@seanmozeik/tripwire 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tripwire-cli.js +1 -1
- package/dist/tripwire-cli.js.jsc +0 -0
- package/dist/tripwire.js +47 -47
- package/dist/tripwire.js.jsc +0 -0
- package/package.json +1 -1
- package/src/lib/bash.ts +232 -0
package/dist/tripwire.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun @bytecode @bun-cjs
|
|
3
|
-
(function(exports, require, module, __filename, __dirname) {var EA=Object.create;var{getPrototypeOf:SA,defineProperty:F9,getOwnPropertyNames:PH,getOwnPropertyDescriptor:vA}=Object,RH=Object.prototype.hasOwnProperty;function NH(X){return this[X]}var xA,kA,O=(X,Q,Y)=>{var J=X!=null&&typeof X==="object";if(J){var $=Q?xA??=new WeakMap:kA??=new WeakMap,G=$.get(X);if(G)return G}Y=X!=null?EA(SA(X)):{};let Z=Q||!X||!X.__esModule?F9(Y,"default",{value:X,enumerable:!0}):Y;for(let K of PH(X))if(!RH.call(Z,K))F9(Z,K,{get:NH.bind(X,K),enumerable:!0});if(J)$.set(X,Z);return Z},yA=(X)=>{var Q=(LH??=new WeakMap).get(X),Y;if(Q)return Q;if(Q=F9({},"__esModule",{value:!0}),X&&typeof X==="object"||typeof X==="function"){for(var J of PH(X))if(!RH.call(Q,J))F9(Q,J,{get:NH.bind(X,J),enumerable:!(Y=vA(X,J))||Y.enumerable})}return LH.set(X,Q),Q},LH,Q3=(X,Q)=>()=>(Q||X((Q={exports:{}}).exports,Q),Q.exports);var bA=(X)=>X;function gA(X,Q){this[X]=bA.bind(null,Q)}var J6=(X,Q)=>{for(var Y in Q)F9(X,Y,{get:Q[Y],enumerable:!0,configurable:!0,set:gA.bind(Q,Y)})};var CM=Q3((u40,wM)=>{wM.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 xM=Q3((l40,vM)=>{var SM="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",TM=new RegExp("^"+SM+"$"),IM="|&;()<> \\t",jr='"((\\\\"|[^"])*?)"',Er="'((\\\\'|[^'])*?)'",Sr=/^#$/,jM="'",EM='"',ZH="$",J5="",vr=4294967296;for(s2=0;s2<4;s2++)J5+=(vr*Math.random()).toString(16);var s2,xr=new RegExp("^"+J5);function kr(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 yr(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+J5+JSON.stringify(J)+J5;return Q+J}function br(X,Q,Y){if(!Y)Y={};var J=Y.escape||"\\",$="(\\"+J+`['"`+IM+`]|[^\\s'"`+IM+"])+",G=new RegExp(["("+SM+")","("+$+"|"+jr+"|"+Er+")+"].join("|"),"g"),Z=kr(X,G);if(Z.length===0)return[];if(!Q)Q={};var K=!1;return Z.map(function(H){var W=H[0];if(!W||K)return;if(TM.test(W))return{op:W};var V=!1,_=!1,D="",q=!1,U;function R(){U+=1;var P,y,Y0=W.charAt(U);if(Y0==="{"){if(U+=1,W.charAt(U)==="}")throw Error("Bad substitution: "+W.slice(U-2,U+1));if(P=W.indexOf("}",U),P<0)throw Error("Bad substitution: "+W.slice(U));y=W.slice(U,P),U=P}else if(/[*@#?$!_-]/.test(Y0))y=Y0,U+=1;else{var X8=W.slice(U);if(P=X8.match(/[^\w\d_]/),!P)y=X8,U=W.length;else y=X8.slice(0,P.index),U+=P.index-1}return yr(Q,"",y)}for(U=0;U<W.length;U++){var L=W.charAt(U);if(q=q||!V&&(L==="*"||L==="?"),_)D+=L,_=!1;else if(V)if(L===V)V=!1;else if(V==jM)D+=L;else if(L===J)if(U+=1,L=W.charAt(U),L===EM||L===J||L===ZH)D+=L;else D+=J+L;else if(L===ZH)D+=R();else D+=L;else if(L===EM||L===jM)V=L;else if(TM.test(L))return{op:W};else if(Sr.test(L)){K=!0;var N={comment:X.slice(H.index+U+1)};if(D.length)return[D,N];return[N]}else if(L===J)_=!0;else if(L===ZH)D+=R();else D+=L}if(q)return{op:"glob",pattern:D};return D}).reduce(function(H,W){return typeof W>"u"?H:H.concat(W)},[])}vM.exports=function(Q,Y,J){var $=br(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("("+J5+".*?"+J5+")","g"));if(K.length===1)return G.concat(K[0]);return G.concat(K.filter(Boolean).map(function(H){if(xr.test(H))return JSON.parse(H.split(J5)[1]);return H}))},[])}});var kM=Q3((KH)=>{KH.quote=CM();KH.parse=xM()});var Bn={};J6(Bn,{runRulesSync:()=>OH,runRules:()=>Wn,normalizeToolName:()=>FH,decide:()=>zH,collectPreToolUseRules:()=>TA,collectPostToolUseRules:()=>IA});module.exports=yA(Bn);var XY={};J6(XY,{runMain:()=>Iv});var k1={};J6(k1,{squash:()=>T6,reasonAnnotations:()=>ET,prettyErrors:()=>WT,pretty:()=>Y$,map:()=>sC,makeInterruptReason:()=>HX,makeFailReason:()=>ZX,makeDieReason:()=>KX,isUnknownError:()=>TT,isTimeoutError:()=>OT,isReason:()=>Q$,isNoSuchElementError:()=>_T,isInterruptReason:()=>rC,isIllegalArgumentError:()=>LT,isFailReason:()=>uC,isExceededCapacityError:()=>PT,isDone:()=>m7,isDieReason:()=>lC,isCause:()=>X$,isAsyncFiberError:()=>AT,interruptors:()=>KT,interrupt:()=>aC,hasInterruptsOnly:()=>h7,hasInterrupts:()=>GT,hasFails:()=>eC,hasDies:()=>YT,fromReasons:()=>GX,findInterrupt:()=>ZT,findFail:()=>XT,findErrorOption:()=>QT,findError:()=>S8,findDie:()=>JT,findDefect:()=>$T,filterInterruptors:()=>HT,fail:()=>nC,empty:()=>oC,done:()=>d7,die:()=>iC,combine:()=>tC,annotations:()=>ST,annotate:()=>jT,UnknownErrorTypeId:()=>CT,UnknownError:()=>IT,TypeId:()=>cC,TimeoutErrorTypeId:()=>UT,TimeoutError:()=>zT,StackTrace:()=>ED,ReasonTypeId:()=>fC,NoSuchElementErrorTypeId:()=>VT,NoSuchElementError:()=>DT,InterruptorStackTrace:()=>SD,IllegalArgumentErrorTypeId:()=>FT,IllegalArgumentError:()=>WX,ExceededCapacityErrorTypeId:()=>RT,ExceededCapacityError:()=>NT,DoneTypeId:()=>qT,Done:()=>BT,AsyncFiberErrorTypeId:()=>MT,AsyncFiberError:()=>wT});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}}},hA={pipe(){return a(this,arguments)}},$6=function(){function X(){}return X.prototype=hA,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,P4=i0(!0),IQ=i0(!1),Y3=i0(null),A8=i0(void 0),G5=A8;function J3(X,...Q){return a(X,Q)}function MH(X,Q,Y,J,$,G,Z,K,H){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 H(K(Z(G($(J(Y(Q(X.apply(this,arguments)))))))))}}return}function p0(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 P9=(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},Z5=new WeakSet;function Q8(X){return typeof X==="string"}function R9(X){return typeof X==="number"}function AH(X){return typeof X==="boolean"}function wH(X){return typeof X==="bigint"}function $3(X){return typeof X==="symbol"}function jQ(X){return Q8(X)||R9(X)||$3(X)}function Y8(X){return typeof X==="function"}function CH(X){return X===void 0}function $1(X){return X!==void 0}function EQ(X){return X!=null}function TH(X){return!1}function G3(X){return!0}function f1(X){return typeof X==="object"&&X!==null&&!Array.isArray(X)}function Z3(X){return typeof X==="object"&&X!==null||Y8(X)}var M=B(2,(X,Q)=>Z3(X)&&(Q in X)),G6=B(2,(X,Q)=>M(X,"_tag")&&X._tag===Q);function p8(X){return M(X,Symbol.iterator)||Q8(X)}var H0="~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(Z5.has(X))return SQ(X);if(H3.has(X))return H3.get(X);let Q=cA(X,()=>{if(mA(X))return X[H0]();else if(typeof X==="function")return SQ(X);else if(Array.isArray(X)||ArrayBuffer.isView(X))return N9(X);else if(X instanceof Map)return dA(X);else if(X instanceof Set)return pA(X);return V3(X)});return H3.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(!K3.has(X))K3.set(X,c8(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)));return K3.get(X)},f0=B(2,(X,Q)=>X*53^Q),vQ=(X)=>X&3221225471|X>>>1&1073741824,mA=(X)=>M(X,H0),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)},_3=(X,Q)=>{let Y=12289;for(let J of Q)Y^=f0(s(J),s(X[J]));return vQ(Y)},V3=(X)=>_3(X,P9(X)),D3=(X,Q)=>(Y)=>{let J=X;for(let $ of Y)J^=Q($);return vQ(J)},N9=D3(6151,s),dA=D3(C0("Map"),([X,Q])=>f0(s(X),s(Q))),pA=D3(C0("Set"),s),K3=new WeakMap,H3=new WeakMap,W3=new WeakSet;function cA(X,Q){if(W3.has(X))return C0("[Circular]");W3.add(X);let Y=Q();return W3.delete(X),Y}var W0="~effect/interfaces/Equal";function o(){if(arguments.length===1)return(X)=>Z6(X,arguments[0]);return Z6(arguments[0],arguments[1])}function Z6(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(Z5.has(X)||Z5.has(Q))return!1;return lA(X,Q,uA)}function fA(X,Q,Y){let J=q3.has(X),$=B3.has(Q);if(J&&$)return!0;if(J||$)return!1;q3.add(X),B3.add(Q);let G=Y();return q3.delete(X),B3.delete(Q),G}var q3=new WeakSet,B3=new WeakSet;function uA(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=IH(X),J=IH(Q);if(Y!==J)return!1;let $=Y&&J;if(typeof X==="function"&&!$)return!1;return fA(X,Q,()=>{if($)return X[W0](Q);else if(Array.isArray(X)){if(!Array.isArray(Q)||X.length!==Q.length)return!1;return rA(X,Q)}else if(ArrayBuffer.isView(X)){if(!ArrayBuffer.isView(Q)||X.byteLength!==Q.byteLength)return!1;return oA(X,Q)}else if(X instanceof Map){if(!(Q instanceof Map)||X.size!==Q.size)return!1;return iA(X,Q)}else if(X instanceof Set){if(!(Q instanceof Set)||X.size!==Q.size)return!1;return aA(X,Q)}return nA(X,Q)})}function lA(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 rA(X,Q){for(let Y=0;Y<X.length;Y++)if(!Z6(X[Y],Q[Y]))return!1;return!0}function oA(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 nA(X,Q){let Y=P9(X),J=P9(Q);if(Y.size!==J.size)return!1;for(let $ of Y)if(!J.has($)||!Z6(X[$],Q[$]))return!1;return!0}function kQ(X,Q){return function(J,$){for(let[G,Z]of J){let K=!1;for(let[H,W]of $)if(X(G,H)&&Q(Z,W)){K=!0;break}if(!K)return!1}return!0}}var iA=kQ(Z6,Z6);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 aA=yQ(Z6),IH=(X)=>M(X,W0),bQ=()=>o;var jH=(X)=>{return Z5.add(X),X};var gQ=Symbol.for("~effect/Redactable"),sA=(X)=>M(X,gQ);function M9(X){if(sA(X))return U3(X);return X}function U3(X){return X[gQ](globalThis[K5]?.context??tA)}var K5="~effect/Fiber/currentFiber",tA={"~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=(W)=>$.repeat(W),Z=(W,V)=>{let _=W?.constructor;return _&&_!==Object.prototype.constructor&&_.name?`${_.name}(${V})`:V},K=(W)=>{try{return Reflect.ownKeys(W)}catch{return["[ownKeys threw]"]}};function H(W,V=0){if(Array.isArray(W)){if(J.has(W))return EH;if(J.add(W),!$||W.length<=1)return`[${W.map((D)=>H(D,V)).join(",")}]`;let _=W.map((D)=>H(D,V+1)).join(`,
|
|
3
|
+
(function(exports, require, module, __filename, __dirname) {var yA=Object.create;var{getPrototypeOf:bA,defineProperty:L9,getOwnPropertyNames:RH,getOwnPropertyDescriptor:gA}=Object,NH=Object.prototype.hasOwnProperty;function MH(X){return this[X]}var hA,mA,O=(X,Q,Y)=>{var J=X!=null&&typeof X==="object";if(J){var $=Q?hA??=new WeakMap:mA??=new WeakMap,G=$.get(X);if(G)return G}Y=X!=null?yA(bA(X)):{};let Z=Q||!X||!X.__esModule?L9(Y,"default",{value:X,enumerable:!0}):Y;for(let K of RH(X))if(!NH.call(Z,K))L9(Z,K,{get:MH.bind(X,K),enumerable:!0});if(J)$.set(X,Z);return Z},dA=(X)=>{var Q=(PH??=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 RH(X))if(!NH.call(Q,J))L9(Q,J,{get:MH.bind(X,J),enumerable:!(Y=gA(X,J))||Y.enumerable})}return PH.set(X,Q),Q},PH,Y3=(X,Q)=>()=>(Q||X((Q={exports:{}}).exports,Q),Q.exports);var pA=(X)=>X;function cA(X,Q){this[X]=pA.bind(null,Q)}var J6=(X,Q)=>{for(var Y in Q)L9(X,Y,{get:Q[Y],enumerable:!0,configurable:!0,set:cA.bind(Q,Y)})};var TM=Y3((Q60,CM)=>{CM.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 kM=Y3((Y60,xM)=>{var vM="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",IM=new RegExp("^"+vM+"$"),jM="|&;()<> \\t",kr='"((\\\\"|[^"])*?)"',yr="'((\\\\'|[^'])*?)'",br=/^#$/,EM="'",SM='"',KH="$",J5="",gr=4294967296;for(s2=0;s2<4;s2++)J5+=(gr*Math.random()).toString(16);var s2,hr=new RegExp("^"+J5);function mr(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 dr(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+J5+JSON.stringify(J)+J5;return Q+J}function pr(X,Q,Y){if(!Y)Y={};var J=Y.escape||"\\",$="(\\"+J+`['"`+jM+`]|[^\\s'"`+jM+"])+",G=new RegExp(["("+vM+")","("+$+"|"+kr+"|"+yr+")+"].join("|"),"g"),Z=mr(X,G);if(Z.length===0)return[];if(!Q)Q={};var K=!1;return Z.map(function(H){var W=H[0];if(!W||K)return;if(IM.test(W))return{op:W};var V=!1,_=!1,q="",D=!1,U;function R(){U+=1;var P,y,Y0=W.charAt(U);if(Y0==="{"){if(U+=1,W.charAt(U)==="}")throw Error("Bad substitution: "+W.slice(U-2,U+1));if(P=W.indexOf("}",U),P<0)throw Error("Bad substitution: "+W.slice(U));y=W.slice(U,P),U=P}else if(/[*@#?$!_-]/.test(Y0))y=Y0,U+=1;else{var X8=W.slice(U);if(P=X8.match(/[^\w\d_]/),!P)y=X8,U=W.length;else y=X8.slice(0,P.index),U+=P.index-1}return dr(Q,"",y)}for(U=0;U<W.length;U++){var L=W.charAt(U);if(D=D||!V&&(L==="*"||L==="?"),_)q+=L,_=!1;else if(V)if(L===V)V=!1;else if(V==EM)q+=L;else if(L===J)if(U+=1,L=W.charAt(U),L===SM||L===J||L===KH)q+=L;else q+=J+L;else if(L===KH)q+=R();else q+=L;else if(L===SM||L===EM)V=L;else if(IM.test(L))return{op:W};else if(br.test(L)){K=!0;var N={comment:X.slice(H.index+U+1)};if(q.length)return[q,N];return[N]}else if(L===J)_=!0;else if(L===KH)q+=R();else q+=L}if(D)return{op:"glob",pattern:q};return q}).reduce(function(H,W){return typeof W>"u"?H:H.concat(W)},[])}xM.exports=function(Q,Y,J){var $=pr(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("("+J5+".*?"+J5+")","g"));if(K.length===1)return G.concat(K[0]);return G.concat(K.filter(Boolean).map(function(H){if(hr.test(H))return JSON.parse(H.split(J5)[1]);return H}))},[])}});var yM=Y3((HH)=>{HH.quote=TM();HH.parse=kM()});var wn={};J6(wn,{runRulesSync:()=>zH,runRules:()=>Pn,normalizeToolName:()=>LH,decide:()=>FH,collectPreToolUseRules:()=>vA,collectPostToolUseRules:()=>xA});module.exports=dA(wn);var XY={};J6(XY,{runMain:()=>xv});var k1={};J6(k1,{squash:()=>T6,reasonAnnotations:()=>yT,prettyErrors:()=>BT,pretty:()=>J$,map:()=>YT,makeInterruptReason:()=>WX,makeFailReason:()=>KX,makeDieReason:()=>HX,isUnknownError:()=>vT,isTimeoutError:()=>RT,isReason:()=>Y$,isNoSuchElementError:()=>UT,isInterruptReason:()=>sC,isIllegalArgumentError:()=>AT,isFailReason:()=>iC,isExceededCapacityError:()=>wT,isDone:()=>m7,isDieReason:()=>aC,isCause:()=>Q$,isAsyncFiberError:()=>jT,interruptors:()=>qT,interrupt:()=>QT,hasInterruptsOnly:()=>h7,hasInterrupts:()=>_T,hasFails:()=>$T,hasDies:()=>KT,fromReasons:()=>ZX,findInterrupt:()=>VT,findFail:()=>GT,findErrorOption:()=>ZT,findError:()=>S8,findDie:()=>HT,findDefect:()=>WT,filterInterruptors:()=>DT,fail:()=>eC,empty:()=>tC,done:()=>d7,die:()=>XT,combine:()=>JT,annotations:()=>bT,annotate:()=>kT,UnknownErrorTypeId:()=>ST,UnknownError:()=>xT,TypeId:()=>oC,TimeoutErrorTypeId:()=>PT,TimeoutError:()=>NT,StackTrace:()=>Sq,ReasonTypeId:()=>nC,NoSuchElementErrorTypeId:()=>OT,NoSuchElementError:()=>zT,InterruptorStackTrace:()=>vq,IllegalArgumentErrorTypeId:()=>MT,IllegalArgumentError:()=>_X,ExceededCapacityErrorTypeId:()=>CT,ExceededCapacityError:()=>TT,DoneTypeId:()=>FT,Done:()=>LT,AsyncFiberErrorTypeId:()=>IT,AsyncFiberError:()=>ET});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}}},fA={pipe(){return a(this,arguments)}},$6=function(){function X(){}return X.prototype=fA,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,P4=i0(!0),IQ=i0(!1),J3=i0(null),A8=i0(void 0),G5=A8;function $3(X,...Q){return a(X,Q)}function AH(X,Q,Y,J,$,G,Z,K,H){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 H(K(Z(G($(J(Y(Q(X.apply(this,arguments)))))))))}}return}function p0(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},Z5=new WeakSet;function Q8(X){return typeof X==="string"}function N9(X){return typeof X==="number"}function wH(X){return typeof X==="boolean"}function CH(X){return typeof X==="bigint"}function G3(X){return typeof X==="symbol"}function jQ(X){return Q8(X)||N9(X)||G3(X)}function Y8(X){return typeof X==="function"}function TH(X){return X===void 0}function $1(X){return X!==void 0}function EQ(X){return X!=null}function IH(X){return!1}function Z3(X){return!0}function f1(X){return typeof X==="object"&&X!==null&&!Array.isArray(X)}function K3(X){return typeof X==="object"&&X!==null||Y8(X)}var M=B(2,(X,Q)=>K3(X)&&(Q in X)),G6=B(2,(X,Q)=>M(X,"_tag")&&X._tag===Q);function p8(X){return M(X,Symbol.iterator)||Q8(X)}var H0="~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(Z5.has(X))return SQ(X);if(W3.has(X))return W3.get(X);let Q=oA(X,()=>{if(uA(X))return X[H0]();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 lA(X);else if(X instanceof Set)return rA(X);return q3(X)});return W3.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,uA=(X)=>M(X,H0),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)},V3=(X,Q)=>{let Y=12289;for(let J of Q)Y^=f0(s(J),s(X[J]));return vQ(Y)},q3=(X)=>V3(X,R9(X)),D3=(X,Q)=>(Y)=>{let J=X;for(let $ of Y)J^=Q($);return vQ(J)},M9=D3(6151,s),lA=D3(C0("Map"),([X,Q])=>f0(s(X),s(Q))),rA=D3(C0("Set"),s),H3=new WeakMap,W3=new WeakMap,_3=new WeakSet;function oA(X,Q){if(_3.has(X))return C0("[Circular]");_3.add(X);let Y=Q();return _3.delete(X),Y}var W0="~effect/interfaces/Equal";function o(){if(arguments.length===1)return(X)=>Z6(X,arguments[0]);return Z6(arguments[0],arguments[1])}function Z6(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(Z5.has(X)||Z5.has(Q))return!1;return aA(X,Q,iA)}function nA(X,Q,Y){let J=B3.has(X),$=U3.has(Q);if(J&&$)return!0;if(J||$)return!1;B3.add(X),U3.add(Q);let G=Y();return B3.delete(X),U3.delete(Q),G}var B3=new WeakSet,U3=new WeakSet;function iA(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=jH(X),J=jH(Q);if(Y!==J)return!1;let $=Y&&J;if(typeof X==="function"&&!$)return!1;return nA(X,Q,()=>{if($)return X[W0](Q);else if(Array.isArray(X)){if(!Array.isArray(Q)||X.length!==Q.length)return!1;return sA(X,Q)}else if(ArrayBuffer.isView(X)){if(!ArrayBuffer.isView(Q)||X.byteLength!==Q.byteLength)return!1;return tA(X,Q)}else if(X instanceof Map){if(!(Q instanceof Map)||X.size!==Q.size)return!1;return Xw(X,Q)}else if(X instanceof Set){if(!(Q instanceof Set)||X.size!==Q.size)return!1;return Qw(X,Q)}return eA(X,Q)})}function aA(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 sA(X,Q){for(let Y=0;Y<X.length;Y++)if(!Z6(X[Y],Q[Y]))return!1;return!0}function tA(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 eA(X,Q){let Y=R9(X),J=R9(Q);if(Y.size!==J.size)return!1;for(let $ of Y)if(!J.has($)||!Z6(X[$],Q[$]))return!1;return!0}function kQ(X,Q){return function(J,$){for(let[G,Z]of J){let K=!1;for(let[H,W]of $)if(X(G,H)&&Q(Z,W)){K=!0;break}if(!K)return!1}return!0}}var Xw=kQ(Z6,Z6);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 Qw=yQ(Z6),jH=(X)=>M(X,W0),bQ=()=>o;var EH=(X)=>{return Z5.add(X),X};var gQ=Symbol.for("~effect/Redactable"),Yw=(X)=>M(X,gQ);function A9(X){if(Yw(X))return O3(X);return X}function O3(X){return X[gQ](globalThis[K5]?.context??Jw)}var K5="~effect/Fiber/currentFiber",Jw={"~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=(W)=>$.repeat(W),Z=(W,V)=>{let _=W?.constructor;return _&&_!==Object.prototype.constructor&&_.name?`${_.name}(${V})`:V},K=(W)=>{try{return Reflect.ownKeys(W)}catch{return["[ownKeys threw]"]}};function H(W,V=0){if(Array.isArray(W)){if(J.has(W))return SH;if(J.add(W),!$||W.length<=1)return`[${W.map((q)=>H(q,V)).join(",")}]`;let _=W.map((q)=>H(q,V+1)).join(`,
|
|
4
4
|
`+G(V+1));return`[
|
|
5
5
|
${G(V+1)}${_}
|
|
6
|
-
${G(V)}]`}if(W instanceof Date)return
|
|
7
|
-
${_.map((
|
|
6
|
+
${G(V)}]`}if(W instanceof Date)return z3(W);if(!Q?.ignoreToString&&M(W,"toString")&&typeof W.toString==="function"&&W.toString!==Object.prototype.toString&&W.toString!==Array.prototype.toString){let _=$w(W);if(W instanceof Error&&W.cause)return`${_} (cause: ${H(W.cause,V)})`;return _}if(typeof W==="string")return JSON.stringify(W);if(typeof W==="number"||W==null||typeof W==="boolean"||typeof W==="symbol")return String(W);if(typeof W==="bigint")return String(W)+"n";if(typeof W==="object"||typeof W==="function"){if(J.has(W))return SH;if(J.add(W),gQ in W)return g(O3(W));if(Symbol.iterator in W)return`${W.constructor.name}(${H(Array.from(W),V)})`;let _=K(W);if(!$||_.length<=1){let D=`{${_.map((U)=>`${R4(U)}:${H(W[U],V)}`).join(",")}}`;return Z(W,D)}let q=`{
|
|
7
|
+
${_.map((D)=>`${G(V+1)}${R4(D)}: ${H(W[D],V+1)}`).join(`,
|
|
8
8
|
`)}
|
|
9
|
-
${G(V)}}`;return Z(W,D)}return String(W)}return H(X,0)}var EH="[Circular]";function R4(X){return typeof X==="string"?JSON.stringify(X):String(X)}function hQ(X){return X.map((Q)=>`[${R4(Q)}]`).join("")}function O3(X){try{return X.toISOString()}catch{return"Invalid Date"}}function eA(X){try{let Q=X.toString();return typeof Q==="string"?Q:String(Q)}catch{return"[toString threw]"}}function A9(X,Q){let Y=[];return JSON.stringify(X,function(J,$){let G=M9($);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 M9(X)},SH=(X,Q=2)=>{if(typeof X==="string")return X;try{return typeof X==="object"?A9(X,{space:Q}):String(X)}catch{return String(X)}},vn={toJSON(){return G1(this)},[a0](){return this.toJSON()},toString(){return g(this.toJSON())}};class K6{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 K6(this.self)}}var H5="~effect/Utils/internal",vH={[H5]:(X)=>{return X()}},Qw={[H5]:(X)=>{try{return X()}finally{}}},Yw=vH[H5](()=>Error().stack)?.includes(H5)===!0,J0=Yw?vH[H5]:Qw[H5];var f8="~effect/Effect",H6="~effect/Exit",Jw={_A:b,_E:b,_R:b},kH=`${f8}/identifier`,t=`${f8}/args`,u0=`${f8}/evaluate`,R1=`${f8}/successCont`,J8=`${f8}/failureCont`,N4=`${f8}/ensureCont`,M4=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()}},yH={[H0](){return _3(this,Object.keys(this))},[W0](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 K6(this)}},$w={..._6,pipe(){return a(this,arguments)}},Gw={[f8]:Jw,...w8,[Symbol.iterator](){return new K6(this)},asEffect(){return this},toJSON(){return{_id:"Effect",op:this[kH],...t in this?{args:this[t]}:void 0}}},p=(X)=>M(X,f8),z3=(X)=>M(X,H6),W5="~effect/Cause",_5="~effect/Cause/Reason",V5=(X)=>M(X,W5),bH=(X)=>M(X,_5);class u8{[W5];reasons;constructor(X){this[W5]=W5,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()}[W0](X){return V5(X)&&this.reasons.length===X.reasons.length&&this.reasons.every((Q,Y)=>o(Q,X.reasons[Y]))}[H0](){return N9(this.reasons)}}var xH=new WeakMap;class C9{[_5];annotations;_tag;constructor(X,Q,Y){if(this[_5]=_5,this._tag=X,Q!==T9&&typeof Y==="object"&&Y!==null&&Q.size>0){let J=xH.get(Y);if(J)Q=new Map([...J,...Q]);xH.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 T9=new Map;class D5 extends C9{error;constructor(X,Q=T9){super("Fail",Q,X);this.error=X}toString(){return`Fail(${g(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[W0](X){return A4(X)&&o(this.error,X.error)&&o(this.annotations,X.annotations)}[H0](){return f0(C0(this._tag))(f0(s(this.error))(s(this.annotations)))}}var l8=(X)=>new u8(X),mQ=new u8([]),F3=(X)=>new u8([new D5(X)]);class dQ extends C9{defect;constructor(X,Q=T9){super("Die",Q,X);this.defect=X}toString(){return`Die(${g(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[W0](X){return V6(X)&&o(this.defect,X.defect)&&o(this.annotations,X.annotations)}[H0](){return f0(C0(this._tag))(f0(s(this.defect))(s(this.annotations)))}}var L3=(X)=>new u8([new dQ(X)]),q5=B((X)=>V5(X[0]),(X,Q,Y)=>{if(Q.mapUnsafe.size===0)return X;return new u8(X.reasons.map((J)=>J.annotate(Q,Y)))}),A4=(X)=>X._tag==="Fail",V6=(X)=>X._tag==="Die",D6=(X)=>X._tag==="Interrupt";function Zw(X){return C8("Effect.evaluate: Not implemented")}var B5=(X)=>({...Gw,[kH]:X.op,[u0]:X[u0]??Zw,[R1]:X[R1],[J8]:X[J8],[N4]:X[N4]}),u1=(X)=>{let Q=B5(X);return function(){let Y=Object.create(Q);return Y[t]=X.single===!1?arguments:arguments[0],Y}},gH=(X)=>{let Q={...B5(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]}},[W0](Y){return z3(Y)&&Y._tag===this._tag&&o(this[t],Y[t])},[H0](){return f0(C0(X.op),s(this[t]))}};return function(Y){let J=Object.create(Q);return J[t]=Y,J}},j0=gH({op:"Success",prop:"value",[u0](X){let Q=X.getCont(R1);return Q?Q[R1](this[t],X,this):X.yieldWith(this)}}),I9={key:"effect/Cause/StackTrace"},hH={key:"effect/Cause/InterruptorStackTrace"},N1=gH({op:"Failure",prop:"cause",[u0](X){let Q=this[t],Y=!1;if(X.currentStackFrame)Q=q5(Q,{mapUnsafe:new Map([[I9.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(F3(X)),C8=(X)=>N1(L3(X)),c=u1({op:"WithFiber",[u0](X){return this[t](X)}}),Kw=function(){class X extends globalThis.Error{asEffect(){return M1(this)}}return Object.assign(X.prototype,$w),X}(),pQ=function(){let X=Symbol.for("effect/Data/Error/plainArgs");return class extends Kw{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 pQ{_tag=X}return Q.prototype.name=X,Q},w9="~effect/Cause/NoSuchElementError",cQ=(X)=>M(X,w9);class $8 extends r8("NoSuchElementError"){[w9]=w9;constructor(X){super({message:X})}}var W6="~effect/Cause/Done",j9=(X)=>M(X,W6),mH={[W6]:W6,_tag:"Done",value:void 0},P3=(X)=>{if(X===void 0)return mH;return{[W6]:W6,_tag:"Done",value:X}},Hw=M1(mH),dH=(X)=>{if(X===void 0)return Hw;return M1(P3(X))};function pH(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 cH(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 fH=(X)=>B(3,(Q,Y,J)=>X(Q,($)=>({...$,[Y]:J($)}))),uH=(X)=>B(2,(Q,Y)=>X(Q,(J)=>({[Y]:J}))),lH=(X,Q)=>B(3,(Y,J,$)=>Q(Y,(G)=>X($(G),(Z)=>({...G,[J]:Z}))));var rH="~effect/data/Option",oH={[rH]:{_A:(X)=>X},...w8,..._6},nH=Object.assign(Object.create(oH),{_tag:"Some",_op:"Some",[W0](X){return uQ(X)&&N3(X)&&o(this.value,X.value)},[H0](){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(nH,"valueOrUndefined",{get(){return this.value}});var Vw=s("None"),Dw=Object.assign(Object.create(oH),{_tag:"None",_op:"None",valueOrUndefined:void 0,[W0](X){return uQ(X)&&R3(X)},[H0](){return Vw},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}},asEffect(){return M1(new $8)}}),uQ=(X)=>M(X,rH),R3=(X)=>X._tag==="None",N3=(X)=>X._tag==="Some",iH=Object.create(Dw),aH=(X)=>{let Q=Object.create(nH);return Q.value=X,Q};var sH="~effect/data/Result",tH={[sH]:{_A:(X)=>X,_E:(X)=>X},...w8,..._6},Bw=Object.assign(Object.create(tH),{_tag:"Success",_op:"Success",[W0](X){return lQ(X)&&A3(X)&&o(this.success,X.success)},[H0](){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)}}),Uw=Object.assign(Object.create(tH),{_tag:"Failure",_op:"Failure",[W0](X){return lQ(X)&&M3(X)&&o(this.failure,X.failure)},[H0](){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,sH),M3=(X)=>X._tag==="Failure",A3=(X)=>X._tag==="Success",eH=(X)=>{let Q=Object.create(Uw);return Q.failure=X,Q},XW=(X)=>{let Q=Object.create(Bw);return Q.success=X,Q};function E9(X){return(Q,Y)=>Q===Y?0:X(Q,Y)}var q1=E9((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=E9((X,Q)=>X<Q?-1:1);var w3=B(2,(X,Q)=>E9((Y,J)=>X(Q(Y),Q(J)))),U5=w3(q1,(X)=>X.getTime());var rQ=(X)=>B(2,(Q,Y)=>X(Q,Y)===-1),O5=(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=()=>iH,F=aH,QW=uQ,T0=R3,B1=N3,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 YW=(X)=>X==null?x():F(X),JW=(X)=>X===void 0?x():F(X),$W=(X)=>X===null?x():F(X);var C3=aQ(Y3),q6=aQ(A8),B6=(X)=>(...Q)=>{try{return F(X(...Q))}catch{return x()}};var T4=B(2,(X,Q)=>T0(X)?x():F(Q(X.value)));var zw=B(2,(X,Q)=>T0(X)?x():Q(X.value));var z5=zw(b);var F5=B(2,(X,Q)=>T0(X)?x():Q(X.value)?F(X.value):x()),GW=(X)=>s0((Q,Y)=>T0(Q)?T0(Y):T0(Y)?!1:X(Q.value,Y.value));var ZW="~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,Fw),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}},Fw={[ZW]:ZW,...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",KW="~effect/Context",I4=(X)=>{let Q=Object.create(Lw);return Q.mapUnsafe=X,Q.mutable=!1,Q},Lw={...w8,[KW]:{_Services:(X)=>X},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([X,Q])=>({key:X,value:Q}))}},[W0](X){if(!I3(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},[H0](){return c8(this.mapUnsafe.size)}},I3=(X)=>M(X,KW);var HW=(X)=>M(X,sQ),Z8=()=>Pw,Pw=I4(new Map),tQ=(X,Q)=>I4(new Map([[X.key,Q]])),K8=B(3,(X,Q,Y)=>qW(X,(J)=>{J.set(Q.key,Y)}));var WW=B(3,(X,Q,Y)=>{if(X.mapUnsafe.has(Q.key))return X.mapUnsafe.get(Q.key);return HW(Q)?eQ(Q):Y()});var U6=B(2,(X,Q)=>{if(!X.mapUnsafe.has(Q.key)){if(sQ in Q)return eQ(Q);throw Rw(Q)}return X.mapUnsafe.get(Q.key)}),E1=U6,_W=(X,Q)=>{if(!X.mapUnsafe.has(Q.key))return eQ(Q);return X.mapUnsafe.get(Q.key)},T3="~effect/Context/defaultValue",eQ=(X)=>{if(T3 in X)return X[T3];return X[T3]=X.defaultValue()},Rw=(X)=>{let Q=Error(`Service not found${X.key?`: ${String(X.key)}`:""}`);if(X.stack){let Y=X.stack.split(`
|
|
9
|
+
${G(V)}}`;return Z(W,q)}return String(W)}return H(X,0)}var SH="[Circular]";function R4(X){return typeof X==="string"?JSON.stringify(X):String(X)}function hQ(X){return X.map((Q)=>`[${R4(Q)}]`).join("")}function z3(X){try{return X.toISOString()}catch{return"Invalid Date"}}function $w(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)},vH=(X,Q=2)=>{if(typeof X==="string")return X;try{return typeof X==="object"?w9(X,{space:Q}):String(X)}catch{return String(X)}},fn={toJSON(){return G1(this)},[a0](){return this.toJSON()},toString(){return g(this.toJSON())}};class K6{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 K6(this.self)}}var H5="~effect/Utils/internal",xH={[H5]:(X)=>{return X()}},Zw={[H5]:(X)=>{try{return X()}finally{}}},Kw=xH[H5](()=>Error().stack)?.includes(H5)===!0,J0=Kw?xH[H5]:Zw[H5];var f8="~effect/Effect",H6="~effect/Exit",Hw={_A:b,_E:b,_R:b},yH=`${f8}/identifier`,t=`${f8}/args`,u0=`${f8}/evaluate`,R1=`${f8}/successCont`,J8=`${f8}/failureCont`,N4=`${f8}/ensureCont`,M4=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()}},bH={[H0](){return V3(this,Object.keys(this))},[W0](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 K6(this)}},Ww={..._6,pipe(){return a(this,arguments)}},_w={[f8]:Hw,...w8,[Symbol.iterator](){return new K6(this)},asEffect(){return this},toJSON(){return{_id:"Effect",op:this[yH],...t in this?{args:this[t]}:void 0}}},p=(X)=>M(X,f8),F3=(X)=>M(X,H6),W5="~effect/Cause",_5="~effect/Cause/Reason",V5=(X)=>M(X,W5),gH=(X)=>M(X,_5);class u8{[W5];reasons;constructor(X){this[W5]=W5,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()}[W0](X){return V5(X)&&this.reasons.length===X.reasons.length&&this.reasons.every((Q,Y)=>o(Q,X.reasons[Y]))}[H0](){return M9(this.reasons)}}var kH=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=kH.get(Y);if(J)Q=new Map([...J,...Q]);kH.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 q5 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}}[W0](X){return A4(X)&&o(this.error,X.error)&&o(this.annotations,X.annotations)}[H0](){return f0(C0(this._tag))(f0(s(this.error))(s(this.annotations)))}}var l8=(X)=>new u8(X),mQ=new u8([]),L3=(X)=>new u8([new q5(X)]);class dQ 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}}[W0](X){return V6(X)&&o(this.defect,X.defect)&&o(this.annotations,X.annotations)}[H0](){return f0(C0(this._tag))(f0(s(this.defect))(s(this.annotations)))}}var P3=(X)=>new u8([new dQ(X)]),D5=B((X)=>V5(X[0]),(X,Q,Y)=>{if(Q.mapUnsafe.size===0)return X;return new u8(X.reasons.map((J)=>J.annotate(Q,Y)))}),A4=(X)=>X._tag==="Fail",V6=(X)=>X._tag==="Die",q6=(X)=>X._tag==="Interrupt";function Vw(X){return C8("Effect.evaluate: Not implemented")}var B5=(X)=>({..._w,[yH]:X.op,[u0]:X[u0]??Vw,[R1]:X[R1],[J8]:X[J8],[N4]:X[N4]}),u1=(X)=>{let Q=B5(X);return function(){let Y=Object.create(Q);return Y[t]=X.single===!1?arguments:arguments[0],Y}},hH=(X)=>{let Q={...B5(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]}},[W0](Y){return F3(Y)&&Y._tag===this._tag&&o(this[t],Y[t])},[H0](){return f0(C0(X.op),s(this[t]))}};return function(Y){let J=Object.create(Q);return J[t]=Y,J}},j0=hH({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"},mH={key:"effect/Cause/InterruptorStackTrace"},N1=hH({op:"Failure",prop:"cause",[u0](X){let Q=this[t],Y=!1;if(X.currentStackFrame)Q=D5(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(L3(X)),C8=(X)=>N1(P3(X)),c=u1({op:"WithFiber",[u0](X){return this[t](X)}}),qw=function(){class X extends globalThis.Error{asEffect(){return M1(this)}}return Object.assign(X.prototype,Ww),X}(),pQ=function(){let X=Symbol.for("effect/Data/Error/plainArgs");return class extends qw{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 pQ{_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 W6="~effect/Cause/Done",E9=(X)=>M(X,W6),dH={[W6]:W6,_tag:"Done",value:void 0},R3=(X)=>{if(X===void 0)return dH;return{[W6]:W6,_tag:"Done",value:X}},Dw=M1(dH),pH=(X)=>{if(X===void 0)return Dw;return M1(R3(X))};function cH(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 fH(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 uH=(X)=>B(3,(Q,Y,J)=>X(Q,($)=>({...$,[Y]:J($)}))),lH=(X)=>B(2,(Q,Y)=>X(Q,(J)=>({[Y]:J}))),rH=(X,Q)=>B(3,(Y,J,$)=>Q(Y,(G)=>X($(G),(Z)=>({...G,[J]:Z}))));var oH="~effect/data/Option",nH={[oH]:{_A:(X)=>X},...w8,..._6},iH=Object.assign(Object.create(nH),{_tag:"Some",_op:"Some",[W0](X){return uQ(X)&&M3(X)&&o(this.value,X.value)},[H0](){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(iH,"valueOrUndefined",{get(){return this.value}});var Ow=s("None"),zw=Object.assign(Object.create(nH),{_tag:"None",_op:"None",valueOrUndefined:void 0,[W0](X){return uQ(X)&&N3(X)},[H0](){return Ow},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}},asEffect(){return M1(new $8)}}),uQ=(X)=>M(X,oH),N3=(X)=>X._tag==="None",M3=(X)=>X._tag==="Some",aH=Object.create(zw),sH=(X)=>{let Q=Object.create(iH);return Q.value=X,Q};var tH="~effect/data/Result",eH={[tH]:{_A:(X)=>X,_E:(X)=>X},...w8,..._6},Lw=Object.assign(Object.create(eH),{_tag:"Success",_op:"Success",[W0](X){return lQ(X)&&w3(X)&&o(this.success,X.success)},[H0](){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)}}),Pw=Object.assign(Object.create(eH),{_tag:"Failure",_op:"Failure",[W0](X){return lQ(X)&&A3(X)&&o(this.failure,X.failure)},[H0](){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,tH),A3=(X)=>X._tag==="Failure",w3=(X)=>X._tag==="Success",XW=(X)=>{let Q=Object.create(Pw);return Q.failure=X,Q},QW=(X)=>{let Q=Object.create(Lw);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 C3=B(2,(X,Q)=>S9((Y,J)=>X(Q(Y),Q(J)))),U5=C3(D1,(X)=>X.getTime());var rQ=(X)=>B(2,(Q,Y)=>X(Q,Y)===-1),O5=(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=()=>aH,F=sH,YW=uQ,T0=N3,B1=M3,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 JW=(X)=>X==null?x():F(X),$W=(X)=>X===void 0?x():F(X),GW=(X)=>X===null?x():F(X);var T3=aQ(J3),D6=aQ(A8),B6=(X)=>(...Q)=>{try{return F(X(...Q))}catch{return x()}};var T4=B(2,(X,Q)=>T0(X)?x():F(Q(X.value)));var Nw=B(2,(X,Q)=>T0(X)?x():Q(X.value));var z5=Nw(b);var F5=B(2,(X,Q)=>T0(X)?x():Q(X.value)?F(X.value):x()),ZW=(X)=>s0((Q,Y)=>T0(Q)?T0(Y):T0(Y)?!1:X(Q.value,Y.value));var KW="~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,Mw),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}},Mw={[KW]:KW,...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",HW="~effect/Context",I4=(X)=>{let Q=Object.create(Aw);return Q.mapUnsafe=X,Q.mutable=!1,Q},Aw={...w8,[HW]:{_Services:(X)=>X},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([X,Q])=>({key:X,value:Q}))}},[W0](X){if(!j3(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},[H0](){return c8(this.mapUnsafe.size)}},j3=(X)=>M(X,HW);var WW=(X)=>M(X,sQ),Z8=()=>ww,ww=I4(new Map),tQ=(X,Q)=>I4(new Map([[X.key,Q]])),K8=B(3,(X,Q,Y)=>BW(X,(J)=>{J.set(Q.key,Y)}));var _W=B(3,(X,Q,Y)=>{if(X.mapUnsafe.has(Q.key))return X.mapUnsafe.get(Q.key);return WW(Q)?eQ(Q):Y()});var U6=B(2,(X,Q)=>{if(!X.mapUnsafe.has(Q.key)){if(sQ in Q)return eQ(Q);throw Cw(Q)}return X.mapUnsafe.get(Q.key)}),E1=U6,VW=(X,Q)=>{if(!X.mapUnsafe.has(Q.key))return eQ(Q);return X.mapUnsafe.get(Q.key)},I3="~effect/Context/defaultValue",eQ=(X)=>{if(I3 in X)return X[I3];return X[I3]=X.defaultValue()},Cw=(X)=>{let Q=Error(`Service not found${X.key?`: ${String(X.key)}`:""}`);if(X.stack){let Y=X.stack.split(`
|
|
10
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
11
|
`);Y.splice(1,3),Q.stack=Y.join(`
|
|
12
|
-
`)}return Q},VW=B(2,(X,Q)=>{if(X.mapUnsafe.has(Q.key))return F(X.mapUnsafe.get(Q.key));return HW(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 qW(X,(Y)=>{Q.mapUnsafe.forEach((J,$)=>Y.set($,J))})}),DW=(...X)=>{let Q=new Map;for(let Y=0;Y<X.length;Y++)X[Y].mapUnsafe.forEach((J,$)=>{Q.set($,J)});return I4(Q)};var qW=(X,Q)=>{if(X.mutable)return Q(X.mapUnsafe),X;let Y=new Map(X.mapUnsafe);return Q(Y),I4(Y)},V0=l1;var j3=(X)=>X.length>0;var l=XW,f=eH;var BW=lQ,u=M3,A1=A3;var UW=(X,Q)=>s0((Y,J)=>u(Y)?u(J)&&Q(Y.failure,J.failure):A1(J)&&X(Y.success,J.success));var S9=B(2,(X,Q)=>u(X)?f(Q(X.failure)):l(X.success)),O6=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 v9=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 Zi={[Symbol.iterator](){return Mw}},Mw={next(){return{done:!0,value:void 0}}};var OW=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 ww=()=>({}),E3=(X)=>Object.keys(X).length===0;var L5=B(2,(X,Q)=>{let Y={...X};for(let J of FW(X))Y[J]=Q(X[J],J);return Y});var zW=B(2,(X,Q)=>{let Y=ww();for(let J of FW(X))if(Q(X[J],J))Y[J]=X[J];return Y});var FW=(X)=>Object.keys(X);var P5=globalThis.Array;var v3=(X)=>new P5(X);var Z1=(X)=>P5.isArray(X)?X:P5.from(X),LW=(X)=>P5.isArray(X)?X:[X];var Y7=B(2,(X,Q)=>[...X,Q]),Cw=B(2,(X,Q)=>Z1(X).concat(Z1(Q)));var _i=P5.isArray;var W8=j3,z6=j3;function Tw(X,Q){return X<0||X>=Q.length}var Iw=B(2,(X,Q)=>{let Y=Math.floor(Q);if(Tw(Y,X))throw Error(`Index out of bounds: ${Y}`);return X[Y]});var jw=Iw(0);var Ew=(X)=>X.slice(1);var x9=B(2,(X,Q)=>{let Y=P5.from(X);return Y.sort(Q),Y});var Sw=B(3,(X,Q,Y)=>{let J=Z1(X),$=Z1(Q);if(z6(J)){if(z6($))return b3(Y)(Cw(J,$));return J}return $}),x3=B(2,(X,Q)=>Sw(X,Q,bQ()));var k3=()=>[];var j4=B(2,(X,Q)=>X.map(Q));var PW=(X)=>{let Q=[];for(let Y of X)if(B1(Y))Q.push(Y.value);return Q};var y3=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 b3=B(2,(X,Q)=>{let Y=Z1(X);if(z6(Y)){let J=[jw(Y)],$=Ew(Y);for(let G of $)if(J.every((Z)=>!Q(G,Z)))J.push(G);return J}return[]});var vw=o8((X,Q)=>X.concat(Q),[]);function RW(){return vw}var J7="~effect/time/Duration",xw=BigInt(0);var AW=BigInt(1000),kw=BigInt(1e6);var yw=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,S1=(X)=>{switch(typeof X){case"number":return E4(X);case"bigint":return a8(X);case"string":{if(X==="Infinity")return i8;if(X==="-Infinity")return F6;let Q=yw.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 mw(BigInt(J));case"milli":case"millis":return E4(G);case"second":case"seconds":return dw(G);case"minute":case"minutes":return pw(G);case"hour":case"hours":return cw(G);case"day":case"days":return fw(G);case"week":case"weeks":return uw(G)}break}case"object":{if(X===null)break;if(J7 in X)return X;if(Array.isArray(X)){if(X.length!==2||!X.every(R9))return NW(X);if(Number.isNaN(X[0])||Number.isNaN(X[1]))return R5;if(X[0]===-1/0||X[1]===-1/0)return F6;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)*kw;if(Q.microseconds)J+=BigInt(Q.microseconds)*AW;if(Q.nanoseconds)J+=BigInt(Q.nanoseconds);return K1(J)}}return NW(X)},NW=(X)=>{throw Error(`Invalid Input: ${X}`)},wW=B6(S1),MW={_tag:"Millis",millis:0},bw={_tag:"Infinity"},gw={_tag:"NegativeInfinity"},hw={[J7]:J7,[H0](){return V3(this.value)},[W0](X){return h3(X)&&rw(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(hw);if(typeof X==="number")if(isNaN(X)||X===0||Object.is(X,-0))Q.value=MW;else if(!Number.isFinite(X))Q.value=X>0?bw:gw;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===xw)Q.value=MW;else Q.value={_tag:"Nanos",nanos:X};return Q},h3=(X)=>M(X,J7);var R5=K1(0),i8=K1(1/0),F6=K1(-1/0),a8=(X)=>K1(X),mw=(X)=>K1(X*AW),E4=(X)=>K1(X),dw=(X)=>K1(X*1000),pw=(X)=>K1(X*60000),cw=(X)=>K1(X*3600000),fw=(X)=>K1(X*86400000),uw=(X)=>K1(X*604800000),S4=(X)=>lw(S1(X),{onMillis:b,onNanos:(Q)=>Number(Q)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var g3=(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))}},CW=B6(g3);var lw=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)()}}),TW=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(g3(X),Q.value.nanos);else return Y.onNanos(X.value.nanos,g3(Q))});var m3=(X,Q)=>TW(X,Q,{onMillis:(Y,J)=>Y===J,onNanos:(Y,J)=>Y===J,onInfinity:(Y,J)=>Y.value._tag===J.value._tag});var IW=B(2,(X,Q)=>TW(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"?R5:i8;if($==="NegativeInfinity")return G==="NegativeInfinity"?R5:F6;return G==="Infinity"?F6:i8}}));var rw=B(2,(X,Q)=>m3(X,Q));var M5=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 $}),jW=(X)=>(Q)=>{let Y=X(Q);return u(Y)?x():F(Y.success)};var k9=V0("effect/Scheduler",{defaultValue:()=>new A5}),SW="setImmediate"in globalThis?(X)=>{let Q=globalThis.setImmediate(X);return()=>globalThis.clearImmediate(Q)}:(X)=>{let Q=setTimeout(X,0);return()=>clearTimeout(Q)};class vW{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 A5{executionMode;setImmediate;constructor(X="async",Q=SW){this.executionMode=X,this.setImmediate=Q}shouldYield(X){return X.currentOpCount>=X.maxOpsBeforeYield}makeDispatcher(){return new xW(this.setImmediate)}}class xW{tasks=new vW;running=void 0;setImmediate;constructor(X=SW){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 kW=V0("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),yW=V0("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1});var d3="effect/Tracer/ParentSpan";class $7 extends l1()(d3){}var ow=(X)=>X;var G7=V0("effect/Tracer/DisablePropagation",{defaultValue:IQ}),hW=V0("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),mW=V0("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),p3="effect/Tracer",Z7=V0(p3,{defaultValue:()=>ow({span:(X)=>new dW(X)})});class dW{_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=q6(X.parent)?.traceId??gW(32),this.spanId=gW(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 gW=function(){return function(Y){let J="";for(let $=0;$<Y;$++)J+="abcdef0123456789".charAt(Math.floor(Math.random()*16));return J}}();var pW="effect/observability/Metric/FiberRuntimeMetricsKey";var K7=V0("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),cW=V0("effect/ErrorReporter/CurrentErrorReporters",{defaultValue:()=>new Set}),y9=V0("effect/References/CurrentStackFrame",{defaultValue:A8}),H7=V0("effect/References/TracerEnabled",{defaultValue:P4}),b9=V0("effect/References/TracerTimingEnabled",{defaultValue:P4}),g9=V0("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),h9=V0("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),s8=V0("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),c3=V0("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),f3=V0("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"});var W7=V0("effect/References/CurrentLogSpans",{defaultValue:()=>[]});var _7=(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:sw(()=>Y.stack)}},u3=(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}},
|
|
14
|
-
`),G=[J];for(let Z=1;Z<$.length;Z++){if(/(?:Generator\.next|~effect\/Effect)/.test($[Z]))break;G.push($[Z])}return Y?
|
|
12
|
+
`)}return Q},qW=B(2,(X,Q)=>{if(X.mapUnsafe.has(Q.key))return F(X.mapUnsafe.get(Q.key));return WW(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 BW(X,(Y)=>{Q.mapUnsafe.forEach((J,$)=>Y.set($,J))})}),DW=(...X)=>{let Q=new Map;for(let Y=0;Y<X.length;Y++)X[Y].mapUnsafe.forEach((J,$)=>{Q.set($,J)});return I4(Q)};var BW=(X,Q)=>{if(X.mutable)return Q(X.mapUnsafe),X;let Y=new Map(X.mapUnsafe);return Q(Y),I4(Y)},V0=l1;var E3=(X)=>X.length>0;var l=QW,f=XW;var UW=lQ,u=A3,A1=w3;var OW=(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)),O6=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 zi={[Symbol.iterator](){return Iw}},Iw={next(){return{done:!0,value:void 0}}};var zW=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 Ew=()=>({}),S3=(X)=>Object.keys(X).length===0;var L5=B(2,(X,Q)=>{let Y={...X};for(let J of LW(X))Y[J]=Q(X[J],J);return Y});var FW=B(2,(X,Q)=>{let Y=Ew();for(let J of LW(X))if(Q(X[J],J))Y[J]=X[J];return Y});var LW=(X)=>Object.keys(X);var P5=globalThis.Array;var x3=(X)=>new P5(X);var Z1=(X)=>P5.isArray(X)?X:P5.from(X),PW=(X)=>P5.isArray(X)?X:[X];var Y7=B(2,(X,Q)=>[...X,Q]),Sw=B(2,(X,Q)=>Z1(X).concat(Z1(Q)));var Ri=P5.isArray;var W8=E3,z6=E3;function vw(X,Q){return X<0||X>=Q.length}var xw=B(2,(X,Q)=>{let Y=Math.floor(Q);if(vw(Y,X))throw Error(`Index out of bounds: ${Y}`);return X[Y]});var kw=xw(0);var yw=(X)=>X.slice(1);var k9=B(2,(X,Q)=>{let Y=P5.from(X);return Y.sort(Q),Y});var bw=B(3,(X,Q,Y)=>{let J=Z1(X),$=Z1(Q);if(z6(J)){if(z6($))return g3(Y)(Sw(J,$));return J}return $}),k3=B(2,(X,Q)=>bw(X,Q,bQ()));var y3=()=>[];var j4=B(2,(X,Q)=>X.map(Q));var RW=(X)=>{let Q=[];for(let Y of X)if(B1(Y))Q.push(Y.value);return Q};var b3=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 g3=B(2,(X,Q)=>{let Y=Z1(X);if(z6(Y)){let J=[kw(Y)],$=yw(Y);for(let G of $)if(J.every((Z)=>!Q(G,Z)))J.push(G);return J}return[]});var gw=o8((X,Q)=>X.concat(Q),[]);function NW(){return gw}var J7="~effect/time/Duration",hw=BigInt(0);var wW=BigInt(1000),mw=BigInt(1e6);var dw=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,S1=(X)=>{switch(typeof X){case"number":return E4(X);case"bigint":return a8(X);case"string":{if(X==="Infinity")return i8;if(X==="-Infinity")return F6;let Q=dw.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 uw(BigInt(J));case"milli":case"millis":return E4(G);case"second":case"seconds":return lw(G);case"minute":case"minutes":return rw(G);case"hour":case"hours":return ow(G);case"day":case"days":return nw(G);case"week":case"weeks":return iw(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 MW(X);if(Number.isNaN(X[0])||Number.isNaN(X[1]))return R5;if(X[0]===-1/0||X[1]===-1/0)return F6;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)*mw;if(Q.microseconds)J+=BigInt(Q.microseconds)*wW;if(Q.nanoseconds)J+=BigInt(Q.nanoseconds);return K1(J)}}return MW(X)},MW=(X)=>{throw Error(`Invalid Input: ${X}`)},CW=B6(S1),AW={_tag:"Millis",millis:0},pw={_tag:"Infinity"},cw={_tag:"NegativeInfinity"},fw={[J7]:J7,[H0](){return q3(this.value)},[W0](X){return m3(X)&&sw(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(fw);if(typeof X==="number")if(isNaN(X)||X===0||Object.is(X,-0))Q.value=AW;else if(!Number.isFinite(X))Q.value=X>0?pw:cw;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===hw)Q.value=AW;else Q.value={_tag:"Nanos",nanos:X};return Q},m3=(X)=>M(X,J7);var R5=K1(0),i8=K1(1/0),F6=K1(-1/0),a8=(X)=>K1(X),uw=(X)=>K1(X*wW),E4=(X)=>K1(X),lw=(X)=>K1(X*1000),rw=(X)=>K1(X*60000),ow=(X)=>K1(X*3600000),nw=(X)=>K1(X*86400000),iw=(X)=>K1(X*604800000),S4=(X)=>aw(S1(X),{onMillis:b,onNanos:(Q)=>Number(Q)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var h3=(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))}},TW=B6(h3);var aw=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)()}}),IW=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(h3(X),Q.value.nanos);else return Y.onNanos(X.value.nanos,h3(Q))});var d3=(X,Q)=>IW(X,Q,{onMillis:(Y,J)=>Y===J,onNanos:(Y,J)=>Y===J,onInfinity:(Y,J)=>Y.value._tag===J.value._tag});var jW=B(2,(X,Q)=>IW(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"?R5:i8;if($==="NegativeInfinity")return G==="NegativeInfinity"?R5:F6;return G==="Infinity"?F6:i8}}));var sw=B(2,(X,Q)=>d3(X,Q));var M5=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 $}),EW=(X)=>(Q)=>{let Y=X(Q);return u(Y)?x():F(Y.success)};var y9=V0("effect/Scheduler",{defaultValue:()=>new A5}),vW="setImmediate"in globalThis?(X)=>{let Q=globalThis.setImmediate(X);return()=>globalThis.clearImmediate(Q)}:(X)=>{let Q=setTimeout(X,0);return()=>clearTimeout(Q)};class xW{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 A5{executionMode;setImmediate;constructor(X="async",Q=vW){this.executionMode=X,this.setImmediate=Q}shouldYield(X){return X.currentOpCount>=X.maxOpsBeforeYield}makeDispatcher(){return new kW(this.setImmediate)}}class kW{tasks=new xW;running=void 0;setImmediate;constructor(X=vW){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 yW=V0("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),bW=V0("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1});var p3="effect/Tracer/ParentSpan";class $7 extends l1()(p3){}var tw=(X)=>X;var G7=V0("effect/Tracer/DisablePropagation",{defaultValue:IQ}),mW=V0("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),dW=V0("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),c3="effect/Tracer",Z7=V0(c3,{defaultValue:()=>tw({span:(X)=>new pW(X)})});class pW{_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=D6(X.parent)?.traceId??hW(32),this.spanId=hW(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 hW=function(){return function(Y){let J="";for(let $=0;$<Y;$++)J+="abcdef0123456789".charAt(Math.floor(Math.random()*16));return J}}();var cW="effect/observability/Metric/FiberRuntimeMetricsKey";var K7=V0("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),fW=V0("effect/ErrorReporter/CurrentErrorReporters",{defaultValue:()=>new Set}),b9=V0("effect/References/CurrentStackFrame",{defaultValue:A8}),H7=V0("effect/References/TracerEnabled",{defaultValue:P4}),g9=V0("effect/References/TracerTimingEnabled",{defaultValue:P4}),h9=V0("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),m9=V0("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),s8=V0("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),f3=V0("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),u3=V0("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"});var W7=V0("effect/References/CurrentLogSpans",{defaultValue:()=>[]});var _7=(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:YC(()=>Y.stack)}},l3=(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}},YC=l3(3);var uW="dev";class e3 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}}[W0](X){return q6(X)&&this.fiberId===X.fiberId&&this.annotations===X.annotations}[H0](){return f0(C0(`${this._tag}:${this.fiberId}`))(SQ(this.annotations))}}var tW=(X)=>new e3(X),I5=(X)=>new u8([new e3(X)]),XJ=(X)=>X.reasons.some(A4),QJ=(X)=>{let Q=X.reasons.find(A4);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)},eW=EW(i1),q7=(X)=>X.reasons.some(V6),X_=(X)=>{let Q=X.reasons.find(V6);return Q?l(Q):f(X)},o9=(X)=>{let Q=X.reasons.find(V6);return Q?l(Q.defect):f(X)},D7=(X)=>X.reasons.some(q6),Q_=(X)=>{let Q=X.reasons.find(q6);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)},Y_=(X)=>{let Q=B7(X);return u(Q)?JC:Q.success},JC=new Set,J_=(X)=>X.reasons.length>0&&X.reasons.every(q6),$_=(X)=>I4(X.annotations),G_=(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 I4(Q)},YJ=B(2,(X,Q)=>{if(X.reasons.length===0)return Q;else if(Q.reasons.length===0)return X;let Y=new u8(k3(X.reasons,Q.reasons));return o(X,Y)?X:Y}),Z_=B(2,(X,Q)=>{let Y=!1,J=X.reasons.map(($)=>{if(A4($))return Y=!0,new q5(Q($.error));return $});return Y?l8(J):X}),$C=(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=$C(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")},JJ=(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(r3($._tag==="Die"?$.defect:$.error,$.annotations))}if(Q.length===0){let $=Error("The fiber was interrupted by:");$.name="InterruptCause",$.stack=HC($,Y);let G=new globalThis.Error("All fibers interrupted without error",{cause:$});G.name="InterruptError",G.stack=`${G.name}: ${G.message}`,Q.push(r3(G,Y[0].annotations))}return Error.stackTraceLimit=J,Q},r3=(X,Q)=>{let Y=typeof X,J;if(X&&Y==="object"){if(J=new globalThis.Error(GC(X),{cause:X.cause?r3(X.cause):void 0}),typeof X.name==="string")J.name=X.name;if(typeof X.stack==="string")J.stack=KC(X.stack,J,Q);else{let $=`${J.name}: ${J.message}`;J.stack=Q?K_($,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},GC=(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)},ZC=/\((.*)\)/g,KC=(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?K_(G.join(`
|
|
15
15
|
`),Y):G.join(`
|
|
16
|
-
`)},
|
|
17
|
-
${
|
|
18
|
-
`)},
|
|
19
|
-
`)},O7=(X)=>
|
|
20
|
-
${
|
|
16
|
+
`)},K_=(X,Q)=>{let Y=Q?.get(j9.key);if(Y)X=`${X}
|
|
17
|
+
${H_(Y)}`;return X},HC=(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(mH.key);if(Y.push(` at fiber (${$})`),G)Y.push(H_(G))}return Y.join(`
|
|
18
|
+
`)},H_=(X)=>{let Q=[],Y=X,J=0;while(Y&&J<10){let $=Y.stack();if($){let G=$.matchAll(ZC),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)=>JJ(X).map((Q)=>Q.cause?`${Q.stack} {
|
|
20
|
+
${W_(Q.cause," ")}
|
|
21
21
|
}`:Q.stack).join(`
|
|
22
|
-
`),
|
|
22
|
+
`),W_=(X,Q)=>{let Y=X.stack.split(`
|
|
23
23
|
`),J=`${Q}[cause]: ${Y[0]}`;for(let $=1,G=Y.length;$<G;$++)J+=`
|
|
24
24
|
${Q}${Y[$]}`;if(X.cause)J+=` {
|
|
25
|
-
${
|
|
26
|
-
${Q}}`;return J},r3=`~effect/Fiber/${fW}`,$C={_A:b,_E:b},GC={id:0},z7=()=>globalThis[K5];class JJ{constructor(X,Q=!0){this[r3]=$C,this.setContext(X),this.id=++GC.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)}[r3];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 _W(this.context,X)}addObserver(X){if(this._exit)return X(this._exit),G5;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=I5(X);if(this.currentStackFrame)Y=q5(Y,tQ(I9,this.currentStackFrame));if(Q)Y=q5(Y,Q);if(this._interruptedCause=this._interruptedCause?QJ(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===M4)return;let Y=o3.interruptChildren&&o3.interruptChildren(this);if(Y!==void 0)return this.evaluate(T(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[K5];globalThis[K5]=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=T(j5,()=>G)}if(J=this.currentTracerContext?this.currentTracerContext(J,this):J[u0](this),$!==this.currentLoopCount)return M4;else if(J===M4){let G=this._yielded;if(H6 in G)return this._yielded=void 0,G;return M4}}}catch(G){if(!M(J,u0))return C8(`Fiber.runLoop: Not a valid effect: ${String(J)}`);return this.runLoop(C8(G))}finally{globalThis[K5]=Q}}getCont(X){while(!0){let Q=this._stack.pop();if(!Q)return;let Y=Q[N4]&&Q[N4](this);if(Y)return Y[X]=Y,Y;if(Q[X])return Q}}yieldWith(X){return this._yielded=X,M4}children(){return this._children??=new Set}pipe(){return a(this,arguments)}setContext(X){this.context=X;let Q=this.getRef(k9);if(Q!==this.currentScheduler)this.currentScheduler=Q,this._dispatcher=void 0;this.currentSpan=X.mapUnsafe.get(d3),this.currentLogLevel=this.getRef(c3),this.minimumLogLevel=this.getRef(f3),this.currentStackFrame=X.mapUnsafe.get(y9.key),this.maxOpsBeforeYield=this.getRef(kW),this.currentPreventYield=this.getRef(yW),this.runtimeMetrics=X.mapUnsafe.get(pW);let Y=X.mapUnsafe.get(p3);this.currentTracerContext=Y?Y.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}}var o3={interruptChildren:void 0},F7=(X)=>{if(!X.currentStackFrame)return;let Q=new Map;return Q.set(I9.key,X.currentStackFrame),I4(Q)},ZC=(X)=>{if(X._children===void 0||X._children.size===0)return;return w5(X._children)},KC=(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))))})},$J=(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 HC=(X)=>c((Q)=>WC(X,Q.id)),WC=B((X)=>M(X[0],r3),(X,Q,Y)=>c((J)=>{let $=F7(J);return $=$&&Y?X7($,Y):$??Y,X.interruptUnsafe(Q,$),n9(KC(X))})),w5=(X)=>c((Q)=>{let Y=F7(Q);for(let J of X)J.interruptUnsafe(Q.id,Y);return n9($J(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]()}}),o9=(X)=>X.asEffect(),W_=o9,__=o9,V_=(X)=>X==null?M0(new $8):A(X),GJ=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})}}),j5=GJ(0),ZJ=(X)=>A(F(X)),L7=A(x()),D_=(X)=>i(()=>N0(J0(X))),P6=(X)=>C8(X),P7=(X)=>i(()=>M0(J0(X))),X0=A(void 0);var q_=(X)=>i(()=>{try{return A(J0(X.try))}catch(Q){return M0(J0(()=>X.catch(Q)))}});var KJ=(X)=>HJ(function(Q,Y){J0(()=>X(Y)).then((J)=>Q(A(J)),(J)=>Q(P6(J)))},X.length!==0),B_=(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 HJ(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)},U_=(X)=>c((Q)=>X(Q.id)),O_=c(A),z_=U_(A),HJ=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 M4;return X._stack.push(_C(()=>{return Y=!0,$?.abort(),G??n1})),M4}}),_C=u1({op:"AsyncFinalizer",[N4](X){if(X.interruptible)X.interruptible=!1,X._stack.push(S7)},[J8](X,Q){return q7(X)?T(this[t](),()=>N0(X)):N0(X)}}),w1=(X)=>HJ(X,X.length>=2),WJ=w1(G5),F_=(...X)=>i(()=>C5(X.length===1?X[0]():X[1].call(X[0].self))),_J=(X,...Q)=>{let Y=Q.length===0?function(){return i(()=>C5(X.apply(this,arguments)))}:function(){let J=i(()=>C5(X.apply(this,arguments)));for(let $=0;$<Q.length;$++)J=Q[$](J,...arguments);return J};return VJ(X.length,Y)},VJ=(X,Q)=>Object.defineProperty(Q,"length",{value:X,configurable:!0}),uW=u3(2),L_=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)=>lW(Q,G,$,Z,X,Y);return lW(Q,arguments[0],$,Array.prototype.slice.call(arguments,1),X,Y)},lW=(X,Q,Y,J,$,G)=>{let Z=typeof Q==="function"?Q:J.pop().bind(Q.self);return VJ(Z.length,function(...K){let H=i(()=>{let _=Z.apply(this,arguments);return p(_)?_:C5(_)});for(let _=0;_<J.length;_++)H=J[_](H,...K);if(!p(H))return H;let W=globalThis.Error.stackTraceLimit;globalThis.Error.stackTraceLimit=2;let V=new globalThis.Error;return globalThis.Error.stackTraceLimit=W,e8($?d9(X,G,(_)=>s3(H,_)):H,y9,(_)=>({name:X,stack:uW(()=>V.stack),parent:{name:`${X} (definition)`,stack:uW(()=>Y.stack),parent:_}}))})},P_=(X,...Q)=>VJ(X.length,Q.length===0?function(){return rW(()=>X.apply(this,arguments))}:function(){let Y=rW(()=>X.apply(this,arguments));for(let J of Q)Y=J(Y);return Y}),rW=(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,T(G,(H)=>C5(Q,H));else return i(()=>C5(X()))})}}}catch(Q){return P6(Q)}},C5=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(!H1($))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 T(X,(J)=>Y)}),R7=(X)=>L0(X,F),R_=(X)=>N6(X,{onFailure:A,onSuccess:M0}),t8=B(2,(X,Q)=>T(X,(Y)=>p(Q)?Q:J0(()=>Q(Y)))),R6=B(2,(X,Q)=>T(X,(Y)=>v1(p(Q)?Q:J0(()=>Q(Y)),Y))),n9=(X)=>T(X,(Q)=>n1),N_=(X)=>a1(X,M0),DJ=(X,Q)=>c((Y)=>w1((J)=>{let $=Z1(X),G=$.length,Z=0,K=!1,H=new Set,W=[],V=(_,D,q)=>{if(Z++,_._tag==="Failure"){if(W.push(..._.cause.reasons),Z>=G)J(N0(l8(W)));return}let U=!K;if(K=!0,J(H.size===0?_:T(M6(w5(H)),()=>_)),U&&Q?.onWinner)Q.onWinner({fiber:D,index:q,parentFiber:Y})};for(let _=0;_<G;_++){let D=A6(Y,$[_],!0,!0,!1);if(H.add(D),D.addObserver((q)=>{H.delete(D),V(q,D,_)}),K)break}return w5(H)})),qJ=(X,Q)=>c((Y)=>w1((J)=>{let $=!1,G=new Set,Z=(H)=>{$=!0,J(G.size===0?H:T(M6(w5(G)),()=>H))},K=0;for(let H of X){if($)break;let W=K++,V=A6(Y,H,!0,!0,!1);G.add(V),V.addObserver((_)=>{G.delete(V);let D=!$;if(Z(_),D&&Q?.onWinner)Q.onWinner({fiber:V,index:W,parentFiber:Y})})}return w5(G)})),M_=B((X)=>p(X[1]),(X,Q,Y)=>DJ([X,Q],Y)),N7=B((X)=>p(X[1]),(X,Q,Y)=>qJ([X,Q],Y)),T=B(2,(X,Q)=>{let Y=Object.create(VC);return Y[t]=X,Y[R1]=Q.length!==1?(J)=>Q(J):Q,Y}),VC=B5({op:"OnSuccess",[u0](X){return X._stack.push(this),this[t]}}),A_=B(2,(X,Q)=>{if(H1(X))return X._tag==="Success"?Q.onSuccess(X.value):Q.onFailure(X.cause);return j8(X,Q)}),H1=(X)=>(H6 in X),w_=B(2,(X,Q)=>{if(H1(X))return X._tag==="Success"?Q(X.value):X;return T(X,Q)}),C_=(X)=>T(X,b),L0=B(2,(X,Q)=>T(X,(Y)=>A(J0(()=>Q(Y))))),T_=B(2,(X,Q)=>H1(X)?OJ(X,Q):L0(X,Q)),I_=B(2,(X,Q)=>H1(X)?zJ(X,Q):TJ(X,Q)),j_=B(2,(X,Q)=>H1(X)?FJ(X,Q):IJ(X,Q)),E_=B(2,(X,Q)=>{if(H1(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)}),S_=(X)=>N1(I5(X)),E5=(X)=>X._tag==="Success",v_=(X)=>X._tag==="Success"?l(X):f(X),x_=(X)=>X._tag==="Success"?l(X.value):f(X),BJ=(X)=>X._tag==="Failure",k_=(X)=>X._tag==="Failure"?l(X):f(X),i9=(X)=>X._tag==="Failure"?l(X.cause):f(X),UJ=M5(i9,i1),y_=M5(i9,r9),b_=(X)=>X._tag==="Failure"&&q7(X.cause),g_=(X)=>X._tag==="Failure"&&D7(X.cause),h_=(X)=>X._tag==="Failure"&&e3(X.cause),n1=j0(void 0),OJ=B(2,(X,Q)=>X._tag==="Success"?j0(Q(X.value)):X),zJ=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))}),FJ=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))}),DC=B(2,(X,Q)=>E5(X)?j0(Q):X);var m_=B(2,(X,Q)=>E5(X)?Q.onSuccess(X.value):Q.onFailure(X.cause)),d_=DC(void 0),LJ=(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))},p_=(X)=>E5(X)?F(X.value):x(),c_=(X)=>BJ(X)?F(X.cause):x(),f_=(X)=>{let Q=UJ(X);return u(Q)?x():F(Q.success)},u_=o9,l_=(X)=>c((Q)=>A(VW(Q.context,X))),qC=(X)=>c((Q)=>Q.context.mapUnsafe.has(X.key)?A(U6(Q.context,X)):M0(new $8)),a9=B(2,(X,Q)=>c((Y)=>{let J=Y.context,$=Q(J);if(J===$)return X;return Y.setContext($),v5(X,()=>{Y.setContext(J);return})})),e8=B(3,(X,Q,Y)=>a9(X,(J)=>{let $=U6(J,Q),G=Y($);if($===G)return J;return K8(J,Q,G)})),PJ=()=>BC,BC=c((X)=>A(X.context)),x4=(X)=>c((Q)=>X(Q.context)),X4=B(2,(X,Q)=>{if(H1(X))return X;return a9(X,X7(Q))}),U1=function(){if(arguments.length===1)return B(2,(X,Q)=>oW(X,arguments[0],Q));return B(3,(X,Q,Y)=>oW(X,Q,Y)).apply(this,arguments)},oW=(X,Q,Y)=>a9(X,(J)=>{if(J.mapUnsafe.get(Q.key)===Y)return J;return K8(J,Q,Y)}),M7=B(3,(X,Q,Y)=>T(Y,(J)=>U1(X,Q,J))),r_=U1(K7),RJ=B((X)=>p(X[1]),(X,Q,Y)=>NJ(X,Q,(J,$)=>[J,$],Y)),NJ=B((X)=>p(X[1]),(X,Q,Y,J)=>J?.concurrent?L0(v7([X,Q],{concurrency:2}),([$,G])=>J0(()=>Y($,G))):T(X,($)=>L0(Q,(G)=>J0(()=>Y($,G))))),o_=B((X)=>p(X[0]),(X,Q,Y)=>uJ(X,Q,Y?(J)=>M0(Y(J)):()=>M0(new $8))),n_=B(2,(X,Q)=>T(Q,(Y)=>Y?R7(X):L7)),MJ=B(2,(X,Q)=>Array.from({length:Q},()=>X)),i_=B((X)=>p(X[0]),(X,Q,Y)=>v7(MJ(X,Q),Y)),A7=B((X)=>p(X[0]),(X,Q)=>y4({while:P4,body:i0(Q?.disableYield?X:T(X,(Y)=>j5)),step:G5})),a1=B(2,(X,Q)=>{let Y=Object.create(UC);return Y[t]=X,Y[J8]=Q.length!==1?(J)=>Q(J):Q,Y}),UC=B5({op:"OnFailure",[u0](X){return X._stack.push(this),this[t]}}),AJ=B(3,(X,Q,Y)=>a1(X,(J)=>{if(!Q(J))return N0(J);return J0(()=>Y(J))})),S5=B(3,(X,Q,Y)=>a1(X,(J)=>{let $=Q(J);return u($)?N0($.failure):J0(()=>Y($.success,J))})),x1=B(2,(X,Q)=>S5(X,i1,(Y)=>Q(Y))),a_=(X)=>N6(X,{onFailure:(Q)=>cQ(Q)?L7:M0(Q),onSuccess:ZJ}),s_=B(2,(X,Q)=>S5(X,r9,Q)),t_=B(2,(X,Q)=>a1(X,(Y)=>t8(J0(()=>Q(Y)),N0(Y)))),e_=B(3,(X,Q,Y)=>AJ(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))})),wJ=B(2,(X,Q)=>w7(X,i1,(Y)=>Q(Y))),XV=B(3,(X,Q,Y)=>{let J=Array.isArray(Q)?($)=>M($,"_tag")&&Q.includes($._tag):G6(Q);return wJ(X,($)=>J($)?Y($):X0)}),QV=B(2,(X,Q)=>w7(X,r9,(Y)=>Q(Y))),s9=B((X)=>p(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)=>p(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))})),CJ=B((X)=>p(X[0]),(X,Q,Y,J)=>{let $=Array.isArray(Q)?(G)=>M(G,"_tag")&&Q.includes(G._tag):G6(Q);return s9(X,$,Y,J)}),YV=B((X)=>p(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)}),JV=B((X)=>p(X[0]),(X,Q,Y,J,$)=>s9(X,(G)=>G6(G,Q)&&M(G,"reason"),(G)=>{let Z=G.reason;if(G6(Z,Y))return J(Z,G);return $?J0(()=>$(Z,G)):M0(G)})),$V=B((X)=>p(X[0]),(X,Q,Y,J)=>{let $;return s9(X,(G)=>G6(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)})}),GV=B(2,(X,Q)=>C7(X,(Y)=>{if(G6(Y,Q)&&M(Y,"reason"))return l(Y.reason);return f(Y)},M0));var TJ=B(2,(X,Q)=>x1(X,(Y)=>P7(()=>Q(Y)))),IJ=B(2,(X,Q)=>N6(X,{onFailure:(Y)=>P7(()=>Q.onFailure(Y)),onSuccess:(Y)=>$0(()=>Q.onSuccess(Y))})),jJ=(X)=>x1(X,P6),ZV=B(2,(X,Q)=>x1(X,(Y)=>$0(Q))),KV=(X)=>i(()=>{let Q=X[Symbol.iterator](),Y=Q.next();if(Y.done)return P6(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)}),EJ=(X)=>x1(X,(Q)=>T(j5,()=>EJ(X))),HV=B((X)=>p(X[0]),(X,Q)=>{if(!Q?.log)return N6(X,{onFailure:(J)=>X0,onSuccess:(J)=>X0});let Y=_8(Q.log===!0?void 0:Q.log);return j8(X,{onFailure(J){let $=XJ(J);return u($)?N0($.failure):Q.message===void 0?Y(J):Y(Q.message,J)},onSuccess:(J)=>X0})}),WV=B((X)=>p(X[0]),(X,Q)=>{if(!Q?.log)return j8(X,{onFailure:(J)=>X0,onSuccess:(J)=>X0});let Y=_8(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})}),_V=(X)=>T7(X,{onFailure:x,onSuccess:F}),v4=(X)=>t9(X,{onFailure:f,onSuccess:l}),j8=B(2,(X,Q)=>{let Y=Object.create(OC);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}),OC=B5({op:"OnSuccessAndFailure",[u0](X){return X._stack.push(this),this[t]}}),SJ=B(2,(X,Q)=>j8(X,{onFailure:(Y)=>$0(()=>Q.onFailure(Y)),onSuccess:(Y)=>$0(()=>Q.onSuccess(Y))})),N6=B(2,(X,Q)=>j8(X,{onFailure:(Y)=>{let J=Y.reasons.find(A4);return J?J0(()=>Q.onFailure(J.error)):N0(Y)},onSuccess:Q.onSuccess})),T7=B(2,(X,Q)=>N6(X,{onFailure:(Y)=>$0(()=>Q.onFailure(Y)),onSuccess:(Y)=>$0(()=>Q.onSuccess(Y))})),t9=B(2,(X,Q)=>{if(H1(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)}),VV=B(2,(X,Q)=>{if(H1(X)){if(X._tag==="Success")return j0(Q.onSuccess(X.value));return j0(Q.onFailure(X.cause))}return SJ(X,Q)}),e9=(X)=>H1(X)?j0(X):zC(X),zC=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))}}),DV=t9({onFailure:()=>!0,onSuccess:()=>!1}),qV=t9({onFailure:()=>!1,onSuccess:()=>!0}),BV=B(2,(X,Q)=>t8(C6(Q),X)),vJ=B(2,(X,Q)=>N7(X,T(C6(Q.duration),Q.orElse))),UV=B(2,(X,Q)=>vJ(X,{duration:Q,orElse:()=>M0(new y7)})),OV=B(2,(X,Q)=>N7(R7(X),v1(C6(Q),x()))),zV=(X)=>w6((Q)=>{let Y=Q.currentTimeNanosUnsafe();return L0(X,(J)=>[a8(Q.currentTimeNanosUnsafe()-Y),J])}),n3="~effect/Scope",i3="~effect/Scope/Closeable",XX=l1("effect/Scope"),xJ=(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 FC(X,J,Q)},FC=_J(function*(X,Q,Y){let J=[],$=[],G=Array.from(Q.values()),Z=z7();for(let K=G.length-1;K>=0;K--){let H=G[K];if(X.strategy==="sequential")J.push(yield*e9(H(Y)));else $.push(A6(Z,H(Y),!0,!0,"inherit"))}if($.length>0)J=yield*$J($);return yield*LJ(J)});var FV=(X,Q)=>{let Y=QX(Q);if(X.state._tag==="Closed")return Y.state=X.state,Y;let J={};return V7(X,J,($)=>xJ(Y,$)),V7(Y,J,($)=>$0(()=>LV(X,J))),Y},k4=(X,Q)=>{return i(()=>{if(X.state._tag==="Closed")return Q(X.state.exit);return V7(X,{},Q),X0})};var V7=(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)},LV=(X,Q)=>{if(X.state._tag==="Open")X.state.finalizers.delete(Q)},QX=(X="sequential")=>({[i3]:i3,[n3]:n3,strategy:X,state:LC}),LC={_tag:"Empty"};var YX=XX.asEffect();var kJ=(X)=>c((Q)=>{let Y=Q.context,J=QX();return Q.setContext(K8(Q.context,XX,J)),v5(X,($)=>{return Q.setContext(Y),I7(J,$)})});var j7=(X)=>i(()=>{let Q=QX();return O1(X(Q),(Y)=>i(()=>I7(Q,Y)??X0))}),E7=(X,Q,Y)=>x4((J)=>JX(($)=>T(YX,(G)=>R6(Y?.interruptible?$(X):X,(Z)=>k4(G,(K)=>X4(Q(Z,K),J)))))),yJ=(X)=>T(YX,(Q)=>x4((Y)=>k4(Q,(J)=>X4(X(J),Y)))),v5=u1({op:"OnExit",single:!1,[u0](X){return X._stack.push(this),this[t][0]},[N4](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?T(J,($)=>Y):Y},[J8](X,Q,Y){Y??=N1(X);let J=this[t][1](Y);return J?T(J,($)=>Y):Y}}),O1=B(2,v5),PV=B(2,(X,Q)=>O1(X,(Y)=>Q)),bJ=B(3,(X,Q,Y)=>O1(X,(J)=>{if(!Q(J))return X0;return Y(J)})),gJ=B(3,(X,Q,Y)=>O1(X,(J)=>{let $=Q(J);return u($)?X0:Y($.success,J)})),hJ=B(2,(X,Q)=>gJ(X,i9,Q)),RV=B(3,(X,Q,Y)=>bJ(X,(J)=>{if(J._tag!=="Failure")return!1;return Q(J.cause)},(J)=>Y(J.cause))),mJ=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)})),NV=B(2,(X,Q)=>mJ(B7,Q)(X)),MV=(X,Q,Y)=>JX((J)=>T(X,($)=>v5(J(Q($)),(G)=>Y($,G),!0))),AV=(X)=>E7(X,(Q)=>M(Q,Symbol.asyncDispose)?KJ(()=>Q[Symbol.asyncDispose]()):$0(()=>Q[Symbol.dispose]())),dJ=B(2,(X,Q)=>$0(()=>{let Y=S4(S1(Q)),J=Number.isFinite(Y),$=NC(!1),G=0,Z=!1,K,H=T($.await,()=>K);return[c((W)=>{let V=W.getRef(E8),_=J?V.currentTimeMillisUnsafe():0;if(Z||_<G)return K??H;return Z=!0,$.closeUnsafe(),K=void 0,O1(X,(D)=>$0(()=>{Z=!1,G=V.currentTimeMillisUnsafe()+Y,K=D,$.openUnsafe()}))}),$0(()=>{G=0,$.closeUnsafe(),K=void 0})]})),pJ=B(2,(X,Q)=>L0(dJ(X,Q),(Y)=>Y[0])),wV=(X)=>pJ(X,i8),CV=c((X)=>N0(I5(X.id))),M6=(X)=>c((Q)=>{if(!Q.interruptible)return X;return Q.interruptible=!1,Q._stack.push(S7),X}),TV=u1({op:"SetInterruptible",[N4](X){if(X.interruptible=this[t],X._interruptedCause&&X.interruptible)return()=>N0(X._interruptedCause)}}),S7=TV(!0),IV=TV(!1),cJ=(X)=>c((Q)=>{if(Q.interruptible)return X;if(Q.interruptible=!0,Q._stack.push(IV),Q._interruptedCause)return N0(Q._interruptedCause);return X}),JX=(X)=>c((Q)=>{if(!Q.interruptible)return X(b);return Q.interruptible=!1,Q._stack.push(S7),X(cJ)}),jV=(X)=>c((Q)=>{if(Q.interruptible)return X(b);return Q.interruptible=!0,Q._stack.push(IV),X(M6)}),EV=L0(E7($0(()=>new AbortController),(X)=>$0(()=>X.abort())),(X)=>X.signal),v7=(X,Q)=>{if(p8(X))return Q?.mode==="result"?o1(X,v4,Q):o1(X,b,Q);else if(Q?.discard)return Q.mode==="result"?o1(Object.values(X),v4,Q):o1(Object.values(X),b,Q);return i(()=>{let Y={};return v1(o1(Object.entries(X),([J,$])=>L0(Q?.mode==="result"?v4($):$,(G)=>{Y[J]=G}),{discard:!0,concurrency:Q?.concurrency}),Y)})},fJ=B((X)=>p8(X[0])&&!p(X[0]),(X,Q,Y)=>L0(o1(X,(J,$)=>v4(Q(J,$)),Y),(J)=>y3(J,b))),SV=B((X)=>p8(X[0])&&!p(X[0]),(X,Q,Y)=>T(fJ(X,Q,{concurrency:Y?.concurrency}),([J,$])=>{if(W8(J))return M0(J);return Y?.discard?X0:A($)})),vV=B((X)=>p8(X[0])&&!p(X[0]),(X,Q)=>i(()=>{let Y=X[Symbol.iterator](),J=Y.next();if(!J.done)return xV(Y,0,Q,J.value);return A(x())})),xV=(X,Q,Y,J)=>T(Y(J,Q),($)=>{if($)return A(F(J));let G=X.next();if(!G.done)return xV(X,Q+1,Y,G.value);return A(x())}),kV=B((X)=>p8(X[0])&&!p(X[0]),(X,Q)=>i(()=>{let Y=X[Symbol.iterator](),J=Y.next();if(!J.done)return yV(Y,0,Q,J.value);return A(x())})),yV=(X,Q,Y,J)=>T(Y(J,Q),($)=>{if(A1($))return A(F($.success));let G=X.next();if(!G.done)return yV(X,Q+1,Y,G.value);return A(x())}),y4=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 PC(X,Q,Y);let Z=Z1(X),K=Z.length;if(K===0)return Y?.discard?X0:A([]);let H=Y?.discard?void 0:Array(K),W=RC({f:Q,out:H},Z,{concurrency:G});return W?v1(W,H):A(H)})),PC=(X,Q,Y)=>i(()=>{let J=Y?.discard?void 0:[],$=X[Symbol.iterator](),G=$.next(),Z=0;return v1(y4({while:()=>!G.done,body:()=>Q(G.value,Z++),step:(K)=>{if(J)J.push(K);G=$.next()}}),J)}),bV=(X)=>{let{onItem:Q,step:Y}=X;return(J,$,G)=>{let Z=G?.start??0,K=G?.end??$.length,H=G?.concurrency??1,W=!1,V,_,D,q=!1,U,R,L=()=>{let N=!1;for(;!U&&Z<K;Z++){let P=$[Z],y=R??Q(J,P,Z);if(H1(y)){if(U=Y(J,P,y,Z),U)break}else if(H===1)return T(e9(y),(Y0)=>{return U=Y(J,P,Y0,Z),Z++,U??L()??X0});else if(!V)return w1((Y0)=>{V=z7(),R=y,D=Y0;let X8=L();if(X8)return Y0(X8);return i(()=>{return U=n1,q=!0,_?w5(_):X0})});else{R=void 0;let Y0=A6(V,y,!0,!0,"inherit");if(Y0._exit){if(U=Y(J,P,Y0._exit,Z),U)break;continue}if(_)_.add(Y0);else _=new Set([Y0]);let X8=Z;if(Y0.addObserver(($5)=>{if(_.delete(Y0),U){if(!q&&$5._tag==="Failure")for(let V1 of $5.cause.reasons)if(V1._tag==="Interrupt")continue;else if(U._tag==="Failure")U.cause.reasons.push(V1);else U=N1(l8([V1]))}else{let V1=Y(J,P,$5,X8);if(V1)U=V1._tag==="Failure"?N1(l8(V1.cause.reasons.slice())):V1,L()}if(N){let V1=L();if(V1)D(V1)}else if(W&&_.size===0)D(U??X0)}),_.size<H)continue;N=!0,Z++;return}}if(W=!0,U){if(_&&_.size>0){let P=F7(V);_.forEach((y)=>y.interruptUnsafe(V.id,P));return}if(D||U._tag==="Failure")return U}else if(D){if(!_)return n1;else if(_.size===0)D(X0)}};return L()}},$X=()=>bV,RC=bV({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}}),uJ=B(3,(X,Q,Y)=>T(X,(J)=>Q(J)?A(J):Y(J))),lJ=B(3,(X,Q,Y)=>T(X,(J)=>{let $=Q(J);return u($)?Y($.failure):A($.success)})),gV=B((X)=>p(X[0]),(X,Q,Y)=>lJ(X,Q,Y?(J)=>M0(Y(J)):()=>M0(new $8))),hV=B((X)=>p8(X[0])&&!p(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)})),mV=B((X)=>p8(X[0])&&!p(X[0]),(X,Q)=>i(()=>{let Y=[];for(let J of X){let $=Q(J);if(A1($))Y.push($.success)}return A(Y)})),dV=B((X)=>p8(X[0])&&!p(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)})),pV=A({}),cV=uH(L0),fV=lH(L0,T),uV=fH(L0);var lV=B((X)=>p(X[0]),(X,Q)=>c((Y)=>{return dC(),A(A6(Y,X,Q?.startImmediately,!1,Q?.uninterruptible??!1))})),A6=(X,Q,Y=!1,J=!1,$=!1)=>{let G=$==="inherit"?X.interruptible:!$,Z=new JJ(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},rV=B((X)=>p(X[0]),(X,Q)=>c((Y)=>A(A6(Y,X,Q?.startImmediately,!0,Q?.uninterruptible)))),oV=(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)$=OW($,(G)=>!Y.includes(G));return n9($J($))})}),rJ=B((X)=>p(X[0]),(X,Q,Y)=>c((J)=>{let $=A6(J,X,Y?.startImmediately,!0,Y?.uninterruptible);if(!$._exit)if(Q.state._tag!=="Closed"){let G={};V7(Q,G,()=>U_((K)=>K===$.id?X0:HC($))),$.addObserver(()=>LV(Q,G))}else $.interruptUnsafe(J.id,F7(J));return A($)})),nV=B((X)=>p(X[0]),(X,Q)=>T(YX,(Y)=>rJ(X,Y,Q))),Q4=(X)=>(Q,Y)=>{let J=new JJ(Y?.scheduler?K8(X,k9,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 iV=Q4(Z8()),oJ=(X)=>{let Q=Q4(X);return(Y,J)=>{let $=Q(Y,J);if(J?.onExit)$.addObserver(J.onExit);return(G)=>{return $.interruptUnsafe(G)}}},aV=oJ(Z8()),x7=(X)=>{let Q=Q4(X);return(Y,J)=>{let $=Q(Y,J);return new Promise((G)=>{$.addObserver((Z)=>G(Z))})}},sV=x7(Z8()),nJ=(X)=>{let Q=x7(X);return(Y,J)=>Q(Y,J).then(($)=>{if($._tag==="Failure")throw U7($.cause);return $.value})},tV=nJ(Z8()),k7=(X)=>{let Q=Q4(X);return(Y)=>{if(H1(Y))return Y;let J=new A5("sync"),$=Q(Y,{scheduler:J});return $.currentDispatcher?.flush(),$._exit??C8(new b7($))}},eV=k7(Z8()),iJ=(X)=>{let Q=k7(X);return(Y)=>{let J=Q(Y);if(J._tag==="Failure")throw U7(J.cause);return J.value}},XD=iJ(Z8()),nW=A(!0),iW=A(!1);class QD{waiters=[];scheduled=!1;isOpen;constructor(X){this.isOpen=X}scheduleUnsafe(X){if(this.scheduled||this.waiters.length===0)return nW;return this.scheduled=!0,X.currentDispatcher.scheduleTask(this.flushWaiters,0),nW}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 iW;return this.isOpen=!0,this.scheduleUnsafe(X)});release=c((X)=>this.isOpen?iW: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)=>T(this.await,()=>X)}var NC=(X)=>new QD(X??!1);var YD=c((X)=>A(X.getRef(Z7))),JD=B(2,(X,Q)=>U1(X,Z7,Q)),$D=U1(H7),GD=U1(b9),a3=BigInt(0),MC={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:a3,endTime:a3,exit:n1},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},AC=(X)=>Object.assign(Object.create(MC),X),ZD=(X)=>{if(!X)return x();return E1(X.annotations,G7)?X._tag==="Span"?ZD(q6(X.parent)):x():F(X)},aJ=(X,Q,Y)=>{let J=!X.getRef(H7)||Y?.annotations&&E1(Y.annotations,G7),$=Y?.parent!==void 0?F(Y.parent):Y?.root?x():ZD(X.currentSpan),G;if(J)G=AC({name:Q,parent:$,annotations:K8(Y?.annotations??Z8(),G7,!0)});else{let Z=X.getRef(Z7),K=X.getRef(E8),H=X.getRef(b9),W=X.getRef(g9),V=X.getRef(h9),_=Y?.level??X.getRef(hW),D=Y?.links!==void 0?[...V,...Y.links]:V.slice();G=Z.span({name:Q,parent:$,annotations:Y?.annotations??Z8(),links:D,startTime:H?K.currentTimeNanosUnsafe():BigInt(0),kind:Y?.kind??"internal",root:Y?.root??T0($),sampled:Y?.sampled??(B1($)&&$.value.sampled===!1?!1:!AD(X.getRef(mW),_))});for(let[q,U]of Object.entries(W))G.attribute(q,U);if(Y?.attributes!==void 0)for(let[q,U]of Object.entries(Y.attributes))G.attribute(q,U)}return G},KD=(X,Q)=>c((Y)=>A(aJ(Y,X,Q))),m9=(X,Q)=>M6(c((Y)=>{let J=U6(Y.context,XX),$=aJ(Y,X,Q??{}),G=Y.getRef(E8),Z=Y.getRef(b9);return v1(k4(J,(K)=>CC($,K,G,Z)),$)})),HD=function(){let X=typeof arguments[0]!=="string",Q=X?arguments[1]:arguments[0],Y=_7(X?arguments[2]:arguments[1]);if(X){let J=arguments[0];return T(m9(Q,Y),($)=>T5(J,$,Y))}return(J)=>T(m9(Q,Y),($)=>T5(J,$,Y))},wC=(X,Q)=>{return Q=typeof Q==="function"?Q:A8,e8(y9,(Y)=>({name:X,stack:Q,parent:Y}))},WD=g9.asEffect(),_D=h9.asEffect(),VD=B((X)=>p(X[0]),(X,Q,Y={})=>{let $=(Array.isArray(Q)?Q:[Q]).map((G)=>({span:G,attributes:Y}));return e8(X,h9,(G)=>[...G,...$])}),CC=(X,Q,Y,J)=>$0(()=>{if(X.status._tag==="Ended")return;X.end(J?Y.currentTimeNanosUnsafe():a3,Q)}),d9=(X,...Q)=>{let Y=Q.length===1?void 0:Q[0],J=Q[Q.length-1];return c(($)=>{let G=aJ($,X,Y),Z=$.getRef(E8);return O1(J0(()=>J(G)),(K)=>$0(()=>{if(G.status._tag==="Ended")return;G.end(Z.currentTimeNanosUnsafe(),K)}))})},s3=U1($7),T5=function(){let X=p(arguments[0]),Q=X?arguments[1]:arguments[0],Y=X?arguments[2]:arguments[1],J=b;if(Q._tag==="Span")Y=_7(Y),J=wC(Q.name,Y?.captureStackTrace);if(X)return s3(J(arguments[0]),Q);return($)=>s3(J($),Q)},DD=function(){let X=typeof arguments[0]!=="string",Q=X?arguments[1]:arguments[0],Y=_7(arguments[2]);if(X){let G=arguments[0];return d9(Q,arguments[2],(Z)=>T5(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)=>T5(G,K,Y))},qD=B((X)=>p(X[0]),(X,...Q)=>e8(X,g9,(Y)=>{let J={...Y};if(Q.length===1)Object.assign(J,Q[0]);else J[Q[0]]=Q[1];return J})),BD=(...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}),UD=c((X)=>{let Q=X.currentSpanLocal;return Q?A(Q):M0(new $8)}),OD=qC($7),E8=V0("effect/Clock",{defaultValue:()=>new zD}),TC=2147483647;class zD{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=$0(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return IC()}currentTimeNanos=$0(()=>this.currentTimeNanosUnsafe());sleep(X){let Q=S4(X);if(Q<=0)return j5;return w1((Y)=>{if(Q>TC)return;let J=setTimeout(()=>Y(X0),Q);return $0(()=>clearTimeout(J))})}}var aW=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))}(),IC=function(){let X=typeof process==="object"&&"hrtime"in process&&typeof process.hrtime.bigint==="function"?process.hrtime:void 0;if(!X)return aW;let Q=aW()-X.bigint();return()=>Q+X.bigint()}(),w6=(X)=>c((Q)=>X(Q.getRef(E8))),C6=(X)=>w6((Q)=>Q.sleep(S1(X))),FD=w6((X)=>X.currentTimeMillis);var p9="~effect/Cause/TimeoutError",LD=(X)=>M(X,p9);class y7 extends r8("TimeoutError"){[p9]=p9;constructor(X){super({message:X})}}var c9="~effect/Cause/IllegalArgumentError",PD=(X)=>M(X,c9);class sJ extends r8("IllegalArgumentError"){[c9]=c9;constructor(X){super({message:X})}}var f9="~effect/Cause/ExceededCapacityError",RD=(X)=>M(X,f9);class tJ extends r8("ExceededCapacityError"){[f9]=f9;constructor(X){super({message:X})}}var u9="~effect/Cause/AsyncFiberError",ND=(X)=>M(X,u9);class b7 extends r8("AsyncFiberError"){[u9]=u9;constructor(X){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:X})}}var l9="~effect/Cause/UnknownError",MD=(X)=>M(X,l9);class g7 extends r8("UnknownError"){[l9]=l9;constructor(X,Q){super({message:Q,cause:X})}}var jC=V0("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),EC=(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}},SC=w3(q1,EC),AD=O5(SC),eJ=V0("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([hC,mC])}),vC=V0("effect/Logger/LogToStderr",{defaultValue:IQ}),wD=function(){let X=typeof arguments[0]==="string"?[[arguments[0],arguments[1]]]:Object.entries(arguments[0]);return M6(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)),k4(U6(Q.context,XX),($)=>{let G=Q.getRef(s8),Z={...G};for(let K=0;K<X.length;K++){let[H,W]=X[K];if(G[H]!==W)continue;if(H in Y)Z[H]=Y[H];else delete Z[H]}return Q.setContext(K8(Q.context,s8,Z)),X0})}))},xC="~effect/Logger",kC={[xC]:{_Message:b,_Output:b},pipe(){return a(this,arguments)}},CD=(X)=>{let Q=Object.create(kC);return Q.log=X,Q},yC=(X)=>X.replace(/[\s="]/g,"_"),bC=(X,Q)=>{return`${yC(X[0])}=${Q-X[1]}ms`};var _8=(X)=>(...Q)=>{let Y=void 0;for(let J=0,$=Q.length;J<$;J++){let G=Q[J];if(V5(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(AD(J.minimumLogLevel,$))return X0;let G=J.getRef(E8),Z=J.getRef(eJ);if(Z.size>0){let K=new Date(G.currentTimeMillisUnsafe());for(let H of Z)H.log({cause:Y,fiber:J,date:K,logLevel:$,message:Q})}return X0})};var L6={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},Si={None:[],All:[],Trace:[L6.gray],Debug:[L6.blue],Info:[L6.green],Warn:[L6.yellow],Error:[L6.red],Fatal:[L6.bgBrightRed,L6.black]};var gC=(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")}`,TD=typeof process==="object"&&process!==null&&typeof process.stdout==="object"&&process.stdout!==null,vi=TD&&process.stdout.isTTY===!0,xi=TD||"Deno"in globalThis;var hC=CD(({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(W7),H="";for(let D of K)H+=` ${bC(D,Z)}`;let W=Y.getRef(s8);if(Object.keys(W).length>0)G.push(W);let V=Y.getRef(jC);(Y.getRef(vC)?V.error:V.log)(`[${gC(Q)}] ${J.toUpperCase()} (#${Y.id})${H}:`,...G)}),mC=CD(({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[H,W]of Object.entries(G))K[H]=W;if(K["effect.fiberId"]=Q.id,K["effect.logLevel"]=Y.toUpperCase(),X.reasons.length>0)K["effect.cause"]=O7(X);Z.event(SH(Array.isArray(J)&&J.length===1?J[0]:J),$.currentTimeNanosUnsafe(),K)});function dC(){o3.interruptChildren??=ZC}var ID=A(void 0);var jD=B((X)=>p(X[0]),(X,Q)=>hJ(X,(Y)=>c((J)=>{return pC(J,Y,Q?.defectsOnly),X0}))),pC=(X,Q,Y)=>{let J=X.getRef(cW);if(J.size===0)return;if(Y&&!D7(Q))return;let $={cause:Q,fiber:X,timestamp:X.getRef(E8).currentTimeNanosUnsafe()};J.forEach((G)=>G.report($))};var cC=W5,fC=_5,X$=V5,Q$=bH,uC=A4,lC=V6,rC=D6,GX=l8,oC=mQ,nC=F3,iC=L3,aC=I5,ZX=(X)=>new D5(X),KX=(X)=>new dQ(X),HX=sW,h7=Y_,sC=G_,tC=QJ,T6=U7,eC=e3,XT=XJ,S8=i1,QT=tW,YT=D7,JT=eW,$T=r9,GT=q7,ZT=X_,KT=Q_,HT=B7,WT=YJ,Y$=O7,_T=cQ,VT=w9,DT=$8,m7=j9,qT=W6,BT=P3,d7=dH,UT=p9,OT=LD,zT=y7,FT=c9,LT=PD,WX=sJ,PT=RD,RT=f9,NT=tJ,MT=u9,AT=ND,wT=b7,CT=l9,TT=MD,IT=g7,jT=q5,ET=J_,ST=$_;class ED extends l1()("effect/Cause/StackTrace"){}class SD extends l1()("effect/Cause/InterruptorStackTrace"){}var U0={};J6(U0,{zipWith:()=>Sj,zip:()=>Ej,yieldNowWith:()=>zj,yieldNow:()=>Oj,withTracerTiming:()=>LS,withTracerEnabled:()=>FS,withTracer:()=>zS,withSpanScoped:()=>SS,withSpan:()=>ES,withParentSpan:()=>vS,withLogger:()=>Gv,withLogSpan:()=>Hv,withFiber:()=>uq,withExecutionPlan:()=>JE,withErrorReporting:()=>$E,withConcurrency:()=>pE,whileLoop:()=>dq,when:()=>AE,void:()=>g4,validate:()=>Qj,useSpan:()=>jS,updateService:()=>mE,updateContext:()=>hE,unwrapReason:()=>gj,uninterruptibleMask:()=>aq,uninterruptible:()=>KS,undefined:()=>Zj,txRetry:()=>Fv,tx:()=>Bv,tryPromise:()=>x$,try:()=>h4,trackSuccesses:()=>_v,trackErrors:()=>Vv,trackDuration:()=>qv,trackDefects:()=>Dv,track:()=>Wv,tracer:()=>OS,timeoutOrElse:()=>WE,timeoutOption:()=>HE,timeout:()=>KE,timed:()=>DE,tapErrorTag:()=>nj,tapError:()=>rq,tapDefect:()=>oq,tapCauseIf:()=>ij,tapCauseFilter:()=>aj,tapCause:()=>t7,tap:()=>lq,sync:()=>cq,suspend:()=>pq,succeedSome:()=>s7,succeedNone:()=>x8,succeed:()=>h,spanLinks:()=>wS,spanAnnotations:()=>AS,sleep:()=>VE,serviceOption:()=>gE,service:()=>bE,scopedWith:()=>uE,scoped:()=>fE,scope:()=>cE,scheduleFrom:()=>sq,schedule:()=>US,satisfiesSuccessType:()=>Pv,satisfiesServicesType:()=>Nv,satisfiesErrorType:()=>Rv,sandbox:()=>XE,runSyncWith:()=>nS,runSyncExitWith:()=>iS,runSyncExit:()=>e7,runSync:()=>AX,runPromiseWith:()=>lS,runPromiseExitWith:()=>oS,runPromiseExit:()=>rS,runPromise:()=>h$,runForkWith:()=>cS,runFork:()=>h5,runCallbackWith:()=>fS,runCallback:()=>uS,retryOrElse:()=>ej,retry:()=>tj,result:()=>Aj,requestUnsafe:()=>kS,request:()=>xS,replicateEffect:()=>BS,replicate:()=>qS,repeatOrElse:()=>DS,repeat:()=>VS,raceFirst:()=>OE,raceAllFirst:()=>BE,raceAll:()=>qE,race:()=>UE,provideServiceEffect:()=>dE,provideService:()=>nq,provideContext:()=>yE,provide:()=>kE,promise:()=>Gj,partition:()=>Xj,orElseSucceed:()=>GE,orDie:()=>oj,option:()=>wj,onInterrupt:()=>ZS,onExitPrimitive:()=>eE,onExitIf:()=>XS,onExitFilter:()=>QS,onExit:()=>g$,onErrorIf:()=>sE,onErrorFilter:()=>tE,onError:()=>aE,never:()=>Kj,matchEffect:()=>jE,matchEager:()=>b$,matchCauseEffectEager:()=>TE,matchCauseEffect:()=>IE,matchCauseEager:()=>CE,matchCause:()=>wE,match:()=>y$,mapErrorEager:()=>y1,mapError:()=>lj,mapEager:()=>m5,mapBothEager:()=>t0,mapBoth:()=>rj,map:()=>MX,makeSpanScoped:()=>IS,makeSpan:()=>TS,logWithLevel:()=>tS,logWarning:()=>Qv,logTrace:()=>$v,logInfo:()=>Yv,logFatal:()=>Xv,logError:()=>m$,logDebug:()=>Jv,log:()=>eS,linkSpans:()=>CS,let:()=>_j,isSuccess:()=>SE,isFailure:()=>EE,isEffect:()=>Y4,interruptibleMask:()=>HS,interruptible:()=>GS,interrupt:()=>iq,ignoreCause:()=>YE,ignore:()=>QE,gen:()=>Dj,fromYieldable:()=>Rj,fromResult:()=>Fj,fromOption:()=>Lj,fromNullishOr:()=>Pj,forkScoped:()=>gS,forkIn:()=>bS,forkDetach:()=>hS,forkChild:()=>yS,forever:()=>_S,forEach:()=>$j,fnUntracedEager:()=>wX,fnUntraced:()=>aS,fn:()=>sS,flip:()=>jj,flatten:()=>Nj,flatMapEager:()=>q8,flatMap:()=>RX,firstSuccessOf:()=>ZE,findFirstFilter:()=>Jj,findFirst:()=>Yj,filterOrFail:()=>NE,filterOrElse:()=>PE,filterMapOrFail:()=>ME,filterMapOrElse:()=>RE,filterMapEffect:()=>LE,filterMap:()=>FE,filter:()=>zE,fiberId:()=>pS,fiber:()=>dS,failSync:()=>qj,failCauseSync:()=>Uj,failCause:()=>Bj,fail:()=>v,exit:()=>NX,eventually:()=>sj,ensuring:()=>iE,effectify:()=>Lv,die:()=>fq,delay:()=>_E,currentSpan:()=>NS,currentParentSpan:()=>MS,contextWith:()=>xE,context:()=>vE,clockWith:()=>tq,catchTags:()=>kj,catchTag:()=>xj,catchReasons:()=>bj,catchReason:()=>yj,catchNoSuchElement:()=>cj,catchIf:()=>dj,catchFilter:()=>pj,catchEager:()=>d5,catchDefect:()=>mj,catchCauseIf:()=>fj,catchCauseFilter:()=>uj,catchCause:()=>hj,catch:()=>vj,callback:()=>k$,cachedWithTTL:()=>JS,cachedInvalidateWithTTL:()=>$S,cached:()=>YS,bindTo:()=>Wj,bind:()=>Vj,awaitAllChildren:()=>mS,asVoid:()=>Ij,asSome:()=>Tj,as:()=>Cj,annotateSpans:()=>PS,annotateLogsScoped:()=>Kv,annotateLogs:()=>Zv,annotateCurrentSpan:()=>RS,andThen:()=>Mj,all:()=>eI,addFinalizer:()=>nE,acquireUseRelease:()=>oE,acquireRelease:()=>lE,acquireDisposable:()=>rE,abortSignal:()=>WS,YieldableClass:()=>mq,Transaction:()=>PX,Do:()=>Hj});var D8={};J6(D8,{void:()=>$$,succeed:()=>_X,match:()=>fT,mapError:()=>p7,mapBoth:()=>lT,map:()=>uT,isSuccess:()=>V8,isFailure:()=>G$,isExit:()=>J$,interrupt:()=>xT,hasInterrupts:()=>bT,hasFails:()=>kT,hasDies:()=>yT,getSuccess:()=>c7,getCause:()=>nT,findErrorOption:()=>iT,findError:()=>pT,findDefect:()=>cT,filterValue:()=>hT,filterSuccess:()=>gT,filterFailure:()=>mT,filterCause:()=>dT,failCause:()=>VX,fail:()=>x5,die:()=>vT,asVoidAll:()=>oT,asVoid:()=>rT});var J$=z3,_X=j0,VX=N1,x5=M1,vT=C8,xT=S_,$$=n1;var V8=E5,G$=BJ,kT=h_,yT=g_,bT=b_,gT=v_,hT=x_,mT=k_,dT=i9,pT=UJ,cT=y_,fT=m_,uT=OJ,p7=zJ,lT=FJ,rT=d_,oT=LJ,c7=p_,nT=c_,iT=f_;var aT="~effect/Deferred";var sT={[aT]:{_A:b,_E:b},pipe(){return a(this,arguments)}},vD=()=>{let X=Object.create(sT);return X.resumes=void 0,X.effect=void 0,X};var xD=(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 tT=B(2,(X,Q)=>$0(()=>eT(X,Q))),kD=tT;var eT=(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 yD=s8;var bD=W7;var gD=QX;var f7=FV,Z$=xJ;var mD="~effect/Layer",hD="~effect/Layer/MemoMap",dD=(X)=>M(X,mD),YI={[mD]:{_ROut:b,_E:b,_RIn:b},pipe(){return a(this,arguments)}},pD=(X)=>{let Q=Object.create(YI);return Q.build=X,Q},cD=(X)=>pD((Q,Y)=>{let J=f7(Y);return O1(X(Q,J),($)=>$._tag==="Failure"?Z$(J,$):X0)});class fD{get[hD](){return hD}map=new Map;getOrElseMemoize(X,Q,Y){if(this.map.has(X)){let Z=this.map.get(X);return Z.observers++,t8(k4(Q,(K)=>Z.finalizer(K)),Z.effect)}let J=gD(),$=vD(),G={observers:1,effect:xD($),finalizer:(Z)=>i(()=>{if(G.observers--,G.observers===0)return this.map.delete(X),Z$(J,Z);return X0})};return this.map.set(X,G),k4(Q,G.finalizer).pipe(T(()=>Y(this,J)),O1((Z)=>{return G.effect=Z,kD($,Z)}))}}var K$=()=>new fD;class u7 extends l1()("effect/Layer/CurrentMemoMap"){static getOrCreate=WW(this,K$)}var H$=B(3,(X,Q,Y)=>U1(L0(X.build(Q,Y),K8(u7,Q)),u7,Q));var uD=B(2,(X,Q)=>c((Y)=>H$(X,u7.getOrCreate(Y.context),Q)));var lD=(X)=>pD(i0(A(X)));var rD=(X,Q,Y)=>{let J=f7(Y,"parallel");return o1(X,($)=>$.build(Q,f7(J,"sequential")),{concurrency:X.length}).pipe(L0(($)=>DW(...$)))},oD=(...X)=>cD((Q,Y)=>rD(X,Q,Y));var JI=(X,Q,Y)=>cD((J,$)=>T(Array.isArray(Q)?rD(Q,J,$):Q.build(J,$),(G)=>X.build(J,$).pipe(X4(G),L0((Z)=>Y(Z,G))))),nD=B(2,(X,Q)=>JI(X,Q,b));var aD="~effect/ExecutionPlan";var $I={[aD]:aD,get withRequirements(){let X=this;return x4((Q)=>A(GI(X.steps.map((Y)=>({...Y,provide:dD(Y.provide)?nD(Y.provide,lD(Q)):Y.provide})))))},pipe(){return a(this,arguments)}},GI=(X)=>{let Q=Object.create($I);return Q.steps=X,Q};var sD=V0("effect/ExecutionPlan/CurrentMetadata",{defaultValue:i0({attempt:0,stepIndex:0})});var tD=class extends $6{constructor(X){super();if(X)Object.assign(this,X)}};var eD=r8;var l7="~effect/time/DateTime",r7="~effect/time/DateTime/TimeZone",Yq={[l7]:l7,pipe(){return a(this,arguments)},[a0](){return this.toString()},toJSON(){return UX(this).toJSON()}},KI={...Yq,_tag:"Utc",[H0](){return c8(this.epochMilliseconds)},[W0](X){return y5(X)&&X._tag==="Utc"&&this.epochMilliseconds===X.epochMilliseconds},toString(){return`DateTime.Utc(${UX(this).toJSON()})`}},HI={...Yq,_tag:"Zoned",[H0](){return f0(c8(this.epochMilliseconds))(s(this.zone))},[W0](X){return y5(X)&&X._tag==="Zoned"&&this.epochMilliseconds===X.epochMilliseconds&&o(this.zone,X.zone)},toString(){return`DateTime.Zoned(${N$(this)})`}},Jq={[r7]:r7,[a0](){return this.toString()}},WI={...Jq,_tag:"Named",[H0](){return C0(`Named:${this.id}`)},[W0](X){return I6(X)&&X._tag==="Named"&&this.id===X.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:"TimeZone",_tag:"Named",id:this.id}}},_I={...Jq,_tag:"Offset",[H0](){return C0(`Offset:${this.offset}`)},[W0](X){return I6(X)&&X._tag==="Offset"&&this.offset===X.offset},toString(){return`TimeZone.Offset(${L$(this.offset)})`},toJSON(){return{_id:"TimeZone",_tag:"Offset",offset:this.offset}}},v8=(X,Q,Y)=>{let J=Object.create(HI);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},y5=(X)=>M(X,l7);var I6=(X)=>M(X,r7),$q=(X)=>I6(X)&&X._tag==="Offset",Gq=(X)=>I6(X)&&X._tag==="Named",Zq=(X)=>X._tag==="Utc",V$=(X)=>X._tag==="Zoned",Kq=s0((X,Q)=>X.epochMilliseconds===Q.epochMilliseconds);var D$=(X)=>{let Q=Object.create(KI);return Q.epochMilliseconds=X,Object.defineProperty(Q,"partsUtc",{value:void 0,enumerable:!1,writable:!0}),Q},k5=(X)=>{let Q=X.getTime();if(Number.isNaN(Q))throw new WX("Invalid date");return D$(Q)},q$=(X)=>{if(y5(X))return X;else if(X instanceof Date)return k5(X);else if(typeof X==="object"){if("epochMilliseconds"in X)return D$(X.epochMilliseconds);let Q=new Date(0);return FI(Q,X),k5(Q)}else if(typeof X==="string"&&!VI(X))return k5(new Date(X+"Z"));return k5(new Date(X))},VI=(X)=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(X),DI=-8639999956800000,qI=8639999949600000,B$=(X,Q)=>{let Y=Q?.timeZone;if(Y===void 0&&y5(X)&&V$(X))return X;let J=q$(X);if(J.epochMilliseconds<DI||J.epochMilliseconds>qI)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;$=BX(G)}else if(I6(Y))$=Y;else if(typeof Y==="number")$=BX(Y);else{let G=z$(Y);if(T0(G))throw new WX(`Invalid time zone: ${Y}`);$=G.value}if(Q?.adjustForTimeZone!==!0)return v8(J.epochMilliseconds,$,J.partsUtc);return LI(J.epochMilliseconds,$,Q?.disambiguation??"compatible")},W$=B6(B$),Hq=B6(q$),BI=/^(.{17,35})\[(.+)\]$/,Wq=(X)=>{let Q=BI.exec(X);if(Q===null){let $=R$(X);return $!==null?W$(X,{timeZone:$}):x()}let[,Y,J]=Q;return W$(Y,{timeZone:J})};var _q=(X)=>D$(X.epochMilliseconds);var qX=new Map,UI={day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"longOffset",fractionalSecondDigits:3,hourCycle:"h23"},OI=(X)=>{let Q=X.resolvedOptions().timeZone;if(qX.has(Q))return qX.get(Q);let Y=Object.create(WI);return Y.id=Q,Y.format=X,qX.set(Q,Y),Y},U$=(X)=>{if(qX.has(X))return qX.get(X);try{return OI(new Intl.DateTimeFormat("en-US",{...UI,timeZone:X}))}catch{throw new WX(`Invalid time zone: ${X}`)}},BX=(X)=>{let Q=Object.create(_I);return Q.offset=X,Q},O$=B6(U$);var zI=/^(?:GMT|[+-])/,z$=(X)=>{if(zI.test(X)){let Q=R$(X);return Q===null?x():F(BX(Q))}return O$(X)},Vq=(X)=>{if(X._tag==="Offset")return L$(X.offset);return X.id};var UX=(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},F$=(X)=>{return o7(X).getTime()-P$(X)},L$=(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")}`},Dq=(X)=>L$(F$(X)),P$=(X)=>X.epochMilliseconds;var FI=(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 Qq=86400000,LI=(X,Q,Y)=>{if(Q._tag==="Offset")return v8(X-Q.offset,Q);let J=DX(X-Qq,X,Q),$=DX(X+Qq,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 W=v8(X-J,Q),V=o7(W).getTime();if(X!==V)switch(Y){case"reject":{let _=new Date(X).toISOString();throw RangeError(`Gap time: ${_} does not exist in time zone ${Q.id}`)}case"earlier":return v8(X-$,Q);case"compatible":case"later":return W}return W}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 W=new Date(X).toISOString();throw RangeError(`Ambiguous time: ${W} occurs twice in time zone ${Q.id}`)}}return v8(X-$,Q)},PI=/([+-])(\d{2}):(\d{2})$/,R$=(X)=>{let Q=PI.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 $=R$(J);if($===null)return F$(v8(Q,Y));return $};var qq=(X)=>UX(X).toISOString();var _$=(X)=>{let Q=o7(X);return X._tag==="Utc"?Q.toISOString():`${Q.toISOString().slice(0,-1)}${Dq(X)}`},N$=(X)=>X.zone._tag==="Offset"?_$(X):`${_$(X)}[${X.zone.id}]`;var Xa=globalThis.Number;var Uq=B(2,(X,Q)=>{let Y=Bq(X),J=Bq(Q),$=Y>J?Y:J,G=parseInt(X.toFixed($).replace(".","")),Z=parseInt(Q.toFixed($).replace(".",""));return G%Z/Math.pow(10,$)});function Bq(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 Oq=o8((X,Q)=>Math.max(X,Q),-1/0),zq=o8((X,Q)=>Math.min(X,Q),1/0);var Qa=globalThis.String;var Fq=(X)=>X.trim();var M$=B(2,(X,Q)=>S5(X,wI,(Y)=>Q(Y)));var AI=M5(S8,(X)=>m7(X)?l(X):f(X));var wI=M5(S8,(X)=>m7(X)?l(X.value):f(X));var Lq=B(2,(X,Q)=>j8(X,{onSuccess:Q.onSuccess,onFailure:(Y)=>{let J=AI(Y);return!u(J)?Q.onDone(J.success.value):Q.onFailure(J.failure)}}));var Rq="~effect/Schedule";var j6=V0("effect/Schedule/CurrentMetadata",{defaultValue:i0({input:void 0,output:void 0,duration:R5,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),CI={[Rq]:{_Out:b,_In:b,_Env:b},pipe(){return a(this,arguments)}},A$=(X)=>M(X,Rq),w$=(X)=>{let Q=Object.create(CI);return Q.step=X,Q},C$=()=>{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}}},TI=(X)=>w$(L0(X,(Q)=>{let Y=C$();return(J,$)=>Q(Y(J,$))})),T$=(X)=>a1(X.step,(Q)=>A(()=>N0(Q))),n7=(X)=>w6((Q)=>L0(T$(X),(Y)=>{let J=C$();return($)=>i(()=>{let G=Q.currentTimeMillisUnsafe();return T(Y(G,$),([Z,K])=>{let H=J(G,$);return H.output=Z,H.duration=K,v1(C6(K),H)})})}));var I$=(X)=>w$(L0(T$(X),(Q)=>(Y,J)=>Lq(Q(Y,J),{onSuccess:($)=>A([J,$[1]]),onFailure:N0,onDone:()=>d7(J)}))),Nq=(X)=>OX(j$,({attempt:Q})=>A(Q<=X));var II=(X)=>{let Q=S1(X);return TI(A((Y)=>A([Y.attempt-1,Q])))};var OX=B(2,(X,Q)=>w$(L0(T$(X),(Y)=>{let J=C$();return($,G)=>T(Y($,G),(Z)=>{let[K,H]=Z,W=Q({...J($,G),output:K,duration:H});return T(p(W)?W:A(W),(V)=>V?A(Z):d7(K))})})));var j$=II(R5);var jI=(X,Q,Y)=>j7((J)=>T(Y?.local?H$(Q,K$(),J):uD(Q,J),($)=>X4(X,$))),i7=B((X)=>p(X[0]),(X,Q,Y)=>I3(Q)?X4(X,Q):jI(X,Array.isArray(Q)?oD(...Q):Q,Y));var E$=B(3,(X,Q,Y)=>T(n7(Q),(J)=>{let $=j6.defaultValue();return x1(A7(R6(T(i(()=>U1(X,j6,$)),J),(G)=>$0(()=>{$=G})),{disableYield:!0}),(G)=>j9(G)?A(G.value):Y(G,$.attempt===0?x():F($)))})),S$=B(3,(X,Q,Y)=>T(n7(Q),(J)=>{let $=j6.defaultValue(),G,Z=x1(i(()=>U1(X,j6,$)),(K)=>{return G=K,T(J(K),(H)=>{return $=H,Z})});return M$(Z,(K)=>J0(()=>Y(G,K)))})),wq=B(2,(X,Q)=>{let Y=typeof Q==="function"?Q(b):A$(Q)?Q:FX(Q);return E$(X,Y,M0)}),zX=B(2,(X,Q)=>{let Y=typeof Q==="function"?Q(b):A$(Q)?Q:FX(Q);return S$(X,Y,M0)}),Cq=B(3,(X,Q,Y)=>T(n7(Y),(J)=>{let $=j6.defaultValue(),G=i(()=>U1(X,j6,$));return x1(T(J(Q),(Z)=>{$=Z;let K=i0(T(G,J));return y4({while:P4,body:K,step(H){$=H}})}),(Z)=>j9(Z)?A(Z.value):M0(Z))})),EI=I$(j$),FX=(X)=>{let Q=X.schedule?I$(X.schedule):EI;if(X.while)Q=OX(Q,({input:Y})=>{let J=X.while(Y);return p(J)?J:A(J)});if(X.until)Q=OX(Q,({input:Y})=>{let J=X.until(Y);return p(J)?L0(J,($)=>!$):A(!J)});if(X.times!==void 0)Q=OX(Q,({attempt:Y})=>A(Y<=X.times));return Q};var jq=B(2,(X,Q)=>i(()=>{let Y=0,J={attempt:0,stepIndex:0},$=M7(sD,$0(()=>{return J={attempt:J.attempt+1,stepIndex:Y},J})),G;return T(y4({while:()=>Y<Q.steps.length&&(G===void 0||u(G)),body(){let Z=Q.steps[Y],K=$(i7(X,Z.provide));if(G){let H=!1,W=K;K=i(()=>{if(H)return W;return H=!0,G.asEffect()}),K=zX(K,Iq(Z,!1))}else{let H=Iq(Z,!0);K=H?zX(K,H):K}return v4(K)},step(Z){G=Z,Y++}}),()=>G.asEffect())})),Iq=(X,Q)=>{if(!Q)return FX({schedule:X.schedule?X.schedule:X.attempts?void 0:SI,times:X.attempts,while:X.while});else if(X.attempts===1||!(X.schedule||X.attempts))return;return FX({schedule:X.schedule,while:X.while,times:X.attempts?X.attempts-1:void 0})},SI=Nq(1);var xI="~effect/Request",kI=jH({_E:(X)=>X,_A:(X)=>X,_R:(X)=>X}),za={...yH,[xI]:kI};var Eq=(X)=>X;var vq=B(2,(X,Q)=>{let Y=(J)=>w1(($)=>{let G=kq(J,X,$,z7());return yI(J,G)});return p(Q)?T(Q,Y):Y(Q)}),xq=(X,Q)=>{let Y=kq(Q.resolver,X,Q.onExit,{context:Q.context,currentScheduler:E1(Q.context,k9)});return()=>yq(Q.resolver,Y)},a7=[],v$=new Map,kq=(X,Q,Y,J)=>{let $=v$.get(X);if(!$)$=new Map,v$.set(X,$);let G,Z=!1,K=Eq({request:Q,context:J.context,uninterruptible:!1,completeUnsafe(W){if(Z)return;Z=!0,Y(W),G?.entrySet.delete(K)}});if(X.preCheck!==void 0&&!X.preCheck(K))return K;let H=X.batchKey(K);if(G=$.get(H),!G){if(a7.length>0)G=a7.pop(),G.key=H,G.resolver=X,G.map=$;else{let W={key:H,resolver:X,map:$,entrySet:new Set,entries:new Set,delayEffect:T(i(()=>W.resolver.delay),(V)=>Sq(W)),run:O1(i(()=>W.resolver.runAll(Array.from(W.entries),W.key)),(V)=>{for(let _ of W.entrySet)_.completeUnsafe(V._tag==="Success"?C8(Error("Effect.request: RequestResolver did not complete request",{cause:_.request})):V);if(W.entries.clear(),a7.length<128)W.entrySet.clear(),W.key=void 0,W.fiber=void 0,a7.push(W);return X0})};G=W}$.set(H,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)(Sq(G),{scheduler:J.currentScheduler}),K},yq=(X,Q)=>{if(Q.uninterruptible)return;let Y=v$.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()},yI=(X,Q)=>$0(()=>yq(X,Q));function Sq(X){if(!X.map.has(X.key))return X0;return X.map.delete(X.key),X.run}var mI="effect/Metric/CurrentMetricAttributes",dI=V0(mI,{defaultValue:()=>({})}),pI="~effect/observability/Metric/MetricRegistryKey",cI=V0(pI,{defaultValue:()=>new Map}),bq="~effect/observability/Metric";class b5{[bq]=bq;#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,dI);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=sI(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=nI(this,Q),J=E1(X,cI);if(J.has(Y))return J.get(Y);let $=this.createHooks(),G={id:this.id,type:this.type,description:this.description,attributes:b4(Q),hooks:$};return J.set(Y,G),G}pipe(){return a(this,arguments)}}var gq=BigInt(0);class fI extends b5{type="Counter";#X;#Q;constructor(X,Q){super(X,Q?.description,b4(Q?.attributes));this.#X=Q?.bigint??!1,this.#Q=Q?.incremental??!1}createHooks(){let X=this.#X?gq:0,Q=this.#Q?this.#X?(J)=>J>=gq:(J)=>J>=0:(J)=>!0;return LX(()=>({count:X,incremental:this.#Q}),(J)=>{if(Q(J))X=X+J})}}class uI extends b5{type="Gauge";#X;constructor(X,Q){super(X,Q?.description,b4(Q?.attributes));this.#X=Q?.bigint??!1}createHooks(){let X=this.#X?BigInt(0):0;return LX(()=>({value:X}),(J)=>{X=J},(J)=>{X=X+J})}}class lI extends b5{type="Frequency";#X;constructor(X,Q){super(X,Q?.description,b4(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 LX(()=>({occurrences:X}),(Y)=>{let J=X.get(Y)??0;X.set(Y,J+1)})}}class rI extends b5{type="Histogram";#X;constructor(X,Q){super(X,Q?.description,b4(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;j4(x9(X,q1),(V,_)=>{J[_]=V});let H=(V)=>{let _=0,D=Q;while(_!==D){let q=Math.floor(_+(D-_)/2),U=J[q];if(V<=U)D=q;else _=q;if(D===_+1)if(V<=J[_])D=_;else _=D}if(Y[_]=Y[_]+1,$=$+1,G=G+V,V<Z)Z=V;if(V>K)K=V},W=()=>{let V=v3(Q),_=0;for(let D=0;D<Q;D++){let q=J[D],U=Y[D];_=_+U,V[D]=[q,_]}return V};return LX(()=>({buckets:W(),count:$,min:Z,max:K,sum:G}),H)}}class oI extends b5{type="Summary";#X;#Q;#Y;constructor(X,Q){super(X,Q?.description,b4(Q?.attributes));this.#X=Math.max(S4(S1(Q.maxAge)),0),this.#Q=Q.maxSize,this.#Y=Q.quantiles}createHooks(){let X=x9(this.#Y,q1),Q=v3(this.#Q);for(let _ of this.#Y)if(_<0||_>1)throw Error(`Quantile must be between 0 and 1, found: ${_}`);let Y=0,J=0,$=0,G=Number.MAX_VALUE,Z=Number.MIN_VALUE,K=(_)=>{let D=[],q=0;while(q<this.#Q){let L=Q[q];if($1(L)){let[N,P]=L,y=_-N;if(y>=0&&y<=this.#X)D.push(P)}q=q+1}let U=x9(D,q1),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]]})},H=(_,D)=>{if(this.#Q>0){let q=Y%this.#Q;Q[q]=[D,_],Y=Y+1}if(J=J+1,$=$+_,_<G)G=_;if(_>Z)Z=_};return LX((_)=>{let D=E1(_,E8);return{quantiles:K(D.currentTimeMillisUnsafe()),count:J,min:G,max:Z,sum:$}},([_,D])=>H(_,D))}}var g5=B(2,(X,Q)=>x4((Y)=>$0(()=>X.updateUnsafe(Q,Y))));function nI(X,Q){let Y=`${X.type}:${X.id}`;if($1(X.description))Y+=`:${X.description}`;if($1(Q))Y+=`:${iI(Q)}`;return Y}function LX(X,Q,Y){return{get:X,update:Q,modify:Y??Q}}function iI(X){return aI(Array.isArray(X)?X:Object.entries(X))}function aI(X){return X.map(([Q,Y])=>`${Q}=${Y}`).join(",")}function sI(X,Q){return{...b4(X),...b4(Q)}}function b4(X){if($1(X)&&Array.isArray(X))return X.reduce((Q,[Y,J])=>{return Q[Y]=J,Q},{});return X}class mq{[Symbol.iterator](){return new K6(this)}}var Y4=p,eI=v7,Xj=fJ,Qj=SV,Yj=vV,Jj=kV,$j=o1,dq=y4,Gj=KJ,x$=B_,h=A,x8=L7,s7=ZJ,pq=i,cq=$0,g4=X0;var Zj=ID;var k$=w1,Kj=WJ,Hj=pV,Wj=cV,_j=uV;var Vj=fV,Dj=F_,v=M0,qj=P7,Bj=N0,Uj=D_,fq=P6,h4=q_;var Oj=j5,zj=GJ,uq=c,Fj=__,Lj=W_,Pj=V_,Rj=o9,RX=T,Nj=C_,Mj=t8,lq=R6,Aj=v4,wj=_V,NX=e9,MX=L0,Cj=v1,Tj=R7,Ij=n9,jj=R_,Ej=RJ,Sj=NJ,vj=x1;var xj=CJ,kj=YV,yj=JV,bj=$V,gj=GV,hj=a1,mj=s_,dj=s9,pj=C7,cj=a_,fj=AJ,uj=S5,lj=TJ,rj=IJ,oj=jJ,rq=wJ,nj=XV,t7=t_,ij=e_,aj=w7,oq=QV,sj=EJ,tj=zX,ej=S$,XE=N_,QE=HV,YE=WV,JE=jq,$E=jD,GE=ZV,ZE=KV,KE=UV,HE=OV,WE=vJ,_E=BV,VE=C6,DE=zV,qE=DJ,BE=qJ,UE=M_,OE=N7,zE=hV,FE=mV,LE=dV,PE=uJ,RE=lJ,NE=o_,ME=gV,AE=n_,y$=T7,b$=t9,wE=SJ,CE=VV,TE=A_,IE=j8,jE=N6,EE=DV,SE=qV,vE=PJ,xE=x4,kE=i7,yE=X4,bE=u_,gE=l_,hE=a9,mE=e8,nq=U1,dE=M7,pE=r_,cE=YX,fE=kJ,uE=j7,lE=E7,rE=AV,oE=MV,nE=yJ,iE=PV,aE=hJ,sE=RV,tE=mJ,eE=v5,g$=O1,XS=bJ,QS=gJ,YS=wV,JS=pJ,$S=dJ,iq=CV,GS=cJ,ZS=NV,KS=M6,aq=JX,HS=jV,WS=EV,_S=A7,VS=wq,DS=E$,qS=MJ,BS=i_,US=B(2,(X,Q)=>sq(X,void 0,Q)),sq=Cq,OS=YD,zS=JD,FS=$D,LS=GD,PS=qD,RS=BD,NS=UD,MS=OD,AS=WD,wS=_D,CS=VD,TS=KD,IS=m9,jS=d9,ES=DD,SS=HD,vS=T5,xS=vq,kS=xq,yS=lV,bS=rJ,gS=nV,hS=rV,mS=oV,dS=O_,pS=z_,h5=iV,cS=Q4,fS=oJ,uS=aV,h$=tV,lS=nJ,rS=sV,oS=x7,AX=XD,nS=iJ,e7=eV,iS=k7,aS=_J,sS=L_,tq=w6,tS=_8,eS=_8(),Xv=_8("Fatal"),Qv=_8("Warn"),m$=_8("Error"),Yv=_8("Info"),Jv=_8("Debug"),$v=_8("Trace"),Gv=B(2,(X,Q)=>e8(X,eJ,(Y)=>new Set([...Y,Q]))),Zv=B((X)=>Y4(X[0]),(X,...Q)=>e8(X,yD,(Y)=>{let J={...Y};if(Q.length===1)Object.assign(J,Q[0]);else J[Q[0]]=Q[1];return J})),Kv=wD,Hv=B(2,(X,Q)=>T(FD,(Y)=>e8(X,bD,(J)=>{return[[Q,Y],...J]}))),Wv=B((X)=>Y4(X[0]),(X,Q,Y)=>g$(X,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return g5(Q,$)})),_v=B((X)=>Y4(X[0]),(X,Q,Y)=>lq(X,(J)=>{let $=Y===void 0?J:Y(J);return g5(Q,$)})),Vv=B((X)=>Y4(X[0]),(X,Q,Y)=>rq(X,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return g5(Q,$)})),Dv=B((X)=>Y4(X[0]),(X,Q,Y)=>oq(X,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return g5(Q,$)})),qv=B((X)=>Y4(X[0]),(X,Q,Y)=>tq((J)=>{let $=J.currentTimeNanosUnsafe();return g$(X,()=>{let G=J.currentTimeNanosUnsafe(),Z=IW(S1(G),S1($)),K=Y===void 0?Z:J0(()=>Y(Z));return g5(Q,K)})}));class PX extends l1()("effect/Effect/Transaction"){}var Bv=(X)=>uq((Q)=>{if(Q.context.mapUnsafe.has(PX.key))return X;let Y={journal:new Map,retry:!1},J;return aq(($)=>RX(dq({while:()=>!J,body:i0($(X).pipe(nq(PX,Y),t7(()=>{if(!Y.retry)return g4;return $(Ov(Y))}),NX)),step(G){if(Y.retry||!Uv(Y))return hq(Y);if(V8(G))zv(Q,Y);else hq(Y);J=G}}),()=>J))}),Uv=(X)=>{for(let[Q,{version:Y}]of X.journal)if(Q.version!==Y)return!1;return!0},Ov=(X)=>pq(()=>{let Q={},Y=Array.from(X.journal.keys()),J=()=>{for(let $ of Y)$.pending.delete(Q)};return k$(($)=>{let G=()=>{J(),$(g4)};for(let Z of Y)Z.pending.set(Q,G);return cq(J)})});function zv(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 hq(X){X.retry=!1,X.journal.clear()}var Fv=RX(PX.asEffect(),(X)=>{return X.retry=!0,iq}),Lv=(X,Q,Y)=>(...J)=>k$(($)=>{try{X(...J,(G,Z)=>{if(G)$(v(Q?Q(G,J):G));else $(h(Z))})}catch(G){$(Y?v(Y(G,J)):fq(G))}}),Pv=()=>(X)=>X,Rv=()=>(X)=>X,Nv=()=>(X)=>X,m5=T_,y1=I_,t0=j_,q8=w_,d5=E_,wX=P_;var Mv=(X,Q)=>{if(V8(X))return Q(0);if(h7(X.cause))return Q(130);return Q(Av(T6(X.cause)))},QB=(X)=>B((Q)=>Y4(Q[0]),(Q,Y)=>{let J=Y?.disableErrorReporting===!0?h5(Q):h5(t7(Q,(G)=>{if(h7(G))return g4;return wv(T6(G))?m$(G):g4}));try{let G=globalThis.setInterval(G5,2147483647);J.addObserver(()=>{clearInterval(G)})}catch{}let $=Y?.teardown??Mv;return X({fiber:J,teardown:$})}),eq="~effect/Runtime/errorExitCode",Av=(X)=>{if(typeof X==="object"&&X!==null&&eq in X){let Q=X[eq];if(typeof Q==="number")return Q}return 1},XB="~effect/Runtime/errorReported",wv=(X)=>{if(typeof X==="object"&&X!==null&&XB in X){let Q=X[XB];if(typeof Q==="boolean")return Q}return!0};var YB=QB(({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 Iv=YB;var w={};J6(w,{withDecodingDefaultTypeKey:()=>Wu,withDecodingDefaultType:()=>_u,withDecodingDefaultKey:()=>QH,withDecodingDefault:()=>MN,withConstructorDefault:()=>NN,toType:()=>P1,toTaggedUnion:()=>AN,toStandardSchemaV1:()=>Vf,toStandardJSONSchemaV1:()=>Df,toRepresentation:()=>BM,toJsonSchemaDocument:()=>UM,toIsoSource:()=>Pr,toIsoFocus:()=>Rr,toIso:()=>Lr,toFormatter:()=>Zr,toEquivalence:()=>Hr,toEncoderXml:()=>Vr,toEncoded:()=>U9,toDifferJsonPatch:()=>Mr,toCodecStringTree:()=>PM,toCodecJson:()=>OM,toCodecIso:()=>FM,toArbitraryLazy:()=>qM,toArbitrary:()=>$r,tagDefaultOmit:()=>Vu,tag:()=>Q5,suspend:()=>zN,revealCodec:()=>Wf,revealBottom:()=>Gf,resolveAnnotationsKey:()=>Ir,resolveAnnotations:()=>Tr,requiredKey:()=>kf,required:()=>yf,refine:()=>Ju,redact:()=>JH,readonlyKey:()=>gf,overrideToFormatter:()=>Gr,overrideToEquivalence:()=>Kr,overrideToCodecIso:()=>Nr,optionalKey:()=>X5,optional:()=>B9,mutableKey:()=>bf,mutable:()=>Qu,middlewareEncoding:()=>LN,middlewareDecoding:()=>eK,makeIsMultipleOf:()=>IN,makeIsLessThanOrEqualTo:()=>AQ,makeIsLessThan:()=>MQ,makeIsGreaterThanOrEqualTo:()=>NQ,makeIsGreaterThan:()=>RQ,makeIsBetween:()=>wQ,makeFilterGroup:()=>Bu,makeFilter:()=>F0,make:()=>I,link:()=>O0,isUppercased:()=>wu,isUnique:()=>yN,isUncapitalized:()=>Iu,isUint32:()=>ku,isUUID:()=>Lu,isULID:()=>Pu,isTrimmed:()=>wN,isStringSymbol:()=>zu,isStringFinite:()=>Uu,isStringBigInt:()=>Ou,isStartsWith:()=>Nu,isSizeBetween:()=>tu,isSchemaError:()=>_f,isSchema:()=>m2,isPropertyNames:()=>Yl,isPropertiesLengthBetween:()=>Ql,isPattern:()=>PQ,isNonEmpty:()=>xN,isMultipleOf:()=>vu,isMinSize:()=>au,isMinProperties:()=>eu,isMinLength:()=>vN,isMaxSize:()=>su,isMaxProperties:()=>Xl,isMaxLength:()=>iu,isLowercased:()=>Cu,isLessThanOrEqualToDate:()=>hu,isLessThanOrEqualToBigInt:()=>cu,isLessThanOrEqualToBigDecimal:()=>ou,isLessThanOrEqualTo:()=>Su,isLessThanDate:()=>gu,isLessThanBigInt:()=>pu,isLessThanBigDecimal:()=>ru,isLessThan:()=>Eu,isLengthBetween:()=>kN,isInt32:()=>xu,isInt:()=>u2,isIncludes:()=>Au,isGreaterThanOrEqualToDate:()=>bu,isGreaterThanOrEqualToBigInt:()=>SN,isGreaterThanOrEqualToBigDecimal:()=>lu,isGreaterThanOrEqualTo:()=>jN,isGreaterThanDate:()=>yu,isGreaterThanBigInt:()=>du,isGreaterThanBigDecimal:()=>uu,isGreaterThan:()=>ju,isFinite:()=>TN,isEndsWith:()=>Mu,isDateValid:()=>EN,isCapitalized:()=>Tu,isBetweenDate:()=>mu,isBetweenBigInt:()=>fu,isBetweenBigDecimal:()=>nu,isBetween:()=>YH,isBase64Url:()=>Ru,isBase64:()=>CN,is:()=>$N,instanceOf:()=>d8,fromURLSearchParams:()=>vl,fromJsonString:()=>sN,fromFormData:()=>Sl,fromBrand:()=>$u,flip:()=>uK,fieldsAssign:()=>rf,extendTo:()=>nf,encodeUnknownSync:()=>Sf,encodeUnknownResult:()=>Tf,encodeUnknownPromise:()=>jf,encodeUnknownOption:()=>wf,encodeUnknownExit:()=>WN,encodeUnknownEffect:()=>KN,encodeTo:()=>XH,encodeSync:()=>vf,encodeResult:()=>If,encodePromise:()=>Ef,encodeOption:()=>Cf,encodeKeys:()=>of,encodeExit:()=>Af,encodeEffect:()=>HN,encode:()=>Hu,decodeUnknownSync:()=>Nf,decodeUnknownResult:()=>Ff,decodeUnknownPromise:()=>Pf,decodeUnknownOption:()=>Of,decodeUnknownExit:()=>ZN,decodeUnknownEffect:()=>GN,decodeTo:()=>m,decodeSync:()=>Mf,decodeResult:()=>Lf,decodePromise:()=>Rf,decodeOption:()=>zf,decodeExit:()=>Uf,decodeEffect:()=>Bf,decode:()=>Ku,declareConstructor:()=>c1,declare:()=>z4,check:()=>Yu,catchEncodingWithContext:()=>RN,catchEncoding:()=>Zu,catchDecodingWithContext:()=>PN,catchDecoding:()=>Gu,brand:()=>FN,asserts:()=>qf,asClass:()=>xf,annotateKey:()=>Hf,annotateEncoded:()=>Kf,annotate:()=>Zf,Void:()=>ff,UnknownFromJsonString:()=>El,Unknown:()=>d2,UniqueSymbol:()=>lf,UniqueArray:()=>Xu,Union:()=>o0,UndefinedOr:()=>c2,Undefined:()=>iK,Uint8ArrayFromHex:()=>ll,Uint8ArrayFromBase64Url:()=>ul,Uint8ArrayFromBase64:()=>fl,Uint8Array:()=>n2,URLSearchParams:()=>XM,URLFromString:()=>Nl,URL:()=>rN,TupleWithRest:()=>sf,Tuple:()=>q9,Trimmed:()=>YM,Trim:()=>bl,Tree:()=>Ar,TimeZoneOffset:()=>il,TimeZoneNamedFromString:()=>al,TimeZoneNamed:()=>GM,TimeZoneFromString:()=>sl,TimeZone:()=>KM,TemplateLiteralParser:()=>df,TemplateLiteral:()=>mf,TaggedUnion:()=>Du,TaggedStruct:()=>f2,TaggedErrorClass:()=>Jr,TaggedClass:()=>Yr,Symbol:()=>DN,StructWithRest:()=>af,Struct:()=>R0,StringFromUriComponent:()=>dl,StringFromHex:()=>ml,StringFromBase64Url:()=>hl,StringFromBase64:()=>gl,String:()=>r,StandardSchemaV1FailureResult:()=>pl,SchemaError:()=>_4,Result:()=>Vl,RegExp:()=>Rl,RedactedFromValue:()=>Dl,Redacted:()=>bN,Record:()=>qN,ReadonlySet:()=>Fl,ReadonlyMap:()=>Ol,PropertyKey:()=>oK,OptionFromUndefinedOr:()=>Zl,OptionFromOptionalNullOr:()=>_l,OptionFromOptionalKey:()=>Hl,OptionFromOptional:()=>Wl,OptionFromNullishOr:()=>Kl,OptionFromNullOr:()=>Gl,Option:()=>Y5,Opaque:()=>qu,ObjectKeyword:()=>uf,NumberFromString:()=>xl,Number:()=>e4,NullishOr:()=>ON,NullOr:()=>tK,Null:()=>nK,NonEmptyString:()=>Jl,NonEmptyArray:()=>tf,Never:()=>cf,MutableJson:()=>Cr,Literals:()=>sK,Literal:()=>X1,Json:()=>wr,Int:()=>QM,HashSet:()=>Ll,HashMap:()=>zl,FormData:()=>eN,FiniteFromString:()=>kl,Finite:()=>o2,File:()=>tN,Exit:()=>Ul,ErrorWithStack:()=>uN,ErrorClass:()=>DM,Error:()=>fN,Enum:()=>pf,DurationFromString:()=>wl,DurationFromNanos:()=>Tl,DurationFromMillis:()=>Il,Duration:()=>r2,DefectWithStack:()=>Bl,Defect:()=>ql,DateValid:()=>nN,DateTimeZonedFromString:()=>tl,DateTimeZoned:()=>WM,DateTimeUtcFromString:()=>ol,DateTimeUtcFromMillis:()=>nl,DateTimeUtcFromDate:()=>rl,DateTimeUtc:()=>i2,DateFromString:()=>Ml,Date:()=>$H,Class:()=>VM,Chunk:()=>Pl,Char:()=>$l,CauseReason:()=>lK,Cause:()=>rK,BooleanFromBit:()=>cl,Boolean:()=>VN,BigIntFromString:()=>yl,BigInt:()=>p2,BigDecimalFromString:()=>jl,BigDecimal:()=>aN,ArrayEnsure:()=>ef,Array:()=>c0,Any:()=>LQ});var JB=/^[+-]?\d+$/,d$="~effect/BigDecimal",jv={[d$]:d$,[H0](){let X=f$(this);return f0(s(X.value),c8(X.scale))},[W0](X){return c$(X)&&Sv(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)}},c$=(X)=>M(X,d$),E6=(X,Q)=>{let Y=Object.create(jv);return Y.value=X,Y.scale=Q,Y},GB=(X,Q)=>{if(X!==k8&&X%p$===k8)throw RangeError("Value must be normalized");let Y=E6(X,Q);return Y.normalized=Y,Y},k8=BigInt(0);var p$=BigInt(10),ZB=GB(k8,0);var f$=(X)=>{if(X.normalized===void 0)if(X.value===k8)X.normalized=ZB;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=GB(J,$)}return X.normalized},QY=B(2,(X,Q)=>{if(Q>X.scale)return E6(X.value*p$**BigInt(Q-X.scale),Q);if(Q<X.scale)return E6(X.value/p$**BigInt(X.scale-Q),Q);return X});var p5=E9((X,Q)=>{let Y=q1($B(X),$B(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 $B=(X)=>X.value===k8?0:X.value<k8?-1:1,Ev=(X)=>X.value<k8?E6(-X.value,X.scale):X;var u$=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}),Sv=B(2,(X,Q)=>u$(X,Q));var KB=(X)=>{if(X==="")return F(ZB);let Q,Y,J=X.search(/[eE]/);if(J!==-1){let H=X.slice(J+1);if(Q=X.slice(0,J),Y=Number(H),Q===""||!Number.isSafeInteger(Y)||!JB.test(H))return x()}else Q=X,Y=0;let $,G,Z=Q.search(/\./);if(Z!==-1){let H=Q.slice(0,Z),W=Q.slice(Z+1);$=`${H}${W}`,G=W.length}else $=Q,G=0;if(!JB.test($))return x();let K=G-Y;if(!Number.isSafeInteger(K))return x();return F(E6(BigInt($),K))};var y8=(X)=>{let Q=f$(X);if(Math.abs(Q.scale)>=16)return vv(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 H=K-J.length;$=`${J}${"0".repeat(H)}`,G=""}else G=J.slice(K),$=J.slice(0,K)}let Z=G===""?$:`${$}.${G}`;return Y?`-${Z}`:Z},vv=(X)=>{if(xv(X))return"0e+0";let Q=f$(X),Y=`${Ev(Q).value}`,J=Y.slice(0,1),$=Y.slice(1),G=`${kv(Q)?"-":""}${J}`;if($!=="")G+=`.${$}`;let Z=$.length-Q.scale;return`${G}e${Z>=0?"+":""}${Z}`};var xv=(X)=>X.value===k8,kv=(X)=>X.value<k8;var WB="~effect/collections/Chunk";function yv(X,Q,Y,J,$){for(let G=Q;G<Math.min(X.length,Q+$);G++)Y[J+G-Q]=X[G];return Y}var _B=[],r$=(X)=>s0((Q,Y)=>Q.length===Y.length&&CX(Q).every((J,$)=>X(J,TX(Y,$)))),bv=r$(o),gv={[WB]:{_A:(X)=>X},toString(){return`Chunk(${g(CX(this))})`},toJSON(){return{_id:"Chunk",values:G1(CX(this))}},[a0](){return this.toJSON()},[W0](X){return YY(X)&&bv(this,X)},[H0](){return N9(CX(this))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return _B[Symbol.iterator]();default:return CX(this)[Symbol.iterator]()}},pipe(){return a(this,arguments)}},o$=(X)=>{let Q=Object.create(gv);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,WB),J4=o$({_tag:"IEmpty"}),hv=()=>J4;var mv=(X)=>o$({_tag:"ISingleton",a:X}),JY=(X)=>YY(X)?X:pv(Z1(X)),l$=(X,Q,Y)=>{switch(X.backing._tag){case"IArray":{yv(X.backing.array,0,Q,Y,X.length);break}case"IConcat":{l$(X.left,Q,Y),l$(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[$]=TX(X,J),J+=1,$+=1;break}}};var dv=(X)=>{switch(X.backing._tag){case"IEmpty":return _B;case"IArray":return X.backing.array;default:{let Q=Array(X.length);return l$(X,Q,0),X.backing={_tag:"IArray",array:Q},X.left=J4,X.right=J4,X.depth=0,Q}}},CX=dv;var pv=(X)=>X.length===0?hv():X.length===1?mv(X[0]):o$({_tag:"IArray",array:X});var TX=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?TX(X.left,Y):TX(X.right,Y-X.left.length);case"ISlice":return TX(X.backing.chunk,Y+X.backing.offset)}});var VB=(X)=>X.length;var n$=y5,DB=I6,qB=$q,BB=Gq,UB=Zq,OB=V$,i$=Kq;var zB=k5;var FB=B$;var $Y=Hq,LB=Wq;var GY=_q;var a$=U$,IX=BX,PB=O$;var RB=z$,m4=Vq;var NB=UX;var MB=P$;var AB=qq;var ZY=N$;var wB="~effect/encoding/EncodingError";class d4 extends eD("EncodingError"){[wB]=wB}var HY=(X)=>typeof X==="string"?t$(QG.encode(X)):t$(X),c5=(X)=>{let Q=yB(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 H=KY(Q.charCodeAt(Z))<<18|KY(Q.charCodeAt(Z+1))<<12|KY(Q.charCodeAt(Z+2))<<6|KY(Q.charCodeAt(Z+3));G[K]=H>>16,G[K+1]=H>>8&255,G[K+2]=H&255}return l(G)}catch($){return f(new d4({kind:"Decode",module:"Base64",input:Q,message:$ instanceof Error?$.message:"Invalid input"}))}},EB=(X)=>O6(c5(X),(Q)=>YG.decode(Q)),SB=(X)=>typeof X==="string"?TB(QG.encode(X)):TB(X),e$=(X)=>{let Q=yB(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,"/"),c5(J)},vB=(X)=>O6(e$(X),(Q)=>YG.decode(Q)),xB=(X)=>typeof X==="string"?IB(QG.encode(X)):IB(X),XG=(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=jB(Q[$*2]),Z=jB(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"}))}},kB=(X)=>O6(XG(X),(Q)=>YG.decode(Q)),QG=new TextEncoder,YG=new TextDecoder,yB=(X)=>X.replace(/[\n\r]/g,""),t$=(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>=CB.length)throw TypeError(`Invalid character ${String.fromCharCode(X)}`);let Q=CB[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","+","/"],CB=[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],TB=(X)=>t$(X).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),IB=(X)=>{let Q="";for(let Y=0;Y<X.length;++Y)Q+=fv[X[Y]];return Q},jB=(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")},fv=["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 _Y="~effect/collections/HashMap",B8=5,vX=1<<B8,uv=vX/4,gB=vX/2,lv=vX-1,rv=(X)=>{return X=X-(X>>>1&1431655765),X=(X&858993459)+(X>>>2&858993459),(X+(X>>>4)&252645135)*16843009>>>24},jX=(X,Q)=>X>>>Q&lv,p4=(X,Q)=>1<<jX(X,Q),WY=(X,Q)=>rv(X&Q-1);function hB(X,Q,Y,J,$,G){if(Q>32)throw Error("HashMap: max depth exceeded");let Z=p4(Y,Q),K=p4($,Q);if(Z===K){let V=hB(X,Q+B8,Y,J,$,G);return new b8(X,Z,[V])}let H=Z|K,W=Z>>>0<K>>>0?[J,G]:[G,J];return new b8(X,H,W)}class f5{canEdit(X){return this.edit===X}}class mB extends f5{_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 f5{_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 EX(X,Y,[[this.key,this.value],[J,$]]);let Z=p4(Y,Q),K=p4(this.hash,Q);if(Z===K)return new b8(X,Z,[this.set(X,Q+B8,Y,J,$,G)]);let H=Z|K,W=Z>>>0<K>>>0?[new G4(X,Y,J,$),this]:[this,new G4(X,Y,J,$)];return new b8(X,H,W)}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 EX extends f5{_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,hB(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 EX(X,this.hash,K)}if(G.value=!0,this.canEdit(X))return this.entries.push([J,$]),this;return new EX(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 EX(X,this.hash,Z)}iterator(){return this.entries[Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}}class b8 extends f5{_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=p4(Q,X);if((this.bitmap&J)===0)return x();let $=WY(this.bitmap,J);return this.children[$].get(X+B8,Q,Y)}has(X,Q,Y){let J=p4(Q,X);if((this.bitmap&J)===0)return!1;let $=WY(this.bitmap,J);return this.children[$].has(X+B8,Q,Y)}set(X,Q,Y,J,$,G){let Z=p4(Y,Q),K=WY(this.bitmap,Z);if((this.bitmap&Z)!==0){let H=this.children[K],W=H.set(X,Q+B8,Y,J,$,G);if(H===W)return this;if(this.canEdit(X))return this.children[K]=W,this;let V=[...this.children];return V[K]=W,new b8(X,this.bitmap,V)}else{G.value=!0;let H=new G4(X,Y,J,$),W=this.bitmap|Z;if(this.canEdit(X)){if(this.children.splice(K,0,H),this.bitmap=W,this._size=void 0,this.children.length>gB)return this.expand(X,W,this.children);return this}let V=[...this.children];if(V.splice(K,0,H),V.length>gB)return this.expand(X,W,V);return new b8(X,W,V)}}remove(X,Q,Y,J,$){let G=p4(Y,Q);if((this.bitmap&G)===0)return this;let Z=WY(this.bitmap,G),K=this.children[Z],H=K.remove(X,Q+B8,Y,J,$);if(!$.value)return this;if(H===void 0){let V=this.bitmap^G;if(V===0)return;if(this.children.length===2){let D=this.children[Z===0?1:0];if(D._tag==="LeafNode")return D}if(this.canEdit(X))return this.children.splice(Z,1),this.bitmap=V,this._size=void 0,this;let _=[...this.children];return _.splice(Z,1),new b8(X,V,_)}if(K===H)return this;if(this.canEdit(X))return this.children[Z]=H,this;let W=[...this.children];return W[Z]=H,new b8(X,this.bitmap,W)}expand(X,Q,Y){let J=new globalThis.Array(vX),$=0;for(let G=0;G<vX;G++)if((Q&1<<G)!==0)J[G]=Y[$++];return new SX(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 SX extends f5{_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=jX(Q,X),$=this.children[J];return $?$.get(X+B8,Q,Y):x()}has(X,Q,Y){let J=jX(Q,X),$=this.children[J];return $?$.has(X+B8,Q,Y):!1}set(X,Q,Y,J,$,G){let Z=jX(Y,Q),K=this.children[Z];if(K){let H=K.set(X,Q+B8,Y,J,$,G);if(K===H)return this;if(this.canEdit(X))return this.children[Z]=H,this;let W=[...this.children];return W[Z]=H,new SX(X,this.count,W)}else{G.value=!0;let H=new G4(X,Y,J,$);if(this.canEdit(X))return this.children[Z]=H,this.count++,this._size=void 0,this;let W=[...this.children];return W[Z]=H,new SX(X,this.count+1,W)}}remove(X,Q,Y,J,$){let G=jX(Y,Q),Z=this.children[G];if(!Z)return this;let K=Z.remove(X,Q+B8,Y,J,$);if(!$.value)return this;let H=this.count-(K?0:1);if(H<uv)return this.pack(X,G,K);if(Z===K)return this;if(this.canEdit(X)){if(this.children[G]=K,!K)this.count=H;return this._size=void 0,this}let W=[...this.children];return W[G]=K,new SX(X,H,W)}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 VY{[_Y]=_Y;_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()}[W0](X){if(JG(X)){let Q=X;if(this.size!==Q.size)return!1;for(let[Y,J]of this){let $=J3(X,cB(Y));if(T0($)||!o(J,$.value))return!1}return!0}return!1}[H0](){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 dB=new mB,JG=(X)=>M(X,_Y),$G=()=>new VY(!1,0,dB,0);var pB=(X)=>{let Q=dB,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 VY(!1,0,Q,Y)};var cB=B(2,(X,Q)=>{return X._root.get(0,s(Q),Q)});var GG=B(2,(X,Q)=>{return X._root.has(0,s(Q),Q)});var ZG=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 VY(!1,J._edit,K,J._size+(G.value?1:0))}),KG=(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 fB=(X)=>{let Q=X[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){return Q.next()}}},DY=(X)=>X.size;var lB=JG;var qY=pB;var iv=fB,BY=(X)=>Array.from(iv(X)),rB=DY;var xX="~effect/collections/HashSet",sv={[H0](){return s(xX)},[W0](X){return HG(X)&&UY(this)===UY(X)&&iB(this,(Q)=>nB(X,Q))},[Symbol.iterator](){return KG(WG(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)}},tv=(X)=>{let Q=Object.create(sv);return Q[xX]=xX,Q.keyMap=X,Q},HG=(X)=>M(X,xX),WG=(X)=>X.keyMap;var oB=(X)=>{let Q=$G();for(let Y of X)Q=ZG(Q,Y,!0);return tv(Q)},nB=(X,Q)=>GG(WG(X),Q);var UY=(X)=>DY(WG(X));var iB=(X,Q)=>{for(let Y of X)if(!Q(Y))return!1;return!0};var OY=oB,aB=HG;var sB=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 u5=zY("identifier"),_G=zY("title");var tB=zY("brands"),FY=p0((X)=>{let Q=u5(X);if(typeof Q==="string")return Q;return X.getExpected(FY)});var Ne=globalThis.Boolean;var eB=o8((X,Q)=>X||Q,!1);function l5(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 Me=globalThis.RegExp;var LY=(X)=>X.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&");var v6=new WeakMap,QU=(X)=>{if(v6.has(X))return v6.get(X);else throw Error("Unable to get redacted value"+(X.label?` with label: "${X.label}"`:""))};var YU="~effect/data/Redacted",VG=(X)=>M(X,YU),Z4=(X,Q)=>{let Y=Object.create($x);if(Q?.label)Y.label=Q.label;return v6.set(Y,X),Y},$x={[YU]:{_A:(X)=>X},label:void 0,...w8,toJSON(){return this.toString()},toString(){return`<redacted${Q8(this.label)?":"+this.label:""}>`},[H0](){return s(v6.get(this))},[W0](X){return VG(X)&&o(v6.get(this),v6.get(X))}},PY=QU;var JU=(X)=>s0((Q,Y)=>X(PY(Q),PY(Y)));var DG="~effect/SchemaIssue/Issue";function Gx(X){return M(X,DG)}class s1{[DG]=DG;toString(){return Kx(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 UG 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 bX 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 D0 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 r5 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 OG extends s1{_tag="OneOf";ast;actual;successes;constructor(X,Q,Y){super();this.ast=X,this.actual=Q,this.successes=Y}}function qG(X,Q){if(Gx(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 ZU(X,Q){if(Q===void 0)return;if(typeof Q==="boolean")return Q?void 0:new Z0(F(X));return qG(X,Q)}function KU(X,Q,Y){if(Array.isArray(Y)){if(z6(Y)){if(Y.length===1)return qG(X,Y[0]);return new D0(Q,F(X),j4(Y,(J)=>qG(X,J)))}return}return ZU(X,Y)}var HU=(X)=>{let Q=yX(X);if(Q!==void 0)return Q;switch(X._tag){case"InvalidType":return BG(FY(X.ast),GU(X.actual));case"InvalidValue":return`Invalid data ${GU(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)}`}},WU=(X)=>{return yX(X.issue)??yX(X)};function _U(X){return(Q)=>({issues:x6(Q,[],X?.leafHook??HU,X?.checkHook??WU)})}function BG(X,Q){return`Expected ${X}, got ${Q}`}function x6(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:BG(VU(X.filter),g(X.actual))}];default:return x6(X.issue,Q,Y,J)}}case"Encoding":return x6(X.issue,Q,Y,J);case"Pointer":return x6(X.issue,[...Q,...X.path],Y,J);case"Composite":return X.issues.flatMap(($)=>x6($,Q,Y,J));case"AnyOf":{let $=yX(X);if(X.issues.length===0){if($!==void 0)return[{path:Q,message:$}];let G=BG(FY(X.ast),g(X.actual));return[{path:Q,message:G}]}return X.issues.flatMap((G)=>x6(G,Q,Y,J))}default:return[{path:Q,message:Y(X)}]}}function VU(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)=>VU(Y)).join(" & ")}}function Zx(){return(X)=>x6(X,[],HU,WU).map(Hx).join(`
|
|
27
|
-
`)}var
|
|
28
|
-
at ${Y}`}return Q}function yX(X){switch(X._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return kX(X.ast.annotations);case"InvalidValue":case"Forbidden":return kX(X.annotations);case"MissingKey":return kX(X.annotations,"messageMissingKey");case"UnexpectedKey":return kX(X.ast.annotations,"messageUnexpectedKey");case"Filter":return kX(X.filter.annotations);case"Encoding":return yX(X.issue)}}function kX(X,Q="message"){let Y=X?.[Q];if(typeof Y==="string")return Y}function GU(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 r5(T4(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(T4(X.actual,Z4));case"AnyOf":case"OneOf":case"UnexpectedKey":return new Z0(F(Z4(X.actual)))}}class K4 extends $6{run;constructor(X){super();this.run=X}map(X){return new K4((Q,Y)=>this.run(Q,Y).pipe(m5(T4(X))))}compose(X){if(DU(this))return X;if(DU(X))return this;return new K4((Q,Y)=>this.run(Q,Y).pipe(q8((J)=>X.run(J,Y))))}}function Wx(X){return new K4((Q)=>v(X(Q)))}function zG(X){return Wx((Q)=>new r5(Q,{message:X(Q)}))}var qU=new K4(h);function DU(X){return X.run===qU.run}function T1(){return qU}function FG(X){return new K4((Q,Y)=>T0(Q)?x8:X(Q.value,Y))}function n(X){return wY(T4(X))}function I1(X){return FG((Q,Y)=>X(Q,Y).pipe(m5(F)))}function wY(X){return new K4((Q)=>h(X(Q)))}function LG(){return new K4(()=>x8)}function hX(X){return new K4((Q)=>{let Y=F5(Q,$1);return B1(Y)?h(Y):MX(X,F)})}function k6(){return n(globalThis.String)}function CY(){return n(globalThis.Number)}function BU(){return n(globalThis.BigInt)}function UU(){return n((X)=>new globalThis.Date(X))}function OU(){return n(Fq)}function zU(X){return FG((Q)=>h4({try:()=>F(JSON.parse(Q,X?.reviver)),catch:(Y)=>new Z0(F(Q),{message:globalThis.String(Y)})}))}function FU(X){return FG((Q)=>h4({try:()=>F(JSON.stringify(Q,X?.replacer,X?.space)),catch:(Y)=>new Z0(F(Q),{message:globalThis.String(Y)})}))}function LU(X){let Q=X?.separator??",";return n((Y)=>Y===""?[]:Y.split(Q))}function PG(){return n(HY)}function TY(){return n(SB)}function IY(){return n(xB)}function PU(){return I1((X)=>S9(c5(X),(Q)=>new Z0(F(X),{message:Q.message})).asEffect())}function RU(){return I1((X)=>I8(EB(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function NU(){return I1((X)=>I8(e$(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function MU(){return I1((X)=>I8(vB(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function AU(){return I1((X)=>I8(XG(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function wU(){return I1((X)=>I8(kB(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function CU(){return n(encodeURIComponent)}function TU(){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 RG(){return I1((X)=>{return G8($Y(X),{onNone:()=>v(new Z0(F(X),{message:"Invalid DateTime input"})),onSome:(Q)=>h(GY(Q))})})}function IU(){return n((X)=>vU(Array.from(X.entries())))}var _x=xU((X)=>typeof X==="string"||typeof Blob<"u"&&X instanceof Blob);function jU(){return n((X)=>{let Q=new FormData;if(typeof X==="object"&&X!==null)_x(X).forEach(([J,$])=>{Q.append(J,$)});return Q})}function EU(){return n((X)=>vU(Array.from(X.entries())))}var Vx=xU(Q8);function SU(){return n((X)=>{if(typeof X==="object"&&X!==null)return new URLSearchParams(Vx(X));return new URLSearchParams})}var Dx=/^\d+$/;function qx(X){if(X==="")return[""];let Q=X.replace(/\[(.*?)\]/g,".$1"),Y=Q.split("."),J=Q.startsWith(".")?1:0;return Y.slice(J).map(($)=>Dx.test($)?globalThis.Number($):$)}function vU(X){let Q={};return X.forEach(([Y,J])=>{let $=qx(Y),G=Q;$.forEach((Z,K)=>{let H=K===$.length-1;if(Array.isArray(G)&&Z==="")if(H)G.push(J);else{let W=$[K+1],V=typeof W==="number"||W==="",_=G.length;if(G[_]===void 0)G[_]=V?[]:{};G=G[_]}else if(H)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 W=$[K+1],V=typeof W==="number"||W==="";if(G[Z]===void 0)G[Z]=V?[]:{};G=G[Z]}})}),Q}function xU(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,H)=>{J(`${$}[${H}]`,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 mX{_tag="Middleware";decode;encode;constructor(X,Q){this.decode=X,this.encode=Q}flip(){return new mX(this.encode,this.decode)}}var MG="~effect/SchemaTransformation/Transformation";class K0{[MG]=MG;_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 Bx(X){return M(X,MG)}var jY=(X)=>{if(Bx(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 kU(){return new K0(OU(),T1())}var Ux=new K0(T1(),T1());function y6(){return Ux}var o5=new K0(CY(),k6()),SY=new K0(BU(),k6()),AG=new K0(UU(),n(O3)),yU=t1({decode:(X)=>G8(wW(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid Duration string: ${X}`})),onSome:h}),encode:(X)=>h(globalThis.String(X))}),bU=t1({decode:(X)=>h(a8(X)),encode:(X)=>G8(CW(X),{onNone:()=>v(new Z0(F(X),{message:`Unable to encode ${X} into a bigint`})),onSome:(Q)=>h(Q)})}),gU=v0({decode:(X)=>E4(X),encode:(X)=>S4(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 hU(){return v0({decode:$W,encode:C3})}function mU(){return v0({decode:JW,encode:q6})}function dU(X){return v0({decode:YW,encode:X?.onNoneEncoding===null?C3:q6})}function pU(){return EY({decode:F,encode:z5})}function cU(){return EY({decode:(X)=>X.pipe(F5($1),F),encode:z5})}var wG=t1({decode:(X)=>h4({try:()=>new URL(X),catch:()=>new Z0(F(X),{message:`Invalid URL string: ${X}`})}),encode:(X)=>h(X.href)}),CG=t1({decode:(X)=>{let Q=KB(X);return T0(Q)?v(new Z0(F(X),{message:`Invalid BigDecimal string: ${X}`})):h(Q.value)},encode:(X)=>h(y8(X))}),TG=new K0(PU(),PG()),fU=new K0(RU(),PG()),uU=new K0(MU(),TY()),lU=new K0(wU(),IY()),rU=new K0(TU(),CU()),oU=new K0(zU(),FU()),nU=new K0(IU(),jU()),iU=new K0(EU(),SU()),aU=v0({decode:(X)=>IX(X),encode:(X)=>X.offset}),IG=t1({decode:(X)=>{return G8(PB(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid IANA time zone: ${X}`})),onSome:h})},encode:(X)=>h(X.id)}),jG=t1({decode:(X)=>{return G8(RB(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid time zone: ${X}`})),onSome:h})},encode:(X)=>h(m4(X))}),EG=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(AB(X))}),SG=t1({decode:(X)=>{return G8(LB(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid Zoned DateTime string: ${X}`})),onSome:h})},encode:(X)=>h(ZY(X))});function g6(X){return(Q)=>Q._tag===X}function GO(X){return M(X,cX)&&X[cX]===cX}var g8=g6("Declaration");var Ox=g6("Never");var vY=g6("Literal"),zx=g6("UniqueSymbol");var kY=g6("Arrays"),ZO=g6("Objects"),yY=g6("Union");class B0{to;transformation;constructor(X,Q){this.to=X,this.transformation=Q}}var i5={};class H4{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 cX="~effect/Schema";class k0{[cX]=cX;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 h6 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 m5(X(Q.value,this,Y),F)}}recur(X){let Q=n5(this.typeParameters,X);return Q===this.typeParameters?this:new h6(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 KO extends k0{_tag="Null";getParser(){return tX(this,null)}getExpected(){return"null"}}var a5=new KO;class HO extends k0{_tag="Undefined";getParser(){return tX(this,void 0)}toCodecJson(){return q0(this,[WO])}getExpected(){return"undefined"}}var WO=new B0(a5,new K0(n(()=>{return}),n(()=>null))),xG=new HO;class _O extends k0{_tag="Void";getParser(){return tX(this,void 0)}toCodecJson(){return q0(this,[WO])}getExpected(){return"void"}}var VO=new _O;class DO extends k0{_tag="Never";getParser(){return F8(this,TH)}getExpected(){return"never"}}var qO=new DO;class BO extends k0{_tag="Any";getParser(){return F8(this,G3)}getExpected(){return"any"}}var UO=new BO;class OO extends k0{_tag="Unknown";getParser(){return F8(this,G3)}getExpected(){return"unknown"}}var b6=new OO;class zO extends k0{_tag="ObjectKeyword";getParser(){return F8(this,Z3)}getExpected(){return"object | array | function"}}var FO=new zO;class kG 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 q0(this,[new B0(new g1(Object.keys(X).map((Q)=>new b1(Q)),"anyOf"),new K0(n((Q)=>X[Q]),k6()))])}return this}getExpected(){return this.enums.map(([X,Q])=>JSON.stringify(Q)).join(" | ")}}function LO(X){switch(X._tag){case"String":case"Number":case"BigInt":case"Literal":case"TemplateLiteral":return!0;case"Union":return X.types.every(LO);default:return!1}}class yG 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(LO(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 D0(this,Y,[$])})}getExpected(){return"string"}asTemplateLiteralParser(){let X=new W4(!1,this.parts.map(rO),[]),Q=oY(this);return rY(m6,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 bG extends k0{_tag="UniqueSymbol";symbol;constructor(X,Q,Y,J,$){super(Q,Y,J,$);this.symbol=X}getParser(){return tX(this,this.symbol)}toCodecStringTree(){return q0(this,[iO])}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 tX(this,this.literal)}toCodecJson(){return typeof this.literal==="bigint"?tU(this):this}toCodecStringTree(){return typeof this.literal==="string"?this:tU(this)}getExpected(){return typeof this.literal==="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}}function tU(X){let Q=globalThis.String(X.literal);return q0(X,[new B0(new b1(Q),new K0(n(()=>X.literal),n(()=>Q)))])}class PO extends k0{_tag="String";getParser(){return F8(this,Q8)}getExpected(){return"string"}}var m6=new PO;class RO extends k0{_tag="Number";getParser(){return F8(this,R9)}toCodecJson(){if(this.checks&&(pX(this.checks,"isFinite")||pX(this.checks,"isInt")))return this;return q0(this,[wx])}toCodecStringTree(){if(this.checks&&(pX(this.checks,"isFinite")||pX(this.checks,"isInt")))return q0(this,[jx]);return q0(this,[Ex])}getExpected(){return"number"}}function pX(X,Q){return X.some((Y)=>{switch(Y._tag){case"Filter":return Y.annotations?.meta?._tag===Q;case"FilterGroup":return pX(Y.checks,Q)}})}var gG=new RO;class NO extends k0{_tag="Boolean";getParser(){return F8(this,AH)}getExpected(){return"boolean"}}var MO=new NO;class AO extends k0{_tag="Symbol";getParser(){return F8(this,$3)}toCodecStringTree(){return q0(this,[iO])}getExpected(){return"symbol"}}var wO=new AO;class CO extends k0{_tag="BigInt";getParser(){return F8(this,wH)}toCodecStringTree(){return q0(this,[Sx])}getExpected(){return"bigint"}}var TO=new CO;class W4 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((H)=>!E0(H))||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((W)=>({ast:W,parser:X(W)})),J=Q.rest.map((W)=>({ast:W,parser:X(W)})),$=Y.length,[G,...Z]=J,K=Z.length;function H(W,V){if(V<$)return Y[V];else if(V>=W)return Z[V-W];return G}return wX(function*(W,V){if(W._tag==="None")return W;let _=W.value;if(!Array.isArray(_))return yield*v(new x0(Q,W));let D=_.length,q={ast:Q,getParser:H,oinput:W,len:D,tailThreshold:Lx(D,$,K),output:new globalThis.Array(D),issues:void 0,options:V},U=hG(V?.concurrency),R=Fx(q,_,{concurrency:U?.concurrency,end:Q.rest.length===0?$:Math.max(D,$+K)});if(R)yield*R;if(Q.rest.length===0&&D>$)for(let L=$;L<=D-1;L++){let N=new A0([L],new MY(Q,_[L]));if(V.errors==="all")if(q.issues)q.issues.push(N);else q.issues=[N];else return yield*v(new D0(Q,W,[N]))}if(q.issues)return yield*v(new D0(Q,W,q.issues));return F(q.output)})}recur(X){let Q=n5(this.elements,X),Y=n5(this.rest,X);return Q===this.elements&&Y===this.rest?this:new W4(this.isMutable,Q,Y,this.annotations,this.checks,void 0,this.context)}getExpected(){return"array"}}var Fx=$X()({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 bX($.ast.context?.annotations));if(X.options.errors==="all")if(X.issues)X.issues.push(G);else X.issues=[G];else return x5(new D0(X.ast,X.oinput,[G]))}}});function Lx(X,Q,Y){return Math.max(Q,X-Y)}var hG=(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 x5(new D0(Q,X.oinput,[G]))},uX="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",Px=new globalThis.RegExp(`(?:${uX}|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)=>Px.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 mG{parameter;type;merge;constructor(X,Q,Y){if(this.parameter=X,this.type=Q,this.merge=Y,E0(Q)&&!pO(Q))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class lX 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,H,W)=>W.indexOf(K)!==H);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?$X()({onItem:wX(function*(K,[H,W]){let _=X(lO(W.parameter))(F(H),K.options),D=H1(_)?_:yield*NX(_);if(D._tag==="Failure"){let N=xY(K,Q,H,D);if(N)yield*N;return}let q=F(K.input[H]),R=X(W.type)(q,K.options),L=H1(R)?R:yield*NX(R);if(L._tag==="Failure"){let N=xY(K,Q,H,L);if(N)yield*N;return}else if(D.value._tag==="Some"&&L.value._tag==="Some"){let N=D.value.value,P=L.value.value;if(W.merge&&W.merge.decode&&Object.hasOwn(K.out,N)){let[y,Y0]=W.merge.decode.combine([N,K.out[N]],[N,P]);l5(K.out,y,Y0)}else l5(K.out,N,P)}}),step:(K,H,W)=>W._tag==="Failure"?W:void 0}):void 0;return wX(function*(K,H){if(K._tag==="None")return K;let W=K.value;if(!(typeof W==="object"&&W!==null&&!Array.isArray(W)))return yield*v(new x0(Q,K));let V={},_={ast:Q,oinput:K,input:W,out:V,issues:void 0,options:H},D=H.errors==="all",q=H.onExcessProperty==="error",U=H.onExcessProperty==="preserve",R;if(Q.indexSignatures.length===0&&(q||U)){R=Reflect.ownKeys(W);for(let P=0;P<R.length;P++){let y=R[P];if(!J.has(y))if(q){let Y0=new A0([y],new MY(Q,W[y]));if(D){if(_.issues)_.issues.push(Y0);else _.issues=[Y0];continue}else return yield*v(new D0(Q,K,[Y0]))}else l5(V,y,W[y])}}let L=hG(H?.concurrency),N=Rx(_,$,L);if(N)yield*N;if(Z){let P=k3();for(let Y0=0;Y0<G;Y0++){let X8=Q.indexSignatures[Y0],$5=d6(W,X8.parameter);for(let V1=0;V1<$5.length;V1++){let jA=$5[V1];P.push([jA,X8])}}let y=Z(_,P,L);if(y)yield*y}if(_.issues)return yield*v(new D0(Q,K,_.issues));if(H.propertyOrder==="original"){let P=(R??Reflect.ownKeys(W)).concat(Y),y={};for(let Y0 of P)if(Object.hasOwn(V,Y0))l5(y,Y0,V[Y0]);return F(y)}return F(V)})}rebuild(X,Q){let Y=n5(this.propertySignatures,($)=>{let G=X($.type);return G===$.type?$:new bY($.name,G)}),J=n5(this.indexSignatures,($)=>{let G=X($.parameter),Z=X($.type),K=Q?$.merge?.flip():$.merge;return G===$.parameter&&Z===$.type&&K===$.merge?$:new mG(G,Z,K)});return Y===this.propertySignatures&&J===this.indexSignatures?this:new lX(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 Rx=$X()({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")l5(X.out,Q.name,Y.value.value);else if(!E0(Q.type)){let J=new A0([Q.name],new bX(Q.type.context?.annotations));if(X.options.errors==="all"){if(X.issues)X.issues.push(J);else X.issues=[J];return}else return x5(new D0(X.ast,X.oinput,[J]))}}});function Nx(X,Q){if(!X)return Q.checks;if(!Q.checks)return X;return[...X,...Q.checks]}function hY(X,Q,Y){return new lX(Reflect.ownKeys(X).map((J)=>{return new bY(J,X[J].ast)}),[],Y,Q)}function rX(X){return X.ast}function dG(X,Q=void 0){return new W4(!1,X.map((Y)=>Y.ast),[],void 0,Q)}function mY(X,Q,Y){return new g1(X.map(rX),Q,void 0,Y)}function IO(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),$=Nx($,G);return new lX(Y,J,void 0,$)}function jO(X,Q){if(X.encoding)throw Error("TupleWithRest does not support encodings");return new W4(X.isMutable,X.elements,Q,void 0,X.checks)}function EO(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(EO)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function oX(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(zx(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 oX(X.thunk())}}var eU=new WeakMap;function Mx(X){let Q=eU.get(X);if(Q)return Q;Q={};for(let Y of X){let J=J1(Y);if(Ox(J))continue;let $=EO(J),G=oX(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 H=Q.bySentinel.get(Z);if(!H)Q.bySentinel.set(Z,H=new Map);let W=H.get(K);if(!W)H.set(K,W=[]);W.push(Y)}}else{Q.otherwise??={};for(let Z of $)(Q.otherwise[Z]??=[]).push(Y)}}return eU.set(X,Q),Q}function XO(X){return(Q)=>{let Y=J1(Q);return Y._tag==="Literal"?Y.literal===X:Y._tag==="UniqueSymbol"?Y.symbol===X:!0}}function nX(X,Q){let Y=Mx(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(XO(X))}}return $}return(Y.byType?.[J]??[]).filter(XO(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=nX($,Q.types),Z={ast:Q,recur:X,oinput:Y,input:$,out:void 0,successes:[],issues:void 0,options:J},K=hG(J?.concurrency),H=Ax(Z,G,K);if(!H)return Z.out?h(Z.out):v(new AY(Q,$,Z.issues??[]));return RX(H,(W)=>{return Z.out?h(Z.out):v(new AY(Q,$,Z.issues??[]))})}}recur(X){let Q=n5(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`${QO($.isMutable)}[ ${G.map((Z)=>X(Z)+YO(Z.context?.isOptional)).join(", ")}, ... ]`;break}case"Objects":{let G=$.propertySignatures.filter((Z)=>vY(Z.type));if(G.length>0)return`{ ${G.map((Z)=>`${QO(Z.type.context?.isMutable)}${R4(Z.name)}${YO(Z.type.context?.isOptional)}: ${X(Z.type)}`).join(", ")}, ... }`;break}}return X($)});return Array.from(new Set(Y)).join(" | ")}}var Ax=$X()({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),x5(new OG(X.ast,X.input,X.successes));if(X.out=Y.value,X.successes.push(Q),X.ast.mode==="anyOf")return $$}}}),SO=new g1([new b1("Infinity"),new b1("-Infinity"),new b1("NaN")],"anyOf"),wx=new B0(new g1([gG,SO],"anyOf"),new K0(CY(),n((X)=>globalThis.Number.isFinite(X)?X:globalThis.String(X))));function QO(X){return X?"":"readonly "}function YO(X){return X?"?":""}function p6(X){let Q=!1,Y;return()=>{if(Q)return Y;return Y=X(),Q=!0,Y}}class dY extends k0{_tag="Suspend";thunk;constructor(X,Q,Y,J,$){super(Q,Y,J,$);this.thunk=p6(X)}getParser(X){return X(this.thunk())}recur(X){return new dY(()=>X(this.thunk()),this.annotations,this.checks,void 0,this.context)}getExpected(X){return X(this.thunk())}}class fX extends $6{_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 fX(this.run,{...this.annotations,...X},this.aborted)}abort(){return new fX(this.run,this.annotations,!0)}and(X,Q){return new c4([this,X],Q)}}class c4 extends $6{_tag="FilterGroup";checks;annotations;constructor(X,Q=void 0){super();this.checks=X,this.annotations=Q}annotate(X){return new c4(this.checks,{...this.annotations,...X})}and(X,Q){return new c4([this,X],Q)}}function pG(X,Q,Y=!1){return new fX((J,$,G)=>KU(J,$,X(J,$,G)),Q,Y)}function pY(X,Q){return new fX((Y)=>X(Y)?void 0:new Z0(F(Y)),Q,!0)}function iX(X,Q){let Y=X.source;return pG((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 q0(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 aX(X){return X.encoding?aX(X.encoding[X.encoding.length-1].to):X}function c6(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 f4(X,Q){return uY(X,X.checks?[...X.checks,...Q]:Q)}function vO(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 xO(X){return(Q)=>Q.encoding?q0(Q,vO(Q.encoding,X)):Q}function kO(X,Q){return cG(X,Q,z8(X))}function yO(X,Q){return cG(J1(X),Q,X)}function cG(X,Q,Y){let J=new B0(X,Q);return q0(Y,Y.encoding?[...Y.encoding,J]:[J])}function bO(X,Q){let Y=tB(X),J=Y?[...Y,Q]:[Q];return c6(X,{brands:J})}function n5(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 sX(X,Q){let Y=X.context?new H4(X.context.isOptional,X.context.isMutable,X.context.defaultValue,{...X.context.annotations,...Q}):new H4(!1,!1,void 0,Q);return fY(X,Y)}var s5=xO(lY);function lY(X){let Q=X.context?X.context.isOptional===!1?new H4(!0,X.context.isMutable,X.context.defaultValue,X.context.annotations):X.context:new H4(!0,!1);return s5(fY(X,Q))}var Cx=xO(fG);function fG(X){let Q=X.context?X.context.isMutable===!1?new H4(X.context.isOptional,!0,X.context.defaultValue,X.context.annotations):X.context:new H4(!1,!0);return Cx(fY(X,Q))}function gO(X,Q){let Y=new K0(hX(Q),T1()),J=[new B0(b6,Y)],$=X.context?new H4(X.context.isOptional,X.context.isMutable,J,X.context.annotations):new H4(!1,!1,J);return fY(X,$)}function rY(X,Q,Y){return cG(X,Y,Q)}function hO(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=hO(X.types[Y]);Q.literals=Q.literals.concat(J.literals),Q.parameters=Q.parameters.concat(J.parameters)}return Q}}return{literals:[],parameters:[]}}function mO(X,Q,Y){let{literals:J,parameters:$}=hO(X);return new lX(J.map((G)=>new bY(G,Q)),$.map((G)=>new mG(G,Q,Y)))}function E0(X){return X.context?.isOptional??!1}function dO(X){return X.context?.isMutable??!1}var z8=p0((X)=>{if(X.encoding)return z8(q0(X,void 0));let Q=X;return Q.recur?.(z8)??Q}),J1=p0((X)=>{return z8(O8(X))});function Tx(X,Q){let Y=Q,J=Y.length,$=Y[J-1],G=[new B0(O8(q0(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 q0(Z,[...Z.encoding,...G]);else return q0(Z,G)}var O8=p0((X)=>{if(X.encoding)return Tx(X,X.encoding);let Q=X;return Q.flip?.(O8)??Q.recur?.(O8)??Q});function pO(X){switch(X._tag){case"Undefined":return!0;case"Union":return X.types.some(pO);default:return!1}}function cO(X,Q){return X.encodedParts.map((Y)=>Ix(Y,fO(Y),Q)).join("")}var oY=p0((X)=>{return new globalThis.RegExp(`^${cO(X,!0)}$`)});function fO(X){switch(X._tag){case"Literal":return LY(globalThis.String(X.literal));case"String":return uG;case"Number":return uX;case"BigInt":return nO;case"TemplateLiteral":return cO(X,!1);case"Union":return X.types.map(fO).join("|")}}function Ix(X,Q,Y){if(yY(X)){if(!Y)return`(?:${Q})`}else if(!Y)return Q;return`(${Q})`}function tX(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 uO=p0((X)=>{return new g1(X.enums.map((Q)=>new b1(Q[1],{title:Q[0]})),"anyOf")});function f6(X){function Q(Y){return Y.encoding?q0(Y,vO(Y.encoding,Q)):X(Y)}return p0(Q)}var lO=f6((X)=>{switch(X._tag){default:return X;case"Number":return X.toCodecStringTree();case"Union":return X.recur(lO)}}),rO=f6((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(rO)}}),uG="[\\s\\S]*?",JO=new globalThis.RegExp(`^${uX}$`);function lG(X){return iX(JO,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:JO},...X})}var oO=f4(m6,[lG()]),jx=new B0(oO,o5),Ex=new B0(new g1([oO,SO],"anyOf"),o5),nO="-?\\d+",$O=new globalThis.RegExp(`^${nO}$`);function rG(X){return iX($O,{expected:"a string representing a bigint",meta:{_tag:"isStringBigInt",regExp:$O},...X})}var oG=f4(m6,[rG({expected:"a string representing a bigint"})]),Sx=new B0(oG,SY),vx="Symbol\\((.*)\\)",vG=new globalThis.RegExp(`^${vx}$`),xx=f4(m6,[nG()]),iO=new B0(xx,new K0(n((X)=>globalThis.Symbol.for(vG.exec(X)[1])),I1((X)=>{if(globalThis.Symbol.keyFor(X)!==void 0)return h(globalThis.String(X));return v(new r5(F(X),{message:"cannot serialize to string, Symbol is not registered"}))})));function nG(X){return iX(vG,{expected:"a string representing a symbol",meta:{_tag:"isStringSymbol",regExp:vG},...X})}function eX(X,Q,Y,J,$){for(let G=0;G<X.length;G++){let Z=X[G];if(Z._tag==="FilterGroup")eX(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 aO(X,Q){let Y=[];if(eX(X,Q,Y,b6,{errors:"all"}),W8(Y)){let J=new D0(b6,F(Q),Y);return f(J)}return l(Q)}var t5="~effect/Schema/Class",h1="~structural";function kx(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 h6([],()=>(X,Q)=>kx(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(b6,y6())}),sO=c6(nY,{typeConstructor:{_tag:"effect/MutableJson"},generation:{runtime:"Schema.MutableJson",Type:"Schema.MutableJson"}}),tO=new B0(a5,new K0(T1(),n(()=>null))),eO=new B0(nY,y6());function yx(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 bx=new h6([],()=>(X,Q)=>yx(X)?h(X):v(new x0(Q,F(X))),{expected:"StringTree",toCodecStringTree:()=>new B0(b6,y6())}),Xz=new B0(bx,y6());var Qz=B(2,(X,Q)=>{return aG(X,(Y,J)=>Q.includes(Y)?[Y,J]:void 0)}),Yz=B(2,(X,Q)=>{return aG(X,(Y,J)=>!Q.includes(Y)?[Y,J]:void 0)}),Jz=B(2,(X,Q)=>{return{...X,...Q}});var iG=B(2,(X,Q)=>{return aG(X,(Y,J)=>[Object.hasOwn(Q,Y)?Q[Y]:Y,J])});var W1=(X)=>X;function aG(X,Q){let Y={};for(let J in X){let $=Q(J,X[J]);if($){let[G,Z]=$;Y[G]=Z}}return Y}function $z(X,Q){let Y=Q?.omitKeyWhen??(()=>!1);return pH((J,$)=>{let G=Reflect.ownKeys(X),Z={};for(let K of G){let H=X[K].combine(J[K],$[K]);if(Y(H))continue;Z[K]=H}return Z})}function XQ(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 Gz=new WeakMap;function Zz(X,Q,Y){return Q.map((J)=>($)=>J.run($,X,i5)===void 0).reduce((J,$)=>J.filter($),Y)}function hx(X){return X?.comparator!==void 0}function Kz(X,Q,Y){let J=Q.constraints?.array,$=hx(J)?X.uniqueArray(Y,J):X.array(Y,J);if(Q.isSuspend)return X.oneof({maxDepth:2,depthIdentifier:""},X.constant([]),$);return $}var Hz=XQ(Oq),Wz=XQ(zq),u4=XQ(eB),mx=XQ(RW()),dx=$z({isInteger:u4,max:Wz,maxExcluded:u4,maxLength:Wz,min:Hz,minExcluded:u4,minLength:Hz,noDefaultInfinity:u4,noInteger:u4,noInvalidDate:u4,noNaN:u4,patterns:mx,comparator:u4},{omitKeyWhen:CH});function px(X,Q,Y){let J=Q[X];return{...Q,[X]:J?dx.combine(J,Y):Y}}var cx={string:null,number:null,bigint:null,array:null,date:null};function fx(X){return X in cx}function _z(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(fx(K))$=px(K,$,G[K]);return $},Y.constraints||{});return{...Y,constraints:J}}}function tG(X){return{...X,constraints:void 0}}function eG(X){if(X)return X.flatMap((Q)=>{switch(Q._tag){case"Filter":return[Q];case"FilterGroup":return eG(Q.checks)}});return[]}var Vz=p0((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)):[],$=eG(X.checks),G=_z($);return(Z,K)=>Zz(X,$,Y(J.map((H)=>H(Z,tG(K))))(Z,G(K)))}if(X.checks){let J=eG(X.checks),$=_z(J),G=L8(uY(X,void 0),Q);return(Z,K)=>Zz(X,J,G(Z,$(K)))}return ux(X,Q)}function ux(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(uO(X),Q);case"TemplateLiteral":return(Y)=>Y.stringMatching(oY(X));case"Arrays":return(Y,J)=>{let $=tG(J),G=X.elements.map((K,H)=>{let W=L8(K,[...Q,H])(Y,$);if(!E0(K))return W.map(F);return W.chain((V)=>Y.boolean().map((_)=>_?F(V):x()))}),Z=Y.tuple(...G).map(PW);if(z6(X.rest)){let K=X.elements.length,[H,...W]=X.rest.map((_,D)=>L8(_,[...Q,K+D])(Y,$)),V=Kz(Y,X.elements.length===0?J:$,H);if(Z=Z.chain((_)=>{if(_.length<K)return Y.constant(_);return V.map((D)=>[..._,...D])}),W.length>0){let _=Y.tuple(...W);Z=Z.chain((D)=>{if(D.length<K)return Y.constant(D);return _.map((q)=>[...D,...q])})}}return Z};case"Objects":return(Y,J)=>{let $=tG(J),G={},Z=[];for(let H of X.propertySignatures){let W=H.name;if(!E0(H.type))Z.push(W);G[W]=L8(H.type,[...Q,W])(Y,$)}let K=Y.record(G,{requiredKeys:Z});for(let H of X.indexSignatures){let W=Y.tuple(L8(H.parameter,Q)(Y,$),L8(H.type,Q)(Y,$)),V=Kz(Y,X.propertySignatures.length===0?J:$,W);K=K.chain((_)=>{return V.map((D)=>{return{...Object.fromEntries(D),..._}})})}return K};case"Union":return(Y,J)=>Y.oneof(...X.types.map(($)=>L8($,Q)(Y,J)));case"Suspend":{let Y=Gz.get(X);if(Y)return Y;let J=p6(()=>L8(X.thunk(),Q)),$=(G,Z)=>G.constant(null).chain(()=>J()(G,{...Z,isSuspend:!0}));return Gz.set(X,$),$}}}var QQ=p0((X)=>{switch(X._tag){case"Declaration":{let Q=X.annotations?.[t5];if(Y8(Q)){let Y=Q(X.typeParameters),J=QQ(Y.to);return q0(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 q0(QQ(Q),Y);return QQ(Q)});case"Suspend":return X.recur(QQ);default:return X}});function e5(X){let Q=QQ(z8(X.ast)),Y=X9(Q);return(J,$)=>{return Y(J,$?.disableChecks?$?.parseOptions?{...$.parseOptions,disableChecks:!0}:{disableChecks:!0}:$?.parseOptions)}}function sY(X){let Q=e5(X);return(Y,J)=>{return c7(e7(Q(Y,J)))}}function Dz(X){let Q=e5(X);return(Y,J)=>{return AX(y1(Q(Y,J),($)=>Error($.toString(),{cause:$})))}}function qz(X){return YQ(X.ast)}function YQ(X){let Q=Q9(X9(z8(X)));return(Y)=>{return V8(Q(Y,i5))}}function Bz(X){let Q=X9(X);return(Y,J)=>{return AX(b$(Q(Y,J),{onSuccess:()=>{return},onFailure:b}))}}function Uz(X){let Q=Q9(X9(z8(X.ast)));return(Y)=>{let J=Q(Y,i5);if(G$(J)){let $=S8(J.cause);if(u($))throw T6($.failure);throw Error($.success.toString(),{cause:$.success})}}}function y0(X){return X9(X.ast)}var tY=y0;function Oz(X){return KZ(y0(X))}function zz(X){return KZ(tY(X))}function Fz(X){return Q9(y0(X))}function XZ(X){return wz(y0(X))}var Lz=XZ;function QZ(X){return Cz(y0(X))}var Pz=QZ;function YZ(X){return Tz(y0(X))}var eY=YZ;function l6(X){return X9(O8(X.ast))}var JZ=(X)=>KZ(l6(X)),Rz=JZ;function Nz(X){return Q9(l6(X))}function $Z(X){return wz(l6(X))}var Mz=$Z;function GZ(X){return Cz(l6(X))}var Az=GZ;function ZZ(X){return Tz(l6(X))}var X2=ZZ;function X9(X){let Q=aY(X);return(Y,J)=>q8(Q(F(Y),J??i5),($)=>{if($._tag==="None")return v(new Z0($));return h($.value)})}function KZ(X){return(Q,Y)=>h$(X(Q,Y))}function Q9(X){return(Q,Y)=>e7(X(Q,Y))}function wz(X){let Q=Q9(X);return(Y,J)=>c7(Q(Y,J))}function Cz(X){let Q=Q9(X);return(Y,J)=>{let $=Q(Y,J);if(V8($))return l($.value);let G=S8($.cause);if(u(G))throw T6(G.failure);return f(G.success)}}function Tz(X){return(Q,Y)=>AX(y1(X(Q,Y),(J)=>Error(J.toString(),{cause:J})))}var aY=p0((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)||ZO(X)||g8(X)&&X.typeParameters.length>0;return($,G)=>{if(Y)G={...G,...Y};let Z=X.encoding,K;if(Z){let W=Z,V=W.length;for(let _=V-1;_>=0;_--){let D=W[_],q=D.to,U=aY(q);if(K=K?q8(K,(R)=>U(R,G)):U($,G),D.transformation._tag==="Transformation"){let R=D.transformation.decode;K=q8(K,(L)=>R.run(L,G))}else K=D.transformation.decode(K,G)}K=y1(K,(_)=>new UG(X,$,_))}Q??=X.getParser(aY);let H=K?q8(K,(W)=>Q(W,G)):Q($,G);if(X.checks&&!G?.disableChecks){let W=X.checks;if(G?.errors==="all"&&J&&B1($))H=d5(H,(V)=>{let _=[];eX(W.filter((q)=>q.annotations?.[h1]),$.value,_,X,G);let D=W8(_)?V._tag==="Composite"&&V.ast===X?new D0(X,V.actual,[...V.issues,..._]):new D0(X,$,[V,..._]):V;return v(D)});H=q8(H,(V)=>{if(B1(V)){let _=V.value,D=[];if(eX(W,_,D,X,G),W8(D))return v(new D0(X,V,D))}return h(V)})}return H}});var Iz=p0((X)=>{return l4(X,[])});function l4(X,Q){let Y=U8(X)?.toEquivalence;if(Y)return Y(g8(X)?X.typeParameters.map((J)=>l4(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)=>l4(Z,[...Q,K])),$=X.elements.length,G=X.rest.map((Z,K)=>l4(Z,[...Q,$+K]));return s0((Z,K)=>{if(!Array.isArray(Z)||!Array.isArray(K))return!1;let H=Z.length;if(H!==K.length)return!1;let W=0;for(;W<Math.min(H,X.elements.length);W++)if(!J[W](Z[W],K[W]))return!1;if(G.length>0){let[V,..._]=G;for(;W<H-_.length;W++)if(!V(Z[W],K[W]))return!1;for(let D=0;D<_.length;D++)if(W+=D,!_[D](Z[W],K[W]))return!1}return!0})}case"Objects":{if(X.propertySignatures.length===0&&X.indexSignatures.length===0)return o;let J=X.propertySignatures.map((G)=>l4(G.type,[...Q,G.name])),$=X.indexSignatures.map((G)=>l4(G.type,Q));return s0((G,Z)=>{if(!f1(G)||!f1(Z))return!1;for(let K=0;K<J.length;K++){let H=X.propertySignatures[K],W=H.name,V=Object.hasOwn(G,W),_=Object.hasOwn(Z,W);if(E0(H.type)){if(V!==_)return!1}if(V&&_&&!J[K](G[W],Z[W]))return!1}for(let K=0;K<$.length;K++){let H=X.indexSignatures[K],W=d6(G,H.parameter),V=d6(Z,H.parameter);if(W.length!==V.length)return!1;for(let _=0;_<W.length;_++){let D=W[_];if(!Object.hasOwn(Z,D)||!$[K](G[D],Z[D]))return!1}}return!0})}case"Union":return s0((J,$)=>{let G=nX(J,X.types),Z=G.map(YQ);for(let K=0;K<G.length;K++){let H=Z[K];if(H(J)&&H($))return l4(G[K],Q)(J,$)}return!1});case"Suspend":{let J=p6(()=>l4(X.thunk(),Q));return s0(($,G)=>J()($,G))}}}function Q2(X){return X.replace(/~/g,"~0").replace(/\//g,"~1")}function jz(X){return X.replace(/~1/g,"/").replace(/~0/g,"~")}var Y2="~effect/Schema/Schema",ox={[Y2]:Y2,pipe(){return a(this,arguments)},annotate(X){return this.rebuild(c6(this.ast,X))},annotateKey(X){return this.rebuild(sX(this.ast,X))},check(...X){return this.rebuild(f4(this.ast,X))}};function r6(X,Q){let Y=Object.create(ox);if(Q)Object.assign(Y,Q);return Y.ast=X,Y.rebuild=(J)=>r6(J,Q),Y.makeEffect=MH(e5(Y),y1((J)=>new _4(J))),Y.make=Dz(Y),Y.makeOption=sY(Y),Y}var J2="~effect/Schema/SchemaError";class _4{[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=WZ(nx);function nx(X){switch(X._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function WZ(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),H=X(Z);if(K!==H)return K-H;return Y.get(G)-Y.get(Z)});if(!J.some((G,Z)=>G!==Q[Z]))return Q;return J}}function Sz(X){let{references:Q,representations:Y}=ix([X]);return{representation:Y[0],references:Q}}function ix(X){let Q={},Y=new Map,J=new Set,$=new Set;return{representations:j4(X,(_)=>K(_)),references:Q};function Z(_){let D=_,q=0;while(J.has(D))D=`${_}${++q}`;return J.add(D),D}function K(_,D){let q=Y.get(_);if(q!==void 0)return{_tag:"Reference",$ref:q};let U=aX(_),R=u5(_)??D;if(_!==U)return K(U,R);if(R!==void 0){let P=Z(R);Y.set(_,P);let y=W(_),Y0=Q[R];if(Y0!==void 0&&o(y,Y0))return Y.set(_,R),{_tag:"Reference",$ref:R};return Q[P]=y,{_tag:"Reference",$ref:P}}if($.has(_)){let P=Z(`${_._tag}_`);return Y.set(_,P),{_tag:"Reference",$ref:P}}$.add(_);let L=W(_);$.delete(_);let N=Y.get(_);if(N!==void 0)return Q[N]=L,{_tag:"Reference",$ref:N};return L}function H(_){let D=_.annotations?.toCodecJson??_.annotations?.toCodec;if(Y8(D)){let q=_.typeParameters.map((R)=>r6(J1(R))),U=D(q);return q0(_,[U])}return a5}function W(_){let D=JQ(_.annotations);switch(_._tag){case"Declaration":{let q=K(H(_));return{_tag:"Declaration",typeParameters:_.typeParameters.map((U)=>K(U)),encodedSchema:q,checks:V(_.checks),...D}}case"Null":case"Undefined":case"Void":case"Never":case"Unknown":case"Any":case"Boolean":case"Symbol":return{_tag:_._tag,...D};case"String":{let q=_.annotations?.contentMediaType,U=_.annotations?.contentSchema;return{_tag:_._tag,checks:V(_.checks),...D,...typeof q==="string"&&GO(U)?{contentSchema:K(U)}:void 0}}case"Number":case"BigInt":return{_tag:_._tag,checks:V(_.checks),...D};case"Literal":return{_tag:_._tag,literal:_.literal,...D};case"UniqueSymbol":return{_tag:_._tag,symbol:_.symbol,...D};case"ObjectKeyword":return{_tag:_._tag,...D};case"Enum":return{_tag:_._tag,enums:_.enums,...D};case"TemplateLiteral":return{_tag:_._tag,parts:_.parts.map((q)=>K(q)),...D};case"Arrays":return{_tag:_._tag,elements:_.elements.map((q)=>{let U=aX(q);return{isOptional:E0(U),type:K(q),...JQ(U.context?.annotations)}}),rest:_.rest.map((q)=>K(q)),checks:V(_.checks),...D};case"Objects":return{_tag:_._tag,propertySignatures:_.propertySignatures.map((q)=>{let U=aX(q.type);return{name:q.name,type:K(q.type),isOptional:E0(U),isMutable:dO(U),...JQ(U.context?.annotations)}}),indexSignatures:_.indexSignatures.map((q)=>({parameter:K(q.parameter),type:K(q.type)})),checks:V(_.checks),...D};case"Union":{let q=$2(_.types);return{_tag:_._tag,types:q.map((U)=>K(U)),mode:_.mode,...D}}case"Suspend":return{_tag:"Suspend",checks:[],thunk:K(_.thunk()),...D}}}function V(_){if(!_)return[];return _.map(D).filter((q)=>q!==void 0);function D(q){switch(q._tag){case"Filter":{let U=q.annotations?.meta;if(U)return{_tag:"Filter",meta:U._tag==="isPropertyNames"?{_tag:"isPropertyNames",propertyNames:K(U.propertyNames)}:U,...JQ(q.annotations)};return}case"FilterGroup":{let U=V(q.checks);if(W8(U))return{_tag:"FilterGroup",checks:U,...JQ(q.annotations)}}}}}}var ax=new Set(["~structural","~sentinels","meta","toArbitrary","toArbitraryConstraint","toEquivalence","toFormatter","toCodec","toCodecJson","toCodecIso",t5]);function JQ(X){if(X!==void 0){let Q=zW(X,(Y,J)=>!ax.has(J));if(!E3(Q))return{annotations:Q}}return}function vz(X,Q){let{definitions:Y,dialect:J,schemas:$}=sx({representations:[X.representation],references:X.references},Q),G=$[0];return{dialect:J,schema:G,definitions:Y}}function sx(X,Q){let Y=Q?.generateDescriptions??!1,J=Q?.additionalProperties??!1,$=L5(X.references,(D)=>G(D));return{dialect:"draft-2020-12",schemas:j4(X.representations,(D)=>G(D)),definitions:$};function G(D){let q=Z(D);if("annotations"in D){let U=H(D.annotations);if(U)q={...q,...U}}if("checks"in D){let U=W(D.checks,q.type);for(let R of U)q=_Z(q,R)}return q}function Z(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 G(D.encodedSchema);case"Suspend":return G(D.thunk);case"Reference":return{$ref:`#/$defs/${Q2(D.$ref)}`};case"Null":return{type:"null"};case"Never":return{not:{}};case"String":{let q={type:"string"};if(D.contentMediaType!==void 0)q.contentMediaType=D.contentMediaType;if(D.contentSchema!==void 0)q.contentSchema=G(D.contentSchema);return q}case"Number":return VZ(D.checks,"isInt")?{type:"integer"}:VZ(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 q=D.literal;if(typeof q==="string")return{type:"string",enum:[q]};if(typeof q==="number")return{type:"number",enum:[q]};if(typeof q==="boolean")return{type:"boolean",enum:[q]};return{type:"string",enum:[String(q)]}}case"Enum":return G({_tag:"Union",types:D.enums.map(([q,U])=>({_tag:"Literal",literal:U,annotations:{title:q}})),mode:"anyOf",annotations:D.annotations});case"TemplateLiteral":return{type:"string",pattern:`^${D.parts.map(G2).join("")}$`};case"Arrays":{if(D.rest.length>1)throw new globalThis.Error("Generating a JSON Schema for post-rest elements is not supported");let q={type:"array"},U=D.elements.length,R=D.elements.map((L)=>{if(L.isOptional)U--;let N=G(L.type),P=H(L.annotations);return P?_Z(N,P):N});if(R.length>0){if(q.prefixItems=R,q.maxItems=D.elements.length,U>0)q.minItems=U}else q.items=!1;if(D.rest.length>0){delete q.maxItems;let L=G(D.rest[0]);if(Object.keys(L).length>0)q.items=L;else delete q.items}return q}case"Objects":{if(D.propertySignatures.length===0&&D.indexSignatures.length===0)return{anyOf:[{type:"object"},{type:"array"}]};let q={type:"object"},U={},R=[];for(let N of D.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=H(N.annotations);if(U[P]=Y0?_Z(y,Y0):y,!N.isOptional)R.push(P)}if(Object.keys(U).length>0)q.properties=U;if(R.length>0)q.required=R;q.additionalProperties=J;let L={};for(let N of D.indexSignatures){let P=G(N.type);if(Object.keys(P).length===1&&"not"in P)P=!1;let y=_(N.parameter);if(y.length>0)for(let Y0 of y)L[Y0]=P;else q.additionalProperties=P}if(Object.keys(L).length>0)q.patternProperties=L,delete q.additionalProperties;if(f1(q.additionalProperties)&&E3(q.additionalProperties))delete q.additionalProperties;return q}case"Union":{let q=D.types.map(G);if(q.length===0)return{not:{}};if(q.length>1){let U=K(q);if(U)return U}return D.mode==="anyOf"?{anyOf:q}:{oneOf:q}}}}function K(D){let q,U=[];for(let R of D){if(Object.keys(R).length!==2||R.type===void 0||!Array.isArray(R.enum)||R.enum.length===0)return;if(q===void 0)q=R.type;else if(R.type!==q)return;for(let N of R.enum)U.push(N)}return{type:q,enum:U}}function H(D){if(D){let q={};if(typeof D.title==="string")q.title=D.title;if(typeof D.description==="string")q.description=D.description;else if(Y&&typeof D.expected==="string")q.description=D.expected;if(D.default!==void 0)q.default=D.default;if(Array.isArray(D.examples))q.examples=D.examples;if(typeof D.readOnly==="boolean")q.readOnly=D.readOnly;if(typeof D.writeOnly==="boolean")q.writeOnly=D.writeOnly;if(typeof D.format==="string")q.format=D.format;if(typeof D.contentEncoding==="string")q.contentEncoding=D.contentEncoding;if(typeof D.contentMediaType==="string")q.contentMediaType=D.contentMediaType;if(Object.keys(q).length>0)return q}}function W(D,q){return D.map(U).filter((R)=>R!==void 0);function U(R){switch(R._tag){case"Filter":return V(R,q);case"FilterGroup":{let L=R.checks.map(U).filter((y)=>y!==void 0);if(L.length===0)return;let N={allOf:L},P=H(R.annotations);if(P)N={...N,...P};return N}}}}function V(D,q){let U=D.meta;if(!U)return;let R=N(U),L=H(D.annotations);if(L)R={...R,...L};return R;function N(P){switch(P._tag){case"isMinLength":return q==="array"?{minItems:P.minLength}:{minLength:P.minLength};case"isMaxLength":return q==="array"?{maxItems:P.maxLength}:{maxLength:P.maxLength};case"isLengthBetween":return q==="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 _(D){switch(D._tag){default:throw new globalThis.Error(`Unsupported index signature parameter: ${D._tag}`);case"Reference":return _(X.references[D.$ref]);case"String":return tx(D);case"TemplateLiteral":return[`^${D.parts.map(G2).join("")}$`];case"Union":return D.types.flatMap(_)}}}function tx(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 VZ(X,Q){return X.some((Y)=>{switch(Y._tag){case"Filter":return Y.meta._tag===Q;case"FilterGroup":return VZ(Y.checks,Q)}})}function _Z(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 uG;case"Number":return uX;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}`,H=Z2(X[Z],Q[Z]);for(let W of H)xz(W,K),Y.push(W)}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 H=`/${Q2(Z)}`,W=Object.hasOwn(X,Z),V=Object.hasOwn(Q,Z);if(W&&V){let _=Z2(X[Z],Q[Z]);for(let D of _)xz(D,H),Y.push(D)}else if(!W&&V)Y.push({op:"add",path:H,value:Q[Z]});else if(W&&!V)Y.push({op:"remove",path:H})}return Y}return Y.push({op:"replace",path:"",value:Q}),Y}function yz(X,Q){let Y=Q;for(let J of X)switch(J.op){case"replace":{Y=J.path===""?J.value:kz(Y,J.path,J.value,"replace");break}case"add":{Y=Qk(Y,J.path,J.value);break}case"remove":{Y=kz(Y,J.path,void 0,"remove");break}}return Y}function xz(X,Q){X.path=X.path===""?Q:Q+X.path}function K2(X){return f1(X)}function Xk(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(jz)}function DZ(X){if(!/^(0|[1-9]\d*)$/.test(X))throw Error(`Invalid array index: "${X}"`);return Number(X)}function Qk(X,Q,Y){if(Q==="")return Y;let J=bz(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:DZ($);if(K<0||K>G.length)throw Error(`Array index out of bounds at "${Q}".`);let H=G.slice();return H.splice(K,0,Y),H2(Z,H)}if(K2(G)){let K={...G};return K[$]=Y,H2(Z,K)}throw Error(`Cannot add at "${Q}" (parent not found or not a container).`)}function kz(X,Q,Y,J){if(Q===""){if(J==="remove"||Y===void 0)throw Error("Unsupported operation at the root");return Y}let $=bz(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 H=DZ(G);if(H<0||H>=Z.length)throw Error(`Array index out of bounds at "${Q}".`);let W=Z.slice();if(J==="remove")W.splice(H,1);else W[H]=Y;return H2(K,W)}if(K2(Z)){if(!Object.hasOwn(Z,G))throw Error(`Property "${G}" does not exist at "${Q}".`);let H={...Z};if(J==="remove")delete H[G];else H[G]=Y;return H2(K,H)}throw Error(`Cannot ${J} at "${Q}" (parent not found or not a container).`)}function bz(X,Q){let Y=Xk(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 H=DZ(K);if(H<0||H>=G.length)return null;$.push({container:G,token:H}),G=G[H];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 H2(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 Jk=/^#\/\$defs(?=\/|$)/;function hz(X){return{dialect:"draft-07",schema:gz(X.schema),definitions:L5(X.definitions,gz)}}function gz(X){return Q(X);function Q(J){return Y(qZ(J,($)=>$.replace(Jk,"#/definitions")),!0)}function Y(J,$){if(Array.isArray(J))return J.map((W)=>Y(W,!1));if(!f1(J))return J;let G=J,Z={},K=void 0,H=void 0;for(let W of Object.keys(G)){let V=G[W];switch(W){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[W]=V;break;case"properties":case"patternProperties":{let _=$k(V,Y);Z[W]=_??V;break}case"additionalProperties":case"propertyNames":Z[W]=Y(V,!1);break;case"allOf":case"anyOf":case"oneOf":Z[W]=Array.isArray(V)?V.map((_)=>Y(_,!1)):V;break;case"prefixItems":K=V;break;case"items":H=V;break;default:break}}if(K!==void 0)if(Array.isArray(K)){if(Z.items=K.map((W)=>Y(W,!1)),H!==void 0)Z.additionalItems=Y(H,!1)}else Z.items=Y(K,!1);else if(H!==void 0)Z.items=Y(H,!1);return Z}}function qZ(X,Q){if(Array.isArray(X))return X.map((J)=>qZ(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]=qZ($,Q);else Y[J]=$}return Y}function $k(X,Q){if(!f1(X))return;let Y={};for(let J of Object.keys(X))Y[J]=Q(X[J],!1);return Y}function dz(X,Q){return P8(new uz(X,Q))}function mz(X,Q){return P8(new UZ(X,Q))}class pz{_tag="IdentityNode"}var cz=new pz;class fz{_tag="CompositionNode";nodes;constructor(X){this.nodes=X}}class uz{_tag="IsoNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class UZ{_tag="LensNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class lz{_tag="PrismNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class OZ{_tag="OptionalNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class zZ{_tag="PathNode";path;constructor(X){this.path=X}}class _2{_tag="CheckNode";checks;constructor(X){this.checks=X}}function Zk(X,Q){let Y=X[X.length-1];if(Y){if(Y._tag==="PathNode"&&Q._tag==="PathNode"){X[X.length-1]=new zZ([...Y.path,...Q.path]);return}if(Y._tag==="CheckNode"&&Q._tag==="CheckNode"){X[X.length-1]=new _2([...Y.checks,...Q.checks]);return}}X.push(Q)}function BZ(X,Q){if(X._tag==="IdentityNode")return;if(X._tag==="CompositionNode"){for(let Y=0;Y<X.nodes.length;Y++)BZ(X.nodes[Y],Q);return}Zk(Q,X)}function o6(X,Q){let Y=[];switch(BZ(X,Y),BZ(Q,Y),Y.length){case 0:return cz;case 1:return Y[0];default:return new fz(Y)}}function Kk(X,Q){return P8(new OZ(X,Q))}class $Q{node;getResult;replaceResult;constructor(X,Q,Y){this.node=X,this.getResult=Q,this.replaceResult=Y}replace(X,Q){return v9(this.replaceResult(X,Q),()=>Q)}modify(X){return(Q)=>v9(Q7(this.getResult(Q),(Y)=>this.replaceResult(X(Y),Q)),()=>Q)}compose(X){return P8(o6(this.node,X.node))}key(X){return P8(o6(this.node,new zZ([X])))}optionalKey(X){return P8(o6(this.node,new UZ((Q)=>Q[X],(Q,Y)=>{let J=V2(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(o6(this.node,new _2(X)))}refine(X,Q){return P8(o6(this.node,new _2([pY(X,Q)])))}tag(X){return P8(o6(this.node,new lz((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(o6(this.node,new OZ((J)=>Object.hasOwn(J,X)?l(J[X]):Y,(J,$)=>{if(Object.hasOwn($,X)){let G=V2($);return G[X]=J,l(G)}else return Y})))}pick(X){return this.compose(mz(Qz(X),(Q,Y)=>({...Y,...Q})))}omit(X){return this.compose(mz(Yz(X),(Q,Y)=>({...Y,...Q})))}notUndefined(){return this.refine($1,{expected:"a value other than `undefined`"})}forEach(X){let Q=X(D2());return Kk((Y)=>O6(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 H=G[K],W=Q.replaceResult(Y[K],$[H]);if(u(W))return f(`each: could not set element ${H}`);Z[H]=W.success}return this.replaceResult(Z,J)}))}modifyAll(X){return(Q)=>v9(Q7(this.getResult(Q),(Y)=>this.replaceResult(Y.map(X),Q)),()=>Q)}}class rz extends $Q{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 oz extends $Q{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 nz extends $Q{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)=>v9(O6(this.getResult(Q),(Y)=>this.set(X(Y))),()=>Q)}}function P8(X){let Q=iz(X);switch(Q._tag){case"IsoNode":return new rz(X,Q.get,Q.set);case"LensNode":return new oz(X,Q.get,Q.set);case"PrismNode":return new nz(X,Q.get,Q.set);case"OptionalNode":return new $Q(X,Q.get,Q.set)}}function V2(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 iz=p0((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,$=V2(Y),G=$,Z=0;for(;Z<J.length-1;Z++){let H=J[Z];G[H]=V2(G[H]),G=G[H]}let K=J[Z];return G[K]=Q,$}};case"CheckNode":return{_tag:"PrismNode",get:(Q)=>S9(aO(X.checks,Q),String),set:b};case"CompositionNode":{let Q=X.nodes.map(iz),Y=Q.reduce((J,$)=>Hk(J,$._tag),"IsoNode");return{_tag:Y,get:(J)=>{for(let $=0;$<Q.length;$++){let G=Q[$],Z=G.get(J);if(W2(G._tag)){if(u(Z))return Z;J=Z.success}else J=Z}return W2(Y)?l(J):J},set:(J,$)=>{let G=$,Z=Q.length,K=Array(Z+1);K[0]=$;for(let H=0;H<Z;H++){let W=Q[H];if(W2(W._tag)){let V=W.get($);if(u(V))return Y==="OptionalNode"?V:G;$=V.success}else $=W.get($);K[H+1]=$}for(let H=Z-1;H>=0;H--){let W=Q[H];if(az(W._tag))J=W.set(J);else if(W._tag==="LensNode")J=W.set(J,K[H]);else{let V=W.set(J,K[H]);if(u(V))return V;J=V.success}}return Y==="OptionalNode"?l(J):J}}}}});function W2(X){return X==="PrismNode"||X==="OptionalNode"}function az(X){return X==="IsoNode"||X==="PrismNode"}function Hk(X,Q){switch(X){case"IsoNode":return Q;case"LensNode":return W2(Q)?"OptionalNode":"LensNode";case"PrismNode":return az(Q)?"PrismNode":"OptionalNode";case"OptionalNode":return"OptionalNode"}}var Wk=P8(cz);function D2(){return Wk}var fK={};J6(fK,{webUrl:()=>Dc,webSegment:()=>gR,webQueryParameters:()=>mR,webPath:()=>hR,webFragments:()=>bR,webAuthority:()=>kR,uuid:()=>ep,uniqueArray:()=>e6,ulid:()=>rp,uint8ClampedArray:()=>AR,uint8Array:()=>MR,uint32Array:()=>NR,uint16Array:()=>RR,tuple:()=>e,toStringMethod:()=>M8,subarray:()=>gp,stringify:()=>g0,stringMatching:()=>nc,string:()=>d0,stream:()=>a4,statistics:()=>ub,sparseArray:()=>wR,shuffledSubarray:()=>hp,set:()=>CR,schedulerFor:()=>Cc,scheduler:()=>wc,scheduledModelRun:()=>Mc,sample:()=>cb,resetConfigureGlobal:()=>ny,record:()=>VK,readConfigureGlobal:()=>N8,property:()=>sy,pre:()=>Mk,option:()=>U4,oneof:()=>l0,object:()=>Fp,noShrink:()=>k2,noBias:()=>v2,nat:()=>n4,modelRun:()=>Rc,mixedCase:()=>ad,memo:()=>ud,maxSafeNat:()=>pm,maxSafeInteger:()=>VR,mapToConstant:()=>V9,map:()=>DK,lorem:()=>dd,limitShrink:()=>Qf,letrec:()=>BR,jsonValue:()=>ER,json:()=>Mp,ipV6:()=>qR,ipV4Extended:()=>DR,ipV4:()=>hK,integer:()=>z0,int8Array:()=>PR,int32Array:()=>LR,int16Array:()=>FR,infiniteStream:()=>Cp,hash:()=>x2,hasToStringMethod:()=>RK,hasCloneMethod:()=>s6,hasAsyncToStringMethod:()=>NK,getDepthContextFor:()=>CK,gen:()=>ib,func:()=>gm,float64Array:()=>zR,float32Array:()=>OR,float:()=>HR,falsy:()=>Ng,entityGraph:()=>vd,emailAddress:()=>rh,double:()=>b2,domain:()=>kK,dictionary:()=>EK,defaultReportMessage:()=>xP,date:()=>uP,createDepthIdentifier:()=>TK,context:()=>Ag,constantFrom:()=>m8,constant:()=>b0,configureGlobal:()=>oy,compareFunc:()=>km,compareBooleanFunc:()=>vm,commands:()=>Oc,cloneMethod:()=>r0,cloneIfNeeded:()=>Z9,clone:()=>xg,check:()=>bP,boolean:()=>OQ,bigUint64Array:()=>Ic,bigInt64Array:()=>Tc,bigInt:()=>s4,base64String:()=>xp,asyncToStringMethod:()=>B4,asyncStringify:()=>MK,asyncProperty:()=>ay,asyncModelRun:()=>Nc,asyncDefaultReportMessage:()=>kP,assert:()=>db,array:()=>P0,anything:()=>jR,__version:()=>Jf,__type:()=>Yf,__commitHash:()=>$f,VerbosityLevel:()=>z1,Value:()=>k,Stream:()=>Q0,Random:()=>AK,PreconditionFailure:()=>t4,ExecutionStatus:()=>i6,Arbitrary:()=>I0});var Vk=class X{constructor(Q){this.seed=Q}clone(){return new X(this.seed)}next(){let Q=FZ(this.seed),Y=LZ(Q),J=FZ(Q),$=LZ(J);return this.seed=FZ(J),LZ(this.seed)+($+(Y<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function FZ(X){return Math.imul(X,214013)+2531011&4294967295}function LZ(X){return(X&-2147483649)>>16}function sz(X){return new Vk(X)}var Dk=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=q2(this.states,this.index),Q}getState(){return[this.index,...this.states]}jump(){let Q=this.states.slice(),Y=this.index;this.index=q2(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)tz(this.states,this.index,Q,Y);this.index=q2(this.states,this.index)}tz(this.states,this.index,Q,Y)}};function tz(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 q2(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 qk(X){for(let Q=0;Q!==624;++Q)q2(X,Q)}function ez(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 qk(Q),new Dk(Q,0)}var Bk=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 PZ(X){return new Bk(-1,~X,X|0,0)}var Uk=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 XF(X){return new Uk(-1,~X,X|0,0)}function QF(X,Q){for(let Y=0;Y!==Q;++Y)X.next()}var YF=BigInt,Ok=4294967296n;function $F(X,Q,Y){let J=Y-Q+1n,$=Ok,G=1;while($<J)$<<=32n,++G;let Z=JF(G,X);if(Z<J)return Z+Q;if(Z+J<$)return Z%J+Q;let K=$-$%J;while(Z>=K)Z=JF(G,X);return Z%J+Q}function JF(X,Q){let Y=YF(Q.next()+2147483648);for(let J=1;J<X;++J){let $=Q.next();Y=(Y<<32n)+YF($+2147483648)}return Y}function GQ(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 RZ(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 zk(X,Q,Y){let J=Q.data[1],$=Q.data[0],G=Q.sign,Z=Y.data[1],K=Y.data[0],H=Y.sign;if(X.sign=1,G===1&&H===-1){let R=J+Z,L=$+K+(R>4294967295?1:0);return X.data[0]=L>>>0,X.data[1]=R>>>0,X}let W=J,V=$,_=Z,D=K;if(G===-1)W=Z,V=K,_=J,D=$;let q=0,U=W-_;if(U<0)q=1,U=U>>>0;return X.data[0]=V-D-q,X.data[1]=U,X}function Fk(X,Q,Y){let J=Y[0]+1;Q[0]=GQ(X,J),Q[1]=GQ(X,4294967296);while(Q[0]>=Y[0]&&(Q[0]!==Y[0]||Q[1]>=Y[1]))Q[0]=GQ(X,J),Q[1]=GQ(X,4294967296);return Q}var Lk=Number.MAX_SAFE_INTEGER,Pk={sign:1,data:[0,0]},Rk={sign:1,data:[0,0]},GF={sign:1,data:[0,0]},NZ=[0,0];function Nk(X,Q,Y,J){let $=J<=Lk?RZ(GF,J):zk(GF,RZ(Pk,Y),RZ(Rk,Q));if($.data[1]===4294967295)$.data[0]+=1,$.data[1]=0;else $.data[1]+=1;return Fk(X,NZ,$.data),NZ[0]*4294967296+NZ[1]+Q}function B2(X,Q,Y){let J=Y-Q;if(J<=4294967295)return GQ(X,J+1)+Q;return Nk(X,Q,Y,J)}var ZF=Symbol.for("fast-check/PreconditionFailure"),t4=class extends Error{constructor(X=!1){super();this.interruptExecution=X,this.footprint=ZF}static isFailure(X){return X!==null&&X!==void 0&&X.footprint===ZF}};function Mk(X){if(!X)throw new t4}var Ak=class{[Symbol.iterator](){return this}next(X){return{value:X,done:!0}}},wk=new Ak;function Ck(){return wk}function*Tk(X,Q){for(let Y of X)yield Q(Y)}function*Ik(X,Q){for(let Y of X)yield*Q(Y)}function*jk(X,Q){for(let Y of X)if(Q(Y))yield Y}function*Ek(X,Q){for(let Y=0;Y<Q;++Y){let J=X.next();if(J.done)break;yield J.value}}function*Sk(X,Q){let Y=X.next();while(!Y.done&&Q(Y.value))yield Y.value,Y=X.next()}function*vk(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 xk=Symbol.iterator,Q0=class X{static nil(){return new X(Ck())}static of(...Q){return new X(Q[xk]())}constructor(Q){this.g=Q}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(Q){return new X(Tk(this.g,Q))}flatMap(Q){return new X(Ik(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(Sk(this.g,Q))}take(Q){return new X(Ek(this.g,Q))}filter(Q){return new X(jk(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(vk(this.g,Q))}getNthOrLast(Q){let Y=Q,J=null;for(let $ of this.g){if(Y--===0)return $;J=$}return J}};function a4(X){return new Q0(X)}var r0=Symbol.for("fast-check/cloneMethod");function s6(X){return X!==null&&(typeof X==="object"||typeof X==="function")&&r0 in X&&typeof X[r0]==="function"}function Z9(X){return s6(X)?X[r0]():X}var kk=Object.defineProperty,k=class{constructor(X,Q,Y=void 0){if(this.value_=X,this.context=Q,this.hasToBeCloned=Y!==void 0||s6(X),this.readOnce=!1,this.hasToBeCloned)kk(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 gk(this,X)}map(X,Q){return new bk(this,X,Q)}chain(X){return new yk(this,X)}},yk=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}},bk=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)&&!s6(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}},gk=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 ZP(X){return typeof X==="object"&&X!==null&&"generate"in X&&"shrink"in X&&"canShrinkWithoutContext"in X}function KP(X){if(!ZP(X))throw Error("Unexpected value received: not an instance of Arbitrary")}var HP=Function.prototype.apply,MZ=Symbol("apply");function hk(X){try{return X.apply}catch{return}}function mk(X,Q,Y){let J=X;J[MZ]=HP;let $=J[MZ](Q,Y);return delete J[MZ],$}function _0(X,Q,Y){if(hk(X)===HP)return X.apply(Q,Y);return mk(X,Q,Y)}var WP=Array,j=BigInt,dk=BigInt64Array,pk=BigUint64Array,_P=Boolean,j2=Date,E=Error,VP=Float32Array,DP=Float64Array,ck=Int8Array,fk=Int16Array,uk=Int32Array,D4=Number,F1=String,K9=Set,lk=Uint8Array,rk=Uint8ClampedArray,ok=Uint16Array,nk=Uint32Array,ik=encodeURIComponent,q4=Map,N2=Symbol,KF=Array.prototype.forEach,HF=Array.prototype.indexOf,WF=Array.prototype.join,_F=Array.prototype.map,VF=Array.prototype.flat,DF=Array.prototype.filter,qF=Array.prototype.push,BF=Array.prototype.pop,UF=Array.prototype.splice,OF=Array.prototype.slice,zF=Array.prototype.sort,FF=Array.prototype.every;function ak(X){try{return X.forEach}catch{return}}function sk(X){try{return X.indexOf}catch{return}}function tk(X){try{return X.join}catch{return}}function ek(X){try{return X.map}catch{return}}function Xy(X){try{return X.flat}catch{return}}function Qy(X){try{return X.filter}catch{return}}function Yy(X){try{return X.push}catch{return}}function Jy(X){try{return X.pop}catch{return}}function $y(X){try{return X.splice}catch{return}}function Gy(X){try{return X.slice}catch{return}}function Zy(X){try{return X.sort}catch{return}}function Ky(X){try{return X.every}catch{return}}function qP(X,Q){if(ak(X)===KF)return X.forEach(Q);return _0(KF,X,[Q])}function V4(X,...Q){if(sk(X)===HF)return X.indexOf(...Q);return _0(HF,X,Q)}function w0(X,...Q){if(tk(X)===WF)return X.join(...Q);return _0(WF,X,Q)}function G0(X,Q){if(ek(X)===_F)return X.map(Q);return _0(_F,X,[Q])}function Hy(X,Q){if(Xy(X)===VF)return[].flat(),X.flat(Q);return _0(VF,X,[Q])}function Wy(X,Q){if(Qy(X)===DF)return X.filter(Q);return _0(DF,X,[Q])}function S(X,...Q){if(Yy(X)===qF)return X.push(...Q);return _0(qF,X,Q)}function BP(X){if(Jy(X)===BF)return X.pop();return _0(BF,X,[])}function UP(X,...Q){if($y(X)===UF)return X.splice(...Q);return _0(UF,X,Q)}function e0(X,...Q){if(Gy(X)===OF)return X.slice(...Q);return _0(OF,X,Q)}function OP(X,...Q){if(Zy(X)===zF)return X.sort(...Q);return _0(zF,X,Q)}function zP(X,...Q){if(Ky(X)===FF)return X.every(...Q);return _0(FF,X,Q)}var LF=Date.prototype.getTime,PF=Date.prototype.toISOString;function _y(X){try{return X.getTime}catch{return}}function Vy(X){try{return X.toISOString}catch{return}}function E2(X){if(_y(X)===LF)return X.getTime();return _0(LF,X,[])}function Dy(X){if(Vy(X)===PF)return X.toISOString();return _0(PF,X,[])}var RF=Set.prototype.add,NF=Set.prototype.has;function qy(X){try{return X.add}catch{return}}function By(X){try{return X.has}catch(Q){return}}function _Q(X,Q){if(qy(X)===RF)return X.add(Q);return _0(RF,X,[Q])}function S2(X,Q){if(By(X)===NF)return X.has(Q);return _0(NF,X,[Q])}var MF=WeakMap.prototype.set,AF=WeakMap.prototype.get;function Uy(X){try{return X.set}catch(Q){return}}function Oy(X){try{return X.get}catch(Q){return}}function zy(X,Q,Y){if(Uy(X)===MF)return X.set(Q,Y);return _0(MF,X,[Q,Y])}function Fy(X,Q){if(Oy(X)===AF)return X.get(Q);return _0(AF,X,[Q])}var wF=Map.prototype.set,CF=Map.prototype.get,TF=Map.prototype.has;function Ly(X){try{return X.set}catch(Q){return}}function Py(X){try{return X.get}catch(Q){return}}function Ry(X){try{return X.has}catch(Q){return}}function R8(X,Q,Y){if(Ly(X)===wF)return X.set(Q,Y);return _0(wF,X,[Q,Y])}function p1(X,Q){if(Py(X)===CF)return X.get(Q);return _0(CF,X,[Q])}function Ny(X,Q){if(Ry(X)===TF)return X.has(Q);return _0(TF,X,[Q])}var IF=String.prototype.split,jF=String.prototype.startsWith,EF=String.prototype.endsWith,SF=String.prototype.substring,vF=String.prototype.toLowerCase,xF=String.prototype.toUpperCase,kF=String.prototype.padStart,yF=String.prototype.charCodeAt,bF=String.prototype.normalize,gF=String.prototype.replace;function My(X){try{return X.split}catch{return}}function Ay(X){try{return X.startsWith}catch{return}}function wy(X){try{return X.endsWith}catch{return}}function Cy(X){try{return X.substring}catch{return}}function Ty(X){try{return X.toLowerCase}catch{return}}function Iy(X){try{return X.toUpperCase}catch{return}}function jy(X){try{return X.padStart}catch{return}}function Ey(X){try{return X.charCodeAt}catch{return}}function Sy(X){try{return X.normalize}catch(Q){return}}function vy(X){try{return X.replace}catch{return}}function L1(X,...Q){if(My(X)===IF)return X.split(...Q);return _0(IF,X,Q)}function xy(X,...Q){if(Ay(X)===jF)return X.startsWith(...Q);return _0(jF,X,Q)}function ky(X,...Q){if(wy(X)===EF)return X.endsWith(...Q);return _0(EF,X,Q)}function S0(X,...Q){if(Cy(X)===SF)return X.substring(...Q);return _0(SF,X,Q)}function nZ(X){if(Ty(X)===vF)return X.toLowerCase();return _0(vF,X,[])}function FK(X){if(Iy(X)===xF)return X.toUpperCase();return _0(xF,X,[])}function yy(X,...Q){if(jy(X)===kF)return X.padStart(...Q);return _0(kF,X,Q)}function H9(X,Q){if(Ey(X)===yF)return X.charCodeAt(Q);return _0(yF,X,[Q])}function by(X,Q){if(Sy(X)===bF)return X.normalize(Q);return _0(bF,X,[Q])}function gy(X,Q,Y){if(vy(X)===gF)return X.replace(Q,Y);return _0(gF,X,[Q,Y])}var hF=Number.prototype.toString;function hy(X){try{return X.toString}catch{return}}function VQ(X,...Q){if(hy(X)===hF)return X.toString(...Q);return _0(hF,X,Q)}var my=Object.prototype.hasOwnProperty,dy=Object.prototype.toString;function FP(X,Q){return _0(my,X,[Q])}function iZ(X){return _0(dy,X,[])}var py=Error.prototype.toString;function cy(X){return _0(py,X,[])}var fy=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 i4(X){return new fy(X)}var LP=Array.isArray,uy=Object.defineProperty;function PP(X,Q){return uy(X,r0,{value:()=>{let Y=[];for(let J=0;J!==Q.length;++J)S(Y,Q[J].value);return PP(Y,Q),Y}})}function RP(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)PP(Y,X);return new k(Y,J)}function NP(X,Q,Y){let J=[],$=LP(Y)?Y:[];for(let G=0;G!==X.length;++G)S(J,i4(()=>X[G].shrink(Q[G],$[G]).map((Z)=>{let K=G0(Q,(H,W)=>new k(Z9(H),$[W]));return[...e0(K,0,G),Z,...e0(K,G+1)]}).map(RP)));return Q0.nil().join(...J)}var ly=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 RP(Y)}canShrinkWithoutContext(X){if(!LP(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 NP(this.arbs,X,Q)}};function e(...X){return new ly(X)}var ry=Math.log;function MP(X){return 2+~~(ry(X+1)*0.4342944819032518)}var LK={};function oy(X){LK=X}function N8(){return LK}function ny(){LK={}}var DQ=Symbol("UndefinedContextPlaceholder");function W9(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 mF=()=>{},iy=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||$||mF,this.afterEachHook=J||G||mF}isAsync(){return!0}generate(X,Q){return W9(this.arb.generate(X,Q!==void 0?MP(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(W9)}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(t4.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}},AP=class extends I0{constructor(X){super();this.arb=X}generate(X,Q){return W9(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(W9)}};function ay(...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 qP(Q,KP),new iy(e(...G0(Q,(J)=>new AP(J))),(J)=>Y(...J))}var dF=()=>{},wP=class{constructor(X,Q){this.arb=X,this.predicate=Q;let{beforeEach:Y=dF,afterEach:J=dF,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 W9(this.arb.generate(X,Q!==void 0?MP(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(W9)}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(t4.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 sy(...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 qP(Q,KP),new wP(e(...G0(Q,(J)=>new AP(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 aZ(X){if("unsafeNext"in X){if(X.unsafeJump===void 0)return{clone:()=>aZ(X),next:()=>X.unsafeNext(),getState:()=>X.getState()};return{clone:()=>aZ(X),next:()=>X.unsafeNext(),jump:()=>X.unsafeJump(),getState:()=>X.getState()}}return X}function CP(X){if("jump"in X&&typeof X.jump==="function")return X;return{clone:()=>CP(X),next:()=>X.next(),jump:()=>QF(X,42),getState:()=>X.getState()}}function y2(X){return CP(aZ(X))}var ty=Date.now,ey=Math.min,Xb=Math.random,Qb=class{constructor(X){let Q=X||{};this.seed=Yb(Q),this.randomType=Jb(Q),this.numRuns=$b(Q),this.verbose=Gb(Q),this.maxSkipsPerRun=Q.maxSkipsPerRun!==void 0?Q.maxSkipsPerRun:100,this.timeout=wZ(Q.timeout),this.skipAllAfterTimeLimit=wZ(Q.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=wZ(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 AZ(X){return(Q)=>{return y2(X(Q))}}function Yb(X){if(X.seed===void 0)return ty()^Xb()*4294967296;let Q=X.seed|0;if(X.seed===Q)return Q;return Q^(X.seed-Q)*4294967296}function Jb(X){if(X.randomType===void 0)return PZ;if(typeof X.randomType==="string")switch(X.randomType){case"mersenne":return AZ(ez);case"congruential":case"congruential32":return AZ(sz);case"xorshift128plus":return PZ;case"xoroshiro128plus":return XF;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 AZ(X.randomType)}function $b(X){if(X.numRuns!==void 0)return X.numRuns;if(X.num_runs!==void 0)return X.num_runs;return 100}function Gb(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 wZ(X){if(X===void 0)return;return ey(X,2147483647)}function PK(X){return new Qb(X)}function Zb(X,Q,Y){let J=null;return{clear:()=>Y(J),promise:new Promise(($)=>{J=Q(()=>{$(new t4(!0))},X)})}}var pF=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 t4(this.interruptExecution);if(this.isAsync())return Promise.resolve(Y);else return Y}if(this.interruptExecution&&this.isAsync()){let Y=Zb(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()}},Kb=(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)})}},Hb=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=Kb(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())}},TP=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()}},cF=Array.from,fF=typeof Buffer<"u"?Buffer.isBuffer:void 0,Y9=JSON.stringify,uF=Number.isNaN,Wb=Object.keys,_b=Object.getOwnPropertySymbols,Vb=Object.getOwnPropertyDescriptor,lF=Object.getPrototypeOf,rF=Number.NEGATIVE_INFINITY,Db=Number.POSITIVE_INFINITY,M8=Symbol.for("fast-check/toStringMethod");function RK(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 NK(X){return X!==null&&(typeof X==="object"||typeof X==="function")&&B4 in X&&typeof X[B4]==="function"}var qb=/^Symbol\((.*)\)$/;function Bb(X){if(X.description!==void 0)return X.description;let Q=qb.exec(F1(X));return Q&&Q[1].length?Q[1]:null}function oF(X){switch(X){case 0:return 1/X===rF?"-0":"0";case rF:return"Number.NEGATIVE_INFINITY";case Db:return"Number.POSITIVE_INFINITY";default:return X===X?F1(X):"Number.NaN"}}function Ub(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 d1(X,Q,Y){let J=[...Q,X];if(typeof X==="object"){if(V4(Q,X)!==-1)return"[cyclic]"}if(NK(X)){let $=Y(X);if($.state==="fulfilled")return $.value}if(RK(X))try{return X[M8]()}catch{}switch(iZ(X)){case"[object Array]":{let $=X;if($.length>=50&&Ub($)){let Z=[];for(let K in $)if(!uF(Number(K)))S(Z,`${K}:${d1($[K],J,Y)}`);return Z.length!==0?`Object.assign(Array(${$.length}),{${w0(Z,",")}})`:`Array(${$.length})`}let G=w0(G0($,(Z)=>d1(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 uF(E2($))?"new Date(NaN)":`new Date(${Y9(Dy($))})`}case"[object Map]":return`new Map(${d1(Array.from(X),J,Y)})`;case"[object Null]":return"null";case"[object Number]":return typeof X==="number"?oF(X):`new Number(${oF(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"?`[${d1(G,J,Y)}]`:Y9(G)}:${d1(X[G],J,Y)}`;return"{"+w0([...lF(X)===null?["__proto__:null"]:[],...G0(Wb(X),$),...G0(Wy(_b(X),(G)=>{let Z=Vb(X,G);return Z&&Z.enumerable}),$)],",")+"}"}case"[object Set]":return`new Set(${d1(Array.from(X),J,Y)})`;case"[object String]":return typeof X==="string"?Y9(X):`new String(${Y9(X)})`;case"[object Symbol]":{let $=X;if(N2.keyFor($)!==void 0)return`Symbol.for(${Y9(N2.keyFor($))})`;let G=Bb($);if(G===null)return"Symbol()";return $===(G.startsWith("Symbol.")&&N2[G.substring(7)])?G:`Symbol(${Y9(G)})`}case"[object Promise]":{let $=Y(X);switch($.state){case"fulfilled":return`Promise.resolve(${d1($.value,J,Y)})`;case"rejected":return`Promise.reject(${d1($.value,J,Y)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(X instanceof Error)return`new Error(${d1(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 fF==="function"&&fF(X))return`Buffer.from(${X.buffer.detached?"/*detached ArrayBuffer*/":d1(cF(X.values()),J,Y)})`;let $=lF(X),G=$&&$.constructor&&$.constructor.name;if(typeof G==="string"){let Z=X;if(Z.buffer.detached)return`${G}.from(/*detached ArrayBuffer*/)`;return`${G}.from(${d1(cF(Z.values()),J,Y)})`}break}}try{return X.toString()}catch{return iZ(X)}}function g0(X){return d1(X,[],()=>({state:"unknown",value:void 0}))}function IP(X){let Q=N2(),Y=[],J=new q4;function $(){let H=null,W=()=>{if(H!==null)clearTimeout(H)};return{delay:new Promise((V)=>{H=setTimeout(()=>{H=null,V(Q)},0)}),cancel:W}}let G={state:"unknown",value:void 0},Z=function(W){let V=W;if(J.has(V))return J.get(V);let _=$(),D=B4 in W?Promise.resolve().then(()=>W[B4]()):W;return D.catch(()=>{}),Y.push(Promise.race([D,_.delay]).then((q)=>{if(q===Q)J.set(V,{state:"pending",value:void 0});else J.set(V,{state:"fulfilled",value:q});_.cancel()},(q)=>{J.set(V,{state:"rejected",value:q}),_.cancel()})),J.set(V,G),G};function K(){let H=d1(X,[],Z);if(Y.length===0)return H;return Promise.all(Y.splice(0)).then(K)}return K()}async function MK(X){return Promise.resolve(IP(X))}function nF(X){return X===null?new t4:X}function Ob(...X){if(X[1])return X[0].then(nF);return nF(X[0])}function zb(X,Q){return Ob(X,Q)}var iF=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 zb(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()}},aF=Date.now,CZ=setTimeout,TZ=clearTimeout;function Fb(X,Q){let Y=X;if(X.isAsync()&&Q.timeout!==void 0)Y=new Hb(Y,Q.timeout,CZ,TZ);if(Q.unbiased)Y=new TP(Y);if(Q.skipAllAfterTimeLimit!==void 0)Y=new pF(Y,aF,Q.skipAllAfterTimeLimit,!1,CZ,TZ);if(Q.interruptAfterTimeLimit!==void 0)Y=new pF(Y,aF,Q.interruptAfterTimeLimit,!0,CZ,TZ);if(Q.skipEqualValues)Y=new iF(Y,!0);if(Q.ignoreEqualValues)Y=new iF(Y,!1);return Y}var i6=function(X){return X[X.Success=0]="Success",X[X.Skipped=-1]="Skipped",X[X.Failure=1]="Failure",X}({}),Lb=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(i6.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(i6.Skipped,Q);if(this.pathToFailure===void 0)++this.numSkips}success(Q){if(this.verbosity>=z1.VeryVerbose)this.appendExecutionTree(i6.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===i6.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()}}},jP=class{constructor(X,Q,Y,J){this.sourceValues=X,this.shrink=Q,this.runExecution=new Lb(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"&&!t4.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_)}},Pb=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}},Rb=-2147483648,Nb=2147483647,Mb=Math.pow(2,27),Ab=Math.pow(2,-53),AK=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?Rb:Q,Y===void 0?Nb:Y)}nextBigInt(Q,Y){return $F(this.internalRng,Q,Y)}nextDouble(){let Q=this.next(26),Y=this.next(27);return(Q*Mb+Y)*Ab}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState==="function")return this.internalRng.getState()}};function wb(X,Q,Y){return Q.jump(),X.generate(new AK(Q),Y)}function*EP(X,Q,Y,J){for(let $=0;$!==J.length;++$)yield new k(J[$],void 0);for(let $=0,G=Y(Q);;++$)yield wb(X,G,$)}function Cb(X,Q,Y){return()=>X.generate(new AK(Q),Y)}function*SP(X,Q,Y,J){yield*G0(J,(Z)=>()=>new k(Z,void 0));let $=0,G=y2(Y(Q));for(;;)G.jump(),yield Cb(X,G,$++)}function sF(X){return X()}function vP(X,Q,Y){let J=Q,$=X.split(":").map((Z)=>+Z);if($.length===0)return J.map(sF);if(!$.every((Z)=>!Number.isNaN(Z)))throw Error(`Unable to replay, got invalid path=${X}`);let G=J.drop($[0]).map(sF);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 Tb=Object.assign;function Ib(X){if(X.length===1)return`Hint: ${X[0]}`;return X.map((Q,Y)=>`Hint (${Y+1}): ${Q}`).join(`
|
|
30
|
-
`)}function
|
|
25
|
+
${W_(X.cause,`${Q} `)}
|
|
26
|
+
${Q}}`;return J},o3=`~effect/Fiber/${uW}`,WC={_A:b,_E:b},_C={id:0},z7=()=>globalThis[K5];class $J{constructor(X,Q=!0){this[o3]=WC,this.setContext(X),this.id=++_C.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)}[o3];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 VW(this.context,X)}addObserver(X){if(this._exit)return X(this._exit),G5;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=I5(X);if(this.currentStackFrame)Y=D5(Y,tQ(j9,this.currentStackFrame));if(Q)Y=D5(Y,Q);if(this._interruptedCause=this._interruptedCause?YJ(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===M4)return;let Y=n3.interruptChildren&&n3.interruptChildren(this);if(Y!==void 0)return this.evaluate(T(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[K5];globalThis[K5]=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=T(j5,()=>G)}if(J=this.currentTracerContext?this.currentTracerContext(J,this):J[u0](this),$!==this.currentLoopCount)return M4;else if(J===M4){let G=this._yielded;if(H6 in G)return this._yielded=void 0,G;return M4}}}catch(G){if(!M(J,u0))return C8(`Fiber.runLoop: Not a valid effect: ${String(J)}`);return this.runLoop(C8(G))}finally{globalThis[K5]=Q}}getCont(X){while(!0){let Q=this._stack.pop();if(!Q)return;let Y=Q[N4]&&Q[N4](this);if(Y)return Y[X]=Y,Y;if(Q[X])return Q}}yieldWith(X){return this._yielded=X,M4}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(p3),this.currentLogLevel=this.getRef(f3),this.minimumLogLevel=this.getRef(u3),this.currentStackFrame=X.mapUnsafe.get(b9.key),this.maxOpsBeforeYield=this.getRef(yW),this.currentPreventYield=this.getRef(bW),this.runtimeMetrics=X.mapUnsafe.get(cW);let Y=X.mapUnsafe.get(c3);this.currentTracerContext=Y?Y.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}}var n3={interruptChildren:void 0},F7=(X)=>{if(!X.currentStackFrame)return;let Q=new Map;return Q.set(j9.key,X.currentStackFrame),I4(Q)},VC=(X)=>{if(X._children===void 0||X._children.size===0)return;return w5(X._children)},qC=(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))))})},GJ=(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 DC=(X)=>c((Q)=>BC(X,Q.id)),BC=B((X)=>M(X[0],o3),(X,Q,Y)=>c((J)=>{let $=F7(J);return $=$&&Y?X7($,Y):$??Y,X.interruptUnsafe(Q,$),i9(qC(X))})),w5=(X)=>c((Q)=>{let Y=F7(Q);for(let J of X)J.interruptUnsafe(Q.id,Y);return i9(GJ(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(),__=n9,V_=n9,q_=(X)=>X==null?M0(new $8):A(X),ZJ=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})}}),j5=ZJ(0),KJ=(X)=>A(F(X)),L7=A(x()),D_=(X)=>i(()=>N0(J0(X))),P6=(X)=>C8(X),P7=(X)=>i(()=>M0(J0(X))),X0=A(void 0);var B_=(X)=>i(()=>{try{return A(J0(X.try))}catch(Q){return M0(J0(()=>X.catch(Q)))}});var HJ=(X)=>WJ(function(Q,Y){J0(()=>X(Y)).then((J)=>Q(A(J)),(J)=>Q(P6(J)))},X.length!==0),U_=(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 WJ(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)},O_=(X)=>c((Q)=>X(Q.id)),z_=c(A),F_=O_(A),WJ=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 M4;return X._stack.push(UC(()=>{return Y=!0,$?.abort(),G??n1})),M4}}),UC=u1({op:"AsyncFinalizer",[N4](X){if(X.interruptible)X.interruptible=!1,X._stack.push(S7)},[J8](X,Q){return D7(X)?T(this[t](),()=>N0(X)):N0(X)}}),w1=(X)=>WJ(X,X.length>=2),_J=w1(G5),L_=(...X)=>i(()=>C5(X.length===1?X[0]():X[1].call(X[0].self))),VJ=(X,...Q)=>{let Y=Q.length===0?function(){return i(()=>C5(X.apply(this,arguments)))}:function(){let J=i(()=>C5(X.apply(this,arguments)));for(let $=0;$<Q.length;$++)J=Q[$](J,...arguments);return J};return qJ(X.length,Y)},qJ=(X,Q)=>Object.defineProperty(Q,"length",{value:X,configurable:!0}),lW=l3(2),P_=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)=>rW(Q,G,$,Z,X,Y);return rW(Q,arguments[0],$,Array.prototype.slice.call(arguments,1),X,Y)},rW=(X,Q,Y,J,$,G)=>{let Z=typeof Q==="function"?Q:J.pop().bind(Q.self);return qJ(Z.length,function(...K){let H=i(()=>{let _=Z.apply(this,arguments);return p(_)?_:C5(_)});for(let _=0;_<J.length;_++)H=J[_](H,...K);if(!p(H))return H;let W=globalThis.Error.stackTraceLimit;globalThis.Error.stackTraceLimit=2;let V=new globalThis.Error;return globalThis.Error.stackTraceLimit=W,e8($?p9(X,G,(_)=>t3(H,_)):H,b9,(_)=>({name:X,stack:lW(()=>V.stack),parent:{name:`${X} (definition)`,stack:lW(()=>Y.stack),parent:_}}))})},R_=(X,...Q)=>qJ(X.length,Q.length===0?function(){return oW(()=>X.apply(this,arguments))}:function(){let Y=oW(()=>X.apply(this,arguments));for(let J of Q)Y=J(Y);return Y}),oW=(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,T(G,(H)=>C5(Q,H));else return i(()=>C5(X()))})}}}catch(Q){return P6(Q)}},C5=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(!H1($))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 T(X,(J)=>Y)}),R7=(X)=>L0(X,F),N_=(X)=>N6(X,{onFailure:A,onSuccess:M0}),t8=B(2,(X,Q)=>T(X,(Y)=>p(Q)?Q:J0(()=>Q(Y)))),R6=B(2,(X,Q)=>T(X,(Y)=>v1(p(Q)?Q:J0(()=>Q(Y)),Y))),i9=(X)=>T(X,(Q)=>n1),M_=(X)=>a1(X,M0),DJ=(X,Q)=>c((Y)=>w1((J)=>{let $=Z1(X),G=$.length,Z=0,K=!1,H=new Set,W=[],V=(_,q,D)=>{if(Z++,_._tag==="Failure"){if(W.push(..._.cause.reasons),Z>=G)J(N0(l8(W)));return}let U=!K;if(K=!0,J(H.size===0?_:T(M6(w5(H)),()=>_)),U&&Q?.onWinner)Q.onWinner({fiber:q,index:D,parentFiber:Y})};for(let _=0;_<G;_++){let q=A6(Y,$[_],!0,!0,!1);if(H.add(q),q.addObserver((D)=>{H.delete(q),V(D,q,_)}),K)break}return w5(H)})),BJ=(X,Q)=>c((Y)=>w1((J)=>{let $=!1,G=new Set,Z=(H)=>{$=!0,J(G.size===0?H:T(M6(w5(G)),()=>H))},K=0;for(let H of X){if($)break;let W=K++,V=A6(Y,H,!0,!0,!1);G.add(V),V.addObserver((_)=>{G.delete(V);let q=!$;if(Z(_),q&&Q?.onWinner)Q.onWinner({fiber:V,index:W,parentFiber:Y})})}return w5(G)})),A_=B((X)=>p(X[1]),(X,Q,Y)=>DJ([X,Q],Y)),N7=B((X)=>p(X[1]),(X,Q,Y)=>BJ([X,Q],Y)),T=B(2,(X,Q)=>{let Y=Object.create(OC);return Y[t]=X,Y[R1]=Q.length!==1?(J)=>Q(J):Q,Y}),OC=B5({op:"OnSuccess",[u0](X){return X._stack.push(this),this[t]}}),w_=B(2,(X,Q)=>{if(H1(X))return X._tag==="Success"?Q.onSuccess(X.value):Q.onFailure(X.cause);return j8(X,Q)}),H1=(X)=>(H6 in X),C_=B(2,(X,Q)=>{if(H1(X))return X._tag==="Success"?Q(X.value):X;return T(X,Q)}),T_=(X)=>T(X,b),L0=B(2,(X,Q)=>T(X,(Y)=>A(J0(()=>Q(Y))))),I_=B(2,(X,Q)=>H1(X)?zJ(X,Q):L0(X,Q)),j_=B(2,(X,Q)=>H1(X)?FJ(X,Q):IJ(X,Q)),E_=B(2,(X,Q)=>H1(X)?LJ(X,Q):jJ(X,Q)),S_=B(2,(X,Q)=>{if(H1(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)}),v_=(X)=>N1(I5(X)),E5=(X)=>X._tag==="Success",x_=(X)=>X._tag==="Success"?l(X):f(X),k_=(X)=>X._tag==="Success"?l(X.value):f(X),UJ=(X)=>X._tag==="Failure",y_=(X)=>X._tag==="Failure"?l(X):f(X),a9=(X)=>X._tag==="Failure"?l(X.cause):f(X),OJ=M5(a9,i1),b_=M5(a9,o9),g_=(X)=>X._tag==="Failure"&&D7(X.cause),h_=(X)=>X._tag==="Failure"&&q7(X.cause),m_=(X)=>X._tag==="Failure"&&XJ(X.cause),n1=j0(void 0),zJ=B(2,(X,Q)=>X._tag==="Success"?j0(Q(X.value)):X),FJ=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))}),LJ=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))}),zC=B(2,(X,Q)=>E5(X)?j0(Q):X);var d_=B(2,(X,Q)=>E5(X)?Q.onSuccess(X.value):Q.onFailure(X.cause)),p_=zC(void 0),PJ=(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))},c_=(X)=>E5(X)?F(X.value):x(),f_=(X)=>UJ(X)?F(X.cause):x(),u_=(X)=>{let Q=OJ(X);return u(Q)?x():F(Q.success)},l_=n9,r_=(X)=>c((Q)=>A(qW(Q.context,X))),FC=(X)=>c((Q)=>Q.context.mapUnsafe.has(X.key)?A(U6(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($),v5(X,()=>{Y.setContext(J);return})})),e8=B(3,(X,Q,Y)=>s9(X,(J)=>{let $=U6(J,Q),G=Y($);if($===G)return J;return K8(J,Q,G)})),RJ=()=>LC,LC=c((X)=>A(X.context)),x4=(X)=>c((Q)=>X(Q.context)),X4=B(2,(X,Q)=>{if(H1(X))return X;return s9(X,X7(Q))}),U1=function(){if(arguments.length===1)return B(2,(X,Q)=>nW(X,arguments[0],Q));return B(3,(X,Q,Y)=>nW(X,Q,Y)).apply(this,arguments)},nW=(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)=>T(Y,(J)=>U1(X,Q,J))),o_=U1(K7),NJ=B((X)=>p(X[1]),(X,Q,Y)=>MJ(X,Q,(J,$)=>[J,$],Y)),MJ=B((X)=>p(X[1]),(X,Q,Y,J)=>J?.concurrent?L0(v7([X,Q],{concurrency:2}),([$,G])=>J0(()=>Y($,G))):T(X,($)=>L0(Q,(G)=>J0(()=>Y($,G))))),n_=B((X)=>p(X[0]),(X,Q,Y)=>lJ(X,Q,Y?(J)=>M0(Y(J)):()=>M0(new $8))),i_=B(2,(X,Q)=>T(Q,(Y)=>Y?R7(X):L7)),AJ=B(2,(X,Q)=>Array.from({length:Q},()=>X)),a_=B((X)=>p(X[0]),(X,Q,Y)=>v7(AJ(X,Q),Y)),A7=B((X)=>p(X[0]),(X,Q)=>y4({while:P4,body:i0(Q?.disableYield?X:T(X,(Y)=>j5)),step:G5})),a1=B(2,(X,Q)=>{let Y=Object.create(PC);return Y[t]=X,Y[J8]=Q.length!==1?(J)=>Q(J):Q,Y}),PC=B5({op:"OnFailure",[u0](X){return X._stack.push(this),this[t]}}),wJ=B(3,(X,Q,Y)=>a1(X,(J)=>{if(!Q(J))return N0(J);return J0(()=>Y(J))})),S5=B(3,(X,Q,Y)=>a1(X,(J)=>{let $=Q(J);return u($)?N0($.failure):J0(()=>Y($.success,J))})),x1=B(2,(X,Q)=>S5(X,i1,(Y)=>Q(Y))),s_=(X)=>N6(X,{onFailure:(Q)=>cQ(Q)?L7:M0(Q),onSuccess:KJ}),t_=B(2,(X,Q)=>S5(X,o9,Q)),e_=B(2,(X,Q)=>a1(X,(Y)=>t8(J0(()=>Q(Y)),N0(Y)))),XV=B(3,(X,Q,Y)=>wJ(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))})),CJ=B(2,(X,Q)=>w7(X,i1,(Y)=>Q(Y))),QV=B(3,(X,Q,Y)=>{let J=Array.isArray(Q)?($)=>M($,"_tag")&&Q.includes($._tag):G6(Q);return CJ(X,($)=>J($)?Y($):X0)}),YV=B(2,(X,Q)=>w7(X,o9,(Y)=>Q(Y))),t9=B((X)=>p(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)=>p(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))})),TJ=B((X)=>p(X[0]),(X,Q,Y,J)=>{let $=Array.isArray(Q)?(G)=>M(G,"_tag")&&Q.includes(G._tag):G6(Q);return t9(X,$,Y,J)}),JV=B((X)=>p(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)}),$V=B((X)=>p(X[0]),(X,Q,Y,J,$)=>t9(X,(G)=>G6(G,Q)&&M(G,"reason"),(G)=>{let Z=G.reason;if(G6(Z,Y))return J(Z,G);return $?J0(()=>$(Z,G)):M0(G)})),GV=B((X)=>p(X[0]),(X,Q,Y,J)=>{let $;return t9(X,(G)=>G6(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)})}),ZV=B(2,(X,Q)=>C7(X,(Y)=>{if(G6(Y,Q)&&M(Y,"reason"))return l(Y.reason);return f(Y)},M0));var IJ=B(2,(X,Q)=>x1(X,(Y)=>P7(()=>Q(Y)))),jJ=B(2,(X,Q)=>N6(X,{onFailure:(Y)=>P7(()=>Q.onFailure(Y)),onSuccess:(Y)=>$0(()=>Q.onSuccess(Y))})),EJ=(X)=>x1(X,P6),KV=B(2,(X,Q)=>x1(X,(Y)=>$0(Q))),HV=(X)=>i(()=>{let Q=X[Symbol.iterator](),Y=Q.next();if(Y.done)return P6(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)}),SJ=(X)=>x1(X,(Q)=>T(j5,()=>SJ(X))),WV=B((X)=>p(X[0]),(X,Q)=>{if(!Q?.log)return N6(X,{onFailure:(J)=>X0,onSuccess:(J)=>X0});let Y=_8(Q.log===!0?void 0:Q.log);return j8(X,{onFailure(J){let $=QJ(J);return u($)?N0($.failure):Q.message===void 0?Y(J):Y(Q.message,J)},onSuccess:(J)=>X0})}),_V=B((X)=>p(X[0]),(X,Q)=>{if(!Q?.log)return j8(X,{onFailure:(J)=>X0,onSuccess:(J)=>X0});let Y=_8(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})}),VV=(X)=>T7(X,{onFailure:x,onSuccess:F}),v4=(X)=>e9(X,{onFailure:f,onSuccess:l}),j8=B(2,(X,Q)=>{let Y=Object.create(RC);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}),RC=B5({op:"OnSuccessAndFailure",[u0](X){return X._stack.push(this),this[t]}}),vJ=B(2,(X,Q)=>j8(X,{onFailure:(Y)=>$0(()=>Q.onFailure(Y)),onSuccess:(Y)=>$0(()=>Q.onSuccess(Y))})),N6=B(2,(X,Q)=>j8(X,{onFailure:(Y)=>{let J=Y.reasons.find(A4);return J?J0(()=>Q.onFailure(J.error)):N0(Y)},onSuccess:Q.onSuccess})),T7=B(2,(X,Q)=>N6(X,{onFailure:(Y)=>$0(()=>Q.onFailure(Y)),onSuccess:(Y)=>$0(()=>Q.onSuccess(Y))})),e9=B(2,(X,Q)=>{if(H1(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)}),qV=B(2,(X,Q)=>{if(H1(X)){if(X._tag==="Success")return j0(Q.onSuccess(X.value));return j0(Q.onFailure(X.cause))}return vJ(X,Q)}),XX=(X)=>H1(X)?j0(X):NC(X),NC=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))}}),DV=e9({onFailure:()=>!0,onSuccess:()=>!1}),BV=e9({onFailure:()=>!1,onSuccess:()=>!0}),UV=B(2,(X,Q)=>t8(C6(Q),X)),xJ=B(2,(X,Q)=>N7(X,T(C6(Q.duration),Q.orElse))),OV=B(2,(X,Q)=>xJ(X,{duration:Q,orElse:()=>M0(new y7)})),zV=B(2,(X,Q)=>N7(R7(X),v1(C6(Q),x()))),FV=(X)=>w6((Q)=>{let Y=Q.currentTimeNanosUnsafe();return L0(X,(J)=>[a8(Q.currentTimeNanosUnsafe()-Y),J])}),i3="~effect/Scope",a3="~effect/Scope/Closeable",QX=l1("effect/Scope"),kJ=(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 MC(X,J,Q)},MC=VJ(function*(X,Q,Y){let J=[],$=[],G=Array.from(Q.values()),Z=z7();for(let K=G.length-1;K>=0;K--){let H=G[K];if(X.strategy==="sequential")J.push(yield*XX(H(Y)));else $.push(A6(Z,H(Y),!0,!0,"inherit"))}if($.length>0)J=yield*GJ($);return yield*PJ(J)});var LV=(X,Q)=>{let Y=YX(Q);if(X.state._tag==="Closed")return Y.state=X.state,Y;let J={};return V7(X,J,($)=>kJ(Y,$)),V7(Y,J,($)=>$0(()=>PV(X,J))),Y},k4=(X,Q)=>{return i(()=>{if(X.state._tag==="Closed")return Q(X.state.exit);return V7(X,{},Q),X0})};var V7=(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)},PV=(X,Q)=>{if(X.state._tag==="Open")X.state.finalizers.delete(Q)},YX=(X="sequential")=>({[a3]:a3,[i3]:i3,strategy:X,state:AC}),AC={_tag:"Empty"};var JX=QX.asEffect();var yJ=(X)=>c((Q)=>{let Y=Q.context,J=YX();return Q.setContext(K8(Q.context,QX,J)),v5(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)=>x4((J)=>$X(($)=>T(JX,(G)=>R6(Y?.interruptible?$(X):X,(Z)=>k4(G,(K)=>X4(Q(Z,K),J)))))),bJ=(X)=>T(JX,(Q)=>x4((Y)=>k4(Q,(J)=>X4(X(J),Y)))),v5=u1({op:"OnExit",single:!1,[u0](X){return X._stack.push(this),this[t][0]},[N4](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?T(J,($)=>Y):Y},[J8](X,Q,Y){Y??=N1(X);let J=this[t][1](Y);return J?T(J,($)=>Y):Y}}),O1=B(2,v5),RV=B(2,(X,Q)=>O1(X,(Y)=>Q)),gJ=B(3,(X,Q,Y)=>O1(X,(J)=>{if(!Q(J))return X0;return Y(J)})),hJ=B(3,(X,Q,Y)=>O1(X,(J)=>{let $=Q(J);return u($)?X0:Y($.success,J)})),mJ=B(2,(X,Q)=>hJ(X,a9,Q)),NV=B(3,(X,Q,Y)=>gJ(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)})),MV=B(2,(X,Q)=>dJ(B7,Q)(X)),AV=(X,Q,Y)=>$X((J)=>T(X,($)=>v5(J(Q($)),(G)=>Y($,G),!0))),wV=(X)=>E7(X,(Q)=>M(Q,Symbol.asyncDispose)?HJ(()=>Q[Symbol.asyncDispose]()):$0(()=>Q[Symbol.dispose]())),pJ=B(2,(X,Q)=>$0(()=>{let Y=S4(S1(Q)),J=Number.isFinite(Y),$=TC(!1),G=0,Z=!1,K,H=T($.await,()=>K);return[c((W)=>{let V=W.getRef(E8),_=J?V.currentTimeMillisUnsafe():0;if(Z||_<G)return K??H;return Z=!0,$.closeUnsafe(),K=void 0,O1(X,(q)=>$0(()=>{Z=!1,G=V.currentTimeMillisUnsafe()+Y,K=q,$.openUnsafe()}))}),$0(()=>{G=0,$.closeUnsafe(),K=void 0})]})),cJ=B(2,(X,Q)=>L0(pJ(X,Q),(Y)=>Y[0])),CV=(X)=>cJ(X,i8),TV=c((X)=>N0(I5(X.id))),M6=(X)=>c((Q)=>{if(!Q.interruptible)return X;return Q.interruptible=!1,Q._stack.push(S7),X}),IV=u1({op:"SetInterruptible",[N4](X){if(X.interruptible=this[t],X._interruptedCause&&X.interruptible)return()=>N0(X._interruptedCause)}}),S7=IV(!0),jV=IV(!1),fJ=(X)=>c((Q)=>{if(Q.interruptible)return X;if(Q.interruptible=!0,Q._stack.push(jV),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(fJ)}),EV=(X)=>c((Q)=>{if(Q.interruptible)return X(b);return Q.interruptible=!0,Q._stack.push(jV),X(M6)}),SV=L0(E7($0(()=>new AbortController),(X)=>$0(()=>X.abort())),(X)=>X.signal),v7=(X,Q)=>{if(p8(X))return Q?.mode==="result"?o1(X,v4,Q):o1(X,b,Q);else if(Q?.discard)return Q.mode==="result"?o1(Object.values(X),v4,Q):o1(Object.values(X),b,Q);return i(()=>{let Y={};return v1(o1(Object.entries(X),([J,$])=>L0(Q?.mode==="result"?v4($):$,(G)=>{Y[J]=G}),{discard:!0,concurrency:Q?.concurrency}),Y)})},uJ=B((X)=>p8(X[0])&&!p(X[0]),(X,Q,Y)=>L0(o1(X,(J,$)=>v4(Q(J,$)),Y),(J)=>b3(J,b))),vV=B((X)=>p8(X[0])&&!p(X[0]),(X,Q,Y)=>T(uJ(X,Q,{concurrency:Y?.concurrency}),([J,$])=>{if(W8(J))return M0(J);return Y?.discard?X0:A($)})),xV=B((X)=>p8(X[0])&&!p(X[0]),(X,Q)=>i(()=>{let Y=X[Symbol.iterator](),J=Y.next();if(!J.done)return kV(Y,0,Q,J.value);return A(x())})),kV=(X,Q,Y,J)=>T(Y(J,Q),($)=>{if($)return A(F(J));let G=X.next();if(!G.done)return kV(X,Q+1,Y,G.value);return A(x())}),yV=B((X)=>p8(X[0])&&!p(X[0]),(X,Q)=>i(()=>{let Y=X[Symbol.iterator](),J=Y.next();if(!J.done)return bV(Y,0,Q,J.value);return A(x())})),bV=(X,Q,Y,J)=>T(Y(J,Q),($)=>{if(A1($))return A(F($.success));let G=X.next();if(!G.done)return bV(X,Q+1,Y,G.value);return A(x())}),y4=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 wC(X,Q,Y);let Z=Z1(X),K=Z.length;if(K===0)return Y?.discard?X0:A([]);let H=Y?.discard?void 0:Array(K),W=CC({f:Q,out:H},Z,{concurrency:G});return W?v1(W,H):A(H)})),wC=(X,Q,Y)=>i(()=>{let J=Y?.discard?void 0:[],$=X[Symbol.iterator](),G=$.next(),Z=0;return v1(y4({while:()=>!G.done,body:()=>Q(G.value,Z++),step:(K)=>{if(J)J.push(K);G=$.next()}}),J)}),gV=(X)=>{let{onItem:Q,step:Y}=X;return(J,$,G)=>{let Z=G?.start??0,K=G?.end??$.length,H=G?.concurrency??1,W=!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(H1(y)){if(U=Y(J,P,y,Z),U)break}else if(H===1)return T(XX(y),(Y0)=>{return U=Y(J,P,Y0,Z),Z++,U??L()??X0});else if(!V)return w1((Y0)=>{V=z7(),R=y,q=Y0;let X8=L();if(X8)return Y0(X8);return i(()=>{return U=n1,D=!0,_?w5(_):X0})});else{R=void 0;let Y0=A6(V,y,!0,!0,"inherit");if(Y0._exit){if(U=Y(J,P,Y0._exit,Z),U)break;continue}if(_)_.add(Y0);else _=new Set([Y0]);let X8=Z;if(Y0.addObserver(($5)=>{if(_.delete(Y0),U){if(!D&&$5._tag==="Failure")for(let V1 of $5.cause.reasons)if(V1._tag==="Interrupt")continue;else if(U._tag==="Failure")U.cause.reasons.push(V1);else U=N1(l8([V1]))}else{let V1=Y(J,P,$5,X8);if(V1)U=V1._tag==="Failure"?N1(l8(V1.cause.reasons.slice())):V1,L()}if(N){let V1=L();if(V1)q(V1)}else if(W&&_.size===0)q(U??X0)}),_.size<H)continue;N=!0,Z++;return}}if(W=!0,U){if(_&&_.size>0){let P=F7(V);_.forEach((y)=>y.interruptUnsafe(V.id,P));return}if(q||U._tag==="Failure")return U}else if(q){if(!_)return n1;else if(_.size===0)q(X0)}};return L()}},GX=()=>gV,CC=gV({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}}),lJ=B(3,(X,Q,Y)=>T(X,(J)=>Q(J)?A(J):Y(J))),rJ=B(3,(X,Q,Y)=>T(X,(J)=>{let $=Q(J);return u($)?Y($.failure):A($.success)})),hV=B((X)=>p(X[0]),(X,Q,Y)=>rJ(X,Q,Y?(J)=>M0(Y(J)):()=>M0(new $8))),mV=B((X)=>p8(X[0])&&!p(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)})),dV=B((X)=>p8(X[0])&&!p(X[0]),(X,Q)=>i(()=>{let Y=[];for(let J of X){let $=Q(J);if(A1($))Y.push($.success)}return A(Y)})),pV=B((X)=>p8(X[0])&&!p(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)})),cV=A({}),fV=lH(L0),uV=rH(L0,T),lV=uH(L0);var rV=B((X)=>p(X[0]),(X,Q)=>c((Y)=>{return lC(),A(A6(Y,X,Q?.startImmediately,!1,Q?.uninterruptible??!1))})),A6=(X,Q,Y=!1,J=!1,$=!1)=>{let G=$==="inherit"?X.interruptible:!$,Z=new $J(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},oV=B((X)=>p(X[0]),(X,Q)=>c((Y)=>A(A6(Y,X,Q?.startImmediately,!0,Q?.uninterruptible)))),nV=(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)$=zW($,(G)=>!Y.includes(G));return i9(GJ($))})}),oJ=B((X)=>p(X[0]),(X,Q,Y)=>c((J)=>{let $=A6(J,X,Y?.startImmediately,!0,Y?.uninterruptible);if(!$._exit)if(Q.state._tag!=="Closed"){let G={};V7(Q,G,()=>O_((K)=>K===$.id?X0:DC($))),$.addObserver(()=>PV(Q,G))}else $.interruptUnsafe(J.id,F7(J));return A($)})),iV=B((X)=>p(X[0]),(X,Q)=>T(JX,(Y)=>oJ(X,Y,Q))),Q4=(X)=>(Q,Y)=>{let J=new $J(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 aV=Q4(Z8()),nJ=(X)=>{let Q=Q4(X);return(Y,J)=>{let $=Q(Y,J);if(J?.onExit)$.addObserver(J.onExit);return(G)=>{return $.interruptUnsafe(G)}}},sV=nJ(Z8()),x7=(X)=>{let Q=Q4(X);return(Y,J)=>{let $=Q(Y,J);return new Promise((G)=>{$.addObserver((Z)=>G(Z))})}},tV=x7(Z8()),iJ=(X)=>{let Q=x7(X);return(Y,J)=>Q(Y,J).then(($)=>{if($._tag==="Failure")throw U7($.cause);return $.value})},eV=iJ(Z8()),k7=(X)=>{let Q=Q4(X);return(Y)=>{if(H1(Y))return Y;let J=new A5("sync"),$=Q(Y,{scheduler:J});return $.currentDispatcher?.flush(),$._exit??C8(new b7($))}},Xq=k7(Z8()),aJ=(X)=>{let Q=k7(X);return(Y)=>{let J=Q(Y);if(J._tag==="Failure")throw U7(J.cause);return J.value}},Qq=aJ(Z8()),iW=A(!0),aW=A(!1);class Yq{waiters=[];scheduled=!1;isOpen;constructor(X){this.isOpen=X}scheduleUnsafe(X){if(this.scheduled||this.waiters.length===0)return iW;return this.scheduled=!0,X.currentDispatcher.scheduleTask(this.flushWaiters,0),iW}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 aW;return this.isOpen=!0,this.scheduleUnsafe(X)});release=c((X)=>this.isOpen?aW: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)=>T(this.await,()=>X)}var TC=(X)=>new Yq(X??!1);var Jq=c((X)=>A(X.getRef(Z7))),$q=B(2,(X,Q)=>U1(X,Z7,Q)),Gq=U1(H7),Zq=U1(g9),s3=BigInt(0),IC={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:s3,endTime:s3,exit:n1},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},jC=(X)=>Object.assign(Object.create(IC),X),Kq=(X)=>{if(!X)return x();return E1(X.annotations,G7)?X._tag==="Span"?Kq(D6(X.parent)):x():F(X)},sJ=(X,Q,Y)=>{let J=!X.getRef(H7)||Y?.annotations&&E1(Y.annotations,G7),$=Y?.parent!==void 0?F(Y.parent):Y?.root?x():Kq(X.currentSpan),G;if(J)G=jC({name:Q,parent:$,annotations:K8(Y?.annotations??Z8(),G7,!0)});else{let Z=X.getRef(Z7),K=X.getRef(E8),H=X.getRef(g9),W=X.getRef(h9),V=X.getRef(m9),_=Y?.level??X.getRef(mW),q=Y?.links!==void 0?[...V,...Y.links]:V.slice();G=Z.span({name:Q,parent:$,annotations:Y?.annotations??Z8(),links:q,startTime:H?K.currentTimeNanosUnsafe():BigInt(0),kind:Y?.kind??"internal",root:Y?.root??T0($),sampled:Y?.sampled??(B1($)&&$.value.sampled===!1?!1:!wq(X.getRef(dW),_))});for(let[D,U]of Object.entries(W))G.attribute(D,U);if(Y?.attributes!==void 0)for(let[D,U]of Object.entries(Y.attributes))G.attribute(D,U)}return G},Hq=(X,Q)=>c((Y)=>A(sJ(Y,X,Q))),d9=(X,Q)=>M6(c((Y)=>{let J=U6(Y.context,QX),$=sJ(Y,X,Q??{}),G=Y.getRef(E8),Z=Y.getRef(g9);return v1(k4(J,(K)=>SC($,K,G,Z)),$)})),Wq=function(){let X=typeof arguments[0]!=="string",Q=X?arguments[1]:arguments[0],Y=_7(X?arguments[2]:arguments[1]);if(X){let J=arguments[0];return T(d9(Q,Y),($)=>T5(J,$,Y))}return(J)=>T(d9(Q,Y),($)=>T5(J,$,Y))},EC=(X,Q)=>{return Q=typeof Q==="function"?Q:A8,e8(b9,(Y)=>({name:X,stack:Q,parent:Y}))},_q=h9.asEffect(),Vq=m9.asEffect(),qq=B((X)=>p(X[0]),(X,Q,Y={})=>{let $=(Array.isArray(Q)?Q:[Q]).map((G)=>({span:G,attributes:Y}));return e8(X,m9,(G)=>[...G,...$])}),SC=(X,Q,Y,J)=>$0(()=>{if(X.status._tag==="Ended")return;X.end(J?Y.currentTimeNanosUnsafe():s3,Q)}),p9=(X,...Q)=>{let Y=Q.length===1?void 0:Q[0],J=Q[Q.length-1];return c(($)=>{let G=sJ($,X,Y),Z=$.getRef(E8);return O1(J0(()=>J(G)),(K)=>$0(()=>{if(G.status._tag==="Ended")return;G.end(Z.currentTimeNanosUnsafe(),K)}))})},t3=U1($7),T5=function(){let X=p(arguments[0]),Q=X?arguments[1]:arguments[0],Y=X?arguments[2]:arguments[1],J=b;if(Q._tag==="Span")Y=_7(Y),J=EC(Q.name,Y?.captureStackTrace);if(X)return t3(J(arguments[0]),Q);return($)=>t3(J($),Q)},Dq=function(){let X=typeof arguments[0]!=="string",Q=X?arguments[1]:arguments[0],Y=_7(arguments[2]);if(X){let G=arguments[0];return p9(Q,arguments[2],(Z)=>T5(G,Z,Y))}let J=typeof arguments[1]==="function"?arguments[1]:void 0,$=J?void 0:arguments[1];return(G,...Z)=>p9(Q,J?J(...Z):$,(K)=>T5(G,K,Y))},Bq=B((X)=>p(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})),Uq=(...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}),Oq=c((X)=>{let Q=X.currentSpanLocal;return Q?A(Q):M0(new $8)}),zq=FC($7),E8=V0("effect/Clock",{defaultValue:()=>new Fq}),vC=2147483647;class Fq{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=$0(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return xC()}currentTimeNanos=$0(()=>this.currentTimeNanosUnsafe());sleep(X){let Q=S4(X);if(Q<=0)return j5;return w1((Y)=>{if(Q>vC)return;let J=setTimeout(()=>Y(X0),Q);return $0(()=>clearTimeout(J))})}}var sW=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))}(),xC=function(){let X=typeof process==="object"&&"hrtime"in process&&typeof process.hrtime.bigint==="function"?process.hrtime:void 0;if(!X)return sW;let Q=sW()-X.bigint();return()=>Q+X.bigint()}(),w6=(X)=>c((Q)=>X(Q.getRef(E8))),C6=(X)=>w6((Q)=>Q.sleep(S1(X))),Lq=w6((X)=>X.currentTimeMillis);var c9="~effect/Cause/TimeoutError",Pq=(X)=>M(X,c9);class y7 extends r8("TimeoutError"){[c9]=c9;constructor(X){super({message:X})}}var f9="~effect/Cause/IllegalArgumentError",Rq=(X)=>M(X,f9);class tJ extends r8("IllegalArgumentError"){[f9]=f9;constructor(X){super({message:X})}}var u9="~effect/Cause/ExceededCapacityError",Nq=(X)=>M(X,u9);class eJ extends r8("ExceededCapacityError"){[u9]=u9;constructor(X){super({message:X})}}var l9="~effect/Cause/AsyncFiberError",Mq=(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",Aq=(X)=>M(X,r9);class g7 extends r8("UnknownError"){[r9]=r9;constructor(X,Q){super({message:Q,cause:X})}}var kC=V0("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),yC=(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}},bC=C3(D1,yC),wq=O5(bC),X$=V0("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([fC,uC])}),gC=V0("effect/Logger/LogToStderr",{defaultValue:IQ}),Cq=function(){let X=typeof arguments[0]==="string"?[[arguments[0],arguments[1]]]:Object.entries(arguments[0]);return M6(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)),k4(U6(Q.context,QX),($)=>{let G=Q.getRef(s8),Z={...G};for(let K=0;K<X.length;K++){let[H,W]=X[K];if(G[H]!==W)continue;if(H in Y)Z[H]=Y[H];else delete Z[H]}return Q.setContext(K8(Q.context,s8,Z)),X0})}))},hC="~effect/Logger",mC={[hC]:{_Message:b,_Output:b},pipe(){return a(this,arguments)}},Tq=(X)=>{let Q=Object.create(mC);return Q.log=X,Q},dC=(X)=>X.replace(/[\s="]/g,"_"),pC=(X,Q)=>{return`${dC(X[0])}=${Q-X[1]}ms`};var _8=(X)=>(...Q)=>{let Y=void 0;for(let J=0,$=Q.length;J<$;J++){let G=Q[J];if(V5(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(wq(J.minimumLogLevel,$))return X0;let G=J.getRef(E8),Z=J.getRef(X$);if(Z.size>0){let K=new Date(G.currentTimeMillisUnsafe());for(let H of Z)H.log({cause:Y,fiber:J,date:K,logLevel:$,message:Q})}return X0})};var L6={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},ci={None:[],All:[],Trace:[L6.gray],Debug:[L6.blue],Info:[L6.green],Warn:[L6.yellow],Error:[L6.red],Fatal:[L6.bgBrightRed,L6.black]};var cC=(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")}`,Iq=typeof process==="object"&&process!==null&&typeof process.stdout==="object"&&process.stdout!==null,fi=Iq&&process.stdout.isTTY===!0,ui=Iq||"Deno"in globalThis;var fC=Tq(({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(W7),H="";for(let q of K)H+=` ${pC(q,Z)}`;let W=Y.getRef(s8);if(Object.keys(W).length>0)G.push(W);let V=Y.getRef(kC);(Y.getRef(gC)?V.error:V.log)(`[${cC(Q)}] ${J.toUpperCase()} (#${Y.id})${H}:`,...G)}),uC=Tq(({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[H,W]of Object.entries(G))K[H]=W;if(K["effect.fiberId"]=Q.id,K["effect.logLevel"]=Y.toUpperCase(),X.reasons.length>0)K["effect.cause"]=O7(X);Z.event(vH(Array.isArray(J)&&J.length===1?J[0]:J),$.currentTimeNanosUnsafe(),K)});function lC(){n3.interruptChildren??=VC}var jq=A(void 0);var Eq=B((X)=>p(X[0]),(X,Q)=>mJ(X,(Y)=>c((J)=>{return rC(J,Y,Q?.defectsOnly),X0}))),rC=(X,Q,Y)=>{let J=X.getRef(fW);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 oC=W5,nC=_5,Q$=V5,Y$=gH,iC=A4,aC=V6,sC=q6,ZX=l8,tC=mQ,eC=L3,XT=P3,QT=I5,KX=(X)=>new q5(X),HX=(X)=>new dQ(X),WX=tW,h7=J_,YT=Z_,JT=YJ,T6=U7,$T=XJ,GT=QJ,S8=i1,ZT=eW,KT=q7,HT=X_,WT=o9,_T=D7,VT=Q_,qT=Y_,DT=B7,BT=JJ,J$=O7,UT=cQ,OT=C9,zT=$8,m7=E9,FT=W6,LT=R3,d7=pH,PT=c9,RT=Pq,NT=y7,MT=f9,AT=Rq,_X=tJ,wT=Nq,CT=u9,TT=eJ,IT=l9,jT=Mq,ET=b7,ST=r9,vT=Aq,xT=g7,kT=D5,yT=$_,bT=G_;class Sq extends l1()("effect/Cause/StackTrace"){}class vq extends l1()("effect/Cause/InterruptorStackTrace"){}var U0={};J6(U0,{zipWith:()=>bj,zip:()=>yj,yieldNowWith:()=>Nj,yieldNow:()=>Rj,withTracerTiming:()=>AS,withTracerEnabled:()=>MS,withTracer:()=>NS,withSpanScoped:()=>bS,withSpan:()=>yS,withParentSpan:()=>gS,withLogger:()=>_v,withLogSpan:()=>Dv,withFiber:()=>lD,withExecutionPlan:()=>HE,withErrorReporting:()=>WE,withConcurrency:()=>rE,whileLoop:()=>pD,when:()=>jE,void:()=>g4,validate:()=>Zj,useSpan:()=>kS,updateService:()=>uE,updateContext:()=>fE,unwrapReason:()=>cj,uninterruptibleMask:()=>sD,uninterruptible:()=>qS,undefined:()=>Vj,txRetry:()=>Mv,tx:()=>Lv,tryPromise:()=>k$,try:()=>h4,trackSuccesses:()=>Uv,trackErrors:()=>Ov,trackDuration:()=>Fv,trackDefects:()=>zv,track:()=>Bv,tracer:()=>RS,timeoutOrElse:()=>BE,timeoutOption:()=>DE,timeout:()=>qE,timed:()=>zE,tapErrorTag:()=>ej,tapError:()=>oD,tapDefect:()=>nD,tapCauseIf:()=>XE,tapCauseFilter:()=>QE,tapCause:()=>t7,tap:()=>rD,sync:()=>fD,suspend:()=>cD,succeedSome:()=>s7,succeedNone:()=>x8,succeed:()=>h,spanLinks:()=>ES,spanAnnotations:()=>jS,sleep:()=>OE,serviceOption:()=>cE,service:()=>pE,scopedWith:()=>iE,scoped:()=>nE,scope:()=>oE,scheduleFrom:()=>tD,schedule:()=>PS,satisfiesSuccessType:()=>wv,satisfiesServicesType:()=>Tv,satisfiesErrorType:()=>Cv,sandbox:()=>GE,runSyncWith:()=>eS,runSyncExitWith:()=>Xv,runSyncExit:()=>e7,runSync:()=>wX,runPromiseWith:()=>aS,runPromiseExitWith:()=>tS,runPromiseExit:()=>sS,runPromise:()=>m$,runForkWith:()=>oS,runFork:()=>h5,runCallbackWith:()=>nS,runCallback:()=>iS,retryOrElse:()=>$E,retry:()=>JE,result:()=>jj,requestUnsafe:()=>mS,request:()=>hS,replicateEffect:()=>LS,replicate:()=>FS,repeatOrElse:()=>zS,repeat:()=>OS,raceFirst:()=>RE,raceAllFirst:()=>LE,raceAll:()=>FE,race:()=>PE,provideServiceEffect:()=>lE,provideService:()=>iD,provideContext:()=>dE,provide:()=>mE,promise:()=>_j,partition:()=>Gj,orElseSucceed:()=>_E,orDie:()=>tj,option:()=>Ej,onInterrupt:()=>VS,onExitPrimitive:()=>$S,onExitIf:()=>GS,onExitFilter:()=>ZS,onExit:()=>h$,onErrorIf:()=>YS,onErrorFilter:()=>JS,onError:()=>QS,never:()=>qj,matchEffect:()=>kE,matchEager:()=>g$,matchCauseEffectEager:()=>vE,matchCauseEffect:()=>xE,matchCauseEager:()=>SE,matchCause:()=>EE,match:()=>b$,mapErrorEager:()=>y1,mapError:()=>aj,mapEager:()=>m5,mapBothEager:()=>t0,mapBoth:()=>sj,map:()=>AX,makeSpanScoped:()=>xS,makeSpan:()=>vS,logWithLevel:()=>Jv,logWarning:()=>Zv,logTrace:()=>Wv,logInfo:()=>Kv,logFatal:()=>Gv,logError:()=>d$,logDebug:()=>Hv,log:()=>$v,linkSpans:()=>SS,let:()=>Uj,isSuccess:()=>bE,isFailure:()=>yE,isEffect:()=>Y4,interruptibleMask:()=>DS,interruptible:()=>_S,interrupt:()=>aD,ignoreCause:()=>KE,ignore:()=>ZE,gen:()=>zj,fromYieldable:()=>Cj,fromResult:()=>Mj,fromOption:()=>Aj,fromNullishOr:()=>wj,forkScoped:()=>cS,forkIn:()=>pS,forkDetach:()=>fS,forkChild:()=>dS,forever:()=>US,forEach:()=>Wj,fnUntracedEager:()=>CX,fnUntraced:()=>Qv,fn:()=>Yv,flip:()=>kj,flatten:()=>Tj,flatMapEager:()=>D8,flatMap:()=>NX,firstSuccessOf:()=>VE,findFirstFilter:()=>Hj,findFirst:()=>Kj,filterOrFail:()=>TE,filterOrElse:()=>wE,filterMapOrFail:()=>IE,filterMapOrElse:()=>CE,filterMapEffect:()=>AE,filterMap:()=>ME,filter:()=>NE,fiberId:()=>rS,fiber:()=>lS,failSync:()=>Fj,failCauseSync:()=>Pj,failCause:()=>Lj,fail:()=>v,exit:()=>MX,eventually:()=>YE,ensuring:()=>XS,effectify:()=>Av,die:()=>uD,delay:()=>UE,currentSpan:()=>TS,currentParentSpan:()=>IS,contextWith:()=>hE,context:()=>gE,clockWith:()=>eD,catchTags:()=>mj,catchTag:()=>hj,catchReasons:()=>pj,catchReason:()=>dj,catchNoSuchElement:()=>oj,catchIf:()=>lj,catchFilter:()=>rj,catchEager:()=>d5,catchDefect:()=>uj,catchCauseIf:()=>nj,catchCauseFilter:()=>ij,catchCause:()=>fj,catch:()=>gj,callback:()=>y$,cachedWithTTL:()=>HS,cachedInvalidateWithTTL:()=>WS,cached:()=>KS,bindTo:()=>Bj,bind:()=>Oj,awaitAllChildren:()=>uS,asVoid:()=>xj,asSome:()=>vj,as:()=>Sj,annotateSpans:()=>wS,annotateLogsScoped:()=>qv,annotateLogs:()=>Vv,annotateCurrentSpan:()=>CS,andThen:()=>Ij,all:()=>$j,addFinalizer:()=>eE,acquireUseRelease:()=>tE,acquireRelease:()=>aE,acquireDisposable:()=>sE,abortSignal:()=>BS,YieldableClass:()=>dD,Transaction:()=>RX,Do:()=>Dj});var q8={};J6(q8,{void:()=>G$,succeed:()=>VX,match:()=>nT,mapError:()=>p7,mapBoth:()=>aT,map:()=>iT,isSuccess:()=>V8,isFailure:()=>Z$,isExit:()=>$$,interrupt:()=>hT,hasInterrupts:()=>pT,hasFails:()=>mT,hasDies:()=>dT,getSuccess:()=>c7,getCause:()=>eT,findErrorOption:()=>XI,findError:()=>rT,findDefect:()=>oT,filterValue:()=>fT,filterSuccess:()=>cT,filterFailure:()=>uT,filterCause:()=>lT,failCause:()=>qX,fail:()=>x5,die:()=>gT,asVoidAll:()=>tT,asVoid:()=>sT});var $$=F3,VX=j0,qX=N1,x5=M1,gT=C8,hT=v_,G$=n1;var V8=E5,Z$=UJ,mT=m_,dT=h_,pT=g_,cT=x_,fT=k_,uT=y_,lT=a9,rT=OJ,oT=b_,nT=d_,iT=zJ,p7=FJ,aT=LJ,sT=p_,tT=PJ,c7=c_,eT=f_,XI=u_;var QI="~effect/Deferred";var YI={[QI]:{_A:b,_E:b},pipe(){return a(this,arguments)}},xq=()=>{let X=Object.create(YI);return X.resumes=void 0,X.effect=void 0,X};var kq=(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 JI=B(2,(X,Q)=>$0(()=>$I(X,Q))),yq=JI;var $I=(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 bq=s8;var gq=W7;var hq=YX;var f7=LV,K$=kJ;var dq="~effect/Layer",mq="~effect/Layer/MemoMap",pq=(X)=>M(X,dq),KI={[dq]:{_ROut:b,_E:b,_RIn:b},pipe(){return a(this,arguments)}},cq=(X)=>{let Q=Object.create(KI);return Q.build=X,Q},fq=(X)=>cq((Q,Y)=>{let J=f7(Y);return O1(X(Q,J),($)=>$._tag==="Failure"?K$(J,$):X0)});class uq{get[mq](){return mq}map=new Map;getOrElseMemoize(X,Q,Y){if(this.map.has(X)){let Z=this.map.get(X);return Z.observers++,t8(k4(Q,(K)=>Z.finalizer(K)),Z.effect)}let J=hq(),$=xq(),G={observers:1,effect:kq($),finalizer:(Z)=>i(()=>{if(G.observers--,G.observers===0)return this.map.delete(X),K$(J,Z);return X0})};return this.map.set(X,G),k4(Q,G.finalizer).pipe(T(()=>Y(this,J)),O1((Z)=>{return G.effect=Z,yq($,Z)}))}}var H$=()=>new uq;class u7 extends l1()("effect/Layer/CurrentMemoMap"){static getOrCreate=_W(this,H$)}var W$=B(3,(X,Q,Y)=>U1(L0(X.build(Q,Y),K8(u7,Q)),u7,Q));var lq=B(2,(X,Q)=>c((Y)=>W$(X,u7.getOrCreate(Y.context),Q)));var rq=(X)=>cq(i0(A(X)));var oq=(X,Q,Y)=>{let J=f7(Y,"parallel");return o1(X,($)=>$.build(Q,f7(J,"sequential")),{concurrency:X.length}).pipe(L0(($)=>DW(...$)))},nq=(...X)=>fq((Q,Y)=>oq(X,Q,Y));var HI=(X,Q,Y)=>fq((J,$)=>T(Array.isArray(Q)?oq(Q,J,$):Q.build(J,$),(G)=>X.build(J,$).pipe(X4(G),L0((Z)=>Y(Z,G))))),iq=B(2,(X,Q)=>HI(X,Q,b));var sq="~effect/ExecutionPlan";var WI={[sq]:sq,get withRequirements(){let X=this;return x4((Q)=>A(_I(X.steps.map((Y)=>({...Y,provide:pq(Y.provide)?iq(Y.provide,rq(Q)):Y.provide})))))},pipe(){return a(this,arguments)}},_I=(X)=>{let Q=Object.create(WI);return Q.steps=X,Q};var tq=V0("effect/ExecutionPlan/CurrentMetadata",{defaultValue:i0({attempt:0,stepIndex:0})});var eq=class extends $6{constructor(X){super();if(X)Object.assign(this,X)}};var XD=r8;var l7="~effect/time/DateTime",r7="~effect/time/DateTime/TimeZone",JD={[l7]:l7,pipe(){return a(this,arguments)},[a0](){return this.toString()},toJSON(){return OX(this).toJSON()}},qI={...JD,_tag:"Utc",[H0](){return c8(this.epochMilliseconds)},[W0](X){return y5(X)&&X._tag==="Utc"&&this.epochMilliseconds===X.epochMilliseconds},toString(){return`DateTime.Utc(${OX(this).toJSON()})`}},DI={...JD,_tag:"Zoned",[H0](){return f0(c8(this.epochMilliseconds))(s(this.zone))},[W0](X){return y5(X)&&X._tag==="Zoned"&&this.epochMilliseconds===X.epochMilliseconds&&o(this.zone,X.zone)},toString(){return`DateTime.Zoned(${M$(this)})`}},$D={[r7]:r7,[a0](){return this.toString()}},BI={...$D,_tag:"Named",[H0](){return C0(`Named:${this.id}`)},[W0](X){return I6(X)&&X._tag==="Named"&&this.id===X.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:"TimeZone",_tag:"Named",id:this.id}}},UI={...$D,_tag:"Offset",[H0](){return C0(`Offset:${this.offset}`)},[W0](X){return I6(X)&&X._tag==="Offset"&&this.offset===X.offset},toString(){return`TimeZone.Offset(${P$(this.offset)})`},toJSON(){return{_id:"TimeZone",_tag:"Offset",offset:this.offset}}},v8=(X,Q,Y)=>{let J=Object.create(DI);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},y5=(X)=>M(X,l7);var I6=(X)=>M(X,r7),GD=(X)=>I6(X)&&X._tag==="Offset",ZD=(X)=>I6(X)&&X._tag==="Named",KD=(X)=>X._tag==="Utc",q$=(X)=>X._tag==="Zoned",HD=s0((X,Q)=>X.epochMilliseconds===Q.epochMilliseconds);var D$=(X)=>{let Q=Object.create(qI);return Q.epochMilliseconds=X,Object.defineProperty(Q,"partsUtc",{value:void 0,enumerable:!1,writable:!0}),Q},k5=(X)=>{let Q=X.getTime();if(Number.isNaN(Q))throw new _X("Invalid date");return D$(Q)},B$=(X)=>{if(y5(X))return X;else if(X instanceof Date)return k5(X);else if(typeof X==="object"){if("epochMilliseconds"in X)return D$(X.epochMilliseconds);let Q=new Date(0);return MI(Q,X),k5(Q)}else if(typeof X==="string"&&!OI(X))return k5(new Date(X+"Z"));return k5(new Date(X))},OI=(X)=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(X),zI=-8639999956800000,FI=8639999949600000,U$=(X,Q)=>{let Y=Q?.timeZone;if(Y===void 0&&y5(X)&&q$(X))return X;let J=B$(X);if(J.epochMilliseconds<zI||J.epochMilliseconds>FI)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(I6(Y))$=Y;else if(typeof Y==="number")$=UX(Y);else{let G=F$(Y);if(T0(G))throw new _X(`Invalid time zone: ${Y}`);$=G.value}if(Q?.adjustForTimeZone!==!0)return v8(J.epochMilliseconds,$,J.partsUtc);return AI(J.epochMilliseconds,$,Q?.disambiguation??"compatible")},_$=B6(U$),WD=B6(B$),LI=/^(.{17,35})\[(.+)\]$/,_D=(X)=>{let Q=LI.exec(X);if(Q===null){let $=N$(X);return $!==null?_$(X,{timeZone:$}):x()}let[,Y,J]=Q;return _$(Y,{timeZone:J})};var VD=(X)=>D$(X.epochMilliseconds);var BX=new Map,PI={day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"longOffset",fractionalSecondDigits:3,hourCycle:"h23"},RI=(X)=>{let Q=X.resolvedOptions().timeZone;if(BX.has(Q))return BX.get(Q);let Y=Object.create(BI);return Y.id=Q,Y.format=X,BX.set(Q,Y),Y},O$=(X)=>{if(BX.has(X))return BX.get(X);try{return RI(new Intl.DateTimeFormat("en-US",{...PI,timeZone:X}))}catch{throw new _X(`Invalid time zone: ${X}`)}},UX=(X)=>{let Q=Object.create(UI);return Q.offset=X,Q},z$=B6(O$);var NI=/^(?:GMT|[+-])/,F$=(X)=>{if(NI.test(X)){let Q=N$(X);return Q===null?x():F(UX(Q))}return z$(X)},qD=(X)=>{if(X._tag==="Offset")return P$(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},L$=(X)=>{return o7(X).getTime()-R$(X)},P$=(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")}`},DD=(X)=>P$(L$(X)),R$=(X)=>X.epochMilliseconds;var MI=(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 YD=86400000,AI=(X,Q,Y)=>{if(Q._tag==="Offset")return v8(X-Q.offset,Q);let J=DX(X-YD,X,Q),$=DX(X+YD,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 W=v8(X-J,Q),V=o7(W).getTime();if(X!==V)switch(Y){case"reject":{let _=new Date(X).toISOString();throw RangeError(`Gap time: ${_} does not exist in time zone ${Q.id}`)}case"earlier":return v8(X-$,Q);case"compatible":case"later":return W}return W}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 W=new Date(X).toISOString();throw RangeError(`Ambiguous time: ${W} occurs twice in time zone ${Q.id}`)}}return v8(X-$,Q)},wI=/([+-])(\d{2}):(\d{2})$/,N$=(X)=>{let Q=wI.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 $=N$(J);if($===null)return L$(v8(Q,Y));return $};var BD=(X)=>OX(X).toISOString();var V$=(X)=>{let Q=o7(X);return X._tag==="Utc"?Q.toISOString():`${Q.toISOString().slice(0,-1)}${DD(X)}`},M$=(X)=>X.zone._tag==="Offset"?V$(X):`${V$(X)}[${X.zone.id}]`;var Va=globalThis.Number;var OD=B(2,(X,Q)=>{let Y=UD(X),J=UD(Q),$=Y>J?Y:J,G=parseInt(X.toFixed($).replace(".","")),Z=parseInt(Q.toFixed($).replace(".",""));return G%Z/Math.pow(10,$)});function UD(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 zD=o8((X,Q)=>Math.max(X,Q),-1/0),FD=o8((X,Q)=>Math.min(X,Q),1/0);var qa=globalThis.String;var LD=(X)=>X.trim();var A$=B(2,(X,Q)=>S5(X,EI,(Y)=>Q(Y)));var jI=M5(S8,(X)=>m7(X)?l(X):f(X));var EI=M5(S8,(X)=>m7(X)?l(X.value):f(X));var PD=B(2,(X,Q)=>j8(X,{onSuccess:Q.onSuccess,onFailure:(Y)=>{let J=jI(Y);return!u(J)?Q.onDone(J.success.value):Q.onFailure(J.failure)}}));var ND="~effect/Schedule";var j6=V0("effect/Schedule/CurrentMetadata",{defaultValue:i0({input:void 0,output:void 0,duration:R5,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),SI={[ND]:{_Out:b,_In:b,_Env:b},pipe(){return a(this,arguments)}},w$=(X)=>M(X,ND),C$=(X)=>{let Q=Object.create(SI);return Q.step=X,Q},T$=()=>{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}}},vI=(X)=>C$(L0(X,(Q)=>{let Y=T$();return(J,$)=>Q(Y(J,$))})),I$=(X)=>a1(X.step,(Q)=>A(()=>N0(Q))),n7=(X)=>w6((Q)=>L0(I$(X),(Y)=>{let J=T$();return($)=>i(()=>{let G=Q.currentTimeMillisUnsafe();return T(Y(G,$),([Z,K])=>{let H=J(G,$);return H.output=Z,H.duration=K,v1(C6(K),H)})})}));var j$=(X)=>C$(L0(I$(X),(Q)=>(Y,J)=>PD(Q(Y,J),{onSuccess:($)=>A([J,$[1]]),onFailure:N0,onDone:()=>d7(J)}))),MD=(X)=>zX(E$,({attempt:Q})=>A(Q<=X));var xI=(X)=>{let Q=S1(X);return vI(A((Y)=>A([Y.attempt-1,Q])))};var zX=B(2,(X,Q)=>C$(L0(I$(X),(Y)=>{let J=T$();return($,G)=>T(Y($,G),(Z)=>{let[K,H]=Z,W=Q({...J($,G),output:K,duration:H});return T(p(W)?W:A(W),(V)=>V?A(Z):d7(K))})})));var E$=xI(R5);var kI=(X,Q,Y)=>j7((J)=>T(Y?.local?W$(Q,H$(),J):lq(Q,J),($)=>X4(X,$))),i7=B((X)=>p(X[0]),(X,Q,Y)=>j3(Q)?X4(X,Q):kI(X,Array.isArray(Q)?nq(...Q):Q,Y));var S$=B(3,(X,Q,Y)=>T(n7(Q),(J)=>{let $=j6.defaultValue();return x1(A7(R6(T(i(()=>U1(X,j6,$)),J),(G)=>$0(()=>{$=G})),{disableYield:!0}),(G)=>E9(G)?A(G.value):Y(G,$.attempt===0?x():F($)))})),v$=B(3,(X,Q,Y)=>T(n7(Q),(J)=>{let $=j6.defaultValue(),G,Z=x1(i(()=>U1(X,j6,$)),(K)=>{return G=K,T(J(K),(H)=>{return $=H,Z})});return A$(Z,(K)=>J0(()=>Y(G,K)))})),CD=B(2,(X,Q)=>{let Y=typeof Q==="function"?Q(b):w$(Q)?Q:LX(Q);return S$(X,Y,M0)}),FX=B(2,(X,Q)=>{let Y=typeof Q==="function"?Q(b):w$(Q)?Q:LX(Q);return v$(X,Y,M0)}),TD=B(3,(X,Q,Y)=>T(n7(Y),(J)=>{let $=j6.defaultValue(),G=i(()=>U1(X,j6,$));return x1(T(J(Q),(Z)=>{$=Z;let K=i0(T(G,J));return y4({while:P4,body:K,step(H){$=H}})}),(Z)=>E9(Z)?A(Z.value):M0(Z))})),yI=j$(E$),LX=(X)=>{let Q=X.schedule?j$(X.schedule):yI;if(X.while)Q=zX(Q,({input:Y})=>{let J=X.while(Y);return p(J)?J:A(J)});if(X.until)Q=zX(Q,({input:Y})=>{let J=X.until(Y);return p(J)?L0(J,($)=>!$):A(!J)});if(X.times!==void 0)Q=zX(Q,({attempt:Y})=>A(Y<=X.times));return Q};var ED=B(2,(X,Q)=>i(()=>{let Y=0,J={attempt:0,stepIndex:0},$=M7(tq,$0(()=>{return J={attempt:J.attempt+1,stepIndex:Y},J})),G;return T(y4({while:()=>Y<Q.steps.length&&(G===void 0||u(G)),body(){let Z=Q.steps[Y],K=$(i7(X,Z.provide));if(G){let H=!1,W=K;K=i(()=>{if(H)return W;return H=!0,G.asEffect()}),K=FX(K,jD(Z,!1))}else{let H=jD(Z,!0);K=H?FX(K,H):K}return v4(K)},step(Z){G=Z,Y++}}),()=>G.asEffect())})),jD=(X,Q)=>{if(!Q)return LX({schedule:X.schedule?X.schedule:X.attempts?void 0:bI,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})},bI=MD(1);var hI="~effect/Request",mI=EH({_E:(X)=>X,_A:(X)=>X,_R:(X)=>X}),Ia={...bH,[hI]:mI};var SD=(X)=>X;var xD=B(2,(X,Q)=>{let Y=(J)=>w1(($)=>{let G=yD(J,X,$,z7());return dI(J,G)});return p(Q)?T(Q,Y):Y(Q)}),kD=(X,Q)=>{let Y=yD(Q.resolver,X,Q.onExit,{context:Q.context,currentScheduler:E1(Q.context,y9)});return()=>bD(Q.resolver,Y)},a7=[],x$=new Map,yD=(X,Q,Y,J)=>{let $=x$.get(X);if(!$)$=new Map,x$.set(X,$);let G,Z=!1,K=SD({request:Q,context:J.context,uninterruptible:!1,completeUnsafe(W){if(Z)return;Z=!0,Y(W),G?.entrySet.delete(K)}});if(X.preCheck!==void 0&&!X.preCheck(K))return K;let H=X.batchKey(K);if(G=$.get(H),!G){if(a7.length>0)G=a7.pop(),G.key=H,G.resolver=X,G.map=$;else{let W={key:H,resolver:X,map:$,entrySet:new Set,entries:new Set,delayEffect:T(i(()=>W.resolver.delay),(V)=>vD(W)),run:O1(i(()=>W.resolver.runAll(Array.from(W.entries),W.key)),(V)=>{for(let _ of W.entrySet)_.completeUnsafe(V._tag==="Success"?C8(Error("Effect.request: RequestResolver did not complete request",{cause:_.request})):V);if(W.entries.clear(),a7.length<128)W.entrySet.clear(),W.key=void 0,W.fiber=void 0,a7.push(W);return X0})};G=W}$.set(H,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)(vD(G),{scheduler:J.currentScheduler}),K},bD=(X,Q)=>{if(Q.uninterruptible)return;let Y=x$.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()},dI=(X,Q)=>$0(()=>bD(X,Q));function vD(X){if(!X.map.has(X.key))return X0;return X.map.delete(X.key),X.run}var uI="effect/Metric/CurrentMetricAttributes",lI=V0(uI,{defaultValue:()=>({})}),rI="~effect/observability/Metric/MetricRegistryKey",oI=V0(rI,{defaultValue:()=>new Map}),gD="~effect/observability/Metric";class b5{[gD]=gD;#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,lI);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=Yj(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=eI(this,Q),J=E1(X,oI);if(J.has(Y))return J.get(Y);let $=this.createHooks(),G={id:this.id,type:this.type,description:this.description,attributes:b4(Q),hooks:$};return J.set(Y,G),G}pipe(){return a(this,arguments)}}var hD=BigInt(0);class nI extends b5{type="Counter";#X;#Q;constructor(X,Q){super(X,Q?.description,b4(Q?.attributes));this.#X=Q?.bigint??!1,this.#Q=Q?.incremental??!1}createHooks(){let X=this.#X?hD:0,Q=this.#Q?this.#X?(J)=>J>=hD:(J)=>J>=0:(J)=>!0;return PX(()=>({count:X,incremental:this.#Q}),(J)=>{if(Q(J))X=X+J})}}class iI extends b5{type="Gauge";#X;constructor(X,Q){super(X,Q?.description,b4(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 aI extends b5{type="Frequency";#X;constructor(X,Q){super(X,Q?.description,b4(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 sI extends b5{type="Histogram";#X;constructor(X,Q){super(X,Q?.description,b4(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;j4(k9(X,D1),(V,_)=>{J[_]=V});let H=(V)=>{let _=0,q=Q;while(_!==q){let D=Math.floor(_+(q-_)/2),U=J[D];if(V<=U)q=D;else _=D;if(q===_+1)if(V<=J[_])q=_;else _=q}if(Y[_]=Y[_]+1,$=$+1,G=G+V,V<Z)Z=V;if(V>K)K=V},W=()=>{let V=x3(Q),_=0;for(let q=0;q<Q;q++){let D=J[q],U=Y[q];_=_+U,V[q]=[D,_]}return V};return PX(()=>({buckets:W(),count:$,min:Z,max:K,sum:G}),H)}}class tI extends b5{type="Summary";#X;#Q;#Y;constructor(X,Q){super(X,Q?.description,b4(Q?.attributes));this.#X=Math.max(S4(S1(Q.maxAge)),0),this.#Q=Q.maxSize,this.#Y=Q.quantiles}createHooks(){let X=k9(this.#Y,D1),Q=x3(this.#Q);for(let _ of this.#Y)if(_<0||_>1)throw Error(`Quantile must be between 0 and 1, found: ${_}`);let Y=0,J=0,$=0,G=Number.MAX_VALUE,Z=Number.MIN_VALUE,K=(_)=>{let q=[],D=0;while(D<this.#Q){let L=Q[D];if($1(L)){let[N,P]=L,y=_-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]]})},H=(_,q)=>{if(this.#Q>0){let D=Y%this.#Q;Q[D]=[q,_],Y=Y+1}if(J=J+1,$=$+_,_<G)G=_;if(_>Z)Z=_};return PX((_)=>{let q=E1(_,E8);return{quantiles:K(q.currentTimeMillisUnsafe()),count:J,min:G,max:Z,sum:$}},([_,q])=>H(_,q))}}var g5=B(2,(X,Q)=>x4((Y)=>$0(()=>X.updateUnsafe(Q,Y))));function eI(X,Q){let Y=`${X.type}:${X.id}`;if($1(X.description))Y+=`:${X.description}`;if($1(Q))Y+=`:${Xj(Q)}`;return Y}function PX(X,Q,Y){return{get:X,update:Q,modify:Y??Q}}function Xj(X){return Qj(Array.isArray(X)?X:Object.entries(X))}function Qj(X){return X.map(([Q,Y])=>`${Q}=${Y}`).join(",")}function Yj(X,Q){return{...b4(X),...b4(Q)}}function b4(X){if($1(X)&&Array.isArray(X))return X.reduce((Q,[Y,J])=>{return Q[Y]=J,Q},{});return X}class dD{[Symbol.iterator](){return new K6(this)}}var Y4=p,$j=v7,Gj=uJ,Zj=vV,Kj=xV,Hj=yV,Wj=o1,pD=y4,_j=HJ,k$=U_,h=A,x8=L7,s7=KJ,cD=i,fD=$0,g4=X0;var Vj=jq;var y$=w1,qj=_J,Dj=cV,Bj=fV,Uj=lV;var Oj=uV,zj=L_,v=M0,Fj=P7,Lj=N0,Pj=D_,uD=P6,h4=B_;var Rj=j5,Nj=ZJ,lD=c,Mj=V_,Aj=__,wj=q_,Cj=n9,NX=T,Tj=T_,Ij=t8,rD=R6,jj=v4,Ej=VV,MX=XX,AX=L0,Sj=v1,vj=R7,xj=i9,kj=N_,yj=NJ,bj=MJ,gj=x1;var hj=TJ,mj=JV,dj=$V,pj=GV,cj=ZV,fj=a1,uj=t_,lj=t9,rj=C7,oj=s_,nj=wJ,ij=S5,aj=IJ,sj=jJ,tj=EJ,oD=CJ,ej=QV,t7=e_,XE=XV,QE=w7,nD=YV,YE=SJ,JE=FX,$E=v$,GE=M_,ZE=WV,KE=_V,HE=ED,WE=Eq,_E=KV,VE=HV,qE=OV,DE=zV,BE=xJ,UE=UV,OE=C6,zE=FV,FE=DJ,LE=BJ,PE=A_,RE=N7,NE=mV,ME=dV,AE=pV,wE=lJ,CE=rJ,TE=n_,IE=hV,jE=i_,b$=T7,g$=e9,EE=vJ,SE=qV,vE=w_,xE=j8,kE=N6,yE=DV,bE=BV,gE=RJ,hE=x4,mE=i7,dE=X4,pE=l_,cE=r_,fE=s9,uE=e8,iD=U1,lE=M7,rE=o_,oE=JX,nE=yJ,iE=j7,aE=E7,sE=wV,tE=AV,eE=bJ,XS=RV,QS=mJ,YS=NV,JS=dJ,$S=v5,h$=O1,GS=gJ,ZS=hJ,KS=CV,HS=cJ,WS=pJ,aD=TV,_S=fJ,VS=MV,qS=M6,sD=$X,DS=EV,BS=SV,US=A7,OS=CD,zS=S$,FS=AJ,LS=a_,PS=B(2,(X,Q)=>tD(X,void 0,Q)),tD=TD,RS=Jq,NS=$q,MS=Gq,AS=Zq,wS=Bq,CS=Uq,TS=Oq,IS=zq,jS=_q,ES=Vq,SS=qq,vS=Hq,xS=d9,kS=p9,yS=Dq,bS=Wq,gS=T5,hS=xD,mS=kD,dS=rV,pS=oJ,cS=iV,fS=oV,uS=nV,lS=z_,rS=F_,h5=aV,oS=Q4,nS=nJ,iS=sV,m$=eV,aS=iJ,sS=tV,tS=x7,wX=Qq,eS=aJ,e7=Xq,Xv=k7,Qv=VJ,Yv=P_,eD=w6,Jv=_8,$v=_8(),Gv=_8("Fatal"),Zv=_8("Warn"),d$=_8("Error"),Kv=_8("Info"),Hv=_8("Debug"),Wv=_8("Trace"),_v=B(2,(X,Q)=>e8(X,X$,(Y)=>new Set([...Y,Q]))),Vv=B((X)=>Y4(X[0]),(X,...Q)=>e8(X,bq,(Y)=>{let J={...Y};if(Q.length===1)Object.assign(J,Q[0]);else J[Q[0]]=Q[1];return J})),qv=Cq,Dv=B(2,(X,Q)=>T(Lq,(Y)=>e8(X,gq,(J)=>{return[[Q,Y],...J]}))),Bv=B((X)=>Y4(X[0]),(X,Q,Y)=>h$(X,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return g5(Q,$)})),Uv=B((X)=>Y4(X[0]),(X,Q,Y)=>rD(X,(J)=>{let $=Y===void 0?J:Y(J);return g5(Q,$)})),Ov=B((X)=>Y4(X[0]),(X,Q,Y)=>oD(X,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return g5(Q,$)})),zv=B((X)=>Y4(X[0]),(X,Q,Y)=>nD(X,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return g5(Q,$)})),Fv=B((X)=>Y4(X[0]),(X,Q,Y)=>eD((J)=>{let $=J.currentTimeNanosUnsafe();return h$(X,()=>{let G=J.currentTimeNanosUnsafe(),Z=jW(S1(G),S1($)),K=Y===void 0?Z:J0(()=>Y(Z));return g5(Q,K)})}));class RX extends l1()("effect/Effect/Transaction"){}var Lv=(X)=>lD((Q)=>{if(Q.context.mapUnsafe.has(RX.key))return X;let Y={journal:new Map,retry:!1},J;return sD(($)=>NX(pD({while:()=>!J,body:i0($(X).pipe(iD(RX,Y),t7(()=>{if(!Y.retry)return g4;return $(Rv(Y))}),MX)),step(G){if(Y.retry||!Pv(Y))return mD(Y);if(V8(G))Nv(Q,Y);else mD(Y);J=G}}),()=>J))}),Pv=(X)=>{for(let[Q,{version:Y}]of X.journal)if(Q.version!==Y)return!1;return!0},Rv=(X)=>cD(()=>{let Q={},Y=Array.from(X.journal.keys()),J=()=>{for(let $ of Y)$.pending.delete(Q)};return y$(($)=>{let G=()=>{J(),$(g4)};for(let Z of Y)Z.pending.set(Q,G);return fD(J)})});function Nv(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 mD(X){X.retry=!1,X.journal.clear()}var Mv=NX(RX.asEffect(),(X)=>{return X.retry=!0,aD}),Av=(X,Q,Y)=>(...J)=>y$(($)=>{try{X(...J,(G,Z)=>{if(G)$(v(Q?Q(G,J):G));else $(h(Z))})}catch(G){$(Y?v(Y(G,J)):uD(G))}}),wv=()=>(X)=>X,Cv=()=>(X)=>X,Tv=()=>(X)=>X,m5=I_,y1=j_,t0=E_,D8=C_,d5=S_,CX=R_;var Iv=(X,Q)=>{if(V8(X))return Q(0);if(h7(X.cause))return Q(130);return Q(jv(T6(X.cause)))},YB=(X)=>B((Q)=>Y4(Q[0]),(Q,Y)=>{let J=Y?.disableErrorReporting===!0?h5(Q):h5(t7(Q,(G)=>{if(h7(G))return g4;return Ev(T6(G))?d$(G):g4}));try{let G=globalThis.setInterval(G5,2147483647);J.addObserver(()=>{clearInterval(G)})}catch{}let $=Y?.teardown??Iv;return X({fiber:J,teardown:$})}),XB="~effect/Runtime/errorExitCode",jv=(X)=>{if(typeof X==="object"&&X!==null&&XB in X){let Q=X[XB];if(typeof Q==="number")return Q}return 1},QB="~effect/Runtime/errorReported",Ev=(X)=>{if(typeof X==="object"&&X!==null&&QB in X){let Q=X[QB];if(typeof Q==="boolean")return Q}return!0};var JB=YB(({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 xv=JB;var w={};J6(w,{withDecodingDefaultTypeKey:()=>Bu,withDecodingDefaultType:()=>Uu,withDecodingDefaultKey:()=>YH,withDecodingDefault:()=>AN,withConstructorDefault:()=>MN,toType:()=>P1,toTaggedUnion:()=>wN,toStandardSchemaV1:()=>Of,toStandardJSONSchemaV1:()=>zf,toRepresentation:()=>UM,toJsonSchemaDocument:()=>OM,toIsoSource:()=>wr,toIsoFocus:()=>Cr,toIso:()=>Ar,toFormatter:()=>Vr,toEquivalence:()=>Dr,toEncoderXml:()=>Or,toEncoded:()=>U9,toDifferJsonPatch:()=>Ir,toCodecStringTree:()=>RM,toCodecJson:()=>zM,toCodecIso:()=>LM,toArbitraryLazy:()=>BM,toArbitrary:()=>Wr,tagDefaultOmit:()=>Ou,tag:()=>Q5,suspend:()=>FN,revealCodec:()=>Bf,revealBottom:()=>_f,resolveAnnotationsKey:()=>xr,resolveAnnotations:()=>vr,requiredKey:()=>mf,required:()=>df,refine:()=>Hu,redact:()=>$H,readonlyKey:()=>cf,overrideToFormatter:()=>_r,overrideToEquivalence:()=>qr,overrideToCodecIso:()=>Tr,optionalKey:()=>X5,optional:()=>B9,mutableKey:()=>pf,mutable:()=>Zu,middlewareEncoding:()=>PN,middlewareDecoding:()=>XH,makeIsMultipleOf:()=>jN,makeIsLessThanOrEqualTo:()=>wQ,makeIsLessThan:()=>AQ,makeIsGreaterThanOrEqualTo:()=>MQ,makeIsGreaterThan:()=>NQ,makeIsBetween:()=>CQ,makeFilterGroup:()=>Lu,makeFilter:()=>F0,make:()=>I,link:()=>O0,isUppercased:()=>Eu,isUnique:()=>bN,isUncapitalized:()=>xu,isUint32:()=>mu,isUUID:()=>Au,isULID:()=>wu,isTrimmed:()=>CN,isStringSymbol:()=>Nu,isStringFinite:()=>Pu,isStringBigInt:()=>Ru,isStartsWith:()=>Tu,isSizeBetween:()=>Jl,isSchemaError:()=>Uf,isSchema:()=>m2,isPropertyNames:()=>Kl,isPropertiesLengthBetween:()=>Zl,isPattern:()=>RQ,isNonEmpty:()=>kN,isMultipleOf:()=>gu,isMinSize:()=>Ql,isMinProperties:()=>$l,isMinLength:()=>xN,isMaxSize:()=>Yl,isMaxProperties:()=>Gl,isMaxLength:()=>Xl,isLowercased:()=>Su,isLessThanOrEqualToDate:()=>fu,isLessThanOrEqualToBigInt:()=>ou,isLessThanOrEqualToBigDecimal:()=>tu,isLessThanOrEqualTo:()=>bu,isLessThanDate:()=>cu,isLessThanBigInt:()=>ru,isLessThanBigDecimal:()=>su,isLessThan:()=>yu,isLengthBetween:()=>yN,isInt32:()=>hu,isInt:()=>u2,isIncludes:()=>ju,isGreaterThanOrEqualToDate:()=>pu,isGreaterThanOrEqualToBigInt:()=>vN,isGreaterThanOrEqualToBigDecimal:()=>au,isGreaterThanOrEqualTo:()=>EN,isGreaterThanDate:()=>du,isGreaterThanBigInt:()=>lu,isGreaterThanBigDecimal:()=>iu,isGreaterThan:()=>ku,isFinite:()=>IN,isEndsWith:()=>Iu,isDateValid:()=>SN,isCapitalized:()=>vu,isBetweenDate:()=>uu,isBetweenBigInt:()=>nu,isBetweenBigDecimal:()=>eu,isBetween:()=>JH,isBase64Url:()=>Cu,isBase64:()=>TN,is:()=>GN,instanceOf:()=>d8,fromURLSearchParams:()=>gl,fromJsonString:()=>tN,fromFormData:()=>bl,fromBrand:()=>Wu,flip:()=>lK,fieldsAssign:()=>tf,extendTo:()=>Xu,encodeUnknownSync:()=>bf,encodeUnknownResult:()=>vf,encodeUnknownPromise:()=>kf,encodeUnknownOption:()=>Ef,encodeUnknownExit:()=>_N,encodeUnknownEffect:()=>HN,encodeTo:()=>QH,encodeSync:()=>gf,encodeResult:()=>xf,encodePromise:()=>yf,encodeOption:()=>Sf,encodeKeys:()=>ef,encodeExit:()=>jf,encodeEffect:()=>WN,encode:()=>Du,decodeUnknownSync:()=>Tf,decodeUnknownResult:()=>Mf,decodeUnknownPromise:()=>wf,decodeUnknownOption:()=>Rf,decodeUnknownExit:()=>KN,decodeUnknownEffect:()=>ZN,decodeTo:()=>m,decodeSync:()=>If,decodeResult:()=>Af,decodePromise:()=>Cf,decodeOption:()=>Nf,decodeExit:()=>Pf,decodeEffect:()=>Lf,decode:()=>qu,declareConstructor:()=>c1,declare:()=>z4,check:()=>Ku,catchEncodingWithContext:()=>NN,catchEncoding:()=>Vu,catchDecodingWithContext:()=>RN,catchDecoding:()=>_u,brand:()=>LN,asserts:()=>Ff,asClass:()=>hf,annotateKey:()=>Df,annotateEncoded:()=>qf,annotate:()=>Vf,Void:()=>nf,UnknownFromJsonString:()=>yl,Unknown:()=>d2,UniqueSymbol:()=>sf,UniqueArray:()=>Gu,Union:()=>o0,UndefinedOr:()=>c2,Undefined:()=>aK,Uint8ArrayFromHex:()=>al,Uint8ArrayFromBase64Url:()=>il,Uint8ArrayFromBase64:()=>nl,Uint8Array:()=>n2,URLSearchParams:()=>QM,URLFromString:()=>Tl,URL:()=>oN,TupleWithRest:()=>Yu,Tuple:()=>D9,Trimmed:()=>JM,Trim:()=>pl,Tree:()=>jr,TimeZoneOffset:()=>Xr,TimeZoneNamedFromString:()=>Qr,TimeZoneNamed:()=>ZM,TimeZoneFromString:()=>Yr,TimeZone:()=>HM,TemplateLiteralParser:()=>lf,TemplateLiteral:()=>uf,TaggedUnion:()=>zu,TaggedStruct:()=>f2,TaggedErrorClass:()=>Hr,TaggedClass:()=>Kr,Symbol:()=>DN,StructWithRest:()=>Qu,Struct:()=>R0,StringFromUriComponent:()=>ll,StringFromHex:()=>ul,StringFromBase64Url:()=>fl,StringFromBase64:()=>cl,String:()=>r,StandardSchemaV1FailureResult:()=>rl,SchemaError:()=>_4,Result:()=>Ol,RegExp:()=>Cl,RedactedFromValue:()=>zl,Redacted:()=>gN,Record:()=>BN,ReadonlySet:()=>Ml,ReadonlyMap:()=>Rl,PropertyKey:()=>nK,OptionFromUndefinedOr:()=>Vl,OptionFromOptionalNullOr:()=>Ul,OptionFromOptionalKey:()=>Dl,OptionFromOptional:()=>Bl,OptionFromNullishOr:()=>ql,OptionFromNullOr:()=>_l,Option:()=>Y5,Opaque:()=>Fu,ObjectKeyword:()=>af,NumberFromString:()=>hl,Number:()=>e4,NullishOr:()=>zN,NullOr:()=>eK,Null:()=>iK,NonEmptyString:()=>Hl,NonEmptyArray:()=>Ju,Never:()=>of,MutableJson:()=>Sr,Literals:()=>tK,Literal:()=>X1,Json:()=>Er,Int:()=>YM,HashSet:()=>Al,HashMap:()=>Nl,FormData:()=>XM,FiniteFromString:()=>ml,Finite:()=>o2,File:()=>eN,Exit:()=>Pl,ErrorWithStack:()=>lN,ErrorClass:()=>DM,Error:()=>uN,Enum:()=>rf,DurationFromString:()=>El,DurationFromNanos:()=>vl,DurationFromMillis:()=>xl,Duration:()=>r2,DefectWithStack:()=>Ll,Defect:()=>Fl,DateValid:()=>iN,DateTimeZonedFromString:()=>Jr,DateTimeZoned:()=>_M,DateTimeUtcFromString:()=>tl,DateTimeUtcFromMillis:()=>el,DateTimeUtcFromDate:()=>sl,DateTimeUtc:()=>i2,DateFromString:()=>Il,Date:()=>GH,Class:()=>qM,Chunk:()=>wl,Char:()=>Wl,CauseReason:()=>rK,Cause:()=>oK,BooleanFromBit:()=>ol,Boolean:()=>qN,BigIntFromString:()=>dl,BigInt:()=>p2,BigDecimalFromString:()=>kl,BigDecimal:()=>sN,ArrayEnsure:()=>$u,Array:()=>c0,Any:()=>PQ});var $B=/^[+-]?\d+$/,p$="~effect/BigDecimal",kv={[p$]:p$,[H0](){let X=u$(this);return f0(s(X.value),c8(X.scale))},[W0](X){return f$(X)&&bv(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)}},f$=(X)=>M(X,p$),E6=(X,Q)=>{let Y=Object.create(kv);return Y.value=X,Y.scale=Q,Y},ZB=(X,Q)=>{if(X!==k8&&X%c$===k8)throw RangeError("Value must be normalized");let Y=E6(X,Q);return Y.normalized=Y,Y},k8=BigInt(0);var c$=BigInt(10),KB=ZB(k8,0);var u$=(X)=>{if(X.normalized===void 0)if(X.value===k8)X.normalized=KB;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=ZB(J,$)}return X.normalized},QY=B(2,(X,Q)=>{if(Q>X.scale)return E6(X.value*c$**BigInt(Q-X.scale),Q);if(Q<X.scale)return E6(X.value/c$**BigInt(X.scale-Q),Q);return X});var p5=S9((X,Q)=>{let Y=D1(GB(X),GB(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 GB=(X)=>X.value===k8?0:X.value<k8?-1:1,yv=(X)=>X.value<k8?E6(-X.value,X.scale):X;var l$=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}),bv=B(2,(X,Q)=>l$(X,Q));var HB=(X)=>{if(X==="")return F(KB);let Q,Y,J=X.search(/[eE]/);if(J!==-1){let H=X.slice(J+1);if(Q=X.slice(0,J),Y=Number(H),Q===""||!Number.isSafeInteger(Y)||!$B.test(H))return x()}else Q=X,Y=0;let $,G,Z=Q.search(/\./);if(Z!==-1){let H=Q.slice(0,Z),W=Q.slice(Z+1);$=`${H}${W}`,G=W.length}else $=Q,G=0;if(!$B.test($))return x();let K=G-Y;if(!Number.isSafeInteger(K))return x();return F(E6(BigInt($),K))};var y8=(X)=>{let Q=u$(X);if(Math.abs(Q.scale)>=16)return gv(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 H=K-J.length;$=`${J}${"0".repeat(H)}`,G=""}else G=J.slice(K),$=J.slice(0,K)}let Z=G===""?$:`${$}.${G}`;return Y?`-${Z}`:Z},gv=(X)=>{if(hv(X))return"0e+0";let Q=u$(X),Y=`${yv(Q).value}`,J=Y.slice(0,1),$=Y.slice(1),G=`${mv(Q)?"-":""}${J}`;if($!=="")G+=`.${$}`;let Z=$.length-Q.scale;return`${G}e${Z>=0?"+":""}${Z}`};var hv=(X)=>X.value===k8,mv=(X)=>X.value<k8;var _B="~effect/collections/Chunk";function dv(X,Q,Y,J,$){for(let G=Q;G<Math.min(X.length,Q+$);G++)Y[J+G-Q]=X[G];return Y}var VB=[],o$=(X)=>s0((Q,Y)=>Q.length===Y.length&&TX(Q).every((J,$)=>X(J,IX(Y,$)))),pv=o$(o),cv={[_B]:{_A:(X)=>X},toString(){return`Chunk(${g(TX(this))})`},toJSON(){return{_id:"Chunk",values:G1(TX(this))}},[a0](){return this.toJSON()},[W0](X){return YY(X)&&pv(this,X)},[H0](){return M9(TX(this))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return VB[Symbol.iterator]();default:return TX(this)[Symbol.iterator]()}},pipe(){return a(this,arguments)}},n$=(X)=>{let Q=Object.create(cv);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,_B),J4=n$({_tag:"IEmpty"}),fv=()=>J4;var uv=(X)=>n$({_tag:"ISingleton",a:X}),JY=(X)=>YY(X)?X:rv(Z1(X)),r$=(X,Q,Y)=>{switch(X.backing._tag){case"IArray":{dv(X.backing.array,0,Q,Y,X.length);break}case"IConcat":{r$(X.left,Q,Y),r$(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 lv=(X)=>{switch(X.backing._tag){case"IEmpty":return VB;case"IArray":return X.backing.array;default:{let Q=Array(X.length);return r$(X,Q,0),X.backing={_tag:"IArray",array:Q},X.left=J4,X.right=J4,X.depth=0,Q}}},TX=lv;var rv=(X)=>X.length===0?fv():X.length===1?uv(X[0]):n$({_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 qB=(X)=>X.length;var i$=y5,DB=I6,BB=GD,UB=ZD,OB=KD,zB=q$,a$=HD;var FB=k5;var LB=U$;var $Y=WD,PB=_D;var GY=VD;var s$=O$,jX=UX,RB=z$;var NB=F$,m4=qD;var MB=OX;var AB=R$;var wB=BD;var ZY=M$;var CB="~effect/encoding/EncodingError";class d4 extends XD("EncodingError"){[CB]=CB}var HY=(X)=>typeof X==="string"?e$(YG.encode(X)):e$(X),c5=(X)=>{let Q=bB(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 H=KY(Q.charCodeAt(Z))<<18|KY(Q.charCodeAt(Z+1))<<12|KY(Q.charCodeAt(Z+2))<<6|KY(Q.charCodeAt(Z+3));G[K]=H>>16,G[K+1]=H>>8&255,G[K+2]=H&255}return l(G)}catch($){return f(new d4({kind:"Decode",module:"Base64",input:Q,message:$ instanceof Error?$.message:"Invalid input"}))}},SB=(X)=>O6(c5(X),(Q)=>JG.decode(Q)),vB=(X)=>typeof X==="string"?IB(YG.encode(X)):IB(X),XG=(X)=>{let Q=bB(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,"/"),c5(J)},xB=(X)=>O6(XG(X),(Q)=>JG.decode(Q)),kB=(X)=>typeof X==="string"?jB(YG.encode(X)):jB(X),QG=(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=EB(Q[$*2]),Z=EB(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"}))}},yB=(X)=>O6(QG(X),(Q)=>JG.decode(Q)),YG=new TextEncoder,JG=new TextDecoder,bB=(X)=>X.replace(/[\n\r]/g,""),e$=(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>=TB.length)throw TypeError(`Invalid character ${String.fromCharCode(X)}`);let Q=TB[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","+","/"],TB=[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],IB=(X)=>e$(X).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),jB=(X)=>{let Q="";for(let Y=0;Y<X.length;++Y)Q+=nv[X[Y]];return Q},EB=(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")},nv=["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 _Y="~effect/collections/HashMap",B8=5,xX=1<<B8,iv=xX/4,hB=xX/2,av=xX-1,sv=(X)=>{return X=X-(X>>>1&1431655765),X=(X&858993459)+(X>>>2&858993459),(X+(X>>>4)&252645135)*16843009>>>24},EX=(X,Q)=>X>>>Q&av,p4=(X,Q)=>1<<EX(X,Q),WY=(X,Q)=>sv(X&Q-1);function mB(X,Q,Y,J,$,G){if(Q>32)throw Error("HashMap: max depth exceeded");let Z=p4(Y,Q),K=p4($,Q);if(Z===K){let V=mB(X,Q+B8,Y,J,$,G);return new b8(X,Z,[V])}let H=Z|K,W=Z>>>0<K>>>0?[J,G]:[G,J];return new b8(X,H,W)}class f5{canEdit(X){return this.edit===X}}class dB extends f5{_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 f5{_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=p4(Y,Q),K=p4(this.hash,Q);if(Z===K)return new b8(X,Z,[this.set(X,Q+B8,Y,J,$,G)]);let H=Z|K,W=Z>>>0<K>>>0?[new G4(X,Y,J,$),this]:[this,new G4(X,Y,J,$)];return new b8(X,H,W)}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 f5{_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,mB(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 f5{_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=p4(Q,X);if((this.bitmap&J)===0)return x();let $=WY(this.bitmap,J);return this.children[$].get(X+B8,Q,Y)}has(X,Q,Y){let J=p4(Q,X);if((this.bitmap&J)===0)return!1;let $=WY(this.bitmap,J);return this.children[$].has(X+B8,Q,Y)}set(X,Q,Y,J,$,G){let Z=p4(Y,Q),K=WY(this.bitmap,Z);if((this.bitmap&Z)!==0){let H=this.children[K],W=H.set(X,Q+B8,Y,J,$,G);if(H===W)return this;if(this.canEdit(X))return this.children[K]=W,this;let V=[...this.children];return V[K]=W,new b8(X,this.bitmap,V)}else{G.value=!0;let H=new G4(X,Y,J,$),W=this.bitmap|Z;if(this.canEdit(X)){if(this.children.splice(K,0,H),this.bitmap=W,this._size=void 0,this.children.length>hB)return this.expand(X,W,this.children);return this}let V=[...this.children];if(V.splice(K,0,H),V.length>hB)return this.expand(X,W,V);return new b8(X,W,V)}}remove(X,Q,Y,J,$){let G=p4(Y,Q);if((this.bitmap&G)===0)return this;let Z=WY(this.bitmap,G),K=this.children[Z],H=K.remove(X,Q+B8,Y,J,$);if(!$.value)return this;if(H===void 0){let V=this.bitmap^G;if(V===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=V,this._size=void 0,this;let _=[...this.children];return _.splice(Z,1),new b8(X,V,_)}if(K===H)return this;if(this.canEdit(X))return this.children[Z]=H,this;let W=[...this.children];return W[Z]=H,new b8(X,this.bitmap,W)}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 f5{_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 H=K.set(X,Q+B8,Y,J,$,G);if(K===H)return this;if(this.canEdit(X))return this.children[Z]=H,this;let W=[...this.children];return W[Z]=H,new vX(X,this.count,W)}else{G.value=!0;let H=new G4(X,Y,J,$);if(this.canEdit(X))return this.children[Z]=H,this.count++,this._size=void 0,this;let W=[...this.children];return W[Z]=H,new vX(X,this.count+1,W)}}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 H=this.count-(K?0:1);if(H<iv)return this.pack(X,G,K);if(Z===K)return this;if(this.canEdit(X)){if(this.children[G]=K,!K)this.count=H;return this._size=void 0,this}let W=[...this.children];return W[G]=K,new vX(X,H,W)}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 VY{[_Y]=_Y;_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()}[W0](X){if($G(X)){let Q=X;if(this.size!==Q.size)return!1;for(let[Y,J]of this){let $=$3(X,fB(Y));if(T0($)||!o(J,$.value))return!1}return!0}return!1}[H0](){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 pB=new dB,$G=(X)=>M(X,_Y),GG=()=>new VY(!1,0,pB,0);var cB=(X)=>{let Q=pB,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 VY(!1,0,Q,Y)};var fB=B(2,(X,Q)=>{return X._root.get(0,s(Q),Q)});var ZG=B(2,(X,Q)=>{return X._root.has(0,s(Q),Q)});var KG=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 VY(!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 uB=(X)=>{let Q=X[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){return Q.next()}}},qY=(X)=>X.size;var rB=$G;var DY=cB;var Xx=uB,BY=(X)=>Array.from(Xx(X)),oB=qY;var kX="~effect/collections/HashSet",Yx={[H0](){return s(kX)},[W0](X){return WG(X)&&UY(this)===UY(X)&&aB(this,(Q)=>iB(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)}},Jx=(X)=>{let Q=Object.create(Yx);return Q[kX]=kX,Q.keyMap=X,Q},WG=(X)=>M(X,kX),_G=(X)=>X.keyMap;var nB=(X)=>{let Q=GG();for(let Y of X)Q=KG(Q,Y,!0);return Jx(Q)},iB=(X,Q)=>ZG(_G(X),Q);var UY=(X)=>qY(_G(X));var aB=(X,Q)=>{for(let Y of X)if(!Q(Y))return!1;return!0};var OY=nB,sB=WG;var tB=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 u5=zY("identifier"),VG=zY("title");var eB=zY("brands"),FY=p0((X)=>{let Q=u5(X);if(typeof Q==="string")return Q;return X.getExpected(FY)});var xe=globalThis.Boolean;var XU=o8((X,Q)=>X||Q,!1);function l5(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 ke=globalThis.RegExp;var LY=(X)=>X.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&");var v6=new WeakMap,YU=(X)=>{if(v6.has(X))return v6.get(X);else throw Error("Unable to get redacted value"+(X.label?` with label: "${X.label}"`:""))};var JU="~effect/data/Redacted",qG=(X)=>M(X,JU),Z4=(X,Q)=>{let Y=Object.create(Wx);if(Q?.label)Y.label=Q.label;return v6.set(Y,X),Y},Wx={[JU]:{_A:(X)=>X},label:void 0,...w8,toJSON(){return this.toString()},toString(){return`<redacted${Q8(this.label)?":"+this.label:""}>`},[H0](){return s(v6.get(this))},[W0](X){return qG(X)&&o(v6.get(this),v6.get(X))}},PY=YU;var $U=(X)=>s0((Q,Y)=>X(PY(Q),PY(Y)));var DG="~effect/SchemaIssue/Issue";function _x(X){return M(X,DG)}class s1{[DG]=DG;toString(){return qx(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 OG 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 r5 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 zG extends s1{_tag="OneOf";ast;actual;successes;constructor(X,Q,Y){super();this.ast=X,this.actual=Q,this.successes=Y}}function BG(X,Q){if(_x(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 KU(X,Q){if(Q===void 0)return;if(typeof Q==="boolean")return Q?void 0:new Z0(F(X));return BG(X,Q)}function HU(X,Q,Y){if(Array.isArray(Y)){if(z6(Y)){if(Y.length===1)return BG(X,Y[0]);return new q0(Q,F(X),j4(Y,(J)=>BG(X,J)))}return}return KU(X,Y)}var WU=(X)=>{let Q=bX(X);if(Q!==void 0)return Q;switch(X._tag){case"InvalidType":return UG(FY(X.ast),ZU(X.actual));case"InvalidValue":return`Invalid data ${ZU(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)}`}},_U=(X)=>{return bX(X.issue)??bX(X)};function VU(X){return(Q)=>({issues:x6(Q,[],X?.leafHook??WU,X?.checkHook??_U)})}function UG(X,Q){return`Expected ${X}, got ${Q}`}function x6(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:UG(qU(X.filter),g(X.actual))}];default:return x6(X.issue,Q,Y,J)}}case"Encoding":return x6(X.issue,Q,Y,J);case"Pointer":return x6(X.issue,[...Q,...X.path],Y,J);case"Composite":return X.issues.flatMap(($)=>x6($,Q,Y,J));case"AnyOf":{let $=bX(X);if(X.issues.length===0){if($!==void 0)return[{path:Q,message:$}];let G=UG(FY(X.ast),g(X.actual));return[{path:Q,message:G}]}return X.issues.flatMap((G)=>x6(G,Q,Y,J))}default:return[{path:Q,message:Y(X)}]}}function qU(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)=>qU(Y)).join(" & ")}}function Vx(){return(X)=>x6(X,[],WU,_U).map(Dx).join(`
|
|
27
|
+
`)}var qx=Vx();function Dx(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 ZU(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 r5(T4(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(T4(X.actual,Z4));case"AnyOf":case"OneOf":case"UnexpectedKey":return new Z0(F(Z4(X.actual)))}}class K4 extends $6{run;constructor(X){super();this.run=X}map(X){return new K4((Q,Y)=>this.run(Q,Y).pipe(m5(T4(X))))}compose(X){if(DU(this))return X;if(DU(X))return this;return new K4((Q,Y)=>this.run(Q,Y).pipe(D8((J)=>X.run(J,Y))))}}function Bx(X){return new K4((Q)=>v(X(Q)))}function FG(X){return Bx((Q)=>new r5(Q,{message:X(Q)}))}var BU=new K4(h);function DU(X){return X.run===BU.run}function T1(){return BU}function LG(X){return new K4((Q,Y)=>T0(Q)?x8:X(Q.value,Y))}function n(X){return wY(T4(X))}function I1(X){return LG((Q,Y)=>X(Q,Y).pipe(m5(F)))}function wY(X){return new K4((Q)=>h(X(Q)))}function PG(){return new K4(()=>x8)}function mX(X){return new K4((Q)=>{let Y=F5(Q,$1);return B1(Y)?h(Y):AX(X,F)})}function k6(){return n(globalThis.String)}function CY(){return n(globalThis.Number)}function UU(){return n(globalThis.BigInt)}function OU(){return n((X)=>new globalThis.Date(X))}function zU(){return n(LD)}function FU(X){return LG((Q)=>h4({try:()=>F(JSON.parse(Q,X?.reviver)),catch:(Y)=>new Z0(F(Q),{message:globalThis.String(Y)})}))}function LU(X){return LG((Q)=>h4({try:()=>F(JSON.stringify(Q,X?.replacer,X?.space)),catch:(Y)=>new Z0(F(Q),{message:globalThis.String(Y)})}))}function PU(X){let Q=X?.separator??",";return n((Y)=>Y===""?[]:Y.split(Q))}function RG(){return n(HY)}function TY(){return n(vB)}function IY(){return n(kB)}function RU(){return I1((X)=>v9(c5(X),(Q)=>new Z0(F(X),{message:Q.message})).asEffect())}function NU(){return I1((X)=>I8(SB(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function MU(){return I1((X)=>I8(XG(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function AU(){return I1((X)=>I8(xB(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function wU(){return I1((X)=>I8(QG(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function CU(){return I1((X)=>I8(yB(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function TU(){return n(encodeURIComponent)}function IU(){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 NG(){return I1((X)=>{return G8($Y(X),{onNone:()=>v(new Z0(F(X),{message:"Invalid DateTime input"})),onSome:(Q)=>h(GY(Q))})})}function jU(){return n((X)=>xU(Array.from(X.entries())))}var Ux=kU((X)=>typeof X==="string"||typeof Blob<"u"&&X instanceof Blob);function EU(){return n((X)=>{let Q=new FormData;if(typeof X==="object"&&X!==null)Ux(X).forEach(([J,$])=>{Q.append(J,$)});return Q})}function SU(){return n((X)=>xU(Array.from(X.entries())))}var Ox=kU(Q8);function vU(){return n((X)=>{if(typeof X==="object"&&X!==null)return new URLSearchParams(Ox(X));return new URLSearchParams})}var zx=/^\d+$/;function Fx(X){if(X==="")return[""];let Q=X.replace(/\[(.*?)\]/g,".$1"),Y=Q.split("."),J=Q.startsWith(".")?1:0;return Y.slice(J).map(($)=>zx.test($)?globalThis.Number($):$)}function xU(X){let Q={};return X.forEach(([Y,J])=>{let $=Fx(Y),G=Q;$.forEach((Z,K)=>{let H=K===$.length-1;if(Array.isArray(G)&&Z==="")if(H)G.push(J);else{let W=$[K+1],V=typeof W==="number"||W==="",_=G.length;if(G[_]===void 0)G[_]=V?[]:{};G=G[_]}else if(H)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 W=$[K+1],V=typeof W==="number"||W==="";if(G[Z]===void 0)G[Z]=V?[]:{};G=G[Z]}})}),Q}function kU(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,H)=>{J(`${$}[${H}]`,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 dX{_tag="Middleware";decode;encode;constructor(X,Q){this.decode=X,this.encode=Q}flip(){return new dX(this.encode,this.decode)}}var AG="~effect/SchemaTransformation/Transformation";class K0{[AG]=AG;_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 Lx(X){return M(X,AG)}var jY=(X)=>{if(Lx(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 yU(){return new K0(zU(),T1())}var Px=new K0(T1(),T1());function y6(){return Px}var o5=new K0(CY(),k6()),SY=new K0(UU(),k6()),wG=new K0(OU(),n(z3)),bU=t1({decode:(X)=>G8(CW(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid Duration string: ${X}`})),onSome:h}),encode:(X)=>h(globalThis.String(X))}),gU=t1({decode:(X)=>h(a8(X)),encode:(X)=>G8(TW(X),{onNone:()=>v(new Z0(F(X),{message:`Unable to encode ${X} into a bigint`})),onSome:(Q)=>h(Q)})}),hU=v0({decode:(X)=>E4(X),encode:(X)=>S4(X)}),pX=(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 mU(){return v0({decode:GW,encode:T3})}function dU(){return v0({decode:$W,encode:D6})}function pU(X){return v0({decode:JW,encode:X?.onNoneEncoding===null?T3:D6})}function cU(){return EY({decode:F,encode:z5})}function fU(){return EY({decode:(X)=>X.pipe(F5($1),F),encode:z5})}var CG=t1({decode:(X)=>h4({try:()=>new URL(X),catch:()=>new Z0(F(X),{message:`Invalid URL string: ${X}`})}),encode:(X)=>h(X.href)}),TG=t1({decode:(X)=>{let Q=HB(X);return T0(Q)?v(new Z0(F(X),{message:`Invalid BigDecimal string: ${X}`})):h(Q.value)},encode:(X)=>h(y8(X))}),IG=new K0(RU(),RG()),uU=new K0(NU(),RG()),lU=new K0(AU(),TY()),rU=new K0(CU(),IY()),oU=new K0(IU(),TU()),nU=new K0(FU(),LU()),iU=new K0(jU(),EU()),aU=new K0(SU(),vU()),sU=v0({decode:(X)=>jX(X),encode:(X)=>X.offset}),jG=t1({decode:(X)=>{return G8(RB(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid IANA time zone: ${X}`})),onSome:h})},encode:(X)=>h(X.id)}),EG=t1({decode:(X)=>{return G8(NB(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid time zone: ${X}`})),onSome:h})},encode:(X)=>h(m4(X))}),SG=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(wB(X))}),vG=t1({decode:(X)=>{return G8(PB(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid Zoned DateTime string: ${X}`})),onSome:h})},encode:(X)=>h(ZY(X))});function g6(X){return(Q)=>Q._tag===X}function ZO(X){return M(X,fX)&&X[fX]===fX}var g8=g6("Declaration");var Rx=g6("Never");var vY=g6("Literal"),Nx=g6("UniqueSymbol");var kY=g6("Arrays"),KO=g6("Objects"),yY=g6("Union");class B0{to;transformation;constructor(X,Q){this.to=X,this.transformation=Q}}var i5={};class H4{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 h6 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 m5(X(Q.value,this,Y),F)}}recur(X){let Q=n5(this.typeParameters,X);return Q===this.typeParameters?this:new h6(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 HO extends k0{_tag="Null";getParser(){return eX(this,null)}getExpected(){return"null"}}var a5=new HO;class WO extends k0{_tag="Undefined";getParser(){return eX(this,void 0)}toCodecJson(){return D0(this,[_O])}getExpected(){return"undefined"}}var _O=new B0(a5,new K0(n(()=>{return}),n(()=>null))),kG=new WO;class VO extends k0{_tag="Void";getParser(){return eX(this,void 0)}toCodecJson(){return D0(this,[_O])}getExpected(){return"void"}}var qO=new VO;class DO extends k0{_tag="Never";getParser(){return F8(this,IH)}getExpected(){return"never"}}var BO=new DO;class UO extends k0{_tag="Any";getParser(){return F8(this,Z3)}getExpected(){return"any"}}var OO=new UO;class zO extends k0{_tag="Unknown";getParser(){return F8(this,Z3)}getExpected(){return"unknown"}}var b6=new zO;class FO extends k0{_tag="ObjectKeyword";getParser(){return F8(this,K3)}getExpected(){return"object | array | function"}}var LO=new FO;class yG 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]),k6()))])}return this}getExpected(){return this.enums.map(([X,Q])=>JSON.stringify(Q)).join(" | ")}}function PO(X){switch(X._tag){case"String":case"Number":case"BigInt":case"Literal":case"TemplateLiteral":return!0;case"Union":return X.types.every(PO);default:return!1}}class bG 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(PO(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 W4(!1,this.parts.map(oO),[]),Q=oY(this);return rY(m6,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 gG 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,[aO])}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"?eU(this):this}toCodecStringTree(){return typeof this.literal==="string"?this:eU(this)}getExpected(){return typeof this.literal==="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}}function eU(X){let Q=globalThis.String(X.literal);return D0(X,[new B0(new b1(Q),new K0(n(()=>X.literal),n(()=>Q)))])}class RO extends k0{_tag="String";getParser(){return F8(this,Q8)}getExpected(){return"string"}}var m6=new RO;class NO 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,[Ex])}toCodecStringTree(){if(this.checks&&(cX(this.checks,"isFinite")||cX(this.checks,"isInt")))return D0(this,[kx]);return D0(this,[yx])}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 hG=new NO;class MO extends k0{_tag="Boolean";getParser(){return F8(this,wH)}getExpected(){return"boolean"}}var AO=new MO;class wO extends k0{_tag="Symbol";getParser(){return F8(this,G3)}toCodecStringTree(){return D0(this,[aO])}getExpected(){return"symbol"}}var CO=new wO;class TO extends k0{_tag="BigInt";getParser(){return F8(this,CH)}toCodecStringTree(){return D0(this,[bx])}getExpected(){return"bigint"}}var IO=new TO;class W4 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((H)=>!E0(H))||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((W)=>({ast:W,parser:X(W)})),J=Q.rest.map((W)=>({ast:W,parser:X(W)})),$=Y.length,[G,...Z]=J,K=Z.length;function H(W,V){if(V<$)return Y[V];else if(V>=W)return Z[V-W];return G}return CX(function*(W,V){if(W._tag==="None")return W;let _=W.value;if(!Array.isArray(_))return yield*v(new x0(Q,W));let q=_.length,D={ast:Q,getParser:H,oinput:W,len:q,tailThreshold:Ax(q,$,K),output:new globalThis.Array(q),issues:void 0,options:V},U=mG(V?.concurrency),R=Mx(D,_,{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,_[L]));if(V.errors==="all")if(D.issues)D.issues.push(N);else D.issues=[N];else return yield*v(new q0(Q,W,[N]))}if(D.issues)return yield*v(new q0(Q,W,D.issues));return F(D.output)})}recur(X){let Q=n5(this.elements,X),Y=n5(this.rest,X);return Q===this.elements&&Y===this.rest?this:new W4(this.isMutable,Q,Y,this.annotations,this.checks,void 0,this.context)}getExpected(){return"array"}}var Mx=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 x5(new q0(X.ast,X.oinput,[G]))}}});function Ax(X,Q,Y){return Math.max(Q,X-Y)}var mG=(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 x5(new q0(Q,X.oinput,[G]))},lX="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",wx=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)=>wx.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)&&!cO(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,H,W)=>W.indexOf(K)!==H);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,[H,W]){let _=X(rO(W.parameter))(F(H),K.options),q=H1(_)?_:yield*MX(_);if(q._tag==="Failure"){let N=xY(K,Q,H,q);if(N)yield*N;return}let D=F(K.input[H]),R=X(W.type)(D,K.options),L=H1(R)?R:yield*MX(R);if(L._tag==="Failure"){let N=xY(K,Q,H,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(W.merge&&W.merge.decode&&Object.hasOwn(K.out,N)){let[y,Y0]=W.merge.decode.combine([N,K.out[N]],[N,P]);l5(K.out,y,Y0)}else l5(K.out,N,P)}}),step:(K,H,W)=>W._tag==="Failure"?W:void 0}):void 0;return CX(function*(K,H){if(K._tag==="None")return K;let W=K.value;if(!(typeof W==="object"&&W!==null&&!Array.isArray(W)))return yield*v(new x0(Q,K));let V={},_={ast:Q,oinput:K,input:W,out:V,issues:void 0,options:H},q=H.errors==="all",D=H.onExcessProperty==="error",U=H.onExcessProperty==="preserve",R;if(Q.indexSignatures.length===0&&(D||U)){R=Reflect.ownKeys(W);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,W[y]));if(q){if(_.issues)_.issues.push(Y0);else _.issues=[Y0];continue}else return yield*v(new q0(Q,K,[Y0]))}else l5(V,y,W[y])}}let L=mG(H?.concurrency),N=Cx(_,$,L);if(N)yield*N;if(Z){let P=y3();for(let Y0=0;Y0<G;Y0++){let X8=Q.indexSignatures[Y0],$5=d6(W,X8.parameter);for(let V1=0;V1<$5.length;V1++){let kA=$5[V1];P.push([kA,X8])}}let y=Z(_,P,L);if(y)yield*y}if(_.issues)return yield*v(new q0(Q,K,_.issues));if(H.propertyOrder==="original"){let P=(R??Reflect.ownKeys(W)).concat(Y),y={};for(let Y0 of P)if(Object.hasOwn(V,Y0))l5(y,Y0,V[Y0]);return F(y)}return F(V)})}rebuild(X,Q){let Y=n5(this.propertySignatures,($)=>{let G=X($.type);return G===$.type?$:new bY($.name,G)}),J=n5(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 Cx=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")l5(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 x5(new q0(X.ast,X.oinput,[J]))}}});function Tx(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 pG(X,Q=void 0){return new W4(!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 jO(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),$=Tx($,G);return new rX(Y,J,void 0,$)}function EO(X,Q){if(X.encoding)throw Error("TupleWithRest does not support encodings");return new W4(X.isMutable,X.elements,Q,void 0,X.checks)}function SO(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(SO)));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(Nx(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 XO=new WeakMap;function Ix(X){let Q=XO.get(X);if(Q)return Q;Q={};for(let Y of X){let J=J1(Y);if(Rx(J))continue;let $=SO(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 H=Q.bySentinel.get(Z);if(!H)Q.bySentinel.set(Z,H=new Map);let W=H.get(K);if(!W)H.set(K,W=[]);W.push(Y)}}else{Q.otherwise??={};for(let Z of $)(Q.otherwise[Z]??=[]).push(Y)}}return XO.set(X,Q),Q}function QO(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=Ix(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(QO(X))}}return $}return(Y.byType?.[J]??[]).filter(QO(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=mG(J?.concurrency),H=jx(Z,G,K);if(!H)return Z.out?h(Z.out):v(new AY(Q,$,Z.issues??[]));return NX(H,(W)=>{return Z.out?h(Z.out):v(new AY(Q,$,Z.issues??[]))})}}recur(X){let Q=n5(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`${YO($.isMutable)}[ ${G.map((Z)=>X(Z)+JO(Z.context?.isOptional)).join(", ")}, ... ]`;break}case"Objects":{let G=$.propertySignatures.filter((Z)=>vY(Z.type));if(G.length>0)return`{ ${G.map((Z)=>`${YO(Z.type.context?.isMutable)}${R4(Z.name)}${JO(Z.type.context?.isOptional)}: ${X(Z.type)}`).join(", ")}, ... }`;break}}return X($)});return Array.from(new Set(Y)).join(" | ")}}var jx=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),x5(new zG(X.ast,X.input,X.successes));if(X.out=Y.value,X.successes.push(Q),X.ast.mode==="anyOf")return G$}}}),vO=new g1([new b1("Infinity"),new b1("-Infinity"),new b1("NaN")],"anyOf"),Ex=new B0(new g1([hG,vO],"anyOf"),new K0(CY(),n((X)=>globalThis.Number.isFinite(X)?X:globalThis.String(X))));function YO(X){return X?"":"readonly "}function JO(X){return X?"?":""}function p6(X){let Q=!1,Y;return()=>{if(Q)return Y;return Y=X(),Q=!0,Y}}class dY extends k0{_tag="Suspend";thunk;constructor(X,Q,Y,J,$){super(Q,Y,J,$);this.thunk=p6(X)}getParser(X){return X(this.thunk())}recur(X){return new dY(()=>X(this.thunk()),this.annotations,this.checks,void 0,this.context)}getExpected(X){return X(this.thunk())}}class uX extends $6{_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 c4([this,X],Q)}}class c4 extends $6{_tag="FilterGroup";checks;annotations;constructor(X,Q=void 0){super();this.checks=X,this.annotations=Q}annotate(X){return new c4(this.checks,{...this.annotations,...X})}and(X,Q){return new c4([this,X],Q)}}function cG(X,Q,Y=!1){return new uX((J,$,G)=>HU(J,$,X(J,$,G)),Q,Y)}function pY(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 cG((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 c6(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 f4(X,Q){return uY(X,X.checks?[...X.checks,...Q]:Q)}function xO(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 kO(X){return(Q)=>Q.encoding?D0(Q,xO(Q.encoding,X)):Q}function yO(X,Q){return fG(X,Q,z8(X))}function bO(X,Q){return fG(J1(X),Q,X)}function fG(X,Q,Y){let J=new B0(X,Q);return D0(Y,Y.encoding?[...Y.encoding,J]:[J])}function gO(X,Q){let Y=eB(X),J=Y?[...Y,Q]:[Q];return c6(X,{brands:J})}function n5(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 H4(X.context.isOptional,X.context.isMutable,X.context.defaultValue,{...X.context.annotations,...Q}):new H4(!1,!1,void 0,Q);return fY(X,Y)}var s5=kO(lY);function lY(X){let Q=X.context?X.context.isOptional===!1?new H4(!0,X.context.isMutable,X.context.defaultValue,X.context.annotations):X.context:new H4(!0,!1);return s5(fY(X,Q))}var Sx=kO(uG);function uG(X){let Q=X.context?X.context.isMutable===!1?new H4(X.context.isOptional,!0,X.context.defaultValue,X.context.annotations):X.context:new H4(!1,!0);return Sx(fY(X,Q))}function hO(X,Q){let Y=new K0(mX(Q),T1()),J=[new B0(b6,Y)],$=X.context?new H4(X.context.isOptional,X.context.isMutable,J,X.context.annotations):new H4(!1,!1,J);return fY(X,$)}function rY(X,Q,Y){return fG(X,Y,Q)}function mO(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=mO(X.types[Y]);Q.literals=Q.literals.concat(J.literals),Q.parameters=Q.parameters.concat(J.parameters)}return Q}}return{literals:[],parameters:[]}}function dO(X,Q,Y){let{literals:J,parameters:$}=mO(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 pO(X){return X.context?.isMutable??!1}var z8=p0((X)=>{if(X.encoding)return z8(D0(X,void 0));let Q=X;return Q.recur?.(z8)??Q}),J1=p0((X)=>{return z8(O8(X))});function vx(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=p0((X)=>{if(X.encoding)return vx(X,X.encoding);let Q=X;return Q.flip?.(O8)??Q.recur?.(O8)??Q});function cO(X){switch(X._tag){case"Undefined":return!0;case"Union":return X.types.some(cO);default:return!1}}function fO(X,Q){return X.encodedParts.map((Y)=>xx(Y,uO(Y),Q)).join("")}var oY=p0((X)=>{return new globalThis.RegExp(`^${fO(X,!0)}$`)});function uO(X){switch(X._tag){case"Literal":return LY(globalThis.String(X.literal));case"String":return lG;case"Number":return lX;case"BigInt":return iO;case"TemplateLiteral":return fO(X,!1);case"Union":return X.types.map(uO).join("|")}}function xx(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 lO=p0((X)=>{return new g1(X.enums.map((Q)=>new b1(Q[1],{title:Q[0]})),"anyOf")});function f6(X){function Q(Y){return Y.encoding?D0(Y,xO(Y.encoding,Q)):X(Y)}return p0(Q)}var rO=f6((X)=>{switch(X._tag){default:return X;case"Number":return X.toCodecStringTree();case"Union":return X.recur(rO)}}),oO=f6((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(oO)}}),lG="[\\s\\S]*?",$O=new globalThis.RegExp(`^${lX}$`);function rG(X){return aX($O,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:$O},...X})}var nO=f4(m6,[rG()]),kx=new B0(nO,o5),yx=new B0(new g1([nO,vO],"anyOf"),o5),iO="-?\\d+",GO=new globalThis.RegExp(`^${iO}$`);function oG(X){return aX(GO,{expected:"a string representing a bigint",meta:{_tag:"isStringBigInt",regExp:GO},...X})}var nG=f4(m6,[oG({expected:"a string representing a bigint"})]),bx=new B0(nG,SY),gx="Symbol\\((.*)\\)",xG=new globalThis.RegExp(`^${gx}$`),hx=f4(m6,[iG()]),aO=new B0(hx,new K0(n((X)=>globalThis.Symbol.for(xG.exec(X)[1])),I1((X)=>{if(globalThis.Symbol.keyFor(X)!==void 0)return h(globalThis.String(X));return v(new r5(F(X),{message:"cannot serialize to string, Symbol is not registered"}))})));function iG(X){return aX(xG,{expected:"a string representing a symbol",meta:{_tag:"isStringSymbol",regExp:xG},...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 sO(X,Q){let Y=[];if(XQ(X,Q,Y,b6,{errors:"all"}),W8(Y)){let J=new q0(b6,F(Q),Y);return f(J)}return l(Q)}var t5="~effect/Schema/Class",h1="~structural";function mx(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 h6([],()=>(X,Q)=>mx(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(b6,y6())}),tO=c6(nY,{typeConstructor:{_tag:"effect/MutableJson"},generation:{runtime:"Schema.MutableJson",Type:"Schema.MutableJson"}}),eO=new B0(a5,new K0(T1(),n(()=>null))),Xz=new B0(nY,y6());function dx(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 px=new h6([],()=>(X,Q)=>dx(X)?h(X):v(new x0(Q,F(X))),{expected:"StringTree",toCodecStringTree:()=>new B0(b6,y6())}),Qz=new B0(px,y6());var Yz=B(2,(X,Q)=>{return sG(X,(Y,J)=>Q.includes(Y)?[Y,J]:void 0)}),Jz=B(2,(X,Q)=>{return sG(X,(Y,J)=>!Q.includes(Y)?[Y,J]:void 0)}),$z=B(2,(X,Q)=>{return{...X,...Q}});var aG=B(2,(X,Q)=>{return sG(X,(Y,J)=>[Object.hasOwn(Q,Y)?Q[Y]:Y,J])});var W1=(X)=>X;function sG(X,Q){let Y={};for(let J in X){let $=Q(J,X[J]);if($){let[G,Z]=$;Y[G]=Z}}return Y}function Gz(X,Q){let Y=Q?.omitKeyWhen??(()=>!1);return cH((J,$)=>{let G=Reflect.ownKeys(X),Z={};for(let K of G){let H=X[K].combine(J[K],$[K]);if(Y(H))continue;Z[K]=H}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 Zz=new WeakMap;function Kz(X,Q,Y){return Q.map((J)=>($)=>J.run($,X,i5)===void 0).reduce((J,$)=>J.filter($),Y)}function fx(X){return X?.comparator!==void 0}function Hz(X,Q,Y){let J=Q.constraints?.array,$=fx(J)?X.uniqueArray(Y,J):X.array(Y,J);if(Q.isSuspend)return X.oneof({maxDepth:2,depthIdentifier:""},X.constant([]),$);return $}var Wz=QQ(zD),_z=QQ(FD),u4=QQ(XU),ux=QQ(NW()),lx=Gz({isInteger:u4,max:_z,maxExcluded:u4,maxLength:_z,min:Wz,minExcluded:u4,minLength:Wz,noDefaultInfinity:u4,noInteger:u4,noInvalidDate:u4,noNaN:u4,patterns:ux,comparator:u4},{omitKeyWhen:TH});function rx(X,Q,Y){let J=Q[X];return{...Q,[X]:J?lx.combine(J,Y):Y}}var ox={string:null,number:null,bigint:null,array:null,date:null};function nx(X){return X in ox}function Vz(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(nx(K))$=rx(K,$,G[K]);return $},Y.constraints||{});return{...Y,constraints:J}}}function eG(X){return{...X,constraints:void 0}}function XZ(X){if(X)return X.flatMap((Q)=>{switch(Q._tag){case"Filter":return[Q];case"FilterGroup":return XZ(Q.checks)}});return[]}var qz=p0((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)):[],$=XZ(X.checks),G=Vz($);return(Z,K)=>Kz(X,$,Y(J.map((H)=>H(Z,eG(K))))(Z,G(K)))}if(X.checks){let J=XZ(X.checks),$=Vz(J),G=L8(uY(X,void 0),Q);return(Z,K)=>Kz(X,J,G(Z,$(K)))}return ix(X,Q)}function ix(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(lO(X),Q);case"TemplateLiteral":return(Y)=>Y.stringMatching(oY(X));case"Arrays":return(Y,J)=>{let $=eG(J),G=X.elements.map((K,H)=>{let W=L8(K,[...Q,H])(Y,$);if(!E0(K))return W.map(F);return W.chain((V)=>Y.boolean().map((_)=>_?F(V):x()))}),Z=Y.tuple(...G).map(RW);if(z6(X.rest)){let K=X.elements.length,[H,...W]=X.rest.map((_,q)=>L8(_,[...Q,K+q])(Y,$)),V=Hz(Y,X.elements.length===0?J:$,H);if(Z=Z.chain((_)=>{if(_.length<K)return Y.constant(_);return V.map((q)=>[..._,...q])}),W.length>0){let _=Y.tuple(...W);Z=Z.chain((q)=>{if(q.length<K)return Y.constant(q);return _.map((D)=>[...q,...D])})}}return Z};case"Objects":return(Y,J)=>{let $=eG(J),G={},Z=[];for(let H of X.propertySignatures){let W=H.name;if(!E0(H.type))Z.push(W);G[W]=L8(H.type,[...Q,W])(Y,$)}let K=Y.record(G,{requiredKeys:Z});for(let H of X.indexSignatures){let W=Y.tuple(L8(H.parameter,Q)(Y,$),L8(H.type,Q)(Y,$)),V=Hz(Y,X.propertySignatures.length===0?J:$,W);K=K.chain((_)=>{return V.map((q)=>{return{...Object.fromEntries(q),..._}})})}return K};case"Union":return(Y,J)=>Y.oneof(...X.types.map(($)=>L8($,Q)(Y,J)));case"Suspend":{let Y=Zz.get(X);if(Y)return Y;let J=p6(()=>L8(X.thunk(),Q)),$=(G,Z)=>G.constant(null).chain(()=>J()(G,{...Z,isSuspend:!0}));return Zz.set(X,$),$}}}var YQ=p0((X)=>{switch(X._tag){case"Declaration":{let Q=X.annotations?.[t5];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 e5(X){let Q=YQ(z8(X.ast)),Y=X9(Q);return(J,$)=>{return Y(J,$?.disableChecks?$?.parseOptions?{...$.parseOptions,disableChecks:!0}:{disableChecks:!0}:$?.parseOptions)}}function sY(X){let Q=e5(X);return(Y,J)=>{return c7(e7(Q(Y,J)))}}function Dz(X){let Q=e5(X);return(Y,J)=>{return wX(y1(Q(Y,J),($)=>Error($.toString(),{cause:$})))}}function Bz(X){return JQ(X.ast)}function JQ(X){let Q=Q9(X9(z8(X)));return(Y)=>{return V8(Q(Y,i5))}}function Uz(X){let Q=X9(X);return(Y,J)=>{return wX(g$(Q(Y,J),{onSuccess:()=>{return},onFailure:b}))}}function Oz(X){let Q=Q9(X9(z8(X.ast)));return(Y)=>{let J=Q(Y,i5);if(Z$(J)){let $=S8(J.cause);if(u($))throw T6($.failure);throw Error($.success.toString(),{cause:$.success})}}}function y0(X){return X9(X.ast)}var tY=y0;function zz(X){return HZ(y0(X))}function Fz(X){return HZ(tY(X))}function Lz(X){return Q9(y0(X))}function QZ(X){return Cz(y0(X))}var Pz=QZ;function YZ(X){return Tz(y0(X))}var Rz=YZ;function JZ(X){return Iz(y0(X))}var eY=JZ;function l6(X){return X9(O8(X.ast))}var $Z=(X)=>HZ(l6(X)),Nz=$Z;function Mz(X){return Q9(l6(X))}function GZ(X){return Cz(l6(X))}var Az=GZ;function ZZ(X){return Tz(l6(X))}var wz=ZZ;function KZ(X){return Iz(l6(X))}var X2=KZ;function X9(X){let Q=aY(X);return(Y,J)=>D8(Q(F(Y),J??i5),($)=>{if($._tag==="None")return v(new Z0($));return h($.value)})}function HZ(X){return(Q,Y)=>m$(X(Q,Y))}function Q9(X){return(Q,Y)=>e7(X(Q,Y))}function Cz(X){let Q=Q9(X);return(Y,J)=>c7(Q(Y,J))}function Tz(X){let Q=Q9(X);return(Y,J)=>{let $=Q(Y,J);if(V8($))return l($.value);let G=S8($.cause);if(u(G))throw T6(G.failure);return f(G.success)}}function Iz(X){return(Q,Y)=>wX(y1(X(Q,Y),(J)=>Error(J.toString(),{cause:J})))}var aY=p0((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)||KO(X)||g8(X)&&X.typeParameters.length>0;return($,G)=>{if(Y)G={...G,...Y};let Z=X.encoding,K;if(Z){let W=Z,V=W.length;for(let _=V-1;_>=0;_--){let q=W[_],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,(_)=>new OG(X,$,_))}Q??=X.getParser(aY);let H=K?D8(K,(W)=>Q(W,G)):Q($,G);if(X.checks&&!G?.disableChecks){let W=X.checks;if(G?.errors==="all"&&J&&B1($))H=d5(H,(V)=>{let _=[];XQ(W.filter((D)=>D.annotations?.[h1]),$.value,_,X,G);let q=W8(_)?V._tag==="Composite"&&V.ast===X?new q0(X,V.actual,[...V.issues,..._]):new q0(X,$,[V,..._]):V;return v(q)});H=D8(H,(V)=>{if(B1(V)){let _=V.value,q=[];if(XQ(W,_,q,X,G),W8(q))return v(new q0(X,V,q))}return h(V)})}return H}});var jz=p0((X)=>{return l4(X,[])});function l4(X,Q){let Y=U8(X)?.toEquivalence;if(Y)return Y(g8(X)?X.typeParameters.map((J)=>l4(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)=>l4(Z,[...Q,K])),$=X.elements.length,G=X.rest.map((Z,K)=>l4(Z,[...Q,$+K]));return s0((Z,K)=>{if(!Array.isArray(Z)||!Array.isArray(K))return!1;let H=Z.length;if(H!==K.length)return!1;let W=0;for(;W<Math.min(H,X.elements.length);W++)if(!J[W](Z[W],K[W]))return!1;if(G.length>0){let[V,..._]=G;for(;W<H-_.length;W++)if(!V(Z[W],K[W]))return!1;for(let q=0;q<_.length;q++)if(W+=q,!_[q](Z[W],K[W]))return!1}return!0})}case"Objects":{if(X.propertySignatures.length===0&&X.indexSignatures.length===0)return o;let J=X.propertySignatures.map((G)=>l4(G.type,[...Q,G.name])),$=X.indexSignatures.map((G)=>l4(G.type,Q));return s0((G,Z)=>{if(!f1(G)||!f1(Z))return!1;for(let K=0;K<J.length;K++){let H=X.propertySignatures[K],W=H.name,V=Object.hasOwn(G,W),_=Object.hasOwn(Z,W);if(E0(H.type)){if(V!==_)return!1}if(V&&_&&!J[K](G[W],Z[W]))return!1}for(let K=0;K<$.length;K++){let H=X.indexSignatures[K],W=d6(G,H.parameter),V=d6(Z,H.parameter);if(W.length!==V.length)return!1;for(let _=0;_<W.length;_++){let q=W[_];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 H=Z[K];if(H(J)&&H($))return l4(G[K],Q)(J,$)}return!1});case"Suspend":{let J=p6(()=>l4(X.thunk(),Q));return s0(($,G)=>J()($,G))}}}function Q2(X){return X.replace(/~/g,"~0").replace(/\//g,"~1")}function Ez(X){return X.replace(/~1/g,"/").replace(/~0/g,"~")}var Y2="~effect/Schema/Schema",tx={[Y2]:Y2,pipe(){return a(this,arguments)},annotate(X){return this.rebuild(c6(this.ast,X))},annotateKey(X){return this.rebuild(tX(this.ast,X))},check(...X){return this.rebuild(f4(this.ast,X))}};function r6(X,Q){let Y=Object.create(tx);if(Q)Object.assign(Y,Q);return Y.ast=X,Y.rebuild=(J)=>r6(J,Q),Y.makeEffect=AH(e5(Y),y1((J)=>new _4(J))),Y.make=Dz(Y),Y.makeOption=sY(Y),Y}var J2="~effect/Schema/SchemaError";class _4{[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(ex);function ex(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),H=X(Z);if(K!==H)return K-H;return Y.get(G)-Y.get(Z)});if(!J.some((G,Z)=>G!==Q[Z]))return Q;return J}}function vz(X){let{references:Q,representations:Y}=Xk([X]);return{representation:Y[0],references:Q}}function Xk(X){let Q={},Y=new Map,J=new Set,$=new Set;return{representations:j4(X,(_)=>K(_)),references:Q};function Z(_){let q=_,D=0;while(J.has(q))q=`${_}${++D}`;return J.add(q),q}function K(_,q){let D=Y.get(_);if(D!==void 0)return{_tag:"Reference",$ref:D};let U=sX(_),R=u5(_)??q;if(_!==U)return K(U,R);if(R!==void 0){let P=Z(R);Y.set(_,P);let y=W(_),Y0=Q[R];if(Y0!==void 0&&o(y,Y0))return Y.set(_,R),{_tag:"Reference",$ref:R};return Q[P]=y,{_tag:"Reference",$ref:P}}if($.has(_)){let P=Z(`${_._tag}_`);return Y.set(_,P),{_tag:"Reference",$ref:P}}$.add(_);let L=W(_);$.delete(_);let N=Y.get(_);if(N!==void 0)return Q[N]=L,{_tag:"Reference",$ref:N};return L}function H(_){let q=_.annotations?.toCodecJson??_.annotations?.toCodec;if(Y8(q)){let D=_.typeParameters.map((R)=>r6(J1(R))),U=q(D);return D0(_,[U])}return a5}function W(_){let q=$Q(_.annotations);switch(_._tag){case"Declaration":{let D=K(H(_));return{_tag:"Declaration",typeParameters:_.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:_._tag,...q};case"String":{let D=_.annotations?.contentMediaType,U=_.annotations?.contentSchema;return{_tag:_._tag,checks:V(_.checks),...q,...typeof D==="string"&&ZO(U)?{contentSchema:K(U)}:void 0}}case"Number":case"BigInt":return{_tag:_._tag,checks:V(_.checks),...q};case"Literal":return{_tag:_._tag,literal:_.literal,...q};case"UniqueSymbol":return{_tag:_._tag,symbol:_.symbol,...q};case"ObjectKeyword":return{_tag:_._tag,...q};case"Enum":return{_tag:_._tag,enums:_.enums,...q};case"TemplateLiteral":return{_tag:_._tag,parts:_.parts.map((D)=>K(D)),...q};case"Arrays":return{_tag:_._tag,elements:_.elements.map((D)=>{let U=sX(D);return{isOptional:E0(U),type:K(D),...$Q(U.context?.annotations)}}),rest:_.rest.map((D)=>K(D)),checks:V(_.checks),...q};case"Objects":return{_tag:_._tag,propertySignatures:_.propertySignatures.map((D)=>{let U=sX(D.type);return{name:D.name,type:K(D.type),isOptional:E0(U),isMutable:pO(U),...$Q(U.context?.annotations)}}),indexSignatures:_.indexSignatures.map((D)=>({parameter:K(D.parameter),type:K(D.type)})),checks:V(_.checks),...q};case"Union":{let D=$2(_.types);return{_tag:_._tag,types:D.map((U)=>K(U)),mode:_.mode,...q}}case"Suspend":return{_tag:"Suspend",checks:[],thunk:K(_.thunk()),...q}}}function V(_){if(!_)return[];return _.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=V(D.checks);if(W8(U))return{_tag:"FilterGroup",checks:U,...$Q(D.annotations)}}}}}}var Qk=new Set(["~structural","~sentinels","meta","toArbitrary","toArbitraryConstraint","toEquivalence","toFormatter","toCodec","toCodecJson","toCodecIso",t5]);function $Q(X){if(X!==void 0){let Q=FW(X,(Y,J)=>!Qk.has(J));if(!S3(Q))return{annotations:Q}}return}function xz(X,Q){let{definitions:Y,dialect:J,schemas:$}=Yk({representations:[X.representation],references:X.references},Q),G=$[0];return{dialect:J,schema:G,definitions:Y}}function Yk(X,Q){let Y=Q?.generateDescriptions??!1,J=Q?.additionalProperties??!1,$=L5(X.references,(q)=>G(q));return{dialect:"draft-2020-12",schemas:j4(X.representations,(q)=>G(q)),definitions:$};function G(q){let D=Z(q);if("annotations"in q){let U=H(q.annotations);if(U)D={...D,...U}}if("checks"in q){let U=W(q.checks,D.type);for(let R of U)D=VZ(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 qZ(q.checks,"isInt")?{type:"integer"}:qZ(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=H(L.annotations);return P?VZ(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=H(N.annotations);if(U[P]=Y0?VZ(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=_(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)&&S3(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 H(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 W(q,D){return q.map(U).filter((R)=>R!==void 0);function U(R){switch(R._tag){case"Filter":return V(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=H(R.annotations);if(P)N={...N,...P};return N}}}}function V(q,D){let U=q.meta;if(!U)return;let R=N(U),L=H(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 _(q){switch(q._tag){default:throw new globalThis.Error(`Unsupported index signature parameter: ${q._tag}`);case"Reference":return _(X.references[q.$ref]);case"String":return Jk(q);case"TemplateLiteral":return[`^${q.parts.map(G2).join("")}$`];case"Union":return q.types.flatMap(_)}}}function Jk(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 qZ(X,Q){return X.some((Y)=>{switch(Y._tag){case"Filter":return Y.meta._tag===Q;case"FilterGroup":return qZ(Y.checks,Q)}})}function VZ(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 lG;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}`,H=Z2(X[Z],Q[Z]);for(let W of H)kz(W,K),Y.push(W)}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 H=`/${Q2(Z)}`,W=Object.hasOwn(X,Z),V=Object.hasOwn(Q,Z);if(W&&V){let _=Z2(X[Z],Q[Z]);for(let q of _)kz(q,H),Y.push(q)}else if(!W&&V)Y.push({op:"add",path:H,value:Q[Z]});else if(W&&!V)Y.push({op:"remove",path:H})}return Y}return Y.push({op:"replace",path:"",value:Q}),Y}function bz(X,Q){let Y=Q;for(let J of X)switch(J.op){case"replace":{Y=J.path===""?J.value:yz(Y,J.path,J.value,"replace");break}case"add":{Y=Zk(Y,J.path,J.value);break}case"remove":{Y=yz(Y,J.path,void 0,"remove");break}}return Y}function kz(X,Q){X.path=X.path===""?Q:Q+X.path}function K2(X){return f1(X)}function Gk(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(Ez)}function DZ(X){if(!/^(0|[1-9]\d*)$/.test(X))throw Error(`Invalid array index: "${X}"`);return Number(X)}function Zk(X,Q,Y){if(Q==="")return Y;let J=gz(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:DZ($);if(K<0||K>G.length)throw Error(`Array index out of bounds at "${Q}".`);let H=G.slice();return H.splice(K,0,Y),H2(Z,H)}if(K2(G)){let K={...G};return K[$]=Y,H2(Z,K)}throw Error(`Cannot add at "${Q}" (parent not found or not a container).`)}function yz(X,Q,Y,J){if(Q===""){if(J==="remove"||Y===void 0)throw Error("Unsupported operation at the root");return Y}let $=gz(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 H=DZ(G);if(H<0||H>=Z.length)throw Error(`Array index out of bounds at "${Q}".`);let W=Z.slice();if(J==="remove")W.splice(H,1);else W[H]=Y;return H2(K,W)}if(K2(Z)){if(!Object.hasOwn(Z,G))throw Error(`Property "${G}" does not exist at "${Q}".`);let H={...Z};if(J==="remove")delete H[G];else H[G]=Y;return H2(K,H)}throw Error(`Cannot ${J} at "${Q}" (parent not found or not a container).`)}function gz(X,Q){let Y=Gk(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 H=DZ(K);if(H<0||H>=G.length)return null;$.push({container:G,token:H}),G=G[H];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 H2(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 Hk=/^#\/\$defs(?=\/|$)/;function mz(X){return{dialect:"draft-07",schema:hz(X.schema),definitions:L5(X.definitions,hz)}}function hz(X){return Q(X);function Q(J){return Y(BZ(J,($)=>$.replace(Hk,"#/definitions")),!0)}function Y(J,$){if(Array.isArray(J))return J.map((W)=>Y(W,!1));if(!f1(J))return J;let G=J,Z={},K=void 0,H=void 0;for(let W of Object.keys(G)){let V=G[W];switch(W){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[W]=V;break;case"properties":case"patternProperties":{let _=Wk(V,Y);Z[W]=_??V;break}case"additionalProperties":case"propertyNames":Z[W]=Y(V,!1);break;case"allOf":case"anyOf":case"oneOf":Z[W]=Array.isArray(V)?V.map((_)=>Y(_,!1)):V;break;case"prefixItems":K=V;break;case"items":H=V;break;default:break}}if(K!==void 0)if(Array.isArray(K)){if(Z.items=K.map((W)=>Y(W,!1)),H!==void 0)Z.additionalItems=Y(H,!1)}else Z.items=Y(K,!1);else if(H!==void 0)Z.items=Y(H,!1);return Z}}function BZ(X,Q){if(Array.isArray(X))return X.map((J)=>BZ(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]=BZ($,Q);else Y[J]=$}return Y}function Wk(X,Q){if(!f1(X))return;let Y={};for(let J of Object.keys(X))Y[J]=Q(X[J],!1);return Y}function pz(X,Q){return P8(new lz(X,Q))}function dz(X,Q){return P8(new OZ(X,Q))}class cz{_tag="IdentityNode"}var fz=new cz;class uz{_tag="CompositionNode";nodes;constructor(X){this.nodes=X}}class lz{_tag="IsoNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class OZ{_tag="LensNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class rz{_tag="PrismNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class zZ{_tag="OptionalNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class FZ{_tag="PathNode";path;constructor(X){this.path=X}}class _2{_tag="CheckNode";checks;constructor(X){this.checks=X}}function Vk(X,Q){let Y=X[X.length-1];if(Y){if(Y._tag==="PathNode"&&Q._tag==="PathNode"){X[X.length-1]=new FZ([...Y.path,...Q.path]);return}if(Y._tag==="CheckNode"&&Q._tag==="CheckNode"){X[X.length-1]=new _2([...Y.checks,...Q.checks]);return}}X.push(Q)}function UZ(X,Q){if(X._tag==="IdentityNode")return;if(X._tag==="CompositionNode"){for(let Y=0;Y<X.nodes.length;Y++)UZ(X.nodes[Y],Q);return}Vk(Q,X)}function o6(X,Q){let Y=[];switch(UZ(X,Y),UZ(Q,Y),Y.length){case 0:return fz;case 1:return Y[0];default:return new uz(Y)}}function qk(X,Q){return P8(new zZ(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(o6(this.node,X.node))}key(X){return P8(o6(this.node,new FZ([X])))}optionalKey(X){return P8(o6(this.node,new OZ((Q)=>Q[X],(Q,Y)=>{let J=V2(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(o6(this.node,new _2(X)))}refine(X,Q){return P8(o6(this.node,new _2([pY(X,Q)])))}tag(X){return P8(o6(this.node,new rz((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(o6(this.node,new zZ((J)=>Object.hasOwn(J,X)?l(J[X]):Y,(J,$)=>{if(Object.hasOwn($,X)){let G=V2($);return G[X]=J,l(G)}else return Y})))}pick(X){return this.compose(dz(Yz(X),(Q,Y)=>({...Y,...Q})))}omit(X){return this.compose(dz(Jz(X),(Q,Y)=>({...Y,...Q})))}notUndefined(){return this.refine($1,{expected:"a value other than `undefined`"})}forEach(X){let Q=X(q2());return qk((Y)=>O6(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 H=G[K],W=Q.replaceResult(Y[K],$[H]);if(u(W))return f(`each: could not set element ${H}`);Z[H]=W.success}return this.replaceResult(Z,J)}))}modifyAll(X){return(Q)=>x9(Q7(this.getResult(Q),(Y)=>this.replaceResult(Y.map(X),Q)),()=>Q)}}class oz 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 nz 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 iz 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(O6(this.getResult(Q),(Y)=>this.set(X(Y))),()=>Q)}}function P8(X){let Q=az(X);switch(Q._tag){case"IsoNode":return new oz(X,Q.get,Q.set);case"LensNode":return new nz(X,Q.get,Q.set);case"PrismNode":return new iz(X,Q.get,Q.set);case"OptionalNode":return new GQ(X,Q.get,Q.set)}}function V2(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 az=p0((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,$=V2(Y),G=$,Z=0;for(;Z<J.length-1;Z++){let H=J[Z];G[H]=V2(G[H]),G=G[H]}let K=J[Z];return G[K]=Q,$}};case"CheckNode":return{_tag:"PrismNode",get:(Q)=>v9(sO(X.checks,Q),String),set:b};case"CompositionNode":{let Q=X.nodes.map(az),Y=Q.reduce((J,$)=>Dk(J,$._tag),"IsoNode");return{_tag:Y,get:(J)=>{for(let $=0;$<Q.length;$++){let G=Q[$],Z=G.get(J);if(W2(G._tag)){if(u(Z))return Z;J=Z.success}else J=Z}return W2(Y)?l(J):J},set:(J,$)=>{let G=$,Z=Q.length,K=Array(Z+1);K[0]=$;for(let H=0;H<Z;H++){let W=Q[H];if(W2(W._tag)){let V=W.get($);if(u(V))return Y==="OptionalNode"?V:G;$=V.success}else $=W.get($);K[H+1]=$}for(let H=Z-1;H>=0;H--){let W=Q[H];if(sz(W._tag))J=W.set(J);else if(W._tag==="LensNode")J=W.set(J,K[H]);else{let V=W.set(J,K[H]);if(u(V))return V;J=V.success}}return Y==="OptionalNode"?l(J):J}}}}});function W2(X){return X==="PrismNode"||X==="OptionalNode"}function sz(X){return X==="IsoNode"||X==="PrismNode"}function Dk(X,Q){switch(X){case"IsoNode":return Q;case"LensNode":return W2(Q)?"OptionalNode":"LensNode";case"PrismNode":return sz(Q)?"PrismNode":"OptionalNode";case"OptionalNode":return"OptionalNode"}}var Bk=P8(fz);function q2(){return Bk}var uK={};J6(uK,{webUrl:()=>zc,webSegment:()=>hR,webQueryParameters:()=>dR,webPath:()=>mR,webFragments:()=>gR,webAuthority:()=>yR,uuid:()=>$c,uniqueArray:()=>e6,ulid:()=>sp,uint8ClampedArray:()=>wR,uint8Array:()=>AR,uint32Array:()=>MR,uint16Array:()=>NR,tuple:()=>e,toStringMethod:()=>M8,subarray:()=>cp,stringify:()=>g0,stringMatching:()=>ec,string:()=>d0,stream:()=>a4,statistics:()=>ib,sparseArray:()=>CR,shuffledSubarray:()=>fp,set:()=>TR,schedulerFor:()=>Sc,scheduler:()=>Ec,scheduledModelRun:()=>Ic,sample:()=>ob,resetConfigureGlobal:()=>ey,record:()=>qK,readConfigureGlobal:()=>N8,property:()=>Yb,pre:()=>Ik,option:()=>U4,oneof:()=>l0,object:()=>Mp,noShrink:()=>k2,noBias:()=>v2,nat:()=>n4,modelRun:()=>Cc,mixedCase:()=>Qp,memo:()=>id,maxSafeNat:()=>rm,maxSafeInteger:()=>qR,mapToConstant:()=>V9,map:()=>DK,lorem:()=>ld,limitShrink:()=>Zf,letrec:()=>UR,jsonValue:()=>SR,json:()=>Ip,ipV6:()=>BR,ipV4Extended:()=>DR,ipV4:()=>mK,integer:()=>z0,int8Array:()=>RR,int32Array:()=>PR,int16Array:()=>LR,infiniteStream:()=>Sp,hash:()=>x2,hasToStringMethod:()=>NK,hasCloneMethod:()=>s6,hasAsyncToStringMethod:()=>MK,getDepthContextFor:()=>TK,gen:()=>Xg,func:()=>cm,float64Array:()=>FR,float32Array:()=>zR,float:()=>WR,falsy:()=>Tg,entityGraph:()=>gd,emailAddress:()=>sh,double:()=>b2,domain:()=>yK,dictionary:()=>SK,defaultReportMessage:()=>kP,date:()=>lP,createDepthIdentifier:()=>IK,context:()=>jg,constantFrom:()=>m8,constant:()=>b0,configureGlobal:()=>ty,compareFunc:()=>mm,compareBooleanFunc:()=>gm,commands:()=>Rc,cloneMethod:()=>r0,cloneIfNeeded:()=>Z9,clone:()=>hg,check:()=>gP,boolean:()=>zQ,bigUint64Array:()=>xc,bigInt64Array:()=>vc,bigInt:()=>s4,base64String:()=>hp,asyncToStringMethod:()=>B4,asyncStringify:()=>AK,asyncProperty:()=>Qb,asyncModelRun:()=>Tc,asyncDefaultReportMessage:()=>yP,assert:()=>lb,array:()=>P0,anything:()=>ER,__version:()=>Hf,__type:()=>Kf,__commitHash:()=>Wf,VerbosityLevel:()=>z1,Value:()=>k,Stream:()=>Q0,Random:()=>wK,PreconditionFailure:()=>t4,ExecutionStatus:()=>i6,Arbitrary:()=>I0});var Ok=class X{constructor(Q){this.seed=Q}clone(){return new X(this.seed)}next(){let Q=LZ(this.seed),Y=PZ(Q),J=LZ(Q),$=PZ(J);return this.seed=LZ(J),PZ(this.seed)+($+(Y<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function LZ(X){return Math.imul(X,214013)+2531011&4294967295}function PZ(X){return(X&-2147483649)>>16}function tz(X){return new Ok(X)}var zk=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)ez(this.states,this.index,Q,Y);this.index=D2(this.states,this.index)}ez(this.states,this.index,Q,Y)}};function ez(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 Fk(X){for(let Q=0;Q!==624;++Q)D2(X,Q)}function XF(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 Fk(Q),new zk(Q,0)}var Lk=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 RZ(X){return new Lk(-1,~X,X|0,0)}var Pk=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 QF(X){return new Pk(-1,~X,X|0,0)}function YF(X,Q){for(let Y=0;Y!==Q;++Y)X.next()}var JF=BigInt,Rk=4294967296n;function GF(X,Q,Y){let J=Y-Q+1n,$=Rk,G=1;while($<J)$<<=32n,++G;let Z=$F(G,X);if(Z<J)return Z+Q;if(Z+J<$)return Z%J+Q;let K=$-$%J;while(Z>=K)Z=$F(G,X);return Z%J+Q}function $F(X,Q){let Y=JF(Q.next()+2147483648);for(let J=1;J<X;++J){let $=Q.next();Y=(Y<<32n)+JF($+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 NZ(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 Nk(X,Q,Y){let J=Q.data[1],$=Q.data[0],G=Q.sign,Z=Y.data[1],K=Y.data[0],H=Y.sign;if(X.sign=1,G===1&&H===-1){let R=J+Z,L=$+K+(R>4294967295?1:0);return X.data[0]=L>>>0,X.data[1]=R>>>0,X}let W=J,V=$,_=Z,q=K;if(G===-1)W=Z,V=K,_=J,q=$;let D=0,U=W-_;if(U<0)D=1,U=U>>>0;return X.data[0]=V-q-D,X.data[1]=U,X}function Mk(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 Ak=Number.MAX_SAFE_INTEGER,wk={sign:1,data:[0,0]},Ck={sign:1,data:[0,0]},ZF={sign:1,data:[0,0]},MZ=[0,0];function Tk(X,Q,Y,J){let $=J<=Ak?NZ(ZF,J):Nk(ZF,NZ(wk,Y),NZ(Ck,Q));if($.data[1]===4294967295)$.data[0]+=1,$.data[1]=0;else $.data[1]+=1;return Mk(X,MZ,$.data),MZ[0]*4294967296+MZ[1]+Q}function B2(X,Q,Y){let J=Y-Q;if(J<=4294967295)return ZQ(X,J+1)+Q;return Tk(X,Q,Y,J)}var KF=Symbol.for("fast-check/PreconditionFailure"),t4=class extends Error{constructor(X=!1){super();this.interruptExecution=X,this.footprint=KF}static isFailure(X){return X!==null&&X!==void 0&&X.footprint===KF}};function Ik(X){if(!X)throw new t4}var jk=class{[Symbol.iterator](){return this}next(X){return{value:X,done:!0}}},Ek=new jk;function Sk(){return Ek}function*vk(X,Q){for(let Y of X)yield Q(Y)}function*xk(X,Q){for(let Y of X)yield*Q(Y)}function*kk(X,Q){for(let Y of X)if(Q(Y))yield Y}function*yk(X,Q){for(let Y=0;Y<Q;++Y){let J=X.next();if(J.done)break;yield J.value}}function*bk(X,Q){let Y=X.next();while(!Y.done&&Q(Y.value))yield Y.value,Y=X.next()}function*gk(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 hk=Symbol.iterator,Q0=class X{static nil(){return new X(Sk())}static of(...Q){return new X(Q[hk]())}constructor(Q){this.g=Q}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(Q){return new X(vk(this.g,Q))}flatMap(Q){return new X(xk(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(bk(this.g,Q))}take(Q){return new X(yk(this.g,Q))}filter(Q){return new X(kk(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(gk(this.g,Q))}getNthOrLast(Q){let Y=Q,J=null;for(let $ of this.g){if(Y--===0)return $;J=$}return J}};function a4(X){return new Q0(X)}var r0=Symbol.for("fast-check/cloneMethod");function s6(X){return X!==null&&(typeof X==="object"||typeof X==="function")&&r0 in X&&typeof X[r0]==="function"}function Z9(X){return s6(X)?X[r0]():X}var mk=Object.defineProperty,k=class{constructor(X,Q,Y=void 0){if(this.value_=X,this.context=Q,this.hasToBeCloned=Y!==void 0||s6(X),this.readOnce=!1,this.hasToBeCloned)mk(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 ck(this,X)}map(X,Q){return new pk(this,X,Q)}chain(X){return new dk(this,X)}},dk=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}},pk=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)&&!s6(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}},ck=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 KP(X){return typeof X==="object"&&X!==null&&"generate"in X&&"shrink"in X&&"canShrinkWithoutContext"in X}function HP(X){if(!KP(X))throw Error("Unexpected value received: not an instance of Arbitrary")}var WP=Function.prototype.apply,AZ=Symbol("apply");function fk(X){try{return X.apply}catch{return}}function uk(X,Q,Y){let J=X;J[AZ]=WP;let $=J[AZ](Q,Y);return delete J[AZ],$}function _0(X,Q,Y){if(fk(X)===WP)return X.apply(Q,Y);return uk(X,Q,Y)}var _P=Array,j=BigInt,lk=BigInt64Array,rk=BigUint64Array,VP=Boolean,j2=Date,E=Error,qP=Float32Array,DP=Float64Array,ok=Int8Array,nk=Int16Array,ik=Int32Array,q4=Number,F1=String,K9=Set,ak=Uint8Array,sk=Uint8ClampedArray,tk=Uint16Array,ek=Uint32Array,Xy=encodeURIComponent,D4=Map,N2=Symbol,HF=Array.prototype.forEach,WF=Array.prototype.indexOf,_F=Array.prototype.join,VF=Array.prototype.map,qF=Array.prototype.flat,DF=Array.prototype.filter,BF=Array.prototype.push,UF=Array.prototype.pop,OF=Array.prototype.splice,zF=Array.prototype.slice,FF=Array.prototype.sort,LF=Array.prototype.every;function Qy(X){try{return X.forEach}catch{return}}function Yy(X){try{return X.indexOf}catch{return}}function Jy(X){try{return X.join}catch{return}}function $y(X){try{return X.map}catch{return}}function Gy(X){try{return X.flat}catch{return}}function Zy(X){try{return X.filter}catch{return}}function Ky(X){try{return X.push}catch{return}}function Hy(X){try{return X.pop}catch{return}}function Wy(X){try{return X.splice}catch{return}}function _y(X){try{return X.slice}catch{return}}function Vy(X){try{return X.sort}catch{return}}function qy(X){try{return X.every}catch{return}}function BP(X,Q){if(Qy(X)===HF)return X.forEach(Q);return _0(HF,X,[Q])}function V4(X,...Q){if(Yy(X)===WF)return X.indexOf(...Q);return _0(WF,X,Q)}function w0(X,...Q){if(Jy(X)===_F)return X.join(...Q);return _0(_F,X,Q)}function G0(X,Q){if($y(X)===VF)return X.map(Q);return _0(VF,X,[Q])}function Dy(X,Q){if(Gy(X)===qF)return[].flat(),X.flat(Q);return _0(qF,X,[Q])}function By(X,Q){if(Zy(X)===DF)return X.filter(Q);return _0(DF,X,[Q])}function S(X,...Q){if(Ky(X)===BF)return X.push(...Q);return _0(BF,X,Q)}function UP(X){if(Hy(X)===UF)return X.pop();return _0(UF,X,[])}function OP(X,...Q){if(Wy(X)===OF)return X.splice(...Q);return _0(OF,X,Q)}function e0(X,...Q){if(_y(X)===zF)return X.slice(...Q);return _0(zF,X,Q)}function zP(X,...Q){if(Vy(X)===FF)return X.sort(...Q);return _0(FF,X,Q)}function FP(X,...Q){if(qy(X)===LF)return X.every(...Q);return _0(LF,X,Q)}var PF=Date.prototype.getTime,RF=Date.prototype.toISOString;function Uy(X){try{return X.getTime}catch{return}}function Oy(X){try{return X.toISOString}catch{return}}function E2(X){if(Uy(X)===PF)return X.getTime();return _0(PF,X,[])}function zy(X){if(Oy(X)===RF)return X.toISOString();return _0(RF,X,[])}var NF=Set.prototype.add,MF=Set.prototype.has;function Fy(X){try{return X.add}catch{return}}function Ly(X){try{return X.has}catch(Q){return}}function VQ(X,Q){if(Fy(X)===NF)return X.add(Q);return _0(NF,X,[Q])}function S2(X,Q){if(Ly(X)===MF)return X.has(Q);return _0(MF,X,[Q])}var AF=WeakMap.prototype.set,wF=WeakMap.prototype.get;function Py(X){try{return X.set}catch(Q){return}}function Ry(X){try{return X.get}catch(Q){return}}function Ny(X,Q,Y){if(Py(X)===AF)return X.set(Q,Y);return _0(AF,X,[Q,Y])}function My(X,Q){if(Ry(X)===wF)return X.get(Q);return _0(wF,X,[Q])}var CF=Map.prototype.set,TF=Map.prototype.get,IF=Map.prototype.has;function Ay(X){try{return X.set}catch(Q){return}}function wy(X){try{return X.get}catch(Q){return}}function Cy(X){try{return X.has}catch(Q){return}}function R8(X,Q,Y){if(Ay(X)===CF)return X.set(Q,Y);return _0(CF,X,[Q,Y])}function p1(X,Q){if(wy(X)===TF)return X.get(Q);return _0(TF,X,[Q])}function Ty(X,Q){if(Cy(X)===IF)return X.has(Q);return _0(IF,X,[Q])}var jF=String.prototype.split,EF=String.prototype.startsWith,SF=String.prototype.endsWith,vF=String.prototype.substring,xF=String.prototype.toLowerCase,kF=String.prototype.toUpperCase,yF=String.prototype.padStart,bF=String.prototype.charCodeAt,gF=String.prototype.normalize,hF=String.prototype.replace;function Iy(X){try{return X.split}catch{return}}function jy(X){try{return X.startsWith}catch{return}}function Ey(X){try{return X.endsWith}catch{return}}function Sy(X){try{return X.substring}catch{return}}function vy(X){try{return X.toLowerCase}catch{return}}function xy(X){try{return X.toUpperCase}catch{return}}function ky(X){try{return X.padStart}catch{return}}function yy(X){try{return X.charCodeAt}catch{return}}function by(X){try{return X.normalize}catch(Q){return}}function gy(X){try{return X.replace}catch{return}}function L1(X,...Q){if(Iy(X)===jF)return X.split(...Q);return _0(jF,X,Q)}function hy(X,...Q){if(jy(X)===EF)return X.startsWith(...Q);return _0(EF,X,Q)}function my(X,...Q){if(Ey(X)===SF)return X.endsWith(...Q);return _0(SF,X,Q)}function S0(X,...Q){if(Sy(X)===vF)return X.substring(...Q);return _0(vF,X,Q)}function iZ(X){if(vy(X)===xF)return X.toLowerCase();return _0(xF,X,[])}function LK(X){if(xy(X)===kF)return X.toUpperCase();return _0(kF,X,[])}function dy(X,...Q){if(ky(X)===yF)return X.padStart(...Q);return _0(yF,X,Q)}function H9(X,Q){if(yy(X)===bF)return X.charCodeAt(Q);return _0(bF,X,[Q])}function py(X,Q){if(by(X)===gF)return X.normalize(Q);return _0(gF,X,[Q])}function cy(X,Q,Y){if(gy(X)===hF)return X.replace(Q,Y);return _0(hF,X,[Q,Y])}var mF=Number.prototype.toString;function fy(X){try{return X.toString}catch{return}}function qQ(X,...Q){if(fy(X)===mF)return X.toString(...Q);return _0(mF,X,Q)}var uy=Object.prototype.hasOwnProperty,ly=Object.prototype.toString;function LP(X,Q){return _0(uy,X,[Q])}function aZ(X){return _0(ly,X,[])}var ry=Error.prototype.toString;function oy(X){return _0(ry,X,[])}var ny=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 i4(X){return new ny(X)}var PP=Array.isArray,iy=Object.defineProperty;function RP(X,Q){return iy(X,r0,{value:()=>{let Y=[];for(let J=0;J!==Q.length;++J)S(Y,Q[J].value);return RP(Y,Q),Y}})}function NP(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)RP(Y,X);return new k(Y,J)}function MP(X,Q,Y){let J=[],$=PP(Y)?Y:[];for(let G=0;G!==X.length;++G)S(J,i4(()=>X[G].shrink(Q[G],$[G]).map((Z)=>{let K=G0(Q,(H,W)=>new k(Z9(H),$[W]));return[...e0(K,0,G),Z,...e0(K,G+1)]}).map(NP)));return Q0.nil().join(...J)}var ay=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 NP(Y)}canShrinkWithoutContext(X){if(!PP(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 MP(this.arbs,X,Q)}};function e(...X){return new ay(X)}var sy=Math.log;function AP(X){return 2+~~(sy(X+1)*0.4342944819032518)}var PK={};function ty(X){PK=X}function N8(){return PK}function ey(){PK={}}var DQ=Symbol("UndefinedContextPlaceholder");function W9(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 dF=()=>{},Xb=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||$||dF,this.afterEachHook=J||G||dF}isAsync(){return!0}generate(X,Q){return W9(this.arb.generate(X,Q!==void 0?AP(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(W9)}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(t4.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}},wP=class extends I0{constructor(X){super();this.arb=X}generate(X,Q){return W9(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(W9)}};function Qb(...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 BP(Q,HP),new Xb(e(...G0(Q,(J)=>new wP(J))),(J)=>Y(...J))}var pF=()=>{},CP=class{constructor(X,Q){this.arb=X,this.predicate=Q;let{beforeEach:Y=pF,afterEach:J=pF,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 W9(this.arb.generate(X,Q!==void 0?AP(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(W9)}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(t4.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 Yb(...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 BP(Q,HP),new CP(e(...G0(Q,(J)=>new wP(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 sZ(X){if("unsafeNext"in X){if(X.unsafeJump===void 0)return{clone:()=>sZ(X),next:()=>X.unsafeNext(),getState:()=>X.getState()};return{clone:()=>sZ(X),next:()=>X.unsafeNext(),jump:()=>X.unsafeJump(),getState:()=>X.getState()}}return X}function TP(X){if("jump"in X&&typeof X.jump==="function")return X;return{clone:()=>TP(X),next:()=>X.next(),jump:()=>YF(X,42),getState:()=>X.getState()}}function y2(X){return TP(sZ(X))}var Jb=Date.now,$b=Math.min,Gb=Math.random,Zb=class{constructor(X){let Q=X||{};this.seed=Kb(Q),this.randomType=Hb(Q),this.numRuns=Wb(Q),this.verbose=_b(Q),this.maxSkipsPerRun=Q.maxSkipsPerRun!==void 0?Q.maxSkipsPerRun:100,this.timeout=CZ(Q.timeout),this.skipAllAfterTimeLimit=CZ(Q.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=CZ(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 wZ(X){return(Q)=>{return y2(X(Q))}}function Kb(X){if(X.seed===void 0)return Jb()^Gb()*4294967296;let Q=X.seed|0;if(X.seed===Q)return Q;return Q^(X.seed-Q)*4294967296}function Hb(X){if(X.randomType===void 0)return RZ;if(typeof X.randomType==="string")switch(X.randomType){case"mersenne":return wZ(XF);case"congruential":case"congruential32":return wZ(tz);case"xorshift128plus":return RZ;case"xoroshiro128plus":return QF;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 wZ(X.randomType)}function Wb(X){if(X.numRuns!==void 0)return X.numRuns;if(X.num_runs!==void 0)return X.num_runs;return 100}function _b(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 CZ(X){if(X===void 0)return;return $b(X,2147483647)}function RK(X){return new Zb(X)}function Vb(X,Q,Y){let J=null;return{clear:()=>Y(J),promise:new Promise(($)=>{J=Q(()=>{$(new t4(!0))},X)})}}var cF=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 t4(this.interruptExecution);if(this.isAsync())return Promise.resolve(Y);else return Y}if(this.interruptExecution&&this.isAsync()){let Y=Vb(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()}},qb=(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)})}},Db=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=qb(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())}},IP=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()}},fF=Array.from,uF=typeof Buffer<"u"?Buffer.isBuffer:void 0,Y9=JSON.stringify,lF=Number.isNaN,Bb=Object.keys,Ub=Object.getOwnPropertySymbols,Ob=Object.getOwnPropertyDescriptor,rF=Object.getPrototypeOf,oF=Number.NEGATIVE_INFINITY,zb=Number.POSITIVE_INFINITY,M8=Symbol.for("fast-check/toStringMethod");function NK(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 MK(X){return X!==null&&(typeof X==="object"||typeof X==="function")&&B4 in X&&typeof X[B4]==="function"}var Fb=/^Symbol\((.*)\)$/;function Lb(X){if(X.description!==void 0)return X.description;let Q=Fb.exec(F1(X));return Q&&Q[1].length?Q[1]:null}function nF(X){switch(X){case 0:return 1/X===oF?"-0":"0";case oF:return"Number.NEGATIVE_INFINITY";case zb:return"Number.POSITIVE_INFINITY";default:return X===X?F1(X):"Number.NaN"}}function Pb(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 d1(X,Q,Y){let J=[...Q,X];if(typeof X==="object"){if(V4(Q,X)!==-1)return"[cyclic]"}if(MK(X)){let $=Y(X);if($.state==="fulfilled")return $.value}if(NK(X))try{return X[M8]()}catch{}switch(aZ(X)){case"[object Array]":{let $=X;if($.length>=50&&Pb($)){let Z=[];for(let K in $)if(!lF(Number(K)))S(Z,`${K}:${d1($[K],J,Y)}`);return Z.length!==0?`Object.assign(Array(${$.length}),{${w0(Z,",")}})`:`Array(${$.length})`}let G=w0(G0($,(Z)=>d1(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 lF(E2($))?"new Date(NaN)":`new Date(${Y9(zy($))})`}case"[object Map]":return`new Map(${d1(Array.from(X),J,Y)})`;case"[object Null]":return"null";case"[object Number]":return typeof X==="number"?nF(X):`new Number(${nF(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"?`[${d1(G,J,Y)}]`:Y9(G)}:${d1(X[G],J,Y)}`;return"{"+w0([...rF(X)===null?["__proto__:null"]:[],...G0(Bb(X),$),...G0(By(Ub(X),(G)=>{let Z=Ob(X,G);return Z&&Z.enumerable}),$)],",")+"}"}case"[object Set]":return`new Set(${d1(Array.from(X),J,Y)})`;case"[object String]":return typeof X==="string"?Y9(X):`new String(${Y9(X)})`;case"[object Symbol]":{let $=X;if(N2.keyFor($)!==void 0)return`Symbol.for(${Y9(N2.keyFor($))})`;let G=Lb($);if(G===null)return"Symbol()";return $===(G.startsWith("Symbol.")&&N2[G.substring(7)])?G:`Symbol(${Y9(G)})`}case"[object Promise]":{let $=Y(X);switch($.state){case"fulfilled":return`Promise.resolve(${d1($.value,J,Y)})`;case"rejected":return`Promise.reject(${d1($.value,J,Y)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(X instanceof Error)return`new Error(${d1(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 uF==="function"&&uF(X))return`Buffer.from(${X.buffer.detached?"/*detached ArrayBuffer*/":d1(fF(X.values()),J,Y)})`;let $=rF(X),G=$&&$.constructor&&$.constructor.name;if(typeof G==="string"){let Z=X;if(Z.buffer.detached)return`${G}.from(/*detached ArrayBuffer*/)`;return`${G}.from(${d1(fF(Z.values()),J,Y)})`}break}}try{return X.toString()}catch{return aZ(X)}}function g0(X){return d1(X,[],()=>({state:"unknown",value:void 0}))}function jP(X){let Q=N2(),Y=[],J=new D4;function $(){let H=null,W=()=>{if(H!==null)clearTimeout(H)};return{delay:new Promise((V)=>{H=setTimeout(()=>{H=null,V(Q)},0)}),cancel:W}}let G={state:"unknown",value:void 0},Z=function(W){let V=W;if(J.has(V))return J.get(V);let _=$(),q=B4 in W?Promise.resolve().then(()=>W[B4]()):W;return q.catch(()=>{}),Y.push(Promise.race([q,_.delay]).then((D)=>{if(D===Q)J.set(V,{state:"pending",value:void 0});else J.set(V,{state:"fulfilled",value:D});_.cancel()},(D)=>{J.set(V,{state:"rejected",value:D}),_.cancel()})),J.set(V,G),G};function K(){let H=d1(X,[],Z);if(Y.length===0)return H;return Promise.all(Y.splice(0)).then(K)}return K()}async function AK(X){return Promise.resolve(jP(X))}function iF(X){return X===null?new t4:X}function Rb(...X){if(X[1])return X[0].then(iF);return iF(X[0])}function Nb(X,Q){return Rb(X,Q)}var aF=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 Nb(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()}},sF=Date.now,TZ=setTimeout,IZ=clearTimeout;function Mb(X,Q){let Y=X;if(X.isAsync()&&Q.timeout!==void 0)Y=new Db(Y,Q.timeout,TZ,IZ);if(Q.unbiased)Y=new IP(Y);if(Q.skipAllAfterTimeLimit!==void 0)Y=new cF(Y,sF,Q.skipAllAfterTimeLimit,!1,TZ,IZ);if(Q.interruptAfterTimeLimit!==void 0)Y=new cF(Y,sF,Q.interruptAfterTimeLimit,!0,TZ,IZ);if(Q.skipEqualValues)Y=new aF(Y,!0);if(Q.ignoreEqualValues)Y=new aF(Y,!1);return Y}var i6=function(X){return X[X.Success=0]="Success",X[X.Skipped=-1]="Skipped",X[X.Failure=1]="Failure",X}({}),Ab=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(i6.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(i6.Skipped,Q);if(this.pathToFailure===void 0)++this.numSkips}success(Q){if(this.verbosity>=z1.VeryVerbose)this.appendExecutionTree(i6.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===i6.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()}}},EP=class{constructor(X,Q,Y,J){this.sourceValues=X,this.shrink=Q,this.runExecution=new Ab(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"&&!t4.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_)}},wb=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}},Cb=-2147483648,Tb=2147483647,Ib=Math.pow(2,27),jb=Math.pow(2,-53),wK=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?Cb:Q,Y===void 0?Tb:Y)}nextBigInt(Q,Y){return GF(this.internalRng,Q,Y)}nextDouble(){let Q=this.next(26),Y=this.next(27);return(Q*Ib+Y)*jb}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState==="function")return this.internalRng.getState()}};function Eb(X,Q,Y){return Q.jump(),X.generate(new wK(Q),Y)}function*SP(X,Q,Y,J){for(let $=0;$!==J.length;++$)yield new k(J[$],void 0);for(let $=0,G=Y(Q);;++$)yield Eb(X,G,$)}function Sb(X,Q,Y){return()=>X.generate(new wK(Q),Y)}function*vP(X,Q,Y,J){yield*G0(J,(Z)=>()=>new k(Z,void 0));let $=0,G=y2(Y(Q));for(;;)G.jump(),yield Sb(X,G,$++)}function tF(X){return X()}function xP(X,Q,Y){let J=Q,$=X.split(":").map((Z)=>+Z);if($.length===0)return J.map(tF);if(!$.every((Z)=>!Number.isNaN(Z)))throw Error(`Unable to replay, got invalid path=${X}`);let G=J.drop($[0]).map(tF);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 vb=Object.assign;function xb(X){if(X.length===1)return`Hint: ${X[0]}`;return X.map((Q,Y)=>`Hint (${Y+1}): ${Q}`).join(`
|
|
30
|
+
`)}function kb(X,Q){return`Encountered failures were:
|
|
31
31
|
- ${X.map(Q).join(`
|
|
32
|
-
- `)}`}function
|
|
32
|
+
- `)}`}function CK(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===i6.Success?"\x1B[32m\u221A\x1B[0m":G.status===i6.Failure?"\x1B[31m\xD7\x1B[0m":"\x1B[33m!\x1B[0m",H=Z!==0?". ".repeat(Z-1):"";Y.push(`${H}${K} ${Q(G.value)}`);for(let W=G.children.length-1;W>=0;--W)J.push({depth:Z+1,tree:G.children[W]})}return`Execution summary:
|
|
33
33
|
${Y.join(`
|
|
34
|
-
`)}`}function
|
|
34
|
+
`)}`}function yb(X,Q){let Y=`Failed to run property, too many pre-condition failures encountered
|
|
35
35
|
{ seed: ${X.seed} }
|
|
36
36
|
|
|
37
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=
|
|
39
|
-
Got ${
|
|
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=CK(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 bb(X){if(X instanceof E&&X.stack!==void 0)return X.stack;try{return F1(X)}catch(Q){}if(X instanceof E)try{return oy(X)}catch(Q){}if(X!==null&&typeof X==="object")try{return aZ(X)}catch(Q){}return"Failed to serialize errorInstance"}function gb(X,Q){let Y=X.runConfiguration.includeErrorInReport?`
|
|
39
|
+
Got ${cy(bb(X.errorInstance),/^Error: /,"error: ")}`:"",J=`Property failed after ${X.numRuns} tests
|
|
40
40
|
{ seed: ${X.seed}, path: "${X.counterexamplePath}", endOnFailure: true }
|
|
41
41
|
Counterexample: ${Q(X.counterexample)}
|
|
42
|
-
Shrunk ${X.numShrinks} time(s)${Y}`,$=null,G=[];if(X.verbose>=z1.VeryVerbose)$=
|
|
43
|
-
{ seed: ${X.seed} }`,J=null,$=[];if(X.verbose>=z1.VeryVerbose)J=
|
|
42
|
+
Shrunk ${X.numShrinks} time(s)${Y}`,$=null,G=[];if(X.verbose>=z1.VeryVerbose)$=CK(X.executionSummary,Q);else if(X.verbose===z1.Verbose)$=kb(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 hb(X,Q){let Y=`Property interrupted after ${X.numRuns} tests
|
|
43
|
+
{ seed: ${X.seed} }`,J=null,$=[];if(X.verbose>=z1.VeryVerbose)J=CK(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 tZ(X,Q){if(!X.failed)return;let{message:Y,details:J,hints:$}=X.counterexamplePath===null?X.interrupted?hb(X,Q):yb(X,Q):gb(X,Q),G=Y;if(J!==null)G+=`
|
|
44
44
|
|
|
45
45
|
${J}`;if($.length>0)G+=`
|
|
46
46
|
|
|
47
|
-
${Ib($)}`;return G}function xP(X){return sZ(X,g0)}async function kP(X){let Q=[];function Y(Z){let K=IP(Z);if(typeof K==="string")return K;return Q.push(Promise.all([Z,K])),"\u2026"}let J=sZ(X,Y);if(Q.length===0)return J;let $=new q4(await Promise.all(Q));function G(Z){let K=p1($,Z);if(K!==void 0)return K;return g0(Z)}return sZ(X,G)}function yP(X,Q){if(Q.runConfiguration.includeErrorInReport)throw new E(X);let Y=new E(X,{cause:Q.errorInstance});if(!("cause"in Y))Tb(Y,{cause:Q.errorInstance});return Y}function kb(X){if(!X.failed)return;throw yP(xP(X),X)}async function yb(X){if(!X.failed)return;throw yP(await kP(X),X)}function bb(X){if(X.runConfiguration.asyncReporter)return X.runConfiguration.asyncReporter(X);else if(X.runConfiguration.reporter)return X.runConfiguration.reporter(X);else return kb(X)}async function gb(X){if(X.runConfiguration.asyncReporter)return X.runConfiguration.asyncReporter(X);else if(X.runConfiguration.reporter)return X.runConfiguration.reporter(X);else return yb(X)}function hb(X,Q,Y,J,$){let G=new jP(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 mb(X,Q,Y,J,$){let G=new jP(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 bP(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=PK({...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=Fb(X,Y),$=Y.path.length===0||Y.path.indexOf(":")===-1?Y.numRuns:-1,G=Y.numRuns*Y.maxSkipsPerRun,Z=(...W)=>J.shrink(...W),K=new Pb(Y.path.length===0?EP(J,Y.seed,Y.randomType,Y.examples):vP(Y.path,a4(SP(J,Y.seed,Y.randomType,Y.examples)),Z),$,G),H=!Y.endOnFailure?Z:Q0.nil;return J.isAsync()?mb(J,H,K,Y.verbose,Y.markInterruptAsFailure).then((W)=>W.toRunDetails(Y.seed,Y.path,G,Y)):hb(J,H,K,Y.verbose,Y.markInterruptAsFailure).toRunDetails(Y.seed,Y.path,G,Y)}function db(X,Q){let Y=bP(X,Q);if(X.isAsync())return Y.then(gb);else bb(Y)}function pb(X,Q){let Y=!Object.prototype.hasOwnProperty.call(X,"isAsync")?new wP(X,()=>!0):X;return Q.unbiased===!0?new TP(Y):Y}function gP(X,Q){let Y=PK(typeof Q==="number"?{...N8(),numRuns:Q}:{...N8(),...Q}),J=pb(X,Y),$=J.shrink.bind(J);return(Y.path.length===0?a4(EP(J,Y.seed,Y.randomType,Y.examples)):vP(Y.path,a4(SP(J,Y.seed,Y.randomType,Y.examples)),$)).take(Y.numRuns).map((G)=>G.value_)}function cb(X,Q){return[...gP(X,Q)]}function fb(X){return(Math.round(X*100)/100).toFixed(2)}function ub(X,Q,Y){let J=PK(typeof Y==="number"?{...N8(),numRuns:Y}:{...N8(),...Y}),$={};for(let H of gP(X,Y)){let W=Q(H),V=Array.isArray(W)?W:[W];for(let _ of V)$[_]=($[_]||0)+1}let G=Object.entries($).sort((H,W)=>W[1]-H[1]).map((H)=>[H[0],`${fb(H[1]*100/J.numRuns)}%`]),Z=G.map((H)=>H[0].length).reduce((H,W)=>Math.max(H,W),0),K=G.map((H)=>H[1].length).reduce((H,W)=>Math.max(H,W),0);for(let H of G)J.logger(`${H[0].padEnd(Z,".")}..${H[1].padStart(K,".")}`)}var lb=Object.assign;function tZ(X,Q,Y,J){let $=Y(),G=X.clone(),Z={mrng:X.clone(),biasFactor:Q,history:[]},K=(W)=>{let V=$[Z.history.length];if(V!==void 0&&V.arb===W){let D=V.value;return S(Z.history,{arb:W,value:D,context:V.context,mrng:V.mrng}),G=V.mrng.clone(),D}let _=W.generate(G,Q);return S(Z.history,{arb:W,value:_.value_,context:_.context,mrng:G.clone()}),_.value};return new k(lb((W,...V)=>{return K(J(W,V))},{values(){return G0(Z.history,(W)=>W.value)},[r0](){return tZ(X,Q,Y,J).value},[M8](){return g0(G0(Z.history,(W)=>W.value))}}),Z)}var IZ=Array.isArray,tF=Object.keys,rb=Object.is;function ob(X){let Q=new q4;return function(J,$){let G=p1(Q,J);if(G===void 0){let H=J(...$);return R8(Q,J,[{args:$,value:H}]),H}let Z=G;for(let H of Z)if(X($,H.args))return H.value;let K=J(...$);return S(Z,{args:$,value:K}),K}}function hP(X,Q){if(X!==null&&typeof X==="object"&&Q!==null&&typeof Q==="object"){if(IZ(X)){if(!IZ(Q))return!1;if(X.length!==Q.length)return!1}else if(IZ(Q))return!1;if(tF(X).length!==tF(Q).length)return!1;for(let Y in X){if(!(Y in Q))return!1;if(!hP(X[Y],Q[Y]))return!1}return!0}else return rb(X,Q)}var nb=class extends I0{constructor(...X){super(...X);this.arbitraryCache=ob(hP)}generate(X,Q){return tZ(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 NP(G.map((Z)=>Z.arb),G.map((Z)=>Z.value),G.map((Z)=>Z.context)).map((Z)=>{function K(){let{value:H,context:W}=Z;return G0(G,(V,_)=>({arb:V.arb,value:H[_],context:W[_],mrng:V.mrng}))}return tZ(J,$,K,this.arbitraryCache)})}};function ib(){return new nb}var{floor:ab,log:eF}=Math;function sb(X){return ab(eF(X)/eF(2))}function tb(X){if(X===j(0))return j(0);return j(F1(X).length)}function mP(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:eb,floor:Xg}=Math;function XL(X){return Xg(X/2)}function QL(X){return eb(X/2)}function YL(X,Q,Y){let J=X-Q;function*$(){let Z=Y?void 0:Q,K=Y?J:XL(J);for(let H=K;H>0;H=XL(H)){let W=H===J?Q:X-H;yield new k(W,Z),Z=W}}function*G(){let Z=Y?void 0:Q,K=Y?J:QL(J);for(let H=K;H<0;H=QL(H)){let W=H===J?Q:X-H;yield new k(W,Z),Z=W}}return J>0?a4($()):a4(G())}var JL=Math.sign,Qg=Number.isInteger,Yg=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"&&Qg(Q)&&!Yg(Q,-0)&&this.min<=Q&&Q<=this.max}shrink(Q,Y){if(!X.isValidContext(Q,Y))return YL(Q,this.defaultTarget(),!0);if(this.isLastChanceTry(Q,Y))return Q0.of(new k(Y,void 0));return YL(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=mP(this.min,this.max,sb);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&&JL(Q)!==JL(Y))throw Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},$L=Number.isInteger;function Jg(X){return{min:X.min!==void 0?X.min:-2147483648,max:X.max!==void 0?X.max:2147483647}}function z0(X={}){let Q=Jg(X);if(Q.min>Q.max)throw Error("fc.integer maximum value should be equal or greater than the minimum one");if(!$L(Q.min))throw Error("fc.integer minimum value should be an integer");if(!$L(Q.max))throw Error("fc.integer maximum value should be an integer");return new _9(Q.min,Q.max)}var GL=new Map;function CK(X){if(X===void 0)return{depth:0};if(typeof X!=="string")return X;let Q=p1(GL,X);if(Q!==void 0)return Q;let Y={depth:0};return R8(GL,X,Y),Y}function TK(){return{depth:0}}var $g=class{constructor(X,Q,Y){this.arb=X,this.mrng=Q,this.biasFactor=Y}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},Gg=Math.min,Zg=Math.max,Kg=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=Gg(Q,Y),this.lastIndexInSlice=Zg(Q,Y),new k(X[this.nextIndexInSlice++],void 0)}};function ZL(X,Q,Y,J){if(J===void 0||Y.length===0||Q.nextInt(1,J)!==1)return new $g(X,Q,J);return new Kg(X,Q,Y,J)}var{floor:Hg,log:KL,max:HL}=Math,Wg=Array.isArray;function jZ(X,Q){if(X===Q)return X;return X+Hg(KL(Q-X)/KL(2))}var dP=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=CK(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=ZL(this.arb,J,this.customSlices,$);while(Z.size()<Y&&G<this.maxGeneratedLength){let H=K.next();if(Z.tryAdd(H))G=0;else G+=1}return Z.getData()}safeGenerateNItemsNoDuplicates(Q,Y,J,$){let G=HL(0,Y-jZ(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=ZL(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 $=HL(0,Q-jZ(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=[],H=[];for(let W=0;W!==G.length;++W){let V=G[W];Z=Z||V.hasToBeCloned,S(K,V.value),S(H,V.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:H,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=jZ(this.minLength,this.maxGeneratedLength);return{size:z0({min:this.minLength,max:J}).generate(Q,void 0).value,biasFactorItems:Y}}canShrinkWithoutContext(Q){if(!Wg(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($,i4(()=>this.arb.shrink(Q[G],Y.itemsContexts[G]).map((Z)=>{let K=G0(e0(Q,0,G),(W,V)=>new k(Z9(W),Y.itemsContexts[V])),H=G0(e0(Q,G+1),(W,V)=>new k(Z9(W),Y.itemsContexts[V+G+1]));return[[...K,Z,...H],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(Z9(Z),J.itemsContexts[K+G])),$.context,0]}).join(i4(()=>Q.length>this.minLength?this.shrinkItemByItem(Q,J,1):this.shrinkItemByItem(Q,J,Q.length))).join(Q.length>this.minLength?i4(()=>{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(Z9(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]))}},_g=Math.floor,Vg=Math.min,t6=2147483647,J9=["xsmall","small","medium","large","xlarge"],Dg=["-4","-3","-2","-1","=","+1","+2","+3","+4"],IK="small";function qg(X,Q){switch(Q){case"xsmall":return _g(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 UQ(X,Q){let Y=V4(Dg,X);if(Y===-1)return X;let J=V4(J9,Q);if(J===-1)throw Error(`Unable to offset size based on the unknown defaulted one: ${Q}`);let $=J+Y-4;return $<0?J9[0]:$>=J9.length?J9[J9.length-1]:J9[$]}function qQ(X,Q,Y,J){let{baseSize:$=IK,defaultSizeToMaxWhenMaxSpecified:G}=N8()||{},Z=X!==void 0?X:J&&G?"max":$;if(Z==="max")return Y;return Vg(qg(Q,UQ(Z,$)),Y)}function Bg(X,Q){if(typeof X==="number")return 1/X;let{baseSize:Y=IK,defaultSizeToMaxWhenMaxSpecified:J}=N8()||{},$=X!==void 0?X:Q&&J?"max":Y;if($==="max")return 0;switch(UQ($,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 jK(X){let{baseSize:Q=IK}=N8()||{};if(X===void 0)return Q;return UQ(X,Q)}function P0(X,Q={}){let Y=Q.size,J=Q.minLength||0,$=Q.maxLength,G=Q.depthIdentifier,Z=$!==void 0?$:t6;return new dP(X,J,qQ(Y,J,Z,$!==void 0),Z,G,void 0,Q.experimentalCustomSlices||[])}function U2(X){return X/j(2)}function WL(X,Q,Y){let J=X-Q;function*$(){let Z=Y?void 0:Q,K=Y?J:U2(J);for(let H=K;H>0;H=U2(H)){let W=X-H;yield new k(W,Z),Z=W}}function*G(){let Z=Y?void 0:Q,K=Y?J:U2(J);for(let H=K;H<0;H=U2(H)){let W=X-H;yield new k(W,Z),Z=W}}return J>0?a4($()):a4(G())}var Ug=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=mP(this.min,this.max,tb);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 WL(Q,this.defaultTarget(),!0);if(this.isLastChanceTry(Q,Y))return Q0.of(new k(Y,void 0));return WL(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 Og(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 zg(X){if(X[0]===void 0)return{};if(X[1]===void 0)return X[0];return{min:X[0],max:X[1]}}function s4(...X){let Q=Og(zg(X));if(Q.min>Q.max)throw Error("fc.bigInt expects max to be greater than or equal to min");return new Ug(Q.min,Q.max)}var Fg=Object.getPrototypeOf,ZQ=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(Fg(X)===ZQ.prototype&&X.generate===ZQ.prototype.generate&&X.canShrinkWithoutContext===ZQ.prototype.canShrinkWithoutContext&&X.shrink===ZQ.prototype.shrink)return X;return new ZQ(X)}function Lg(X){return X===1}function Pg(X){if(typeof X!=="boolean")throw Error("Unsupported input type");return X===!0?1:0}function OQ(){return v2(z0({min:0,max:1}).map(Lg,Pg))}var WQ=Object.is,Rg=class{constructor(X){this.values=X,this.fastValues=new K9(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||WQ($,-0),Y=Y||WQ($,0)}this.hasMinusZero=Q,this.hasPlusZero=Y}has(X){if(X===0){if(WQ(X,0))return this.hasPlusZero;return this.hasMinusZero}return S2(this.fastValues,X)}},pP=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(!s6(J))return new k(J,Y);return new k(J,Y,()=>J[r0]())}canShrinkWithoutContext(X){if(this.values.length===1)return WQ(this.values[0],X);if(this.fastValues===void 0)this.fastValues=new Rg(this.values);return this.fastValues.has(X)}shrink(X,Q){if(Q===0||WQ(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 pP(X)}function Ng(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 pP([X])}var Mg=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 Ag(){return b0(new Mg)}var wg=NaN,Cg=Number.isNaN;function cP(X){return new j2(X)}function fP(X){if(!(X instanceof j2)||X.constructor!==j2)throw new E("Not a valid value for date unmapper");return E2(X)}function Tg(X){return(Q)=>{return Q===X?new j2(wg):cP(Q)}}function Ig(X){return(Q)=>{let Y=fP(Q);return Cg(Y)?X:Y}}var _L=Number.isNaN;function uP(X={}){let Q=X.min!==void 0?E2(X.min):-8640000000000000,Y=X.max!==void 0?E2(X.max):8640000000000000,J=X.noInvalidDate;if(_L(Q))throw Error("fc.date min must be valid instance of Date");if(_L(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(cP,fP);let $=Y+1;return z0({min:Q,max:Y+1}).map(Tg($),Ig($))}var jg=Symbol.iterator,Eg=Array.isArray,Sg=Object.is,vg=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(!Eg(Q)||Q.length!==this.numValues)return!1;if(Q.length===0)return!0;for(let Y=1;Y<Q.length;++Y)if(!Sg(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])[jg]()),$=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 xg(X,Q){return new vg(X,Q)}var VL=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}},kg=Number.isNaN,yg=class{constructor(X){this.selector=X,this.selectedItemsExceptNaN=new K9,this.data=[]}tryAdd(X){let Q=this.selector(X);if(kg(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}},bg=Object.is,gg=class{constructor(X){this.selector=X,this.selectedItemsExceptMinusZero=new K9,this.data=[],this.hasMinusZero=!1}tryAdd(X){let Q=this.selector(X);if(bg(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}},hg=class{constructor(X){this.selector=X,this.selectedItems=new K9,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 mg(X){if(typeof X.comparator==="function"){if(X.selector===void 0){let K=X.comparator,H=(W,V)=>K(W.value_,V.value_);return()=>new VL(H)}let{comparator:J,selector:$}=X,G=(K)=>$(K.value_),Z=(K,H)=>J(G(K),G(H));return()=>new VL(Z)}let Q=X.selector||((J)=>J),Y=(J)=>Q(J.value_);switch(X.comparator){case"IsStrictlyEqual":return()=>new yg(Y);case"SameValueZero":return()=>new hg(Y);case"SameValue":case void 0:return()=>new gg(Y)}}function e6(X,Q={}){let Y=Q.minLength!==void 0?Q.minLength:0,J=Q.maxLength!==void 0?Q.maxLength:t6,$=qQ(Q.size,Y,J,Q.maxLength!==void 0),G=Q.depthIdentifier,Z=new dP(X,Y,$,J,G,mg(Q),[]);if(Y===0)return Z;return Z.filter((K)=>K.length>=Y)}var{create:dg,defineProperty:pg,getOwnPropertyDescriptor:cg,getPrototypeOf:DL,prototype:fg}=Object,ug=Reflect.ownKeys;function lg(X){let Q=X[1]?dg(null):{};for(let Y of X[0])pg(Q,Y[0],{enumerable:!0,configurable:!0,writable:!0,value:Y[1]});return Q}function rg(X){return X!==void 0&&!!X.configurable&&!!X.enumerable&&!!X.writable&&X.get===void 0&&X.set===void 0}function og(X){if(typeof X!=="object"||X===null)throw new E("Incompatible instance received: should be a non-null object");let Q=DL(X)===null,Y=DL(X)===fg;if(!Q&&!Y)throw new E("Incompatible instance received: should be of exact type Object");let J=G0(ug(X),($)=>[$,cg(X,$)]);if(!zP(J,([,$])=>rg($)))throw new E("Incompatible instance received: should contain only c/e/w properties without get/set");return[G0(J,([$,G])=>[$,G.value]),Q]}function ng(X){return X[0]}function EK(X,Q,Y={}){let J=!!Y.noNullPrototype;return e(e6(e(X,Q),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:ng,depthIdentifier:Y.depthIdentifier}),J?b0(!1):OQ()).map(lg,og)}var{POSITIVE_INFINITY:ig,MAX_SAFE_INTEGER:ag,isInteger:sg}=Number,tg=Math.floor,eg=Math.pow,Xh=Math.min,eZ=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,!sg(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:Bg(Y.depthSize,Y.maxDepth!==void 0),maxDepth:Y.maxDepth!==void 0?Y.maxDepth:ig,withCrossShrink:!!Y.withCrossShrink},CK(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((H)=>this.mapIntoValue(G,H,null,Z));if($.clonedMrngForFallbackFirst!==null){if($.cachedGeneratedForFirst===void 0)$.cachedGeneratedForFirst=this.safeGenerateForIndex($.clonedMrngForFallbackFirst,0,Z);let H=$.cachedGeneratedForFirst;return Q0.of(H).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=tg(eg(1+Q,this.context.depth))-1;return-Xh(this.totalWeight*Y,ag)||0}};function Qh(X){return X!==null&&X!==void 0&&typeof X==="object"&&!("generate"in X)&&!("arbitrary"in X)&&!("weight"in X)}function qL(X){if(ZP(X))return{arbitrary:X,weight:1};return X}function l0(...X){let Q=X[0];if(Qh(Q)){let J=G0(e0(X,1),qL);return eZ.from(J,Q,"fc.oneof")}let Y=G0(X,qL);return eZ.from(Y,{},"fc.oneof")}var Yh=Number.isInteger;function n4(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(!Yh(Q))throw Error("fc.nat maximum value should be an integer");return new _9(0,Q)}var Jh=Object.is;function $h(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 Gh(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 Zh(X){let Q=$h(X);return function(J){let $=Gh(Q,J);return $.entry.build(J-$.from)}}function Kh(X){let Q={mapping:new q4,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===D4.NEGATIVE_INFINITY)Q.negativeZeroIndex=Y;else R8(Q.mapping,Z,Y);++Y}}return Q}function Hh(X){let Q=null;return function(J){if(Q===null)Q=Kh(X);let $=Jh(J,-0)?Q.negativeZeroIndex:p1(Q.mapping,J);if($===void 0)throw new E("Unknown value encountered cannot be built using this mapToConstant");return $}}function Wh(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 V9(...X){return n4({max:Wh(X)-1}).map(Zh(X),Hh(X))}function lP(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=BP($);for(let Z=G.nextStartIndex;Z<=Q.length;++Z){let K=S0(Q,G.endIndexChunks,Z);if(X.canShrinkWithoutContext(K)){let H=[...G.chunks,K];if(Z===Q.length){if(H.length<Y)break;return H}if(S($,{endIndexChunks:G.endIndexChunks,nextStartIndex:Z+1,chunks:G.chunks}),H.length<J)S($,{endIndexChunks:Z,nextStartIndex:Z+1,chunks:H});break}}}}function _h(X){return w0(X,"")}function rP(X){return X.minLength!==void 0?X.minLength:0}function oP(X){return X.maxLength!==void 0?X.maxLength:t6}function Vh(X,Q){return rP(Q)<=X.length&&X.length<=oP(Q)}function Dh(X,Q){return function(J){if(typeof J!=="string")throw new E("Unsupported value");let $=lP(X,J,rP(Q),oP(Q));if($===void 0)throw new E("Unable to unmap received string");return $}}var nP=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function qh(X,Q,Y){let J;try{J=Y(X)}catch{return}for(let $ of J)if(!Q.canShrinkWithoutContext($))return;return J}function Bh(X,Q){let Y=[];for(let J of nP){let $=qh(J,X,Q);if($!==void 0)S(Y,$)}return Y}var BL=new WeakMap;function Uh(X){let Q=[];for(let Y of nP){let J=lP(X,Y,0,t6);if(J!==void 0)S(Q,J)}return Q}function Oh(X,Q){let Y=Fy(BL,X);if(Y===void 0)Y=Uh(X),zy(BL,X,Y);let J=[];for(let $ of Y)if(Vh($,Q))S(J,$);return J}var zh=[[0,127]],Fh=[[0,55295],[57344,1114111]],Lh=[[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]],Ph=[[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]],UL=String.fromCodePoint,Rh=Math.min,Nh=Math.max;function XK(X){if(X.length===1){let Y=UL(X[0]);return{num:1,build:()=>Y}}let Q=X[0];return{num:X[1]-X[0]+1,build:(Y)=>UL(Q+Y)}}function OL(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],H=Q[$],W=H[0],V=H.length===1?H[0]:H[1];if(K<W)J+=1;else if(V<Z)$+=1;else{let _=Nh(Z,W),D=Rh(K,V);if(Y.length>=1){let q=Y[Y.length-1];if((q.length===1?q[0]:q[1])+1===_)_=q[0],BP(Y)}if(S(Y,_===D?[_]:[_,D]),K<=D)J+=1;if(V<=D)$+=1}}return Y}var zL=Object.create(null);function Mh(X){switch(X){case"full":return Fh;case"ascii":return zh}}function Ah(X,Q){let Y=`${X}:${Q}`,J=zL[Y];if(J!==void 0)return J;let $=Mh(Q),G=X==="binary"?$:OL($,Lh),Z=[];for(let H of G)S(Z,XK(H));if(X==="grapheme"){let H=OL($,Ph);for(let W of H){let V=XK(W);S(Z,{num:V.num,build:(_)=>by(V.build(_),"NFD")})}}let K=V9(...Z);return zL[Y]=K,K}function KQ(X,Q){return Ah(X,Q)}function wh(X){if(typeof X.unit==="object")return X.unit;switch(X.unit){case"grapheme":return KQ("grapheme","full");case"grapheme-composite":return KQ("composite","full");case"grapheme-ascii":case void 0:return KQ("grapheme","ascii");case"binary":return KQ("binary","full");case"binary-ascii":return KQ("binary","ascii")}}function d0(X={}){let Q=wh(X),Y=Dh(Q,X),J=Oh(Q,X);return P0(Q,{...X,experimentalCustomSlices:J}).map(_h,Y)}var iP=Map,SK=String.fromCharCode,vK={num:26,build:(X)=>SK(X+97)},Ch={num:26,build:(X)=>SK(X+65)},aP={num:10,build:(X)=>SK(X+48)};function Th(X){let Q=ik(X);return X!==Q?Q:`%${VQ(H9(X,0),16)}`}function Ih(X){if(typeof X!=="string")throw Error("Unsupported");return decodeURIComponent(X)}var jh=()=>d0({unit:"binary",minLength:1,maxLength:1}).map(Th,Ih),EZ=void 0;function Eh(){if(EZ===void 0)EZ=V9(vK);return EZ}var O2=void 0;function QK(X){if(O2===void 0)O2=new iP;let Q=p1(O2,X);if(Q===void 0)Q=V9(vK,aP,{num:X.length,build:(Y)=>X[Y]}),R8(O2,X,Q);return Q}function Sh(X){return V9(vK,Ch,aP,{num:X.length,build:(Q)=>X[Q]})}var z2=void 0;function xK(X){if(z2===void 0)z2=new iP;let Q=p1(z2,X);if(Q===void 0)Q=l0({weight:10,arbitrary:Sh(X)},{weight:1,arbitrary:jh()}),R8(z2,X,Q);return Q}function U4(X,Q={}){let Y=Q.freq===void 0?6:Q.freq,J=FP(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 eZ.from($,G,"fc.option")}function vh(X){if(X.length>63)return!1;return X.length<4||X[0]!=="x"||X[1]!=="n"||X[2]!=="-"||X[3]!=="-"}var sP=Symbol("adapted-value");function xh(X,Q){let Y=Q(X.value_);if(!Y.adapted)return X;return new k(Y.value,sP)}var kh=class extends I0{constructor(X,Q){super();this.sourceArb=X,this.adapter=Q,this.adaptValue=(Y)=>xh(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===sP){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 tP(X,Q){return new kh(X,Q)}function yh([X,Q]){return Q===null?X:`${X}${Q[0]}${Q[1]}`}function bh(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 gh(X){let Q=QK("");return e(Q,U4(e(d0({unit:QK("-"),size:X,maxLength:61}),Q))).map(yh,bh).filter(vh)}function hh(X){return`${w0(X[0],".")}.${X[1]}`}function mh(X){if(typeof X!=="string")throw Error("Unsupported type");let Q=X.lastIndexOf(".");return[L1(S0(X,0,Q),"."),S0(X,Q+1)]}function dh(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 kK(X={}){let Q=jK(X.size),Y=UQ("-1",Q),J=d0({unit:Eh(),minLength:2,maxLength:63,size:Y});return tP(e(P0(gh(Q),{size:Y,minLength:1,maxLength:127}),J),dh).map(hh,mh)}function ph(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 ch(X){return w0(X,".")}function fh(X){if(typeof X!=="string")throw Error("Unsupported");return L1(X,".")}function uh(X){return`${X[0]}@${X[1]}`}function lh(X){if(typeof X!=="string")throw Error("Unsupported");return L1(X,"@",2)}function rh(X={}){return e(tP(P0(d0({unit:QK("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:X.size}),{minLength:1,maxLength:32,size:X.size}),ph).map(ch,fh),kK({size:X.size})).map(uh,lh)}var{NEGATIVE_INFINITY:oh,POSITIVE_INFINITY:YK,EPSILON:eP}=D4,yK=j(2146435072)*j(4294967296),nh=-yK-j(1),FL=4503599627370496,ih=j(4503599627370495),LL=j("9007199254740992"),JK=new Float64Array(1),PL=new Uint32Array(JK.buffer,JK.byteOffset);function ah(X){return JK[0]=X,[PL[1],PL[0]]}function sh(X){let{0:Q,1:Y}=ah(X),J=Q>>>31,$=Q>>>20&2047,G=(Q&1048575)*4294967296+Y,Z=$===0?-1022:$-1023,K=$===0?0:1;return K+=G*eP,K*=J===0?1:-1,{exponent:Z,significand:K}}function RL(X,Q){if(X===-1022)return j(Q*FL);return j((Q-1)*FL)+(j(X+1023)<<j(52))}function bK(X){if(X===YK)return yK;if(X===oh)return nh;let Q=sh(X),Y=Q.exponent,J=Q.significand;if(X>0||X===0&&1/X===YK)return RL(Y,J);else return-RL(Y,-J)-j(1)}function $K(X){if(X<0)return-$K(-X-j(1));if(X===yK)return YK;if(X<LL)return D4(X)*0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005;let Q=X-LL,Y=-1021+D4(Q>>j(52));return(1+D4(Q&ih)*eP)*2**Y}var NL=Number.isInteger,ML=Object.is,SZ=Number.NEGATIVE_INFINITY,vZ=Number.POSITIVE_INFINITY;function XR(X,Q,Y,J){let{noDefaultInfinity:$=!1,minExcluded:G=!1,maxExcluded:Z=!1,min:K=$?-Q:SZ,max:H=$?Q:vZ}=X,W=G?K<-Y?-J:Math.max(K,-Y):K===SZ?Math.max(K,-J):Math.max(K,-Y),V=Z?H>Y?J:Math.min(H,Y):H===vZ?Math.min(H,J):Math.min(H,Y);return{noDefaultInfinity:!1,minExcluded:G||(K!==SZ||G)&&NL(W),maxExcluded:Z||(H!==vZ||Z)&&NL(V),min:ML(W,-0)?0:W,max:ML(V,0)?-0:V,noNaN:X.noNaN||!1}}var{NEGATIVE_INFINITY:QR,POSITIVE_INFINITY:YR,MAX_VALUE:th}=Number,eh=4503599627370495.5,GK=4503599627370496;function Xm(X){return XR(X,th,eh,GK)}function Qm(X){return X===4503599627370496?YR:X===-4503599627370496?QR:X}function Ym(X){if(typeof X!=="number")throw Error("Unsupported type");return X===YR?GK:X===QR?-GK:X}var{isInteger:Jm,isNaN:JR,NEGATIVE_INFINITY:$m,POSITIVE_INFINITY:Gm,MAX_VALUE:AL}=Number,Zm=NaN;function wL(X,Q){if(JR(X))throw Error("fc.double constraints."+Q+" must be a 64-bit float");return bK(X)}function Km(X){if(typeof X!=="number")throw Error("Unsupported type");return bK(X)}function Hm(X){return!Jm(X)}function CL(X){let{noDefaultInfinity:Q=!1,noNaN:Y=!1,minExcluded:J=!1,maxExcluded:$=!1,min:G=Q?-AL:$m,max:Z=Q?AL:Gm}=X,K=wL(G,"min"),H=J?K+j(1):K,W=wL(Z,"max"),V=$?W-j(1):W;if(V<H)throw Error("fc.double constraints.min must be smaller or equal to constraints.max");if(Y)return s4({min:H,max:V}).map($K,Km);let _=V>j(0),D=_?H:H-j(1),q=_?V+j(1):V;return s4({min:D,max:q}).map((U)=>{if(V<U||U<H)return Zm;else return $K(U)},(U)=>{if(typeof U!=="number")throw Error("Unsupported type");if(JR(U))return V!==q?q:D;return bK(U)})}function b2(X={}){if(!X.noInteger)return CL(X);return CL(Xm(X)).map(Qm,Ym).filter(Hm)}var{NEGATIVE_INFINITY:Wm,POSITIVE_INFINITY:ZK}=Number,_m=Math.imul,KK=340282346638528860000000000000000000000,$R=2139095040,Vm=-2139095041,HK=new Float32Array(1),Dm=new Uint32Array(HK.buffer,HK.byteOffset);function qm(X){return HK[0]=X,Dm[0]}function Bm(X){let Q=qm(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 TL(X,Q){if(X===-126)return Q*8388608;return _m(X+127,8388608)+(Q-1)*8388608}function gK(X){if(X===ZK)return $R;if(X===Wm)return Vm;let Q=Bm(X),Y=Q.exponent,J=Q.significand;if(X>0||X===0&&1/X===ZK)return TL(Y,J);else return-TL(Y,-J)-1}function WK(X){if(X<0)return-WK(-X-1);if(X===$R)return ZK;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:GR,POSITIVE_INFINITY:ZR}=Number,Um=KK,Om=8388607.5,_K=8388608;function zm(X){return XR(X,Um,Om,_K)}function Fm(X){return X===8388608?ZR:X===-8388608?GR:X}function Lm(X){if(typeof X!=="number")throw Error("Unsupported type");return X===ZR?_K:X===GR?-_K:X}var{isInteger:Pm,isNaN:KR}=Number,Rm=Math.fround,Nm=Number.NEGATIVE_INFINITY,Mm=Number.POSITIVE_INFINITY,Am=NaN;function IL(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(KR(X)||Rm(X)!==X)throw Error(Y);return gK(X)}function wm(X){if(typeof X!=="number")throw Error("Unsupported type");return gK(X)}function Cm(X){return!Pm(X)}function jL(X){let{noDefaultInfinity:Q=!1,noNaN:Y=!1,minExcluded:J=!1,maxExcluded:$=!1,min:G=Q?-KK:Nm,max:Z=Q?KK:Mm}=X,K=IL(G,"min"),H=J?K+1:K,W=IL(Z,"max"),V=$?W-1:W;if(H>V)throw Error("fc.float constraints.min must be smaller or equal to constraints.max");if(Y)return z0({min:H,max:V}).map(WK,wm);let _=V>0?H:H-1,D=V>0?V+1:V;return z0({min:_,max:D}).map((q)=>{if(q>V||q<H)return Am;else return WK(q)},(q)=>{if(typeof q!=="number")throw Error("Unsupported type");if(KR(q))return V!==D?D:_;return gK(q)})}function HR(X={}){if(!X.noInteger)return jL(X);return jL(zm(X)).map(Fm,Lm).filter(Cm)}function Tm(X){return X.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function WR(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 Im=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(Im(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:jm,keys:Em}=Object;function _R(X){return e(k2(z0()),k2(z0({min:1,max:4294967295}))).map(([Q,Y])=>{let J=()=>{let $={};return jm((Z,K)=>{let H=g0(Z),W=g0(K),V=X(x2(`${Q}${H}`)%Y,x2(`${Q}${W}`)%Y);return $[`[${H},${W}]`]=V,V},{toString:()=>{let Z=Em($).sort().map((K)=>`${K} => ${g0($[K])}`).map((K)=>`/* ${WR(K)} */`);return`function(a, b) {
|
|
47
|
+
${xb($)}`;return G}function kP(X){return tZ(X,g0)}async function yP(X){let Q=[];function Y(Z){let K=jP(Z);if(typeof K==="string")return K;return Q.push(Promise.all([Z,K])),"\u2026"}let J=tZ(X,Y);if(Q.length===0)return J;let $=new D4(await Promise.all(Q));function G(Z){let K=p1($,Z);if(K!==void 0)return K;return g0(Z)}return tZ(X,G)}function bP(X,Q){if(Q.runConfiguration.includeErrorInReport)throw new E(X);let Y=new E(X,{cause:Q.errorInstance});if(!("cause"in Y))vb(Y,{cause:Q.errorInstance});return Y}function mb(X){if(!X.failed)return;throw bP(kP(X),X)}async function db(X){if(!X.failed)return;throw bP(await yP(X),X)}function pb(X){if(X.runConfiguration.asyncReporter)return X.runConfiguration.asyncReporter(X);else if(X.runConfiguration.reporter)return X.runConfiguration.reporter(X);else return mb(X)}async function cb(X){if(X.runConfiguration.asyncReporter)return X.runConfiguration.asyncReporter(X);else if(X.runConfiguration.reporter)return X.runConfiguration.reporter(X);else return db(X)}function fb(X,Q,Y,J,$){let G=new EP(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 ub(X,Q,Y,J,$){let G=new EP(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 gP(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=RK({...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=Mb(X,Y),$=Y.path.length===0||Y.path.indexOf(":")===-1?Y.numRuns:-1,G=Y.numRuns*Y.maxSkipsPerRun,Z=(...W)=>J.shrink(...W),K=new wb(Y.path.length===0?SP(J,Y.seed,Y.randomType,Y.examples):xP(Y.path,a4(vP(J,Y.seed,Y.randomType,Y.examples)),Z),$,G),H=!Y.endOnFailure?Z:Q0.nil;return J.isAsync()?ub(J,H,K,Y.verbose,Y.markInterruptAsFailure).then((W)=>W.toRunDetails(Y.seed,Y.path,G,Y)):fb(J,H,K,Y.verbose,Y.markInterruptAsFailure).toRunDetails(Y.seed,Y.path,G,Y)}function lb(X,Q){let Y=gP(X,Q);if(X.isAsync())return Y.then(cb);else pb(Y)}function rb(X,Q){let Y=!Object.prototype.hasOwnProperty.call(X,"isAsync")?new CP(X,()=>!0):X;return Q.unbiased===!0?new IP(Y):Y}function hP(X,Q){let Y=RK(typeof Q==="number"?{...N8(),numRuns:Q}:{...N8(),...Q}),J=rb(X,Y),$=J.shrink.bind(J);return(Y.path.length===0?a4(SP(J,Y.seed,Y.randomType,Y.examples)):xP(Y.path,a4(vP(J,Y.seed,Y.randomType,Y.examples)),$)).take(Y.numRuns).map((G)=>G.value_)}function ob(X,Q){return[...hP(X,Q)]}function nb(X){return(Math.round(X*100)/100).toFixed(2)}function ib(X,Q,Y){let J=RK(typeof Y==="number"?{...N8(),numRuns:Y}:{...N8(),...Y}),$={};for(let H of hP(X,Y)){let W=Q(H),V=Array.isArray(W)?W:[W];for(let _ of V)$[_]=($[_]||0)+1}let G=Object.entries($).sort((H,W)=>W[1]-H[1]).map((H)=>[H[0],`${nb(H[1]*100/J.numRuns)}%`]),Z=G.map((H)=>H[0].length).reduce((H,W)=>Math.max(H,W),0),K=G.map((H)=>H[1].length).reduce((H,W)=>Math.max(H,W),0);for(let H of G)J.logger(`${H[0].padEnd(Z,".")}..${H[1].padStart(K,".")}`)}var ab=Object.assign;function eZ(X,Q,Y,J){let $=Y(),G=X.clone(),Z={mrng:X.clone(),biasFactor:Q,history:[]},K=(W)=>{let V=$[Z.history.length];if(V!==void 0&&V.arb===W){let q=V.value;return S(Z.history,{arb:W,value:q,context:V.context,mrng:V.mrng}),G=V.mrng.clone(),q}let _=W.generate(G,Q);return S(Z.history,{arb:W,value:_.value_,context:_.context,mrng:G.clone()}),_.value};return new k(ab((W,...V)=>{return K(J(W,V))},{values(){return G0(Z.history,(W)=>W.value)},[r0](){return eZ(X,Q,Y,J).value},[M8](){return g0(G0(Z.history,(W)=>W.value))}}),Z)}var jZ=Array.isArray,eF=Object.keys,sb=Object.is;function tb(X){let Q=new D4;return function(J,$){let G=p1(Q,J);if(G===void 0){let H=J(...$);return R8(Q,J,[{args:$,value:H}]),H}let Z=G;for(let H of Z)if(X($,H.args))return H.value;let K=J(...$);return S(Z,{args:$,value:K}),K}}function mP(X,Q){if(X!==null&&typeof X==="object"&&Q!==null&&typeof Q==="object"){if(jZ(X)){if(!jZ(Q))return!1;if(X.length!==Q.length)return!1}else if(jZ(Q))return!1;if(eF(X).length!==eF(Q).length)return!1;for(let Y in X){if(!(Y in Q))return!1;if(!mP(X[Y],Q[Y]))return!1}return!0}else return sb(X,Q)}var eb=class extends I0{constructor(...X){super(...X);this.arbitraryCache=tb(mP)}generate(X,Q){return eZ(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 MP(G.map((Z)=>Z.arb),G.map((Z)=>Z.value),G.map((Z)=>Z.context)).map((Z)=>{function K(){let{value:H,context:W}=Z;return G0(G,(V,_)=>({arb:V.arb,value:H[_],context:W[_],mrng:V.mrng}))}return eZ(J,$,K,this.arbitraryCache)})}};function Xg(){return new eb}var{floor:Qg,log:XL}=Math;function Yg(X){return Qg(XL(X)/XL(2))}function Jg(X){if(X===j(0))return j(0);return j(F1(X).length)}function dP(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:$g,floor:Gg}=Math;function QL(X){return Gg(X/2)}function YL(X){return $g(X/2)}function JL(X,Q,Y){let J=X-Q;function*$(){let Z=Y?void 0:Q,K=Y?J:QL(J);for(let H=K;H>0;H=QL(H)){let W=H===J?Q:X-H;yield new k(W,Z),Z=W}}function*G(){let Z=Y?void 0:Q,K=Y?J:YL(J);for(let H=K;H<0;H=YL(H)){let W=H===J?Q:X-H;yield new k(W,Z),Z=W}}return J>0?a4($()):a4(G())}var $L=Math.sign,Zg=Number.isInteger,Kg=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"&&Zg(Q)&&!Kg(Q,-0)&&this.min<=Q&&Q<=this.max}shrink(Q,Y){if(!X.isValidContext(Q,Y))return JL(Q,this.defaultTarget(),!0);if(this.isLastChanceTry(Q,Y))return Q0.of(new k(Y,void 0));return JL(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=dP(this.min,this.max,Yg);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&&$L(Q)!==$L(Y))throw Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},GL=Number.isInteger;function Hg(X){return{min:X.min!==void 0?X.min:-2147483648,max:X.max!==void 0?X.max:2147483647}}function z0(X={}){let Q=Hg(X);if(Q.min>Q.max)throw Error("fc.integer maximum value should be equal or greater than the minimum one");if(!GL(Q.min))throw Error("fc.integer minimum value should be an integer");if(!GL(Q.max))throw Error("fc.integer maximum value should be an integer");return new _9(Q.min,Q.max)}var ZL=new Map;function TK(X){if(X===void 0)return{depth:0};if(typeof X!=="string")return X;let Q=p1(ZL,X);if(Q!==void 0)return Q;let Y={depth:0};return R8(ZL,X,Y),Y}function IK(){return{depth:0}}var Wg=class{constructor(X,Q,Y){this.arb=X,this.mrng=Q,this.biasFactor=Y}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},_g=Math.min,Vg=Math.max,qg=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=_g(Q,Y),this.lastIndexInSlice=Vg(Q,Y),new k(X[this.nextIndexInSlice++],void 0)}};function KL(X,Q,Y,J){if(J===void 0||Y.length===0||Q.nextInt(1,J)!==1)return new Wg(X,Q,J);return new qg(X,Q,Y,J)}var{floor:Dg,log:HL,max:WL}=Math,Bg=Array.isArray;function EZ(X,Q){if(X===Q)return X;return X+Dg(HL(Q-X)/HL(2))}var pP=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=TK(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=KL(this.arb,J,this.customSlices,$);while(Z.size()<Y&&G<this.maxGeneratedLength){let H=K.next();if(Z.tryAdd(H))G=0;else G+=1}return Z.getData()}safeGenerateNItemsNoDuplicates(Q,Y,J,$){let G=WL(0,Y-EZ(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=KL(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 $=WL(0,Q-EZ(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=[],H=[];for(let W=0;W!==G.length;++W){let V=G[W];Z=Z||V.hasToBeCloned,S(K,V.value),S(H,V.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:H,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=EZ(this.minLength,this.maxGeneratedLength);return{size:z0({min:this.minLength,max:J}).generate(Q,void 0).value,biasFactorItems:Y}}canShrinkWithoutContext(Q){if(!Bg(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($,i4(()=>this.arb.shrink(Q[G],Y.itemsContexts[G]).map((Z)=>{let K=G0(e0(Q,0,G),(W,V)=>new k(Z9(W),Y.itemsContexts[V])),H=G0(e0(Q,G+1),(W,V)=>new k(Z9(W),Y.itemsContexts[V+G+1]));return[[...K,Z,...H],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(Z9(Z),J.itemsContexts[K+G])),$.context,0]}).join(i4(()=>Q.length>this.minLength?this.shrinkItemByItem(Q,J,1):this.shrinkItemByItem(Q,J,Q.length))).join(Q.length>this.minLength?i4(()=>{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(Z9(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]))}},Ug=Math.floor,Og=Math.min,t6=2147483647,J9=["xsmall","small","medium","large","xlarge"],zg=["-4","-3","-2","-1","=","+1","+2","+3","+4"],jK="small";function Fg(X,Q){switch(Q){case"xsmall":return Ug(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=V4(zg,X);if(Y===-1)return X;let J=V4(J9,Q);if(J===-1)throw Error(`Unable to offset size based on the unknown defaulted one: ${Q}`);let $=J+Y-4;return $<0?J9[0]:$>=J9.length?J9[J9.length-1]:J9[$]}function BQ(X,Q,Y,J){let{baseSize:$=jK,defaultSizeToMaxWhenMaxSpecified:G}=N8()||{},Z=X!==void 0?X:J&&G?"max":$;if(Z==="max")return Y;return Og(Fg(Q,OQ(Z,$)),Y)}function Lg(X,Q){if(typeof X==="number")return 1/X;let{baseSize:Y=jK,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 EK(X){let{baseSize:Q=jK}=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?$:t6;return new pP(X,J,BQ(Y,J,Z,$!==void 0),Z,G,void 0,Q.experimentalCustomSlices||[])}function U2(X){return X/j(2)}function _L(X,Q,Y){let J=X-Q;function*$(){let Z=Y?void 0:Q,K=Y?J:U2(J);for(let H=K;H>0;H=U2(H)){let W=X-H;yield new k(W,Z),Z=W}}function*G(){let Z=Y?void 0:Q,K=Y?J:U2(J);for(let H=K;H<0;H=U2(H)){let W=X-H;yield new k(W,Z),Z=W}}return J>0?a4($()):a4(G())}var Pg=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=dP(this.min,this.max,Jg);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 _L(Q,this.defaultTarget(),!0);if(this.isLastChanceTry(Q,Y))return Q0.of(new k(Y,void 0));return _L(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 Rg(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 Ng(X){if(X[0]===void 0)return{};if(X[1]===void 0)return X[0];return{min:X[0],max:X[1]}}function s4(...X){let Q=Rg(Ng(X));if(Q.min>Q.max)throw Error("fc.bigInt expects max to be greater than or equal to min");return new Pg(Q.min,Q.max)}var Mg=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(Mg(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 Ag(X){return X===1}function wg(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(Ag,wg))}var _Q=Object.is,Cg=class{constructor(X){this.values=X,this.fastValues=new K9(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||_Q($,-0),Y=Y||_Q($,0)}this.hasMinusZero=Q,this.hasPlusZero=Y}has(X){if(X===0){if(_Q(X,0))return this.hasPlusZero;return this.hasMinusZero}return S2(this.fastValues,X)}},cP=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(!s6(J))return new k(J,Y);return new k(J,Y,()=>J[r0]())}canShrinkWithoutContext(X){if(this.values.length===1)return _Q(this.values[0],X);if(this.fastValues===void 0)this.fastValues=new Cg(this.values);return this.fastValues.has(X)}shrink(X,Q){if(Q===0||_Q(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 cP(X)}function Tg(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 cP([X])}var Ig=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 jg(){return b0(new Ig)}var Eg=NaN,Sg=Number.isNaN;function fP(X){return new j2(X)}function uP(X){if(!(X instanceof j2)||X.constructor!==j2)throw new E("Not a valid value for date unmapper");return E2(X)}function vg(X){return(Q)=>{return Q===X?new j2(Eg):fP(Q)}}function xg(X){return(Q)=>{let Y=uP(Q);return Sg(Y)?X:Y}}var VL=Number.isNaN;function lP(X={}){let Q=X.min!==void 0?E2(X.min):-8640000000000000,Y=X.max!==void 0?E2(X.max):8640000000000000,J=X.noInvalidDate;if(VL(Q))throw Error("fc.date min must be valid instance of Date");if(VL(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(fP,uP);let $=Y+1;return z0({min:Q,max:Y+1}).map(vg($),xg($))}var kg=Symbol.iterator,yg=Array.isArray,bg=Object.is,gg=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(!yg(Q)||Q.length!==this.numValues)return!1;if(Q.length===0)return!0;for(let Y=1;Y<Q.length;++Y)if(!bg(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])[kg]()),$=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 hg(X,Q){return new gg(X,Q)}var qL=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}},mg=Number.isNaN,dg=class{constructor(X){this.selector=X,this.selectedItemsExceptNaN=new K9,this.data=[]}tryAdd(X){let Q=this.selector(X);if(mg(Q))return S(this.data,X),!0;let Y=this.selectedItemsExceptNaN.size;if(VQ(this.selectedItemsExceptNaN,Q),Y!==this.selectedItemsExceptNaN.size)return S(this.data,X),!0;return!1}size(){return this.data.length}getData(){return this.data}},pg=Object.is,cg=class{constructor(X){this.selector=X,this.selectedItemsExceptMinusZero=new K9,this.data=[],this.hasMinusZero=!1}tryAdd(X){let Q=this.selector(X);if(pg(Q,-0)){if(this.hasMinusZero)return!1;return S(this.data,X),this.hasMinusZero=!0,!0}let Y=this.selectedItemsExceptMinusZero.size;if(VQ(this.selectedItemsExceptMinusZero,Q),Y!==this.selectedItemsExceptMinusZero.size)return S(this.data,X),!0;return!1}size(){return this.data.length}getData(){return this.data}},fg=class{constructor(X){this.selector=X,this.selectedItems=new K9,this.data=[]}tryAdd(X){let Q=this.selector(X),Y=this.selectedItems.size;if(VQ(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 ug(X){if(typeof X.comparator==="function"){if(X.selector===void 0){let K=X.comparator,H=(W,V)=>K(W.value_,V.value_);return()=>new qL(H)}let{comparator:J,selector:$}=X,G=(K)=>$(K.value_),Z=(K,H)=>J(G(K),G(H));return()=>new qL(Z)}let Q=X.selector||((J)=>J),Y=(J)=>Q(J.value_);switch(X.comparator){case"IsStrictlyEqual":return()=>new dg(Y);case"SameValueZero":return()=>new fg(Y);case"SameValue":case void 0:return()=>new cg(Y)}}function e6(X,Q={}){let Y=Q.minLength!==void 0?Q.minLength:0,J=Q.maxLength!==void 0?Q.maxLength:t6,$=BQ(Q.size,Y,J,Q.maxLength!==void 0),G=Q.depthIdentifier,Z=new pP(X,Y,$,J,G,ug(Q),[]);if(Y===0)return Z;return Z.filter((K)=>K.length>=Y)}var{create:lg,defineProperty:rg,getOwnPropertyDescriptor:og,getPrototypeOf:DL,prototype:ng}=Object,ig=Reflect.ownKeys;function ag(X){let Q=X[1]?lg(null):{};for(let Y of X[0])rg(Q,Y[0],{enumerable:!0,configurable:!0,writable:!0,value:Y[1]});return Q}function sg(X){return X!==void 0&&!!X.configurable&&!!X.enumerable&&!!X.writable&&X.get===void 0&&X.set===void 0}function tg(X){if(typeof X!=="object"||X===null)throw new E("Incompatible instance received: should be a non-null object");let Q=DL(X)===null,Y=DL(X)===ng;if(!Q&&!Y)throw new E("Incompatible instance received: should be of exact type Object");let J=G0(ig(X),($)=>[$,og(X,$)]);if(!FP(J,([,$])=>sg($)))throw new E("Incompatible instance received: should contain only c/e/w properties without get/set");return[G0(J,([$,G])=>[$,G.value]),Q]}function eg(X){return X[0]}function SK(X,Q,Y={}){let J=!!Y.noNullPrototype;return e(e6(e(X,Q),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:eg,depthIdentifier:Y.depthIdentifier}),J?b0(!1):zQ()).map(ag,tg)}var{POSITIVE_INFINITY:Xh,MAX_SAFE_INTEGER:Qh,isInteger:Yh}=Number,Jh=Math.floor,$h=Math.pow,Gh=Math.min,XK=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,!Yh(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:Lg(Y.depthSize,Y.maxDepth!==void 0),maxDepth:Y.maxDepth!==void 0?Y.maxDepth:Xh,withCrossShrink:!!Y.withCrossShrink},TK(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((H)=>this.mapIntoValue(G,H,null,Z));if($.clonedMrngForFallbackFirst!==null){if($.cachedGeneratedForFirst===void 0)$.cachedGeneratedForFirst=this.safeGenerateForIndex($.clonedMrngForFallbackFirst,0,Z);let H=$.cachedGeneratedForFirst;return Q0.of(H).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=Jh($h(1+Q,this.context.depth))-1;return-Gh(this.totalWeight*Y,Qh)||0}};function Zh(X){return X!==null&&X!==void 0&&typeof X==="object"&&!("generate"in X)&&!("arbitrary"in X)&&!("weight"in X)}function BL(X){if(KP(X))return{arbitrary:X,weight:1};return X}function l0(...X){let Q=X[0];if(Zh(Q)){let J=G0(e0(X,1),BL);return XK.from(J,Q,"fc.oneof")}let Y=G0(X,BL);return XK.from(Y,{},"fc.oneof")}var Kh=Number.isInteger;function n4(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(!Kh(Q))throw Error("fc.nat maximum value should be an integer");return new _9(0,Q)}var Hh=Object.is;function Wh(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 _h(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 Vh(X){let Q=Wh(X);return function(J){let $=_h(Q,J);return $.entry.build(J-$.from)}}function qh(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 Dh(X){let Q=null;return function(J){if(Q===null)Q=qh(X);let $=Hh(J,-0)?Q.negativeZeroIndex:p1(Q.mapping,J);if($===void 0)throw new E("Unknown value encountered cannot be built using this mapToConstant");return $}}function Bh(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 V9(...X){return n4({max:Bh(X)-1}).map(Vh(X),Dh(X))}function rP(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=UP($);for(let Z=G.nextStartIndex;Z<=Q.length;++Z){let K=S0(Q,G.endIndexChunks,Z);if(X.canShrinkWithoutContext(K)){let H=[...G.chunks,K];if(Z===Q.length){if(H.length<Y)break;return H}if(S($,{endIndexChunks:G.endIndexChunks,nextStartIndex:Z+1,chunks:G.chunks}),H.length<J)S($,{endIndexChunks:Z,nextStartIndex:Z+1,chunks:H});break}}}}function Uh(X){return w0(X,"")}function oP(X){return X.minLength!==void 0?X.minLength:0}function nP(X){return X.maxLength!==void 0?X.maxLength:t6}function Oh(X,Q){return oP(Q)<=X.length&&X.length<=nP(Q)}function zh(X,Q){return function(J){if(typeof J!=="string")throw new E("Unsupported value");let $=rP(X,J,oP(Q),nP(Q));if($===void 0)throw new E("Unable to unmap received string");return $}}var iP=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function Fh(X,Q,Y){let J;try{J=Y(X)}catch{return}for(let $ of J)if(!Q.canShrinkWithoutContext($))return;return J}function Lh(X,Q){let Y=[];for(let J of iP){let $=Fh(J,X,Q);if($!==void 0)S(Y,$)}return Y}var UL=new WeakMap;function Ph(X){let Q=[];for(let Y of iP){let J=rP(X,Y,0,t6);if(J!==void 0)S(Q,J)}return Q}function Rh(X,Q){let Y=My(UL,X);if(Y===void 0)Y=Ph(X),Ny(UL,X,Y);let J=[];for(let $ of Y)if(Oh($,Q))S(J,$);return J}var Nh=[[0,127]],Mh=[[0,55295],[57344,1114111]],Ah=[[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]],wh=[[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]],OL=String.fromCodePoint,Ch=Math.min,Th=Math.max;function QK(X){if(X.length===1){let Y=OL(X[0]);return{num:1,build:()=>Y}}let Q=X[0];return{num:X[1]-X[0]+1,build:(Y)=>OL(Q+Y)}}function zL(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],H=Q[$],W=H[0],V=H.length===1?H[0]:H[1];if(K<W)J+=1;else if(V<Z)$+=1;else{let _=Th(Z,W),q=Ch(K,V);if(Y.length>=1){let D=Y[Y.length-1];if((D.length===1?D[0]:D[1])+1===_)_=D[0],UP(Y)}if(S(Y,_===q?[_]:[_,q]),K<=q)J+=1;if(V<=q)$+=1}}return Y}var FL=Object.create(null);function Ih(X){switch(X){case"full":return Mh;case"ascii":return Nh}}function jh(X,Q){let Y=`${X}:${Q}`,J=FL[Y];if(J!==void 0)return J;let $=Ih(Q),G=X==="binary"?$:zL($,Ah),Z=[];for(let H of G)S(Z,QK(H));if(X==="grapheme"){let H=zL($,wh);for(let W of H){let V=QK(W);S(Z,{num:V.num,build:(_)=>py(V.build(_),"NFD")})}}let K=V9(...Z);return FL[Y]=K,K}function HQ(X,Q){return jh(X,Q)}function Eh(X){if(typeof X.unit==="object")return X.unit;switch(X.unit){case"grapheme":return HQ("grapheme","full");case"grapheme-composite":return HQ("composite","full");case"grapheme-ascii":case void 0:return HQ("grapheme","ascii");case"binary":return HQ("binary","full");case"binary-ascii":return HQ("binary","ascii")}}function d0(X={}){let Q=Eh(X),Y=zh(Q,X),J=Rh(Q,X);return P0(Q,{...X,experimentalCustomSlices:J}).map(Uh,Y)}var aP=Map,vK=String.fromCharCode,xK={num:26,build:(X)=>vK(X+97)},Sh={num:26,build:(X)=>vK(X+65)},sP={num:10,build:(X)=>vK(X+48)};function vh(X){let Q=Xy(X);return X!==Q?Q:`%${qQ(H9(X,0),16)}`}function xh(X){if(typeof X!=="string")throw Error("Unsupported");return decodeURIComponent(X)}var kh=()=>d0({unit:"binary",minLength:1,maxLength:1}).map(vh,xh),SZ=void 0;function yh(){if(SZ===void 0)SZ=V9(xK);return SZ}var O2=void 0;function YK(X){if(O2===void 0)O2=new aP;let Q=p1(O2,X);if(Q===void 0)Q=V9(xK,sP,{num:X.length,build:(Y)=>X[Y]}),R8(O2,X,Q);return Q}function bh(X){return V9(xK,Sh,sP,{num:X.length,build:(Q)=>X[Q]})}var z2=void 0;function kK(X){if(z2===void 0)z2=new aP;let Q=p1(z2,X);if(Q===void 0)Q=l0({weight:10,arbitrary:bh(X)},{weight:1,arbitrary:kh()}),R8(z2,X,Q);return Q}function U4(X,Q={}){let Y=Q.freq===void 0?6:Q.freq,J=LP(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 XK.from($,G,"fc.option")}function gh(X){if(X.length>63)return!1;return X.length<4||X[0]!=="x"||X[1]!=="n"||X[2]!=="-"||X[3]!=="-"}var tP=Symbol("adapted-value");function hh(X,Q){let Y=Q(X.value_);if(!Y.adapted)return X;return new k(Y.value,tP)}var mh=class extends I0{constructor(X,Q){super();this.sourceArb=X,this.adapter=Q,this.adaptValue=(Y)=>hh(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===tP){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 eP(X,Q){return new mh(X,Q)}function dh([X,Q]){return Q===null?X:`${X}${Q[0]}${Q[1]}`}function ph(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 ch(X){let Q=YK("");return e(Q,U4(e(d0({unit:YK("-"),size:X,maxLength:61}),Q))).map(dh,ph).filter(gh)}function fh(X){return`${w0(X[0],".")}.${X[1]}`}function uh(X){if(typeof X!=="string")throw Error("Unsupported type");let Q=X.lastIndexOf(".");return[L1(S0(X,0,Q),"."),S0(X,Q+1)]}function lh(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 yK(X={}){let Q=EK(X.size),Y=OQ("-1",Q),J=d0({unit:yh(),minLength:2,maxLength:63,size:Y});return eP(e(P0(ch(Q),{size:Y,minLength:1,maxLength:127}),J),lh).map(fh,uh)}function rh(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 oh(X){return w0(X,".")}function nh(X){if(typeof X!=="string")throw Error("Unsupported");return L1(X,".")}function ih(X){return`${X[0]}@${X[1]}`}function ah(X){if(typeof X!=="string")throw Error("Unsupported");return L1(X,"@",2)}function sh(X={}){return e(eP(P0(d0({unit:YK("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:X.size}),{minLength:1,maxLength:32,size:X.size}),rh).map(oh,nh),yK({size:X.size})).map(ih,ah)}var{NEGATIVE_INFINITY:th,POSITIVE_INFINITY:JK,EPSILON:XR}=q4,bK=j(2146435072)*j(4294967296),eh=-bK-j(1),LL=4503599627370496,Xm=j(4503599627370495),PL=j("9007199254740992"),$K=new Float64Array(1),RL=new Uint32Array($K.buffer,$K.byteOffset);function Qm(X){return $K[0]=X,[RL[1],RL[0]]}function Ym(X){let{0:Q,1:Y}=Qm(X),J=Q>>>31,$=Q>>>20&2047,G=(Q&1048575)*4294967296+Y,Z=$===0?-1022:$-1023,K=$===0?0:1;return K+=G*XR,K*=J===0?1:-1,{exponent:Z,significand:K}}function NL(X,Q){if(X===-1022)return j(Q*LL);return j((Q-1)*LL)+(j(X+1023)<<j(52))}function gK(X){if(X===JK)return bK;if(X===th)return eh;let Q=Ym(X),Y=Q.exponent,J=Q.significand;if(X>0||X===0&&1/X===JK)return NL(Y,J);else return-NL(Y,-J)-j(1)}function GK(X){if(X<0)return-GK(-X-j(1));if(X===bK)return JK;if(X<PL)return q4(X)*0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005;let Q=X-PL,Y=-1021+q4(Q>>j(52));return(1+q4(Q&Xm)*XR)*2**Y}var ML=Number.isInteger,AL=Object.is,vZ=Number.NEGATIVE_INFINITY,xZ=Number.POSITIVE_INFINITY;function QR(X,Q,Y,J){let{noDefaultInfinity:$=!1,minExcluded:G=!1,maxExcluded:Z=!1,min:K=$?-Q:vZ,max:H=$?Q:xZ}=X,W=G?K<-Y?-J:Math.max(K,-Y):K===vZ?Math.max(K,-J):Math.max(K,-Y),V=Z?H>Y?J:Math.min(H,Y):H===xZ?Math.min(H,J):Math.min(H,Y);return{noDefaultInfinity:!1,minExcluded:G||(K!==vZ||G)&&ML(W),maxExcluded:Z||(H!==xZ||Z)&&ML(V),min:AL(W,-0)?0:W,max:AL(V,0)?-0:V,noNaN:X.noNaN||!1}}var{NEGATIVE_INFINITY:YR,POSITIVE_INFINITY:JR,MAX_VALUE:Jm}=Number,$m=4503599627370495.5,ZK=4503599627370496;function Gm(X){return QR(X,Jm,$m,ZK)}function Zm(X){return X===4503599627370496?JR:X===-4503599627370496?YR:X}function Km(X){if(typeof X!=="number")throw Error("Unsupported type");return X===JR?ZK:X===YR?-ZK:X}var{isInteger:Hm,isNaN:$R,NEGATIVE_INFINITY:Wm,POSITIVE_INFINITY:_m,MAX_VALUE:wL}=Number,Vm=NaN;function CL(X,Q){if($R(X))throw Error("fc.double constraints."+Q+" must be a 64-bit float");return gK(X)}function qm(X){if(typeof X!=="number")throw Error("Unsupported type");return gK(X)}function Dm(X){return!Hm(X)}function TL(X){let{noDefaultInfinity:Q=!1,noNaN:Y=!1,minExcluded:J=!1,maxExcluded:$=!1,min:G=Q?-wL:Wm,max:Z=Q?wL:_m}=X,K=CL(G,"min"),H=J?K+j(1):K,W=CL(Z,"max"),V=$?W-j(1):W;if(V<H)throw Error("fc.double constraints.min must be smaller or equal to constraints.max");if(Y)return s4({min:H,max:V}).map(GK,qm);let _=V>j(0),q=_?H:H-j(1),D=_?V+j(1):V;return s4({min:q,max:D}).map((U)=>{if(V<U||U<H)return Vm;else return GK(U)},(U)=>{if(typeof U!=="number")throw Error("Unsupported type");if($R(U))return V!==D?D:q;return gK(U)})}function b2(X={}){if(!X.noInteger)return TL(X);return TL(Gm(X)).map(Zm,Km).filter(Dm)}var{NEGATIVE_INFINITY:Bm,POSITIVE_INFINITY:KK}=Number,Um=Math.imul,HK=340282346638528860000000000000000000000,GR=2139095040,Om=-2139095041,WK=new Float32Array(1),zm=new Uint32Array(WK.buffer,WK.byteOffset);function Fm(X){return WK[0]=X,zm[0]}function Lm(X){let Q=Fm(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 IL(X,Q){if(X===-126)return Q*8388608;return Um(X+127,8388608)+(Q-1)*8388608}function hK(X){if(X===KK)return GR;if(X===Bm)return Om;let Q=Lm(X),Y=Q.exponent,J=Q.significand;if(X>0||X===0&&1/X===KK)return IL(Y,J);else return-IL(Y,-J)-1}function _K(X){if(X<0)return-_K(-X-1);if(X===GR)return KK;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:ZR,POSITIVE_INFINITY:KR}=Number,Pm=HK,Rm=8388607.5,VK=8388608;function Nm(X){return QR(X,Pm,Rm,VK)}function Mm(X){return X===8388608?KR:X===-8388608?ZR:X}function Am(X){if(typeof X!=="number")throw Error("Unsupported type");return X===KR?VK:X===ZR?-VK:X}var{isInteger:wm,isNaN:HR}=Number,Cm=Math.fround,Tm=Number.NEGATIVE_INFINITY,Im=Number.POSITIVE_INFINITY,jm=NaN;function jL(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(HR(X)||Cm(X)!==X)throw Error(Y);return hK(X)}function Em(X){if(typeof X!=="number")throw Error("Unsupported type");return hK(X)}function Sm(X){return!wm(X)}function EL(X){let{noDefaultInfinity:Q=!1,noNaN:Y=!1,minExcluded:J=!1,maxExcluded:$=!1,min:G=Q?-HK:Tm,max:Z=Q?HK:Im}=X,K=jL(G,"min"),H=J?K+1:K,W=jL(Z,"max"),V=$?W-1:W;if(H>V)throw Error("fc.float constraints.min must be smaller or equal to constraints.max");if(Y)return z0({min:H,max:V}).map(_K,Em);let _=V>0?H:H-1,q=V>0?V+1:V;return z0({min:_,max:q}).map((D)=>{if(D>V||D<H)return jm;else return _K(D)},(D)=>{if(typeof D!=="number")throw Error("Unsupported type");if(HR(D))return V!==q?q:_;return hK(D)})}function WR(X={}){if(!X.noInteger)return EL(X);return EL(Nm(X)).map(Mm,Am).filter(Sm)}function vm(X){return X.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function _R(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 xm=Object.getPrototypeOf,WQ=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(xm(X)===WQ.prototype&&X.generate===WQ.prototype.generate&&X.canShrinkWithoutContext===WQ.prototype.canShrinkWithoutContext&&X.shrink===WQ.prototype.shrink)return X;return new WQ(X)}var{assign:km,keys:ym}=Object;function VR(X){return e(k2(z0()),k2(z0({min:1,max:4294967295}))).map(([Q,Y])=>{let J=()=>{let $={};return km((Z,K)=>{let H=g0(Z),W=g0(K),V=X(x2(`${Q}${H}`)%Y,x2(`${Q}${W}`)%Y);return $[`[${H},${W}]`]=V,V},{toString:()=>{let Z=ym($).sort().map((K)=>`${K} => ${g0($[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
|
`)}`:""}
|
|
@@ -52,39 +52,39 @@ ${Ib($)}`;return G}function xP(X){return sZ(X,g0)}async function kP(X){let Q=[];
|
|
|
52
52
|
const hA = hash('${Q}' + stringify(a)) % ${Y};
|
|
53
53
|
const hB = hash('${Q}' + stringify(b)) % ${Y};
|
|
54
54
|
return cmp(hA, hB);
|
|
55
|
-
}`},[r0]:J})};return J()})}var
|
|
55
|
+
}`},[r0]:J})};return J()})}var bm=Object.assign;function gm(){return VR(bm((X,Q)=>X<Q,{toString(){return"(hA, hB) => hA < hB"}}))}var hm=Object.assign;function mm(){return VR(hm((X,Q)=>X-Q,{toString(){return"(hA, hB) => hA - hB"}}))}var{defineProperties:dm,keys:pm}=Object;function cm(X){return e(P0(X,{minLength:1}),k2(z0())).map(([Q,Y])=>{let J=()=>{let $={},G=(...K)=>{let H=g0(K),W=Q[x2(`${Y}${H}`)%Q.length];return $[H]=W,s6(W)?W[r0]():W};function Z(K){let H=G0(G0(zP(pm($)),(W)=>`${W} => ${g0($[W])}`),(W)=>`/* ${_R(W)} */`);return`function(...args) {
|
|
56
56
|
// With hash and stringify coming from fast-check${H.length!==0?`
|
|
57
57
|
${H.join(`
|
|
58
58
|
`)}`:""}
|
|
59
59
|
const outs = ${K};
|
|
60
60
|
return outs[hash('${Y}' + stringify(args)) % outs.length];
|
|
61
|
-
}`}return ym(G,{toString:{value:()=>Z(g0(Q))},[M8]:{value:()=>Z(g0(Q))},[B4]:{value:async()=>Z(await MK(Q))},[r0]:{value:J,configurable:!0}})};return J()})}var{MIN_SAFE_INTEGER:hm,MAX_SAFE_INTEGER:mm}=Number;function VR(){return new _9(hm,mm)}var dm=Number.MAX_SAFE_INTEGER;function pm(){return new _9(0,dm)}var cm=Number.parseInt;function fm(X){let[Q,Y]=X;switch(Q){case"oct":return`0${VQ(Y,8)}`;case"hex":return`0x${VQ(Y,16)}`;default:return`${Y}`}}function M2(X,Q){let Y=cm(X,Q);if(VQ(Y,Q)!==X)throw Error("Invalid value");return Y}function um(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 lm(X){return w0(X,".")}function rm(X){if(typeof X!=="string")throw Error("Invalid type");return G0(L1(X,"."),(Q)=>M2(Q,10))}function hK(){return e(n4(255),n4(255),n4(255),n4(255)).map(lm,rm)}function h8(X){return e(m8("dec","oct","hex"),n4(X)).map(fm,um)}function xZ(X){return w0(X,".")}function kZ(X){if(typeof X!=="string")throw Error("Invalid type");return L1(X,".")}function DR(){return l0(e(h8(255),h8(255),h8(255),h8(255)).map(xZ,kZ),e(h8(255),h8(255),h8(65535)).map(xZ,kZ),e(h8(255),h8(16777215)).map(xZ,kZ),h8(4294967295))}function mK(X){if(X.length===0)return[];else return L1(X,":")}function dK(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 om(X){return`${w0(X[0],":")}:${X[1]}`}function nm(X){if(typeof X!=="string")throw Error("Invalid type");return dK(X)}function im(X){return`::${w0(X[0],":")}:${X[1]}`}function am(X){if(typeof X!=="string")throw Error("Invalid type");if(!xy(X,"::"))throw Error("Invalid value");return dK(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,$]=dK(Y);return[mK(Q),J,$]}function sm(X){return A2([X[0],[X[1]],X[2]])}function tm(X){let Q=w2(X);return[Q[0],w0(Q[1],":"),Q[2]]}function EL(X){return`${w0(X[0],":")}::${X[1]}`}function SL(X){if(typeof X!=="string")throw Error("Invalid type");let[Q,Y]=L1(X,"::",2);return[mK(Q),Y]}function em(X){return`${w0(X[0],":")}::`}function Xd(X){if(typeof X!=="string")throw Error("Invalid type");if(!ky(X,"::"))throw Error("Invalid value");return[mK(S0(X,0,X.length-2))]}function Qd([X,Q]){return`${X}:${Q}`}function Yd(X){if(typeof X!=="string")throw new E("Invalid type");if(!X.includes(":"))throw new E("Invalid value");return X.split(":",2)}var Jd="0123456789abcdef",yZ=void 0;function $d(){if(yZ===void 0)yZ=z0({min:0,max:15}).map((X)=>Jd[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 yZ}function qR(){let X=d0({unit:$d(),minLength:1,maxLength:4,size:"max"}),Q=l0(e(X,X).map(Qd,Yd),hK());return l0(e(P0(X,{minLength:6,maxLength:6,size:"max"}),Q).map(om,nm),e(P0(X,{minLength:5,maxLength:5,size:"max"}),Q).map(im,am),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(sm,tm),e(P0(X,{minLength:0,maxLength:5,size:"max"}),Q).map(EL,SL),e(P0(X,{minLength:0,maxLength:6,size:"max"}),X).map(EL,SL),e(P0(X,{minLength:0,maxLength:7,size:"max"})).map(em,Xd))}var Gd=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)}},Zd=Object.getOwnPropertyNames;function Kd(){let X=new q4;return(Y)=>{let J=p1(X,Y);if(J!==void 0)return J;return J=new Gd(String(Y)),R8(X,Y,J),J}}function BR(X){let Q=Kd(),Y=X(Q),J=Zd(Y);for(let $ of J){let G=Q($);G.underlying=Y[$]}return Y}function Hd(X,Q){for(let Y of X){let J=Q[Y]||{};if(J.maxLength===void 0||J.maxLength>0)return!0}return!1}function Wd(X,Q){if(X.length===0)return b0([]);if(!Hd(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)=>Hy(Y)).filter((Y)=>Y.length>0)}var{assign:vL,create:C2,defineProperty:UR,getPrototypeOf:xL,prototype:_d}=Object;function Vd(X){return UR(C2(null),M8,{configurable:!1,enumerable:!1,writable:!1,value:()=>X})}function kL(X,Q){return Vd(`<${F1(X)}#${Q}>`)}function Dd(X,Q){let Y=C2(_d);for(let J in X){let $=X[J],G=[];for(let Z of $){let K=vL(C2(xL(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 H in Z){let W=Z[H];K[H]=W.index===void 0?void 0:typeof W.index==="number"?Y[W.type][W.index]:G0(W.index,(V)=>Y[W.type][V])}UR(K,M8,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let H=X[J][G],W=vL(C2(xL(H)),H);for(let V in Z){let _=Z[V];W[V]=_.index===void 0?void 0:typeof _.index==="number"?kL(_.type,_.index):G0(_.index,(D)=>kL(_.type,D))}return g0(W)}})}}return Y}function qd(X){let Q=0,Y=new q4;for(let $ in X){let G=X[$];for(let Z in G){let K=G[Z];if(K.arity!=="inverse")continue;let H=p1(Y,K.type);if(H===void 0)H=new q4,R8(Y,K.type,H);if(Ny(H,K.forwardRelationship))throw new E(`Cannot declare multiple inverse relationships for the same forward relationship ${F1(K.forwardRelationship)} on type ${F1(K.type)}`);R8(H,K.forwardRelationship,{type:$,property:Z}),Q+=1}}let J=new q4;if(Q===0)return J;for(let $ in X){let G=X[$],Z=p1(Y,$);if(Z===void 0)continue;for(let K in G){let H=G[K];if(H.arity==="inverse")continue;let W=p1(Z,K);if(W===void 0)continue;if(W.type!==H.type)throw new E(`Inverse relationship ${F1(W.property)} on type ${F1(W.type)} references forward relationship ${F1(K)} but types do not match`);R8(J,H,W)}}if(J.size!==Q)throw new E("Some inverse relationships could not be matched with their corresponding forward relationships");return J}var yL=Object.create;function Bd(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 Ud(X,Q,Y,J,$,G,Z){let K=Bd(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 H=0,W=U4(e6(K,{depthIdentifier:$,selector:(_)=>_===J?_+ ++H:_,minLength:1}),{nil:[],depthIdentifier:$}).generate(G,Z).value,V=0;return G0(W,(_)=>_===J?_+V++:_)}}}var Od=class extends I0{constructor(X,Q){super();this.relations=X,this.defaultEntities=Q;let Y=new K9,J=new K9;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=qd(X)}createEmptyLinksInstanceFor(X){let Q=yL(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=yL(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],H=TK();H.depth=G.depth;for(let W in Z){let V=Z[W];if(V.arity==="inverse")continue;let _=V.type,D=Y[_],q=D.length,U=Ud(V.arity,V.strategy||"any",_===G.type?G.indexInType:void 0,D.length,H,X,Q);K[W]={type:_,index:U};let R=U===void 0?[]:typeof U==="number"?[U]:U;for(let L of R){if(L>=q)S(J,{type:_,indexInType:L,depth:G.depth+1}),S(D,this.createEmptyLinksInstanceFor(_));let N=p1(this.inversedRelations,V);if(N!==void 0){let P=D[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 zd(X,Q){return new Od(X,Q)}var{keys:Fd,getOwnPropertySymbols:Ld,getOwnPropertyDescriptor:Pd}=Object;function Rd(X){let Q=Fd(X),Y=Ld(X);for(let J=0;J!==Y.length;++J){let $=Y[J],G=Pd(X,$);if(G&&G.enumerable)Q.push($)}return Q}var{create:Nd,defineProperty:Md,getOwnPropertyDescriptor:Ad,getOwnPropertyNames:wd,getOwnPropertySymbols:Cd}=Object;function Td(X,Q){return function(J){let $=J[1]?Nd(null):{};for(let G=0;G!==X.length;++G){let Z=J[0][G];if(Z!==Q)Md($,X[G],{value:Z,configurable:!0,enumerable:!0,writable:!0})}return $}}function Id(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 V=0;V!==X.length;++V){let _=Ad(J,X[V]);if(_!==void 0){if(!_.configurable||!_.enumerable||!_.writable)throw Error("Incompatible instance received: should contain only c/e/w properties");if(_.get!==void 0||_.set!==void 0)throw Error("Incompatible instance received: should contain only no get/set properties");++Z,S(K,_.value)}else S(K,Q)}let H=wd(J).length,W=Cd(J).length;if(Z!==H+W)throw Error("Incompatible instance received: should not contain extra properties");return[K,$]}}var bZ=Symbol("no-key");function gZ(X,Q,Y){let J=Rd(X),$=[];for(let G=0;G!==J.length;++G){let Z=J[G],K=X[Z];if(Q===void 0||V4(Q,Z)!==-1)S($,K);else S($,U4(K,{nil:bZ}))}return e(e(...$),Y?b0(!1):OQ()).map(Td(J,bZ),Id(J,bZ))}function VK(X,Q){let Y=Q!==void 0&&!!Q.noNullPrototype;if(Q===void 0)return gZ(X,void 0,Y);if(!(("requiredKeys"in Q)&&Q.requiredKeys!==void 0))return gZ(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 gZ(X,J,Y)}var jd=Object.create;function Ed(X,Q,Y,J){let $=jd(null);for(let G in X){let Z=X[G],K=VK(Z,J),H=Q(G),W=Y(G),V={minLength:H,maxLength:H};$[G]=W!==void 0?e6(K,{...V,selector:W}):P0(K,V)}return VK($)}var{create:bL,keys:Sd}=Object;function vd(X,Q,Y={}){let J=Sd(X),$=Y.initialPoolConstraints||bL(null),G=Y.unicityConstraints||bL(null),Z={noNullPrototype:Y.noNullPrototype};return Wd(J,$).chain((K)=>zd(Q,K).chain((H)=>Ed(X,(W)=>H[W].length,(W)=>G[W],Z).map((W)=>Dd(W,H))))}function xd(X){return w0(G0(X,(Q)=>Q[Q.length-1]===","?S0(Q,0,Q.length-1):Q)," ")}function kd(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 yd(X){let Q=w0(X," ");if(Q[Q.length-1]===",")Q=S0(Q,0,Q.length-1);return FK(Q[0])+S0(Q,1)+"."}function bd(X){return function(Y){if(typeof Y!=="string")throw Error("Unsupported type");if(Y.length<2||Y[Y.length-1]!=="."||Y[Y.length-2]===","||FK(nZ(Y[0]))!==Y[0])throw Error("Unsupported value");let J=nZ(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 gd(X){return w0(X," ")}function hd(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 md(){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 dd(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 $=md();if(Y==="sentences")return P0(P0($,{minLength:1,size:"small"}).map(yd,bd($)),{minLength:1,maxLength:Q,size:J}).map(gd,hd);else return P0($,{minLength:1,maxLength:Q,size:J}).map(xd,kd($))}function pd(X){return new Map(X)}function cd(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 fd(X){return X[0]}function DK(X,Q,Y={}){return e6(e(X,Q),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:fd,depthIdentifier:Y.depthIdentifier,comparator:"SameValueZero"}).map(pd,cd)}var F2=10;function ud(X){let Q={};return(Y)=>{let J=Y!==void 0?Y:F2;if(!FP(Q,J)){let $=F2;F2=J-1,Q[J]=X(J),F2=$}return Q[J]}}function ld(X){let Q=0;while(X>j(0)){if(X&j(1))++Q;X>>=j(1)}return Q}function rd(X,Q){let Y=(j(1)<<j(Q))-j(1),J=X&Y,$=ld(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 od(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 hZ(X,Q,Y,J){for(let $=0,G=j(1);$!==Y.length;++$,G<<=j(1))if(Q&G)X[Y[$]]=J(X[Y[$]])}var nd=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=s4(j(0),(j(1)<<j($.length))-j(1)).generate(X,void 0);return hZ(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:od(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),H=rd($,K.length);return hZ(Z,H,K,this.toggleCase),new k(w0(Z,""),this.buildContextFor(G,new k(H,void 0)))}).join(i4(()=>{let G=[...J],Z=L2(G,this.toggleCase);return s4(j(0),(j(1)<<j(Z.length))-j(1)).shrink($,Y.flagsContext).map((K)=>{let H=e0(G);return hZ(H,K.value,Z,this.toggleCase),new k(w0(H,""),this.buildContextFor(new k(J,Y.rawStringContext),K))})}))}};function id(X){let Q=FK(X);if(Q!==X)return Q;return nZ(X)}function ad(X,Q){return new nd(X,Q&&Q.toggleCase||id,Q&&Q.untoggleAll)}function sd(X){return VP.from(X)}function td(X){if(!(X instanceof VP))throw Error("Unexpected type");return[...X]}function OR(X={}){return P0(HR(X),X).map(sd,td)}function ed(X){return DP.from(X)}function Xp(X){if(!(X instanceof DP))throw Error("Unexpected type");return[...X]}function zR(X={}){return P0(b2(X),X).map(ed,Xp)}function O4(X,Q,Y,J,$){let G=J.name,{min:Z=Q,max:K=Y,...H}=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}),H).map((W)=>J.from(W),(W)=>{if(!(W instanceof J))throw Error("Invalid type");return[...W]})}function FR(X={}){return O4(X,-32768,32767,fk,z0)}function LR(X={}){return O4(X,-2147483648,2147483647,uk,z0)}function PR(X={}){return O4(X,-128,127,ck,z0)}function RR(X={}){return O4(X,0,65535,ok,z0)}function NR(X={}){return O4(X,0,4294967295,nk,z0)}function MR(X={}){return O4(X,0,255,lk,z0)}function AR(X={}){return O4(X,0,255,rk,z0)}function Qp(X){return X!==void 0}function gL(X){if(X.hasToBeCloned)return new k(X.value_,{generatorContext:X.context},()=>X.value);return new k(X.value_,{generatorContext:X.context})}function hL(X){if(X.hasToBeCloned)return new k(X.value_,{shrinkerContext:X.context},()=>X.value);return new k(X.value_,{shrinkerContext:X.context})}var Yp=class extends I0{constructor(X,Q){super();this.generatorArbitrary=X,this.shrinkerArbitrary=Q}generate(X,Q){return gL(this.generatorArbitrary.generate(X,Q))}canShrinkWithoutContext(X){return this.shrinkerArbitrary.canShrinkWithoutContext(X)}shrink(X,Q){if(!Qp(Q))return this.shrinkerArbitrary.shrink(X,void 0).map(hL);if("generatorContext"in Q)return this.generatorArbitrary.shrink(X,Q.generatorContext).map(gL);return this.shrinkerArbitrary.shrink(X,Q.shrinkerContext).map(hL)}};function qK(X,Q,Y){let J=z0({min:X,max:Q});if(Q===Y)return J;return new Yp(J,z0({min:X,max:Y}))}var{min:Jp,max:BK}=Math,mL=WP.isArray,$p=Object.entries;function Gp(X){let Q=-1;for(let Y=0;Y!==X.length;++Y)Q=BK(Q,X[Y][0]);return Q}function Zp(X,Q){let Y=WP(X);for(let J=0;J!==Q.length;++J){let $=Q[J];if($[0]<X)Y[$[0]]=$[1]}return Y}function wR(X,Q={}){let{size:Y,minNumElements:J=0,maxLength:$=t6,maxNumElements:G=$,noTrailingHole:Z,depthIdentifier:K}=Q,H=qQ(Y,qQ(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 W=Jp(G,$),V=Q.maxNumElements!==void 0||Y!==void 0?Y:"=",_=e6(e(qK(0,BK(H-1,0),BK($-1,0)),X),{size:V,minLength:J,maxLength:W,selector:(D)=>D[0],depthIdentifier:K}).map((D)=>{return Zp(Gp(D)+1,D)},(D)=>{if(!mL(D))throw Error("Not supported entry type");if(Z&&D.length!==0&&!(D.length-1 in D))throw Error("No trailing hole");return G0($p(D),(q)=>[Number(q[0]),q[1]])});if(Z||$===J)return _;return e(_,qK(J,H,$)).map((D)=>{let q=D[0],U=D[1];if(q.length>=U)return q;let R=e0(q);return R.length=U,R},(D)=>{if(!mL(D))throw Error("Not supported entry type");return[D,D.length]})}function Kp(X){return new Set(X)}function Hp(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 CR(X,Q={}){return e6(X,{minLength:Q.minLength,maxLength:Q.maxLength,size:Q.size,depthIdentifier:Q.depthIdentifier,comparator:"SameValueZero"}).map(Kp,Hp)}function Wp(X,Q,Y,J,$,G){return EK(X,Q,{maxKeys:Y,noNullPrototype:!G,size:J,depthIdentifier:$})}function _p(X){return l0(PR(X),MR(X),AR(X),FR(X),RR(X),LR(X),NR(X),OR(X),zR(X))}function TR(X){let{values:Q,depthSize:Y}=X,J=TK(),$=X.maxDepth,G=X.maxKeys,Z=X.size,K=l0(...Q,...X.withBigInt?[s4()]:[],...X.withDate?[uP()]:[]);return BR((H)=>({anything:l0({maxDepth:$,depthSize:Y,depthIdentifier:J},K,H("array"),H("object"),...X.withMap?[H("map")]:[],...X.withSet?[H("set")]:[],...X.withObjectString?[H("anything").map((W)=>g0(W))]:[],...X.withTypedArray?[_p({maxLength:G,size:Z})]:[],...X.withSparseArray?[wR(H("anything"),{maxNumElements:G,size:Z,depthIdentifier:J})]:[]),keys:X.withObjectString?l0({arbitrary:X.key,weight:10},{arbitrary:H("anything").map((W)=>g0(W)),weight:1}):X.key,array:P0(H("anything"),{maxLength:G,size:Z,depthIdentifier:J}),set:CR(H("anything"),{maxLength:G,size:Z,depthIdentifier:J}),map:l0(DK(H("keys"),H("anything"),{maxKeys:G,size:Z,depthIdentifier:J}),DK(H("anything"),H("anything"),{maxKeys:G,size:Z,depthIdentifier:J})),object:Wp(H("keys"),H("anything"),G,Z,J,X.withNullPrototype)})).anything}function Vp(X){switch(typeof X){case"boolean":return new _P(X);case"number":return new D4(X);case"string":return new F1(X);default:return X}}function Dp(X){if(typeof X!=="object"||X===null||!("constructor"in X))return X;return X.constructor===_P||X.constructor===D4||X.constructor===F1?X.valueOf():X}function qp(X){return X.map(Vp,Dp)}function Bp(X,Q){return[OQ(),VR(),b2(),Q(X),l0(Q(X),b0(null),b0(void 0))]}function Up(X){return X.map((Q)=>qp(Q))}function Op(X,Q){return Q?Up(X).concat(X):X}function IR(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:d0(Q),values:Op(X.values!==void 0?X.values:Bp(Q,d0),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 zp(X){return EK(X.key,TR(X),{maxKeys:X.maxKeys,noNullPrototype:!X.withNullPrototype,size:X.size})}function Fp(X){return zp(IR(X))}function Lp(X,Q){let{depthSize:Y,maxDepth:J}=Q;return{key:X,values:[OQ(),b2({noDefaultInfinity:!0,noNaN:!0}),X,b0(null)],depthSize:Y,maxDepth:J}}function jR(X){return TR(IR(X))}function ER(X={}){let Q=X.noUnicodeString===void 0||X.noUnicodeString===!0;return jR(Lp("stringUnit"in X?d0({unit:X.stringUnit}):Q?d0():d0({unit:"binary"}),X))}var{stringify:Pp,parse:Rp}=JSON;function Np(X){if(typeof X!=="string")throw new E("Cannot unmap the passed value");return Rp(X)}function Mp(X={}){return ER(X).map(Pp,Np)}var Ap=Object.defineProperties;function mZ(X,Q){return`Stream(${Q!==void 0?`${w0(Q,",")}\u2026`:`${X} emitted`})`}var wp=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 Ap(new Q0(function*(K,H){while(!0){let W=K.generate(H,Y).value;if(G++,$!==null)S($,W);yield W}}(this.arb,X.clone())),{toString:{value:()=>mZ(G,$!==null?$.map(g0):void 0)},[M8]:{value:()=>mZ(G,$!==null?$.map(g0):void 0)},[B4]:{value:async()=>mZ(G,$!==null?await Promise.all($.map(MK)):void 0)},[r0]:{value:J,enumerable:!0}})};return new k(J(),void 0)}canShrinkWithoutContext(X){return!1}shrink(X,Q){return Q0.nil()}};function Cp(X,Q){return new wp(X,Q!==void 0&&typeof Q==="object"&&"noHistory"in Q?!Q.noHistory:!0)}function Tp(X){return w0(X,"")}function dL(X){if(typeof X!=="string")throw Error("Cannot unmap the passed value");return[...X]}function Ip(X){switch(X.length%4){case 0:return X;case 3:return`${X}=`;case 2:return`${X}==`;default:return S0(X,1)}}function jp(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 dZ=String.fromCharCode;function Ep(X){if(X<26)return dZ(X+65);if(X<52)return dZ(X+97-26);if(X<62)return dZ(X+48-52);return X===62?"+":"/"}function Sp(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 vp(){return z0({min:0,max:63}).map(Ep,Sp)}function xp(X={}){let{minLength:Q=0,maxLength:Y=t6,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=vp();return P0(K,{minLength:$,maxLength:G,size:Z,experimentalCustomSlices:Bh(K,dL)}).map(Tp,dL).map(Ip,jp)}var pL=Object.is;function kp(X,Q){let Y=new q4,J=0;for(let $ of X)if(pL($,-0))++J;else R8(Y,$,(p1(Y,$)||0)+1);for(let $=0;$!==Q.length;++$){if(!($ in Q))return!1;let G=Q[$];if(pL(G,-0)){if(J===0)return!1;--J}else{let Z=p1(Y,G)||0;if(Z===0)return!1;R8(Y,G,Z-1)}}return!0}var{floor:yp,log:cL}=Math,bp=Array.isArray,SR=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+yp(cL(J-Y)/cL(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]),UP($,K,1)}if(this.isOrdered)OP(G,(Z,K)=>Z-K);return new k(G0(G,(Z)=>this.originalArray[Z]),Y.context)}canShrinkWithoutContext(X){if(!bp(X))return!1;if(!this.lengthArb.canShrinkWithoutContext(X.length))return!1;return kp(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?i4(()=>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 gp(X,Q={}){let{minLength:Y=0,maxLength:J=X.length}=Q;return new SR(X,!0,Y,J)}function hp(X,Q={}){let{minLength:Y=0,maxLength:J=X.length}=Q;return new SR(X,!1,Y,J)}var mp={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"},dp={"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 pp(X){return X<10?F1(X):mp[X]}function fL(X,Q){let Y="";while(X.length+Y.length<Q)Y+="0";return Y+X}function uL(X){let Q="";for(let Y=X;Y!==0;){let J=Y>>5;Q=pp(Y-(J<<5))+Q,Y=J}return Q}function cp(X,Q){let Y=~~(X/1073741824),J=X&1073741823;return fL(uL(Y),Q-6)+fL(uL(J),6)}function vR(X){return function(Y){return cp(Y,X)}}function pZ(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 $=dp[X[J]];if($===void 0)throw new E("Unsupported type");Q+=$*Y,Y*=32}return Q}var fp=vR(10),lL=vR(8);function up(X){return fp(X[0])+lL(X[1])+lL(X[2])}function lp(X){if(typeof X!=="string"||X.length!==26)throw Error("Unsupported type");return[pZ(X.slice(0,10)),pZ(X.slice(10,18)),pZ(X.slice(18))]}function rp(){return e(z0({min:0,max:281474976710655}),z0({min:0,max:1099511627775}),z0({min:0,max:1099511627775})).map(up,lp)}function xR(X){return yy(VQ(X,16),8,"0")}function op(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!==xR(Q))throw Error("Unsupported value: invalid content");return Q}function cZ(X,Q){return z0({min:X,max:Q}).map(xR,op)}function np(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 ip=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function ap(X){if(typeof X!=="string")throw Error("Unsupported type");let Q=ip.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 rL="0123456789abcdef";function sp(X){let Q={},Y={};for(let G=0;G!==X.length;++G){let Z=rL[G],K=rL[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 tp(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 ep(X={}){let Q=cZ(0,4294967295),Y=X.version!==void 0?typeof X.version==="number"?[X.version]:X.version:[1,2,3,4,5,6,7,8];tp(Y);let{versionsApplierMapper:J,versionsApplierUnmapper:$}=sp(Y);return e(Q,cZ(0,268435456*Y.length-1).map(J,$),cZ(2147483648,3221225471),Q).map(np,ap)}function Xc(X){return d0({unit:xK("-._~!$&'()*+,;=:"),size:X})}function Qc([X,Q,Y]){return(X===null?"":`${X}@`)+Q+(Y===null?"":`:${Y}`)}function Yc(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 Jc(X){return`[${X}]`}function $c(X){if(typeof X!=="string"||X[0]!=="["||X[X.length-1]!=="]")throw Error("Unsupported");return X.substring(1,X.length-1)}function kR(X){let Q=X||{},Y=Q.size,J=[kK({size:Y}),...Q.withIPv4===!0?[hK()]:[],...Q.withIPv6===!0?[qR().map(Jc,$c)]:[],...Q.withIPv4Extended===!0?[DR()]:[]];return e(Q.withUserInfo===!0?U4(Xc(Y)):b0(null),l0(...J),Q.withPort===!0?U4(n4(65535)):b0(null)).map(Qc,Yc)}function yR(X){return d0({unit:xK("-._~!$&'()*+,;=:@/?"),size:X})}function bR(X={}){return yR(X.size)}function gR(X={}){return d0({unit:xK("-._~!$&'()*+,;=:@"),size:X.size})}function Gc(X){return w0(G0(X,(Q)=>`/${Q}`),"")}function Zc(X){if(typeof X!=="string")throw Error("Incompatible value received: type");if(X.length!==0&&X[0]!=="/")throw Error("Incompatible value received: start");return UP(L1(X,"/"),1)}function Kc(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 fZ(X,Q){return P0(gR({size:X}),{size:Q}).map(Gc,Zc)}function Hc(X){let[Q,Y]=Kc(X);if(Q===Y)return fZ(Q,Y);return l0(fZ(Q,Y),fZ(Y,Q))}function hR(X){return Hc(jK((X||{}).size))}function mR(X={}){return yR(X.size)}function Wc(X){let[Q,Y,J]=X;return`${Q}://${Y}${J}${X[3]===null?"":`?${X[3]}`}${X[4]===null?"":`#${X[4]}`}`}var _c=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function Vc(X){if(typeof X!=="string")throw Error("Incompatible value received: type");let Q=_c.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 Dc(X){let Q=X||{},Y=jK(Q.size),J=Q.authoritySettings!==void 0&&Q.authoritySettings.size!==void 0?UQ(Q.authoritySettings.size,Y):Y,$={...Q.authoritySettings,size:J};return e(m8(...Q.validSchemes||["http","https"]),kR($),hR({size:Y}),Q.withQueryParameters===!0?U4(mR({size:Y})):b0(null),Q.withFragments===!0?U4(bR({size:Y})):b0(null)).map(Wc,Vc)}var qc=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}},Bc=class X{constructor(Q){if(this.cmd=Q,this.hasRan=!1,RK(Q)){let Y=Q[M8];this[M8]=function(){return Y.call(Q)}}if(NK(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(s6(this.cmd))return new X(this.cmd[r0]());return new X(this.cmd)}toString(){return this.cmd.toString()}},oL=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)}},Uc=class extends I0{constructor(X,Q,Y,J,$){super();this.sourceReplayPath=J,this.disableReplayLog=$,this.oneCommandArb=l0(...X).map((G)=>new Bc(G)),this.lengthArb=qK(0,Q,Y),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(oL.stringify(this.replayPath))}`}buildValueFor(X,Q){let Y=X.map(($)=>$.value_),J={shrunkOnce:Q,items:X};return new k(new qc(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?oL.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 H=0;H!==G.length;++H)K.push(i4(()=>{let W=G.slice(0,H);return this.lengthArb.shrink(G.length-1-H,void 0).map((V)=>W.concat(G.slice(G.length-(V.value+1))))}));for(let H=0;H!==G.length;++H)K.push(i4(()=>this.oneCommandArb.shrink(G[H].value_,G[H].context).map((W)=>G.slice(0,H).concat([W],G.slice(H+1)))));return Z.join(...K).map((H)=>{return this.buildValueFor(H.map((W)=>new k(W.value_.clone(),W.context)),!0)})}};function Oc(X,Q={}){let{size:Y,maxCommands:J=t6,disableReplayLog:$=!1,replayPath:G=null}=Q;return new Uc(X,qQ(Y,0,J,Q.maxCommands!==void 0),J,G,$)}var zc=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}},Fc=function*(X,Q){for(let Y of Q)yield new zc(X,Y)},dR=(X,Q,Y,J,$)=>{return X.then((G)=>{let{model:Z,real:K}=G,H=Y;for(let W of Q)H=$(H,()=>{return J(W,Z,K)});return H})},Lc=(X,Q)=>{return dR({then:(G)=>{G(X())}},Q,void 0,(G,Z,K)=>{if(G.check(Z))G.run(Z,K)},(G,Z)=>Z())},Pc=(X)=>{return typeof X.then==="function"},pR=async(X,Q,Y=Promise.resolve())=>{return await dR({then:(Z)=>{let K=X();if(Pc(K))return K.then(Z);else return Z(K)}},Q,Y,async(Z,K,H)=>{if(await Z.check(K))await Z.run(K,H)},(Z,K)=>Z.then(K))};function Rc(X,Q){Lc(X,Q)}async function Nc(X,Q){await pR(X,Q)}async function Mc(X,Q,Y){let J=pR(Q,Fc(X,Y),X.schedule(Promise.resolve(),"startModel"));await X.waitFor(J),await X.waitAll()}var P2=(X)=>X(),cR=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 ${Tm(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,H=void 0,W=new Promise((V,_)=>{H=()=>{let D=Promise.resolve(Z!==void 0?J.then(()=>Z()):J);return D.then((q)=>{this.log(Q,K,Y,$,"resolved",q),V(q)},(q)=>{this.log(Q,K,Y,$,"rejected",q),_(q)}),D}});if(this.scheduledTasks.push({original:J,trigger:H,schedulingType:Q,taskId:K,label:Y,metadata:$,customAct:G}),this.scheduledWatchers.length!==0)this.scheduledWatchers[0]();return W}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:(V)=>V()},G=()=>{},Z=new Promise((V)=>{G=()=>V({done:J.done,faulty:J.faulty})}),K=()=>{J.faulty=!0,G()},H=()=>{J.done=!0,G()},W=(V,_)=>{if(V>=Q.length){_.then(H,K);return}_.then(()=>{let D=Q[V],[q,U,R]=typeof D==="function"?[D,D.name,void 0]:[D.builder,D.label,D.metadata],L=this.scheduleInternal("sequence",U,$,R,Y||P2,()=>q());W(V+1,L)},K)};return W(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,H=void 0,W=void 0,V=0,_=null,D=null,q=async()=>{V=50;for(V=50;!J&&V>0;--V)await Promise.resolve();if(!J&&this.scheduledTasks.length>0){if(G!==void 0)G();return D=this.waitOne($),D.then(()=>{return D=null,q()},(N)=>{throw D=null,J=!0,W(N),N})}if(!J&&Z!==void 0)Z();_=null},U=()=>{if(_!==null){V=51;return}_=q().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)=>{H=(y)=>{R(),N(y)},W=(y)=>{R(),P(y)}});if(Q.then((N)=>{if(J=!0,D===null)H(N);else D.then(()=>H(N),(P)=>W(P))},(N)=>{if(J=!0,D===null)W(N);else D.then(()=>W(N),()=>W(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 fR(X){let Q=0;return{clone:()=>fR(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 nL(X,Q){return new cR(X,fR(Q))}function uR(X){let Q=X.clone();return{clone:()=>uR(Q),nextTaskIndex:(Y)=>{return X.nextInt(0,Y.length-1)}}}var Ac=class extends I0{constructor(X){super();this.act=X}generate(X,Q){return new k(new cR(this.act,uR(X.clone())),void 0)}canShrinkWithoutContext(X){return!1}shrink(X,Q){return Q0.nil()}};function wc(X){let{act:Q=(Y)=>Y()}=X||{};return new Ac(Q)}function Cc(X,Q){let{act:Y=(J)=>J()}=Array.isArray(X)?Q||{}:X||{};if(Array.isArray(X))return nL(Y,X);return function(J,...$){return nL(Y,$)}}function Tc(X={}){return O4(X,j("-9223372036854775808"),j("9223372036854775807"),dk,s4)}function Ic(X={}){return O4(X,j(0),j("18446744073709551615"),pk,s4)}function jc(X,Q){return Q}var{floor:uZ,min:Ec}=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:uZ(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?uZ(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:uZ(Q/$)},expression:J.astNode},minLength:X.quantifier.from*J.minLength};return{astNode:{...X,expression:J.astNode},minLength:X.quantifier.from*J.minLength}}default:return jc(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,H=Q-Y+Z.minLength;S($,(H!==K?e1(Z.astNode,H):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:Ec(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 Sc(X,Q){return e1(X,Q).astNode}function vc(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},$=lR(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 lR(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:lR(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 vc(X)}}function xc(X){return T2(X,!0,!0)}function iL(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 UK(X){return X>="0"&&X<="9"}function rR(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 kc(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=rR(X,J);else if($==="(")Y+=1}throw Error("Missing closing ')'")}function yc(X,Q){let Y=!1;for(let J=Q;J!==X.length;++J){let $=X[J];if(UK($));else if(Q===J)return-1;else if($===","){if(Y)return-1;Y=!0}else if($==="}")return J;else return-1}return-1}var a6=function(X){return X[X.Full=0]="Full",X[X.Character=1]="Character",X}({});function bc(X,Q,Y,J){switch(X[Q]){case"[":if(J===a6.Character)return Q+1;return rR(X,Q+1)+1;case"{":{if(J===a6.Character)return Q+1;let $=yc(X,Q+1);if($===-1)return Q+1;return $+1}case"(":if(J===a6.Character)return Q+1;return kc(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(UK($)){let G=Y?X.length:Math.min(Q+4,X.length),Z=Q+2;for(;Z<G&&UK(X[Z]);++Z);return Z}return Q+(Y?iL(X,Q+1):1)+1}}default:return Q+(Y?iL(X,Q):1)}}function R2(X,Q,Y,J){let $=bc(X,Q,Y,J);return X.substring(Q,$)}var aL={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"},BQ=cK(g2),pK={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"},OK=cK(pK),oR={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"},sL=cK(oR);function cK(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 gc(X){return X in pK||X in OK}function hc(X){return X in g2||X in BQ}function tL(X){if(X in aL)return aL[X];if(X in BQ)return BQ[X];if(X in g2||X==="General_Category"||X==="Script"||X==="Script_Extensions")return X;throw Error(`Unknown Unicode property name: ${X}`)}function eL(X){if(X in OK)return OK[X];if(X in sL)return sL[X];if(X in BQ)return BQ[X];if(X in pK||X in oR||X in g2)return X;throw Error(`Unknown Unicode property value: ${X}`)}function mc(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:tL(J),canonicalValue:eL($)}}if(gc(X))return{type:"UnicodeProperty",name:"General_Category",value:X,negative:Q,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:eL(X)};if(hc(X)){let J=tL(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 lZ=String.fromCodePoint;function rZ(X){let Q=X.pop();if(Q===void 0)throw Error("Unable to extract token preceeding the currently parsed one");return Q}function nR(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 $9(X,Q){return{type:"Char",kind:"meta",symbol:Q,value:X,codePoint:Q.codePointAt(0)||-1}}function r4(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 oZ(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:lZ(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:lZ(J),value:X,codePoint:J}}case"0":return $9(X,"\x00");case"n":return $9(X,`
|
|
63
|
-
`);case"f":return $9(X,"\f");case"r":return $9(X,"\r");case"t":return $9(X,"\t");case"v":return $9(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(
|
|
64
|
-
\v\f`],
|
|
65
|
-
`],iR=[..."\x1E\x15"],oc=[...zK,...iR],n6=()=>d0({unit:"grapheme-ascii",minLength:1,maxLength:1});function GP(X){return new E(`Unsupported AST node! Received: ${g0(X)}`)}function o4(X,Q,Y){switch(X.type){case"Char":if(X.kind==="meta")switch(X.value){case"\\w":return m8(...YP);case"\\W":return n6().filter((J)=>V4(YP,J)===-1);case"\\d":return m8(...JP);case"\\D":return n6().filter((J)=>V4(JP,J)===-1);case"\\s":return m8(...$P);case"\\S":return n6().filter((J)=>V4($P,J)===-1);case"\\b":case"\\B":throw new E(`Meta character ${X.value} not implemented yet!`);case".":{let J=Y.dotAll?iR:oc;return n6().filter(($)=>V4(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=o4(X.expression,Q,Y);switch(X.quantifier.kind){case"*":return d0({...Q,unit:J});case"+":return d0({...Q,minLength:1,unit:J});case"?":return d0({...Q,minLength:0,maxLength:1,unit:J});case"Range":return d0({...Q,minLength:X.quantifier.from,maxLength:X.quantifier.to,unit:J});default:throw GP(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)=>o4(J,Q,Y))).map((J)=>w0(J,""));case"CharacterClass":if(X.negative){let J=G0(X.expressions,($)=>o4($,Q,Y));return n6().filter(($)=>zP(J,(G)=>!G.canShrinkWithoutContext($)))}return l0(...G0(X.expressions,(J)=>o4(J,Q,Y)));case"ClassRange":{let J=X.from.codePoint,$=X.to.codePoint;return z0({min:J,max:$}).map((G)=>rc(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 o4(X.expression,Q,Y);case"Disjunction":return l0(X.left!==null?o4(X.left,Q,Y):b0(""),X.right!==null?o4(X.right,Q,Y):b0(""));case"Assertion":if(X.kind==="^"||X.kind==="$"){if(Y.multiline)if(X.kind==="^")return l0(b0(""),e(d0({unit:n6()}),m8(...zK)).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(...zK),d0({unit:n6()})).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 lc(X);default:throw GP(X)}}function nc(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=xc(dc(X));if(Y!==void 0)G=Sc(G,Y);let Z=o4(G,J,$);if(Y!==void 0)return Z.filter((K)=>[...K].length<=Y);return Z}function ic(X){let Q=[];for(let Y=0;Y!==X.length;++Y)Q.push(X[Y].next());return Q}function ac(X,Q){for(let Y=0;Y!==X.length;++Y)Q[Y]=X[Y].next()}function sc(X){for(let Q=0;Q!==X.length;++Q)if(X[Q].done)return!0;return!1}function*tc(...X){let Q=ic(X);while(!sc(Q))yield Q.map((Y)=>Y.value),ac(X,Q)}function*ec(X){let Q=X;while(!0)yield Q,++Q}var Xf=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(tc(this.arb.shrink(X,Q),ec(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 Qf(X,Q){return new Xf(X,Q)}var Yf="module",Jf="4.7.0",$f="fd1a1840b2fda7f909f825083bd486318adfcf11";var zQ=Y2;function c1(){return(X,Q,Y)=>{return I(new h6(X.map(rX),(J)=>Q(J.map(($)=>I($))),Y))}}function z4(X,Q){return c1()([],()=>(Y,J)=>X(Y)?h(Y):v(new x0(J,F(Y))),Q)}function Gf(X){return X}function Zf(X){return(Q)=>Q.annotate(X)}function Kf(X){return(Q)=>uK(uK(Q).annotate(X))}function Hf(X){return(Q)=>{return Q.rebuild(sX(Q.ast,X))}}function Wf(X){return X}function _f(X){return M(X,J2)}function aR(X){return V8(X)?X.value:{issues:[{message:Y$(X.cause)}]}}function Vf(X,Q){let Y=y0(X),J={errors:"all",...Q?.parseOptions},$=_U(Q),G=(Z)=>{let K=new A5,H=h5(y$(Y(Z,J),{onFailure:$,onSuccess:(V)=>({value:V})}),{scheduler:K});H.currentDispatcher?.flush();let W=H.pollUnsafe();if(W)return aR(W);return new Promise((V)=>{H.addObserver((_)=>{V(aR(_))})})};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 sR(X,Q){let Y=UM(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=hz(Y),$=J.schema;if(Object.keys(J.definitions).length>0)$.definitions=J.definitions;return $}throw new globalThis.Error(`Unsupported target: ${Q}`)}function Df(X){let Q={input(Y){return sR(X,Y.target)},output(Y){return sR(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 $N=qz,qf=Uz;function GN(X){let Q=y0(X);return(Y,J)=>{return y1(Q(Y,J),($)=>new _4($))}}var Bf=GN;function ZN(X){let Q=Fz(X);return(Y,J)=>{return p7(Q(Y,J),($)=>new _4($))}}var Uf=ZN,Of=XZ,zf=Lz,Ff=QZ,Lf=Pz,Pf=Oz,Rf=zz,Nf=YZ,Mf=eY;function KN(X){let Q=l6(X);return(Y,J)=>{return y1(Q(Y,J),($)=>new _4($))}}var HN=KN;function WN(X){let Q=Nz(X);return(Y,J)=>{return p7(Q(Y,J),($)=>new _4($))}}var Af=WN,wf=$Z,Cf=Mz,Tf=GZ,If=Az,jf=JZ,Ef=Rz,Sf=ZZ,vf=X2,I=r6;function xf(X){class Q{}return Object.setPrototypeOf(Q,X)}function m2(X){return M(X,zQ)&&X[zQ]===zQ}var X5=W1((X)=>I(lY(X.ast),{schema:X})),kf=W1((X)=>X.schema),B9=W1((X)=>X5(c2(X))),yf=W1((X)=>X.schema.members[0]),bf=W1((X)=>I(fG(X.ast),{schema:X})),gf=W1((X)=>X.schema),P1=W1((X)=>I(z8(X.ast),{schema:X})),U9=W1((X)=>I(J1(X.ast),{schema:X})),FQ="~effect/Schema/flip";function hf(X){return M(X,FQ)&&X[FQ]===FQ}function uK(X){if(hf(X))return X.schema.rebuild(O8(X.ast));return I(O8(X.ast),{[FQ]:FQ,schema:X})}function X1(X){let Q=I(new b1(X),{literal:X,transform(Y){return Q.pipe(m(X1(Y),{decode:n(()=>Y),encode:n(()=>X)}))}});return Q}function _N(X){return new yG(X.map((Q)=>m2(Q)?Q.ast:new b1(Q)))}function mf(X){return I(_N(X),{parts:X})}function df(X){return I(_N(X).asTemplateLiteralParser(),{parts:X})}function pf(X){return I(new kG(Object.keys(X).filter((Q)=>typeof X[X[Q]]!=="number").map((Q)=>[Q,X[Q]])),{enums:X})}var cf=I(qO),LQ=I(UO),d2=I(b6),nK=I(a5),iK=I(xG),r=I(m6),e4=I(gG),VN=I(MO),DN=I(wO),p2=I(TO),ff=I(VO),uf=I(FO);function lf(X){return I(new bG(X))}function aK(X,Q){return I(X,{fields:Q,mapFields(Y,J){let $=Y(this.fields);return aK(hY($,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function R0(X){return aK(hY(X,void 0),X)}function rf(X){return W1((Q)=>Q.mapFields(Jz(X)))}function of(X){return function(Q){let Y={},J={};for(let $ in Q.fields){let G=U9(Q.fields[$]);if(Object.hasOwn(X,$))Y[X[$]]=G,J[X[$]]=$;else Y[$]=G}return R0(Y).pipe(m(Q,v0({decode:iG(J),encode:iG(X)})))}}function nf(X,Q){return(Y)=>{let J=L5(Y.fields,P1),$=R0({...J,...X});return Y.pipe(m($,v0({decode:(G)=>{let Z={...G};for(let K in X){let H=Q[K],W=H(G);if(B1(W))Z[K]=W.value}return Z},encode:(G)=>{let Z={...G};for(let K in X)delete Z[K];return Z}})))}}function qN(X,Q,Y){let J=Y?.keyValueCombiner?.decode||Y?.keyValueCombiner?.encode?new gY(Y.keyValueCombiner.decode,Y.keyValueCombiner.encode):void 0;return I(mO(X.ast,Q.ast,J),{key:X,value:Q})}function af(X,Q){return I(IO(X.ast,Q.map(rX)),{schema:X,records:Q})}function BN(X,Q){return I(X,{elements:Q,mapElements(Y,J){let $=Y(this.elements);return BN(dG($,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function q9(X){return BN(dG(X),X)}function sf(X,Q){return I(jO(X.ast,Q.map(rX)),{schema:X,rest:Q})}var c0=W1((X)=>I(new W4(!1,[],[X.ast]),{schema:X}));var tf=W1((X)=>I(new W4(!1,[X.ast],[X.ast]),{schema:X}));function ef(X){return o0([X,c0(X)]).pipe(m(c0(P1(X)),v0({decode:LW,encode:(Q)=>Q.length===1?Q[0]:Q})))}function Xu(X){return c0(X).check(yN())}var Qu=W1((X)=>{return I(new W4(!0,X.ast.elements,X.ast.rest),{schema:X})});function UN(X,Q){return I(X,{members:Q,mapMembers(Y,J){let $=Y(this.members);return UN(mY($,this.ast.mode,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function o0(X,Q){return UN(mY(X,Q?.mode??"anyOf",void 0),X)}function sK(X){let Q=X.map(X1);return I(mY(Q,"anyOf",void 0),{literals:X,members:Q,mapMembers(Y){return o0(Y(this.members))},pick(Y){return sK(Y)},transform(Y){return o0(Q.map((J,$)=>J.transform(Y[$])))}})}var tK=W1((X)=>o0([X,nK])),c2=W1((X)=>o0([X,iK])),ON=W1((X)=>o0([X,nK,iK]));function zN(X){return I(new dY(()=>X().ast))}function Yu(...X){return(Q)=>Q.check(...X)}function Ju(X,Q){return(Y)=>I(f4(Y.ast,[pY(X,Q)]),{schema:Y})}function FN(X){return(Q)=>I(bO(Q.ast,X),{schema:Q,identifier:X})}function $u(X,Q){return(Y)=>{return(Q.checks?Y.check(...Q.checks):Y).pipe(FN(X))}}function eK(X){return(Q)=>I(kO(Q.ast,new mX(X,b)),{schema:Q})}function LN(X){return(Q)=>I(yO(Q.ast,new mX(b,X)),{schema:Q})}function Gu(X){return PN(X)}function PN(X){return(Q)=>Q.pipe(eK(d5(X)))}function Zu(X){return RN(X)}function RN(X){return(Q)=>Q.pipe(LN(d5(X)))}function m(X,Q){return(Y)=>{return I(rY(Y.ast,X.ast,Q?jY(Q):y6()),{from:Y,to:X})}}function Ku(X){return(Q)=>{return Q.pipe(m(P1(Q),X))}}function XH(X,Q){return(Y)=>{return Q?X.pipe(m(Y,Q)):X.pipe(m(Y))}}function Hu(X){return(Q)=>{return U9(Q).pipe(m(Q,X))}}function NN(X){return(Q)=>I(gO(Q.ast,X),{schema:Q})}function QH(X,Q){let Y=Q?.encodingStrategy==="omit"?LG():T1();return(J)=>{return X5(U9(J)).pipe(m(J,{decode:hX(X),encode:Y}))}}function Wu(X,Q){return(Y)=>{return P1(Y).pipe(QH(X,Q),XH(X5(Y)))}}function MN(X,Q){let Y=Q?.encodingStrategy==="omit"?LG():T1();return(J)=>{return B9(U9(J)).pipe(m(J,{decode:hX(X),encode:Y}))}}function _u(X,Q){return(Y)=>{return P1(Y).pipe(MN(X,Q),XH(B9(Y)))}}function Q5(X){return X1(X).pipe(NN(h(X)))}function Vu(X){return Q5(X).pipe(QH(h(X),{encodingStrategy:"omit"}))}function f2(X,Q){return R0({_tag:Q5(X),...Q})}function AN(X){return(Q)=>{let Y={},J={},$=(K)=>(H)=>K.includes(H[X]);return G(Q),Object.assign(Q,{cases:Y,isAnyOf:$,guards:J,match:Z});function G(K){let H=K.ast;if(yY(H)&&"members"in K&&globalThis.Array.isArray(K.members)&&K.members.every(m2))return K.members.forEach(G);let W=oX(H);if(W.length>0){let V=W.find((_)=>_.key===X)?.literal;if(jQ(V)){Y[V]=K,J[V]=$N(P1(K));return}}throw new globalThis.Error("No literal or unique symbol found")}function Z(){if(arguments.length===1){let W=arguments[0];return function(V){return W[V[X]](V)}}let K=arguments[0];return arguments[1][K[X]](K)}}}function Du(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}=AN("_tag")(J);return I(J.ast,{cases:Q,isAnyOf:G,guards:$,match:Z})}function qu(){return(X)=>{class Q{}return Object.setPrototypeOf(Q,X)}}function d8(X,Q){return z4((Y)=>Y instanceof X,Q)}function O0(){return(X,Q)=>{return new B0(X.ast,jY(Q))}}var F0=pG;function Bu(X,Q=void 0){return new c4(X,Q)}var tR="^\\S[\\s\\S]*\\S$|^\\S$|^$";function wN(X){return F0((Q)=>Q.trim()===Q,{expected:"a string with no leading or trailing whitespace",meta:{_tag:"isTrimmed",regExp:new globalThis.RegExp(tR)},toArbitraryConstraint:{string:{patterns:[tR]}},...X})}var PQ=iX,Uu=lG,Ou=rG,zu=nG,Fu=(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 Lu(X,Q){let Y=Fu(X);return PQ(Y,{expected:X?`a UUID v${X}`:"a UUID",meta:{_tag:"isUUID",regExp:Y,version:X},...Q})}function Pu(X){let Q=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;return PQ(Q,{meta:{_tag:"isULID",regExp:Q},...X})}function CN(X){let Q=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return PQ(Q,{expected:"a base64 encoded string",meta:{_tag:"isBase64",regExp:Q},...X})}function Ru(X){let Q=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;return PQ(Q,{expected:"a base64url encoded string",meta:{_tag:"isBase64Url",regExp:Q},...X})}function Nu(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 Mu(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 Au(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 eR="^[^a-z]*$";function wu(X){return F0((Q)=>Q.toUpperCase()===Q,{expected:"a string with all characters in uppercase",meta:{_tag:"isUppercased",regExp:new globalThis.RegExp(eR)},toArbitraryConstraint:{string:{patterns:[eR]}},...X})}var XN="^[^A-Z]*$";function Cu(X){return F0((Q)=>Q.toLowerCase()===Q,{expected:"a string with all characters in lowercase",meta:{_tag:"isLowercased",regExp:new globalThis.RegExp(XN)},toArbitraryConstraint:{string:{patterns:[XN]}},...X})}var QN="^[^a-z]?.*$";function Tu(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(QN)},toArbitraryConstraint:{string:{patterns:[QN]}},...X})}var YN="^[^A-Z]?.*$";function Iu(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(YN)},toArbitraryConstraint:{string:{patterns:[YN]}},...X})}function TN(X){return F0((Q)=>globalThis.Number.isFinite(Q),{expected:"a finite number",meta:{_tag:"isFinite"},toArbitraryConstraint:{number:{noDefaultInfinity:!0,noNaN:!0}},...X})}function RQ(X){let Q=O5(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 NQ(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 MQ(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 AQ(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 wQ(X){let Q=nQ(X.order),Y=O5(X.order),J=oQ(X.order),$=rQ(X.order),G=X.formatter??g;return(Z,K)=>{let H=Z.exclusiveMinimum?Y:Q,W=Z.exclusiveMaximum?$:J;return F0((V)=>H(V,Z.minimum)&&W(V,Z.maximum),{expected:`a value between ${G(Z.minimum)}${Z.exclusiveMinimum?" (excluded)":""} and ${G(Z.maximum)}${Z.exclusiveMaximum?" (excluded)":""}`,...X.annotate?.(Z),...K})}}function IN(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 ju=RQ({order:q1,annotate:(X)=>({meta:{_tag:"isGreaterThan",exclusiveMinimum:X},toArbitraryConstraint:{number:{min:X,minExcluded:!0}}})}),jN=NQ({order:q1,annotate:(X)=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:X},toArbitraryConstraint:{number:{min:X}}})}),Eu=MQ({order:q1,annotate:(X)=>({meta:{_tag:"isLessThan",exclusiveMaximum:X},toArbitraryConstraint:{number:{max:X,maxExcluded:!0}}})}),Su=AQ({order:q1,annotate:(X)=>({meta:{_tag:"isLessThanOrEqualTo",maximum:X},toArbitraryConstraint:{number:{max:X}}})}),YH=wQ({order:q1,annotate:(X)=>{return{meta:{_tag:"isBetween",...X},toArbitraryConstraint:{number:{min:X.minimum,max:X.maximum,...X.exclusiveMinimum&&{minExcluded:!0},...X.exclusiveMaximum&&{maxExcluded:!0}}}}}}),vu=IN({remainder:Uq,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 xu(X){return new c4([u2(X),YH({minimum:-2147483648,maximum:2147483647})],{expected:"a 32-bit integer",...X})}function ku(X){return new c4([u2(),YH({minimum:0,maximum:4294967295})],{expected:"a 32-bit unsigned integer",...X})}function EN(X){return F0((Q)=>!isNaN(Q.getTime()),{expected:"a valid date",meta:{_tag:"isDateValid"},toArbitraryConstraint:{date:{noInvalidDate:!0}},...X})}var yu=RQ({order:U5,annotate:(X)=>({meta:{_tag:"isGreaterThanDate",exclusiveMinimum:X},toArbitraryConstraint:{date:{min:X,minExcluded:!0}}})}),bu=NQ({order:U5,annotate:(X)=>({meta:{_tag:"isGreaterThanOrEqualToDate",minimum:X},toArbitraryConstraint:{date:{min:X}}})}),gu=MQ({order:U5,annotate:(X)=>({meta:{_tag:"isLessThanDate",exclusiveMaximum:X},toArbitraryConstraint:{date:{max:X,maxExcluded:!0}}})}),hu=AQ({order:U5,annotate:(X)=>({meta:{_tag:"isLessThanOrEqualToDate",maximum:X},toArbitraryConstraint:{date:{max:X}}})}),mu=wQ({order:U5,annotate:(X)=>({meta:{_tag:"isBetweenDate",...X},toArbitraryConstraint:{date:{min:X.minimum,max:X.maximum}}})}),du=RQ({order:T8,annotate:(X)=>({meta:{_tag:"isGreaterThanBigInt",exclusiveMinimum:X},toArbitraryConstraint:{bigint:{min:X,minExcluded:!0}}})}),SN=NQ({order:T8,annotate:(X)=>({meta:{_tag:"isGreaterThanOrEqualToBigInt",minimum:X},toArbitraryConstraint:{bigint:{min:X}}})}),pu=MQ({order:T8,annotate:(X)=>({meta:{_tag:"isLessThanBigInt",exclusiveMaximum:X},toArbitraryConstraint:{bigint:{max:X,maxExcluded:!0}}})}),cu=AQ({order:T8,annotate:(X)=>({meta:{_tag:"isLessThanOrEqualToBigInt",maximum:X},toArbitraryConstraint:{bigint:{max:X}}})}),fu=wQ({order:T8,annotate:(X)=>({meta:{_tag:"isBetweenBigInt",...X},toArbitraryConstraint:{bigint:{min:X.minimum,max:X.maximum}}})}),uu=RQ({order:p5,formatter:(X)=>y8(X)}),lu=NQ({order:p5,formatter:(X)=>y8(X)}),ru=MQ({order:p5,formatter:(X)=>y8(X)}),ou=AQ({order:p5,formatter:(X)=>y8(X)}),nu=wQ({order:p5,formatter:(X)=>y8(X)});function vN(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 xN(X){return vN(1,X)}function iu(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 kN(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 au(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 su(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 tu(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 eu(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 Xl(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 Ql(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 Yl(X,Q){let Y=U9(X),J=Bz(Y.ast);return F0(($,G,Z)=>{let K=Reflect.ownKeys($),H=[];for(let W of K){let V=J(W,Z);if(V!==void 0){if(H.push(new A0([W],V)),Z.errors==="first")break}}if(W8(H))return new D0(G,F($),H);return!0},{expected:"an object with property names matching the schema",meta:{_tag:"isPropertyNames",propertyNames:Y.ast},[h1]:!0,...Q})}function yN(X){let Q=bQ();return F0((Y)=>b3(Y,Q).length===Y.length,{expected:"an array with unique items",meta:{_tag:"isUnique"},toArbitraryConstraint:{array:{comparator:Q}},...X})}var Jl=r.check(xN()),$l=r.check(kN(1,1));function Y5(X){let Q=c1()([X],([Y])=>(J,$,G)=>{if(QW(J)){if(T0(J))return x8;return t0(y0(Y)(J.value,G),{onSuccess:F,onFailure:(Z)=>new D0($,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])=>GW(Y),toFormatter:([Y])=>G8({onNone:()=>"none()",onSome:(J)=>`some(${Y(J)})`})});return I(Q.ast,{value:X})}function Gl(X){return tK(X).pipe(m(Y5(P1(X)),hU()))}function Zl(X){return c2(X).pipe(m(Y5(P1(X)),mU()))}function Kl(X,Q){return ON(X).pipe(m(Y5(P1(X)),dU(Q)))}function Hl(X){return X5(X).pipe(m(Y5(P1(X)),pU()))}function Wl(X){return B9(X).pipe(m(Y5(P1(X)),cU()))}function _l(X,Q){let Y=Q===void 0?"omit":Q.onNoneEncoding,J=Y===null?null:void 0;return B9(tK(X)).pipe(m(Y5(P1(X)),EY({decode:($)=>$.pipe(F5(EQ),F),encode:Y==="omit"?z5:($)=>F(aQ(z5($),()=>J))})))}function Vl(X,Q){let Y=c1()([X,Q],([J,$])=>(G,Z,K)=>{if(!BW(G))return v(new x0(Z,F(G)));switch(G._tag){case"Success":return t0(tY(J)(G.success,K),{onSuccess:l,onFailure:(H)=>new D0(Z,F(G),[new A0(["success"],H)])});case"Failure":return t0(tY($)(G.failure,K),{onSuccess:f,onFailure:(H)=>new D0(Z,F(G),[new A0(["failure"],H)])})}},{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,$])=>UW(J,$),toFormatter:([J,$])=>I8({onSuccess:(G)=>`success(${J(G)})`,onFailure:(G)=>`failure(${$(G)})`})});return I(Y.ast,{success:X,failure:Q})}function bN(X,Q){let Y=typeof Q?.label==="string"?y0(X1(Q.label)):void 0,J=c1()([X],([$])=>(G,Z,K)=>{if(VG(G)){let H=Y!==void 0?y1(Y(G.label,K),(W)=>new A0(["label"],W)):g4;return q8(H,()=>t0(y0($)(PY(G),K),{onSuccess:()=>G,onFailure:()=>{let W=F(G);return new D0(Z,W,[new A0(["value"],new Z0(W))])}}))}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()(JH($),{decode:n((G)=>Z4(G,{label:Q?.label})),encode:zG((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:([$])=>JU($)});return I(J.ast,{value:X})}function JH(X){return X.pipe(eK(y1(RY)))}function Dl(X,Q){return JH(X).pipe(m(bN(P1(X),Q),{decode:n((Y)=>Z4(Y,{label:Q?.label})),encode:zG((Y)=>"Cannot encode Redacted"+(B1(Y)&&typeof Y.value.label==="string"?` with label: "${Y.value.label}"`:""))}))}function lK(X,Q){let Y=c1()([X,Q],([J,$])=>(G,Z,K)=>{if(!Q$(G))return v(new x0(Z,F(G)));switch(G._tag){case"Fail":return t0(y0(J)(G.error,K),{onSuccess:ZX,onFailure:(H)=>new D0(Z,F(G),[new A0(["error"],H)])});case"Die":return t0(y0($)(G.defect,K),{onSuccess:KX,onFailure:(H)=>new D0(Z,F(G),[new A0(["defect"],H)])});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 ZX(G.error);case"Die":return KX(G.defect);case"Interrupt":return HX(G.fiberId)}},encode:b})),toArbitrary:([J,$])=>gN(J,$),toEquivalence:([J,$])=>hN(J,$),toFormatter:([J,$])=>mN(J,$)});return I(Y.ast,{error:X,defect:Q})}function gN(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(($)=>ZX($)),Q.map(($)=>KX($)))}}function hN(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 mN(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 rK(X,Q){let Y=c1()([X,Q],([J,$])=>{let G=c0(lK(J,$));return(Z,K,H)=>{if(!X$(Z))return v(new x0(K,F(Z)));return t0(y0(G)(Z.reasons,H),{onSuccess:GX,onFailure:(W)=>new D0(K,F(Z),[new A0(["failures"],W)])})}},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([J,$])=>O0()(c0(lK(J,$)),v0({decode:GX,encode:({reasons:G})=>G})),toArbitrary:([J,$])=>dN(J,$),toEquivalence:([J,$])=>pN(J,$),toFormatter:([J,$])=>cN(J,$)});return I(Y.ast,{error:X,defect:Q})}function dN(X,Q){return(Y,J)=>{return Y.array(gN(X,Q)(Y,J)).map(GX)}}function pN(X,Q){let Y=cH(hN(X,Q));return(J,$)=>Y(J.reasons,$.reasons)}function cN(X,Q){let Y=mN(X,Q);return(J)=>`Cause([${J.reasons.map(Y).join(", ")}])`}var l2=R0({message:r,name:X5(r),stack:X5(r)}),fN=d8(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))}),uN=d8(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)}})),ql=o0([l2.pipe(m(fN,dX())),LQ.pipe(m(d2.annotate({toCodecJson:()=>O0()(LQ,h2),toArbitrary:()=>(X)=>X.json()}),h2))]),Bl=o0([l2.pipe(m(uN,dX({includeStack:!0}))),LQ.pipe(m(d2.annotate({toCodecJson:()=>O0()(LQ,h2),toArbitrary:()=>(X)=>X.json()}),h2))]);function Ul(X,Q,Y){let J=c1()([X,Q,Y],([$,G,Z])=>{let K=rK(G,Z);return(H,W,V)=>{if(!J$(H))return v(new x0(W,F(H)));switch(H._tag){case"Success":return t0(y0($)(H.value,V),{onSuccess:_X,onFailure:(_)=>new D0(W,F(H),[new A0(["value"],_)])});case"Failure":return t0(y0(K)(H.cause,V),{onSuccess:VX,onFailure:(_)=>new D0(W,F(H),[new A0(["cause"],_)])})}}},{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:rK(G,Z)})]),v0({decode:(K)=>K._tag==="Success"?_X(K.value):VX(K.cause),encode:(K)=>V8(K)?{_tag:"Success",value:K.value}:{_tag:"Failure",cause:K.cause}})),toArbitrary:([$,G,Z])=>(K,H)=>K.oneof(H?.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},$.map((W)=>_X(W)),dN(G,Z)(K,H).map((W)=>VX(W))),toEquivalence:([$,G,Z])=>{let K=pN(G,Z);return(H,W)=>{if(H._tag!==W._tag)return!1;switch(H._tag){case"Success":return $(H.value,W.value);case"Failure":return K(H.cause,W.cause)}}},toFormatter:([$,G,Z])=>{let K=cN(G,Z);return(H)=>{switch(H._tag){case"Success":return`Exit.Success(${$(H.value)})`;case"Failure":return`Exit.Failure(${K(H.cause)})`}}}});return I(J.ast,{value:X,error:Q,defect:Y})}function Ol(X,Q){let Y=c1()([X,Q],([J,$])=>{let G=c0(q9([J,$]));return(Z,K,H)=>{if(Z instanceof globalThis.Map)return t0(y0(G)([...Z],H),{onSuccess:(W)=>new globalThis.Map(W),onFailure:(W)=>new D0(K,F(Z),[new A0(["entries"],W)])});return v(new x0(K,F(Z)))}},{typeConstructor:{_tag:"ReadonlyMap"},generation:{runtime:"Schema.ReadonlyMap(?, ?)",Type:"globalThis.ReadonlyMap<?, ?>"},expected:"ReadonlyMap",toCodec:([J,$])=>O0()(c0(q9([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(([H,W])=>`${J(H)} => ${$(W)}`);return`ReadonlyMap(${Z}) { ${K.join(", ")} }`}});return I(Y.ast,{key:X,value:Q})}function zl(X,Q){let Y=c1()([X,Q],([J,$])=>{let G=c0(q9([J,$]));return(Z,K,H)=>{if(lB(Z))return t0(y0(G)(BY(Z),H),{onSuccess:qY,onFailure:(W)=>new D0(K,F(Z),[new A0(["entries"],W)])});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(q9([J,$])),v0({decode:qY,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(qY)},toEquivalence:([J,$])=>kQ(J,$),toFormatter:([J,$])=>(G)=>{let Z=rB(G);if(Z===0)return"HashMap(0) {}";let K=BY(G).sort().map(([H,W])=>`${J(H)} => ${$(W)}`);return`HashMap(${Z}) { ${K.join(", ")} }`}});return I(Y.ast,{key:X,value:Q})}function Fl(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 D0(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 I(Q.ast,{value:X})}function Ll(X){let Q=c1()([X],([Y])=>{let J=c0(Y);return($,G,Z)=>{if(aB($))return t0(y0(J)(Z1($),Z),{onSuccess:OY,onFailure:(K)=>new D0(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 $=sB(J);if($===0)return"HashSet(0) {}";let G=globalThis.Array.from(J).sort().map((Z)=>`${Y(Z)}`);return`HashSet(${$}) { ${G.join(", ")} }`}});return I(Q.ast,{value:X})}function Pl(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 D0(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])=>r$(Y),toFormatter:([Y])=>(J)=>{let $=VB(J);if($===0)return"Chunk(0) {}";let G=globalThis.Array.from(J).sort().map((Z)=>`${Y(Z)}`);return`Chunk(${$}) { ${G.join(", ")} }`}});return I(Q.ast,{value:X})}var Rl=d8(globalThis.RegExp,{typeConstructor:{_tag:"RegExp"},generation:{runtime:"Schema.RegExp",Type:"globalThis.RegExp"},expected:"RegExp",toCodecJson:()=>O0()(R0({source:r,flags:r}),t1({decode:(X)=>h4({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}),lN=r.annotate({expected:"a string that will be decoded as a URL"}),rN=d8(globalThis.URL,{typeConstructor:{_tag:"URL"},generation:{runtime:"Schema.URL",Type:"globalThis.URL"},expected:"URL",toCodecJson:()=>O0()(lN,wG),toArbitrary:()=>(X)=>X.webUrl().map((Q)=>new globalThis.URL(Q)),toEquivalence:()=>(X,Q)=>X.toString()===Q.toString()}),Nl=lN.pipe(m(rN,wG)),oN=r.annotate({expected:"a string in ISO 8601 format that will be decoded as a Date"}),$H=d8(globalThis.Date,{typeConstructor:{_tag:"Date"},generation:{runtime:"Schema.Date",Type:"globalThis.Date"},expected:"Date",toCodecJson:()=>O0()(oN,AG),toArbitrary:()=>(X,Q)=>X.date(Q?.constraints?.date)}),Ml=oN.pipe(m($H,AG)),nN=$H.check(EN()),r2=z4(h3,{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:p2}),R0({_tag:X1("Millis"),value:QM})]),v0({decode:(X)=>{switch(X._tag){case"Infinity":return i8;case"NegativeInfinity":return F6;case"Nanos":return a8(X.value);case"Millis":return E4(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(F6),X.bigInt().map(a8),X.maxSafeInteger().map(E4)),toFormatter:()=>globalThis.String,toEquivalence:()=>m3}),Al=r.annotate({expected:"a string that will be decoded as a Duration"}),wl=Al.pipe(m(r2,yU)),Cl=globalThis.BigInt(0),Tl=p2.check(SN(Cl)).pipe(m(r2,bU)),Il=e4.check(jN(0)).pipe(m(r2,gU)),iN=r.annotate({expected:"a string that will be decoded as a BigDecimal"}),aN=z4(c$,{typeConstructor:{_tag:"effect/BigDecimal"},generation:{runtime:"Schema.BigDecimal",Type:"BigDecimal.BigDecimal",importDeclaration:'import * as BigDecimal from "effect/BigDecimal"'},expected:"BigDecimal",toCodecJson:()=>O0()(iN,CG),toArbitrary:()=>(X)=>X.tuple(X.bigInt(),X.integer({min:0,max:20})).map(([Q,Y])=>E6(Q,Y)),toFormatter:()=>(X)=>y8(X),toEquivalence:()=>u$}),jl=iN.pipe(m(aN,CG)),El=sN(d2);function sN(X){return r.annotate({expected:"a string that will be decoded as JSON",contentMediaType:"application/json",contentSchema:J1(X.ast)}).pipe(m(X,oU))}var tN=d8(globalThis.File,{typeConstructor:{_tag:"File"},generation:{runtime:"Schema.File",Type:"globalThis.File"},expected:"File",toCodecJson:()=>O0()(R0({data:r.check(CN()),type:r,name:r,lastModified:e4}),t1({decode:(X)=>I8(c5(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)=>x$({try:async()=>{let Q=new globalThis.Uint8Array(await X.arrayBuffer());return{data:HY(Q),type:X.type,name:X.name,lastModified:X.lastModified}},catch:(Q)=>new Z0(F(X),{message:globalThis.String(Q)})})}))}),eN=d8(globalThis.FormData,{typeConstructor:{_tag:"FormData"},generation:{runtime:"Schema.FormData",Type:"globalThis.FormData"},expected:"FormData",toCodecJson:()=>O0()(c0(q9([r,o0([R0({_tag:Q5("String"),value:r}),R0({_tag:Q5("File"),value:tN})])])),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 Sl(X){return eN.pipe(m(X,nU))}var XM=d8(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 vl(X){return XM.pipe(m(X,iU))}var o2=e4.check(TN()),QM=e4.check(u2()),xl=r.annotate({expected:"a string that will be decoded as a number"}).pipe(m(e4,o5)),kl=r.annotate({expected:"a string that will be decoded as a finite number"}).pipe(m(o2,o5)),yl=I(oG).pipe(m(p2,SY)),YM=r.check(wN()),bl=r.annotate({expected:"a string that will be decoded as a trimmed string"}).pipe(m(YM,kU())),gl=r.annotate({expected:"a base64 encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,fU)),hl=r.annotate({expected:"a base64 (URL) encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,uU)),ml=r.annotate({expected:"a hex encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,lU)),dl=r.annotate({expected:"a URI component encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,rU)),oK=o0([o2,DN,r]),pl=R0({issues:c0(R0({message:r,path:B9(c0(o0([oK,R0({key:oK})])))}))}),cl=sK([0,1]).pipe(m(VN,v0({decode:(X)=>X===1,encode:(X)=>X?1:0}))),JM=r.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),n2=d8(globalThis.Uint8Array,{typeConstructor:{_tag:"Uint8Array"},generation:{runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"},expected:"Uint8Array",toCodecJson:()=>O0()(JM,TG),toArbitrary:()=>(X)=>X.uint8Array()}),fl=JM.pipe(m(n2,TG)),ul=r.annotate({expected:"a base64 (URL) encoded string that will be decoded as a Uint8Array"}).pipe(m(n2,{decode:NU(),encode:TY()})),ll=r.annotate({expected:"a hex encoded string that will be decoded as a Uint8Array"}).pipe(m(n2,{decode:AU(),encode:IY()})),i2=z4((X)=>n$(X)&&UB(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,EG),toArbitrary:()=>(X,Q)=>X.date({noInvalidDate:!0,...Q?.constraints?.date}).map((Y)=>zB(Y)),toFormatter:()=>(X)=>X.toString(),toEquivalence:()=>i$}),rl=nN.pipe(m(i2,{decode:RG(),encode:n(NB)})),ol=r.annotate({expected:"a string that will be decoded as a DateTime.Utc"}).pipe(m(i2,EG)),nl=e4.pipe(m(i2,{decode:RG(),encode:n(MB)})),il=z4(qB,{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()(e4,aU),toArbitrary:()=>(X)=>X.integer({min:-43200000,max:50400000}).map((Q)=>IX(Q)),toFormatter:()=>(X)=>m4(X),toEquivalence:()=>(X,Q)=>X.offset===Q.offset}),$M=r.annotate({expected:"an IANA time zone identifier"}),GM=z4(BB,{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()($M,IG),toArbitrary:()=>(X)=>X.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(a$)),toFormatter:()=>(X)=>m4(X),toEquivalence:()=>(X,Q)=>X.id===Q.id}),al=$M.pipe(m(GM,IG)),ZM=r.annotate({expected:"a time zone string (IANA identifier or offset like +03:00)"}),KM=z4(DB,{typeConstructor:{_tag:"effect/DateTime.TimeZone"},generation:{runtime:"Schema.TimeZone",Type:"DateTime.TimeZone",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone",toCodecJson:()=>O0()(ZM,jG),toArbitrary:()=>(X)=>X.oneof(X.integer({min:-43200000,max:50400000}).map((Q)=>IX(Q)),X.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(a$))),toFormatter:()=>(X)=>m4(X),toEquivalence:()=>(X,Q)=>m4(X)===m4(Q)}),sl=ZM.pipe(m(KM,jG)),HM=r.annotate({expected:"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"}),WM=z4((X)=>n$(X)&&OB(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()(HM,SG),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])=>FB(Y,{timeZone:J})),toFormatter:()=>(X)=>ZY(X),toEquivalence:()=>i$}),tl=HM.pipe(m(WM,SG)),el=globalThis.Symbol.for("immer-draftable");function GH(X,Q,Y,J,$){let G=Qr(Y,Q,J),Z=_M(Q),K=class extends X{constructor(...[H,W]){H=H??{};let V=Y.make(H,W);super({...H,...V},{...W,disableChecks:!0})}static[zQ]=zQ;get[Z](){return Z}static[el]=!0;static identifier=Q;static fields=Y.fields;static get ast(){return G(this).ast}static pipe(){return a(this,arguments)}static rebuild(H){return G(this).rebuild(H)}static make(H,W){return new this(H,W)}static makeOption(H,W){return sY(G(this))(H??{},W)}static makeEffect(H,W){return y1(e5(G(this))(H??{},W),(V)=>new _4(V))}static annotate(H){return this.rebuild(c6(this.ast,H))}static annotateKey(H){return this.rebuild(sX(this.ast,H))}static check(...H){return this.rebuild(f4(this.ast,H))}static extend(H){return(W,V)=>{let _={...Y.fields,...W};return GH(this,H,aK(hY(_,Y.ast.checks,{identifier:H}),_),V,$)}}static mapFields(H,W){return Y.mapFields(H,W)}};if($!==void 0)Object.assign(K.prototype,$(Q));return K}function Xr(X){return new K0(n((Q)=>new X(Q)),T1())}function _M(X){return`~effect/Schema/Class/${X}`}function Qr(X,Q,Y){let J;return($)=>{if(J===void 0){let G=Xr($),Z=I(new h6([X.ast],()=>(K,H)=>{return K instanceof $||M(K,_M(Q))?h(K):v(new x0(H,F(K)))},{identifier:Q,[t5]:([K])=>new B0(K,G),toCodec:([K])=>new B0(K.ast,G),toArbitrary:([K])=>()=>K.map((H)=>new $(H)),toFormatter:([K])=>(H)=>`${$.identifier}(${K(H)})`,"~sentinels":oX(X.ast),...Y}));J=X.pipe(m(Z,G))}return J}}function a2(X){return m2(X)}var VM=(X)=>(Q,Y)=>{let J=a2(Q)?Q:R0(Q);return GH(tD,X,J,Y,($)=>({toString(){return`${$}(${g({...this})})`}}))},Yr=(X)=>{return(Q,Y,J)=>{return VM(X??Q)(a2(Y)?Y.mapFields(($)=>({_tag:Q5(Q),...$}),{unsafePreserveChecks:!0}):f2(Q,Y),J)}},DM=(X)=>(Q,Y)=>{let J=a2(Q)?Q:R0(Q);return GH(pQ,X,J,Y,(G)=>({name:G}))},Jr=(X)=>{return(Q,Y,J)=>{return DM(X??Q)(a2(Y)?Y.mapFields(($)=>({_tag:Q5(Q),...$}),{unsafePreserveChecks:!0}):f2(Q,Y),J)}};function qM(X){let Q=Vz(X.ast);return(Y)=>Q(Y,{})}function $r(X){return qM(X)(fK)}function Gr(X){return(Q)=>{return Q.annotate({toFormatter:X})}}function Zr(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 H=[],W=0;for(;W<G.length;W++)if(K.length<W+1){if(E0($.elements[W]))continue}else H.push(G[W](K[W]));if(Z.length>0){let[V,..._]=Z;for(;W<K.length-_.length;W++)H.push(V(K[W]));for(let D=0;D<_.length;D++)W+=D,H.push(_[D](K[W]))}return"["+H.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 H=[],W=new Set;for(let V=0;V<G.length;V++){let _=$.propertySignatures[V],D=_.name;if(W.add(D),E0(_.type)&&!Object.hasOwn(K,D))continue;H.push(`${R4(D)}: ${G[V](K[D])}`)}for(let V=0;V<Z.length;V++){let _=d6(K,$.indexSignatures[V].parameter);for(let D of _){if(W.has(D))continue;W.add(D),H.push(`${R4(D)}: ${Z[V](K[D])}`)}}return H.length>0?"{ "+H.join(", ")+" }":"{}"}}case"Union":{let G=(Z)=>nX(Z,$.types);return(Z)=>{let K=G(Z),H=K.map(YQ);for(let W=0;W<K.length;W++){let V=H[W];if(V(Z))return Y(K[W])(Z)}return g(Z)}}case"Suspend":{let G=p6(()=>Y($.thunk()));return(Z)=>G()(Z)}}}}function Kr(X){return(Q)=>Q.annotate({toEquivalence:X})}function Hr(X){return Iz(X.ast)}function BM(X){return Sz(X.ast)}function UM(X,Q){let Y=BM(X),J=vz(Y,Q);return{dialect:"draft-2020-12",schema:J.schema,definitions:J.definitions}}function OM(X){return I(zM(X.ast))}var zM=f6((X)=>{let Q=Wr(X,zM);return Q!==X&&E0(X)?s5(Q):Q});function Wr(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)=>r6(J1(Z))):[],$=Y(J),G=Q($.to);return q0(X,G===$.to?[$]:[new B0(G,$.transformation)])}return q0(X,[tO])}case"Unknown":case"ObjectKeyword":return q0(X,[eO]);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 FM(X){return I(LM(z8(X.ast)))}var LM=p0((X)=>{let Q=_r(X,LM);return Q!==X&&E0(X)?s5(Q):Q});function _r(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)=>r6(G))),$=Q(J.to);return q0(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 PM(X,Q){return I(AM(Q?.keepDeclarations===!0?MM(X.ast):NM(X.ast)))}function Vr(X,Q){let Y=u5(X.ast)??_G(X.ast),J=HN(PM(X));return($)=>J($).pipe(MX((G)=>Dr(G,{rootName:Y,...Q})))}function Dr(X,Q){let Y=Q.rootName??"root",J=Q.arrayItemName??"item",$=Q.pretty??!0,G=Q.indent??" ",Z=Q.sortKeys??!0,K=new Set,H=[];return V(Y,X,0),H.join($?`
|
|
66
|
-
`:"");function W(_,
|
|
67
|
-
`)},_1=(X)=>/(^|\s)#\s*tripwire-allow\b/.test(X);var
|
|
68
|
-
`)}if(X==="Read"){let Y=Q;return Y.content??Y.file?.content??""}if(typeof Q.content==="string")return Q.content??"";return""};var
|
|
69
|
-
`)}catch{}};var e2=require("child_process"),Qo=(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 e2.spawnSync("test",["-x",J],{stdio:"ignore"}),J}catch{continue}try{let J=e2.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},QA=(X,Q,Y=2000)=>{if(!Q.enabled)return{};let J=Qo(Q);if(J===null)return{};let $=JSON.stringify(X),G=e2.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,H=Z.hookSpecificOutput?.permissionDecisionReason;if(typeof K!=="string")return{};if(typeof H==="string")return{updatedCommand:K,reason:H};return{updatedCommand:K}}catch{return{}}};var Yo=(X)=>X.tokens.slice(1).join(" "),YA=(X,...Q)=>X.flags.some((Y)=>Q.includes(Y)),Jo=[{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"&&YA(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"&&YA(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:"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(Yo(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")}],JA=(X,Q)=>{if(_1(Q))return C("bash-deny");for(let Y of X)for(let J of Jo)if(J.match(Y,Q))return J.action==="deny"?d(J.rule,J.message):n0(J.rule,J.message);return C("bash-deny")};var $o=["main","master","develop","production","release"],VH=(X)=>X.protectedBranches??$o,Go=/^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([\w./\- ]+\))?!?:\s+\S/,Zo=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix"]),Ko=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"]),Ho=(X)=>{if(X.head!=="git")return null;let Q=X.tokens.slice(1),Y=0;while(Y<Q.length){let J=Q[Y];if(Zo.has(J)){Y+=2;continue}if(Ko.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},Wo=(X)=>{for(let Q=0;Q<X.length;Q++){let Y=X[Q];if(Y==="-m"||Y==="--message")return X[Q+1]??null;if(Y.startsWith("--message="))return Y.slice(10);if(/^-[a-zA-Z]*m[a-zA-Z]*$/.test(Y))return X[Q+1]??null}return null},_o=(X,Q)=>{let Y=VH(Q);for(let J of X)for(let $ of Y)if(J===$||J.endsWith(`:${$}`)||J.endsWith(`/${$}`))return $;return null},Vo=(X)=>X.filter((Q)=>!Q.startsWith("-")),Do=(X)=>X.filter((Q)=>Q.startsWith("-")),h0=(X,...Q)=>Q.some((Y)=>X.includes(Y)),qo=({subArgs:X,positional:Q})=>{if(h0(X,"--global","--system"))return d("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 d("git-config-write","Local git config writes should be done explicitly. To read a value, use `git config --get <key>`.");return C("bash-git")},Bo=({subArgs:X})=>{if(h0(X,"--cached"))return C("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.")},Uo=({subArgs:X,positional:Q})=>{if(h0(X,"--staged","-S")&&!h0(X,"--worktree","-W"))return C("bash-git");if(Q.length>0)return d("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 C("bash-git")},Oo=({subArgs:X,positional:Q})=>{if(h0(X,"-b","-B"))return C("bash-git");if(h0(X,"-f","--force"))return d("git-checkout-force","`git checkout -f` overwrites the working tree without preserving uncommitted changes. Refuse.");if(X.includes("--"))return d("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 d("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 C("bash-git")},zo=({subArgs:X})=>{if(h0(X,"-f","--force","--discard-changes"))return d("git-switch-force","`git switch -f / --discard-changes` throws away uncommitted working-tree changes. Refuse.");return C("bash-git")},Fo=({subArgs:X,flags:Q,positional:Y})=>{if(h0(X,"--hard"))return d("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 C("bash-git");return n0("git-reset-mixed","`git reset` moves HEAD. Confirm intent \u2014 if undoing a commit, `git revert` is usually safer.")},Lo=({flags:X})=>{if(X.some((Q)=>/^-[a-zA-Z]*[df]/.test(Q)||Q==="--force"))return d("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 C("bash-git")},Po=({subArgs:X,positional:Q,config:Y})=>{if(h0(X,"--abort","--quit","--continue","--skip","--edit-todo"))return C("bash-git");if(h0(X,"-i","--interactive"))return d("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],$=VH(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.")},Ro=({subArgs:X})=>{if(h0(X,"--abort","--quit","--continue","--skip"))return C("bash-git");return n0("git-cherry-pick","`git cherry-pick` applies commits onto the current branch and can create conflicts. Confirm intent.")},No=({subArgs:X})=>{if(h0(X,"--abort","--continue","--quit"))return C("bash-git");return n0("git-merge","`git merge <branch>` may create merge conflicts. Confirm intent.")},Mo=({subArgs:X,config:Q})=>{if(h0(X,"--amend"))return d("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 Y=Wo(X),J=h0(X,"-F","--file","-c","-C","--reuse-message","--reedit-message"),$=h0(X,"--no-edit");if(Y===null&&!J&&!$)return d("git-commit-no-message",'`git commit` without `-m "..."` opens an editor and hangs the agent. Use `git commit -m "<conventional message>"`.');if(Y!==null&&Q.enforceConventionalCommits!==!1&&!Go.test(Y))return d("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(Y)}`].join(`
|
|
70
|
-
`));if(h0(X,"-a","--all")||X.some((G)=>/^-[a-zA-Z]*a[a-zA-Z]*$/.test(G)))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 C("bash-git")},
|
|
61
|
+
}`}return dm(G,{toString:{value:()=>Z(g0(Q))},[M8]:{value:()=>Z(g0(Q))},[B4]:{value:async()=>Z(await AK(Q))},[r0]:{value:J,configurable:!0}})};return J()})}var{MIN_SAFE_INTEGER:fm,MAX_SAFE_INTEGER:um}=Number;function qR(){return new _9(fm,um)}var lm=Number.MAX_SAFE_INTEGER;function rm(){return new _9(0,lm)}var om=Number.parseInt;function nm(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=om(X,Q);if(qQ(Y,Q)!==X)throw Error("Invalid value");return Y}function im(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 am(X){return w0(X,".")}function sm(X){if(typeof X!=="string")throw Error("Invalid type");return G0(L1(X,"."),(Q)=>M2(Q,10))}function mK(){return e(n4(255),n4(255),n4(255),n4(255)).map(am,sm)}function h8(X){return e(m8("dec","oct","hex"),n4(X)).map(nm,im)}function kZ(X){return w0(X,".")}function yZ(X){if(typeof X!=="string")throw Error("Invalid type");return L1(X,".")}function DR(){return l0(e(h8(255),h8(255),h8(255),h8(255)).map(kZ,yZ),e(h8(255),h8(255),h8(65535)).map(kZ,yZ),e(h8(255),h8(16777215)).map(kZ,yZ),h8(4294967295))}function dK(X){if(X.length===0)return[];else return L1(X,":")}function pK(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 tm(X){return`${w0(X[0],":")}:${X[1]}`}function em(X){if(typeof X!=="string")throw Error("Invalid type");return pK(X)}function Xd(X){return`::${w0(X[0],":")}:${X[1]}`}function Qd(X){if(typeof X!=="string")throw Error("Invalid type");if(!hy(X,"::"))throw Error("Invalid value");return pK(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,$]=pK(Y);return[dK(Q),J,$]}function Yd(X){return A2([X[0],[X[1]],X[2]])}function Jd(X){let Q=w2(X);return[Q[0],w0(Q[1],":"),Q[2]]}function SL(X){return`${w0(X[0],":")}::${X[1]}`}function vL(X){if(typeof X!=="string")throw Error("Invalid type");let[Q,Y]=L1(X,"::",2);return[dK(Q),Y]}function $d(X){return`${w0(X[0],":")}::`}function Gd(X){if(typeof X!=="string")throw Error("Invalid type");if(!my(X,"::"))throw Error("Invalid value");return[dK(S0(X,0,X.length-2))]}function Zd([X,Q]){return`${X}:${Q}`}function Kd(X){if(typeof X!=="string")throw new E("Invalid type");if(!X.includes(":"))throw new E("Invalid value");return X.split(":",2)}var Hd="0123456789abcdef",bZ=void 0;function Wd(){if(bZ===void 0)bZ=z0({min:0,max:15}).map((X)=>Hd[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 bZ}function BR(){let X=d0({unit:Wd(),minLength:1,maxLength:4,size:"max"}),Q=l0(e(X,X).map(Zd,Kd),mK());return l0(e(P0(X,{minLength:6,maxLength:6,size:"max"}),Q).map(tm,em),e(P0(X,{minLength:5,maxLength:5,size:"max"}),Q).map(Xd,Qd),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(Yd,Jd),e(P0(X,{minLength:0,maxLength:5,size:"max"}),Q).map(SL,vL),e(P0(X,{minLength:0,maxLength:6,size:"max"}),X).map(SL,vL),e(P0(X,{minLength:0,maxLength:7,size:"max"})).map($d,Gd))}var _d=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)}},Vd=Object.getOwnPropertyNames;function qd(){let X=new D4;return(Y)=>{let J=p1(X,Y);if(J!==void 0)return J;return J=new _d(String(Y)),R8(X,Y,J),J}}function UR(X){let Q=qd(),Y=X(Q),J=Vd(Y);for(let $ of J){let G=Q($);G.underlying=Y[$]}return Y}function Dd(X,Q){for(let Y of X){let J=Q[Y]||{};if(J.maxLength===void 0||J.maxLength>0)return!0}return!1}function Bd(X,Q){if(X.length===0)return b0([]);if(!Dd(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)=>Dy(Y)).filter((Y)=>Y.length>0)}var{assign:xL,create:C2,defineProperty:OR,getPrototypeOf:kL,prototype:Ud}=Object;function Od(X){return OR(C2(null),M8,{configurable:!1,enumerable:!1,writable:!1,value:()=>X})}function yL(X,Q){return Od(`<${F1(X)}#${Q}>`)}function zd(X,Q){let Y=C2(Ud);for(let J in X){let $=X[J],G=[];for(let Z of $){let K=xL(C2(kL(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 H in Z){let W=Z[H];K[H]=W.index===void 0?void 0:typeof W.index==="number"?Y[W.type][W.index]:G0(W.index,(V)=>Y[W.type][V])}OR(K,M8,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let H=X[J][G],W=xL(C2(kL(H)),H);for(let V in Z){let _=Z[V];W[V]=_.index===void 0?void 0:typeof _.index==="number"?yL(_.type,_.index):G0(_.index,(q)=>yL(_.type,q))}return g0(W)}})}}return Y}function Fd(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 H=p1(Y,K.type);if(H===void 0)H=new D4,R8(Y,K.type,H);if(Ty(H,K.forwardRelationship))throw new E(`Cannot declare multiple inverse relationships for the same forward relationship ${F1(K.forwardRelationship)} on type ${F1(K.type)}`);R8(H,K.forwardRelationship,{type:$,property:Z}),Q+=1}}let J=new D4;if(Q===0)return J;for(let $ in X){let G=X[$],Z=p1(Y,$);if(Z===void 0)continue;for(let K in G){let H=G[K];if(H.arity==="inverse")continue;let W=p1(Z,K);if(W===void 0)continue;if(W.type!==H.type)throw new E(`Inverse relationship ${F1(W.property)} on type ${F1(W.type)} references forward relationship ${F1(K)} but types do not match`);R8(J,H,W)}}if(J.size!==Q)throw new E("Some inverse relationships could not be matched with their corresponding forward relationships");return J}var bL=Object.create;function Ld(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 Pd(X,Q,Y,J,$,G,Z){let K=Ld(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 H=0,W=U4(e6(K,{depthIdentifier:$,selector:(_)=>_===J?_+ ++H:_,minLength:1}),{nil:[],depthIdentifier:$}).generate(G,Z).value,V=0;return G0(W,(_)=>_===J?_+V++:_)}}}var Rd=class extends I0{constructor(X,Q){super();this.relations=X,this.defaultEntities=Q;let Y=new K9,J=new K9;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)}`);VQ(J,K.type)}else{if(S2(J,K.type))throw new E(`Cannot mix exclusive with other strategies for type ${F1(K.type)}`);VQ(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=Fd(X)}createEmptyLinksInstanceFor(X){let Q=bL(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=bL(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],H=IK();H.depth=G.depth;for(let W in Z){let V=Z[W];if(V.arity==="inverse")continue;let _=V.type,q=Y[_],D=q.length,U=Pd(V.arity,V.strategy||"any",_===G.type?G.indexInType:void 0,q.length,H,X,Q);K[W]={type:_,index:U};let R=U===void 0?[]:typeof U==="number"?[U]:U;for(let L of R){if(L>=D)S(J,{type:_,indexInType:L,depth:G.depth+1}),S(q,this.createEmptyLinksInstanceFor(_));let N=p1(this.inversedRelations,V);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 Nd(X,Q){return new Rd(X,Q)}var{keys:Md,getOwnPropertySymbols:Ad,getOwnPropertyDescriptor:wd}=Object;function Cd(X){let Q=Md(X),Y=Ad(X);for(let J=0;J!==Y.length;++J){let $=Y[J],G=wd(X,$);if(G&&G.enumerable)Q.push($)}return Q}var{create:Td,defineProperty:Id,getOwnPropertyDescriptor:jd,getOwnPropertyNames:Ed,getOwnPropertySymbols:Sd}=Object;function vd(X,Q){return function(J){let $=J[1]?Td(null):{};for(let G=0;G!==X.length;++G){let Z=J[0][G];if(Z!==Q)Id($,X[G],{value:Z,configurable:!0,enumerable:!0,writable:!0})}return $}}function xd(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 V=0;V!==X.length;++V){let _=jd(J,X[V]);if(_!==void 0){if(!_.configurable||!_.enumerable||!_.writable)throw Error("Incompatible instance received: should contain only c/e/w properties");if(_.get!==void 0||_.set!==void 0)throw Error("Incompatible instance received: should contain only no get/set properties");++Z,S(K,_.value)}else S(K,Q)}let H=Ed(J).length,W=Sd(J).length;if(Z!==H+W)throw Error("Incompatible instance received: should not contain extra properties");return[K,$]}}var gZ=Symbol("no-key");function hZ(X,Q,Y){let J=Cd(X),$=[];for(let G=0;G!==J.length;++G){let Z=J[G],K=X[Z];if(Q===void 0||V4(Q,Z)!==-1)S($,K);else S($,U4(K,{nil:gZ}))}return e(e(...$),Y?b0(!1):zQ()).map(vd(J,gZ),xd(J,gZ))}function qK(X,Q){let Y=Q!==void 0&&!!Q.noNullPrototype;if(Q===void 0)return hZ(X,void 0,Y);if(!(("requiredKeys"in Q)&&Q.requiredKeys!==void 0))return hZ(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 hZ(X,J,Y)}var kd=Object.create;function yd(X,Q,Y,J){let $=kd(null);for(let G in X){let Z=X[G],K=qK(Z,J),H=Q(G),W=Y(G),V={minLength:H,maxLength:H};$[G]=W!==void 0?e6(K,{...V,selector:W}):P0(K,V)}return qK($)}var{create:gL,keys:bd}=Object;function gd(X,Q,Y={}){let J=bd(X),$=Y.initialPoolConstraints||gL(null),G=Y.unicityConstraints||gL(null),Z={noNullPrototype:Y.noNullPrototype};return Bd(J,$).chain((K)=>Nd(Q,K).chain((H)=>yd(X,(W)=>H[W].length,(W)=>G[W],Z).map((W)=>zd(W,H))))}function hd(X){return w0(G0(X,(Q)=>Q[Q.length-1]===","?S0(Q,0,Q.length-1):Q)," ")}function md(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 dd(X){let Q=w0(X," ");if(Q[Q.length-1]===",")Q=S0(Q,0,Q.length-1);return LK(Q[0])+S0(Q,1)+"."}function pd(X){return function(Y){if(typeof Y!=="string")throw Error("Unsupported type");if(Y.length<2||Y[Y.length-1]!=="."||Y[Y.length-2]===","||LK(iZ(Y[0]))!==Y[0])throw Error("Unsupported value");let J=iZ(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 cd(X){return w0(X," ")}function fd(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 ud(){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 ld(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 $=ud();if(Y==="sentences")return P0(P0($,{minLength:1,size:"small"}).map(dd,pd($)),{minLength:1,maxLength:Q,size:J}).map(cd,fd);else return P0($,{minLength:1,maxLength:Q,size:J}).map(hd,md($))}function rd(X){return new Map(X)}function od(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 nd(X){return X[0]}function DK(X,Q,Y={}){return e6(e(X,Q),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:nd,depthIdentifier:Y.depthIdentifier,comparator:"SameValueZero"}).map(rd,od)}var F2=10;function id(X){let Q={};return(Y)=>{let J=Y!==void 0?Y:F2;if(!LP(Q,J)){let $=F2;F2=J-1,Q[J]=X(J),F2=$}return Q[J]}}function ad(X){let Q=0;while(X>j(0)){if(X&j(1))++Q;X>>=j(1)}return Q}function sd(X,Q){let Y=(j(1)<<j(Q))-j(1),J=X&Y,$=ad(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 td(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 mZ(X,Q,Y,J){for(let $=0,G=j(1);$!==Y.length;++$,G<<=j(1))if(Q&G)X[Y[$]]=J(X[Y[$]])}var ed=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=s4(j(0),(j(1)<<j($.length))-j(1)).generate(X,void 0);return mZ(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:td(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),H=sd($,K.length);return mZ(Z,H,K,this.toggleCase),new k(w0(Z,""),this.buildContextFor(G,new k(H,void 0)))}).join(i4(()=>{let G=[...J],Z=L2(G,this.toggleCase);return s4(j(0),(j(1)<<j(Z.length))-j(1)).shrink($,Y.flagsContext).map((K)=>{let H=e0(G);return mZ(H,K.value,Z,this.toggleCase),new k(w0(H,""),this.buildContextFor(new k(J,Y.rawStringContext),K))})}))}};function Xp(X){let Q=LK(X);if(Q!==X)return Q;return iZ(X)}function Qp(X,Q){return new ed(X,Q&&Q.toggleCase||Xp,Q&&Q.untoggleAll)}function Yp(X){return qP.from(X)}function Jp(X){if(!(X instanceof qP))throw Error("Unexpected type");return[...X]}function zR(X={}){return P0(WR(X),X).map(Yp,Jp)}function $p(X){return DP.from(X)}function Gp(X){if(!(X instanceof DP))throw Error("Unexpected type");return[...X]}function FR(X={}){return P0(b2(X),X).map($p,Gp)}function O4(X,Q,Y,J,$){let G=J.name,{min:Z=Q,max:K=Y,...H}=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}),H).map((W)=>J.from(W),(W)=>{if(!(W instanceof J))throw Error("Invalid type");return[...W]})}function LR(X={}){return O4(X,-32768,32767,nk,z0)}function PR(X={}){return O4(X,-2147483648,2147483647,ik,z0)}function RR(X={}){return O4(X,-128,127,ok,z0)}function NR(X={}){return O4(X,0,65535,tk,z0)}function MR(X={}){return O4(X,0,4294967295,ek,z0)}function AR(X={}){return O4(X,0,255,ak,z0)}function wR(X={}){return O4(X,0,255,sk,z0)}function Zp(X){return X!==void 0}function hL(X){if(X.hasToBeCloned)return new k(X.value_,{generatorContext:X.context},()=>X.value);return new k(X.value_,{generatorContext:X.context})}function mL(X){if(X.hasToBeCloned)return new k(X.value_,{shrinkerContext:X.context},()=>X.value);return new k(X.value_,{shrinkerContext:X.context})}var Kp=class extends I0{constructor(X,Q){super();this.generatorArbitrary=X,this.shrinkerArbitrary=Q}generate(X,Q){return hL(this.generatorArbitrary.generate(X,Q))}canShrinkWithoutContext(X){return this.shrinkerArbitrary.canShrinkWithoutContext(X)}shrink(X,Q){if(!Zp(Q))return this.shrinkerArbitrary.shrink(X,void 0).map(mL);if("generatorContext"in Q)return this.generatorArbitrary.shrink(X,Q.generatorContext).map(hL);return this.shrinkerArbitrary.shrink(X,Q.shrinkerContext).map(mL)}};function BK(X,Q,Y){let J=z0({min:X,max:Q});if(Q===Y)return J;return new Kp(J,z0({min:X,max:Y}))}var{min:Hp,max:UK}=Math,dL=_P.isArray,Wp=Object.entries;function _p(X){let Q=-1;for(let Y=0;Y!==X.length;++Y)Q=UK(Q,X[Y][0]);return Q}function Vp(X,Q){let Y=_P(X);for(let J=0;J!==Q.length;++J){let $=Q[J];if($[0]<X)Y[$[0]]=$[1]}return Y}function CR(X,Q={}){let{size:Y,minNumElements:J=0,maxLength:$=t6,maxNumElements:G=$,noTrailingHole:Z,depthIdentifier:K}=Q,H=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 W=Hp(G,$),V=Q.maxNumElements!==void 0||Y!==void 0?Y:"=",_=e6(e(BK(0,UK(H-1,0),UK($-1,0)),X),{size:V,minLength:J,maxLength:W,selector:(q)=>q[0],depthIdentifier:K}).map((q)=>{return Vp(_p(q)+1,q)},(q)=>{if(!dL(q))throw Error("Not supported entry type");if(Z&&q.length!==0&&!(q.length-1 in q))throw Error("No trailing hole");return G0(Wp(q),(D)=>[Number(D[0]),D[1]])});if(Z||$===J)return _;return e(_,BK(J,H,$)).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(!dL(q))throw Error("Not supported entry type");return[q,q.length]})}function qp(X){return new Set(X)}function Dp(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 TR(X,Q={}){return e6(X,{minLength:Q.minLength,maxLength:Q.maxLength,size:Q.size,depthIdentifier:Q.depthIdentifier,comparator:"SameValueZero"}).map(qp,Dp)}function Bp(X,Q,Y,J,$,G){return SK(X,Q,{maxKeys:Y,noNullPrototype:!G,size:J,depthIdentifier:$})}function Up(X){return l0(RR(X),AR(X),wR(X),LR(X),NR(X),PR(X),MR(X),zR(X),FR(X))}function IR(X){let{values:Q,depthSize:Y}=X,J=IK(),$=X.maxDepth,G=X.maxKeys,Z=X.size,K=l0(...Q,...X.withBigInt?[s4()]:[],...X.withDate?[lP()]:[]);return UR((H)=>({anything:l0({maxDepth:$,depthSize:Y,depthIdentifier:J},K,H("array"),H("object"),...X.withMap?[H("map")]:[],...X.withSet?[H("set")]:[],...X.withObjectString?[H("anything").map((W)=>g0(W))]:[],...X.withTypedArray?[Up({maxLength:G,size:Z})]:[],...X.withSparseArray?[CR(H("anything"),{maxNumElements:G,size:Z,depthIdentifier:J})]:[]),keys:X.withObjectString?l0({arbitrary:X.key,weight:10},{arbitrary:H("anything").map((W)=>g0(W)),weight:1}):X.key,array:P0(H("anything"),{maxLength:G,size:Z,depthIdentifier:J}),set:TR(H("anything"),{maxLength:G,size:Z,depthIdentifier:J}),map:l0(DK(H("keys"),H("anything"),{maxKeys:G,size:Z,depthIdentifier:J}),DK(H("anything"),H("anything"),{maxKeys:G,size:Z,depthIdentifier:J})),object:Bp(H("keys"),H("anything"),G,Z,J,X.withNullPrototype)})).anything}function Op(X){switch(typeof X){case"boolean":return new VP(X);case"number":return new q4(X);case"string":return new F1(X);default:return X}}function zp(X){if(typeof X!=="object"||X===null||!("constructor"in X))return X;return X.constructor===VP||X.constructor===q4||X.constructor===F1?X.valueOf():X}function Fp(X){return X.map(Op,zp)}function Lp(X,Q){return[zQ(),qR(),b2(),Q(X),l0(Q(X),b0(null),b0(void 0))]}function Pp(X){return X.map((Q)=>Fp(Q))}function Rp(X,Q){return Q?Pp(X).concat(X):X}function jR(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:d0(Q),values:Rp(X.values!==void 0?X.values:Lp(Q,d0),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 Np(X){return SK(X.key,IR(X),{maxKeys:X.maxKeys,noNullPrototype:!X.withNullPrototype,size:X.size})}function Mp(X){return Np(jR(X))}function Ap(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 ER(X){return IR(jR(X))}function SR(X={}){let Q=X.noUnicodeString===void 0||X.noUnicodeString===!0;return ER(Ap("stringUnit"in X?d0({unit:X.stringUnit}):Q?d0():d0({unit:"binary"}),X))}var{stringify:wp,parse:Cp}=JSON;function Tp(X){if(typeof X!=="string")throw new E("Cannot unmap the passed value");return Cp(X)}function Ip(X={}){return SR(X).map(wp,Tp)}var jp=Object.defineProperties;function dZ(X,Q){return`Stream(${Q!==void 0?`${w0(Q,",")}\u2026`:`${X} emitted`})`}var Ep=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 jp(new Q0(function*(K,H){while(!0){let W=K.generate(H,Y).value;if(G++,$!==null)S($,W);yield W}}(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(AK)):void 0)},[r0]:{value:J,enumerable:!0}})};return new k(J(),void 0)}canShrinkWithoutContext(X){return!1}shrink(X,Q){return Q0.nil()}};function Sp(X,Q){return new Ep(X,Q!==void 0&&typeof Q==="object"&&"noHistory"in Q?!Q.noHistory:!0)}function vp(X){return w0(X,"")}function pL(X){if(typeof X!=="string")throw Error("Cannot unmap the passed value");return[...X]}function xp(X){switch(X.length%4){case 0:return X;case 3:return`${X}=`;case 2:return`${X}==`;default:return S0(X,1)}}function kp(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 pZ=String.fromCharCode;function yp(X){if(X<26)return pZ(X+65);if(X<52)return pZ(X+97-26);if(X<62)return pZ(X+48-52);return X===62?"+":"/"}function bp(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 gp(){return z0({min:0,max:63}).map(yp,bp)}function hp(X={}){let{minLength:Q=0,maxLength:Y=t6,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=gp();return P0(K,{minLength:$,maxLength:G,size:Z,experimentalCustomSlices:Lh(K,pL)}).map(vp,pL).map(xp,kp)}var cL=Object.is;function mp(X,Q){let Y=new D4,J=0;for(let $ of X)if(cL($,-0))++J;else R8(Y,$,(p1(Y,$)||0)+1);for(let $=0;$!==Q.length;++$){if(!($ in Q))return!1;let G=Q[$];if(cL(G,-0)){if(J===0)return!1;--J}else{let Z=p1(Y,G)||0;if(Z===0)return!1;R8(Y,G,Z-1)}}return!0}var{floor:dp,log:fL}=Math,pp=Array.isArray,vR=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+dp(fL(J-Y)/fL(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]),OP($,K,1)}if(this.isOrdered)zP(G,(Z,K)=>Z-K);return new k(G0(G,(Z)=>this.originalArray[Z]),Y.context)}canShrinkWithoutContext(X){if(!pp(X))return!1;if(!this.lengthArb.canShrinkWithoutContext(X.length))return!1;return mp(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?i4(()=>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 cp(X,Q={}){let{minLength:Y=0,maxLength:J=X.length}=Q;return new vR(X,!0,Y,J)}function fp(X,Q={}){let{minLength:Y=0,maxLength:J=X.length}=Q;return new vR(X,!1,Y,J)}var up={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"},lp={"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 rp(X){return X<10?F1(X):up[X]}function uL(X,Q){let Y="";while(X.length+Y.length<Q)Y+="0";return Y+X}function lL(X){let Q="";for(let Y=X;Y!==0;){let J=Y>>5;Q=rp(Y-(J<<5))+Q,Y=J}return Q}function op(X,Q){let Y=~~(X/1073741824),J=X&1073741823;return uL(lL(Y),Q-6)+uL(lL(J),6)}function xR(X){return function(Y){return op(Y,X)}}function cZ(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 $=lp[X[J]];if($===void 0)throw new E("Unsupported type");Q+=$*Y,Y*=32}return Q}var np=xR(10),rL=xR(8);function ip(X){return np(X[0])+rL(X[1])+rL(X[2])}function ap(X){if(typeof X!=="string"||X.length!==26)throw Error("Unsupported type");return[cZ(X.slice(0,10)),cZ(X.slice(10,18)),cZ(X.slice(18))]}function sp(){return e(z0({min:0,max:281474976710655}),z0({min:0,max:1099511627775}),z0({min:0,max:1099511627775})).map(ip,ap)}function kR(X){return dy(qQ(X,16),8,"0")}function tp(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!==kR(Q))throw Error("Unsupported value: invalid content");return Q}function fZ(X,Q){return z0({min:X,max:Q}).map(kR,tp)}function ep(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 Xc=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function Qc(X){if(typeof X!=="string")throw Error("Unsupported type");let Q=Xc.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 oL="0123456789abcdef";function Yc(X){let Q={},Y={};for(let G=0;G!==X.length;++G){let Z=oL[G],K=oL[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 Jc(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 $c(X={}){let Q=fZ(0,4294967295),Y=X.version!==void 0?typeof X.version==="number"?[X.version]:X.version:[1,2,3,4,5,6,7,8];Jc(Y);let{versionsApplierMapper:J,versionsApplierUnmapper:$}=Yc(Y);return e(Q,fZ(0,268435456*Y.length-1).map(J,$),fZ(2147483648,3221225471),Q).map(ep,Qc)}function Gc(X){return d0({unit:kK("-._~!$&'()*+,;=:"),size:X})}function Zc([X,Q,Y]){return(X===null?"":`${X}@`)+Q+(Y===null?"":`:${Y}`)}function Kc(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 Hc(X){return`[${X}]`}function Wc(X){if(typeof X!=="string"||X[0]!=="["||X[X.length-1]!=="]")throw Error("Unsupported");return X.substring(1,X.length-1)}function yR(X){let Q=X||{},Y=Q.size,J=[yK({size:Y}),...Q.withIPv4===!0?[mK()]:[],...Q.withIPv6===!0?[BR().map(Hc,Wc)]:[],...Q.withIPv4Extended===!0?[DR()]:[]];return e(Q.withUserInfo===!0?U4(Gc(Y)):b0(null),l0(...J),Q.withPort===!0?U4(n4(65535)):b0(null)).map(Zc,Kc)}function bR(X){return d0({unit:kK("-._~!$&'()*+,;=:@/?"),size:X})}function gR(X={}){return bR(X.size)}function hR(X={}){return d0({unit:kK("-._~!$&'()*+,;=:@"),size:X.size})}function _c(X){return w0(G0(X,(Q)=>`/${Q}`),"")}function Vc(X){if(typeof X!=="string")throw Error("Incompatible value received: type");if(X.length!==0&&X[0]!=="/")throw Error("Incompatible value received: start");return OP(L1(X,"/"),1)}function qc(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 uZ(X,Q){return P0(hR({size:X}),{size:Q}).map(_c,Vc)}function Dc(X){let[Q,Y]=qc(X);if(Q===Y)return uZ(Q,Y);return l0(uZ(Q,Y),uZ(Y,Q))}function mR(X){return Dc(EK((X||{}).size))}function dR(X={}){return bR(X.size)}function Bc(X){let[Q,Y,J]=X;return`${Q}://${Y}${J}${X[3]===null?"":`?${X[3]}`}${X[4]===null?"":`#${X[4]}`}`}var Uc=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function Oc(X){if(typeof X!=="string")throw Error("Incompatible value received: type");let Q=Uc.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 zc(X){let Q=X||{},Y=EK(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"]),yR($),mR({size:Y}),Q.withQueryParameters===!0?U4(dR({size:Y})):b0(null),Q.withFragments===!0?U4(gR({size:Y})):b0(null)).map(Bc,Oc)}var Fc=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}},Lc=class X{constructor(Q){if(this.cmd=Q,this.hasRan=!1,NK(Q)){let Y=Q[M8];this[M8]=function(){return Y.call(Q)}}if(MK(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(s6(this.cmd))return new X(this.cmd[r0]());return new X(this.cmd)}toString(){return this.cmd.toString()}},nL=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)}},Pc=class extends I0{constructor(X,Q,Y,J,$){super();this.sourceReplayPath=J,this.disableReplayLog=$,this.oneCommandArb=l0(...X).map((G)=>new Lc(G)),this.lengthArb=BK(0,Q,Y),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(nL.stringify(this.replayPath))}`}buildValueFor(X,Q){let Y=X.map(($)=>$.value_),J={shrunkOnce:Q,items:X};return new k(new Fc(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?nL.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 H=0;H!==G.length;++H)K.push(i4(()=>{let W=G.slice(0,H);return this.lengthArb.shrink(G.length-1-H,void 0).map((V)=>W.concat(G.slice(G.length-(V.value+1))))}));for(let H=0;H!==G.length;++H)K.push(i4(()=>this.oneCommandArb.shrink(G[H].value_,G[H].context).map((W)=>G.slice(0,H).concat([W],G.slice(H+1)))));return Z.join(...K).map((H)=>{return this.buildValueFor(H.map((W)=>new k(W.value_.clone(),W.context)),!0)})}};function Rc(X,Q={}){let{size:Y,maxCommands:J=t6,disableReplayLog:$=!1,replayPath:G=null}=Q;return new Pc(X,BQ(Y,0,J,Q.maxCommands!==void 0),J,G,$)}var Nc=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}},Mc=function*(X,Q){for(let Y of Q)yield new Nc(X,Y)},pR=(X,Q,Y,J,$)=>{return X.then((G)=>{let{model:Z,real:K}=G,H=Y;for(let W of Q)H=$(H,()=>{return J(W,Z,K)});return H})},Ac=(X,Q)=>{return pR({then:(G)=>{G(X())}},Q,void 0,(G,Z,K)=>{if(G.check(Z))G.run(Z,K)},(G,Z)=>Z())},wc=(X)=>{return typeof X.then==="function"},cR=async(X,Q,Y=Promise.resolve())=>{return await pR({then:(Z)=>{let K=X();if(wc(K))return K.then(Z);else return Z(K)}},Q,Y,async(Z,K,H)=>{if(await Z.check(K))await Z.run(K,H)},(Z,K)=>Z.then(K))};function Cc(X,Q){Ac(X,Q)}async function Tc(X,Q){await cR(X,Q)}async function Ic(X,Q,Y){let J=cR(Q,Mc(X,Y),X.schedule(Promise.resolve(),"startModel"));await X.waitFor(J),await X.waitAll()}var P2=(X)=>X(),fR=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 ${vm(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,H=void 0,W=new Promise((V,_)=>{H=()=>{let q=Promise.resolve(Z!==void 0?J.then(()=>Z()):J);return q.then((D)=>{this.log(Q,K,Y,$,"resolved",D),V(D)},(D)=>{this.log(Q,K,Y,$,"rejected",D),_(D)}),q}});if(this.scheduledTasks.push({original:J,trigger:H,schedulingType:Q,taskId:K,label:Y,metadata:$,customAct:G}),this.scheduledWatchers.length!==0)this.scheduledWatchers[0]();return W}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:(V)=>V()},G=()=>{},Z=new Promise((V)=>{G=()=>V({done:J.done,faulty:J.faulty})}),K=()=>{J.faulty=!0,G()},H=()=>{J.done=!0,G()},W=(V,_)=>{if(V>=Q.length){_.then(H,K);return}_.then(()=>{let q=Q[V],[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());W(V+1,L)},K)};return W(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,H=void 0,W=void 0,V=0,_=null,q=null,D=async()=>{V=50;for(V=50;!J&&V>0;--V)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,W(N),N})}if(!J&&Z!==void 0)Z();_=null},U=()=>{if(_!==null){V=51;return}_=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)=>{H=(y)=>{R(),N(y)},W=(y)=>{R(),P(y)}});if(Q.then((N)=>{if(J=!0,q===null)H(N);else q.then(()=>H(N),(P)=>W(P))},(N)=>{if(J=!0,q===null)W(N);else q.then(()=>W(N),()=>W(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 uR(X){let Q=0;return{clone:()=>uR(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 iL(X,Q){return new fR(X,uR(Q))}function lR(X){let Q=X.clone();return{clone:()=>lR(Q),nextTaskIndex:(Y)=>{return X.nextInt(0,Y.length-1)}}}var jc=class extends I0{constructor(X){super();this.act=X}generate(X,Q){return new k(new fR(this.act,lR(X.clone())),void 0)}canShrinkWithoutContext(X){return!1}shrink(X,Q){return Q0.nil()}};function Ec(X){let{act:Q=(Y)=>Y()}=X||{};return new jc(Q)}function Sc(X,Q){let{act:Y=(J)=>J()}=Array.isArray(X)?Q||{}:X||{};if(Array.isArray(X))return iL(Y,X);return function(J,...$){return iL(Y,$)}}function vc(X={}){return O4(X,j("-9223372036854775808"),j("9223372036854775807"),lk,s4)}function xc(X={}){return O4(X,j(0),j("18446744073709551615"),rk,s4)}function kc(X,Q){return Q}var{floor:lZ,min:yc}=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:lZ(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?lZ(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:lZ(Q/$)},expression:J.astNode},minLength:X.quantifier.from*J.minLength};return{astNode:{...X,expression:J.astNode},minLength:X.quantifier.from*J.minLength}}default:return kc(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,H=Q-Y+Z.minLength;S($,(H!==K?e1(Z.astNode,H):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:yc(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 bc(X,Q){return e1(X,Q).astNode}function gc(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},$=rR(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 rR(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:rR(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 gc(X)}}function hc(X){return T2(X,!0,!0)}function aL(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 OK(X){return X>="0"&&X<="9"}function oR(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 mc(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=oR(X,J);else if($==="(")Y+=1}throw Error("Missing closing ')'")}function dc(X,Q){let Y=!1;for(let J=Q;J!==X.length;++J){let $=X[J];if(OK($));else if(Q===J)return-1;else if($===","){if(Y)return-1;Y=!0}else if($==="}")return J;else return-1}return-1}var a6=function(X){return X[X.Full=0]="Full",X[X.Character=1]="Character",X}({});function pc(X,Q,Y,J){switch(X[Q]){case"[":if(J===a6.Character)return Q+1;return oR(X,Q+1)+1;case"{":{if(J===a6.Character)return Q+1;let $=dc(X,Q+1);if($===-1)return Q+1;return $+1}case"(":if(J===a6.Character)return Q+1;return mc(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(OK($)){let G=Y?X.length:Math.min(Q+4,X.length),Z=Q+2;for(;Z<G&&OK(X[Z]);++Z);return Z}return Q+(Y?aL(X,Q+1):1)+1}}default:return Q+(Y?aL(X,Q):1)}}function R2(X,Q,Y,J){let $=pc(X,Q,Y,J);return X.substring(Q,$)}var sL={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=fK(g2),cK={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"},zK=fK(cK),nR={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"},tL=fK(nR);function fK(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 cc(X){return X in cK||X in zK}function fc(X){return X in g2||X in UQ}function eL(X){if(X in sL)return sL[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 XP(X){if(X in zK)return zK[X];if(X in tL)return tL[X];if(X in UQ)return UQ[X];if(X in cK||X in nR||X in g2)return X;throw Error(`Unknown Unicode property value: ${X}`)}function uc(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:eL(J),canonicalValue:XP($)}}if(cc(X))return{type:"UnicodeProperty",name:"General_Category",value:X,negative:Q,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:XP(X)};if(fc(X)){let J=eL(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 rZ=String.fromCodePoint;function oZ(X){let Q=X.pop();if(Q===void 0)throw Error("Unable to extract token preceeding the currently parsed one");return Q}function iR(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 $9(X,Q){return{type:"Char",kind:"meta",symbol:Q,value:X,codePoint:Q.codePointAt(0)||-1}}function r4(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 nZ(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:rZ(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:rZ(J),value:X,codePoint:J}}case"0":return $9(X,"\x00");case"n":return $9(X,`
|
|
63
|
+
`);case"f":return $9(X,"\f");case"r":return $9(X,"\r");case"t":return $9(X,"\t");case"v":return $9(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(iR(Q)){let Y=X.substring(1),J=Number(Y);return{type:"Char",kind:"decimal",symbol:rZ(J),value:X,codePoint:J}}if(X.length>2&&(Q==="p"||Q==="P")){let Y=Q==="P";return uc(X.substring(3,X.length-1),Y)}return I2(X.substring(1),!0)}}return I2(X)}function G9(X,Q,Y,J){let $=null;for(let G=0,Z=R2(Q,G,Y,a6.Full);G!==Q.length;G+=Z.length,Z=R2(Q,G,Y,a6.Full)){let K=Z[0];switch(K){case"|":if($===null)$=[];$.push(r4(X.splice(0),!0)||null);break;case".":X.push({type:"Char",kind:"meta",symbol:Z,value:Z,codePoint:NaN});break;case"*":case"+":{let H=oZ(X);X.push({type:"Repetition",expression:H,quantifier:{type:"Quantifier",kind:K,greedy:!0}});break}case"?":{let H=oZ(X);if(H.type==="Repetition")H.quantifier.greedy=!1,X.push(H);else X.push({type:"Repetition",expression:H,quantifier:{type:"Quantifier",kind:K,greedy:!0}});break}case"{":{if(Z==="{"){X.push(I2(Z));break}let H=oZ(X),W=Z.substring(1,Z.length-1).split(","),V=Number(W[0]),_=W.length===1?V:W[1].length!==0?Number(W[1]):void 0;X.push({type:"Repetition",expression:H,quantifier:{type:"Quantifier",kind:"Range",greedy:!0,from:V,to:_}});break}case"[":{let H=Z.substring(1,Z.length-1),W=[],V=void 0,_=!1;for(let q=0,D=R2(H,q,Y,a6.Character);q!==H.length;q+=D.length,D=R2(H,q,Y,a6.Character)){if(q===0&&D==="^"){V=!0;continue}let U=nZ(D);if(D==="-")W.push(U),_=!0;else{let R=W.length>=2?W[W.length-2]:void 0;if(_&&R!==void 0&&R.type==="Char"&&U.type==="Char")W.pop(),W.pop(),W.push({type:"ClassRange",from:R,to:U});else W.push(U);_=!1}}X.push({type:"CharacterClass",expressions:W,negative:V});break}case"(":{let H=Z.substring(1,Z.length-1),W=[];if(H[0]==="?")if(H[1]===":")G9(W,H.substring(2),Y,J),X.push({type:"Group",capturing:!1,expression:r4(W)});else if(H[1]==="="||H[1]==="!")G9(W,H.substring(2),Y,J),X.push({type:"Assertion",kind:"Lookahead",negative:H[1]==="!"?!0:void 0,assertion:r4(W)});else if(H[1]==="<"&&(H[2]==="="||H[2]==="!"))G9(W,H.substring(3),Y,J),X.push({type:"Assertion",kind:"Lookbehind",negative:H[2]==="!"?!0:void 0,assertion:r4(W)});else{let V=H.split(">");if(V.length<2||V[0][1]!=="<")throw Error(`Unsupported regex content found at ${JSON.stringify(Z)}`);let _=++J.lastIndex,q=V[0].substring(2);J.named.set(q,_),G9(W,V.slice(1).join(">"),Y,J),X.push({type:"Group",capturing:!0,nameRaw:q,name:q,number:_,expression:r4(W)})}else{let V=++J.lastIndex;G9(W,H,Y,J),X.push({type:"Group",capturing:!0,number:V,expression:r4(W)})}break}default:if(Z==="^")X.push({type:"Assertion",kind:Z});else if(Z==="$")X.push({type:"Assertion",kind:Z});else if(Z[0]==="\\"&&iR(Z[1])){let H=Number(Z.substring(1));if(Y||H<=J.lastIndex)X.push({type:"Backreference",kind:"number",number:H,reference:H});else X.push(nZ(Z))}else if(Z[0]==="\\"&&Z[1]==="k"&&Z.length!==2){let H=Z.substring(3,Z.length-1);X.push({type:"Backreference",kind:"name",number:J.named.get(H)||0,referenceRaw:H,reference:H})}else X.push(nZ(Z));break}}if($!==null){$.push(r4(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 lc(X){let Q=V4([...X.flags],"u")!==-1,Y=X.source,J=[];return G9(J,Y,Q,{lastIndex:0,named:new Map}),r4(J)}var rc=String.fromCodePoint;function oc(X){if(X.binary||X.shorthand)return X.canonicalValue;return`${X.canonicalName}=${X.canonicalValue}`}function QP(X,Q,Y,J){let $=-1;for(let G=Q;G<=Y;++G)if(X.test(rc(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 nc(X,Q){let Y=new RegExp(`^\\${Q?"P":"p"}{${X}}$`,"u"),J=[];return QP(Y,0,55295,J),QP(Y,57344,1114111,J),J}var YP=new Map;function ic(X,Q){let Y=`${Q?"P":"p"}:${X}`,J=YP.get(Y);if(J!==void 0)return J;let $=nc(X,Q);return YP.set(Y,$),$}function ac(X){return V9(...G0(ic(oc(X),X.negative),(Q)=>QK(Q)))}var sc=String.fromCodePoint,JP=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],$P=[..."0123456789"],GP=[...` \r
|
|
64
|
+
\v\f`],FK=[...`\r
|
|
65
|
+
`],aR=[..."\x1E\x15"],tc=[...FK,...aR],n6=()=>d0({unit:"grapheme-ascii",minLength:1,maxLength:1});function ZP(X){return new E(`Unsupported AST node! Received: ${g0(X)}`)}function o4(X,Q,Y){switch(X.type){case"Char":if(X.kind==="meta")switch(X.value){case"\\w":return m8(...JP);case"\\W":return n6().filter((J)=>V4(JP,J)===-1);case"\\d":return m8(...$P);case"\\D":return n6().filter((J)=>V4($P,J)===-1);case"\\s":return m8(...GP);case"\\S":return n6().filter((J)=>V4(GP,J)===-1);case"\\b":case"\\B":throw new E(`Meta character ${X.value} not implemented yet!`);case".":{let J=Y.dotAll?aR:tc;return n6().filter(($)=>V4(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=o4(X.expression,Q,Y);switch(X.quantifier.kind){case"*":return d0({...Q,unit:J});case"+":return d0({...Q,minLength:1,unit:J});case"?":return d0({...Q,minLength:0,maxLength:1,unit:J});case"Range":return d0({...Q,minLength:X.quantifier.from,maxLength:X.quantifier.to,unit:J});default:throw ZP(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)=>o4(J,Q,Y))).map((J)=>w0(J,""));case"CharacterClass":if(X.negative){let J=G0(X.expressions,($)=>o4($,Q,Y));return n6().filter(($)=>FP(J,(G)=>!G.canShrinkWithoutContext($)))}return l0(...G0(X.expressions,(J)=>o4(J,Q,Y)));case"ClassRange":{let J=X.from.codePoint,$=X.to.codePoint;return z0({min:J,max:$}).map((G)=>sc(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 o4(X.expression,Q,Y);case"Disjunction":return l0(X.left!==null?o4(X.left,Q,Y):b0(""),X.right!==null?o4(X.right,Q,Y):b0(""));case"Assertion":if(X.kind==="^"||X.kind==="$"){if(Y.multiline)if(X.kind==="^")return l0(b0(""),e(d0({unit:n6()}),m8(...FK)).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(...FK),d0({unit:n6()})).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 ac(X);default:throw ZP(X)}}function ec(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=hc(lc(X));if(Y!==void 0)G=bc(G,Y);let Z=o4(G,J,$);if(Y!==void 0)return Z.filter((K)=>[...K].length<=Y);return Z}function Xf(X){let Q=[];for(let Y=0;Y!==X.length;++Y)Q.push(X[Y].next());return Q}function Qf(X,Q){for(let Y=0;Y!==X.length;++Y)Q[Y]=X[Y].next()}function Yf(X){for(let Q=0;Q!==X.length;++Q)if(X[Q].done)return!0;return!1}function*Jf(...X){let Q=Xf(X);while(!Yf(Q))yield Q.map((Y)=>Y.value),Qf(X,Q)}function*$f(X){let Q=X;while(!0)yield Q,++Q}var Gf=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(Jf(this.arb.shrink(X,Q),$f(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 Zf(X,Q){return new Gf(X,Q)}var Kf="module",Hf="4.7.0",Wf="fd1a1840b2fda7f909f825083bd486318adfcf11";var FQ=Y2;function c1(){return(X,Q,Y)=>{return I(new h6(X.map(oX),(J)=>Q(J.map(($)=>I($))),Y))}}function z4(X,Q){return c1()([],()=>(Y,J)=>X(Y)?h(Y):v(new x0(J,F(Y))),Q)}function _f(X){return X}function Vf(X){return(Q)=>Q.annotate(X)}function qf(X){return(Q)=>lK(lK(Q).annotate(X))}function Df(X){return(Q)=>{return Q.rebuild(tX(Q.ast,X))}}function Bf(X){return X}function Uf(X){return M(X,J2)}function sR(X){return V8(X)?X.value:{issues:[{message:J$(X.cause)}]}}function Of(X,Q){let Y=y0(X),J={errors:"all",...Q?.parseOptions},$=VU(Q),G=(Z)=>{let K=new A5,H=h5(b$(Y(Z,J),{onFailure:$,onSuccess:(V)=>({value:V})}),{scheduler:K});H.currentDispatcher?.flush();let W=H.pollUnsafe();if(W)return sR(W);return new Promise((V)=>{H.addObserver((_)=>{V(sR(_))})})};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 tR(X,Q){let Y=OM(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=mz(Y),$=J.schema;if(Object.keys(J.definitions).length>0)$.definitions=J.definitions;return $}throw new globalThis.Error(`Unsupported target: ${Q}`)}function zf(X){let Q={input(Y){return tR(X,Y.target)},output(Y){return tR(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 GN=Bz,Ff=Oz;function ZN(X){let Q=y0(X);return(Y,J)=>{return y1(Q(Y,J),($)=>new _4($))}}var Lf=ZN;function KN(X){let Q=Lz(X);return(Y,J)=>{return p7(Q(Y,J),($)=>new _4($))}}var Pf=KN,Rf=QZ,Nf=Pz,Mf=YZ,Af=Rz,wf=zz,Cf=Fz,Tf=JZ,If=eY;function HN(X){let Q=l6(X);return(Y,J)=>{return y1(Q(Y,J),($)=>new _4($))}}var WN=HN;function _N(X){let Q=Mz(X);return(Y,J)=>{return p7(Q(Y,J),($)=>new _4($))}}var jf=_N,Ef=GZ,Sf=Az,vf=ZZ,xf=wz,kf=$Z,yf=Nz,bf=KZ,gf=X2,I=r6;function hf(X){class Q{}return Object.setPrototypeOf(Q,X)}function m2(X){return M(X,FQ)&&X[FQ]===FQ}var X5=W1((X)=>I(lY(X.ast),{schema:X})),mf=W1((X)=>X.schema),B9=W1((X)=>X5(c2(X))),df=W1((X)=>X.schema.members[0]),pf=W1((X)=>I(uG(X.ast),{schema:X})),cf=W1((X)=>X.schema),P1=W1((X)=>I(z8(X.ast),{schema:X})),U9=W1((X)=>I(J1(X.ast),{schema:X})),LQ="~effect/Schema/flip";function ff(X){return M(X,LQ)&&X[LQ]===LQ}function lK(X){if(ff(X))return X.schema.rebuild(O8(X.ast));return I(O8(X.ast),{[LQ]:LQ,schema:X})}function X1(X){let Q=I(new b1(X),{literal:X,transform(Y){return Q.pipe(m(X1(Y),{decode:n(()=>Y),encode:n(()=>X)}))}});return Q}function VN(X){return new bG(X.map((Q)=>m2(Q)?Q.ast:new b1(Q)))}function uf(X){return I(VN(X),{parts:X})}function lf(X){return I(VN(X).asTemplateLiteralParser(),{parts:X})}function rf(X){return I(new yG(Object.keys(X).filter((Q)=>typeof X[X[Q]]!=="number").map((Q)=>[Q,X[Q]])),{enums:X})}var of=I(BO),PQ=I(OO),d2=I(b6),iK=I(a5),aK=I(kG),r=I(m6),e4=I(hG),qN=I(AO),DN=I(CO),p2=I(IO),nf=I(qO),af=I(LO);function sf(X){return I(new gG(X))}function sK(X,Q){return I(X,{fields:Q,mapFields(Y,J){let $=Y(this.fields);return sK(hY($,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function R0(X){return sK(hY(X,void 0),X)}function tf(X){return W1((Q)=>Q.mapFields($z(X)))}function ef(X){return function(Q){let Y={},J={};for(let $ in Q.fields){let G=U9(Q.fields[$]);if(Object.hasOwn(X,$))Y[X[$]]=G,J[X[$]]=$;else Y[$]=G}return R0(Y).pipe(m(Q,v0({decode:aG(J),encode:aG(X)})))}}function Xu(X,Q){return(Y)=>{let J=L5(Y.fields,P1),$=R0({...J,...X});return Y.pipe(m($,v0({decode:(G)=>{let Z={...G};for(let K in X){let H=Q[K],W=H(G);if(B1(W))Z[K]=W.value}return Z},encode:(G)=>{let Z={...G};for(let K in X)delete Z[K];return Z}})))}}function BN(X,Q,Y){let J=Y?.keyValueCombiner?.decode||Y?.keyValueCombiner?.encode?new gY(Y.keyValueCombiner.decode,Y.keyValueCombiner.encode):void 0;return I(dO(X.ast,Q.ast,J),{key:X,value:Q})}function Qu(X,Q){return I(jO(X.ast,Q.map(oX)),{schema:X,records:Q})}function UN(X,Q){return I(X,{elements:Q,mapElements(Y,J){let $=Y(this.elements);return UN(pG($,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function D9(X){return UN(pG(X),X)}function Yu(X,Q){return I(EO(X.ast,Q.map(oX)),{schema:X,rest:Q})}var c0=W1((X)=>I(new W4(!1,[],[X.ast]),{schema:X}));var Ju=W1((X)=>I(new W4(!1,[X.ast],[X.ast]),{schema:X}));function $u(X){return o0([X,c0(X)]).pipe(m(c0(P1(X)),v0({decode:PW,encode:(Q)=>Q.length===1?Q[0]:Q})))}function Gu(X){return c0(X).check(bN())}var Zu=W1((X)=>{return I(new W4(!0,X.ast.elements,X.ast.rest),{schema:X})});function ON(X,Q){return I(X,{members:Q,mapMembers(Y,J){let $=Y(this.members);return ON(mY($,this.ast.mode,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function o0(X,Q){return ON(mY(X,Q?.mode??"anyOf",void 0),X)}function tK(X){let Q=X.map(X1);return I(mY(Q,"anyOf",void 0),{literals:X,members:Q,mapMembers(Y){return o0(Y(this.members))},pick(Y){return tK(Y)},transform(Y){return o0(Q.map((J,$)=>J.transform(Y[$])))}})}var eK=W1((X)=>o0([X,iK])),c2=W1((X)=>o0([X,aK])),zN=W1((X)=>o0([X,iK,aK]));function FN(X){return I(new dY(()=>X().ast))}function Ku(...X){return(Q)=>Q.check(...X)}function Hu(X,Q){return(Y)=>I(f4(Y.ast,[pY(X,Q)]),{schema:Y})}function LN(X){return(Q)=>I(gO(Q.ast,X),{schema:Q,identifier:X})}function Wu(X,Q){return(Y)=>{return(Q.checks?Y.check(...Q.checks):Y).pipe(LN(X))}}function XH(X){return(Q)=>I(yO(Q.ast,new dX(X,b)),{schema:Q})}function PN(X){return(Q)=>I(bO(Q.ast,new dX(b,X)),{schema:Q})}function _u(X){return RN(X)}function RN(X){return(Q)=>Q.pipe(XH(d5(X)))}function Vu(X){return NN(X)}function NN(X){return(Q)=>Q.pipe(PN(d5(X)))}function m(X,Q){return(Y)=>{return I(rY(Y.ast,X.ast,Q?jY(Q):y6()),{from:Y,to:X})}}function qu(X){return(Q)=>{return Q.pipe(m(P1(Q),X))}}function QH(X,Q){return(Y)=>{return Q?X.pipe(m(Y,Q)):X.pipe(m(Y))}}function Du(X){return(Q)=>{return U9(Q).pipe(m(Q,X))}}function MN(X){return(Q)=>I(hO(Q.ast,X),{schema:Q})}function YH(X,Q){let Y=Q?.encodingStrategy==="omit"?PG():T1();return(J)=>{return X5(U9(J)).pipe(m(J,{decode:mX(X),encode:Y}))}}function Bu(X,Q){return(Y)=>{return P1(Y).pipe(YH(X,Q),QH(X5(Y)))}}function AN(X,Q){let Y=Q?.encodingStrategy==="omit"?PG():T1();return(J)=>{return B9(U9(J)).pipe(m(J,{decode:mX(X),encode:Y}))}}function Uu(X,Q){return(Y)=>{return P1(Y).pipe(AN(X,Q),QH(B9(Y)))}}function Q5(X){return X1(X).pipe(MN(h(X)))}function Ou(X){return Q5(X).pipe(YH(h(X),{encodingStrategy:"omit"}))}function f2(X,Q){return R0({_tag:Q5(X),...Q})}function wN(X){return(Q)=>{let Y={},J={},$=(K)=>(H)=>K.includes(H[X]);return G(Q),Object.assign(Q,{cases:Y,isAnyOf:$,guards:J,match:Z});function G(K){let H=K.ast;if(yY(H)&&"members"in K&&globalThis.Array.isArray(K.members)&&K.members.every(m2))return K.members.forEach(G);let W=nX(H);if(W.length>0){let V=W.find((_)=>_.key===X)?.literal;if(jQ(V)){Y[V]=K,J[V]=GN(P1(K));return}}throw new globalThis.Error("No literal or unique symbol found")}function Z(){if(arguments.length===1){let W=arguments[0];return function(V){return W[V[X]](V)}}let K=arguments[0];return arguments[1][K[X]](K)}}}function zu(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}=wN("_tag")(J);return I(J.ast,{cases:Q,isAnyOf:G,guards:$,match:Z})}function Fu(){return(X)=>{class Q{}return Object.setPrototypeOf(Q,X)}}function d8(X,Q){return z4((Y)=>Y instanceof X,Q)}function O0(){return(X,Q)=>{return new B0(X.ast,jY(Q))}}var F0=cG;function Lu(X,Q=void 0){return new c4(X,Q)}var eR="^\\S[\\s\\S]*\\S$|^\\S$|^$";function CN(X){return F0((Q)=>Q.trim()===Q,{expected:"a string with no leading or trailing whitespace",meta:{_tag:"isTrimmed",regExp:new globalThis.RegExp(eR)},toArbitraryConstraint:{string:{patterns:[eR]}},...X})}var RQ=aX,Pu=rG,Ru=oG,Nu=iG,Mu=(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 Au(X,Q){let Y=Mu(X);return RQ(Y,{expected:X?`a UUID v${X}`:"a UUID",meta:{_tag:"isUUID",regExp:Y,version:X},...Q})}function wu(X){let Q=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;return RQ(Q,{meta:{_tag:"isULID",regExp:Q},...X})}function TN(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 Cu(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 Tu(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 Iu(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 ju(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 XN="^[^a-z]*$";function Eu(X){return F0((Q)=>Q.toUpperCase()===Q,{expected:"a string with all characters in uppercase",meta:{_tag:"isUppercased",regExp:new globalThis.RegExp(XN)},toArbitraryConstraint:{string:{patterns:[XN]}},...X})}var QN="^[^A-Z]*$";function Su(X){return F0((Q)=>Q.toLowerCase()===Q,{expected:"a string with all characters in lowercase",meta:{_tag:"isLowercased",regExp:new globalThis.RegExp(QN)},toArbitraryConstraint:{string:{patterns:[QN]}},...X})}var YN="^[^a-z]?.*$";function vu(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(YN)},toArbitraryConstraint:{string:{patterns:[YN]}},...X})}var JN="^[^A-Z]?.*$";function xu(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(JN)},toArbitraryConstraint:{string:{patterns:[JN]}},...X})}function IN(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=O5(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=O5(X.order),J=oQ(X.order),$=rQ(X.order),G=X.formatter??g;return(Z,K)=>{let H=Z.exclusiveMinimum?Y:Q,W=Z.exclusiveMaximum?$:J;return F0((V)=>H(V,Z.minimum)&&W(V,Z.maximum),{expected:`a value between ${G(Z.minimum)}${Z.exclusiveMinimum?" (excluded)":""} and ${G(Z.maximum)}${Z.exclusiveMaximum?" (excluded)":""}`,...X.annotate?.(Z),...K})}}function jN(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 ku=NQ({order:D1,annotate:(X)=>({meta:{_tag:"isGreaterThan",exclusiveMinimum:X},toArbitraryConstraint:{number:{min:X,minExcluded:!0}}})}),EN=MQ({order:D1,annotate:(X)=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:X},toArbitraryConstraint:{number:{min:X}}})}),yu=AQ({order:D1,annotate:(X)=>({meta:{_tag:"isLessThan",exclusiveMaximum:X},toArbitraryConstraint:{number:{max:X,maxExcluded:!0}}})}),bu=wQ({order:D1,annotate:(X)=>({meta:{_tag:"isLessThanOrEqualTo",maximum:X},toArbitraryConstraint:{number:{max:X}}})}),JH=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}}}}}}),gu=jN({remainder:OD,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 hu(X){return new c4([u2(X),JH({minimum:-2147483648,maximum:2147483647})],{expected:"a 32-bit integer",...X})}function mu(X){return new c4([u2(),JH({minimum:0,maximum:4294967295})],{expected:"a 32-bit unsigned integer",...X})}function SN(X){return F0((Q)=>!isNaN(Q.getTime()),{expected:"a valid date",meta:{_tag:"isDateValid"},toArbitraryConstraint:{date:{noInvalidDate:!0}},...X})}var du=NQ({order:U5,annotate:(X)=>({meta:{_tag:"isGreaterThanDate",exclusiveMinimum:X},toArbitraryConstraint:{date:{min:X,minExcluded:!0}}})}),pu=MQ({order:U5,annotate:(X)=>({meta:{_tag:"isGreaterThanOrEqualToDate",minimum:X},toArbitraryConstraint:{date:{min:X}}})}),cu=AQ({order:U5,annotate:(X)=>({meta:{_tag:"isLessThanDate",exclusiveMaximum:X},toArbitraryConstraint:{date:{max:X,maxExcluded:!0}}})}),fu=wQ({order:U5,annotate:(X)=>({meta:{_tag:"isLessThanOrEqualToDate",maximum:X},toArbitraryConstraint:{date:{max:X}}})}),uu=CQ({order:U5,annotate:(X)=>({meta:{_tag:"isBetweenDate",...X},toArbitraryConstraint:{date:{min:X.minimum,max:X.maximum}}})}),lu=NQ({order:T8,annotate:(X)=>({meta:{_tag:"isGreaterThanBigInt",exclusiveMinimum:X},toArbitraryConstraint:{bigint:{min:X,minExcluded:!0}}})}),vN=MQ({order:T8,annotate:(X)=>({meta:{_tag:"isGreaterThanOrEqualToBigInt",minimum:X},toArbitraryConstraint:{bigint:{min:X}}})}),ru=AQ({order:T8,annotate:(X)=>({meta:{_tag:"isLessThanBigInt",exclusiveMaximum:X},toArbitraryConstraint:{bigint:{max:X,maxExcluded:!0}}})}),ou=wQ({order:T8,annotate:(X)=>({meta:{_tag:"isLessThanOrEqualToBigInt",maximum:X},toArbitraryConstraint:{bigint:{max:X}}})}),nu=CQ({order:T8,annotate:(X)=>({meta:{_tag:"isBetweenBigInt",...X},toArbitraryConstraint:{bigint:{min:X.minimum,max:X.maximum}}})}),iu=NQ({order:p5,formatter:(X)=>y8(X)}),au=MQ({order:p5,formatter:(X)=>y8(X)}),su=AQ({order:p5,formatter:(X)=>y8(X)}),tu=wQ({order:p5,formatter:(X)=>y8(X)}),eu=CQ({order:p5,formatter:(X)=>y8(X)});function xN(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 kN(X){return xN(1,X)}function Xl(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 yN(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 Ql(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 Yl(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 Jl(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 $l(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 Gl(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 Zl(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 Kl(X,Q){let Y=U9(X),J=Uz(Y.ast);return F0(($,G,Z)=>{let K=Reflect.ownKeys($),H=[];for(let W of K){let V=J(W,Z);if(V!==void 0){if(H.push(new A0([W],V)),Z.errors==="first")break}}if(W8(H))return new q0(G,F($),H);return!0},{expected:"an object with property names matching the schema",meta:{_tag:"isPropertyNames",propertyNames:Y.ast},[h1]:!0,...Q})}function bN(X){let Q=bQ();return F0((Y)=>g3(Y,Q).length===Y.length,{expected:"an array with unique items",meta:{_tag:"isUnique"},toArbitraryConstraint:{array:{comparator:Q}},...X})}var Hl=r.check(kN()),Wl=r.check(yN(1,1));function Y5(X){let Q=c1()([X],([Y])=>(J,$,G)=>{if(YW(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])=>ZW(Y),toFormatter:([Y])=>G8({onNone:()=>"none()",onSome:(J)=>`some(${Y(J)})`})});return I(Q.ast,{value:X})}function _l(X){return eK(X).pipe(m(Y5(P1(X)),mU()))}function Vl(X){return c2(X).pipe(m(Y5(P1(X)),dU()))}function ql(X,Q){return zN(X).pipe(m(Y5(P1(X)),pU(Q)))}function Dl(X){return X5(X).pipe(m(Y5(P1(X)),cU()))}function Bl(X){return B9(X).pipe(m(Y5(P1(X)),fU()))}function Ul(X,Q){let Y=Q===void 0?"omit":Q.onNoneEncoding,J=Y===null?null:void 0;return B9(eK(X)).pipe(m(Y5(P1(X)),EY({decode:($)=>$.pipe(F5(EQ),F),encode:Y==="omit"?z5:($)=>F(aQ(z5($),()=>J))})))}function Ol(X,Q){let Y=c1()([X,Q],([J,$])=>(G,Z,K)=>{if(!UW(G))return v(new x0(Z,F(G)));switch(G._tag){case"Success":return t0(tY(J)(G.success,K),{onSuccess:l,onFailure:(H)=>new q0(Z,F(G),[new A0(["success"],H)])});case"Failure":return t0(tY($)(G.failure,K),{onSuccess:f,onFailure:(H)=>new q0(Z,F(G),[new A0(["failure"],H)])})}},{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,$])=>OW(J,$),toFormatter:([J,$])=>I8({onSuccess:(G)=>`success(${J(G)})`,onFailure:(G)=>`failure(${$(G)})`})});return I(Y.ast,{success:X,failure:Q})}function gN(X,Q){let Y=typeof Q?.label==="string"?y0(X1(Q.label)):void 0,J=c1()([X],([$])=>(G,Z,K)=>{if(qG(G)){let H=Y!==void 0?y1(Y(G.label,K),(W)=>new A0(["label"],W)):g4;return D8(H,()=>t0(y0($)(PY(G),K),{onSuccess:()=>G,onFailure:()=>{let W=F(G);return new q0(Z,W,[new A0(["value"],new Z0(W))])}}))}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()($H($),{decode:n((G)=>Z4(G,{label:Q?.label})),encode:FG((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:([$])=>$U($)});return I(J.ast,{value:X})}function $H(X){return X.pipe(XH(y1(RY)))}function zl(X,Q){return $H(X).pipe(m(gN(P1(X),Q),{decode:n((Y)=>Z4(Y,{label:Q?.label})),encode:FG((Y)=>"Cannot encode Redacted"+(B1(Y)&&typeof Y.value.label==="string"?` with label: "${Y.value.label}"`:""))}))}function rK(X,Q){let Y=c1()([X,Q],([J,$])=>(G,Z,K)=>{if(!Y$(G))return v(new x0(Z,F(G)));switch(G._tag){case"Fail":return t0(y0(J)(G.error,K),{onSuccess:KX,onFailure:(H)=>new q0(Z,F(G),[new A0(["error"],H)])});case"Die":return t0(y0($)(G.defect,K),{onSuccess:HX,onFailure:(H)=>new q0(Z,F(G),[new A0(["defect"],H)])});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 HX(G.defect);case"Interrupt":return WX(G.fiberId)}},encode:b})),toArbitrary:([J,$])=>hN(J,$),toEquivalence:([J,$])=>mN(J,$),toFormatter:([J,$])=>dN(J,$)});return I(Y.ast,{error:X,defect:Q})}function hN(X,Q){return(Y,J)=>{return Y.oneof(J?.isSuspend?{maxDepth:2,depthIdentifier:"Cause.Failure"}:{},Y.constant(WX()),Y.integer({min:1}).map(WX),X.map(($)=>KX($)),Q.map(($)=>HX($)))}}function mN(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 dN(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 oK(X,Q){let Y=c1()([X,Q],([J,$])=>{let G=c0(rK(J,$));return(Z,K,H)=>{if(!Q$(Z))return v(new x0(K,F(Z)));return t0(y0(G)(Z.reasons,H),{onSuccess:ZX,onFailure:(W)=>new q0(K,F(Z),[new A0(["failures"],W)])})}},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([J,$])=>O0()(c0(rK(J,$)),v0({decode:ZX,encode:({reasons:G})=>G})),toArbitrary:([J,$])=>pN(J,$),toEquivalence:([J,$])=>cN(J,$),toFormatter:([J,$])=>fN(J,$)});return I(Y.ast,{error:X,defect:Q})}function pN(X,Q){return(Y,J)=>{return Y.array(hN(X,Q)(Y,J)).map(ZX)}}function cN(X,Q){let Y=fH(mN(X,Q));return(J,$)=>Y(J.reasons,$.reasons)}function fN(X,Q){let Y=dN(X,Q);return(J)=>`Cause([${J.reasons.map(Y).join(", ")}])`}var l2=R0({message:r,name:X5(r),stack:X5(r)}),uN=d8(globalThis.Error,{typeConstructor:{_tag:"Error"},generation:{runtime:"Schema.Error",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>O0()(l2,pX()),toArbitrary:()=>(X)=>X.string().map((Q)=>new globalThis.Error(Q))}),lN=d8(globalThis.Error,{typeConstructor:{_tag:"ErrorWithStack"},generation:{runtime:"Schema.ErrorWithStack",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>O0()(l2,pX({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)}})),Fl=o0([l2.pipe(m(uN,pX())),PQ.pipe(m(d2.annotate({toCodecJson:()=>O0()(PQ,h2),toArbitrary:()=>(X)=>X.json()}),h2))]),Ll=o0([l2.pipe(m(lN,pX({includeStack:!0}))),PQ.pipe(m(d2.annotate({toCodecJson:()=>O0()(PQ,h2),toArbitrary:()=>(X)=>X.json()}),h2))]);function Pl(X,Q,Y){let J=c1()([X,Q,Y],([$,G,Z])=>{let K=oK(G,Z);return(H,W,V)=>{if(!$$(H))return v(new x0(W,F(H)));switch(H._tag){case"Success":return t0(y0($)(H.value,V),{onSuccess:VX,onFailure:(_)=>new q0(W,F(H),[new A0(["value"],_)])});case"Failure":return t0(y0(K)(H.cause,V),{onSuccess:qX,onFailure:(_)=>new q0(W,F(H),[new A0(["cause"],_)])})}}},{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:oK(G,Z)})]),v0({decode:(K)=>K._tag==="Success"?VX(K.value):qX(K.cause),encode:(K)=>V8(K)?{_tag:"Success",value:K.value}:{_tag:"Failure",cause:K.cause}})),toArbitrary:([$,G,Z])=>(K,H)=>K.oneof(H?.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},$.map((W)=>VX(W)),pN(G,Z)(K,H).map((W)=>qX(W))),toEquivalence:([$,G,Z])=>{let K=cN(G,Z);return(H,W)=>{if(H._tag!==W._tag)return!1;switch(H._tag){case"Success":return $(H.value,W.value);case"Failure":return K(H.cause,W.cause)}}},toFormatter:([$,G,Z])=>{let K=fN(G,Z);return(H)=>{switch(H._tag){case"Success":return`Exit.Success(${$(H.value)})`;case"Failure":return`Exit.Failure(${K(H.cause)})`}}}});return I(J.ast,{value:X,error:Q,defect:Y})}function Rl(X,Q){let Y=c1()([X,Q],([J,$])=>{let G=c0(D9([J,$]));return(Z,K,H)=>{if(Z instanceof globalThis.Map)return t0(y0(G)([...Z],H),{onSuccess:(W)=>new globalThis.Map(W),onFailure:(W)=>new q0(K,F(Z),[new A0(["entries"],W)])});return v(new x0(K,F(Z)))}},{typeConstructor:{_tag:"ReadonlyMap"},generation:{runtime:"Schema.ReadonlyMap(?, ?)",Type:"globalThis.ReadonlyMap<?, ?>"},expected:"ReadonlyMap",toCodec:([J,$])=>O0()(c0(D9([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(([H,W])=>`${J(H)} => ${$(W)}`);return`ReadonlyMap(${Z}) { ${K.join(", ")} }`}});return I(Y.ast,{key:X,value:Q})}function Nl(X,Q){let Y=c1()([X,Q],([J,$])=>{let G=c0(D9([J,$]));return(Z,K,H)=>{if(rB(Z))return t0(y0(G)(BY(Z),H),{onSuccess:DY,onFailure:(W)=>new q0(K,F(Z),[new A0(["entries"],W)])});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(D9([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=oB(G);if(Z===0)return"HashMap(0) {}";let K=BY(G).sort().map(([H,W])=>`${J(H)} => ${$(W)}`);return`HashMap(${Z}) { ${K.join(", ")} }`}});return I(Y.ast,{key:X,value:Q})}function Ml(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 I(Q.ast,{value:X})}function Al(X){let Q=c1()([X],([Y])=>{let J=c0(Y);return($,G,Z)=>{if(sB($))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 $=tB(J);if($===0)return"HashSet(0) {}";let G=globalThis.Array.from(J).sort().map((Z)=>`${Y(Z)}`);return`HashSet(${$}) { ${G.join(", ")} }`}});return I(Q.ast,{value:X})}function wl(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])=>o$(Y),toFormatter:([Y])=>(J)=>{let $=qB(J);if($===0)return"Chunk(0) {}";let G=globalThis.Array.from(J).sort().map((Z)=>`${Y(Z)}`);return`Chunk(${$}) { ${G.join(", ")} }`}});return I(Q.ast,{value:X})}var Cl=d8(globalThis.RegExp,{typeConstructor:{_tag:"RegExp"},generation:{runtime:"Schema.RegExp",Type:"globalThis.RegExp"},expected:"RegExp",toCodecJson:()=>O0()(R0({source:r,flags:r}),t1({decode:(X)=>h4({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}),rN=r.annotate({expected:"a string that will be decoded as a URL"}),oN=d8(globalThis.URL,{typeConstructor:{_tag:"URL"},generation:{runtime:"Schema.URL",Type:"globalThis.URL"},expected:"URL",toCodecJson:()=>O0()(rN,CG),toArbitrary:()=>(X)=>X.webUrl().map((Q)=>new globalThis.URL(Q)),toEquivalence:()=>(X,Q)=>X.toString()===Q.toString()}),Tl=rN.pipe(m(oN,CG)),nN=r.annotate({expected:"a string in ISO 8601 format that will be decoded as a Date"}),GH=d8(globalThis.Date,{typeConstructor:{_tag:"Date"},generation:{runtime:"Schema.Date",Type:"globalThis.Date"},expected:"Date",toCodecJson:()=>O0()(nN,wG),toArbitrary:()=>(X,Q)=>X.date(Q?.constraints?.date)}),Il=nN.pipe(m(GH,wG)),iN=GH.check(SN()),r2=z4(m3,{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:p2}),R0({_tag:X1("Millis"),value:YM})]),v0({decode:(X)=>{switch(X._tag){case"Infinity":return i8;case"NegativeInfinity":return F6;case"Nanos":return a8(X.value);case"Millis":return E4(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(F6),X.bigInt().map(a8),X.maxSafeInteger().map(E4)),toFormatter:()=>globalThis.String,toEquivalence:()=>d3}),jl=r.annotate({expected:"a string that will be decoded as a Duration"}),El=jl.pipe(m(r2,bU)),Sl=globalThis.BigInt(0),vl=p2.check(vN(Sl)).pipe(m(r2,gU)),xl=e4.check(EN(0)).pipe(m(r2,hU)),aN=r.annotate({expected:"a string that will be decoded as a BigDecimal"}),sN=z4(f$,{typeConstructor:{_tag:"effect/BigDecimal"},generation:{runtime:"Schema.BigDecimal",Type:"BigDecimal.BigDecimal",importDeclaration:'import * as BigDecimal from "effect/BigDecimal"'},expected:"BigDecimal",toCodecJson:()=>O0()(aN,TG),toArbitrary:()=>(X)=>X.tuple(X.bigInt(),X.integer({min:0,max:20})).map(([Q,Y])=>E6(Q,Y)),toFormatter:()=>(X)=>y8(X),toEquivalence:()=>l$}),kl=aN.pipe(m(sN,TG)),yl=tN(d2);function tN(X){return r.annotate({expected:"a string that will be decoded as JSON",contentMediaType:"application/json",contentSchema:J1(X.ast)}).pipe(m(X,nU))}var eN=d8(globalThis.File,{typeConstructor:{_tag:"File"},generation:{runtime:"Schema.File",Type:"globalThis.File"},expected:"File",toCodecJson:()=>O0()(R0({data:r.check(TN()),type:r,name:r,lastModified:e4}),t1({decode:(X)=>I8(c5(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)=>k$({try:async()=>{let Q=new globalThis.Uint8Array(await X.arrayBuffer());return{data:HY(Q),type:X.type,name:X.name,lastModified:X.lastModified}},catch:(Q)=>new Z0(F(X),{message:globalThis.String(Q)})})}))}),XM=d8(globalThis.FormData,{typeConstructor:{_tag:"FormData"},generation:{runtime:"Schema.FormData",Type:"globalThis.FormData"},expected:"FormData",toCodecJson:()=>O0()(c0(D9([r,o0([R0({_tag:Q5("String"),value:r}),R0({_tag:Q5("File"),value:eN})])])),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 bl(X){return XM.pipe(m(X,iU))}var QM=d8(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 gl(X){return QM.pipe(m(X,aU))}var o2=e4.check(IN()),YM=e4.check(u2()),hl=r.annotate({expected:"a string that will be decoded as a number"}).pipe(m(e4,o5)),ml=r.annotate({expected:"a string that will be decoded as a finite number"}).pipe(m(o2,o5)),dl=I(nG).pipe(m(p2,SY)),JM=r.check(CN()),pl=r.annotate({expected:"a string that will be decoded as a trimmed string"}).pipe(m(JM,yU())),cl=r.annotate({expected:"a base64 encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,uU)),fl=r.annotate({expected:"a base64 (URL) encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,lU)),ul=r.annotate({expected:"a hex encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,rU)),ll=r.annotate({expected:"a URI component encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,oU)),nK=o0([o2,DN,r]),rl=R0({issues:c0(R0({message:r,path:B9(c0(o0([nK,R0({key:nK})])))}))}),ol=tK([0,1]).pipe(m(qN,v0({decode:(X)=>X===1,encode:(X)=>X?1:0}))),$M=r.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),n2=d8(globalThis.Uint8Array,{typeConstructor:{_tag:"Uint8Array"},generation:{runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"},expected:"Uint8Array",toCodecJson:()=>O0()($M,IG),toArbitrary:()=>(X)=>X.uint8Array()}),nl=$M.pipe(m(n2,IG)),il=r.annotate({expected:"a base64 (URL) encoded string that will be decoded as a Uint8Array"}).pipe(m(n2,{decode:MU(),encode:TY()})),al=r.annotate({expected:"a hex encoded string that will be decoded as a Uint8Array"}).pipe(m(n2,{decode:wU(),encode:IY()})),i2=z4((X)=>i$(X)&&OB(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,SG),toArbitrary:()=>(X,Q)=>X.date({noInvalidDate:!0,...Q?.constraints?.date}).map((Y)=>FB(Y)),toFormatter:()=>(X)=>X.toString(),toEquivalence:()=>a$}),sl=iN.pipe(m(i2,{decode:NG(),encode:n(MB)})),tl=r.annotate({expected:"a string that will be decoded as a DateTime.Utc"}).pipe(m(i2,SG)),el=e4.pipe(m(i2,{decode:NG(),encode:n(AB)})),Xr=z4(BB,{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()(e4,sU),toArbitrary:()=>(X)=>X.integer({min:-43200000,max:50400000}).map((Q)=>jX(Q)),toFormatter:()=>(X)=>m4(X),toEquivalence:()=>(X,Q)=>X.offset===Q.offset}),GM=r.annotate({expected:"an IANA time zone identifier"}),ZM=z4(UB,{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()(GM,jG),toArbitrary:()=>(X)=>X.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(s$)),toFormatter:()=>(X)=>m4(X),toEquivalence:()=>(X,Q)=>X.id===Q.id}),Qr=GM.pipe(m(ZM,jG)),KM=r.annotate({expected:"a time zone string (IANA identifier or offset like +03:00)"}),HM=z4(DB,{typeConstructor:{_tag:"effect/DateTime.TimeZone"},generation:{runtime:"Schema.TimeZone",Type:"DateTime.TimeZone",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone",toCodecJson:()=>O0()(KM,EG),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(s$))),toFormatter:()=>(X)=>m4(X),toEquivalence:()=>(X,Q)=>m4(X)===m4(Q)}),Yr=KM.pipe(m(HM,EG)),WM=r.annotate({expected:"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"}),_M=z4((X)=>i$(X)&&zB(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()(WM,vG),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])=>LB(Y,{timeZone:J})),toFormatter:()=>(X)=>ZY(X),toEquivalence:()=>a$}),Jr=WM.pipe(m(_M,vG)),$r=globalThis.Symbol.for("immer-draftable");function ZH(X,Q,Y,J,$){let G=Zr(Y,Q,J),Z=VM(Q),K=class extends X{constructor(...[H,W]){H=H??{};let V=Y.make(H,W);super({...H,...V},{...W,disableChecks:!0})}static[FQ]=FQ;get[Z](){return Z}static[$r]=!0;static identifier=Q;static fields=Y.fields;static get ast(){return G(this).ast}static pipe(){return a(this,arguments)}static rebuild(H){return G(this).rebuild(H)}static make(H,W){return new this(H,W)}static makeOption(H,W){return sY(G(this))(H??{},W)}static makeEffect(H,W){return y1(e5(G(this))(H??{},W),(V)=>new _4(V))}static annotate(H){return this.rebuild(c6(this.ast,H))}static annotateKey(H){return this.rebuild(tX(this.ast,H))}static check(...H){return this.rebuild(f4(this.ast,H))}static extend(H){return(W,V)=>{let _={...Y.fields,...W};return ZH(this,H,sK(hY(_,Y.ast.checks,{identifier:H}),_),V,$)}}static mapFields(H,W){return Y.mapFields(H,W)}};if($!==void 0)Object.assign(K.prototype,$(Q));return K}function Gr(X){return new K0(n((Q)=>new X(Q)),T1())}function VM(X){return`~effect/Schema/Class/${X}`}function Zr(X,Q,Y){let J;return($)=>{if(J===void 0){let G=Gr($),Z=I(new h6([X.ast],()=>(K,H)=>{return K instanceof $||M(K,VM(Q))?h(K):v(new x0(H,F(K)))},{identifier:Q,[t5]:([K])=>new B0(K,G),toCodec:([K])=>new B0(K.ast,G),toArbitrary:([K])=>()=>K.map((H)=>new $(H)),toFormatter:([K])=>(H)=>`${$.identifier}(${K(H)})`,"~sentinels":nX(X.ast),...Y}));J=X.pipe(m(Z,G))}return J}}function a2(X){return m2(X)}var qM=(X)=>(Q,Y)=>{let J=a2(Q)?Q:R0(Q);return ZH(eq,X,J,Y,($)=>({toString(){return`${$}(${g({...this})})`}}))},Kr=(X)=>{return(Q,Y,J)=>{return qM(X??Q)(a2(Y)?Y.mapFields(($)=>({_tag:Q5(Q),...$}),{unsafePreserveChecks:!0}):f2(Q,Y),J)}},DM=(X)=>(Q,Y)=>{let J=a2(Q)?Q:R0(Q);return ZH(pQ,X,J,Y,(G)=>({name:G}))},Hr=(X)=>{return(Q,Y,J)=>{return DM(X??Q)(a2(Y)?Y.mapFields(($)=>({_tag:Q5(Q),...$}),{unsafePreserveChecks:!0}):f2(Q,Y),J)}};function BM(X){let Q=qz(X.ast);return(Y)=>Q(Y,{})}function Wr(X){return BM(X)(uK)}function _r(X){return(Q)=>{return Q.annotate({toFormatter:X})}}function Vr(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 H=[],W=0;for(;W<G.length;W++)if(K.length<W+1){if(E0($.elements[W]))continue}else H.push(G[W](K[W]));if(Z.length>0){let[V,..._]=Z;for(;W<K.length-_.length;W++)H.push(V(K[W]));for(let q=0;q<_.length;q++)W+=q,H.push(_[q](K[W]))}return"["+H.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 H=[],W=new Set;for(let V=0;V<G.length;V++){let _=$.propertySignatures[V],q=_.name;if(W.add(q),E0(_.type)&&!Object.hasOwn(K,q))continue;H.push(`${R4(q)}: ${G[V](K[q])}`)}for(let V=0;V<Z.length;V++){let _=d6(K,$.indexSignatures[V].parameter);for(let q of _){if(W.has(q))continue;W.add(q),H.push(`${R4(q)}: ${Z[V](K[q])}`)}}return H.length>0?"{ "+H.join(", ")+" }":"{}"}}case"Union":{let G=(Z)=>iX(Z,$.types);return(Z)=>{let K=G(Z),H=K.map(JQ);for(let W=0;W<K.length;W++){let V=H[W];if(V(Z))return Y(K[W])(Z)}return g(Z)}}case"Suspend":{let G=p6(()=>Y($.thunk()));return(Z)=>G()(Z)}}}}function qr(X){return(Q)=>Q.annotate({toEquivalence:X})}function Dr(X){return jz(X.ast)}function UM(X){return vz(X.ast)}function OM(X,Q){let Y=UM(X),J=xz(Y,Q);return{dialect:"draft-2020-12",schema:J.schema,definitions:J.definitions}}function zM(X){return I(FM(X.ast))}var FM=f6((X)=>{let Q=Br(X,FM);return Q!==X&&E0(X)?s5(Q):Q});function Br(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)=>r6(J1(Z))):[],$=Y(J),G=Q($.to);return D0(X,G===$.to?[$]:[new B0(G,$.transformation)])}return D0(X,[eO])}case"Unknown":case"ObjectKeyword":return D0(X,[Xz]);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 LM(X){return I(PM(z8(X.ast)))}var PM=p0((X)=>{let Q=Ur(X,PM);return Q!==X&&E0(X)?s5(Q):Q});function Ur(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)=>r6(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 RM(X,Q){return I(wM(Q?.keepDeclarations===!0?AM(X.ast):MM(X.ast)))}function Or(X,Q){let Y=u5(X.ast)??VG(X.ast),J=WN(RM(X));return($)=>J($).pipe(AX((G)=>zr(G,{rootName:Y,...Q})))}function zr(X,Q){let Y=Q.rootName??"root",J=Q.arrayItemName??"item",$=Q.pretty??!0,G=Q.indent??" ",Z=Q.sortKeys??!0,K=new Set,H=[];return V(Y,X,0),H.join($?`
|
|
66
|
+
`:"");function W(_,q){H.push($?G.repeat(_)+q:q)}function V(_,q,D,U){let{attrs:R,safe:L}=q9.tagInfo(_,U);if(q===void 0)W(D,`<${L}${R}/>`);else if(typeof q==="string")W(D,`<${L}${R}>${q9.escapeText(q)}</${L}>`);else if(typeof q!=="object"||q===null)W(D,`<${L}${R}>${q9.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){W(D,`<${L}${R}/>`);return}W(D,`<${L}${R}>`);for(let y of q)V(J,y,D+1);W(D,`</${L}>`);return}let N=q,P=Object.keys(N);if(Z)P.sort();if(P.length===0){W(D,`<${L}${R}/>`);return}W(D,`<${L}${R}>`);for(let y of P)V(q9.parseTagName(y).safe,N[y],D+1,y);W(D,`</${L}>`)}finally{K.delete(q)}}}}var q9={escapeText(X){return X.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},escapeAttribute(X){return X.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")},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}=q9.parseTagName(X),G=Y||Q&&Q!==X?` data-name="${q9.escapeAttribute(Q??X)}"`:"";return{safe:J,attrs:G}}};function Fr(X){switch(X._tag){case"Null":case"Boolean":case"Number":case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}var Lr=_Z(Fr);function NM(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)=>I(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,[Pr]);case"Boolean":return D0(X,[Rr]);case"Unknown":case"ObjectKeyword":return D0(X,[Qz]);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=Lr(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 Pr=new B0(new b1("null"),new K0(n(()=>null),n(()=>"null"))),Rr=new B0(new g1([new b1("true"),new b1("false")],"anyOf"),new K0(n((X)=>X==="true"),k6())),MM=f6((X)=>{let Q=NM(X,MM,(Y)=>D0(Y,[Nr]));if(Q!==X&&E0(X))return s5(Q);return Q}),Nr=new B0(kG,new K0(T1(),n(()=>{return}))),AM=f6((X)=>{let Q=NM(X,AM,b);if(Q!==X&&E0(X))return s5(Q);return Q}),$N="~effect/Schema/SERIALIZER_ENSURE_ARRAY",wM=f6((X)=>{if(yY(X)&&X.annotations?.[$N])return X;let Q=Mr(X);if(kY(Q)){let Y=new g1([Q,rY(m6,Q,new K0(PU(),T1()))],"anyOf",{[$N]:!0});return E0(X)?lY(Y):Y}return Q});function Mr(X){switch(X._tag){default:return X;case"Declaration":case"Arrays":case"Objects":case"Union":case"Suspend":return X.recur(wM)}}function Ar(X){let Q=LM(X);return pz(X2(Q),eY(Q))}function wr(X){return q2()}function Cr(X){return q2()}function Tr(X,Q){return(Y)=>{return I(c6(Y.ast,{toCodecIso:()=>new B0(X.ast,jY(Q))}),{schema:Y})}}function Ir(X){let Q=zM(X),Y=X2(Q),J=eY(Q);return{empty:[],diff:($,G)=>Z2(Y($),Y(G)),combine:($,G)=>[...$,...G],patch:($,G)=>{let Z=Y($),K=bz(G,Z);return Object.is(K,Z)?$:J(K)}}}function jr(X){let Q=FN(()=>Y),Y=o0([X,c0(Q),BN(r,Q)]);return Y}var Er=I(nY),Sr=I(tO);function vr(X){return U8(X.ast)}function xr(X){return X.ast.context?.annotations}var mM=O(yM(),1),cr=["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"],fr=["/tmp","/var/tmp","/var/folders","/private/tmp","/private/var/tmp","/private/var/folders"],dM=new Set([">",">>","<","<<","<<<","<>",">&","<&","&>","&>>"]),pM=new Set([";","&&","||","|","|&","&"]),cM=(X)=>typeof X==="string",F4=(X)=>{if(typeof X==="object"&&"op"in X&&typeof X.op==="string")return X.op;return null},ur=(X)=>typeof X==="object"&&("comment"in X),lr=(X)=>{try{let Q=[...new Bun.Glob(X).scanSync({onlyFiles:!1,dot:!0})];if(Q.length>0)return Q}catch{}return[X]},rr=(X)=>{if(cM(X))return[X];if(typeof X==="object"&&"op"in X&&X.op==="glob"&&"pattern"in X)return lr(String(X.pattern));let Q=F4(X);if(Q!==null){if(dM.has(Q)||pM.has(Q))return[];return[`__op_${Q}__`]}if(ur(X))return[];return["__tripwire_cmd_sub__"]},bM=(X,Q)=>{let Y=[],J=[],$=[],G=[],Z=0;while(Z<X.length){let K=X[Z],H=F4(K);if(H!==null&&dM.has(H)){let W=Y.at(-1);if(W!==void 0&&/^[0-9]+$/.test(W)&&Q.remaining>0)Y.pop(),Q.remaining--;let V=X[Z+1];if(V!==void 0&&cM(V)){G.push({op:H,target:V}),Z+=2;continue}Z++;continue}for(let W of rr(K))Y.push(W);Z++}if(Y.length===0)return null;for(let K=1;K<Y.length;K++){let H=Y[K];if(H.startsWith("-")&&H!=="-")$.push(H);else J.push(H)}return{head:Y[0],tokens:Y,args:J,flags:$,redirects:G,raw:Y.join(" ")}},or=(X)=>`$${X}`,nr=(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},ir=(X)=>{return X.match(/(?<![\w$])\d+(?=[<>])/g)?.length??0},ar=(X)=>{let Q=[],Y=X.match(/`([^`]+)`/g);if(Y!==null)for(let J of Y)Q.push(J.slice(1,-1));for(let J=0;J<X.length-1;J++){let $=X[J],G=X[J+1];if(!(($==="$"||$==="<"||$===">")&&G==="("))continue;let K=1,H=J+2;while(H<X.length&&K>0){let W=X[H];if(W==="(")K++;else if(W===")")K--;if(K>0)H++}if(K===0)Q.push(X.slice(J+2,H)),J=H}return Q},fM=/^\$\{?HOME\}?(?:\/|$)/,uM=(X)=>{if(X===""||X==="-")return!1;if(X==="/"||X==="~"||X==="."||X==="..")return!0;if(X.startsWith("/")||X.startsWith("~")||X.startsWith("./")||X.startsWith("../")||fM.test(X))return!0;return!1},t2=(X)=>{if(X==="/")return 100;if(X==="~"||fM.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},sr=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"]),tr=(X,Q)=>{let Y=[],J=1;while(J<Q){let $=X[J];if(sr.has($)){J+=2;continue}if($.startsWith("-")){J++;continue}if(uM($))Y.push($);J++}if(Y.length===0)return".";return Y.sort(($,G)=>t2(G)-t2($)),Y[0]},er=(X,Q)=>{let Y=[];for(let J=1;J<Q;J++){let $=X[J];if($.startsWith("-"))break;if(uM($))Y.push($)}if(Y.length===0)return".";return Y.sort((J,$)=>t2($)-t2(J)),Y[0]},gM={execFlags:new Set(["-x","-X","--exec","--exec-batch"]),placeholders:new Set(["{}","{/}","{//}","{.}","{/.}"]),pickRoot:tr},hM={execFlags:new Set(["-exec","-execdir","-ok","-okdir"]),placeholders:new Set(["{}"]),pickRoot:er},Xo={fd:gM,fdfind:gM,find:hM,gfind:hM},Qo=(X,Q,Y)=>X.map((J)=>Q.placeholders.has(J)?Y:J),Yo=(X)=>{let Q=Xo[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 W=J[Z];if(W===";"||W==="+")break;G.push(W),Z++}if(G.length===0)continue;let K=G[0];if(Q.placeholders.has(K))continue;let H=Q.pickRoot(J,$);Y.push(Qo(G,Q,H).join(" ")),$=Z}return Y},z9=(X)=>{let Q;try{Q=mM.parse(X,or)}catch{return[]}Q=nr(Q);let Y={remaining:ir(X)},J=[],$=[];for(let K of Q){let H=F4(K);if(H!==null&&pM.has(H)){let W=bM($,Y);if(W!==null)J.push(W);$=[];continue}$.push(K)}let G=bM($,Y);if(G!==null)J.push(G);for(let K of ar(X))for(let H of z9(K))J.push(H);let Z=J.length;for(let K=0;K<Z;K++){let H=J[K];for(let W of Yo(H))for(let V of z9(W))J.push(V)}return J},Jo=(X)=>X.startsWith("./")?X.slice(2):X,WH=(X,Q=[],Y=[])=>{if(X==="")return!1;let J=Jo(X);if(J===".."||J.startsWith("../")||J.includes("/../"))return!1;for(let $ of[...fr,...Y])if(J===$||J.startsWith(`${$}/`))return!0;for(let $ of[...cr,...Q])if(J===$||J.startsWith(`${$}/`))return!0;return!1},lM=(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(`
|
|
67
|
+
`)},_1=(X)=>/(^|\s)#\s*tripwire-allow\b/.test(X);var F9=require("fs"),oM=require("os");var rM=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)})))}),$o=w.Struct({enabled:w.optional(w.Boolean),path:w.optional(w.String)}),Go=w.Struct({protectedBranches:w.optional(w.Array(w.String)),enforceConventionalCommits:w.optional(w.Boolean)}),Zo=w.Struct({relative:w.optional(w.Array(w.String)),absolute:w.optional(w.Array(w.String))}),Ko=w.Struct({rtk:w.optional($o),git:w.optional(Go),safePaths:w.optional(Zo),blockedCommands:w.optional(w.Array(rM)),allowedCommands:w.optional(w.Array(rM))}),nM=`${oM.homedir()}/.config/tripwire/config.json`,Ho=()=>U0.sync(()=>{try{return F9.accessSync(nM,F9.constants.R_OK),!0}catch{return!1}}),Wo=()=>U0.try({try:()=>F9.readFileSync(nM,"utf8"),catch:(X)=>X}),_o=(X)=>U0.try({try:()=>JSON.parse(X),catch:(Q)=>Q}),Vo=(X)=>w.decodeUnknownEffect(Ko)(X),L4=()=>({rtk:{enabled:!1},git:{protectedBranches:["main","master","develop","production","release"],enforceConventionalCommits:!0},safePaths:{},blockedCommands:[],allowedCommands:[]}),_H=(X)=>({rtk:X.rtk??L4().rtk,git:X.git??L4().git,safePaths:X.safePaths??L4().safePaths,blockedCommands:X.blockedCommands??L4().blockedCommands,allowedCommands:X.allowedCommands??L4().allowedCommands}),iM=()=>U0.gen(function*(){if(!(yield*Ho()))return L4();let Q=yield*Wo(),Y=yield*_o(Q),J=yield*Vo(Y);return _H(J)}).pipe(U0.timeout(1000),U0.catch(()=>{return console.error("[tripwire] Config loading failed, using defaults"),U0.succeed(L4())}));var aM={allow:0,warn:1,ask:2,deny:3},C=(X)=>({kind:"allow",rule:X,message:""}),X6=(X,Q)=>({kind:"warn",rule:X,message:Q}),n0=(X,Q)=>({kind:"ask",rule:X,message:Q}),d=(X,Q)=>({kind:"deny",rule:X,message:Q}),VH=(X)=>{let Q=C("none"),Y;for(let J of X){if(aM[J.kind]>aM[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 sM=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)}),tM=(X)=>typeof X==="object"&&X!==null&&typeof X.command==="string",eM=(X)=>typeof X==="object"&&X!==null&&typeof X.file_path==="string"&&typeof X.old_string==="string"&&typeof X.new_string==="string",XA=(X)=>typeof X==="object"&&X!==null&&typeof X.file_path==="string"&&typeof X.content==="string",QA=(X)=>typeof X==="object"&&X!==null&&typeof X.file_path==="string",YA=(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(`
|
|
68
|
+
`)}if(X==="Read"){let Y=Q;return Y.content??Y.file?.content??""}if(typeof Q.content==="string")return Q.content??"";return""};var e2=require("fs"),JA=require("os"),$A=require("path"),GA=`${JA.homedir()}/.claude/tripwire.log`;try{e2.mkdirSync($A.dirname(GA),{recursive:!0})}catch{}var TQ=(X,Q)=>{let Y=new Date().toISOString(),J=Q instanceof Error?Q.stack??Q.message:String(Q);try{e2.appendFileSync(GA,`[${Y}] [${X}] ${J}
|
|
69
|
+
`)}catch{}};var X3=require("child_process"),qo=(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 X3.spawnSync("test",["-x",J],{stdio:"ignore"}),J}catch{continue}try{let J=X3.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=(X,Q,Y=2000)=>{if(!Q.enabled)return{};let J=qo(Q);if(J===null)return{};let $=JSON.stringify(X),G=X3.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,H=Z.hookSpecificOutput?.permissionDecisionReason;if(typeof K!=="string")return{};if(typeof H==="string")return{updatedCommand:K,reason:H};return{updatedCommand:K}}catch{return{}}};var Do=(X)=>X.tokens.slice(1).join(" "),KA=(X,...Q)=>X.flags.some((Y)=>Q.includes(Y)),Bo=[{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"&&KA(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"&&KA(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:"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(Do(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")}],HA=(X,Q)=>{if(_1(Q))return C("bash-deny");for(let Y of X)for(let J of Bo)if(J.match(Y,Q))return J.action==="deny"?d(J.rule,J.message):n0(J.rule,J.message);return C("bash-deny")};var Uo=["main","master","develop","production","release"],qH=(X)=>X.protectedBranches??Uo,Oo=/^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([\w./\- ]+\))?!?:\s+\S/,zo=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix"]),Fo=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"]),Lo=(X)=>{if(X.head!=="git")return null;let Q=X.tokens.slice(1),Y=0;while(Y<Q.length){let J=Q[Y];if(zo.has(J)){Y+=2;continue}if(Fo.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},Po=(X)=>{for(let Q=0;Q<X.length;Q++){let Y=X[Q];if(Y==="-m"||Y==="--message")return X[Q+1]??null;if(Y.startsWith("--message="))return Y.slice(10);if(/^-[a-zA-Z]*m[a-zA-Z]*$/.test(Y))return X[Q+1]??null}return null},Ro=(X,Q)=>{let Y=qH(Q);for(let J of X)for(let $ of Y)if(J===$||J.endsWith(`:${$}`)||J.endsWith(`/${$}`))return $;return null},No=(X)=>X.filter((Q)=>!Q.startsWith("-")),Mo=(X)=>X.filter((Q)=>Q.startsWith("-")),h0=(X,...Q)=>Q.some((Y)=>X.includes(Y)),Ao=({subArgs:X,positional:Q})=>{if(h0(X,"--global","--system"))return d("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 d("git-config-write","Local git config writes should be done explicitly. To read a value, use `git config --get <key>`.");return C("bash-git")},wo=({subArgs:X})=>{if(h0(X,"--cached"))return C("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.")},Co=({subArgs:X,positional:Q})=>{if(h0(X,"--staged","-S")&&!h0(X,"--worktree","-W"))return C("bash-git");if(Q.length>0)return d("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 C("bash-git")},To=({subArgs:X,positional:Q})=>{if(h0(X,"-b","-B"))return C("bash-git");if(h0(X,"-f","--force"))return d("git-checkout-force","`git checkout -f` overwrites the working tree without preserving uncommitted changes. Refuse.");if(X.includes("--"))return d("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 d("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 C("bash-git")},Io=({subArgs:X})=>{if(h0(X,"-f","--force","--discard-changes"))return d("git-switch-force","`git switch -f / --discard-changes` throws away uncommitted working-tree changes. Refuse.");return C("bash-git")},jo=({subArgs:X,flags:Q,positional:Y})=>{if(h0(X,"--hard"))return d("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 C("bash-git");return n0("git-reset-mixed","`git reset` moves HEAD. Confirm intent \u2014 if undoing a commit, `git revert` is usually safer.")},Eo=({flags:X})=>{if(X.some((Q)=>/^-[a-zA-Z]*[df]/.test(Q)||Q==="--force"))return d("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 C("bash-git")},So=({subArgs:X,positional:Q,config:Y})=>{if(h0(X,"--abort","--quit","--continue","--skip","--edit-todo"))return C("bash-git");if(h0(X,"-i","--interactive"))return d("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],$=qH(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.")},vo=({subArgs:X})=>{if(h0(X,"--abort","--quit","--continue","--skip"))return C("bash-git");return n0("git-cherry-pick","`git cherry-pick` applies commits onto the current branch and can create conflicts. Confirm intent.")},xo=({subArgs:X})=>{if(h0(X,"--abort","--continue","--quit"))return C("bash-git");return n0("git-merge","`git merge <branch>` may create merge conflicts. Confirm intent.")},ko=({subArgs:X,config:Q})=>{if(h0(X,"--amend"))return d("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 Y=Po(X),J=h0(X,"-F","--file","-c","-C","--reuse-message","--reedit-message"),$=h0(X,"--no-edit");if(Y===null&&!J&&!$)return d("git-commit-no-message",'`git commit` without `-m "..."` opens an editor and hangs the agent. Use `git commit -m "<conventional message>"`.');if(Y!==null&&Q.enforceConventionalCommits!==!1&&!Oo.test(Y))return d("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(Y)}`].join(`
|
|
70
|
+
`));if(h0(X,"-a","--all")||X.some((G)=>/^-[a-zA-Z]*a[a-zA-Z]*$/.test(G)))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 C("bash-git")},yo=({subArgs:X,flags:Q,positional:Y,config:J})=>{if(Q.some((G)=>G==="--force"||G==="-f"||G.startsWith("--force-with-lease")))return d("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 d("git-push-delete","Refusing to delete a remote branch via push. If genuinely needed, surface the intent.");let $=Ro(Y,J);if($!==null)return d("git-push-protected",`Refusing to push directly to protected branch \`${$}\`. Open a PR instead: \`gh pr create\`.`);return C("bash-git")},bo=({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=qH(J),K=G.find((H)=>Z.includes(H));if(K!==void 0)return d("git-branch-delete-protected",`Refusing to delete protected branch \`${K}\`.`);if($==="-D"||$.includes("D"))return d("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 C("bash-git")},go=({subArgs:X})=>{if(h0(X,"-d","--delete"))return d("git-tag-delete","`git tag -d` deletes a tag. Refuse \u2014 surface intent.");return C("bash-git")},ho=({subArgs:X})=>{let Q=X[0]??"push";if(Q==="drop"||Q==="clear")return d("git-stash-drop",`\`git stash ${Q}\` discards stashed work. Refuse \u2014 \`git stash list\` and \`git stash show\` to inspect first.`);return C("bash-git")},mo=({flags:X})=>{if(X.some((Q)=>Q.startsWith("--prune=")||Q==="--aggressive"))return d("git-gc-prune","`git gc --prune=now` / `--aggressive` destroys reflog recovery options. Refuse.");return C("bash-git")},po=({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 C("bash-git")},WA=({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 C("bash-git")},co=new Map([["config",Ao],["add",()=>C("bash-git")],["mv",()=>C("bash-git")],["rm",wo],["restore",Co],["checkout",To],["switch",Io],["reset",jo],["clean",Eo],["rebase",So],["cherry-pick",vo],["merge",xo],["commit",ko],["push",yo],["branch",bo],["tag",go],["stash",ho],["filter-branch",({subcommand:X})=>d("git-filter",`\`git ${X}\` rewrites entire repo history. Refuse.`)],["filter-repo",({subcommand:X})=>d("git-filter",`\`git ${X}\` rewrites entire repo history. Refuse.`)],["gc",mo],["update-ref",()=>d("git-update-ref","`git update-ref` directly mutates refs and bypasses normal git operations. Refuse.")],["remote",po],["submodule",WA],["worktree",WA],["init",({subcommand:X})=>X6(`git-${X}`,`\`git ${X}\` is allowed but unusual mid-session. Make sure this is what Sean asked for.`)],["clone",({subcommand:X})=>X6(`git-${X}`,`\`git ${X}\` is allowed but unusual mid-session. Make sure this is what Sean asked for.`)]]),fo=(X,Q)=>{let{subcommand:Y,subArgs:J}=X,$=Mo(J),G=No(J);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(Y)){if(Y==="reflog"&&(J[0]==="expire"||h0(J,"--expire")))return d("git-reflog-expire","`git reflog expire` destroys git's recovery history. Refuse \u2014 surface the intent.");if(Y==="symbolic-ref"&&G.length>=2)return d("git-symbolic-ref-write","`git symbolic-ref <name> <ref>` rewrites a symbolic ref. Refuse.");return C("bash-git")}let K=co.get(Y);if(K!==void 0)return K({subcommand:Y,subArgs:J,flags:$,positional:G,config:Q});return X6("git-unknown-subcommand",`\`git ${Y}\` is not classified by tripwire. Allowing \u2014 flag if this looks like history-rewriting or data-loss territory.`)},_A=(X,Q,Y)=>{if(_1(Q))return C("bash-git");for(let J of X){let $=Lo(J);if($===null)continue;let G=fo($,Y);if(G!==null&&G.kind!=="allow")return G}return C("bash-git")};var uo=new Set(["curl","wget","wget2","aria2c","xh"]),lo=new Set(["bash","sh","zsh","fish"]),ro=(X)=>{for(let Q=0;Q<X.length-1;Q++){let Y=X[Q],J=X[Q+1];if(uo.has(Y.head)&&lo.has(J.head))return!0}return!1},oo=[{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."}],VA=(X,Q)=>{if(_1(Q))return C("bash-network-install");if(ro(X))return d("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 oo)if(Y.head===J.head&&Y.tokens[1]===J.subcommand)return n0(J.rule,J.message);return C("bash-network-install")};var no=[{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."}],DH=(X)=>{for(let Q of no)if(Q.pattern.test(X))return d(Q.rule,Q.message);return null},qA=(X,Q)=>{if(_1(Q))return C("bash-redirect");for(let Y of X){for(let J of Y.redirects)if(J.op===">"||J.op===">>"){let $=DH(J.target);if($!==null)return $}if(Y.head==="tee")for(let J of Y.args){let $=DH(J);if($!==null)return $}if(Y.head==="cp"||Y.head==="mv"){let J=Y.args.at(-1);if(J!==void 0){let $=DH(J);if($!==null)return $}}}return C("bash-redirect")};var io=(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)=>!WH(Z,$,G))},ao=(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)=>!WH(Z,$,G))},DA=(X,Q,Y)=>{if(_1(Q))return C("bash-scoped-rm");let J=[];for(let K of X){if(K.head==="rm"){let H=io(K,Y);if(H.length>0)J.push({kind:"rm",targets:H});continue}if(K.head==="find"){let H=ao(K,Y);if(H!==null&&H.length>0)J.push({kind:"find -delete",targets:H})}}if(J.length===0)return C("bash-scoped-rm");let $=Y.relative??[],G=Y.absolute??[],Z=J.map((K)=>` \u2022 ${K.kind} on: ${K.targets.map((H)=>JSON.stringify(H)).join(", ")}`).join(`
|
|
71
71
|
`);return d("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:
|
|
72
|
-
${
|
|
72
|
+
${lM($,G)}
|
|
73
73
|
|
|
74
74
|
Flagged targets:
|
|
75
75
|
${Z}
|
|
76
76
|
|
|
77
|
-
If raw \`rm\` is genuinely needed, append \` # tripwire-allow: <reason>\` to the command.`)};var
|
|
77
|
+
If raw \`rm\` is genuinely needed, append \` # tripwire-allow: <reason>\` to the command.`)};var so=(X)=>X==="-x"||X==="-xf"||X==="-xzf"||X==="-xjf"||X==="-xJf"||X==="-xvf"||X==="-xvzf"||X==="-xvjf"||X==="--extract"||/^-[xvzjJtf]+$/.test(X),to=(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},BA=(X)=>{return X==="/"||/^(~|\$HOME|\$\{HOME\})$/.test(X)},UA=(X,Q)=>{if(_1(Q))return C("bash-tar-explosion");for(let Y of X){if(Y.head!=="tar")continue;if(!(Y.flags.some(so)||Y.tokens.includes("--extract")))continue;let $=to(Y);if($!==null&&BA($))return d("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&&BA($))return d("unzip-to-root",`unzip -d ${$} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory.`)}}return C("bash-tar-explosion")};var eo=[{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"}],OA=(X,Q)=>{if(_1(Q))return C("bash-tool-policy");for(let Y of X)for(let J of eo)if(J.fires(Y))return J.action==="deny"?d(J.rule,J.message):X6(J.rule,J.message);return C("bash-tool-policy")};var Xn="If this is intentional, append ` # tripwire-allow: <reason>` to the command.",Qn=new Map([["add","create"],["new","create"],["edit","update"],["set","update"],["rm","delete"],["del","delete"],["remove","delete"]]),zA=(X)=>Qn.get(X)??X,FA=(X)=>{let Q=X.lastIndexOf("/");return Q===-1?X:X.slice(Q+1)},Yn=(X,Q)=>X.some((Y)=>Y===Q||Y.startsWith(`${Q}=`)),Jn=(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},$n=(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},LA=(X,Q)=>{let Y=Q.pattern,J=z9(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(FA(K.head)!==FA(G))continue;if(Z.length>0){let V=$n(K);if(!Z.every((q,D)=>V[D]!==void 0&&zA(V[D])===zA(q)))continue}if((Q.requiresFlags??[]).some((V)=>!Yn(K.tokens,V)))continue;if(!(Q.forbidsFlagValues??[]).every((V)=>{let _=Jn(K.tokens,V.flag);return _!==null&&V.values.includes(_)}))continue;if(Z.length===0&&Q.requiresFlags===void 0&&Q.forbidsFlagValues===void 0)return!0;return!0}return!1},PA=(X,Q,Y,J)=>{if(_1(Q))return C("config-custom");for(let $ of J)if(LA(X,$))return C("config-custom");for(let $ of Y)if(LA(X,$)){let G=$.message.includes("tripwire-allow")?$.message:`${$.message} ${Xn}`;return $.action==="ask"?n0("config-custom",G):d("config-custom",G)}return C("config-custom")};var RA=require("fs"),NA=(X,Q)=>{let Y=new Set(X.split(`
|
|
78
78
|
`).map((J)=>J.trim()).filter((J)=>J.length>0));return Q.split(`
|
|
79
|
-
`).filter((J)=>J.trim().length>0).filter((J)=>!Y.has(J.trim()))},
|
|
79
|
+
`).filter((J)=>J.trim().length>0).filter((J)=>!Y.has(J.trim()))},MA=(X)=>{try{return RA.readFileSync(X,"utf8")}catch{return""}};var Gn=[/\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],Zn=/\.(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,Kn=/(^|\/)(__tests__|tests?|spec|fixtures?|mocks?|__mocks__|stories)(\/|$)|\.(test|spec|fixture|mock|stories)\.[^/]+$/i,Hn=/tripwire-allow\b/,Wn=(X)=>{if(Hn.test(X))return!1;for(let Q of Gn)if(Q.test(X))return!0;return!1},BH=(X)=>{let Q=X.file_path;if(!Zn.test(Q)||Kn.test(Q))return C("lazy-code");let Y="content"in X?X.content:X.new_string,J="content"in X?MA(Q):X.old_string,$=[];for(let K of NA(J,Y))if(Wn(K))$.push(K.slice(0,200));if($.length===0)return C("lazy-code");let G=$.slice(0,3).map((K)=>` \u2022 ${K}`).join(`
|
|
80
80
|
`),Z=$.length>3?`
|
|
81
81
|
\u2026and ${$.length-3} more`:"";return X6("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(`
|
|
82
|
-
`))};var
|
|
82
|
+
`))};var AA=require("path");var _n=[{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."}],UH=(X)=>{let Q=AA.resolve(X.file_path);for(let Y of _n)if(Y.pattern.test(Q))return d(Y.rule,Y.message);return C("path-protect")};var wA=require("child_process"),Q6=require("fs"),CA=require("os"),Q3=require("path"),Vn="/opt/homebrew/bin/betterleaks",qn=(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 Dn=(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},TA=(X,Q=5000)=>{if(X.length===0)return{hits:[],redacted:X};let Y=Q6.mkdtempSync(Q3.join(CA.tmpdir(),"tripwire-scan-")),J=Q3.join(Y,"input"),$=Q3.join(Y,"report.json");try{if(Q6.writeFileSync(J,X),wA.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=Q6.readFileSync($,"utf8"),H=JSON.parse(K||"[]");Z=Array.isArray(H)?H:[]}catch{return{hits:[],redacted:X}}if(Z.length===0)return{hits:[],redacted:X};return{hits:qn(Z),redacted:Dn(X,Z)}}finally{try{Q6.rmSync(Y,{recursive:!0,force:!0})}catch{}}};var IA=(X)=>{let Q=YA(X.toolName,X.response);if(Q.length===0)return C("post-secret-scrub");let{hits:Y,redacted:J}=TA(Q);if(Y.length===0)return C("post-secret-scrub");let $=Y.map((G)=>`${G.rule}\xD7${G.count}`).join(", ");return d("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?`
|
|
83
83
|
\u2026[truncated]`:"")].join(`
|
|
84
|
-
`))};var
|
|
85
|
-
`)},
|
|
86
|
-
`)},
|
|
84
|
+
`))};var jA=require("path");var Bn=[{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}."}],EA=(X)=>{let Q=jA.resolve(X.file_path);for(let Y of Bn)if(Y.pattern.test(Q))return d(Y.rule,Y.message);return C("read-protect")};var Un=async()=>{let X=[];for await(let Q of process.stdin)X.push(Q);return Buffer.concat(X).toString("utf8")},Y6=()=>{process.stdout.write(`{"continue": true}
|
|
85
|
+
`)},SA=(X)=>X.turn_id!==void 0,On=(X,Q,Y)=>{if(SA(X)){Y6();return}let J={continue:!0,hookSpecificOutput:{hookEventName:X.hook_event_name,updatedInput:{command:Q}}};process.stdout.write(`${JSON.stringify(J)}
|
|
86
|
+
`)},OH=(X,Q)=>{let Y=X.hook_event_name,J=`[tripwire:${Q.rule}] ${Q.message}`;if(SA(X)){process.stdout.write(`${JSON.stringify({continue:!0,systemMessage:J})}
|
|
87
87
|
`);return}let $={hookEventName:Y,additionalContext:J};if(Q.rewriteCommand!==void 0)$.updatedInput={command:Q.rewriteCommand};process.stdout.write(`${JSON.stringify({continue:!0,hookSpecificOutput:$})}
|
|
88
|
-
`)},
|
|
89
|
-
`)},
|
|
90
|
-
`)},
|
|
88
|
+
`)},zn=(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)}
|
|
89
|
+
`)},Fn=(X)=>{let Q={continue:!0,decision:"block",reason:`[tripwire:${X.rule}] ${X.message}`};process.stdout.write(`${JSON.stringify(Q)}
|
|
90
|
+
`)},LH=(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},Ln=(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)),C(X)}),vA=(X,Q,Y)=>{let J=[];if(X==="Bash"&&tM(Q)){let Z=Q,K=z9(Z.command);return J.push({name:"bash-deny",fn:()=>HA(K,Z.command)}),J.push({name:"bash-git",fn:()=>_A(K,Z.command,Y.git??{enforceConventionalCommits:!0})}),J.push({name:"bash-scoped-rm",fn:()=>DA(K,Z.command,Y.safePaths??{})}),J.push({name:"bash-redirect",fn:()=>qA(K,Z.command)}),J.push({name:"bash-network-install",fn:()=>VA(K,Z.command)}),J.push({name:"bash-tar-explosion",fn:()=>UA(K,Z.command)}),J.push({name:"bash-tool-policy",fn:()=>OA(K,Z.command)}),J.push({name:"config-custom",fn:()=>PA(K,Z.command,Y.blockedCommands??[],Y.allowedCommands??[])}),J}if(X==="Read"&&QA(Q)){let Z=Q;return J.push({name:"read-protect",fn:()=>EA(Z)}),J}let $=(X==="Edit"||X==="MultiEdit")&&eM(Q),G=X==="Write"&&XA(Q);if($){let Z=Q;J.push({name:"path-protect",fn:()=>UH(Z)}),J.push({name:"lazy-code",fn:()=>BH(Z)})}else if(G){let Z=Q;J.push({name:"path-protect",fn:()=>UH(Z)}),J.push({name:"lazy-code",fn:()=>BH(Z)})}return J},xA=(X,Q)=>{if(X==="Bash"||X==="Read"||X==="WebFetch")return[{name:"post-secret-scrub",fn:()=>IA({toolName:X,response:Q})}];return[]},Pn=(X,Q)=>U0.gen(function*(){if(X.length===0)return C("no-rules");let Y=[];for(let J of X)Y.push(yield*Ln(J.name,J.fn,Q));return VH(Y)}),zH=(X)=>{if(X.length===0)return C("no-rules");return VH(X.map((Q)=>Q.fn()))},FH=(X,Q=L4())=>{let Y=_H(Q),J=LH(X.tool_name??"");if(X.hook_event_name==="PreToolUse")return zH(vA(J,X.tool_input,Y));if(X.hook_event_name==="PostToolUse")return zH(xA(J,X.tool_response));return C("no-rules")},Rn=(X,Q,Y)=>{let J=ZA(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){OH(X,{...Q,rewriteCommand:G});return}OH(X,Q);return}if(G!==null){On(X,G,J.reason);return}Y6()},Nn=(X,Q,Y)=>{let J=X.hook_event_name,$=LH(X.tool_name??"");if(J==="PreToolUse"&&$==="Bash"){Rn(X,Q,Y);return}if(Q.kind==="warn"){OH(X,Q);return}Y6()},Mn=U0.gen(function*(){let X=yield*iM(),Q=yield*U0.promise(Un),Y=yield*U0.exit(U0.try({try:()=>JSON.parse(Q),catch:(G)=>G}));if(q8.isFailure(Y)){TQ("parse",k1.pretty(Y.cause)),Y6();return}let J=yield*U0.exit(w.decodeUnknownEffect(sM)(Y.value));if(q8.isFailure(J)){TQ("decode",k1.pretty(J.cause)),Y6();return}let $=J.value;if($.hook_event_name==="PreToolUse"){let G=FH($,X);if(G.kind==="deny"||G.kind==="ask"){zn($.hook_event_name,G);return}Nn($,G,X);return}if($.hook_event_name==="PostToolUse"){let G=FH($,X);if(G.kind==="deny"){Fn(G);return}Y6();return}Y6()}),An=Mn.pipe(U0.catchCause((X)=>{return TQ("dispatch-fatal",k1.pretty(X)),Y6(),U0.void}));if(require.main==module)XY.runMain(An);})
|