ripplo 0.7.7 → 0.7.8

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.
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- var dx=Object.create;var If=Object.defineProperty;var fx=Object.getOwnPropertyDescriptor;var px=Object.getOwnPropertyNames;var hx=Object.getPrototypeOf,mx=Object.prototype.hasOwnProperty;var kr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var gx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of px(t))!mx.call(e,i)&&i!==r&&If(e,i,{get:()=>t[i],enumerable:!(n=fx(t,i))||n.enumerable});return e};var Pi=(e,t,r)=>(r=e!=null?dx(hx(e)):{},gx(t||!e||!e.__esModule?If(r,"default",{value:e,enumerable:!0}):r,e));var Df=kr(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.timingSafeEqual=void 0;function $f(e,t=""){if(!e)throw new Error(t)}function Jx(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),$f(e instanceof DataView),$f(t instanceof DataView);let r=e.byteLength,n=0,i=-1;for(;++i<r;)n|=e.getUint8(i)^t.getUint8(i);return n===0}Mi.timingSafeEqual=Jx});var jf=kr(He=>{"use strict";var Zx=He&&He.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(He,"__esModule",{value:!0});var Ae=256,fa=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var r="",n=0;n<t.length-2;n+=3){var i=t[n]<<16|t[n+1]<<8|t[n+2];r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),r+=this._encodeByte(i>>>6&63),r+=this._encodeByte(i>>>0&63)}var o=t.length-n;if(o>0){var i=t[n]<<16|(o===2?t[n+1]<<8:0);r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),o===2?r+=this._encodeByte(i>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(t),n=t.length-r,i=new Uint8Array(this.maxDecodedLength(n)),o=0,s=0,a=0,l=0,u=0,c=0,d=0;s<n-4;s+=4)l=this._decodeChar(t.charCodeAt(s+0)),u=this._decodeChar(t.charCodeAt(s+1)),c=this._decodeChar(t.charCodeAt(s+2)),d=this._decodeChar(t.charCodeAt(s+3)),i[o++]=l<<2|u>>>4,i[o++]=u<<4|c>>>2,i[o++]=c<<6|d,a|=l&Ae,a|=u&Ae,a|=c&Ae,a|=d&Ae;if(s<n-1&&(l=this._decodeChar(t.charCodeAt(s)),u=this._decodeChar(t.charCodeAt(s+1)),i[o++]=l<<2|u>>>4,a|=l&Ae,a|=u&Ae),s<n-2&&(c=this._decodeChar(t.charCodeAt(s+2)),i[o++]=u<<4|c>>>2,a|=c&Ae),s<n-3&&(d=this._decodeChar(t.charCodeAt(s+3)),i[o++]=c<<6|d,a|=d&Ae),a!==0)throw new Error("Base64Coder: incorrect characters for decoding");return i},e.prototype._encodeByte=function(t){var r=t;return r+=65,r+=25-t>>>8&6,r+=51-t>>>8&-75,r+=61-t>>>8&-15,r+=62-t>>>8&3,String.fromCharCode(r)},e.prototype._decodeChar=function(t){var r=Ae;return r+=(42-t&t-44)>>>8&-Ae+t-43+62,r+=(46-t&t-48)>>>8&-Ae+t-47+63,r+=(47-t&t-58)>>>8&-Ae+t-48+52,r+=(64-t&t-91)>>>8&-Ae+t-65+0,r+=(96-t&t-123)>>>8&-Ae+t-97+26,r},e.prototype._getPaddingLength=function(t){var r=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)r++;if(t.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},e})();He.Coder=fa;var hn=new fa;function Xx(e){return hn.encode(e)}He.encode=Xx;function Qx(e){return hn.decode(e)}He.decode=Qx;var _f=(function(e){Zx(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},t.prototype._decodeChar=function(r){var n=Ae;return n+=(44-r&r-46)>>>8&-Ae+r-45+62,n+=(94-r&r-96)>>>8&-Ae+r-95+63,n+=(47-r&r-58)>>>8&-Ae+r-48+52,n+=(64-r&r-91)>>>8&-Ae+r-65+0,n+=(96-r&r-123)>>>8&-Ae+r-97+26,n},t})(fa);He.URLSafeCoder=_f;var Ff=new _f;function eR(e){return Ff.encode(e)}He.encodeURLSafe=eR;function tR(e){return Ff.decode(e)}He.decodeURLSafe=tR;He.encodedLength=function(e){return hn.encodedLength(e)};He.maxDecodedLength=function(e){return hn.maxDecodedLength(e)};He.decodedLength=function(e){return hn.decodedLength(e)}});var Bf=kr((Vf,Oi)=>{"use strict";(function(e,t){var r={};t(r);var n=r.default;for(var i in r)n[i]=r[i];typeof Oi=="object"&&typeof Oi.exports=="object"?Oi.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):e.sha256=n})(Vf,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(d,p,h,f,m){for(var g,S,w,y,x,E,N,I,M,C,V,Z,X;m>=64;){for(g=p[0],S=p[1],w=p[2],y=p[3],x=p[4],E=p[5],N=p[6],I=p[7],C=0;C<16;C++)V=f+C*4,d[C]=(h[V]&255)<<24|(h[V+1]&255)<<16|(h[V+2]&255)<<8|h[V+3]&255;for(C=16;C<64;C++)M=d[C-2],Z=(M>>>17|M<<15)^(M>>>19|M<<13)^M>>>10,M=d[C-15],X=(M>>>7|M<<25)^(M>>>18|M<<14)^M>>>3,d[C]=(Z+d[C-7]|0)+(X+d[C-16]|0);for(C=0;C<64;C++)Z=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&E^~x&N)|0)+(I+(t[C]+d[C]|0)|0)|0,X=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&S^g&w^S&w)|0,I=N,N=E,E=x,x=y+Z|0,y=w,w=S,S=g,g=Z+X|0;p[0]+=g,p[1]+=S,p[2]+=w,p[3]+=y,p[4]+=x,p[5]+=E,p[6]+=N,p[7]+=I,f+=64,m-=64}return f}var n=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var p=0;p<this.buffer.length;p++)this.buffer[p]=0;for(var p=0;p<this.temp.length;p++)this.temp[p]=0;this.reset()},d.prototype.update=function(p,h){if(h===void 0&&(h=p.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this.bytesHashed+=h,this.bufferLength>0){for(;this.bufferLength<64&&h>0;)this.buffer[this.bufferLength++]=p[f++],h--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(h>=64&&(f=r(this.temp,this.state,p,f,h),h%=64);h>0;)this.buffer[this.bufferLength++]=p[f++],h--;return this},d.prototype.finish=function(p){if(!this.finished){var h=this.bytesHashed,f=this.bufferLength,m=h/536870912|0,g=h<<3,S=h%64<56?64:128;this.buffer[f]=128;for(var w=f+1;w<S-8;w++)this.buffer[w]=0;this.buffer[S-8]=m>>>24&255,this.buffer[S-7]=m>>>16&255,this.buffer[S-6]=m>>>8&255,this.buffer[S-5]=m>>>0&255,this.buffer[S-4]=g>>>24&255,this.buffer[S-3]=g>>>16&255,this.buffer[S-2]=g>>>8&255,this.buffer[S-1]=g>>>0&255,r(this.temp,this.state,this.buffer,0,S),this.finished=!0}for(var w=0;w<8;w++)p[w*4+0]=this.state[w]>>>24&255,p[w*4+1]=this.state[w]>>>16&255,p[w*4+2]=this.state[w]>>>8&255,p[w*4+3]=this.state[w]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var h=0;h<this.state.length;h++)p[h]=this.state[h]},d.prototype._restoreState=function(p,h){for(var f=0;f<this.state.length;f++)this.state[f]=p[f];this.bytesHashed=h,this.finished=!1,this.bufferLength=0},d})();e.Hash=n;var i=(function(){function d(p){this.inner=new n,this.outer=new n,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var h=new Uint8Array(this.blockSize);if(p.length>this.blockSize)new n().update(p).finish(h).clean();else for(var f=0;f<p.length;f++)h[f]=p[f];for(var f=0;f<h.length;f++)h[f]^=54;this.inner.update(h);for(var f=0;f<h.length;f++)h[f]^=106;this.outer.update(h),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var f=0;f<h.length;f++)h[f]=0}return d.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},d.prototype.clean=function(){for(var p=0;p<this.istate.length;p++)this.ostate[p]=this.istate[p]=0;this.inner.clean(),this.outer.clean()},d.prototype.update=function(p){return this.inner.update(p),this},d.prototype.finish=function(p){return this.outer.finished?this.outer.finish(p):(this.inner.finish(p),this.outer.update(p,this.digestLength).finish(p)),this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d})();e.HMAC=i;function o(d){var p=new n().update(d),h=p.digest();return p.clean(),h}e.hash=o,e.default=o;function s(d,p){var h=new i(d).update(p),f=h.digest();return h.clean(),f}e.hmac=s;function a(d,p,h,f){var m=f[0];if(m===0)throw new Error("hkdf: cannot expand more");p.reset(),m>1&&p.update(d),h&&p.update(h),p.update(f),p.finish(d),f[0]++}var l=new Uint8Array(e.digestLength);function u(d,p,h,f){p===void 0&&(p=l),f===void 0&&(f=32);for(var m=new Uint8Array([1]),g=s(p,d),S=new i(g),w=new Uint8Array(S.digestLength),y=w.length,x=new Uint8Array(f),E=0;E<f;E++)y===w.length&&(a(w,S,h,m),y=0),x[E]=w[y++];return S.clean(),w.fill(0),m.fill(0),x}e.hkdf=u;function c(d,p,h,f){for(var m=new i(d),g=m.digestLength,S=new Uint8Array(4),w=new Uint8Array(g),y=new Uint8Array(g),x=new Uint8Array(f),E=0;E*g<f;E++){var N=E+1;S[0]=N>>>24&255,S[1]=N>>>16&255,S[2]=N>>>8&255,S[3]=N>>>0&255,m.reset(),m.update(p),m.update(S),m.finish(y);for(var I=0;I<g;I++)w[I]=y[I];for(var I=2;I<=h;I++){m.reset(),m.update(y).finish(y);for(var M=0;M<g;M++)w[M]^=y[M]}for(var I=0;I<g&&E*g+I<f;I++)x[E*g+I]=w[I]}for(var E=0;E<g;E++)w[E]=y[E]=0;for(var E=0;E<4;E++)S[E]=0;return m.clean(),x}e.pbkdf2=c})});var ha=kr(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.Webhook=Cr.WebhookVerificationError=void 0;var rR=Df(),Uf=jf(),nR=Bf(),Wf=300,pa=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Wt=class e extends pa{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};Cr.WebhookVerificationError=Wt;var Ni=class e{constructor(t,r){if(!t)throw new Error("Secret can't be empty.");if(r?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,n=>n.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=Uf.decode(t)}}verify(t,r){let n={};for(let p of Object.keys(r))n[p.toLowerCase()]=r[p];let i=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!i||!s)throw new Wt("Missing required headers");let a=this.verifyTimestamp(s),u=this.sign(i,a,t).split(",")[1],c=o.split(" "),d=new globalThis.TextEncoder;for(let p of c){let[h,f]=p.split(",");if(h==="v1"&&(0,rR.timingSafeEqual)(d.encode(f),d.encode(u)))return JSON.parse(t.toString())}throw new Wt("No matching signature found")}sign(t,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=i.encode(`${t}.${o}.${n}`);return`v1,${Uf.encode(nR.hmac(this.key,s))}`}verifyTimestamp(t){let r=Math.floor(Date.now()/1e3),n=parseInt(t,10);if(isNaN(n))throw new Wt("Invalid Signature Headers");if(r-n>Wf)throw new Wt("Message timestamp too old");if(n>r+Wf)throw new Wt("Message timestamp too new");return new Date(n*1e3)}};Cr.Webhook=Ni;Ni.prefix="whsec_"});var Zp=kr((Za,Jp)=>{"use strict";var{hasOwnProperty:xn}=Object.prototype,cr=Ja();cr.configure=Ja;cr.stringify=cr;cr.default=cr;Za.stringify=cr;Za.configure=Ja;Jp.exports=cr;var Lk=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Gt(e){return e.length<5e3&&!Lk.test(e)?`"${e}"`:JSON.stringify(e)}function Ka(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var $k=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Ya(e){return $k.call(e)!==void 0&&e.length!==0}function Kp(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let o=1;o<r;o++)i+=`${t}"${o}":${n}${e[o]}`;return i}function Dk(e){if(xn.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function _k(e){let t;if(xn.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function Fk(e,t){let r;if(xn.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function Yp(e,t){let r;if(xn.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function ur(e){return e===1?"1 item":`${e} items`}function jk(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function Vk(e){if(xn.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Ja(e){e={...e};let t=Vk(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=Dk(e),n=Fk(e,"bigint"),i=_k(e),o=typeof i=="function"?i:void 0,s=Yp(e,"maximumDepth"),a=Yp(e,"maximumBreadth");function l(h,f,m,g,S,w){let y=f[h];switch(typeof y=="object"&&y!==null&&typeof y.toJSON=="function"&&(y=y.toJSON(h)),y=g.call(f,h,y),typeof y){case"string":return Gt(y);case"object":{if(y===null)return"null";if(m.indexOf(y)!==-1)return r;let x="",E=",",N=w;if(Array.isArray(y)){if(y.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(y),S!==""&&(w+=S,x+=`
2
+ var px=Object.create;var Pf=Object.defineProperty;var hx=Object.getOwnPropertyDescriptor;var mx=Object.getOwnPropertyNames;var gx=Object.getPrototypeOf,yx=Object.prototype.hasOwnProperty;var kr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var bx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of mx(t))!yx.call(e,i)&&i!==r&&Pf(e,i,{get:()=>t[i],enumerable:!(n=hx(t,i))||n.enumerable});return e};var Pi=(e,t,r)=>(r=e!=null?px(gx(e)):{},bx(t||!e||!e.__esModule?Pf(r,"default",{value:e,enumerable:!0}):r,e));var _f=kr(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.timingSafeEqual=void 0;function Df(e,t=""){if(!e)throw new Error(t)}function Xx(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),Df(e instanceof DataView),Df(t instanceof DataView);let r=e.byteLength,n=0,i=-1;for(;++i<r;)n|=e.getUint8(i)^t.getUint8(i);return n===0}Mi.timingSafeEqual=Xx});var Vf=kr(He=>{"use strict";var Qx=He&&He.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(He,"__esModule",{value:!0});var Ae=256,fa=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var r="",n=0;n<t.length-2;n+=3){var i=t[n]<<16|t[n+1]<<8|t[n+2];r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),r+=this._encodeByte(i>>>6&63),r+=this._encodeByte(i>>>0&63)}var o=t.length-n;if(o>0){var i=t[n]<<16|(o===2?t[n+1]<<8:0);r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),o===2?r+=this._encodeByte(i>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(t),n=t.length-r,i=new Uint8Array(this.maxDecodedLength(n)),o=0,s=0,a=0,l=0,u=0,c=0,d=0;s<n-4;s+=4)l=this._decodeChar(t.charCodeAt(s+0)),u=this._decodeChar(t.charCodeAt(s+1)),c=this._decodeChar(t.charCodeAt(s+2)),d=this._decodeChar(t.charCodeAt(s+3)),i[o++]=l<<2|u>>>4,i[o++]=u<<4|c>>>2,i[o++]=c<<6|d,a|=l&Ae,a|=u&Ae,a|=c&Ae,a|=d&Ae;if(s<n-1&&(l=this._decodeChar(t.charCodeAt(s)),u=this._decodeChar(t.charCodeAt(s+1)),i[o++]=l<<2|u>>>4,a|=l&Ae,a|=u&Ae),s<n-2&&(c=this._decodeChar(t.charCodeAt(s+2)),i[o++]=u<<4|c>>>2,a|=c&Ae),s<n-3&&(d=this._decodeChar(t.charCodeAt(s+3)),i[o++]=c<<6|d,a|=d&Ae),a!==0)throw new Error("Base64Coder: incorrect characters for decoding");return i},e.prototype._encodeByte=function(t){var r=t;return r+=65,r+=25-t>>>8&6,r+=51-t>>>8&-75,r+=61-t>>>8&-15,r+=62-t>>>8&3,String.fromCharCode(r)},e.prototype._decodeChar=function(t){var r=Ae;return r+=(42-t&t-44)>>>8&-Ae+t-43+62,r+=(46-t&t-48)>>>8&-Ae+t-47+63,r+=(47-t&t-58)>>>8&-Ae+t-48+52,r+=(64-t&t-91)>>>8&-Ae+t-65+0,r+=(96-t&t-123)>>>8&-Ae+t-97+26,r},e.prototype._getPaddingLength=function(t){var r=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)r++;if(t.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},e})();He.Coder=fa;var hn=new fa;function eR(e){return hn.encode(e)}He.encode=eR;function tR(e){return hn.decode(e)}He.decode=tR;var Ff=(function(e){Qx(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},t.prototype._decodeChar=function(r){var n=Ae;return n+=(44-r&r-46)>>>8&-Ae+r-45+62,n+=(94-r&r-96)>>>8&-Ae+r-95+63,n+=(47-r&r-58)>>>8&-Ae+r-48+52,n+=(64-r&r-91)>>>8&-Ae+r-65+0,n+=(96-r&r-123)>>>8&-Ae+r-97+26,n},t})(fa);He.URLSafeCoder=Ff;var jf=new Ff;function rR(e){return jf.encode(e)}He.encodeURLSafe=rR;function nR(e){return jf.decode(e)}He.decodeURLSafe=nR;He.encodedLength=function(e){return hn.encodedLength(e)};He.maxDecodedLength=function(e){return hn.maxDecodedLength(e)};He.decodedLength=function(e){return hn.decodedLength(e)}});var Uf=kr((Bf,Oi)=>{"use strict";(function(e,t){var r={};t(r);var n=r.default;for(var i in r)n[i]=r[i];typeof Oi=="object"&&typeof Oi.exports=="object"?Oi.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):e.sha256=n})(Bf,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(d,p,h,f,m){for(var g,S,w,y,x,E,N,I,M,C,V,Z,X;m>=64;){for(g=p[0],S=p[1],w=p[2],y=p[3],x=p[4],E=p[5],N=p[6],I=p[7],C=0;C<16;C++)V=f+C*4,d[C]=(h[V]&255)<<24|(h[V+1]&255)<<16|(h[V+2]&255)<<8|h[V+3]&255;for(C=16;C<64;C++)M=d[C-2],Z=(M>>>17|M<<15)^(M>>>19|M<<13)^M>>>10,M=d[C-15],X=(M>>>7|M<<25)^(M>>>18|M<<14)^M>>>3,d[C]=(Z+d[C-7]|0)+(X+d[C-16]|0);for(C=0;C<64;C++)Z=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&E^~x&N)|0)+(I+(t[C]+d[C]|0)|0)|0,X=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&S^g&w^S&w)|0,I=N,N=E,E=x,x=y+Z|0,y=w,w=S,S=g,g=Z+X|0;p[0]+=g,p[1]+=S,p[2]+=w,p[3]+=y,p[4]+=x,p[5]+=E,p[6]+=N,p[7]+=I,f+=64,m-=64}return f}var n=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var p=0;p<this.buffer.length;p++)this.buffer[p]=0;for(var p=0;p<this.temp.length;p++)this.temp[p]=0;this.reset()},d.prototype.update=function(p,h){if(h===void 0&&(h=p.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this.bytesHashed+=h,this.bufferLength>0){for(;this.bufferLength<64&&h>0;)this.buffer[this.bufferLength++]=p[f++],h--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(h>=64&&(f=r(this.temp,this.state,p,f,h),h%=64);h>0;)this.buffer[this.bufferLength++]=p[f++],h--;return this},d.prototype.finish=function(p){if(!this.finished){var h=this.bytesHashed,f=this.bufferLength,m=h/536870912|0,g=h<<3,S=h%64<56?64:128;this.buffer[f]=128;for(var w=f+1;w<S-8;w++)this.buffer[w]=0;this.buffer[S-8]=m>>>24&255,this.buffer[S-7]=m>>>16&255,this.buffer[S-6]=m>>>8&255,this.buffer[S-5]=m>>>0&255,this.buffer[S-4]=g>>>24&255,this.buffer[S-3]=g>>>16&255,this.buffer[S-2]=g>>>8&255,this.buffer[S-1]=g>>>0&255,r(this.temp,this.state,this.buffer,0,S),this.finished=!0}for(var w=0;w<8;w++)p[w*4+0]=this.state[w]>>>24&255,p[w*4+1]=this.state[w]>>>16&255,p[w*4+2]=this.state[w]>>>8&255,p[w*4+3]=this.state[w]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var h=0;h<this.state.length;h++)p[h]=this.state[h]},d.prototype._restoreState=function(p,h){for(var f=0;f<this.state.length;f++)this.state[f]=p[f];this.bytesHashed=h,this.finished=!1,this.bufferLength=0},d})();e.Hash=n;var i=(function(){function d(p){this.inner=new n,this.outer=new n,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var h=new Uint8Array(this.blockSize);if(p.length>this.blockSize)new n().update(p).finish(h).clean();else for(var f=0;f<p.length;f++)h[f]=p[f];for(var f=0;f<h.length;f++)h[f]^=54;this.inner.update(h);for(var f=0;f<h.length;f++)h[f]^=106;this.outer.update(h),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var f=0;f<h.length;f++)h[f]=0}return d.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},d.prototype.clean=function(){for(var p=0;p<this.istate.length;p++)this.ostate[p]=this.istate[p]=0;this.inner.clean(),this.outer.clean()},d.prototype.update=function(p){return this.inner.update(p),this},d.prototype.finish=function(p){return this.outer.finished?this.outer.finish(p):(this.inner.finish(p),this.outer.update(p,this.digestLength).finish(p)),this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d})();e.HMAC=i;function o(d){var p=new n().update(d),h=p.digest();return p.clean(),h}e.hash=o,e.default=o;function s(d,p){var h=new i(d).update(p),f=h.digest();return h.clean(),f}e.hmac=s;function a(d,p,h,f){var m=f[0];if(m===0)throw new Error("hkdf: cannot expand more");p.reset(),m>1&&p.update(d),h&&p.update(h),p.update(f),p.finish(d),f[0]++}var l=new Uint8Array(e.digestLength);function u(d,p,h,f){p===void 0&&(p=l),f===void 0&&(f=32);for(var m=new Uint8Array([1]),g=s(p,d),S=new i(g),w=new Uint8Array(S.digestLength),y=w.length,x=new Uint8Array(f),E=0;E<f;E++)y===w.length&&(a(w,S,h,m),y=0),x[E]=w[y++];return S.clean(),w.fill(0),m.fill(0),x}e.hkdf=u;function c(d,p,h,f){for(var m=new i(d),g=m.digestLength,S=new Uint8Array(4),w=new Uint8Array(g),y=new Uint8Array(g),x=new Uint8Array(f),E=0;E*g<f;E++){var N=E+1;S[0]=N>>>24&255,S[1]=N>>>16&255,S[2]=N>>>8&255,S[3]=N>>>0&255,m.reset(),m.update(p),m.update(S),m.finish(y);for(var I=0;I<g;I++)w[I]=y[I];for(var I=2;I<=h;I++){m.reset(),m.update(y).finish(y);for(var M=0;M<g;M++)w[M]^=y[M]}for(var I=0;I<g&&E*g+I<f;I++)x[E*g+I]=w[I]}for(var E=0;E<g;E++)w[E]=y[E]=0;for(var E=0;E<4;E++)S[E]=0;return m.clean(),x}e.pbkdf2=c})});var ha=kr(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.Webhook=Cr.WebhookVerificationError=void 0;var iR=_f(),Wf=Vf(),oR=Uf(),zf=300,pa=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Wt=class e extends pa{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};Cr.WebhookVerificationError=Wt;var Ni=class e{constructor(t,r){if(!t)throw new Error("Secret can't be empty.");if(r?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,n=>n.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=Wf.decode(t)}}verify(t,r){let n={};for(let p of Object.keys(r))n[p.toLowerCase()]=r[p];let i=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!i||!s)throw new Wt("Missing required headers");let a=this.verifyTimestamp(s),u=this.sign(i,a,t).split(",")[1],c=o.split(" "),d=new globalThis.TextEncoder;for(let p of c){let[h,f]=p.split(",");if(h==="v1"&&(0,iR.timingSafeEqual)(d.encode(f),d.encode(u)))return JSON.parse(t.toString())}throw new Wt("No matching signature found")}sign(t,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=i.encode(`${t}.${o}.${n}`);return`v1,${Wf.encode(oR.hmac(this.key,s))}`}verifyTimestamp(t){let r=Math.floor(Date.now()/1e3),n=parseInt(t,10);if(isNaN(n))throw new Wt("Invalid Signature Headers");if(r-n>zf)throw new Wt("Message timestamp too old");if(n>r+zf)throw new Wt("Message timestamp too new");return new Date(n*1e3)}};Cr.Webhook=Ni;Ni.prefix="whsec_"});var Qp=kr((Xa,Xp)=>{"use strict";var{hasOwnProperty:xn}=Object.prototype,cr=Za();cr.configure=Za;cr.stringify=cr;cr.default=cr;Xa.stringify=cr;Xa.configure=Za;Xp.exports=cr;var Fk=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Gt(e){return e.length<5e3&&!Fk.test(e)?`"${e}"`:JSON.stringify(e)}function Ya(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var jk=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Ja(e){return jk.call(e)!==void 0&&e.length!==0}function Jp(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let o=1;o<r;o++)i+=`${t}"${o}":${n}${e[o]}`;return i}function Vk(e){if(xn.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function Bk(e){let t;if(xn.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function Uk(e,t){let r;if(xn.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function Zp(e,t){let r;if(xn.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function ur(e){return e===1?"1 item":`${e} items`}function Wk(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function zk(e){if(xn.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Za(e){e={...e};let t=zk(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=Vk(e),n=Uk(e,"bigint"),i=Bk(e),o=typeof i=="function"?i:void 0,s=Zp(e,"maximumDepth"),a=Zp(e,"maximumBreadth");function l(h,f,m,g,S,w){let y=f[h];switch(typeof y=="object"&&y!==null&&typeof y.toJSON=="function"&&(y=y.toJSON(h)),y=g.call(f,h,y),typeof y){case"string":return Gt(y);case"object":{if(y===null)return"null";if(m.indexOf(y)!==-1)return r;let x="",E=",",N=w;if(Array.isArray(y)){if(y.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(y),S!==""&&(w+=S,x+=`
3
3
  ${w}`,E=`,
4
4
  ${w}`);let X=Math.min(y.length,a),F=0;for(;F<X-1;F++){let pt=l(String(F),y,m,g,S,w);x+=pt!==void 0?pt:"null",x+=E}let $e=l(String(F),y,m,g,S,w);if(x+=$e!==void 0?$e:"null",y.length-1>a){let pt=y.length-a-1;x+=`${E}"... ${ur(pt)} not stringified"`}return S!==""&&(x+=`
5
5
  ${N}`),m.pop(),`[${x}]`}let I=Object.keys(y),M=I.length;if(M===0)return"{}";if(s<m.length+1)return'"[Object]"';let C="",V="";S!==""&&(w+=S,E=`,
6
- ${w}`,C=" ");let Z=Math.min(M,a);i&&!Ya(y)&&(I=Ka(I,o)),m.push(y);for(let X=0;X<Z;X++){let F=I[X],$e=l(F,y,m,g,S,w);$e!==void 0&&(x+=`${V}${Gt(F)}:${C}${$e}`,V=E)}if(M>a){let X=M-a;x+=`${V}"...":${C}"${ur(X)} not stringified"`,V=E}return S!==""&&V.length>1&&(x=`
6
+ ${w}`,C=" ");let Z=Math.min(M,a);i&&!Ja(y)&&(I=Ya(I,o)),m.push(y);for(let X=0;X<Z;X++){let F=I[X],$e=l(F,y,m,g,S,w);$e!==void 0&&(x+=`${V}${Gt(F)}:${C}${$e}`,V=E)}if(M>a){let X=M-a;x+=`${V}"...":${C}"${ur(X)} not stringified"`,V=E}return S!==""&&V.length>1&&(x=`
7
7
  ${w}${x}
8
8
  ${N}`),m.pop(),`{${x}}`}case"number":return isFinite(y)?String(y):t?t(y):"null";case"boolean":return y===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(y);default:return t?t(y):void 0}}function u(h,f,m,g,S,w){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(h)),typeof f){case"string":return Gt(f);case"object":{if(f===null)return"null";if(m.indexOf(f)!==-1)return r;let y=w,x="",E=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f),S!==""&&(w+=S,x+=`
9
9
  ${w}`,E=`,
@@ -15,106 +15,106 @@ ${y}`),m.pop(),`{${x}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";
15
15
  ${S}`,V=`,
16
16
  ${S}`,Z=Math.min(f.length,a),X=0;for(;X<Z-1;X++){let $e=c(String(X),f[X],m,g,S);C+=$e!==void 0?$e:"null",C+=V}let F=c(String(X),f[X],m,g,S);if(C+=F!==void 0?F:"null",f.length-1>a){let $e=f.length-a-1;C+=`${V}"... ${ur($e)} not stringified"`}return C+=`
17
17
  ${w}`,m.pop(),`[${C}]`}let y=Object.keys(f),x=y.length;if(x===0)return"{}";if(s<m.length+1)return'"[Object]"';S+=g;let E=`,
18
- ${S}`,N="",I="",M=Math.min(x,a);Ya(f)&&(N+=Kp(f,E,a),y=y.slice(f.length),M-=f.length,I=E),i&&(y=Ka(y,o)),m.push(f);for(let C=0;C<M;C++){let V=y[C],Z=c(V,f[V],m,g,S);Z!==void 0&&(N+=`${I}${Gt(V)}: ${Z}`,I=E)}if(x>a){let C=x-a;N+=`${I}"...": "${ur(C)} not stringified"`,I=E}return I!==""&&(N=`
18
+ ${S}`,N="",I="",M=Math.min(x,a);Ja(f)&&(N+=Jp(f,E,a),y=y.slice(f.length),M-=f.length,I=E),i&&(y=Ya(y,o)),m.push(f);for(let C=0;C<M;C++){let V=y[C],Z=c(V,f[V],m,g,S);Z!==void 0&&(N+=`${I}${Gt(V)}: ${Z}`,I=E)}if(x>a){let C=x-a;N+=`${I}"...": "${ur(C)} not stringified"`,I=E}return I!==""&&(N=`
19
19
  ${S}${N}
20
- ${w}`),m.pop(),`{${N}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function d(h,f,m){switch(typeof f){case"string":return Gt(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(h),typeof f!="object")return d(h,f,m);if(f===null)return"null"}if(m.indexOf(f)!==-1)return r;let g="",S=f.length!==void 0;if(S&&Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f);let N=Math.min(f.length,a),I=0;for(;I<N-1;I++){let C=d(String(I),f[I],m);g+=C!==void 0?C:"null",g+=","}let M=d(String(I),f[I],m);if(g+=M!==void 0?M:"null",f.length-1>a){let C=f.length-a-1;g+=`,"... ${ur(C)} not stringified"`}return m.pop(),`[${g}]`}let w=Object.keys(f),y=w.length;if(y===0)return"{}";if(s<m.length+1)return'"[Object]"';let x="",E=Math.min(y,a);S&&Ya(f)&&(g+=Kp(f,",",a),w=w.slice(f.length),E-=f.length,x=","),i&&(w=Ka(w,o)),m.push(f);for(let N=0;N<E;N++){let I=w[N],M=d(I,f[I],m);M!==void 0&&(g+=`${x}${Gt(I)}:${M}`,x=",")}if(y>a){let N=y-a;g+=`${x}"...":"${ur(N)} not stringified"`}return m.pop(),`{${g}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function p(h,f,m){if(arguments.length>1){let g="";if(typeof m=="number"?g=" ".repeat(Math.min(m,10)):typeof m=="string"&&(g=m.slice(0,10)),f!=null){if(typeof f=="function")return l("",{"":h},[],f,g,"");if(Array.isArray(f))return u("",h,[],jk(f),g,"")}if(g.length!==0)return c("",h,[],g,"")}return d("",h,[])}return p}});var mm=kr((ez,Bl)=>{"use strict";var vo=process||{},pm=vo.argv||[],wo=vo.env||{},lI=!(wo.NO_COLOR||pm.includes("--no-color"))&&(!!wo.FORCE_COLOR||pm.includes("--color")||vo.platform==="win32"||(vo.stdout||{}).isTTY&&wo.TERM!=="dumb"||!!wo.CI),uI=(e,t,r=e)=>n=>{let i=""+n,o=i.indexOf(t,e.length);return~o?e+cI(i,t,r,o)+t:e+i+t},cI=(e,t,r,n)=>{let i="",o=0;do i+=e.substring(o,n)+r,o=n+t.length,n=e.indexOf(t,o);while(~n);return i+e.substring(o)},hm=(e=lI)=>{let t=e?uI:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Bl.exports=hm();Bl.exports.createColors=hm});import{execFileSync as yx}from"child_process";import bx from"fs";import Ti from"path";function Sx(e){let t=vx(e);return t??Pf(e)}function Pf(e){let t=Ti.dirname(e);return wx(Ti.join(e,".ripplo"))?e:t===e?null:Pf(t)}function wx(e){try{return bx.statSync(e).isDirectory()}catch{return!1}}function vx(e){let t=xx(["rev-parse","--show-toplevel"],e);if(t==null)return null;let r=t.trim();return r.length===0?null:Ti.isAbsolute(r)?r:Ti.resolve(e,r)}function xx(e,t){try{return yx("git",e,{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]})}catch{return null}}import Rx from"pino";import kx from"pino-pretty";var Se=Rx({level:process.env.LOG_LEVEL??"info"},kx({ignore:"pid,hostname"}));import{readdir as Ex,rm as Cx,stat as Ax}from"fs/promises";import Of from"path";var Tf=Of.join(process.cwd(),".ripplo","debug"),Mf=360*60*1e3;async function Ix({maxRuns:e}){try{let r=(await Ex(Tf,{withFileTypes:!0})).filter(u=>u.isDirectory()),n=Date.now(),i=await Promise.all(r.map(async u=>{let c=Of.join(Tf,u.name),d=await Ax(c);return{dirPath:c,mtime:d.mtimeMs}})),o=i.filter(u=>n-u.mtime>Mf),a=i.filter(u=>n-u.mtime<=Mf).toSorted((u,c)=>c.mtime-u.mtime).slice(e),l=[...o,...a];if(l.length===0)return;await Promise.allSettled(l.map(u=>Cx(u.dirPath,{force:!0,recursive:!0}))),Se.debug("Pruned %d old debug run(s)",l.length)}catch{Se.warn("Debug run pruning failed, ignoring")}}var Er=class extends Error{detail;serverUrl;constructor({detail:t,serverUrl:r}){super(`Failed to connect to Ripplo server at ${r}. Check the server is running and reachable. Details: ${t}`),this.name="GqlConnectionError",this.detail=t,this.serverUrl=r}},cn=class extends Error{errors;constructor(t){super(t.map(r=>r.message).join(", ")),this.name="GqlRequestError",this.errors=t}};function Px(e){if(e instanceof cn)return e.errors[0]?.extensions?.code}async function _e(e){let{print:t}=await import("graphql"),r=t(e.document),n=JSON.stringify({query:r,variables:e.variables}),i=`${e.config.ripploServerUrl}/graphql`,o=await Tx({init:{body:n,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json"},method:"POST"},serverUrl:e.config.ripploServerUrl,url:i}),s=await Nx({res:o,url:i});if(!Lx(s))throw new Error("Invalid GraphQL response");if($x(s))throw new cn(s.errors);if(s.data==null)throw new Error("No data returned from server");return s.data}async function Tx({init:e,serverUrl:t,url:r}){let n=1,i=await Nf({init:e,url:r});for(;i.retryable&&n<3;)await Ox(Mx(n)),n+=1,i=await Nf({init:e,url:r});if(i.response!=null)return i.response;throw new Er({detail:i.detail,serverUrl:t})}async function Nf({init:e,url:t}){try{let r=await fetch(t,{...e,signal:AbortSignal.timeout(15e3)});return{detail:"",response:r,retryable:r.status>=500}}catch(r){return{detail:r instanceof Error?r.message:String(r),response:void 0,retryable:!0}}}function Mx(e){return 300*3**(e-1)*(.5+Math.random())}function Ox(e){return new Promise(t=>{setTimeout(t,e)})}async function Nx({res:e,url:t}){let r=await e.text();if(r.length===0)throw new Error(`Empty response from Ripplo server at ${t} (status ${String(e.status)}). The server may have restarted or the request was rejected before a body was sent.`);try{return JSON.parse(r)}catch{throw new Error(`Non-JSON response from Ripplo server at ${t} (status ${String(e.status)}): ${r.slice(0,200)}`)}}function Lx(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function $x(e){return Array.isArray(e.errors)&&e.errors.length>0}import{Agent as Dx,RetryAgent as _x,setGlobalDispatcher as Fx}from"undici";var jx=1500,Vx=4e3,Bx=3,Ux=50,Wx=100,Lf=!1;function zx(){if(Lf)return;Lf=!0;let e=new Dx({connections:Wx,keepAliveMaxTimeout:Vx,keepAliveTimeout:jx}),t=new _x(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:Bx,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:Ux});Fx(t)}import pn from"fs";import ar from"fs";import Gx from"os";import dn from"path";var Hx=".local",qx=".ripplo";function la(e){return dn.join(e,".ripplo",Hx)}function ua(e){let t=la(e);ar.existsSync(t)||ar.mkdirSync(t,{recursive:!0});let r=dn.join(t,".gitignore");return ar.existsSync(r)||ar.writeFileSync(r,`*
21
- `),t}function Ut(e,t){return dn.join(la(e),t)}function ca(){return dn.join(Gx.homedir(),qx)}function fn(){let e=ca();return ar.existsSync(e)?ar.chmodSync(e,448):ar.mkdirSync(e,{mode:448,recursive:!0}),e}function lr(e){return dn.join(ca(),e)}function da(){let e=process.env.RIPPLO_TOKEN;if(e!=null&&e.trim().length>0)return e.trim();let t=lr("token");if(!pn.existsSync(t))return null;let r=pn.readFileSync(t,"utf8").trim();return r.length===0?null:r}function Kx(e){fn(),pn.writeFileSync(lr("token"),e+`
22
- `,{mode:384})}function Yx(){let e=lr("token");return pn.existsSync(e)?(pn.unlinkSync(e),!0):!1}var Gf=Pi(ha(),1);import zf from"crypto";function iR({body:e,secret:t}){let r=new Gf.Webhook(t),n=`msg_${zf.randomUUID()}`,i=new Date,o=r.sign(n,i,e),s=Math.floor(i.getTime()/1e3);return{"webhook-id":n,"webhook-signature":o,"webhook-timestamp":String(s)}}function oR(){return`whsec_${zf.randomBytes(24).toString("base64")}`}import Kf from"fs";import Fi from"path";import{config as cR}from"dotenv";import{z as Di}from"zod";import{err as dR,ok as Yf}from"neverthrow";import $i from"fs";import ya from"path";import{err as ma,ok as Hf}from"neverthrow";import{z as Li}from"zod";var sR=ya.join(".ripplo","project.json"),ga=[".env",".env.local"],aR=Li.object({envFiles:Li.array(Li.string().min(1)).optional(),projectId:Li.string().min(1)});function qf(e){return ya.join(e,sR)}function ba(e){let t=qf(e);return $i.existsSync(t)?lR(t).andThen(r=>{let n=aR.safeParse(r);return n.success?Hf({envFiles:n.data.envFiles??ga,projectId:n.data.projectId}):ma({issues:n.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`),kind:"project-file-invalid",path:t})}):ma({kind:"project-file-missing",path:t})}function Sa(e){return ba(e).match(t=>t,()=>{})}function lR(e){try{return Hf(JSON.parse($i.readFileSync(e,"utf8")))}catch(t){return ma({issues:[t instanceof Error?t.message:String(t)],kind:"project-file-invalid",path:e})}}function uV({cwd:e,envFiles:t,projectId:r}){let n=qf(e);$i.mkdirSync(ya.dirname(n),{recursive:!0});let i={projectId:r};t!=null&&!uR(t)&&(i.envFiles=[...t]),$i.writeFileSync(n,JSON.stringify(i,null,2)+`
23
- `)}function uR(e){return e.length!==ga.length?!1:e.every((t,r)=>t===ga[r])}function yV(e){let r=Sa(e)?.envFiles??[".env",".env.local"],n=Fi.join(e,".ripplo");r.forEach(i=>{let o=Fi.resolve(n,i);Kf.existsSync(o)&&cR({override:!0,path:o,quiet:!0})}),_i=void 0}var fR=Di.object({RIPPLO_APP_URL:Di.url(),RIPPLO_ENGINE_URL:Di.url(),RIPPLO_WEBHOOK_SECRET:Di.string().min(1)}),_i;function ji(){return _i!=null?Yf(_i):hR().map(e=>(_i=e,e))}function pR(e){let r=Sa(e)?.envFiles??[],n=Fi.join(e,".ripplo");return r.map(i=>Fi.resolve(n,i)).filter(i=>!Kf.existsSync(i))}function hR(){let e=fR.safeParse(process.env);if(!e.success)return dR({issues:e.error.issues.map(r=>`${r.path.join(".")}: ${r.message}`),kind:"env-invalid",missingEnvFiles:pR(process.cwd())});let t=e.data;return Yf({appUrl:t.RIPPLO_APP_URL,engineUrl:t.RIPPLO_ENGINE_URL,webhookSecret:t.RIPPLO_WEBHOOK_SECRET})}import{z as Vi}from"zod";var mR=Vi.object({__codec:Vi.string().min(1),data:Vi.unknown(),version:Vi.number().int().positive()}),Bi=class extends Error{codec;currentVersion;gotVersion;constructor(t){super(`Unsupported ${t.codec} version ${String(t.gotVersion)} (current ${String(t.currentVersion)}). Upgrade Ripplo or rebuild with a compatible CLI.`),this.name="CodecVersionError",this.codec=t.codec,this.currentVersion=t.currentVersion,this.gotVersion=t.gotVersion}},Ui=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}};function wa({name:e,schema:t}){return{currentVersion:1,name:e,decode:r=>bR({name:e,raw:r,schema:t}),encode:r=>({__codec:e,data:r,version:1})}}function gR(e,t){return JSON.stringify(e.encode(t))}function yR(e,t){let r=JSON.parse(t);return e.decode(r)}function bR({name:e,raw:t,schema:r}){let n=mR.parse(t);if(n.__codec!==e)throw new Ui({expected:e,got:n.__codec});if(n.version!==1)throw new Bi({codec:e,currentVersion:1,gotVersion:n.version});return r.parse(n.data)}import{z as P}from"zod";import{z as A}from"zod";var va=A.enum(["fast","slow","async"]),Ar=A.object({ref:A.string().min(1)}),Xe=A.union([A.string(),A.number(),A.boolean()]),xa=A.object({template:A.array(A.union([A.string(),Ar])).min(1)}),Ue=A.union([Ar,Xe,xa,A.null()]),Jf=A.object({kind:A.literal("changed")}),Ra=A.union([Ue,Jf]),xt=A.union([A.string(),Ar,xa]),SR=A.object({by:A.literal("role"),name:A.union([xt,A.undefined()]).optional().transform(e=>e),role:A.string().min(1)}),wR=A.object({by:A.literal("testId"),value:xt}),vR=A.object({by:A.literal("inside"),scope:A.lazy(()=>Re),target:A.lazy(()=>Re)}),Re=A.discriminatedUnion("by",[SR,wR,vR]),Wi=A.enum(["string","number","boolean"]),ka=A.enum(["strict","eventual"]),xR=A.object({kind:A.literal("string"),maxLength:A.number().int().positive().optional(),minLength:A.number().int().nonnegative().optional(),pattern:A.string().optional()}),RR=A.object({kind:A.literal("number"),max:A.number().int().optional(),min:A.number().int().optional()}),kR=A.object({kind:A.literal("datetime"),maxOffsetDays:A.number().int(),minOffsetDays:A.number().int()}),Zf=A.discriminatedUnion("kind",[xR,RR,kR]),Xf=A.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),Ea=A.object({constraints:Zf.optional(),generator:Xf,name:A.string().min(1),type:Wi,values:A.array(Xe).min(1).optional()}),Qf=A.object({consistency:ka.default("strict"),optional:A.boolean(),stable:A.boolean(),type:Wi,valueSpace:A.string().min(1).optional()}),Ca=A.enum(["backend","client"]),Aa=A.object({description:A.string().optional(),identity:A.array(A.string().min(1)).min(1),identityKind:A.enum(["surrogate","natural"]),name:A.string().min(1),props:A.record(A.string().min(1),Qf),source:Ca.default("backend")}),Ia=A.object({consistency:ka.default("strict"),default:Xe,description:A.string().optional(),name:A.string().min(1),source:Ca.default("backend"),type:Wi,valueSpace:A.string().min(1).optional()}),Rt=A.enum(["url","title","viewport"]);import{z as T}from"zod";var ER=T.discriminatedUnion("kind",[T.object({as:T.string().min(1),kind:T.literal("created"),props:T.record(T.string().min(1),Ue)}),T.object({as:T.string().min(1),kind:T.literal("updated"),props:T.record(T.string().min(1),Ra)}),T.object({kind:T.literal("deleted")})]),CR=T.object({kind:T.literal("is"),value:Ue}),ep=T.lazy(()=>T.union([Ue,IR])),AR=T.object({entity:T.string().min(1),where:T.record(T.string().min(1),ep)}),IR=T.object({field:T.string().min(1),kind:T.literal("within"),selection:AR}),kt=T.union([va,T.undefined()]).optional().transform(e=>e),zt=T.lazy(()=>T.discriminatedUnion("kind",[T.object({kind:T.literal("visible"),locator:Re,wait:kt}),T.object({kind:T.literal("disabled"),locator:Re,wait:kt}),T.object({kind:T.literal("enabled"),locator:Re,wait:kt}),T.object({kind:T.literal("focused"),locator:Re,wait:kt}),T.object({kind:T.literal("value"),locator:Re,value:xt,wait:kt}),T.object({kind:T.literal("text"),locator:Re,value:xt,wait:kt}),T.object({assertion:CR,kind:T.literal("singleton"),singleton:T.string().min(1),wait:kt}),T.object({kind:T.literal("browser"),name:Rt,value:xt,wait:kt}),T.object({assertion:ER,entity:T.string().min(1),key:T.record(T.string().min(1),ep),kind:T.literal("state"),wait:kt}),T.object({kind:T.literal("not"),predicate:zt}),T.object({kind:T.literal("and"),predicates:T.array(zt)}),T.object({entity:T.string().min(1),kind:T.literal("count"),value:T.number().int().nonnegative()}),T.object({condition:zt,consequence:zt,kind:T.literal("when"),otherwise:T.union([zt,T.undefined()]).optional().transform(e=>e)})]));var tp=P.discriminatedUnion("kind",[P.object({kind:P.literal("goto"),url:xt}),P.object({kind:P.literal("fill"),locator:Re,value:Ue}),P.object({kind:P.literal("clear"),locator:Re}),P.object({kind:P.literal("click"),locator:Re}),P.object({kind:P.literal("dblclick"),locator:Re}),P.object({kind:P.literal("select"),locator:Re,value:Ue}),P.object({kind:P.literal("check"),locator:Re}),P.object({kind:P.literal("uncheck"),locator:Re}),P.object({kind:P.literal("hover"),locator:Re}),P.object({files:P.array(P.string().min(1)).min(1),kind:P.literal("upload"),locator:Re}),P.object({key:P.string().min(1),kind:P.literal("press"),locator:Re.optional()})]),rp=P.object({action:tp,expect:P.array(zt).default([])}),np=P.object({example:Xe.optional(),valueSpace:P.string().min(1)}),Pa=P.object({as:P.string().min(1),entity:P.string().min(1),set:P.record(P.string().min(1),Ue)}),ip=P.object({entity:P.string().min(1),where:P.record(P.string().min(1),Ue)}),zi=P.object({absent:P.array(ip).default([]),exclusive:P.array(P.string().min(1)).default([]),intent:P.string().min(1),maybe:P.array(Pa).default([]),name:P.string().min(1),params:P.record(P.string().min(1),np),singletons:P.record(P.string().min(1),Ue).default({}),sourcePath:P.string().min(1).optional(),steps:P.array(rp).default([]),stub:P.boolean().default(!1),world:P.array(Pa).default([])}),op=P.object({sha256:P.string().regex(/^[0-9a-f]{64}$/u),size:P.number().int().nonnegative()}),Gi=P.object({entities:P.array(Aa),fixtures:P.record(P.string().min(1),op).default({}),singletons:P.array(Ia).default([]),tests:P.array(zi),valueSpaces:P.array(Ea)}),PR=wa({name:"ripplo-lockfile",schema:Gi});var Hi="__ripplo__",Ta="__ripplo_seed__";import{z as mn}from"zod";var TR=mn.object({index:mn.number().int().nonnegative(),kind:mn.string(),target:mn.string(),value:mn.string()});function Ma(e,t){return{index:t,kind:e.action.kind,target:MR(e.action),value:OR(e.action)}}function rt(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function MR(e){return e.kind==="goto"?qi(e.url):e.kind==="press"&&e.locator==null?"":Ki(e.locator)}function qi(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join("")}function Ki(e){return e.by==="testId"?`testId=${qi(e.value)}`:e.by==="inside"?`${Ki(e.scope)} \u25B8 ${Ki(e.target)}`:`${e.role} ${e.name==null?"":qi(e.name)}`.trim()}function OR(e){return e.kind==="fill"||e.kind==="select"?NR(e.value):e.kind==="press"?e.key:""}function NR(e){return e==null?"":typeof e!="object"?String(e):qi(e)}import{z as ke}from"zod";var sp=ke.enum(["Strict","Lax","None"]),ap=ke.object({domain:ke.string().min(1),expires:ke.number(),httpOnly:ke.boolean(),name:ke.string().min(1),path:ke.string().min(1),sameSite:sp,secure:ke.boolean(),value:ke.string()}),lp=ke.object({localStorage:ke.array(ke.object({name:ke.string().min(1),value:ke.string()})),origin:ke.string().min(1)}),Oa=ke.object({cookies:ke.array(ap),headers:ke.record(ke.string().min(1),ke.string()).optional(),origins:ke.array(lp)});import{z as K}from"zod";var Na=K.union([Xe,K.null()]),La=K.record(K.string().min(1),Na),up=K.object({as:K.string().min(1),entity:K.string().min(1),fields:K.record(K.string().min(1),Ue)}),LR=K.object({entities:K.array(up),runId:K.string().min(1),singletons:K.record(K.string().min(1),Na).default({})}),cp=K.object({as:K.string().min(1),row:La,session:Oa.optional()}),$a=K.object({rows:K.array(cp)}),$R=K.object({entities:K.array(K.string().min(1)),runId:K.string().min(1),singletons:K.array(K.string().min(1)).default([])}),Da=K.object({entities:K.record(K.string().min(1),K.array(La)),singletons:K.record(K.string().min(1),Na).default({})}),DR=K.object({runId:K.string().min(1)}),_a=K.object({ok:K.literal(!0)});import Fa from"fs";import Yi from"path";import{createJiti as BR}from"jiti";import{err as Ji,ok as fp}from"neverthrow";import _R from"fs";import gn from"path";import Ir from"typescript";function dp(e){let t=gn.join(e,"index.ts"),r=VR(e);_R.mkdirSync(gn.dirname(r.tsBuildInfoFile??""),{recursive:!0});let n=Ir.createIncrementalCompilerHost(r),i=Ir.createIncrementalProgram({host:n,options:r,rootNames:[t]}),o=[...i.getSyntacticDiagnostics(),...i.getSemanticDiagnostics()];i.emit();let s=o.filter(u=>FR(u,e));if(s.length===0)return{diagnostics:[],ok:!0};let a={getCanonicalFileName:u=>u,getCurrentDirectory:()=>gn.dirname(e),getNewLine:()=>`
20
+ ${w}`),m.pop(),`{${N}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function d(h,f,m){switch(typeof f){case"string":return Gt(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(h),typeof f!="object")return d(h,f,m);if(f===null)return"null"}if(m.indexOf(f)!==-1)return r;let g="",S=f.length!==void 0;if(S&&Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f);let N=Math.min(f.length,a),I=0;for(;I<N-1;I++){let C=d(String(I),f[I],m);g+=C!==void 0?C:"null",g+=","}let M=d(String(I),f[I],m);if(g+=M!==void 0?M:"null",f.length-1>a){let C=f.length-a-1;g+=`,"... ${ur(C)} not stringified"`}return m.pop(),`[${g}]`}let w=Object.keys(f),y=w.length;if(y===0)return"{}";if(s<m.length+1)return'"[Object]"';let x="",E=Math.min(y,a);S&&Ja(f)&&(g+=Jp(f,",",a),w=w.slice(f.length),E-=f.length,x=","),i&&(w=Ya(w,o)),m.push(f);for(let N=0;N<E;N++){let I=w[N],M=d(I,f[I],m);M!==void 0&&(g+=`${x}${Gt(I)}:${M}`,x=",")}if(y>a){let N=y-a;g+=`${x}"...":"${ur(N)} not stringified"`}return m.pop(),`{${g}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function p(h,f,m){if(arguments.length>1){let g="";if(typeof m=="number"?g=" ".repeat(Math.min(m,10)):typeof m=="string"&&(g=m.slice(0,10)),f!=null){if(typeof f=="function")return l("",{"":h},[],f,g,"");if(Array.isArray(f))return u("",h,[],Wk(f),g,"")}if(g.length!==0)return c("",h,[],g,"")}return d("",h,[])}return p}});var ym=kr((az,Ul)=>{"use strict";var vo=process||{},mm=vo.argv||[],wo=vo.env||{},fI=!(wo.NO_COLOR||mm.includes("--no-color"))&&(!!wo.FORCE_COLOR||mm.includes("--color")||vo.platform==="win32"||(vo.stdout||{}).isTTY&&wo.TERM!=="dumb"||!!wo.CI),pI=(e,t,r=e)=>n=>{let i=""+n,o=i.indexOf(t,e.length);return~o?e+hI(i,t,r,o)+t:e+i+t},hI=(e,t,r,n)=>{let i="",o=0;do i+=e.substring(o,n)+r,o=n+t.length,n=e.indexOf(t,o);while(~n);return i+e.substring(o)},gm=(e=fI)=>{let t=e?pI:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Ul.exports=gm();Ul.exports.createColors=gm});import{execFileSync as Sx}from"child_process";import wx from"fs";import Ti from"path";function vx(e){let t=Rx(e);return t??Tf(e)}function Tf(e){let t=Ti.dirname(e);return xx(Ti.join(e,".ripplo"))?e:t===e?null:Tf(t)}function xx(e){try{return wx.statSync(e).isDirectory()}catch{return!1}}function Rx(e){let t=kx(["rev-parse","--show-toplevel"],e);if(t==null)return null;let r=t.trim();return r.length===0?null:Ti.isAbsolute(r)?r:Ti.resolve(e,r)}function kx(e,t){try{return Sx("git",e,{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]})}catch{return null}}import Ex from"pino";import Cx from"pino-pretty";var Se=Ex({level:process.env.LOG_LEVEL??"info"},Cx({ignore:"pid,hostname"}));import{readdir as Ax,rm as Ix,stat as Px}from"fs/promises";import Nf from"path";var Mf=Nf.join(process.cwd(),".ripplo","debug"),Of=360*60*1e3;async function Tx({maxRuns:e}){try{let r=(await Ax(Mf,{withFileTypes:!0})).filter(u=>u.isDirectory()),n=Date.now(),i=await Promise.all(r.map(async u=>{let c=Nf.join(Mf,u.name),d=await Px(c);return{dirPath:c,mtime:d.mtimeMs}})),o=i.filter(u=>n-u.mtime>Of),a=i.filter(u=>n-u.mtime<=Of).toSorted((u,c)=>c.mtime-u.mtime).slice(e),l=[...o,...a];if(l.length===0)return;await Promise.allSettled(l.map(u=>Ix(u.dirPath,{force:!0,recursive:!0}))),Se.debug("Pruned %d old debug run(s)",l.length)}catch{Se.warn("Debug run pruning failed, ignoring")}}var Er=class extends Error{detail;serverUrl;constructor({detail:t,serverUrl:r}){super(`Failed to connect to Ripplo server at ${r}. Check the server is running and reachable. Details: ${t}`),this.name="GqlConnectionError",this.detail=t,this.serverUrl=r}},cn=class extends Error{errors;constructor(t){super(t.map(r=>r.message).join(", ")),this.name="GqlRequestError",this.errors=t}};function Mx(e){if(e instanceof cn)return e.errors[0]?.extensions?.code}async function _e(e){let{print:t}=await import("graphql"),r=t(e.document),n=JSON.stringify({query:r,variables:e.variables}),i=`${e.config.ripploServerUrl}/graphql`,o=await Ox({init:{body:n,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json"},method:"POST"},serverUrl:e.config.ripploServerUrl,url:i}),s=await $x({res:o,url:i});if(!Dx(s))throw new Error("Invalid GraphQL response");if(_x(s))throw new cn(s.errors);if(s.data==null)throw new Error("No data returned from server");return s.data}async function Ox({init:e,serverUrl:t,url:r}){let n=1,i=await Lf({init:e,url:r});for(;i.retryable&&n<3;)await Lx(Nx(n)),n+=1,i=await Lf({init:e,url:r});if(i.response!=null)return i.response;throw new Er({detail:i.detail,serverUrl:t})}async function Lf({init:e,url:t}){try{let r=await fetch(t,{...e,signal:AbortSignal.timeout(15e3)});return{detail:"",response:r,retryable:r.status>=500}}catch(r){return{detail:r instanceof Error?r.message:String(r),response:void 0,retryable:!0}}}function Nx(e){return 300*3**(e-1)*(.5+Math.random())}function Lx(e){return new Promise(t=>{setTimeout(t,e)})}async function $x({res:e,url:t}){let r=await e.text();if(r.length===0)throw new Error(`Empty response from Ripplo server at ${t} (status ${String(e.status)}). The server may have restarted or the request was rejected before a body was sent.`);try{return JSON.parse(r)}catch{throw new Error(`Non-JSON response from Ripplo server at ${t} (status ${String(e.status)}): ${r.slice(0,200)}`)}}function Dx(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function _x(e){return Array.isArray(e.errors)&&e.errors.length>0}import{Agent as Fx,RetryAgent as jx,setGlobalDispatcher as Vx}from"undici";var Bx=1500,Ux=4e3,Wx=3,zx=50,Gx=100,$f=!1;function Hx(){if($f)return;$f=!0;let e=new Fx({connections:Gx,keepAliveMaxTimeout:Ux,keepAliveTimeout:Bx}),t=new jx(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:Wx,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:zx});Vx(t)}import pn from"fs";import ar from"fs";import qx from"os";import dn from"path";var Kx=".local",Yx=".ripplo";function la(e){return dn.join(e,".ripplo",Kx)}function ua(e){let t=la(e);ar.existsSync(t)||ar.mkdirSync(t,{recursive:!0});let r=dn.join(t,".gitignore");return ar.existsSync(r)||ar.writeFileSync(r,`*
21
+ `),t}function Ut(e,t){return dn.join(la(e),t)}function ca(){return dn.join(qx.homedir(),Yx)}function fn(){let e=ca();return ar.existsSync(e)?ar.chmodSync(e,448):ar.mkdirSync(e,{mode:448,recursive:!0}),e}function lr(e){return dn.join(ca(),e)}function da(){let e=process.env.RIPPLO_TOKEN;if(e!=null&&e.trim().length>0)return e.trim();let t=lr("token");if(!pn.existsSync(t))return null;let r=pn.readFileSync(t,"utf8").trim();return r.length===0?null:r}function Jx(e){fn(),pn.writeFileSync(lr("token"),e+`
22
+ `,{mode:384})}function Zx(){let e=lr("token");return pn.existsSync(e)?(pn.unlinkSync(e),!0):!1}var Hf=Pi(ha(),1);import Gf from"crypto";function sR({body:e,secret:t}){let r=new Hf.Webhook(t),n=`msg_${Gf.randomUUID()}`,i=new Date,o=r.sign(n,i,e),s=Math.floor(i.getTime()/1e3);return{"webhook-id":n,"webhook-signature":o,"webhook-timestamp":String(s)}}function aR(){return`whsec_${Gf.randomBytes(24).toString("base64")}`}import Yf from"fs";import Fi from"path";import{config as fR}from"dotenv";import{z as Di}from"zod";import{err as pR,ok as Jf}from"neverthrow";import $i from"fs";import ya from"path";import{err as ma,ok as qf}from"neverthrow";import{z as Li}from"zod";var lR=ya.join(".ripplo","project.json"),ga=[".env",".env.local"],uR=Li.object({envFiles:Li.array(Li.string().min(1)).optional(),projectId:Li.string().min(1)});function Kf(e){return ya.join(e,lR)}function ba(e){let t=Kf(e);return $i.existsSync(t)?cR(t).andThen(r=>{let n=uR.safeParse(r);return n.success?qf({envFiles:n.data.envFiles??ga,projectId:n.data.projectId}):ma({issues:n.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`),kind:"project-file-invalid",path:t})}):ma({kind:"project-file-missing",path:t})}function Sa(e){return ba(e).match(t=>t,()=>{})}function cR(e){try{return qf(JSON.parse($i.readFileSync(e,"utf8")))}catch(t){return ma({issues:[t instanceof Error?t.message:String(t)],kind:"project-file-invalid",path:e})}}function pV({cwd:e,envFiles:t,projectId:r}){let n=Kf(e);$i.mkdirSync(ya.dirname(n),{recursive:!0});let i={projectId:r};t!=null&&!dR(t)&&(i.envFiles=[...t]),$i.writeFileSync(n,JSON.stringify(i,null,2)+`
23
+ `)}function dR(e){return e.length!==ga.length?!1:e.every((t,r)=>t===ga[r])}function vV(e){let r=Sa(e)?.envFiles??[".env",".env.local"],n=Fi.join(e,".ripplo");r.forEach(i=>{let o=Fi.resolve(n,i);Yf.existsSync(o)&&fR({override:!0,path:o,quiet:!0})}),_i=void 0}var hR=Di.object({RIPPLO_APP_URL:Di.url(),RIPPLO_ENGINE_URL:Di.url(),RIPPLO_WEBHOOK_SECRET:Di.string().min(1)}),_i;function ji(){return _i!=null?Jf(_i):gR().map(e=>(_i=e,e))}function mR(e){let r=Sa(e)?.envFiles??[],n=Fi.join(e,".ripplo");return r.map(i=>Fi.resolve(n,i)).filter(i=>!Yf.existsSync(i))}function gR(){let e=hR.safeParse(process.env);if(!e.success)return pR({issues:e.error.issues.map(r=>`${r.path.join(".")}: ${r.message}`),kind:"env-invalid",missingEnvFiles:mR(process.cwd())});let t=e.data;return Jf({appUrl:t.RIPPLO_APP_URL,engineUrl:t.RIPPLO_ENGINE_URL,webhookSecret:t.RIPPLO_WEBHOOK_SECRET})}import{readFileSync as yR}from"fs";import{z as Zf}from"zod";var bR=Zf.object({version:Zf.string()});function wa(){let e=yR(new URL("../package.json",import.meta.url),"utf8");return bR.parse(JSON.parse(e)).version}import{z as Vi}from"zod";var SR=Vi.object({__codec:Vi.string().min(1),data:Vi.unknown(),version:Vi.number().int().positive()}),Bi=class extends Error{codec;currentVersion;gotVersion;constructor(t){super(`Unsupported ${t.codec} version ${String(t.gotVersion)} (current ${String(t.currentVersion)}). Upgrade Ripplo or rebuild with a compatible CLI.`),this.name="CodecVersionError",this.codec=t.codec,this.currentVersion=t.currentVersion,this.gotVersion=t.gotVersion}},Ui=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}};function va({name:e,schema:t}){return{currentVersion:1,name:e,decode:r=>xR({name:e,raw:r,schema:t}),encode:r=>({__codec:e,data:r,version:1})}}function wR(e,t){return JSON.stringify(e.encode(t))}function vR(e,t){let r=JSON.parse(t);return e.decode(r)}function xR({name:e,raw:t,schema:r}){let n=SR.parse(t);if(n.__codec!==e)throw new Ui({expected:e,got:n.__codec});if(n.version!==1)throw new Bi({codec:e,currentVersion:1,gotVersion:n.version});return r.parse(n.data)}import{z as P}from"zod";import{z as A}from"zod";var xa=A.enum(["fast","slow","async"]),Ar=A.object({ref:A.string().min(1)}),Xe=A.union([A.string(),A.number(),A.boolean()]),Ra=A.object({template:A.array(A.union([A.string(),Ar])).min(1)}),Ue=A.union([Ar,Xe,Ra,A.null()]),Xf=A.object({kind:A.literal("changed")}),ka=A.union([Ue,Xf]),xt=A.union([A.string(),Ar,Ra]),RR=A.object({by:A.literal("role"),name:A.union([xt,A.undefined()]).optional().transform(e=>e),role:A.string().min(1)}),kR=A.object({by:A.literal("testId"),value:xt}),ER=A.object({by:A.literal("inside"),scope:A.lazy(()=>Re),target:A.lazy(()=>Re)}),Re=A.discriminatedUnion("by",[RR,kR,ER]),Wi=A.enum(["string","number","boolean"]),Ea=A.enum(["strict","eventual"]),CR=A.object({kind:A.literal("string"),maxLength:A.number().int().positive().optional(),minLength:A.number().int().nonnegative().optional(),pattern:A.string().optional()}),AR=A.object({kind:A.literal("number"),max:A.number().int().optional(),min:A.number().int().optional()}),IR=A.object({kind:A.literal("datetime"),maxOffsetDays:A.number().int(),minOffsetDays:A.number().int()}),Qf=A.discriminatedUnion("kind",[CR,AR,IR]),ep=A.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),Ca=A.object({constraints:Qf.optional(),generator:ep,name:A.string().min(1),type:Wi,values:A.array(Xe).min(1).optional()}),tp=A.object({consistency:Ea.default("strict"),optional:A.boolean(),stable:A.boolean(),type:Wi,valueSpace:A.string().min(1).optional()}),Aa=A.enum(["backend","client"]),Ia=A.object({description:A.string().optional(),identity:A.array(A.string().min(1)).min(1),identityKind:A.enum(["surrogate","natural"]),name:A.string().min(1),props:A.record(A.string().min(1),tp),source:Aa.default("backend")}),Pa=A.object({consistency:Ea.default("strict"),default:Xe,description:A.string().optional(),name:A.string().min(1),source:Aa.default("backend"),type:Wi,valueSpace:A.string().min(1).optional()}),Rt=A.enum(["url","title","viewport"]);import{z as T}from"zod";var PR=T.discriminatedUnion("kind",[T.object({as:T.string().min(1),kind:T.literal("created"),props:T.record(T.string().min(1),Ue)}),T.object({as:T.string().min(1),kind:T.literal("updated"),props:T.record(T.string().min(1),ka)}),T.object({kind:T.literal("deleted")})]),TR=T.object({kind:T.literal("is"),value:Ue}),rp=T.lazy(()=>T.union([Ue,OR])),MR=T.object({entity:T.string().min(1),where:T.record(T.string().min(1),rp)}),OR=T.object({field:T.string().min(1),kind:T.literal("within"),selection:MR}),kt=T.union([xa,T.undefined()]).optional().transform(e=>e),zt=T.lazy(()=>T.discriminatedUnion("kind",[T.object({kind:T.literal("visible"),locator:Re,wait:kt}),T.object({kind:T.literal("disabled"),locator:Re,wait:kt}),T.object({kind:T.literal("enabled"),locator:Re,wait:kt}),T.object({kind:T.literal("focused"),locator:Re,wait:kt}),T.object({kind:T.literal("value"),locator:Re,value:xt,wait:kt}),T.object({kind:T.literal("text"),locator:Re,value:xt,wait:kt}),T.object({assertion:TR,kind:T.literal("singleton"),singleton:T.string().min(1),wait:kt}),T.object({kind:T.literal("browser"),name:Rt,value:xt,wait:kt}),T.object({assertion:PR,entity:T.string().min(1),key:T.record(T.string().min(1),rp),kind:T.literal("state"),wait:kt}),T.object({kind:T.literal("not"),predicate:zt}),T.object({kind:T.literal("and"),predicates:T.array(zt)}),T.object({entity:T.string().min(1),kind:T.literal("count"),value:T.number().int().nonnegative()}),T.object({condition:zt,consequence:zt,kind:T.literal("when"),otherwise:T.union([zt,T.undefined()]).optional().transform(e=>e)})]));var np=P.discriminatedUnion("kind",[P.object({kind:P.literal("goto"),url:xt}),P.object({kind:P.literal("fill"),locator:Re,value:Ue}),P.object({kind:P.literal("clear"),locator:Re}),P.object({kind:P.literal("click"),locator:Re}),P.object({kind:P.literal("dblclick"),locator:Re}),P.object({kind:P.literal("select"),locator:Re,value:Ue}),P.object({kind:P.literal("check"),locator:Re}),P.object({kind:P.literal("uncheck"),locator:Re}),P.object({kind:P.literal("hover"),locator:Re}),P.object({files:P.array(P.string().min(1)).min(1),kind:P.literal("upload"),locator:Re}),P.object({key:P.string().min(1),kind:P.literal("press"),locator:Re.optional()})]),ip=P.object({action:np,expect:P.array(zt).default([])}),op=P.object({example:Xe.optional(),valueSpace:P.string().min(1)}),Ta=P.object({as:P.string().min(1),entity:P.string().min(1),set:P.record(P.string().min(1),Ue)}),sp=P.object({entity:P.string().min(1),where:P.record(P.string().min(1),Ue)}),zi=P.object({absent:P.array(sp).default([]),exclusive:P.array(P.string().min(1)).default([]),intent:P.string().min(1),maybe:P.array(Ta).default([]),name:P.string().min(1),params:P.record(P.string().min(1),op),singletons:P.record(P.string().min(1),Ue).default({}),sourcePath:P.string().min(1).optional(),steps:P.array(ip).default([]),stub:P.boolean().default(!1),world:P.array(Ta).default([])}),ap=P.object({sha256:P.string().regex(/^[0-9a-f]{64}$/u),size:P.number().int().nonnegative()}),Gi=P.object({entities:P.array(Ia),fixtures:P.record(P.string().min(1),ap).default({}),singletons:P.array(Pa).default([]),tests:P.array(zi),valueSpaces:P.array(Ca)}),NR=va({name:"ripplo-lockfile",schema:Gi});var Hi="__ripplo__",Ma="__ripplo_seed__";import{z as mn}from"zod";var LR=mn.object({index:mn.number().int().nonnegative(),kind:mn.string(),target:mn.string(),value:mn.string()});function Oa(e,t){return{index:t,kind:e.action.kind,target:$R(e.action),value:DR(e.action)}}function rt(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function $R(e){return e.kind==="goto"?qi(e.url):e.kind==="press"&&e.locator==null?"":Ki(e.locator)}function qi(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join("")}function Ki(e){return e.by==="testId"?`testId=${qi(e.value)}`:e.by==="inside"?`${Ki(e.scope)} \u25B8 ${Ki(e.target)}`:`${e.role} ${e.name==null?"":qi(e.name)}`.trim()}function DR(e){return e.kind==="fill"||e.kind==="select"?_R(e.value):e.kind==="press"?e.key:""}function _R(e){return e==null?"":typeof e!="object"?String(e):qi(e)}import{z as ke}from"zod";var lp=ke.enum(["Strict","Lax","None"]),up=ke.object({domain:ke.string().min(1),expires:ke.number(),httpOnly:ke.boolean(),name:ke.string().min(1),path:ke.string().min(1),sameSite:lp,secure:ke.boolean(),value:ke.string()}),cp=ke.object({localStorage:ke.array(ke.object({name:ke.string().min(1),value:ke.string()})),origin:ke.string().min(1)}),Na=ke.object({cookies:ke.array(up),headers:ke.record(ke.string().min(1),ke.string()).optional(),origins:ke.array(cp)});import{z as K}from"zod";var La=K.union([Xe,K.null()]),$a=K.record(K.string().min(1),La),dp=K.object({as:K.string().min(1),entity:K.string().min(1),fields:K.record(K.string().min(1),Ue)}),FR=K.object({entities:K.array(dp),runId:K.string().min(1),singletons:K.record(K.string().min(1),La).default({})}),fp=K.object({as:K.string().min(1),row:$a,session:Na.optional()}),Da=K.object({rows:K.array(fp)}),jR=K.object({entities:K.array(K.string().min(1)),runId:K.string().min(1),singletons:K.array(K.string().min(1)).default([])}),_a=K.object({entities:K.record(K.string().min(1),K.array($a)),singletons:K.record(K.string().min(1),La).default({})}),VR=K.object({runId:K.string().min(1)}),Fa=K.object({ok:K.literal(!0)});import ja from"fs";import Yi from"path";import{createJiti as GR}from"jiti";import{err as Ji,ok as hp}from"neverthrow";import BR from"fs";import gn from"path";import Ir from"typescript";function pp(e){let t=gn.join(e,"index.ts"),r=zR(e);BR.mkdirSync(gn.dirname(r.tsBuildInfoFile??""),{recursive:!0});let n=Ir.createIncrementalCompilerHost(r),i=Ir.createIncrementalProgram({host:n,options:r,rootNames:[t]}),o=[...i.getSyntacticDiagnostics(),...i.getSemanticDiagnostics()];i.emit();let s=o.filter(u=>UR(u,e));if(s.length===0)return{diagnostics:[],ok:!0};let a={getCanonicalFileName:u=>u,getCurrentDirectory:()=>gn.dirname(e),getNewLine:()=>`
24
24
  `};return{diagnostics:Ir.formatDiagnosticsWithColorAndContext(s,a).split(`
25
- `).filter(u=>u.length>0),ok:!1}}function FR(e,t){let r=e.file?.fileName;return r==null?!0:r.startsWith(t)}var jR=gn.join(".local","tsbuildinfo");function VR(e){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:Ir.ModuleKind.Preserve,moduleResolution:Ir.ModuleResolutionKind.Bundler,noEmit:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!1,target:Ir.ScriptTarget.ES2022,tsBuildInfoFile:gn.join(e,jR)}}var Zi=".ripplo/ripplo.lock",yn;async function pp(e){let{result:t}=await UR(e);return t}async function UR(e){let t=zR(Yi.join(e,".ripplo"));if(yn!=null&&yn.fingerprint===t&&yn.result.isOk())return{fingerprint:t,result:yn.result};let r=await bn(e);return yn={fingerprint:t,result:r},{fingerprint:t,result:r}}async function bn(e){let t=Yi.join(e,".ripplo"),r=Yi.join(t,"index.ts"),n=dp(t);return n.ok?(await GR(r)).andThen(o=>qR({entryPath:r,exported:o})):Ji({diagnostics:n.diagnostics,kind:"typecheck-failed"})}var WR=new Set([".local","debug","node_modules"]);function zR(e){return hp(e).toSorted((t,r)=>t.localeCompare(r)).join("|")}function hp(e){return(Fa.existsSync(e)?Fa.readdirSync(e,{withFileTypes:!0}):[]).flatMap(r=>{if(WR.has(r.name))return[];let n=Yi.join(e,r.name);if(r.isDirectory())return hp(n);let i=Fa.statSync(n);return[`${n}:${String(i.mtimeMs)}:${String(i.size)}`]})}async function GR(e){try{let r=await BR(import.meta.url,{fsCache:!1,moduleCache:!1,sourceMaps:!0}).import(e),n=r!=null&&typeof r=="object"&&"default"in r?Reflect.get(r,"default"):r;return fp(n)}catch(t){return Ji({kind:"load-threw",message:HR(t)})}}function HR(e){return e instanceof Error?e.message:String(e)}function qR({entryPath:e,exported:t}){if(t==null||typeof t!="object"||!("lockfile"in t))return Ji({entryPath:e,kind:"not-ripplo"});let r=Gi.safeParse(Reflect.get(t,"lockfile"));return r.success?fp(r.data):Ji({issues:r.error.issues.map(n=>`${n.path.join(".")}: ${n.message}`),kind:"invalid-lockfile"})}function Pr(e,t){return t==null?`Load \`/ripplo:${e}\` skill for instructions.`:`Load \`/ripplo:${e}\` skill for instructions on ${t}.`}function aB(e){return e.length===1?Pr(e[0]):`REQUIRED before proceeding: load ${e.map(r=>`\`/ripplo:${r}\``).join(" AND ")} skills (load every one \u2014 each carries rules the others don't).`}function Xi(e){return[`Compilation failed: ${KR(e)}`,Pr("create","DSL authoring + lint rules")].join(`
26
- `)}function dB(){return`${Zi} is up to date`}function fB(e){return[`${Zi} is ${e==="missing"?"missing":"out of date"} \u2014 run \`ripplo compile\` and commit the result`,Pr("setup")].join(`
27
- `)}function pB(){return`wrote ${Zi}`}function KR(e){switch(e.kind){case"typecheck-failed":return["TypeScript errors in .ripplo/:",...mp(e.diagnostics)].join(`
28
- `);case"not-ripplo":return`${e.entryPath} must default-export a Ripplo (createRipplo({ entities, invariants, singletons, tests })). Check that the default export is the value returned by createRipplo, not a function or a re-export.`;case"invalid-lockfile":return["Lockfile failed schema validation (stale or hand-edited .ripplo/ripplo.lock?):",...mp(e.issues),"Regenerate with `npx ripplo compile` \u2014 never hand-edit the lockfile."].join(`
25
+ `).filter(u=>u.length>0),ok:!1}}function UR(e,t){let r=e.file?.fileName;return r==null?!0:r.startsWith(t)}var WR=gn.join(".local","tsbuildinfo");function zR(e){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:Ir.ModuleKind.Preserve,moduleResolution:Ir.ModuleResolutionKind.Bundler,noEmit:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!1,target:Ir.ScriptTarget.ES2022,tsBuildInfoFile:gn.join(e,WR)}}var Zi=".ripplo/ripplo.lock",yn;async function mp(e){let{result:t}=await HR(e);return t}async function HR(e){let t=KR(Yi.join(e,".ripplo"));if(yn!=null&&yn.fingerprint===t&&yn.result.isOk())return{fingerprint:t,result:yn.result};let r=await bn(e);return yn={fingerprint:t,result:r},{fingerprint:t,result:r}}async function bn(e){let t=Yi.join(e,".ripplo"),r=Yi.join(t,"index.ts"),n=pp(t);return n.ok?(await YR(r)).andThen(o=>ZR({entryPath:r,exported:o})):Ji({diagnostics:n.diagnostics,kind:"typecheck-failed"})}var qR=new Set([".local","debug","node_modules"]);function KR(e){return gp(e).toSorted((t,r)=>t.localeCompare(r)).join("|")}function gp(e){return(ja.existsSync(e)?ja.readdirSync(e,{withFileTypes:!0}):[]).flatMap(r=>{if(qR.has(r.name))return[];let n=Yi.join(e,r.name);if(r.isDirectory())return gp(n);let i=ja.statSync(n);return[`${n}:${String(i.mtimeMs)}:${String(i.size)}`]})}async function YR(e){try{let r=await GR(import.meta.url,{fsCache:!1,moduleCache:!1,sourceMaps:!0}).import(e),n=r!=null&&typeof r=="object"&&"default"in r?Reflect.get(r,"default"):r;return hp(n)}catch(t){return Ji({kind:"load-threw",message:JR(t)})}}function JR(e){return e instanceof Error?e.message:String(e)}function ZR({entryPath:e,exported:t}){if(t==null||typeof t!="object"||!("lockfile"in t))return Ji({entryPath:e,kind:"not-ripplo"});let r=Gi.safeParse(Reflect.get(t,"lockfile"));return r.success?hp(r.data):Ji({issues:r.error.issues.map(n=>`${n.path.join(".")}: ${n.message}`),kind:"invalid-lockfile"})}function Pr(e,t){return t==null?`Load \`/ripplo:${e}\` skill for instructions.`:`Load \`/ripplo:${e}\` skill for instructions on ${t}.`}function hB(e){return e.length===1?Pr(e[0]):`REQUIRED before proceeding: load ${e.map(r=>`\`/ripplo:${r}\``).join(" AND ")} skills (load every one \u2014 each carries rules the others don't).`}function Xi(e){return[`Compilation failed: ${XR(e)}`,Pr("create","DSL authoring + lint rules")].join(`
26
+ `)}function bB(){return`${Zi} is up to date`}function SB(e){return[`${Zi} is ${e==="missing"?"missing":"out of date"} \u2014 run \`ripplo compile\` and commit the result`,Pr("setup")].join(`
27
+ `)}function wB(){return`wrote ${Zi}`}function XR(e){switch(e.kind){case"typecheck-failed":return["TypeScript errors in .ripplo/:",...yp(e.diagnostics)].join(`
28
+ `);case"not-ripplo":return`${e.entryPath} must default-export a Ripplo (createRipplo({ entities, invariants, singletons, tests })). Check that the default export is the value returned by createRipplo, not a function or a re-export.`;case"invalid-lockfile":return["Lockfile failed schema validation (stale or hand-edited .ripplo/ripplo.lock?):",...yp(e.issues),"Regenerate with `npx ripplo compile` \u2014 never hand-edit the lockfile."].join(`
29
29
  `);case"load-threw":return[`.ripplo/index.ts threw while loading: ${e.message}`,"Usually a bad import or a top-level throw in .ripplo/ \u2014 run `npx ripplo compile` for the stack."].join(`
30
- `)}}function mp(e,t=8){return e.length<=t?e:[...e.slice(0,t),`\u2026 and ${String(e.length-t)} more`]}var Qi=class extends Error{failure;constructor(t){super(t.kind),this.name="CliError",this.failure=t}};function SB(e){return e instanceof Qi?ja(e.failure):e instanceof Error?e.message:String(e)}function ja(e){switch(e.kind){case"project-file-missing":return[`Missing ${e.path} \u2014 this directory is not a Ripplo project.`,"Run `npx ripplo init` to create it (or cd into the project root).",Pr("setup")].join(`
30
+ `)}}function yp(e,t=8){return e.length<=t?e:[...e.slice(0,t),`\u2026 and ${String(e.length-t)} more`]}var Qi=class extends Error{failure;constructor(t){super(t.kind),this.name="CliError",this.failure=t}};function CB(e){return e instanceof Qi?Va(e.failure):e instanceof Error?e.message:String(e)}function Va(e){switch(e.kind){case"project-file-missing":return[`Missing ${e.path} \u2014 this directory is not a Ripplo project.`,"Run `npx ripplo init` to create it (or cd into the project root).",Pr("setup")].join(`
31
31
  `);case"project-file-invalid":return[`${e.path} is invalid:`,...e.issues.map(t=>` ${t}`),"Fix the file by hand or re-run `npx ripplo init`."].join(`
32
32
  `);case"not-authenticated":return["Not authenticated. Run `ripplo auth login`.","(Claude Code: run it yourself as a background process \u2014 device-code flow, the user only approves in the browser.)"].join(`
33
- `);case"env-invalid":return YR(e);case"playwright-install-failed":return["Playwright browser installation failed (Chromium still missing after install).","Try manually: `npx playwright install chromium` \u2014 look for network/proxy or disk-space errors in its output."].join(`
33
+ `);case"env-invalid":return QR(e);case"playwright-install-failed":return["Playwright browser installation failed (Chromium still missing after install).","Try manually: `npx playwright install chromium` \u2014 look for network/proxy or disk-space errors in its output."].join(`
34
34
  `);case"gitdir-unrecognized":return`Unrecognized .git file at ${e.marker} \u2014 expected a directory or a "gitdir:" pointer (worktree). Is the repo corrupted?`;case"gitdir-empty":return`Empty gitdir pointer at ${e.marker} \u2014 the worktree's .git file points nowhere. Re-create the worktree.`;case"oauth-device-code-failed":return[`Could not start sign-in (device-code request failed): ${e.description}`,"Is the Ripplo server reachable? Check RIPPLO_SERVER_URL and retry."].join(`
35
35
  `);case"oauth-authorization-failed":return[`Sign-in failed (${e.code}): ${e.description}`,e.code==="expired_token"?"The approval window expired \u2014 run `ripplo auth login` again.":"Run `ripplo auth login` to retry."].join(`
36
- `);case"compilation-failed":return Xi(e.error)}}function YR(e){let t=e.missingEnvFiles.length===0?[]:["Declared env file(s) not found at this path:",...e.missingEnvFiles.map(r=>` ${r}`),"If you're in a git worktree, the env file may not have been copied from the main checkout \u2014 recreate it (or symlink to a shared file outside the working tree)."];return["Env config invalid:",...e.issues.map(r=>` ${r}`),"Add missing values to the env file(s) declared in .ripplo/project.json.",...t].join(`
37
- `)}import{err as XR,ok as QR}from"neverthrow";import{z as Va}from"zod";var JR="https://ripplo.ai";function yp(){return Sp().RIPPLO_SERVER_URL}function bp(){return Sp().RIPPLO_PROJECT_ID}var ZR=Va.object({RIPPLO_PROJECT_ID:Va.string().min(1).optional(),RIPPLO_SERVER_URL:Va.string().min(1).default(JR)}),gp;function Sp(){return gp??=ZR.parse(process.env),gp}import wp from"fs";import Ba from"path";function vp(e){let t=wp.realpathSync(e),r=t,n=Ba.dirname(r);for(;n!==r;){if(wp.existsSync(Ba.join(r,".git")))return r;r=n,n=Ba.dirname(r)}return t}function OB(e){return ba(e).andThen(t=>ji().andThen(r=>{let n=da();return n==null?XR({kind:"not-authenticated"}):QR({appUrl:r.appUrl,cwd:vp(e),engineUrl:r.engineUrl,projectId:bp()??t.projectId,ripploServerUrl:yp(),token:n,webhookSecret:r.webhookSecret})}))}import xp from"fs";import{checkSync as ek,lockSync as tk}from"proper-lockfile";var rk="dev.pid",Rp=15e3;function kp(e){return Ut(e,rk)}function Ep(e){try{return ek(kp(e),{realpath:!1,stale:Rp})}catch{return!1}}var Ua=class extends Error{pid;cwd;constructor({cwd:t,pid:r}){super("dev-lock-held"),this.name="DevLockHeldError",this.pid=r,this.cwd=t}};function _B({cwd:e,onCompromised:t}){ua(e);let r=kp(e),n=nk({cwd:e,onCompromised:t,path:r});return xp.writeFileSync(r,String(process.pid)),()=>{try{n()}catch{}}}function nk({cwd:e,onCompromised:t,path:r}){try{return tk(r,{realpath:!1,stale:Rp,onCompromised:()=>{t()}})}catch(n){throw ik(n)?new Ua({cwd:e,pid:ok(r)}):n}}function ik(e){if(!(e instanceof Error)||!("code"in e))return!1;let{code:t}=e;return t==="ELOCKED"}function ok(e){try{let t=xp.readFileSync(e,"utf8").trim(),r=Number.parseInt(t,10);return Number.isFinite(r)&&r>0?r:null}catch{return null}}import{createServer as dk}from"http";import{mkdir as fk,rm as pk,writeFile as hk}from"fs/promises";import mk from"path";import{z as te}from"zod";import sk from"path";import{z as Sn}from"zod";var ak=["unspecified","internal","server","client","producer","consumer"],lk=["unset","ok","error"];function Cp(e){return ak[e]??"unspecified"}function Ap(e){return lk[e]??"unset"}var BB=Sn.looseObject({data:Sn.looseObject({source:Sn.number().optional()}).optional(),timestamp:Sn.number(),type:Sn.number()});function Ip({debugDir:e,runId:t,worker:r}){let n=sk.join(e,t,"behavior.jsonl");return r.open({file:n,runId:t}),{close:i=>r.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(uk(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:ck(i.timeNanos)};r.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{r.rrwebBatch({data:i,runId:t})}}}function Tr(e){return String(BigInt(Math.round(e))*1000000n)}function uk(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function ck(e){return Number(BigInt(e)/1000000n)}var gk="otlp-port",Tp=te.object({key:te.string(),value:te.object({boolValue:te.boolean().optional(),doubleValue:te.number().optional(),intValue:te.union([te.string(),te.number()]).optional(),stringValue:te.string().optional()})}),yk=te.object({attributes:te.array(Tp).default([]),endTimeUnixNano:te.string(),kind:te.number().default(0),name:te.string(),parentSpanId:te.string().optional(),spanId:te.string(),startTimeUnixNano:te.string(),status:te.object({code:te.number(),message:te.string().optional()}).optional(),traceId:te.string()}),bk=te.object({resourceSpans:te.array(te.object({resource:te.object({attributes:te.array(Tp).default([])}).optional(),scopeSpans:te.array(te.object({spans:te.array(yk).default([])})).default([])})).default([])});async function Wa({localDir:e,onRrwebBatch:t,onSpan:r,writePortFile:n}){let{port:i,server:o}=await Sk({onRrwebBatch:t,onSpan:r}),s=mk.join(e,gk);return n&&(await fk(e,{recursive:!0}),await hk(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{n&&await pk(s,{force:!0}),await kk(o)}}}function Sk(e){return new Promise((t,r)=>{let n=dk((i,o)=>{wk(i,o,e)});n.on("error",r),n.listen(0,()=>{let i=n.address();if(i==null||typeof i=="string"){r(new Error("otlp_receiver_no_port"));return}t({port:i.port,server:n})})})}function wk(e,t,r){let n=vk(e.url);if(n!=null){Pp(e).then(i=>{r.onRrwebBatch(n,i),eo(t)}).catch(()=>{eo(t)});return}Pp(e).then(i=>{xk(bk.parse(JSON.parse(i.toString("utf8"))),r.onSpan),eo(t)}).catch(()=>{eo(t)})}function vk(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function Pp(e){return new Promise((t,r)=>{let n=[];e.on("data",i=>{n.push(i)}),e.on("end",()=>{t(Buffer.concat(n))}),e.on("error",r)})}function eo(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function xk(e,t){e.resourceSpans.flatMap(r=>r.scopeSpans).flatMap(r=>r.spans).forEach(r=>{t({attributes:Rk(r.attributes),durationMs:Number((BigInt(r.endTimeUnixNano)-BigInt(r.startTimeUnixNano))/1000000n),kind:"span",name:r.name,parentSpanId:r.parentSpanId,source:"server",spanId:r.spanId,spanKind:Cp(r.kind),status:{code:Ap(r.status?.code??0),message:r.status?.message},timeNanos:r.startTimeUnixNano,traceId:r.traceId})})}function Rk(e){return Object.fromEntries(e.map(({key:t,value:r})=>[t,String(r.stringValue??r.intValue??r.doubleValue??r.boolValue??"")]))}function kk(e){return new Promise((t,r)=>{e.close(n=>{if(n==null){t();return}r(n)}),e.closeAllConnections()})}function Et(e){let t=new URL(e,"https://ripplo.invalid"),r=[...t.searchParams.entries()].toSorted(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${n}=${i}`).join("&");return r.length===0?t.pathname:`${t.pathname}?${r}`}function Mr(e,t){return e==="url"?Et(t):t}function za(e,t,r){return Mr(e,String(t))===Mr(e,String(r))}function Op(e,t,r){return e!=="url"?za(e,t,r):Mp(String(t))===Mp(String(r))}function Mp(e){return new URL(e,"https://ripplo.invalid").pathname}function Ga({actual:e,canon:t,pre:r,predicted:n}){return[...[...new Set([...n.entities.keys(),...e.entities.keys()])].flatMap(s=>Ek({actual:e.entities.get(s),canon:t,entity:s,pre:r.entities.get(s),predicted:n.entities.get(s)})),...Ak(r.singletons,n.singletons,e.singletons)]}function Ek({actual:e,canon:t,entity:r,pre:n,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>Ck({actual:e?.get(s),canon:t,entity:r,key:s,predicted:i?.get(s),preHadKey:n?.has(s)??!1,preRow:n?.get(s)}))}function Ck({actual:e,canon:t,entity:r,key:n,predicted:i,preHadKey:o,preRow:s}){if(i==null)return[{divergence:{entity:r,key:n,kind:"ghost-write"},pending:o}];if(e==null)return[{divergence:{entity:r,key:n,kind:"absent"},pending:!o}];let a=(u,c,d)=>$p(t(r,u,c),t(r,u,d));return[...new Set([...Object.keys(i),...Object.keys(e)])].filter(u=>!a(u,i[u],e[u])).map(u=>({divergence:{entity:r,field:u,key:n,kind:"field-mismatch",snapshot:i[u],sut:e[u]},pending:s==null?e[u]===void 0:a(u,s[u],e[u])}))}function $p(e,t){return Np(e)===Np(t)}function Np(e){return e==null?"\u2205":JSON.stringify(e)}function Ak(e,t,r){return[...new Set([...Object.keys(t),...Object.keys(r)])].flatMap(i=>{let o=t[i],s=r[i];return o===void 0||s===void 0||Lp(i,o,s)?[]:[{divergence:{kind:"singleton-mismatch",singleton:i,snapshot:o,sut:s},pending:e[i]!==void 0&&Lp(i,e[i],s)}]})}function Lp(e,t,r){let n=Rt.safeParse(e);return n.success?Op(n.data,t,r):$p(t,r)}function Ha(e){let t=Ik(e.entities),r=Pk(e.singletons);return n=>Tk(n,t,r)}function Ik(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([r,n])=>[Dp(t.name,r),n.consistency])))}function Dp(e,t){return`${e}.${t}`}function Pk(e){return new Map(e.map(t=>[t.name,t.consistency]))}function Tk(e,t,r){return e.kind==="singleton-mismatch"?Mk(e.singleton,r):e.kind==="ghost-write"||e.kind==="absent"?"strict":t.get(Dp(e.entity,e.field))??"strict"}function Mk(e,t){return Rt.safeParse(e).success?t.get(e)??"eventual":t.get(e)??"strict"}function qa(e){let t=new Set(e.valueSpaces.filter(r=>r.generator==="date.iso").map(r=>r.name));return(r,n,i)=>{if(!t.has(`${r}.${n}`)||typeof i!="string")return i;let o=Date.parse(i);return Number.isNaN(o)?i:new Date(o).toISOString()}}function Fp(e,t,r){return{detail:r.slice(0,500),kind:"engine-http",path:e,status:t}}function to(e,t){return{code:qp(t),kind:"engine-network",message:vn(t),path:e}}function jp(e){return{kind:"client-mount-missing",mountKey:e}}function Vp(e,t){return{kind:"engine-decode",message:vn(t),path:e}}function Bp(e,t){return{entity:e,field:t,kind:"state-identity"}}function Up(e){return{as:e,kind:"setup-missing-row"}}function wn(e){return{kind:"driver-launch",message:vn(e)}}function Wp(e,t){return{action:e,kind:"action-failed",message:vn(t)}}function zp(e){return{kind:"check-failed",message:vn(e)}}function Gp(){return{kind:"aborted"}}var _p=300;function Ct(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${Ok(e.detail)}${Nk(e.status)}`;case"engine-network":return`engine ${e.path} request failed: ${e.message}`;case"client-mount-missing":return`client bridge "${e.mountKey}" never mounted; client singletons unreadable`;case"engine-decode":return`engine ${e.path} response did not match schema: ${e.message}`;case"state-identity":return`row of "${e.entity}" is missing identity field "${e.field}"`;case"setup-missing-row":return`setup returned no row for "${e.as}"`;case"driver-launch":return`browser driver failed to launch: ${e.message}`;case"action-failed":return`action "${e.action}" failed: ${e.message}`;case"check-failed":return`check failed: ${e.message}`;case"aborted":return"run aborted"}}function Hp(e){throw new Error(Ct(e))}function ro(){}function Ok(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=_p?t:`${t.slice(0,_p)}\u2026 [truncated]`}function Nk(e){return e===404?" \u2014 the engine adapter is not mounted at RIPPLO_ENGINE_URL (or the mount path differs). Verify the adapter is wired into the app server and ENABLE_RIPPLO_TESTING=true; `ripplo doctor` checks the endpoint.":e===403||e===401?" \u2014 the adapter rejected the request: ENABLE_RIPPLO_TESTING is not true in the app's env, or RIPPLO_WEBHOOK_SECRET differs between the app and .ripplo env.":""}function qp(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?qp(e.cause):void 0}function vn(e){return e instanceof Error?e.message:String(e)}var Xa=Pi(Zp(),1),nU=Xa.default.configure,no=Xa.default;function J(e){return no(e)??""}function At(e,t){return[...new Map(e.map(r=>[t(r),r])).values()]}function Qa(e){return At(e,J)}function Xp(e){return J(e)}var Rn=class extends Error{name="AbortError";constructor(){super("aborted")}};function Qp(e){return e instanceof Error&&e.name==="AbortError"}function Ht(e){if(e.aborted)throw new Rn}function el(e,t){return t.aborted?Promise.reject(new Rn):new Promise((r,n)=>{let i=()=>{clearTimeout(o),n(new Rn)},o=setTimeout(()=>{t.removeEventListener("abort",i),r()},e);t.addEventListener("abort",i,{once:!0})})}function oh(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var Bk=()=>[];async function nl({canon:e,classify:t,initialSnapshot:r,lawObligations:n,observe:i,onAssertion:o,onStep:s,steps:a},l){return sh({acc:[],canon:e,classify:t,index:0,lawObligations:n??Bk,observe:i,onAssertion:o,onStep:s,signal:l,snapshot:r,steps:a})}async function sh({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,steps:c}){Ht(l);let d=c[n];if(d==null)return{finalModel:u,findings:e};let p=Date.now();if(!d.guard(u)){let h={kind:"illegal-transition",step:d.step};return tl(a,{endMs:Date.now(),findings:[h],index:n,post:u,pre:u,startMs:p,url:rl(u)}),{finalModel:u,findings:[...e,h]}}return d.perform().match(()=>Uk({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,startMs:p,step:d,steps:c}),h=>{let f=io(h,d);return tl(a,{endMs:Date.now(),findings:[f],index:n,post:u,pre:u,startMs:p,url:rl(u)}),Promise.resolve({finalModel:u,findings:[...e,f]})})}async function Uk({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,startMs:c,step:d,steps:p}){let h=d.effect(u),f=await Yk({canon:t,classify:r,observe:o,pre:u,predicted:h,signal:l,step:d}),m=[...d.obligations,...i(u,f.snapshot)],g=[...await Wk({obligations:m,onAssertion:s,signal:l,step:d}),...f.findings];return tl(a,{endMs:Date.now(),findings:g,index:n,post:f.snapshot,pre:u,startMs:c,url:rl(f.snapshot)}),sh({acc:[...e,...g],canon:t,classify:r,index:n+1,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:f.snapshot,steps:p})}async function Wk({obligations:e,onAssertion:t,signal:r,step:n}){let i=[...new Map(e.map(s=>[Xp(s.source),s])).values()],o=await Promise.all(i.map(async s=>({obligation:s,outcome:await zk(s,r)})));return o.forEach(s=>{Gk(t,s.obligation,s.outcome,n)}),o.flatMap(s=>qk(s.obligation,s.outcome,n))}function zk(e,t){if(e.check.kind==="decided"){let r=e.check.passed?"passed":"failed";return Promise.resolve({kind:r})}return Jk(e.budget,e.check.run,t)}function Gk(e,t,r,n){e?.({outcome:Hk(r),source:t.source,step:n.step})}function Hk(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function qk(e,t,r){return t.kind==="error"?[io(t.error,r)]:t.kind==="failed"?[{budget:e.budget,kind:"obligation",source:e.source,step:r.step}]:[]}function io(e,t){return{error:e,kind:"driver-error",step:t.step}}function tl(e,t){e?.(t)}function rl(e){let t=e.singletons.url;return typeof t=="string"?t:null}var kn={async:12e4,fast:5e3,slow:3e4},ah={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:kn.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:kn.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:kn.slow}};function lh(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function eh(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function Kk(e,t,r){return r.reconcile==null?e:r.reconcile(e,t)}function th({canon:e,pre:t,predicted:r,step:n},i){let o=n.verifyChanges==null?[]:n.verifyChanges(r,i),s=Kk(r,i,n),a=o.map(l=>({divergence:l,pending:!0}));return{adopted:s,probed:[...a,...Ga({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function uh(e,t){return{budget:t.settle,divergence:e.divergence,kind:"consistency",pending:e.pending,step:t.step}}function rh(e,t,r){let n=e.probed.filter(i=>!i.pending&&r(i.divergence)==="strict");return n.length>0?{findings:n.map(i=>uh(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function nh(e,t,r){return{findings:[...e.probed.map(n=>uh(n,t)),...r],snapshot:e.adopted}}async function Yk({canon:e,classify:t,observe:r,pre:n,predicted:i,signal:o,step:s}){let a=ah[s.settle],l=Date.now()+a.timeoutMs,u=await eh(r);if(!u.ok)return{findings:[io(u.error,s)],snapshot:i};let c=th({canon:e,pre:n,predicted:i,step:s},u.observed),d=0;for(;Date.now()<l;){Ht(o);let p=rh(c,s,t);if(p!=null)return p;await el(lh(a,d),o),d+=1;let h=await eh(r);if(!h.ok)return nh(c,s,[io(h.error,s)]);c=th({canon:e,pre:n,predicted:i,step:s},h.observed)}return rh(c,s,t)??nh(c,s,[])}async function Jk(e,t,r){let n=ah[e],i=Date.now()+n.timeoutMs,o=await ih(t),s=0;for(;o.kind==="pending"&&Date.now()<i;)Ht(r),await el(lh(n,s),r),s+=1,o=await ih(t);return o.kind==="pending"?{kind:"failed"}:o}function ih(e){return e().match(t=>t?{kind:"passed"}:{kind:"pending"},t=>({error:t,kind:"error"}))}import{z as Zk}from"zod";var ol=Zk.string().brand(),ee=ol.parse("");function It(e){return ol.parse(e)}function qe(e,t){return ol.parse(e.length===0?t:`${e}.${t}`)}function Ie(e){return Ar.safeParse(e).success}function mt(e){return typeof e=="object"&&e!==null&&"template"in e}function il(e,t,r){let n=qe(t,e.ref);if(!r.has(n))throw new Error(`unresolved binding ref "${n}"`);return r.get(n)??null}function oo(e,t,r){return Xk(e).every(n=>r.has(qe(t,n)))}function nt(e,t,r){return typeof e=="string"?e:Ie(e)?String(il(e,t,r)):e.template.map(n=>typeof n=="string"?n:String(il(n,t,r))).join("")}function it(e,t,r){return e===null||typeof e=="number"||typeof e=="boolean"?e:Ie(e)?il(e,t,r):nt(e,t,r)}function ch(e,t){return it(e,ee,t)}function En(e){return no(e)}function Or(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,it(i,t,r)]))}function Xk(e){return e==null||typeof e!="object"?[]:mt(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}function qt(e){return typeof e=="object"&&e!==null&&"kind"in e}function dr(e){return Object.fromEntries(Object.entries(e).filter(t=>!qt(t[1])))}function dh(e,t,r){return t.reduce((n,i)=>Qk(n,i,r,e),e)}function fh(e,t){return Object.keys(t).length===0?e:{...e,singletons:{...e.singletons,...t}}}function Qk(e,t,r,n){if(!eE(t,r))return e;if(t.assertion.kind==="created"){let o=Or(t.assertion.props,ee,r);return tE(e,t.entity,En(o),o)}if(t.assertion.kind==="deleted")return sl(e,t.entity,oE(t.key,r,n));let i=Or(dr(t.assertion.props),ee,r);return sl(e,t.entity,sE(t.key,i,r,n))}function eE(e,t){return("props"in e.assertion?[e.key,dr(e.assertion.props)]:[e.key]).every(n=>Object.values(n).every(i=>mh(i)||!Ie(i)||t.has(It(i.ref))))}function tE(e,t,r,n){let i=new Map([...e.entities.get(t)??[],[r,n]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function sl(e,t,r){let n=r(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,n]])}}function Cn(e,t,r,n){let i={env:n,key:r,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>ao(o,i))}function ph(e,t,r,n,i){let o={env:n,key:r,snapshot:e};return sl(e,t,s=>new Map([...s].map(([a,l])=>[a,ao(l,o)?i(l):l])))}function ao(e,t){return Object.entries(t.key).every(([r,n])=>hh(e[r],n,t))}function hh(e,t,r){return mh(t)?rE(t,r).has(so(e)):so(e)===so(iE(t,r.env))}function mh(e){return typeof e=="object"&&e!==null&&"kind"in e}function rE(e,t){let r=t.snapshot.entities.get(e.selection.entity);return r==null?new Set:new Set([...r.values()].filter(n=>nE(n,e.selection.where,t)).map(n=>so(n[e.field])))}function nE(e,t,r){return Object.entries(t).every(([n,i])=>hh(e[n],i,r))}function so(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function iE(e,t){return it(e,ee,t)}function oE(e,t,r){let n={env:t,key:e,snapshot:r};return i=>new Map([...i].filter(([,o])=>!ao(o,n)))}function sE(e,t,r,n){let i={env:r,key:e,snapshot:n};return o=>new Map([...o].map(([s,a])=>ao(a,i)?[s,{...a,...t}]:[s,a]))}function bh(e){let t=e.predicates.filter(o=>xh(o)),r=t.filter(o=>o.assertion.kind==="created"),n=vh(t);if(r.length===0&&n.length===0&&e.deferred.length===0&&e.adopt.length===0)return;let i=t.filter(o=>o.assertion.kind==="updated");return(o,s)=>{let a=r.reduce((c,d)=>pE(c,s,d,e.env),{env:e.env,snapshot:o}),l=n.reduce((c,d)=>fE(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>lE(c,s,d),a.env);return aE(mE(l,e.deferred,u),s,e.adopt)}}function aE(e,t,r){if(r.length===0)return e;let n=r.reduce((i,o)=>{let s=t.snapshot.singletons[o];return s===void 0?i:{...i,[o]:s}},e.singletons);return{...e,singletons:n}}function Sh(e,t,r){return new Map([...e,...Object.entries(r).map(([n,i])=>[qe(ee,`${t}.${n}`),i])])}function lE(e,t,r){let n=Cn(t.snapshot,r.entity,r.key,e).at(0);return n==null?e:Sh(e,r.assertion.as,n)}function wh(e){let t=vh(e.predicates.filter(r=>xh(r)));if(t.length!==0)return(r,n)=>t.flatMap(i=>uE(i,r,n,e.env))}function vh(e){return e.filter(t=>t.assertion.kind==="updated"&&al(t.assertion.props).length>0)}function al(e){return Object.entries(e).filter(([,t])=>qt(t)).map(([t])=>t)}function xh(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function uE(e,t,r,n){let i=Cn(t,e.entity,e.key,n).at(0),o=Cn(r.snapshot,e.entity,e.key,n).at(0);if(i==null||o==null)return[];let s=En(cE(e.key,n));return al(e.assertion.props).flatMap(a=>gh(i[a])===gh(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function cE(e,t){let r=Object.fromEntries(Object.entries(e).filter(n=>!dE(n[1])));return Or(r,ee,t)}function dE(e){return typeof e=="object"&&e!==null&&"kind"in e}function gh(e){return e==null?"\u2205":JSON.stringify(e)}function fE(e,t,r,n){let i=al(r.assertion.props),o=Cn(t.snapshot,r.entity,r.key,n).at(0);return o==null?e:ph(e,r.entity,r.key,n,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function pE(e,t,r,n){if(r.assertion.kind!=="created")return e;let i=Or(r.assertion.props,ee,n),o=En(i),s=e.snapshot.entities.get(r.entity);if(s==null||!s.has(o))return e;let a=hE(t.snapshot.entities.get(r.entity),s,i);if(a==null)return e;let[l,u]=a,c=new Map(s);return c.delete(o),c.set(l,u),{env:Sh(e.env,r.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(r.entity,c)}}}function hE(e,t,r){if(e!=null)return[...e].find(([n,i])=>!t.has(n)&&Object.entries(r).every(([o,s])=>yh(i[o])===yh(s)))}function yh(e){return e==null?"\u2205":JSON.stringify(e)}function mE(e,t,r){let n=t.reduce((i,o)=>{let s=gE(o.value,r);return s==null?i:{...i,[o.name]:Mr(o.name,s)}},e.singletons);return{...e,singletons:n}}function gE(e,t){try{return nt(e,ee,t)}catch{return}}function lo(e,t){if(e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused")return{kind:e.kind,locator:An(e.locator,t)};if(e.kind==="not"){let r=lo(e.predicate,t);return r==null?null:{inner:r,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:An(e.locator,t),value:nt(e.value,ee,t)}:e.kind!=="browser"?null:{kind:"browser",name:e.name,value:nt(e.value,ee,t)}}function In(e,t){let r=e.expect.filter(l=>l.kind==="state"),n=RE(r),{adopt:i,conditional:o,deferred:s,immediate:a}=SE(e,t,n);return{action:kE(e.action,t),label:e.action.kind,obligations:e.expect.flatMap(l=>CE(l,t)),reconcile:bh({adopt:i,deferred:s,env:t,predicates:r}),verifyChanges:wh({adopt:i,deferred:s,env:t,predicates:r}),effect:l=>{let u=dh(l,r,t),c=o.reduce((d,p)=>({...d,...ll(p,u,t)}),{});return fh(u,{...a,...c})}}}function An(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:nt(e.name,ee,t),role:e.role}:e.by==="inside"?{by:"inside",scope:An(e.scope,t),target:An(e.target,t)}:{by:"testId",value:nt(e.value,ee,t)}}function ll(e,t,r){return e==null?{}:e.kind==="when"?ul(e.condition,t,r)?ll(e.consequence,t,r):ll(e.otherwise,t,r):bE(e,r)}function ul(e,t,r){if(!yE(e))throw new Error(`when() condition cannot be a "${e.kind}" predicate`);switch(e.kind){case"singleton":return t.singletons[e.singleton]===it(e.assertion.value,ee,r);case"count":return(t.entities.get(e.entity)?.size??0)===e.value;case"not":return!ul(e.predicate,t,r);case"and":return e.predicates.every(n=>ul(n,t,r))}}function yE(e){return e.kind==="singleton"||e.kind==="count"||e.kind==="not"||e.kind==="and"}function bE(e,t){if(e.kind!=="browser"&&e.kind!=="singleton")return{};let r=e.kind==="browser"?e.value:e.assertion.value;return oo(r,ee,t)?Rh(e,t):{}}function SE(e,t,r){let n=e.action.kind==="goto"&&!e.expect.some(s=>s.kind==="browser"&&s.name==="url"),i=e.action.kind==="goto"&&!n?{url:Et(nt(e.action.url,ee,t))}:{},o=n?["url"]:[];return e.expect.reduce((s,a)=>a.kind==="browser"&&wE(a.value,r)?{...s,deferred:[...s.deferred,{name:a.name,value:a.value}]}:a.kind==="browser"||a.kind==="singleton"?{...s,immediate:{...s.immediate,...Rh(a,t)}}:a.kind==="when"?{...s,conditional:[...s.conditional,a]}:s,{adopt:o,conditional:[],deferred:[],immediate:i})}function wE(e,t){return vE(e).some(r=>t.has(r.split(".")[0]??r))}function vE(e){return typeof e=="string"?[]:Ie(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function Rh(e,t){if(e.kind==="browser")return{[e.name]:xE(e,t)};if(e.kind==="singleton")return{[e.singleton]:it(e.assertion.value,ee,t)};throw new Error("when() consequence must be a url (browser) or singleton assertion")}function xE(e,t){return Mr(e.name,nt(e.value,ee,t))}function RE(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function kE(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:EE(e,t),url:e.kind==="goto"?nt(e.url,ee,t):void 0,value:"value"in e?ch(e.value,t):void 0}}function EE(e,t){if(!(!("locator"in e)||e.locator==null))return An(e.locator,t)}function CE(e,t){if(e.kind==="browser"||e.kind==="singleton")return[];let r=lo(e,t),n="wait"in e?e.wait??"fast":"fast";return r==null?[]:[{budget:n,check:r}]}import{err as AE,ok as IE,okAsync as PE,Result as TE}from"neverthrow";function Pn(e,t,r){let n=e.tests.find(a=>a.name===t);if(n==null)throw new Error(`test "${t}" not found in lockfile`);let i=_E(e),o={env:new Map,generate:r.generate,generatedParams:new Set,indexed:i,overrides:new Map(Object.entries(r.params??{}).map(([a,l])=>[It(a),l]))};FE(n.params,ee,o);let s=n.world.map(a=>jE(a,ee,o));return r.materialize(s).map(a=>ME({base:WE(a,o.env,i),generatedParams:o.generatedParams,lockfile:e,test:n}))}function dl(e,t){let r=new Map(t.map(n=>[n.name,n]));return n=>PE(LE(n,e,r).rows)}function fl(e){return t=>{let r=t.map(n=>({as:n.as,entity:n.entity,fields:n.fields}));return e(r).andThen(n=>NE(t,n))}}function kh(e,t){let r=uo(t);return Object.fromEntries(Object.entries(e).filter(([n,i])=>r.includes(n)&&i!=null))}function uo(e){return Object.entries(e.props).filter(([,t])=>t.stable).map(([t])=>t)}function ME({base:e,generatedParams:t,lockfile:r,test:n}){let i=Object.fromEntries(r.singletons.map(c=>[c.name,c.default])),o=Object.fromEntries(Object.entries(n.singletons).map(([c,d])=>[c,it(d,ee,e.env)])),s=Object.entries(n.singletons).filter(([,c])=>OE(c,t)).map(([c])=>c),a={...i,...o},l=new Set(r.singletons.filter(c=>c.source==="client").map(c=>c.name)),u=Object.fromEntries(Object.entries(a).filter(([c])=>l.has(c)));return{...e,clientState:u,generatedSingletons:s,snapshot:{...e.snapshot,singletons:a}}}function OE(e,t){return Ie(e)?t.has(qe(ee,e.ref)):mt(e)?e.template.some(r=>typeof r!="string"&&t.has(qe(ee,r.ref))):!1}function NE(e,t){let r=new Map(t.map(n=>[n.as,n]));return TE.combine(e.map(n=>{let i=r.get(n.as);return i==null?AE(Up(n.as)):IE({as:n.as,entity:n.entity,generatedFields:n.generatedFields,row:i.row,session:i.session})}))}function LE(e,t,r){return e.reduce((n,i)=>{let o=$E(i.fields,n.env),s=GE({generate:t,model:i.model,seedPrefix:i.seedPrefix,set:o,valueSpaces:r}),a=Object.entries(s).map(([u,c])=>[`${i.as}.${u}`,c]),l=Object.keys(s).filter(u=>!(u in o));return{env:new Map([...n.env,...a]),rows:[...n.rows,{as:i.as,entity:i.entity,generatedFields:[...new Set([...i.generatedFields,...l])],row:s,session:void 0}]}},{env:new Map,rows:[]})}function $E(e,t){return Object.fromEntries(Object.entries(e).map(([r,n])=>{if(Ie(n))return[r,DE(t,n.ref)];if(mt(n))throw new Error(`template value not allowed in entity field "${r}"`);return[r,n]}))}function DE(e,t){let r=e.get(t);if(r==null)throw new Error(`setup ref "${t}" was not produced by an earlier entity`);return r}function _E(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function FE(e,t,r){Object.entries(e).forEach(([n,i])=>{let o=qe(t,n),s=r.indexed.valueSpaces.get(i.valueSpace);if(s==null)throw new Error(`unknown valueSpace "${i.valueSpace}" for param "${o}"`);let a=r.overrides.get(o)??i.example;a==null&&r.generatedParams.add(o);let l=a??r.generate.value({anchor:void 0,constraints:s.constraints,generator:s.generator,nullable:!1,seed:o,type:s.type,values:s.values,valueSpace:i.valueSpace});r.env.set(o,l)})}function jE(e,t,r){let n=r.indexed.models.get(e.entity);if(n==null)throw new Error(`model "${e.entity}" not found for setup "${e.as}"`);let i=qe(t,e.as),o=VE(e.set,t,r.env),s=UE(n,o,i,r),a=Object.entries(e.set).filter(([,l])=>Ie(l)&&r.generatedParams.has(qe(t,l.ref))).map(([l])=>l);return{as:i,entity:e.entity,fields:{...s,...o},generatedFields:[...Object.keys(s),...a],model:n,seedPrefix:i}}function VE(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,BE(i,t,r)]))}function BE(e,t,r){if(!Ie(e))return e;let n=qe(t,e.ref);return r.get(n)??{ref:n}}function UE(e,t,r,n){return Object.fromEntries(Object.entries(e.props).filter(([i,o])=>!o.optional&&!e.identity.includes(i)&&!(i in t)).map(([i,o])=>[i,Eh({field:i,generate:n.generate,model:e,seedPrefix:r,spec:o,valueSpaces:n.indexed.valueSpaces})]))}function WE(e,t,r){let n=new Map,i=e.flatMap(a=>{let l=r.models.get(a.entity);if(l==null)throw new Error(`model "${a.entity}" not found for setup "${a.as}"`);Object.entries(a.row).forEach(([c,d])=>t.set(qe(It(a.as),c),d));let u=n.get(a.entity)??new Map;return u.set(cl(a.row,l),kh(a.row,l)),n.set(a.entity,u),a.session==null?[]:[a.session]}),o=e.flatMap(a=>{let l=r.models.get(a.entity);return l==null?[]:[{alias:a.as,entity:a.entity,key:cl(a.row,l)}]}),s=e.flatMap(a=>{let l=r.models.get(a.entity);if(l==null)return[];let u=cl(a.row,l);return a.generatedFields.map(c=>({entity:a.entity,field:c,key:u}))});return{aliases:o,auth:zE(i),env:t,generated:s,snapshot:{entities:HE(n),singletons:{}}}}function zE(e){if(e.length===0)return;let t=e.flatMap(r=>Object.entries(r.headers??{}));return{cookies:e.flatMap(r=>r.cookies),headers:t.length===0?void 0:Object.fromEntries(t),origins:e.flatMap(r=>r.origins)}}function GE({generate:e,model:t,seedPrefix:r,set:n,valueSpaces:i}){return{...Object.fromEntries(Object.entries(t.props).filter(([s])=>!(s in n)).map(([s,a])=>[s,Eh({field:s,generate:e,model:t,seedPrefix:r,spec:a,valueSpaces:i})])),...n}}function Eh({field:e,generate:t,model:r,seedPrefix:n,spec:i,valueSpaces:o}){let s=`${r.name}.${e}`;return t.value({anchor:void 0,constraints:o.get(s)?.constraints,generator:o.get(s)?.generator??"lorem.word",nullable:i.optional,seed:qe(n,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function cl(e,t){return t.identity.map(r=>String(e[r])).join(":")}function HE(e){return new Map([...e].map(([t,r])=>[t,new Map(r)]))}function gt(e){return`${e.test}#${String(e.index)}`}function Nr(e){let t=e.tests.flatMap(r=>co(e,r.name));return At(t,r=>`${r.test}:${J(r.steps)}`)}function co(e,t){let r=Oh(e,t),n=Ih(r,e),i=Ch(n,r.singletons),o=mC(r,hC(e));return qE(i,gC(r.steps),n).map(({chunk:a,guard:l},u)=>fC({chunk:a,guard:l,index:u,intent:r.intent,namespace:n.namespace,paramSpaceOf:o,testName:t}))}function Ch(e,t){return{absences:cC(e),entities:dC(e),exclusives:e.exclusives,optionals:Mh(e.optionals,e),singletons:Object.fromEntries(Object.entries(t).filter(([,r])=>!Ie(r)&&!mt(r)))}}function fo(e,t,r){return Object.values(e).flatMap(n=>Ie(n)?hl(n.ref,r):[]).find(n=>n.entity===t)?.aliasPath}function qE(e,t,r){return t.reduce((n,i)=>({guard:KE(n.guard,i,r),guarded:[...n.guarded,{chunk:i,guard:sC(n.guard,i)}]}),{guard:e,guarded:[]}).guarded}function KE(e,t,r){let n=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>YE(i,o,r),e);return{...n,singletons:{...n.singletons,...nC(t)}}}function YE(e,t,r){return t.assertion.kind==="deleted"?JE(e,t,r):t.assertion.kind==="created"?QE(e,t.entity,t.assertion.as,t.assertion.props,r):tC(e,t,r)}function JE(e,t,r){let n=fo(t.key,t.entity,r.namespace),i=e.entities.find(a=>a.alias===n),o=Tn(ZE(t.key),t.entity,r),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...XE(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==n)}}function ZE(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let r=t[1];return Th(r)?[]:[[t[0],r]]}))}function XE(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(r=>!t.relations.some(n=>n.field===r.field)),...t.relations]}}function QE(e,t,r,n,i){let o=Tn(n,t,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!eC(o,s)),entities:[...e.entities,{alias:r,entity:t,...o}]}}function eC(e,t){return Object.entries(t.literals).every(([n,i])=>e.literals[n]===i)&&t.relations.every(n=>e.relations.some(i=>i.field===n.field&&i.targetAlias===n.targetAlias&&i.targetField===n.targetField))}function tC(e,t,r){if(t.assertion.kind!=="updated")return e;let n=fo(t.key,t.entity,r.namespace);if(n==null)return e;let i=Tn(dr(t.assertion.props),t.entity,r),o=Object.entries(t.assertion.props).filter(([,a])=>qt(a)).map(([a])=>a),s=a=>a.alias===n?rC(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a)),optionals:e.optionals.map(a=>s(a))}}function rC(e,t,r){let n=Object.entries(e.literals).filter(([i])=>!r.includes(i)&&!(i in t.literals));return{...e,literals:{...Object.fromEntries(n),...t.literals},relations:[...e.relations.filter(i=>!t.relations.some(o=>o.field===i.field)),...t.relations]}}function nC(e){return e.reduce((t,r)=>({...t,...iC(r),...oC(r)}),{})}function iC(e){return e.action.kind==="goto"?{url:e.action.url}:{}}function oC(e){return Object.fromEntries(e.expect.flatMap(t=>t.kind==="browser"?[[t.name,t.value]]:t.kind==="singleton"?[[t.singleton,t.assertion.value]]:[]))}function sC(e,t){return t[0]?.action.kind!=="goto"?e:{...e,singletons:Object.fromEntries(Object.entries(e.singletons).filter(([r])=>r!=="url"))}}function po(e,t){let r=Oh(e,t),n=Ih(r,e);return{guard:Ch(n,r.singletons),namespace:n.namespace,stable:n.stable}}function Ah(e,t){return[...new Set(e)].flatMap(r=>hl(r,t))}function ot(e){return Ie(e)?[e.ref]:mt(e)?e.template.flatMap(t=>Ie(t)?[t.ref]:[]):[]}function Kt(e){switch(e.kind){case"visible":case"disabled":case"enabled":case"focused":return Yt(e.locator);case"value":case"text":return[...Yt(e.locator),...ot(e.value)];case"singleton":return ot(e.assertion.value);case"browser":return ot(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(dr(e.assertion.props)).flatMap(t=>ot(t)),...Object.values(e.key).flatMap(t=>Ph(t))];case"not":return Kt(e.predicate);case"when":return[...Kt(e.condition),...Kt(e.consequence),...e.otherwise==null?[]:Kt(e.otherwise)];case"and":return e.predicates.flatMap(t=>Kt(t));case"count":return[]}}function Ih(e,t){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map([...e.world,...e.maybe].map(r=>[r.as,r.entity])),optionals:e.maybe,setups:e.world,stable:aC(t)}}function aC(e){let t=new Map(e.entities.map(r=>[r.name,r]));return(r,n)=>t.get(r)?.props[n]?.stable===!0}function Yt(e){return e.by==="inside"?[...Yt(e.scope),...Yt(e.target)]:e.by==="role"?e.name==null?[]:ot(e.name):ot(e.value)}function Ph(e){return Th(e)?Object.values(e.selection.where).flatMap(t=>Ph(t)):ot(e)}function Th(e){return typeof e=="object"&&e!==null&&"kind"in e}function lC(e){return e.kind==="goto"?ot(e.url):e.kind==="fill"||e.kind==="select"?[...Yt(e.locator),...ot(e.value)]:e.kind==="press"?e.locator==null?[]:Yt(e.locator):(e.kind==="upload",Yt(e.locator))}function uC(e){return[...lC(e.action),...e.expect.flatMap(t=>Kt(t))]}function cC(e){return e.absences.map(t=>({entity:t.entity,...Tn(t.where,t.entity,e)}))}function Tn(e,t,r){let n=Object.entries(e).filter(([s])=>r.stable(t,s)),i=Object.fromEntries(n.flatMap(([s,a])=>Ie(a)||mt(a)?[]:[[s,a]])),o=n.flatMap(s=>{let a=s[1];if(!Ie(a))return[];let l=hl(a.ref,r.namespace).at(0);return l==null?[]:[{entity:l.entity,field:s[0],targetAlias:l.aliasPath,targetField:l.field}]});return{literals:i,relations:o}}function Mh(e,t){return e.map(r=>({alias:r.as,entity:r.entity,...Tn(r.set,r.entity,t)}))}function dC(e){return Mh(e.setups,e)}function fC(e){let t=e.chunk.findIndex(s=>s.action.kind!=="goto"),r=t===-1?e.chunk:e.chunk.slice(0,t),n=e.chunk.slice(r.length),i=n.at(-1)??e.chunk.at(-1);if(i==null)throw new Error("empty transition chunk");let o=[...new Set(e.chunk.flatMap(s=>uC(s)))];return{effectStep:i,guard:e.guard,index:e.index,intent:e.intent,namespace:e.namespace,nav:r,paramSpaces:Object.fromEntries(o.filter(s=>e.paramSpaceOf.has(s)).map(s=>[s,e.paramSpaceOf.get(s)])),steps:n,test:e.testName,wait:oh(n.flatMap(s=>pC(s)))}}function pC(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function hl(e,t){let r=e.lastIndexOf(".");if(r===-1)return[];let n=e.slice(0,r),i=t.get(n);return i==null?[]:[{aliasPath:n,entity:i,field:e.slice(r+1),ref:e}]}function Oh(e,t){let r=e.tests.find(n=>n.name===t);if(r==null)throw new Error(`test "${t}" not found in lockfile`);return r}function hC(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function mC(e,t){return new Map(Object.entries(e.params).map(([r,n])=>[r,t.get(n.valueSpace)]))}function gC(e){return pl(e,0,[],[])}function pl(e,t,r,n){let i=e[t];if(i==null)return r.length===0?n:[...n,r];let o=[...r,i];return yC(i)?pl(e,t+1,[],[...n,o]):pl(e,t+1,o,n)}function yC(e){return e.expect.some(t=>t.kind==="state")}function Nh(e){return Lh(e,new Map)}function bC(e,t){return e.reduce((r,n)=>r??t(n),null)}function Lh(e,t){let r=e.variables.find(n=>!t.has(n));return r==null?t:bC(e.domain(r),n=>{let i=new Map([...t,[r,n]]);return e.consistent(i)?Lh(e,i):null})}function yt(e,t){let r=SC(e,t);if(r==null)return null;let n=EC(r);return CC(e.singletons,t,n)?n:null}function SC(e,t){let{absences:r,entities:n,exclusives:i,optionals:o}=e,s=new Map(n.map(u=>[u.alias,u])),a=Nh({variables:n.map(u=>u.alias),consistent:u=>wC(u)&&vC(n,u)&&RC(r,u,t),domain:u=>_h(s.get(u),t)});if(a==null)return null;let l=Fh(o,a,t);return kC(i,[...n,...o],l,t)?l:null}function wC(e){let t=[...e.values()];return new Set(t).size===t.length}function vC(e,t){return e.every(r=>t.has(r.alias)?r.relations.every(n=>xC(r,n,t)):!0)}function xC(e,t,r){if(!r.has(t.targetAlias))return!0;let n=r.get(t.targetAlias)?.[t.targetField];return n==null?!0:r.get(e.alias)?.[t.field]===n}function RC(e,t,r){return e.every(n=>![...r.entities.get(n.entity)?.values()??[]].some(i=>$h(i,n,t)))}function $h(e,t,r){return Dh(e,t)?t.relations.every(n=>{if(!r.has(n.targetAlias))return!1;let i=r.get(n.targetAlias)?.[n.targetField];return i!=null&&e[n.field]===i}):!1}function Dh(e,t){return Object.entries(t.literals).every(([r,n])=>n===null?e[r]==null:e[r]===n)}function _h(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(r=>Dh(r,e))}function Fh(e,t,r){let n=e.reduce((i,o)=>{if(i.has(o.alias))return i;let s=new Set(i.values()),a=_h(o,r).find(l=>!s.has(l)&&$h(l,o,i));return a==null?i:new Map([...i,[o.alias,a]])},t);return n.size===t.size?n:Fh(e,n,r)}function kC(e,t,r,n){return e.every(i=>{let o=t.filter(a=>a.entity===i&&r.has(a.alias)).length;return(n.entities.get(i)?.size??0)===o})}function EC(e){return new Map([...e].flatMap(([t,r])=>Object.entries(r).flatMap(n=>{let i=n[1];return typeof i=="string"||typeof i=="number"||typeof i=="boolean"?[[It(`${t}.${n[0]}`),i]]:[]})))}function CC(e,t,r){return Object.entries(e).every(([n,i])=>{if(!oo(i,ee,r))return!1;let o=it(i,ee,r),s=t.singletons[n],a=Rt.safeParse(n);return a.success?za(a.data,o,s):s===o})}function ho(e,t,r){let n=yt(e.guard,t);return n==null?null:new Map([...n,...Object.entries(r).map(([i,o])=>[It(i),o])])}function mo(e,t){let r=In(e.effectStep,t),n=PC(e,t),i=[...e.nav,...e.steps].map(o=>In(o,t));return{effect:TC(r.effect,n),steps:i.map(o=>({action:o.action,effect:o.effect,obligations:o.obligations,reconcile:o.reconcile,verifyChanges:o.verifyChanges}))}}function ml(e,t,r){return yt(e.guard,r)==null?!1:fr(t(r))!==fr(r)||MC(e)||AC(e)}function AC(e){return[...e.nav,...e.steps].every(t=>t.expect.every(r=>r.kind!=="state"))}var jh=new WeakMap;function fr(e){let t=jh.get(e);if(t!=null)return t;let r=J({entities:[...e.entities].map(([n,i])=>[n,[...i]]),singletons:IC(e.singletons)});return jh.set(e,r),r}function IC(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>t==="url"&&typeof r=="string"?[t,Et(r)]:[t,r]))}function PC(e,t){let r=e.nav.at(-1);return r==null?void 0:In(r,t).action.url}function TC(e,t){if(t==null)return e;let r=Et(t);return n=>{let i=e(n);return{...i,singletons:{...i.singletons,url:r}}}}function MC(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(r=>qt(r)))}function Mn(e,t,r){let n=ho(e,t.snapshot,r);if(n==null)return null;let i=OC(e,n);return i==null||!ml(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function Vh(e,t,r){let n=ho(e,t.snapshot,r);if(n==null)return"guard-unsatisfied";try{return mo(e,n),"no-effect"}catch{return"unresolvable"}}function OC(e,t){try{return mo(e,t)}catch{return null}}function Lr(e,t,r){return e.flatMap((n,i)=>{let o=r(n),s=Mn(n,t,o);return s==null?[]:[{firing:s,idx:i,label:gt(n),params:o}]})}var NC={absences:[],entities:[],exclusives:[],optionals:[],singletons:{}};function On(e){return{...NC,...e}}function gl(e){return LC(e).flatMap(t=>$C(t))}function LC(e){return[...e.reduce((r,n)=>{let i=J([n.when.singletons,n.consequence]);return new Map([...r,[i,[...r.get(i)??[],n]]])},new Map).values()]}function $C(e){if(e.length<2)return[];let t=e.map(o=>new Set(o.when.entities.map(s=>Bh(s)))),[r]=t;if(r==null)return[];let n=[...r].filter(o=>t.every(s=>s.has(o))),i=e.toSorted((o,s)=>o.when.entities.length-s.when.entities.length)[0];return i==null||n.length===i.when.entities.length?[]:DC(i,n,FC(e))}function Bh(e){return J([e.entity,e.literals])}function DC(e,t,r){let n=e.when.entities.filter(s=>t.includes(Bh(s))),i=new Set(n.map(s=>s.alias));if(![...e.refs].every(s=>i.has(s)))return[];let o=On({entities:n.map(s=>_C(s,i)),optionals:e.when.optionals.filter(s=>i.has(s.alias)),singletons:e.when.singletons});return[{consequence:e.consequence,origin:{kind:"generalized",tests:r},refs:e.refs,when:o}]}function _C(e,t){return{...e,relations:e.relations.filter(r=>t.has(r.targetAlias))}}function FC(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function jC(e){return e.flatMap((t,r)=>e.slice(r+1).flatMap(n=>Gh(t,n)))}function zh(e,t){return Gh(e,t).length>0}function Gh(e,t){let r=Uh(e.when,t.when);return!r&&!Uh(t.when,e.when)||!BC(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:r?t.when:e.when}]}function Uh(e,t){return yl(e.entities,t.entities)&&yl(e.absences,t.absences)&&yl(e.optionals,t.optionals)&&e.exclusives.every(r=>t.exclusives.includes(r))&&VC(e.singletons,t.singletons)}function yl(e,t){let r=new Set(t.map(n=>J(n)));return e.every(n=>r.has(J(n)))}function VC(e,t){return Object.entries(e).every(([r,n])=>J(t[r])===J(n))}function BC(e,t){return e.kind==="not"?bl(e.predicate,t):t.kind==="not"?bl(e,t.predicate):UC(e,t)||WC(e,t)}function bl(e,t){return e.kind===t.kind&&"locator"in e&&"locator"in t&&Hh(e,t)}function Hh(e,t){return"locator"in t&&J(e.locator)===J(t.locator)}function UC(e,t){let r=new Set([e.kind,t.kind]);return r.has("enabled")&&r.has("disabled")&&"locator"in e&&"locator"in t?Hh(e,t):!1}function WC(e,t){let r=Wh(e),n=Wh(t);return r==null||n==null||e.kind!==t.kind?!1:bl(e,t)&&J(r)!==J(n)}function Wh(e){return e.kind==="value"||e.kind==="text"?e.value:null}function zC(e,t){return e.flatMap(r=>{let n=GC(r),i=new Set(r.guard.absences.map(o=>o.entity));return t.flatMap(o=>HC(r,o,n,i))})}function GC(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(r=>r.kind==="state"&&r.assertion.kind==="deleted"?[r.entity]:[])))}function HC(e,t,r,n){let{source:i,target:o}=t.reference;return!r.has(o)||r.has(i)||n.has(i)?[]:[{invariant:t,source:i,target:o,transition:gt(e)}]}function wl(e){return J({consequence:e.consequence,when:e.when})}function vl(e){let t=[...qC(e),...nA(e)],r=gl(t).reduce((n,i)=>[...t,...n].some(s=>zh(i,s))?n:[...n,i],[]);return At([...t,...r],wl)}function xl(e){return e.kind==="not"?xl(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="value"||e.kind==="text"}function Rl(e,t,r){if(yt(e.when,t)!=null)return null;let n=yt(e.when,r);return n==null?null:oA(e,n)}function qC(e){return At(e.tests.flatMap(t=>KC(e,t)),wl)}function KC(e,t){let r=po(e,t.name);return t.steps.reduce((n,i)=>({guard:YC(n.guard,i,r),laws:[...n.laws,...rA(i,n.guard,r.namespace,{kind:"test",test:t.name})]}),{guard:r.guard,laws:[]}).laws}function YC(e,t,r){return t.expect.reduce((n,i)=>i.kind==="state"?JC(n,i,r):n,e)}function JC(e,t,r){if(t.assertion.kind==="created"){let o=ZC(t.assertion.as,t.entity,t.assertion.props,r);return{...e,entities:[...e.entities,o]}}let n=fo(t.key,t.entity,r.namespace);if(n==null)return e;if(t.assertion.kind==="deleted")return eA(e,n);let i=dr(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===n?Sl(o,i,r):o),optionals:e.optionals.map(o=>o.alias===n?Sl(o,i,r):o)}}function ZC(e,t,r,n){return Sl({alias:e,entity:t,literals:{},relations:[]},r,n)}function Sl(e,t,r){return Object.entries(t).reduce((n,[i,o])=>{if(mt(o)||!r.stable(e.entity,i))return n;if(Ie(o)){let s=XC(o.ref,i,r.namespace);return{...n,literals:QC(n.literals,i),relations:s==null?n.relations:[...qh(n.relations,i),s]}}return{...n,literals:{...n.literals,[i]:o},relations:qh(n.relations,i)}},e)}function XC(e,t,r){let n=e.lastIndexOf(".");if(n===-1)return;let i=e.slice(0,n),o=r.get(i);return o==null?void 0:{entity:o,field:t,targetAlias:i,targetField:e.slice(n+1)}}function QC(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>r!==t))}function qh(e,t){return e.filter(r=>r.field!==t)}function eA(e,t){let r=[...e.entities,...e.optionals].find(i=>i.alias===t),n=tA(e,t);return r==null?n:{...n,absences:[...n.absences,{entity:r.entity,literals:r.literals,relations:r.relations}]}}function tA(e,t){return{...e,entities:e.entities.filter(r=>r.alias!==t),optionals:e.optionals.filter(r=>r.alias!==t)}}function rA(e,t,r,n){if(e.action.kind!=="goto")return[];let i=e.action.url;return e.expect.filter(o=>xl(o)).map(o=>Kh({consequence:o,guard:t,namespace:r,origin:n,url:i}))}function Kh({consequence:e,guard:t,namespace:r,origin:n,url:i}){return{consequence:e,origin:n,refs:new Set(Ah([...ot(i),...Kt(e)],r).map(o=>o.aliasPath)),when:{...t,singletons:{...t.singletons,url:i}}}}function nA(e){return At(Nr(e).flatMap(t=>iA(t)),wl)}function iA(e){let t=e.nav.at(-1),r=e.steps[0]?.action,n=r!=null&&"locator"in r?r.locator:void 0;return t==null||t.action.kind!=="goto"||n==null?[]:[Kh({consequence:{kind:"enabled",locator:n,wait:void 0},guard:e.guard,namespace:e.namespace,origin:{intent:e.intent,kind:"trigger",test:e.test},url:t.action.url})]}function oA(e,t){try{let r=lo(e.consequence,t);return r==null?null:{check:r}}catch{return null}}function kl(e){return Qa(e.tests.flatMap(t=>sA(e,t.name)))}function El(e,t){return yt(e.when,t)==null?!1:yt(e.holds,t)==null}function sA(e,t){let r=po(e,t);return r.guard.entities.flatMap(n=>n.relations.flatMap(i=>aA(e,n,i,r.namespace)?cA(n,i,r.namespace):[]))}function aA(e,t,r,n){let i=n.get(r.targetAlias);return i!=null&&!lA(e,t.entity,r.field)&&uA(e,i,r.targetField)}function lA(e,t,r){return e.entities.find(n=>n.name===t)?.props[r]?.optional===!0}function uA(e,t,r){return e.entities.find(n=>n.name===t)?.identity.includes(r)===!0}function cA(e,t,r){let n=r.get(t.targetAlias);if(n==null)return[];let i=Yh(e.alias,e.entity),o=Yh(t.targetAlias,n);return[{holds:On({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:n,targetField:t.targetField},when:On({entities:[i]})}]}function Yh(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function Jh(e,t){let r=[...t.entities].flatMap(([o,s])=>[...s].map(([a,l])=>dA({entity:o,key:a,pre:e,row:l}))),n=[...e.entities].flatMap(([o,s])=>[...s].flatMap(([a,l])=>fA({entity:o,key:a,post:t,row:l}))),i=Object.entries(t.singletons).map(([o,s])=>({changed:e.singletons[o]!==s,name:o,value:s}));return{rows:[...r,...n],singletons:i}}function dA({entity:e,key:t,pre:r,row:n}){let i=pA(r.entities.get(e),t),o=Object.entries(n).map(([s,a])=>({changed:i==null||i[s]!==a,field:s,value:a}));return{changed:i==null||o.some(s=>s.changed),entity:e,fields:o,key:t,status:i==null?"created":"present"}}function fA({entity:e,key:t,post:r,row:n}){if(r.entities.get(e)?.has(t)===!0)return[];let i=Object.entries(n).map(([o,s])=>({changed:!1,field:o,value:s}));return[{changed:!0,entity:e,fields:i,key:t,status:"deleted"}]}function pA(e,t){return e?.get(t)}function Cl(e,t,r){return t.steps.map(n=>({effect:n.effect,obligations:n.obligations.map(i=>({budget:i.budget,check:{kind:"poll",run:()=>r.evaluate(i.check)},source:{check:i.check,kind:"step"}})),reconcile:n.reconcile,settle:e.wait,step:{action:n.action,intent:e.intent,test:e.test},verifyChanges:n.verifyChanges,guard:()=>!0,perform:()=>r.perform(n.action)}))}async function Zh(e,t){let{params:r,transition:n}=e.firing,i=Mn(n,e.state,r);if(i==null){let s={intent:n.intent,kind:"unfireable",reason:Vh(n,e.state,r),test:n.test};return{label:gt(n),next:e.state,result:{finalModel:e.state.snapshot,findings:[s]}}}let o=await nl({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,lawObligations:mA(e.laws,e.invariants,e.driver),observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,steps:Cl(e.firing.transition,i.resolved,e.driver)},t);return{label:gt(e.firing.transition),next:{snapshot:o.finalModel},result:o}}function hA(e,t){return El(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},source:{invariant:e,kind:"invariant"}}]:[]}function mA(e,t,r){return(n,i)=>[...e.flatMap(o=>gA(o,n,i,r)),...t.flatMap(o=>hA(o,i))]}function gA(e,t,r,n){let i=Rl(e,t,r);return i==null?[]:[{budget:"fast",check:{kind:"poll",run:()=>n.evaluate(i.check)},source:{check:i.check,kind:"law",origin:e.origin}}]}function Il(e,t){return Al({acc:{findings:[],fired:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function Al({acc:e,index:t,params:r,signal:n,state:i,stepBase:o}){Ht(n);let s=r.sequence[t];if(s==null)return e;let a=Date.now(),l=[],u=await Zh({canon:r.canon,classify:r.classify,driver:r.driver,firing:s,invariants:r.invariants,laws:r.laws,onAssertion:r.onAssertion,state:i,onStep:d=>{l.push(d.index),r.onEvent({endMs:d.endMs,findings:d.findings,index:o+d.index,kind:"step",startMs:d.startMs,state:Jh(d.pre,d.post),url:d.url})}},n);if(u==null)return Al({acc:e,index:t+1,params:r,signal:n,state:i,stepBase:o});r.onEvent({endMs:Date.now(),intent:s.transition.intent,kind:"fired",startMs:a}),u.result.findings.forEach(d=>{r.onEvent({finding:d,kind:"finding"})});let c={findings:[...e.findings,...u.result.findings],fired:[...e.fired,u.label]};return Al({acc:c,index:t+1,params:r,signal:n,state:u.next,stepBase:o+l.length})}var $r={value:e=>yA(e)};function Tl(e,t){return{value:r=>e.value({...r,seed:`${t}:${r.seed}`})}}function Ml(e,t){return{value:r=>e.value({...r,anchor:t})}}function yA({anchor:e,constraints:t,generator:r,nullable:n,seed:i,type:o,values:s,valueSpace:a}){let l=Pl(`${a}:${i}`);return n&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:r==="date.iso"?bA({anchor:e,constraints:t,n:l,timeHash:Pl(`${a}:${i}#tod`)}):o==="number"?SA(l,t):o==="boolean"?l%2===0:kA(r,l)}var go=864e5;function bA({anchor:e,constraints:t,n:r,timeHash:n}){if(t?.kind!=="datetime")throw new Error("datetime value space requires offsetDays constraints");if(e==null)throw new Error("datetime value space requires a run anchor timestamp");let i=Date.parse(e);if(Number.isNaN(i))throw new TypeError(`datetime anchor "${e}" is not a valid ISO timestamp`);let o=t.maxOffsetDays-t.minOffsetDays+1,s=o<=0?t.minOffsetDays:t.minOffsetDays+r%o,a=Math.floor(i/go)*go;return new Date(a+s*go+n%go).toISOString()}function Pl(e,t=0,r=7){return t>=e.length?r>>>0:Pl(e,t+1,r*31+(e.codePointAt(t)??0)>>>0)}function SA(e,t){if(t?.kind!=="number"||t.min==null||t.max==null)throw new Error("number value space requires min and max constraints");let r=t.max-t.min+1;return r<=0?t.min:t.min+e%r}var wA=["ada","bruno","carmen","dario","elena","felix","greta","hugo","iris","jonas","kira","lena","mateo","nadia","oscar","petra","quinn","rosa","stefan","tara","ugo","vera","wim","yara"],vA=["abreu","berg","costa","duval","eriksen","fischer","garza","holm","ito","jansen","kovac","laurent","moreau","novak","okafor","petrov","quist","rossi","sato","tanaka","ueda","vargas","weber","zhang"],xA=["amber","brisk","calm","deep","early","fond","glad","hazel","ivory","jade","keen","lush","mauve","noble","opal","plum","quiet","rapid","sage","teal","umber","vivid","warm","zesty"],RA=["aspen","brook","cedar","dune","ember","fjord","grove","harbor","isle","juniper","knoll","lagoon","meadow","nimbus","orchid","prairie","quartz","ridge","summit","thicket","umbra","vale","willow","zephyr"];function yo(e,t){let r=e[t%e.length];if(r==null)throw new Error("empty word list");return r}function bo(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function kA(e,t){let r=yo(wA,t),n=yo(vA,Math.floor(t/31)),i=yo(xA,t),o=yo(RA,Math.floor(t/29));return e==="internet.email"?`${r}.${n}${String(t%100)}@test.ripplo.ai`:e==="internet.url"?`https://${i}-${o}.example.com`:e==="person.fullName"?`${bo(r)} ${bo(n)}`:e==="company.name"?`${bo(i)} ${bo(o)}`:e==="lorem.slug"?`${i}-${o}`:`${o}-${String(t%1e3)}`}import{ResultAsync as Nl}from"neverthrow";var Nn=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}};function Ol(e){return{read:t=>EA(t,e),seedScript:t=>`globalThis[${JSON.stringify(Ta)}] = ${JSON.stringify(t)};`}}async function EA(e,t){let r={title:await e.title(),url:Et(e.url()),viewport:IA(e.viewportSize())};if(t.length===0)return r;let n=await e.evaluate(AA,{mountKey:Hi,names:t,timeoutMs:CA});if(n.kind==="unmounted")throw new Nn(Hi);return{...r,...n.values}}var CA=5e3;async function AA(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(n=>setTimeout(n,25));let r=Reflect.get(globalThis,e.mountKey);return r==null?{kind:"unmounted"}:{kind:"values",values:Object.fromEntries(e.names.map(n=>[n,r.readSingleton(n)??null]))}}function IA(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}function $l(e,t,r){return{evaluate:n=>Nl.fromPromise(em(PA(e,r,n),`check ${n.kind}`),Xh),observe:()=>t.read().andThen(n=>Nl.fromPromise(em(tm(e,r,0),"observe"),Xh).map(i=>({snapshot:{...n,singletons:{...n.singletons,...i}}}))),perform:n=>Nl.fromPromise(nm(e,n,0),i=>Wp(n.kind,i))}}async function PA(e,t,r){try{return await sm(e,t,r)}catch(n){if(rm(n))return!1;throw n}}function Xh(e){return e instanceof Nn?jp(e.mountKey):zp(e)}var TA=[100,250,500];async function tm(e,t,r){try{return await t.read(e)}catch(n){let i=TA[r];if(i==null||!rm(n))throw n;return await om(i),tm(e,t,r+1)}}function rm(e){let t=e instanceof Error?e.message:String(e);return/Execution context was destroyed|Cannot find context with specified id|[Ff]rame was detached|frame got detached/.test(t)}var Qh=35e3;function em(e,t){let r,n=new Promise((i,o)=>{r=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(Qh)}ms`))},Qh)});return Promise.race([e,n]).finally(()=>{clearTimeout(r)})}var MA=[250,750,2e3];async function nm(e,t,r){try{await OA(e,t)}catch(n){let i=MA[r];if(i==null||!$A(n))throw n;await om(i),await nm(e,t,r+1)}}async function OA(e,t){if(t.kind==="goto"){await e.goto(Dr(t.url,t,"url"));return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(Dr(t.key,t,"key"));return}await NA(im(e,t.locator),t)}function Dr(e,t,r){if(e==null)throw new Error(`action "${t.kind}" requires ${r}`);return e}function NA(e,t){switch(t.kind){case"goto":throw new Error("goto must not be located");case"fill":return e.fill(String(Dr(t.value,t,"value")));case"clear":return e.clear();case"click":return e.click();case"dblclick":return e.dblclick();case"check":return e.check();case"uncheck":return e.uncheck();case"hover":return e.hover();case"select":return e.selectOption(String(Dr(t.value,t,"value")));case"upload":return e.setInputFiles(Dr(t.files,t,"files"));case"press":return e.press(Dr(t.key,t,"key"))}}function im(e,t){if(t==null)throw new Error("action requires a locator");return Ll(e,t)}function Ll(e,t){return t.by==="testId"?e.getByTestId(t.value):t.by==="inside"?Ll(Ll(e,t.scope),t.target):e.locator(LA(t.role,t.name))}function LA(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function $A(e){let t=e instanceof Error?e.message:String(e);return/net::ERR_|ERR_HTTP_RESPONSE_CODE_FAILURE|ECONNREFUSED|ECONNRESET|socket hang up|fetch failed|page\.goto: Timeout/.test(t)}function om(e){return new Promise(t=>{setTimeout(t,e)})}async function sm(e,t,r){if(r.kind==="browser")return DA(e,t,r.name,r.value);if(r.kind==="not")return!await sm(e,t,r.inner);let n=im(e,r.locator);return r.kind==="visible"?n.isVisible():r.kind==="disabled"?n.isDisabled():r.kind==="enabled"?n.isEnabled():r.kind==="focused"?n.evaluate(i=>i===i.ownerDocument.activeElement):r.kind==="value"?await n.inputValue()===r.value:(await n.textContent()??"").includes(r.value)}async function DA(e,t,r,n){let o=(await t.read(e))[r];return typeof o=="string"&&o.includes(n)}async function Dl({baseUrl:e,browser:t,capture:r,clientState:n,engine:i,reader:o,session:s}){let a=await t.newContext({baseURL:e,reducedMotion:"reduce",storageState:s==null?void 0:{cookies:s.cookies,origins:s.origins}});s?.headers!=null&&await a.setExtraHTTPHeaders(s.headers),await a.addInitScript(i.seedScript(n));let l=r==null?_A():await r.hub.attach(a,r.runId),u=await a.newPage();return l.onPage(u),{driver:FA($l(u,o,i),l),emitAssertion:l.emitAssertion,close:()=>jA({context:a,handle:l})}}async function _l(e,t){let r=await lm(e);try{return await t(r)}finally{await r.close()}}function _A(){return{emitAction:()=>{},emitAssertion:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function lm(e){let{chromium:t}=await import("playwright");return t.launch({headless:!e})}function um({headed:e}){let t;return{acquire:async()=>{let i=t;if(i!=null){let o=await i.catch(()=>{});if(o?.isConnected()===!0)return o;t===i&&(t=void 0)}return t??=lm(e),t},close:async()=>{let i=t;t=void 0,i!=null&&await i.then(o=>o.close()).catch(()=>{})}}}function FA(e,t){return{evaluate:e.evaluate,observe:e.observe,perform:r=>(t.emitAction(r),e.perform(r))}}async function jA({context:e,handle:t}){await am(t.finish()),await am(e.close())}var VA=15e3;async function am(e){let t,r=new Promise(n=>{t=setTimeout(n,VA)});await Promise.race([e.catch(()=>{}),r]).finally(()=>{clearTimeout(t)})}import{err as BA,ok as UA,Result as Fl}from"neverthrow";function jl(e,t,r){return{read:()=>r.read(e.map(n=>n.name),t).andThen(n=>WA(e,n))}}function WA(e,t){return Fl.combine(e.map(r=>zA(r,t.entities[r.name]??[]).map(n=>[r.name,n]))).map(r=>({entities:new Map(r),singletons:t.singletons}))}function zA(e,t){let r=uo(e);return Fl.combine(t.map(n=>GA(n,e).map(i=>[i,HA(n,r)]))).map(n=>new Map(n))}function GA(e,t){return Fl.combine(t.identity.map(r=>{let n=e[r];return n==null?BA(Bp(t.name,r)):UA(String(n))})).map(r=>r.join(":"))}function HA(e,t){let r=t.map(n=>[n,e[n]]).filter(n=>n[1]!=null);return Object.fromEntries(r)}var dm=Pi(ha(),1);import qA from"crypto";import{err as KA,errAsync as cm,ok as YA,ResultAsync as So}from"neverthrow";var JA=3e4,ZA=[250,750,2e3];function Vl({baseUrl:e,runId:t,secret:r},n){let i=new dm.Webhook(r),o=(s,a,l)=>XA({baseUrl:e,body:a,path:s,retry:l.retry,schema:l.schema,signal:l.signal,webhook:i});return{query:{read:(s,a)=>o("/state",{entities:s,runId:t,singletons:a},{retry:"transient",schema:Da,signal:n}).map(l=>({entities:l.entities,singletons:l.singletons}))},setupWorld:s=>o("/setup",{entities:s,runId:t},{retry:"connection",schema:$a,signal:n}).map(a=>a.rows),teardown:()=>o("/teardown",{runId:t},{retry:"connection",schema:_a,signal:void 0}).map(()=>{})}}function XA(e){return fm(e.retry,()=>nI(e),0)}function fm(e,t,r){return t().orElse(n=>{let i=ZA[r];return i==null||!eI(n,e)?cm(n):So.fromSafePromise(rI(i)).andThen(()=>fm(e,t,r+1))})}var QA=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function eI(e,t){return e.kind==="aborted"?!1:tI(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function tI(e){return e.kind==="engine-network"&&e.code!=null&&QA.has(e.code)}function rI(e){return new Promise(t=>{setTimeout(t,e)})}function nI({baseUrl:e,body:t,path:r,schema:n,signal:i,webhook:o}){let s=JSON.stringify(t);return So.fromPromise(fetch(`${e}${r}`,{body:s,headers:{"Content-Type":"application/json",...iI(o,s)},method:"PUT",signal:oI(i)}),a=>to(r,a)).andThen(a=>sI(a,r)).andThen(a=>aI(n,a,r)).mapErr(a=>i?.aborted===!0?Gp():a)}function iI(e,t){let r=`msg_${qA.randomUUID()}`,n=new Date;return{"webhook-id":r,"webhook-signature":e.sign(r,n,t),"webhook-timestamp":String(Math.floor(n.getTime()/1e3))}}function oI(e){let t=AbortSignal.timeout(JA);return e==null?t:AbortSignal.any([e,t])}function sI(e,t){return e.ok?So.fromPromise(e.json(),r=>to(t,r)):So.fromPromise(e.text().catch(()=>""),r=>to(t,r)).andThen(r=>cm(Fp(t,e.status,r)))}function aI(e,t,r){let n=e.safeParse(t);return n.success?YA(n.data):KA(Vp(r,n.error))}var le=Pi(mm(),1),W={actual:e=>le.default.red(e),bad:e=>le.default.red(le.default.bold(e)),bold:e=>le.default.bold(e),dim:e=>le.default.dim(e),expected:e=>le.default.green(e),good:e=>le.default.green(le.default.bold(e)),heading:e=>le.default.bold(le.default.cyan(e)),path:e=>le.default.cyan(le.default.underline(e)),warn:e=>le.default.yellow(le.default.bold(e))},dI={assertion:le.default.yellow,consistency:le.default.magenta,driver:le.default.red,illegal:le.default.cyan,invariant:le.default.yellow,unfireable:le.default.red};function Ln(e){return`${le.default.red(le.default.bold("\u2717"))} ${dI[e](le.default.bold(e.toUpperCase()))}`}var fI=le.default.red("\u2717"),tz=le.default.green("\u2713"),gm=le.default.dim("\u203A"),pI=8;function re(e,t,r){let n=r==null?"":` ${W.dim(r)}`;return` ${W.dim(e.padStart(pI))} ${t}${n}`}function _r(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${_r(e.scope)} \u25B8 ${_r(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function Wl(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${_r(e.locator)}`:e.kind}function $n(e){return e.kind==="not"?`not ${$n(e.inner)}`:e.kind==="browser"?`${e.name}="${e.value}"`:e.kind==="value"||e.kind==="text"?`${e.kind} ${_r(e.locator)}="${e.value}"`:`${e.kind} ${_r(e.locator)}`}function Dn(e){let{field:t,source:r,target:n,targetField:i}=e.reference;return`${r}.${t} \u2192 ${n}.${i}`}function Sm(e){return`${e.intent} \u203A ${Wl(e.action)}`}function wm(e){return e.kind==="invariant"?`invariant ${Dn(e.invariant)}`:`${e.kind} ${$n(e.check)}`}function st(e){return e==null?"\u2205":JSON.stringify(e)}function vm(e){return e.kind==="ghost-write"?`${e.entity} "${e.key}" exists in SUT but model expected none`:e.kind==="absent"?`${e.entity} "${e.key}" expected by model but absent in SUT`:e.kind==="field-mismatch"?`${e.entity}.${e.field} [${e.key}] model=${st(e.snapshot)} sut=${st(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${st(e.value)}`:`${e.singleton} model=${st(e.snapshot)} sut=${st(e.sut)}`}function zl(e){return{label:wm(e.source),step:Sm(e.step)}}function _n(e){return e.kind==="consistency"?xI(e):e.kind==="obligation"?II(e.source,e.step,e.budget):e.kind==="illegal-transition"?pr("illegal","guard was false before this step",e.step,[re("meaning",W.dim("the action fired from a state the model says is unreachable"),void 0)]):e.kind==="unfireable"?pr("unfireable",`could not fire "${e.intent}"`,void 0,[re("reason",W.actual(Rm(e.reason)),void 0),re("meaning",W.dim("a planned move was skipped \u2014 never silently drop it"),void 0)]):pr("driver","the browser failed to run this step",e.step,[re("cause",W.actual(Ct(e.error)),void 0),re("decide",W.dim("environment/infra failure \u2014 fix the run environment (daemon, dev server, ports); never weaken the model or app for a driver failure"),void 0)])}function xm(e){return mI(gI(e))}var hI=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function mI(e){return e.replaceAll(hI,"").replaceAll(/\s+/g," ").trim()}function gI(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${vm(e.divergence)}${t}`}return e.kind==="obligation"?`${TI(e.source)} failed at "${e.step.intent}": ${MI(e.source)}`:e.kind==="illegal-transition"?`guard was false before "${e.step.intent}" \u2014 the action fired from a state the model says is unreachable`:e.kind==="unfireable"?`could not fire "${e.intent}" \u2014 ${Rm(e.reason)}`:`driver failed at "${e.step.intent}": ${Ct(e.error)}`}var yI={"guard-unsatisfied":"the guard isn't satisfied by the live state","no-effect":"the move has no observable effect from this state",unresolvable:"a step references a value the model can't resolve yet (e.g. a not-yet-created id)"};function Rm(e){return yI[e]}function bI({debugDir:e,runId:t}){let r=`${e}/${t}`;return re("behavior",W.path(`${r}/behavior.jsonl`),void 0)}function SI(e){if(e.kind==="cascade-gap"){let{gap:n}=e,i=`${n.transition} deletes ${n.target} but leaves ${n.source} dangling`;return`${Ln("invariant")} ${W.bold(i)}
36
+ `);case"compilation-failed":return Xi(e.error)}}function QR(e){let t=e.missingEnvFiles.length===0?[]:["Declared env file(s) not found at this path:",...e.missingEnvFiles.map(r=>` ${r}`),"If you're in a git worktree, the env file may not have been copied from the main checkout \u2014 recreate it (or symlink to a shared file outside the working tree)."];return["Env config invalid:",...e.issues.map(r=>` ${r}`),"Add missing values to the env file(s) declared in .ripplo/project.json.",...t].join(`
37
+ `)}import{err as rk,ok as nk}from"neverthrow";import{z as Ba}from"zod";var ek="https://ripplo.ai";function Sp(){return vp().RIPPLO_SERVER_URL}function wp(){return vp().RIPPLO_PROJECT_ID}var tk=Ba.object({RIPPLO_PROJECT_ID:Ba.string().min(1).optional(),RIPPLO_SERVER_URL:Ba.string().min(1).default(ek)}),bp;function vp(){return bp??=tk.parse(process.env),bp}import xp from"fs";import Ua from"path";function Rp(e){let t=xp.realpathSync(e),r=t,n=Ua.dirname(r);for(;n!==r;){if(xp.existsSync(Ua.join(r,".git")))return r;r=n,n=Ua.dirname(r)}return t}function jB(e){return ba(e).andThen(t=>ji().andThen(r=>{let n=da();return n==null?rk({kind:"not-authenticated"}):nk({appUrl:r.appUrl,cwd:Rp(e),engineUrl:r.engineUrl,projectId:wp()??t.projectId,ripploServerUrl:Sp(),token:n,webhookSecret:r.webhookSecret})}))}import kp from"fs";import{checkSync as ik,lockSync as ok}from"proper-lockfile";var sk="dev.pid",Ep=15e3;function Cp(e){return Ut(e,sk)}function Ap(e){try{return ik(Cp(e),{realpath:!1,stale:Ep})}catch{return!1}}var Wa=class extends Error{pid;cwd;constructor({cwd:t,pid:r}){super("dev-lock-held"),this.name="DevLockHeldError",this.pid=r,this.cwd=t}};function zB({cwd:e,onCompromised:t}){ua(e);let r=Cp(e),n=ak({cwd:e,onCompromised:t,path:r});return kp.writeFileSync(r,String(process.pid)),()=>{try{n()}catch{}}}function ak({cwd:e,onCompromised:t,path:r}){try{return ok(r,{realpath:!1,stale:Ep,onCompromised:()=>{t()}})}catch(n){throw lk(n)?new Wa({cwd:e,pid:uk(r)}):n}}function lk(e){if(!(e instanceof Error)||!("code"in e))return!1;let{code:t}=e;return t==="ELOCKED"}function uk(e){try{let t=kp.readFileSync(e,"utf8").trim(),r=Number.parseInt(t,10);return Number.isFinite(r)&&r>0?r:null}catch{return null}}import{createServer as mk}from"http";import{mkdir as gk,rm as yk,writeFile as bk}from"fs/promises";import Sk from"path";import{z as te}from"zod";import ck from"path";import{z as Sn}from"zod";var dk=["unspecified","internal","server","client","producer","consumer"],fk=["unset","ok","error"];function Ip(e){return dk[e]??"unspecified"}function Pp(e){return fk[e]??"unset"}var KB=Sn.looseObject({data:Sn.looseObject({source:Sn.number().optional()}).optional(),timestamp:Sn.number(),type:Sn.number()});function Tp({debugDir:e,runId:t,worker:r}){let n=ck.join(e,t,"behavior.jsonl");return r.open({file:n,runId:t}),{close:i=>r.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(pk(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:hk(i.timeNanos)};r.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{r.rrwebBatch({data:i,runId:t})}}}function Tr(e){return String(BigInt(Math.round(e))*1000000n)}function pk(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function hk(e){return Number(BigInt(e)/1000000n)}var wk="otlp-port",Op=te.object({key:te.string(),value:te.object({boolValue:te.boolean().optional(),doubleValue:te.number().optional(),intValue:te.union([te.string(),te.number()]).optional(),stringValue:te.string().optional()})}),vk=te.object({attributes:te.array(Op).default([]),endTimeUnixNano:te.string(),kind:te.number().default(0),name:te.string(),parentSpanId:te.string().optional(),spanId:te.string(),startTimeUnixNano:te.string(),status:te.object({code:te.number(),message:te.string().optional()}).optional(),traceId:te.string()}),xk=te.object({resourceSpans:te.array(te.object({resource:te.object({attributes:te.array(Op).default([])}).optional(),scopeSpans:te.array(te.object({spans:te.array(vk).default([])})).default([])})).default([])});async function za({localDir:e,onRrwebBatch:t,onSpan:r,writePortFile:n}){let{port:i,server:o}=await Rk({onRrwebBatch:t,onSpan:r}),s=Sk.join(e,wk);return n&&(await gk(e,{recursive:!0}),await bk(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{n&&await yk(s,{force:!0}),await Ik(o)}}}function Rk(e){return new Promise((t,r)=>{let n=mk((i,o)=>{kk(i,o,e)});n.on("error",r),n.listen(0,()=>{let i=n.address();if(i==null||typeof i=="string"){r(new Error("otlp_receiver_no_port"));return}t({port:i.port,server:n})})})}function kk(e,t,r){let n=Ek(e.url);if(n!=null){Mp(e).then(i=>{r.onRrwebBatch(n,i),eo(t)}).catch(()=>{eo(t)});return}Mp(e).then(i=>{Ck(xk.parse(JSON.parse(i.toString("utf8"))),r.onSpan),eo(t)}).catch(()=>{eo(t)})}function Ek(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function Mp(e){return new Promise((t,r)=>{let n=[];e.on("data",i=>{n.push(i)}),e.on("end",()=>{t(Buffer.concat(n))}),e.on("error",r)})}function eo(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function Ck(e,t){e.resourceSpans.flatMap(r=>r.scopeSpans).flatMap(r=>r.spans).forEach(r=>{t({attributes:Ak(r.attributes),durationMs:Number((BigInt(r.endTimeUnixNano)-BigInt(r.startTimeUnixNano))/1000000n),kind:"span",name:r.name,parentSpanId:r.parentSpanId,source:"server",spanId:r.spanId,spanKind:Ip(r.kind),status:{code:Pp(r.status?.code??0),message:r.status?.message},timeNanos:r.startTimeUnixNano,traceId:r.traceId})})}function Ak(e){return Object.fromEntries(e.map(({key:t,value:r})=>[t,String(r.stringValue??r.intValue??r.doubleValue??r.boolValue??"")]))}function Ik(e){return new Promise((t,r)=>{e.close(n=>{if(n==null){t();return}r(n)}),e.closeAllConnections()})}function Et(e){let t=new URL(e,"https://ripplo.invalid"),r=[...t.searchParams.entries()].toSorted(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${n}=${i}`).join("&");return r.length===0?t.pathname:`${t.pathname}?${r}`}function Mr(e,t){return e==="url"?Et(t):t}function Ga(e,t,r){return Mr(e,String(t))===Mr(e,String(r))}function Lp(e,t,r){return e!=="url"?Ga(e,t,r):Np(String(t))===Np(String(r))}function Np(e){return new URL(e,"https://ripplo.invalid").pathname}function Ha({actual:e,canon:t,pre:r,predicted:n}){return[...[...new Set([...n.entities.keys(),...e.entities.keys()])].flatMap(s=>Pk({actual:e.entities.get(s),canon:t,entity:s,pre:r.entities.get(s),predicted:n.entities.get(s)})),...Mk(r.singletons,n.singletons,e.singletons)]}function Pk({actual:e,canon:t,entity:r,pre:n,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>Tk({actual:e?.get(s),canon:t,entity:r,key:s,predicted:i?.get(s),preHadKey:n?.has(s)??!1,preRow:n?.get(s)}))}function Tk({actual:e,canon:t,entity:r,key:n,predicted:i,preHadKey:o,preRow:s}){if(i==null)return[{divergence:{entity:r,key:n,kind:"ghost-write"},pending:o}];if(e==null)return[{divergence:{entity:r,key:n,kind:"absent"},pending:!o}];let a=(u,c,d)=>_p(t(r,u,c),t(r,u,d));return[...new Set([...Object.keys(i),...Object.keys(e)])].filter(u=>!a(u,i[u],e[u])).map(u=>({divergence:{entity:r,field:u,key:n,kind:"field-mismatch",snapshot:i[u],sut:e[u]},pending:s==null?e[u]===void 0:a(u,s[u],e[u])}))}function _p(e,t){return $p(e)===$p(t)}function $p(e){return e==null?"\u2205":JSON.stringify(e)}function Mk(e,t,r){return[...new Set([...Object.keys(t),...Object.keys(r)])].flatMap(i=>{let o=t[i],s=r[i];return o===void 0||s===void 0||Dp(i,o,s)?[]:[{divergence:{kind:"singleton-mismatch",singleton:i,snapshot:o,sut:s},pending:e[i]!==void 0&&Dp(i,e[i],s)}]})}function Dp(e,t,r){let n=Rt.safeParse(e);return n.success?Lp(n.data,t,r):_p(t,r)}function qa(e){let t=Ok(e.entities),r=Nk(e.singletons);return n=>Lk(n,t,r)}function Ok(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([r,n])=>[Fp(t.name,r),n.consistency])))}function Fp(e,t){return`${e}.${t}`}function Nk(e){return new Map(e.map(t=>[t.name,t.consistency]))}function Lk(e,t,r){return e.kind==="singleton-mismatch"?$k(e.singleton,r):e.kind==="ghost-write"||e.kind==="absent"?"strict":t.get(Fp(e.entity,e.field))??"strict"}function $k(e,t){return Rt.safeParse(e).success?t.get(e)??"eventual":t.get(e)??"strict"}function Ka(e){let t=new Set(e.valueSpaces.filter(r=>r.generator==="date.iso").map(r=>r.name));return(r,n,i)=>{if(!t.has(`${r}.${n}`)||typeof i!="string")return i;let o=Date.parse(i);return Number.isNaN(o)?i:new Date(o).toISOString()}}function Vp(e,t,r){return{detail:r.slice(0,500),kind:"engine-http",path:e,status:t}}function to(e,t){return{code:Yp(t),kind:"engine-network",message:vn(t),path:e}}function Bp(e){return{kind:"client-mount-missing",mountKey:e}}function Up(e,t){return{kind:"engine-decode",message:vn(t),path:e}}function Wp(e,t){return{entity:e,field:t,kind:"state-identity"}}function zp(e){return{as:e,kind:"setup-missing-row"}}function wn(e){return{kind:"driver-launch",message:vn(e)}}function Gp(e,t){return{action:e,kind:"action-failed",message:vn(t)}}function Hp(e){return{kind:"check-failed",message:vn(e)}}function qp(){return{kind:"aborted"}}var jp=300;function Ct(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${Dk(e.detail)}${_k(e.status)}`;case"engine-network":return`engine ${e.path} request failed: ${e.message}`;case"client-mount-missing":return`client bridge "${e.mountKey}" never mounted; client singletons unreadable`;case"engine-decode":return`engine ${e.path} response did not match schema: ${e.message}`;case"state-identity":return`row of "${e.entity}" is missing identity field "${e.field}"`;case"setup-missing-row":return`setup returned no row for "${e.as}"`;case"driver-launch":return`browser driver failed to launch: ${e.message}`;case"action-failed":return`action "${e.action}" failed: ${e.message}`;case"check-failed":return`check failed: ${e.message}`;case"aborted":return"run aborted"}}function Kp(e){throw new Error(Ct(e))}function ro(){}function Dk(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=jp?t:`${t.slice(0,jp)}\u2026 [truncated]`}function _k(e){return e===404?" \u2014 the engine adapter is not mounted at RIPPLO_ENGINE_URL (or the mount path differs). Verify the adapter is wired into the app server and ENABLE_RIPPLO_TESTING=true; `ripplo doctor` checks the endpoint.":e===403||e===401?" \u2014 the adapter rejected the request: ENABLE_RIPPLO_TESTING is not true in the app's env, or RIPPLO_WEBHOOK_SECRET differs between the app and .ripplo env.":""}function Yp(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?Yp(e.cause):void 0}function vn(e){return e instanceof Error?e.message:String(e)}var Qa=Pi(Qp(),1),cU=Qa.default.configure,no=Qa.default;function J(e){return no(e)??""}function At(e,t){return[...new Map(e.map(r=>[t(r),r])).values()]}function el(e){return At(e,J)}function eh(e){return J(e)}var Rn=class extends Error{name="AbortError";constructor(){super("aborted")}};function th(e){return e instanceof Error&&e.name==="AbortError"}function Ht(e){if(e.aborted)throw new Rn}function tl(e,t){return t.aborted?Promise.reject(new Rn):new Promise((r,n)=>{let i=()=>{clearTimeout(o),n(new Rn)},o=setTimeout(()=>{t.removeEventListener("abort",i),r()},e);t.addEventListener("abort",i,{once:!0})})}function ah(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var Gk=()=>[];async function il({canon:e,classify:t,initialSnapshot:r,lawObligations:n,observe:i,onAssertion:o,onStep:s,steps:a},l){return lh({acc:[],canon:e,classify:t,index:0,lawObligations:n??Gk,observe:i,onAssertion:o,onStep:s,signal:l,snapshot:r,steps:a})}async function lh({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,steps:c}){Ht(l);let d=c[n];if(d==null)return{finalModel:u,findings:e};let p=Date.now();if(!d.guard(u)){let h={kind:"illegal-transition",step:d.step};return rl(a,{endMs:Date.now(),findings:[h],index:n,post:u,pre:u,startMs:p,url:nl(u)}),{finalModel:u,findings:[...e,h]}}return d.perform().match(()=>Hk({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,startMs:p,step:d,steps:c}),h=>{let f=io(h,d);return rl(a,{endMs:Date.now(),findings:[f],index:n,post:u,pre:u,startMs:p,url:nl(u)}),Promise.resolve({finalModel:u,findings:[...e,f]})})}async function Hk({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,startMs:c,step:d,steps:p}){let h=d.effect(u),f=await Qk({canon:t,classify:r,observe:o,pre:u,predicted:h,signal:l,step:d}),m=[...d.obligations,...i(u,f.snapshot)],g=[...await qk({obligations:m,onAssertion:s,signal:l,step:d}),...f.findings];return rl(a,{endMs:Date.now(),findings:g,index:n,post:f.snapshot,pre:u,startMs:c,url:nl(f.snapshot)}),lh({acc:[...e,...g],canon:t,classify:r,index:n+1,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:f.snapshot,steps:p})}async function qk({obligations:e,onAssertion:t,signal:r,step:n}){let i=[...new Map(e.map(s=>[eh(s.source),s])).values()],o=await Promise.all(i.map(async s=>({obligation:s,outcome:await Kk(s,r)})));return o.forEach(s=>{Yk(t,s.obligation,s.outcome,n)}),o.flatMap(s=>Zk(s.obligation,s.outcome,n))}function Kk(e,t){if(e.check.kind==="decided"){let r=e.check.passed?"passed":"failed";return Promise.resolve({kind:r})}return eE(e.budget,e.check.run,t)}function Yk(e,t,r,n){e?.({outcome:Jk(r),source:t.source,step:n.step})}function Jk(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function Zk(e,t,r){return t.kind==="error"?[io(t.error,r)]:t.kind==="failed"?[{budget:e.budget,kind:"obligation",source:e.source,step:r.step}]:[]}function io(e,t){return{error:e,kind:"driver-error",step:t.step}}function rl(e,t){e?.(t)}function nl(e){let t=e.singletons.url;return typeof t=="string"?t:null}var kn={async:12e4,fast:5e3,slow:3e4},uh={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:kn.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:kn.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:kn.slow}};function ch(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function rh(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function Xk(e,t,r){return r.reconcile==null?e:r.reconcile(e,t)}function nh({canon:e,pre:t,predicted:r,step:n},i){let o=n.verifyChanges==null?[]:n.verifyChanges(r,i),s=Xk(r,i,n),a=o.map(l=>({divergence:l,pending:!0}));return{adopted:s,probed:[...a,...Ha({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function dh(e,t){return{budget:t.settle,divergence:e.divergence,kind:"consistency",pending:e.pending,step:t.step}}function ih(e,t,r){let n=e.probed.filter(i=>!i.pending&&r(i.divergence)==="strict");return n.length>0?{findings:n.map(i=>dh(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function oh(e,t,r){return{findings:[...e.probed.map(n=>dh(n,t)),...r],snapshot:e.adopted}}async function Qk({canon:e,classify:t,observe:r,pre:n,predicted:i,signal:o,step:s}){let a=uh[s.settle],l=Date.now()+a.timeoutMs,u=await rh(r);if(!u.ok)return{findings:[io(u.error,s)],snapshot:i};let c=nh({canon:e,pre:n,predicted:i,step:s},u.observed),d=0;for(;Date.now()<l;){Ht(o);let p=ih(c,s,t);if(p!=null)return p;await tl(ch(a,d),o),d+=1;let h=await rh(r);if(!h.ok)return oh(c,s,[io(h.error,s)]);c=nh({canon:e,pre:n,predicted:i,step:s},h.observed)}return ih(c,s,t)??oh(c,s,[])}async function eE(e,t,r){let n=uh[e],i=Date.now()+n.timeoutMs,o=await sh(t),s=0;for(;o.kind==="pending"&&Date.now()<i;)Ht(r),await tl(ch(n,s),r),s+=1,o=await sh(t);return o.kind==="pending"?{kind:"failed"}:o}function sh(e){return e().match(t=>t?{kind:"passed"}:{kind:"pending"},t=>({error:t,kind:"error"}))}import{z as tE}from"zod";var sl=tE.string().brand(),ee=sl.parse("");function It(e){return sl.parse(e)}function qe(e,t){return sl.parse(e.length===0?t:`${e}.${t}`)}function Ie(e){return Ar.safeParse(e).success}function mt(e){return typeof e=="object"&&e!==null&&"template"in e}function ol(e,t,r){let n=qe(t,e.ref);if(!r.has(n))throw new Error(`unresolved binding ref "${n}"`);return r.get(n)??null}function oo(e,t,r){return rE(e).every(n=>r.has(qe(t,n)))}function nt(e,t,r){return typeof e=="string"?e:Ie(e)?String(ol(e,t,r)):e.template.map(n=>typeof n=="string"?n:String(ol(n,t,r))).join("")}function it(e,t,r){return e===null||typeof e=="number"||typeof e=="boolean"?e:Ie(e)?ol(e,t,r):nt(e,t,r)}function fh(e,t){return it(e,ee,t)}function En(e){return no(e)}function Or(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,it(i,t,r)]))}function rE(e){return e==null||typeof e!="object"?[]:mt(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}function qt(e){return typeof e=="object"&&e!==null&&"kind"in e}function dr(e){return Object.fromEntries(Object.entries(e).filter(t=>!qt(t[1])))}function ph(e,t,r){return t.reduce((n,i)=>nE(n,i,r,e),e)}function hh(e,t){return Object.keys(t).length===0?e:{...e,singletons:{...e.singletons,...t}}}function nE(e,t,r,n){if(!iE(t,r))return e;if(t.assertion.kind==="created"){let o=Or(t.assertion.props,ee,r);return oE(e,t.entity,En(o),o)}if(t.assertion.kind==="deleted")return al(e,t.entity,uE(t.key,r,n));let i=Or(dr(t.assertion.props),ee,r);return al(e,t.entity,cE(t.key,i,r,n))}function iE(e,t){return("props"in e.assertion?[e.key,dr(e.assertion.props)]:[e.key]).every(n=>Object.values(n).every(i=>yh(i)||!Ie(i)||t.has(It(i.ref))))}function oE(e,t,r,n){let i=new Map([...e.entities.get(t)??[],[r,n]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function al(e,t,r){let n=r(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,n]])}}function Cn(e,t,r,n){let i={env:n,key:r,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>ao(o,i))}function mh(e,t,r,n,i){let o={env:n,key:r,snapshot:e};return al(e,t,s=>new Map([...s].map(([a,l])=>[a,ao(l,o)?i(l):l])))}function ao(e,t){return Object.entries(t.key).every(([r,n])=>gh(e[r],n,t))}function gh(e,t,r){return yh(t)?sE(t,r).has(so(e)):so(e)===so(lE(t,r.env))}function yh(e){return typeof e=="object"&&e!==null&&"kind"in e}function sE(e,t){let r=t.snapshot.entities.get(e.selection.entity);return r==null?new Set:new Set([...r.values()].filter(n=>aE(n,e.selection.where,t)).map(n=>so(n[e.field])))}function aE(e,t,r){return Object.entries(t).every(([n,i])=>gh(e[n],i,r))}function so(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function lE(e,t){return it(e,ee,t)}function uE(e,t,r){let n={env:t,key:e,snapshot:r};return i=>new Map([...i].filter(([,o])=>!ao(o,n)))}function cE(e,t,r,n){let i={env:r,key:e,snapshot:n};return o=>new Map([...o].map(([s,a])=>ao(a,i)?[s,{...a,...t}]:[s,a]))}function wh(e){let t=e.predicates.filter(o=>kh(o)),r=t.filter(o=>o.assertion.kind==="created"),n=Rh(t);if(r.length===0&&n.length===0&&e.deferred.length===0&&e.adopt.length===0)return;let i=t.filter(o=>o.assertion.kind==="updated");return(o,s)=>{let a=r.reduce((c,d)=>yE(c,s,d,e.env),{env:e.env,snapshot:o}),l=n.reduce((c,d)=>gE(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>fE(c,s,d),a.env);return dE(SE(l,e.deferred,u),s,e.adopt)}}function dE(e,t,r){if(r.length===0)return e;let n=r.reduce((i,o)=>{let s=t.snapshot.singletons[o];return s===void 0?i:{...i,[o]:s}},e.singletons);return{...e,singletons:n}}function vh(e,t,r){return new Map([...e,...Object.entries(r).map(([n,i])=>[qe(ee,`${t}.${n}`),i])])}function fE(e,t,r){let n=Cn(t.snapshot,r.entity,r.key,e).at(0);return n==null?e:vh(e,r.assertion.as,n)}function xh(e){let t=Rh(e.predicates.filter(r=>kh(r)));if(t.length!==0)return(r,n)=>t.flatMap(i=>pE(i,r,n,e.env))}function Rh(e){return e.filter(t=>t.assertion.kind==="updated"&&ll(t.assertion.props).length>0)}function ll(e){return Object.entries(e).filter(([,t])=>qt(t)).map(([t])=>t)}function kh(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function pE(e,t,r,n){let i=Cn(t,e.entity,e.key,n).at(0),o=Cn(r.snapshot,e.entity,e.key,n).at(0);if(i==null||o==null)return[];let s=En(hE(e.key,n));return ll(e.assertion.props).flatMap(a=>bh(i[a])===bh(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function hE(e,t){let r=Object.fromEntries(Object.entries(e).filter(n=>!mE(n[1])));return Or(r,ee,t)}function mE(e){return typeof e=="object"&&e!==null&&"kind"in e}function bh(e){return e==null?"\u2205":JSON.stringify(e)}function gE(e,t,r,n){let i=ll(r.assertion.props),o=Cn(t.snapshot,r.entity,r.key,n).at(0);return o==null?e:mh(e,r.entity,r.key,n,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function yE(e,t,r,n){if(r.assertion.kind!=="created")return e;let i=Or(r.assertion.props,ee,n),o=En(i),s=e.snapshot.entities.get(r.entity);if(s==null||!s.has(o))return e;let a=bE(t.snapshot.entities.get(r.entity),s,i);if(a==null)return e;let[l,u]=a,c=new Map(s);return c.delete(o),c.set(l,u),{env:vh(e.env,r.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(r.entity,c)}}}function bE(e,t,r){if(e!=null)return[...e].find(([n,i])=>!t.has(n)&&Object.entries(r).every(([o,s])=>Sh(i[o])===Sh(s)))}function Sh(e){return e==null?"\u2205":JSON.stringify(e)}function SE(e,t,r){let n=t.reduce((i,o)=>{let s=wE(o.value,r);return s==null?i:{...i,[o.name]:Mr(o.name,s)}},e.singletons);return{...e,singletons:n}}function wE(e,t){try{return nt(e,ee,t)}catch{return}}function lo(e,t){if(e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused")return{kind:e.kind,locator:An(e.locator,t)};if(e.kind==="not"){let r=lo(e.predicate,t);return r==null?null:{inner:r,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:An(e.locator,t),value:nt(e.value,ee,t)}:e.kind!=="browser"?null:{kind:"browser",name:e.name,value:nt(e.value,ee,t)}}function In(e,t){let r=e.expect.filter(l=>l.kind==="state"),n=AE(r),{adopt:i,conditional:o,deferred:s,immediate:a}=RE(e,t,n);return{action:IE(e.action,t),label:e.action.kind,obligations:e.expect.flatMap(l=>TE(l,t)),reconcile:wh({adopt:i,deferred:s,env:t,predicates:r}),verifyChanges:xh({adopt:i,deferred:s,env:t,predicates:r}),effect:l=>{let u=ph(l,r,t),c=o.reduce((d,p)=>({...d,...ul(p,u,t)}),{});return hh(u,{...a,...c})}}}function An(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:nt(e.name,ee,t),role:e.role}:e.by==="inside"?{by:"inside",scope:An(e.scope,t),target:An(e.target,t)}:{by:"testId",value:nt(e.value,ee,t)}}function ul(e,t,r){return e==null?{}:e.kind==="when"?cl(e.condition,t,r)?ul(e.consequence,t,r):ul(e.otherwise,t,r):xE(e,r)}function cl(e,t,r){if(!vE(e))throw new Error(`when() condition cannot be a "${e.kind}" predicate`);switch(e.kind){case"singleton":return t.singletons[e.singleton]===it(e.assertion.value,ee,r);case"count":return(t.entities.get(e.entity)?.size??0)===e.value;case"not":return!cl(e.predicate,t,r);case"and":return e.predicates.every(n=>cl(n,t,r))}}function vE(e){return e.kind==="singleton"||e.kind==="count"||e.kind==="not"||e.kind==="and"}function xE(e,t){if(e.kind!=="browser"&&e.kind!=="singleton")return{};let r=e.kind==="browser"?e.value:e.assertion.value;return oo(r,ee,t)?Eh(e,t):{}}function RE(e,t,r){let n=e.action.kind==="goto"&&!e.expect.some(s=>s.kind==="browser"&&s.name==="url"),i=e.action.kind==="goto"&&!n?{url:Et(nt(e.action.url,ee,t))}:{},o=n?["url"]:[];return e.expect.reduce((s,a)=>a.kind==="browser"&&kE(a.value,r)?{...s,deferred:[...s.deferred,{name:a.name,value:a.value}]}:a.kind==="browser"||a.kind==="singleton"?{...s,immediate:{...s.immediate,...Eh(a,t)}}:a.kind==="when"?{...s,conditional:[...s.conditional,a]}:s,{adopt:o,conditional:[],deferred:[],immediate:i})}function kE(e,t){return EE(e).some(r=>t.has(r.split(".")[0]??r))}function EE(e){return typeof e=="string"?[]:Ie(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function Eh(e,t){if(e.kind==="browser")return{[e.name]:CE(e,t)};if(e.kind==="singleton")return{[e.singleton]:it(e.assertion.value,ee,t)};throw new Error("when() consequence must be a url (browser) or singleton assertion")}function CE(e,t){return Mr(e.name,nt(e.value,ee,t))}function AE(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function IE(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:PE(e,t),url:e.kind==="goto"?nt(e.url,ee,t):void 0,value:"value"in e?fh(e.value,t):void 0}}function PE(e,t){if(!(!("locator"in e)||e.locator==null))return An(e.locator,t)}function TE(e,t){if(e.kind==="browser"||e.kind==="singleton")return[];let r=lo(e,t),n="wait"in e?e.wait??"fast":"fast";return r==null?[]:[{budget:n,check:r}]}import{err as ME,ok as OE,okAsync as NE,Result as LE}from"neverthrow";function Pn(e,t,r){let n=e.tests.find(a=>a.name===t);if(n==null)throw new Error(`test "${t}" not found in lockfile`);let i=BE(e),o={env:new Map,generate:r.generate,generatedParams:new Set,indexed:i,overrides:new Map(Object.entries(r.params??{}).map(([a,l])=>[It(a),l]))};UE(n.params,ee,o);let s=n.world.map(a=>WE(a,ee,o));return r.materialize(s).map(a=>$E({base:qE(a,o.env,i),generatedParams:o.generatedParams,lockfile:e,test:n}))}function fl(e,t){let r=new Map(t.map(n=>[n.name,n]));return n=>NE(FE(n,e,r).rows)}function pl(e){return t=>{let r=t.map(n=>({as:n.as,entity:n.entity,fields:n.fields}));return e(r).andThen(n=>_E(t,n))}}function Ch(e,t){let r=uo(t);return Object.fromEntries(Object.entries(e).filter(([n,i])=>r.includes(n)&&i!=null))}function uo(e){return Object.entries(e.props).filter(([,t])=>t.stable).map(([t])=>t)}function $E({base:e,generatedParams:t,lockfile:r,test:n}){let i=Object.fromEntries(r.singletons.map(c=>[c.name,c.default])),o=Object.fromEntries(Object.entries(n.singletons).map(([c,d])=>[c,it(d,ee,e.env)])),s=Object.entries(n.singletons).filter(([,c])=>DE(c,t)).map(([c])=>c),a={...i,...o},l=new Set(r.singletons.filter(c=>c.source==="client").map(c=>c.name)),u=Object.fromEntries(Object.entries(a).filter(([c])=>l.has(c)));return{...e,clientState:u,generatedSingletons:s,snapshot:{...e.snapshot,singletons:a}}}function DE(e,t){return Ie(e)?t.has(qe(ee,e.ref)):mt(e)?e.template.some(r=>typeof r!="string"&&t.has(qe(ee,r.ref))):!1}function _E(e,t){let r=new Map(t.map(n=>[n.as,n]));return LE.combine(e.map(n=>{let i=r.get(n.as);return i==null?ME(zp(n.as)):OE({as:n.as,entity:n.entity,generatedFields:n.generatedFields,row:i.row,session:i.session})}))}function FE(e,t,r){return e.reduce((n,i)=>{let o=jE(i.fields,n.env),s=YE({generate:t,model:i.model,seedPrefix:i.seedPrefix,set:o,valueSpaces:r}),a=Object.entries(s).map(([u,c])=>[`${i.as}.${u}`,c]),l=Object.keys(s).filter(u=>!(u in o));return{env:new Map([...n.env,...a]),rows:[...n.rows,{as:i.as,entity:i.entity,generatedFields:[...new Set([...i.generatedFields,...l])],row:s,session:void 0}]}},{env:new Map,rows:[]})}function jE(e,t){return Object.fromEntries(Object.entries(e).map(([r,n])=>{if(Ie(n))return[r,VE(t,n.ref)];if(mt(n))throw new Error(`template value not allowed in entity field "${r}"`);return[r,n]}))}function VE(e,t){let r=e.get(t);if(r==null)throw new Error(`setup ref "${t}" was not produced by an earlier entity`);return r}function BE(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function UE(e,t,r){Object.entries(e).forEach(([n,i])=>{let o=qe(t,n),s=r.indexed.valueSpaces.get(i.valueSpace);if(s==null)throw new Error(`unknown valueSpace "${i.valueSpace}" for param "${o}"`);let a=r.overrides.get(o)??i.example;a==null&&r.generatedParams.add(o);let l=a??r.generate.value({anchor:void 0,constraints:s.constraints,generator:s.generator,nullable:!1,seed:o,type:s.type,values:s.values,valueSpace:i.valueSpace});r.env.set(o,l)})}function WE(e,t,r){let n=r.indexed.models.get(e.entity);if(n==null)throw new Error(`model "${e.entity}" not found for setup "${e.as}"`);let i=qe(t,e.as),o=zE(e.set,t,r.env),s=HE(n,o,i,r),a=Object.entries(e.set).filter(([,l])=>Ie(l)&&r.generatedParams.has(qe(t,l.ref))).map(([l])=>l);return{as:i,entity:e.entity,fields:{...s,...o},generatedFields:[...Object.keys(s),...a],model:n,seedPrefix:i}}function zE(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,GE(i,t,r)]))}function GE(e,t,r){if(!Ie(e))return e;let n=qe(t,e.ref);return r.get(n)??{ref:n}}function HE(e,t,r,n){return Object.fromEntries(Object.entries(e.props).filter(([i,o])=>!o.optional&&!e.identity.includes(i)&&!(i in t)).map(([i,o])=>[i,Ah({field:i,generate:n.generate,model:e,seedPrefix:r,spec:o,valueSpaces:n.indexed.valueSpaces})]))}function qE(e,t,r){let n=new Map,i=e.flatMap(a=>{let l=r.models.get(a.entity);if(l==null)throw new Error(`model "${a.entity}" not found for setup "${a.as}"`);Object.entries(a.row).forEach(([c,d])=>t.set(qe(It(a.as),c),d));let u=n.get(a.entity)??new Map;return u.set(dl(a.row,l),Ch(a.row,l)),n.set(a.entity,u),a.session==null?[]:[a.session]}),o=e.flatMap(a=>{let l=r.models.get(a.entity);return l==null?[]:[{alias:a.as,entity:a.entity,key:dl(a.row,l)}]}),s=e.flatMap(a=>{let l=r.models.get(a.entity);if(l==null)return[];let u=dl(a.row,l);return a.generatedFields.map(c=>({entity:a.entity,field:c,key:u}))});return{aliases:o,auth:KE(i),env:t,generated:s,snapshot:{entities:JE(n),singletons:{}}}}function KE(e){if(e.length===0)return;let t=e.flatMap(r=>Object.entries(r.headers??{}));return{cookies:e.flatMap(r=>r.cookies),headers:t.length===0?void 0:Object.fromEntries(t),origins:e.flatMap(r=>r.origins)}}function YE({generate:e,model:t,seedPrefix:r,set:n,valueSpaces:i}){return{...Object.fromEntries(Object.entries(t.props).filter(([s])=>!(s in n)).map(([s,a])=>[s,Ah({field:s,generate:e,model:t,seedPrefix:r,spec:a,valueSpaces:i})])),...n}}function Ah({field:e,generate:t,model:r,seedPrefix:n,spec:i,valueSpaces:o}){let s=`${r.name}.${e}`;return t.value({anchor:void 0,constraints:o.get(s)?.constraints,generator:o.get(s)?.generator??"lorem.word",nullable:i.optional,seed:qe(n,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function dl(e,t){return t.identity.map(r=>String(e[r])).join(":")}function JE(e){return new Map([...e].map(([t,r])=>[t,new Map(r)]))}function gt(e){return`${e.test}#${String(e.index)}`}function Nr(e){let t=e.tests.flatMap(r=>co(e,r.name));return At(t,r=>`${r.test}:${J(r.steps)}`)}function co(e,t){let r=Lh(e,t),n=Th(r,e),i=Ih(n,r.singletons),o=SC(r,bC(e));return ZE(i,wC(r.steps),n).map(({chunk:a,guard:l},u)=>gC({chunk:a,guard:l,index:u,intent:r.intent,namespace:n.namespace,paramSpaceOf:o,testName:t}))}function Ih(e,t){return{absences:hC(e),entities:mC(e),exclusives:e.exclusives,optionals:Nh(e.optionals,e),singletons:Object.fromEntries(Object.entries(t).filter(([,r])=>!Ie(r)&&!mt(r)))}}function fo(e,t,r){return Object.values(e).flatMap(n=>Ie(n)?ml(n.ref,r):[]).find(n=>n.entity===t)?.aliasPath}function ZE(e,t,r){return t.reduce((n,i)=>({guard:XE(n.guard,i,r),guarded:[...n.guarded,{chunk:i,guard:cC(n.guard,i)}]}),{guard:e,guarded:[]}).guarded}function XE(e,t,r){let n=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>QE(i,o,r),e);return{...n,singletons:{...n.singletons,...aC(t)}}}function QE(e,t,r){return t.assertion.kind==="deleted"?eC(e,t,r):t.assertion.kind==="created"?nC(e,t.entity,t.assertion.as,t.assertion.props,r):oC(e,t,r)}function eC(e,t,r){let n=fo(t.key,t.entity,r.namespace),i=e.entities.find(a=>a.alias===n),o=Tn(tC(t.key),t.entity,r),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...rC(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==n)}}function tC(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let r=t[1];return Oh(r)?[]:[[t[0],r]]}))}function rC(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(r=>!t.relations.some(n=>n.field===r.field)),...t.relations]}}function nC(e,t,r,n,i){let o=Tn(n,t,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!iC(o,s)),entities:[...e.entities,{alias:r,entity:t,...o}]}}function iC(e,t){return Object.entries(t.literals).every(([n,i])=>e.literals[n]===i)&&t.relations.every(n=>e.relations.some(i=>i.field===n.field&&i.targetAlias===n.targetAlias&&i.targetField===n.targetField))}function oC(e,t,r){if(t.assertion.kind!=="updated")return e;let n=fo(t.key,t.entity,r.namespace);if(n==null)return e;let i=Tn(dr(t.assertion.props),t.entity,r),o=Object.entries(t.assertion.props).filter(([,a])=>qt(a)).map(([a])=>a),s=a=>a.alias===n?sC(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a)),optionals:e.optionals.map(a=>s(a))}}function sC(e,t,r){let n=Object.entries(e.literals).filter(([i])=>!r.includes(i)&&!(i in t.literals));return{...e,literals:{...Object.fromEntries(n),...t.literals},relations:[...e.relations.filter(i=>!t.relations.some(o=>o.field===i.field)),...t.relations]}}function aC(e){return e.reduce((t,r)=>({...t,...lC(r),...uC(r)}),{})}function lC(e){return e.action.kind==="goto"?{url:e.action.url}:{}}function uC(e){return Object.fromEntries(e.expect.flatMap(t=>t.kind==="browser"?[[t.name,t.value]]:t.kind==="singleton"?[[t.singleton,t.assertion.value]]:[]))}function cC(e,t){return t[0]?.action.kind!=="goto"?e:{...e,singletons:Object.fromEntries(Object.entries(e.singletons).filter(([r])=>r!=="url"))}}function po(e,t){let r=Lh(e,t),n=Th(r,e);return{guard:Ih(n,r.singletons),namespace:n.namespace,stable:n.stable}}function Ph(e,t){return[...new Set(e)].flatMap(r=>ml(r,t))}function ot(e){return Ie(e)?[e.ref]:mt(e)?e.template.flatMap(t=>Ie(t)?[t.ref]:[]):[]}function Kt(e){switch(e.kind){case"visible":case"disabled":case"enabled":case"focused":return Yt(e.locator);case"value":case"text":return[...Yt(e.locator),...ot(e.value)];case"singleton":return ot(e.assertion.value);case"browser":return ot(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(dr(e.assertion.props)).flatMap(t=>ot(t)),...Object.values(e.key).flatMap(t=>Mh(t))];case"not":return Kt(e.predicate);case"when":return[...Kt(e.condition),...Kt(e.consequence),...e.otherwise==null?[]:Kt(e.otherwise)];case"and":return e.predicates.flatMap(t=>Kt(t));case"count":return[]}}function Th(e,t){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map([...e.world,...e.maybe].map(r=>[r.as,r.entity])),optionals:e.maybe,setups:e.world,stable:dC(t)}}function dC(e){let t=new Map(e.entities.map(r=>[r.name,r]));return(r,n)=>t.get(r)?.props[n]?.stable===!0}function Yt(e){return e.by==="inside"?[...Yt(e.scope),...Yt(e.target)]:e.by==="role"?e.name==null?[]:ot(e.name):ot(e.value)}function Mh(e){return Oh(e)?Object.values(e.selection.where).flatMap(t=>Mh(t)):ot(e)}function Oh(e){return typeof e=="object"&&e!==null&&"kind"in e}function fC(e){return e.kind==="goto"?ot(e.url):e.kind==="fill"||e.kind==="select"?[...Yt(e.locator),...ot(e.value)]:e.kind==="press"?e.locator==null?[]:Yt(e.locator):(e.kind==="upload",Yt(e.locator))}function pC(e){return[...fC(e.action),...e.expect.flatMap(t=>Kt(t))]}function hC(e){return e.absences.map(t=>({entity:t.entity,...Tn(t.where,t.entity,e)}))}function Tn(e,t,r){let n=Object.entries(e).filter(([s])=>r.stable(t,s)),i=Object.fromEntries(n.flatMap(([s,a])=>Ie(a)||mt(a)?[]:[[s,a]])),o=n.flatMap(s=>{let a=s[1];if(!Ie(a))return[];let l=ml(a.ref,r.namespace).at(0);return l==null?[]:[{entity:l.entity,field:s[0],targetAlias:l.aliasPath,targetField:l.field}]});return{literals:i,relations:o}}function Nh(e,t){return e.map(r=>({alias:r.as,entity:r.entity,...Tn(r.set,r.entity,t)}))}function mC(e){return Nh(e.setups,e)}function gC(e){let t=e.chunk.findIndex(s=>s.action.kind!=="goto"),r=t===-1?e.chunk:e.chunk.slice(0,t),n=e.chunk.slice(r.length),i=n.at(-1)??e.chunk.at(-1);if(i==null)throw new Error("empty transition chunk");let o=[...new Set(e.chunk.flatMap(s=>pC(s)))];return{effectStep:i,guard:e.guard,index:e.index,intent:e.intent,namespace:e.namespace,nav:r,paramSpaces:Object.fromEntries(o.filter(s=>e.paramSpaceOf.has(s)).map(s=>[s,e.paramSpaceOf.get(s)])),steps:n,test:e.testName,wait:ah(n.flatMap(s=>yC(s)))}}function yC(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function ml(e,t){let r=e.lastIndexOf(".");if(r===-1)return[];let n=e.slice(0,r),i=t.get(n);return i==null?[]:[{aliasPath:n,entity:i,field:e.slice(r+1),ref:e}]}function Lh(e,t){let r=e.tests.find(n=>n.name===t);if(r==null)throw new Error(`test "${t}" not found in lockfile`);return r}function bC(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function SC(e,t){return new Map(Object.entries(e.params).map(([r,n])=>[r,t.get(n.valueSpace)]))}function wC(e){return hl(e,0,[],[])}function hl(e,t,r,n){let i=e[t];if(i==null)return r.length===0?n:[...n,r];let o=[...r,i];return vC(i)?hl(e,t+1,[],[...n,o]):hl(e,t+1,o,n)}function vC(e){return e.expect.some(t=>t.kind==="state")}function $h(e){return Dh(e,new Map)}function xC(e,t){return e.reduce((r,n)=>r??t(n),null)}function Dh(e,t){let r=e.variables.find(n=>!t.has(n));return r==null?t:xC(e.domain(r),n=>{let i=new Map([...t,[r,n]]);return e.consistent(i)?Dh(e,i):null})}function yt(e,t){let r=RC(e,t);if(r==null)return null;let n=PC(r);return TC(e.singletons,t,n)?n:null}function RC(e,t){let{absences:r,entities:n,exclusives:i,optionals:o}=e,s=new Map(n.map(u=>[u.alias,u])),a=$h({variables:n.map(u=>u.alias),consistent:u=>kC(u)&&EC(n,u)&&AC(r,u,t),domain:u=>jh(s.get(u),t)});if(a==null)return null;let l=Vh(o,a,t);return IC(i,[...n,...o],l,t)?l:null}function kC(e){let t=[...e.values()];return new Set(t).size===t.length}function EC(e,t){return e.every(r=>t.has(r.alias)?r.relations.every(n=>CC(r,n,t)):!0)}function CC(e,t,r){if(!r.has(t.targetAlias))return!0;let n=r.get(t.targetAlias)?.[t.targetField];return n==null?!0:r.get(e.alias)?.[t.field]===n}function AC(e,t,r){return e.every(n=>![...r.entities.get(n.entity)?.values()??[]].some(i=>_h(i,n,t)))}function _h(e,t,r){return Fh(e,t)?t.relations.every(n=>{if(!r.has(n.targetAlias))return!1;let i=r.get(n.targetAlias)?.[n.targetField];return i!=null&&e[n.field]===i}):!1}function Fh(e,t){return Object.entries(t.literals).every(([r,n])=>n===null?e[r]==null:e[r]===n)}function jh(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(r=>Fh(r,e))}function Vh(e,t,r){let n=e.reduce((i,o)=>{if(i.has(o.alias))return i;let s=new Set(i.values()),a=jh(o,r).find(l=>!s.has(l)&&_h(l,o,i));return a==null?i:new Map([...i,[o.alias,a]])},t);return n.size===t.size?n:Vh(e,n,r)}function IC(e,t,r,n){return e.every(i=>{let o=t.filter(a=>a.entity===i&&r.has(a.alias)).length;return(n.entities.get(i)?.size??0)===o})}function PC(e){return new Map([...e].flatMap(([t,r])=>Object.entries(r).flatMap(n=>{let i=n[1];return typeof i=="string"||typeof i=="number"||typeof i=="boolean"?[[It(`${t}.${n[0]}`),i]]:[]})))}function TC(e,t,r){return Object.entries(e).every(([n,i])=>{if(!oo(i,ee,r))return!1;let o=it(i,ee,r),s=t.singletons[n],a=Rt.safeParse(n);return a.success?Ga(a.data,o,s):s===o})}function ho(e,t,r){let n=yt(e.guard,t);return n==null?null:new Map([...n,...Object.entries(r).map(([i,o])=>[It(i),o])])}function mo(e,t){let r=In(e.effectStep,t),n=NC(e,t),i=[...e.nav,...e.steps].map(o=>In(o,t));return{effect:LC(r.effect,n),steps:i.map(o=>({action:o.action,effect:o.effect,obligations:o.obligations,reconcile:o.reconcile,verifyChanges:o.verifyChanges}))}}function gl(e,t,r){return yt(e.guard,r)==null?!1:fr(t(r))!==fr(r)||$C(e)||MC(e)}function MC(e){return[...e.nav,...e.steps].every(t=>t.expect.every(r=>r.kind!=="state"))}var Bh=new WeakMap;function fr(e){let t=Bh.get(e);if(t!=null)return t;let r=J({entities:[...e.entities].map(([n,i])=>[n,[...i]]),singletons:OC(e.singletons)});return Bh.set(e,r),r}function OC(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>t==="url"&&typeof r=="string"?[t,Et(r)]:[t,r]))}function NC(e,t){let r=e.nav.at(-1);return r==null?void 0:In(r,t).action.url}function LC(e,t){if(t==null)return e;let r=Et(t);return n=>{let i=e(n);return{...i,singletons:{...i.singletons,url:r}}}}function $C(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(r=>qt(r)))}function Mn(e,t,r){let n=ho(e,t.snapshot,r);if(n==null)return null;let i=DC(e,n);return i==null||!gl(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function Uh(e,t,r){let n=ho(e,t.snapshot,r);if(n==null)return"guard-unsatisfied";try{return mo(e,n),"no-effect"}catch{return"unresolvable"}}function DC(e,t){try{return mo(e,t)}catch{return null}}function Lr(e,t,r){return e.flatMap((n,i)=>{let o=r(n),s=Mn(n,t,o);return s==null?[]:[{firing:s,idx:i,label:gt(n),params:o}]})}var _C={absences:[],entities:[],exclusives:[],optionals:[],singletons:{}};function On(e){return{..._C,...e}}function yl(e){return FC(e).flatMap(t=>jC(t))}function FC(e){return[...e.reduce((r,n)=>{let i=J([n.when.singletons,n.consequence]);return new Map([...r,[i,[...r.get(i)??[],n]]])},new Map).values()]}function jC(e){if(e.length<2)return[];let t=e.map(o=>new Set(o.when.entities.map(s=>Wh(s)))),[r]=t;if(r==null)return[];let n=[...r].filter(o=>t.every(s=>s.has(o))),i=e.toSorted((o,s)=>o.when.entities.length-s.when.entities.length)[0];return i==null||n.length===i.when.entities.length?[]:VC(i,n,UC(e))}function Wh(e){return J([e.entity,e.literals])}function VC(e,t,r){let n=e.when.entities.filter(s=>t.includes(Wh(s))),i=new Set(n.map(s=>s.alias));if(![...e.refs].every(s=>i.has(s)))return[];let o=On({entities:n.map(s=>BC(s,i)),optionals:e.when.optionals.filter(s=>i.has(s.alias)),singletons:e.when.singletons});return[{consequence:e.consequence,origin:{kind:"generalized",tests:r},refs:e.refs,when:o}]}function BC(e,t){return{...e,relations:e.relations.filter(r=>t.has(r.targetAlias))}}function UC(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function WC(e){return e.flatMap((t,r)=>e.slice(r+1).flatMap(n=>qh(t,n)))}function Hh(e,t){return qh(e,t).length>0}function qh(e,t){let r=zh(e.when,t.when);return!r&&!zh(t.when,e.when)||!GC(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:r?t.when:e.when}]}function zh(e,t){return bl(e.entities,t.entities)&&bl(e.absences,t.absences)&&bl(e.optionals,t.optionals)&&e.exclusives.every(r=>t.exclusives.includes(r))&&zC(e.singletons,t.singletons)}function bl(e,t){let r=new Set(t.map(n=>J(n)));return e.every(n=>r.has(J(n)))}function zC(e,t){return Object.entries(e).every(([r,n])=>J(t[r])===J(n))}function GC(e,t){return e.kind==="not"?Sl(e.predicate,t):t.kind==="not"?Sl(e,t.predicate):HC(e,t)||qC(e,t)}function Sl(e,t){return e.kind===t.kind&&"locator"in e&&"locator"in t&&Kh(e,t)}function Kh(e,t){return"locator"in t&&J(e.locator)===J(t.locator)}function HC(e,t){let r=new Set([e.kind,t.kind]);return r.has("enabled")&&r.has("disabled")&&"locator"in e&&"locator"in t?Kh(e,t):!1}function qC(e,t){let r=Gh(e),n=Gh(t);return r==null||n==null||e.kind!==t.kind?!1:Sl(e,t)&&J(r)!==J(n)}function Gh(e){return e.kind==="value"||e.kind==="text"?e.value:null}function KC(e,t){return e.flatMap(r=>{let n=YC(r),i=new Set(r.guard.absences.map(o=>o.entity));return t.flatMap(o=>JC(r,o,n,i))})}function YC(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(r=>r.kind==="state"&&r.assertion.kind==="deleted"?[r.entity]:[])))}function JC(e,t,r,n){let{source:i,target:o}=t.reference;return!r.has(o)||r.has(i)||n.has(i)?[]:[{invariant:t,source:i,target:o,transition:gt(e)}]}function vl(e){return J({consequence:e.consequence,when:e.when})}function xl(e){let t=[...ZC(e),...aA(e)],r=yl(t).reduce((n,i)=>[...t,...n].some(s=>Hh(i,s))?n:[...n,i],[]);return At([...t,...r],vl)}function Rl(e){return e.kind==="not"?Rl(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="value"||e.kind==="text"}function kl(e,t,r){if(yt(e.when,t)!=null)return null;let n=yt(e.when,r);return n==null?null:uA(e,n)}function ZC(e){return At(e.tests.flatMap(t=>XC(e,t)),vl)}function XC(e,t){let r=po(e,t.name);return t.steps.reduce((n,i)=>({guard:QC(n.guard,i,r),laws:[...n.laws,...sA(i,n.guard,r.namespace,{kind:"test",test:t.name})]}),{guard:r.guard,laws:[]}).laws}function QC(e,t,r){return t.expect.reduce((n,i)=>i.kind==="state"?eA(n,i,r):n,e)}function eA(e,t,r){if(t.assertion.kind==="created"){let o=tA(t.assertion.as,t.entity,t.assertion.props,r);return{...e,entities:[...e.entities,o]}}let n=fo(t.key,t.entity,r.namespace);if(n==null)return e;if(t.assertion.kind==="deleted")return iA(e,n);let i=dr(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===n?wl(o,i,r):o),optionals:e.optionals.map(o=>o.alias===n?wl(o,i,r):o)}}function tA(e,t,r,n){return wl({alias:e,entity:t,literals:{},relations:[]},r,n)}function wl(e,t,r){return Object.entries(t).reduce((n,[i,o])=>{if(mt(o)||!r.stable(e.entity,i))return n;if(Ie(o)){let s=rA(o.ref,i,r.namespace);return{...n,literals:nA(n.literals,i),relations:s==null?n.relations:[...Yh(n.relations,i),s]}}return{...n,literals:{...n.literals,[i]:o},relations:Yh(n.relations,i)}},e)}function rA(e,t,r){let n=e.lastIndexOf(".");if(n===-1)return;let i=e.slice(0,n),o=r.get(i);return o==null?void 0:{entity:o,field:t,targetAlias:i,targetField:e.slice(n+1)}}function nA(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>r!==t))}function Yh(e,t){return e.filter(r=>r.field!==t)}function iA(e,t){let r=[...e.entities,...e.optionals].find(i=>i.alias===t),n=oA(e,t);return r==null?n:{...n,absences:[...n.absences,{entity:r.entity,literals:r.literals,relations:r.relations}]}}function oA(e,t){return{...e,entities:e.entities.filter(r=>r.alias!==t),optionals:e.optionals.filter(r=>r.alias!==t)}}function sA(e,t,r,n){if(e.action.kind!=="goto")return[];let i=e.action.url;return e.expect.filter(o=>Rl(o)).map(o=>Jh({consequence:o,guard:t,namespace:r,origin:n,url:i}))}function Jh({consequence:e,guard:t,namespace:r,origin:n,url:i}){return{consequence:e,origin:n,refs:new Set(Ph([...ot(i),...Kt(e)],r).map(o=>o.aliasPath)),when:{...t,singletons:{...t.singletons,url:i}}}}function aA(e){return At(Nr(e).flatMap(t=>lA(t)),vl)}function lA(e){let t=e.nav.at(-1),r=e.steps[0]?.action,n=r!=null&&"locator"in r?r.locator:void 0;return t==null||t.action.kind!=="goto"||n==null?[]:[Jh({consequence:{kind:"enabled",locator:n,wait:void 0},guard:e.guard,namespace:e.namespace,origin:{intent:e.intent,kind:"trigger",test:e.test},url:t.action.url})]}function uA(e,t){try{let r=lo(e.consequence,t);return r==null?null:{check:r}}catch{return null}}function El(e){return el(e.tests.flatMap(t=>cA(e,t.name)))}function Cl(e,t){return yt(e.when,t)==null?!1:yt(e.holds,t)==null}function cA(e,t){let r=po(e,t);return r.guard.entities.flatMap(n=>n.relations.flatMap(i=>dA(e,n,i,r.namespace)?hA(n,i,r.namespace):[]))}function dA(e,t,r,n){let i=n.get(r.targetAlias);return i!=null&&!fA(e,t.entity,r.field)&&pA(e,i,r.targetField)}function fA(e,t,r){return e.entities.find(n=>n.name===t)?.props[r]?.optional===!0}function pA(e,t,r){return e.entities.find(n=>n.name===t)?.identity.includes(r)===!0}function hA(e,t,r){let n=r.get(t.targetAlias);if(n==null)return[];let i=Zh(e.alias,e.entity),o=Zh(t.targetAlias,n);return[{holds:On({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:n,targetField:t.targetField},when:On({entities:[i]})}]}function Zh(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function Xh(e,t){let r=[...t.entities].flatMap(([o,s])=>[...s].map(([a,l])=>mA({entity:o,key:a,pre:e,row:l}))),n=[...e.entities].flatMap(([o,s])=>[...s].flatMap(([a,l])=>gA({entity:o,key:a,post:t,row:l}))),i=Object.entries(t.singletons).map(([o,s])=>({changed:e.singletons[o]!==s,name:o,value:s}));return{rows:[...r,...n],singletons:i}}function mA({entity:e,key:t,pre:r,row:n}){let i=yA(r.entities.get(e),t),o=Object.entries(n).map(([s,a])=>({changed:i==null||i[s]!==a,field:s,value:a}));return{changed:i==null||o.some(s=>s.changed),entity:e,fields:o,key:t,status:i==null?"created":"present"}}function gA({entity:e,key:t,post:r,row:n}){if(r.entities.get(e)?.has(t)===!0)return[];let i=Object.entries(n).map(([o,s])=>({changed:!1,field:o,value:s}));return[{changed:!0,entity:e,fields:i,key:t,status:"deleted"}]}function yA(e,t){return e?.get(t)}function Al(e,t,r){return t.steps.map(n=>({effect:n.effect,obligations:n.obligations.map(i=>({budget:i.budget,check:{kind:"poll",run:()=>r.evaluate(i.check)},source:{check:i.check,kind:"step"}})),reconcile:n.reconcile,settle:e.wait,step:{action:n.action,intent:e.intent,test:e.test},verifyChanges:n.verifyChanges,guard:()=>!0,perform:()=>r.perform(n.action)}))}async function Qh(e,t){let{params:r,transition:n}=e.firing,i=Mn(n,e.state,r);if(i==null){let s={intent:n.intent,kind:"unfireable",reason:Uh(n,e.state,r),test:n.test};return{label:gt(n),next:e.state,result:{finalModel:e.state.snapshot,findings:[s]}}}let o=await il({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,lawObligations:SA(e.laws,e.invariants,e.driver),observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,steps:Al(e.firing.transition,i.resolved,e.driver)},t);return{label:gt(e.firing.transition),next:{snapshot:o.finalModel},result:o}}function bA(e,t){return Cl(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},source:{invariant:e,kind:"invariant"}}]:[]}function SA(e,t,r){return(n,i)=>[...e.flatMap(o=>wA(o,n,i,r)),...t.flatMap(o=>bA(o,i))]}function wA(e,t,r,n){let i=kl(e,t,r);return i==null?[]:[{budget:"fast",check:{kind:"poll",run:()=>n.evaluate(i.check)},source:{check:i.check,kind:"law",origin:e.origin}}]}function Pl(e,t){return Il({acc:{findings:[],fired:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function Il({acc:e,index:t,params:r,signal:n,state:i,stepBase:o}){Ht(n);let s=r.sequence[t];if(s==null)return e;let a=Date.now(),l=[],u=await Qh({canon:r.canon,classify:r.classify,driver:r.driver,firing:s,invariants:r.invariants,laws:r.laws,onAssertion:r.onAssertion,state:i,onStep:d=>{l.push(d.index),r.onEvent({endMs:d.endMs,findings:d.findings,index:o+d.index,kind:"step",startMs:d.startMs,state:Xh(d.pre,d.post),url:d.url})}},n);if(u==null)return Il({acc:e,index:t+1,params:r,signal:n,state:i,stepBase:o});r.onEvent({endMs:Date.now(),intent:s.transition.intent,kind:"fired",startMs:a}),u.result.findings.forEach(d=>{r.onEvent({finding:d,kind:"finding"})});let c={findings:[...e.findings,...u.result.findings],fired:[...e.fired,u.label]};return Il({acc:c,index:t+1,params:r,signal:n,state:u.next,stepBase:o+l.length})}var $r={value:e=>vA(e)};function Ml(e,t){return{value:r=>e.value({...r,seed:`${t}:${r.seed}`})}}function Ol(e,t){return{value:r=>e.value({...r,anchor:t})}}function vA({anchor:e,constraints:t,generator:r,nullable:n,seed:i,type:o,values:s,valueSpace:a}){let l=Tl(`${a}:${i}`);return n&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:r==="date.iso"?xA({anchor:e,constraints:t,n:l,timeHash:Tl(`${a}:${i}#tod`)}):o==="number"?RA(l,t):o==="boolean"?l%2===0:IA(r,l)}var go=864e5;function xA({anchor:e,constraints:t,n:r,timeHash:n}){if(t?.kind!=="datetime")throw new Error("datetime value space requires offsetDays constraints");if(e==null)throw new Error("datetime value space requires a run anchor timestamp");let i=Date.parse(e);if(Number.isNaN(i))throw new TypeError(`datetime anchor "${e}" is not a valid ISO timestamp`);let o=t.maxOffsetDays-t.minOffsetDays+1,s=o<=0?t.minOffsetDays:t.minOffsetDays+r%o,a=Math.floor(i/go)*go;return new Date(a+s*go+n%go).toISOString()}function Tl(e,t=0,r=7){return t>=e.length?r>>>0:Tl(e,t+1,r*31+(e.codePointAt(t)??0)>>>0)}function RA(e,t){if(t?.kind!=="number"||t.min==null||t.max==null)throw new Error("number value space requires min and max constraints");let r=t.max-t.min+1;return r<=0?t.min:t.min+e%r}var kA=["ada","bruno","carmen","dario","elena","felix","greta","hugo","iris","jonas","kira","lena","mateo","nadia","oscar","petra","quinn","rosa","stefan","tara","ugo","vera","wim","yara"],EA=["abreu","berg","costa","duval","eriksen","fischer","garza","holm","ito","jansen","kovac","laurent","moreau","novak","okafor","petrov","quist","rossi","sato","tanaka","ueda","vargas","weber","zhang"],CA=["amber","brisk","calm","deep","early","fond","glad","hazel","ivory","jade","keen","lush","mauve","noble","opal","plum","quiet","rapid","sage","teal","umber","vivid","warm","zesty"],AA=["aspen","brook","cedar","dune","ember","fjord","grove","harbor","isle","juniper","knoll","lagoon","meadow","nimbus","orchid","prairie","quartz","ridge","summit","thicket","umbra","vale","willow","zephyr"];function yo(e,t){let r=e[t%e.length];if(r==null)throw new Error("empty word list");return r}function bo(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function IA(e,t){let r=yo(kA,t),n=yo(EA,Math.floor(t/31)),i=yo(CA,t),o=yo(AA,Math.floor(t/29));return e==="internet.email"?`${r}.${n}${String(t%100)}@test.ripplo.ai`:e==="internet.url"?`https://${i}-${o}.example.com`:e==="person.fullName"?`${bo(r)} ${bo(n)}`:e==="company.name"?`${bo(i)} ${bo(o)}`:e==="lorem.slug"?`${i}-${o}`:`${o}-${String(t%1e3)}`}import{ResultAsync as Ll}from"neverthrow";var Nn=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}};function Nl(e){return{read:t=>PA(t,e),seedScript:t=>`globalThis[${JSON.stringify(Ma)}] = ${JSON.stringify(t)};`}}async function PA(e,t){let r={title:await e.title(),url:Et(e.url()),viewport:OA(e.viewportSize())};if(t.length===0)return r;let n=await e.evaluate(MA,{mountKey:Hi,names:t,timeoutMs:TA});if(n.kind==="unmounted")throw new Nn(Hi);return{...r,...n.values}}var TA=5e3;async function MA(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(n=>setTimeout(n,25));let r=Reflect.get(globalThis,e.mountKey);return r==null?{kind:"unmounted"}:{kind:"values",values:Object.fromEntries(e.names.map(n=>[n,r.readSingleton(n)??null]))}}function OA(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}function Dl(e,t,r){return{evaluate:n=>Ll.fromPromise(rm(NA(e,r,n),`check ${n.kind}`),em),observe:()=>t.read().andThen(n=>Ll.fromPromise(rm(nm(e,r,0),"observe"),em).map(i=>({snapshot:{...n,singletons:{...n.singletons,...i}}}))),perform:n=>Ll.fromPromise(om(e,n,0),i=>Gp(n.kind,i))}}async function NA(e,t,r){try{return await lm(e,t,r)}catch(n){if(im(n))return!1;throw n}}function em(e){return e instanceof Nn?Bp(e.mountKey):Hp(e)}var LA=[100,250,500];async function nm(e,t,r){try{return await t.read(e)}catch(n){let i=LA[r];if(i==null||!im(n))throw n;return await am(i),nm(e,t,r+1)}}function im(e){let t=e instanceof Error?e.message:String(e);return/Execution context was destroyed|Cannot find context with specified id|[Ff]rame was detached|frame got detached/.test(t)}var tm=35e3;function rm(e,t){let r,n=new Promise((i,o)=>{r=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(tm)}ms`))},tm)});return Promise.race([e,n]).finally(()=>{clearTimeout(r)})}var $A=[250,750,2e3];async function om(e,t,r){try{await DA(e,t)}catch(n){let i=$A[r];if(i==null||!jA(n))throw n;await am(i),await om(e,t,r+1)}}async function DA(e,t){if(t.kind==="goto"){await e.goto(Dr(t.url,t,"url"));return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(Dr(t.key,t,"key"));return}await _A(sm(e,t.locator),t)}function Dr(e,t,r){if(e==null)throw new Error(`action "${t.kind}" requires ${r}`);return e}function _A(e,t){switch(t.kind){case"goto":throw new Error("goto must not be located");case"fill":return e.fill(String(Dr(t.value,t,"value")));case"clear":return e.clear();case"click":return e.click();case"dblclick":return e.dblclick();case"check":return e.check();case"uncheck":return e.uncheck();case"hover":return e.hover();case"select":return e.selectOption(String(Dr(t.value,t,"value")));case"upload":return e.setInputFiles(Dr(t.files,t,"files"));case"press":return e.press(Dr(t.key,t,"key"))}}function sm(e,t){if(t==null)throw new Error("action requires a locator");return $l(e,t)}function $l(e,t){return t.by==="testId"?e.getByTestId(t.value):t.by==="inside"?$l($l(e,t.scope),t.target):e.locator(FA(t.role,t.name))}function FA(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function jA(e){let t=e instanceof Error?e.message:String(e);return/net::ERR_|ERR_HTTP_RESPONSE_CODE_FAILURE|ECONNREFUSED|ECONNRESET|socket hang up|fetch failed|page\.goto: Timeout/.test(t)}function am(e){return new Promise(t=>{setTimeout(t,e)})}async function lm(e,t,r){if(r.kind==="browser")return VA(e,t,r.name,r.value);if(r.kind==="not")return!await lm(e,t,r.inner);let n=sm(e,r.locator);return r.kind==="visible"?n.isVisible():r.kind==="disabled"?n.isDisabled():r.kind==="enabled"?n.isEnabled():r.kind==="focused"?n.evaluate(i=>i===i.ownerDocument.activeElement):r.kind==="value"?await n.inputValue()===r.value:(await n.textContent()??"").includes(r.value)}async function VA(e,t,r,n){let o=(await t.read(e))[r];return typeof o=="string"&&o.includes(n)}async function _l({baseUrl:e,browser:t,capture:r,clientState:n,engine:i,reader:o,session:s}){let a=await t.newContext({baseURL:e,reducedMotion:"reduce",storageState:s==null?void 0:{cookies:s.cookies,origins:s.origins}});s?.headers!=null&&await a.setExtraHTTPHeaders(s.headers),await a.addInitScript(i.seedScript(n));let l=r==null?BA():await r.hub.attach(a,r.runId),u=await a.newPage();return l.onPage(u),{driver:UA(Dl(u,o,i),l),emitAssertion:l.emitAssertion,close:()=>WA({context:a,handle:l})}}async function Fl(e,t){let r=await cm(e);try{return await t(r)}finally{await r.close()}}function BA(){return{emitAction:()=>{},emitAssertion:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function cm(e){let{chromium:t}=await import("playwright");return t.launch({headless:!e})}function dm({headed:e}){let t;return{acquire:async()=>{let i=t;if(i!=null){let o=await i.catch(()=>{});if(o?.isConnected()===!0)return o;t===i&&(t=void 0)}return t??=cm(e),t},close:async()=>{let i=t;t=void 0,i!=null&&await i.then(o=>o.close()).catch(()=>{})}}}function UA(e,t){return{evaluate:e.evaluate,observe:e.observe,perform:r=>(t.emitAction(r),e.perform(r))}}async function WA({context:e,handle:t}){await um(t.finish()),await um(e.close())}var zA=15e3;async function um(e){let t,r=new Promise(n=>{t=setTimeout(n,zA)});await Promise.race([e.catch(()=>{}),r]).finally(()=>{clearTimeout(t)})}import{err as GA,ok as HA,Result as jl}from"neverthrow";function Vl(e,t,r){return{read:()=>r.read(e.map(n=>n.name),t).andThen(n=>qA(e,n))}}function qA(e,t){return jl.combine(e.map(r=>KA(r,t.entities[r.name]??[]).map(n=>[r.name,n]))).map(r=>({entities:new Map(r),singletons:t.singletons}))}function KA(e,t){let r=uo(e);return jl.combine(t.map(n=>YA(n,e).map(i=>[i,JA(n,r)]))).map(n=>new Map(n))}function YA(e,t){return jl.combine(t.identity.map(r=>{let n=e[r];return n==null?GA(Wp(t.name,r)):HA(String(n))})).map(r=>r.join(":"))}function JA(e,t){let r=t.map(n=>[n,e[n]]).filter(n=>n[1]!=null);return Object.fromEntries(r)}var pm=Pi(ha(),1);import ZA from"crypto";import{err as XA,errAsync as fm,ok as QA,ResultAsync as So}from"neverthrow";var eI=3e4,tI=[250,750,2e3];function Bl({baseUrl:e,runId:t,secret:r},n){let i=new pm.Webhook(r),o=(s,a,l)=>rI({baseUrl:e,body:a,path:s,retry:l.retry,schema:l.schema,signal:l.signal,webhook:i});return{query:{read:(s,a)=>o("/state",{entities:s,runId:t,singletons:a},{retry:"transient",schema:_a,signal:n}).map(l=>({entities:l.entities,singletons:l.singletons}))},setupWorld:s=>o("/setup",{entities:s,runId:t},{retry:"connection",schema:Da,signal:n}).map(a=>a.rows),teardown:()=>o("/teardown",{runId:t},{retry:"connection",schema:Fa,signal:void 0}).map(()=>{})}}function rI(e){return hm(e.retry,()=>aI(e),0)}function hm(e,t,r){return t().orElse(n=>{let i=tI[r];return i==null||!iI(n,e)?fm(n):So.fromSafePromise(sI(i)).andThen(()=>hm(e,t,r+1))})}var nI=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function iI(e,t){return e.kind==="aborted"?!1:oI(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function oI(e){return e.kind==="engine-network"&&e.code!=null&&nI.has(e.code)}function sI(e){return new Promise(t=>{setTimeout(t,e)})}function aI({baseUrl:e,body:t,path:r,schema:n,signal:i,webhook:o}){let s=JSON.stringify(t);return So.fromPromise(fetch(`${e}${r}`,{body:s,headers:{"Content-Type":"application/json",...lI(o,s)},method:"PUT",signal:uI(i)}),a=>to(r,a)).andThen(a=>cI(a,r)).andThen(a=>dI(n,a,r)).mapErr(a=>i?.aborted===!0?qp():a)}function lI(e,t){let r=`msg_${ZA.randomUUID()}`,n=new Date;return{"webhook-id":r,"webhook-signature":e.sign(r,n,t),"webhook-timestamp":String(Math.floor(n.getTime()/1e3))}}function uI(e){let t=AbortSignal.timeout(eI);return e==null?t:AbortSignal.any([e,t])}function cI(e,t){return e.ok?So.fromPromise(e.json(),r=>to(t,r)):So.fromPromise(e.text().catch(()=>""),r=>to(t,r)).andThen(r=>fm(Vp(t,e.status,r)))}function dI(e,t,r){let n=e.safeParse(t);return n.success?QA(n.data):XA(Up(r,n.error))}var le=Pi(ym(),1),W={actual:e=>le.default.red(e),bad:e=>le.default.red(le.default.bold(e)),bold:e=>le.default.bold(e),dim:e=>le.default.dim(e),expected:e=>le.default.green(e),good:e=>le.default.green(le.default.bold(e)),heading:e=>le.default.bold(le.default.cyan(e)),path:e=>le.default.cyan(le.default.underline(e)),warn:e=>le.default.yellow(le.default.bold(e))},mI={assertion:le.default.yellow,consistency:le.default.magenta,driver:le.default.red,illegal:le.default.cyan,invariant:le.default.yellow,unfireable:le.default.red};function Ln(e){return`${le.default.red(le.default.bold("\u2717"))} ${mI[e](le.default.bold(e.toUpperCase()))}`}var gI=le.default.red("\u2717"),lz=le.default.green("\u2713"),bm=le.default.dim("\u203A"),yI=8;function re(e,t,r){let n=r==null?"":` ${W.dim(r)}`;return` ${W.dim(e.padStart(yI))} ${t}${n}`}function _r(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${_r(e.scope)} \u25B8 ${_r(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function zl(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${_r(e.locator)}`:e.kind}function $n(e){return e.kind==="not"?`not ${$n(e.inner)}`:e.kind==="browser"?`${e.name}="${e.value}"`:e.kind==="value"||e.kind==="text"?`${e.kind} ${_r(e.locator)}="${e.value}"`:`${e.kind} ${_r(e.locator)}`}function Dn(e){let{field:t,source:r,target:n,targetField:i}=e.reference;return`${r}.${t} \u2192 ${n}.${i}`}function vm(e){return`${e.intent} \u203A ${zl(e.action)}`}function xm(e){return e.kind==="invariant"?`invariant ${Dn(e.invariant)}`:`${e.kind} ${$n(e.check)}`}function st(e){return e==null?"\u2205":JSON.stringify(e)}function Rm(e){return e.kind==="ghost-write"?`${e.entity} "${e.key}" exists in SUT but model expected none`:e.kind==="absent"?`${e.entity} "${e.key}" expected by model but absent in SUT`:e.kind==="field-mismatch"?`${e.entity}.${e.field} [${e.key}] model=${st(e.snapshot)} sut=${st(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${st(e.value)}`:`${e.singleton} model=${st(e.snapshot)} sut=${st(e.sut)}`}function Gl(e){return{label:xm(e.source),step:vm(e.step)}}function _n(e){return e.kind==="consistency"?CI(e):e.kind==="obligation"?OI(e.source,e.step,e.budget):e.kind==="illegal-transition"?pr("illegal","guard was false before this step",e.step,[re("meaning",W.dim("the action fired from a state the model says is unreachable"),void 0)]):e.kind==="unfireable"?pr("unfireable",`could not fire "${e.intent}"`,void 0,[re("reason",W.actual(Em(e.reason)),void 0),re("meaning",W.dim("a planned move was skipped \u2014 never silently drop it"),void 0)]):pr("driver","the browser failed to run this step",e.step,[re("cause",W.actual(Ct(e.error)),void 0),re("decide",W.dim("environment/infra failure \u2014 fix the run environment (daemon, dev server, ports); never weaken the model or app for a driver failure"),void 0)])}function km(e){return SI(wI(e))}var bI=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function SI(e){return e.replaceAll(bI,"").replaceAll(/\s+/g," ").trim()}function wI(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${Rm(e.divergence)}${t}`}return e.kind==="obligation"?`${LI(e.source)} failed at "${e.step.intent}": ${$I(e.source)}`:e.kind==="illegal-transition"?`guard was false before "${e.step.intent}" \u2014 the action fired from a state the model says is unreachable`:e.kind==="unfireable"?`could not fire "${e.intent}" \u2014 ${Em(e.reason)}`:`driver failed at "${e.step.intent}": ${Ct(e.error)}`}var vI={"guard-unsatisfied":"the guard isn't satisfied by the live state","no-effect":"the move has no observable effect from this state",unresolvable:"a step references a value the model can't resolve yet (e.g. a not-yet-created id)"};function Em(e){return vI[e]}function xI({debugDir:e,runId:t}){let r=`${e}/${t}`;return re("behavior",W.path(`${r}/behavior.jsonl`),void 0)}function RI(e){if(e.kind==="cascade-gap"){let{gap:n}=e,i=`${n.transition} deletes ${n.target} but leaves ${n.source} dangling`;return`${Ln("invariant")} ${W.bold(i)}
38
38
  ${re("breaks",W.dim(Dn(n.invariant)),void 0)}`}if(e.kind==="create-gap"){let{gap:n}=e,i=`${n.transition} creates ${n.entity} without setting required field(s)`;return`${Ln("invariant")} ${W.bold(i)}
39
39
  ${re("missing",W.dim(n.missing.join(", ")),void 0)}`}let{conflict:t}=e,r=`view laws contradict: ${t.a.kind} vs ${t.b.kind}`;return`${Ln("invariant")} ${W.bold(r)}
40
- ${re("when",W.dim(JSON.stringify(t.when.singletons)),void 0)}`}function wI(e){return"locator"in e&&e.locator!=null?`${e.kind} ${Ul(e.locator)}`:"url"in e?`${e.kind} ${vI(e.url)}`:e.kind}function vI(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:km(e)}function Ul(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${ym(e.name)}`:e.by==="inside"?`${Ul(e.scope)} \u25B8 ${Ul(e.target)}`:ym(e.value)}function ym(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:km(e)}function km(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function pr(e,t,r,n){let i=r==null?[]:[` ${r.intent} ${gm} ${W.dim(Wl(r.action))}`];return[`${Ln(e)} ${W.bold(t)}`,...i,...n].join(`
41
- `)}function xI(e){return e.pending?pr("consistency",EI(e.divergence),e.step,[...bm(e.divergence),re("meaning",W.dim(`the write never landed within the ${CI(e.budget)} settle budget \u2014 the app still showed the pre-step value, not a wrong one`),void 0),re("fix",W.dim("declare wait: on the expectation (or a slower tier) if this write is legitimately slow"),void 0)]):pr("consistency",AI(e.divergence),e.step,[...bm(e.divergence),re("decide",W.dim(kI(e.divergence)),void 0)])}var RI={absent:"app bug if the write was promised; if it only happens from a different starting state, restrict this test's given and cover that state in its own test","expected-change":"app bug if this action should change it; if the change needs other preconditions, split that case into its own test with the right given","field-mismatch":"app bug if the model value is the promised behavior; if the app legitimately owns this value, mark the field stable: false or assert changed() instead","ghost-write":"declare the missing effect on the acting step (Entity.created/updated/deleted), or if this write belongs to a different flow, cover it in that flow's test","singleton-mismatch":"app bug if the model value is the promised behavior; otherwise correct the singleton's expected value at the step that sets it"};function kI(e){return RI[e.kind]}function EI(e){return e.kind==="field-mismatch"?`${e.entity}.${e.field} write never landed`:e.kind==="ghost-write"?`${e.entity} "${e.key}" delete never landed`:e.kind==="absent"?`${e.entity} "${e.key}" create never landed`:e.kind==="expected-change"?`${e.entity}.${e.field} never changed`:`${e.singleton} write never landed`}function bm(e){if(e.kind==="field-mismatch")return[re("row",W.dim(`${e.entity} ${e.key}`),void 0),re("expected",W.expected(st(e.snapshot)),"model predicted this"),re("actual",W.actual(st(e.sut)),"app showed this")];if(e.kind==="singleton-mismatch")return[re("expected",W.expected(st(e.snapshot)),"model predicted this"),re("actual",W.actual(st(e.sut)),"app showed this")];if(e.kind==="expected-change")return[re("row",W.dim(`${e.entity} ${e.key}`),void 0),re("expected",W.expected("a different value"),"changed() asserted a change"),re("actual",W.actual(st(e.value)),"app left it unchanged")];let t=e.kind==="ghost-write"?"an app write the model never declared \u2014 unmodeled side effect":"the model expected this row but the app has none";return[re("meaning",W.dim(t),void 0)]}function CI(e){return`${String(kn[e]/1e3)}s "${e}"`}function AI(e){return e.kind==="field-mismatch"?`${e.entity}.${e.field} diverged`:e.kind==="ghost-write"?`${e.entity} "${e.key}" written but never modeled`:e.kind==="absent"?`${e.entity} "${e.key}" missing in the app`:e.kind==="expected-change"?`${e.entity}.${e.field} never changed`:`${e.singleton} diverged`}function II(e,t,r){if(e.kind==="invariant")return pr("invariant",`${Dn(e.invariant)} violated`,t,[re("meaning",W.dim("a referenced row went missing after this step"),void 0)]);let n=e.kind==="law"?"view law never held":"expectation never held",i=e.kind==="law"&&e.origin!=null?[PI(e.origin)]:[];return pr("assertion",n,t,[re("check",W.warn($n(e.check)),void 0),...i,re("budget",W.dim(`${r} (polled until timeout)`),void 0),re("decide",W.dim("wrong locator/accessible name, UI regression, or the expectation only holds under a narrower given \u2014 confirm in behavior.jsonl before changing the test"),void 0)])}function PI(e){if(e.kind==="test")return re("law from",W.dim(`an assertion in test "${e.test}"`),void 0);if(e.kind==="trigger")return re("law from",W.dim(`the trigger of "${e.intent}" (test "${e.test}")`),void 0);let t=e.tests.map(r=>JSON.stringify(r)).join(", ");return re("law from",W.dim(`generalized across tests ${t}`),void 0)}function TI(e){return e.kind==="invariant"?"invariant":e.kind==="law"?"law":"assertion"}function MI(e){return e.kind==="invariant"?Dn(e.invariant):$n(e.check)}import{err as U8,ok as W8,ResultAsync as z8}from"neverthrow";import Ib from"path";import{existsSync as OI}from"fs";import{createRequire as NI}from"module";import{fileURLToPath as LI}from"url";import{Worker as $I}from"worker_threads";var DI=NI(import.meta.url);function Em(e){let t=new $I(_I(),{workerData:e});t.unref();let r=new Map,n={next:0};t.on("message",o=>{let s=r.get(o.seq);s!=null&&(r.delete(o.seq),s())});let i=o=>{t.postMessage(o)};return{close:({noticeLineIfNoRrweb:o,runId:s})=>{let a=n.next;return n.next+=1,new Promise(l=>{r.set(a,l),i({noticeLineIfNoRrweb:o,runId:s,seq:a,t:"close"})})},line:({line:o,runId:s,timeNanos:a})=>{i({line:o,runId:s,t:"line",timeNanos:a})},open:({file:o,runId:s})=>{i({file:o,runId:s,t:"open"})},rrwebBatch:({data:o,runId:s})=>{i({data:o,runId:s,t:"rrweb-batch"})},terminate:async()=>{await t.terminate()}}}function _I(){try{return DI.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(r=>LI(new URL(r,import.meta.url))),t=e.find(r=>OI(r));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}import{readFile as FI}from"fs/promises";import{createRequire as jI}from"module";import{fileURLToPath as VI}from"url";var BI=jI(import.meta.url);function Gl(e,t){try{return BI.resolve(e)}catch{return VI(new URL(`assets/${t}`,import.meta.url))}}var UI=Gl("@ripplo/browser-trace/bundle","browser-trace.js");async function Am(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await WI())}var Cm;function WI(){return Cm??=FI(UI,{encoding:"utf8"}),Cm}import{readFile as f6}from"fs/promises";var zI=Object.defineProperty,GI=(e,t,r)=>t in e?zI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k=(e,t,r)=>GI(e,typeof t!="symbol"?t+"":t,r),Im,HI=Object.defineProperty,qI=(e,t,r)=>t in e?HI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pm=(e,t,r)=>qI(e,typeof t!="symbol"?t+"":t,r),Te=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Te||{}),Tm={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Mm={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xo={},KI=()=>!!globalThis.Zone;function Yu(e){if(xo[e])return xo[e];let t=globalThis[e],r=t.prototype,n=e in Tm?Tm[e]:void 0,i=!!(n&&n.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in Mm?Mm[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!KI())return xo[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let u=l[e].prototype;return document.body.removeChild(a),u?xo[e]=u:r}catch{return r}}var Hl={};function Ot(e,t,r){var n;let i=`${e}.${String(r)}`;if(Hl[i])return Hl[i].call(t);let o=Yu(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(Hl[i]=s,s.call(t)):t[r]}var ql={};function Ig(e,t,r){let n=`${e}.${String(r)}`;if(ql[n])return ql[n].bind(t);let o=Yu(e)[r];return typeof o!="function"?t[r]:(ql[n]=o,o.bind(t))}function YI(e){return Ot("Node",e,"ownerDocument")}function JI(e){return Ot("Node",e,"childNodes")}function ZI(e){return Ot("Node",e,"parentNode")}function XI(e){return Ot("Node",e,"parentElement")}function QI(e){return Ot("Node",e,"textContent")}function eP(e,t){return Ig("Node",e,"contains")(t)}function tP(e){return Ig("Node",e,"getRootNode")()}function rP(e){return!e||!("host"in e)?null:Ot("ShadowRoot",e,"host")}function nP(e){return e.styleSheets}function iP(e){return!e||!("shadowRoot"in e)?null:Ot("Element",e,"shadowRoot")}function oP(e,t){return Ot("Element",e,"querySelector")(t)}function sP(e,t){return Ot("Element",e,"querySelectorAll")(t)}function aP(){return Yu("MutationObserver").constructor}function lP(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var De={ownerDocument:YI,childNodes:JI,parentNode:ZI,parentElement:XI,textContent:QI,contains:eP,getRootNode:tP,host:rP,styleSheets:nP,shadowRoot:iP,querySelector:oP,querySelectorAll:sP,mutationObserver:aP,patch:lP};function Pg(e){return e.nodeType===e.ELEMENT_NODE}function Wn(e){let t=e&&"host"in e&&"mode"in e&&De.host(e)||null;return!!(t&&"shadowRoot"in t&&De.shadowRoot(t)===e)}function zn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function uP(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function cP(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function su(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,i=>Tg(i,r)).join("");return uP(n)}catch{return null}}function Tg(e,t){if(fP(e)){let r;try{r=su(e.styleSheet)||cP(e)}catch{r=e.cssText}return e.styleSheet.href?es(r,e.styleSheet.href):r}else{let r=e.cssText;return pP(e)&&e.selectorText.includes(":")&&(r=dP(r)),t?es(r,t):r}}function dP(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function fP(e){return"styleSheet"in e}function pP(e){return"selectorText"in e}var Zo=class{constructor(){Pm(this,"idNodeMap",new Map),Pm(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function hP(){return new Zo}function Xo({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"",a=n&&mr(n);return(t[r.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function mr(e){return e.toLowerCase()}var Om="__rrweb_original__";function mP(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let i=0;i<e.height;i+=r){let o=t.getImageData,s=Om in o?o[Om]:o;if(new Uint32Array(s.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function Qo(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?mr(t):null}function Mg(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(n);return i?.[1]??null}function gP(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var yP=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,bP=/^(?:[a-z+]+:)?\/\//i,SP=/^www\..*/i,wP=/^(data:)([^,]*),(.*)/i;function es(e,t){return(e||"").replace(yP,(r,n,i,o,s,a)=>{let l=i||s||a,u=n||o||"";if(!l)return r;if(bP.test(l)||SP.test(l))return`url(${u}${l}${u})`;if(wP.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${gP(t)+l}${u})`;let c=t.split("/"),d=l.split("/");c.pop();for(let p of d)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function Ro(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function vP(e,t,r=!1){let n=Array.from(t.childNodes),i=[],o=0;if(n.length>1&&e&&typeof e=="string"){let s=Ro(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let u=Ro(n[l].textContent,r),c=100,d=3;for(;d<u.length&&(u[d].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,d),1)!==-1);d++);for(;d<u.length;d++){let p=u.substring(0,d),h=s.split(p),f=-1;if(h.length===2)f=h[0].length;else if(h.length>2&&h[0]===""&&n[l-1].textContent!=="")f=s.indexOf(p,1);else if(h.length===1){if(p=p.substring(0,p.length-1),h=s.split(p),h.length<=1)return i.push(e),i;d=c+1}else d===u.length-1&&(f=s.indexOf(p));if(h.length>=2&&d>c){let m=n[l-1].textContent;if(m&&typeof m=="string"){let g=Ro(m).length;f=s.indexOf(p,g)}f===-1&&(f=h[0].length)}if(f!==-1){let m=Math.floor(f/a);for(;m>0&&m<e.length;){if(o+=1,o>50*n.length)return i.push(e),i;let g=Ro(e.substring(0,m),r);if(g.length===f){i.push(e.substring(0,m)),e=e.substring(m),s=s.substring(f);break}else g.length<f?m+=Math.max(1,Math.floor((f-g.length)/a)):m-=Math.max(1,Math.floor((g.length-f)*a))}break}}}}return i.push(e),i}function xP(e,t){return vP(e,t).join("/* rr_split */")}var RP=1,kP=new RegExp("[^a-z0-9-_:]"),Hn=-2;function Og(){return RP++}function EP(e){if(e instanceof HTMLFormElement)return"form";let t=mr(e.tagName);return kP.test(t)?"div":t}var Fr,Nm,CP=/^[^ \t\n\r\u000c]+/,AP=/^[, \t\n\r\u000c]+/;function IP(e,t){if(t.trim()==="")return t;let r=0;function n(o){let s,a=o.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let i=[];for(;n(AP),!(r>=t.length);){let o=n(CP);if(o.slice(-1)===",")o=Br(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=Br(e,o);let a=!1;for(;;){let l=t.charAt(r);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return i.join(", ")}var Lm=new WeakMap;function Br(e,t){return!t||t.trim()===""?t:Ju(e,t)}function PP(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Ju(e,t){let r=Lm.get(e);if(r||(r=e.createElement("a"),Lm.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Ng(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?Br(e,n):r==="srcset"?IP(e,n):r==="style"?es(n,Ju(e)):t==="object"&&r==="data"?Br(e,n):n)}function Lg(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function TP(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function ts(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ts(De.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}return r?ts(De.parentNode(e),t,r):!1}function $g(e,t,r,n){let i;if(Pg(e)){if(i=e,!De.childNodes(i).length)return!1}else{if(De.parentElement(e)===null)return!1;i=De.parentElement(e)}try{if(typeof t=="string"){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(ts(i,t,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function MP(e,t,r){let n=e.contentWindow;if(!n)return;let i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){let a=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function OP(e,t,r){let n=!1,i;try{i=e.sheet}catch{return}if(i)return;let o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}function NP(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,S=LP(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Te.Document,childNodes:[],compatMode:e.compatMode}:{type:Te.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Te.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return DP(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m,rootId:S});case e.TEXT_NODE:return $P(e,{doc:r,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Te.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Te.Comment,textContent:De.textContent(e)||"",rootId:S};default:return!1}}function LP(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function $P(e,t){let{needsMask:r,maskTextFn:n,rootId:i,cssCaptured:o}=t,s=De.parentNode(e),a=s&&s.tagName,l="",u=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;return c?l="SCRIPT_PLACEHOLDER":o||(l=De.textContent(e),u&&l&&(l=es(l,Ju(t.doc)))),!u&&!c&&l&&r&&(l=n?n(l,De.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Te.Text,textContent:l||"",rootId:i}}function DP(e,t){let{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:h}=t,f=TP(e,n,i),m=EP(e),g={},S=e.attributes.length;for(let y=0;y<S;y++){let x=e.attributes[y];Lg(m,x.name,x.value)||(g[x.name]=Ng(r,m,mr(x.name),x.value))}if(m==="link"&&o){let y=Array.from(r.styleSheets).find(E=>E.href===e.href),x=null;y&&(x=su(y)),x&&(delete g.rel,delete g.href,g._cssText=x)}if(m==="style"&&e.sheet){let y=su(e.sheet);y&&(e.childNodes.length>1&&(y=xP(y,e)),g._cssText=y)}if(["input","textarea","select"].includes(m)){let y=e.value,x=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&y?g.value=Xo({element:e,type:Qo(e),tagName:m,value:y,maskInputOptions:s,maskInputFn:a}):x&&(g.checked=x)}if(m==="option"&&(e.selected&&!s.select?g.selected=!0:delete g.selected),m==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(e.__context==="2d")mP(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let y=e.toDataURL(l.type,l.quality),x=r.createElement("canvas");x.width=e.width,x.height=e.height;let E=x.toDataURL(l.type,l.quality);y!==E&&(g.rr_dataURL=y)}}if(m==="img"&&u){Fr||(Fr=r.createElement("canvas"),Nm=Fr.getContext("2d"));let y=e,x=y.currentSrc||y.getAttribute("src")||"<unknown-src>",E=y.crossOrigin,N=()=>{y.removeEventListener("load",N);try{Fr.width=y.naturalWidth,Fr.height=y.naturalHeight,Nm.drawImage(y,0,0),g.rr_dataURL=Fr.toDataURL(l.type,l.quality)}catch(I){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${x}! Error: ${I}`)}y.crossOrigin==="anonymous"&&(E?g.crossOrigin=E:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N)}if(["audio","video"].includes(m)){let y=g;y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime,y.rr_mediaPlaybackRate=e.playbackRate,y.rr_mediaMuted=e.muted,y.rr_mediaLoop=e.loop,y.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),f){let{width:y,height:x}=e.getBoundingClientRect();g={class:g.class,rr_width:`${y}px`,rr_height:`${x}px`}}m==="iframe"&&!d(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch{}return{type:Te.Element,tagName:m,attributes:g,childNodes:[],isSVG:PP(e)||void 0,needBlock:f,rootId:h,isCustom:w}}function ue(e){return e==null?"":e.toLowerCase()}function Dg(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function _P(e,t){if(t.comment&&e.type===Te.Comment)return!0;if(e.type===Te.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Mg(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ue(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ue(e.attributes.name)==="application-name"||ue(e.attributes.rel)==="icon"||ue(e.attributes.rel)==="apple-touch-icon"||ue(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ue(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ue(e.attributes.property).match(/^(og|twitter|fb):/)||ue(e.attributes.name).match(/^(og|twitter):/)||ue(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ue(e.attributes.name)==="robots"||ue(e.attributes.name)==="googlebot"||ue(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ue(e.attributes.name)==="author"||ue(e.attributes.name)==="generator"||ue(e.attributes.name)==="framework"||ue(e.attributes.name)==="publisher"||ue(e.attributes.name)==="progid"||ue(e.attributes.property).match(/^article:/)||ue(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ue(e.attributes.name)==="google-site-verification"||ue(e.attributes.name)==="yandex-verification"||ue(e.attributes.name)==="csrf-token"||ue(e.attributes.name)==="p:domain_verify"||ue(e.attributes.name)==="verify-v1"||ue(e.attributes.name)==="verification"||ue(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ur(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:I=!1,cssCaptured:M=!1}=t,{needsMask:C}=t,{preserveWhiteSpace:V=!0}=t;C||(C=$g(e,s,a,C===void 0));let Z=NP(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:N,newlyAddedElement:I,cssCaptured:M});if(!Z)return console.warn(e,"not serialized"),null;let X;n.hasNode(e)?X=n.getId(e):_P(Z,h)||!V&&Z.type===Te.Text&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?X=Hn:X=Og();let F=Object.assign(Z,{id:X});if(n.add(e,F),X===Hn)return null;S&&S(e);let $e=!l;if(F.type===Te.Element){$e=$e&&!F.needBlock,delete F.needBlock;let Pe=De.shadowRoot(e);Pe&&zn(Pe)&&(F.isShadowHost=!0)}if((F.type===Te.Document||F.type===Te.Element)&&$e){h.headWhitespace&&F.type===Te.Element&&F.tagName==="head"&&(V=!1);let Pe={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N,cssCaptured:!1};if(!(F.type===Te.Element&&F.tagName==="textarea"&&F.attributes.value!==void 0)){F.type===Te.Element&&F.attributes._cssText!==void 0&&typeof F.attributes._cssText=="string"&&(Pe.cssCaptured=!0);for(let ir of Array.from(De.childNodes(e))){let ht=Ur(ir,Pe);ht&&F.childNodes.push(ht)}}let Ze=null;if(Pg(e)&&(Ze=De.shadowRoot(e)))for(let ir of Array.from(De.childNodes(Ze))){let ht=Ur(ir,Pe);ht&&(zn(Ze)&&(ht.isShadow=!0),F.childNodes.push(ht))}}let pt=De.parentNode(e);return pt&&Wn(pt)&&zn(pt)&&(F.isShadow=!0),F.type===Te.Element&&F.tagName==="iframe"&&MP(e,()=>{let Pe=e.contentDocument;if(Pe&&w){let Ze=Ur(Pe,{doc:Pe,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N});Ze&&w(e,Ze)}},y),F.type===Te.Element&&F.tagName==="link"&&typeof F.attributes.rel=="string"&&(F.attributes.rel==="stylesheet"||F.attributes.rel==="preload"&&typeof F.attributes.href=="string"&&Mg(F.attributes.href)==="css")&&OP(e,()=>{if(x){let Pe=Ur(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N});Pe&&x(e,Pe)}},E),F}function FP(e,t){let{mirror:r=new Zo,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:p,slimDOM:h=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:E=()=>!1}=t||{},N=c===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:c===!1?{password:!0}:c,I=Dg(h);return Ur(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:N,maskTextFn:d,maskInputFn:p,slimDOMOptions:I,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:E,newlyAddedElement:!1})}var jP=/(max|min)-device-(width|height)/,yz=new RegExp(jP.source,"g");function VP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function BP(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Zu={exports:{}},fe=String,_g=function(){return{isColorSupported:!1,reset:fe,bold:fe,dim:fe,italic:fe,underline:fe,inverse:fe,hidden:fe,strikethrough:fe,black:fe,red:fe,green:fe,yellow:fe,blue:fe,magenta:fe,cyan:fe,white:fe,gray:fe,bgBlack:fe,bgRed:fe,bgGreen:fe,bgYellow:fe,bgBlue:fe,bgMagenta:fe,bgCyan:fe,bgWhite:fe}};Zu.exports=_g();Zu.exports.createColors=_g;var UP=Zu.exports,WP={},zP=Object.freeze(Object.defineProperty({__proto__:null,default:WP},Symbol.toStringTag,{value:"Module"})),lt=BP(zP),$m=UP,Dm=lt,au=class Fg extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof r<"u"&&typeof n<"u"&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Fg)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=$m.isColorSupported),Dm&&t&&(r=Dm(r));let n=r.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=$m.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return n.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let h=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
40
+ ${re("when",W.dim(JSON.stringify(t.when.singletons)),void 0)}`}function kI(e){return"locator"in e&&e.locator!=null?`${e.kind} ${Wl(e.locator)}`:"url"in e?`${e.kind} ${EI(e.url)}`:e.kind}function EI(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:Cm(e)}function Wl(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${Sm(e.name)}`:e.by==="inside"?`${Wl(e.scope)} \u25B8 ${Wl(e.target)}`:Sm(e.value)}function Sm(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:Cm(e)}function Cm(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function pr(e,t,r,n){let i=r==null?[]:[` ${r.intent} ${bm} ${W.dim(zl(r.action))}`];return[`${Ln(e)} ${W.bold(t)}`,...i,...n].join(`
41
+ `)}function CI(e){return e.pending?pr("consistency",PI(e.divergence),e.step,[...wm(e.divergence),re("meaning",W.dim(`the write never landed within the ${TI(e.budget)} settle budget \u2014 the app still showed the pre-step value, not a wrong one`),void 0),re("fix",W.dim("declare wait: on the expectation (or a slower tier) if this write is legitimately slow"),void 0)]):pr("consistency",MI(e.divergence),e.step,[...wm(e.divergence),re("decide",W.dim(II(e.divergence)),void 0)])}var AI={absent:"app bug if the write was promised; if it only happens from a different starting state, restrict this test's given and cover that state in its own test","expected-change":"app bug if this action should change it; if the change needs other preconditions, split that case into its own test with the right given","field-mismatch":"app bug if the model value is the promised behavior; if the app legitimately owns this value, mark the field stable: false or assert changed() instead","ghost-write":"declare the missing effect on the acting step (Entity.created/updated/deleted), or if this write belongs to a different flow, cover it in that flow's test","singleton-mismatch":"app bug if the model value is the promised behavior; otherwise correct the singleton's expected value at the step that sets it"};function II(e){return AI[e.kind]}function PI(e){return e.kind==="field-mismatch"?`${e.entity}.${e.field} write never landed`:e.kind==="ghost-write"?`${e.entity} "${e.key}" delete never landed`:e.kind==="absent"?`${e.entity} "${e.key}" create never landed`:e.kind==="expected-change"?`${e.entity}.${e.field} never changed`:`${e.singleton} write never landed`}function wm(e){if(e.kind==="field-mismatch")return[re("row",W.dim(`${e.entity} ${e.key}`),void 0),re("expected",W.expected(st(e.snapshot)),"model predicted this"),re("actual",W.actual(st(e.sut)),"app showed this")];if(e.kind==="singleton-mismatch")return[re("expected",W.expected(st(e.snapshot)),"model predicted this"),re("actual",W.actual(st(e.sut)),"app showed this")];if(e.kind==="expected-change")return[re("row",W.dim(`${e.entity} ${e.key}`),void 0),re("expected",W.expected("a different value"),"changed() asserted a change"),re("actual",W.actual(st(e.value)),"app left it unchanged")];let t=e.kind==="ghost-write"?"an app write the model never declared \u2014 unmodeled side effect":"the model expected this row but the app has none";return[re("meaning",W.dim(t),void 0)]}function TI(e){return`${String(kn[e]/1e3)}s "${e}"`}function MI(e){return e.kind==="field-mismatch"?`${e.entity}.${e.field} diverged`:e.kind==="ghost-write"?`${e.entity} "${e.key}" written but never modeled`:e.kind==="absent"?`${e.entity} "${e.key}" missing in the app`:e.kind==="expected-change"?`${e.entity}.${e.field} never changed`:`${e.singleton} diverged`}function OI(e,t,r){if(e.kind==="invariant")return pr("invariant",`${Dn(e.invariant)} violated`,t,[re("meaning",W.dim("a referenced row went missing after this step"),void 0)]);let n=e.kind==="law"?"view law never held":"expectation never held",i=e.kind==="law"&&e.origin!=null?[NI(e.origin)]:[];return pr("assertion",n,t,[re("check",W.warn($n(e.check)),void 0),...i,re("budget",W.dim(`${r} (polled until timeout)`),void 0),re("decide",W.dim("wrong locator/accessible name, UI regression, or the expectation only holds under a narrower given \u2014 confirm in behavior.jsonl before changing the test"),void 0)])}function NI(e){if(e.kind==="test")return re("law from",W.dim(`an assertion in test "${e.test}"`),void 0);if(e.kind==="trigger")return re("law from",W.dim(`the trigger of "${e.intent}" (test "${e.test}")`),void 0);let t=e.tests.map(r=>JSON.stringify(r)).join(", ");return re("law from",W.dim(`generalized across tests ${t}`),void 0)}function LI(e){return e.kind==="invariant"?"invariant":e.kind==="law"?"law":"assertion"}function $I(e){return e.kind==="invariant"?Dn(e.invariant):$n(e.check)}import{err as H8,ok as q8,ResultAsync as K8}from"neverthrow";import Tb from"path";import{existsSync as DI}from"fs";import{createRequire as _I}from"module";import{fileURLToPath as FI}from"url";import{Worker as jI}from"worker_threads";var VI=_I(import.meta.url);function Am(e){let t=new jI(BI(),{workerData:e});t.unref();let r=new Map,n={next:0};t.on("message",o=>{let s=r.get(o.seq);s!=null&&(r.delete(o.seq),s())});let i=o=>{t.postMessage(o)};return{close:({noticeLineIfNoRrweb:o,runId:s})=>{let a=n.next;return n.next+=1,new Promise(l=>{r.set(a,l),i({noticeLineIfNoRrweb:o,runId:s,seq:a,t:"close"})})},line:({line:o,runId:s,timeNanos:a})=>{i({line:o,runId:s,t:"line",timeNanos:a})},open:({file:o,runId:s})=>{i({file:o,runId:s,t:"open"})},rrwebBatch:({data:o,runId:s})=>{i({data:o,runId:s,t:"rrweb-batch"})},terminate:async()=>{await t.terminate()}}}function BI(){try{return VI.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(r=>FI(new URL(r,import.meta.url))),t=e.find(r=>DI(r));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}import{readFile as UI}from"fs/promises";import{createRequire as WI}from"module";import{fileURLToPath as zI}from"url";var GI=WI(import.meta.url);function Hl(e,t){try{return GI.resolve(e)}catch{return zI(new URL(`assets/${t}`,import.meta.url))}}var HI=Hl("@ripplo/browser-trace/bundle","browser-trace.js");async function Pm(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await qI())}var Im;function qI(){return Im??=UI(HI,{encoding:"utf8"}),Im}import{readFile as g6}from"fs/promises";var KI=Object.defineProperty,YI=(e,t,r)=>t in e?KI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k=(e,t,r)=>YI(e,typeof t!="symbol"?t+"":t,r),Tm,JI=Object.defineProperty,ZI=(e,t,r)=>t in e?JI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mm=(e,t,r)=>ZI(e,typeof t!="symbol"?t+"":t,r),Te=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Te||{}),Om={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Nm={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xo={},XI=()=>!!globalThis.Zone;function Ju(e){if(xo[e])return xo[e];let t=globalThis[e],r=t.prototype,n=e in Om?Om[e]:void 0,i=!!(n&&n.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in Nm?Nm[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!XI())return xo[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let u=l[e].prototype;return document.body.removeChild(a),u?xo[e]=u:r}catch{return r}}var ql={};function Ot(e,t,r){var n;let i=`${e}.${String(r)}`;if(ql[i])return ql[i].call(t);let o=Ju(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(ql[i]=s,s.call(t)):t[r]}var Kl={};function Tg(e,t,r){let n=`${e}.${String(r)}`;if(Kl[n])return Kl[n].bind(t);let o=Ju(e)[r];return typeof o!="function"?t[r]:(Kl[n]=o,o.bind(t))}function QI(e){return Ot("Node",e,"ownerDocument")}function eP(e){return Ot("Node",e,"childNodes")}function tP(e){return Ot("Node",e,"parentNode")}function rP(e){return Ot("Node",e,"parentElement")}function nP(e){return Ot("Node",e,"textContent")}function iP(e,t){return Tg("Node",e,"contains")(t)}function oP(e){return Tg("Node",e,"getRootNode")()}function sP(e){return!e||!("host"in e)?null:Ot("ShadowRoot",e,"host")}function aP(e){return e.styleSheets}function lP(e){return!e||!("shadowRoot"in e)?null:Ot("Element",e,"shadowRoot")}function uP(e,t){return Ot("Element",e,"querySelector")(t)}function cP(e,t){return Ot("Element",e,"querySelectorAll")(t)}function dP(){return Ju("MutationObserver").constructor}function fP(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var De={ownerDocument:QI,childNodes:eP,parentNode:tP,parentElement:rP,textContent:nP,contains:iP,getRootNode:oP,host:sP,styleSheets:aP,shadowRoot:lP,querySelector:uP,querySelectorAll:cP,mutationObserver:dP,patch:fP};function Mg(e){return e.nodeType===e.ELEMENT_NODE}function Wn(e){let t=e&&"host"in e&&"mode"in e&&De.host(e)||null;return!!(t&&"shadowRoot"in t&&De.shadowRoot(t)===e)}function zn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function pP(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function hP(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function au(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,i=>Og(i,r)).join("");return pP(n)}catch{return null}}function Og(e,t){if(gP(e)){let r;try{r=au(e.styleSheet)||hP(e)}catch{r=e.cssText}return e.styleSheet.href?es(r,e.styleSheet.href):r}else{let r=e.cssText;return yP(e)&&e.selectorText.includes(":")&&(r=mP(r)),t?es(r,t):r}}function mP(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function gP(e){return"styleSheet"in e}function yP(e){return"selectorText"in e}var Zo=class{constructor(){Mm(this,"idNodeMap",new Map),Mm(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function bP(){return new Zo}function Xo({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"",a=n&&mr(n);return(t[r.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function mr(e){return e.toLowerCase()}var Lm="__rrweb_original__";function SP(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let i=0;i<e.height;i+=r){let o=t.getImageData,s=Lm in o?o[Lm]:o;if(new Uint32Array(s.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function Qo(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?mr(t):null}function Ng(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(n);return i?.[1]??null}function wP(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var vP=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,xP=/^(?:[a-z+]+:)?\/\//i,RP=/^www\..*/i,kP=/^(data:)([^,]*),(.*)/i;function es(e,t){return(e||"").replace(vP,(r,n,i,o,s,a)=>{let l=i||s||a,u=n||o||"";if(!l)return r;if(xP.test(l)||RP.test(l))return`url(${u}${l}${u})`;if(kP.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${wP(t)+l}${u})`;let c=t.split("/"),d=l.split("/");c.pop();for(let p of d)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function Ro(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function EP(e,t,r=!1){let n=Array.from(t.childNodes),i=[],o=0;if(n.length>1&&e&&typeof e=="string"){let s=Ro(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let u=Ro(n[l].textContent,r),c=100,d=3;for(;d<u.length&&(u[d].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,d),1)!==-1);d++);for(;d<u.length;d++){let p=u.substring(0,d),h=s.split(p),f=-1;if(h.length===2)f=h[0].length;else if(h.length>2&&h[0]===""&&n[l-1].textContent!=="")f=s.indexOf(p,1);else if(h.length===1){if(p=p.substring(0,p.length-1),h=s.split(p),h.length<=1)return i.push(e),i;d=c+1}else d===u.length-1&&(f=s.indexOf(p));if(h.length>=2&&d>c){let m=n[l-1].textContent;if(m&&typeof m=="string"){let g=Ro(m).length;f=s.indexOf(p,g)}f===-1&&(f=h[0].length)}if(f!==-1){let m=Math.floor(f/a);for(;m>0&&m<e.length;){if(o+=1,o>50*n.length)return i.push(e),i;let g=Ro(e.substring(0,m),r);if(g.length===f){i.push(e.substring(0,m)),e=e.substring(m),s=s.substring(f);break}else g.length<f?m+=Math.max(1,Math.floor((f-g.length)/a)):m-=Math.max(1,Math.floor((g.length-f)*a))}break}}}}return i.push(e),i}function CP(e,t){return EP(e,t).join("/* rr_split */")}var AP=1,IP=new RegExp("[^a-z0-9-_:]"),Hn=-2;function Lg(){return AP++}function PP(e){if(e instanceof HTMLFormElement)return"form";let t=mr(e.tagName);return IP.test(t)?"div":t}var Fr,$m,TP=/^[^ \t\n\r\u000c]+/,MP=/^[, \t\n\r\u000c]+/;function OP(e,t){if(t.trim()==="")return t;let r=0;function n(o){let s,a=o.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let i=[];for(;n(MP),!(r>=t.length);){let o=n(TP);if(o.slice(-1)===",")o=Br(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=Br(e,o);let a=!1;for(;;){let l=t.charAt(r);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return i.join(", ")}var Dm=new WeakMap;function Br(e,t){return!t||t.trim()===""?t:Zu(e,t)}function NP(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Zu(e,t){let r=Dm.get(e);if(r||(r=e.createElement("a"),Dm.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function $g(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?Br(e,n):r==="srcset"?OP(e,n):r==="style"?es(n,Zu(e)):t==="object"&&r==="data"?Br(e,n):n)}function Dg(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function LP(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function ts(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ts(De.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}return r?ts(De.parentNode(e),t,r):!1}function _g(e,t,r,n){let i;if(Mg(e)){if(i=e,!De.childNodes(i).length)return!1}else{if(De.parentElement(e)===null)return!1;i=De.parentElement(e)}try{if(typeof t=="string"){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(ts(i,t,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function $P(e,t,r){let n=e.contentWindow;if(!n)return;let i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){let a=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function DP(e,t,r){let n=!1,i;try{i=e.sheet}catch{return}if(i)return;let o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}function _P(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,S=FP(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Te.Document,childNodes:[],compatMode:e.compatMode}:{type:Te.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Te.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return VP(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m,rootId:S});case e.TEXT_NODE:return jP(e,{doc:r,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Te.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Te.Comment,textContent:De.textContent(e)||"",rootId:S};default:return!1}}function FP(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function jP(e,t){let{needsMask:r,maskTextFn:n,rootId:i,cssCaptured:o}=t,s=De.parentNode(e),a=s&&s.tagName,l="",u=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;return c?l="SCRIPT_PLACEHOLDER":o||(l=De.textContent(e),u&&l&&(l=es(l,Zu(t.doc)))),!u&&!c&&l&&r&&(l=n?n(l,De.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Te.Text,textContent:l||"",rootId:i}}function VP(e,t){let{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:h}=t,f=LP(e,n,i),m=PP(e),g={},S=e.attributes.length;for(let y=0;y<S;y++){let x=e.attributes[y];Dg(m,x.name,x.value)||(g[x.name]=$g(r,m,mr(x.name),x.value))}if(m==="link"&&o){let y=Array.from(r.styleSheets).find(E=>E.href===e.href),x=null;y&&(x=au(y)),x&&(delete g.rel,delete g.href,g._cssText=x)}if(m==="style"&&e.sheet){let y=au(e.sheet);y&&(e.childNodes.length>1&&(y=CP(y,e)),g._cssText=y)}if(["input","textarea","select"].includes(m)){let y=e.value,x=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&y?g.value=Xo({element:e,type:Qo(e),tagName:m,value:y,maskInputOptions:s,maskInputFn:a}):x&&(g.checked=x)}if(m==="option"&&(e.selected&&!s.select?g.selected=!0:delete g.selected),m==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(e.__context==="2d")SP(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let y=e.toDataURL(l.type,l.quality),x=r.createElement("canvas");x.width=e.width,x.height=e.height;let E=x.toDataURL(l.type,l.quality);y!==E&&(g.rr_dataURL=y)}}if(m==="img"&&u){Fr||(Fr=r.createElement("canvas"),$m=Fr.getContext("2d"));let y=e,x=y.currentSrc||y.getAttribute("src")||"<unknown-src>",E=y.crossOrigin,N=()=>{y.removeEventListener("load",N);try{Fr.width=y.naturalWidth,Fr.height=y.naturalHeight,$m.drawImage(y,0,0),g.rr_dataURL=Fr.toDataURL(l.type,l.quality)}catch(I){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${x}! Error: ${I}`)}y.crossOrigin==="anonymous"&&(E?g.crossOrigin=E:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N)}if(["audio","video"].includes(m)){let y=g;y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime,y.rr_mediaPlaybackRate=e.playbackRate,y.rr_mediaMuted=e.muted,y.rr_mediaLoop=e.loop,y.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),f){let{width:y,height:x}=e.getBoundingClientRect();g={class:g.class,rr_width:`${y}px`,rr_height:`${x}px`}}m==="iframe"&&!d(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch{}return{type:Te.Element,tagName:m,attributes:g,childNodes:[],isSVG:NP(e)||void 0,needBlock:f,rootId:h,isCustom:w}}function ue(e){return e==null?"":e.toLowerCase()}function Fg(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function BP(e,t){if(t.comment&&e.type===Te.Comment)return!0;if(e.type===Te.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Ng(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ue(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ue(e.attributes.name)==="application-name"||ue(e.attributes.rel)==="icon"||ue(e.attributes.rel)==="apple-touch-icon"||ue(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ue(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ue(e.attributes.property).match(/^(og|twitter|fb):/)||ue(e.attributes.name).match(/^(og|twitter):/)||ue(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ue(e.attributes.name)==="robots"||ue(e.attributes.name)==="googlebot"||ue(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ue(e.attributes.name)==="author"||ue(e.attributes.name)==="generator"||ue(e.attributes.name)==="framework"||ue(e.attributes.name)==="publisher"||ue(e.attributes.name)==="progid"||ue(e.attributes.property).match(/^article:/)||ue(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ue(e.attributes.name)==="google-site-verification"||ue(e.attributes.name)==="yandex-verification"||ue(e.attributes.name)==="csrf-token"||ue(e.attributes.name)==="p:domain_verify"||ue(e.attributes.name)==="verify-v1"||ue(e.attributes.name)==="verification"||ue(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ur(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:I=!1,cssCaptured:M=!1}=t,{needsMask:C}=t,{preserveWhiteSpace:V=!0}=t;C||(C=_g(e,s,a,C===void 0));let Z=_P(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:N,newlyAddedElement:I,cssCaptured:M});if(!Z)return console.warn(e,"not serialized"),null;let X;n.hasNode(e)?X=n.getId(e):BP(Z,h)||!V&&Z.type===Te.Text&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?X=Hn:X=Lg();let F=Object.assign(Z,{id:X});if(n.add(e,F),X===Hn)return null;S&&S(e);let $e=!l;if(F.type===Te.Element){$e=$e&&!F.needBlock,delete F.needBlock;let Pe=De.shadowRoot(e);Pe&&zn(Pe)&&(F.isShadowHost=!0)}if((F.type===Te.Document||F.type===Te.Element)&&$e){h.headWhitespace&&F.type===Te.Element&&F.tagName==="head"&&(V=!1);let Pe={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N,cssCaptured:!1};if(!(F.type===Te.Element&&F.tagName==="textarea"&&F.attributes.value!==void 0)){F.type===Te.Element&&F.attributes._cssText!==void 0&&typeof F.attributes._cssText=="string"&&(Pe.cssCaptured=!0);for(let ir of Array.from(De.childNodes(e))){let ht=Ur(ir,Pe);ht&&F.childNodes.push(ht)}}let Ze=null;if(Mg(e)&&(Ze=De.shadowRoot(e)))for(let ir of Array.from(De.childNodes(Ze))){let ht=Ur(ir,Pe);ht&&(zn(Ze)&&(ht.isShadow=!0),F.childNodes.push(ht))}}let pt=De.parentNode(e);return pt&&Wn(pt)&&zn(pt)&&(F.isShadow=!0),F.type===Te.Element&&F.tagName==="iframe"&&$P(e,()=>{let Pe=e.contentDocument;if(Pe&&w){let Ze=Ur(Pe,{doc:Pe,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N});Ze&&w(e,Ze)}},y),F.type===Te.Element&&F.tagName==="link"&&typeof F.attributes.rel=="string"&&(F.attributes.rel==="stylesheet"||F.attributes.rel==="preload"&&typeof F.attributes.href=="string"&&Ng(F.attributes.href)==="css")&&DP(e,()=>{if(x){let Pe=Ur(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N});Pe&&x(e,Pe)}},E),F}function UP(e,t){let{mirror:r=new Zo,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:p,slimDOM:h=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:E=()=>!1}=t||{},N=c===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:c===!1?{password:!0}:c,I=Fg(h);return Ur(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:N,maskTextFn:d,maskInputFn:p,slimDOMOptions:I,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:E,newlyAddedElement:!1})}var WP=/(max|min)-device-(width|height)/,kz=new RegExp(WP.source,"g");function zP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function GP(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Xu={exports:{}},fe=String,jg=function(){return{isColorSupported:!1,reset:fe,bold:fe,dim:fe,italic:fe,underline:fe,inverse:fe,hidden:fe,strikethrough:fe,black:fe,red:fe,green:fe,yellow:fe,blue:fe,magenta:fe,cyan:fe,white:fe,gray:fe,bgBlack:fe,bgRed:fe,bgGreen:fe,bgYellow:fe,bgBlue:fe,bgMagenta:fe,bgCyan:fe,bgWhite:fe}};Xu.exports=jg();Xu.exports.createColors=jg;var HP=Xu.exports,qP={},KP=Object.freeze(Object.defineProperty({__proto__:null,default:qP},Symbol.toStringTag,{value:"Module"})),lt=GP(KP),_m=HP,Fm=lt,lu=class Vg extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof r<"u"&&typeof n<"u"&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Vg)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=_m.isColorSupported),Fm&&t&&(r=Fm(r));let n=r.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=_m.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return n.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let h=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
42
42
  `+h+a("^")}return" "+l(p)+u}).join(`
43
43
  `)}toString(){let t=this.showSourceCode();return t&&(t=`
44
44
 
45
45
  `+t+`
46
- `),this.name+": "+this.message+t}},Xu=au;au.default=au;var ri={};ri.isClean=Symbol("isClean");ri.my=Symbol("my");var _m={after:`
46
+ `),this.name+": "+this.message+t}},Qu=lu;lu.default=lu;var ri={};ri.isClean=Symbol("isClean");ri.my=Symbol("my");var jm={after:`
47
47
  `,beforeClose:`
48
48
  `,beforeComment:`
49
49
  `,beforeDecl:`
50
50
  `,beforeOpen:" ",beforeRule:`
51
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function GP(e){return e[0].toUpperCase()+e.slice(1)}var lu=class{constructor(t){this.builder=t}atrule(t,r){let n="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?n+=t.raws.afterName:i&&(n+=" "),t.nodes)this.block(t,n+i);else{let o=(t.raws.between||"")+(r?";":"");this.builder(n+i+o,t)}}beforeAfter(t,r){let n;t.type==="decl"?n=this.raw(t,null,"beforeDecl"):t.type==="comment"?n=this.raw(t,null,"beforeComment"):r==="before"?n=this.raw(t,null,"beforeRule"):n=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(n.includes(`
52
- `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return _m[n];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[n]<"u")return s.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(t,n);{let a="raw"+GP(n);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[r],typeof i<"u")return!1})}return typeof i>"u"&&(i=_m[n]),s.rawCache[n]=i,i}rawBeforeClose(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return r=n.raws.after,r.includes(`
51
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function YP(e){return e[0].toUpperCase()+e.slice(1)}var uu=class{constructor(t){this.builder=t}atrule(t,r){let n="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?n+=t.raws.afterName:i&&(n+=" "),t.nodes)this.block(t,n+i);else{let o=(t.raws.between||"")+(r?";":"");this.builder(n+i+o,t)}}beforeAfter(t,r){let n;t.type==="decl"?n=this.raw(t,null,"beforeDecl"):t.type==="comment"?n=this.raw(t,null,"beforeComment"):r==="before"?n=this.raw(t,null,"beforeRule"):n=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(n.includes(`
52
+ `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return jm[n];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[n]<"u")return s.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(t,n);{let a="raw"+YP(n);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[r],typeof i<"u")return!1})}return typeof i>"u"&&(i=jm[n]),s.rawCache[n]=i,i}rawBeforeClose(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return r=n.raws.after,r.includes(`
53
53
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawBeforeComment(t,r){let n;return t.walkComments(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
54
54
  `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(t,r){let n;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
55
55
  `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(t){let r;return t.walk(n=>{if(n.type!=="decl"&&(r=n.raws.between,typeof r<"u"))return!1}),r}rawBeforeRule(t){let r;return t.walk(n=>{if(n.nodes&&(n.parent!==t||t.first!==n)&&typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
56
56
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawColon(t){let r;return t.walkDecls(n=>{if(typeof n.raws.between<"u")return r=n.raws.between.replace(/[^\s:]/g,""),!1}),r}rawEmptyBody(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length===0&&(r=n.raws.after,typeof r<"u"))return!1}),r}rawIndent(t){if(t.raws.indent)return t.raws.indent;let r;return t.walk(n=>{let i=n.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof n.raws.before<"u"){let o=n.raws.before.split(`
57
- `);return r=o[o.length-1],r=r.replace(/\S/g,""),!1}}),r}rawSemicolon(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(r=n.raws.semicolon,typeof r<"u"))return!1}),r}rawValue(t,r){let n=t[r],i=t.raws[r];return i&&i.value===n?i.raw:n}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)}},jg=lu;lu.default=lu;var HP=jg;function uu(e,t){new HP(t).stringify(e)}var hs=uu;uu.default=uu;var{isClean:ko,my:qP}=ri,KP=Xu,YP=jg,JP=hs;function cu(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let i=e[n],o=typeof i;n==="parent"&&o==="object"?t&&(r[n]=t):n==="source"?r[n]=i:Array.isArray(i)?r[n]=i.map(s=>cu(s,r)):(o==="object"&&i!==null&&(i=cu(i)),r[n]=i)}return r}var du=class{constructor(t={}){this.raws={},this[ko]=!1,this[qP]=!0;for(let r in t)if(r==="nodes"){this.nodes=[];for(let n of t[r])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[r]=t[r]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${r.input.from}:${r.start.line}:${r.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let r in t)this[r]=t[r];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let r=cu(this);for(let n in t)r[n]=t[n];return r}cloneAfter(t={}){let r=this.clone(t);return this.parent.insertAfter(this,r),r}cloneBefore(t={}){let r=this.clone(t);return this.parent.insertBefore(this,r),r}error(t,r={}){if(this.source){let{end:n,start:i}=this.rangeBy(r);return this.source.input.error(t,{column:i.column,line:i.line},{column:n.column,line:n.line},r)}return new KP(t)}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:r==="root"?()=>t.root().toProxy():t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}}markDirty(){if(this[ko]){this[ko]=!1;let t=this;for(;t=t.parent;)t[ko]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,r){let n=this.source.start;if(t.index)n=this.positionInside(t.index,r);else if(t.word){r=this.toString();let i=r.indexOf(t.word);i!==-1&&(n=this.positionInside(i,r))}return n}positionInside(t,r){let n=r||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)n[s]===`
58
- `?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new YP().raw(this,t,r)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let r=this,n=!1;for(let i of t)i===this?n=!0:n?(this.parent.insertAfter(r,i),r=i):this.parent.insertBefore(r,i);n||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,r){let n={},i=r==null;r=r||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))n[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,r):l);else if(typeof a=="object"&&a.toJSON)n[s]=a.toJSON(null,r);else if(s==="source"){let l=r.get(a.input);l==null&&(l=o,r.set(a.input,o),o++),n[s]={end:a.end,inputId:l,start:a.start}}else n[s]=a}return i&&(n.inputs=[...r.keys()].map(s=>s.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=JP){t.stringify&&(t=t.stringify);let r="";return t(this,n=>{r+=n}),r}warn(t,r,n){let i={node:this};for(let o in n)i[o]=n[o];return t.warn(r,i)}get proxyOf(){return this}},ms=du;du.default=du;var ZP=ms,fu=class extends ZP{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},gs=fu;fu.default=fu;var XP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",QP=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},eT=(e=21)=>{let t="",r=e;for(;r--;)t+=XP[Math.random()*64|0];return t},tT={nanoid:eT,customAlphabet:QP},{SourceMapConsumer:Fm,SourceMapGenerator:jm}=lt,{existsSync:rT,readFileSync:nT}=lt,{dirname:Kl,join:iT}=lt;function oT(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var pu=class{constructor(t,r){if(r.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let n=r.map?r.map.prev:void 0,i=this.loadMap(r.from,n);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=Kl(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Fm(this.text)),this.consumerCache}decodeInline(t){let r=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(r.test(t)||n.test(t))return oT(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!r)return;let n=t.lastIndexOf(r.pop()),i=t.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(n,i)))}loadFile(t){if(this.root=Kl(t),rT(t))return this.mapFile=t,nT(t,"utf-8").toString().trim()}loadMap(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){let n=r(t);if(n){let i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(r instanceof Fm)return jm.fromSourceMap(r).toString();if(r instanceof jm)return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let n=this.annotation;return t&&(n=iT(Kl(t),n)),this.loadFile(n)}}}startWith(t,r){return t?t.substr(0,r.length)===r:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Vg=pu;pu.default=pu;var{SourceMapConsumer:sT,SourceMapGenerator:aT}=lt,{fileURLToPath:Vm,pathToFileURL:Eo}=lt,{isAbsolute:hu,resolve:mu}=lt,{nanoid:lT}=tT,Yl=lt,Bm=Xu,uT=Vg,Jl=Symbol("fromOffsetCache"),cT=!!(sT&&aT),Um=!!(mu&&hu),rs=class{constructor(t,r={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,r.from&&(!Um||/^\w+:\/\//.test(r.from)||hu(r.from)?this.file=r.from:this.file=mu(r.from)),Um&&cT){let n=new uT(this.css,r);if(n.text){this.map=n;let i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+lT(6)+">"),this.map&&(this.map.file=this.from)}error(t,r,n,i={}){let o,s,a;if(r&&typeof r=="object"){let u=r,c=n;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);r=d.line,n=d.col}else r=u.line,n=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);s=d.line,a=d.col}else s=c.line,a=c.column}else if(!n){let u=this.fromOffset(r);r=u.line,n=u.col}let l=this.origin(r,n,s,a);return l?o=new Bm(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new Bm(t,s===void 0?r:{column:n,line:r},s===void 0?n:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:n,endColumn:a,endLine:s,line:r,source:this.css},this.file&&(Eo&&(o.input.url=Eo(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let r,n;if(this[Jl])n=this[Jl];else{let o=this.css.split(`
59
- `);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[Jl]=n}r=n[n.length-1];let i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<n[s])o=s-1;else if(t>=n[s+1])i=s+1;else{i=s;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:mu(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,n,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:r,line:t});if(!s.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:i,line:n}));let l;hu(s.source)?l=Eo(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||Eo(this.map.mapFile));let u={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(Vm)u.file=Vm(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let t={};for(let r of["hasBOM","css","file","id"])this[r]!=null&&(t[r]=this[r]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},ys=rs;rs.default=rs;Yl&&Yl.registerInput&&Yl.registerInput(rs);var{SourceMapConsumer:Bg,SourceMapGenerator:Go}=lt,{dirname:Ho,relative:Ug,resolve:Wg,sep:zg}=lt,{pathToFileURL:Wm}=lt,dT=ys,fT=!!(Bg&&Go),pT=!!(Ho&&Wg&&Ug&&zg),hT=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let r=`
57
+ `);return r=o[o.length-1],r=r.replace(/\S/g,""),!1}}),r}rawSemicolon(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(r=n.raws.semicolon,typeof r<"u"))return!1}),r}rawValue(t,r){let n=t[r],i=t.raws[r];return i&&i.value===n?i.raw:n}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)}},Bg=uu;uu.default=uu;var JP=Bg;function cu(e,t){new JP(t).stringify(e)}var hs=cu;cu.default=cu;var{isClean:ko,my:ZP}=ri,XP=Qu,QP=Bg,eT=hs;function du(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let i=e[n],o=typeof i;n==="parent"&&o==="object"?t&&(r[n]=t):n==="source"?r[n]=i:Array.isArray(i)?r[n]=i.map(s=>du(s,r)):(o==="object"&&i!==null&&(i=du(i)),r[n]=i)}return r}var fu=class{constructor(t={}){this.raws={},this[ko]=!1,this[ZP]=!0;for(let r in t)if(r==="nodes"){this.nodes=[];for(let n of t[r])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[r]=t[r]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${r.input.from}:${r.start.line}:${r.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let r in t)this[r]=t[r];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let r=du(this);for(let n in t)r[n]=t[n];return r}cloneAfter(t={}){let r=this.clone(t);return this.parent.insertAfter(this,r),r}cloneBefore(t={}){let r=this.clone(t);return this.parent.insertBefore(this,r),r}error(t,r={}){if(this.source){let{end:n,start:i}=this.rangeBy(r);return this.source.input.error(t,{column:i.column,line:i.line},{column:n.column,line:n.line},r)}return new XP(t)}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:r==="root"?()=>t.root().toProxy():t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}}markDirty(){if(this[ko]){this[ko]=!1;let t=this;for(;t=t.parent;)t[ko]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,r){let n=this.source.start;if(t.index)n=this.positionInside(t.index,r);else if(t.word){r=this.toString();let i=r.indexOf(t.word);i!==-1&&(n=this.positionInside(i,r))}return n}positionInside(t,r){let n=r||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)n[s]===`
58
+ `?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new QP().raw(this,t,r)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let r=this,n=!1;for(let i of t)i===this?n=!0:n?(this.parent.insertAfter(r,i),r=i):this.parent.insertBefore(r,i);n||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,r){let n={},i=r==null;r=r||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))n[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,r):l);else if(typeof a=="object"&&a.toJSON)n[s]=a.toJSON(null,r);else if(s==="source"){let l=r.get(a.input);l==null&&(l=o,r.set(a.input,o),o++),n[s]={end:a.end,inputId:l,start:a.start}}else n[s]=a}return i&&(n.inputs=[...r.keys()].map(s=>s.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=eT){t.stringify&&(t=t.stringify);let r="";return t(this,n=>{r+=n}),r}warn(t,r,n){let i={node:this};for(let o in n)i[o]=n[o];return t.warn(r,i)}get proxyOf(){return this}},ms=fu;fu.default=fu;var tT=ms,pu=class extends tT{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},gs=pu;pu.default=pu;var rT="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",nT=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},iT=(e=21)=>{let t="",r=e;for(;r--;)t+=rT[Math.random()*64|0];return t},oT={nanoid:iT,customAlphabet:nT},{SourceMapConsumer:Vm,SourceMapGenerator:Bm}=lt,{existsSync:sT,readFileSync:aT}=lt,{dirname:Yl,join:lT}=lt;function uT(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var hu=class{constructor(t,r){if(r.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let n=r.map?r.map.prev:void 0,i=this.loadMap(r.from,n);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=Yl(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Vm(this.text)),this.consumerCache}decodeInline(t){let r=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(r.test(t)||n.test(t))return uT(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!r)return;let n=t.lastIndexOf(r.pop()),i=t.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(n,i)))}loadFile(t){if(this.root=Yl(t),sT(t))return this.mapFile=t,aT(t,"utf-8").toString().trim()}loadMap(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){let n=r(t);if(n){let i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(r instanceof Vm)return Bm.fromSourceMap(r).toString();if(r instanceof Bm)return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let n=this.annotation;return t&&(n=lT(Yl(t),n)),this.loadFile(n)}}}startWith(t,r){return t?t.substr(0,r.length)===r:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Ug=hu;hu.default=hu;var{SourceMapConsumer:cT,SourceMapGenerator:dT}=lt,{fileURLToPath:Um,pathToFileURL:Eo}=lt,{isAbsolute:mu,resolve:gu}=lt,{nanoid:fT}=oT,Jl=lt,Wm=Qu,pT=Ug,Zl=Symbol("fromOffsetCache"),hT=!!(cT&&dT),zm=!!(gu&&mu),rs=class{constructor(t,r={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,r.from&&(!zm||/^\w+:\/\//.test(r.from)||mu(r.from)?this.file=r.from:this.file=gu(r.from)),zm&&hT){let n=new pT(this.css,r);if(n.text){this.map=n;let i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+fT(6)+">"),this.map&&(this.map.file=this.from)}error(t,r,n,i={}){let o,s,a;if(r&&typeof r=="object"){let u=r,c=n;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);r=d.line,n=d.col}else r=u.line,n=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);s=d.line,a=d.col}else s=c.line,a=c.column}else if(!n){let u=this.fromOffset(r);r=u.line,n=u.col}let l=this.origin(r,n,s,a);return l?o=new Wm(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new Wm(t,s===void 0?r:{column:n,line:r},s===void 0?n:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:n,endColumn:a,endLine:s,line:r,source:this.css},this.file&&(Eo&&(o.input.url=Eo(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let r,n;if(this[Zl])n=this[Zl];else{let o=this.css.split(`
59
+ `);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[Zl]=n}r=n[n.length-1];let i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<n[s])o=s-1;else if(t>=n[s+1])i=s+1;else{i=s;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:gu(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,n,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:r,line:t});if(!s.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:i,line:n}));let l;mu(s.source)?l=Eo(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||Eo(this.map.mapFile));let u={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(Um)u.file=Um(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let t={};for(let r of["hasBOM","css","file","id"])this[r]!=null&&(t[r]=this[r]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},ys=rs;rs.default=rs;Jl&&Jl.registerInput&&Jl.registerInput(rs);var{SourceMapConsumer:Wg,SourceMapGenerator:Go}=lt,{dirname:Ho,relative:zg,resolve:Gg,sep:Hg}=lt,{pathToFileURL:Gm}=lt,mT=ys,gT=!!(Wg&&Go),yT=!!(Ho&&Gg&&zg&&Hg),bT=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let r=`
60
60
  `;this.css.includes(`\r
61
61
  `)&&(r=`\r
62
- `),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||Ho(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Bg(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),pT&&fT&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,r=>{t+=r}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Go.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Go({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Go({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,r=1,n="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=t,i.generated.column=r-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
63
- `),r=a.length-s):r+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(r=>r.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?Ho(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=Ho(Wg(n,this.mapOpts.annotation)));let i=Ug(n,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new dT(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let r=this.memoizedFileURLs.get(t);if(r)return r;if(Wm){let n=Wm(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;zg==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Gg=hT,mT=ms,gu=class extends mT{constructor(t){super(t),this.type="comment"}},bs=gu;gu.default=gu;var{isClean:Hg,my:qg}=ri,Kg=gs,Yg=bs,gT=ms,Jg,Qu,ec,Zg;function Xg(e){return e.map(t=>(t.nodes&&(t.nodes=Xg(t.nodes)),delete t.source,t))}function Qg(e){if(e[Hg]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Qg(t)}var Tt=class ey extends gT{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=Xg(Jg(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Kg(t)]}else if(t.selector)t=[new Qu(t)];else if(t.name)t=[new ec(t)];else if(t.text)t=[new Yg(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[qg]||ey.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Hg]&&Qg(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Tt.registerParse=e=>{Jg=e};Tt.registerRule=e=>{Qu=e};Tt.registerAtRule=e=>{ec=e};Tt.registerRoot=e=>{Zg=e};var gr=Tt;Tt.default=Tt;Tt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,ec.prototype):e.type==="rule"?Object.setPrototypeOf(e,Qu.prototype):e.type==="decl"?Object.setPrototypeOf(e,Kg.prototype):e.type==="comment"?Object.setPrototypeOf(e,Yg.prototype):e.type==="root"&&Object.setPrototypeOf(e,Zg.prototype),e[qg]=!0,e.nodes&&e.nodes.forEach(t=>{Tt.rebuild(t)})};var yT=gr,ty,ry,qn=class extends yT{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new ty(new ry,this,t).stringify()}};qn.registerLazyResult=e=>{ty=e};qn.registerProcessor=e=>{ry=e};var tc=qn;qn.default=qn;var zm={},ny=function(t){zm[t]||(zm[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},yu=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},iy=yu;yu.default=yu;var bT=iy,bu=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new bT(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},rc=bu;bu.default=bu;var Zl=39,Gm=34,Co=92,Hm=47,Ao=10,Fn=32,Io=12,Po=9,To=13,ST=91,wT=93,vT=40,xT=41,RT=123,kT=125,ET=59,CT=42,AT=58,IT=64,Mo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Oo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,PT=/.[\r\n"'(/\\]/,qm=/[\da-f]/i,TT=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=n.length,g=0,S=[],w=[];function y(){return g}function x(M){throw t.error("Unclosed "+M,g)}function E(){return w.length===0&&g>=m}function N(M){if(w.length)return w.pop();if(g>=m)return;let C=M?M.ignoreUnclosed:!1;switch(o=n.charCodeAt(g),o){case Ao:case Fn:case Po:case To:case Io:{s=g;do s+=1,o=n.charCodeAt(s);while(o===Fn||o===Ao||o===Po||o===To||o===Io);f=["space",n.slice(g,s)],g=s-1;break}case ST:case wT:case RT:case kT:case AT:case ET:case xT:{let V=String.fromCharCode(o);f=[V,V,g];break}case vT:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==Zl&&h!==Gm&&h!==Fn&&h!==Ao&&h!==Po&&h!==Io&&h!==To){s=g;do{if(c=!1,s=n.indexOf(")",s+1),s===-1)if(i||C){s=g;break}else x("bracket");for(d=s;n.charCodeAt(d-1)===Co;)d-=1,c=!c}while(c);f=["brackets",n.slice(g,s+1),g,s],g=s}else s=n.indexOf(")",g+1),l=n.slice(g,s+1),s===-1||PT.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case Zl:case Gm:{a=o===Zl?"'":'"',s=g;do{if(c=!1,s=n.indexOf(a,s+1),s===-1)if(i||C){s=g+1;break}else x("string");for(d=s;n.charCodeAt(d-1)===Co;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case IT:{Mo.lastIndex=g+1,Mo.test(n),Mo.lastIndex===0?s=n.length-1:s=Mo.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case Co:{for(s=g,u=!0;n.charCodeAt(s+1)===Co;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==Hm&&o!==Fn&&o!==Ao&&o!==Po&&o!==To&&o!==Io&&(s+=1,qm.test(n.charAt(s)))){for(;qm.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===Fn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===Hm&&n.charCodeAt(g+1)===CT?(s=n.indexOf("*/",g+2)+1,s===0&&(i||C?s=n.length:x("comment")),f=["comment",n.slice(g,s+1),g,s],g=s):(Oo.lastIndex=g+1,Oo.test(n),Oo.lastIndex===0?s=n.length-1:s=Oo.lastIndex-2,f=["word",n.slice(g,s+1),g,s],S.push(f),g=s);break}}return g++,f}function I(M){w.push(M)}return{back:I,endOfFile:E,nextToken:N,position:y}},oy=gr,ns=class extends oy{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}},nc=ns;ns.default=ns;oy.registerAtRule(ns);var sy=gr,ay,ly,zr=class extends sy{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new ay(new ly,this,t).stringify()}};zr.registerLazyResult=e=>{ay=e};zr.registerProcessor=e=>{ly=e};var ni=zr;zr.default=zr;sy.registerRoot(zr);var Kn={comma(e){return Kn.split(e,[","],!0)},space(e){let t=[" ",`
64
- `," "];return Kn.split(e,t)},split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let c of e)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?s+=1:c===")"?s>0&&(s-=1):s===0&&t.includes(c)&&(o=!0),o?(i!==""&&n.push(i.trim()),i="",o=!1):i+=c;return(r||i!=="")&&n.push(i.trim()),n}},uy=Kn;Kn.default=Kn;var cy=gr,MT=uy,is=class extends cy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return MT.comma(this.selector)}set selectors(t){let r=this.selector?this.selector.match(/,\s*/):null,n=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(n)}},ic=is;is.default=is;cy.registerRule(is);var OT=gs,NT=TT,LT=bs,$T=nc,DT=ni,Km=ic,Ym={empty:!0,space:!0};function _T(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var FT=class{constructor(t){this.input=t,this.root=new DT,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let r=new $T;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),n=t[0],n==="("||n==="["?u.push(n==="("?")":"]"):n==="{"&&u.length>0?u.push("}"):n===u[u.length-1]&&u.pop(),u.length===0)if(n===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){a=!0;break}else if(n==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(r.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(r,"params",l),s&&(t=l[l.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let r=this.colon(t);if(r===!1)return;let n=0,i;for(let o=r-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(n+=1,n===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let r=0,n,i,o;for(let[s,a]of t.entries()){if(n=a,i=n[0],i==="("&&(r+=1),i===")"&&(r-=1),r===0&&i===":")if(!o)this.doubleColon(n);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=n}return!1}comment(t){let r=new LT;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;let n=t[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=i[2],r.raws.left=i[1],r.raws.right=i[3]}}createTokenizer(){this.tokenizer=NT(this.input)}decl(t,r){let n=new OT;this.init(n,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(i[3]||i[2]||_T(t)),n.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;n.prop+=t.shift()[1]}n.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){n.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){n.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(n.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let p=u;p>0;p--){let h=c[p][0];if(d.trim().indexOf("!")===0&&h!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(n.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(n,"value",s.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let r=new Km;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}}init(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let r=!1,n=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(n=u[0],l.push(u),n==="("||n==="[")o||(o=u),s.push(n==="("?")":"]");else if(a&&i&&n==="{")o||(o=u),s.push("}");else if(s.length===0)if(n===";")if(i){this.decl(l,a);return}else break;else if(n==="{"){this.rule(l);return}else if(n==="}"){this.tokenizer.back(l.pop()),r=!0;break}else n===":"&&(i=!0);else n===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),s.length>0&&this.unclosedBracket(o),r&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,r,n,i){let o,s,a=n.length,l="",u=!0,c,d;for(let p=0;p<a;p+=1)o=n[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=n[p-1]?n[p-1][0]:"empty",c=n[p+1]?n[p+1][0]:"empty",!Ym[d]&&!Ym[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=n.reduce((h,f)=>h+f[1],"");t.raws[r]={raw:p,value:l}}t[r]=l}rule(t){t.pop();let r=new Km;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r}spacesAndCommentsFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)n=t.pop()[1]+n;return n}spacesAndCommentsFromStart(t){let r,n="";for(;t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)n+=t.shift()[1];return n}spacesFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],r==="space");)n=t.pop()[1]+n;return n}stringFrom(t,r){let n="";for(let i=r;i<t.length;i++)n+=t[i][1];return t.splice(r,t.length-r),n}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})}},jT=FT,VT=gr,BT=jT,UT=ys;function os(e,t){let r=new UT(e,t),n=new BT(r);try{n.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
62
+ `),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||Ho(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Wg(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),yT&&gT&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,r=>{t+=r}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Go.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Go({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Go({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,r=1,n="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=t,i.generated.column=r-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
63
+ `),r=a.length-s):r+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(r=>r.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?Ho(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=Ho(Gg(n,this.mapOpts.annotation)));let i=zg(n,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new mT(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let r=this.memoizedFileURLs.get(t);if(r)return r;if(Gm){let n=Gm(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;Hg==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},qg=bT,ST=ms,yu=class extends ST{constructor(t){super(t),this.type="comment"}},bs=yu;yu.default=yu;var{isClean:Kg,my:Yg}=ri,Jg=gs,Zg=bs,wT=ms,Xg,ec,tc,Qg;function ey(e){return e.map(t=>(t.nodes&&(t.nodes=ey(t.nodes)),delete t.source,t))}function ty(e){if(e[Kg]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ty(t)}var Tt=class ry extends wT{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=ey(Xg(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Jg(t)]}else if(t.selector)t=[new ec(t)];else if(t.name)t=[new tc(t)];else if(t.text)t=[new Zg(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Yg]||ry.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Kg]&&ty(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Tt.registerParse=e=>{Xg=e};Tt.registerRule=e=>{ec=e};Tt.registerAtRule=e=>{tc=e};Tt.registerRoot=e=>{Qg=e};var gr=Tt;Tt.default=Tt;Tt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,tc.prototype):e.type==="rule"?Object.setPrototypeOf(e,ec.prototype):e.type==="decl"?Object.setPrototypeOf(e,Jg.prototype):e.type==="comment"?Object.setPrototypeOf(e,Zg.prototype):e.type==="root"&&Object.setPrototypeOf(e,Qg.prototype),e[Yg]=!0,e.nodes&&e.nodes.forEach(t=>{Tt.rebuild(t)})};var vT=gr,ny,iy,qn=class extends vT{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new ny(new iy,this,t).stringify()}};qn.registerLazyResult=e=>{ny=e};qn.registerProcessor=e=>{iy=e};var rc=qn;qn.default=qn;var Hm={},oy=function(t){Hm[t]||(Hm[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},bu=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},sy=bu;bu.default=bu;var xT=sy,Su=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new xT(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},nc=Su;Su.default=Su;var Xl=39,qm=34,Co=92,Km=47,Ao=10,Fn=32,Io=12,Po=9,To=13,RT=91,kT=93,ET=40,CT=41,AT=123,IT=125,PT=59,TT=42,MT=58,OT=64,Mo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Oo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,NT=/.[\r\n"'(/\\]/,Ym=/[\da-f]/i,LT=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=n.length,g=0,S=[],w=[];function y(){return g}function x(M){throw t.error("Unclosed "+M,g)}function E(){return w.length===0&&g>=m}function N(M){if(w.length)return w.pop();if(g>=m)return;let C=M?M.ignoreUnclosed:!1;switch(o=n.charCodeAt(g),o){case Ao:case Fn:case Po:case To:case Io:{s=g;do s+=1,o=n.charCodeAt(s);while(o===Fn||o===Ao||o===Po||o===To||o===Io);f=["space",n.slice(g,s)],g=s-1;break}case RT:case kT:case AT:case IT:case MT:case PT:case CT:{let V=String.fromCharCode(o);f=[V,V,g];break}case ET:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==Xl&&h!==qm&&h!==Fn&&h!==Ao&&h!==Po&&h!==Io&&h!==To){s=g;do{if(c=!1,s=n.indexOf(")",s+1),s===-1)if(i||C){s=g;break}else x("bracket");for(d=s;n.charCodeAt(d-1)===Co;)d-=1,c=!c}while(c);f=["brackets",n.slice(g,s+1),g,s],g=s}else s=n.indexOf(")",g+1),l=n.slice(g,s+1),s===-1||NT.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case Xl:case qm:{a=o===Xl?"'":'"',s=g;do{if(c=!1,s=n.indexOf(a,s+1),s===-1)if(i||C){s=g+1;break}else x("string");for(d=s;n.charCodeAt(d-1)===Co;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case OT:{Mo.lastIndex=g+1,Mo.test(n),Mo.lastIndex===0?s=n.length-1:s=Mo.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case Co:{for(s=g,u=!0;n.charCodeAt(s+1)===Co;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==Km&&o!==Fn&&o!==Ao&&o!==Po&&o!==To&&o!==Io&&(s+=1,Ym.test(n.charAt(s)))){for(;Ym.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===Fn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===Km&&n.charCodeAt(g+1)===TT?(s=n.indexOf("*/",g+2)+1,s===0&&(i||C?s=n.length:x("comment")),f=["comment",n.slice(g,s+1),g,s],g=s):(Oo.lastIndex=g+1,Oo.test(n),Oo.lastIndex===0?s=n.length-1:s=Oo.lastIndex-2,f=["word",n.slice(g,s+1),g,s],S.push(f),g=s);break}}return g++,f}function I(M){w.push(M)}return{back:I,endOfFile:E,nextToken:N,position:y}},ay=gr,ns=class extends ay{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}},ic=ns;ns.default=ns;ay.registerAtRule(ns);var ly=gr,uy,cy,zr=class extends ly{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new uy(new cy,this,t).stringify()}};zr.registerLazyResult=e=>{uy=e};zr.registerProcessor=e=>{cy=e};var ni=zr;zr.default=zr;ly.registerRoot(zr);var Kn={comma(e){return Kn.split(e,[","],!0)},space(e){let t=[" ",`
64
+ `," "];return Kn.split(e,t)},split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let c of e)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?s+=1:c===")"?s>0&&(s-=1):s===0&&t.includes(c)&&(o=!0),o?(i!==""&&n.push(i.trim()),i="",o=!1):i+=c;return(r||i!=="")&&n.push(i.trim()),n}},dy=Kn;Kn.default=Kn;var fy=gr,$T=dy,is=class extends fy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return $T.comma(this.selector)}set selectors(t){let r=this.selector?this.selector.match(/,\s*/):null,n=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(n)}},oc=is;is.default=is;fy.registerRule(is);var DT=gs,_T=LT,FT=bs,jT=ic,VT=ni,Jm=oc,Zm={empty:!0,space:!0};function BT(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var UT=class{constructor(t){this.input=t,this.root=new VT,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let r=new jT;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),n=t[0],n==="("||n==="["?u.push(n==="("?")":"]"):n==="{"&&u.length>0?u.push("}"):n===u[u.length-1]&&u.pop(),u.length===0)if(n===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){a=!0;break}else if(n==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(r.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(r,"params",l),s&&(t=l[l.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let r=this.colon(t);if(r===!1)return;let n=0,i;for(let o=r-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(n+=1,n===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let r=0,n,i,o;for(let[s,a]of t.entries()){if(n=a,i=n[0],i==="("&&(r+=1),i===")"&&(r-=1),r===0&&i===":")if(!o)this.doubleColon(n);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=n}return!1}comment(t){let r=new FT;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;let n=t[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=i[2],r.raws.left=i[1],r.raws.right=i[3]}}createTokenizer(){this.tokenizer=_T(this.input)}decl(t,r){let n=new DT;this.init(n,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(i[3]||i[2]||BT(t)),n.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;n.prop+=t.shift()[1]}n.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){n.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){n.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(n.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let p=u;p>0;p--){let h=c[p][0];if(d.trim().indexOf("!")===0&&h!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(n.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(n,"value",s.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let r=new Jm;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}}init(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let r=!1,n=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(n=u[0],l.push(u),n==="("||n==="[")o||(o=u),s.push(n==="("?")":"]");else if(a&&i&&n==="{")o||(o=u),s.push("}");else if(s.length===0)if(n===";")if(i){this.decl(l,a);return}else break;else if(n==="{"){this.rule(l);return}else if(n==="}"){this.tokenizer.back(l.pop()),r=!0;break}else n===":"&&(i=!0);else n===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),s.length>0&&this.unclosedBracket(o),r&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,r,n,i){let o,s,a=n.length,l="",u=!0,c,d;for(let p=0;p<a;p+=1)o=n[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=n[p-1]?n[p-1][0]:"empty",c=n[p+1]?n[p+1][0]:"empty",!Zm[d]&&!Zm[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=n.reduce((h,f)=>h+f[1],"");t.raws[r]={raw:p,value:l}}t[r]=l}rule(t){t.pop();let r=new Jm;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r}spacesAndCommentsFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)n=t.pop()[1]+n;return n}spacesAndCommentsFromStart(t){let r,n="";for(;t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)n+=t.shift()[1];return n}spacesFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],r==="space");)n=t.pop()[1]+n;return n}stringFrom(t,r){let n="";for(let i=r;i<t.length;i++)n+=t[i][1];return t.splice(r,t.length-r),n}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})}},WT=UT,zT=gr,GT=WT,HT=ys;function os(e,t){let r=new HT(e,t),n=new GT(r);try{n.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
65
65
  You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
66
66
  You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
67
- You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var oc=os;os.default=os;VT.registerParse(os);var{isClean:bt,my:WT}=ri,zT=Gg,GT=hs,HT=gr,qT=tc,KT=ny,Jm=rc,YT=oc,JT=ni,ZT={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},XT={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},QT={Once:!0,postcssPlugin:!0,prepare:!0},Gr=0;function jn(e){return typeof e=="object"&&typeof e.then=="function"}function dy(e){let t=!1,r=ZT[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Gr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Gr,r+"Exit"]:[r,r+"Exit"]}function Zm(e){let t;return e.type==="document"?t=["Document",Gr,"DocumentExit"]:e.type==="root"?t=["Root",Gr,"RootExit"]:t=dy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Su(e){return e[bt]=!1,e.nodes&&e.nodes.forEach(t=>Su(t)),e}var wu={},Hr=class fy{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=Su(r);else if(r instanceof fy||r instanceof Jm)i=Su(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=YT;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[WT]&&HT.rebuild(i)}this.result=new Jm(t,i,n),this.helpers={...wu,postcss:wu,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!XT[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!QT[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(jn(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[bt];){t[bt]=!0;let r=[Zm(t)];for(;r.length>0;){let n=this.visitTick(r);if(jn(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return jn(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=GT;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new zT(r,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let r=this.runOnRoot(t);if(jn(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[bt];)t[bt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||KT("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(jn(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[bt]){a[bt]=!0,t.push(Zm(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Gr){n.nodes&&n.nodes.length&&(n[bt]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[bt]=!0;let r=dy(t);for(let n of r)if(n===Gr)t.nodes&&t.each(i=>{i[bt]||this.walkSync(i)});else{let i=this.listeners[n];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Hr.registerPostcss=e=>{wu=e};var py=Hr;Hr.default=Hr;JT.registerLazyResult(Hr);qT.registerLazyResult(Hr);var eM=Gg,tM=hs,rM=ny,nM=oc,iM=rc,vu=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=tM;this.result=new iM(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new eM(o,i,this._opts,r);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||rM("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,r=nM;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},oM=vu;vu.default=vu;var sM=oM,aM=py,lM=tc,uM=ni,Yn=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new sM(this,t,r):new aM(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},cM=Yn;Yn.default=Yn;uM.registerProcessor(Yn);lM.registerProcessor(Yn);var dM=gs,fM=Vg,pM=bs,hM=nc,mM=ys,gM=ni,yM=ic;function Jn(e,t){if(Array.isArray(e))return e.map(i=>Jn(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:mM.prototype};o.map&&(o.map={...o.map,__proto__:fM.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>Jn(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new gM(n);if(n.type==="decl")return new dM(n);if(n.type==="rule")return new yM(n);if(n.type==="comment")return new pM(n);if(n.type==="atrule")return new hM(n);throw new Error("Unknown node type: "+e.type)}var bM=Jn;Jn.default=Jn;var SM=Xu,hy=gs,wM=py,vM=gr,sc=cM,xM=hs,RM=bM,my=tc,kM=iy,gy=bs,yy=nc,EM=rc,CM=ys,AM=oc,IM=uy,by=ic,Sy=ni,PM=ms;function ne(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new sc(e)}ne.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
67
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var sc=os;os.default=os;zT.registerParse(os);var{isClean:bt,my:qT}=ri,KT=qg,YT=hs,JT=gr,ZT=rc,XT=oy,Xm=nc,QT=sc,eM=ni,tM={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},rM={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},nM={Once:!0,postcssPlugin:!0,prepare:!0},Gr=0;function jn(e){return typeof e=="object"&&typeof e.then=="function"}function py(e){let t=!1,r=tM[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Gr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Gr,r+"Exit"]:[r,r+"Exit"]}function Qm(e){let t;return e.type==="document"?t=["Document",Gr,"DocumentExit"]:e.type==="root"?t=["Root",Gr,"RootExit"]:t=py(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function wu(e){return e[bt]=!1,e.nodes&&e.nodes.forEach(t=>wu(t)),e}var vu={},Hr=class hy{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=wu(r);else if(r instanceof hy||r instanceof Xm)i=wu(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=QT;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[qT]&&JT.rebuild(i)}this.result=new Xm(t,i,n),this.helpers={...vu,postcss:vu,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!rM[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!nM[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(jn(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[bt];){t[bt]=!0;let r=[Qm(t)];for(;r.length>0;){let n=this.visitTick(r);if(jn(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return jn(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=YT;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new KT(r,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let r=this.runOnRoot(t);if(jn(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[bt];)t[bt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||XT("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(jn(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[bt]){a[bt]=!0,t.push(Qm(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Gr){n.nodes&&n.nodes.length&&(n[bt]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[bt]=!0;let r=py(t);for(let n of r)if(n===Gr)t.nodes&&t.each(i=>{i[bt]||this.walkSync(i)});else{let i=this.listeners[n];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Hr.registerPostcss=e=>{vu=e};var my=Hr;Hr.default=Hr;eM.registerLazyResult(Hr);ZT.registerLazyResult(Hr);var iM=qg,oM=hs,sM=oy,aM=sc,lM=nc,xu=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=oM;this.result=new lM(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new iM(o,i,this._opts,r);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||sM("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,r=aM;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},uM=xu;xu.default=xu;var cM=uM,dM=my,fM=rc,pM=ni,Yn=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new cM(this,t,r):new dM(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},hM=Yn;Yn.default=Yn;pM.registerProcessor(Yn);fM.registerProcessor(Yn);var mM=gs,gM=Ug,yM=bs,bM=ic,SM=ys,wM=ni,vM=oc;function Jn(e,t){if(Array.isArray(e))return e.map(i=>Jn(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:SM.prototype};o.map&&(o.map={...o.map,__proto__:gM.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>Jn(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new wM(n);if(n.type==="decl")return new mM(n);if(n.type==="rule")return new vM(n);if(n.type==="comment")return new yM(n);if(n.type==="atrule")return new bM(n);throw new Error("Unknown node type: "+e.type)}var xM=Jn;Jn.default=Jn;var RM=Qu,gy=gs,kM=my,EM=gr,ac=hM,CM=hs,AM=xM,yy=rc,IM=sy,by=bs,Sy=ic,PM=nc,TM=ys,MM=sc,OM=dy,wy=oc,vy=ni,NM=ms;function ne(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new ac(e)}ne.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
68
68
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
69
- https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new sc().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return ne([i(l)]).process(s,a)},i};ne.stringify=xM;ne.parse=AM;ne.fromJSON=RM;ne.list=IM;ne.comment=e=>new gy(e);ne.atRule=e=>new yy(e);ne.decl=e=>new hy(e);ne.rule=e=>new by(e);ne.root=e=>new Sy(e);ne.document=e=>new my(e);ne.CssSyntaxError=SM;ne.Declaration=hy;ne.Container=vM;ne.Processor=sc;ne.Document=my;ne.Comment=gy;ne.Warning=kM;ne.AtRule=yy;ne.Result=EM;ne.Input=CM;ne.Rule=by;ne.Root=Sy;ne.Node=PM;wM.registerPostcss(ne);var TM=ne;ne.default=ne;var he=VP(TM);he.stringify;he.fromJSON;he.plugin;he.parse;he.list;he.document;he.comment;he.atRule;he.rule;he.decl;he.root;he.CssSyntaxError;he.Declaration;he.Container;he.Processor;he.Document;he.Comment;he.Warning;he.AtRule;he.Result;he.Input;he.Rule;he.Root;he.Node;var MM=Object.defineProperty,OM=(e,t,r)=>t in e?MM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qe=(e,t,r)=>OM(e,typeof t!="symbol"?t+"":t,r);function NM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function LM(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var ac={exports:{}},pe=String,wy=function(){return{isColorSupported:!1,reset:pe,bold:pe,dim:pe,italic:pe,underline:pe,inverse:pe,hidden:pe,strikethrough:pe,black:pe,red:pe,green:pe,yellow:pe,blue:pe,magenta:pe,cyan:pe,white:pe,gray:pe,bgBlack:pe,bgRed:pe,bgGreen:pe,bgYellow:pe,bgBlue:pe,bgMagenta:pe,bgCyan:pe,bgWhite:pe}};ac.exports=wy();ac.exports.createColors=wy;var $M=ac.exports,DM={},_M=Object.freeze(Object.defineProperty({__proto__:null,default:DM},Symbol.toStringTag,{value:"Module"})),ut=LM(_M),Xm=$M,Qm=ut,xu=class vy extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof r<"u"&&typeof n<"u"&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,vy)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=Xm.isColorSupported),Qm&&t&&(r=Qm(r));let n=r.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=Xm.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return n.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let h=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
69
+ https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new ac().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return ne([i(l)]).process(s,a)},i};ne.stringify=CM;ne.parse=MM;ne.fromJSON=AM;ne.list=OM;ne.comment=e=>new by(e);ne.atRule=e=>new Sy(e);ne.decl=e=>new gy(e);ne.rule=e=>new wy(e);ne.root=e=>new vy(e);ne.document=e=>new yy(e);ne.CssSyntaxError=RM;ne.Declaration=gy;ne.Container=EM;ne.Processor=ac;ne.Document=yy;ne.Comment=by;ne.Warning=IM;ne.AtRule=Sy;ne.Result=PM;ne.Input=TM;ne.Rule=wy;ne.Root=vy;ne.Node=NM;kM.registerPostcss(ne);var LM=ne;ne.default=ne;var he=zP(LM);he.stringify;he.fromJSON;he.plugin;he.parse;he.list;he.document;he.comment;he.atRule;he.rule;he.decl;he.root;he.CssSyntaxError;he.Declaration;he.Container;he.Processor;he.Document;he.Comment;he.Warning;he.AtRule;he.Result;he.Input;he.Rule;he.Root;he.Node;var $M=Object.defineProperty,DM=(e,t,r)=>t in e?$M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qe=(e,t,r)=>DM(e,typeof t!="symbol"?t+"":t,r);function _M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function FM(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var lc={exports:{}},pe=String,xy=function(){return{isColorSupported:!1,reset:pe,bold:pe,dim:pe,italic:pe,underline:pe,inverse:pe,hidden:pe,strikethrough:pe,black:pe,red:pe,green:pe,yellow:pe,blue:pe,magenta:pe,cyan:pe,white:pe,gray:pe,bgBlack:pe,bgRed:pe,bgGreen:pe,bgYellow:pe,bgBlue:pe,bgMagenta:pe,bgCyan:pe,bgWhite:pe}};lc.exports=xy();lc.exports.createColors=xy;var jM=lc.exports,VM={},BM=Object.freeze(Object.defineProperty({__proto__:null,default:VM},Symbol.toStringTag,{value:"Module"})),ut=FM(BM),eg=jM,tg=ut,Ru=class Ry extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof r<"u"&&typeof n<"u"&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ry)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=eg.isColorSupported),tg&&t&&(r=tg(r));let n=r.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=eg.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return n.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let h=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
70
70
  `+h+a("^")}return" "+l(p)+u}).join(`
71
71
  `)}toString(){let t=this.showSourceCode();return t&&(t=`
72
72
 
73
73
  `+t+`
74
- `),this.name+": "+this.message+t}},lc=xu;xu.default=xu;var ii={};ii.isClean=Symbol("isClean");ii.my=Symbol("my");var eg={after:`
74
+ `),this.name+": "+this.message+t}},uc=Ru;Ru.default=Ru;var ii={};ii.isClean=Symbol("isClean");ii.my=Symbol("my");var rg={after:`
75
75
  `,beforeClose:`
76
76
  `,beforeComment:`
77
77
  `,beforeDecl:`
78
78
  `,beforeOpen:" ",beforeRule:`
79
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function FM(e){return e[0].toUpperCase()+e.slice(1)}var Ru=class{constructor(t){this.builder=t}atrule(t,r){let n="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?n+=t.raws.afterName:i&&(n+=" "),t.nodes)this.block(t,n+i);else{let o=(t.raws.between||"")+(r?";":"");this.builder(n+i+o,t)}}beforeAfter(t,r){let n;t.type==="decl"?n=this.raw(t,null,"beforeDecl"):t.type==="comment"?n=this.raw(t,null,"beforeComment"):r==="before"?n=this.raw(t,null,"beforeRule"):n=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(n.includes(`
80
- `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return eg[n];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[n]<"u")return s.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(t,n);{let a="raw"+FM(n);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[r],typeof i<"u")return!1})}return typeof i>"u"&&(i=eg[n]),s.rawCache[n]=i,i}rawBeforeClose(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return r=n.raws.after,r.includes(`
79
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function UM(e){return e[0].toUpperCase()+e.slice(1)}var ku=class{constructor(t){this.builder=t}atrule(t,r){let n="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?n+=t.raws.afterName:i&&(n+=" "),t.nodes)this.block(t,n+i);else{let o=(t.raws.between||"")+(r?";":"");this.builder(n+i+o,t)}}beforeAfter(t,r){let n;t.type==="decl"?n=this.raw(t,null,"beforeDecl"):t.type==="comment"?n=this.raw(t,null,"beforeComment"):r==="before"?n=this.raw(t,null,"beforeRule"):n=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(n.includes(`
80
+ `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return rg[n];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[n]<"u")return s.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(t,n);{let a="raw"+UM(n);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[r],typeof i<"u")return!1})}return typeof i>"u"&&(i=rg[n]),s.rawCache[n]=i,i}rawBeforeClose(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return r=n.raws.after,r.includes(`
81
81
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawBeforeComment(t,r){let n;return t.walkComments(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
82
82
  `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(t,r){let n;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
83
83
  `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(t){let r;return t.walk(n=>{if(n.type!=="decl"&&(r=n.raws.between,typeof r<"u"))return!1}),r}rawBeforeRule(t){let r;return t.walk(n=>{if(n.nodes&&(n.parent!==t||t.first!==n)&&typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
84
84
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawColon(t){let r;return t.walkDecls(n=>{if(typeof n.raws.between<"u")return r=n.raws.between.replace(/[^\s:]/g,""),!1}),r}rawEmptyBody(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length===0&&(r=n.raws.after,typeof r<"u"))return!1}),r}rawIndent(t){if(t.raws.indent)return t.raws.indent;let r;return t.walk(n=>{let i=n.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof n.raws.before<"u"){let o=n.raws.before.split(`
85
- `);return r=o[o.length-1],r=r.replace(/\S/g,""),!1}}),r}rawSemicolon(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(r=n.raws.semicolon,typeof r<"u"))return!1}),r}rawValue(t,r){let n=t[r],i=t.raws[r];return i&&i.value===n?i.raw:n}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)}},xy=Ru;Ru.default=Ru;var jM=xy;function ku(e,t){new jM(t).stringify(e)}var Ss=ku;ku.default=ku;var{isClean:No,my:VM}=ii,BM=lc,UM=xy,WM=Ss;function Eu(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let i=e[n],o=typeof i;n==="parent"&&o==="object"?t&&(r[n]=t):n==="source"?r[n]=i:Array.isArray(i)?r[n]=i.map(s=>Eu(s,r)):(o==="object"&&i!==null&&(i=Eu(i)),r[n]=i)}return r}var Cu=class{constructor(t={}){this.raws={},this[No]=!1,this[VM]=!0;for(let r in t)if(r==="nodes"){this.nodes=[];for(let n of t[r])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[r]=t[r]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${r.input.from}:${r.start.line}:${r.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let r in t)this[r]=t[r];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let r=Eu(this);for(let n in t)r[n]=t[n];return r}cloneAfter(t={}){let r=this.clone(t);return this.parent.insertAfter(this,r),r}cloneBefore(t={}){let r=this.clone(t);return this.parent.insertBefore(this,r),r}error(t,r={}){if(this.source){let{end:n,start:i}=this.rangeBy(r);return this.source.input.error(t,{column:i.column,line:i.line},{column:n.column,line:n.line},r)}return new BM(t)}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:r==="root"?()=>t.root().toProxy():t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}}markDirty(){if(this[No]){this[No]=!1;let t=this;for(;t=t.parent;)t[No]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,r){let n=this.source.start;if(t.index)n=this.positionInside(t.index,r);else if(t.word){r=this.toString();let i=r.indexOf(t.word);i!==-1&&(n=this.positionInside(i,r))}return n}positionInside(t,r){let n=r||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)n[s]===`
86
- `?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new UM().raw(this,t,r)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let r=this,n=!1;for(let i of t)i===this?n=!0:n?(this.parent.insertAfter(r,i),r=i):this.parent.insertBefore(r,i);n||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,r){let n={},i=r==null;r=r||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))n[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,r):l);else if(typeof a=="object"&&a.toJSON)n[s]=a.toJSON(null,r);else if(s==="source"){let l=r.get(a.input);l==null&&(l=o,r.set(a.input,o),o++),n[s]={end:a.end,inputId:l,start:a.start}}else n[s]=a}return i&&(n.inputs=[...r.keys()].map(s=>s.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=WM){t.stringify&&(t=t.stringify);let r="";return t(this,n=>{r+=n}),r}warn(t,r,n){let i={node:this};for(let o in n)i[o]=n[o];return t.warn(r,i)}get proxyOf(){return this}},ws=Cu;Cu.default=Cu;var zM=ws,Au=class extends zM{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},vs=Au;Au.default=Au;var GM="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",HM=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},qM=(e=21)=>{let t="",r=e;for(;r--;)t+=GM[Math.random()*64|0];return t},KM={nanoid:qM,customAlphabet:HM},{SourceMapConsumer:tg,SourceMapGenerator:rg}=ut,{existsSync:YM,readFileSync:JM}=ut,{dirname:Xl,join:ZM}=ut;function XM(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Iu=class{constructor(t,r){if(r.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let n=r.map?r.map.prev:void 0,i=this.loadMap(r.from,n);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=Xl(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new tg(this.text)),this.consumerCache}decodeInline(t){let r=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(r.test(t)||n.test(t))return XM(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!r)return;let n=t.lastIndexOf(r.pop()),i=t.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(n,i)))}loadFile(t){if(this.root=Xl(t),YM(t))return this.mapFile=t,JM(t,"utf-8").toString().trim()}loadMap(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){let n=r(t);if(n){let i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(r instanceof tg)return rg.fromSourceMap(r).toString();if(r instanceof rg)return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let n=this.annotation;return t&&(n=ZM(Xl(t),n)),this.loadFile(n)}}}startWith(t,r){return t?t.substr(0,r.length)===r:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Ry=Iu;Iu.default=Iu;var{SourceMapConsumer:QM,SourceMapGenerator:eO}=ut,{fileURLToPath:ng,pathToFileURL:Lo}=ut,{isAbsolute:Pu,resolve:Tu}=ut,{nanoid:tO}=KM,Ql=ut,ig=lc,rO=Ry,eu=Symbol("fromOffsetCache"),nO=!!(QM&&eO),og=!!(Tu&&Pu),ss=class{constructor(t,r={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,r.from&&(!og||/^\w+:\/\//.test(r.from)||Pu(r.from)?this.file=r.from:this.file=Tu(r.from)),og&&nO){let n=new rO(this.css,r);if(n.text){this.map=n;let i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+tO(6)+">"),this.map&&(this.map.file=this.from)}error(t,r,n,i={}){let o,s,a;if(r&&typeof r=="object"){let u=r,c=n;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);r=d.line,n=d.col}else r=u.line,n=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);s=d.line,a=d.col}else s=c.line,a=c.column}else if(!n){let u=this.fromOffset(r);r=u.line,n=u.col}let l=this.origin(r,n,s,a);return l?o=new ig(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new ig(t,s===void 0?r:{column:n,line:r},s===void 0?n:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:n,endColumn:a,endLine:s,line:r,source:this.css},this.file&&(Lo&&(o.input.url=Lo(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let r,n;if(this[eu])n=this[eu];else{let o=this.css.split(`
87
- `);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[eu]=n}r=n[n.length-1];let i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<n[s])o=s-1;else if(t>=n[s+1])i=s+1;else{i=s;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Tu(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,n,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:r,line:t});if(!s.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:i,line:n}));let l;Pu(s.source)?l=Lo(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||Lo(this.map.mapFile));let u={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(ng)u.file=ng(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let t={};for(let r of["hasBOM","css","file","id"])this[r]!=null&&(t[r]=this[r]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},xs=ss;ss.default=ss;Ql&&Ql.registerInput&&Ql.registerInput(ss);var{SourceMapConsumer:ky,SourceMapGenerator:qo}=ut,{dirname:Ko,relative:Ey,resolve:Cy,sep:Ay}=ut,{pathToFileURL:sg}=ut,iO=xs,oO=!!(ky&&qo),sO=!!(Ko&&Cy&&Ey&&Ay),aO=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let r=`
85
+ `);return r=o[o.length-1],r=r.replace(/\S/g,""),!1}}),r}rawSemicolon(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(r=n.raws.semicolon,typeof r<"u"))return!1}),r}rawValue(t,r){let n=t[r],i=t.raws[r];return i&&i.value===n?i.raw:n}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)}},ky=ku;ku.default=ku;var WM=ky;function Eu(e,t){new WM(t).stringify(e)}var Ss=Eu;Eu.default=Eu;var{isClean:No,my:zM}=ii,GM=uc,HM=ky,qM=Ss;function Cu(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let i=e[n],o=typeof i;n==="parent"&&o==="object"?t&&(r[n]=t):n==="source"?r[n]=i:Array.isArray(i)?r[n]=i.map(s=>Cu(s,r)):(o==="object"&&i!==null&&(i=Cu(i)),r[n]=i)}return r}var Au=class{constructor(t={}){this.raws={},this[No]=!1,this[zM]=!0;for(let r in t)if(r==="nodes"){this.nodes=[];for(let n of t[r])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[r]=t[r]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${r.input.from}:${r.start.line}:${r.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let r in t)this[r]=t[r];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let r=Cu(this);for(let n in t)r[n]=t[n];return r}cloneAfter(t={}){let r=this.clone(t);return this.parent.insertAfter(this,r),r}cloneBefore(t={}){let r=this.clone(t);return this.parent.insertBefore(this,r),r}error(t,r={}){if(this.source){let{end:n,start:i}=this.rangeBy(r);return this.source.input.error(t,{column:i.column,line:i.line},{column:n.column,line:n.line},r)}return new GM(t)}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:r==="root"?()=>t.root().toProxy():t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}}markDirty(){if(this[No]){this[No]=!1;let t=this;for(;t=t.parent;)t[No]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,r){let n=this.source.start;if(t.index)n=this.positionInside(t.index,r);else if(t.word){r=this.toString();let i=r.indexOf(t.word);i!==-1&&(n=this.positionInside(i,r))}return n}positionInside(t,r){let n=r||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)n[s]===`
86
+ `?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new HM().raw(this,t,r)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let r=this,n=!1;for(let i of t)i===this?n=!0:n?(this.parent.insertAfter(r,i),r=i):this.parent.insertBefore(r,i);n||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,r){let n={},i=r==null;r=r||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))n[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,r):l);else if(typeof a=="object"&&a.toJSON)n[s]=a.toJSON(null,r);else if(s==="source"){let l=r.get(a.input);l==null&&(l=o,r.set(a.input,o),o++),n[s]={end:a.end,inputId:l,start:a.start}}else n[s]=a}return i&&(n.inputs=[...r.keys()].map(s=>s.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=qM){t.stringify&&(t=t.stringify);let r="";return t(this,n=>{r+=n}),r}warn(t,r,n){let i={node:this};for(let o in n)i[o]=n[o];return t.warn(r,i)}get proxyOf(){return this}},ws=Au;Au.default=Au;var KM=ws,Iu=class extends KM{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},vs=Iu;Iu.default=Iu;var YM="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",JM=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},ZM=(e=21)=>{let t="",r=e;for(;r--;)t+=YM[Math.random()*64|0];return t},XM={nanoid:ZM,customAlphabet:JM},{SourceMapConsumer:ng,SourceMapGenerator:ig}=ut,{existsSync:QM,readFileSync:eO}=ut,{dirname:Ql,join:tO}=ut;function rO(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Pu=class{constructor(t,r){if(r.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let n=r.map?r.map.prev:void 0,i=this.loadMap(r.from,n);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=Ql(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new ng(this.text)),this.consumerCache}decodeInline(t){let r=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(r.test(t)||n.test(t))return rO(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!r)return;let n=t.lastIndexOf(r.pop()),i=t.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(n,i)))}loadFile(t){if(this.root=Ql(t),QM(t))return this.mapFile=t,eO(t,"utf-8").toString().trim()}loadMap(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){let n=r(t);if(n){let i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(r instanceof ng)return ig.fromSourceMap(r).toString();if(r instanceof ig)return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let n=this.annotation;return t&&(n=tO(Ql(t),n)),this.loadFile(n)}}}startWith(t,r){return t?t.substr(0,r.length)===r:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Ey=Pu;Pu.default=Pu;var{SourceMapConsumer:nO,SourceMapGenerator:iO}=ut,{fileURLToPath:og,pathToFileURL:Lo}=ut,{isAbsolute:Tu,resolve:Mu}=ut,{nanoid:oO}=XM,eu=ut,sg=uc,sO=Ey,tu=Symbol("fromOffsetCache"),aO=!!(nO&&iO),ag=!!(Mu&&Tu),ss=class{constructor(t,r={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,r.from&&(!ag||/^\w+:\/\//.test(r.from)||Tu(r.from)?this.file=r.from:this.file=Mu(r.from)),ag&&aO){let n=new sO(this.css,r);if(n.text){this.map=n;let i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+oO(6)+">"),this.map&&(this.map.file=this.from)}error(t,r,n,i={}){let o,s,a;if(r&&typeof r=="object"){let u=r,c=n;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);r=d.line,n=d.col}else r=u.line,n=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);s=d.line,a=d.col}else s=c.line,a=c.column}else if(!n){let u=this.fromOffset(r);r=u.line,n=u.col}let l=this.origin(r,n,s,a);return l?o=new sg(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new sg(t,s===void 0?r:{column:n,line:r},s===void 0?n:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:n,endColumn:a,endLine:s,line:r,source:this.css},this.file&&(Lo&&(o.input.url=Lo(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let r,n;if(this[tu])n=this[tu];else{let o=this.css.split(`
87
+ `);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[tu]=n}r=n[n.length-1];let i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<n[s])o=s-1;else if(t>=n[s+1])i=s+1;else{i=s;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Mu(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,n,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:r,line:t});if(!s.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:i,line:n}));let l;Tu(s.source)?l=Lo(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||Lo(this.map.mapFile));let u={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(og)u.file=og(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let t={};for(let r of["hasBOM","css","file","id"])this[r]!=null&&(t[r]=this[r]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},xs=ss;ss.default=ss;eu&&eu.registerInput&&eu.registerInput(ss);var{SourceMapConsumer:Cy,SourceMapGenerator:qo}=ut,{dirname:Ko,relative:Ay,resolve:Iy,sep:Py}=ut,{pathToFileURL:lg}=ut,lO=xs,uO=!!(Cy&&qo),cO=!!(Ko&&Iy&&Ay&&Py),dO=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let r=`
88
88
  `;this.css.includes(`\r
89
89
  `)&&(r=`\r
90
- `),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||Ko(t.file),i;this.mapOpts.sourcesContent===!1?(i=new ky(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),sO&&oO&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,r=>{t+=r}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=qo.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new qo({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new qo({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,r=1,n="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=t,i.generated.column=r-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
91
- `),r=a.length-s):r+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(r=>r.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?Ko(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=Ko(Cy(n,this.mapOpts.annotation)));let i=Ey(n,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new iO(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let r=this.memoizedFileURLs.get(t);if(r)return r;if(sg){let n=sg(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;Ay==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Iy=aO,lO=ws,Mu=class extends lO{constructor(t){super(t),this.type="comment"}},Rs=Mu;Mu.default=Mu;var{isClean:Py,my:Ty}=ii,My=vs,Oy=Rs,uO=ws,Ny,uc,cc,Ly;function $y(e){return e.map(t=>(t.nodes&&(t.nodes=$y(t.nodes)),delete t.source,t))}function Dy(e){if(e[Py]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Dy(t)}var Mt=class _y extends uO{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=$y(Ny(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new My(t)]}else if(t.selector)t=[new uc(t)];else if(t.name)t=[new cc(t)];else if(t.text)t=[new Oy(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Ty]||_y.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Py]&&Dy(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Mt.registerParse=e=>{Ny=e};Mt.registerRule=e=>{uc=e};Mt.registerAtRule=e=>{cc=e};Mt.registerRoot=e=>{Ly=e};var yr=Mt;Mt.default=Mt;Mt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,cc.prototype):e.type==="rule"?Object.setPrototypeOf(e,uc.prototype):e.type==="decl"?Object.setPrototypeOf(e,My.prototype):e.type==="comment"?Object.setPrototypeOf(e,Oy.prototype):e.type==="root"&&Object.setPrototypeOf(e,Ly.prototype),e[Ty]=!0,e.nodes&&e.nodes.forEach(t=>{Mt.rebuild(t)})};var cO=yr,Fy,jy,Zn=class extends cO{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Fy(new jy,this,t).stringify()}};Zn.registerLazyResult=e=>{Fy=e};Zn.registerProcessor=e=>{jy=e};var dc=Zn;Zn.default=Zn;var ag={},Vy=function(t){ag[t]||(ag[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Ou=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},By=Ou;Ou.default=Ou;var dO=By,Nu=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new dO(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},fc=Nu;Nu.default=Nu;var tu=39,lg=34,$o=92,ug=47,Do=10,Vn=32,_o=12,Fo=9,jo=13,fO=91,pO=93,hO=40,mO=41,gO=123,yO=125,bO=59,SO=42,wO=58,vO=64,Vo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Bo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,xO=/.[\r\n"'(/\\]/,cg=/[\da-f]/i,RO=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=n.length,g=0,S=[],w=[];function y(){return g}function x(M){throw t.error("Unclosed "+M,g)}function E(){return w.length===0&&g>=m}function N(M){if(w.length)return w.pop();if(g>=m)return;let C=M?M.ignoreUnclosed:!1;switch(o=n.charCodeAt(g),o){case Do:case Vn:case Fo:case jo:case _o:{s=g;do s+=1,o=n.charCodeAt(s);while(o===Vn||o===Do||o===Fo||o===jo||o===_o);f=["space",n.slice(g,s)],g=s-1;break}case fO:case pO:case gO:case yO:case wO:case bO:case mO:{let V=String.fromCharCode(o);f=[V,V,g];break}case hO:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==tu&&h!==lg&&h!==Vn&&h!==Do&&h!==Fo&&h!==_o&&h!==jo){s=g;do{if(c=!1,s=n.indexOf(")",s+1),s===-1)if(i||C){s=g;break}else x("bracket");for(d=s;n.charCodeAt(d-1)===$o;)d-=1,c=!c}while(c);f=["brackets",n.slice(g,s+1),g,s],g=s}else s=n.indexOf(")",g+1),l=n.slice(g,s+1),s===-1||xO.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case tu:case lg:{a=o===tu?"'":'"',s=g;do{if(c=!1,s=n.indexOf(a,s+1),s===-1)if(i||C){s=g+1;break}else x("string");for(d=s;n.charCodeAt(d-1)===$o;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case vO:{Vo.lastIndex=g+1,Vo.test(n),Vo.lastIndex===0?s=n.length-1:s=Vo.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case $o:{for(s=g,u=!0;n.charCodeAt(s+1)===$o;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==ug&&o!==Vn&&o!==Do&&o!==Fo&&o!==jo&&o!==_o&&(s+=1,cg.test(n.charAt(s)))){for(;cg.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===Vn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===ug&&n.charCodeAt(g+1)===SO?(s=n.indexOf("*/",g+2)+1,s===0&&(i||C?s=n.length:x("comment")),f=["comment",n.slice(g,s+1),g,s],g=s):(Bo.lastIndex=g+1,Bo.test(n),Bo.lastIndex===0?s=n.length-1:s=Bo.lastIndex-2,f=["word",n.slice(g,s+1),g,s],S.push(f),g=s);break}}return g++,f}function I(M){w.push(M)}return{back:I,endOfFile:E,nextToken:N,position:y}},Uy=yr,as=class extends Uy{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}},pc=as;as.default=as;Uy.registerAtRule(as);var Wy=yr,zy,Gy,qr=class extends Wy{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new zy(new Gy,this,t).stringify()}};qr.registerLazyResult=e=>{zy=e};qr.registerProcessor=e=>{Gy=e};var oi=qr;qr.default=qr;Wy.registerRoot(qr);var Xn={comma(e){return Xn.split(e,[","],!0)},space(e){let t=[" ",`
92
- `," "];return Xn.split(e,t)},split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let c of e)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?s+=1:c===")"?s>0&&(s-=1):s===0&&t.includes(c)&&(o=!0),o?(i!==""&&n.push(i.trim()),i="",o=!1):i+=c;return(r||i!=="")&&n.push(i.trim()),n}},Hy=Xn;Xn.default=Xn;var qy=yr,kO=Hy,ls=class extends qy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return kO.comma(this.selector)}set selectors(t){let r=this.selector?this.selector.match(/,\s*/):null,n=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(n)}},hc=ls;ls.default=ls;qy.registerRule(ls);var EO=vs,CO=RO,AO=Rs,IO=pc,PO=oi,dg=hc,fg={empty:!0,space:!0};function TO(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var MO=class{constructor(t){this.input=t,this.root=new PO,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let r=new IO;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),n=t[0],n==="("||n==="["?u.push(n==="("?")":"]"):n==="{"&&u.length>0?u.push("}"):n===u[u.length-1]&&u.pop(),u.length===0)if(n===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){a=!0;break}else if(n==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(r.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(r,"params",l),s&&(t=l[l.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let r=this.colon(t);if(r===!1)return;let n=0,i;for(let o=r-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(n+=1,n===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let r=0,n,i,o;for(let[s,a]of t.entries()){if(n=a,i=n[0],i==="("&&(r+=1),i===")"&&(r-=1),r===0&&i===":")if(!o)this.doubleColon(n);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=n}return!1}comment(t){let r=new AO;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;let n=t[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=i[2],r.raws.left=i[1],r.raws.right=i[3]}}createTokenizer(){this.tokenizer=CO(this.input)}decl(t,r){let n=new EO;this.init(n,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(i[3]||i[2]||TO(t)),n.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;n.prop+=t.shift()[1]}n.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){n.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){n.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(n.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let p=u;p>0;p--){let h=c[p][0];if(d.trim().indexOf("!")===0&&h!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(n.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(n,"value",s.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let r=new dg;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}}init(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let r=!1,n=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(n=u[0],l.push(u),n==="("||n==="[")o||(o=u),s.push(n==="("?")":"]");else if(a&&i&&n==="{")o||(o=u),s.push("}");else if(s.length===0)if(n===";")if(i){this.decl(l,a);return}else break;else if(n==="{"){this.rule(l);return}else if(n==="}"){this.tokenizer.back(l.pop()),r=!0;break}else n===":"&&(i=!0);else n===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),s.length>0&&this.unclosedBracket(o),r&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,r,n,i){let o,s,a=n.length,l="",u=!0,c,d;for(let p=0;p<a;p+=1)o=n[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=n[p-1]?n[p-1][0]:"empty",c=n[p+1]?n[p+1][0]:"empty",!fg[d]&&!fg[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=n.reduce((h,f)=>h+f[1],"");t.raws[r]={raw:p,value:l}}t[r]=l}rule(t){t.pop();let r=new dg;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r}spacesAndCommentsFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)n=t.pop()[1]+n;return n}spacesAndCommentsFromStart(t){let r,n="";for(;t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)n+=t.shift()[1];return n}spacesFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],r==="space");)n=t.pop()[1]+n;return n}stringFrom(t,r){let n="";for(let i=r;i<t.length;i++)n+=t[i][1];return t.splice(r,t.length-r),n}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})}},OO=MO,NO=yr,LO=OO,$O=xs;function us(e,t){let r=new $O(e,t),n=new LO(r);try{n.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
90
+ `),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||Ko(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Cy(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),cO&&uO&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,r=>{t+=r}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=qo.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new qo({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new qo({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,r=1,n="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=t,i.generated.column=r-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
91
+ `),r=a.length-s):r+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(r=>r.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?Ko(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=Ko(Iy(n,this.mapOpts.annotation)));let i=Ay(n,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new lO(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let r=this.memoizedFileURLs.get(t);if(r)return r;if(lg){let n=lg(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;Py==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Ty=dO,fO=ws,Ou=class extends fO{constructor(t){super(t),this.type="comment"}},Rs=Ou;Ou.default=Ou;var{isClean:My,my:Oy}=ii,Ny=vs,Ly=Rs,pO=ws,$y,cc,dc,Dy;function _y(e){return e.map(t=>(t.nodes&&(t.nodes=_y(t.nodes)),delete t.source,t))}function Fy(e){if(e[My]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Fy(t)}var Mt=class jy extends pO{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=_y($y(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Ny(t)]}else if(t.selector)t=[new cc(t)];else if(t.name)t=[new dc(t)];else if(t.text)t=[new Ly(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Oy]||jy.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[My]&&Fy(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Mt.registerParse=e=>{$y=e};Mt.registerRule=e=>{cc=e};Mt.registerAtRule=e=>{dc=e};Mt.registerRoot=e=>{Dy=e};var yr=Mt;Mt.default=Mt;Mt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,dc.prototype):e.type==="rule"?Object.setPrototypeOf(e,cc.prototype):e.type==="decl"?Object.setPrototypeOf(e,Ny.prototype):e.type==="comment"?Object.setPrototypeOf(e,Ly.prototype):e.type==="root"&&Object.setPrototypeOf(e,Dy.prototype),e[Oy]=!0,e.nodes&&e.nodes.forEach(t=>{Mt.rebuild(t)})};var hO=yr,Vy,By,Zn=class extends hO{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Vy(new By,this,t).stringify()}};Zn.registerLazyResult=e=>{Vy=e};Zn.registerProcessor=e=>{By=e};var fc=Zn;Zn.default=Zn;var ug={},Uy=function(t){ug[t]||(ug[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Nu=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},Wy=Nu;Nu.default=Nu;var mO=Wy,Lu=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new mO(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},pc=Lu;Lu.default=Lu;var ru=39,cg=34,$o=92,dg=47,Do=10,Vn=32,_o=12,Fo=9,jo=13,gO=91,yO=93,bO=40,SO=41,wO=123,vO=125,xO=59,RO=42,kO=58,EO=64,Vo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Bo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,CO=/.[\r\n"'(/\\]/,fg=/[\da-f]/i,AO=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=n.length,g=0,S=[],w=[];function y(){return g}function x(M){throw t.error("Unclosed "+M,g)}function E(){return w.length===0&&g>=m}function N(M){if(w.length)return w.pop();if(g>=m)return;let C=M?M.ignoreUnclosed:!1;switch(o=n.charCodeAt(g),o){case Do:case Vn:case Fo:case jo:case _o:{s=g;do s+=1,o=n.charCodeAt(s);while(o===Vn||o===Do||o===Fo||o===jo||o===_o);f=["space",n.slice(g,s)],g=s-1;break}case gO:case yO:case wO:case vO:case kO:case xO:case SO:{let V=String.fromCharCode(o);f=[V,V,g];break}case bO:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==ru&&h!==cg&&h!==Vn&&h!==Do&&h!==Fo&&h!==_o&&h!==jo){s=g;do{if(c=!1,s=n.indexOf(")",s+1),s===-1)if(i||C){s=g;break}else x("bracket");for(d=s;n.charCodeAt(d-1)===$o;)d-=1,c=!c}while(c);f=["brackets",n.slice(g,s+1),g,s],g=s}else s=n.indexOf(")",g+1),l=n.slice(g,s+1),s===-1||CO.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case ru:case cg:{a=o===ru?"'":'"',s=g;do{if(c=!1,s=n.indexOf(a,s+1),s===-1)if(i||C){s=g+1;break}else x("string");for(d=s;n.charCodeAt(d-1)===$o;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case EO:{Vo.lastIndex=g+1,Vo.test(n),Vo.lastIndex===0?s=n.length-1:s=Vo.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case $o:{for(s=g,u=!0;n.charCodeAt(s+1)===$o;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==dg&&o!==Vn&&o!==Do&&o!==Fo&&o!==jo&&o!==_o&&(s+=1,fg.test(n.charAt(s)))){for(;fg.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===Vn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===dg&&n.charCodeAt(g+1)===RO?(s=n.indexOf("*/",g+2)+1,s===0&&(i||C?s=n.length:x("comment")),f=["comment",n.slice(g,s+1),g,s],g=s):(Bo.lastIndex=g+1,Bo.test(n),Bo.lastIndex===0?s=n.length-1:s=Bo.lastIndex-2,f=["word",n.slice(g,s+1),g,s],S.push(f),g=s);break}}return g++,f}function I(M){w.push(M)}return{back:I,endOfFile:E,nextToken:N,position:y}},zy=yr,as=class extends zy{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}},hc=as;as.default=as;zy.registerAtRule(as);var Gy=yr,Hy,qy,qr=class extends Gy{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new Hy(new qy,this,t).stringify()}};qr.registerLazyResult=e=>{Hy=e};qr.registerProcessor=e=>{qy=e};var oi=qr;qr.default=qr;Gy.registerRoot(qr);var Xn={comma(e){return Xn.split(e,[","],!0)},space(e){let t=[" ",`
92
+ `," "];return Xn.split(e,t)},split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let c of e)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?s+=1:c===")"?s>0&&(s-=1):s===0&&t.includes(c)&&(o=!0),o?(i!==""&&n.push(i.trim()),i="",o=!1):i+=c;return(r||i!=="")&&n.push(i.trim()),n}},Ky=Xn;Xn.default=Xn;var Yy=yr,IO=Ky,ls=class extends Yy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return IO.comma(this.selector)}set selectors(t){let r=this.selector?this.selector.match(/,\s*/):null,n=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(n)}},mc=ls;ls.default=ls;Yy.registerRule(ls);var PO=vs,TO=AO,MO=Rs,OO=hc,NO=oi,pg=mc,hg={empty:!0,space:!0};function LO(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var $O=class{constructor(t){this.input=t,this.root=new NO,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let r=new OO;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),n=t[0],n==="("||n==="["?u.push(n==="("?")":"]"):n==="{"&&u.length>0?u.push("}"):n===u[u.length-1]&&u.pop(),u.length===0)if(n===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){a=!0;break}else if(n==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(r.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(r,"params",l),s&&(t=l[l.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let r=this.colon(t);if(r===!1)return;let n=0,i;for(let o=r-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(n+=1,n===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let r=0,n,i,o;for(let[s,a]of t.entries()){if(n=a,i=n[0],i==="("&&(r+=1),i===")"&&(r-=1),r===0&&i===":")if(!o)this.doubleColon(n);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=n}return!1}comment(t){let r=new MO;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;let n=t[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=i[2],r.raws.left=i[1],r.raws.right=i[3]}}createTokenizer(){this.tokenizer=TO(this.input)}decl(t,r){let n=new PO;this.init(n,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(i[3]||i[2]||LO(t)),n.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;n.prop+=t.shift()[1]}n.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){n.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){n.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(n.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let p=u;p>0;p--){let h=c[p][0];if(d.trim().indexOf("!")===0&&h!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(n.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(n,"value",s.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let r=new pg;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}}init(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let r=!1,n=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(n=u[0],l.push(u),n==="("||n==="[")o||(o=u),s.push(n==="("?")":"]");else if(a&&i&&n==="{")o||(o=u),s.push("}");else if(s.length===0)if(n===";")if(i){this.decl(l,a);return}else break;else if(n==="{"){this.rule(l);return}else if(n==="}"){this.tokenizer.back(l.pop()),r=!0;break}else n===":"&&(i=!0);else n===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),s.length>0&&this.unclosedBracket(o),r&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,r,n,i){let o,s,a=n.length,l="",u=!0,c,d;for(let p=0;p<a;p+=1)o=n[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=n[p-1]?n[p-1][0]:"empty",c=n[p+1]?n[p+1][0]:"empty",!hg[d]&&!hg[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=n.reduce((h,f)=>h+f[1],"");t.raws[r]={raw:p,value:l}}t[r]=l}rule(t){t.pop();let r=new pg;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r}spacesAndCommentsFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)n=t.pop()[1]+n;return n}spacesAndCommentsFromStart(t){let r,n="";for(;t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)n+=t.shift()[1];return n}spacesFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],r==="space");)n=t.pop()[1]+n;return n}stringFrom(t,r){let n="";for(let i=r;i<t.length;i++)n+=t[i][1];return t.splice(r,t.length-r),n}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})}},DO=$O,_O=yr,FO=DO,jO=xs;function us(e,t){let r=new jO(e,t),n=new FO(r);try{n.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
93
93
  You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
94
94
  You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
95
- You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var mc=us;us.default=us;NO.registerParse(us);var{isClean:St,my:DO}=ii,_O=Iy,FO=Ss,jO=yr,VO=dc,BO=Vy,pg=fc,UO=mc,WO=oi,zO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},GO={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},HO={Once:!0,postcssPlugin:!0,prepare:!0},Kr=0;function Bn(e){return typeof e=="object"&&typeof e.then=="function"}function Ky(e){let t=!1,r=zO[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Kr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Kr,r+"Exit"]:[r,r+"Exit"]}function hg(e){let t;return e.type==="document"?t=["Document",Kr,"DocumentExit"]:e.type==="root"?t=["Root",Kr,"RootExit"]:t=Ky(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Lu(e){return e[St]=!1,e.nodes&&e.nodes.forEach(t=>Lu(t)),e}var $u={},Yr=class Yy{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=Lu(r);else if(r instanceof Yy||r instanceof pg)i=Lu(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=UO;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[DO]&&jO.rebuild(i)}this.result=new pg(t,i,n),this.helpers={...$u,postcss:$u,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!GO[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!HO[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(Bn(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[St];){t[St]=!0;let r=[hg(t)];for(;r.length>0;){let n=this.visitTick(r);if(Bn(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return Bn(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=FO;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new _O(r,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let r=this.runOnRoot(t);if(Bn(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[St];)t[St]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||BO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Bn(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[St]){a[St]=!0,t.push(hg(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Kr){n.nodes&&n.nodes.length&&(n[St]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[St]=!0;let r=Ky(t);for(let n of r)if(n===Kr)t.nodes&&t.each(i=>{i[St]||this.walkSync(i)});else{let i=this.listeners[n];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Yr.registerPostcss=e=>{$u=e};var Jy=Yr;Yr.default=Yr;WO.registerLazyResult(Yr);VO.registerLazyResult(Yr);var qO=Iy,KO=Ss,YO=Vy,JO=mc,ZO=fc,Du=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=KO;this.result=new ZO(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new qO(o,i,this._opts,r);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||YO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,r=JO;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},XO=Du;Du.default=Du;var QO=XO,e2=Jy,t2=dc,r2=oi,Qn=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new QO(this,t,r):new e2(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},n2=Qn;Qn.default=Qn;r2.registerProcessor(Qn);t2.registerProcessor(Qn);var i2=vs,o2=Ry,s2=Rs,a2=pc,l2=xs,u2=oi,c2=hc;function ei(e,t){if(Array.isArray(e))return e.map(i=>ei(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:l2.prototype};o.map&&(o.map={...o.map,__proto__:o2.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>ei(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new u2(n);if(n.type==="decl")return new i2(n);if(n.type==="rule")return new c2(n);if(n.type==="comment")return new s2(n);if(n.type==="atrule")return new a2(n);throw new Error("Unknown node type: "+e.type)}var d2=ei;ei.default=ei;var f2=lc,Zy=vs,p2=Jy,h2=yr,gc=n2,m2=Ss,g2=d2,Xy=dc,y2=By,Qy=Rs,eb=pc,b2=fc,S2=xs,w2=mc,v2=Hy,tb=hc,rb=oi,x2=ws;function ie(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new gc(e)}ie.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
95
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var gc=us;us.default=us;_O.registerParse(us);var{isClean:St,my:VO}=ii,BO=Ty,UO=Ss,WO=yr,zO=fc,GO=Uy,mg=pc,HO=gc,qO=oi,KO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},YO={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},JO={Once:!0,postcssPlugin:!0,prepare:!0},Kr=0;function Bn(e){return typeof e=="object"&&typeof e.then=="function"}function Jy(e){let t=!1,r=KO[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Kr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Kr,r+"Exit"]:[r,r+"Exit"]}function gg(e){let t;return e.type==="document"?t=["Document",Kr,"DocumentExit"]:e.type==="root"?t=["Root",Kr,"RootExit"]:t=Jy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function $u(e){return e[St]=!1,e.nodes&&e.nodes.forEach(t=>$u(t)),e}var Du={},Yr=class Zy{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=$u(r);else if(r instanceof Zy||r instanceof mg)i=$u(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=HO;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[VO]&&WO.rebuild(i)}this.result=new mg(t,i,n),this.helpers={...Du,postcss:Du,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!YO[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!JO[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(Bn(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[St];){t[St]=!0;let r=[gg(t)];for(;r.length>0;){let n=this.visitTick(r);if(Bn(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return Bn(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=UO;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new BO(r,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let r=this.runOnRoot(t);if(Bn(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[St];)t[St]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||GO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Bn(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[St]){a[St]=!0,t.push(gg(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Kr){n.nodes&&n.nodes.length&&(n[St]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[St]=!0;let r=Jy(t);for(let n of r)if(n===Kr)t.nodes&&t.each(i=>{i[St]||this.walkSync(i)});else{let i=this.listeners[n];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Yr.registerPostcss=e=>{Du=e};var Xy=Yr;Yr.default=Yr;qO.registerLazyResult(Yr);zO.registerLazyResult(Yr);var ZO=Ty,XO=Ss,QO=Uy,e2=gc,t2=pc,_u=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=XO;this.result=new t2(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new ZO(o,i,this._opts,r);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||QO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,r=e2;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},r2=_u;_u.default=_u;var n2=r2,i2=Xy,o2=fc,s2=oi,Qn=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new n2(this,t,r):new i2(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},a2=Qn;Qn.default=Qn;s2.registerProcessor(Qn);o2.registerProcessor(Qn);var l2=vs,u2=Ey,c2=Rs,d2=hc,f2=xs,p2=oi,h2=mc;function ei(e,t){if(Array.isArray(e))return e.map(i=>ei(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:f2.prototype};o.map&&(o.map={...o.map,__proto__:u2.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>ei(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new p2(n);if(n.type==="decl")return new l2(n);if(n.type==="rule")return new h2(n);if(n.type==="comment")return new c2(n);if(n.type==="atrule")return new d2(n);throw new Error("Unknown node type: "+e.type)}var m2=ei;ei.default=ei;var g2=uc,Qy=vs,y2=Xy,b2=yr,yc=a2,S2=Ss,w2=m2,eb=fc,v2=Wy,tb=Rs,rb=hc,x2=pc,R2=xs,k2=gc,E2=Ky,nb=mc,ib=oi,C2=ws;function ie(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new yc(e)}ie.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
96
96
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
97
- https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new gc().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return ie([i(l)]).process(s,a)},i};ie.stringify=m2;ie.parse=w2;ie.fromJSON=g2;ie.list=v2;ie.comment=e=>new Qy(e);ie.atRule=e=>new eb(e);ie.decl=e=>new Zy(e);ie.rule=e=>new tb(e);ie.root=e=>new rb(e);ie.document=e=>new Xy(e);ie.CssSyntaxError=f2;ie.Declaration=Zy;ie.Container=h2;ie.Processor=gc;ie.Document=Xy;ie.Comment=Qy;ie.Warning=y2;ie.AtRule=eb;ie.Result=b2;ie.Input=S2;ie.Rule=tb;ie.Root=rb;ie.Node=x2;p2.registerPostcss(ie);var R2=ie;ie.default=ie;var me=NM(R2);me.stringify;me.fromJSON;me.plugin;me.parse;me.list;me.document;me.comment;me.atRule;me.rule;me.decl;me.root;me.CssSyntaxError;me.Declaration;me.Container;me.Processor;me.Document;me.Comment;me.Warning;me.AtRule;me.Result;me.Input;me.Rule;me.Root;me.Node;var _u=class e{constructor(...t){Qe(this,"parentElement",null),Qe(this,"parentNode",null),Qe(this,"ownerDocument"),Qe(this,"firstChild",null),Qe(this,"lastChild",null),Qe(this,"previousSibling",null),Qe(this,"nextSibling",null),Qe(this,"ELEMENT_NODE",1),Qe(this,"TEXT_NODE",3),Qe(this,"nodeType"),Qe(this,"nodeName"),Qe(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var mg={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},gg={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Uo={},k2=()=>!!globalThis.Zone;function yc(e){if(Uo[e])return Uo[e];let t=globalThis[e],r=t.prototype,n=e in mg?mg[e]:void 0,i=!!(n&&n.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in gg?gg[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!k2())return Uo[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let u=l[e].prototype;return document.body.removeChild(a),u?Uo[e]=u:r}catch{return r}}var ru={};function Nt(e,t,r){var n;let i=`${e}.${String(r)}`;if(ru[i])return ru[i].call(t);let o=yc(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(ru[i]=s,s.call(t)):t[r]}var nu={};function nb(e,t,r){let n=`${e}.${String(r)}`;if(nu[n])return nu[n].bind(t);let o=yc(e)[r];return typeof o!="function"?t[r]:(nu[n]=o,o.bind(t))}function E2(e){return Nt("Node",e,"ownerDocument")}function C2(e){return Nt("Node",e,"childNodes")}function A2(e){return Nt("Node",e,"parentNode")}function I2(e){return Nt("Node",e,"parentElement")}function P2(e){return Nt("Node",e,"textContent")}function T2(e,t){return nb("Node",e,"contains")(t)}function M2(e){return nb("Node",e,"getRootNode")()}function O2(e){return!e||!("host"in e)?null:Nt("ShadowRoot",e,"host")}function N2(e){return e.styleSheets}function L2(e){return!e||!("shadowRoot"in e)?null:Nt("Element",e,"shadowRoot")}function $2(e,t){return Nt("Element",e,"querySelector")(t)}function D2(e,t){return Nt("Element",e,"querySelectorAll")(t)}function ib(){return yc("MutationObserver").constructor}function br(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var U={ownerDocument:E2,childNodes:C2,parentNode:A2,parentElement:I2,textContent:P2,contains:T2,getRootNode:M2,host:O2,styleSheets:N2,shadowRoot:L2,querySelector:$2,querySelectorAll:D2,mutationObserver:ib,patch:br};function Fe(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var jr=`Please stop import mirror directly. Instead of that,\r
97
+ https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new yc().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return ie([i(l)]).process(s,a)},i};ie.stringify=S2;ie.parse=k2;ie.fromJSON=w2;ie.list=E2;ie.comment=e=>new tb(e);ie.atRule=e=>new rb(e);ie.decl=e=>new Qy(e);ie.rule=e=>new nb(e);ie.root=e=>new ib(e);ie.document=e=>new eb(e);ie.CssSyntaxError=g2;ie.Declaration=Qy;ie.Container=b2;ie.Processor=yc;ie.Document=eb;ie.Comment=tb;ie.Warning=v2;ie.AtRule=rb;ie.Result=x2;ie.Input=R2;ie.Rule=nb;ie.Root=ib;ie.Node=C2;y2.registerPostcss(ie);var A2=ie;ie.default=ie;var me=_M(A2);me.stringify;me.fromJSON;me.plugin;me.parse;me.list;me.document;me.comment;me.atRule;me.rule;me.decl;me.root;me.CssSyntaxError;me.Declaration;me.Container;me.Processor;me.Document;me.Comment;me.Warning;me.AtRule;me.Result;me.Input;me.Rule;me.Root;me.Node;var Fu=class e{constructor(...t){Qe(this,"parentElement",null),Qe(this,"parentNode",null),Qe(this,"ownerDocument"),Qe(this,"firstChild",null),Qe(this,"lastChild",null),Qe(this,"previousSibling",null),Qe(this,"nextSibling",null),Qe(this,"ELEMENT_NODE",1),Qe(this,"TEXT_NODE",3),Qe(this,"nodeType"),Qe(this,"nodeName"),Qe(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var yg={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},bg={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Uo={},I2=()=>!!globalThis.Zone;function bc(e){if(Uo[e])return Uo[e];let t=globalThis[e],r=t.prototype,n=e in yg?yg[e]:void 0,i=!!(n&&n.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in bg?bg[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!I2())return Uo[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let u=l[e].prototype;return document.body.removeChild(a),u?Uo[e]=u:r}catch{return r}}var nu={};function Nt(e,t,r){var n;let i=`${e}.${String(r)}`;if(nu[i])return nu[i].call(t);let o=bc(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(nu[i]=s,s.call(t)):t[r]}var iu={};function ob(e,t,r){let n=`${e}.${String(r)}`;if(iu[n])return iu[n].bind(t);let o=bc(e)[r];return typeof o!="function"?t[r]:(iu[n]=o,o.bind(t))}function P2(e){return Nt("Node",e,"ownerDocument")}function T2(e){return Nt("Node",e,"childNodes")}function M2(e){return Nt("Node",e,"parentNode")}function O2(e){return Nt("Node",e,"parentElement")}function N2(e){return Nt("Node",e,"textContent")}function L2(e,t){return ob("Node",e,"contains")(t)}function $2(e){return ob("Node",e,"getRootNode")()}function D2(e){return!e||!("host"in e)?null:Nt("ShadowRoot",e,"host")}function _2(e){return e.styleSheets}function F2(e){return!e||!("shadowRoot"in e)?null:Nt("Element",e,"shadowRoot")}function j2(e,t){return Nt("Element",e,"querySelector")(t)}function V2(e,t){return Nt("Element",e,"querySelectorAll")(t)}function sb(){return bc("MutationObserver").constructor}function br(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var U={ownerDocument:P2,childNodes:T2,parentNode:M2,parentElement:O2,textContent:N2,contains:L2,getRootNode:$2,host:D2,styleSheets:_2,shadowRoot:F2,querySelector:j2,querySelectorAll:V2,mutationObserver:sb,patch:br};function Fe(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var jr=`Please stop import mirror directly. Instead of that,\r
98
98
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
99
- or you can use record.mirror to access the mirror instance during recording.`,yg={map:{},getId(){return console.error(jr),-1},getNode(){return console.error(jr),null},removeNodeFromMap(){console.error(jr)},has(){return console.error(jr),!1},reset(){console.error(jr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(yg=new Proxy(yg,{get(e,t,r){return t==="map"&&console.error(jr),Reflect.get(e,t,r)}}));function ti(e,t,r={}){let n=null,i=0;return function(...o){let s=Date.now();!i&&r.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(l,o)},a))}}function ks(e,t,r,n,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>ks(e,t,o||{},!0)}var cs=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(cs=()=>new Date().getTime());function ob(e){var t,r,n,i;let o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||o?.body&&((t=U.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o?.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:o?.documentElement.scrollTop||o?.body&&((n=U.parentElement(o.body))==null?void 0:n.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}function sb(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ab(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function lb(e){return e?e.nodeType===e.ELEMENT_NODE?e:U.parentElement(e):null}function je(e,t,r,n){if(!e)return!1;let i=lb(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(ts(i,t,n))return!0}catch{}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function _2(e,t){return t.getId(e)!==-1}function iu(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===Hn}function ub(e,t){if(Wn(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=U.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?ub(n,t):!0}function Fu(e){return!!e.changedTouches}function F2(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function cb(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function db(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ju(e){return e?e instanceof _u&&"shadowRoot"in e?!!e.shadowRoot:!!U.shadowRoot(e):!1}var Vu=class{constructor(){k(this,"id",1),k(this,"styleIDMap",new WeakMap),k(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function fb(e){var t;let r=null;return"getRootNode"in e&&((t=U.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&U.host(U.getRootNode(e))&&(r=U.host(U.getRootNode(e))),r}function j2(e){let t=e,r;for(;r=fb(t);)t=r;return t}function V2(e){let t=U.ownerDocument(e);if(!t)return!1;let r=j2(e);return U.contains(t,r)}function pb(e){let t=U.ownerDocument(e);return t?U.contains(t,e)||V2(e):!1}var H=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(H||{}),z=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(z||{}),We=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(We||{}),Pt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Pt||{}),Jr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Jr||{}),Vr=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Vr||{});var hb=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(hb||{});function bg(e){return"__ln"in e}var Bu=class{constructor(){k(this,"length",0),k(this,"head",null),k(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){let r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&bg(t.previousSibling)){let n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&bg(t.nextSibling)&&t.nextSibling.__ln.previous){let n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){let r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},Sg=(e,t)=>`${e}@${t}`,Uu=class{constructor(){k(this,"frozen",!1),k(this,"locked",!1),k(this,"texts",[]),k(this,"attributes",[]),k(this,"attributeMap",new WeakMap),k(this,"removes",[]),k(this,"mapRemoves",[]),k(this,"movedMap",{}),k(this,"addedSet",new Set),k(this,"movedSet",new Set),k(this,"droppedSet",new Set),k(this,"removesSubTreeCache",new Set),k(this,"mutationCb"),k(this,"blockClass"),k(this,"blockSelector"),k(this,"maskTextClass"),k(this,"maskTextSelector"),k(this,"inlineStylesheet"),k(this,"maskInputOptions"),k(this,"maskTextFn"),k(this,"maskInputFn"),k(this,"keepIframeSrcFn"),k(this,"recordCanvas"),k(this,"inlineImages"),k(this,"slimDOMOptions"),k(this,"dataURLOptions"),k(this,"doc"),k(this,"mirror"),k(this,"iframeManager"),k(this,"stylesheetManager"),k(this,"shadowDomManager"),k(this,"canvasManager"),k(this,"processedNodeManager"),k(this,"unattachedDoc"),k(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),k(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set,n=new Bu,i=l=>{let u=l,c=Hn;for(;c===Hn;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=U.parentNode(l);if(!u||!pb(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let f=u.tagName;if(f==="TEXTAREA")return;f==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=Wn(u)?this.mirror.getId(fb(l)):this.mirror.getId(u),p=i(l);if(d===-1||p===-1)return n.addNode(l);let h=Ur(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{cb(f,this.mirror)&&this.iframeManager.addIframe(f),db(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),ju(l)&&this.shadowDomManager.addShadowRoot(U.shadowRoot(l),this.doc)},onIframeLoad:(f,m)=>{this.iframeManager.attachIframe(f,m),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,m)=>{this.stylesheetManager.attachLinkElement(f,m)},cssCaptured:c});h&&(t.push({parentId:d,nextId:p,node:h}),r.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)wg(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(U.parentNode(l))||o(l);for(let l of this.addedSet)!vg(this.droppedSet,l)&&!wg(this.removesSubTreeCache,l,this.mirror)||vg(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;n.length;){let l=null;if(s){let u=this.mirror.getId(U.parentNode(s.value)),c=i(s.value);u!==-1&&c!==-1&&(l=s)}if(!l){let u=n.tail;for(;u;){let c=u;if(u=u.previous,c){let d=this.mirror.getId(U.parentNode(c.value));if(i(c.value)===-1)continue;if(d!==-1){l=c;break}else{let h=c.value,f=U.parentNode(h);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=U.host(f);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}s=l.previous,n.removeNode(l.value),o(l.value)}let a={texts:this.texts.map(l=>{let u=l.node,c=U.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:u}=l;if(typeof u.style=="string"){let c=JSON.stringify(l.styleDiff),d=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+d).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),k(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(U.childNodes(t),i=>U.textContent(i)||"").join("");r.attributes.value=Xo({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Qo(t),value:n,maskInputFn:this.maskInputFn})}),k(this,"processMutation",t=>{if(!iu(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=U.textContent(t.target);!je(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:$g(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,lb(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){let s=Qo(r);i=Xo({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(je(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Lg(r.tagName,n))if(o.attributes[n]=Ng(this.doc,mr(r.tagName),mr(n),i),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let s=this.unattachedDoc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue);for(let a of Array.from(r.style)){let l=r.style.getPropertyValue(a),u=r.style.getPropertyPriority(a);l!==s.style.getPropertyValue(a)||u!==s.style.getPropertyPriority(a)?u===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,u]:o._unchangedStyles[a]=[l,u]}for(let a of Array.from(s.style))r.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(je(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),i=Wn(t.target)?this.mirror.getId(U.host(t.target)):this.mirror.getId(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||iu(r,this.mirror,this.slimDOMOptions)||!_2(r,this.mirror)||(this.addedSet.has(r)?(Wu(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||ub(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Sg(n,i)]?Wu(this.movedSet,r):(this.removes.push({parentId:i,id:n,isShadow:Wn(t.target)&&zn(t.target)?!0:void 0}),B2(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),k(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(iu(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Sg(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);je(t,this.blockClass,this.blockSelector,!1)||(U.childNodes(t).forEach(n=>this.genAdds(n)),ju(t)&&U.childNodes(U.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Wu(e,t){e.delete(t),U.childNodes(t).forEach(r=>Wu(e,r))}function B2(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),U.childNodes(n).forEach(i=>r.push(i)))}}function wg(e,t,r){return e.size===0?!1:U2(e,t)}function U2(e,t,r){let n=U.parentNode(t);return n?e.has(n):!1}function vg(e,t){return e.size===0?!1:mb(e,t)}function mb(e,t){let r=U.parentNode(t);return r?e.has(r)?!0:mb(e,r):!1}var Gn;function W2(e){Gn=e}function z2(){Gn=void 0}var Y=e=>Gn?(...r)=>{try{return e(...r)}catch(n){if(Gn&&Gn(n)===!0)return;throw n}}:e,hr=[];function si(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function gb(e,t){let r=new Uu;hr.push(r),r.init(e);let n=new(ib())(Y(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function G2({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=ti(Y(d=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),d),s=[],a=null}),o),u=Y(ti(Y(d=>{let p=si(d),{clientX:h,clientY:f}=Fu(d)?d.changedTouches[0]:d;a||(a=cs()),s.push({x:h,y:f,id:n.getId(p),timeOffset:cs()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?z.Drag:d instanceof MouseEvent?z.MouseMove:z.TouchMove)}),i,{trailing:!1})),c=[Fe("mousemove",u,r),Fe("touchmove",u,r),Fe("drag",u,r)];return Y(()=>{c.forEach(d=>d())})}function H2({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=null,u=c=>d=>{let p=si(d);if(je(p,n,i,!0))return;let h=null,f=c;if("pointerType"in d){switch(d.pointerType){case"mouse":h=Pt.Mouse;break;case"touch":h=Pt.Touch;break;case"pen":h=Pt.Pen;break}h===Pt.Touch?We[c]===We.MouseDown?f="TouchStart":We[c]===We.MouseUp&&(f="TouchEnd"):Pt.Pen}else Fu(d)&&(h=Pt.Touch);h!==null?(l=h,(f.startsWith("Touch")&&h===Pt.Touch||f.startsWith("Mouse")&&h===Pt.Mouse)&&(h=null)):We[c]===We.Click&&(h=l,l=null);let m=Fu(d)?d.changedTouches[0]:d;if(!m)return;let g=r.getId(p),{clientX:S,clientY:w}=m;Y(e)({type:We[f],id:g,x:S,y:w,...h!==null&&{pointerType:h}})};return Object.keys(We).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=mr(c),p=u(c);if(window.PointerEvent)switch(We[c]){case We.MouseDown:case We.MouseUp:d=d.replace("mouse","pointer");break;case We.TouchStart:case We.TouchEnd:return}a.push(Fe(d,p,t))}),Y(()=>{a.forEach(c=>c())})}function yb({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){let s=Y(ti(Y(a=>{let l=si(a);if(!l||je(l,n,i,!0))return;let u=r.getId(l);if(l===t&&t.defaultView){let c=ob(t.defaultView);e({id:u,x:c.left,y:c.top})}else e({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return Fe("scroll",s,t)}function q2({viewportResizeCb:e},{win:t}){let r=-1,n=-1,i=Y(ti(Y(()=>{let o=sb(),s=ab();(r!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),r=o,n=s)}),200));return Fe("resize",i,t)}var K2=["INPUT","TEXTAREA","SELECT"],xg=new WeakMap;function Y2({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(w){let y=si(w),x=w.isTrusted,E=y&&y.tagName;if(y&&E==="OPTION"&&(y=U.parentElement(y)),!y||!E||K2.indexOf(E)<0||je(y,n,i,!0)||y.classList.contains(o)||s&&y.matches(s))return;let N=y.value,I=!1,M=Qo(y)||"";M==="radio"||M==="checkbox"?I=y.checked:(a[E.toLowerCase()]||a[M])&&(N=Xo({element:y,maskInputOptions:a,tagName:E,type:M,value:N,maskInputFn:l})),p(y,c?{text:N,isChecked:I,userTriggered:x}:{text:N,isChecked:I});let C=y.name;M==="radio"&&C&&I&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(V=>{if(V!==y){let Z=V.value;p(V,c?{text:Z,isChecked:!I,userTriggered:!1}:{text:Z,isChecked:!I})}})}function p(w,y){let x=xg.get(w);if(!x||x.text!==y.text||x.isChecked!==y.isChecked){xg.set(w,y);let E=r.getId(w);Y(e)({...y,id:E})}}let f=(u.input==="last"?["change"]:["input","change"]).map(w=>Fe(w,Y(d),t)),m=t.defaultView;if(!m)return()=>{f.forEach(w=>w())};let g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),S=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&f.push(...S.map(w=>ks(w[0],w[1],{set(){Y(d)({target:this,isTrusted:!1})}},!1,m))),Y(()=>{f.forEach(w=>w())})}function ds(e){let t=[];function r(n,i){if(Wo("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Wo("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Wo("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Wo("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(s)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(s)}return i}return r(e,t)}function Jt(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function J2({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Y((c,d,p)=>{let[h,f]=p,{id:m,styleId:g}=Jt(d,t,r.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,adds:[{rule:h,index:f}]}),c.apply(d,p)})}),n.CSSStyleSheet.prototype.addRule=function(c,d,p=this.cssRules.length){let h=`${c} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,p])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Jt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,removes:[{index:h}]}),c.apply(d,p)})}),n.CSSStyleSheet.prototype.removeRule=function(c){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Jt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replace:h}),c.apply(d,p)})}));let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Jt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replaceSync:h}),c.apply(d,p)})}));let l={};zo("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(zo("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),zo("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),zo("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));let u={};return Object.entries(l).forEach(([c,d])=>{u[c]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[c].insertRule,{apply:Y((p,h,f)=>{let[m,g]=f,{id:S,styleId:w}=Jt(h.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:m,index:[...ds(h),g||0]}]}),p.apply(h,f)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:Y((p,h,f)=>{let[m]=f,{id:g,styleId:S}=Jt(h.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,removes:[{index:[...ds(h),m]}]}),p.apply(h,f)})})}),Y(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function bb({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(U.host(r));let a=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(i=r.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;let d=(c=l.set)==null?void 0:c.call(this,u);if(s!==null&&s!==-1)try{t.adoptStyleSheets(u,s)}catch{}return d}}),Y(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Z2({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Y((a,l,u)=>{var c;let[d,p,h]=u;if(r.has(d))return o.apply(l,[d,p,h]);let{id:f,styleId:m}=Jt((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,set:{property:d,value:p,priority:h},index:ds(l.parentRule)}),a.apply(l,u)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Y((a,l,u)=>{var c;let[d]=u;if(r.has(d))return s.apply(l,[d]);let{id:p,styleId:h}=Jt((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,remove:{property:d},index:ds(l.parentRule)}),a.apply(l,u)})}),Y(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function X2({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){let s=Y(l=>ti(Y(u=>{let c=si(u);if(!c||je(c,t,r,!0))return;let{currentTime:d,volume:p,muted:h,playbackRate:f,loop:m}=c;e({type:l,id:n.getId(c),currentTime:d,volume:p,muted:h,playbackRate:f,loop:m})}),i.media||500)),a=[Fe("play",s(Vr.Play),o),Fe("pause",s(Vr.Pause),o),Fe("seeked",s(Vr.Seeked),o),Fe("volumechange",s(Vr.VolumeChange),o),Fe("ratechange",s(Vr.RateChange),o)];return Y(()=>{a.forEach(l=>l())})}function Q2({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(l,u,c){let d=new o(l,u,c);return i.set(d,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};let s=br(t.fonts,"add",function(a){return function(l){return setTimeout(Y(()=>{let u=i.get(l);u&&(e(u),i.delete(l))}),0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=o}),n.push(s),Y(()=>{n.forEach(a=>a())})}function e6(e){let{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,s=!0,a=Y(()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let u=[],c=l.rangeCount||0;for(let d=0;d<c;d++){let p=l.getRangeAt(d),{startContainer:h,startOffset:f,endContainer:m,endOffset:g}=p;je(h,n,i,!0)||je(m,n,i,!0)||u.push({start:r.getId(h),startOffset:f,end:r.getId(m),endOffset:g})}o({ranges:u})});return a(),Fe("selectionchange",a)}function t6({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:br(r.customElements,"define",function(i){return function(o,s,a){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,s,a])}})}function r6(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),i(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),o(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),s(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),a(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),l(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),u(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),c(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),p(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),h(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),f(...m)}}function n6(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};r6(e,t);let n;e.recordDOM&&(n=gb(e,e.doc));let i=G2(e),o=H2(e),s=yb(e),a=q2(e,{win:r}),l=Y2(e),u=X2(e),c=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(c=J2(e,{win:r}),d=bb(e,e.doc),p=Z2(e,{win:r}),e.collectFonts&&(h=Q2(e)));let f=e6(e),m=t6(e),g=[];for(let S of e.plugins)g.push(S.observer(S.callback,r,S.options));return Y(()=>{hr.forEach(S=>S.reset()),n?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),p(),h(),f(),m(),g.forEach(S=>S())})}function Wo(e){return typeof window[e]<"u"}function zo(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var fs=class{constructor(t){k(this,"iframeIdToRemoteIdMap",new WeakMap),k(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,i){let o=n||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(r);return a||(a=this.generateIdFn(),o.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){let i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=i.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},zu=class{constructor(t){k(this,"iframes",new WeakMap),k(this,"crossOriginIframeMap",new WeakMap),k(this,"crossOriginIframeMirror",new fs(Og)),k(this,"crossOriginIframeStyleMirror"),k(this,"crossOriginIframeRootIdMap",new WeakMap),k(this,"mirror"),k(this,"mutationCb"),k(this,"wrappedEmit"),k(this,"loadListener"),k(this,"stylesheetManager"),k(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new fs(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let i=this.crossOriginIframeMap.get(t.source);if(!i)return;let o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case H.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:H.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case H.Meta:case H.Load:case H.DomContentLoaded:return!1;case H.Plugin:return r;case H.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case H.IncrementalSnapshot:switch(r.data.source){case z.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case z.Drag:case z.TouchMove:case z.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(r.data,t,["id"]),r;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case z.Font:return r;case z.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case z.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,n,i){for(let o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==hb.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},Gu=class{constructor(t){k(this,"shadowDoms",new WeakSet),k(this,"mutationCb"),k(this,"scrollCb"),k(this,"bypassOptions"),k(this,"mirror"),k(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!zn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let n=gb({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(yb({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(U.host(t))),this.restoreHandlers.push(bb({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(br(t.prototype,"attachShadow",function(i){return function(o){let s=i.call(this,o),a=U.shadowRoot(this);return a&&pb(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i6=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Un=0;Un<Wr.length;Un++)i6[Wr.charCodeAt(Un)]=Un;var Un,o6=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=Wr[t[r]>>2],i+=Wr[(t[r]&3)<<4|t[r+1]>>4],i+=Wr[(t[r+1]&15)<<2|t[r+2]>>6],i+=Wr[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Rg=new Map;function s6(e,t){let r=Rg.get(e);return r||(r=new Map,Rg.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var Sb=(e,t,r)=>{if(!e||!(vb(e,t)||typeof e=="object"))return;let n=e.constructor.name,i=s6(r,n),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Yo(e,t,r){if(e instanceof Array)return e.map(n=>Yo(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,i=o6(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Yo(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Yo(e.data,t,r),e.width,e.height]};if(vb(e,t)||typeof e=="object"){let n=e.constructor.name,i=Sb(e,t,r);return{rr_type:n,index:i}}}}return e}var wb=(e,t,r)=>e.map(n=>Yo(n,t,r)),vb=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function a6(e,t,r,n){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=br(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...u){return je(this.canvas,r,n,!0)||setTimeout(()=>{let c=wb(u,t,this);e(this.canvas,{type:Jr["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=ks(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:Jr["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function l6(e){return e==="experimental-webgl"?"webgl":e}function kg(e,t,r,n){let i=[];try{let o=br(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!je(this,t,r,!0)){let u=l6(a);if("__context"in this||(this.__context=u),n&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){let c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[a,...l])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function Eg(e,t,r,n,i,o){let s=[],a=Object.getOwnPropertyNames(e);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let u=br(e,l,function(c){return function(...d){let p=c.apply(this,d);if(Sb(p,o,this),"tagName"in this.canvas&&!je(this.canvas,n,i,!0)){let h=wb(d,o,this),f={type:t,property:l,args:h};r(this.canvas,f)}return p}});s.push(u)}catch{let u=ks(e,l,{set(c){r(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function u6(e,t,r,n){let i=[];return i.push(...Eg(t.WebGLRenderingContext.prototype,Jr.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Eg(t.WebGL2RenderingContext.prototype,Jr.WebGL2,e,r,n,t)),()=>{i.forEach(o=>o())}}var xb="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",c6=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Cg=typeof window<"u"&&window.Blob&&new Blob([c6(xb)],{type:"text/javascript;charset=utf-8"});function d6(e){let t;try{if(t=Cg&&(window.URL||window.webkitURL).createObjectURL(Cg),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;base64,"+xb,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var Hu=class{constructor(t){k(this,"pendingCanvasMutations",new Map),k(this,"rafStamps",{latestId:0,invokeId:null}),k(this,"mirror"),k(this,"mutationCb"),k(this,"resetObservers"),k(this,"frozen",!1),k(this,"locked",!1),k(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});let{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,i,o){let s=kg(r,n,i,!0),a=new Map,l=new d6;l.onmessage=f=>{let{id:m}=f.data;if(a.set(m,!1),!("base64"in f.data))return;let{base64:g,type:S,width:w,height:y}=f.data;this.mutationCb({id:m,type:Jr["2D"],commands:[{property:"clearRect",args:[0,0,w,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:S}]},0,0]}]})};let u=1e3/t,c=0,d,p=()=>{let f=[];return r.document.querySelectorAll("canvas").forEach(m=>{je(m,n,i,!0)||f.push(m)}),f},h=f=>{if(c&&f-c<u){d=requestAnimationFrame(h);return}c=f,p().forEach(async m=>{var g;let S=this.mirror.getId(m);if(a.get(S)||m.width===0||m.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(m.__context)){let y=m.getContext(m.__context);((g=y?.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let w=await createImageBitmap(m);l.postMessage({id:S,bitmap:w,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[w])}),d=requestAnimationFrame(h)};d=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=kg(t,r,n,!1),o=a6(this.processMutation.bind(this),t,r,n),s=u6(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let i=n.map(s=>{let{type:a,...l}=s;return l}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}},qu=class{constructor(t){k(this,"trackedLinkElements",new WeakSet),k(this,"mutationCb"),k(this,"adoptedStyleSheetCb"),k(this,"styleMirror",new Vu),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},i=[];for(let o of t){let s;this.styleMirror.has(o)?s=this.styleMirror.getId(o):(s=this.styleMirror.add(o),i.push({styleId:s,rules:Array.from(o.rules||CSSRule,(a,l)=>({rule:Tg(a,o.href),index:l}))})),n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Ku=class{constructor(){k(this,"nodeMap",new WeakMap),k(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},we,Jo,ou,ps=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Im=e.contentWindow)==null?void 0:Im.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var at=hP();function Sr(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:h,maskInputFn:f,maskTextFn:m,hooks:g,packFn:S,sampling:w={},dataURLOptions:y={},mousemoveWait:x,recordDOM:E=!0,recordCanvas:N=!1,recordCrossOriginIframes:I=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:C=!1,collectFonts:V=!1,inlineImages:Z=!1,plugins:X,keepIframeSrcFn:F=()=>!1,ignoreCSSAttributes:$e=new Set([]),errorHandler:pt}=e;W2(pt);let Pe=I?window.parent===window:!0,Ze=!1;if(!Pe)try{window.parent.document&&(Ze=!1)}catch{Ze=!0}if(Pe&&!t)throw new Error("emit function is required");if(!Pe&&!Ze)return()=>{};x!==void 0&&w.mousemove===void 0&&(w.mousemove=x),at.reset();let ir=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},ht=Dg(h);F2();let kf,oa=0,Ef=Q=>{for(let tt of X||[])tt.eventProcessor&&(Q=tt.eventProcessor(Q));return S&&!Ze&&(Q=S(Q)),Q};we=(Q,tt)=>{var ye;let be=Q;if(be.timestamp=cs(),(ye=hr[0])!=null&&ye.isFrozen()&&be.type!==H.FullSnapshot&&!(be.type===H.IncrementalSnapshot&&be.data.source===z.Mutation)&&hr.forEach(Ge=>Ge.unfreeze()),Pe)t?.(Ef(be),tt);else if(Ze){let Ge={type:"rrweb",event:Ef(be),origin:window.location.origin,isCheckout:tt};window.parent.postMessage(Ge,"*")}if(be.type===H.FullSnapshot)kf=be,oa=0;else if(be.type===H.IncrementalSnapshot){if(be.data.source===z.Mutation&&be.data.isAttachIframe)return;oa++;let Ge=n&&oa>=n,se=r&&be.timestamp-kf.timestamp>r;(Ge||se)&&Jo(!0)}};let Ai=Q=>{we({type:H.IncrementalSnapshot,data:{source:z.Mutation,...Q}})},Cf=Q=>we({type:H.IncrementalSnapshot,data:{source:z.Scroll,...Q}}),Af=Q=>we({type:H.IncrementalSnapshot,data:{source:z.CanvasMutation,...Q}}),cx=Q=>we({type:H.IncrementalSnapshot,data:{source:z.AdoptedStyleSheet,...Q}}),or=new qu({mutationCb:Ai,adoptedStyleSheetCb:cx}),sr=new zu({mirror:at,mutationCb:Ai,stylesheetManager:or,recordCrossOriginIframes:I,wrappedEmit:we});for(let Q of X||[])Q.getMirror&&Q.getMirror({nodeMirror:at,crossOriginIframeMirror:sr.crossOriginIframeMirror,crossOriginIframeStyleMirror:sr.crossOriginIframeStyleMirror});let sa=new Ku;ou=new Hu({recordCanvas:N,mutationCb:Af,win:window,blockClass:i,blockSelector:o,mirror:at,sampling:w.canvas,dataURLOptions:y});let Ii=new Gu({mutationCb:Ai,scrollCb:Cf,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ir,dataURLOptions:y,maskTextFn:m,maskInputFn:f,recordCanvas:N,inlineImages:Z,sampling:w,slimDOMOptions:ht,iframeManager:sr,stylesheetManager:or,canvasManager:ou,keepIframeSrcFn:F,processedNodeManager:sa},mirror:at});Jo=(Q=!1)=>{if(!E)return;we({type:H.Meta,data:{href:window.location.href,width:ab(),height:sb()}},Q),or.reset(),Ii.init(),hr.forEach(ye=>ye.lock());let tt=FP(document,{mirror:at,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ir,maskTextFn:m,maskInputFn:f,slimDOM:ht,dataURLOptions:y,recordCanvas:N,inlineImages:Z,onSerialize:ye=>{cb(ye,at)&&sr.addIframe(ye),db(ye,at)&&or.trackLinkElement(ye),ju(ye)&&Ii.addShadowRoot(U.shadowRoot(ye),document)},onIframeLoad:(ye,be)=>{sr.attachIframe(ye,be),Ii.observeAttachShadow(ye)},onStylesheetLoad:(ye,be)=>{or.attachLinkElement(ye,be)},keepIframeSrcFn:F});if(!tt)return console.warn("Failed to snapshot the document");we({type:H.FullSnapshot,data:{node:tt,initialOffset:ob(window)}},Q),hr.forEach(ye=>ye.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&or.adoptStyleSheets(document.adoptedStyleSheets,at.getId(document))};try{let Q=[],tt=be=>{var Ge;return Y(n6)({mutationCb:Ai,mousemoveCb:(se,aa)=>we({type:H.IncrementalSnapshot,data:{source:aa,positions:se}}),mouseInteractionCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.MouseInteraction,...se}}),scrollCb:Cf,viewportResizeCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.ViewportResize,...se}}),inputCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.Input,...se}}),mediaInteractionCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.MediaInteraction,...se}}),styleSheetRuleCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.StyleSheetRule,...se}}),styleDeclarationCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.StyleDeclaration,...se}}),canvasMutationCb:Af,fontCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.Font,...se}}),selectionCb:se=>{we({type:H.IncrementalSnapshot,data:{source:z.Selection,...se}})},customElementCb:se=>{we({type:H.IncrementalSnapshot,data:{source:z.CustomElement,...se}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:ir,inlineStylesheet:c,sampling:w,recordDOM:E,recordCanvas:N,inlineImages:Z,userTriggeredOnInput:C,collectFonts:V,doc:be,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:F,blockSelector:o,slimDOMOptions:ht,dataURLOptions:y,mirror:at,iframeManager:sr,stylesheetManager:or,shadowDomManager:Ii,processedNodeManager:sa,canvasManager:ou,ignoreCSSAttributes:$e,plugins:((Ge=X?.filter(se=>se.observer))==null?void 0:Ge.map(se=>({observer:se.observer,options:se.options,callback:aa=>we({type:H.Plugin,data:{plugin:se.name,payload:aa}})})))||[]},g)};sr.addLoadListener(be=>{try{Q.push(tt(be.contentDocument))}catch(Ge){console.warn(Ge)}});let ye=()=>{Jo(),Q.push(tt(document)),ps=!0};return["interactive","complete"].includes(document.readyState)?ye():(Q.push(Fe("DOMContentLoaded",()=>{we({type:H.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&ye()})),Q.push(Fe("load",()=>{we({type:H.Load,data:{}}),M==="load"&&ye()},window))),()=>{Q.forEach(be=>{try{be()}catch(Ge){String(Ge).toLowerCase().includes("cross-origin")||console.warn(Ge)}}),sa.destroy(),ps=!1,z2()}}catch(Q){console.warn(Q)}}Sr.addCustomEvent=(e,t)=>{if(!ps)throw new Error("please add custom event after start recording");we({type:H.Custom,data:{tag:e,payload:t}})};Sr.freezePage=()=>{hr.forEach(e=>e.freeze())};Sr.takeFullSnapshot=e=>{if(!ps)throw new Error("please take full snapshot after start recording");Jo(e)};Sr.mirror=at;var Ag;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ag||(Ag={}));var Jz=5*1e3;var{addCustomEvent:Zz}=Sr,{freezePage:Xz}=Sr,{takeFullSnapshot:Qz}=Sr;var Eb="__ripploEmitRrwebEvent";function Cb(){return{eventTypes:Rb(H),incrementalSources:Rb(z)}}function Rb(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,r])=>[r,t]))}var p6=Gl("@ripplo/rrweb-bundle/bundle","rrweb.js"),kb;function Ab(){return kb??=f6(p6,{encoding:"utf8"}),kb}async function Sc({debugDir:e,writeOtlpPortFile:t}){let r=new Map,n=Em(Cb()),i=await Wa({localDir:Ib.join(Ib.dirname(e),".local"),writePortFile:t,onRrwebBatch:(a,l)=>{r.get(a)?.emitRrwebBatch(l)},onSpan:a=>{let l=a.attributes["ripplo.run"];l!=null&&r.get(l)?.emit(a)}}),o=await Ab();return{attach:async(a,l)=>{let u=Ip({debugDir:e,runId:l,worker:n});r.set(l,u),await Am(a,l),await a.addInitScript(`globalThis.__ripploCapturePort = ${String(i.port)};`),await m6(a,u);let c=[];return{emitAction:d=>{b6(u,d)},emitAssertion:d=>{S6(u,d)},finish:()=>g6(u,{pages:c,registry:r,runId:l}),onPage:d=>{c.push(d),y6(u,o,d)}}},close:async()=>{await i.stop(),await n.terminate()},injectSpan:(a,l)=>{r.get(a)?.emit(l)}}}async function h6(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function m6(e,t){await e.exposeBinding(Eb,(r,n)=>{let i=typeof n=="string"?n:JSON.stringify(n);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}async function g6(e,t){await h6(t.pages),t.registry.delete(t.runId),await e.close({noticeIfNoRrweb:"rrweb capture unavailable: recorder never pushed an event \u2014 page never loaded the recorder (blank page, failed navigation, or CSP block)"})}function y6(e,t,r){r.on("load",()=>{r.addScriptTag({content:t}).catch(()=>{})}),r.on("response",n=>{R6(e,n)}),r.on("console",n=>{e.emit({kind:"console",level:n.type(),source:"browser",text:n.text(),timeNanos:Tr(Date.now())})}),r.on("pageerror",n=>{e.emit({kind:"error",message:n.message,source:"browser",stack:n.stack,timeNanos:Tr(Date.now())})})}function b6(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:w6(t),timeNanos:Tr(Date.now()),value:v6(t)})}function S6(e,t){let r=zl(t);e.emit({kind:"assertion",label:r.label,outcome:t.outcome,source:"test",step:r.step,timeNanos:Tr(Date.now())})}function w6(e){if(e.url!=null)return e.url;if(e.locator!=null)return bc(e.locator)}function bc(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${bc(e.scope)} \u25B8 ${bc(e.target)}`:`${e.role} ${e.name??""}`.trim()}function v6(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var x6=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;function R6(e,t){let r=t.request(),n=r.resourceType();if(n!=="fetch"&&n!=="xhr"||x6.test(r.url()))return;let i=r.headers().traceparent?.split("-");e.emit({kind:"network",method:r.method(),resourceType:n,source:"browser",spanId:i?.[2],status:t.status(),timeNanos:Tr(Date.now()),traceId:i?.[1],url:t.url()})}import{err as z0,ok as Jd,ResultAsync as O8}from"neverthrow";function wc(e){return{invariants:kl(e),laws:vl(e)}}var Pb=Object.defineProperty,Tb=(e,t)=>{let r={};for(var n in e)Pb(r,n,{get:e[n],enumerable:!0});return t||Pb(r,Symbol.toStringTag,{value:"Module"}),r};var k6=class Mb{constructor(t){this.seed=t}clone(){return new Mb(this.seed)}next(){let t=vc(this.seed),r=xc(t),n=vc(t),i=xc(n);return this.seed=vc(n),xc(this.seed)+(i+(r<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function vc(e){return Math.imul(e,214013)+2531011&4294967295}function xc(e){return(e&-2147483649)>>16}function Ob(e){return new k6(e)}var E6="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",C6=class Lb{constructor(t,r){this.states=t,this.index=r}clone(){return new Lb(this.states.slice(),this.index)}next(){let t=this.states[this.index];return t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,this.index=Es(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),r=this.index;this.index=Es(this.states,this.index);for(let n=19932;n>0;--n)E6.charCodeAt(n/6|0)-48&1<<n%6&&Nb(this.states,this.index,t,r),this.index=Es(this.states,this.index);Nb(this.states,this.index,t,r)}};function Nb(e,t,r,n){let i=0;if(n>=t){for(;i<624-n;i++)e[i+t]^=r[i+n];for(;i<624-t;i++)e[i+t]^=r[i+n-624];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}else{for(;i<624-t;i++)e[i+t]^=r[i+n];for(;i<624-n;i++)e[i+t-624]^=r[i+n];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}}function Es(e,t){if(t<227){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397]^r>>>1^-(r&1)&2567483615,t+1}else if(t<623){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397-624]^r>>>1^-(r&1)&2567483615,t+1}else{let r=e[t]&2147483648|e[0]&2147483647;return e[t]=e[396]^r>>>1^-(r&1)&2567483615,0}}function A6(e){for(let t=0;t!==624;++t)Es(e,t)}function $b(e){let t=[e|0];for(let r=1;r!==624;++r){let n=t[r-1]^t[r-1]>>>30;t.push(Math.imul(1812433253,n)+r|0)}return A6(t),new C6(t,0)}var I6=class Db{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new Db(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00^this.s00<<23,r=this.s01^(this.s01<<23|this.s00>>>9),n=t^this.s10^(t>>>18|r<<14)^(this.s10>>>5|this.s11<<27),i=r^this.s11^r>>>18^this.s11>>>5,o=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=i,this.s10=n,o}jump(){let t=0,r=0,n=0,i=0,o=[1667051007,2321340297,1548169110,304075285];for(let s=0;s!==4;++s)for(let a=1;a;a<<=1)o[s]&a&&(t^=this.s01,r^=this.s00,n^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=r,this.s11=n,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Rc(e){return new I6(-1,~e,e|0,0)}var P6=class _b{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new _b(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00+this.s10|0,r=this.s10^this.s00,n=this.s11^this.s01,i=this.s00,o=this.s01;return this.s00=i<<24^o>>>8^r^r<<16,this.s01=o<<24^i>>>8^n^(n<<16|r>>>16),this.s10=n<<5^r>>>27,this.s11=r<<5^n>>>27,t}jump(){let t=0,r=0,n=0,i=0,o=[3639956645,3750757012,1261568508,386426335];for(let s=0;s!==4;++s)for(let a=1;a;a<<=1)o[s]&a&&(t^=this.s01,r^=this.s00,n^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=r,this.s11=n,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Fb(e){return new P6(-1,~e,e|0,0)}function jb(e,t){for(let r=0;r!==t;++r)e.next()}var Vb=BigInt,T6=4294967296n;function Ub(e,t,r){let n=r-t+1n,i=T6,o=1;for(;i<n;)i<<=32n,++o;let s=Bb(o,e);if(s<n)return s+t;if(s+n<i)return s%n+t;let a=i-i%n;for(;s>=a;)s=Bb(o,e);return s%n+t}function Bb(e,t){let r=Vb(t.next()+2147483648);for(let n=1;n<e;++n){let i=t.next();r=(r<<32n)+Vb(i+2147483648)}return r}function ai(e,t){let r=t>2?~~(4294967296/t)*t:4294967296,n=e.next()+2147483648;for(;n>=r;)n=e.next()+2147483648;return n%t}function kc(e,t){if(t<0){let r=-t;e.sign=-1,e.data[0]=~~(r/4294967296),e.data[1]=r>>>0}else e.sign=1,e.data[0]=~~(t/4294967296),e.data[1]=t>>>0;return e}function M6(e,t,r){let n=t.data[1],i=t.data[0],o=t.sign,s=r.data[1],a=r.data[0],l=r.sign;if(e.sign=1,o===1&&l===-1){let m=n+s,g=i+a+(m>4294967295?1:0);return e.data[0]=g>>>0,e.data[1]=m>>>0,e}let u=n,c=i,d=s,p=a;o===-1&&(u=s,c=a,d=n,p=i);let h=0,f=u-d;return f<0&&(h=1,f=f>>>0),e.data[0]=c-p-h,e.data[1]=f,e}function O6(e,t,r){let n=r[0]+1;for(t[0]=ai(e,n),t[1]=ai(e,4294967296);t[0]>=r[0]&&(t[0]!==r[0]||t[1]>=r[1]);)t[0]=ai(e,n),t[1]=ai(e,4294967296);return t}var N6=Number.MAX_SAFE_INTEGER,L6={sign:1,data:[0,0]},$6={sign:1,data:[0,0]},Wb={sign:1,data:[0,0]},Ec=[0,0];function D6(e,t,r,n){let i=n<=N6?kc(Wb,n):M6(Wb,kc(L6,r),kc($6,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,O6(e,Ec,i.data),Ec[0]*4294967296+Ec[1]+t}function Cs(e,t,r){let n=r-t;return n<=4294967295?ai(e,n+1)+t:D6(e,t,r,n)}var zb=Symbol.for("fast-check/PreconditionFailure"),nr=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=zb}static isFailure(e){return e!=null&&e.footprint===zb}};function _6(e){if(!e)throw new nr}var F6=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},j6=new F6;function V6(){return j6}function*B6(e,t){for(let r of e)yield t(r)}function*U6(e,t){for(let r of e)yield*t(r)}function*W6(e,t){for(let r of e)t(r)&&(yield r)}function*z6(e,t){for(let r=0;r<t;++r){let n=e.next();if(n.done)break;yield n.value}}function*G6(e,t){let r=e.next();for(;!r.done&&t(r.value);)yield r.value,r=e.next()}function*H6(e,t){for(let r=e.next();!r.done;r=e.next())yield r.value;for(let r of t)for(let n=r.next();!n.done;n=r.next())yield n.value}var q6=Symbol.iterator,j=class Lt{static nil(){return new Lt(V6())}static of(...t){return new Lt(t[q6]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Lt(B6(this.g,t))}flatMap(t){return new Lt(U6(this.g,t))}dropWhile(t){let r=!1;function*n(i){(r||!t(i))&&(r=!0,yield i)}return this.flatMap(n)}drop(t){if(t<=0)return this;let r=0;function n(){return r++<t}return this.dropWhile(n)}takeWhile(t){return new Lt(G6(this.g,t))}take(t){return new Lt(z6(this.g,t))}filter(t){return new Lt(W6(this.g,t))}every(t){for(let r of this.g)if(!t(r))return!1;return!0}has(t){for(let r of this.g)if(t(r))return[!0,r];return[!1,null]}join(...t){return new Lt(H6(this.g,t))}getNthOrLast(t){let r=t,n=null;for(let i of this.g){if(r--===0)return i;n=i}return n}};function tr(e){return new j(e)}var Oe=Symbol.for("fast-check/cloneMethod");function vr(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Oe in e&&typeof e[Oe]=="function"}function tn(e){return vr(e)?e[Oe]():e}var K6=Object.defineProperty,_=class{constructor(e,t,r){this.value_=e,this.context=t,this.hasToBeCloned=r!==void 0||vr(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&K6(this,"value",{get:r!==void 0?r:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[Oe]():(this.readOnce=!0,this.value_):this.value_}},de=class{filter(e){return new Z6(this,e)}map(e,t){return new J6(this,e,t)}chain(e){return new Y6(this,e)}},Y6=class extends de{constructor(e,t){super(),this.arb=e,this.chainer=t}generate(e,t){let r=e.clone(),n=this.arb.generate(e,t);return this.valueChainer(n,e,r,t)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?(t.stoppedForOriginal?j.nil():this.arb.shrink(t.originalValue,t.originalContext).map(r=>this.valueChainer(r,t.clonedMrng.clone(),t.clonedMrng,t.originalBias))).join(t.chainedArbitrary.shrink(e,t.chainedContext).map(r=>{let n={...t,chainedContext:r.context,stoppedForOriginal:!0};return new _(r.value_,n)})):j.nil()}valueChainer(e,t,r,n){let i=this.chainer(e.value_),o=i.generate(t,n),s={originalBias:n,originalValue:e.value_,originalContext:e.context,stoppedForOriginal:!1,chainedArbitrary:i,chainedContext:o.context,clonedMrng:r};return new _(o.value_,s)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalBias"in e&&"originalValue"in e&&"originalContext"in e&&"stoppedForOriginal"in e&&"chainedArbitrary"in e&&"chainedContext"in e&&"clonedMrng"in e}},J6=class extends de{constructor(e,t,r){super(),this.arb=e,this.mapper=t,this.unmapper=r,this.bindValueMapper=n=>this.valueMapper(n)}generate(e,t){let r=this.arb.generate(e,t);return this.valueMapper(r)}canShrinkWithoutContext(e){if(this.unmapper!==void 0)try{let t=this.unmapper(e);return this.arb.canShrinkWithoutContext(t)}catch{return!1}return!1}shrink(e,t){if(this.isSafeContext(t))return this.arb.shrink(t.originalValue,t.originalContext).map(this.bindValueMapper);if(this.unmapper!==void 0){let r=this.unmapper(e);return this.arb.shrink(r,void 0).map(this.bindValueMapper)}return j.nil()}mapperWithCloneIfNeeded(e){let t=e.value,r=this.mapper(t);return e.hasToBeCloned&&(typeof r=="object"&&r!==null||typeof r=="function")&&Object.isExtensible(r)&&!vr(r)&&Object.defineProperty(r,Oe,{get:()=>()=>this.mapperWithCloneIfNeeded(e)[0]}),[r,t]}valueMapper(e){let[t,r]=this.mapperWithCloneIfNeeded(e);return new _(t,{originalValue:r,originalContext:e.context})}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalValue"in e&&"originalContext"in e}},Z6=class extends de{constructor(e,t){super(),this.arb=e,this.refinement=t,this.bindRefinementOnValue=r=>this.refinementOnValue(r)}generate(e,t){for(;;){let r=this.arb.generate(e,t);if(this.refinementOnValue(r))return r}}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)&&this.refinement(e)}shrink(e,t){return this.arb.shrink(e,t).filter(this.bindRefinementOnValue)}refinementOnValue(e){return this.refinement(e.value)}};function zw(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function Gw(e){if(!zw(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Hw=Function.prototype.apply,Cc=Symbol("apply");function X6(e){try{return e.apply}catch{return}}function Q6(e,t,r){let n=e;n[Cc]=Hw;let i=n[Cc](t,r);return delete n[Cc],i}function q(e,t,r){return X6(e)===Hw?e.apply(t,r):Q6(e,t,r)}var qw=Array,O=BigInt,e4=BigInt64Array,t4=BigUint64Array,Kw=Boolean,Bs=Date,L=Error,Yw=Float32Array,Jw=Float64Array,r4=Int8Array,n4=Int16Array,i4=Int32Array,Dt=Number,Ve=String,rn=Set,o4=Uint8Array,s4=Uint8ClampedArray,a4=Uint16Array,l4=Uint32Array,u4=encodeURIComponent,_t=Map,Ls=Symbol,Gb=Array.prototype.forEach,Hb=Array.prototype.indexOf,qb=Array.prototype.join,Kb=Array.prototype.map,Yb=Array.prototype.flat,Jb=Array.prototype.filter,Zb=Array.prototype.push,Xb=Array.prototype.pop,Qb=Array.prototype.splice,eS=Array.prototype.slice,tS=Array.prototype.sort,rS=Array.prototype.every;function c4(e){try{return e.forEach}catch{return}}function d4(e){try{return e.indexOf}catch{return}}function f4(e){try{return e.join}catch{return}}function p4(e){try{return e.map}catch{return}}function h4(e){try{return e.flat}catch{return}}function m4(e){try{return e.filter}catch{return}}function g4(e){try{return e.push}catch{return}}function y4(e){try{return e.pop}catch{return}}function b4(e){try{return e.splice}catch{return}}function S4(e){try{return e.slice}catch{return}}function w4(e){try{return e.sort}catch{return}}function v4(e){try{return e.every}catch{return}}function Zw(e,t){return c4(e)===Gb?e.forEach(t):q(Gb,e,[t])}function $t(e,...t){return d4(e)===Hb?e.indexOf(...t):q(Hb,e,t)}function ce(e,...t){return f4(e)===qb?e.join(...t):q(qb,e,t)}function G(e,t){return p4(e)===Kb?e.map(t):q(Kb,e,[t])}function x4(e,t){return h4(e)===Yb?([].flat(),e.flat(t)):q(Yb,e,[t])}function R4(e,t){return m4(e)===Jb?e.filter(t):q(Jb,e,[t])}function $(e,...t){return g4(e)===Zb?e.push(...t):q(Zb,e,t)}function Xw(e){return y4(e)===Xb?e.pop():q(Xb,e,[])}function Qw(e,...t){return b4(e)===Qb?e.splice(...t):q(Qb,e,t)}function Le(e,...t){return S4(e)===eS?e.slice(...t):q(eS,e,t)}function e1(e,...t){return w4(e)===tS?e.sort(...t):q(tS,e,t)}function t1(e,...t){return v4(e)===rS?e.every(...t):q(rS,e,t)}var nS=Date.prototype.getTime,iS=Date.prototype.toISOString;function k4(e){try{return e.getTime}catch{return}}function E4(e){try{return e.toISOString}catch{return}}function Us(e){return k4(e)===nS?e.getTime():q(nS,e,[])}function C4(e){return E4(e)===iS?e.toISOString():q(iS,e,[])}var oS=Set.prototype.add,sS=Set.prototype.has;function A4(e){try{return e.add}catch{return}}function I4(e){try{return e.has}catch{return}}function fi(e,t){return A4(e)===oS?e.add(t):q(oS,e,[t])}function Ws(e,t){return I4(e)===sS?e.has(t):q(sS,e,[t])}var aS=WeakMap.prototype.set,lS=WeakMap.prototype.get;function P4(e){try{return e.set}catch{return}}function T4(e){try{return e.get}catch{return}}function M4(e,t,r){return P4(e)===aS?e.set(t,r):q(aS,e,[t,r])}function O4(e,t){return T4(e)===lS?e.get(t):q(lS,e,[t])}var uS=Map.prototype.set,cS=Map.prototype.get,dS=Map.prototype.has;function N4(e){try{return e.set}catch{return}}function L4(e){try{return e.get}catch{return}}function $4(e){try{return e.has}catch{return}}function ct(e,t,r){return N4(e)===uS?e.set(t,r):q(uS,e,[t,r])}function Je(e,t){return L4(e)===cS?e.get(t):q(cS,e,[t])}function D4(e,t){return $4(e)===dS?e.has(t):q(dS,e,[t])}var fS=String.prototype.split,pS=String.prototype.startsWith,hS=String.prototype.endsWith,mS=String.prototype.substring,gS=String.prototype.toLowerCase,yS=String.prototype.toUpperCase,bS=String.prototype.padStart,SS=String.prototype.charCodeAt,wS=String.prototype.normalize,vS=String.prototype.replace;function _4(e){try{return e.split}catch{return}}function F4(e){try{return e.startsWith}catch{return}}function j4(e){try{return e.endsWith}catch{return}}function V4(e){try{return e.substring}catch{return}}function B4(e){try{return e.toLowerCase}catch{return}}function U4(e){try{return e.toUpperCase}catch{return}}function W4(e){try{return e.padStart}catch{return}}function z4(e){try{return e.charCodeAt}catch{return}}function G4(e){try{return e.normalize}catch{return}}function H4(e){try{return e.replace}catch{return}}function Be(e,...t){return _4(e)===fS?e.split(...t):q(fS,e,t)}function q4(e,...t){return F4(e)===pS?e.startsWith(...t):q(pS,e,t)}function K4(e,...t){return j4(e)===hS?e.endsWith(...t):q(hS,e,t)}function ge(e,...t){return V4(e)===mS?e.substring(...t):q(mS,e,t)}function Zc(e){return B4(e)===gS?e.toLowerCase():q(gS,e,[])}function Rd(e){return U4(e)===yS?e.toUpperCase():q(yS,e,[])}function Y4(e,...t){return W4(e)===bS?e.padStart(...t):q(bS,e,t)}function nn(e,t){return z4(e)===SS?e.charCodeAt(t):q(SS,e,[t])}function J4(e,t){return G4(e)===wS?e.normalize(t):q(wS,e,[t])}function Z4(e,t,r){return H4(e)===vS?e.replace(t,r):q(vS,e,[t,r])}var xS=Number.prototype.toString;function X4(e){try{return e.toString}catch{return}}function pi(e,...t){return X4(e)===xS?e.toString(...t):q(xS,e,t)}var Q4=Object.prototype.hasOwnProperty,eN=Object.prototype.toString;function r1(e,t){return q(Q4,e,[t])}function Xc(e){return q(eN,e,[])}var tN=Error.prototype.toString;function rN(e){return q(tN,e,[])}var nN=class{constructor(e){this.producer=e}[Symbol.iterator](){return this.it===void 0&&(this.it=this.producer()),this.it}next(){return this.it===void 0&&(this.it=this.producer()),this.it.next()}};function er(e){return new nN(e)}var n1=Array.isArray,iN=Object.defineProperty;function i1(e,t){return iN(e,Oe,{value:()=>{let r=[];for(let n=0;n!==t.length;++n)$(r,t[n].value);return i1(r,t),r}})}function o1(e){let t=!1,r=[],n=[];for(let i=0;i!==e.length;++i){let o=e[i];t=t||o.hasToBeCloned,$(r,o.value),$(n,o.context)}return t&&i1(r,e),new _(r,n)}function s1(e,t,r){let n=[],i=n1(r)?r:[];for(let o=0;o!==e.length;++o)$(n,er(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=G(t,(l,u)=>new _(tn(l),i[u]));return[...Le(a,0,o),s,...Le(a,o+1)]}).map(o1)));return j.nil().join(...n)}var oN=class extends de{constructor(e){super(),this.arbs=e;for(let t=0;t!==e.length;++t){let r=e[t];if(r==null||r.generate===null||r.generate===void 0)throw new Error(`Invalid parameter encountered at index ${t}: expecting an Arbitrary`)}}generate(e,t){let r=[];for(let n=0;n!==this.arbs.length;++n)$(r,this.arbs[n].generate(e,t));return o1(r)}canShrinkWithoutContext(e){if(!n1(e)||e.length!==this.arbs.length)return!1;for(let t=0;t!==this.arbs.length;++t)if(!this.arbs[t].canShrinkWithoutContext(e[t]))return!1;return!0}shrink(e,t){return s1(this.arbs,e,t)}};function B(...e){return new oN(e)}var sN=Math.log;function a1(e){return 2+~~(sN(e+1)*.4342944819032518)}var kd={};function aN(e){kd=e}function dt(){return kd}function lN(){kd={}}var hi=Symbol("UndefinedContextPlaceholder");function on(e){return e.context!==void 0?e:e.hasToBeCloned?new _(e.value_,hi,()=>e.value):new _(e.value_,hi)}var RS=()=>{},uN=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:r,asyncAfterEach:n,beforeEach:i,afterEach:o}=dt()||{};if(r!==void 0&&i!==void 0)throw L(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(n!==void 0&&o!==void 0)throw L(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=r||i||RS,this.afterEachHook=n||o||RS}isAsync(){return!0}generate(e,t){return on(this.arb.generate(e,t!==void 0?a1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==hi?e.context:void 0;return this.arb.shrink(e.value_,t).map(on)}async runBeforeEach(){await this.beforeEachHook()}async runAfterEach(){await this.afterEachHook()}async run(e){try{let t=await this.predicate(e);return t===void 0||t===!0?null:{error:new L("Property failed by returning false")}}catch(t){return nr.isFailure(t)?t:{error:t}}}beforeEach(e){let t=this.beforeEachHook;return this.beforeEachHook=()=>e(t),this}afterEach(e){let t=this.afterEachHook;return this.afterEachHook=()=>e(t),this}},l1=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return on(this.arb.generate(e,t))}canShrinkWithoutContext(e){return!0}shrink(e,t){if(t===void 0&&!this.arb.canShrinkWithoutContext(e))return j.nil();let r=t!==hi?t:void 0;return this.arb.shrink(e,r).map(on)}};function cN(...e){if(e.length<2)throw new Error("asyncProperty expects at least two parameters");let t=Le(e,0,e.length-1),r=e[e.length-1];return Zw(t,Gw),new uN(B(...G(t,n=>new l1(n))),n=>r(...n))}var kS=()=>{},u1=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:r=kS,afterEach:n=kS,asyncBeforeEach:i,asyncAfterEach:o}=dt()||{};if(i!==void 0)throw L(`"asyncBeforeEach" can't be set when running synchronous properties`);if(o!==void 0)throw L(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=r,this.afterEachHook=n}isAsync(){return!1}generate(e,t){return on(this.arb.generate(e,t!==void 0?a1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==hi?e.context:void 0;return this.arb.shrink(e.value_,t).map(on)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(e){try{let t=this.predicate(e);return t===void 0||t===!0?null:{error:new L("Property failed by returning false")}}catch(t){return nr.isFailure(t)?t:{error:t}}}beforeEach(e){let t=this.beforeEachHook;return this.beforeEachHook=()=>e(t),this}afterEach(e){let t=this.afterEachHook;return this.afterEachHook=()=>e(t),this}};function dN(...e){if(e.length<2)throw new Error("property expects at least two parameters");let t=Le(e,0,e.length-1),r=e[e.length-1];return Zw(t,Gw),new u1(B(...G(t,n=>new l1(n))),n=>r(...n))}var fN=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function Qc(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>Qc(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>Qc(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function c1(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>c1(e),next:()=>e.next(),jump:()=>jb(e,42),getState:()=>e.getState()}}function qs(e){return c1(Qc(e))}var pN=Date.now,hN=Math.min,mN=Math.random,gN=class{constructor(e){let t=e||{};this.seed=yN(t),this.randomType=bN(t),this.numRuns=SN(t),this.verbose=wN(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=Ic(t.timeout),this.skipAllAfterTimeLimit=Ic(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=Ic(t.interruptAfterTimeLimit),this.markInterruptAsFailure=t.markInterruptAsFailure===!0,this.skipEqualValues=t.skipEqualValues===!0,this.ignoreEqualValues=t.ignoreEqualValues===!0,this.logger=t.logger!==void 0?t.logger:r=>{console.log(r)},this.path=t.path!==void 0?t.path:"",this.unbiased=t.unbiased===!0,this.examples=t.examples!==void 0?t.examples:[],this.endOnFailure=t.endOnFailure===!0,this.reporter=t.reporter,this.asyncReporter=t.asyncReporter,this.includeErrorInReport=t.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 Ac(e){return t=>qs(e(t))}function yN(e){if(e.seed===void 0)return pN()^mN()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function bN(e){if(e.randomType===void 0)return Rc;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return Ac($b);case"congruential":case"congruential32":return Ac(Ob);case"xorshift128plus":return Rc;case"xoroshiro128plus":return Fb;default:throw new Error(`Invalid random specified: '${e.randomType}'`)}let t=e.randomType(0);if("min"in t&&t.min!==-2147483648)throw new Error(`Invalid random number generator: min must equal -0x80000000, got ${String(t.min)}`);if("max"in t&&t.max!==2147483647)throw new Error(`Invalid random number generator: max must equal 0x7fffffff, got ${String(t.max)}`);return t===qs(t)?e.randomType:Ac(e.randomType)}function SN(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function wN(e){return e.verbose===void 0?0:typeof e.verbose=="boolean"?e.verbose===!0?1:0:e.verbose<=0?0:e.verbose>=2?2:e.verbose|0}function Ic(e){if(e!==void 0)return hN(e,2147483647)}function Ed(e){return new gN(e)}function vN(e,t,r){let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i(new nr(!0))},e)})}}var ES=class{constructor(e,t,r,n,i,o){this.property=e,this.getTime=t,this.interruptExecution=n,this.setTimeoutSafe=i,this.clearTimeoutSafe=o,this.skipAfterTime=this.getTime()+r}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}run(e){let t=this.skipAfterTime-this.getTime();if(t<=0){let r=new nr(this.interruptExecution);return this.isAsync()?Promise.resolve(r):r}if(this.interruptExecution&&this.isAsync()){let r=vN(t,this.setTimeoutSafe,this.clearTimeoutSafe),n=Promise.race([this.property.run(e),r.promise]);return n.then(r.clear,r.clear),n}return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},xN=(e,t,r)=>{let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i({error:new L(`Property timeout: exceeded limit of ${e} milliseconds`)})},e)})}},RN=class{constructor(e,t,r,n){this.property=e,this.timeMs=t,this.setTimeoutSafe=r,this.clearTimeoutSafe=n}isAsync(){return!0}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}async run(e){let t=xN(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),r=Promise.race([this.property.run(e),t.promise]);return r.then(t.clear,t.clear),r}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},d1=class{constructor(e){this.property=e}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,void 0)}shrink(e){return this.property.shrink(e)}run(e){return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},CS=Array.from,AS=typeof Buffer<"u"?Buffer.isBuffer:void 0,Zr=JSON.stringify,IS=Number.isNaN,kN=Object.keys,EN=Object.getOwnPropertySymbols,CN=Object.getOwnPropertyDescriptor,PS=Object.getPrototypeOf,TS=Number.NEGATIVE_INFINITY,AN=Number.POSITIVE_INFINITY,ft=Symbol.for("fast-check/toStringMethod");function Cd(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&ft in e&&typeof e[ft]=="function"}var Ft=Symbol.for("fast-check/asyncToStringMethod");function Ad(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Ft in e&&typeof e[Ft]=="function"}var IN=/^Symbol\((.*)\)$/;function PN(e){if(e.description!==void 0)return e.description;let t=IN.exec(Ve(e));return t&&t[1].length?t[1]:null}function MS(e){switch(e){case 0:return 1/e===TS?"-0":"0";case TS:return"Number.NEGATIVE_INFINITY";case AN:return"Number.POSITIVE_INFINITY";default:return e===e?Ve(e):"Number.NaN"}}function TN(e){let t=-1;for(let r in e){let n=Number(r);if(n!==t+1)return!0;t=n}return t+1!==e.length}function Ye(e,t,r){let n=[...t,e];if(typeof e=="object"&&$t(t,e)!==-1)return"[cyclic]";if(Ad(e)){let i=r(e);if(i.state==="fulfilled")return i.value}if(Cd(e))try{return e[ft]()}catch{}switch(Xc(e)){case"[object Array]":{let i=e;if(i.length>=50&&TN(i)){let s=[];for(let a in i)IS(Number(a))||$(s,`${a}:${Ye(i[a],n,r)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${ce(s,",")}})`:`Array(${i.length})`}let o=ce(G(i,s=>Ye(s,n,r)),",");return i.length===0||i.length-1 in i?`[${o}]`:`[${o},]`}case"[object BigInt]":return`${e}n`;case"[object Boolean]":{let i=e==!0?"true":"false";return typeof e=="boolean"?i:`new Boolean(${i})`}case"[object Date]":{let i=e;return IS(Us(i))?"new Date(NaN)":`new Date(${Zr(C4(i))})`}case"[object Map]":return`new Map(${Ye(Array.from(e),n,r)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?MS(e):`new Number(${MS(Number(e))})`;case"[object Object]":{try{let o=e.toString;if(typeof o=="function"&&o!==Object.prototype.toString)return e.toString()}catch{return"[object Object]"}let i=o=>`${o==="__proto__"?'["__proto__"]':typeof o=="symbol"?`[${Ye(o,n,r)}]`:Zr(o)}:${Ye(e[o],n,r)}`;return"{"+ce([...PS(e)===null?["__proto__:null"]:[],...G(kN(e),i),...G(R4(EN(e),o=>{let s=CN(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${Ye(Array.from(e),n,r)})`;case"[object String]":return typeof e=="string"?Zr(e):`new String(${Zr(e)})`;case"[object Symbol]":{let i=e;if(Ls.keyFor(i)!==void 0)return`Symbol.for(${Zr(Ls.keyFor(i))})`;let o=PN(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&Ls[o.substring(7)])?o:`Symbol(${Zr(o)})`}case"[object Promise]":{let i=r(e);switch(i.state){case"fulfilled":return`Promise.resolve(${Ye(i.value,n,r)})`;case"rejected":return`Promise.reject(${Ye(i.value,n,r)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(e instanceof Error)return`new Error(${Ye(e.message,n,r)})`;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 AS=="function"&&AS(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":Ye(CS(e.values()),n,r)})`;let i=PS(e),o=i&&i.constructor&&i.constructor.name;if(typeof o=="string"){let s=e;return s.buffer.detached?`${o}.from(/*detached ArrayBuffer*/)`:`${o}.from(${Ye(CS(s.values()),n,r)})`}break}}try{return e.toString()}catch{return Xc(e)}}function xe(e){return Ye(e,[],()=>({state:"unknown",value:void 0}))}function f1(e){let t=Ls(),r=[],n=new _t;function i(){let l=null,u=()=>{l!==null&&clearTimeout(l)};return{delay:new Promise(c=>{l=setTimeout(()=>{l=null,c(t)},0)}),cancel:u}}let o={state:"unknown",value:void 0},s=function(u){let c=u;if(n.has(c))return n.get(c);let d=i(),p=Ft in u?Promise.resolve().then(()=>u[Ft]()):u;return p.catch(()=>{}),r.push(Promise.race([p,d.delay]).then(h=>{h===t?n.set(c,{state:"pending",value:void 0}):n.set(c,{state:"fulfilled",value:h}),d.cancel()},h=>{n.set(c,{state:"rejected",value:h}),d.cancel()})),n.set(c,o),o};function a(){let l=Ye(e,[],s);return r.length===0?l:Promise.all(r.splice(0)).then(a)}return a()}async function Id(e){return Promise.resolve(f1(e))}function OS(e){return e===null?new nr:e}function MN(...e){return e[1]?e[0].then(OS):OS(e[0])}function ON(e,t){return MN(e,t)}var NS=class{constructor(e,t){this.property=e,this.skipRuns=t,this.coveredCases=new Map}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}run(e){let t=xe(e);if(this.coveredCases.has(t)){let n=this.coveredCases.get(t);return this.skipRuns?ON(n,this.property.isAsync()):n}let r=this.property.run(e);return this.coveredCases.set(t,r),r}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},LS=Date.now,Pc=setTimeout,Tc=clearTimeout;function NN(e,t){let r=e;return e.isAsync()&&t.timeout!==void 0&&(r=new RN(r,t.timeout,Pc,Tc)),t.unbiased&&(r=new d1(r)),t.skipAllAfterTimeLimit!==void 0&&(r=new ES(r,LS,t.skipAllAfterTimeLimit,!1,Pc,Tc)),t.interruptAfterTimeLimit!==void 0&&(r=new ES(r,LS,t.interruptAfterTimeLimit,!0,Pc,Tc)),t.skipEqualValues&&(r=new NS(r,!0)),t.ignoreEqualValues&&(r=new NS(r,!1)),r}var LN=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),$N=class p1{constructor(t,r){this.verbosity=t,this.interruptedAsFailure=r,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(t,r){let n={status:t,value:r,children:[]};return this.currentLevelExecutionTrees.push(n),n}fail(t,r,n){if(this.verbosity>=1){let i=this.appendExecutionTree(1,t);this.currentLevelExecutionTrees=i.children}this.pathToFailure===void 0?this.pathToFailure=`${r}`:this.pathToFailure+=`:${r}`,this.value=t,this.failure=n}skip(t){this.verbosity>=2&&this.appendExecutionTree(-1,t),this.pathToFailure===void 0&&++this.numSkips}success(t){this.verbosity>=2&&this.appendExecutionTree(0,t),this.pathToFailure===void 0&&++this.numSuccesses}interrupt(){this.interrupted=!0}isSuccess(){return this.pathToFailure===void 0}firstFailure(){return this.pathToFailure!==void 0?+Be(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?Be(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let t=[],r=this.rootExecutionTrees;for(;r.length>0&&r[r.length-1].status===1;){let n=r[r.length-1];t.push(n.value),r=n.children}return t}static mergePaths(t,r){if(t.length===0)return r;let n=t.split(":"),i=r.split(":"),o=+n[n.length-1]+ +i[0];return[...n.slice(0,n.length-1),`${o}`,...i.slice(1)].join(":")}toRunDetails(t,r,n,i){if(!this.isSuccess())return{failed:!0,interrupted:this.interrupted,numRuns:this.firstFailure()+1-this.numSkips,numSkips:this.numSkips,numShrinks:this.numShrinks(),seed:t,counterexample:this.value,counterexamplePath:p1.mergePaths(r,this.pathToFailure),errorInstance:this.failure.error,failures:this.extractFailures(),executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:i.toParameters()};let o=this.interruptedAsFailure||this.numSuccesses===0;return{failed:this.numSkips>n||this.interrupted&&o,interrupted:this.interrupted,numRuns:this.numSuccesses,numSkips:this.numSkips,numShrinks:0,seed:t,counterexample:null,counterexamplePath:null,error:null,errorInstance:null,failures:[],executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:i.toParameters()}}},h1=class{constructor(e,t,r,n){this.sourceValues=e,this.shrink=t,this.runExecution=new $N(r,n),this.currentIdx=-1,this.nextValues=e}[Symbol.iterator](){return this}next(){let e=this.nextValues.next();return e.done||this.runExecution.interrupted?{done:!0,value:void 0}:(this.currentValue=e.value,++this.currentIdx,{done:!1,value:e.value.value_})}handleResult(e){e!==null&&typeof e=="object"&&!nr.isFailure(e)?(this.runExecution.fail(this.currentValue.value_,this.currentIdx,e),this.currentIdx=-1,this.nextValues=this.shrink(this.currentValue)):e!==null?e.interruptExecution?this.runExecution.interrupt():(this.runExecution.skip(this.currentValue.value_),this.sourceValues.skippedOne()):this.runExecution.success(this.currentValue.value_)}},DN=class{constructor(e,t,r){this.initialValues=e,this.maxInitialIterations=t,this.remainingSkips=r}[Symbol.iterator](){return this}next(){if(--this.maxInitialIterations!==-1&&this.remainingSkips>=0){let e=this.initialValues.next();if(!e.done)return{value:e.value,done:!1}}return{value:void 0,done:!0}}skippedOne(){--this.remainingSkips,++this.maxInitialIterations}},_N=-2147483648,FN=2147483647,jN=Math.pow(2,27),VN=Math.pow(2,-53),Pd=class m1{constructor(t){this.internalRng=qs(t.clone())}clone(){return new m1(this.internalRng)}next(t){return Cs(this.internalRng,0,(1<<t)-1)}nextBoolean(){return Cs(this.internalRng,0,1)===1}nextInt(t,r){return Cs(this.internalRng,t===void 0?_N:t,r===void 0?FN:r)}nextBigInt(t,r){return Ub(this.internalRng,t,r)}nextDouble(){let t=this.next(26),r=this.next(27);return(t*jN+r)*VN}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function BN(e,t,r){return t.jump(),e.generate(new Pd(t),r)}function*g1(e,t,r,n){for(let i=0;i!==n.length;++i)yield new _(n[i],void 0);for(let i=0,o=r(t);;++i)yield BN(e,o,i)}function UN(e,t,r){return()=>e.generate(new Pd(t),r)}function*y1(e,t,r,n){yield*G(n,s=>()=>new _(s,void 0));let i=0,o=qs(r(t));for(;;)o.jump(),yield UN(e,o,i++)}function $S(e){return e()}function b1(e,t,r){let n=t,i=e.split(":").map(s=>+s);if(i.length===0)return n.map($S);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=n.drop(i[0]).map($S);for(let s of i.slice(1)){let a=o.getNthOrLast(0);if(a===null)throw new Error(`Unable to replay, got wrong path=${e}`);o=r(a).drop(s)}return o}var WN=Object.assign;function zN(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,r)=>`Hint (${r+1}): ${t}`).join(`
100
- `)}function GN(e,t){return`Encountered failures were:
99
+ or you can use record.mirror to access the mirror instance during recording.`,Sg={map:{},getId(){return console.error(jr),-1},getNode(){return console.error(jr),null},removeNodeFromMap(){console.error(jr)},has(){return console.error(jr),!1},reset(){console.error(jr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Sg=new Proxy(Sg,{get(e,t,r){return t==="map"&&console.error(jr),Reflect.get(e,t,r)}}));function ti(e,t,r={}){let n=null,i=0;return function(...o){let s=Date.now();!i&&r.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(l,o)},a))}}function ks(e,t,r,n,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>ks(e,t,o||{},!0)}var cs=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(cs=()=>new Date().getTime());function ab(e){var t,r,n,i;let o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||o?.body&&((t=U.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o?.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:o?.documentElement.scrollTop||o?.body&&((n=U.parentElement(o.body))==null?void 0:n.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}function lb(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ub(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function cb(e){return e?e.nodeType===e.ELEMENT_NODE?e:U.parentElement(e):null}function je(e,t,r,n){if(!e)return!1;let i=cb(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(ts(i,t,n))return!0}catch{}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function B2(e,t){return t.getId(e)!==-1}function ou(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===Hn}function db(e,t){if(Wn(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=U.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?db(n,t):!0}function ju(e){return!!e.changedTouches}function U2(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function fb(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function pb(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Vu(e){return e?e instanceof Fu&&"shadowRoot"in e?!!e.shadowRoot:!!U.shadowRoot(e):!1}var Bu=class{constructor(){k(this,"id",1),k(this,"styleIDMap",new WeakMap),k(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function hb(e){var t;let r=null;return"getRootNode"in e&&((t=U.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&U.host(U.getRootNode(e))&&(r=U.host(U.getRootNode(e))),r}function W2(e){let t=e,r;for(;r=hb(t);)t=r;return t}function z2(e){let t=U.ownerDocument(e);if(!t)return!1;let r=W2(e);return U.contains(t,r)}function mb(e){let t=U.ownerDocument(e);return t?U.contains(t,e)||z2(e):!1}var H=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(H||{}),z=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(z||{}),We=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(We||{}),Pt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Pt||{}),Jr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Jr||{}),Vr=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Vr||{});var gb=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(gb||{});function wg(e){return"__ln"in e}var Uu=class{constructor(){k(this,"length",0),k(this,"head",null),k(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){let r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&wg(t.previousSibling)){let n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&wg(t.nextSibling)&&t.nextSibling.__ln.previous){let n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){let r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},vg=(e,t)=>`${e}@${t}`,Wu=class{constructor(){k(this,"frozen",!1),k(this,"locked",!1),k(this,"texts",[]),k(this,"attributes",[]),k(this,"attributeMap",new WeakMap),k(this,"removes",[]),k(this,"mapRemoves",[]),k(this,"movedMap",{}),k(this,"addedSet",new Set),k(this,"movedSet",new Set),k(this,"droppedSet",new Set),k(this,"removesSubTreeCache",new Set),k(this,"mutationCb"),k(this,"blockClass"),k(this,"blockSelector"),k(this,"maskTextClass"),k(this,"maskTextSelector"),k(this,"inlineStylesheet"),k(this,"maskInputOptions"),k(this,"maskTextFn"),k(this,"maskInputFn"),k(this,"keepIframeSrcFn"),k(this,"recordCanvas"),k(this,"inlineImages"),k(this,"slimDOMOptions"),k(this,"dataURLOptions"),k(this,"doc"),k(this,"mirror"),k(this,"iframeManager"),k(this,"stylesheetManager"),k(this,"shadowDomManager"),k(this,"canvasManager"),k(this,"processedNodeManager"),k(this,"unattachedDoc"),k(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),k(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set,n=new Uu,i=l=>{let u=l,c=Hn;for(;c===Hn;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=U.parentNode(l);if(!u||!mb(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let f=u.tagName;if(f==="TEXTAREA")return;f==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=Wn(u)?this.mirror.getId(hb(l)):this.mirror.getId(u),p=i(l);if(d===-1||p===-1)return n.addNode(l);let h=Ur(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{fb(f,this.mirror)&&this.iframeManager.addIframe(f),pb(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Vu(l)&&this.shadowDomManager.addShadowRoot(U.shadowRoot(l),this.doc)},onIframeLoad:(f,m)=>{this.iframeManager.attachIframe(f,m),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,m)=>{this.stylesheetManager.attachLinkElement(f,m)},cssCaptured:c});h&&(t.push({parentId:d,nextId:p,node:h}),r.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)xg(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(U.parentNode(l))||o(l);for(let l of this.addedSet)!Rg(this.droppedSet,l)&&!xg(this.removesSubTreeCache,l,this.mirror)||Rg(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;n.length;){let l=null;if(s){let u=this.mirror.getId(U.parentNode(s.value)),c=i(s.value);u!==-1&&c!==-1&&(l=s)}if(!l){let u=n.tail;for(;u;){let c=u;if(u=u.previous,c){let d=this.mirror.getId(U.parentNode(c.value));if(i(c.value)===-1)continue;if(d!==-1){l=c;break}else{let h=c.value,f=U.parentNode(h);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=U.host(f);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}s=l.previous,n.removeNode(l.value),o(l.value)}let a={texts:this.texts.map(l=>{let u=l.node,c=U.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:u}=l;if(typeof u.style=="string"){let c=JSON.stringify(l.styleDiff),d=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+d).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),k(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(U.childNodes(t),i=>U.textContent(i)||"").join("");r.attributes.value=Xo({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Qo(t),value:n,maskInputFn:this.maskInputFn})}),k(this,"processMutation",t=>{if(!ou(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=U.textContent(t.target);!je(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:_g(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,cb(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){let s=Qo(r);i=Xo({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(je(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Dg(r.tagName,n))if(o.attributes[n]=$g(this.doc,mr(r.tagName),mr(n),i),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let s=this.unattachedDoc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue);for(let a of Array.from(r.style)){let l=r.style.getPropertyValue(a),u=r.style.getPropertyPriority(a);l!==s.style.getPropertyValue(a)||u!==s.style.getPropertyPriority(a)?u===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,u]:o._unchangedStyles[a]=[l,u]}for(let a of Array.from(s.style))r.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(je(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),i=Wn(t.target)?this.mirror.getId(U.host(t.target)):this.mirror.getId(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||ou(r,this.mirror,this.slimDOMOptions)||!B2(r,this.mirror)||(this.addedSet.has(r)?(zu(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||db(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[vg(n,i)]?zu(this.movedSet,r):(this.removes.push({parentId:i,id:n,isShadow:Wn(t.target)&&zn(t.target)?!0:void 0}),G2(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),k(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(ou(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[vg(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);je(t,this.blockClass,this.blockSelector,!1)||(U.childNodes(t).forEach(n=>this.genAdds(n)),Vu(t)&&U.childNodes(U.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function zu(e,t){e.delete(t),U.childNodes(t).forEach(r=>zu(e,r))}function G2(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),U.childNodes(n).forEach(i=>r.push(i)))}}function xg(e,t,r){return e.size===0?!1:H2(e,t)}function H2(e,t,r){let n=U.parentNode(t);return n?e.has(n):!1}function Rg(e,t){return e.size===0?!1:yb(e,t)}function yb(e,t){let r=U.parentNode(t);return r?e.has(r)?!0:yb(e,r):!1}var Gn;function q2(e){Gn=e}function K2(){Gn=void 0}var Y=e=>Gn?(...r)=>{try{return e(...r)}catch(n){if(Gn&&Gn(n)===!0)return;throw n}}:e,hr=[];function si(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function bb(e,t){let r=new Wu;hr.push(r),r.init(e);let n=new(sb())(Y(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Y2({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=ti(Y(d=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),d),s=[],a=null}),o),u=Y(ti(Y(d=>{let p=si(d),{clientX:h,clientY:f}=ju(d)?d.changedTouches[0]:d;a||(a=cs()),s.push({x:h,y:f,id:n.getId(p),timeOffset:cs()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?z.Drag:d instanceof MouseEvent?z.MouseMove:z.TouchMove)}),i,{trailing:!1})),c=[Fe("mousemove",u,r),Fe("touchmove",u,r),Fe("drag",u,r)];return Y(()=>{c.forEach(d=>d())})}function J2({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=null,u=c=>d=>{let p=si(d);if(je(p,n,i,!0))return;let h=null,f=c;if("pointerType"in d){switch(d.pointerType){case"mouse":h=Pt.Mouse;break;case"touch":h=Pt.Touch;break;case"pen":h=Pt.Pen;break}h===Pt.Touch?We[c]===We.MouseDown?f="TouchStart":We[c]===We.MouseUp&&(f="TouchEnd"):Pt.Pen}else ju(d)&&(h=Pt.Touch);h!==null?(l=h,(f.startsWith("Touch")&&h===Pt.Touch||f.startsWith("Mouse")&&h===Pt.Mouse)&&(h=null)):We[c]===We.Click&&(h=l,l=null);let m=ju(d)?d.changedTouches[0]:d;if(!m)return;let g=r.getId(p),{clientX:S,clientY:w}=m;Y(e)({type:We[f],id:g,x:S,y:w,...h!==null&&{pointerType:h}})};return Object.keys(We).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=mr(c),p=u(c);if(window.PointerEvent)switch(We[c]){case We.MouseDown:case We.MouseUp:d=d.replace("mouse","pointer");break;case We.TouchStart:case We.TouchEnd:return}a.push(Fe(d,p,t))}),Y(()=>{a.forEach(c=>c())})}function Sb({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){let s=Y(ti(Y(a=>{let l=si(a);if(!l||je(l,n,i,!0))return;let u=r.getId(l);if(l===t&&t.defaultView){let c=ab(t.defaultView);e({id:u,x:c.left,y:c.top})}else e({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return Fe("scroll",s,t)}function Z2({viewportResizeCb:e},{win:t}){let r=-1,n=-1,i=Y(ti(Y(()=>{let o=lb(),s=ub();(r!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),r=o,n=s)}),200));return Fe("resize",i,t)}var X2=["INPUT","TEXTAREA","SELECT"],kg=new WeakMap;function Q2({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(w){let y=si(w),x=w.isTrusted,E=y&&y.tagName;if(y&&E==="OPTION"&&(y=U.parentElement(y)),!y||!E||X2.indexOf(E)<0||je(y,n,i,!0)||y.classList.contains(o)||s&&y.matches(s))return;let N=y.value,I=!1,M=Qo(y)||"";M==="radio"||M==="checkbox"?I=y.checked:(a[E.toLowerCase()]||a[M])&&(N=Xo({element:y,maskInputOptions:a,tagName:E,type:M,value:N,maskInputFn:l})),p(y,c?{text:N,isChecked:I,userTriggered:x}:{text:N,isChecked:I});let C=y.name;M==="radio"&&C&&I&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(V=>{if(V!==y){let Z=V.value;p(V,c?{text:Z,isChecked:!I,userTriggered:!1}:{text:Z,isChecked:!I})}})}function p(w,y){let x=kg.get(w);if(!x||x.text!==y.text||x.isChecked!==y.isChecked){kg.set(w,y);let E=r.getId(w);Y(e)({...y,id:E})}}let f=(u.input==="last"?["change"]:["input","change"]).map(w=>Fe(w,Y(d),t)),m=t.defaultView;if(!m)return()=>{f.forEach(w=>w())};let g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),S=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&f.push(...S.map(w=>ks(w[0],w[1],{set(){Y(d)({target:this,isTrusted:!1})}},!1,m))),Y(()=>{f.forEach(w=>w())})}function ds(e){let t=[];function r(n,i){if(Wo("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Wo("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Wo("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Wo("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(s)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(s)}return i}return r(e,t)}function Jt(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function e6({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Y((c,d,p)=>{let[h,f]=p,{id:m,styleId:g}=Jt(d,t,r.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,adds:[{rule:h,index:f}]}),c.apply(d,p)})}),n.CSSStyleSheet.prototype.addRule=function(c,d,p=this.cssRules.length){let h=`${c} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,p])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Jt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,removes:[{index:h}]}),c.apply(d,p)})}),n.CSSStyleSheet.prototype.removeRule=function(c){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Jt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replace:h}),c.apply(d,p)})}));let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Jt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replaceSync:h}),c.apply(d,p)})}));let l={};zo("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(zo("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),zo("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),zo("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));let u={};return Object.entries(l).forEach(([c,d])=>{u[c]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[c].insertRule,{apply:Y((p,h,f)=>{let[m,g]=f,{id:S,styleId:w}=Jt(h.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:m,index:[...ds(h),g||0]}]}),p.apply(h,f)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:Y((p,h,f)=>{let[m]=f,{id:g,styleId:S}=Jt(h.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,removes:[{index:[...ds(h),m]}]}),p.apply(h,f)})})}),Y(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function wb({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(U.host(r));let a=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(i=r.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;let d=(c=l.set)==null?void 0:c.call(this,u);if(s!==null&&s!==-1)try{t.adoptStyleSheets(u,s)}catch{}return d}}),Y(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function t6({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Y((a,l,u)=>{var c;let[d,p,h]=u;if(r.has(d))return o.apply(l,[d,p,h]);let{id:f,styleId:m}=Jt((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,set:{property:d,value:p,priority:h},index:ds(l.parentRule)}),a.apply(l,u)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Y((a,l,u)=>{var c;let[d]=u;if(r.has(d))return s.apply(l,[d]);let{id:p,styleId:h}=Jt((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,remove:{property:d},index:ds(l.parentRule)}),a.apply(l,u)})}),Y(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function r6({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){let s=Y(l=>ti(Y(u=>{let c=si(u);if(!c||je(c,t,r,!0))return;let{currentTime:d,volume:p,muted:h,playbackRate:f,loop:m}=c;e({type:l,id:n.getId(c),currentTime:d,volume:p,muted:h,playbackRate:f,loop:m})}),i.media||500)),a=[Fe("play",s(Vr.Play),o),Fe("pause",s(Vr.Pause),o),Fe("seeked",s(Vr.Seeked),o),Fe("volumechange",s(Vr.VolumeChange),o),Fe("ratechange",s(Vr.RateChange),o)];return Y(()=>{a.forEach(l=>l())})}function n6({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(l,u,c){let d=new o(l,u,c);return i.set(d,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};let s=br(t.fonts,"add",function(a){return function(l){return setTimeout(Y(()=>{let u=i.get(l);u&&(e(u),i.delete(l))}),0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=o}),n.push(s),Y(()=>{n.forEach(a=>a())})}function i6(e){let{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,s=!0,a=Y(()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let u=[],c=l.rangeCount||0;for(let d=0;d<c;d++){let p=l.getRangeAt(d),{startContainer:h,startOffset:f,endContainer:m,endOffset:g}=p;je(h,n,i,!0)||je(m,n,i,!0)||u.push({start:r.getId(h),startOffset:f,end:r.getId(m),endOffset:g})}o({ranges:u})});return a(),Fe("selectionchange",a)}function o6({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:br(r.customElements,"define",function(i){return function(o,s,a){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,s,a])}})}function s6(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),i(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),o(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),s(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),a(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),l(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),u(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),c(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),p(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),h(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),f(...m)}}function a6(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};s6(e,t);let n;e.recordDOM&&(n=bb(e,e.doc));let i=Y2(e),o=J2(e),s=Sb(e),a=Z2(e,{win:r}),l=Q2(e),u=r6(e),c=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(c=e6(e,{win:r}),d=wb(e,e.doc),p=t6(e,{win:r}),e.collectFonts&&(h=n6(e)));let f=i6(e),m=o6(e),g=[];for(let S of e.plugins)g.push(S.observer(S.callback,r,S.options));return Y(()=>{hr.forEach(S=>S.reset()),n?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),p(),h(),f(),m(),g.forEach(S=>S())})}function Wo(e){return typeof window[e]<"u"}function zo(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var fs=class{constructor(t){k(this,"iframeIdToRemoteIdMap",new WeakMap),k(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,i){let o=n||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(r);return a||(a=this.generateIdFn(),o.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){let i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=i.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},Gu=class{constructor(t){k(this,"iframes",new WeakMap),k(this,"crossOriginIframeMap",new WeakMap),k(this,"crossOriginIframeMirror",new fs(Lg)),k(this,"crossOriginIframeStyleMirror"),k(this,"crossOriginIframeRootIdMap",new WeakMap),k(this,"mirror"),k(this,"mutationCb"),k(this,"wrappedEmit"),k(this,"loadListener"),k(this,"stylesheetManager"),k(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new fs(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let i=this.crossOriginIframeMap.get(t.source);if(!i)return;let o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case H.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:H.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case H.Meta:case H.Load:case H.DomContentLoaded:return!1;case H.Plugin:return r;case H.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case H.IncrementalSnapshot:switch(r.data.source){case z.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case z.Drag:case z.TouchMove:case z.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(r.data,t,["id"]),r;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case z.Font:return r;case z.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case z.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,n,i){for(let o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==gb.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},Hu=class{constructor(t){k(this,"shadowDoms",new WeakSet),k(this,"mutationCb"),k(this,"scrollCb"),k(this,"bypassOptions"),k(this,"mirror"),k(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!zn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let n=bb({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Sb({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(U.host(t))),this.restoreHandlers.push(wb({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(br(t.prototype,"attachShadow",function(i){return function(o){let s=i.call(this,o),a=U.shadowRoot(this);return a&&mb(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l6=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Un=0;Un<Wr.length;Un++)l6[Wr.charCodeAt(Un)]=Un;var Un,u6=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=Wr[t[r]>>2],i+=Wr[(t[r]&3)<<4|t[r+1]>>4],i+=Wr[(t[r+1]&15)<<2|t[r+2]>>6],i+=Wr[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Eg=new Map;function c6(e,t){let r=Eg.get(e);return r||(r=new Map,Eg.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var vb=(e,t,r)=>{if(!e||!(Rb(e,t)||typeof e=="object"))return;let n=e.constructor.name,i=c6(r,n),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Yo(e,t,r){if(e instanceof Array)return e.map(n=>Yo(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,i=u6(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Yo(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Yo(e.data,t,r),e.width,e.height]};if(Rb(e,t)||typeof e=="object"){let n=e.constructor.name,i=vb(e,t,r);return{rr_type:n,index:i}}}}return e}var xb=(e,t,r)=>e.map(n=>Yo(n,t,r)),Rb=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function d6(e,t,r,n){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=br(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...u){return je(this.canvas,r,n,!0)||setTimeout(()=>{let c=xb(u,t,this);e(this.canvas,{type:Jr["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=ks(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:Jr["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function f6(e){return e==="experimental-webgl"?"webgl":e}function Cg(e,t,r,n){let i=[];try{let o=br(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!je(this,t,r,!0)){let u=f6(a);if("__context"in this||(this.__context=u),n&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){let c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[a,...l])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function Ag(e,t,r,n,i,o){let s=[],a=Object.getOwnPropertyNames(e);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let u=br(e,l,function(c){return function(...d){let p=c.apply(this,d);if(vb(p,o,this),"tagName"in this.canvas&&!je(this.canvas,n,i,!0)){let h=xb(d,o,this),f={type:t,property:l,args:h};r(this.canvas,f)}return p}});s.push(u)}catch{let u=ks(e,l,{set(c){r(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function p6(e,t,r,n){let i=[];return i.push(...Ag(t.WebGLRenderingContext.prototype,Jr.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Ag(t.WebGL2RenderingContext.prototype,Jr.WebGL2,e,r,n,t)),()=>{i.forEach(o=>o())}}var kb="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",h6=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Ig=typeof window<"u"&&window.Blob&&new Blob([h6(kb)],{type:"text/javascript;charset=utf-8"});function m6(e){let t;try{if(t=Ig&&(window.URL||window.webkitURL).createObjectURL(Ig),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;base64,"+kb,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var qu=class{constructor(t){k(this,"pendingCanvasMutations",new Map),k(this,"rafStamps",{latestId:0,invokeId:null}),k(this,"mirror"),k(this,"mutationCb"),k(this,"resetObservers"),k(this,"frozen",!1),k(this,"locked",!1),k(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});let{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,i,o){let s=Cg(r,n,i,!0),a=new Map,l=new m6;l.onmessage=f=>{let{id:m}=f.data;if(a.set(m,!1),!("base64"in f.data))return;let{base64:g,type:S,width:w,height:y}=f.data;this.mutationCb({id:m,type:Jr["2D"],commands:[{property:"clearRect",args:[0,0,w,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:S}]},0,0]}]})};let u=1e3/t,c=0,d,p=()=>{let f=[];return r.document.querySelectorAll("canvas").forEach(m=>{je(m,n,i,!0)||f.push(m)}),f},h=f=>{if(c&&f-c<u){d=requestAnimationFrame(h);return}c=f,p().forEach(async m=>{var g;let S=this.mirror.getId(m);if(a.get(S)||m.width===0||m.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(m.__context)){let y=m.getContext(m.__context);((g=y?.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let w=await createImageBitmap(m);l.postMessage({id:S,bitmap:w,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[w])}),d=requestAnimationFrame(h)};d=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Cg(t,r,n,!1),o=d6(this.processMutation.bind(this),t,r,n),s=p6(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let i=n.map(s=>{let{type:a,...l}=s;return l}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}},Ku=class{constructor(t){k(this,"trackedLinkElements",new WeakSet),k(this,"mutationCb"),k(this,"adoptedStyleSheetCb"),k(this,"styleMirror",new Bu),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},i=[];for(let o of t){let s;this.styleMirror.has(o)?s=this.styleMirror.getId(o):(s=this.styleMirror.add(o),i.push({styleId:s,rules:Array.from(o.rules||CSSRule,(a,l)=>({rule:Og(a,o.href),index:l}))})),n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Yu=class{constructor(){k(this,"nodeMap",new WeakMap),k(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},we,Jo,su,ps=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Tm=e.contentWindow)==null?void 0:Tm.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var at=bP();function Sr(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:h,maskInputFn:f,maskTextFn:m,hooks:g,packFn:S,sampling:w={},dataURLOptions:y={},mousemoveWait:x,recordDOM:E=!0,recordCanvas:N=!1,recordCrossOriginIframes:I=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:C=!1,collectFonts:V=!1,inlineImages:Z=!1,plugins:X,keepIframeSrcFn:F=()=>!1,ignoreCSSAttributes:$e=new Set([]),errorHandler:pt}=e;q2(pt);let Pe=I?window.parent===window:!0,Ze=!1;if(!Pe)try{window.parent.document&&(Ze=!1)}catch{Ze=!0}if(Pe&&!t)throw new Error("emit function is required");if(!Pe&&!Ze)return()=>{};x!==void 0&&w.mousemove===void 0&&(w.mousemove=x),at.reset();let ir=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},ht=Fg(h);U2();let Ef,oa=0,Cf=Q=>{for(let tt of X||[])tt.eventProcessor&&(Q=tt.eventProcessor(Q));return S&&!Ze&&(Q=S(Q)),Q};we=(Q,tt)=>{var ye;let be=Q;if(be.timestamp=cs(),(ye=hr[0])!=null&&ye.isFrozen()&&be.type!==H.FullSnapshot&&!(be.type===H.IncrementalSnapshot&&be.data.source===z.Mutation)&&hr.forEach(Ge=>Ge.unfreeze()),Pe)t?.(Cf(be),tt);else if(Ze){let Ge={type:"rrweb",event:Cf(be),origin:window.location.origin,isCheckout:tt};window.parent.postMessage(Ge,"*")}if(be.type===H.FullSnapshot)Ef=be,oa=0;else if(be.type===H.IncrementalSnapshot){if(be.data.source===z.Mutation&&be.data.isAttachIframe)return;oa++;let Ge=n&&oa>=n,se=r&&be.timestamp-Ef.timestamp>r;(Ge||se)&&Jo(!0)}};let Ai=Q=>{we({type:H.IncrementalSnapshot,data:{source:z.Mutation,...Q}})},Af=Q=>we({type:H.IncrementalSnapshot,data:{source:z.Scroll,...Q}}),If=Q=>we({type:H.IncrementalSnapshot,data:{source:z.CanvasMutation,...Q}}),fx=Q=>we({type:H.IncrementalSnapshot,data:{source:z.AdoptedStyleSheet,...Q}}),or=new Ku({mutationCb:Ai,adoptedStyleSheetCb:fx}),sr=new Gu({mirror:at,mutationCb:Ai,stylesheetManager:or,recordCrossOriginIframes:I,wrappedEmit:we});for(let Q of X||[])Q.getMirror&&Q.getMirror({nodeMirror:at,crossOriginIframeMirror:sr.crossOriginIframeMirror,crossOriginIframeStyleMirror:sr.crossOriginIframeStyleMirror});let sa=new Yu;su=new qu({recordCanvas:N,mutationCb:If,win:window,blockClass:i,blockSelector:o,mirror:at,sampling:w.canvas,dataURLOptions:y});let Ii=new Hu({mutationCb:Ai,scrollCb:Af,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ir,dataURLOptions:y,maskTextFn:m,maskInputFn:f,recordCanvas:N,inlineImages:Z,sampling:w,slimDOMOptions:ht,iframeManager:sr,stylesheetManager:or,canvasManager:su,keepIframeSrcFn:F,processedNodeManager:sa},mirror:at});Jo=(Q=!1)=>{if(!E)return;we({type:H.Meta,data:{href:window.location.href,width:ub(),height:lb()}},Q),or.reset(),Ii.init(),hr.forEach(ye=>ye.lock());let tt=UP(document,{mirror:at,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ir,maskTextFn:m,maskInputFn:f,slimDOM:ht,dataURLOptions:y,recordCanvas:N,inlineImages:Z,onSerialize:ye=>{fb(ye,at)&&sr.addIframe(ye),pb(ye,at)&&or.trackLinkElement(ye),Vu(ye)&&Ii.addShadowRoot(U.shadowRoot(ye),document)},onIframeLoad:(ye,be)=>{sr.attachIframe(ye,be),Ii.observeAttachShadow(ye)},onStylesheetLoad:(ye,be)=>{or.attachLinkElement(ye,be)},keepIframeSrcFn:F});if(!tt)return console.warn("Failed to snapshot the document");we({type:H.FullSnapshot,data:{node:tt,initialOffset:ab(window)}},Q),hr.forEach(ye=>ye.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&or.adoptStyleSheets(document.adoptedStyleSheets,at.getId(document))};try{let Q=[],tt=be=>{var Ge;return Y(a6)({mutationCb:Ai,mousemoveCb:(se,aa)=>we({type:H.IncrementalSnapshot,data:{source:aa,positions:se}}),mouseInteractionCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.MouseInteraction,...se}}),scrollCb:Af,viewportResizeCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.ViewportResize,...se}}),inputCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.Input,...se}}),mediaInteractionCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.MediaInteraction,...se}}),styleSheetRuleCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.StyleSheetRule,...se}}),styleDeclarationCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.StyleDeclaration,...se}}),canvasMutationCb:If,fontCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.Font,...se}}),selectionCb:se=>{we({type:H.IncrementalSnapshot,data:{source:z.Selection,...se}})},customElementCb:se=>{we({type:H.IncrementalSnapshot,data:{source:z.CustomElement,...se}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:ir,inlineStylesheet:c,sampling:w,recordDOM:E,recordCanvas:N,inlineImages:Z,userTriggeredOnInput:C,collectFonts:V,doc:be,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:F,blockSelector:o,slimDOMOptions:ht,dataURLOptions:y,mirror:at,iframeManager:sr,stylesheetManager:or,shadowDomManager:Ii,processedNodeManager:sa,canvasManager:su,ignoreCSSAttributes:$e,plugins:((Ge=X?.filter(se=>se.observer))==null?void 0:Ge.map(se=>({observer:se.observer,options:se.options,callback:aa=>we({type:H.Plugin,data:{plugin:se.name,payload:aa}})})))||[]},g)};sr.addLoadListener(be=>{try{Q.push(tt(be.contentDocument))}catch(Ge){console.warn(Ge)}});let ye=()=>{Jo(),Q.push(tt(document)),ps=!0};return["interactive","complete"].includes(document.readyState)?ye():(Q.push(Fe("DOMContentLoaded",()=>{we({type:H.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&ye()})),Q.push(Fe("load",()=>{we({type:H.Load,data:{}}),M==="load"&&ye()},window))),()=>{Q.forEach(be=>{try{be()}catch(Ge){String(Ge).toLowerCase().includes("cross-origin")||console.warn(Ge)}}),sa.destroy(),ps=!1,K2()}}catch(Q){console.warn(Q)}}Sr.addCustomEvent=(e,t)=>{if(!ps)throw new Error("please add custom event after start recording");we({type:H.Custom,data:{tag:e,payload:t}})};Sr.freezePage=()=>{hr.forEach(e=>e.freeze())};Sr.takeFullSnapshot=e=>{if(!ps)throw new Error("please take full snapshot after start recording");Jo(e)};Sr.mirror=at;var Pg;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Pg||(Pg={}));var nG=5*1e3;var{addCustomEvent:iG}=Sr,{freezePage:oG}=Sr,{takeFullSnapshot:sG}=Sr;var Ab="__ripploEmitRrwebEvent";function Ib(){return{eventTypes:Eb(H),incrementalSources:Eb(z)}}function Eb(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,r])=>[r,t]))}var y6=Hl("@ripplo/rrweb-bundle/bundle","rrweb.js"),Cb;function Pb(){return Cb??=g6(y6,{encoding:"utf8"}),Cb}async function wc({clientVersion:e,debugDir:t,writeOtlpPortFile:r}){let n=new Map,i=Am(Ib()),o=await za({localDir:Tb.join(Tb.dirname(t),".local"),writePortFile:r,onRrwebBatch:(l,u)=>{n.get(l)?.emitRrwebBatch(u)},onSpan:l=>{let u=l.attributes["ripplo.run"];u!=null&&n.get(u)?.emit(l)}}),s=await Pb();return{attach:async(l,u)=>{let c=Tp({debugDir:t,runId:u,worker:i});c.emit({clientVersion:e,kind:"meta",source:"capture",timeNanos:"0"}),n.set(u,c),await Pm(l,u),await l.addInitScript(`globalThis.__ripploCapturePort = ${String(o.port)};`),await S6(l,c);let d=[];return{emitAction:p=>{x6(c,p)},emitAssertion:p=>{R6(c,p)},finish:()=>w6(c,{pages:d,registry:n,runId:u}),onPage:p=>{d.push(p),v6(c,s,p)}}},close:async()=>{await o.stop(),await i.terminate()},injectSpan:(l,u)=>{n.get(l)?.emit(u)}}}async function b6(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function S6(e,t){await e.exposeBinding(Ab,(r,n)=>{let i=typeof n=="string"?n:JSON.stringify(n);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}async function w6(e,t){await b6(t.pages),t.registry.delete(t.runId),await e.close({noticeIfNoRrweb:"rrweb capture unavailable: recorder never pushed an event \u2014 page never loaded the recorder (blank page, failed navigation, or CSP block)"})}function v6(e,t,r){r.on("load",()=>{r.addScriptTag({content:t}).catch(()=>{})}),r.on("response",n=>{A6(e,n)}),r.on("console",n=>{e.emit({kind:"console",level:n.type(),source:"browser",text:n.text(),timeNanos:Tr(Date.now())})}),r.on("pageerror",n=>{e.emit({kind:"error",message:n.message,source:"browser",stack:n.stack,timeNanos:Tr(Date.now())})})}function x6(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:k6(t),timeNanos:Tr(Date.now()),value:E6(t)})}function R6(e,t){let r=Gl(t);e.emit({kind:"assertion",label:r.label,outcome:t.outcome,source:"test",step:r.step,timeNanos:Tr(Date.now())})}function k6(e){if(e.url!=null)return e.url;if(e.locator!=null)return Sc(e.locator)}function Sc(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${Sc(e.scope)} \u25B8 ${Sc(e.target)}`:`${e.role} ${e.name??""}`.trim()}function E6(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var C6=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;function A6(e,t){let r=t.request(),n=r.resourceType();if(n!=="fetch"&&n!=="xhr"||C6.test(r.url()))return;let i=r.headers().traceparent?.split("-");e.emit({kind:"network",method:r.method(),resourceType:n,source:"browser",spanId:i?.[2],status:t.status(),timeNanos:Tr(Date.now()),traceId:i?.[1],url:t.url()})}import{err as H0,ok as Zd,ResultAsync as D8}from"neverthrow";function vc(e){return{invariants:El(e),laws:xl(e)}}var Mb=Object.defineProperty,Ob=(e,t)=>{let r={};for(var n in e)Mb(r,n,{get:e[n],enumerable:!0});return t||Mb(r,Symbol.toStringTag,{value:"Module"}),r};var I6=class Nb{constructor(t){this.seed=t}clone(){return new Nb(this.seed)}next(){let t=xc(this.seed),r=Rc(t),n=xc(t),i=Rc(n);return this.seed=xc(n),Rc(this.seed)+(i+(r<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function xc(e){return Math.imul(e,214013)+2531011&4294967295}function Rc(e){return(e&-2147483649)>>16}function Lb(e){return new I6(e)}var P6="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",T6=class Db{constructor(t,r){this.states=t,this.index=r}clone(){return new Db(this.states.slice(),this.index)}next(){let t=this.states[this.index];return t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,this.index=Es(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),r=this.index;this.index=Es(this.states,this.index);for(let n=19932;n>0;--n)P6.charCodeAt(n/6|0)-48&1<<n%6&&$b(this.states,this.index,t,r),this.index=Es(this.states,this.index);$b(this.states,this.index,t,r)}};function $b(e,t,r,n){let i=0;if(n>=t){for(;i<624-n;i++)e[i+t]^=r[i+n];for(;i<624-t;i++)e[i+t]^=r[i+n-624];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}else{for(;i<624-t;i++)e[i+t]^=r[i+n];for(;i<624-n;i++)e[i+t-624]^=r[i+n];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}}function Es(e,t){if(t<227){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397]^r>>>1^-(r&1)&2567483615,t+1}else if(t<623){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397-624]^r>>>1^-(r&1)&2567483615,t+1}else{let r=e[t]&2147483648|e[0]&2147483647;return e[t]=e[396]^r>>>1^-(r&1)&2567483615,0}}function M6(e){for(let t=0;t!==624;++t)Es(e,t)}function _b(e){let t=[e|0];for(let r=1;r!==624;++r){let n=t[r-1]^t[r-1]>>>30;t.push(Math.imul(1812433253,n)+r|0)}return M6(t),new T6(t,0)}var O6=class Fb{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new Fb(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00^this.s00<<23,r=this.s01^(this.s01<<23|this.s00>>>9),n=t^this.s10^(t>>>18|r<<14)^(this.s10>>>5|this.s11<<27),i=r^this.s11^r>>>18^this.s11>>>5,o=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=i,this.s10=n,o}jump(){let t=0,r=0,n=0,i=0,o=[1667051007,2321340297,1548169110,304075285];for(let s=0;s!==4;++s)for(let a=1;a;a<<=1)o[s]&a&&(t^=this.s01,r^=this.s00,n^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=r,this.s11=n,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function kc(e){return new O6(-1,~e,e|0,0)}var N6=class jb{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new jb(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00+this.s10|0,r=this.s10^this.s00,n=this.s11^this.s01,i=this.s00,o=this.s01;return this.s00=i<<24^o>>>8^r^r<<16,this.s01=o<<24^i>>>8^n^(n<<16|r>>>16),this.s10=n<<5^r>>>27,this.s11=r<<5^n>>>27,t}jump(){let t=0,r=0,n=0,i=0,o=[3639956645,3750757012,1261568508,386426335];for(let s=0;s!==4;++s)for(let a=1;a;a<<=1)o[s]&a&&(t^=this.s01,r^=this.s00,n^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=r,this.s11=n,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Vb(e){return new N6(-1,~e,e|0,0)}function Bb(e,t){for(let r=0;r!==t;++r)e.next()}var Ub=BigInt,L6=4294967296n;function zb(e,t,r){let n=r-t+1n,i=L6,o=1;for(;i<n;)i<<=32n,++o;let s=Wb(o,e);if(s<n)return s+t;if(s+n<i)return s%n+t;let a=i-i%n;for(;s>=a;)s=Wb(o,e);return s%n+t}function Wb(e,t){let r=Ub(t.next()+2147483648);for(let n=1;n<e;++n){let i=t.next();r=(r<<32n)+Ub(i+2147483648)}return r}function ai(e,t){let r=t>2?~~(4294967296/t)*t:4294967296,n=e.next()+2147483648;for(;n>=r;)n=e.next()+2147483648;return n%t}function Ec(e,t){if(t<0){let r=-t;e.sign=-1,e.data[0]=~~(r/4294967296),e.data[1]=r>>>0}else e.sign=1,e.data[0]=~~(t/4294967296),e.data[1]=t>>>0;return e}function $6(e,t,r){let n=t.data[1],i=t.data[0],o=t.sign,s=r.data[1],a=r.data[0],l=r.sign;if(e.sign=1,o===1&&l===-1){let m=n+s,g=i+a+(m>4294967295?1:0);return e.data[0]=g>>>0,e.data[1]=m>>>0,e}let u=n,c=i,d=s,p=a;o===-1&&(u=s,c=a,d=n,p=i);let h=0,f=u-d;return f<0&&(h=1,f=f>>>0),e.data[0]=c-p-h,e.data[1]=f,e}function D6(e,t,r){let n=r[0]+1;for(t[0]=ai(e,n),t[1]=ai(e,4294967296);t[0]>=r[0]&&(t[0]!==r[0]||t[1]>=r[1]);)t[0]=ai(e,n),t[1]=ai(e,4294967296);return t}var _6=Number.MAX_SAFE_INTEGER,F6={sign:1,data:[0,0]},j6={sign:1,data:[0,0]},Gb={sign:1,data:[0,0]},Cc=[0,0];function V6(e,t,r,n){let i=n<=_6?Ec(Gb,n):$6(Gb,Ec(F6,r),Ec(j6,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,D6(e,Cc,i.data),Cc[0]*4294967296+Cc[1]+t}function Cs(e,t,r){let n=r-t;return n<=4294967295?ai(e,n+1)+t:V6(e,t,r,n)}var Hb=Symbol.for("fast-check/PreconditionFailure"),nr=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=Hb}static isFailure(e){return e!=null&&e.footprint===Hb}};function B6(e){if(!e)throw new nr}var U6=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},W6=new U6;function z6(){return W6}function*G6(e,t){for(let r of e)yield t(r)}function*H6(e,t){for(let r of e)yield*t(r)}function*q6(e,t){for(let r of e)t(r)&&(yield r)}function*K6(e,t){for(let r=0;r<t;++r){let n=e.next();if(n.done)break;yield n.value}}function*Y6(e,t){let r=e.next();for(;!r.done&&t(r.value);)yield r.value,r=e.next()}function*J6(e,t){for(let r=e.next();!r.done;r=e.next())yield r.value;for(let r of t)for(let n=r.next();!n.done;n=r.next())yield n.value}var Z6=Symbol.iterator,j=class Lt{static nil(){return new Lt(z6())}static of(...t){return new Lt(t[Z6]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Lt(G6(this.g,t))}flatMap(t){return new Lt(H6(this.g,t))}dropWhile(t){let r=!1;function*n(i){(r||!t(i))&&(r=!0,yield i)}return this.flatMap(n)}drop(t){if(t<=0)return this;let r=0;function n(){return r++<t}return this.dropWhile(n)}takeWhile(t){return new Lt(Y6(this.g,t))}take(t){return new Lt(K6(this.g,t))}filter(t){return new Lt(q6(this.g,t))}every(t){for(let r of this.g)if(!t(r))return!1;return!0}has(t){for(let r of this.g)if(t(r))return[!0,r];return[!1,null]}join(...t){return new Lt(J6(this.g,t))}getNthOrLast(t){let r=t,n=null;for(let i of this.g){if(r--===0)return i;n=i}return n}};function tr(e){return new j(e)}var Oe=Symbol.for("fast-check/cloneMethod");function vr(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Oe in e&&typeof e[Oe]=="function"}function tn(e){return vr(e)?e[Oe]():e}var X6=Object.defineProperty,_=class{constructor(e,t,r){this.value_=e,this.context=t,this.hasToBeCloned=r!==void 0||vr(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&X6(this,"value",{get:r!==void 0?r:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[Oe]():(this.readOnce=!0,this.value_):this.value_}},de=class{filter(e){return new t4(this,e)}map(e,t){return new e4(this,e,t)}chain(e){return new Q6(this,e)}},Q6=class extends de{constructor(e,t){super(),this.arb=e,this.chainer=t}generate(e,t){let r=e.clone(),n=this.arb.generate(e,t);return this.valueChainer(n,e,r,t)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?(t.stoppedForOriginal?j.nil():this.arb.shrink(t.originalValue,t.originalContext).map(r=>this.valueChainer(r,t.clonedMrng.clone(),t.clonedMrng,t.originalBias))).join(t.chainedArbitrary.shrink(e,t.chainedContext).map(r=>{let n={...t,chainedContext:r.context,stoppedForOriginal:!0};return new _(r.value_,n)})):j.nil()}valueChainer(e,t,r,n){let i=this.chainer(e.value_),o=i.generate(t,n),s={originalBias:n,originalValue:e.value_,originalContext:e.context,stoppedForOriginal:!1,chainedArbitrary:i,chainedContext:o.context,clonedMrng:r};return new _(o.value_,s)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalBias"in e&&"originalValue"in e&&"originalContext"in e&&"stoppedForOriginal"in e&&"chainedArbitrary"in e&&"chainedContext"in e&&"clonedMrng"in e}},e4=class extends de{constructor(e,t,r){super(),this.arb=e,this.mapper=t,this.unmapper=r,this.bindValueMapper=n=>this.valueMapper(n)}generate(e,t){let r=this.arb.generate(e,t);return this.valueMapper(r)}canShrinkWithoutContext(e){if(this.unmapper!==void 0)try{let t=this.unmapper(e);return this.arb.canShrinkWithoutContext(t)}catch{return!1}return!1}shrink(e,t){if(this.isSafeContext(t))return this.arb.shrink(t.originalValue,t.originalContext).map(this.bindValueMapper);if(this.unmapper!==void 0){let r=this.unmapper(e);return this.arb.shrink(r,void 0).map(this.bindValueMapper)}return j.nil()}mapperWithCloneIfNeeded(e){let t=e.value,r=this.mapper(t);return e.hasToBeCloned&&(typeof r=="object"&&r!==null||typeof r=="function")&&Object.isExtensible(r)&&!vr(r)&&Object.defineProperty(r,Oe,{get:()=>()=>this.mapperWithCloneIfNeeded(e)[0]}),[r,t]}valueMapper(e){let[t,r]=this.mapperWithCloneIfNeeded(e);return new _(t,{originalValue:r,originalContext:e.context})}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalValue"in e&&"originalContext"in e}},t4=class extends de{constructor(e,t){super(),this.arb=e,this.refinement=t,this.bindRefinementOnValue=r=>this.refinementOnValue(r)}generate(e,t){for(;;){let r=this.arb.generate(e,t);if(this.refinementOnValue(r))return r}}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)&&this.refinement(e)}shrink(e,t){return this.arb.shrink(e,t).filter(this.bindRefinementOnValue)}refinementOnValue(e){return this.refinement(e.value)}};function Hw(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function qw(e){if(!Hw(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Kw=Function.prototype.apply,Ac=Symbol("apply");function r4(e){try{return e.apply}catch{return}}function n4(e,t,r){let n=e;n[Ac]=Kw;let i=n[Ac](t,r);return delete n[Ac],i}function q(e,t,r){return r4(e)===Kw?e.apply(t,r):n4(e,t,r)}var Yw=Array,O=BigInt,i4=BigInt64Array,o4=BigUint64Array,Jw=Boolean,Bs=Date,L=Error,Zw=Float32Array,Xw=Float64Array,s4=Int8Array,a4=Int16Array,l4=Int32Array,Dt=Number,Ve=String,rn=Set,u4=Uint8Array,c4=Uint8ClampedArray,d4=Uint16Array,f4=Uint32Array,p4=encodeURIComponent,_t=Map,Ls=Symbol,qb=Array.prototype.forEach,Kb=Array.prototype.indexOf,Yb=Array.prototype.join,Jb=Array.prototype.map,Zb=Array.prototype.flat,Xb=Array.prototype.filter,Qb=Array.prototype.push,eS=Array.prototype.pop,tS=Array.prototype.splice,rS=Array.prototype.slice,nS=Array.prototype.sort,iS=Array.prototype.every;function h4(e){try{return e.forEach}catch{return}}function m4(e){try{return e.indexOf}catch{return}}function g4(e){try{return e.join}catch{return}}function y4(e){try{return e.map}catch{return}}function b4(e){try{return e.flat}catch{return}}function S4(e){try{return e.filter}catch{return}}function w4(e){try{return e.push}catch{return}}function v4(e){try{return e.pop}catch{return}}function x4(e){try{return e.splice}catch{return}}function R4(e){try{return e.slice}catch{return}}function k4(e){try{return e.sort}catch{return}}function E4(e){try{return e.every}catch{return}}function Qw(e,t){return h4(e)===qb?e.forEach(t):q(qb,e,[t])}function $t(e,...t){return m4(e)===Kb?e.indexOf(...t):q(Kb,e,t)}function ce(e,...t){return g4(e)===Yb?e.join(...t):q(Yb,e,t)}function G(e,t){return y4(e)===Jb?e.map(t):q(Jb,e,[t])}function C4(e,t){return b4(e)===Zb?([].flat(),e.flat(t)):q(Zb,e,[t])}function A4(e,t){return S4(e)===Xb?e.filter(t):q(Xb,e,[t])}function $(e,...t){return w4(e)===Qb?e.push(...t):q(Qb,e,t)}function e1(e){return v4(e)===eS?e.pop():q(eS,e,[])}function t1(e,...t){return x4(e)===tS?e.splice(...t):q(tS,e,t)}function Le(e,...t){return R4(e)===rS?e.slice(...t):q(rS,e,t)}function r1(e,...t){return k4(e)===nS?e.sort(...t):q(nS,e,t)}function n1(e,...t){return E4(e)===iS?e.every(...t):q(iS,e,t)}var oS=Date.prototype.getTime,sS=Date.prototype.toISOString;function I4(e){try{return e.getTime}catch{return}}function P4(e){try{return e.toISOString}catch{return}}function Us(e){return I4(e)===oS?e.getTime():q(oS,e,[])}function T4(e){return P4(e)===sS?e.toISOString():q(sS,e,[])}var aS=Set.prototype.add,lS=Set.prototype.has;function M4(e){try{return e.add}catch{return}}function O4(e){try{return e.has}catch{return}}function fi(e,t){return M4(e)===aS?e.add(t):q(aS,e,[t])}function Ws(e,t){return O4(e)===lS?e.has(t):q(lS,e,[t])}var uS=WeakMap.prototype.set,cS=WeakMap.prototype.get;function N4(e){try{return e.set}catch{return}}function L4(e){try{return e.get}catch{return}}function $4(e,t,r){return N4(e)===uS?e.set(t,r):q(uS,e,[t,r])}function D4(e,t){return L4(e)===cS?e.get(t):q(cS,e,[t])}var dS=Map.prototype.set,fS=Map.prototype.get,pS=Map.prototype.has;function _4(e){try{return e.set}catch{return}}function F4(e){try{return e.get}catch{return}}function j4(e){try{return e.has}catch{return}}function ct(e,t,r){return _4(e)===dS?e.set(t,r):q(dS,e,[t,r])}function Je(e,t){return F4(e)===fS?e.get(t):q(fS,e,[t])}function V4(e,t){return j4(e)===pS?e.has(t):q(pS,e,[t])}var hS=String.prototype.split,mS=String.prototype.startsWith,gS=String.prototype.endsWith,yS=String.prototype.substring,bS=String.prototype.toLowerCase,SS=String.prototype.toUpperCase,wS=String.prototype.padStart,vS=String.prototype.charCodeAt,xS=String.prototype.normalize,RS=String.prototype.replace;function B4(e){try{return e.split}catch{return}}function U4(e){try{return e.startsWith}catch{return}}function W4(e){try{return e.endsWith}catch{return}}function z4(e){try{return e.substring}catch{return}}function G4(e){try{return e.toLowerCase}catch{return}}function H4(e){try{return e.toUpperCase}catch{return}}function q4(e){try{return e.padStart}catch{return}}function K4(e){try{return e.charCodeAt}catch{return}}function Y4(e){try{return e.normalize}catch{return}}function J4(e){try{return e.replace}catch{return}}function Be(e,...t){return B4(e)===hS?e.split(...t):q(hS,e,t)}function Z4(e,...t){return U4(e)===mS?e.startsWith(...t):q(mS,e,t)}function X4(e,...t){return W4(e)===gS?e.endsWith(...t):q(gS,e,t)}function ge(e,...t){return z4(e)===yS?e.substring(...t):q(yS,e,t)}function Xc(e){return G4(e)===bS?e.toLowerCase():q(bS,e,[])}function kd(e){return H4(e)===SS?e.toUpperCase():q(SS,e,[])}function Q4(e,...t){return q4(e)===wS?e.padStart(...t):q(wS,e,t)}function nn(e,t){return K4(e)===vS?e.charCodeAt(t):q(vS,e,[t])}function eN(e,t){return Y4(e)===xS?e.normalize(t):q(xS,e,[t])}function tN(e,t,r){return J4(e)===RS?e.replace(t,r):q(RS,e,[t,r])}var kS=Number.prototype.toString;function rN(e){try{return e.toString}catch{return}}function pi(e,...t){return rN(e)===kS?e.toString(...t):q(kS,e,t)}var nN=Object.prototype.hasOwnProperty,iN=Object.prototype.toString;function i1(e,t){return q(nN,e,[t])}function Qc(e){return q(iN,e,[])}var oN=Error.prototype.toString;function sN(e){return q(oN,e,[])}var aN=class{constructor(e){this.producer=e}[Symbol.iterator](){return this.it===void 0&&(this.it=this.producer()),this.it}next(){return this.it===void 0&&(this.it=this.producer()),this.it.next()}};function er(e){return new aN(e)}var o1=Array.isArray,lN=Object.defineProperty;function s1(e,t){return lN(e,Oe,{value:()=>{let r=[];for(let n=0;n!==t.length;++n)$(r,t[n].value);return s1(r,t),r}})}function a1(e){let t=!1,r=[],n=[];for(let i=0;i!==e.length;++i){let o=e[i];t=t||o.hasToBeCloned,$(r,o.value),$(n,o.context)}return t&&s1(r,e),new _(r,n)}function l1(e,t,r){let n=[],i=o1(r)?r:[];for(let o=0;o!==e.length;++o)$(n,er(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=G(t,(l,u)=>new _(tn(l),i[u]));return[...Le(a,0,o),s,...Le(a,o+1)]}).map(a1)));return j.nil().join(...n)}var uN=class extends de{constructor(e){super(),this.arbs=e;for(let t=0;t!==e.length;++t){let r=e[t];if(r==null||r.generate===null||r.generate===void 0)throw new Error(`Invalid parameter encountered at index ${t}: expecting an Arbitrary`)}}generate(e,t){let r=[];for(let n=0;n!==this.arbs.length;++n)$(r,this.arbs[n].generate(e,t));return a1(r)}canShrinkWithoutContext(e){if(!o1(e)||e.length!==this.arbs.length)return!1;for(let t=0;t!==this.arbs.length;++t)if(!this.arbs[t].canShrinkWithoutContext(e[t]))return!1;return!0}shrink(e,t){return l1(this.arbs,e,t)}};function B(...e){return new uN(e)}var cN=Math.log;function u1(e){return 2+~~(cN(e+1)*.4342944819032518)}var Ed={};function dN(e){Ed=e}function dt(){return Ed}function fN(){Ed={}}var hi=Symbol("UndefinedContextPlaceholder");function on(e){return e.context!==void 0?e:e.hasToBeCloned?new _(e.value_,hi,()=>e.value):new _(e.value_,hi)}var ES=()=>{},pN=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:r,asyncAfterEach:n,beforeEach:i,afterEach:o}=dt()||{};if(r!==void 0&&i!==void 0)throw L(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(n!==void 0&&o!==void 0)throw L(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=r||i||ES,this.afterEachHook=n||o||ES}isAsync(){return!0}generate(e,t){return on(this.arb.generate(e,t!==void 0?u1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==hi?e.context:void 0;return this.arb.shrink(e.value_,t).map(on)}async runBeforeEach(){await this.beforeEachHook()}async runAfterEach(){await this.afterEachHook()}async run(e){try{let t=await this.predicate(e);return t===void 0||t===!0?null:{error:new L("Property failed by returning false")}}catch(t){return nr.isFailure(t)?t:{error:t}}}beforeEach(e){let t=this.beforeEachHook;return this.beforeEachHook=()=>e(t),this}afterEach(e){let t=this.afterEachHook;return this.afterEachHook=()=>e(t),this}},c1=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return on(this.arb.generate(e,t))}canShrinkWithoutContext(e){return!0}shrink(e,t){if(t===void 0&&!this.arb.canShrinkWithoutContext(e))return j.nil();let r=t!==hi?t:void 0;return this.arb.shrink(e,r).map(on)}};function hN(...e){if(e.length<2)throw new Error("asyncProperty expects at least two parameters");let t=Le(e,0,e.length-1),r=e[e.length-1];return Qw(t,qw),new pN(B(...G(t,n=>new c1(n))),n=>r(...n))}var CS=()=>{},d1=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:r=CS,afterEach:n=CS,asyncBeforeEach:i,asyncAfterEach:o}=dt()||{};if(i!==void 0)throw L(`"asyncBeforeEach" can't be set when running synchronous properties`);if(o!==void 0)throw L(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=r,this.afterEachHook=n}isAsync(){return!1}generate(e,t){return on(this.arb.generate(e,t!==void 0?u1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==hi?e.context:void 0;return this.arb.shrink(e.value_,t).map(on)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(e){try{let t=this.predicate(e);return t===void 0||t===!0?null:{error:new L("Property failed by returning false")}}catch(t){return nr.isFailure(t)?t:{error:t}}}beforeEach(e){let t=this.beforeEachHook;return this.beforeEachHook=()=>e(t),this}afterEach(e){let t=this.afterEachHook;return this.afterEachHook=()=>e(t),this}};function mN(...e){if(e.length<2)throw new Error("property expects at least two parameters");let t=Le(e,0,e.length-1),r=e[e.length-1];return Qw(t,qw),new d1(B(...G(t,n=>new c1(n))),n=>r(...n))}var gN=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function ed(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>ed(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>ed(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function f1(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>f1(e),next:()=>e.next(),jump:()=>Bb(e,42),getState:()=>e.getState()}}function qs(e){return f1(ed(e))}var yN=Date.now,bN=Math.min,SN=Math.random,wN=class{constructor(e){let t=e||{};this.seed=vN(t),this.randomType=xN(t),this.numRuns=RN(t),this.verbose=kN(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=Pc(t.timeout),this.skipAllAfterTimeLimit=Pc(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=Pc(t.interruptAfterTimeLimit),this.markInterruptAsFailure=t.markInterruptAsFailure===!0,this.skipEqualValues=t.skipEqualValues===!0,this.ignoreEqualValues=t.ignoreEqualValues===!0,this.logger=t.logger!==void 0?t.logger:r=>{console.log(r)},this.path=t.path!==void 0?t.path:"",this.unbiased=t.unbiased===!0,this.examples=t.examples!==void 0?t.examples:[],this.endOnFailure=t.endOnFailure===!0,this.reporter=t.reporter,this.asyncReporter=t.asyncReporter,this.includeErrorInReport=t.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 Ic(e){return t=>qs(e(t))}function vN(e){if(e.seed===void 0)return yN()^SN()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function xN(e){if(e.randomType===void 0)return kc;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return Ic(_b);case"congruential":case"congruential32":return Ic(Lb);case"xorshift128plus":return kc;case"xoroshiro128plus":return Vb;default:throw new Error(`Invalid random specified: '${e.randomType}'`)}let t=e.randomType(0);if("min"in t&&t.min!==-2147483648)throw new Error(`Invalid random number generator: min must equal -0x80000000, got ${String(t.min)}`);if("max"in t&&t.max!==2147483647)throw new Error(`Invalid random number generator: max must equal 0x7fffffff, got ${String(t.max)}`);return t===qs(t)?e.randomType:Ic(e.randomType)}function RN(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function kN(e){return e.verbose===void 0?0:typeof e.verbose=="boolean"?e.verbose===!0?1:0:e.verbose<=0?0:e.verbose>=2?2:e.verbose|0}function Pc(e){if(e!==void 0)return bN(e,2147483647)}function Cd(e){return new wN(e)}function EN(e,t,r){let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i(new nr(!0))},e)})}}var AS=class{constructor(e,t,r,n,i,o){this.property=e,this.getTime=t,this.interruptExecution=n,this.setTimeoutSafe=i,this.clearTimeoutSafe=o,this.skipAfterTime=this.getTime()+r}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}run(e){let t=this.skipAfterTime-this.getTime();if(t<=0){let r=new nr(this.interruptExecution);return this.isAsync()?Promise.resolve(r):r}if(this.interruptExecution&&this.isAsync()){let r=EN(t,this.setTimeoutSafe,this.clearTimeoutSafe),n=Promise.race([this.property.run(e),r.promise]);return n.then(r.clear,r.clear),n}return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},CN=(e,t,r)=>{let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i({error:new L(`Property timeout: exceeded limit of ${e} milliseconds`)})},e)})}},AN=class{constructor(e,t,r,n){this.property=e,this.timeMs=t,this.setTimeoutSafe=r,this.clearTimeoutSafe=n}isAsync(){return!0}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}async run(e){let t=CN(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),r=Promise.race([this.property.run(e),t.promise]);return r.then(t.clear,t.clear),r}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},p1=class{constructor(e){this.property=e}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,void 0)}shrink(e){return this.property.shrink(e)}run(e){return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},IS=Array.from,PS=typeof Buffer<"u"?Buffer.isBuffer:void 0,Zr=JSON.stringify,TS=Number.isNaN,IN=Object.keys,PN=Object.getOwnPropertySymbols,TN=Object.getOwnPropertyDescriptor,MS=Object.getPrototypeOf,OS=Number.NEGATIVE_INFINITY,MN=Number.POSITIVE_INFINITY,ft=Symbol.for("fast-check/toStringMethod");function Ad(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&ft in e&&typeof e[ft]=="function"}var Ft=Symbol.for("fast-check/asyncToStringMethod");function Id(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Ft in e&&typeof e[Ft]=="function"}var ON=/^Symbol\((.*)\)$/;function NN(e){if(e.description!==void 0)return e.description;let t=ON.exec(Ve(e));return t&&t[1].length?t[1]:null}function NS(e){switch(e){case 0:return 1/e===OS?"-0":"0";case OS:return"Number.NEGATIVE_INFINITY";case MN:return"Number.POSITIVE_INFINITY";default:return e===e?Ve(e):"Number.NaN"}}function LN(e){let t=-1;for(let r in e){let n=Number(r);if(n!==t+1)return!0;t=n}return t+1!==e.length}function Ye(e,t,r){let n=[...t,e];if(typeof e=="object"&&$t(t,e)!==-1)return"[cyclic]";if(Id(e)){let i=r(e);if(i.state==="fulfilled")return i.value}if(Ad(e))try{return e[ft]()}catch{}switch(Qc(e)){case"[object Array]":{let i=e;if(i.length>=50&&LN(i)){let s=[];for(let a in i)TS(Number(a))||$(s,`${a}:${Ye(i[a],n,r)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${ce(s,",")}})`:`Array(${i.length})`}let o=ce(G(i,s=>Ye(s,n,r)),",");return i.length===0||i.length-1 in i?`[${o}]`:`[${o},]`}case"[object BigInt]":return`${e}n`;case"[object Boolean]":{let i=e==!0?"true":"false";return typeof e=="boolean"?i:`new Boolean(${i})`}case"[object Date]":{let i=e;return TS(Us(i))?"new Date(NaN)":`new Date(${Zr(T4(i))})`}case"[object Map]":return`new Map(${Ye(Array.from(e),n,r)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?NS(e):`new Number(${NS(Number(e))})`;case"[object Object]":{try{let o=e.toString;if(typeof o=="function"&&o!==Object.prototype.toString)return e.toString()}catch{return"[object Object]"}let i=o=>`${o==="__proto__"?'["__proto__"]':typeof o=="symbol"?`[${Ye(o,n,r)}]`:Zr(o)}:${Ye(e[o],n,r)}`;return"{"+ce([...MS(e)===null?["__proto__:null"]:[],...G(IN(e),i),...G(A4(PN(e),o=>{let s=TN(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${Ye(Array.from(e),n,r)})`;case"[object String]":return typeof e=="string"?Zr(e):`new String(${Zr(e)})`;case"[object Symbol]":{let i=e;if(Ls.keyFor(i)!==void 0)return`Symbol.for(${Zr(Ls.keyFor(i))})`;let o=NN(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&Ls[o.substring(7)])?o:`Symbol(${Zr(o)})`}case"[object Promise]":{let i=r(e);switch(i.state){case"fulfilled":return`Promise.resolve(${Ye(i.value,n,r)})`;case"rejected":return`Promise.reject(${Ye(i.value,n,r)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(e instanceof Error)return`new Error(${Ye(e.message,n,r)})`;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 PS=="function"&&PS(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":Ye(IS(e.values()),n,r)})`;let i=MS(e),o=i&&i.constructor&&i.constructor.name;if(typeof o=="string"){let s=e;return s.buffer.detached?`${o}.from(/*detached ArrayBuffer*/)`:`${o}.from(${Ye(IS(s.values()),n,r)})`}break}}try{return e.toString()}catch{return Qc(e)}}function xe(e){return Ye(e,[],()=>({state:"unknown",value:void 0}))}function h1(e){let t=Ls(),r=[],n=new _t;function i(){let l=null,u=()=>{l!==null&&clearTimeout(l)};return{delay:new Promise(c=>{l=setTimeout(()=>{l=null,c(t)},0)}),cancel:u}}let o={state:"unknown",value:void 0},s=function(u){let c=u;if(n.has(c))return n.get(c);let d=i(),p=Ft in u?Promise.resolve().then(()=>u[Ft]()):u;return p.catch(()=>{}),r.push(Promise.race([p,d.delay]).then(h=>{h===t?n.set(c,{state:"pending",value:void 0}):n.set(c,{state:"fulfilled",value:h}),d.cancel()},h=>{n.set(c,{state:"rejected",value:h}),d.cancel()})),n.set(c,o),o};function a(){let l=Ye(e,[],s);return r.length===0?l:Promise.all(r.splice(0)).then(a)}return a()}async function Pd(e){return Promise.resolve(h1(e))}function LS(e){return e===null?new nr:e}function $N(...e){return e[1]?e[0].then(LS):LS(e[0])}function DN(e,t){return $N(e,t)}var $S=class{constructor(e,t){this.property=e,this.skipRuns=t,this.coveredCases=new Map}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}run(e){let t=xe(e);if(this.coveredCases.has(t)){let n=this.coveredCases.get(t);return this.skipRuns?DN(n,this.property.isAsync()):n}let r=this.property.run(e);return this.coveredCases.set(t,r),r}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},DS=Date.now,Tc=setTimeout,Mc=clearTimeout;function _N(e,t){let r=e;return e.isAsync()&&t.timeout!==void 0&&(r=new AN(r,t.timeout,Tc,Mc)),t.unbiased&&(r=new p1(r)),t.skipAllAfterTimeLimit!==void 0&&(r=new AS(r,DS,t.skipAllAfterTimeLimit,!1,Tc,Mc)),t.interruptAfterTimeLimit!==void 0&&(r=new AS(r,DS,t.interruptAfterTimeLimit,!0,Tc,Mc)),t.skipEqualValues&&(r=new $S(r,!0)),t.ignoreEqualValues&&(r=new $S(r,!1)),r}var FN=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),jN=class m1{constructor(t,r){this.verbosity=t,this.interruptedAsFailure=r,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(t,r){let n={status:t,value:r,children:[]};return this.currentLevelExecutionTrees.push(n),n}fail(t,r,n){if(this.verbosity>=1){let i=this.appendExecutionTree(1,t);this.currentLevelExecutionTrees=i.children}this.pathToFailure===void 0?this.pathToFailure=`${r}`:this.pathToFailure+=`:${r}`,this.value=t,this.failure=n}skip(t){this.verbosity>=2&&this.appendExecutionTree(-1,t),this.pathToFailure===void 0&&++this.numSkips}success(t){this.verbosity>=2&&this.appendExecutionTree(0,t),this.pathToFailure===void 0&&++this.numSuccesses}interrupt(){this.interrupted=!0}isSuccess(){return this.pathToFailure===void 0}firstFailure(){return this.pathToFailure!==void 0?+Be(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?Be(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let t=[],r=this.rootExecutionTrees;for(;r.length>0&&r[r.length-1].status===1;){let n=r[r.length-1];t.push(n.value),r=n.children}return t}static mergePaths(t,r){if(t.length===0)return r;let n=t.split(":"),i=r.split(":"),o=+n[n.length-1]+ +i[0];return[...n.slice(0,n.length-1),`${o}`,...i.slice(1)].join(":")}toRunDetails(t,r,n,i){if(!this.isSuccess())return{failed:!0,interrupted:this.interrupted,numRuns:this.firstFailure()+1-this.numSkips,numSkips:this.numSkips,numShrinks:this.numShrinks(),seed:t,counterexample:this.value,counterexamplePath:m1.mergePaths(r,this.pathToFailure),errorInstance:this.failure.error,failures:this.extractFailures(),executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:i.toParameters()};let o=this.interruptedAsFailure||this.numSuccesses===0;return{failed:this.numSkips>n||this.interrupted&&o,interrupted:this.interrupted,numRuns:this.numSuccesses,numSkips:this.numSkips,numShrinks:0,seed:t,counterexample:null,counterexamplePath:null,error:null,errorInstance:null,failures:[],executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:i.toParameters()}}},g1=class{constructor(e,t,r,n){this.sourceValues=e,this.shrink=t,this.runExecution=new jN(r,n),this.currentIdx=-1,this.nextValues=e}[Symbol.iterator](){return this}next(){let e=this.nextValues.next();return e.done||this.runExecution.interrupted?{done:!0,value:void 0}:(this.currentValue=e.value,++this.currentIdx,{done:!1,value:e.value.value_})}handleResult(e){e!==null&&typeof e=="object"&&!nr.isFailure(e)?(this.runExecution.fail(this.currentValue.value_,this.currentIdx,e),this.currentIdx=-1,this.nextValues=this.shrink(this.currentValue)):e!==null?e.interruptExecution?this.runExecution.interrupt():(this.runExecution.skip(this.currentValue.value_),this.sourceValues.skippedOne()):this.runExecution.success(this.currentValue.value_)}},VN=class{constructor(e,t,r){this.initialValues=e,this.maxInitialIterations=t,this.remainingSkips=r}[Symbol.iterator](){return this}next(){if(--this.maxInitialIterations!==-1&&this.remainingSkips>=0){let e=this.initialValues.next();if(!e.done)return{value:e.value,done:!1}}return{value:void 0,done:!0}}skippedOne(){--this.remainingSkips,++this.maxInitialIterations}},BN=-2147483648,UN=2147483647,WN=Math.pow(2,27),zN=Math.pow(2,-53),Td=class y1{constructor(t){this.internalRng=qs(t.clone())}clone(){return new y1(this.internalRng)}next(t){return Cs(this.internalRng,0,(1<<t)-1)}nextBoolean(){return Cs(this.internalRng,0,1)===1}nextInt(t,r){return Cs(this.internalRng,t===void 0?BN:t,r===void 0?UN:r)}nextBigInt(t,r){return zb(this.internalRng,t,r)}nextDouble(){let t=this.next(26),r=this.next(27);return(t*WN+r)*zN}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function GN(e,t,r){return t.jump(),e.generate(new Td(t),r)}function*b1(e,t,r,n){for(let i=0;i!==n.length;++i)yield new _(n[i],void 0);for(let i=0,o=r(t);;++i)yield GN(e,o,i)}function HN(e,t,r){return()=>e.generate(new Td(t),r)}function*S1(e,t,r,n){yield*G(n,s=>()=>new _(s,void 0));let i=0,o=qs(r(t));for(;;)o.jump(),yield HN(e,o,i++)}function _S(e){return e()}function w1(e,t,r){let n=t,i=e.split(":").map(s=>+s);if(i.length===0)return n.map(_S);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=n.drop(i[0]).map(_S);for(let s of i.slice(1)){let a=o.getNthOrLast(0);if(a===null)throw new Error(`Unable to replay, got wrong path=${e}`);o=r(a).drop(s)}return o}var qN=Object.assign;function KN(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,r)=>`Hint (${r+1}): ${t}`).join(`
100
+ `)}function YN(e,t){return`Encountered failures were:
101
101
  - ${e.map(t).join(`
102
- - `)}`}function Td(e,t){let r=[],n=[];for(let i=e.length-1;i>=0;--i)n.push({depth:1,tree:e[i]});for(;n.length!==0;){let i=n.pop(),o=i.tree,s=i.depth,a=o.status===0?"\x1B[32m\u221A\x1B[0m":o.status===1?"\x1B[31m\xD7\x1B[0m":"\x1B[33m!\x1B[0m",l=s!==0?". ".repeat(s-1):"";r.push(`${l}${a} ${t(o.value)}`);for(let u=o.children.length-1;u>=0;--u)n.push({depth:s+1,tree:o.children[u]})}return`Execution summary:
102
+ - `)}`}function Md(e,t){let r=[],n=[];for(let i=e.length-1;i>=0;--i)n.push({depth:1,tree:e[i]});for(;n.length!==0;){let i=n.pop(),o=i.tree,s=i.depth,a=o.status===0?"\x1B[32m\u221A\x1B[0m":o.status===1?"\x1B[31m\xD7\x1B[0m":"\x1B[33m!\x1B[0m",l=s!==0?". ".repeat(s-1):"";r.push(`${l}${a} ${t(o.value)}`);for(let u=o.children.length-1;u>=0;--u)n.push({depth:s+1,tree:o.children[u]})}return`Execution summary:
103
103
  ${r.join(`
104
- `)}`}function HN(e,t){let r=`Failed to run property, too many pre-condition failures encountered
104
+ `)}`}function JN(e,t){let r=`Failed to run property, too many pre-condition failures encountered
105
105
  { seed: ${e.seed} }
106
106
 
107
107
  Ran ${e.numRuns} time(s)
108
- Skipped ${e.numSkips} time(s)`,n=null,i=["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"];return e.verbose>=2?n=Td(e.executionSummary,t):$(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:r,details:n,hints:i}}function qN(e){if(e instanceof L&&e.stack!==void 0)return e.stack;try{return Ve(e)}catch{}if(e instanceof L)try{return rN(e)}catch{}if(e!==null&&typeof e=="object")try{return Xc(e)}catch{}return"Failed to serialize errorInstance"}function KN(e,t){let r=e.runConfiguration.includeErrorInReport?`
109
- Got ${Z4(qN(e.errorInstance),/^Error: /,"error: ")}`:"",n=`Property failed after ${e.numRuns} tests
108
+ Skipped ${e.numSkips} time(s)`,n=null,i=["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"];return e.verbose>=2?n=Md(e.executionSummary,t):$(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:r,details:n,hints:i}}function ZN(e){if(e instanceof L&&e.stack!==void 0)return e.stack;try{return Ve(e)}catch{}if(e instanceof L)try{return sN(e)}catch{}if(e!==null&&typeof e=="object")try{return Qc(e)}catch{}return"Failed to serialize errorInstance"}function XN(e,t){let r=e.runConfiguration.includeErrorInReport?`
109
+ Got ${tN(ZN(e.errorInstance),/^Error: /,"error: ")}`:"",n=`Property failed after ${e.numRuns} tests
110
110
  { seed: ${e.seed}, path: "${e.counterexamplePath}", endOnFailure: true }
111
111
  Counterexample: ${t(e.counterexample)}
112
- Shrunk ${e.numShrinks} time(s)${r}`,i=null,o=[];return e.verbose>=2?i=Td(e.executionSummary,t):e.verbose===1?i=GN(e.failures,t):$(o,"Enable verbose mode in order to have the list of all failing values encountered during the run"),{message:n,details:i,hints:o}}function YN(e,t){let r=`Property interrupted after ${e.numRuns} tests
113
- { seed: ${e.seed} }`,n=null,i=[];return e.verbose>=2?n=Td(e.executionSummary,t):$(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:r,details:n,hints:i}}function ed(e,t){if(!e.failed)return;let{message:r,details:n,hints:i}=e.counterexamplePath===null?e.interrupted?YN(e,t):HN(e,t):KN(e,t),o=r;return n!==null&&(o+=`
112
+ Shrunk ${e.numShrinks} time(s)${r}`,i=null,o=[];return e.verbose>=2?i=Md(e.executionSummary,t):e.verbose===1?i=YN(e.failures,t):$(o,"Enable verbose mode in order to have the list of all failing values encountered during the run"),{message:n,details:i,hints:o}}function QN(e,t){let r=`Property interrupted after ${e.numRuns} tests
113
+ { seed: ${e.seed} }`,n=null,i=[];return e.verbose>=2?n=Md(e.executionSummary,t):$(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:r,details:n,hints:i}}function td(e,t){if(!e.failed)return;let{message:r,details:n,hints:i}=e.counterexamplePath===null?e.interrupted?QN(e,t):JN(e,t):XN(e,t),o=r;return n!==null&&(o+=`
114
114
 
115
115
  ${n}`),i.length>0&&(o+=`
116
116
 
117
- ${zN(i)}`),o}function S1(e){return ed(e,xe)}async function w1(e){let t=[];function r(s){let a=f1(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let n=ed(e,r);if(t.length===0)return n;let i=new _t(await Promise.all(t));function o(s){let a=Je(i,s);return a!==void 0?a:xe(s)}return ed(e,o)}function v1(e,t){if(t.runConfiguration.includeErrorInReport)throw new L(e);let r=new L(e,{cause:t.errorInstance});return"cause"in r||WN(r,{cause:t.errorInstance}),r}function JN(e){if(e.failed)throw v1(S1(e),e)}async function ZN(e){if(e.failed)throw v1(await w1(e),e)}function XN(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):JN(e)}async function QN(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):ZN(e)}function e3(e,t,r,n,i){let o=new h1(r,t,n,i);for(let s of o){e.runBeforeEach();let a=e.run(s);e.runAfterEach(),o.handleResult(a)}return o.runExecution}async function t3(e,t,r,n,i){let o=new h1(r,t,n,i);for(let s of o){await e.runBeforeEach();let a=await e.run(s);await e.runAfterEach(),o.handleResult(a)}return o.runExecution}function x1(e,t){if(e==null||e.generate===null||e.generate===void 0)throw new Error("Invalid property encountered, please use a valid property");if(e.run===null||e.run===void 0)throw new Error("Invalid property encountered, please use a valid property not an arbitrary");let r=Ed({...dt(),...t});if(r.reporter!==void 0&&r.asyncReporter!==void 0)throw new Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(r.asyncReporter!==void 0&&!e.isAsync())throw new Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let n=NN(e,r),i=r.path.length===0||r.path.indexOf(":")===-1?r.numRuns:-1,o=r.numRuns*r.maxSkipsPerRun,s=(...u)=>n.shrink(...u),a=new DN(r.path.length===0?g1(n,r.seed,r.randomType,r.examples):b1(r.path,tr(y1(n,r.seed,r.randomType,r.examples)),s),i,o),l=r.endOnFailure?j.nil:s;return n.isAsync()?t3(n,l,a,r.verbose,r.markInterruptAsFailure).then(u=>u.toRunDetails(r.seed,r.path,o,r)):e3(n,l,a,r.verbose,r.markInterruptAsFailure).toRunDetails(r.seed,r.path,o,r)}function r3(e,t){let r=x1(e,t);if(e.isAsync())return r.then(QN);XN(r)}function n3(e,t){let r=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new u1(e,()=>!0);return t.unbiased===!0?new d1(r):r}function R1(e,t){let r=Ed(typeof t=="number"?{...dt(),numRuns:t}:{...dt(),...t}),n=n3(e,r),i=n.shrink.bind(n);return(r.path.length===0?tr(g1(n,r.seed,r.randomType,r.examples)):b1(r.path,tr(y1(n,r.seed,r.randomType,r.examples)),i)).take(r.numRuns).map(o=>o.value_)}function i3(e,t){return[...R1(e,t)]}function o3(e){return(Math.round(e*100)/100).toFixed(2)}function s3(e,t,r){let n=Ed(typeof r=="number"?{...dt(),numRuns:r}:{...dt(),...r}),i={};for(let l of R1(e,r)){let u=t(l),c=Array.isArray(u)?u:[u];for(let d of c)i[d]=(i[d]||0)+1}let o=Object.entries(i).sort((l,u)=>u[1]-l[1]).map(l=>[l[0],`${o3(l[1]*100/n.numRuns)}%`]),s=o.map(l=>l[0].length).reduce((l,u)=>Math.max(l,u),0),a=o.map(l=>l[1].length).reduce((l,u)=>Math.max(l,u),0);for(let l of o)n.logger(`${l[0].padEnd(s,".")}..${l[1].padStart(a,".")}`)}var a3=Object.assign;function td(e,t,r,n){let i=r(),o=e.clone(),s={mrng:e.clone(),biasFactor:t,history:[]},a=u=>{let c=i[s.history.length];if(c!==void 0&&c.arb===u){let p=c.value;return $(s.history,{arb:u,value:p,context:c.context,mrng:c.mrng}),o=c.mrng.clone(),p}let d=u.generate(o,t);return $(s.history,{arb:u,value:d.value_,context:d.context,mrng:o.clone()}),d.value},l=(u,...c)=>a(n(u,c));return new _(a3(l,{values(){return G(s.history,u=>u.value)},[Oe](){return td(e,t,r,n).value},[ft](){return xe(G(s.history,u=>u.value))}}),s)}var Mc=Array.isArray,DS=Object.keys,l3=Object.is;function u3(e){let t=new _t;return function(n,i){let o=Je(t,n);if(o===void 0){let l=n(...i);return ct(t,n,[{args:i,value:l}]),l}let s=o;for(let l of s)if(e(i,l.args))return l.value;let a=n(...i);return $(s,{args:i,value:a}),a}}function k1(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if(Mc(e)){if(!Mc(t)||e.length!==t.length)return!1}else if(Mc(t))return!1;if(DS(e).length!==DS(t).length)return!1;for(let r in e)if(!(r in t)||!k1(e[r],t[r]))return!1;return!0}else return l3(e,t)}var c3=class extends de{constructor(...e){super(...e),this.arbitraryCache=u3(k1)}generate(e,t){return td(e,t,()=>[],this.arbitraryCache)}canShrinkWithoutContext(e){return!1}shrink(e,t){if(t===void 0)return j.nil();let r=t,n=r.mrng,i=r.biasFactor,o=r.history;return s1(o.map(s=>s.arb),o.map(s=>s.value),o.map(s=>s.context)).map(s=>{function a(){let l=s.value,u=s.context;return G(o,(c,d)=>({arb:c.arb,value:l[d],context:u[d],mrng:c.mrng}))}return td(n,i,a,this.arbitraryCache)})}};function d3(){return new c3}var f3=Math.floor,_S=Math.log;function p3(e){return f3(_S(e)/_S(2))}function h3(e){return e===O(0)?O(0):O(Ve(e).length)}function E1(e,t,r){if(e===t)return[{min:e,max:t}];if(e<0&&t>0){let s=r(-e),a=r(t);return[{min:-s,max:a},{min:t-a,max:t},{min:e,max:e+s}]}let n=r(t-e),i={min:e,max:e+n},o={min:t-n,max:t};return e<0?[o,i]:[i,o]}var m3=Math.ceil,g3=Math.floor;function FS(e){return g3(e/2)}function jS(e){return m3(e/2)}function VS(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:FS(n);for(let l=a;l>0;l=FS(l)){let u=l===n?t:e-l;yield new _(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:jS(n);for(let l=a;l<0;l=jS(l)){let u=l===n?t:e-l;yield new _(u,s),s=u}}return n>0?tr(i()):tr(o())}var BS=Math.sign,y3=Number.isInteger,b3=Object.is,sn=class C1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new _(t.nextInt(n.min,n.max),void 0)}canShrinkWithoutContext(t){return typeof t=="number"&&y3(t)&&!b3(t,-0)&&this.min<=t&&t<=this.max}shrink(t,r){return C1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new _(r,void 0)):VS(t,r,!1):VS(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?0:this.min<0?this.max:this.min}computeGenerateRange(t,r){if(r===void 0||t.nextInt(1,r)!==1)return{min:this.min,max:this.max};let n=E1(this.min,this.max,p3);if(n.length===1)return n[0];let i=t.nextInt(-2*(n.length-1),n.length-2);return i<0?n[0]:n[i+1]}isLastChanceTry(t,r){return t>0?t===r+1&&t>this.min:t<0?t===r-1&&t<this.max:!1}static isValidContext(t,r){if(r===void 0)return!1;if(typeof r!="number")throw new Error("Invalid context type passed to IntegerArbitrary (#1)");if(r!==0&&BS(t)!==BS(r))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},US=Number.isInteger;function S3(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function oe(e={}){let t=S3(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!US(t.min))throw new Error("fc.integer minimum value should be an integer");if(!US(t.max))throw new Error("fc.integer maximum value should be an integer");return new sn(t.min,t.max)}var WS=new Map;function Md(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=Je(WS,e);if(t!==void 0)return t;let r={depth:0};return ct(WS,e,r),r}function Od(){return{depth:0}}var w3=class{constructor(e,t,r){this.arb=e,this.mrng=t,this.biasFactor=r}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},v3=Math.min,x3=Math.max,R3=class{constructor(e,t,r,n){this.arb=e,this.mrng=t,this.slices=r,this.biasFactor=n,this.activeSliceIndex=0,this.nextIndexInSlice=0,this.lastIndexInSlice=-1}attemptExact(e){if(e!==0&&this.mrng.nextInt(1,this.biasFactor)===1){let t=[];for(let r=0;r!==this.slices.length;++r)this.slices[r].length===e&&$(t,r);if(t.length===0)return;this.activeSliceIndex=t[this.mrng.nextInt(0,t.length-1)],this.nextIndexInSlice=0,this.lastIndexInSlice=e-1}}next(){if(this.nextIndexInSlice<=this.lastIndexInSlice)return new _(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 e=this.slices[this.activeSliceIndex];if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.nextIndexInSlice=1,this.lastIndexInSlice=e.length-1,new _(e[0],void 0);let t=this.mrng.nextInt(0,e.length-1),r=this.mrng.nextInt(0,e.length-1);return this.nextIndexInSlice=v3(t,r),this.lastIndexInSlice=x3(t,r),new _(e[this.nextIndexInSlice++],void 0)}};function zS(e,t,r,n){return n===void 0||r.length===0||t.nextInt(1,n)!==1?new w3(e,t,n):new R3(e,t,r,n)}var k3=Math.floor,GS=Math.log,HS=Math.max,E3=Array.isArray;function Oc(e,t){return e===t?e:e+k3(GS(t-e)/GS(2))}var A1=class I1 extends de{constructor(t,r,n,i,o,s,a){super(),this.arb=t,this.minLength=r,this.maxGeneratedLength=n,this.maxLength=i,this.setBuilder=s,this.customSlices=a,this.lengthArb=oe({min:r,max:n}),this.depthContext=Md(o)}preFilter(t){if(this.setBuilder===void 0)return t;let r=this.setBuilder();for(let n=0;n!==t.length;++n)r.tryAdd(t[n]);return r.getData()}static makeItCloneable(t,r){return t[Oe]=()=>{let n=[];for(let i=0;i!==r.length;++i)$(n,r[i].value);return this.makeItCloneable(n,r),n},t}generateNItemsNoDuplicates(t,r,n,i){let o=0,s=t(),a=zS(this.arb,n,this.customSlices,i);for(;s.size()<r&&o<this.maxGeneratedLength;){let l=a.next();s.tryAdd(l)?o=0:o+=1}return s.getData()}safeGenerateNItemsNoDuplicates(t,r,n,i){let o=HS(0,r-Oc(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=o;try{return this.generateNItemsNoDuplicates(t,r,n,i)}finally{this.depthContext.depth-=o}}generateNItems(t,r,n){let i=[],o=zS(this.arb,r,this.customSlices,n);o.attemptExact(t);for(let s=0;s!==t;++s)$(i,o.next());return i}safeGenerateNItems(t,r,n){let i=HS(0,t-Oc(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=i;try{return this.generateNItems(t,r,n)}finally{this.depthContext.depth-=i}}wrapper(t,r,n,i){let o=r?this.preFilter(t):t,s=!1,a=[],l=[];for(let u=0;u!==o.length;++u){let c=o[u];s=s||c.hasToBeCloned,$(a,c.value),$(l,c.context)}return s&&I1.makeItCloneable(a,o),new _(a,{shrunkOnce:r,lengthContext:t.length===o.length&&n!==void 0?n:void 0,itemsContexts:l,startIndex:i})}generate(t,r){let n=this.applyBias(t,r),i=n.size,o=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,i,t,n.biasFactorItems):this.safeGenerateNItems(i,t,n.biasFactorItems);return this.wrapper(o,!1,void 0,0)}applyBias(t,r){if(r===void 0)return{size:this.lengthArb.generate(t,void 0).value};if(this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:r};if(t.nextInt(1,r)!==1)return{size:this.lengthArb.generate(t,void 0).value};if(t.nextInt(1,r)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:r};let n=Oc(this.minLength,this.maxGeneratedLength);return{size:oe({min:this.minLength,max:n}).generate(t,void 0).value,biasFactorItems:r}}canShrinkWithoutContext(t){if(!E3(t)||this.minLength>t.length||t.length>this.maxLength)return!1;for(let r=0;r!==t.length;++r)if(!(r in t)||!this.arb.canShrinkWithoutContext(t[r]))return!1;return this.preFilter(G(t,r=>new _(r,void 0))).length===t.length}shrinkItemByItem(t,r,n){let i=[];for(let o=r.startIndex;o<n;++o)$(i,er(()=>this.arb.shrink(t[o],r.itemsContexts[o]).map(s=>{let a=G(Le(t,0,o),(u,c)=>new _(tn(u),r.itemsContexts[c])),l=G(Le(t,o+1),(u,c)=>new _(tn(u),r.itemsContexts[c+o+1]));return[[...a,s,...l],void 0,o]})));return j.nil().join(...i)}shrinkImpl(t,r){if(t.length===0)return j.nil();let n=r!==void 0?r:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(t.length,n.lengthContext).drop(n.shrunkOnce&&n.lengthContext===void 0&&t.length>this.minLength+1?1:0).map(i=>{let o=t.length-i.value;return[G(Le(t,o),(s,a)=>new _(tn(s),n.itemsContexts[a+o])),i.context,0]}).join(er(()=>t.length>this.minLength?this.shrinkItemByItem(t,n,1):this.shrinkItemByItem(t,n,t.length))).join(t.length>this.minLength?er(()=>{let i={shrunkOnce:!1,lengthContext:void 0,itemsContexts:Le(n.itemsContexts,1),startIndex:0};return this.shrinkImpl(Le(t,1),i).filter(o=>this.minLength<=o[0].length+1).map(o=>[[new _(tn(t[0]),n.itemsContexts[0]),...o[0]],void 0,0])}):j.nil())}shrink(t,r){return this.shrinkImpl(t,r).map(n=>this.wrapper(n[0],!0,n[1],n[2]))}},C3=Math.floor,A3=Math.min,xr=2147483647,Xr=["xsmall","small","medium","large","xlarge"],I3=["-4","-3","-2","-1","=","+1","+2","+3","+4"],Nd="small";function P3(e,t){switch(t){case"xsmall":return C3(1.1*e)+1;case"small":return 2*e+10;case"medium":return 11*e+100;case"large":return 101*e+1e3;case"xlarge":return 1001*e+1e4;default:throw new Error(`Unable to compute lengths based on received size: ${t}`)}}function yi(e,t){let r=$t(I3,e);if(r===-1)return e;let n=$t(Xr,t);if(n===-1)throw new Error(`Unable to offset size based on the unknown defaulted one: ${t}`);let i=n+r-4;return i<0?Xr[0]:i>=Xr.length?Xr[Xr.length-1]:Xr[i]}function mi(e,t,r,n){let{baseSize:i=Nd,defaultSizeToMaxWhenMaxSpecified:o}=dt()||{},s=e!==void 0?e:n&&o?"max":i;return s==="max"?r:A3(P3(t,yi(s,i)),r)}function T3(e,t){if(typeof e=="number")return 1/e;let{baseSize:r=Nd,defaultSizeToMaxWhenMaxSpecified:n}=dt()||{},i=e!==void 0?e:t&&n?"max":r;if(i==="max")return 0;switch(yi(i,r)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function Ld(e){let{baseSize:t=Nd}=dt()||{};return e===void 0?t:yi(e,t)}function ae(e,t={}){let r=t.size,n=t.minLength||0,i=t.maxLength,o=t.depthIdentifier,s=i!==void 0?i:xr;return new A1(e,n,mi(r,n,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function As(e){return e/O(2)}function qS(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:As(n);for(let l=a;l>0;l=As(l)){let u=e-l;yield new _(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:As(n);for(let l=a;l<0;l=As(l)){let u=e-l;yield new _(u,s),s=u}}return n>0?tr(i()):tr(o())}var M3=class P1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new _(t.nextBigInt(n.min,n.max),void 0)}computeGenerateRange(t,r){if(r===void 0||t.nextInt(1,r)!==1)return{min:this.min,max:this.max};let n=E1(this.min,this.max,h3);if(n.length===1)return n[0];let i=t.nextInt(-2*(n.length-1),n.length-2);return i<0?n[0]:n[i+1]}canShrinkWithoutContext(t){return typeof t=="bigint"&&this.min<=t&&t<=this.max}shrink(t,r){return P1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new _(r,void 0)):qS(t,r,!1):qS(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?O(0):this.min<0?this.max:this.min}isLastChanceTry(t,r){return t>0?t===r+O(1)&&t>this.min:t<0?t===r-O(1)&&t<this.max:!1}static isValidContext(t,r){if(r===void 0)return!1;if(typeof r!="bigint")throw new Error("Invalid context type passed to BigIntArbitrary (#1)");let n=t>0&&r<0||t<0&&r>0;if(r!==O(0)&&n)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function O3(e){let r=O(-1)<<O(255),n=(O(1)<<O(255))-O(1),i=e.min,o=e.max;return{min:i!==void 0?i:r-(o!==void 0&&o<O(0)?o*o:O(0)),max:o!==void 0?o:n+(i!==void 0&&i>O(0)?i*i:O(0))}}function N3(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function rr(...e){let t=O3(N3(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new M3(t.min,t.max)}var L3=Object.getPrototypeOf,li=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return this.arb.generate(e,void 0)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return this.arb.shrink(e,t)}};function zs(e){return L3(e)===li.prototype&&e.generate===li.prototype.generate&&e.canShrinkWithoutContext===li.prototype.canShrinkWithoutContext&&e.shrink===li.prototype.shrink?e:new li(e)}function $3(e){return e===1}function D3(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function bi(){return zs(oe({min:0,max:1}).map($3,D3))}var di=Object.is,_3=class{constructor(e){this.values=e,this.fastValues=new rn(this.values);let t=!1,r=!1;if(Ws(this.fastValues,0))for(let n=0;n!==this.values.length;++n){let i=this.values[n];t=t||di(i,-0),r=r||di(i,0)}this.hasMinusZero=t,this.hasPlusZero=r}has(e){return e===0?di(e,0)?this.hasPlusZero:this.hasMinusZero:Ws(this.fastValues,e)}},T1=class extends de{constructor(e){super(),this.values=e}generate(e,t){let r=this.values.length===1?0:e.nextInt(0,this.values.length-1),n=this.values[r];return vr(n)?new _(n,r,()=>n[Oe]()):new _(n,r)}canShrinkWithoutContext(e){return this.values.length===1?di(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new _3(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||di(e,this.values[0])?j.nil():j.of(new _(this.values[0],0))}};function vt(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new T1(e)}function F3(e){return!e||!e.withBigInt?vt(!1,null,void 0,0,"",NaN):vt(!1,null,void 0,0,"",NaN,O(0))}function ve(e){return new T1([e])}var j3=class M1{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Oe](){return new M1}};function V3(){return ve(new j3)}var B3=NaN,U3=Number.isNaN;function O1(e){return new Bs(e)}function N1(e){if(!(e instanceof Bs)||e.constructor!==Bs)throw new L("Not a valid value for date unmapper");return Us(e)}function W3(e){return t=>t===e?new Bs(B3):O1(t)}function z3(e){return t=>{let r=N1(t);return U3(r)?e:r}}var KS=Number.isNaN;function L1(e={}){let t=e.min!==void 0?Us(e.min):-864e13,r=e.max!==void 0?Us(e.max):864e13,n=e.noInvalidDate;if(KS(t))throw new Error("fc.date min must be valid instance of Date");if(KS(r))throw new Error("fc.date max must be valid instance of Date");if(t>r)throw new Error("fc.date max must be greater or equal to min");if(n)return oe({min:t,max:r}).map(O1,N1);let i=r+1;return oe({min:t,max:r+1}).map(W3(i),z3(i))}var G3=class extends de{constructor(e,t){super(),this.startArb=e,this.chainer=t}generate(e,t){let r=[],n=e.clone(),i=this.startArb.generate(e,t);for(r.push({arbitrary:this.startArb,value:i.value_,context:i.context,clonedMrng:n});;){let s=this.chainer(i.value_);if(s===void 0)break;let a=e.clone();i=s.generate(e,t),r.push({arbitrary:s,value:i.value_,context:i.context,clonedMrng:a})}let o={biasFactor:t,entries:r,currentShrinkLevel:0};return new _(i.value_,o)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?new j(this.shrinkIterator(t)):j.nil()}*shrinkIterator(e){let{entries:t,currentShrinkLevel:r,biasFactor:n}=e;for(let i=r;i<t.length;++i){let o=t[i],s=o.arbitrary.shrink(o.value,o.context);for(let a of s){let l=t.slice(0,i);l.push({arbitrary:o.arbitrary,value:a.value_,context:a.context,clonedMrng:o.clonedMrng});let u=a,c=o.clonedMrng.clone();for(;;){let h=this.chainer(u.value_);if(h===void 0)break;let f=c.clone(),m=h.generate(c,n);l.push({arbitrary:h,value:m.value_,context:m.context,clonedMrng:f}),u=m}let d=l[l.length-1],p={biasFactor:n,entries:l,currentShrinkLevel:i};yield new _(d.value,p)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function H3(e,t){return new G3(e,t)}var q3=Symbol.iterator,K3=Array.isArray,Y3=Object.is,J3=class $1 extends de{constructor(t,r){super(),this.arb=t,this.numValues=r}generate(t,r){let n=[];if(this.numValues<=0)return this.wrapper(n);for(let i=0;i!==this.numValues-1;++i)$(n,this.arb.generate(t.clone(),r));return $(n,this.arb.generate(t,r)),this.wrapper(n)}canShrinkWithoutContext(t){if(!K3(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let r=1;r<t.length;++r)if(!Y3(t[0],t[r]))return!1;return this.arb.canShrinkWithoutContext(t[0])}shrink(t,r){return t.length===0?j.nil():new j(this.shrinkImpl(t,r!==void 0?r:[])).map(n=>this.wrapper(n))}*shrinkImpl(t,r){let n=G(t,(o,s)=>this.arb.shrink(o,r[s])[q3]()),i=G(n,o=>o.next());for(;!i[0].done;)yield G(i,o=>o.value),i=G(n,o=>o.next())}static makeItCloneable(t,r){return t[Oe]=()=>{let n=[];for(let i=0;i!==r.length;++i)$(n,r[i].value);return this.makeItCloneable(n,r),n},t}wrapper(t){let r=!1,n=[],i=[];for(let o=0;o!==t.length;++o){let s=t[o];r=r||s.hasToBeCloned,$(n,s.value),$(i,s.context)}return r&&$1.makeItCloneable(n,t),new _(n,i)}};function Z3(e,t){return new J3(e,t)}var YS=class{constructor(e){this.isEqual=e,this.data=[]}tryAdd(e){for(let t=0;t!==this.data.length;++t)if(this.isEqual(this.data[t],e))return!1;return $(this.data,e),!0}size(){return this.data.length}getData(){return this.data}},X3=Number.isNaN,Q3=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new rn,this.data=[]}tryAdd(e){let t=this.selector(e);if(X3(t))return $(this.data,e),!0;let r=this.selectedItemsExceptNaN.size;return fi(this.selectedItemsExceptNaN,t),r!==this.selectedItemsExceptNaN.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},eL=Object.is,tL=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new rn,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(eL(t,-0))return this.hasMinusZero?!1:($(this.data,e),this.hasMinusZero=!0,!0);let r=this.selectedItemsExceptMinusZero.size;return fi(this.selectedItemsExceptMinusZero,t),r!==this.selectedItemsExceptMinusZero.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},rL=class{constructor(e){this.selector=e,this.selectedItems=new rn,this.data=[]}tryAdd(e){let t=this.selector(e),r=this.selectedItems.size;return fi(this.selectedItems,t),r!==this.selectedItems.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function nL(e){if(typeof e.comparator=="function"){if(e.selector===void 0){let a=e.comparator,l=(u,c)=>a(u.value_,c.value_);return()=>new YS(l)}let n=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>n(o(a),o(l));return()=>new YS(s)}let t=e.selector||(n=>n),r=n=>t(n.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new Q3(r);case"SameValueZero":return()=>new rL(r);case"SameValue":case void 0:return()=>new tL(r)}}function Rr(e,t={}){let r=t.minLength!==void 0?t.minLength:0,n=t.maxLength!==void 0?t.maxLength:xr,i=mi(t.size,r,n,t.maxLength!==void 0),o=t.depthIdentifier,s=new A1(e,r,i,n,o,nL(t),[]);return r===0?s:s.filter(a=>a.length>=r)}var iL=Object.create,oL=Object.defineProperty,sL=Object.getOwnPropertyDescriptor,JS=Object.getPrototypeOf,aL=Object.prototype,lL=Reflect.ownKeys;function uL(e){let t=e[1]?iL(null):{};for(let r of e[0])oL(t,r[0],{enumerable:!0,configurable:!0,writable:!0,value:r[1]});return t}function cL(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function dL(e){if(typeof e!="object"||e===null)throw new L("Incompatible instance received: should be a non-null object");let t=JS(e)===null,r=JS(e)===aL;if(!t&&!r)throw new L("Incompatible instance received: should be of exact type Object");let n=G(lL(e),i=>[i,sL(e,i)]);if(!t1(n,([,i])=>cL(i)))throw new L("Incompatible instance received: should contain only c/e/w properties without get/set");return[G(n,([i,o])=>[i,o.value]),t]}function fL(e){return e[0]}function $d(e,t,r={}){let n=!!r.noNullPrototype;return B(Rr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:fL,depthIdentifier:r.depthIdentifier}),n?ve(!1):bi()).map(uL,dL)}var pL=Number.POSITIVE_INFINITY,hL=Number.MAX_SAFE_INTEGER,mL=Number.isInteger,gL=Math.floor,yL=Math.pow,bL=Math.min,rd=class D1 extends de{static from(t,r,n){if(t.length===0)throw new Error(`${n} expects at least one weighted arbitrary`);let i=0;for(let o=0;o!==t.length;++o){if(t[o].arbitrary===void 0)throw new Error(`${n} expects arbitraries to be specified`);let s=t[o].weight;if(i+=s,!mL(s))throw new Error(`${n} expects weights to be integer values`);if(s<0)throw new Error(`${n} expects weights to be superior or equal to 0`)}if(i<=0)throw new Error(`${n} expects the sum of weights to be strictly superior to 0`);return new D1(t,{depthBias:T3(r.depthSize,r.maxDepth!==void 0),maxDepth:r.maxDepth!==void 0?r.maxDepth:pL,withCrossShrink:!!r.withCrossShrink},Md(r.depthIdentifier))}constructor(t,r,n){super(),this.warbs=t,this.constraints=r,this.context=n;let i=0;this.cumulatedWeights=[];for(let o=0;o!==t.length;++o)i+=t[o].weight,$(this.cumulatedWeights,i);this.totalWeight=i}generate(t,r){if(this.mustGenerateFirst())return this.safeGenerateForIndex(t,0,r);let n=t.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let i=0;i!==this.cumulatedWeights.length;++i)if(n<this.cumulatedWeights[i])return this.safeGenerateForIndex(t,i,r);throw new Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(t){return this.canShrinkWithoutContextIndex(t)!==-1}shrink(t,r){if(r!==void 0){let i=r,o=i.selectedIndex,s=i.originalBias,a=this.warbs[o].arbitrary.shrink(t,i.originalContext).map(l=>this.mapIntoValue(o,l,null,s));if(i.clonedMrngForFallbackFirst!==null){i.cachedGeneratedForFirst===void 0&&(i.cachedGeneratedForFirst=this.safeGenerateForIndex(i.clonedMrngForFallbackFirst,0,s));let l=i.cachedGeneratedForFirst;return j.of(l).join(a)}return a}let n=this.canShrinkWithoutContextIndex(t);return n===-1?j.nil():this.defaultShrinkForFirst(n).join(this.warbs[n].arbitrary.shrink(t,void 0).map(i=>this.mapIntoValue(n,i,null,void 0)))}defaultShrinkForFirst(t){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(t)||this.warbs[0].fallbackValue===void 0)return j.nil()}finally{--this.context.depth}let r=new _(this.warbs[0].fallbackValue.default,void 0);return j.of(this.mapIntoValue(0,r,null,void 0))}canShrinkWithoutContextIndex(t){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(t)?0:-1;try{++this.context.depth;for(let r=0;r!==this.warbs.length;++r){let n=this.warbs[r];if(n.weight!==0&&n.arbitrary.canShrinkWithoutContext(t))return r}return-1}finally{--this.context.depth}}mapIntoValue(t,r,n,i){let o={selectedIndex:t,originalBias:i,originalContext:r.context,clonedMrngForFallbackFirst:n};return new _(r.value,o)}safeGenerateForIndex(t,r,n){++this.context.depth;try{let i=this.warbs[r].arbitrary.generate(t,n),o=this.mustFallbackToFirstInShrink(r)?t.clone():null;return this.mapIntoValue(r,i,o,n)}finally{--this.context.depth}}mustGenerateFirst(){return this.constraints.maxDepth<=this.context.depth}mustFallbackToFirstInShrink(t){return t!==0&&this.constraints.withCrossShrink&&this.warbs[0].weight!==0}computeNegDepthBenefit(){let t=this.constraints.depthBias;if(t<=0||this.warbs[0].weight===0)return 0;let r=gL(yL(1+t,this.context.depth))-1;return-bL(this.totalWeight*r,hL)||0}};function SL(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function ZS(e){return zw(e)?{arbitrary:e,weight:1}:e}function Me(...e){let t=e[0];if(SL(t)){let n=G(Le(e,1),ZS);return rd.from(n,t,"fc.oneof")}let r=G(e,ZS);return rd.from(r,{},"fc.oneof")}var wL=Number.isInteger;function Qt(e){let t=typeof e=="number"?e:e&&e.max!==void 0?e.max:2147483647;if(t<0)throw new Error("fc.nat value should be greater than or equal to 0");if(!wL(t))throw new Error("fc.nat maximum value should be an integer");return new sn(0,t)}var vL=Object.is;function xL(e){let t=0,r=[];for(let n of e){let i=t;t=i+n.num;let o=t-1;r.push({from:i,to:o,entry:n})}return r}function RL(e,t){let r=0,n=e.length;for(;n-r>1;){let i=~~((r+n)/2);t<e[i].from?n=i:r=i}return e[r]}function kL(e){let t=xL(e);return function(n){let i=RL(t,n);return i.entry.build(n-i.from)}}function EL(e){let t={mapping:new _t,negativeZeroIndex:void 0},r=0;for(let n=0;n!==e.length;++n){let i=e[n];for(let o=0;o!==i.num;++o){let s=i.build(o);s===0&&1/s===Dt.NEGATIVE_INFINITY?t.negativeZeroIndex=r:ct(t.mapping,s,r),++r}}return t}function CL(e){let t=null;return function(n){t===null&&(t=EL(e));let i=vL(n,-0)?t.negativeZeroIndex:Je(t.mapping,n);if(i===void 0)throw new L("Unknown value encountered cannot be built using this mapToConstant");return i}}function AL(e){if(e.length===0)throw new L("fc.mapToConstant expects at least one option");let t=0;for(let r=0;r!==e.length;++r){if(e[r].num<0)throw new L("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");t+=e[r].num}if(t===0)throw new L("fc.mapToConstant expects at least one choice among options");return t}function an(...e){return Qt({max:AL(e)-1}).map(kL(e),CL(e))}function _1(e,t,r,n){if(t.length===0)return r>0?void 0:[];if(n<=0)return;let i=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];for(;i.length>0;){let o=Xw(i);for(let s=o.nextStartIndex;s<=t.length;++s){let a=ge(t,o.endIndexChunks,s);if(e.canShrinkWithoutContext(a)){let l=[...o.chunks,a];if(s===t.length){if(l.length<r)break;return l}$(i,{endIndexChunks:o.endIndexChunks,nextStartIndex:s+1,chunks:o.chunks}),l.length<n&&$(i,{endIndexChunks:s,nextStartIndex:s+1,chunks:l});break}}}}function IL(e){return ce(e,"")}function F1(e){return e.minLength!==void 0?e.minLength:0}function j1(e){return e.maxLength!==void 0?e.maxLength:xr}function PL(e,t){return F1(t)<=e.length&&e.length<=j1(t)}function TL(e,t){return function(n){if(typeof n!="string")throw new L("Unsupported value");let i=_1(e,n,F1(t),j1(t));if(i===void 0)throw new L("Unable to unmap received string");return i}}var V1=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function ML(e,t,r){let n;try{n=r(e)}catch{return}for(let i of n)if(!t.canShrinkWithoutContext(i))return;return n}function OL(e,t){let r=[];for(let n of V1){let i=ML(n,e,t);i!==void 0&&$(r,i)}return r}var XS=new WeakMap;function NL(e){let t=[];for(let r of V1){let n=_1(e,r,0,xr);n!==void 0&&$(t,n)}return t}function LL(e,t){let r=O4(XS,e);r===void 0&&(r=NL(e),M4(XS,e,r));let n=[];for(let i of r)PL(i,t)&&$(n,i);return n}var $L=[[0,127]],DL=[[0,55295],[57344,1114111]],_L=[[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,6e3],[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],[66e3,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],[128e3,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]],FL=[[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]],QS=String.fromCodePoint,jL=Math.min,VL=Math.max;function nd(e){if(e.length===1){let r=QS(e[0]);return{num:1,build:()=>r}}let t=e[0];return{num:e[1]-e[0]+1,build:r=>QS(t+r)}}function ew(e,t){let r=[],n=0,i=0;for(;n<e.length&&i<t.length;){let o=e[n],s=o[0],a=o.length===1?o[0]:o[1],l=t[i],u=l[0],c=l.length===1?l[0]:l[1];if(a<u)n+=1;else if(c<s)i+=1;else{let d=VL(s,u),p=jL(a,c);if(r.length>=1){let h=r[r.length-1];(h.length===1?h[0]:h[1])+1===d&&(d=h[0],Xw(r))}$(r,d===p?[d]:[d,p]),a<=p&&(n+=1),c<=p&&(i+=1)}}return r}var tw=Object.create(null);function BL(e){switch(e){case"full":return DL;case"ascii":return $L}}function UL(e,t){let r=`${e}:${t}`,n=tw[r];if(n!==void 0)return n;let i=BL(t),o=e==="binary"?i:ew(i,_L),s=[];for(let l of o)$(s,nd(l));if(e==="grapheme"){let l=ew(i,FL);for(let u of l){let c=nd(u);$(s,{num:c.num,build:d=>J4(c.build(d),"NFD")})}}let a=an(...s);return tw[r]=a,a}function ui(e,t){return UL(e,t)}function WL(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return ui("grapheme","full");case"grapheme-composite":return ui("composite","full");case"grapheme-ascii":case void 0:return ui("grapheme","ascii");case"binary":return ui("binary","full");case"binary-ascii":return ui("binary","ascii")}}function Ce(e={}){let t=WL(e),r=TL(t,e),n=LL(t,e);return ae(t,{...e,experimentalCustomSlices:n}).map(IL,r)}var B1=Map,Dd=String.fromCharCode,_d={num:26,build:e=>Dd(e+97)},zL={num:26,build:e=>Dd(e+65)},U1={num:10,build:e=>Dd(e+48)};function GL(e){let t=u4(e);return e!==t?t:`%${pi(nn(e,0),16)}`}function HL(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var qL=()=>Ce({unit:"binary",minLength:1,maxLength:1}).map(GL,HL),Nc;function KL(){return Nc===void 0&&(Nc=an(_d)),Nc}var Is;function id(e){Is===void 0&&(Is=new B1);let t=Je(Is,e);return t===void 0&&(t=an(_d,U1,{num:e.length,build:r=>e[r]}),ct(Is,e,t)),t}function YL(e){return an(_d,zL,U1,{num:e.length,build:t=>e[t]})}var Ps;function Fd(e){Ps===void 0&&(Ps=new B1);let t=Je(Ps,e);return t===void 0&&(t=Me({weight:10,arbitrary:YL(e)},{weight:1,arbitrary:qL()}),ct(Ps,e,t)),t}function jt(e,t={}){let r=t.freq===void 0?6:t.freq,n=r1(t,"nil")?t.nil:null,i=[{arbitrary:ve(n),weight:1,fallbackValue:{default:n}},{arbitrary:e,weight:r-1}],o={withCrossShrink:!0,depthSize:t.depthSize,maxDepth:t.maxDepth,depthIdentifier:t.depthIdentifier};return rd.from(i,o,"fc.option")}function JL(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var W1=Symbol("adapted-value");function ZL(e,t){let r=t(e.value_);return r.adapted?new _(r.value,W1):e}var XL=class extends de{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=r=>ZL(r,t)}generate(e,t){let r=this.sourceArb.generate(e,t);return this.adaptValue(r)}canShrinkWithoutContext(e){return this.sourceArb.canShrinkWithoutContext(e)&&!this.adapter(e).adapted}shrink(e,t){return t===W1?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):j.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function z1(e,t){return new XL(e,t)}function QL([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function e$(e){if(typeof e!="string"||e.length===0)throw new Error("Unsupported");return e.length===1?[e[0],null]:[e[0],[ge(e,1,e.length-1),e[e.length-1]]]}function t$(e){let t=id("");return B(t,jt(B(Ce({unit:id("-"),size:e,maxLength:61}),t))).map(QL,e$).filter(JL)}function r$(e){return`${ce(e[0],".")}.${e[1]}`}function n$(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e.lastIndexOf(".");return[Be(ge(e,0,t),"."),ge(e,t+1)]}function i$(e){let[t,r]=e,n=r.length;for(let i=0;i!==t.length;++i)if(n+=1+t[i].length,n>255)return{adapted:!0,value:[Le(t,0,i),r]};return{adapted:!1,value:e}}function jd(e={}){let t=Ld(e.size),r=yi("-1",t),n=Ce({unit:KL(),minLength:2,maxLength:63,size:r});return z1(B(ae(t$(t),{size:r,minLength:1,maxLength:127}),n),i$).map(r$,n$)}function o$(e){let t=e[0].length;for(let r=1;r!==e.length;++r)if(t+=1+e[r].length,t>64)return{adapted:!0,value:Le(e,0,r)};return{adapted:!1,value:e}}function s$(e){return ce(e,".")}function a$(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,".")}function l$(e){return`${e[0]}@${e[1]}`}function u$(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,"@",2)}function c$(e={}){return B(z1(ae(Ce({unit:id("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),o$).map(s$,a$),jd({size:e.size})).map(l$,u$)}var d$=Dt.NEGATIVE_INFINITY,od=Dt.POSITIVE_INFINITY,G1=Dt.EPSILON,Vd=O(2146435072)*O(4294967296),f$=-Vd-O(1),rw=4503599627370496,p$=O(0xfffffffffffff),nw=O("9007199254740992"),sd=new Float64Array(1),iw=new Uint32Array(sd.buffer,sd.byteOffset);function h$(e){return sd[0]=e,[iw[1],iw[0]]}function m$(e){let{0:t,1:r}=h$(e),n=t>>>31,i=t>>>20&2047,o=(t&1048575)*4294967296+r,s=i===0?-1022:i-1023,a=i===0?0:1;return a+=o*G1,a*=n===0?1:-1,{exponent:s,significand:a}}function ow(e,t){return e===-1022?O(t*rw):O((t-1)*rw)+(O(e+1023)<<O(52))}function Bd(e){if(e===od)return Vd;if(e===d$)return f$;let t=m$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===od?ow(r,n):-ow(r,-n)-O(1)}function ad(e){if(e<0)return-ad(-e-O(1));if(e===Vd)return od;if(e<nw)return Dt(e)*2**-1074;let t=e-nw,r=-1021+Dt(t>>O(52));return(1+Dt(t&p$)*G1)*2**r}var sw=Number.isInteger,aw=Object.is,Lc=Number.NEGATIVE_INFINITY,$c=Number.POSITIVE_INFINITY;function H1(e,t,r,n){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:Lc,max:l=i?t:$c}=e,u=o?a<-r?-n:Math.max(a,-r):a===Lc?Math.max(a,-n):Math.max(a,-r),c=s?l>r?n:Math.min(l,r):l===$c?Math.min(l,n):Math.min(l,r);return{noDefaultInfinity:!1,minExcluded:o||(a!==Lc||o)&&sw(u),maxExcluded:s||(l!==$c||s)&&sw(c),min:aw(u,-0)?0:u,max:aw(c,0)?-0:c,noNaN:e.noNaN||!1}}var q1=Number.NEGATIVE_INFINITY,K1=Number.POSITIVE_INFINITY,g$=Number.MAX_VALUE,y$=45035996273704955e-1,ld=4503599627370496;function b$(e){return H1(e,g$,y$,ld)}function S$(e){return e===4503599627370496?K1:e===-4503599627370496?q1:e}function w$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===K1?ld:e===q1?-ld:e}var v$=Number.isInteger,Y1=Number.isNaN,x$=Number.NEGATIVE_INFINITY,R$=Number.POSITIVE_INFINITY,lw=Number.MAX_VALUE,k$=NaN;function uw(e,t){if(Y1(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return Bd(e)}function E$(e){if(typeof e!="number")throw new Error("Unsupported type");return Bd(e)}function C$(e){return!v$(e)}function cw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-lw:x$,max:s=t?lw:R$}=e,a=uw(o,"min"),l=n?a+O(1):a,u=uw(s,"max"),c=i?u-O(1):u;if(c<l)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(r)return rr({min:l,max:c}).map(ad,E$);let d=c>O(0),p=d?l:l-O(1),h=d?c+O(1):c;return rr({min:p,max:h}).map(f=>c<f||f<l?k$:ad(f),f=>{if(typeof f!="number")throw new Error("Unsupported type");return Y1(f)?c!==h?h:p:Bd(f)})}function Ks(e={}){return e.noInteger?cw(b$(e)).map(S$,w$).filter(C$):cw(e)}var A$=Number.NEGATIVE_INFINITY,ud=Number.POSITIVE_INFINITY,I$=Math.imul,cd=2**127*(1+(2**23-1)/2**23),J1=2139095040,P$=-2139095041,dd=new Float32Array(1),T$=new Uint32Array(dd.buffer,dd.byteOffset);function M$(e){return dd[0]=e,T$[0]}function O$(e){let t=M$(e),r=t>>>31,n=t>>>23&255,i=t&8388607,o=n===0?-126:n-127,s=n===0?0:1;return s+=i/2**23,s*=r===0?1:-1,{exponent:o,significand:s}}function dw(e,t){return e===-126?t*8388608:I$(e+127,8388608)+(t-1)*8388608}function Ud(e){if(e===ud)return J1;if(e===A$)return P$;let t=O$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===ud?dw(r,n):-dw(r,-n)-1}function fd(e){if(e<0)return-fd(-e-1);if(e===J1)return ud;if(e<16777216)return e*2**-149;let t=e-16777216,r=-125+(t>>23);return(1+(t&8388607)/8388608)*2**r}var Z1=Number.NEGATIVE_INFINITY,X1=Number.POSITIVE_INFINITY,N$=cd,L$=83886075e-1,pd=8388608;function $$(e){return H1(e,N$,L$,pd)}function D$(e){return e===8388608?X1:e===-8388608?Z1:e}function _$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===X1?pd:e===Z1?-pd:e}var F$=Number.isInteger,Q1=Number.isNaN,j$=Math.fround,V$=Number.NEGATIVE_INFINITY,B$=Number.POSITIVE_INFINITY,U$=NaN;function fw(e,t){let r="fc.float constraints."+t+" must be a 32-bit float - you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";if(Q1(e)||j$(e)!==e)throw new Error(r);return Ud(e)}function W$(e){if(typeof e!="number")throw new Error("Unsupported type");return Ud(e)}function z$(e){return!F$(e)}function pw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-cd:V$,max:s=t?cd:B$}=e,a=fw(o,"min"),l=n?a+1:a,u=fw(s,"max"),c=i?u-1:u;if(l>c)throw new Error("fc.float constraints.min must be smaller or equal to constraints.max");if(r)return oe({min:l,max:c}).map(fd,W$);let d=c>0?l:l-1,p=c>0?c+1:c;return oe({min:d,max:p}).map(h=>h>c||h<l?U$:fd(h),h=>{if(typeof h!="number")throw new Error("Unsupported type");return Q1(h)?c!==p?p:d:Ud(h)})}function e0(e={}){return e.noInteger?pw($$(e)).map(D$,_$).filter(z$):pw(e)}function G$(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function t0(e){return e.replace(/\*\//g,"*\\/")}var Ke=[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,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function Gs(e){let t=4294967295;for(let r=0;r<e.length;++r){let n=nn(e,r);if(n<128)t=Ke[t&255^n]^t>>8;else if(n<2048)t=Ke[t&255^(192|n>>6&31)]^t>>8,t=Ke[t&255^(128|n&63)]^t>>8;else if(n>=55296&&n<57344){let i=nn(e,++r);if(n>=56320||i<56320||i>57343||Number.isNaN(i))r-=1,t=Ke[t&255^239]^t>>8,t=Ke[t&255^191]^t>>8,t=Ke[t&255^189]^t>>8;else{let o=(n&1023)+64,s=i&1023;t=Ke[t&255^(240|o>>8&7)]^t>>8,t=Ke[t&255^(128|o>>2&63)]^t>>8,t=Ke[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=Ke[t&255^(128|s&63)]^t>>8}}else t=Ke[t&255^(224|n>>12&15)]^t>>8,t=Ke[t&255^(128|n>>6&63)]^t>>8,t=Ke[t&255^(128|n&63)]^t>>8}return(t|0)+2147483648}var H$=Object.getPrototypeOf,ci=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return this.arb.generate(e,t)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return j.nil()}};function Hs(e){return H$(e)===ci.prototype&&e.generate===ci.prototype.generate&&e.canShrinkWithoutContext===ci.prototype.canShrinkWithoutContext&&e.shrink===ci.prototype.shrink?e:new ci(e)}var q$=Object.assign,K$=Object.keys;function r0(e){return B(Hs(oe()),Hs(oe({min:1,max:4294967295}))).map(([t,r])=>{let n=()=>{let i={};return q$((s,a)=>{let l=xe(s),u=xe(a),c=e(Gs(`${t}${l}`)%r,Gs(`${t}${u}`)%r);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=K$(i).sort().map(a=>`${a} => ${xe(i[a])}`).map(a=>`/* ${t0(a)} */`);return`function(a, b) {
117
+ ${KN(i)}`),o}function v1(e){return td(e,xe)}async function x1(e){let t=[];function r(s){let a=h1(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let n=td(e,r);if(t.length===0)return n;let i=new _t(await Promise.all(t));function o(s){let a=Je(i,s);return a!==void 0?a:xe(s)}return td(e,o)}function R1(e,t){if(t.runConfiguration.includeErrorInReport)throw new L(e);let r=new L(e,{cause:t.errorInstance});return"cause"in r||qN(r,{cause:t.errorInstance}),r}function e3(e){if(e.failed)throw R1(v1(e),e)}async function t3(e){if(e.failed)throw R1(await x1(e),e)}function r3(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):e3(e)}async function n3(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):t3(e)}function i3(e,t,r,n,i){let o=new g1(r,t,n,i);for(let s of o){e.runBeforeEach();let a=e.run(s);e.runAfterEach(),o.handleResult(a)}return o.runExecution}async function o3(e,t,r,n,i){let o=new g1(r,t,n,i);for(let s of o){await e.runBeforeEach();let a=await e.run(s);await e.runAfterEach(),o.handleResult(a)}return o.runExecution}function k1(e,t){if(e==null||e.generate===null||e.generate===void 0)throw new Error("Invalid property encountered, please use a valid property");if(e.run===null||e.run===void 0)throw new Error("Invalid property encountered, please use a valid property not an arbitrary");let r=Cd({...dt(),...t});if(r.reporter!==void 0&&r.asyncReporter!==void 0)throw new Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(r.asyncReporter!==void 0&&!e.isAsync())throw new Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let n=_N(e,r),i=r.path.length===0||r.path.indexOf(":")===-1?r.numRuns:-1,o=r.numRuns*r.maxSkipsPerRun,s=(...u)=>n.shrink(...u),a=new VN(r.path.length===0?b1(n,r.seed,r.randomType,r.examples):w1(r.path,tr(S1(n,r.seed,r.randomType,r.examples)),s),i,o),l=r.endOnFailure?j.nil:s;return n.isAsync()?o3(n,l,a,r.verbose,r.markInterruptAsFailure).then(u=>u.toRunDetails(r.seed,r.path,o,r)):i3(n,l,a,r.verbose,r.markInterruptAsFailure).toRunDetails(r.seed,r.path,o,r)}function s3(e,t){let r=k1(e,t);if(e.isAsync())return r.then(n3);r3(r)}function a3(e,t){let r=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new d1(e,()=>!0);return t.unbiased===!0?new p1(r):r}function E1(e,t){let r=Cd(typeof t=="number"?{...dt(),numRuns:t}:{...dt(),...t}),n=a3(e,r),i=n.shrink.bind(n);return(r.path.length===0?tr(b1(n,r.seed,r.randomType,r.examples)):w1(r.path,tr(S1(n,r.seed,r.randomType,r.examples)),i)).take(r.numRuns).map(o=>o.value_)}function l3(e,t){return[...E1(e,t)]}function u3(e){return(Math.round(e*100)/100).toFixed(2)}function c3(e,t,r){let n=Cd(typeof r=="number"?{...dt(),numRuns:r}:{...dt(),...r}),i={};for(let l of E1(e,r)){let u=t(l),c=Array.isArray(u)?u:[u];for(let d of c)i[d]=(i[d]||0)+1}let o=Object.entries(i).sort((l,u)=>u[1]-l[1]).map(l=>[l[0],`${u3(l[1]*100/n.numRuns)}%`]),s=o.map(l=>l[0].length).reduce((l,u)=>Math.max(l,u),0),a=o.map(l=>l[1].length).reduce((l,u)=>Math.max(l,u),0);for(let l of o)n.logger(`${l[0].padEnd(s,".")}..${l[1].padStart(a,".")}`)}var d3=Object.assign;function rd(e,t,r,n){let i=r(),o=e.clone(),s={mrng:e.clone(),biasFactor:t,history:[]},a=u=>{let c=i[s.history.length];if(c!==void 0&&c.arb===u){let p=c.value;return $(s.history,{arb:u,value:p,context:c.context,mrng:c.mrng}),o=c.mrng.clone(),p}let d=u.generate(o,t);return $(s.history,{arb:u,value:d.value_,context:d.context,mrng:o.clone()}),d.value},l=(u,...c)=>a(n(u,c));return new _(d3(l,{values(){return G(s.history,u=>u.value)},[Oe](){return rd(e,t,r,n).value},[ft](){return xe(G(s.history,u=>u.value))}}),s)}var Oc=Array.isArray,FS=Object.keys,f3=Object.is;function p3(e){let t=new _t;return function(n,i){let o=Je(t,n);if(o===void 0){let l=n(...i);return ct(t,n,[{args:i,value:l}]),l}let s=o;for(let l of s)if(e(i,l.args))return l.value;let a=n(...i);return $(s,{args:i,value:a}),a}}function C1(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if(Oc(e)){if(!Oc(t)||e.length!==t.length)return!1}else if(Oc(t))return!1;if(FS(e).length!==FS(t).length)return!1;for(let r in e)if(!(r in t)||!C1(e[r],t[r]))return!1;return!0}else return f3(e,t)}var h3=class extends de{constructor(...e){super(...e),this.arbitraryCache=p3(C1)}generate(e,t){return rd(e,t,()=>[],this.arbitraryCache)}canShrinkWithoutContext(e){return!1}shrink(e,t){if(t===void 0)return j.nil();let r=t,n=r.mrng,i=r.biasFactor,o=r.history;return l1(o.map(s=>s.arb),o.map(s=>s.value),o.map(s=>s.context)).map(s=>{function a(){let l=s.value,u=s.context;return G(o,(c,d)=>({arb:c.arb,value:l[d],context:u[d],mrng:c.mrng}))}return rd(n,i,a,this.arbitraryCache)})}};function m3(){return new h3}var g3=Math.floor,jS=Math.log;function y3(e){return g3(jS(e)/jS(2))}function b3(e){return e===O(0)?O(0):O(Ve(e).length)}function A1(e,t,r){if(e===t)return[{min:e,max:t}];if(e<0&&t>0){let s=r(-e),a=r(t);return[{min:-s,max:a},{min:t-a,max:t},{min:e,max:e+s}]}let n=r(t-e),i={min:e,max:e+n},o={min:t-n,max:t};return e<0?[o,i]:[i,o]}var S3=Math.ceil,w3=Math.floor;function VS(e){return w3(e/2)}function BS(e){return S3(e/2)}function US(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:VS(n);for(let l=a;l>0;l=VS(l)){let u=l===n?t:e-l;yield new _(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:BS(n);for(let l=a;l<0;l=BS(l)){let u=l===n?t:e-l;yield new _(u,s),s=u}}return n>0?tr(i()):tr(o())}var WS=Math.sign,v3=Number.isInteger,x3=Object.is,sn=class I1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new _(t.nextInt(n.min,n.max),void 0)}canShrinkWithoutContext(t){return typeof t=="number"&&v3(t)&&!x3(t,-0)&&this.min<=t&&t<=this.max}shrink(t,r){return I1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new _(r,void 0)):US(t,r,!1):US(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?0:this.min<0?this.max:this.min}computeGenerateRange(t,r){if(r===void 0||t.nextInt(1,r)!==1)return{min:this.min,max:this.max};let n=A1(this.min,this.max,y3);if(n.length===1)return n[0];let i=t.nextInt(-2*(n.length-1),n.length-2);return i<0?n[0]:n[i+1]}isLastChanceTry(t,r){return t>0?t===r+1&&t>this.min:t<0?t===r-1&&t<this.max:!1}static isValidContext(t,r){if(r===void 0)return!1;if(typeof r!="number")throw new Error("Invalid context type passed to IntegerArbitrary (#1)");if(r!==0&&WS(t)!==WS(r))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},zS=Number.isInteger;function R3(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function oe(e={}){let t=R3(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!zS(t.min))throw new Error("fc.integer minimum value should be an integer");if(!zS(t.max))throw new Error("fc.integer maximum value should be an integer");return new sn(t.min,t.max)}var GS=new Map;function Od(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=Je(GS,e);if(t!==void 0)return t;let r={depth:0};return ct(GS,e,r),r}function Nd(){return{depth:0}}var k3=class{constructor(e,t,r){this.arb=e,this.mrng=t,this.biasFactor=r}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},E3=Math.min,C3=Math.max,A3=class{constructor(e,t,r,n){this.arb=e,this.mrng=t,this.slices=r,this.biasFactor=n,this.activeSliceIndex=0,this.nextIndexInSlice=0,this.lastIndexInSlice=-1}attemptExact(e){if(e!==0&&this.mrng.nextInt(1,this.biasFactor)===1){let t=[];for(let r=0;r!==this.slices.length;++r)this.slices[r].length===e&&$(t,r);if(t.length===0)return;this.activeSliceIndex=t[this.mrng.nextInt(0,t.length-1)],this.nextIndexInSlice=0,this.lastIndexInSlice=e-1}}next(){if(this.nextIndexInSlice<=this.lastIndexInSlice)return new _(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 e=this.slices[this.activeSliceIndex];if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.nextIndexInSlice=1,this.lastIndexInSlice=e.length-1,new _(e[0],void 0);let t=this.mrng.nextInt(0,e.length-1),r=this.mrng.nextInt(0,e.length-1);return this.nextIndexInSlice=E3(t,r),this.lastIndexInSlice=C3(t,r),new _(e[this.nextIndexInSlice++],void 0)}};function HS(e,t,r,n){return n===void 0||r.length===0||t.nextInt(1,n)!==1?new k3(e,t,n):new A3(e,t,r,n)}var I3=Math.floor,qS=Math.log,KS=Math.max,P3=Array.isArray;function Nc(e,t){return e===t?e:e+I3(qS(t-e)/qS(2))}var P1=class T1 extends de{constructor(t,r,n,i,o,s,a){super(),this.arb=t,this.minLength=r,this.maxGeneratedLength=n,this.maxLength=i,this.setBuilder=s,this.customSlices=a,this.lengthArb=oe({min:r,max:n}),this.depthContext=Od(o)}preFilter(t){if(this.setBuilder===void 0)return t;let r=this.setBuilder();for(let n=0;n!==t.length;++n)r.tryAdd(t[n]);return r.getData()}static makeItCloneable(t,r){return t[Oe]=()=>{let n=[];for(let i=0;i!==r.length;++i)$(n,r[i].value);return this.makeItCloneable(n,r),n},t}generateNItemsNoDuplicates(t,r,n,i){let o=0,s=t(),a=HS(this.arb,n,this.customSlices,i);for(;s.size()<r&&o<this.maxGeneratedLength;){let l=a.next();s.tryAdd(l)?o=0:o+=1}return s.getData()}safeGenerateNItemsNoDuplicates(t,r,n,i){let o=KS(0,r-Nc(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=o;try{return this.generateNItemsNoDuplicates(t,r,n,i)}finally{this.depthContext.depth-=o}}generateNItems(t,r,n){let i=[],o=HS(this.arb,r,this.customSlices,n);o.attemptExact(t);for(let s=0;s!==t;++s)$(i,o.next());return i}safeGenerateNItems(t,r,n){let i=KS(0,t-Nc(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=i;try{return this.generateNItems(t,r,n)}finally{this.depthContext.depth-=i}}wrapper(t,r,n,i){let o=r?this.preFilter(t):t,s=!1,a=[],l=[];for(let u=0;u!==o.length;++u){let c=o[u];s=s||c.hasToBeCloned,$(a,c.value),$(l,c.context)}return s&&T1.makeItCloneable(a,o),new _(a,{shrunkOnce:r,lengthContext:t.length===o.length&&n!==void 0?n:void 0,itemsContexts:l,startIndex:i})}generate(t,r){let n=this.applyBias(t,r),i=n.size,o=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,i,t,n.biasFactorItems):this.safeGenerateNItems(i,t,n.biasFactorItems);return this.wrapper(o,!1,void 0,0)}applyBias(t,r){if(r===void 0)return{size:this.lengthArb.generate(t,void 0).value};if(this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:r};if(t.nextInt(1,r)!==1)return{size:this.lengthArb.generate(t,void 0).value};if(t.nextInt(1,r)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:r};let n=Nc(this.minLength,this.maxGeneratedLength);return{size:oe({min:this.minLength,max:n}).generate(t,void 0).value,biasFactorItems:r}}canShrinkWithoutContext(t){if(!P3(t)||this.minLength>t.length||t.length>this.maxLength)return!1;for(let r=0;r!==t.length;++r)if(!(r in t)||!this.arb.canShrinkWithoutContext(t[r]))return!1;return this.preFilter(G(t,r=>new _(r,void 0))).length===t.length}shrinkItemByItem(t,r,n){let i=[];for(let o=r.startIndex;o<n;++o)$(i,er(()=>this.arb.shrink(t[o],r.itemsContexts[o]).map(s=>{let a=G(Le(t,0,o),(u,c)=>new _(tn(u),r.itemsContexts[c])),l=G(Le(t,o+1),(u,c)=>new _(tn(u),r.itemsContexts[c+o+1]));return[[...a,s,...l],void 0,o]})));return j.nil().join(...i)}shrinkImpl(t,r){if(t.length===0)return j.nil();let n=r!==void 0?r:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(t.length,n.lengthContext).drop(n.shrunkOnce&&n.lengthContext===void 0&&t.length>this.minLength+1?1:0).map(i=>{let o=t.length-i.value;return[G(Le(t,o),(s,a)=>new _(tn(s),n.itemsContexts[a+o])),i.context,0]}).join(er(()=>t.length>this.minLength?this.shrinkItemByItem(t,n,1):this.shrinkItemByItem(t,n,t.length))).join(t.length>this.minLength?er(()=>{let i={shrunkOnce:!1,lengthContext:void 0,itemsContexts:Le(n.itemsContexts,1),startIndex:0};return this.shrinkImpl(Le(t,1),i).filter(o=>this.minLength<=o[0].length+1).map(o=>[[new _(tn(t[0]),n.itemsContexts[0]),...o[0]],void 0,0])}):j.nil())}shrink(t,r){return this.shrinkImpl(t,r).map(n=>this.wrapper(n[0],!0,n[1],n[2]))}},T3=Math.floor,M3=Math.min,xr=2147483647,Xr=["xsmall","small","medium","large","xlarge"],O3=["-4","-3","-2","-1","=","+1","+2","+3","+4"],Ld="small";function N3(e,t){switch(t){case"xsmall":return T3(1.1*e)+1;case"small":return 2*e+10;case"medium":return 11*e+100;case"large":return 101*e+1e3;case"xlarge":return 1001*e+1e4;default:throw new Error(`Unable to compute lengths based on received size: ${t}`)}}function yi(e,t){let r=$t(O3,e);if(r===-1)return e;let n=$t(Xr,t);if(n===-1)throw new Error(`Unable to offset size based on the unknown defaulted one: ${t}`);let i=n+r-4;return i<0?Xr[0]:i>=Xr.length?Xr[Xr.length-1]:Xr[i]}function mi(e,t,r,n){let{baseSize:i=Ld,defaultSizeToMaxWhenMaxSpecified:o}=dt()||{},s=e!==void 0?e:n&&o?"max":i;return s==="max"?r:M3(N3(t,yi(s,i)),r)}function L3(e,t){if(typeof e=="number")return 1/e;let{baseSize:r=Ld,defaultSizeToMaxWhenMaxSpecified:n}=dt()||{},i=e!==void 0?e:t&&n?"max":r;if(i==="max")return 0;switch(yi(i,r)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function $d(e){let{baseSize:t=Ld}=dt()||{};return e===void 0?t:yi(e,t)}function ae(e,t={}){let r=t.size,n=t.minLength||0,i=t.maxLength,o=t.depthIdentifier,s=i!==void 0?i:xr;return new P1(e,n,mi(r,n,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function As(e){return e/O(2)}function YS(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:As(n);for(let l=a;l>0;l=As(l)){let u=e-l;yield new _(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:As(n);for(let l=a;l<0;l=As(l)){let u=e-l;yield new _(u,s),s=u}}return n>0?tr(i()):tr(o())}var $3=class M1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new _(t.nextBigInt(n.min,n.max),void 0)}computeGenerateRange(t,r){if(r===void 0||t.nextInt(1,r)!==1)return{min:this.min,max:this.max};let n=A1(this.min,this.max,b3);if(n.length===1)return n[0];let i=t.nextInt(-2*(n.length-1),n.length-2);return i<0?n[0]:n[i+1]}canShrinkWithoutContext(t){return typeof t=="bigint"&&this.min<=t&&t<=this.max}shrink(t,r){return M1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new _(r,void 0)):YS(t,r,!1):YS(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?O(0):this.min<0?this.max:this.min}isLastChanceTry(t,r){return t>0?t===r+O(1)&&t>this.min:t<0?t===r-O(1)&&t<this.max:!1}static isValidContext(t,r){if(r===void 0)return!1;if(typeof r!="bigint")throw new Error("Invalid context type passed to BigIntArbitrary (#1)");let n=t>0&&r<0||t<0&&r>0;if(r!==O(0)&&n)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function D3(e){let r=O(-1)<<O(255),n=(O(1)<<O(255))-O(1),i=e.min,o=e.max;return{min:i!==void 0?i:r-(o!==void 0&&o<O(0)?o*o:O(0)),max:o!==void 0?o:n+(i!==void 0&&i>O(0)?i*i:O(0))}}function _3(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function rr(...e){let t=D3(_3(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new $3(t.min,t.max)}var F3=Object.getPrototypeOf,li=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return this.arb.generate(e,void 0)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return this.arb.shrink(e,t)}};function zs(e){return F3(e)===li.prototype&&e.generate===li.prototype.generate&&e.canShrinkWithoutContext===li.prototype.canShrinkWithoutContext&&e.shrink===li.prototype.shrink?e:new li(e)}function j3(e){return e===1}function V3(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function bi(){return zs(oe({min:0,max:1}).map(j3,V3))}var di=Object.is,B3=class{constructor(e){this.values=e,this.fastValues=new rn(this.values);let t=!1,r=!1;if(Ws(this.fastValues,0))for(let n=0;n!==this.values.length;++n){let i=this.values[n];t=t||di(i,-0),r=r||di(i,0)}this.hasMinusZero=t,this.hasPlusZero=r}has(e){return e===0?di(e,0)?this.hasPlusZero:this.hasMinusZero:Ws(this.fastValues,e)}},O1=class extends de{constructor(e){super(),this.values=e}generate(e,t){let r=this.values.length===1?0:e.nextInt(0,this.values.length-1),n=this.values[r];return vr(n)?new _(n,r,()=>n[Oe]()):new _(n,r)}canShrinkWithoutContext(e){return this.values.length===1?di(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new B3(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||di(e,this.values[0])?j.nil():j.of(new _(this.values[0],0))}};function vt(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new O1(e)}function U3(e){return!e||!e.withBigInt?vt(!1,null,void 0,0,"",NaN):vt(!1,null,void 0,0,"",NaN,O(0))}function ve(e){return new O1([e])}var W3=class N1{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Oe](){return new N1}};function z3(){return ve(new W3)}var G3=NaN,H3=Number.isNaN;function L1(e){return new Bs(e)}function $1(e){if(!(e instanceof Bs)||e.constructor!==Bs)throw new L("Not a valid value for date unmapper");return Us(e)}function q3(e){return t=>t===e?new Bs(G3):L1(t)}function K3(e){return t=>{let r=$1(t);return H3(r)?e:r}}var JS=Number.isNaN;function D1(e={}){let t=e.min!==void 0?Us(e.min):-864e13,r=e.max!==void 0?Us(e.max):864e13,n=e.noInvalidDate;if(JS(t))throw new Error("fc.date min must be valid instance of Date");if(JS(r))throw new Error("fc.date max must be valid instance of Date");if(t>r)throw new Error("fc.date max must be greater or equal to min");if(n)return oe({min:t,max:r}).map(L1,$1);let i=r+1;return oe({min:t,max:r+1}).map(q3(i),K3(i))}var Y3=class extends de{constructor(e,t){super(),this.startArb=e,this.chainer=t}generate(e,t){let r=[],n=e.clone(),i=this.startArb.generate(e,t);for(r.push({arbitrary:this.startArb,value:i.value_,context:i.context,clonedMrng:n});;){let s=this.chainer(i.value_);if(s===void 0)break;let a=e.clone();i=s.generate(e,t),r.push({arbitrary:s,value:i.value_,context:i.context,clonedMrng:a})}let o={biasFactor:t,entries:r,currentShrinkLevel:0};return new _(i.value_,o)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?new j(this.shrinkIterator(t)):j.nil()}*shrinkIterator(e){let{entries:t,currentShrinkLevel:r,biasFactor:n}=e;for(let i=r;i<t.length;++i){let o=t[i],s=o.arbitrary.shrink(o.value,o.context);for(let a of s){let l=t.slice(0,i);l.push({arbitrary:o.arbitrary,value:a.value_,context:a.context,clonedMrng:o.clonedMrng});let u=a,c=o.clonedMrng.clone();for(;;){let h=this.chainer(u.value_);if(h===void 0)break;let f=c.clone(),m=h.generate(c,n);l.push({arbitrary:h,value:m.value_,context:m.context,clonedMrng:f}),u=m}let d=l[l.length-1],p={biasFactor:n,entries:l,currentShrinkLevel:i};yield new _(d.value,p)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function J3(e,t){return new Y3(e,t)}var Z3=Symbol.iterator,X3=Array.isArray,Q3=Object.is,eL=class _1 extends de{constructor(t,r){super(),this.arb=t,this.numValues=r}generate(t,r){let n=[];if(this.numValues<=0)return this.wrapper(n);for(let i=0;i!==this.numValues-1;++i)$(n,this.arb.generate(t.clone(),r));return $(n,this.arb.generate(t,r)),this.wrapper(n)}canShrinkWithoutContext(t){if(!X3(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let r=1;r<t.length;++r)if(!Q3(t[0],t[r]))return!1;return this.arb.canShrinkWithoutContext(t[0])}shrink(t,r){return t.length===0?j.nil():new j(this.shrinkImpl(t,r!==void 0?r:[])).map(n=>this.wrapper(n))}*shrinkImpl(t,r){let n=G(t,(o,s)=>this.arb.shrink(o,r[s])[Z3]()),i=G(n,o=>o.next());for(;!i[0].done;)yield G(i,o=>o.value),i=G(n,o=>o.next())}static makeItCloneable(t,r){return t[Oe]=()=>{let n=[];for(let i=0;i!==r.length;++i)$(n,r[i].value);return this.makeItCloneable(n,r),n},t}wrapper(t){let r=!1,n=[],i=[];for(let o=0;o!==t.length;++o){let s=t[o];r=r||s.hasToBeCloned,$(n,s.value),$(i,s.context)}return r&&_1.makeItCloneable(n,t),new _(n,i)}};function tL(e,t){return new eL(e,t)}var ZS=class{constructor(e){this.isEqual=e,this.data=[]}tryAdd(e){for(let t=0;t!==this.data.length;++t)if(this.isEqual(this.data[t],e))return!1;return $(this.data,e),!0}size(){return this.data.length}getData(){return this.data}},rL=Number.isNaN,nL=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new rn,this.data=[]}tryAdd(e){let t=this.selector(e);if(rL(t))return $(this.data,e),!0;let r=this.selectedItemsExceptNaN.size;return fi(this.selectedItemsExceptNaN,t),r!==this.selectedItemsExceptNaN.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},iL=Object.is,oL=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new rn,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(iL(t,-0))return this.hasMinusZero?!1:($(this.data,e),this.hasMinusZero=!0,!0);let r=this.selectedItemsExceptMinusZero.size;return fi(this.selectedItemsExceptMinusZero,t),r!==this.selectedItemsExceptMinusZero.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},sL=class{constructor(e){this.selector=e,this.selectedItems=new rn,this.data=[]}tryAdd(e){let t=this.selector(e),r=this.selectedItems.size;return fi(this.selectedItems,t),r!==this.selectedItems.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function aL(e){if(typeof e.comparator=="function"){if(e.selector===void 0){let a=e.comparator,l=(u,c)=>a(u.value_,c.value_);return()=>new ZS(l)}let n=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>n(o(a),o(l));return()=>new ZS(s)}let t=e.selector||(n=>n),r=n=>t(n.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new nL(r);case"SameValueZero":return()=>new sL(r);case"SameValue":case void 0:return()=>new oL(r)}}function Rr(e,t={}){let r=t.minLength!==void 0?t.minLength:0,n=t.maxLength!==void 0?t.maxLength:xr,i=mi(t.size,r,n,t.maxLength!==void 0),o=t.depthIdentifier,s=new P1(e,r,i,n,o,aL(t),[]);return r===0?s:s.filter(a=>a.length>=r)}var lL=Object.create,uL=Object.defineProperty,cL=Object.getOwnPropertyDescriptor,XS=Object.getPrototypeOf,dL=Object.prototype,fL=Reflect.ownKeys;function pL(e){let t=e[1]?lL(null):{};for(let r of e[0])uL(t,r[0],{enumerable:!0,configurable:!0,writable:!0,value:r[1]});return t}function hL(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function mL(e){if(typeof e!="object"||e===null)throw new L("Incompatible instance received: should be a non-null object");let t=XS(e)===null,r=XS(e)===dL;if(!t&&!r)throw new L("Incompatible instance received: should be of exact type Object");let n=G(fL(e),i=>[i,cL(e,i)]);if(!n1(n,([,i])=>hL(i)))throw new L("Incompatible instance received: should contain only c/e/w properties without get/set");return[G(n,([i,o])=>[i,o.value]),t]}function gL(e){return e[0]}function Dd(e,t,r={}){let n=!!r.noNullPrototype;return B(Rr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:gL,depthIdentifier:r.depthIdentifier}),n?ve(!1):bi()).map(pL,mL)}var yL=Number.POSITIVE_INFINITY,bL=Number.MAX_SAFE_INTEGER,SL=Number.isInteger,wL=Math.floor,vL=Math.pow,xL=Math.min,nd=class F1 extends de{static from(t,r,n){if(t.length===0)throw new Error(`${n} expects at least one weighted arbitrary`);let i=0;for(let o=0;o!==t.length;++o){if(t[o].arbitrary===void 0)throw new Error(`${n} expects arbitraries to be specified`);let s=t[o].weight;if(i+=s,!SL(s))throw new Error(`${n} expects weights to be integer values`);if(s<0)throw new Error(`${n} expects weights to be superior or equal to 0`)}if(i<=0)throw new Error(`${n} expects the sum of weights to be strictly superior to 0`);return new F1(t,{depthBias:L3(r.depthSize,r.maxDepth!==void 0),maxDepth:r.maxDepth!==void 0?r.maxDepth:yL,withCrossShrink:!!r.withCrossShrink},Od(r.depthIdentifier))}constructor(t,r,n){super(),this.warbs=t,this.constraints=r,this.context=n;let i=0;this.cumulatedWeights=[];for(let o=0;o!==t.length;++o)i+=t[o].weight,$(this.cumulatedWeights,i);this.totalWeight=i}generate(t,r){if(this.mustGenerateFirst())return this.safeGenerateForIndex(t,0,r);let n=t.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let i=0;i!==this.cumulatedWeights.length;++i)if(n<this.cumulatedWeights[i])return this.safeGenerateForIndex(t,i,r);throw new Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(t){return this.canShrinkWithoutContextIndex(t)!==-1}shrink(t,r){if(r!==void 0){let i=r,o=i.selectedIndex,s=i.originalBias,a=this.warbs[o].arbitrary.shrink(t,i.originalContext).map(l=>this.mapIntoValue(o,l,null,s));if(i.clonedMrngForFallbackFirst!==null){i.cachedGeneratedForFirst===void 0&&(i.cachedGeneratedForFirst=this.safeGenerateForIndex(i.clonedMrngForFallbackFirst,0,s));let l=i.cachedGeneratedForFirst;return j.of(l).join(a)}return a}let n=this.canShrinkWithoutContextIndex(t);return n===-1?j.nil():this.defaultShrinkForFirst(n).join(this.warbs[n].arbitrary.shrink(t,void 0).map(i=>this.mapIntoValue(n,i,null,void 0)))}defaultShrinkForFirst(t){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(t)||this.warbs[0].fallbackValue===void 0)return j.nil()}finally{--this.context.depth}let r=new _(this.warbs[0].fallbackValue.default,void 0);return j.of(this.mapIntoValue(0,r,null,void 0))}canShrinkWithoutContextIndex(t){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(t)?0:-1;try{++this.context.depth;for(let r=0;r!==this.warbs.length;++r){let n=this.warbs[r];if(n.weight!==0&&n.arbitrary.canShrinkWithoutContext(t))return r}return-1}finally{--this.context.depth}}mapIntoValue(t,r,n,i){let o={selectedIndex:t,originalBias:i,originalContext:r.context,clonedMrngForFallbackFirst:n};return new _(r.value,o)}safeGenerateForIndex(t,r,n){++this.context.depth;try{let i=this.warbs[r].arbitrary.generate(t,n),o=this.mustFallbackToFirstInShrink(r)?t.clone():null;return this.mapIntoValue(r,i,o,n)}finally{--this.context.depth}}mustGenerateFirst(){return this.constraints.maxDepth<=this.context.depth}mustFallbackToFirstInShrink(t){return t!==0&&this.constraints.withCrossShrink&&this.warbs[0].weight!==0}computeNegDepthBenefit(){let t=this.constraints.depthBias;if(t<=0||this.warbs[0].weight===0)return 0;let r=wL(vL(1+t,this.context.depth))-1;return-xL(this.totalWeight*r,bL)||0}};function RL(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function QS(e){return Hw(e)?{arbitrary:e,weight:1}:e}function Me(...e){let t=e[0];if(RL(t)){let n=G(Le(e,1),QS);return nd.from(n,t,"fc.oneof")}let r=G(e,QS);return nd.from(r,{},"fc.oneof")}var kL=Number.isInteger;function Qt(e){let t=typeof e=="number"?e:e&&e.max!==void 0?e.max:2147483647;if(t<0)throw new Error("fc.nat value should be greater than or equal to 0");if(!kL(t))throw new Error("fc.nat maximum value should be an integer");return new sn(0,t)}var EL=Object.is;function CL(e){let t=0,r=[];for(let n of e){let i=t;t=i+n.num;let o=t-1;r.push({from:i,to:o,entry:n})}return r}function AL(e,t){let r=0,n=e.length;for(;n-r>1;){let i=~~((r+n)/2);t<e[i].from?n=i:r=i}return e[r]}function IL(e){let t=CL(e);return function(n){let i=AL(t,n);return i.entry.build(n-i.from)}}function PL(e){let t={mapping:new _t,negativeZeroIndex:void 0},r=0;for(let n=0;n!==e.length;++n){let i=e[n];for(let o=0;o!==i.num;++o){let s=i.build(o);s===0&&1/s===Dt.NEGATIVE_INFINITY?t.negativeZeroIndex=r:ct(t.mapping,s,r),++r}}return t}function TL(e){let t=null;return function(n){t===null&&(t=PL(e));let i=EL(n,-0)?t.negativeZeroIndex:Je(t.mapping,n);if(i===void 0)throw new L("Unknown value encountered cannot be built using this mapToConstant");return i}}function ML(e){if(e.length===0)throw new L("fc.mapToConstant expects at least one option");let t=0;for(let r=0;r!==e.length;++r){if(e[r].num<0)throw new L("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");t+=e[r].num}if(t===0)throw new L("fc.mapToConstant expects at least one choice among options");return t}function an(...e){return Qt({max:ML(e)-1}).map(IL(e),TL(e))}function j1(e,t,r,n){if(t.length===0)return r>0?void 0:[];if(n<=0)return;let i=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];for(;i.length>0;){let o=e1(i);for(let s=o.nextStartIndex;s<=t.length;++s){let a=ge(t,o.endIndexChunks,s);if(e.canShrinkWithoutContext(a)){let l=[...o.chunks,a];if(s===t.length){if(l.length<r)break;return l}$(i,{endIndexChunks:o.endIndexChunks,nextStartIndex:s+1,chunks:o.chunks}),l.length<n&&$(i,{endIndexChunks:s,nextStartIndex:s+1,chunks:l});break}}}}function OL(e){return ce(e,"")}function V1(e){return e.minLength!==void 0?e.minLength:0}function B1(e){return e.maxLength!==void 0?e.maxLength:xr}function NL(e,t){return V1(t)<=e.length&&e.length<=B1(t)}function LL(e,t){return function(n){if(typeof n!="string")throw new L("Unsupported value");let i=j1(e,n,V1(t),B1(t));if(i===void 0)throw new L("Unable to unmap received string");return i}}var U1=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function $L(e,t,r){let n;try{n=r(e)}catch{return}for(let i of n)if(!t.canShrinkWithoutContext(i))return;return n}function DL(e,t){let r=[];for(let n of U1){let i=$L(n,e,t);i!==void 0&&$(r,i)}return r}var ew=new WeakMap;function _L(e){let t=[];for(let r of U1){let n=j1(e,r,0,xr);n!==void 0&&$(t,n)}return t}function FL(e,t){let r=D4(ew,e);r===void 0&&(r=_L(e),$4(ew,e,r));let n=[];for(let i of r)NL(i,t)&&$(n,i);return n}var jL=[[0,127]],VL=[[0,55295],[57344,1114111]],BL=[[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,6e3],[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],[66e3,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],[128e3,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]],UL=[[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]],tw=String.fromCodePoint,WL=Math.min,zL=Math.max;function id(e){if(e.length===1){let r=tw(e[0]);return{num:1,build:()=>r}}let t=e[0];return{num:e[1]-e[0]+1,build:r=>tw(t+r)}}function rw(e,t){let r=[],n=0,i=0;for(;n<e.length&&i<t.length;){let o=e[n],s=o[0],a=o.length===1?o[0]:o[1],l=t[i],u=l[0],c=l.length===1?l[0]:l[1];if(a<u)n+=1;else if(c<s)i+=1;else{let d=zL(s,u),p=WL(a,c);if(r.length>=1){let h=r[r.length-1];(h.length===1?h[0]:h[1])+1===d&&(d=h[0],e1(r))}$(r,d===p?[d]:[d,p]),a<=p&&(n+=1),c<=p&&(i+=1)}}return r}var nw=Object.create(null);function GL(e){switch(e){case"full":return VL;case"ascii":return jL}}function HL(e,t){let r=`${e}:${t}`,n=nw[r];if(n!==void 0)return n;let i=GL(t),o=e==="binary"?i:rw(i,BL),s=[];for(let l of o)$(s,id(l));if(e==="grapheme"){let l=rw(i,UL);for(let u of l){let c=id(u);$(s,{num:c.num,build:d=>eN(c.build(d),"NFD")})}}let a=an(...s);return nw[r]=a,a}function ui(e,t){return HL(e,t)}function qL(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return ui("grapheme","full");case"grapheme-composite":return ui("composite","full");case"grapheme-ascii":case void 0:return ui("grapheme","ascii");case"binary":return ui("binary","full");case"binary-ascii":return ui("binary","ascii")}}function Ce(e={}){let t=qL(e),r=LL(t,e),n=FL(t,e);return ae(t,{...e,experimentalCustomSlices:n}).map(OL,r)}var W1=Map,_d=String.fromCharCode,Fd={num:26,build:e=>_d(e+97)},KL={num:26,build:e=>_d(e+65)},z1={num:10,build:e=>_d(e+48)};function YL(e){let t=p4(e);return e!==t?t:`%${pi(nn(e,0),16)}`}function JL(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var ZL=()=>Ce({unit:"binary",minLength:1,maxLength:1}).map(YL,JL),Lc;function XL(){return Lc===void 0&&(Lc=an(Fd)),Lc}var Is;function od(e){Is===void 0&&(Is=new W1);let t=Je(Is,e);return t===void 0&&(t=an(Fd,z1,{num:e.length,build:r=>e[r]}),ct(Is,e,t)),t}function QL(e){return an(Fd,KL,z1,{num:e.length,build:t=>e[t]})}var Ps;function jd(e){Ps===void 0&&(Ps=new W1);let t=Je(Ps,e);return t===void 0&&(t=Me({weight:10,arbitrary:QL(e)},{weight:1,arbitrary:ZL()}),ct(Ps,e,t)),t}function jt(e,t={}){let r=t.freq===void 0?6:t.freq,n=i1(t,"nil")?t.nil:null,i=[{arbitrary:ve(n),weight:1,fallbackValue:{default:n}},{arbitrary:e,weight:r-1}],o={withCrossShrink:!0,depthSize:t.depthSize,maxDepth:t.maxDepth,depthIdentifier:t.depthIdentifier};return nd.from(i,o,"fc.option")}function e$(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var G1=Symbol("adapted-value");function t$(e,t){let r=t(e.value_);return r.adapted?new _(r.value,G1):e}var r$=class extends de{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=r=>t$(r,t)}generate(e,t){let r=this.sourceArb.generate(e,t);return this.adaptValue(r)}canShrinkWithoutContext(e){return this.sourceArb.canShrinkWithoutContext(e)&&!this.adapter(e).adapted}shrink(e,t){return t===G1?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):j.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function H1(e,t){return new r$(e,t)}function n$([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function i$(e){if(typeof e!="string"||e.length===0)throw new Error("Unsupported");return e.length===1?[e[0],null]:[e[0],[ge(e,1,e.length-1),e[e.length-1]]]}function o$(e){let t=od("");return B(t,jt(B(Ce({unit:od("-"),size:e,maxLength:61}),t))).map(n$,i$).filter(e$)}function s$(e){return`${ce(e[0],".")}.${e[1]}`}function a$(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e.lastIndexOf(".");return[Be(ge(e,0,t),"."),ge(e,t+1)]}function l$(e){let[t,r]=e,n=r.length;for(let i=0;i!==t.length;++i)if(n+=1+t[i].length,n>255)return{adapted:!0,value:[Le(t,0,i),r]};return{adapted:!1,value:e}}function Vd(e={}){let t=$d(e.size),r=yi("-1",t),n=Ce({unit:XL(),minLength:2,maxLength:63,size:r});return H1(B(ae(o$(t),{size:r,minLength:1,maxLength:127}),n),l$).map(s$,a$)}function u$(e){let t=e[0].length;for(let r=1;r!==e.length;++r)if(t+=1+e[r].length,t>64)return{adapted:!0,value:Le(e,0,r)};return{adapted:!1,value:e}}function c$(e){return ce(e,".")}function d$(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,".")}function f$(e){return`${e[0]}@${e[1]}`}function p$(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,"@",2)}function h$(e={}){return B(H1(ae(Ce({unit:od("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),u$).map(c$,d$),Vd({size:e.size})).map(f$,p$)}var m$=Dt.NEGATIVE_INFINITY,sd=Dt.POSITIVE_INFINITY,q1=Dt.EPSILON,Bd=O(2146435072)*O(4294967296),g$=-Bd-O(1),iw=4503599627370496,y$=O(0xfffffffffffff),ow=O("9007199254740992"),ad=new Float64Array(1),sw=new Uint32Array(ad.buffer,ad.byteOffset);function b$(e){return ad[0]=e,[sw[1],sw[0]]}function S$(e){let{0:t,1:r}=b$(e),n=t>>>31,i=t>>>20&2047,o=(t&1048575)*4294967296+r,s=i===0?-1022:i-1023,a=i===0?0:1;return a+=o*q1,a*=n===0?1:-1,{exponent:s,significand:a}}function aw(e,t){return e===-1022?O(t*iw):O((t-1)*iw)+(O(e+1023)<<O(52))}function Ud(e){if(e===sd)return Bd;if(e===m$)return g$;let t=S$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===sd?aw(r,n):-aw(r,-n)-O(1)}function ld(e){if(e<0)return-ld(-e-O(1));if(e===Bd)return sd;if(e<ow)return Dt(e)*2**-1074;let t=e-ow,r=-1021+Dt(t>>O(52));return(1+Dt(t&y$)*q1)*2**r}var lw=Number.isInteger,uw=Object.is,$c=Number.NEGATIVE_INFINITY,Dc=Number.POSITIVE_INFINITY;function K1(e,t,r,n){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:$c,max:l=i?t:Dc}=e,u=o?a<-r?-n:Math.max(a,-r):a===$c?Math.max(a,-n):Math.max(a,-r),c=s?l>r?n:Math.min(l,r):l===Dc?Math.min(l,n):Math.min(l,r);return{noDefaultInfinity:!1,minExcluded:o||(a!==$c||o)&&lw(u),maxExcluded:s||(l!==Dc||s)&&lw(c),min:uw(u,-0)?0:u,max:uw(c,0)?-0:c,noNaN:e.noNaN||!1}}var Y1=Number.NEGATIVE_INFINITY,J1=Number.POSITIVE_INFINITY,w$=Number.MAX_VALUE,v$=45035996273704955e-1,ud=4503599627370496;function x$(e){return K1(e,w$,v$,ud)}function R$(e){return e===4503599627370496?J1:e===-4503599627370496?Y1:e}function k$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===J1?ud:e===Y1?-ud:e}var E$=Number.isInteger,Z1=Number.isNaN,C$=Number.NEGATIVE_INFINITY,A$=Number.POSITIVE_INFINITY,cw=Number.MAX_VALUE,I$=NaN;function dw(e,t){if(Z1(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return Ud(e)}function P$(e){if(typeof e!="number")throw new Error("Unsupported type");return Ud(e)}function T$(e){return!E$(e)}function fw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-cw:C$,max:s=t?cw:A$}=e,a=dw(o,"min"),l=n?a+O(1):a,u=dw(s,"max"),c=i?u-O(1):u;if(c<l)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(r)return rr({min:l,max:c}).map(ld,P$);let d=c>O(0),p=d?l:l-O(1),h=d?c+O(1):c;return rr({min:p,max:h}).map(f=>c<f||f<l?I$:ld(f),f=>{if(typeof f!="number")throw new Error("Unsupported type");return Z1(f)?c!==h?h:p:Ud(f)})}function Ks(e={}){return e.noInteger?fw(x$(e)).map(R$,k$).filter(T$):fw(e)}var M$=Number.NEGATIVE_INFINITY,cd=Number.POSITIVE_INFINITY,O$=Math.imul,dd=2**127*(1+(2**23-1)/2**23),X1=2139095040,N$=-2139095041,fd=new Float32Array(1),L$=new Uint32Array(fd.buffer,fd.byteOffset);function $$(e){return fd[0]=e,L$[0]}function D$(e){let t=$$(e),r=t>>>31,n=t>>>23&255,i=t&8388607,o=n===0?-126:n-127,s=n===0?0:1;return s+=i/2**23,s*=r===0?1:-1,{exponent:o,significand:s}}function pw(e,t){return e===-126?t*8388608:O$(e+127,8388608)+(t-1)*8388608}function Wd(e){if(e===cd)return X1;if(e===M$)return N$;let t=D$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===cd?pw(r,n):-pw(r,-n)-1}function pd(e){if(e<0)return-pd(-e-1);if(e===X1)return cd;if(e<16777216)return e*2**-149;let t=e-16777216,r=-125+(t>>23);return(1+(t&8388607)/8388608)*2**r}var Q1=Number.NEGATIVE_INFINITY,e0=Number.POSITIVE_INFINITY,_$=dd,F$=83886075e-1,hd=8388608;function j$(e){return K1(e,_$,F$,hd)}function V$(e){return e===8388608?e0:e===-8388608?Q1:e}function B$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===e0?hd:e===Q1?-hd:e}var U$=Number.isInteger,t0=Number.isNaN,W$=Math.fround,z$=Number.NEGATIVE_INFINITY,G$=Number.POSITIVE_INFINITY,H$=NaN;function hw(e,t){let r="fc.float constraints."+t+" must be a 32-bit float - you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";if(t0(e)||W$(e)!==e)throw new Error(r);return Wd(e)}function q$(e){if(typeof e!="number")throw new Error("Unsupported type");return Wd(e)}function K$(e){return!U$(e)}function mw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-dd:z$,max:s=t?dd:G$}=e,a=hw(o,"min"),l=n?a+1:a,u=hw(s,"max"),c=i?u-1:u;if(l>c)throw new Error("fc.float constraints.min must be smaller or equal to constraints.max");if(r)return oe({min:l,max:c}).map(pd,q$);let d=c>0?l:l-1,p=c>0?c+1:c;return oe({min:d,max:p}).map(h=>h>c||h<l?H$:pd(h),h=>{if(typeof h!="number")throw new Error("Unsupported type");return t0(h)?c!==p?p:d:Wd(h)})}function r0(e={}){return e.noInteger?mw(j$(e)).map(V$,B$).filter(K$):mw(e)}function Y$(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function n0(e){return e.replace(/\*\//g,"*\\/")}var Ke=[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,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function Gs(e){let t=4294967295;for(let r=0;r<e.length;++r){let n=nn(e,r);if(n<128)t=Ke[t&255^n]^t>>8;else if(n<2048)t=Ke[t&255^(192|n>>6&31)]^t>>8,t=Ke[t&255^(128|n&63)]^t>>8;else if(n>=55296&&n<57344){let i=nn(e,++r);if(n>=56320||i<56320||i>57343||Number.isNaN(i))r-=1,t=Ke[t&255^239]^t>>8,t=Ke[t&255^191]^t>>8,t=Ke[t&255^189]^t>>8;else{let o=(n&1023)+64,s=i&1023;t=Ke[t&255^(240|o>>8&7)]^t>>8,t=Ke[t&255^(128|o>>2&63)]^t>>8,t=Ke[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=Ke[t&255^(128|s&63)]^t>>8}}else t=Ke[t&255^(224|n>>12&15)]^t>>8,t=Ke[t&255^(128|n>>6&63)]^t>>8,t=Ke[t&255^(128|n&63)]^t>>8}return(t|0)+2147483648}var J$=Object.getPrototypeOf,ci=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return this.arb.generate(e,t)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return j.nil()}};function Hs(e){return J$(e)===ci.prototype&&e.generate===ci.prototype.generate&&e.canShrinkWithoutContext===ci.prototype.canShrinkWithoutContext&&e.shrink===ci.prototype.shrink?e:new ci(e)}var Z$=Object.assign,X$=Object.keys;function i0(e){return B(Hs(oe()),Hs(oe({min:1,max:4294967295}))).map(([t,r])=>{let n=()=>{let i={};return Z$((s,a)=>{let l=xe(s),u=xe(a),c=e(Gs(`${t}${l}`)%r,Gs(`${t}${u}`)%r);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=X$(i).sort().map(a=>`${a} => ${xe(i[a])}`).map(a=>`/* ${n0(a)} */`);return`function(a, b) {
118
118
  // With hash and stringify coming from fast-check${s.length!==0?`
119
119
  ${ce(s,`
120
120
  `)}`:""}
@@ -122,20 +122,20 @@ ${zN(i)}`),o}function S1(e){return ed(e,xe)}async function w1(e){let t=[];functi
122
122
  const hA = hash('${t}' + stringify(a)) % ${r};
123
123
  const hB = hash('${t}' + stringify(b)) % ${r};
124
124
  return cmp(hA, hB);
125
- }`},[Oe]:n})};return n()})}var Y$=Object.assign;function J$(){return r0(Y$((e,t)=>e<t,{toString(){return"(hA, hB) => hA < hB"}}))}var Z$=Object.assign;function X$(){return r0(Z$((e,t)=>e-t,{toString(){return"(hA, hB) => hA - hB"}}))}var Q$=Object.defineProperties,eD=Object.keys;function tD(e){return B(ae(e,{minLength:1}),Hs(oe())).map(([t,r])=>{let n=()=>{let i={},o=(...a)=>{let l=xe(a),u=t[Gs(`${r}${l}`)%t.length];return i[l]=u,vr(u)?u[Oe]():u};function s(a){let l=G(G(e1(eD(i)),u=>`${u} => ${xe(i[u])}`),u=>`/* ${t0(u)} */`);return`function(...args) {
125
+ }`},[Oe]:n})};return n()})}var Q$=Object.assign;function eD(){return i0(Q$((e,t)=>e<t,{toString(){return"(hA, hB) => hA < hB"}}))}var tD=Object.assign;function rD(){return i0(tD((e,t)=>e-t,{toString(){return"(hA, hB) => hA - hB"}}))}var nD=Object.defineProperties,iD=Object.keys;function oD(e){return B(ae(e,{minLength:1}),Hs(oe())).map(([t,r])=>{let n=()=>{let i={},o=(...a)=>{let l=xe(a),u=t[Gs(`${r}${l}`)%t.length];return i[l]=u,vr(u)?u[Oe]():u};function s(a){let l=G(G(r1(iD(i)),u=>`${u} => ${xe(i[u])}`),u=>`/* ${n0(u)} */`);return`function(...args) {
126
126
  // With hash and stringify coming from fast-check${l.length!==0?`
127
127
  ${l.join(`
128
128
  `)}`:""}
129
129
  const outs = ${a};
130
130
  return outs[hash('${r}' + stringify(args)) % outs.length];
131
- }`}return Q$(o,{toString:{value:()=>s(xe(t))},[ft]:{value:()=>s(xe(t))},[Ft]:{value:async()=>s(await Id(t))},[Oe]:{value:n,configurable:!0}})};return n()})}var rD=Number.MIN_SAFE_INTEGER,nD=Number.MAX_SAFE_INTEGER;function n0(){return new sn(rD,nD)}var iD=Number.MAX_SAFE_INTEGER;function oD(){return new sn(0,iD)}var sD=Number.parseInt;function aD(e){let[t,r]=e;switch(t){case"oct":return`0${pi(r,8)}`;case"hex":return`0x${pi(r,16)}`;default:return`${r}`}}function $s(e,t){let r=sD(e,t);if(pi(r,t)!==e)throw new Error("Invalid value");return r}function lD(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",$s(ge(e,2),16)]:["oct",$s(ge(e,1),8)]:["dec",$s(e,10)]}function uD(e){return ce(e,".")}function cD(e){if(typeof e!="string")throw new Error("Invalid type");return G(Be(e,"."),t=>$s(t,10))}function Wd(){return B(Qt(255),Qt(255),Qt(255),Qt(255)).map(uD,cD)}function wt(e){return B(vt("dec","oct","hex"),Qt(e)).map(aD,lD)}function Dc(e){return ce(e,".")}function _c(e){if(typeof e!="string")throw new Error("Invalid type");return Be(e,".")}function i0(){return Me(B(wt(255),wt(255),wt(255),wt(255)).map(Dc,_c),B(wt(255),wt(255),wt(65535)).map(Dc,_c),B(wt(255),wt(16777215)).map(Dc,_c),wt(4294967295))}function zd(e){return e.length===0?[]:Be(e,":")}function Gd(e){let t=Be(e,":");return t.length>=2&&t[t.length-1].length<=4?[Le(t,0,t.length-2),`${t[t.length-2]}:${t[t.length-1]}`]:[Le(t,0,t.length-1),t[t.length-1]]}function dD(e){return`${ce(e[0],":")}:${e[1]}`}function fD(e){if(typeof e!="string")throw new Error("Invalid type");return Gd(e)}function pD(e){return`::${ce(e[0],":")}:${e[1]}`}function hD(e){if(typeof e!="string")throw new Error("Invalid type");if(!q4(e,"::"))throw new Error("Invalid value");return Gd(ge(e,2))}function Ds(e){return`${ce(e[0],":")}::${ce(e[1],":")}:${e[2]}`}function _s(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2),[n,i]=Gd(r);return[zd(t),n,i]}function mD(e){return Ds([e[0],[e[1]],e[2]])}function gD(e){let t=_s(e);return[t[0],ce(t[1],":"),t[2]]}function hw(e){return`${ce(e[0],":")}::${e[1]}`}function mw(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2);return[zd(t),r]}function yD(e){return`${ce(e[0],":")}::`}function bD(e){if(typeof e!="string")throw new Error("Invalid type");if(!K4(e,"::"))throw new Error("Invalid value");return[zd(ge(e,0,e.length-2))]}function SD([e,t]){return`${e}:${t}`}function wD(e){if(typeof e!="string")throw new L("Invalid type");if(!e.includes(":"))throw new L("Invalid value");return e.split(":",2)}var vD="0123456789abcdef",Fc;function xD(){return Fc===void 0&&(Fc=oe({min:0,max:15}).map(e=>vD[e],e=>{if(typeof e!="string")throw new L("Not a string");if(e.length!==1)throw new L("Invalid length");let t=nn(e,0);if(t<=57)return t-48;if(t<97)throw new L("Invalid character");return t-87})),Fc}function o0(){let e=Ce({unit:xD(),minLength:1,maxLength:4,size:"max"}),t=Me(B(e,e).map(SD,wD),Wd());return Me(B(ae(e,{minLength:6,maxLength:6,size:"max"}),t).map(dD,fD),B(ae(e,{minLength:5,maxLength:5,size:"max"}),t).map(pD,hD),B(ae(e,{minLength:0,maxLength:1,size:"max"}),ae(e,{minLength:4,maxLength:4,size:"max"}),t).map(Ds,_s),B(ae(e,{minLength:0,maxLength:2,size:"max"}),ae(e,{minLength:3,maxLength:3,size:"max"}),t).map(Ds,_s),B(ae(e,{minLength:0,maxLength:3,size:"max"}),ae(e,{minLength:2,maxLength:2,size:"max"}),t).map(Ds,_s),B(ae(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(mD,gD),B(ae(e,{minLength:0,maxLength:5,size:"max"}),t).map(hw,mw),B(ae(e,{minLength:0,maxLength:6,size:"max"}),e).map(hw,mw),B(ae(e,{minLength:0,maxLength:7,size:"max"})).map(yD,bD))}var RD=class extends de{constructor(e){super(),this.name=e,this.underlying=null}generate(e,t){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.generate(e,t)}canShrinkWithoutContext(e){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.canShrinkWithoutContext(e)}shrink(e,t){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.shrink(e,t)}},kD=Object.getOwnPropertyNames;function ED(){let e=new _t;return r=>{let n=Je(e,r);return n!==void 0||(n=new RD(String(r)),ct(e,r,n)),n}}function s0(e){let t=ED(),r=e(t),n=kD(r);for(let i of n){let o=t(i);o.underlying=r[i]}return r}function CD(e,t){for(let r of e){let n=t[r]||{};if(n.maxLength===void 0||n.maxLength>0)return!0}return!1}function AD(e,t){if(e.length===0)return ve([]);if(!CD(e,t))throw new L("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return B(...e.map(r=>ae(ve(r),t[r]))).map(r=>x4(r)).filter(r=>r.length>0)}var gw=Object.assign,Fs=Object.create,a0=Object.defineProperty,yw=Object.getPrototypeOf,ID=Object.prototype;function PD(e){return a0(Fs(null),ft,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function bw(e,t){return PD(`<${Ve(e)}#${t}>`)}function TD(e,t){let r=Fs(ID);for(let n in e){let i=e[n],o=[];for(let s of i){let a=gw(Fs(yw(s)),s);o.push(a)}r[n]=o}for(let n in t){let i=t[n];for(let o=0;o!==i.length;++o){let s=i[o],a=r[n][o];for(let l in s){let u=s[l];a[l]=u.index===void 0?void 0:typeof u.index=="number"?r[u.type][u.index]:G(u.index,c=>r[u.type][c])}a0(a,ft,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[n][o],u=gw(Fs(yw(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?bw(d.type,d.index):G(d.index,p=>bw(d.type,p))}return xe(u)}})}}return r}function MD(e){let t=0,r=new _t;for(let i in e){let o=e[i];for(let s in o){let a=o[s];if(a.arity!=="inverse")continue;let l=Je(r,a.type);if(l===void 0&&(l=new _t,ct(r,a.type,l)),D4(l,a.forwardRelationship))throw new L(`Cannot declare multiple inverse relationships for the same forward relationship ${Ve(a.forwardRelationship)} on type ${Ve(a.type)}`);ct(l,a.forwardRelationship,{type:i,property:s}),t+=1}}let n=new _t;if(t===0)return n;for(let i in e){let o=e[i],s=Je(r,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=Je(s,a);if(u!==void 0){if(u.type!==l.type)throw new L(`Inverse relationship ${Ve(u.property)} on type ${Ve(u.type)} references forward relationship ${Ve(a)} but types do not match`);ct(n,l,u)}}}if(n.size!==t)throw new L("Some inverse relationships could not be matched with their corresponding forward relationships");return n}var Sw=Object.create;function OD(e,t,r){switch(e){case"exclusive":return ve(r);case"successor":return zs(oe({min:t!==void 0?t+1:0,max:r}));case"any":return zs(oe({min:0,max:r}))}}function ND(e,t,r,n,i,o,s){let a=OD(t,r,n);switch(e){case"0-1":return jt(a,{nil:void 0,depthIdentifier:i}).generate(o,s).value;case"1":return a.generate(o,s).value;case"many":{let l=0,u=jt(Rr(a,{depthIdentifier:i,selector:d=>d===n?d+ ++l:d,minLength:1}),{nil:[],depthIdentifier:i}).generate(o,s).value,c=0;return G(u,d=>d===n?d+c++:d)}}}var LD=class extends de{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let r=new rn,n=new rn;for(let i in e){let o=e[i];for(let s in o){let a=o[s];if(a.arity!=="inverse"){if(a.strategy==="exclusive"){if(Ws(r,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);fi(n,a.type)}else{if(Ws(n,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);fi(r,a.type)}if(a.strategy==="successor"&&a.type!==i)throw new L("Cannot mix types for the strategy successor");if(a.strategy==="successor"&&a.arity==="1")throw new L("Cannot use an arity of 1 for the strategy successor")}}}this.inversedRelations=MD(e)}createEmptyLinksInstanceFor(e){let t=Sw(null),r=this.relations[e];for(let n in r){let i=r[n];i.arity==="inverse"&&(t[n]={type:i.type,index:[]})}return t}generate(e,t){let r=Sw(null);for(let o in this.relations)r[o]=[];let n=[];for(let o of this.defaultEntities)$(n,{type:o,indexInType:r[o].length,depth:0}),$(r[o],this.createEmptyLinksInstanceFor(o));let i=-1;for(;++i<n.length;){let o=n[i],s=this.relations[o.type],a=r[o.type][o.indexInType],l=Od();l.depth=o.depth;for(let u in s){let c=s[u];if(c.arity==="inverse")continue;let d=c.type,p=r[d],h=p.length,f=ND(c.arity,c.strategy||"any",d===o.type?o.indexInType:void 0,p.length,l,e,t);a[u]={type:d,index:f};let m=f===void 0?[]:typeof f=="number"?[f]:f;for(let g of m){g>=h&&($(n,{type:d,indexInType:g,depth:o.depth+1}),$(p,this.createEmptyLinksInstanceFor(d)));let S=Je(this.inversedRelations,c);if(S!==void 0){let w=p[g][S.property].index;$(w,o.indexInType)}}}}return n.length=0,new _(r,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function $D(e,t){return new LD(e,t)}var DD=Object.keys,_D=Object.getOwnPropertySymbols,FD=Object.getOwnPropertyDescriptor;function jD(e){let t=DD(e),r=_D(e);for(let n=0;n!==r.length;++n){let i=r[n],o=FD(e,i);o&&o.enumerable&&t.push(i)}return t}var VD=Object.create,BD=Object.defineProperty,UD=Object.getOwnPropertyDescriptor,WD=Object.getOwnPropertyNames,zD=Object.getOwnPropertySymbols;function GD(e,t){return function(n){let i=n[1]?VD(null):{};for(let o=0;o!==e.length;++o){let s=n[0][o];s!==t&&BD(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function HD(e,t){return function(n){if(typeof n!="object"||n===null)throw new Error("Incompatible instance received: should be a non-null object");let i=Object.getPrototypeOf(n)===null,o="constructor"in n&&n.constructor===Object;if(!i&&!o)throw new Error("Incompatible instance received: should be of exact type Object");let s=0,a=[];for(let c=0;c!==e.length;++c){let d=UD(n,e[c]);if(d!==void 0){if(!d.configurable||!d.enumerable||!d.writable)throw new Error("Incompatible instance received: should contain only c/e/w properties");if(d.get!==void 0||d.set!==void 0)throw new Error("Incompatible instance received: should contain only no get/set properties");++s,$(a,d.value)}else $(a,t)}let l=WD(n).length,u=zD(n).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var jc=Symbol("no-key");function Vc(e,t,r){let n=jD(e),i=[];for(let o=0;o!==n.length;++o){let s=n[o],a=e[s];t===void 0||$t(t,s)!==-1?$(i,a):$(i,jt(a,{nil:jc}))}return B(B(...i),r?ve(!1):bi()).map(GD(n,jc),HD(n,jc))}function hd(e,t){let r=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return Vc(e,void 0,r);let n=("requiredKeys"in t?t.requiredKeys:void 0)||[];for(let i=0;i!==n.length;++i){let o=Object.getOwnPropertyDescriptor(e,n[i]);if(o===void 0)throw new Error("requiredKeys cannot reference keys that have not been defined in recordModel");if(!o.enumerable)throw new Error("requiredKeys cannot reference keys that are not enumerable in recordModel")}return Vc(e,n,r)}var qD=Object.create;function KD(e,t,r,n){let i=qD(null);for(let o in e){let s=e[o],a=hd(s,n),l=t(o),u=r(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?Rr(a,{...c,selector:u}):ae(a,c)}return hd(i)}var ww=Object.create,YD=Object.keys;function JD(e,t,r={}){let n=YD(e),i=r.initialPoolConstraints||ww(null),o=r.unicityConstraints||ww(null),s={noNullPrototype:r.noNullPrototype};return AD(n,i).chain(a=>$D(t,a).chain(l=>KD(e,u=>l[u].length,u=>o[u],s).map(u=>TD(u,l))))}function ZD(e){return ce(G(e,t=>t[t.length-1]===","?ge(t,0,t.length-1):t)," ")}function XD(e){return function(r){if(typeof r!="string")throw new Error("Unsupported type");let n=[];for(let i of Be(r," "))if(e.canShrinkWithoutContext(i))$(n,i);else if(e.canShrinkWithoutContext(i+","))$(n,i+",");else throw new Error("Unsupported word");return n}}function QD(e){let t=ce(e," ");return t[t.length-1]===","&&(t=ge(t,0,t.length-1)),Rd(t[0])+ge(t,1)+"."}function e_(e){return function(r){if(typeof r!="string")throw new Error("Unsupported type");if(r.length<2||r[r.length-1]!=="."||r[r.length-2]===","||Rd(Zc(r[0]))!==r[0])throw new Error("Unsupported value");let n=Zc(r[0])+ge(r,1,r.length-1),i=[],o=Be(n," ");for(let s=0;s!==o.length;++s){let a=o[s];if(e.canShrinkWithoutContext(a))$(i,a);else if(s===o.length-1&&e.canShrinkWithoutContext(a+","))$(i,a+",");else throw new Error("Unsupported word")}return i}}function t_(e){return ce(e," ")}function r_(e){if(typeof e!="string")throw new Error("Unsupported type");let t=Be(e,". ");for(let r=0;r<t.length-1;++r)t[r]+=".";return t}var b=(e,t)=>({arbitrary:ve(e),weight:t});function n_(){return Me(b("non",6),b("adipiscing",5),b("ligula",5),b("enim",5),b("pellentesque",5),b("in",5),b("augue",5),b("et",5),b("nulla",5),b("lorem",4),b("sit",4),b("sed",4),b("diam",4),b("fermentum",4),b("ut",4),b("eu",4),b("aliquam",4),b("mauris",4),b("vitae",4),b("felis",4),b("ipsum",3),b("dolor",3),b("amet,",3),b("elit",3),b("euismod",3),b("mi",3),b("orci",3),b("erat",3),b("praesent",3),b("egestas",3),b("leo",3),b("vel",3),b("sapien",3),b("integer",3),b("curabitur",3),b("convallis",3),b("purus",3),b("risus",2),b("suspendisse",2),b("lectus",2),b("nec,",2),b("ultricies",2),b("sed,",2),b("cras",2),b("elementum",2),b("ultrices",2),b("maecenas",2),b("massa,",2),b("varius",2),b("a,",2),b("semper",2),b("proin",2),b("nec",2),b("nisl",2),b("amet",2),b("duis",2),b("congue",2),b("libero",2),b("vestibulum",2),b("pede",2),b("blandit",2),b("sodales",2),b("ante",2),b("nibh",2),b("ac",2),b("aenean",2),b("massa",2),b("suscipit",2),b("sollicitudin",2),b("fusce",2),b("tempus",2),b("aliquam,",2),b("nunc",2),b("ullamcorper",2),b("rhoncus",2),b("metus",2),b("faucibus,",2),b("justo",2),b("magna",2),b("at",2),b("tincidunt",2),b("consectetur",1),b("tortor,",1),b("dignissim",1),b("congue,",1),b("non,",1),b("porttitor,",1),b("nonummy",1),b("molestie,",1),b("est",1),b("eleifend",1),b("mi,",1),b("arcu",1),b("scelerisque",1),b("vitae,",1),b("consequat",1),b("in,",1),b("pretium",1),b("volutpat",1),b("pharetra",1),b("tempor",1),b("bibendum",1),b("odio",1),b("dui",1),b("primis",1),b("faucibus",1),b("luctus",1),b("posuere",1),b("cubilia",1),b("curae,",1),b("hendrerit",1),b("velit",1),b("mauris,",1),b("gravida",1),b("ornare",1),b("ut,",1),b("pulvinar",1),b("varius,",1),b("turpis",1),b("nibh,",1),b("eros",1),b("id",1),b("aliquet",1),b("quis",1),b("lobortis",1),b("consectetuer",1),b("morbi",1),b("vehicula",1),b("tortor",1),b("tellus,",1),b("id,",1),b("eu,",1),b("quam",1),b("feugiat,",1),b("posuere,",1),b("iaculis",1),b("lectus,",1),b("tristique",1),b("mollis,",1),b("nisl,",1),b("vulputate",1),b("sem",1),b("vivamus",1),b("placerat",1),b("imperdiet",1),b("cursus",1),b("rutrum",1),b("iaculis,",1),b("augue,",1),b("lacus",1))}function i_(e={}){let{maxCount:t,mode:r="words",size:n}=e;if(t!==void 0&&t<1)throw new Error("lorem has to produce at least one word/sentence");let i=n_();return r==="sentences"?ae(ae(i,{minLength:1,size:"small"}).map(QD,e_(i)),{minLength:1,maxLength:t,size:n}).map(t_,r_):ae(i,{minLength:1,maxLength:t,size:n}).map(ZD,XD(i))}function o_(e){return new Map(e)}function s_(e){if(typeof e!="object"||e===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in e)||e.constructor!==Map)throw new Error("Incompatible instance received: should be of exact type Map");return Array.from(e)}function a_(e){return e[0]}function md(e,t,r={}){return Rr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:a_,depthIdentifier:r.depthIdentifier,comparator:"SameValueZero"}).map(o_,s_)}var Ts=10;function l_(e){let t={};return(r=>{let n=r!==void 0?r:Ts;if(!r1(t,n)){let i=Ts;Ts=n-1,t[n]=e(n),Ts=i}return t[n]})}function u_(e){let t=0;for(;e>O(0);)e&O(1)&&++t,e>>=O(1);return t}function c_(e,t){let r=(O(1)<<O(t))-O(1),n=e&r,i=u_(e-n),o=n;for(let s=O(1);s<=r&&i!==0;s<<=O(1))o&s||(o|=s,--i);return o}function Ms(e,t){let r=[];for(let n=e.length-1;n!==-1;--n)t(e[n])!==e[n]&&$(r,n);return r}function d_(e,t,r){let n=O(0);for(let i=0,o=O(1);i!==r.length;++i,o<<=O(1))e[r[i]]!==t[r[i]]&&(n|=o);return n}function Bc(e,t,r,n){for(let i=0,o=O(1);i!==r.length;++i,o<<=O(1))t&o&&(e[r[i]]=n(e[r[i]]))}var f_=class extends de{constructor(e,t,r){super(),this.stringArb=e,this.toggleCase=t,this.untoggleAll=r}buildContextFor(e,t){return{rawString:e.value,rawStringContext:e.context,flags:t.value,flagsContext:t.context}}generate(e,t){let r=this.stringArb.generate(e,t),n=[...r.value],i=Ms(n,this.toggleCase),o=rr(O(0),(O(1)<<O(i.length))-O(1)).generate(e,void 0);return Bc(n,o.value,i,this.toggleCase),new _(ce(n,""),this.buildContextFor(r,o))}canShrinkWithoutContext(e){return typeof e!="string"?!1:this.untoggleAll!==void 0?this.stringArb.canShrinkWithoutContext(this.untoggleAll(e)):this.stringArb.canShrinkWithoutContext(e)}shrink(e,t){let r;if(t!==void 0)r=t;else if(this.untoggleAll!==void 0){let o=this.untoggleAll(e),s=[...e],a=[...o];r={rawString:o,rawStringContext:void 0,flags:d_(a,s,Ms(a,this.toggleCase)),flagsContext:void 0}}else r={rawString:e,rawStringContext:void 0,flags:O(0),flagsContext:void 0};let n=r.rawString,i=r.flags;return this.stringArb.shrink(n,r.rawStringContext).map(o=>{let s=[...o.value],a=Ms(s,this.toggleCase),l=c_(i,a.length);return Bc(s,l,a,this.toggleCase),new _(ce(s,""),this.buildContextFor(o,new _(l,void 0)))}).join(er(()=>{let o=[...n],s=Ms(o,this.toggleCase);return rr(O(0),(O(1)<<O(s.length))-O(1)).shrink(i,r.flagsContext).map(a=>{let l=Le(o);return Bc(l,a.value,s,this.toggleCase),new _(ce(l,""),this.buildContextFor(new _(n,r.rawStringContext),a))})}))}};function p_(e){let t=Rd(e);return t!==e?t:Zc(e)}function h_(e,t){return new f_(e,t&&t.toggleCase||p_,t&&t.untoggleAll)}function m_(e){return Yw.from(e)}function g_(e){if(!(e instanceof Yw))throw new Error("Unexpected type");return[...e]}function l0(e={}){return ae(e0(e),e).map(m_,g_)}function y_(e){return Jw.from(e)}function b_(e){if(!(e instanceof Jw))throw new Error("Unexpected type");return[...e]}function u0(e={}){return ae(Ks(e),e).map(y_,b_)}function Vt(e,t,r,n,i){let o=n.name,{min:s=t,max:a=r,...l}=e;if(s>a)throw new Error(`Invalid range passed to ${o}: min must be lower than or equal to max`);if(s<t)throw new Error(`Invalid min value passed to ${o}: min must be greater than or equal to ${t}`);if(a>r)throw new Error(`Invalid max value passed to ${o}: max must be lower than or equal to ${r}`);return ae(i({min:s,max:a}),l).map(u=>n.from(u),u=>{if(!(u instanceof n))throw new Error("Invalid type");return[...u]})}function c0(e={}){return Vt(e,-32768,32767,n4,oe)}function d0(e={}){return Vt(e,-2147483648,2147483647,i4,oe)}function f0(e={}){return Vt(e,-128,127,r4,oe)}function p0(e={}){return Vt(e,0,65535,a4,oe)}function h0(e={}){return Vt(e,0,4294967295,l4,oe)}function m0(e={}){return Vt(e,0,255,o4,oe)}function g0(e={}){return Vt(e,0,255,s4,oe)}function S_(e){return e!==void 0}function vw(e){return e.hasToBeCloned?new _(e.value_,{generatorContext:e.context},()=>e.value):new _(e.value_,{generatorContext:e.context})}function xw(e){return e.hasToBeCloned?new _(e.value_,{shrinkerContext:e.context},()=>e.value):new _(e.value_,{shrinkerContext:e.context})}var w_=class extends de{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return vw(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return S_(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(vw):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(xw):this.shrinkerArbitrary.shrink(e,void 0).map(xw)}};function gd(e,t,r){let n=oe({min:e,max:t});return t===r?n:new w_(n,oe({min:e,max:r}))}var v_=Math.min,yd=Math.max,Rw=qw.isArray,x_=Object.entries;function R_(e){let t=-1;for(let r=0;r!==e.length;++r)t=yd(t,e[r][0]);return t}function k_(e,t){let r=qw(e);for(let n=0;n!==t.length;++n){let i=t[n];i[0]<e&&(r[i[0]]=i[1])}return r}function y0(e,t={}){let{size:r,minNumElements:n=0,maxLength:i=xr,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=mi(r,mi(r,n,o,t.maxNumElements!==void 0),i,t.maxLength!==void 0);if(n>i)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(n>o)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let u=v_(o,i),c=t.maxNumElements!==void 0||r!==void 0?r:"=",d=Rr(B(gd(0,yd(l-1,0),yd(i-1,0)),e),{size:c,minLength:n,maxLength:u,selector:p=>p[0],depthIdentifier:a}).map(p=>k_(R_(p)+1,p),p=>{if(!Rw(p))throw new Error("Not supported entry type");if(s&&p.length!==0&&!(p.length-1 in p))throw new Error("No trailing hole");return G(x_(p),h=>[Number(h[0]),h[1]])});return s||i===n?d:B(d,gd(n,l,i)).map(p=>{let h=p[0],f=p[1];if(h.length>=f)return h;let m=Le(h);return m.length=f,m},p=>{if(!Rw(p))throw new Error("Not supported entry type");return[p,p.length]})}function E_(e){return new Set(e)}function C_(e){if(typeof e!="object"||e===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in e)||e.constructor!==Set)throw new Error("Incompatible instance received: should be of exact type Set");return Array.from(e)}function b0(e,t={}){return Rr(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(E_,C_)}function A_(e,t,r,n,i,o){return $d(e,t,{maxKeys:r,noNullPrototype:!o,size:n,depthIdentifier:i})}function I_(e){return Me(f0(e),m0(e),g0(e),c0(e),p0(e),d0(e),h0(e),l0(e),u0(e))}function S0(e){let t=e.values,r=e.depthSize,n=Od(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Me(...t,...e.withBigInt?[rr()]:[],...e.withDate?[L1()]:[]);return s0(l=>({anything:Me({maxDepth:i,depthSize:r,depthIdentifier:n},a,l("array"),l("object"),...e.withMap?[l("map")]:[],...e.withSet?[l("set")]:[],...e.withObjectString?[l("anything").map(u=>xe(u))]:[],...e.withTypedArray?[I_({maxLength:o,size:s})]:[],...e.withSparseArray?[y0(l("anything"),{maxNumElements:o,size:s,depthIdentifier:n})]:[]),keys:e.withObjectString?Me({arbitrary:e.key,weight:10},{arbitrary:l("anything").map(u=>xe(u)),weight:1}):e.key,array:ae(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),set:b0(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),map:Me(md(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n}),md(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n})),object:A_(l("keys"),l("anything"),o,s,n,e.withNullPrototype)})).anything}function P_(e){switch(typeof e){case"boolean":return new Kw(e);case"number":return new Dt(e);case"string":return new Ve(e);default:return e}}function T_(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===Kw||e.constructor===Dt||e.constructor===Ve?e.valueOf():e}function M_(e){return e.map(P_,T_)}function O_(e,t){return[bi(),n0(),Ks(),t(e),Me(t(e),ve(null),ve(void 0))]}function N_(e){return e.map(t=>M_(t))}function L_(e,t){return t?N_(e).concat(e):e}function w0(e={}){let t={size:e.size,unit:"stringUnit"in e?e.stringUnit:e.withUnicodeString?"binary":void 0};return{key:e.key!==void 0?e.key:Ce(t),values:L_(e.values!==void 0?e.values:O_(t,Ce),e.withBoxedValues===!0),depthSize:e.depthSize,maxDepth:e.maxDepth,maxKeys:e.maxKeys,size:e.size,withSet:e.withSet===!0,withMap:e.withMap===!0,withObjectString:e.withObjectString===!0,withNullPrototype:e.withNullPrototype===!0,withBigInt:e.withBigInt===!0,withDate:e.withDate===!0,withTypedArray:e.withTypedArray===!0,withSparseArray:e.withSparseArray===!0}}function $_(e){return $d(e.key,S0(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function D_(e){return $_(w0(e))}function __(e,t){let{depthSize:r,maxDepth:n}=t;return{key:e,values:[bi(),Ks({noDefaultInfinity:!0,noNaN:!0}),e,ve(null)],depthSize:r,maxDepth:n}}function v0(e){return S0(w0(e))}function x0(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return v0(__("stringUnit"in e?Ce({unit:e.stringUnit}):t?Ce():Ce({unit:"binary"}),e))}var F_=JSON.stringify,j_=JSON.parse;function V_(e){if(typeof e!="string")throw new L("Cannot unmap the passed value");return j_(e)}function B_(e={}){return x0(e).map(F_,V_)}var U_=Object.defineProperties;function Uc(e,t){return`Stream(${t!==void 0?`${ce(t,",")}\u2026`:`${e} emitted`})`}var W_=class extends de{constructor(e,t){super(),this.arb=e,this.history=t}generate(e,t){let r=t!==void 0&&e.nextInt(1,t)===1?t:void 0,n=()=>{let i=this.history?[]:null,o=0,s=function*(a,l){for(;;){let u=a.generate(l,r).value;o++,i!==null&&$(i,u),yield u}};return U_(new j(s(this.arb,e.clone())),{toString:{value:()=>Uc(o,i!==null?i.map(xe):void 0)},[ft]:{value:()=>Uc(o,i!==null?i.map(xe):void 0)},[Ft]:{value:async()=>Uc(o,i!==null?await Promise.all(i.map(Id)):void 0)},[Oe]:{value:n,enumerable:!0}})};return new _(n(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function z_(e,t){return new W_(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function G_(e){return ce(e,"")}function kw(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function H_(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return ge(e,1)}}function q_(e){if(typeof e!="string"||e.length%4!==0)throw new Error("Invalid string received");let t=e.indexOf("=");if(t===-1)return e;if(e.length-t>2)throw new Error("Cannot unmap the passed value");return ge(e,0,t)}var Wc=String.fromCharCode;function K_(e){return e<26?Wc(e+65):e<52?Wc(e+97-26):e<62?Wc(e+48-52):e===62?"+":"/"}function Y_(e){if(typeof e!="string"||e.length!==1)throw new L("Invalid entry");let t=nn(e,0);return t>=65&&t<=90?t-65:t>=97&&t<=122?t-97+26:t>=48&&t<=57?t-48+52:t===43?62:t===47?63:-1}function J_(){return oe({min:0,max:63}).map(K_,Y_)}function Z_(e={}){let{minLength:t=0,maxLength:r=xr,size:n}=e,i=t+3-(t+3)%4,o=r-r%4,s=e.maxLength===void 0&&n===void 0?"=":n;if(i>o)throw new L("Minimal length should be inferior or equal to maximal length");if(i%4!==0)throw new L("Minimal length of base64 strings must be a multiple of 4");if(o%4!==0)throw new L("Maximal length of base64 strings must be a multiple of 4");let a=J_();return ae(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:OL(a,kw)}).map(G_,kw).map(H_,q_)}var Ew=Object.is;function X_(e,t){let r=new _t,n=0;for(let i of e)Ew(i,-0)?++n:ct(r,i,(Je(r,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(Ew(o,-0)){if(n===0)return!1;--n}else{let s=Je(r,o)||0;if(s===0)return!1;ct(r,o,s-1)}}return!0}var Q_=Math.floor,Cw=Math.log,e7=Array.isArray,R0=class extends de{constructor(e,t,r,n){if(super(),this.originalArray=e,this.isOrdered=t,this.minLength=r,this.maxLength=n,r<0||r>e.length)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be between 0 and the size of the original array");if(n<0||n>e.length)throw new Error("fc.*{s|S}ubarrayOf expects the maximal length to be between 0 and the size of the original array");if(r>n)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new sn(r,n),this.biasedLengthArb=r!==n?new sn(r,r+Q_(Cw(n-r)/Cw(2))):this.lengthArb}generate(e,t){let r=(t!==void 0&&e.nextInt(1,t)===1?this.biasedLengthArb:this.lengthArb).generate(e,void 0),n=r.value,i=G(this.originalArray,(s,a)=>a),o=[];for(let s=0;s!==n;++s){let a=e.nextInt(0,i.length-1);$(o,i[a]),Qw(i,a,1)}return this.isOrdered&&e1(o,(s,a)=>s-a),new _(G(o,s=>this.originalArray[s]),r.context)}canShrinkWithoutContext(e){return!e7(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:X_(this.originalArray,e)}shrink(e,t){return e.length===0?j.nil():this.lengthArb.shrink(e.length,t).map(r=>new _(Le(e,e.length-r.value),r.context)).join(e.length>this.minLength?er(()=>this.shrink(Le(e,1),void 0).filter(r=>this.minLength<=r.value.length+1).map(r=>new _([e[0],...r.value],void 0))):j.nil())}};function t7(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new R0(e,!0,r,n)}function r7(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new R0(e,!1,r,n)}var n7={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"},i7={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 o7(e){return e<10?Ve(e):n7[e]}function Aw(e,t){let r="";for(;e.length+r.length<t;)r+="0";return r+e}function Iw(e){let t="";for(let r=e;r!==0;){let n=r>>5;t=o7(r-(n<<5))+t,r=n}return t}function s7(e,t){let r=~~(e/1073741824),n=e&1073741823;return Aw(Iw(r),t-6)+Aw(Iw(n),6)}function k0(e){return function(r){return s7(r,e)}}function zc(e){if(typeof e!="string")throw new L("Unsupported type");let t=0,r=1;for(let n=e.length-1;n>=0;--n){let i=i7[e[n]];if(i===void 0)throw new L("Unsupported type");t+=i*r,r*=32}return t}var a7=k0(10),Pw=k0(8);function l7(e){return a7(e[0])+Pw(e[1])+Pw(e[2])}function u7(e){if(typeof e!="string"||e.length!==26)throw new Error("Unsupported type");return[zc(e.slice(0,10)),zc(e.slice(10,18)),zc(e.slice(18))]}function c7(){return B(oe({min:0,max:0xffffffffffff}),oe({min:0,max:0xffffffffff}),oe({min:0,max:0xffffffffff})).map(l7,u7)}function E0(e){return Y4(pi(e,16),8,"0")}function d7(e){if(typeof e!="string")throw new Error("Unsupported type");if(e.length!==8)throw new Error("Unsupported value: invalid length");let t=parseInt(e,16);if(e!==E0(t))throw new Error("Unsupported value: invalid content");return t}function Gc(e,t){return oe({min:e,max:t}).map(E0,d7)}function f7(e){return`${e[0]}-${ge(e[1],4)}-${ge(e[1],0,4)}-${ge(e[2],0,4)}-${ge(e[2],4)}${e[3]}`}var p7=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function h7(e){if(typeof e!="string")throw new Error("Unsupported type");let t=p7.exec(e);if(t===null)throw new Error("Unsupported type");return[t[1],t[3]+t[2],t[4]+ge(t[5],0,4),ge(t[5],4)]}var Tw="0123456789abcdef";function m7(e){let t={},r={};for(let o=0;o!==e.length;++o){let s=Tw[o],a=Tw[e[o]];t[s]=a,r[a]=s}function n(o){return t[o[0]]+ge(o,1)}function i(o){if(typeof o!="string")throw new L("Cannot produce non-string values");let s=r[o[0]];if(s===void 0)throw new L("Cannot produce strings not starting by the version in hexa code");return s+ge(o,1)}return{versionsApplierMapper:n,versionsApplierUnmapper:i}}function g7(e){let t={};for(let r of e){if(t[r])throw new L(`Version ${r} has been requested at least twice for uuid`);if(t[r]=!0,r<1||r>15)throw new L(`Version must be a value in [1-15] for uuid, but received ${r}`);if(~~r!==r)throw new L(`Version must be an integer value for uuid, but received ${r}`)}if(e.length===0)throw new L("Must provide at least one version for uuid")}function y7(e={}){let t=Gc(0,4294967295),r=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];g7(r);let{versionsApplierMapper:n,versionsApplierUnmapper:i}=m7(r);return B(t,Gc(0,268435456*r.length-1).map(n,i),Gc(2147483648,3221225471),t).map(f7,h7)}function b7(e){return Ce({unit:Fd("-._~!$&'()*+,;=:"),size:e})}function S7([e,t,r]){return(e===null?"":`${e}@`)+t+(r===null?"":`:${r}`)}function w7(e){if(typeof e!="string")throw new Error("Unsupported");let t=e.indexOf("@"),r=t!==-1?e.substring(0,t):null,n=/:(\d+)$/.exec(e),i=n!==null?Number(n[1]):null;return[r,n!==null?e.substring(t+1,e.length-n[1].length-1):e.substring(t+1),i]}function v7(e){return`[${e}]`}function x7(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function C0(e){let t=e||{},r=t.size,n=[jd({size:r}),...t.withIPv4===!0?[Wd()]:[],...t.withIPv6===!0?[o0().map(v7,x7)]:[],...t.withIPv4Extended===!0?[i0()]:[]];return B(t.withUserInfo===!0?jt(b7(r)):ve(null),Me(...n),t.withPort===!0?jt(Qt(65535)):ve(null)).map(S7,w7)}function A0(e){return Ce({unit:Fd("-._~!$&'()*+,;=:@/?"),size:e})}function I0(e={}){return A0(e.size)}function P0(e={}){return Ce({unit:Fd("-._~!$&'()*+,;=:@"),size:e.size})}function R7(e){return ce(G(e,t=>`/${t}`),"")}function k7(e){if(typeof e!="string")throw new Error("Incompatible value received: type");if(e.length!==0&&e[0]!=="/")throw new Error("Incompatible value received: start");return Qw(Be(e,"/"),1)}function E7(e){switch(e){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 Hc(e,t){return ae(P0({size:e}),{size:t}).map(R7,k7)}function C7(e){let[t,r]=E7(e);return t===r?Hc(t,r):Me(Hc(t,r),Hc(r,t))}function T0(e){return C7(Ld((e||{}).size))}function M0(e={}){return A0(e.size)}function A7(e){let[t,r,n]=e;return`${t}://${r}${n}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var I7=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function P7(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=I7.exec(e);if(t===null)throw new Error("Incompatible value received");let r=t[1],n=t[2],i=t[3],o=t[4],s=t[5];return[r,n,i,o!==void 0?o.substring(1):null,s!==void 0?s.substring(1):null]}function T7(e){let t=e||{},r=Ld(t.size),n=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?yi(t.authoritySettings.size,r):r,i={...t.authoritySettings,size:n};return B(vt(...t.validSchemes||["http","https"]),C0(i),T0({size:r}),t.withQueryParameters===!0?jt(M0({size:r})):ve(null),t.withFragments===!0?jt(I0({size:r})):ve(null)).map(A7,P7)}var M7=class O0{constructor(t,r){this.commands=t,this.metadataForReplay=r,this[Oe]=function(){return new O0(this.commands.map(n=>n.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let t=this.commands.filter(n=>n.hasRan).map(n=>n.toString()).join(","),r=this.metadataForReplay();return r.length!==0?`${t} /*${r}*/`:t}},O7=class bd{constructor(t){if(this.cmd=t,this.hasRan=!1,Cd(t)){let r=t[ft];this[ft]=function(){return r.call(t)}}if(Ad(t)){let r=t[Ft];this[Ft]=function(){return r.call(t)}}}check(t){return this.cmd.check(t)}run(t,r){return this.hasRan=!0,this.cmd.run(t,r)}clone(){return vr(this.cmd)?new bd(this.cmd[Oe]()):new bd(this.cmd)}toString(){return this.cmd.toString()}},Mw=class{static parse(e){let[t,r]=e.split(":"),n=this.parseCounts(t),i=this.parseChanges(r);return this.parseOccurences(n,i)}static stringify(e){let t=this.countOccurences(e);return`${this.stringifyCounts(t)}:${this.stringifyChanges(t)}`}static intToB64(e){return e<26?String.fromCharCode(e+65):e<52?String.fromCharCode(e+97-26):e<62?String.fromCharCode(e+48-52):String.fromCharCode(e===62?43:47)}static b64ToInt(e){return e>="a"?e.charCodeAt(0)-97+26:e>="A"?e.charCodeAt(0)-65:e>="0"?e.charCodeAt(0)-48+52:e==="+"?62:63}static countOccurences(e){return e.reduce((t,r)=>(t.length===0||t[t.length-1].count===64||t[t.length-1].value!==r?t.push({value:r,count:1}):t[t.length-1].count+=1,t),[])}static parseOccurences(e,t){let r=[];for(let n=0;n!==e.length;++n){let i=e[n],o=t[n];for(let s=0;s!==i;++s)r.push(o)}return r}static stringifyChanges(e){let t="";for(let r=0;r<e.length;r+=6){let n=e.slice(r,r+6).reduceRight((i,o)=>(i<<1)+(o.value?1:0),0);t+=this.intToB64(n)}return t}static parseChanges(e){let t=e.split("").map(n=>this.b64ToInt(n)),r=[];for(let n=0;n!==t.length;++n){let i=t[n];for(let o=0;o!==6;++o,i>>=1)r.push(i%2===1)}return r}static stringifyCounts(e){return e.map(({count:t})=>this.intToB64(t-1)).join("")}static parseCounts(e){return e.split("").map(t=>this.b64ToInt(t)+1)}},N7=class extends de{constructor(e,t,r,n,i){super(),this.sourceReplayPath=n,this.disableReplayLog=i,this.oneCommandArb=Me(...e).map(o=>new O7(o)),this.lengthArb=gd(0,t,r),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(Mw.stringify(this.replayPath))}`}buildValueFor(e,t){let r=e.map(i=>i.value_),n={shrunkOnce:t,items:e};return new _(new M7(r,()=>this.metadataForReplay()),n)}generate(e){let t=this.lengthArb.generate(e,void 0).value,r=Array(t);for(let n=0;n!==t;++n)r[n]=this.oneCommandArb.generate(e,void 0);return this.replayPathPosition=0,this.buildValueFor(r,!1)}canShrinkWithoutContext(e){return!1}filterOnExecution(e){let t=[];for(let r of e)r.value_.hasRan?(this.replayPath.push(!0),t.push(r)):this.replayPath.push(!1);return t}filterOnReplay(e){return e.filter((t,r)=>{let n=this.replayPath[this.replayPathPosition+r];if(n===void 0)throw new Error("Too short replayPath");if(!n&&t.value_.hasRan)throw new Error("Mismatch between replayPath and real execution");return n})}filterForShrinkImpl(e){this.replayPathPosition===0&&(this.replayPath=this.sourceReplayPath!==null?Mw.parse(this.sourceReplayPath):[]);let t=this.replayPathPosition<this.replayPath.length?this.filterOnReplay(e):this.filterOnExecution(e);return this.replayPathPosition+=e.length,t}shrink(e,t){if(t===void 0)return j.nil();let r=t,n=r.shrunkOnce,i=r.items,o=this.filterForShrinkImpl(i);if(o.length===0)return j.nil();let s=n?j.nil():new j([[]][Symbol.iterator]()),a=[];for(let l=0;l!==o.length;++l)a.push(er(()=>{let u=o.slice(0,l);return this.lengthArb.shrink(o.length-1-l,void 0).map(c=>u.concat(o.slice(o.length-(c.value+1))))}));for(let l=0;l!==o.length;++l)a.push(er(()=>this.oneCommandArb.shrink(o[l].value_,o[l].context).map(u=>o.slice(0,l).concat([u],o.slice(l+1)))));return s.join(...a).map(l=>this.buildValueFor(l.map(u=>new _(u.value_.clone(),u.context)),!0))}};function L7(e,t={}){let{size:r,maxCommands:n=xr,disableReplayLog:i=!1,replayPath:o=null}=t;return new N7(e,mi(r,0,n,t.maxCommands!==void 0),n,o,i)}var $7=class{constructor(e,t){this.s=e,this.cmd=t}async check(e){let t=null,r=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{r=await Promise.resolve(this.cmd.check(e))}catch(n){throw t=n,n}}}]).task).faulty)throw t;return r}async run(e,t){let r=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(e,t)}catch(n){throw r=n,n}}}]).task).faulty)throw r}},D7=function*(e,t){for(let r of t)yield new $7(e,r)},N0=(e,t,r,n,i)=>e.then(o=>{let{model:s,real:a}=o,l=r;for(let u of t)l=i(l,()=>n(u,s,a));return l}),_7=(e,t)=>N0({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),F7=e=>typeof e.then=="function",L0=async(e,t,r=Promise.resolve())=>await N0({then:s=>{let a=e();return F7(a)?a.then(s):s(a)}},t,r,async(s,a,l)=>{await s.check(a)&&await s.run(a,l)},(s,a)=>s.then(a));function j7(e,t){_7(e,t)}async function V7(e,t){await L0(e,t)}async function B7(e,t,r){let n=L0(t,D7(e,r),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(n),await e.waitAll()}var Os=e=>e(),$0=class Sd{constructor(t,r){this.act=t,this.taskSelector=r,this.lastTaskId=0,this.sourceTaskSelector=r.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Oe]=function(){return new Sd(this.act,this.sourceTaskSelector)}}static buildLog(t){return`[task\${${t.taskId}}] ${t.label.length!==0?`${t.schedulingType}::${t.label}`:t.schedulingType} ${t.status}${t.outputValue!==void 0?` with value ${G$(t.outputValue)}`:""}`}log(t,r,n,i,o,s){this.triggeredTasks.push({status:o,schedulingType:t,taskId:r,label:n,metadata:i,outputValue:s!==void 0?xe(s):void 0})}scheduleInternal(t,r,n,i,o,s){let a=++this.lastTaskId,l,u=new Promise((c,d)=>{l=()=>{let p=Promise.resolve(s!==void 0?n.then(()=>s()):n);return p.then(h=>{this.log(t,a,r,i,"resolved",h),c(h)},h=>{this.log(t,a,r,i,"rejected",h),d(h)}),p}});return this.scheduledTasks.push({original:n,trigger:l,schedulingType:t,taskId:a,label:r,metadata:i,customAct:o}),this.scheduledWatchers.length!==0&&this.scheduledWatchers[0](),u}schedule(t,r,n,i){return this.scheduleInternal("promise",r||"",t,n,i||Os)}scheduleFunction(t,r){return(...n)=>this.scheduleInternal("function",`${t.name}(${n.map(xe).join(",")})`,t(...n),void 0,r||Os)}scheduleSequence(t,r){let n={done:!1,faulty:!1},i={then:c=>c()},o=()=>{},s=new Promise(c=>{o=()=>c({done:n.done,faulty:n.faulty})}),a=()=>{n.faulty=!0,o()},l=()=>{n.done=!0,o()},u=(c,d)=>{if(c>=t.length){d.then(l,a);return}d.then(()=>{let p=t[c],[h,f,m]=typeof p=="function"?[p,p.name,void 0]:[p.builder,p.label,p.metadata],g=this.scheduleInternal("sequence",f,i,m,r||Os,()=>h());u(c+1,g)},a)};return u(0,i),Object.assign(n,{task:s})}count(){return this.scheduledTasks.length}internalWaitOne(){if(this.scheduledTasks.length===0)throw new Error("No task scheduled");let t=this.taskSelector.nextTaskIndex(this.scheduledTasks),[r]=this.scheduledTasks.splice(t,1);return r.customAct(()=>r.trigger().catch(n=>{}))}waitOne(t){let r=t||Os;return this.act(()=>r(()=>this.internalWaitOne()))}async waitAll(t){for(;this.scheduledTasks.length>0;)await this.waitOne(t)}async internalWaitFor(t,r){let n=!1,i=r.customAct,o=r.onWaitStart,s=r.onWaitIdle,a=r.launchAwaiterOnInit,l,u,c=0,d=null,p=null,h=async()=>{for(c=50,c=50;!n&&c>0;--c)await Promise.resolve();if(!n&&this.scheduledTasks.length>0)return o!==void 0&&o(),p=this.waitOne(i),p.then(()=>(p=null,h()),S=>{throw p=null,n=!0,u(S),S});!n&&s!==void 0&&s(),d=null},f=()=>{if(d!==null){c=51;return}d=h().catch(()=>{})},m=()=>{let S=this.scheduledWatchers.indexOf(f);S!==-1&&this.scheduledWatchers.splice(S,1),S===0&&this.scheduledWatchers.length!==0&&this.scheduledWatchers[0]()},g=new Promise((S,w)=>{l=y=>{m(),S(y)},u=y=>{m(),w(y)}});return t.then(S=>{n=!0,p===null?l(S):p.then(()=>l(S),w=>u(w))},S=>{n=!0,p===null?u(S):p.then(()=>u(S),()=>u(S))}),(this.scheduledTasks.length>0||a)&&this.scheduledWatchers.length===0&&f(),this.scheduledWatchers.push(f),g}waitNext(t,r){let n,i=t,o=i<=0?Promise.resolve():new Promise(s=>{n=()=>{--i<=0&&s()}});return this.internalWaitFor(o,{customAct:r,onWaitStart:n,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(t){let r,n=new Promise(i=>r=i);return this.internalWaitFor(n,{customAct:t,onWaitStart:void 0,onWaitIdle:r,launchAwaiterOnInit:!0})}waitFor(t,r){return this.internalWaitFor(t,{customAct:r,onWaitStart:void 0,onWaitIdle:void 0,launchAwaiterOnInit:!1})}report(){return[...this.triggeredTasks,...this.scheduledTasks.map(t=>({status:"pending",schedulingType:t.schedulingType,taskId:t.taskId,label:t.label,metadata:t.metadata}))]}toString(){return"schedulerFor()`\n"+this.report().map(Sd.buildLog).map(t=>`-> ${t}`).join(`
132
- `)+"`"}};function D0(e){let t=0;return{clone:()=>D0(e),nextTaskIndex:r=>{if(e.length<=t)throw new Error("Invalid schedulerFor defined: too many tasks have been scheduled");let n=r.findIndex(i=>i.taskId===e[t]);if(n===-1)throw new Error("Invalid schedulerFor defined: unable to find next task");return++t,n}}}function Ow(e,t){return new $0(e,D0(t))}function _0(e){let t=e.clone();return{clone:()=>_0(t),nextTaskIndex:r=>e.nextInt(0,r.length-1)}}var U7=class extends de{constructor(e){super(),this.act=e}generate(e,t){return new _(new $0(this.act,_0(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function W7(e){let{act:t=r=>r()}=e||{};return new U7(t)}function z7(e,t){let{act:r=n=>n()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?Ow(r,e):function(n,...i){return Ow(r,i)}}function G7(e={}){return Vt(e,O("-9223372036854775808"),O("9223372036854775807"),e4,rr)}function H7(e={}){return Vt(e,O(0),O("18446744073709551615"),t4,rr)}function q7(e,t){return t}var qc=Math.floor,K7=Math.min;function et(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let r=et(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:r.astNode},minLength:0}}case"+":{let r=et(e.expression,t),n=r.minLength>1?r.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:qc(t/n)},expression:r.astNode},minLength:r.minLength}}case"?":{let r=et(e.expression,t);return t<r.minLength?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:0},expression:r.astNode},minLength:0}:{astNode:{...e,expression:r.astNode},minLength:0}}case"Range":{let r=e.quantifier.from>1?qc(t/e.quantifier.from):t,n=et(e.expression,r),i=n.minLength>1?n.minLength:1;return e.quantifier.to===void 0||e.quantifier.to*i>t?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",to:qc(t/i)},expression:n.astNode},minLength:e.quantifier.from*n.minLength}:{astNode:{...e,expression:n.astNode},minLength:e.quantifier.from*n.minLength}}default:return q7(e.quantifier,{astNode:e,minLength:0})}case"Quantifier":return{astNode:e,minLength:0};case"Alternative":{let r=0,n=[];for(let o=0;o!==e.expressions.length;++o){let s=t-r,a=et(e.expressions[o],s);r+=a.minLength,$(n,{value:a,allowance:s})}let i=[];for(let o=0;o!==n.length;++o){let s=n[o].value,a=n[o].allowance,l=t-r+s.minLength;$(i,(l!==a?et(s.astNode,l):s).astNode)}return{astNode:{...e,expressions:i},minLength:r}}case"CharacterClass":return{astNode:e,minLength:1};case"ClassRange":return{astNode:e,minLength:1};case"Group":{let r=et(e.expression,t);return{astNode:{...e,expression:r.astNode},minLength:r.minLength}}case"Disjunction":{if(e.left===null){if(e.right===null)return{astNode:e,minLength:0};let i=et(e.right,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:null,right:o},minLength:0}}if(e.right===null){let i=et(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let r=et(e.left,t),n=et(e.right,t);return r.minLength>t?n:n.minLength>t?r:{astNode:{...e,left:r.astNode,right:n.astNode},minLength:K7(r.minLength,n.minLength)}}case"Assertion":return{astNode:e,minLength:0};case"Backreference":return{astNode:e,minLength:0};case"UnicodeProperty":return{astNode:e,minLength:1}}}function Y7(e,t){return et(e,t).astNode}function J7(e){return new Error(`Unsupported AST node! Received: ${xe(e)}`)}function js(e,t,r){if(!t&&!r)return e;let n={hasStart:!1,hasEnd:!1},i=F0(e,t,r,n),o=t&&!n.hasStart,s=r&&!n.hasEnd;if(!o&&!s)return i;let a=[];return o&&(a.push({type:"Assertion",kind:"^"}),a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}})),a.push(i),s&&(a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}}),a.push({type:"Assertion",kind:"$"})),{type:"Group",capturing:!1,expression:{type:"Alternative",expressions:a}}}function F0(e,t,r,n){switch(e.type){case"Char":return e;case"Repetition":return e;case"Quantifier":throw new Error("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return n.hasStart=!0,n.hasEnd=!0,{...e,expressions:e.expressions.map((i,o)=>js(i,t&&o===0,r&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:F0(e.expression,t,r,n)};case"Disjunction":return n.hasStart=!0,n.hasEnd=!0,{...e,left:e.left!==null?js(e.left,t,r):null,right:e.right!==null?js(e.right,t,r):null};case"Assertion":if(e.kind==="^"||e.kind==="Lookahead")return n.hasStart=!0,e;if(e.kind==="$"||e.kind==="Lookbehind")return n.hasEnd=!0,e;throw new Error(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":return e;case"UnicodeProperty":return e;default:throw J7(e)}}function Z7(e){return js(e,!0,!0)}function Nw(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Ee(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function wd(e){return e>="0"&&e<="9"}function j0(e,t){for(let r=t;r!==e.length;++r){let n=e[r];if(n==="\\")r+=1;else if(n==="]")return r}throw new Error("Missing closing ']'")}function X7(e,t){let r=0;for(let n=t;n!==e.length;++n){let i=e[n];if(i==="\\")n+=1;else if(i===")"){if(r===0)return n;r-=1}else i==="["?n=j0(e,n):i==="("&&(r+=1)}throw new Error("Missing closing ')'")}function Q7(e,t){let r=!1;for(let n=t;n!==e.length;++n){let i=e[n];if(!wd(i)){if(t===n)return-1;if(i===","){if(r)return-1;r=!0}else return i==="}"?n:-1}}return-1}function e8(e,t,r,n){switch(e[t]){case"[":return n===1?t+1:j0(e,t+1)+1;case"{":{if(n===1)return t+1;let i=Q7(e,t+1);return i===-1?t+1:i+1}case"(":return n===1?t+1:X7(e,t+1)+1;case"]":case"}":case")":return t+1;case"\\":{let i=e[t+1];switch(i){case"x":if(Ee(e[t+2])&&Ee(e[t+3]))return t+4;throw new Error(`Unexpected token '${e.substring(t,t+4)}' found`);case"u":if(e[t+2]==="{"){if(!r)return t+2;if(e[t+4]==="}"){if(Ee(e[t+3]))return t+5;throw new Error(`Unexpected token '${e.substring(t,t+5)}' found`)}if(e[t+5]==="}"){if(Ee(e[t+3])&&Ee(e[t+4]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`)}if(e[t+6]==="}"){if(Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5]))return t+7;throw new Error(`Unexpected token '${e.substring(t,t+7)}' found`)}if(e[t+7]==="}"){if(Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5])&&Ee(e[t+6]))return t+8;throw new Error(`Unexpected token '${e.substring(t,t+8)}' found`)}if(e[t+8]==="}"&&Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5])&&Ee(e[t+6])&&Ee(e[t+7]))return t+9;throw new Error(`Unexpected token '${e.substring(t,t+9)}' found`)}if(Ee(e[t+2])&&Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`);case"p":case"P":{if(!r)return t+2;let o=t+2;for(;o<e.length&&e[o]!=="}";o+=e[o]==="\\"?2:1);if(e[o]!=="}")throw new Error("Invalid \\P definition");return o+1}case"k":{let o=t+2;for(;o<e.length&&e[o]!==">";++o);if(e[o]!==">"){if(!r)return t+2;throw new Error("Invalid \\k definition")}return o+1}default:if(wd(i)){let o=r?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&wd(e[s]);++s);return s}return t+(r?Nw(e,t+1):1)+1}}default:return t+(r?Nw(e,t):1)}}function Ns(e,t,r,n){let i=e8(e,t,r,n);return e.substring(t,i)}var Lw={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},Ys={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"},gi=qd(Ys),Hd={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"},vd=qd(Hd),V0={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"},$w=qd(V0);function qd(e){let t={};for(let r of Object.keys(e)){let n=e[r];if(Array.isArray(n))for(let i=0;i!==n.length;++i)t[n[i]]=r;else t[n]=r}return t}function t8(e){return e in Hd||e in vd}function r8(e){return e in Ys||e in gi}function Dw(e){if(e in Lw)return Lw[e];if(e in gi)return gi[e];if(e in Ys||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function _w(e){if(e in vd)return vd[e];if(e in $w)return $w[e];if(e in gi)return gi[e];if(e in Hd||e in V0||e in Ys)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function n8(e,t){let r=e.indexOf("=");if(r!==-1){let n=e.substring(0,r),i=e.substring(r+1);return{type:"UnicodeProperty",name:n,value:i,negative:t,shorthand:!1,binary:!1,canonicalName:Dw(n),canonicalValue:_w(i)}}if(t8(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:_w(e)};if(r8(e)){let n=Dw(e);return{type:"UnicodeProperty",name:e,value:e,negative:t,shorthand:!1,binary:!0,canonicalName:n,canonicalValue:n}}throw new Error(`Invalid Unicode property: ${e}`)}var Kc=String.fromCodePoint;function Yc(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function B0(e){return e>="0"&&e<="9"}function Vs(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function Qr(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function Zt(e,t){if(e.length>1)return{type:"Alternative",expressions:e};if(!t&&e.length===0)throw new Error("Unsupported no token");return e[0]}function Jc(e){if(e[0]==="\\"){let t=e[1];switch(t){case"x":{let r=e.substring(2),n=Number.parseInt(r,16);return{type:"Char",kind:"hex",symbol:Kc(n),value:e,codePoint:n}}case"u":{if(e==="\\u")return Vs("u",!0);let r=e[2]==="{"?e.substring(3,e.length-1):e.substring(2),n=Number.parseInt(r,16);return{type:"Char",kind:"unicode",symbol:Kc(n),value:e,codePoint:n}}case"0":return Qr(e,"\0");case"n":return Qr(e,`
133
- `);case"f":return Qr(e,"\f");case"r":return Qr(e,"\r");case"t":return Qr(e," ");case"v":return Qr(e,"\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:e,codePoint:NaN};default:if(B0(t)){let r=e.substring(1),n=Number(r);return{type:"Char",kind:"decimal",symbol:Kc(n),value:e,codePoint:n}}if(e.length>2&&(t==="p"||t==="P")){let r=t==="P";return n8(e.substring(3,e.length-1),r)}return Vs(e.substring(1),!0)}}return Vs(e)}function en(e,t,r,n){let i=null;for(let o=0,s=Ns(t,o,r,0);o!==t.length;o+=s.length,s=Ns(t,o,r,0)){let a=s[0];switch(a){case"|":i===null&&(i=[]),i.push(Zt(e.splice(0),!0)||null);break;case".":e.push({type:"Char",kind:"meta",symbol:s,value:s,codePoint:NaN});break;case"*":case"+":{let l=Yc(e);e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"?":{let l=Yc(e);l.type==="Repetition"?(l.quantifier.greedy=!1,e.push(l)):e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"{":{if(s==="{"){e.push(Vs(s));break}let l=Yc(e),u=s.substring(1,s.length-1).split(","),c=Number(u[0]),d=u.length===1?c:u[1].length!==0?Number(u[1]):void 0;e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:"Range",greedy:!0,from:c,to:d}});break}case"[":{let l=s.substring(1,s.length-1),u=[],c,d=!1;for(let p=0,h=Ns(l,p,r,1);p!==l.length;p+=h.length,h=Ns(l,p,r,1)){if(p===0&&h==="^"){c=!0;continue}let f=Jc(h);if(h==="-")u.push(f),d=!0;else{let m=u.length>=2?u[u.length-2]:void 0;d&&m!==void 0&&m.type==="Char"&&f.type==="Char"?(u.pop(),u.pop(),u.push({type:"ClassRange",from:m,to:f})):u.push(f),d=!1}}e.push({type:"CharacterClass",expressions:u,negative:c});break}case"(":{let l=s.substring(1,s.length-1),u=[];if(l[0]==="?")if(l[1]===":")en(u,l.substring(2),r,n),e.push({type:"Group",capturing:!1,expression:Zt(u)});else if(l[1]==="="||l[1]==="!")en(u,l.substring(2),r,n),e.push({type:"Assertion",kind:"Lookahead",negative:l[1]==="!"?!0:void 0,assertion:Zt(u)});else if(l[1]==="<"&&(l[2]==="="||l[2]==="!"))en(u,l.substring(3),r,n),e.push({type:"Assertion",kind:"Lookbehind",negative:l[2]==="!"?!0:void 0,assertion:Zt(u)});else{let c=l.split(">");if(c.length<2||c[0][1]!=="<")throw new Error(`Unsupported regex content found at ${JSON.stringify(s)}`);let d=++n.lastIndex,p=c[0].substring(2);n.named.set(p,d),en(u,c.slice(1).join(">"),r,n),e.push({type:"Group",capturing:!0,nameRaw:p,name:p,number:d,expression:Zt(u)})}else{let c=++n.lastIndex;en(u,l,r,n),e.push({type:"Group",capturing:!0,number:c,expression:Zt(u)})}break}default:if(s==="^")e.push({type:"Assertion",kind:s});else if(s==="$")e.push({type:"Assertion",kind:s});else if(s[0]==="\\"&&B0(s[1])){let l=Number(s.substring(1));r||l<=n.lastIndex?e.push({type:"Backreference",kind:"number",number:l,reference:l}):e.push(Jc(s))}else if(s[0]==="\\"&&s[1]==="k"&&s.length!==2){let l=s.substring(3,s.length-1);e.push({type:"Backreference",kind:"name",number:n.named.get(l)||0,referenceRaw:l,reference:l})}else e.push(Jc(s));break}}if(i!==null){i.push(Zt(e.splice(0),!0)||null);let o={type:"Disjunction",left:i[0],right:i[1]};for(let s=2;s<i.length;++s)o={type:"Disjunction",left:o,right:i[s]};e.push(o)}}function i8(e){let t=$t([...e.flags],"u")!==-1,r=e.source,n=[];return en(n,r,t,{lastIndex:0,named:new Map}),Zt(n)}var o8=String.fromCodePoint;function s8(e){return e.binary||e.shorthand?e.canonicalValue:`${e.canonicalName}=${e.canonicalValue}`}function Fw(e,t,r,n){let i=-1;for(let o=t;o<=r;++o)if(e.test(o8(o)))i===-1&&(i=o);else if(i!==-1){let s=o-1;n.push(i===s?[s]:[i,s]),i=-1}i!==-1&&n.push(i===r?[r]:[i,r])}function a8(e,t){let r=new RegExp(`^\\${t?"P":"p"}{${e}}$`,"u"),n=[];return Fw(r,0,55295,n),Fw(r,57344,1114111,n),n}var jw=new Map;function l8(e,t){let r=`${t?"P":"p"}:${e}`,n=jw.get(r);if(n!==void 0)return n;let i=a8(e,t);return jw.set(r,i),i}function u8(e){return an(...G(l8(s8(e),e.negative),t=>nd(t)))}var c8=String.fromCodePoint,Vw=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],Bw=[..."0123456789"],Uw=[...` \r
134
- \v\f`],xd=[...`\r
135
- `],U0=[...""],d8=[...xd,...U0],wr=()=>Ce({unit:"grapheme-ascii",minLength:1,maxLength:1});function Ww(e){return new L(`Unsupported AST node! Received: ${xe(e)}`)}function Xt(e,t,r){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return vt(...Vw);case"\\W":return wr().filter(n=>$t(Vw,n)===-1);case"\\d":return vt(...Bw);case"\\D":return wr().filter(n=>$t(Bw,n)===-1);case"\\s":return vt(...Uw);case"\\S":return wr().filter(n=>$t(Uw,n)===-1);case"\\b":case"\\B":throw new L(`Meta character ${e.value} not implemented yet!`);case".":{let n=r.dotAll?U0:d8;return wr().filter(i=>$t(n,i)===-1)}}if(e.symbol===void 0)throw new L(`Unexpected undefined symbol received for non-meta Char! Received: ${xe(e)}`);return ve(e.symbol);case"Repetition":{let n=Xt(e.expression,t,r);switch(e.quantifier.kind){case"*":return Ce({...t,unit:n});case"+":return Ce({...t,minLength:1,unit:n});case"?":return Ce({...t,minLength:0,maxLength:1,unit:n});case"Range":return Ce({...t,minLength:e.quantifier.from,maxLength:e.quantifier.to,unit:n});default:throw Ww(e.quantifier)}}case"Quantifier":throw new L("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return B(...G(e.expressions,n=>Xt(n,t,r))).map(n=>ce(n,""));case"CharacterClass":if(e.negative){let n=G(e.expressions,i=>Xt(i,t,r));return wr().filter(i=>t1(n,o=>!o.canShrinkWithoutContext(i)))}return Me(...G(e.expressions,n=>Xt(n,t,r)));case"ClassRange":{let n=e.from.codePoint,i=e.to.codePoint;return oe({min:n,max:i}).map(o=>c8(o),o=>{if(typeof o!="string")throw new L("Invalid type");if([...o].length!==1)throw new L("Invalid length");return nn(o,0)})}case"Group":return Xt(e.expression,t,r);case"Disjunction":return Me(e.left!==null?Xt(e.left,t,r):ve(""),e.right!==null?Xt(e.right,t,r):ve(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return r.multiline?e.kind==="^"?Me(ve(""),B(Ce({unit:wr()}),vt(...xd)).map(n=>`${n[0]}${n[1]}`,n=>{if(typeof n!="string"||n.length===0)throw new L("Invalid type");return[ge(n,0,n.length-1),n[n.length-1]]})):Me(ve(""),B(vt(...xd),Ce({unit:wr()})).map(n=>`${n[0]}${n[1]}`,n=>{if(typeof n!="string"||n.length===0)throw new L("Invalid type");return[n[0],ge(n,1)]})):ve("");throw new L(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":throw new L("Backreference nodes not implemented yet!");case"UnicodeProperty":return u8(e);default:throw Ww(e)}}function f8(e,t={}){for(let a of e.flags)if(a!=="d"&&a!=="g"&&a!=="m"&&a!=="s"&&a!=="u")throw new L(`Unable to use "stringMatching" against a regex using the flag ${a}`);let r=t.maxLength,n={size:t.size,maxLength:r},i={multiline:e.multiline,dotAll:e.dotAll},o=Z7(i8(e));r!==void 0&&(o=Y7(o,r));let s=Xt(o,n,i);return r!==void 0?s.filter(a=>[...a].length<=r):s}function p8(e){let t=[];for(let r=0;r!==e.length;++r)t.push(e[r].next());return t}function h8(e,t){for(let r=0;r!==e.length;++r)t[r]=e[r].next()}function m8(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*g8(...e){let t=p8(e);for(;!m8(t);)yield t.map(r=>r.value),h8(e,t)}function*y8(e){let t=e;for(;;)yield t,++t}var b8=class extends de{constructor(e,t){super(),this.arb=e,this.maxShrinks=t}generate(e,t){let r=this.arb.generate(e,t);return this.valueMapper(r,0)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return this.isSafeContext(t)?this.safeShrink(e,t.originalContext,t.length):this.safeShrink(e,void 0,0)}safeShrink(e,t,r){let n=this.maxShrinks-r;return n<=0?j.nil():new j(g8(this.arb.shrink(e,t),y8(r+1))).take(n).map(i=>this.valueMapper(i[0],i[1]))}valueMapper(e,t){let r={originalContext:e.context,length:t};return new _(e.value,r)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalContext"in e&&"length"in e}};function S8(e,t){return new b8(e,t)}var w8=Tb({Arbitrary:()=>de,ExecutionStatus:()=>LN,PreconditionFailure:()=>nr,Random:()=>Pd,Stream:()=>j,Value:()=>_,VerbosityLevel:()=>fN,__commitHash:()=>R8,__type:()=>v8,__version:()=>x8,anything:()=>v0,array:()=>ae,assert:()=>r3,asyncDefaultReportMessage:()=>w1,asyncModelRun:()=>V7,asyncProperty:()=>cN,asyncStringify:()=>Id,asyncToStringMethod:()=>Ft,base64String:()=>Z_,bigInt:()=>rr,bigInt64Array:()=>G7,bigUint64Array:()=>H7,boolean:()=>bi,chainUntil:()=>H3,check:()=>x1,clone:()=>Z3,cloneIfNeeded:()=>tn,cloneMethod:()=>Oe,commands:()=>L7,compareBooleanFunc:()=>J$,compareFunc:()=>X$,configureGlobal:()=>aN,constant:()=>ve,constantFrom:()=>vt,context:()=>V3,createDepthIdentifier:()=>Od,date:()=>L1,defaultReportMessage:()=>S1,dictionary:()=>$d,domain:()=>jd,double:()=>Ks,emailAddress:()=>c$,entityGraph:()=>JD,falsy:()=>F3,float:()=>e0,float32Array:()=>l0,float64Array:()=>u0,func:()=>tD,gen:()=>d3,getDepthContextFor:()=>Md,hasAsyncToStringMethod:()=>Ad,hasCloneMethod:()=>vr,hasToStringMethod:()=>Cd,hash:()=>Gs,infiniteStream:()=>z_,int16Array:()=>c0,int32Array:()=>d0,int8Array:()=>f0,integer:()=>oe,ipV4:()=>Wd,ipV4Extended:()=>i0,ipV6:()=>o0,json:()=>B_,jsonValue:()=>x0,letrec:()=>s0,limitShrink:()=>S8,lorem:()=>i_,map:()=>md,mapToConstant:()=>an,maxSafeInteger:()=>n0,maxSafeNat:()=>oD,memo:()=>l_,mixedCase:()=>h_,modelRun:()=>j7,nat:()=>Qt,noBias:()=>zs,noShrink:()=>Hs,object:()=>D_,oneof:()=>Me,option:()=>jt,pre:()=>_6,property:()=>dN,readConfigureGlobal:()=>dt,record:()=>hd,resetConfigureGlobal:()=>lN,sample:()=>i3,scheduledModelRun:()=>B7,scheduler:()=>W7,schedulerFor:()=>z7,set:()=>b0,shuffledSubarray:()=>r7,sparseArray:()=>y0,statistics:()=>s3,stream:()=>tr,string:()=>Ce,stringMatching:()=>f8,stringify:()=>xe,subarray:()=>t7,toStringMethod:()=>ft,tuple:()=>B,uint16Array:()=>p0,uint32Array:()=>h0,uint8Array:()=>m0,uint8ClampedArray:()=>g0,ulid:()=>c7,uniqueArray:()=>Rr,uuid:()=>y7,webAuthority:()=>C0,webFragments:()=>I0,webPath:()=>T0,webQueryParameters:()=>M0,webSegment:()=>P0,webUrl:()=>T7}),v8="module",x8="4.8.0",R8="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",Ne=w8;function Js(e){return e?.values!=null&&e.values.length>0?Ne.constantFrom(...e.values):k8(e)}function k8(e){if(e?.type==="number")return Ne.integer();if(e?.type==="boolean")return Ne.boolean();let t=e?.generator==null?void 0:C8[e.generator];if(t!=null)return t;let r=e?.constraints?.kind==="string"?e.constraints:void 0;return Ne.string({maxLength:r?.maxLength,minLength:r?.minLength??1}).filter(n=>n.trim().length>0&&n===n.trim())}var E8="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],ln=e=>Ne.array(Ne.constantFrom(...E8),{maxLength:e,minLength:1}).map(t=>t.join("")),Kd=(e,t)=>Ne.array(ln(10),{maxLength:t,minLength:1}).map(r=>r.join(e)),C8={"company.name":Kd(" ",3),"date.iso":A8(),"internet.email":I8(),"internet.url":P8(),"lorem.slug":Kd("-",3),"lorem.word":ln(10),"person.fullName":Kd(" ",2)};function A8(){return Ne.date({max:new Date("2030-12-31T23:59:59.999Z"),min:new Date("2020-01-01T00:00:00.000Z"),noInvalidDate:!0}).map(e=>e.toISOString())}function I8(){return Ne.tuple(ln(12),ln(10),Ne.constantFrom("com","dev","io","org","ai")).map(([e,t,r])=>`${e}@${t}.${r}`)}function P8(){return Ne.tuple(Ne.constantFrom("http","https"),ln(12),Ne.constantFrom("app","com","dev","io","org"),Ne.array(ln(8),{maxLength:3})).map(([e,t,r,n])=>{let i=n.length===0?"":`/${n.join("/")}`;return`${e}://${t}.${r}${i}`})}var W0=new WeakMap;function Yd(e){let t=W0.get(e);if(t!=null)return t;let r=Object.fromEntries(Object.entries(e.paramSpaces).map(([n,i])=>[n,M8(i)]));return W0.set(e,r),r}var T8=24301;function M8(e){let[t]=Ne.sample(Js(e),{numRuns:1,seed:T8});if(t==null)throw new Error("arbitrary produced no sample");return t}function Si(e){return{aborted:!0,findings:[],fired:[],teardown:e}}function Zd(e,t){return new O8(N8(e,t))}async function N8({browser:e,hub:t,request:r},n){if(n.aborted)return Jd(Si("skipped"));let i=j8({lockfile:r.lockfile,options:r.options,runId:r.runId,signal:n}),o=async s=>{try{return Jd(await $8({browser:e,established:s,hub:t,request:r,signal:n}))}catch(a){return z0(wn(a))}};return F8(i,r).match(o,s=>L8(s,i.teardown))}async function L8(e,t){return e.kind!=="aborted"?z0(e):Jd(Si(await G0(t)))}function G0(e){return e().match(()=>"done",()=>"failed")}async function $8(e){let t=await D8(e);if(t.kind==="completed")return await e.established.teardown().match(ro,Hp),{aborted:!1,...t.result};let r=await G0(e.established.teardown);if(t.kind==="aborted")return Si(r);throw t.error}async function D8({browser:e,established:t,hub:r,request:n,signal:i}){try{Ht(i);let{close:o,driver:s,emitAssertion:a}=await Dl({baseUrl:n.options.baseUrl,browser:e,capture:n.capture?{hub:r,runId:n.runId}:null,clientState:t.clientState,engine:Ol(B8(n.lockfile)),reader:t.reader,session:t.auth});try{return n.onEvent?.({aliases:t.aliases,generated:t.generated,generatedSingletons:t.generatedSingletons,kind:"world"}),{kind:"completed",result:await Il({canon:qa(n.lockfile),classify:Ha(n.lockfile),driver:s,initialState:{snapshot:t.snapshot},onAssertion:a,onEvent:n.onEvent??ro,sequence:n.sequence??_8(n.lockfile,n.testName,n.params),...wc(n.lockfile)},i)}}finally{await o()}}catch(o){return Qp(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function _8(e,t,r){return co(e,t).map(n=>({params:{...Yd(n),...r},transition:n}))}function F8(e,t){return Pn(t.lockfile,t.testName,{generate:Ml(Tl(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(r=>({aliases:r.aliases,auth:r.auth,clientState:r.clientState,generated:r.generated,generatedSingletons:r.generatedSingletons,reader:e.reader,snapshot:r.snapshot,teardown:e.teardown}))}function j8({lockfile:e,options:t,runId:r,signal:n}){let i=Vl({baseUrl:t.engineUrl,runId:r,secret:t.secret},n);return{materialize:fl(i.setupWorld),reader:jl(e.entities,V8(e),i.query),teardown:i.teardown}}function V8(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function B8(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}function G8({debugDir:e,headed:t,writeOtlpPortFile:r}){let n=um({headed:t}),i,o,s=async()=>(i??=Sc({debugDir:e,writeOtlpPortFile:r}),o=await i,o),a=async(u,c)=>{if(c.aborted)return W8(Si("skipped"));try{let d=await s();return u.options.headed&&!t?await _l(!0,async p=>Zd({browser:p,hub:d,request:u},c)):await Zd({browser:await n.acquire(),hub:d,request:u},c)}catch(d){return U8(wn(d))}};return{close:async()=>{await n.close();let u=i;i=void 0,o=void 0,u!=null&&await u.then(c=>c.close()).catch(()=>{})},injectSpan:(u,c)=>{o?.injectSpan(u,c)},runOnce:(u,c)=>new z8(a(u,c))}}function wi(e,t){let r=e.axes.flatMap(n=>n.classify(t).map(([i,o])=>`${i}:${o}`));return[t.label,...r.toSorted((n,i)=>n.localeCompare(i))].join("|")}function Xd(e){return e.axes.map(t=>t.name).join("+")}function Qd(e){return{name:`counts(${e})`,classify:({pre:t})=>[...t.entities].flatMap(([r,n])=>n.size===0?[]:[[r,q8(e,n.size)]])}}function ef(e){let t=H0(e);return{name:"enum-fields",classify:({pre:r})=>[...r.entities].flatMap(([n,i])=>[...i.values()].flatMap(o=>H8(n,o,t)))}}function H8(e,t,r){return Object.entries(t).flatMap(([n,i])=>r.has(`${e}.${n}`)?[[`${e}.${n}`,K8(i)]]:[])}function H0(e){let t=e.valueSpaces.flatMap(n=>n.values==null?[]:[n.name]),r=new Set(t);return new Set(e.entities.flatMap(n=>Object.entries(n.props).flatMap(([i,o])=>o.type==="boolean"||o.valueSpace!=null&&r.has(o.valueSpace)?[`${n.name}.${i}`]:[])))}function q8(e,t){return e==="presence"?"1+":e==="unit"?t===1?"1":"2+":t<=2?String(t):"3+"}function K8(e){return e==null?"\u2205":String(e)}import{createHash as Y8}from"crypto";import{appendFile as J8,mkdir as Z8,readFile as X8}from"fs/promises";import Q8 from"path";import{ResultAsync as K0}from"neverthrow";import{z as R}from"zod";var un=R.enum(["crash","invariant","law","frame"]),q0=R.object({intent:R.string().min(1),test:R.string().min(1)}),e9=R.union([R.object({kind:R.literal("singleton-mismatch"),singleton:R.string().min(1)}),R.object({entity:R.string().min(1),kind:R.string().min(1)})]),Y0=R.discriminatedUnion("kind",[R.object({divergence:e9,kind:R.literal("consistency"),layer:un,step:q0.nullable()}),R.object({kind:R.literal("obligation"),layer:un,source:R.string().min(1),step:q0}),R.object({intent:R.string().min(1),kind:R.literal("unfireable"),layer:un,reason:R.string().min(1),test:R.string().min(1)}),R.object({error:R.string().min(1),kind:R.literal("driver-error"),layer:un,step:R.string().min(1)}),R.object({kind:R.literal("illegal-transition"),layer:un,step:R.string().min(1)})]),t9=R.object({actionHash:R.string().min(1),at:R.string().min(1),kind:R.literal("covered"),lensId:R.string().min(1),targetKey:R.string().min(1)}),r9=R.object({actionHash:R.string().min(1),at:R.string().min(1),depot:R.string().min(1),evidence:R.array(R.string().min(1)),kind:R.literal("finding"),lensId:R.string().min(1),lockfileHash:R.string().min(1),oracleLayer:un,parts:R.array(Y0),runId:R.string().min(1).optional(),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1)),trailParams:R.array(R.record(R.string(),R.union([Xe,R.null()])))}),n9=R.object({actionHash:R.string().min(1),at:R.string().min(1),depot:R.string().min(1),evidence:R.array(R.string().min(1)),kind:R.literal("flaky-candidate"),lensId:R.string().min(1),parts:R.array(Y0),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1))}),i9=R.object({at:R.string().min(1),kind:R.literal("saturation"),lensId:R.string().min(1),lockfileHash:R.string().min(1),ring:R.number().int().nonnegative()}),o9=R.object({at:R.string().min(1),kind:R.literal("resolution"),signature:R.string().min(1)}),s9=R.object({arrangement:R.string().min(1),at:R.string().min(1),canonicalKey:R.string().min(1),kind:R.literal("derived-depot")}),Zs=R.discriminatedUnion("kind",[t9,r9,n9,i9,o9,s9]);function Xs(e){return of(e).slice(0,12)}function ze(e){return`${e.lensId} ${e.actionHash} ${e.targetKey}`}function vi(e){return e.reduce((t,r)=>f9(t,r),d9())}function xi(e){return K0.fromPromise(a9(e),t=>({error:t,kind:"io"})).map(t=>u9(t))}function tf(e,t){let r=t.map(n=>`${JSON.stringify(n)}
136
- `).join("");return K0.fromPromise(Z8(Q8.dirname(e),{recursive:!0}).then(()=>J8(e,r)),n=>({error:n,kind:"io"}))}function rf(e,t){let r=J({effect:t.effectStep,guard:t.guard,nav:t.nav,params:t.paramSpaces,steps:t.steps}),n=e.entities.filter(i=>r.includes(`"${i.name}"`));return of(J({entities:n,spec:r}))}function nf(e){return of(J(e))}async function a9(e){return(await X8(e,"utf8").catch(r=>{if(l9(r))return"";throw r})).split(`
137
- `).filter(r=>r.length>0)}function l9(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}function u9(e){return e.flatMap(t=>{let r=Zs.safeParse(c9(t));return r.success?[r.data]:[]})}function c9(e){try{return JSON.parse(e)}catch{return null}}function of(e){return Y8("sha256").update(e).digest("hex")}function d9(){return{covered:new Set,findings:new Map,flaky:new Map,saturations:new Map}}function f9(e,t){if(t.kind==="covered")return{...e,covered:new Set([...e.covered,ze(t)])};if(t.kind==="flaky-candidate")return{...e,covered:new Set([...e.covered,ze(t)]),flaky:p9(e.flaky,t)};if(t.kind==="finding")return{...e,covered:new Set([...e.covered,ze(t)]),findings:h9(e.findings,t)};if(t.kind==="resolution")return{...e,findings:m9(e.findings,t)};if(t.kind==="saturation"){let r=`${t.lensId} ${String(t.ring)}`;return{...e,saturations:new Map([...e.saturations,[r,t]])}}return e}function p9(e,t){let r=e.get(t.signature),n=r==null?{first:t,occurrences:1}:{first:r.first,occurrences:r.occurrences+1};return new Map([...e,[t.signature,n]])}function h9(e,t){let r=e.get(t.signature),n=r==null?{first:t,latest:t,occurrences:1,resolvedAt:void 0}:{first:r.first,latest:t,occurrences:r.occurrences+1,resolvedAt:void 0};return new Map([...e,[t.signature,n]])}function m9(e,t){let r=e.get(t.signature);return r==null?e:new Map([...e,[t.signature,{...r,resolvedAt:t.at}]])}function sf(e){let t={edges:new Map,saturationDepth:0,seen:new Set,states:0,targets:new Map},r=e.depots.map(n=>(t.seen.add(fr(n.snapshot)),{depot:n.name,lastLabel:null,snapshot:n.snapshot,trail:[]}));return y9(e,r,t),{edges:t.edges,saturationDepth:t.saturationDepth,states:t.seen.size,targets:t.targets}}var g9=24301,J0=new WeakMap;function Qs(e,t){let r=J0.get(e)??new Map;J0.set(e,r);let n=r.get(t);if(n!=null)return n;let i=Object.fromEntries(Object.entries(e.paramSpaces).map(([o,s])=>[o,R9(s,t)]));return r.set(t,i),i}function y9(e,t,r){let n=[...t],i=0;for(;i<n.length;){let o=n[i];i+=1,o!=null&&b9(e,o,r).forEach(s=>n.push(s))}}function b9(e,t,r){let n={snapshot:t.snapshot},i=o=>Qs(o,x9(t.trail,e.corpus,o));return Lr(e.corpus,n,i).flatMap(o=>{let s=e.corpus[o.idx];if(s==null)return[];let a=[...t.trail,{idx:o.idx,params:o.params}],l={depot:t.depot,trail:a,transitionIndex:o.idx};return S9({acc:r,node:t,option:o,params:e,transition:s,witness:l}),w9({acc:r,node:t,option:o,params:e,trail:a})})}function S9({acc:e,node:t,option:r,params:n,transition:i,witness:o}){let s={label:r.label,params:r.params,pre:t.snapshot,spaces:i.paramSpaces},a=wi(n.lens,s);if(e.targets.has(a)||(e.targets.set(a,o),e.saturationDepth=Math.max(e.saturationDepth,o.trail.length)),t.lastLabel!=null){let l=`${t.lastLabel} \u2192 ${r.label}`;e.edges.has(l)||e.edges.set(l,o)}}function w9({acc:e,node:t,option:r,params:n,trail:i}){if(i.length>=n.maxDepth)return[];let o=r.firing.next.snapshot;if(v9(t.snapshot,o,n.maxCount))return[];let s=fr(o);return e.seen.has(s)?[]:(e.seen.add(s),[{depot:t.depot,lastLabel:r.label,snapshot:o,trail:i}])}function v9(e,t,r){return[...t.entities].some(([n,i])=>{let o=e.entities.get(n)?.size??0;return i.size>o&&i.size>r})}function x9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function R9(e,t){let[r]=Ne.sample(Js(e),{numRuns:1,seed:g9+t});if(r==null)throw new Error("arbitrary produced no sample");return r}var k9=10;function af(e){return cf(e).reduce((t,r)=>t+X0(e,r).length,0)}function lf(e){return e.targets.size+e.edges.size}function uf(e){let t=cf(e).map(o=>X0(e,o)),r=E9(e,t);if(r!=null)return r;let n=t.find(o=>o.length>0);return n==null?{kind:"saturated",ring:t.length}:{kind:"cover",target:n.reduce((o,s)=>Z0(e,s)>Z0(e,o)?s:o)}}function cf(e){return[{entries:e.graph.targets,index:1},{entries:e.graph.edges,index:2}]}function X0(e,t){return[...t.entries].flatMap(([r,n])=>{let i=Q0({params:e,ring:t.index,targetKey:r,witness:n});return e.covered.has(ev(e,i))?[]:[i]})}function Q0({params:e,ring:t,targetKey:r,witness:n}){let i=e.actionHashes[n.transitionIndex];if(i==null)throw new Error("transition index out of corpus range");return{actionHash:i,ring:t,targetKey:r,witness:n}}function ev(e,t){return ze({actionHash:t.actionHash,lensId:e.lensId,targetKey:t.targetKey})}function E9(e,t){if(e.tick===0||e.tick%k9!==0)return null;let r=cf(e).flatMap(i=>[...i.entries].flatMap(([o,s])=>{let a=Q0({params:e,ring:i.index,targetKey:o,witness:s});return e.covered.has(ev(e,a))?[a]:[]}));if(r.length===0||t.every(i=>i.length===0))return null;let n=r[e.tick%r.length];return n==null?null:{kind:"revalidate",target:n}}var C9=/delete|remove|cancel|deactivate|revoke|archive/i;function Z0(e,t){let r=t.ring===2&&A9(e,t)?4:0,n=C9.test(t.targetKey)?2:0,i=1/(1+t.witness.trail.length);return r+n+i}function A9(e,t){return new Set(t.witness.trail.flatMap(n=>{let i=e.corpus[n.idx];return i==null?[]:[i.test]})).size>1}function I9(e){let t=P9(e,e.witnessTrail);return t==null?{covers:[],firings:[]}:M9(e,t)}function P9(e,t){return t.reduce((r,n)=>r==null?null:T9(e,r,n),{covers:[],firings:[],snapshot:e.depotSnapshot})}function T9(e,t,r){let n=e.corpus[r.idx];if(n==null)return null;let i=Mn(n,{snapshot:t.snapshot},r.params);if(i==null)return null;let o=tv({params:e,planned:r,pre:t.snapshot,transition:n});return{covers:[...t.covers,o],firings:[...t.firings,r],snapshot:i.next.snapshot}}function tv({params:e,planned:t,pre:r,transition:n}){let i={label:`${n.test}#${String(n.index)}`,params:t.params,pre:r,spaces:n.paramSpaces},o=e.actionHashes[t.idx];if(o==null)throw new Error("transition index out of corpus range");return{actionHash:o,targetKey:wi(e.lens,i)}}function M9(e,t){let r=new Set([...e.covered,...t.covers.map(i=>ze({...i,lensId:e.lensId}))]),n=rv({params:e,seen:r,state:t});return{covers:n.covers,firings:n.firings}}function rv({params:e,seen:t,state:r}){if(r.firings.length>=e.maxLength)return r;let n=O9({params:e,seen:t,state:r});return n==null?r:(t.add(ze({...n.coverage,lensId:e.lensId})),rv({params:e,seen:t,state:{covers:[...r.covers,n.coverage],firings:[...r.firings,n.planned],snapshot:n.snapshot}}))}function O9({params:e,seen:t,state:r}){let n=o=>Qs(o,N9(r.firings,e.corpus,o));return Lr(e.corpus,{snapshot:r.snapshot},n).map(o=>{let s=e.corpus[o.idx];if(s==null)return null;let a={idx:o.idx,params:o.params};return{coverage:tv({params:e,planned:a,pre:r.snapshot,transition:s}),planned:a,snapshot:o.firing.next.snapshot}}).find(o=>o!=null&&!t.has(ze({...o.coverage,lensId:e.lensId})))??null}function N9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function df(e,{sweep:t}){let r=At(e.tests.filter(n=>!n.stub),n=>J({s:n.singletons,w:n.world})).map(n=>({name:n.name,test:n}));return t?[...r,...r.flatMap(n=>L9(n))]:r}function ff(e,t,r){return Pn({...e,tests:[t.test]},t.test.name,r)}function L9(e){return $9(e.test).map(t=>{let r={...t,as:`${t.as}~2`},n=`${e.name} +${t.entity}`;return{name:n,test:{...e.test,name:n,world:[...e.test.world,r]}}})}function $9(e){return e.world.filter(t=>{let r=J({...e,world:e.world.filter(n=>n!==t)});return!r.includes(`"${t.as}.`)&&!r.includes(`"ref":"${t.as}"`)})}async function D9(e,t){let r=await ea({attemptIndex:0,capture:!1,firings:e.trail.firings,params:e},t);return r.kind!=="completed"?iv(r):r.findings.length===0?{kind:"clean",rows:U9(e)}:_9(e,Ri(e.depot.name,r.findings),t)}function iv(e){return e.kind==="aborted"?{kind:"aborted"}:{error:e.error,kind:"error"}}async function _9(e,t,r){let n=await ea({attemptIndex:1,capture:!1,firings:e.trail.firings,params:e},r);return n.kind!=="completed"?iv(n):Ri(e.depot.name,n.findings).signature!==t.signature?{kind:"flaky",rows:[W9(e,t)]}:F9({digest:t,params:e,signal:r})}async function ea({attemptIndex:e,capture:t,firings:r,params:n},i){let o=n.runIdFor(e);return(await n.session.runOnce({capture:t,lockfile:B9(n),onEvent:void 0,options:n.options,params:void 0,runId:o,sequence:V9(n,r),testName:n.depot.test.name},i)).match(a=>a.aborted?{kind:"aborted"}:{findings:a.findings,kind:"completed",runId:o},a=>({error:a,kind:"error"}))}async function F9({digest:e,params:t,signal:r}){let n=await ov({attemptIndex:2,budget:t.shrinkBudget,firings:t.trail.firings,params:t,signal:r,signature:e.signature});if(n.kind!=="shrunk")return n.outcome;let i=await j9({firings:n.firings,params:t,signal:r,signature:e.signature});if(i.kind==="aborted")return{kind:"aborted"};let o=q9({digest:e,minimal:n.firings,params:t,runId:i.kind==="reproduced"?i.runId:void 0});return{finding:o,kind:"finding",minimal:n.firings,rows:[o],runId:i.kind==="reproduced"?i.runId:n.runId}}async function j9({firings:e,params:t,signal:r,signature:n}){let i=await ea({attemptIndex:t.shrinkBudget+2,capture:!0,firings:e,params:t},r);return i.kind==="aborted"?{kind:"aborted"}:i.kind==="completed"&&Ri(t.depot.name,i.findings).signature===n?{kind:"reproduced",runId:i.runId}:{kind:"no-repro"}}async function ov(e){let t={firings:e.firings,kind:"shrunk",runId:e.params.runIdFor(e.attemptIndex-1)};if(e.budget<=0||e.firings.length<=1)return t;let r=e.firings.map((n,i)=>e.firings.filter((o,s)=>s!==i));return sv(e,r,t)}async function sv(e,t,r){let[n,...i]=t;if(n==null||e.budget-1<0)return r;let o=await ea({attemptIndex:e.attemptIndex,capture:!1,firings:n,params:e.params},e.signal);if(o.kind==="aborted")return{kind:"halted",outcome:{kind:"aborted"}};let s={...e,attemptIndex:e.attemptIndex+1,budget:e.budget-1};return o.kind==="completed"&&Ri(e.params.depot.name,o.findings).signature===e.signature?ov({...s,firings:n}):sv(s,i,r)}function V9(e,t){return t.map(r=>{let n=e.corpus[r.idx];if(n==null)throw new Error("transition index out of corpus range");return{params:r.params,transition:n}})}function B9(e){return e.lockfile.tests.some(r=>r.name===e.depot.test.name)?e.lockfile:{...e.lockfile,tests:[...e.lockfile.tests,e.depot.test]}}function U9(e){return e.trail.covers.map(t=>({actionHash:t.actionHash,at:e.now(),kind:"covered",lensId:e.lensId,targetKey:t.targetKey}))}function W9(e,t){return{actionHash:pf(e).actionHash,at:e.now(),depot:e.depot.name,evidence:[...t.evidence],kind:"flaky-candidate",lensId:e.lensId,parts:[...t.parts],signature:t.signature,targetKey:pf(e).targetKey,trail:e.trail.covers.map(r=>r.targetKey)}}function av(e){return e.kind==="driver-error"||e.kind==="unfireable"?"crash":e.kind==="obligation"?e.source.kind==="invariant"?"invariant":e.source.kind==="law"?"law":"frame":"frame"}function Ri(e,t){let r=t.map(i=>({line:xm(i),part:G9(i)})).toSorted((i,o)=>J(i.part).localeCompare(J(o.part))),n=r.map(i=>i.part);return{evidence:r.map(i=>i.line),layer:z9(n),parts:n,signature:J({depot:e,parts:n.map(i=>J(i))})}}var nv={crash:0,frame:3,invariant:1,law:2};function z9(e){return e.map(r=>r.layer).toSorted((r,n)=>nv[r]-nv[n]).at(0)??"frame"}function G9(e){let t=av(e);switch(e.kind){case"consistency":return{divergence:H9(e.divergence),kind:"consistency",layer:t,step:e.step==null?null:{intent:e.step.intent,test:e.step.test}};case"obligation":return{kind:"obligation",layer:t,source:e.source.kind,step:{intent:e.step.intent,test:e.step.test}};case"unfireable":return{intent:e.intent,kind:"unfireable",layer:t,reason:e.reason,test:e.test};case"driver-error":return{error:e.error.kind,kind:"driver-error",layer:t,step:e.step.intent};case"illegal-transition":return{kind:"illegal-transition",layer:t,step:e.step.intent}}}function H9(e){return e.kind==="singleton-mismatch"?{kind:e.kind,singleton:e.singleton}:{entity:e.entity,kind:e.kind}}function q9({digest:e,minimal:t,params:r,runId:n}){let i=pf(r);return{actionHash:i.actionHash,at:r.now(),depot:r.depot.name,evidence:[...e.evidence],kind:"finding",lensId:r.lensId,lockfileHash:r.lockfileHash,oracleLayer:e.layer,parts:[...e.parts],runId:n,signature:e.signature,targetKey:i.targetKey,trail:t.map(o=>{let s=r.corpus[o.idx];if(s==null)throw new Error("transition index out of corpus range");return`${s.test}#${String(s.index)}`}),trailParams:t.map(o=>o.params)}}function pf(e){let t=e.trail.covers.at(-1);if(t==null)throw new Error("trail has no coverage");return t}function NK(e){switch(e.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${e.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${e.message}`}}function LK({projectId:e,serverUrl:t}){return[`Project "${e}" (from .ripplo/project.json) was not found on ${t}, or this account does not have access to it.`,"Run `npx ripplo projects list` to see your projects, then update .ripplo/project.json (or re-run `npx ripplo init --project <id>`)."].join(`
138
- `)}function $K(e){return`ripplo daemon: ready as local executor for session ${e} (sync happens on each \`ripplo run\`; Ctrl-C to stop)`}function DK({cwd:e,pid:t}){return`ripplo daemon: another daemon is already running for this project${t==null?"":` (pid ${String(t)})`} (cwd ${e}).`}function _K(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project; shutting down."}function FK(e){if(e.kind==="not-running")return"daemon: not running";if(e.kind==="unresponsive")return`daemon: running but did not reply within ${String(e.timeoutMs/1e3)}s \u2014 likely busy executing runs (event loop saturated); retry when the batch drains`;let{status:t}=e,r=`${String(t.active)} active, ${String(t.queued)} queued`,n=`explorer: ${t.explorer}, ${String(t.exploring)} exploring`;return`daemon: running (${r}; ${n}; ${K9(t.progress)})`}function K9(e){if(e.total===0)return"explore: idle";let t=`covered ${String(e.covered)}/${String(e.total)} targets`,r=e.deferred===0?"":` (${String(e.deferred)} deferred \u2014 timed out or errored, auto-retried after cooldown)`,n=Y9(e);return`explore: ${t}${r}, ${String(e.findings)} findings, ${n}`}function jK(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:e.findings.map(t=>_n(t)),kind:"findings"};case"error":return{detail:Ct(e.error),kind:"error"};case"dispatch-failed":return{detail:e.reason,kind:"dispatch-error"}}}function Y9(e){return e.saturated?e.deferred===0?"saturated":"waiting \u2014 every open target is deferred, retrying after cooldown":"searching"}import J9 from"p-queue";var Z9=4,X9={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},ta=new J9({concurrency:Z9}),Bt={headedActive:0,interactiveActive:0,interactiveQueued:0},lv={current:null};function UK({headed:e,task:t,workClass:r}){let n=X9[r];return r==="p3-explore"?ta.add(t,{priority:n}):(Bt.interactiveQueued+=1,ra(),ta.add(()=>Q9({headed:e,task:t}),{priority:n}))}function WK(e){!Number.isFinite(e)||e<1||(ta.concurrency=Math.floor(e),ra())}function hf(){return{active:Bt.interactiveActive,headedActive:Bt.headedActive,poolSize:ta.concurrency,queued:Bt.interactiveQueued}}function zK(e){lv.current=e}async function Q9({headed:e,task:t}){Bt.interactiveQueued-=1,Bt.interactiveActive+=1,Bt.headedActive+=e?1:0,ra();try{return await t()}finally{Bt.interactiveActive-=1,Bt.headedActive-=e?1:0,ra()}}function ra(){lv.current?.()}import mf from"fs";import gf from"path";function uv(e){try{let t=e5(e);if(t==null)return;let r=gf.join(t,"HEAD"),n=mf.readFileSync(r,"utf8").trim(),i="ref: refs/heads/";return n.startsWith(i)?n.slice(i.length):n.length===0?void 0:n.slice(0,7)}catch{return}}function e5(e){let t=gf.join(e,".git");if(mf.statSync(t).isDirectory())return t;let n=mf.readFileSync(t,"utf8").trim(),i="gitdir:";if(!n.startsWith(i))return;let o=n.slice(i.length).trim();if(o.length!==0)return gf.resolve(e,o)}import t5 from"crypto";import{graphql as r5}from"gql.tada";import{err as n5,ok as i5}from"neverthrow";var o5=r5(`
131
+ }`}return nD(o,{toString:{value:()=>s(xe(t))},[ft]:{value:()=>s(xe(t))},[Ft]:{value:async()=>s(await Pd(t))},[Oe]:{value:n,configurable:!0}})};return n()})}var sD=Number.MIN_SAFE_INTEGER,aD=Number.MAX_SAFE_INTEGER;function o0(){return new sn(sD,aD)}var lD=Number.MAX_SAFE_INTEGER;function uD(){return new sn(0,lD)}var cD=Number.parseInt;function dD(e){let[t,r]=e;switch(t){case"oct":return`0${pi(r,8)}`;case"hex":return`0x${pi(r,16)}`;default:return`${r}`}}function $s(e,t){let r=cD(e,t);if(pi(r,t)!==e)throw new Error("Invalid value");return r}function fD(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",$s(ge(e,2),16)]:["oct",$s(ge(e,1),8)]:["dec",$s(e,10)]}function pD(e){return ce(e,".")}function hD(e){if(typeof e!="string")throw new Error("Invalid type");return G(Be(e,"."),t=>$s(t,10))}function zd(){return B(Qt(255),Qt(255),Qt(255),Qt(255)).map(pD,hD)}function wt(e){return B(vt("dec","oct","hex"),Qt(e)).map(dD,fD)}function _c(e){return ce(e,".")}function Fc(e){if(typeof e!="string")throw new Error("Invalid type");return Be(e,".")}function s0(){return Me(B(wt(255),wt(255),wt(255),wt(255)).map(_c,Fc),B(wt(255),wt(255),wt(65535)).map(_c,Fc),B(wt(255),wt(16777215)).map(_c,Fc),wt(4294967295))}function Gd(e){return e.length===0?[]:Be(e,":")}function Hd(e){let t=Be(e,":");return t.length>=2&&t[t.length-1].length<=4?[Le(t,0,t.length-2),`${t[t.length-2]}:${t[t.length-1]}`]:[Le(t,0,t.length-1),t[t.length-1]]}function mD(e){return`${ce(e[0],":")}:${e[1]}`}function gD(e){if(typeof e!="string")throw new Error("Invalid type");return Hd(e)}function yD(e){return`::${ce(e[0],":")}:${e[1]}`}function bD(e){if(typeof e!="string")throw new Error("Invalid type");if(!Z4(e,"::"))throw new Error("Invalid value");return Hd(ge(e,2))}function Ds(e){return`${ce(e[0],":")}::${ce(e[1],":")}:${e[2]}`}function _s(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2),[n,i]=Hd(r);return[Gd(t),n,i]}function SD(e){return Ds([e[0],[e[1]],e[2]])}function wD(e){let t=_s(e);return[t[0],ce(t[1],":"),t[2]]}function gw(e){return`${ce(e[0],":")}::${e[1]}`}function yw(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2);return[Gd(t),r]}function vD(e){return`${ce(e[0],":")}::`}function xD(e){if(typeof e!="string")throw new Error("Invalid type");if(!X4(e,"::"))throw new Error("Invalid value");return[Gd(ge(e,0,e.length-2))]}function RD([e,t]){return`${e}:${t}`}function kD(e){if(typeof e!="string")throw new L("Invalid type");if(!e.includes(":"))throw new L("Invalid value");return e.split(":",2)}var ED="0123456789abcdef",jc;function CD(){return jc===void 0&&(jc=oe({min:0,max:15}).map(e=>ED[e],e=>{if(typeof e!="string")throw new L("Not a string");if(e.length!==1)throw new L("Invalid length");let t=nn(e,0);if(t<=57)return t-48;if(t<97)throw new L("Invalid character");return t-87})),jc}function a0(){let e=Ce({unit:CD(),minLength:1,maxLength:4,size:"max"}),t=Me(B(e,e).map(RD,kD),zd());return Me(B(ae(e,{minLength:6,maxLength:6,size:"max"}),t).map(mD,gD),B(ae(e,{minLength:5,maxLength:5,size:"max"}),t).map(yD,bD),B(ae(e,{minLength:0,maxLength:1,size:"max"}),ae(e,{minLength:4,maxLength:4,size:"max"}),t).map(Ds,_s),B(ae(e,{minLength:0,maxLength:2,size:"max"}),ae(e,{minLength:3,maxLength:3,size:"max"}),t).map(Ds,_s),B(ae(e,{minLength:0,maxLength:3,size:"max"}),ae(e,{minLength:2,maxLength:2,size:"max"}),t).map(Ds,_s),B(ae(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(SD,wD),B(ae(e,{minLength:0,maxLength:5,size:"max"}),t).map(gw,yw),B(ae(e,{minLength:0,maxLength:6,size:"max"}),e).map(gw,yw),B(ae(e,{minLength:0,maxLength:7,size:"max"})).map(vD,xD))}var AD=class extends de{constructor(e){super(),this.name=e,this.underlying=null}generate(e,t){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.generate(e,t)}canShrinkWithoutContext(e){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.canShrinkWithoutContext(e)}shrink(e,t){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.shrink(e,t)}},ID=Object.getOwnPropertyNames;function PD(){let e=new _t;return r=>{let n=Je(e,r);return n!==void 0||(n=new AD(String(r)),ct(e,r,n)),n}}function l0(e){let t=PD(),r=e(t),n=ID(r);for(let i of n){let o=t(i);o.underlying=r[i]}return r}function TD(e,t){for(let r of e){let n=t[r]||{};if(n.maxLength===void 0||n.maxLength>0)return!0}return!1}function MD(e,t){if(e.length===0)return ve([]);if(!TD(e,t))throw new L("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return B(...e.map(r=>ae(ve(r),t[r]))).map(r=>C4(r)).filter(r=>r.length>0)}var bw=Object.assign,Fs=Object.create,u0=Object.defineProperty,Sw=Object.getPrototypeOf,OD=Object.prototype;function ND(e){return u0(Fs(null),ft,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function ww(e,t){return ND(`<${Ve(e)}#${t}>`)}function LD(e,t){let r=Fs(OD);for(let n in e){let i=e[n],o=[];for(let s of i){let a=bw(Fs(Sw(s)),s);o.push(a)}r[n]=o}for(let n in t){let i=t[n];for(let o=0;o!==i.length;++o){let s=i[o],a=r[n][o];for(let l in s){let u=s[l];a[l]=u.index===void 0?void 0:typeof u.index=="number"?r[u.type][u.index]:G(u.index,c=>r[u.type][c])}u0(a,ft,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[n][o],u=bw(Fs(Sw(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?ww(d.type,d.index):G(d.index,p=>ww(d.type,p))}return xe(u)}})}}return r}function $D(e){let t=0,r=new _t;for(let i in e){let o=e[i];for(let s in o){let a=o[s];if(a.arity!=="inverse")continue;let l=Je(r,a.type);if(l===void 0&&(l=new _t,ct(r,a.type,l)),V4(l,a.forwardRelationship))throw new L(`Cannot declare multiple inverse relationships for the same forward relationship ${Ve(a.forwardRelationship)} on type ${Ve(a.type)}`);ct(l,a.forwardRelationship,{type:i,property:s}),t+=1}}let n=new _t;if(t===0)return n;for(let i in e){let o=e[i],s=Je(r,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=Je(s,a);if(u!==void 0){if(u.type!==l.type)throw new L(`Inverse relationship ${Ve(u.property)} on type ${Ve(u.type)} references forward relationship ${Ve(a)} but types do not match`);ct(n,l,u)}}}if(n.size!==t)throw new L("Some inverse relationships could not be matched with their corresponding forward relationships");return n}var vw=Object.create;function DD(e,t,r){switch(e){case"exclusive":return ve(r);case"successor":return zs(oe({min:t!==void 0?t+1:0,max:r}));case"any":return zs(oe({min:0,max:r}))}}function _D(e,t,r,n,i,o,s){let a=DD(t,r,n);switch(e){case"0-1":return jt(a,{nil:void 0,depthIdentifier:i}).generate(o,s).value;case"1":return a.generate(o,s).value;case"many":{let l=0,u=jt(Rr(a,{depthIdentifier:i,selector:d=>d===n?d+ ++l:d,minLength:1}),{nil:[],depthIdentifier:i}).generate(o,s).value,c=0;return G(u,d=>d===n?d+c++:d)}}}var FD=class extends de{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let r=new rn,n=new rn;for(let i in e){let o=e[i];for(let s in o){let a=o[s];if(a.arity!=="inverse"){if(a.strategy==="exclusive"){if(Ws(r,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);fi(n,a.type)}else{if(Ws(n,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);fi(r,a.type)}if(a.strategy==="successor"&&a.type!==i)throw new L("Cannot mix types for the strategy successor");if(a.strategy==="successor"&&a.arity==="1")throw new L("Cannot use an arity of 1 for the strategy successor")}}}this.inversedRelations=$D(e)}createEmptyLinksInstanceFor(e){let t=vw(null),r=this.relations[e];for(let n in r){let i=r[n];i.arity==="inverse"&&(t[n]={type:i.type,index:[]})}return t}generate(e,t){let r=vw(null);for(let o in this.relations)r[o]=[];let n=[];for(let o of this.defaultEntities)$(n,{type:o,indexInType:r[o].length,depth:0}),$(r[o],this.createEmptyLinksInstanceFor(o));let i=-1;for(;++i<n.length;){let o=n[i],s=this.relations[o.type],a=r[o.type][o.indexInType],l=Nd();l.depth=o.depth;for(let u in s){let c=s[u];if(c.arity==="inverse")continue;let d=c.type,p=r[d],h=p.length,f=_D(c.arity,c.strategy||"any",d===o.type?o.indexInType:void 0,p.length,l,e,t);a[u]={type:d,index:f};let m=f===void 0?[]:typeof f=="number"?[f]:f;for(let g of m){g>=h&&($(n,{type:d,indexInType:g,depth:o.depth+1}),$(p,this.createEmptyLinksInstanceFor(d)));let S=Je(this.inversedRelations,c);if(S!==void 0){let w=p[g][S.property].index;$(w,o.indexInType)}}}}return n.length=0,new _(r,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function jD(e,t){return new FD(e,t)}var VD=Object.keys,BD=Object.getOwnPropertySymbols,UD=Object.getOwnPropertyDescriptor;function WD(e){let t=VD(e),r=BD(e);for(let n=0;n!==r.length;++n){let i=r[n],o=UD(e,i);o&&o.enumerable&&t.push(i)}return t}var zD=Object.create,GD=Object.defineProperty,HD=Object.getOwnPropertyDescriptor,qD=Object.getOwnPropertyNames,KD=Object.getOwnPropertySymbols;function YD(e,t){return function(n){let i=n[1]?zD(null):{};for(let o=0;o!==e.length;++o){let s=n[0][o];s!==t&&GD(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function JD(e,t){return function(n){if(typeof n!="object"||n===null)throw new Error("Incompatible instance received: should be a non-null object");let i=Object.getPrototypeOf(n)===null,o="constructor"in n&&n.constructor===Object;if(!i&&!o)throw new Error("Incompatible instance received: should be of exact type Object");let s=0,a=[];for(let c=0;c!==e.length;++c){let d=HD(n,e[c]);if(d!==void 0){if(!d.configurable||!d.enumerable||!d.writable)throw new Error("Incompatible instance received: should contain only c/e/w properties");if(d.get!==void 0||d.set!==void 0)throw new Error("Incompatible instance received: should contain only no get/set properties");++s,$(a,d.value)}else $(a,t)}let l=qD(n).length,u=KD(n).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var Vc=Symbol("no-key");function Bc(e,t,r){let n=WD(e),i=[];for(let o=0;o!==n.length;++o){let s=n[o],a=e[s];t===void 0||$t(t,s)!==-1?$(i,a):$(i,jt(a,{nil:Vc}))}return B(B(...i),r?ve(!1):bi()).map(YD(n,Vc),JD(n,Vc))}function md(e,t){let r=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return Bc(e,void 0,r);let n=("requiredKeys"in t?t.requiredKeys:void 0)||[];for(let i=0;i!==n.length;++i){let o=Object.getOwnPropertyDescriptor(e,n[i]);if(o===void 0)throw new Error("requiredKeys cannot reference keys that have not been defined in recordModel");if(!o.enumerable)throw new Error("requiredKeys cannot reference keys that are not enumerable in recordModel")}return Bc(e,n,r)}var ZD=Object.create;function XD(e,t,r,n){let i=ZD(null);for(let o in e){let s=e[o],a=md(s,n),l=t(o),u=r(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?Rr(a,{...c,selector:u}):ae(a,c)}return md(i)}var xw=Object.create,QD=Object.keys;function e_(e,t,r={}){let n=QD(e),i=r.initialPoolConstraints||xw(null),o=r.unicityConstraints||xw(null),s={noNullPrototype:r.noNullPrototype};return MD(n,i).chain(a=>jD(t,a).chain(l=>XD(e,u=>l[u].length,u=>o[u],s).map(u=>LD(u,l))))}function t_(e){return ce(G(e,t=>t[t.length-1]===","?ge(t,0,t.length-1):t)," ")}function r_(e){return function(r){if(typeof r!="string")throw new Error("Unsupported type");let n=[];for(let i of Be(r," "))if(e.canShrinkWithoutContext(i))$(n,i);else if(e.canShrinkWithoutContext(i+","))$(n,i+",");else throw new Error("Unsupported word");return n}}function n_(e){let t=ce(e," ");return t[t.length-1]===","&&(t=ge(t,0,t.length-1)),kd(t[0])+ge(t,1)+"."}function i_(e){return function(r){if(typeof r!="string")throw new Error("Unsupported type");if(r.length<2||r[r.length-1]!=="."||r[r.length-2]===","||kd(Xc(r[0]))!==r[0])throw new Error("Unsupported value");let n=Xc(r[0])+ge(r,1,r.length-1),i=[],o=Be(n," ");for(let s=0;s!==o.length;++s){let a=o[s];if(e.canShrinkWithoutContext(a))$(i,a);else if(s===o.length-1&&e.canShrinkWithoutContext(a+","))$(i,a+",");else throw new Error("Unsupported word")}return i}}function o_(e){return ce(e," ")}function s_(e){if(typeof e!="string")throw new Error("Unsupported type");let t=Be(e,". ");for(let r=0;r<t.length-1;++r)t[r]+=".";return t}var b=(e,t)=>({arbitrary:ve(e),weight:t});function a_(){return Me(b("non",6),b("adipiscing",5),b("ligula",5),b("enim",5),b("pellentesque",5),b("in",5),b("augue",5),b("et",5),b("nulla",5),b("lorem",4),b("sit",4),b("sed",4),b("diam",4),b("fermentum",4),b("ut",4),b("eu",4),b("aliquam",4),b("mauris",4),b("vitae",4),b("felis",4),b("ipsum",3),b("dolor",3),b("amet,",3),b("elit",3),b("euismod",3),b("mi",3),b("orci",3),b("erat",3),b("praesent",3),b("egestas",3),b("leo",3),b("vel",3),b("sapien",3),b("integer",3),b("curabitur",3),b("convallis",3),b("purus",3),b("risus",2),b("suspendisse",2),b("lectus",2),b("nec,",2),b("ultricies",2),b("sed,",2),b("cras",2),b("elementum",2),b("ultrices",2),b("maecenas",2),b("massa,",2),b("varius",2),b("a,",2),b("semper",2),b("proin",2),b("nec",2),b("nisl",2),b("amet",2),b("duis",2),b("congue",2),b("libero",2),b("vestibulum",2),b("pede",2),b("blandit",2),b("sodales",2),b("ante",2),b("nibh",2),b("ac",2),b("aenean",2),b("massa",2),b("suscipit",2),b("sollicitudin",2),b("fusce",2),b("tempus",2),b("aliquam,",2),b("nunc",2),b("ullamcorper",2),b("rhoncus",2),b("metus",2),b("faucibus,",2),b("justo",2),b("magna",2),b("at",2),b("tincidunt",2),b("consectetur",1),b("tortor,",1),b("dignissim",1),b("congue,",1),b("non,",1),b("porttitor,",1),b("nonummy",1),b("molestie,",1),b("est",1),b("eleifend",1),b("mi,",1),b("arcu",1),b("scelerisque",1),b("vitae,",1),b("consequat",1),b("in,",1),b("pretium",1),b("volutpat",1),b("pharetra",1),b("tempor",1),b("bibendum",1),b("odio",1),b("dui",1),b("primis",1),b("faucibus",1),b("luctus",1),b("posuere",1),b("cubilia",1),b("curae,",1),b("hendrerit",1),b("velit",1),b("mauris,",1),b("gravida",1),b("ornare",1),b("ut,",1),b("pulvinar",1),b("varius,",1),b("turpis",1),b("nibh,",1),b("eros",1),b("id",1),b("aliquet",1),b("quis",1),b("lobortis",1),b("consectetuer",1),b("morbi",1),b("vehicula",1),b("tortor",1),b("tellus,",1),b("id,",1),b("eu,",1),b("quam",1),b("feugiat,",1),b("posuere,",1),b("iaculis",1),b("lectus,",1),b("tristique",1),b("mollis,",1),b("nisl,",1),b("vulputate",1),b("sem",1),b("vivamus",1),b("placerat",1),b("imperdiet",1),b("cursus",1),b("rutrum",1),b("iaculis,",1),b("augue,",1),b("lacus",1))}function l_(e={}){let{maxCount:t,mode:r="words",size:n}=e;if(t!==void 0&&t<1)throw new Error("lorem has to produce at least one word/sentence");let i=a_();return r==="sentences"?ae(ae(i,{minLength:1,size:"small"}).map(n_,i_(i)),{minLength:1,maxLength:t,size:n}).map(o_,s_):ae(i,{minLength:1,maxLength:t,size:n}).map(t_,r_(i))}function u_(e){return new Map(e)}function c_(e){if(typeof e!="object"||e===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in e)||e.constructor!==Map)throw new Error("Incompatible instance received: should be of exact type Map");return Array.from(e)}function d_(e){return e[0]}function gd(e,t,r={}){return Rr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:d_,depthIdentifier:r.depthIdentifier,comparator:"SameValueZero"}).map(u_,c_)}var Ts=10;function f_(e){let t={};return(r=>{let n=r!==void 0?r:Ts;if(!i1(t,n)){let i=Ts;Ts=n-1,t[n]=e(n),Ts=i}return t[n]})}function p_(e){let t=0;for(;e>O(0);)e&O(1)&&++t,e>>=O(1);return t}function h_(e,t){let r=(O(1)<<O(t))-O(1),n=e&r,i=p_(e-n),o=n;for(let s=O(1);s<=r&&i!==0;s<<=O(1))o&s||(o|=s,--i);return o}function Ms(e,t){let r=[];for(let n=e.length-1;n!==-1;--n)t(e[n])!==e[n]&&$(r,n);return r}function m_(e,t,r){let n=O(0);for(let i=0,o=O(1);i!==r.length;++i,o<<=O(1))e[r[i]]!==t[r[i]]&&(n|=o);return n}function Uc(e,t,r,n){for(let i=0,o=O(1);i!==r.length;++i,o<<=O(1))t&o&&(e[r[i]]=n(e[r[i]]))}var g_=class extends de{constructor(e,t,r){super(),this.stringArb=e,this.toggleCase=t,this.untoggleAll=r}buildContextFor(e,t){return{rawString:e.value,rawStringContext:e.context,flags:t.value,flagsContext:t.context}}generate(e,t){let r=this.stringArb.generate(e,t),n=[...r.value],i=Ms(n,this.toggleCase),o=rr(O(0),(O(1)<<O(i.length))-O(1)).generate(e,void 0);return Uc(n,o.value,i,this.toggleCase),new _(ce(n,""),this.buildContextFor(r,o))}canShrinkWithoutContext(e){return typeof e!="string"?!1:this.untoggleAll!==void 0?this.stringArb.canShrinkWithoutContext(this.untoggleAll(e)):this.stringArb.canShrinkWithoutContext(e)}shrink(e,t){let r;if(t!==void 0)r=t;else if(this.untoggleAll!==void 0){let o=this.untoggleAll(e),s=[...e],a=[...o];r={rawString:o,rawStringContext:void 0,flags:m_(a,s,Ms(a,this.toggleCase)),flagsContext:void 0}}else r={rawString:e,rawStringContext:void 0,flags:O(0),flagsContext:void 0};let n=r.rawString,i=r.flags;return this.stringArb.shrink(n,r.rawStringContext).map(o=>{let s=[...o.value],a=Ms(s,this.toggleCase),l=h_(i,a.length);return Uc(s,l,a,this.toggleCase),new _(ce(s,""),this.buildContextFor(o,new _(l,void 0)))}).join(er(()=>{let o=[...n],s=Ms(o,this.toggleCase);return rr(O(0),(O(1)<<O(s.length))-O(1)).shrink(i,r.flagsContext).map(a=>{let l=Le(o);return Uc(l,a.value,s,this.toggleCase),new _(ce(l,""),this.buildContextFor(new _(n,r.rawStringContext),a))})}))}};function y_(e){let t=kd(e);return t!==e?t:Xc(e)}function b_(e,t){return new g_(e,t&&t.toggleCase||y_,t&&t.untoggleAll)}function S_(e){return Zw.from(e)}function w_(e){if(!(e instanceof Zw))throw new Error("Unexpected type");return[...e]}function c0(e={}){return ae(r0(e),e).map(S_,w_)}function v_(e){return Xw.from(e)}function x_(e){if(!(e instanceof Xw))throw new Error("Unexpected type");return[...e]}function d0(e={}){return ae(Ks(e),e).map(v_,x_)}function Vt(e,t,r,n,i){let o=n.name,{min:s=t,max:a=r,...l}=e;if(s>a)throw new Error(`Invalid range passed to ${o}: min must be lower than or equal to max`);if(s<t)throw new Error(`Invalid min value passed to ${o}: min must be greater than or equal to ${t}`);if(a>r)throw new Error(`Invalid max value passed to ${o}: max must be lower than or equal to ${r}`);return ae(i({min:s,max:a}),l).map(u=>n.from(u),u=>{if(!(u instanceof n))throw new Error("Invalid type");return[...u]})}function f0(e={}){return Vt(e,-32768,32767,a4,oe)}function p0(e={}){return Vt(e,-2147483648,2147483647,l4,oe)}function h0(e={}){return Vt(e,-128,127,s4,oe)}function m0(e={}){return Vt(e,0,65535,d4,oe)}function g0(e={}){return Vt(e,0,4294967295,f4,oe)}function y0(e={}){return Vt(e,0,255,u4,oe)}function b0(e={}){return Vt(e,0,255,c4,oe)}function R_(e){return e!==void 0}function Rw(e){return e.hasToBeCloned?new _(e.value_,{generatorContext:e.context},()=>e.value):new _(e.value_,{generatorContext:e.context})}function kw(e){return e.hasToBeCloned?new _(e.value_,{shrinkerContext:e.context},()=>e.value):new _(e.value_,{shrinkerContext:e.context})}var k_=class extends de{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return Rw(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return R_(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(Rw):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(kw):this.shrinkerArbitrary.shrink(e,void 0).map(kw)}};function yd(e,t,r){let n=oe({min:e,max:t});return t===r?n:new k_(n,oe({min:e,max:r}))}var E_=Math.min,bd=Math.max,Ew=Yw.isArray,C_=Object.entries;function A_(e){let t=-1;for(let r=0;r!==e.length;++r)t=bd(t,e[r][0]);return t}function I_(e,t){let r=Yw(e);for(let n=0;n!==t.length;++n){let i=t[n];i[0]<e&&(r[i[0]]=i[1])}return r}function S0(e,t={}){let{size:r,minNumElements:n=0,maxLength:i=xr,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=mi(r,mi(r,n,o,t.maxNumElements!==void 0),i,t.maxLength!==void 0);if(n>i)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(n>o)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let u=E_(o,i),c=t.maxNumElements!==void 0||r!==void 0?r:"=",d=Rr(B(yd(0,bd(l-1,0),bd(i-1,0)),e),{size:c,minLength:n,maxLength:u,selector:p=>p[0],depthIdentifier:a}).map(p=>I_(A_(p)+1,p),p=>{if(!Ew(p))throw new Error("Not supported entry type");if(s&&p.length!==0&&!(p.length-1 in p))throw new Error("No trailing hole");return G(C_(p),h=>[Number(h[0]),h[1]])});return s||i===n?d:B(d,yd(n,l,i)).map(p=>{let h=p[0],f=p[1];if(h.length>=f)return h;let m=Le(h);return m.length=f,m},p=>{if(!Ew(p))throw new Error("Not supported entry type");return[p,p.length]})}function P_(e){return new Set(e)}function T_(e){if(typeof e!="object"||e===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in e)||e.constructor!==Set)throw new Error("Incompatible instance received: should be of exact type Set");return Array.from(e)}function w0(e,t={}){return Rr(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(P_,T_)}function M_(e,t,r,n,i,o){return Dd(e,t,{maxKeys:r,noNullPrototype:!o,size:n,depthIdentifier:i})}function O_(e){return Me(h0(e),y0(e),b0(e),f0(e),m0(e),p0(e),g0(e),c0(e),d0(e))}function v0(e){let t=e.values,r=e.depthSize,n=Nd(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Me(...t,...e.withBigInt?[rr()]:[],...e.withDate?[D1()]:[]);return l0(l=>({anything:Me({maxDepth:i,depthSize:r,depthIdentifier:n},a,l("array"),l("object"),...e.withMap?[l("map")]:[],...e.withSet?[l("set")]:[],...e.withObjectString?[l("anything").map(u=>xe(u))]:[],...e.withTypedArray?[O_({maxLength:o,size:s})]:[],...e.withSparseArray?[S0(l("anything"),{maxNumElements:o,size:s,depthIdentifier:n})]:[]),keys:e.withObjectString?Me({arbitrary:e.key,weight:10},{arbitrary:l("anything").map(u=>xe(u)),weight:1}):e.key,array:ae(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),set:w0(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),map:Me(gd(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n}),gd(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n})),object:M_(l("keys"),l("anything"),o,s,n,e.withNullPrototype)})).anything}function N_(e){switch(typeof e){case"boolean":return new Jw(e);case"number":return new Dt(e);case"string":return new Ve(e);default:return e}}function L_(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===Jw||e.constructor===Dt||e.constructor===Ve?e.valueOf():e}function $_(e){return e.map(N_,L_)}function D_(e,t){return[bi(),o0(),Ks(),t(e),Me(t(e),ve(null),ve(void 0))]}function __(e){return e.map(t=>$_(t))}function F_(e,t){return t?__(e).concat(e):e}function x0(e={}){let t={size:e.size,unit:"stringUnit"in e?e.stringUnit:e.withUnicodeString?"binary":void 0};return{key:e.key!==void 0?e.key:Ce(t),values:F_(e.values!==void 0?e.values:D_(t,Ce),e.withBoxedValues===!0),depthSize:e.depthSize,maxDepth:e.maxDepth,maxKeys:e.maxKeys,size:e.size,withSet:e.withSet===!0,withMap:e.withMap===!0,withObjectString:e.withObjectString===!0,withNullPrototype:e.withNullPrototype===!0,withBigInt:e.withBigInt===!0,withDate:e.withDate===!0,withTypedArray:e.withTypedArray===!0,withSparseArray:e.withSparseArray===!0}}function j_(e){return Dd(e.key,v0(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function V_(e){return j_(x0(e))}function B_(e,t){let{depthSize:r,maxDepth:n}=t;return{key:e,values:[bi(),Ks({noDefaultInfinity:!0,noNaN:!0}),e,ve(null)],depthSize:r,maxDepth:n}}function R0(e){return v0(x0(e))}function k0(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return R0(B_("stringUnit"in e?Ce({unit:e.stringUnit}):t?Ce():Ce({unit:"binary"}),e))}var U_=JSON.stringify,W_=JSON.parse;function z_(e){if(typeof e!="string")throw new L("Cannot unmap the passed value");return W_(e)}function G_(e={}){return k0(e).map(U_,z_)}var H_=Object.defineProperties;function Wc(e,t){return`Stream(${t!==void 0?`${ce(t,",")}\u2026`:`${e} emitted`})`}var q_=class extends de{constructor(e,t){super(),this.arb=e,this.history=t}generate(e,t){let r=t!==void 0&&e.nextInt(1,t)===1?t:void 0,n=()=>{let i=this.history?[]:null,o=0,s=function*(a,l){for(;;){let u=a.generate(l,r).value;o++,i!==null&&$(i,u),yield u}};return H_(new j(s(this.arb,e.clone())),{toString:{value:()=>Wc(o,i!==null?i.map(xe):void 0)},[ft]:{value:()=>Wc(o,i!==null?i.map(xe):void 0)},[Ft]:{value:async()=>Wc(o,i!==null?await Promise.all(i.map(Pd)):void 0)},[Oe]:{value:n,enumerable:!0}})};return new _(n(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function K_(e,t){return new q_(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function Y_(e){return ce(e,"")}function Cw(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function J_(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return ge(e,1)}}function Z_(e){if(typeof e!="string"||e.length%4!==0)throw new Error("Invalid string received");let t=e.indexOf("=");if(t===-1)return e;if(e.length-t>2)throw new Error("Cannot unmap the passed value");return ge(e,0,t)}var zc=String.fromCharCode;function X_(e){return e<26?zc(e+65):e<52?zc(e+97-26):e<62?zc(e+48-52):e===62?"+":"/"}function Q_(e){if(typeof e!="string"||e.length!==1)throw new L("Invalid entry");let t=nn(e,0);return t>=65&&t<=90?t-65:t>=97&&t<=122?t-97+26:t>=48&&t<=57?t-48+52:t===43?62:t===47?63:-1}function e7(){return oe({min:0,max:63}).map(X_,Q_)}function t7(e={}){let{minLength:t=0,maxLength:r=xr,size:n}=e,i=t+3-(t+3)%4,o=r-r%4,s=e.maxLength===void 0&&n===void 0?"=":n;if(i>o)throw new L("Minimal length should be inferior or equal to maximal length");if(i%4!==0)throw new L("Minimal length of base64 strings must be a multiple of 4");if(o%4!==0)throw new L("Maximal length of base64 strings must be a multiple of 4");let a=e7();return ae(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:DL(a,Cw)}).map(Y_,Cw).map(J_,Z_)}var Aw=Object.is;function r7(e,t){let r=new _t,n=0;for(let i of e)Aw(i,-0)?++n:ct(r,i,(Je(r,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(Aw(o,-0)){if(n===0)return!1;--n}else{let s=Je(r,o)||0;if(s===0)return!1;ct(r,o,s-1)}}return!0}var n7=Math.floor,Iw=Math.log,i7=Array.isArray,E0=class extends de{constructor(e,t,r,n){if(super(),this.originalArray=e,this.isOrdered=t,this.minLength=r,this.maxLength=n,r<0||r>e.length)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be between 0 and the size of the original array");if(n<0||n>e.length)throw new Error("fc.*{s|S}ubarrayOf expects the maximal length to be between 0 and the size of the original array");if(r>n)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new sn(r,n),this.biasedLengthArb=r!==n?new sn(r,r+n7(Iw(n-r)/Iw(2))):this.lengthArb}generate(e,t){let r=(t!==void 0&&e.nextInt(1,t)===1?this.biasedLengthArb:this.lengthArb).generate(e,void 0),n=r.value,i=G(this.originalArray,(s,a)=>a),o=[];for(let s=0;s!==n;++s){let a=e.nextInt(0,i.length-1);$(o,i[a]),t1(i,a,1)}return this.isOrdered&&r1(o,(s,a)=>s-a),new _(G(o,s=>this.originalArray[s]),r.context)}canShrinkWithoutContext(e){return!i7(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:r7(this.originalArray,e)}shrink(e,t){return e.length===0?j.nil():this.lengthArb.shrink(e.length,t).map(r=>new _(Le(e,e.length-r.value),r.context)).join(e.length>this.minLength?er(()=>this.shrink(Le(e,1),void 0).filter(r=>this.minLength<=r.value.length+1).map(r=>new _([e[0],...r.value],void 0))):j.nil())}};function o7(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new E0(e,!0,r,n)}function s7(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new E0(e,!1,r,n)}var a7={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"},l7={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 u7(e){return e<10?Ve(e):a7[e]}function Pw(e,t){let r="";for(;e.length+r.length<t;)r+="0";return r+e}function Tw(e){let t="";for(let r=e;r!==0;){let n=r>>5;t=u7(r-(n<<5))+t,r=n}return t}function c7(e,t){let r=~~(e/1073741824),n=e&1073741823;return Pw(Tw(r),t-6)+Pw(Tw(n),6)}function C0(e){return function(r){return c7(r,e)}}function Gc(e){if(typeof e!="string")throw new L("Unsupported type");let t=0,r=1;for(let n=e.length-1;n>=0;--n){let i=l7[e[n]];if(i===void 0)throw new L("Unsupported type");t+=i*r,r*=32}return t}var d7=C0(10),Mw=C0(8);function f7(e){return d7(e[0])+Mw(e[1])+Mw(e[2])}function p7(e){if(typeof e!="string"||e.length!==26)throw new Error("Unsupported type");return[Gc(e.slice(0,10)),Gc(e.slice(10,18)),Gc(e.slice(18))]}function h7(){return B(oe({min:0,max:0xffffffffffff}),oe({min:0,max:0xffffffffff}),oe({min:0,max:0xffffffffff})).map(f7,p7)}function A0(e){return Q4(pi(e,16),8,"0")}function m7(e){if(typeof e!="string")throw new Error("Unsupported type");if(e.length!==8)throw new Error("Unsupported value: invalid length");let t=parseInt(e,16);if(e!==A0(t))throw new Error("Unsupported value: invalid content");return t}function Hc(e,t){return oe({min:e,max:t}).map(A0,m7)}function g7(e){return`${e[0]}-${ge(e[1],4)}-${ge(e[1],0,4)}-${ge(e[2],0,4)}-${ge(e[2],4)}${e[3]}`}var y7=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function b7(e){if(typeof e!="string")throw new Error("Unsupported type");let t=y7.exec(e);if(t===null)throw new Error("Unsupported type");return[t[1],t[3]+t[2],t[4]+ge(t[5],0,4),ge(t[5],4)]}var Ow="0123456789abcdef";function S7(e){let t={},r={};for(let o=0;o!==e.length;++o){let s=Ow[o],a=Ow[e[o]];t[s]=a,r[a]=s}function n(o){return t[o[0]]+ge(o,1)}function i(o){if(typeof o!="string")throw new L("Cannot produce non-string values");let s=r[o[0]];if(s===void 0)throw new L("Cannot produce strings not starting by the version in hexa code");return s+ge(o,1)}return{versionsApplierMapper:n,versionsApplierUnmapper:i}}function w7(e){let t={};for(let r of e){if(t[r])throw new L(`Version ${r} has been requested at least twice for uuid`);if(t[r]=!0,r<1||r>15)throw new L(`Version must be a value in [1-15] for uuid, but received ${r}`);if(~~r!==r)throw new L(`Version must be an integer value for uuid, but received ${r}`)}if(e.length===0)throw new L("Must provide at least one version for uuid")}function v7(e={}){let t=Hc(0,4294967295),r=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];w7(r);let{versionsApplierMapper:n,versionsApplierUnmapper:i}=S7(r);return B(t,Hc(0,268435456*r.length-1).map(n,i),Hc(2147483648,3221225471),t).map(g7,b7)}function x7(e){return Ce({unit:jd("-._~!$&'()*+,;=:"),size:e})}function R7([e,t,r]){return(e===null?"":`${e}@`)+t+(r===null?"":`:${r}`)}function k7(e){if(typeof e!="string")throw new Error("Unsupported");let t=e.indexOf("@"),r=t!==-1?e.substring(0,t):null,n=/:(\d+)$/.exec(e),i=n!==null?Number(n[1]):null;return[r,n!==null?e.substring(t+1,e.length-n[1].length-1):e.substring(t+1),i]}function E7(e){return`[${e}]`}function C7(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function I0(e){let t=e||{},r=t.size,n=[Vd({size:r}),...t.withIPv4===!0?[zd()]:[],...t.withIPv6===!0?[a0().map(E7,C7)]:[],...t.withIPv4Extended===!0?[s0()]:[]];return B(t.withUserInfo===!0?jt(x7(r)):ve(null),Me(...n),t.withPort===!0?jt(Qt(65535)):ve(null)).map(R7,k7)}function P0(e){return Ce({unit:jd("-._~!$&'()*+,;=:@/?"),size:e})}function T0(e={}){return P0(e.size)}function M0(e={}){return Ce({unit:jd("-._~!$&'()*+,;=:@"),size:e.size})}function A7(e){return ce(G(e,t=>`/${t}`),"")}function I7(e){if(typeof e!="string")throw new Error("Incompatible value received: type");if(e.length!==0&&e[0]!=="/")throw new Error("Incompatible value received: start");return t1(Be(e,"/"),1)}function P7(e){switch(e){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 qc(e,t){return ae(M0({size:e}),{size:t}).map(A7,I7)}function T7(e){let[t,r]=P7(e);return t===r?qc(t,r):Me(qc(t,r),qc(r,t))}function O0(e){return T7($d((e||{}).size))}function N0(e={}){return P0(e.size)}function M7(e){let[t,r,n]=e;return`${t}://${r}${n}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var O7=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function N7(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=O7.exec(e);if(t===null)throw new Error("Incompatible value received");let r=t[1],n=t[2],i=t[3],o=t[4],s=t[5];return[r,n,i,o!==void 0?o.substring(1):null,s!==void 0?s.substring(1):null]}function L7(e){let t=e||{},r=$d(t.size),n=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?yi(t.authoritySettings.size,r):r,i={...t.authoritySettings,size:n};return B(vt(...t.validSchemes||["http","https"]),I0(i),O0({size:r}),t.withQueryParameters===!0?jt(N0({size:r})):ve(null),t.withFragments===!0?jt(T0({size:r})):ve(null)).map(M7,N7)}var $7=class L0{constructor(t,r){this.commands=t,this.metadataForReplay=r,this[Oe]=function(){return new L0(this.commands.map(n=>n.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let t=this.commands.filter(n=>n.hasRan).map(n=>n.toString()).join(","),r=this.metadataForReplay();return r.length!==0?`${t} /*${r}*/`:t}},D7=class Sd{constructor(t){if(this.cmd=t,this.hasRan=!1,Ad(t)){let r=t[ft];this[ft]=function(){return r.call(t)}}if(Id(t)){let r=t[Ft];this[Ft]=function(){return r.call(t)}}}check(t){return this.cmd.check(t)}run(t,r){return this.hasRan=!0,this.cmd.run(t,r)}clone(){return vr(this.cmd)?new Sd(this.cmd[Oe]()):new Sd(this.cmd)}toString(){return this.cmd.toString()}},Nw=class{static parse(e){let[t,r]=e.split(":"),n=this.parseCounts(t),i=this.parseChanges(r);return this.parseOccurences(n,i)}static stringify(e){let t=this.countOccurences(e);return`${this.stringifyCounts(t)}:${this.stringifyChanges(t)}`}static intToB64(e){return e<26?String.fromCharCode(e+65):e<52?String.fromCharCode(e+97-26):e<62?String.fromCharCode(e+48-52):String.fromCharCode(e===62?43:47)}static b64ToInt(e){return e>="a"?e.charCodeAt(0)-97+26:e>="A"?e.charCodeAt(0)-65:e>="0"?e.charCodeAt(0)-48+52:e==="+"?62:63}static countOccurences(e){return e.reduce((t,r)=>(t.length===0||t[t.length-1].count===64||t[t.length-1].value!==r?t.push({value:r,count:1}):t[t.length-1].count+=1,t),[])}static parseOccurences(e,t){let r=[];for(let n=0;n!==e.length;++n){let i=e[n],o=t[n];for(let s=0;s!==i;++s)r.push(o)}return r}static stringifyChanges(e){let t="";for(let r=0;r<e.length;r+=6){let n=e.slice(r,r+6).reduceRight((i,o)=>(i<<1)+(o.value?1:0),0);t+=this.intToB64(n)}return t}static parseChanges(e){let t=e.split("").map(n=>this.b64ToInt(n)),r=[];for(let n=0;n!==t.length;++n){let i=t[n];for(let o=0;o!==6;++o,i>>=1)r.push(i%2===1)}return r}static stringifyCounts(e){return e.map(({count:t})=>this.intToB64(t-1)).join("")}static parseCounts(e){return e.split("").map(t=>this.b64ToInt(t)+1)}},_7=class extends de{constructor(e,t,r,n,i){super(),this.sourceReplayPath=n,this.disableReplayLog=i,this.oneCommandArb=Me(...e).map(o=>new D7(o)),this.lengthArb=yd(0,t,r),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(Nw.stringify(this.replayPath))}`}buildValueFor(e,t){let r=e.map(i=>i.value_),n={shrunkOnce:t,items:e};return new _(new $7(r,()=>this.metadataForReplay()),n)}generate(e){let t=this.lengthArb.generate(e,void 0).value,r=Array(t);for(let n=0;n!==t;++n)r[n]=this.oneCommandArb.generate(e,void 0);return this.replayPathPosition=0,this.buildValueFor(r,!1)}canShrinkWithoutContext(e){return!1}filterOnExecution(e){let t=[];for(let r of e)r.value_.hasRan?(this.replayPath.push(!0),t.push(r)):this.replayPath.push(!1);return t}filterOnReplay(e){return e.filter((t,r)=>{let n=this.replayPath[this.replayPathPosition+r];if(n===void 0)throw new Error("Too short replayPath");if(!n&&t.value_.hasRan)throw new Error("Mismatch between replayPath and real execution");return n})}filterForShrinkImpl(e){this.replayPathPosition===0&&(this.replayPath=this.sourceReplayPath!==null?Nw.parse(this.sourceReplayPath):[]);let t=this.replayPathPosition<this.replayPath.length?this.filterOnReplay(e):this.filterOnExecution(e);return this.replayPathPosition+=e.length,t}shrink(e,t){if(t===void 0)return j.nil();let r=t,n=r.shrunkOnce,i=r.items,o=this.filterForShrinkImpl(i);if(o.length===0)return j.nil();let s=n?j.nil():new j([[]][Symbol.iterator]()),a=[];for(let l=0;l!==o.length;++l)a.push(er(()=>{let u=o.slice(0,l);return this.lengthArb.shrink(o.length-1-l,void 0).map(c=>u.concat(o.slice(o.length-(c.value+1))))}));for(let l=0;l!==o.length;++l)a.push(er(()=>this.oneCommandArb.shrink(o[l].value_,o[l].context).map(u=>o.slice(0,l).concat([u],o.slice(l+1)))));return s.join(...a).map(l=>this.buildValueFor(l.map(u=>new _(u.value_.clone(),u.context)),!0))}};function F7(e,t={}){let{size:r,maxCommands:n=xr,disableReplayLog:i=!1,replayPath:o=null}=t;return new _7(e,mi(r,0,n,t.maxCommands!==void 0),n,o,i)}var j7=class{constructor(e,t){this.s=e,this.cmd=t}async check(e){let t=null,r=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{r=await Promise.resolve(this.cmd.check(e))}catch(n){throw t=n,n}}}]).task).faulty)throw t;return r}async run(e,t){let r=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(e,t)}catch(n){throw r=n,n}}}]).task).faulty)throw r}},V7=function*(e,t){for(let r of t)yield new j7(e,r)},$0=(e,t,r,n,i)=>e.then(o=>{let{model:s,real:a}=o,l=r;for(let u of t)l=i(l,()=>n(u,s,a));return l}),B7=(e,t)=>$0({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),U7=e=>typeof e.then=="function",D0=async(e,t,r=Promise.resolve())=>await $0({then:s=>{let a=e();return U7(a)?a.then(s):s(a)}},t,r,async(s,a,l)=>{await s.check(a)&&await s.run(a,l)},(s,a)=>s.then(a));function W7(e,t){B7(e,t)}async function z7(e,t){await D0(e,t)}async function G7(e,t,r){let n=D0(t,V7(e,r),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(n),await e.waitAll()}var Os=e=>e(),_0=class wd{constructor(t,r){this.act=t,this.taskSelector=r,this.lastTaskId=0,this.sourceTaskSelector=r.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Oe]=function(){return new wd(this.act,this.sourceTaskSelector)}}static buildLog(t){return`[task\${${t.taskId}}] ${t.label.length!==0?`${t.schedulingType}::${t.label}`:t.schedulingType} ${t.status}${t.outputValue!==void 0?` with value ${Y$(t.outputValue)}`:""}`}log(t,r,n,i,o,s){this.triggeredTasks.push({status:o,schedulingType:t,taskId:r,label:n,metadata:i,outputValue:s!==void 0?xe(s):void 0})}scheduleInternal(t,r,n,i,o,s){let a=++this.lastTaskId,l,u=new Promise((c,d)=>{l=()=>{let p=Promise.resolve(s!==void 0?n.then(()=>s()):n);return p.then(h=>{this.log(t,a,r,i,"resolved",h),c(h)},h=>{this.log(t,a,r,i,"rejected",h),d(h)}),p}});return this.scheduledTasks.push({original:n,trigger:l,schedulingType:t,taskId:a,label:r,metadata:i,customAct:o}),this.scheduledWatchers.length!==0&&this.scheduledWatchers[0](),u}schedule(t,r,n,i){return this.scheduleInternal("promise",r||"",t,n,i||Os)}scheduleFunction(t,r){return(...n)=>this.scheduleInternal("function",`${t.name}(${n.map(xe).join(",")})`,t(...n),void 0,r||Os)}scheduleSequence(t,r){let n={done:!1,faulty:!1},i={then:c=>c()},o=()=>{},s=new Promise(c=>{o=()=>c({done:n.done,faulty:n.faulty})}),a=()=>{n.faulty=!0,o()},l=()=>{n.done=!0,o()},u=(c,d)=>{if(c>=t.length){d.then(l,a);return}d.then(()=>{let p=t[c],[h,f,m]=typeof p=="function"?[p,p.name,void 0]:[p.builder,p.label,p.metadata],g=this.scheduleInternal("sequence",f,i,m,r||Os,()=>h());u(c+1,g)},a)};return u(0,i),Object.assign(n,{task:s})}count(){return this.scheduledTasks.length}internalWaitOne(){if(this.scheduledTasks.length===0)throw new Error("No task scheduled");let t=this.taskSelector.nextTaskIndex(this.scheduledTasks),[r]=this.scheduledTasks.splice(t,1);return r.customAct(()=>r.trigger().catch(n=>{}))}waitOne(t){let r=t||Os;return this.act(()=>r(()=>this.internalWaitOne()))}async waitAll(t){for(;this.scheduledTasks.length>0;)await this.waitOne(t)}async internalWaitFor(t,r){let n=!1,i=r.customAct,o=r.onWaitStart,s=r.onWaitIdle,a=r.launchAwaiterOnInit,l,u,c=0,d=null,p=null,h=async()=>{for(c=50,c=50;!n&&c>0;--c)await Promise.resolve();if(!n&&this.scheduledTasks.length>0)return o!==void 0&&o(),p=this.waitOne(i),p.then(()=>(p=null,h()),S=>{throw p=null,n=!0,u(S),S});!n&&s!==void 0&&s(),d=null},f=()=>{if(d!==null){c=51;return}d=h().catch(()=>{})},m=()=>{let S=this.scheduledWatchers.indexOf(f);S!==-1&&this.scheduledWatchers.splice(S,1),S===0&&this.scheduledWatchers.length!==0&&this.scheduledWatchers[0]()},g=new Promise((S,w)=>{l=y=>{m(),S(y)},u=y=>{m(),w(y)}});return t.then(S=>{n=!0,p===null?l(S):p.then(()=>l(S),w=>u(w))},S=>{n=!0,p===null?u(S):p.then(()=>u(S),()=>u(S))}),(this.scheduledTasks.length>0||a)&&this.scheduledWatchers.length===0&&f(),this.scheduledWatchers.push(f),g}waitNext(t,r){let n,i=t,o=i<=0?Promise.resolve():new Promise(s=>{n=()=>{--i<=0&&s()}});return this.internalWaitFor(o,{customAct:r,onWaitStart:n,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(t){let r,n=new Promise(i=>r=i);return this.internalWaitFor(n,{customAct:t,onWaitStart:void 0,onWaitIdle:r,launchAwaiterOnInit:!0})}waitFor(t,r){return this.internalWaitFor(t,{customAct:r,onWaitStart:void 0,onWaitIdle:void 0,launchAwaiterOnInit:!1})}report(){return[...this.triggeredTasks,...this.scheduledTasks.map(t=>({status:"pending",schedulingType:t.schedulingType,taskId:t.taskId,label:t.label,metadata:t.metadata}))]}toString(){return"schedulerFor()`\n"+this.report().map(wd.buildLog).map(t=>`-> ${t}`).join(`
132
+ `)+"`"}};function F0(e){let t=0;return{clone:()=>F0(e),nextTaskIndex:r=>{if(e.length<=t)throw new Error("Invalid schedulerFor defined: too many tasks have been scheduled");let n=r.findIndex(i=>i.taskId===e[t]);if(n===-1)throw new Error("Invalid schedulerFor defined: unable to find next task");return++t,n}}}function Lw(e,t){return new _0(e,F0(t))}function j0(e){let t=e.clone();return{clone:()=>j0(t),nextTaskIndex:r=>e.nextInt(0,r.length-1)}}var H7=class extends de{constructor(e){super(),this.act=e}generate(e,t){return new _(new _0(this.act,j0(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function q7(e){let{act:t=r=>r()}=e||{};return new H7(t)}function K7(e,t){let{act:r=n=>n()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?Lw(r,e):function(n,...i){return Lw(r,i)}}function Y7(e={}){return Vt(e,O("-9223372036854775808"),O("9223372036854775807"),i4,rr)}function J7(e={}){return Vt(e,O(0),O("18446744073709551615"),o4,rr)}function Z7(e,t){return t}var Kc=Math.floor,X7=Math.min;function et(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let r=et(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:r.astNode},minLength:0}}case"+":{let r=et(e.expression,t),n=r.minLength>1?r.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:Kc(t/n)},expression:r.astNode},minLength:r.minLength}}case"?":{let r=et(e.expression,t);return t<r.minLength?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:0},expression:r.astNode},minLength:0}:{astNode:{...e,expression:r.astNode},minLength:0}}case"Range":{let r=e.quantifier.from>1?Kc(t/e.quantifier.from):t,n=et(e.expression,r),i=n.minLength>1?n.minLength:1;return e.quantifier.to===void 0||e.quantifier.to*i>t?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",to:Kc(t/i)},expression:n.astNode},minLength:e.quantifier.from*n.minLength}:{astNode:{...e,expression:n.astNode},minLength:e.quantifier.from*n.minLength}}default:return Z7(e.quantifier,{astNode:e,minLength:0})}case"Quantifier":return{astNode:e,minLength:0};case"Alternative":{let r=0,n=[];for(let o=0;o!==e.expressions.length;++o){let s=t-r,a=et(e.expressions[o],s);r+=a.minLength,$(n,{value:a,allowance:s})}let i=[];for(let o=0;o!==n.length;++o){let s=n[o].value,a=n[o].allowance,l=t-r+s.minLength;$(i,(l!==a?et(s.astNode,l):s).astNode)}return{astNode:{...e,expressions:i},minLength:r}}case"CharacterClass":return{astNode:e,minLength:1};case"ClassRange":return{astNode:e,minLength:1};case"Group":{let r=et(e.expression,t);return{astNode:{...e,expression:r.astNode},minLength:r.minLength}}case"Disjunction":{if(e.left===null){if(e.right===null)return{astNode:e,minLength:0};let i=et(e.right,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:null,right:o},minLength:0}}if(e.right===null){let i=et(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let r=et(e.left,t),n=et(e.right,t);return r.minLength>t?n:n.minLength>t?r:{astNode:{...e,left:r.astNode,right:n.astNode},minLength:X7(r.minLength,n.minLength)}}case"Assertion":return{astNode:e,minLength:0};case"Backreference":return{astNode:e,minLength:0};case"UnicodeProperty":return{astNode:e,minLength:1}}}function Q7(e,t){return et(e,t).astNode}function e8(e){return new Error(`Unsupported AST node! Received: ${xe(e)}`)}function js(e,t,r){if(!t&&!r)return e;let n={hasStart:!1,hasEnd:!1},i=V0(e,t,r,n),o=t&&!n.hasStart,s=r&&!n.hasEnd;if(!o&&!s)return i;let a=[];return o&&(a.push({type:"Assertion",kind:"^"}),a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}})),a.push(i),s&&(a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}}),a.push({type:"Assertion",kind:"$"})),{type:"Group",capturing:!1,expression:{type:"Alternative",expressions:a}}}function V0(e,t,r,n){switch(e.type){case"Char":return e;case"Repetition":return e;case"Quantifier":throw new Error("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return n.hasStart=!0,n.hasEnd=!0,{...e,expressions:e.expressions.map((i,o)=>js(i,t&&o===0,r&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:V0(e.expression,t,r,n)};case"Disjunction":return n.hasStart=!0,n.hasEnd=!0,{...e,left:e.left!==null?js(e.left,t,r):null,right:e.right!==null?js(e.right,t,r):null};case"Assertion":if(e.kind==="^"||e.kind==="Lookahead")return n.hasStart=!0,e;if(e.kind==="$"||e.kind==="Lookbehind")return n.hasEnd=!0,e;throw new Error(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":return e;case"UnicodeProperty":return e;default:throw e8(e)}}function t8(e){return js(e,!0,!0)}function $w(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Ee(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function vd(e){return e>="0"&&e<="9"}function B0(e,t){for(let r=t;r!==e.length;++r){let n=e[r];if(n==="\\")r+=1;else if(n==="]")return r}throw new Error("Missing closing ']'")}function r8(e,t){let r=0;for(let n=t;n!==e.length;++n){let i=e[n];if(i==="\\")n+=1;else if(i===")"){if(r===0)return n;r-=1}else i==="["?n=B0(e,n):i==="("&&(r+=1)}throw new Error("Missing closing ')'")}function n8(e,t){let r=!1;for(let n=t;n!==e.length;++n){let i=e[n];if(!vd(i)){if(t===n)return-1;if(i===","){if(r)return-1;r=!0}else return i==="}"?n:-1}}return-1}function i8(e,t,r,n){switch(e[t]){case"[":return n===1?t+1:B0(e,t+1)+1;case"{":{if(n===1)return t+1;let i=n8(e,t+1);return i===-1?t+1:i+1}case"(":return n===1?t+1:r8(e,t+1)+1;case"]":case"}":case")":return t+1;case"\\":{let i=e[t+1];switch(i){case"x":if(Ee(e[t+2])&&Ee(e[t+3]))return t+4;throw new Error(`Unexpected token '${e.substring(t,t+4)}' found`);case"u":if(e[t+2]==="{"){if(!r)return t+2;if(e[t+4]==="}"){if(Ee(e[t+3]))return t+5;throw new Error(`Unexpected token '${e.substring(t,t+5)}' found`)}if(e[t+5]==="}"){if(Ee(e[t+3])&&Ee(e[t+4]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`)}if(e[t+6]==="}"){if(Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5]))return t+7;throw new Error(`Unexpected token '${e.substring(t,t+7)}' found`)}if(e[t+7]==="}"){if(Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5])&&Ee(e[t+6]))return t+8;throw new Error(`Unexpected token '${e.substring(t,t+8)}' found`)}if(e[t+8]==="}"&&Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5])&&Ee(e[t+6])&&Ee(e[t+7]))return t+9;throw new Error(`Unexpected token '${e.substring(t,t+9)}' found`)}if(Ee(e[t+2])&&Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`);case"p":case"P":{if(!r)return t+2;let o=t+2;for(;o<e.length&&e[o]!=="}";o+=e[o]==="\\"?2:1);if(e[o]!=="}")throw new Error("Invalid \\P definition");return o+1}case"k":{let o=t+2;for(;o<e.length&&e[o]!==">";++o);if(e[o]!==">"){if(!r)return t+2;throw new Error("Invalid \\k definition")}return o+1}default:if(vd(i)){let o=r?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&vd(e[s]);++s);return s}return t+(r?$w(e,t+1):1)+1}}default:return t+(r?$w(e,t):1)}}function Ns(e,t,r,n){let i=i8(e,t,r,n);return e.substring(t,i)}var Dw={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},Ys={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"},gi=Kd(Ys),qd={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"},xd=Kd(qd),U0={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"},_w=Kd(U0);function Kd(e){let t={};for(let r of Object.keys(e)){let n=e[r];if(Array.isArray(n))for(let i=0;i!==n.length;++i)t[n[i]]=r;else t[n]=r}return t}function o8(e){return e in qd||e in xd}function s8(e){return e in Ys||e in gi}function Fw(e){if(e in Dw)return Dw[e];if(e in gi)return gi[e];if(e in Ys||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function jw(e){if(e in xd)return xd[e];if(e in _w)return _w[e];if(e in gi)return gi[e];if(e in qd||e in U0||e in Ys)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function a8(e,t){let r=e.indexOf("=");if(r!==-1){let n=e.substring(0,r),i=e.substring(r+1);return{type:"UnicodeProperty",name:n,value:i,negative:t,shorthand:!1,binary:!1,canonicalName:Fw(n),canonicalValue:jw(i)}}if(o8(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:jw(e)};if(s8(e)){let n=Fw(e);return{type:"UnicodeProperty",name:e,value:e,negative:t,shorthand:!1,binary:!0,canonicalName:n,canonicalValue:n}}throw new Error(`Invalid Unicode property: ${e}`)}var Yc=String.fromCodePoint;function Jc(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function W0(e){return e>="0"&&e<="9"}function Vs(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function Qr(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function Zt(e,t){if(e.length>1)return{type:"Alternative",expressions:e};if(!t&&e.length===0)throw new Error("Unsupported no token");return e[0]}function Zc(e){if(e[0]==="\\"){let t=e[1];switch(t){case"x":{let r=e.substring(2),n=Number.parseInt(r,16);return{type:"Char",kind:"hex",symbol:Yc(n),value:e,codePoint:n}}case"u":{if(e==="\\u")return Vs("u",!0);let r=e[2]==="{"?e.substring(3,e.length-1):e.substring(2),n=Number.parseInt(r,16);return{type:"Char",kind:"unicode",symbol:Yc(n),value:e,codePoint:n}}case"0":return Qr(e,"\0");case"n":return Qr(e,`
133
+ `);case"f":return Qr(e,"\f");case"r":return Qr(e,"\r");case"t":return Qr(e," ");case"v":return Qr(e,"\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:e,codePoint:NaN};default:if(W0(t)){let r=e.substring(1),n=Number(r);return{type:"Char",kind:"decimal",symbol:Yc(n),value:e,codePoint:n}}if(e.length>2&&(t==="p"||t==="P")){let r=t==="P";return a8(e.substring(3,e.length-1),r)}return Vs(e.substring(1),!0)}}return Vs(e)}function en(e,t,r,n){let i=null;for(let o=0,s=Ns(t,o,r,0);o!==t.length;o+=s.length,s=Ns(t,o,r,0)){let a=s[0];switch(a){case"|":i===null&&(i=[]),i.push(Zt(e.splice(0),!0)||null);break;case".":e.push({type:"Char",kind:"meta",symbol:s,value:s,codePoint:NaN});break;case"*":case"+":{let l=Jc(e);e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"?":{let l=Jc(e);l.type==="Repetition"?(l.quantifier.greedy=!1,e.push(l)):e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"{":{if(s==="{"){e.push(Vs(s));break}let l=Jc(e),u=s.substring(1,s.length-1).split(","),c=Number(u[0]),d=u.length===1?c:u[1].length!==0?Number(u[1]):void 0;e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:"Range",greedy:!0,from:c,to:d}});break}case"[":{let l=s.substring(1,s.length-1),u=[],c,d=!1;for(let p=0,h=Ns(l,p,r,1);p!==l.length;p+=h.length,h=Ns(l,p,r,1)){if(p===0&&h==="^"){c=!0;continue}let f=Zc(h);if(h==="-")u.push(f),d=!0;else{let m=u.length>=2?u[u.length-2]:void 0;d&&m!==void 0&&m.type==="Char"&&f.type==="Char"?(u.pop(),u.pop(),u.push({type:"ClassRange",from:m,to:f})):u.push(f),d=!1}}e.push({type:"CharacterClass",expressions:u,negative:c});break}case"(":{let l=s.substring(1,s.length-1),u=[];if(l[0]==="?")if(l[1]===":")en(u,l.substring(2),r,n),e.push({type:"Group",capturing:!1,expression:Zt(u)});else if(l[1]==="="||l[1]==="!")en(u,l.substring(2),r,n),e.push({type:"Assertion",kind:"Lookahead",negative:l[1]==="!"?!0:void 0,assertion:Zt(u)});else if(l[1]==="<"&&(l[2]==="="||l[2]==="!"))en(u,l.substring(3),r,n),e.push({type:"Assertion",kind:"Lookbehind",negative:l[2]==="!"?!0:void 0,assertion:Zt(u)});else{let c=l.split(">");if(c.length<2||c[0][1]!=="<")throw new Error(`Unsupported regex content found at ${JSON.stringify(s)}`);let d=++n.lastIndex,p=c[0].substring(2);n.named.set(p,d),en(u,c.slice(1).join(">"),r,n),e.push({type:"Group",capturing:!0,nameRaw:p,name:p,number:d,expression:Zt(u)})}else{let c=++n.lastIndex;en(u,l,r,n),e.push({type:"Group",capturing:!0,number:c,expression:Zt(u)})}break}default:if(s==="^")e.push({type:"Assertion",kind:s});else if(s==="$")e.push({type:"Assertion",kind:s});else if(s[0]==="\\"&&W0(s[1])){let l=Number(s.substring(1));r||l<=n.lastIndex?e.push({type:"Backreference",kind:"number",number:l,reference:l}):e.push(Zc(s))}else if(s[0]==="\\"&&s[1]==="k"&&s.length!==2){let l=s.substring(3,s.length-1);e.push({type:"Backreference",kind:"name",number:n.named.get(l)||0,referenceRaw:l,reference:l})}else e.push(Zc(s));break}}if(i!==null){i.push(Zt(e.splice(0),!0)||null);let o={type:"Disjunction",left:i[0],right:i[1]};for(let s=2;s<i.length;++s)o={type:"Disjunction",left:o,right:i[s]};e.push(o)}}function l8(e){let t=$t([...e.flags],"u")!==-1,r=e.source,n=[];return en(n,r,t,{lastIndex:0,named:new Map}),Zt(n)}var u8=String.fromCodePoint;function c8(e){return e.binary||e.shorthand?e.canonicalValue:`${e.canonicalName}=${e.canonicalValue}`}function Vw(e,t,r,n){let i=-1;for(let o=t;o<=r;++o)if(e.test(u8(o)))i===-1&&(i=o);else if(i!==-1){let s=o-1;n.push(i===s?[s]:[i,s]),i=-1}i!==-1&&n.push(i===r?[r]:[i,r])}function d8(e,t){let r=new RegExp(`^\\${t?"P":"p"}{${e}}$`,"u"),n=[];return Vw(r,0,55295,n),Vw(r,57344,1114111,n),n}var Bw=new Map;function f8(e,t){let r=`${t?"P":"p"}:${e}`,n=Bw.get(r);if(n!==void 0)return n;let i=d8(e,t);return Bw.set(r,i),i}function p8(e){return an(...G(f8(c8(e),e.negative),t=>id(t)))}var h8=String.fromCodePoint,Uw=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],Ww=[..."0123456789"],zw=[...` \r
134
+ \v\f`],Rd=[...`\r
135
+ `],z0=[...""],m8=[...Rd,...z0],wr=()=>Ce({unit:"grapheme-ascii",minLength:1,maxLength:1});function Gw(e){return new L(`Unsupported AST node! Received: ${xe(e)}`)}function Xt(e,t,r){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return vt(...Uw);case"\\W":return wr().filter(n=>$t(Uw,n)===-1);case"\\d":return vt(...Ww);case"\\D":return wr().filter(n=>$t(Ww,n)===-1);case"\\s":return vt(...zw);case"\\S":return wr().filter(n=>$t(zw,n)===-1);case"\\b":case"\\B":throw new L(`Meta character ${e.value} not implemented yet!`);case".":{let n=r.dotAll?z0:m8;return wr().filter(i=>$t(n,i)===-1)}}if(e.symbol===void 0)throw new L(`Unexpected undefined symbol received for non-meta Char! Received: ${xe(e)}`);return ve(e.symbol);case"Repetition":{let n=Xt(e.expression,t,r);switch(e.quantifier.kind){case"*":return Ce({...t,unit:n});case"+":return Ce({...t,minLength:1,unit:n});case"?":return Ce({...t,minLength:0,maxLength:1,unit:n});case"Range":return Ce({...t,minLength:e.quantifier.from,maxLength:e.quantifier.to,unit:n});default:throw Gw(e.quantifier)}}case"Quantifier":throw new L("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return B(...G(e.expressions,n=>Xt(n,t,r))).map(n=>ce(n,""));case"CharacterClass":if(e.negative){let n=G(e.expressions,i=>Xt(i,t,r));return wr().filter(i=>n1(n,o=>!o.canShrinkWithoutContext(i)))}return Me(...G(e.expressions,n=>Xt(n,t,r)));case"ClassRange":{let n=e.from.codePoint,i=e.to.codePoint;return oe({min:n,max:i}).map(o=>h8(o),o=>{if(typeof o!="string")throw new L("Invalid type");if([...o].length!==1)throw new L("Invalid length");return nn(o,0)})}case"Group":return Xt(e.expression,t,r);case"Disjunction":return Me(e.left!==null?Xt(e.left,t,r):ve(""),e.right!==null?Xt(e.right,t,r):ve(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return r.multiline?e.kind==="^"?Me(ve(""),B(Ce({unit:wr()}),vt(...Rd)).map(n=>`${n[0]}${n[1]}`,n=>{if(typeof n!="string"||n.length===0)throw new L("Invalid type");return[ge(n,0,n.length-1),n[n.length-1]]})):Me(ve(""),B(vt(...Rd),Ce({unit:wr()})).map(n=>`${n[0]}${n[1]}`,n=>{if(typeof n!="string"||n.length===0)throw new L("Invalid type");return[n[0],ge(n,1)]})):ve("");throw new L(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":throw new L("Backreference nodes not implemented yet!");case"UnicodeProperty":return p8(e);default:throw Gw(e)}}function g8(e,t={}){for(let a of e.flags)if(a!=="d"&&a!=="g"&&a!=="m"&&a!=="s"&&a!=="u")throw new L(`Unable to use "stringMatching" against a regex using the flag ${a}`);let r=t.maxLength,n={size:t.size,maxLength:r},i={multiline:e.multiline,dotAll:e.dotAll},o=t8(l8(e));r!==void 0&&(o=Q7(o,r));let s=Xt(o,n,i);return r!==void 0?s.filter(a=>[...a].length<=r):s}function y8(e){let t=[];for(let r=0;r!==e.length;++r)t.push(e[r].next());return t}function b8(e,t){for(let r=0;r!==e.length;++r)t[r]=e[r].next()}function S8(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*w8(...e){let t=y8(e);for(;!S8(t);)yield t.map(r=>r.value),b8(e,t)}function*v8(e){let t=e;for(;;)yield t,++t}var x8=class extends de{constructor(e,t){super(),this.arb=e,this.maxShrinks=t}generate(e,t){let r=this.arb.generate(e,t);return this.valueMapper(r,0)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return this.isSafeContext(t)?this.safeShrink(e,t.originalContext,t.length):this.safeShrink(e,void 0,0)}safeShrink(e,t,r){let n=this.maxShrinks-r;return n<=0?j.nil():new j(w8(this.arb.shrink(e,t),v8(r+1))).take(n).map(i=>this.valueMapper(i[0],i[1]))}valueMapper(e,t){let r={originalContext:e.context,length:t};return new _(e.value,r)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalContext"in e&&"length"in e}};function R8(e,t){return new x8(e,t)}var k8=Ob({Arbitrary:()=>de,ExecutionStatus:()=>FN,PreconditionFailure:()=>nr,Random:()=>Td,Stream:()=>j,Value:()=>_,VerbosityLevel:()=>gN,__commitHash:()=>A8,__type:()=>E8,__version:()=>C8,anything:()=>R0,array:()=>ae,assert:()=>s3,asyncDefaultReportMessage:()=>x1,asyncModelRun:()=>z7,asyncProperty:()=>hN,asyncStringify:()=>Pd,asyncToStringMethod:()=>Ft,base64String:()=>t7,bigInt:()=>rr,bigInt64Array:()=>Y7,bigUint64Array:()=>J7,boolean:()=>bi,chainUntil:()=>J3,check:()=>k1,clone:()=>tL,cloneIfNeeded:()=>tn,cloneMethod:()=>Oe,commands:()=>F7,compareBooleanFunc:()=>eD,compareFunc:()=>rD,configureGlobal:()=>dN,constant:()=>ve,constantFrom:()=>vt,context:()=>z3,createDepthIdentifier:()=>Nd,date:()=>D1,defaultReportMessage:()=>v1,dictionary:()=>Dd,domain:()=>Vd,double:()=>Ks,emailAddress:()=>h$,entityGraph:()=>e_,falsy:()=>U3,float:()=>r0,float32Array:()=>c0,float64Array:()=>d0,func:()=>oD,gen:()=>m3,getDepthContextFor:()=>Od,hasAsyncToStringMethod:()=>Id,hasCloneMethod:()=>vr,hasToStringMethod:()=>Ad,hash:()=>Gs,infiniteStream:()=>K_,int16Array:()=>f0,int32Array:()=>p0,int8Array:()=>h0,integer:()=>oe,ipV4:()=>zd,ipV4Extended:()=>s0,ipV6:()=>a0,json:()=>G_,jsonValue:()=>k0,letrec:()=>l0,limitShrink:()=>R8,lorem:()=>l_,map:()=>gd,mapToConstant:()=>an,maxSafeInteger:()=>o0,maxSafeNat:()=>uD,memo:()=>f_,mixedCase:()=>b_,modelRun:()=>W7,nat:()=>Qt,noBias:()=>zs,noShrink:()=>Hs,object:()=>V_,oneof:()=>Me,option:()=>jt,pre:()=>B6,property:()=>mN,readConfigureGlobal:()=>dt,record:()=>md,resetConfigureGlobal:()=>fN,sample:()=>l3,scheduledModelRun:()=>G7,scheduler:()=>q7,schedulerFor:()=>K7,set:()=>w0,shuffledSubarray:()=>s7,sparseArray:()=>S0,statistics:()=>c3,stream:()=>tr,string:()=>Ce,stringMatching:()=>g8,stringify:()=>xe,subarray:()=>o7,toStringMethod:()=>ft,tuple:()=>B,uint16Array:()=>m0,uint32Array:()=>g0,uint8Array:()=>y0,uint8ClampedArray:()=>b0,ulid:()=>h7,uniqueArray:()=>Rr,uuid:()=>v7,webAuthority:()=>I0,webFragments:()=>T0,webPath:()=>O0,webQueryParameters:()=>N0,webSegment:()=>M0,webUrl:()=>L7}),E8="module",C8="4.8.0",A8="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",Ne=k8;function Js(e){return e?.values!=null&&e.values.length>0?Ne.constantFrom(...e.values):I8(e)}function I8(e){if(e?.type==="number")return Ne.integer();if(e?.type==="boolean")return Ne.boolean();let t=e?.generator==null?void 0:T8[e.generator];if(t!=null)return t;let r=e?.constraints?.kind==="string"?e.constraints:void 0;return Ne.string({maxLength:r?.maxLength,minLength:r?.minLength??1}).filter(n=>n.trim().length>0&&n===n.trim())}var P8="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],ln=e=>Ne.array(Ne.constantFrom(...P8),{maxLength:e,minLength:1}).map(t=>t.join("")),Yd=(e,t)=>Ne.array(ln(10),{maxLength:t,minLength:1}).map(r=>r.join(e)),T8={"company.name":Yd(" ",3),"date.iso":M8(),"internet.email":O8(),"internet.url":N8(),"lorem.slug":Yd("-",3),"lorem.word":ln(10),"person.fullName":Yd(" ",2)};function M8(){return Ne.date({max:new Date("2030-12-31T23:59:59.999Z"),min:new Date("2020-01-01T00:00:00.000Z"),noInvalidDate:!0}).map(e=>e.toISOString())}function O8(){return Ne.tuple(ln(12),ln(10),Ne.constantFrom("com","dev","io","org","ai")).map(([e,t,r])=>`${e}@${t}.${r}`)}function N8(){return Ne.tuple(Ne.constantFrom("http","https"),ln(12),Ne.constantFrom("app","com","dev","io","org"),Ne.array(ln(8),{maxLength:3})).map(([e,t,r,n])=>{let i=n.length===0?"":`/${n.join("/")}`;return`${e}://${t}.${r}${i}`})}var G0=new WeakMap;function Jd(e){let t=G0.get(e);if(t!=null)return t;let r=Object.fromEntries(Object.entries(e.paramSpaces).map(([n,i])=>[n,$8(i)]));return G0.set(e,r),r}var L8=24301;function $8(e){let[t]=Ne.sample(Js(e),{numRuns:1,seed:L8});if(t==null)throw new Error("arbitrary produced no sample");return t}function Si(e){return{aborted:!0,findings:[],fired:[],teardown:e}}function Xd(e,t){return new D8(_8(e,t))}async function _8({browser:e,hub:t,request:r},n){if(n.aborted)return Zd(Si("skipped"));let i=W8({lockfile:r.lockfile,options:r.options,runId:r.runId,signal:n}),o=async s=>{try{return Zd(await j8({browser:e,established:s,hub:t,request:r,signal:n}))}catch(a){return H0(wn(a))}};return U8(i,r).match(o,s=>F8(s,i.teardown))}async function F8(e,t){return e.kind!=="aborted"?H0(e):Zd(Si(await q0(t)))}function q0(e){return e().match(()=>"done",()=>"failed")}async function j8(e){let t=await V8(e);if(t.kind==="completed")return await e.established.teardown().match(ro,Kp),{aborted:!1,...t.result};let r=await q0(e.established.teardown);if(t.kind==="aborted")return Si(r);throw t.error}async function V8({browser:e,established:t,hub:r,request:n,signal:i}){try{Ht(i);let{close:o,driver:s,emitAssertion:a}=await _l({baseUrl:n.options.baseUrl,browser:e,capture:n.capture?{hub:r,runId:n.runId}:null,clientState:t.clientState,engine:Nl(G8(n.lockfile)),reader:t.reader,session:t.auth});try{return n.onEvent?.({aliases:t.aliases,generated:t.generated,generatedSingletons:t.generatedSingletons,kind:"world"}),{kind:"completed",result:await Pl({canon:Ka(n.lockfile),classify:qa(n.lockfile),driver:s,initialState:{snapshot:t.snapshot},onAssertion:a,onEvent:n.onEvent??ro,sequence:n.sequence??B8(n.lockfile,n.testName,n.params),...vc(n.lockfile)},i)}}finally{await o()}}catch(o){return th(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function B8(e,t,r){return co(e,t).map(n=>({params:{...Jd(n),...r},transition:n}))}function U8(e,t){return Pn(t.lockfile,t.testName,{generate:Ol(Ml(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(r=>({aliases:r.aliases,auth:r.auth,clientState:r.clientState,generated:r.generated,generatedSingletons:r.generatedSingletons,reader:e.reader,snapshot:r.snapshot,teardown:e.teardown}))}function W8({lockfile:e,options:t,runId:r,signal:n}){let i=Bl({baseUrl:t.engineUrl,runId:r,secret:t.secret},n);return{materialize:pl(i.setupWorld),reader:Vl(e.entities,z8(e),i.query),teardown:i.teardown}}function z8(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function G8(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}function Y8({clientVersion:e,debugDir:t,headed:r,writeOtlpPortFile:n}){let i=dm({headed:r}),o,s,a=async()=>(o??=wc({clientVersion:e,debugDir:t,writeOtlpPortFile:n}),s=await o,s),l=async(c,d)=>{if(d.aborted)return q8(Si("skipped"));try{let p=await a();return c.options.headed&&!r?await Fl(!0,async h=>Xd({browser:h,hub:p,request:c},d)):await Xd({browser:await i.acquire(),hub:p,request:c},d)}catch(p){return H8(wn(p))}};return{close:async()=>{await i.close();let c=o;o=void 0,s=void 0,c!=null&&await c.then(d=>d.close()).catch(()=>{})},injectSpan:(c,d)=>{s?.injectSpan(c,d)},runOnce:(c,d)=>new K8(l(c,d))}}function wi(e,t){let r=e.axes.flatMap(n=>n.classify(t).map(([i,o])=>`${i}:${o}`));return[t.label,...r.toSorted((n,i)=>n.localeCompare(i))].join("|")}function Qd(e){return e.axes.map(t=>t.name).join("+")}function ef(e){return{name:`counts(${e})`,classify:({pre:t})=>[...t.entities].flatMap(([r,n])=>n.size===0?[]:[[r,Z8(e,n.size)]])}}function tf(e){let t=K0(e);return{name:"enum-fields",classify:({pre:r})=>[...r.entities].flatMap(([n,i])=>[...i.values()].flatMap(o=>J8(n,o,t)))}}function J8(e,t,r){return Object.entries(t).flatMap(([n,i])=>r.has(`${e}.${n}`)?[[`${e}.${n}`,X8(i)]]:[])}function K0(e){let t=e.valueSpaces.flatMap(n=>n.values==null?[]:[n.name]),r=new Set(t);return new Set(e.entities.flatMap(n=>Object.entries(n.props).flatMap(([i,o])=>o.type==="boolean"||o.valueSpace!=null&&r.has(o.valueSpace)?[`${n.name}.${i}`]:[])))}function Z8(e,t){return e==="presence"?"1+":e==="unit"?t===1?"1":"2+":t<=2?String(t):"3+"}function X8(e){return e==null?"\u2205":String(e)}import{createHash as Q8}from"crypto";import{appendFile as e9,mkdir as t9,readFile as r9}from"fs/promises";import n9 from"path";import{ResultAsync as J0}from"neverthrow";import{z as R}from"zod";var un=R.enum(["crash","invariant","law","frame"]),Y0=R.object({intent:R.string().min(1),test:R.string().min(1)}),i9=R.union([R.object({kind:R.literal("singleton-mismatch"),singleton:R.string().min(1)}),R.object({entity:R.string().min(1),kind:R.string().min(1)})]),Z0=R.discriminatedUnion("kind",[R.object({divergence:i9,kind:R.literal("consistency"),layer:un,step:Y0.nullable()}),R.object({kind:R.literal("obligation"),layer:un,source:R.string().min(1),step:Y0}),R.object({intent:R.string().min(1),kind:R.literal("unfireable"),layer:un,reason:R.string().min(1),test:R.string().min(1)}),R.object({error:R.string().min(1),kind:R.literal("driver-error"),layer:un,step:R.string().min(1)}),R.object({kind:R.literal("illegal-transition"),layer:un,step:R.string().min(1)})]),o9=R.object({actionHash:R.string().min(1),at:R.string().min(1),kind:R.literal("covered"),lensId:R.string().min(1),targetKey:R.string().min(1)}),s9=R.object({actionHash:R.string().min(1),at:R.string().min(1),depot:R.string().min(1),evidence:R.array(R.string().min(1)),kind:R.literal("finding"),lensId:R.string().min(1),lockfileHash:R.string().min(1),oracleLayer:un,parts:R.array(Z0),runId:R.string().min(1).optional(),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1)),trailParams:R.array(R.record(R.string(),R.union([Xe,R.null()])))}),a9=R.object({actionHash:R.string().min(1),at:R.string().min(1),depot:R.string().min(1),evidence:R.array(R.string().min(1)),kind:R.literal("flaky-candidate"),lensId:R.string().min(1),parts:R.array(Z0),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1))}),l9=R.object({at:R.string().min(1),kind:R.literal("saturation"),lensId:R.string().min(1),lockfileHash:R.string().min(1),ring:R.number().int().nonnegative()}),u9=R.object({at:R.string().min(1),kind:R.literal("resolution"),signature:R.string().min(1)}),c9=R.object({arrangement:R.string().min(1),at:R.string().min(1),canonicalKey:R.string().min(1),kind:R.literal("derived-depot")}),Zs=R.discriminatedUnion("kind",[o9,s9,a9,l9,u9,c9]);function Xs(e){return sf(e).slice(0,12)}function ze(e){return`${e.lensId} ${e.actionHash} ${e.targetKey}`}function vi(e){return e.reduce((t,r)=>g9(t,r),m9())}function xi(e){return J0.fromPromise(d9(e),t=>({error:t,kind:"io"})).map(t=>p9(t))}function rf(e,t){let r=t.map(n=>`${JSON.stringify(n)}
136
+ `).join("");return J0.fromPromise(t9(n9.dirname(e),{recursive:!0}).then(()=>e9(e,r)),n=>({error:n,kind:"io"}))}function nf(e,t){let r=J({effect:t.effectStep,guard:t.guard,nav:t.nav,params:t.paramSpaces,steps:t.steps}),n=e.entities.filter(i=>r.includes(`"${i.name}"`));return sf(J({entities:n,spec:r}))}function of(e){return sf(J(e))}async function d9(e){return(await r9(e,"utf8").catch(r=>{if(f9(r))return"";throw r})).split(`
137
+ `).filter(r=>r.length>0)}function f9(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}function p9(e){return e.flatMap(t=>{let r=Zs.safeParse(h9(t));return r.success?[r.data]:[]})}function h9(e){try{return JSON.parse(e)}catch{return null}}function sf(e){return Q8("sha256").update(e).digest("hex")}function m9(){return{covered:new Set,findings:new Map,flaky:new Map,saturations:new Map}}function g9(e,t){if(t.kind==="covered")return{...e,covered:new Set([...e.covered,ze(t)])};if(t.kind==="flaky-candidate")return{...e,covered:new Set([...e.covered,ze(t)]),flaky:y9(e.flaky,t)};if(t.kind==="finding")return{...e,covered:new Set([...e.covered,ze(t)]),findings:b9(e.findings,t)};if(t.kind==="resolution")return{...e,findings:S9(e.findings,t)};if(t.kind==="saturation"){let r=`${t.lensId} ${String(t.ring)}`;return{...e,saturations:new Map([...e.saturations,[r,t]])}}return e}function y9(e,t){let r=e.get(t.signature),n=r==null?{first:t,occurrences:1}:{first:r.first,occurrences:r.occurrences+1};return new Map([...e,[t.signature,n]])}function b9(e,t){let r=e.get(t.signature),n=r==null?{first:t,latest:t,occurrences:1,resolvedAt:void 0}:{first:r.first,latest:t,occurrences:r.occurrences+1,resolvedAt:void 0};return new Map([...e,[t.signature,n]])}function S9(e,t){let r=e.get(t.signature);return r==null?e:new Map([...e,[t.signature,{...r,resolvedAt:t.at}]])}function af(e){let t={edges:new Map,saturationDepth:0,seen:new Set,states:0,targets:new Map},r=e.depots.map(n=>(t.seen.add(fr(n.snapshot)),{depot:n.name,lastLabel:null,snapshot:n.snapshot,trail:[]}));return v9(e,r,t),{edges:t.edges,saturationDepth:t.saturationDepth,states:t.seen.size,targets:t.targets}}var w9=24301,X0=new WeakMap;function Qs(e,t){let r=X0.get(e)??new Map;X0.set(e,r);let n=r.get(t);if(n!=null)return n;let i=Object.fromEntries(Object.entries(e.paramSpaces).map(([o,s])=>[o,A9(s,t)]));return r.set(t,i),i}function v9(e,t,r){let n=[...t],i=0;for(;i<n.length;){let o=n[i];i+=1,o!=null&&x9(e,o,r).forEach(s=>n.push(s))}}function x9(e,t,r){let n={snapshot:t.snapshot},i=o=>Qs(o,C9(t.trail,e.corpus,o));return Lr(e.corpus,n,i).flatMap(o=>{let s=e.corpus[o.idx];if(s==null)return[];let a=[...t.trail,{idx:o.idx,params:o.params}],l={depot:t.depot,trail:a,transitionIndex:o.idx};return R9({acc:r,node:t,option:o,params:e,transition:s,witness:l}),k9({acc:r,node:t,option:o,params:e,trail:a})})}function R9({acc:e,node:t,option:r,params:n,transition:i,witness:o}){let s={label:r.label,params:r.params,pre:t.snapshot,spaces:i.paramSpaces},a=wi(n.lens,s);if(e.targets.has(a)||(e.targets.set(a,o),e.saturationDepth=Math.max(e.saturationDepth,o.trail.length)),t.lastLabel!=null){let l=`${t.lastLabel} \u2192 ${r.label}`;e.edges.has(l)||e.edges.set(l,o)}}function k9({acc:e,node:t,option:r,params:n,trail:i}){if(i.length>=n.maxDepth)return[];let o=r.firing.next.snapshot;if(E9(t.snapshot,o,n.maxCount))return[];let s=fr(o);return e.seen.has(s)?[]:(e.seen.add(s),[{depot:t.depot,lastLabel:r.label,snapshot:o,trail:i}])}function E9(e,t,r){return[...t.entities].some(([n,i])=>{let o=e.entities.get(n)?.size??0;return i.size>o&&i.size>r})}function C9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function A9(e,t){let[r]=Ne.sample(Js(e),{numRuns:1,seed:w9+t});if(r==null)throw new Error("arbitrary produced no sample");return r}var I9=10;function lf(e){return df(e).reduce((t,r)=>t+ev(e,r).length,0)}function uf(e){return e.targets.size+e.edges.size}function cf(e){let t=df(e).map(o=>ev(e,o)),r=P9(e,t);if(r!=null)return r;let n=t.find(o=>o.length>0);return n==null?{kind:"saturated",ring:t.length}:{kind:"cover",target:n.reduce((o,s)=>Q0(e,s)>Q0(e,o)?s:o)}}function df(e){return[{entries:e.graph.targets,index:1},{entries:e.graph.edges,index:2}]}function ev(e,t){return[...t.entries].flatMap(([r,n])=>{let i=tv({params:e,ring:t.index,targetKey:r,witness:n});return e.covered.has(rv(e,i))?[]:[i]})}function tv({params:e,ring:t,targetKey:r,witness:n}){let i=e.actionHashes[n.transitionIndex];if(i==null)throw new Error("transition index out of corpus range");return{actionHash:i,ring:t,targetKey:r,witness:n}}function rv(e,t){return ze({actionHash:t.actionHash,lensId:e.lensId,targetKey:t.targetKey})}function P9(e,t){if(e.tick===0||e.tick%I9!==0)return null;let r=df(e).flatMap(i=>[...i.entries].flatMap(([o,s])=>{let a=tv({params:e,ring:i.index,targetKey:o,witness:s});return e.covered.has(rv(e,a))?[a]:[]}));if(r.length===0||t.every(i=>i.length===0))return null;let n=r[e.tick%r.length];return n==null?null:{kind:"revalidate",target:n}}var T9=/delete|remove|cancel|deactivate|revoke|archive/i;function Q0(e,t){let r=t.ring===2&&M9(e,t)?4:0,n=T9.test(t.targetKey)?2:0,i=1/(1+t.witness.trail.length);return r+n+i}function M9(e,t){return new Set(t.witness.trail.flatMap(n=>{let i=e.corpus[n.idx];return i==null?[]:[i.test]})).size>1}function O9(e){let t=N9(e,e.witnessTrail);return t==null?{covers:[],firings:[]}:$9(e,t)}function N9(e,t){return t.reduce((r,n)=>r==null?null:L9(e,r,n),{covers:[],firings:[],snapshot:e.depotSnapshot})}function L9(e,t,r){let n=e.corpus[r.idx];if(n==null)return null;let i=Mn(n,{snapshot:t.snapshot},r.params);if(i==null)return null;let o=nv({params:e,planned:r,pre:t.snapshot,transition:n});return{covers:[...t.covers,o],firings:[...t.firings,r],snapshot:i.next.snapshot}}function nv({params:e,planned:t,pre:r,transition:n}){let i={label:`${n.test}#${String(n.index)}`,params:t.params,pre:r,spaces:n.paramSpaces},o=e.actionHashes[t.idx];if(o==null)throw new Error("transition index out of corpus range");return{actionHash:o,targetKey:wi(e.lens,i)}}function $9(e,t){let r=new Set([...e.covered,...t.covers.map(i=>ze({...i,lensId:e.lensId}))]),n=iv({params:e,seen:r,state:t});return{covers:n.covers,firings:n.firings}}function iv({params:e,seen:t,state:r}){if(r.firings.length>=e.maxLength)return r;let n=D9({params:e,seen:t,state:r});return n==null?r:(t.add(ze({...n.coverage,lensId:e.lensId})),iv({params:e,seen:t,state:{covers:[...r.covers,n.coverage],firings:[...r.firings,n.planned],snapshot:n.snapshot}}))}function D9({params:e,seen:t,state:r}){let n=o=>Qs(o,_9(r.firings,e.corpus,o));return Lr(e.corpus,{snapshot:r.snapshot},n).map(o=>{let s=e.corpus[o.idx];if(s==null)return null;let a={idx:o.idx,params:o.params};return{coverage:nv({params:e,planned:a,pre:r.snapshot,transition:s}),planned:a,snapshot:o.firing.next.snapshot}}).find(o=>o!=null&&!t.has(ze({...o.coverage,lensId:e.lensId})))??null}function _9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function ff(e,{sweep:t}){let r=At(e.tests.filter(n=>!n.stub),n=>J({s:n.singletons,w:n.world})).map(n=>({name:n.name,test:n}));return t?[...r,...r.flatMap(n=>F9(n))]:r}function pf(e,t,r){return Pn({...e,tests:[t.test]},t.test.name,r)}function F9(e){return j9(e.test).map(t=>{let r={...t,as:`${t.as}~2`},n=`${e.name} +${t.entity}`;return{name:n,test:{...e.test,name:n,world:[...e.test.world,r]}}})}function j9(e){return e.world.filter(t=>{let r=J({...e,world:e.world.filter(n=>n!==t)});return!r.includes(`"${t.as}.`)&&!r.includes(`"ref":"${t.as}"`)})}async function V9(e,t){let r=await ea({attemptIndex:0,capture:!1,firings:e.trail.firings,params:e},t);return r.kind!=="completed"?sv(r):r.findings.length===0?{kind:"clean",rows:H9(e)}:B9(e,Ri(e.depot.name,r.findings),t)}function sv(e){return e.kind==="aborted"?{kind:"aborted"}:{error:e.error,kind:"error"}}async function B9(e,t,r){let n=await ea({attemptIndex:1,capture:!1,firings:e.trail.firings,params:e},r);return n.kind!=="completed"?sv(n):Ri(e.depot.name,n.findings).signature!==t.signature?{kind:"flaky",rows:[q9(e,t)]}:U9({digest:t,params:e,signal:r})}async function ea({attemptIndex:e,capture:t,firings:r,params:n},i){let o=n.runIdFor(e);return(await n.session.runOnce({capture:t,lockfile:G9(n),onEvent:void 0,options:n.options,params:void 0,runId:o,sequence:z9(n,r),testName:n.depot.test.name},i)).match(a=>a.aborted?{kind:"aborted"}:{findings:a.findings,kind:"completed",runId:o},a=>({error:a,kind:"error"}))}async function U9({digest:e,params:t,signal:r}){let n=await av({attemptIndex:2,budget:t.shrinkBudget,firings:t.trail.firings,params:t,signal:r,signature:e.signature});if(n.kind!=="shrunk")return n.outcome;let i=await W9({firings:n.firings,params:t,signal:r,signature:e.signature});if(i.kind==="aborted")return{kind:"aborted"};let o=Z9({digest:e,minimal:n.firings,params:t,runId:i.kind==="reproduced"?i.runId:void 0});return{finding:o,kind:"finding",minimal:n.firings,rows:[o],runId:i.kind==="reproduced"?i.runId:n.runId}}async function W9({firings:e,params:t,signal:r,signature:n}){let i=await ea({attemptIndex:t.shrinkBudget+2,capture:!0,firings:e,params:t},r);return i.kind==="aborted"?{kind:"aborted"}:i.kind==="completed"&&Ri(t.depot.name,i.findings).signature===n?{kind:"reproduced",runId:i.runId}:{kind:"no-repro"}}async function av(e){let t={firings:e.firings,kind:"shrunk",runId:e.params.runIdFor(e.attemptIndex-1)};if(e.budget<=0||e.firings.length<=1)return t;let r=e.firings.map((n,i)=>e.firings.filter((o,s)=>s!==i));return lv(e,r,t)}async function lv(e,t,r){let[n,...i]=t;if(n==null||e.budget-1<0)return r;let o=await ea({attemptIndex:e.attemptIndex,capture:!1,firings:n,params:e.params},e.signal);if(o.kind==="aborted")return{kind:"halted",outcome:{kind:"aborted"}};let s={...e,attemptIndex:e.attemptIndex+1,budget:e.budget-1};return o.kind==="completed"&&Ri(e.params.depot.name,o.findings).signature===e.signature?av({...s,firings:n}):lv(s,i,r)}function z9(e,t){return t.map(r=>{let n=e.corpus[r.idx];if(n==null)throw new Error("transition index out of corpus range");return{params:r.params,transition:n}})}function G9(e){return e.lockfile.tests.some(r=>r.name===e.depot.test.name)?e.lockfile:{...e.lockfile,tests:[...e.lockfile.tests,e.depot.test]}}function H9(e){return e.trail.covers.map(t=>({actionHash:t.actionHash,at:e.now(),kind:"covered",lensId:e.lensId,targetKey:t.targetKey}))}function q9(e,t){return{actionHash:hf(e).actionHash,at:e.now(),depot:e.depot.name,evidence:[...t.evidence],kind:"flaky-candidate",lensId:e.lensId,parts:[...t.parts],signature:t.signature,targetKey:hf(e).targetKey,trail:e.trail.covers.map(r=>r.targetKey)}}function uv(e){return e.kind==="driver-error"||e.kind==="unfireable"?"crash":e.kind==="obligation"?e.source.kind==="invariant"?"invariant":e.source.kind==="law"?"law":"frame":"frame"}function Ri(e,t){let r=t.map(i=>({line:km(i),part:Y9(i)})).toSorted((i,o)=>J(i.part).localeCompare(J(o.part))),n=r.map(i=>i.part);return{evidence:r.map(i=>i.line),layer:K9(n),parts:n,signature:J({depot:e,parts:n.map(i=>J(i))})}}var ov={crash:0,frame:3,invariant:1,law:2};function K9(e){return e.map(r=>r.layer).toSorted((r,n)=>ov[r]-ov[n]).at(0)??"frame"}function Y9(e){let t=uv(e);switch(e.kind){case"consistency":return{divergence:J9(e.divergence),kind:"consistency",layer:t,step:e.step==null?null:{intent:e.step.intent,test:e.step.test}};case"obligation":return{kind:"obligation",layer:t,source:e.source.kind,step:{intent:e.step.intent,test:e.step.test}};case"unfireable":return{intent:e.intent,kind:"unfireable",layer:t,reason:e.reason,test:e.test};case"driver-error":return{error:e.error.kind,kind:"driver-error",layer:t,step:e.step.intent};case"illegal-transition":return{kind:"illegal-transition",layer:t,step:e.step.intent}}}function J9(e){return e.kind==="singleton-mismatch"?{kind:e.kind,singleton:e.singleton}:{entity:e.entity,kind:e.kind}}function Z9({digest:e,minimal:t,params:r,runId:n}){let i=hf(r);return{actionHash:i.actionHash,at:r.now(),depot:r.depot.name,evidence:[...e.evidence],kind:"finding",lensId:r.lensId,lockfileHash:r.lockfileHash,oracleLayer:e.layer,parts:[...e.parts],runId:n,signature:e.signature,targetKey:i.targetKey,trail:t.map(o=>{let s=r.corpus[o.idx];if(s==null)throw new Error("transition index out of corpus range");return`${s.test}#${String(s.index)}`}),trailParams:t.map(o=>o.params)}}function hf(e){let t=e.trail.covers.at(-1);if(t==null)throw new Error("trail has no coverage");return t}function VK(e){switch(e.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${e.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${e.message}`}}function BK({projectId:e,serverUrl:t}){return[`Project "${e}" (from .ripplo/project.json) was not found on ${t}, or this account does not have access to it.`,"Run `npx ripplo projects list` to see your projects, then update .ripplo/project.json (or re-run `npx ripplo init --project <id>`)."].join(`
138
+ `)}function UK({devSessionId:e,version:t}){return`ripplo daemon: v${t} ready as local executor for session ${e} (sync happens on each \`ripplo run\`; Ctrl-C to stop)`}function WK({cwd:e,pid:t}){return`ripplo daemon: another daemon is already running for this project${t==null?"":` (pid ${String(t)})`} (cwd ${e}).`}function zK(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project; shutting down."}function GK(e){if(e.kind==="not-running")return"daemon: not running";if(e.kind==="unresponsive")return`daemon: running but did not reply within ${String(e.timeoutMs/1e3)}s \u2014 likely busy executing runs (event loop saturated); retry when the batch drains`;let{status:t}=e,r=t.version==null?"version unknown (pre-0.7.8)":`v${t.version}`,n=`${String(t.active)} active, ${String(t.queued)} queued`,i=`explorer: ${t.explorer}, ${String(t.exploring)} exploring`;return`daemon: running (${r}; ${n}; ${i}; ${X9(t.progress)})`}function X9(e){if(e.total===0)return"explore: idle";let t=`covered ${String(e.covered)}/${String(e.total)} targets`,r=e.deferred===0?"":` (${String(e.deferred)} deferred \u2014 timed out or errored, auto-retried after cooldown)`,n=Q9(e);return`explore: ${t}${r}, ${String(e.findings)} findings, ${n}`}function HK(e){let t=e.daemonVersion==null?"an older version":`v${e.daemonVersion}`;return e.kind==="restarted"?`ripplo: daemon was ${t} \u2014 restarted on the current version`:`ripplo: daemon is ${t} (older than this CLI) with runs in flight \u2014 it will keep running; restart it when idle to pick up the new version`}function qK(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:e.findings.map(t=>_n(t)),kind:"findings"};case"error":return{detail:Ct(e.error),kind:"error"};case"dispatch-failed":return{detail:e.reason,kind:"dispatch-error"}}}function Q9(e){return e.saturated?e.deferred===0?"saturated":"waiting \u2014 every open target is deferred, retrying after cooldown":"searching"}import eF from"p-queue";var tF=4,rF={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},ta=new eF({concurrency:tF}),Bt={headedActive:0,interactiveActive:0,interactiveQueued:0},cv={current:null};function JK({headed:e,task:t,workClass:r}){let n=rF[r];return r==="p3-explore"?ta.add(t,{priority:n}):(Bt.interactiveQueued+=1,ra(),ta.add(()=>nF({headed:e,task:t}),{priority:n}))}function ZK(e){!Number.isFinite(e)||e<1||(ta.concurrency=Math.floor(e),ra())}function mf(){return{active:Bt.interactiveActive,headedActive:Bt.headedActive,poolSize:ta.concurrency,queued:Bt.interactiveQueued}}function XK(e){cv.current=e}async function nF({headed:e,task:t}){Bt.interactiveQueued-=1,Bt.interactiveActive+=1,Bt.headedActive+=e?1:0,ra();try{return await t()}finally{Bt.interactiveActive-=1,Bt.headedActive-=e?1:0,ra()}}function ra(){cv.current?.()}import gf from"fs";import yf from"path";function dv(e){try{let t=iF(e);if(t==null)return;let r=yf.join(t,"HEAD"),n=gf.readFileSync(r,"utf8").trim(),i="ref: refs/heads/";return n.startsWith(i)?n.slice(i.length):n.length===0?void 0:n.slice(0,7)}catch{return}}function iF(e){let t=yf.join(e,".git");if(gf.statSync(t).isDirectory())return t;let n=gf.readFileSync(t,"utf8").trim(),i="gitdir:";if(!n.startsWith(i))return;let o=n.slice(i.length).trim();if(o.length!==0)return yf.resolve(e,o)}import oF from"crypto";import{graphql as sF}from"gql.tada";import{err as aF,ok as lF}from"neverthrow";var uF=sF(`
139
139
  mutation SyncDevSession(
140
140
  $projectId: String!
141
141
  $cwd: String!
@@ -154,13 +154,13 @@ ${zN(i)}`),o}function S1(e){return ed(e,xe)}async function w1(e){let t=[];functi
154
154
  hooksPaused
155
155
  }
156
156
  }
157
- `);async function rY(e,t){let r=await bn(e);if(r.isErr())return n5({error:r.error,kind:"compilation-failed"});let n=await yf({config:t,cwd:e,lockfile:r.value});return i5({devSessionId:n.devSessionId,lockfile:r.value})}async function yf(e){let t=s5(e.lockfile);return h5({config:e.config,cwd:e.cwd,payload:t})}function s5(e){let t=a5(e);return{preconditions:e.entities.map(r=>({depends:t.get(r.name)??[],description:r.description??"",name:r.name,returns:r.identity})),workflows:e.tests.map(r=>({expectedOutcome:r.intent,name:r.intent,preconditions:d5(f5(r),t),requiresKeys:r.world.map(n=>({namespace:n.as,preconditionName:n.entity})),slug:rt(r.name),sourcePath:r.sourcePath??null,spec:JSON.stringify(r)}))}}function a5(e){let t=e.tests.reduce((r,n)=>l5(r,n),new Map);return new Map([...t].map(([r,n])=>[r,[...n]]))}function l5(e,t){let r=[...t.world,...t.maybe],n=new Map(r.map(i=>[i.as,i.entity]));return r.reduce((i,o)=>{let s=u5(o,n),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function u5(e,t){return Object.values(e.set).flatMap(r=>c5(r)).map(r=>t.get(r)).filter(r=>r!=null&&r!==e.entity)}function c5(e){return e==null||typeof e!="object"?[]:"ref"in e?[cv(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>cv(t.ref))}function cv(e){let[t]=e.split(".");return t??e}function d5(e,t){let r=(n,i)=>n.has(i)?n:(t.get(i)??[]).reduce((o,s)=>r(o,s),new Set([...n,i]));return[...e.reduce((n,i)=>r(n,i),new Set)]}function f5(e){return[...new Set(e.world.map(t=>t.entity))]}function p5(e){return t5.createHash("sha256").update(JSON.stringify(e)).digest("hex")}async function h5({config:e,cwd:t,payload:r}){let n=p5(r),i=uv(t),o=await _e({config:e,document:o5,variables:{branch:i??null,cwd:t,preconditions:r.preconditions.map(s=>({depends:[...s.depends],description:s.description,name:s.name,returns:[...s.returns]})),projectId:e.projectId,workflows:r.workflows.map(s=>({expectedOutcome:s.expectedOutcome,name:s.name,preconditions:[...s.preconditions],requiresKeys:s.requiresKeys.map(a=>({namespace:a.namespace,preconditionName:a.preconditionName})),slug:s.slug,sourcePath:s.sourcePath,spec:s.spec??null}))}});if(o.syncDevSession==null)throw new Error("syncDevSession returned null");return{devSessionId:o.syncDevSession.id,hash:n,hooksPaused:o.syncDevSession.hooksPaused}}import{randomUUID as P5}from"crypto";import{CancellationTokenSource as T5,ResponseError as M5}from"vscode-jsonrpc/node";import{graphql as Mv}from"gql.tada";import{createMessageConnection as m5,NotificationType as dv,RequestType as fv,RequestType0 as pv,SocketMessageReader as g5,SocketMessageWriter as y5}from"vscode-jsonrpc/node";import{z as v}from"zod";var b5="daemon.sock",S5="daemon.log";function aY(e){return Ut(e,b5)}function lY(e){return Ut(e,S5)}function hv(e){return m5(new g5(e),new y5(e))}var mv=v.object({all:v.boolean(),headed:v.boolean(),tests:v.array(v.string())}),uY=v.object({jobId:v.string(),total:v.number()}),w5=v.enum(["holder","standby","off"]),v5=v.object({covered:v.number(),deferred:v.number(),findings:v.number(),saturated:v.boolean(),total:v.number()}),cY=v.object({active:v.number(),explorer:w5,exploring:v.number(),progress:v5,queued:v.number()}),bf=v.discriminatedUnion("kind",[v.object({kind:v.literal("pass")}),v.object({findingLines:v.array(v.string()),kind:v.literal("findings")}),v.object({detail:v.string(),kind:v.literal("error")}),v.object({detail:v.string(),kind:v.literal("dispatch-error")}),v.object({detail:v.string(),kind:v.literal("infra-error")})]),x5=v.discriminatedUnion("kind",[v.object({kind:v.literal("test-started"),runId:v.string(),testName:v.string()}),v.object({kind:v.literal("test-outcome"),outcome:bf,runId:v.string(),testName:v.string()})]),dY=v.object({event:x5,jobId:v.string()}),fY=v.object({failed:v.number(),jobId:v.string(),notRun:v.number(),passed:v.number()}),pY=v.discriminatedUnion("code",[v.object({code:v.literal("compile-failed"),detail:v.string(),diagnostics:v.array(v.string()).default([])}),v.object({code:v.literal("selection-conflicting-flags")}),v.object({code:v.literal("selection-nothing-selected")}),v.object({code:v.literal("selection-unknown-ids"),known:v.array(v.string()),unknown:v.array(v.string())}),v.object({code:v.literal("scope-failed"),detail:v.string()}),v.object({code:v.literal("app-unreachable"),detail:v.string(),url:v.string()}),v.object({code:v.literal("sync-failed"),detail:v.string()}),v.object({code:v.literal("bad-message")})]),gv=v.object({findingId:v.string().min(1)}),hY=v.discriminatedUnion("kind",[v.object({kind:v.literal("resolved")}),v.object({kind:v.literal("unreachable")}),v.object({kind:v.literal("still-failing"),runId:v.string().optional()}),v.object({kind:v.literal("diverged"),runId:v.string().optional()}),v.object({kind:v.literal("flaky")}),v.object({kind:v.literal("aborted")}),v.object({kind:v.literal("finding-not-found")}),v.object({kind:v.literal("unreplayable"),reason:v.enum(["depot-missing","transition-missing","ledger-unreadable"])}),v.object({kind:v.literal("error"),reason:v.string()})]),yv=new fv("ripplo/exploreReplay"),bv=new fv("ripplo/enqueue"),Sv=new pv("ripplo/status"),wv=new pv("ripplo/shutdownIfIdle"),vv=new dv("ripplo/jobEvent"),xv=new dv("ripplo/jobDone");import{err as Sf,ok as Rv}from"neverthrow";function kv({all:e,ids:t,lockfile:r}){let n=r.tests.map(a=>a.name);if(e&&t.length>0)return Sf({kind:"conflicting-flags"});if(e)return Rv(r.tests.filter(a=>!a.stub).map(a=>a.name));if(t.length===0)return Sf({kind:"nothing-selected"});let i=new Map(n.map(a=>[rt(a),a])),o=t.map(a=>({id:a,name:n.includes(a)?a:i.get(rt(a))})),s=o.filter(a=>a.name==null).map(a=>a.id);return s.length>0?Sf({kind:"unknown-ids",known:n,unknown:s}):Rv(o.flatMap(a=>a.name==null?[]:[a.name]))}import{err as wf,ok as Cv}from"neverthrow";import{graphql as Av}from"gql.tada";import{execFileSync as R5}from"child_process";function na(e,t){return R5("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}async function Iv({config:e,cwd:t,lockfile:r}){await E5({config:e,cwd:t,lockfile:r});let n=await A5(e);if(n.isErr())return wf(n.error);let i=new Map(r.tests.filter(s=>!s.stub).map(s=>[rt(s.name),s.name])),o=[...new Set(n.value)].flatMap(s=>{let a=i.get(s);return a==null?[]:[a]});return o.length===0?wf({kind:"scope-empty"}):Cv(o)}var k5=Av(`
157
+ `);async function cY(e,t){let r=await bn(e);if(r.isErr())return aF({error:r.error,kind:"compilation-failed"});let n=await bf({config:t,cwd:e,lockfile:r.value});return lF({devSessionId:n.devSessionId,lockfile:r.value})}async function bf(e){let t=cF(e.lockfile);return bF({config:e.config,cwd:e.cwd,payload:t})}function cF(e){let t=dF(e);return{preconditions:e.entities.map(r=>({depends:t.get(r.name)??[],description:r.description??"",name:r.name,returns:r.identity})),workflows:e.tests.map(r=>({expectedOutcome:r.intent,name:r.intent,preconditions:mF(gF(r),t),requiresKeys:r.world.map(n=>({namespace:n.as,preconditionName:n.entity})),slug:rt(r.name),sourcePath:r.sourcePath??null,spec:JSON.stringify(r)}))}}function dF(e){let t=e.tests.reduce((r,n)=>fF(r,n),new Map);return new Map([...t].map(([r,n])=>[r,[...n]]))}function fF(e,t){let r=[...t.world,...t.maybe],n=new Map(r.map(i=>[i.as,i.entity]));return r.reduce((i,o)=>{let s=pF(o,n),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function pF(e,t){return Object.values(e.set).flatMap(r=>hF(r)).map(r=>t.get(r)).filter(r=>r!=null&&r!==e.entity)}function hF(e){return e==null||typeof e!="object"?[]:"ref"in e?[fv(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>fv(t.ref))}function fv(e){let[t]=e.split(".");return t??e}function mF(e,t){let r=(n,i)=>n.has(i)?n:(t.get(i)??[]).reduce((o,s)=>r(o,s),new Set([...n,i]));return[...e.reduce((n,i)=>r(n,i),new Set)]}function gF(e){return[...new Set(e.world.map(t=>t.entity))]}function yF(e){return oF.createHash("sha256").update(JSON.stringify(e)).digest("hex")}async function bF({config:e,cwd:t,payload:r}){let n=yF(r),i=dv(t),o=await _e({config:e,document:uF,variables:{branch:i??null,cwd:t,preconditions:r.preconditions.map(s=>({depends:[...s.depends],description:s.description,name:s.name,returns:[...s.returns]})),projectId:e.projectId,workflows:r.workflows.map(s=>({expectedOutcome:s.expectedOutcome,name:s.name,preconditions:[...s.preconditions],requiresKeys:s.requiresKeys.map(a=>({namespace:a.namespace,preconditionName:a.preconditionName})),slug:s.slug,sourcePath:s.sourcePath,spec:s.spec??null}))}});if(o.syncDevSession==null)throw new Error("syncDevSession returned null");return{devSessionId:o.syncDevSession.id,hash:n,hooksPaused:o.syncDevSession.hooksPaused}}import{randomUUID as NF}from"crypto";import{CancellationTokenSource as LF,ResponseError as $F}from"vscode-jsonrpc/node";import{graphql as Nv}from"gql.tada";import{createMessageConnection as SF,NotificationType as pv,RequestType as hv,RequestType0 as mv,SocketMessageReader as wF,SocketMessageWriter as vF}from"vscode-jsonrpc/node";import{z as v}from"zod";var xF="daemon.sock",RF="daemon.log";function mY(e){return Ut(e,xF)}function gY(e){return Ut(e,RF)}function gv(e){return SF(new wF(e),new vF(e))}var yv=v.object({all:v.boolean(),headed:v.boolean(),tests:v.array(v.string())}),yY=v.object({jobId:v.string(),total:v.number()}),kF=v.enum(["holder","standby","off"]),EF=v.object({covered:v.number(),deferred:v.number(),findings:v.number(),saturated:v.boolean(),total:v.number()}),bY=v.object({active:v.number(),explorer:kF,exploring:v.number(),progress:EF,queued:v.number(),version:v.string().optional()}),Sf=v.discriminatedUnion("kind",[v.object({kind:v.literal("pass")}),v.object({findingLines:v.array(v.string()),kind:v.literal("findings")}),v.object({detail:v.string(),kind:v.literal("error")}),v.object({detail:v.string(),kind:v.literal("dispatch-error")}),v.object({detail:v.string(),kind:v.literal("infra-error")})]),CF=v.discriminatedUnion("kind",[v.object({kind:v.literal("test-started"),runId:v.string(),testName:v.string()}),v.object({kind:v.literal("test-outcome"),outcome:Sf,runId:v.string(),testName:v.string()})]),SY=v.object({event:CF,jobId:v.string()}),wY=v.object({failed:v.number(),jobId:v.string(),notRun:v.number(),passed:v.number()}),vY=v.discriminatedUnion("code",[v.object({code:v.literal("compile-failed"),detail:v.string(),diagnostics:v.array(v.string()).default([])}),v.object({code:v.literal("selection-conflicting-flags")}),v.object({code:v.literal("selection-nothing-selected")}),v.object({code:v.literal("selection-unknown-ids"),known:v.array(v.string()),unknown:v.array(v.string())}),v.object({code:v.literal("scope-failed"),detail:v.string()}),v.object({code:v.literal("app-unreachable"),detail:v.string(),url:v.string()}),v.object({code:v.literal("sync-failed"),detail:v.string()}),v.object({code:v.literal("bad-message")})]),bv=v.object({findingId:v.string().min(1)}),xY=v.discriminatedUnion("kind",[v.object({kind:v.literal("resolved")}),v.object({kind:v.literal("unreachable")}),v.object({kind:v.literal("still-failing"),runId:v.string().optional()}),v.object({kind:v.literal("diverged"),runId:v.string().optional()}),v.object({kind:v.literal("flaky")}),v.object({kind:v.literal("aborted")}),v.object({kind:v.literal("finding-not-found")}),v.object({kind:v.literal("unreplayable"),reason:v.enum(["depot-missing","transition-missing","ledger-unreadable"])}),v.object({kind:v.literal("error"),reason:v.string()})]),Sv=new hv("ripplo/exploreReplay"),wv=new hv("ripplo/enqueue"),vv=new mv("ripplo/status"),xv=new mv("ripplo/shutdownIfIdle"),Rv=new pv("ripplo/jobEvent"),kv=new pv("ripplo/jobDone");import{err as wf,ok as Ev}from"neverthrow";function Cv({all:e,ids:t,lockfile:r}){let n=r.tests.map(a=>a.name);if(e&&t.length>0)return wf({kind:"conflicting-flags"});if(e)return Ev(r.tests.filter(a=>!a.stub).map(a=>a.name));if(t.length===0)return wf({kind:"nothing-selected"});let i=new Map(n.map(a=>[rt(a),a])),o=t.map(a=>({id:a,name:n.includes(a)?a:i.get(rt(a))})),s=o.filter(a=>a.name==null).map(a=>a.id);return s.length>0?wf({kind:"unknown-ids",known:n,unknown:s}):Ev(o.flatMap(a=>a.name==null?[]:[a.name]))}import{err as vf,ok as Iv}from"neverthrow";import{graphql as Pv}from"gql.tada";import{execFileSync as AF}from"child_process";function na(e,t){return AF("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}async function Tv({config:e,cwd:t,lockfile:r}){await PF({config:e,cwd:t,lockfile:r});let n=await MF(e);if(n.isErr())return vf(n.error);let i=new Map(r.tests.filter(s=>!s.stub).map(s=>[rt(s.name),s.name])),o=[...new Set(n.value)].flatMap(s=>{let a=i.get(s);return a==null?[]:[a]});return o.length===0?vf({kind:"scope-empty"}):Iv(o)}var IF=Pv(`
158
158
  mutation AddDirtyTestsToScope($projectId: String!, $cwd: String!, $workflowSlugs: [String!]!) {
159
159
  addDirtyTestsToScope(projectId: $projectId, cwd: $cwd, workflowSlugs: $workflowSlugs) {
160
160
  __typename
161
161
  }
162
162
  }
163
- `);async function E5({config:e,cwd:t,lockfile:r}){let n=new Set(I5(t)),i=r.tests.filter(o=>o.sourcePath!=null&&n.has(o.sourcePath)).map(o=>rt(o.name));i.length!==0&&await _e({config:e,document:k5,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:i}}).catch(o=>{Se.warn({err:o},"auto-scope of dirty tests failed")})}var C5=Av(`
163
+ `);async function PF({config:e,cwd:t,lockfile:r}){let n=new Set(OF(t)),i=r.tests.filter(o=>o.sourcePath!=null&&n.has(o.sourcePath)).map(o=>rt(o.name));i.length!==0&&await _e({config:e,document:IF,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:i}}).catch(o=>{Se.warn({err:o},"auto-scope of dirty tests failed")})}var TF=Pv(`
164
164
  query ScopeSelection($projectId: String!, $cwd: String!) {
165
165
  project(id: $projectId) {
166
166
  id
@@ -176,8 +176,8 @@ ${zN(i)}`),o}function S1(e){return ed(e,xe)}async function w1(e){let t=[];functi
176
176
  }
177
177
  }
178
178
  }
179
- `);async function A5(e){try{let r=(await _e({config:e,document:C5,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession?.scopeItems??[];return Cv(r.flatMap(n=>n.workflow==null?[]:[n.workflow.slug]))}catch(t){return wf({detail:t instanceof Error?t.message:String(t),kind:"scope-fetch-failed"})}}var Ev=".ripplo/tests/";function I5(e){try{return na(["status","--porcelain","--",".ripplo/tests"],e).split(`
180
- `).map(t=>t.slice(3).trim()).filter(t=>t.startsWith(Ev)&&t.endsWith(".ts")).map(t=>t.slice(Ev.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}catch{return[]}}var O5=12e4,N5=-32099;function L5(e){let t=new AbortController;return e.isCancellationRequested?(t.abort(),t.signal):(e.onCancellationRequested(()=>{t.abort()}),t.signal)}function FY(e){let t={...e,expectations:new Map,jobs:new Map};return{claim:r=>B5(t,r),handleConnection:r=>{$5(t,r)},idle:()=>Ov(t)}}function $5(e,t){let r=hv(t);r.onRequest(bv,(n,i)=>D5({connection:r,ctx:e,params:n,token:i})),r.onRequest(Sv,()=>{let n=hf();return{active:n.active,queued:n.queued,...e.explorationStatus()}}),r.onRequest(yv,async(n,i)=>{let o=gv.safeParse(n);return o.success?(await e.ready,e.replayFinding(o.data.findingId,L5(i))):{kind:"error",reason:"bad-message"}}),r.onRequest(wv,()=>{let n=Ov(e);return n&&e.onShutdownRequest(),n}),r.onClose(()=>{_5(e,r)}),r.onError(n=>{Se.warn({err:n},"ipc connection error")}),t.on("error",n=>{Se.warn({err:n},"ipc socket error")}),r.listen()}function Ov(e){let t=hf();return e.jobs.size===0&&t.active===0&&t.queued===0}async function D5({connection:e,ctx:t,params:r,token:n}){let i=mv.safeParse(r);if(!i.success)throw Pv({code:"bad-message"});await t.ready;let o=await W5({config:t.config,cwd:t.cwd,message:i.data});if(o.kind==="error")throw Pv(o.error);let s=P5(),a=new T5;return n.onCancellationRequested(()=>{Nv(t,s)}),t.jobs.set(s,{cancellation:a,connection:e,failed:0,notRun:0,passed:0,total:o.testNames.length}),eF({ctx:t,headed:i.data.headed,jobId:s,testNames:o.testNames,token:a.token,workflowIdsBySlug:o.workflowIdsBySlug}).catch(l=>{Se.error({err:l},"ipc dispatch failed")}),{jobId:s,total:o.testNames.length}}function Pv(e){return new M5(N5,e.code,e)}function Nv(e,t){let r=e.jobs.get(t);r!=null&&(r.cancellation.cancel(),e.jobs.delete(t),e.expectations.forEach((n,i)=>{n.filter(o=>o.jobId===t).forEach(o=>{clearTimeout(o.timer)}),e.expectations.set(i,n.filter(o=>o.jobId!==t))}))}function _5(e,t){[...e.jobs.entries()].filter(([,r])=>r.connection===t).forEach(([r])=>{Nv(e,r)})}function ki(e,t,r){let n=e.jobs.get(t);n!=null&&(Tv(()=>n.connection.sendNotification(vv,{event:r,jobId:t})),r.kind==="test-outcome"&&(F5(n,r.outcome.kind),n.passed+n.failed+n.notRun>=n.total&&(Tv(()=>n.connection.sendNotification(xv,{failed:n.failed,jobId:t,notRun:n.notRun,passed:n.passed})),e.jobs.delete(t))))}function Tv(e){e().catch(t=>{Se.warn({err:t},"ipc notification failed")})}function F5(e,t){if(t==="pass"){e.passed+=1;return}if(t==="dispatch-error"||t==="infra-error"){e.notRun+=1;return}e.failed+=1}function Lv(e,t){let n=e.expectations.get(t)?.shift();return n==null?null:(clearTimeout(n.timer),n)}function j5(e,t){let{headed:r,jobId:n,slug:i,testName:o}=t,s=setTimeout(()=>{V5({ctx:e,jobId:n,slug:i,testName:o,timer:s})},O5);e.expectations.set(i,[...e.expectations.get(i)??[],{headed:r,jobId:n,testName:o,timer:s}])}function V5({ctx:e,jobId:t,slug:r,testName:n,timer:i}){let o=e.expectations.get(r)??[],s=o.findIndex(a=>a.timer===i);s!==-1&&(e.expectations.set(r,o.toSpliced(s,1)),ki(e,t,{kind:"test-outcome",outcome:{detail:"dispatch-timeout",kind:"dispatch-error"},runId:"",testName:n}))}function B5(e,t){let r=Lv(e,t);if(r==null)return null;let n=e.jobs.get(r.jobId);return n==null?null:{headed:r.headed,token:n.cancellation.token,finished:(i,o)=>{ki(e,r.jobId,{kind:"test-outcome",outcome:o,runId:i,testName:r.testName})},started:i=>{ki(e,r.jobId,{kind:"test-started",runId:i,testName:r.testName})}}}function U5(e){return e.kind==="typecheck-failed"?e.diagnostics.slice(0,5):e.kind==="invalid-lockfile"?e.issues.slice(0,5):e.kind==="load-threw"?[e.message]:[]}async function W5({config:e,cwd:t,message:r}){return(await pp(t)).match(i=>z5({config:e,cwd:t,lockfile:i,message:r}),i=>Promise.resolve({error:{code:"compile-failed",detail:i.kind,diagnostics:[...U5(i)]},kind:"error"}))}async function z5({config:e,cwd:t,lockfile:r,message:n}){let i=await H5(e.appUrl);if(i!=null)return{error:{code:"app-unreachable",detail:i,url:e.appUrl},kind:"error"};let o=await q5({config:e,cwd:t,lockfile:r});return o!=null?{error:{code:"sync-failed",detail:o},kind:"error"}:(await K5({config:e,cwd:t,lockfile:r,message:n})).match(async a=>({kind:"ready",testNames:a,workflowIdsBySlug:await X5(e,t)}),a=>Promise.resolve({error:a,kind:"error"}))}var G5=2e3;async function H5(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(G5)}),null}catch(t){return t instanceof Error?t.message:String(t)}}async function q5(e){try{return await yf(e),null}catch(t){return t instanceof Error?t.message:String(t)}}async function K5({config:e,cwd:t,lockfile:r,message:n}){return!n.all&&n.tests.length===0?(await Iv({config:e,cwd:t,lockfile:r})).mapErr(Y5):kv({all:n.all,ids:n.tests,lockfile:r}).mapErr(J5)}function Y5(e){return e.kind==="scope-empty"?{code:"selection-nothing-selected"}:{code:"scope-failed",detail:e.detail}}function J5(e){switch(e.kind){case"conflicting-flags":return{code:"selection-conflicting-flags"};case"nothing-selected":return{code:"selection-nothing-selected"};case"unknown-ids":return{code:"selection-unknown-ids",known:[...e.known],unknown:[...e.unknown]}}}var Z5=Mv(`
179
+ `);async function MF(e){try{let r=(await _e({config:e,document:TF,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession?.scopeItems??[];return Iv(r.flatMap(n=>n.workflow==null?[]:[n.workflow.slug]))}catch(t){return vf({detail:t instanceof Error?t.message:String(t),kind:"scope-fetch-failed"})}}var Av=".ripplo/tests/";function OF(e){try{return na(["status","--porcelain","--",".ripplo/tests"],e).split(`
180
+ `).map(t=>t.slice(3).trim()).filter(t=>t.startsWith(Av)&&t.endsWith(".ts")).map(t=>t.slice(Av.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}catch{return[]}}var DF=12e4,_F=-32099;function FF(e){let t=new AbortController;return e.isCancellationRequested?(t.abort(),t.signal):(e.onCancellationRequested(()=>{t.abort()}),t.signal)}function qY(e){let t={...e,expectations:new Map,jobs:new Map};return{claim:r=>GF(t,r),handleConnection:r=>{jF(t,r)},idle:()=>Lv(t)}}function jF(e,t){let r=gv(t);r.onRequest(wv,(n,i)=>VF({connection:r,ctx:e,params:n,token:i})),r.onRequest(vv,()=>{let n=mf();return{active:n.active,queued:n.queued,version:wa(),...e.explorationStatus()}}),r.onRequest(Sv,async(n,i)=>{let o=bv.safeParse(n);return o.success?(await e.ready,e.replayFinding(o.data.findingId,FF(i))):{kind:"error",reason:"bad-message"}}),r.onRequest(xv,()=>{let n=Lv(e);return n&&e.onShutdownRequest(),n}),r.onClose(()=>{BF(e,r)}),r.onError(n=>{Se.warn({err:n},"ipc connection error")}),t.on("error",n=>{Se.warn({err:n},"ipc socket error")}),r.listen()}function Lv(e){let t=mf();return e.jobs.size===0&&t.active===0&&t.queued===0}async function VF({connection:e,ctx:t,params:r,token:n}){let i=yv.safeParse(r);if(!i.success)throw Mv({code:"bad-message"});await t.ready;let o=await qF({config:t.config,cwd:t.cwd,message:i.data});if(o.kind==="error")throw Mv(o.error);let s=NF(),a=new LF;return n.onCancellationRequested(()=>{$v(t,s)}),t.jobs.set(s,{cancellation:a,connection:e,failed:0,notRun:0,passed:0,total:o.testNames.length}),i5({ctx:t,headed:i.data.headed,jobId:s,testNames:o.testNames,token:a.token,workflowIdsBySlug:o.workflowIdsBySlug}).catch(l=>{Se.error({err:l},"ipc dispatch failed")}),{jobId:s,total:o.testNames.length}}function Mv(e){return new $F(_F,e.code,e)}function $v(e,t){let r=e.jobs.get(t);r!=null&&(r.cancellation.cancel(),e.jobs.delete(t),e.expectations.forEach((n,i)=>{n.filter(o=>o.jobId===t).forEach(o=>{clearTimeout(o.timer)}),e.expectations.set(i,n.filter(o=>o.jobId!==t))}))}function BF(e,t){[...e.jobs.entries()].filter(([,r])=>r.connection===t).forEach(([r])=>{$v(e,r)})}function ki(e,t,r){let n=e.jobs.get(t);n!=null&&(Ov(()=>n.connection.sendNotification(Rv,{event:r,jobId:t})),r.kind==="test-outcome"&&(UF(n,r.outcome.kind),n.passed+n.failed+n.notRun>=n.total&&(Ov(()=>n.connection.sendNotification(kv,{failed:n.failed,jobId:t,notRun:n.notRun,passed:n.passed})),e.jobs.delete(t))))}function Ov(e){e().catch(t=>{Se.warn({err:t},"ipc notification failed")})}function UF(e,t){if(t==="pass"){e.passed+=1;return}if(t==="dispatch-error"||t==="infra-error"){e.notRun+=1;return}e.failed+=1}function Dv(e,t){let n=e.expectations.get(t)?.shift();return n==null?null:(clearTimeout(n.timer),n)}function WF(e,t){let{headed:r,jobId:n,slug:i,testName:o}=t,s=setTimeout(()=>{zF({ctx:e,jobId:n,slug:i,testName:o,timer:s})},DF);e.expectations.set(i,[...e.expectations.get(i)??[],{headed:r,jobId:n,testName:o,timer:s}])}function zF({ctx:e,jobId:t,slug:r,testName:n,timer:i}){let o=e.expectations.get(r)??[],s=o.findIndex(a=>a.timer===i);s!==-1&&(e.expectations.set(r,o.toSpliced(s,1)),ki(e,t,{kind:"test-outcome",outcome:{detail:"dispatch-timeout",kind:"dispatch-error"},runId:"",testName:n}))}function GF(e,t){let r=Dv(e,t);if(r==null)return null;let n=e.jobs.get(r.jobId);return n==null?null:{headed:r.headed,token:n.cancellation.token,finished:(i,o)=>{ki(e,r.jobId,{kind:"test-outcome",outcome:o,runId:i,testName:r.testName})},started:i=>{ki(e,r.jobId,{kind:"test-started",runId:i,testName:r.testName})}}}function HF(e){return e.kind==="typecheck-failed"?e.diagnostics.slice(0,5):e.kind==="invalid-lockfile"?e.issues.slice(0,5):e.kind==="load-threw"?[e.message]:[]}async function qF({config:e,cwd:t,message:r}){return(await mp(t)).match(i=>KF({config:e,cwd:t,lockfile:i,message:r}),i=>Promise.resolve({error:{code:"compile-failed",detail:i.kind,diagnostics:[...HF(i)]},kind:"error"}))}async function KF({config:e,cwd:t,lockfile:r,message:n}){let i=await JF(e.appUrl);if(i!=null)return{error:{code:"app-unreachable",detail:i,url:e.appUrl},kind:"error"};let o=await ZF({config:e,cwd:t,lockfile:r});return o!=null?{error:{code:"sync-failed",detail:o},kind:"error"}:(await XF({config:e,cwd:t,lockfile:r,message:n})).match(async a=>({kind:"ready",testNames:a,workflowIdsBySlug:await r5(e,t)}),a=>Promise.resolve({error:a,kind:"error"}))}var YF=2e3;async function JF(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(YF)}),null}catch(t){return t instanceof Error?t.message:String(t)}}async function ZF(e){try{return await bf(e),null}catch(t){return t instanceof Error?t.message:String(t)}}async function XF({config:e,cwd:t,lockfile:r,message:n}){return!n.all&&n.tests.length===0?(await Tv({config:e,cwd:t,lockfile:r})).mapErr(QF):Cv({all:n.all,ids:n.tests,lockfile:r}).mapErr(e5)}function QF(e){return e.kind==="scope-empty"?{code:"selection-nothing-selected"}:{code:"scope-failed",detail:e.detail}}function e5(e){switch(e.kind){case"conflicting-flags":return{code:"selection-conflicting-flags"};case"nothing-selected":return{code:"selection-nothing-selected"};case"unknown-ids":return{code:"selection-unknown-ids",known:[...e.known],unknown:[...e.unknown]}}}var t5=Nv(`
181
181
  query DaemonWorkflows($projectId: String!, $cwd: String!) {
182
182
  project(id: $projectId) {
183
183
  id
@@ -190,43 +190,43 @@ ${zN(i)}`),o}function S1(e){return ed(e,xe)}async function w1(e){let t=[];functi
190
190
  }
191
191
  }
192
192
  }
193
- `);async function X5(e,t){let n=(await _e({config:e,document:Z5,variables:{cwd:t,projectId:e.projectId}})).project?.devSession?.workflows??[];return new Map(n.map(i=>[i.slug,i.id]))}var Q5=Mv(`
194
- mutation DaemonCreateRun($workflowId: String!) {
195
- createRun(workflowId: $workflowId, executor: local) {
193
+ `);async function r5(e,t){let n=(await _e({config:e,document:t5,variables:{cwd:t,projectId:e.projectId}})).project?.devSession?.workflows??[];return new Map(n.map(i=>[i.slug,i.id]))}var n5=Nv(`
194
+ mutation DaemonCreateRun($workflowId: String!, $clientVersion: String) {
195
+ createRun(workflowId: $workflowId, executor: local, clientVersion: $clientVersion) {
196
196
  __typename
197
197
  ... on Run {
198
198
  id
199
199
  }
200
200
  }
201
201
  }
202
- `);async function eF(e){await e.testNames.reduce((t,r)=>t.then(()=>tF(e,r)),Promise.resolve())}async function tF(e,t){let{ctx:r,headed:n,jobId:i,token:o,workflowIdsBySlug:s}=e;if(o.isCancellationRequested)return;let a=rt(t),l=s.get(a);if(l==null){ki(r,i,{kind:"test-outcome",outcome:{detail:"workflow-not-found",kind:"dispatch-error"},runId:"",testName:t});return}j5(r,{headed:n,jobId:i,slug:a,testName:t});let u=await rF(r.config,l);u!=null&&(Lv(r,a),ki(r,i,{kind:"test-outcome",outcome:u,runId:"",testName:t}))}async function rF(e,t){try{let n=(await _e({config:e,document:Q5,variables:{workflowId:t}})).createRun;return n==null?{detail:"create-run-null",kind:"dispatch-error"}:n.__typename==="Run"?null:{detail:n.__typename,kind:"dispatch-error"}}catch(r){return r instanceof Er?{detail:r.message,kind:"infra-error"}:{detail:r instanceof Error?r.message:String(r),kind:"dispatch-error"}}}function nF(e){let{backoffActive:t,explorerHolder:r,headedActive:n,interactiveActive:i,interactiveQueued:o}=e,{explorationActive:s,exploreConcurrency:a,poolSize:l}=e;if(!r||n||o>0)return{abortCount:s,refillCount:0};if(t)return{abortCount:0,refillCount:0};let u=Math.min(a,l-1,l-i);return{abortCount:0,refillCount:Math.max(0,u-s)}}function VY(e){let t={active:new Map,backoffUntil:0,cancelBackoffTimer:null,cancelHeartbeat:null,holder:!1,prevInteractiveActive:e.probe().interactiveActive,stopped:!1};return _v(t,e),{explorationActive:()=>t.active.size,explorerHolder:()=>t.holder,notifyQueueChange:()=>{iF(t,e)},setExplorerHolder:r=>{t.holder=r,Ei(t,e)},stop:()=>{t.stopped=!0,t.cancelBackoffTimer?.(),t.cancelBackoffTimer=null,t.cancelHeartbeat?.(),t.cancelHeartbeat=null,Fv(t,t.active.size)}}}function _v(e,t){e.stopped||(e.cancelHeartbeat=t.setTimer(()=>{Ei(e,t),_v(e,t)},15e3))}function Ei(e,t){if(e.stopped)return;let r=t.probe(),n=nF({backoffActive:t.now()<e.backoffUntil,explorationActive:e.active.size,exploreConcurrency:t.exploreConcurrency,explorerHolder:e.holder&&t.exploreEnabled,headedActive:r.headedActive>0,interactiveActive:r.interactiveActive,interactiveQueued:r.interactiveQueued,poolSize:r.poolSize});Fv(e,n.abortCount),jv({count:n.refillCount,params:t,state:e})}function Fv(e,t){[...e.active.values()].slice(0,t).forEach(({controller:r})=>{r.abort()})}function iF(e,t){let r=t.probe();r.interactiveActive<e.prevInteractiveActive&&oF(e,t),e.prevInteractiveActive=r.interactiveActive,Ei(e,t)}function oF(e,t){e.backoffUntil=t.now()+3e4,e.cancelBackoffTimer?.(),e.cancelBackoffTimer=t.setTimer(()=>{e.cancelBackoffTimer=null,Ei(e,t)},3e4)}function jv({count:e,params:t,state:r}){if(e<=0)return;let n=sF(t.sources);n!=null&&(aF({params:t,pulled:n,state:r}),jv({count:e-1,params:t,state:r}))}function sF(e){return e.reduce((t,r)=>{if(t!=null)return t;let n=r.next();return n==null?null:{job:n,source:r}},null)}function aF({params:e,pulled:t,state:r}){let{job:n,source:i}=t,o=new AbortController;r.active.set(n.id,{controller:o,job:n,source:i}),e.execute({job:n,priority:i.priority,signal:o.signal}).then(()=>{Dv({job:n,outcome:$v(o.signal,null),params:e,source:i,state:r})}).catch(s=>{Dv({job:n,outcome:$v(o.signal,{error:s}),params:e,source:i,state:r})})}function $v(e,t){return e.aborted?{kind:"aborted"}:t==null?{kind:"completed"}:{error:t.error,kind:"error"}}function Dv({job:e,outcome:t,params:r,source:n,state:i}){i.active.delete(e.id),n.onResult(e,t),Ei(i,r)}import lF from"fs";import uF from"path";async function KY(e){let t=uF.join(e,".ripplo","index.ts");if(!lF.existsSync(t))return{appUrl:void 0,engineUrl:void 0,errors:[{message:".ripplo/index.ts not found",path:""}],valid:!1,warnings:[]};let r=await bn(e);return r.isErr()?{appUrl:void 0,engineUrl:void 0,errors:[{message:Xi(r.error),path:".ripplo/"}],valid:!1,warnings:[]}:ji().match(n=>({appUrl:n.appUrl,engineUrl:n.engineUrl,errors:[],valid:!0,warnings:[]}),n=>({appUrl:void 0,engineUrl:void 0,errors:[{message:ja(n),path:""}],valid:!1,warnings:[]}))}async function YY(e){try{await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(5e3)});return}catch{return`appUrl (${e}) is not responding. Make sure your dev server is running on that port.`}}async function JY({appUrl:e,engineUrl:t}){let r=t.startsWith("http://")||t.startsWith("https://")?t:`${e}${t}`;try{return(await fetch(`${r}/setup`,{body:JSON.stringify({}),headers:{"Content-Type":"application/json"},method:"PUT",signal:AbortSignal.timeout(5e3)})).ok?"Engine endpoint accepted an unsigned request \u2014 webhook signature verification may be missing.":void 0}catch{return}}import pF from"fs";import cF from"fs";import vf from"path";var dF=["MERGE_HEAD","rebase-merge","rebase-apply","CHERRY_PICK_HEAD","REVERT_HEAD"];function Vv(e){let t=fF(e);return t==null?!1:dF.some(r=>cF.existsSync(vf.join(t,r)))}function fF(e){try{let t=na(["rev-parse","--git-dir"],e).trim();return t.length===0?null:vf.isAbsolute(t)?t:vf.resolve(e,t)}catch{return null}}function hF(e){return Ut(e,"hooks-paused")}function sJ(e){return pF.existsSync(hF(e))||Vv(e)?!1:Ep(e)}import mF from"fs";import{lockSync as gF}from"proper-lockfile";var yF="explorer.lock",bF=15e3,SF=15e3;function wF(){return lr(yF)}function dJ({onChange:e}){let t={release:null,stopped:!1},r=()=>{t.release=null,t.stopped||e(!1)},n=()=>{if(t.stopped||t.release!=null)return;let o=vF(r);o!=null&&(t.release=o,e(!0))};n();let i=setInterval(n,SF);return{holder:()=>t.release!=null,stop:()=>{t.stopped=!0,clearInterval(i),t.release?.(),t.release=null}}}function vF(e){try{fn();let t=wF(),r=gF(t,{onCompromised:e,realpath:!1,stale:bF});return mF.writeFileSync(t,String(process.pid)),()=>{try{r()}catch{}}}catch{return null}}import xF from"path";import{randomUUID as RF}from"crypto";function Bv(e){return{axes:[Qd("unit"),ef(e)]}}var Uv=12,Wv=15,zv=4,Gv=2,Hv=18e4;var Yv={covered:0,deferred:0,findings:0,saturated:!1,total:0};function wJ(){return{priority:"p3",next:()=>null,onResult:()=>{},ready:()=>Promise.resolve(),status:()=>Yv,stop:()=>Promise.resolve()}}function vJ(e){let t={claimed:new Set,consecutiveErrors:0,covered:new Set,deferred:new Map,findings:0,haltedUntil:0,prepared:null,preparing:!1,refreshing:!1,saturated:!1,tick:0},r=xf(e,t);return{priority:"p3",next:()=>IF(e,t),onResult:()=>{},ready:()=>r,status:()=>t.prepared==null?Yv:CF(t.prepared,t),stop:()=>Promise.resolve()}}async function xf(e,t){if(!t.preparing){t.preparing=!0;try{let r=await e.loadLockfile();if(r==null)return;let n=await kF(r);if(n==null)return;await xi(Zv(e.cwd)).match(i=>{let o=vi(i);t.covered=new Set(o.covered),t.findings=[...o.findings.values()].filter(s=>s.resolvedAt==null).length,t.prepared=n,t.consecutiveErrors=0,t.haltedUntil=0,t.deferred.clear(),e.notifyWork()},i=>{Se.warn("explore ledger unreadable, exploration disabled: %s",i.kind)})}finally{t.preparing=!1}}}async function kF({fingerprint:e,lockfile:t}){let r=Bv(t),n=Nr(t);if(n.length===0)return null;let i=df(t,{sweep:!1}),o=await EF(t,i),s=sf({corpus:n,depots:o,lens:r,maxCount:Gv,maxDepth:zv});return{actionHashes:n.map(a=>rf(t,a)),corpus:n,depots:i,fingerprint:e,graph:s,lens:r,lensIdValue:Xd(r),lockfile:t,lockfileHashValue:nf(t)}}async function EF(e,t){let r={generate:$r,materialize:dl($r,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await ff(e,i,r)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}var qv=20,Jv=6e5,Kv=3e5;function CF(e,t){let r=lf(e.graph),n=af({actionHashes:e.actionHashes,corpus:e.corpus,covered:t.covered,graph:e.graph,lensId:e.lensIdValue,tick:t.tick});return{covered:r-n,deferred:ex(t).size,findings:t.findings,saturated:t.saturated,total:r}}async function AF(e,t){if(!(t.refreshing||t.preparing||t.prepared==null)){t.refreshing=!0;try{let r=await e.loadLockfile();if(r==null||r.fingerprint===t.prepared.fingerprint)return;Se.info("exploration model changed, re-preparing target graph"),t.prepared=null,await xf(e,t)}finally{t.refreshing=!1}}}function IF(e,t){AF(e,t);let r=t.prepared;if(r==null||Date.now()<t.haltedUntil)return null;let n=uf({actionHashes:r.actionHashes,corpus:r.corpus,covered:new Set([...t.covered,...t.claimed,...ex(t)]),graph:r.graph,lensId:r.lensIdValue,tick:t.tick});if(t.tick+=1,n.kind==="saturated")return t.saturated=!0,null;t.saturated=!1;let i=DF(r,n.target);return t.claimed.add(i),{id:`explore:${RF()}`,label:n.target.targetKey,run:o=>PF({choice:n.target,key:i,params:e,prepared:r,signal:o,state:t})}}async function PF({choice:e,key:t,params:r,prepared:n,signal:i,state:o}){try{let s=MF({choice:e,params:r,prepared:n});if(s==null)return;if(!await r.probeApp()){Qv(o,"app-unreachable");return}let a=AbortSignal.timeout(Hv),l=await r.executeTrail(s,AbortSignal.any([i,a]));if(l.kind==="aborted"){NF({deadline:a,key:t,signal:i,state:o});return}if(l.kind==="error"){LF({key:t,params:r,reason:l.reason,state:o});return}o.consecutiveErrors=0,Se.info("exploration trail %s: %s @ %s",l.kind,l.trail.map(u=>u.label).join(" -> "),e.targetKey.slice(0,80)),r.onTrailDone?.({kind:l.kind,label:e.targetKey,trail:l.trail}),await OF({outcome:TF(l,e,n),params:r,state:o})}finally{o.claimed.delete(t)}}function TF(e,t,r){let n={actionHash:t.actionHash,at:new Date().toISOString(),kind:"covered",lensId:r.lensIdValue,targetKey:t.targetKey};return{...e,rows:[...e.rows,n]}}function MF({choice:e,params:t,prepared:r}){let n=r.depots.find(i=>i.name===e.witness.depot);return n==null?null:{depotTest:n.test,firings:e.witness.trail.map(i=>({idx:i.idx,params:i.params})),lensId:r.lensIdValue,lockfileFingerprint:r.fingerprint,lockfileHash:r.lockfileHashValue,maxLength:t.maxTrailLength??Uv,shrinkBudget:Wv}}async function OF({outcome:e,params:t,state:r}){let n=e.rows.filter(i=>i.kind!=="covered"||!r.covered.has(ze(i)));n.forEach(i=>{(i.kind==="covered"||i.kind==="finding"||i.kind==="flaky-candidate")&&r.covered.add(ze(i))}),e.kind==="finding"&&(r.findings+=1,Se.info("exploration finding recorded")),n.length!==0&&await tf(Zv(t.cwd),n).match(()=>{},i=>{Se.warn("explore ledger append failed: %s",i.kind)})}function Zv(e){return xF.join(e,".ripplo",".local","explore-ledger.jsonl")}function NF({deadline:e,key:t,signal:r,state:n}){e.aborted&&!r.aborted&&(Xv(n,t),Se.warn("exploration trail timed out, target deferred for %ds",Jv/1e3))}function LF({key:e,params:t,reason:r,state:n}){if(r==="lockfile:fingerprint-mismatch"){$F(t,n);return}Xv(n,e),Qv(n,r)}function $F(e,t){t.preparing||(t.prepared=null,xf(e,t))}function Xv(e,t){e.deferred.set(t,Date.now()+Jv)}function Qv(e,t){e.consecutiveErrors+=1,Se.debug("exploration trail error: %s",t),e.consecutiveErrors>=qv&&(e.haltedUntil=Date.now()+Kv,e.consecutiveErrors=0,Se.warn("exploration cooling down for %ds after %d consecutive trail errors (last: %s)",Kv/1e3,qv,t))}function ex(e){let t=Date.now();return[...e.deferred].filter(([,r])=>r<=t).forEach(([r])=>e.deferred.delete(r)),new Set(e.deferred.keys())}function DF(e,t){return ze({actionHash:t.actionHash,lensId:e.lensIdValue,targetKey:t.targetKey})}import _F from"path";var FF=3;function EJ(e){return xi(jF(e)).map(t=>VF(vi(t)))}function jF(e){return _F.join(e,".ripplo",".local","explore-ledger.jsonl")}function VF(e){let t=[...e.findings.entries()].filter(([,n])=>n.resolvedAt==null).map(([n,i])=>BF(n,i)).toSorted(WF),r=[...e.flaky.entries()].filter(([,n])=>n.occurrences>=FF).map(([n,i])=>UF(n,i)).toSorted((n,i)=>i.occurrences-n.occurrences);return{pending:t,recurrentFlaky:r}}function BF(e,t){let r=t.latest;return{depot:r.depot,evidence:r.evidence,firstSeen:t.first.at,id:Xs(e),lastSeen:r.at,occurrences:t.occurrences,oracleLayer:r.oracleLayer,parts:r.parts,runId:r.runId,trail:r.trail}}function UF(e,t){return{at:t.first.at,depot:t.first.depot,id:Xs(e),occurrences:t.occurrences,trail:t.first.trail}}var tx={crash:0,frame:3,invariant:1,law:2};function WF(e,t){let r=tx[e.oracleLayer]-tx[t.oracleLayer];return r===0?t.occurrences-e.occurrences:r}import{gzip as zF}from"zlib";import{promisify as GF}from"util";import{existsSync as HF,readFileSync as qF}from"fs";import nx from"path";import{graphql as Ci}from"gql.tada";function rx(e){return[e.kind,e.target,e.value].filter(t=>t.length>0).join(" ")}async function _J({config:e,cwd:t,headed:r,lockfile:n,runId:i,session:o,signal:s,test:a}){if(!await cj(e,i))return{kind:"dispatch-failed",reason:"already-claimed",runId:i};let u=nx.join(t,".ripplo","debug"),c=[];return(await o.runOnce({capture:!0,lockfile:n,options:{baseUrl:e.appUrl,engineUrl:e.engineUrl,generate:$r,headed:r,secret:e.webhookSecret},params:void 0,runId:i,sequence:void 0,testName:a.name,onEvent:p=>{c.push(p)}},s)).match(async p=>{await KF({config:e,debugDir:u,events:c,runId:i,test:a,total:p.fired.length});let h=ix(c).flatMap(f=>f.findings);return h.length>0?{findings:h,kind:"findings",runId:i}:{kind:"pass",runId:i}},async p=>(await aj(e,i,Ct(p)),{error:p,kind:"error",runId:i}))}async function KF({config:e,debugDir:t,events:r,runId:n,test:i}){let o=ix(r),s=YF(t,n);if(s==null)throw new Error("recording-missing");await Promise.all([nj({aliases:[...XF(r),...QF(o,i)],config:e,generated:ej(r),generatedSingletons:tj(r),origin:s.origin,records:o,runId:n,test:i}),lj(e,n,s)]),await uj(e,n,o)}function ix(e){return e.flatMap(t=>t.kind==="step"?[{endMs:t.endMs,findings:t.findings,index:t.index,startMs:t.startMs,state:t.state,url:t.url}]:[])}function YF(e,t){let r=nx.join(e,t,"behavior.jsonl");if(!HF(r))return null;let n=qF(r,"utf8").split(`
203
- `).filter(o=>o.length>0).map(o=>JF(o)).flatMap(o=>ZF(o)?[o.event]:[]),i=n[0];return i==null?null:{events:n,origin:i.timestamp}}function JF(e){return JSON.parse(e)}function ZF(e){return typeof e=="object"&&e!=null&&Reflect.get(e,"kind")==="rrweb"}function XF(e){return e.flatMap(t=>t.kind==="world"?t.aliases:[])}function QF(e,t){return e.flatMap(r=>{let n=rj(t.steps[r.index]);return n.flatMap(i=>{let s=n.filter(l=>l.entity===i.entity).indexOf(i),a=r.state.rows.filter(l=>l.status==="created"&&l.entity===i.entity).at(s);return a==null?[]:[{alias:i.as,entity:i.entity,key:a.key}]})})}function ej(e){return new Set(e.flatMap(t=>t.kind==="world"?t.generated.map(r=>ox(r)):[]))}function ox({entity:e,field:t,key:r}){return`${e}\0${r}\0${t}`}function tj(e){return new Set(e.flatMap(t=>t.kind==="world"?t.generatedSingletons:[]))}function rj(e){return e==null?[]:e.expect.flatMap(t=>ia(t))}function ia(e){return e.kind==="state"&&e.assertion.kind==="created"?[{as:e.assertion.as,entity:e.entity}]:e.kind==="and"?e.predicates.flatMap(t=>ia(t)):e.kind==="when"?[...ia(e.consequence),...e.otherwise==null?[]:ia(e.otherwise)]:[]}async function nj({aliases:e,config:t,generated:r,generatedSingletons:n,origin:i,records:o,runId:s,test:a}){let l=o.map(u=>ij({aliases:e,generated:r,generatedSingletons:n,origin:i,record:u,test:a}));await _e({config:t,document:fj,variables:{items:[{runId:s,steps:l}]}})}function ij({aliases:e,generated:t,generatedSingletons:r,origin:n,record:i,test:o}){let s=o.steps[i.index];if(s==null)throw new Error("step-descriptor-missing");let a=Ma(s,i.index);return{assertions:i.findings.map(l=>({description:_n(l),detail:null,status:"failed"})),detail:null,duration:Math.max(0,i.endMs-i.startMs),nodeType:a.kind,recordingEndMs:Math.max(0,i.endMs-n),recordingStartMs:Math.max(0,i.startMs-n),rrwebIds:[],snapshotTimestamp:Math.max(0,i.endMs-n),stateRows:i.state.rows.map(l=>oj({aliases:e,generated:t,row:l})),stateSingletons:i.state.singletons.map(l=>({changed:l.changed,generated:r.has(l.name),name:l.name,value:l.value==null?null:String(l.value)})),status:i.findings.length>0?"failed":"passed",stepIndex:i.index,title:rx(a),url:i.url}}function oj({aliases:e,generated:t,row:r}){let n=e.find(i=>i.entity===r.entity&&i.key===r.key);return{entity:r.entity,fields:r.fields.map(i=>({changed:i.changed,field:i.field,generated:t.has(ox({entity:r.entity,field:i.field,key:r.key})),value:i.value==null?null:String(i.value)})),key:r.key,label:n?.alias??r.key,status:r.status}}var sj=GF(zF);async function aj(e,t,r){await _e({config:e,document:mj,variables:{reason:r,runId:t}}).catch(n=>{Se.error(n,"failRun submission failed")})}async function lj(e,t,r){let n=r.events.map(s=>JSON.stringify(s)).join(`
204
- `),i=await sj(Buffer.from(n,"utf8")),o=r.events.at(-1);await _e({config:e,document:pj,variables:{input:{bodyBase64:i.toString("base64"),chunkIndex:0,endTimestamp:Math.max(0,(o?.timestamp??r.origin)-r.origin),eventCount:r.events.length,runId:t,startTimestamp:0}}})}async function uj(e,t,r){let n=r.filter(s=>s.findings.length>0).length,i=r.length-n,o=r.reduce((s,a)=>s+Math.max(0,a.endMs-a.startMs),0);await _e({config:e,document:hj,variables:{items:[{duration:o,failCount:n,passCount:i,runId:t,status:n>0?"failed":"passed",summary:null,warnCount:0}]}})}async function cj(e,t){return((await _e({config:e,document:dj,variables:{runIds:[t]}})).startRunsBatch??[]).some(n=>n.id===t)}var dj=Ci(`
202
+ `);async function i5(e){await e.testNames.reduce((t,r)=>t.then(()=>o5(e,r)),Promise.resolve())}async function o5(e,t){let{ctx:r,headed:n,jobId:i,token:o,workflowIdsBySlug:s}=e;if(o.isCancellationRequested)return;let a=rt(t),l=s.get(a);if(l==null){ki(r,i,{kind:"test-outcome",outcome:{detail:"workflow-not-found",kind:"dispatch-error"},runId:"",testName:t});return}WF(r,{headed:n,jobId:i,slug:a,testName:t});let u=await s5(r.config,l);u!=null&&(Dv(r,a),ki(r,i,{kind:"test-outcome",outcome:u,runId:"",testName:t}))}async function s5(e,t){try{let n=(await _e({config:e,document:n5,variables:{clientVersion:wa(),workflowId:t}})).createRun;return n==null?{detail:"create-run-null",kind:"dispatch-error"}:n.__typename==="Run"?null:{detail:n.__typename,kind:"dispatch-error"}}catch(r){return r instanceof Er?{detail:r.message,kind:"infra-error"}:{detail:r instanceof Error?r.message:String(r),kind:"dispatch-error"}}}function a5(e){let{backoffActive:t,explorerHolder:r,headedActive:n,interactiveActive:i,interactiveQueued:o}=e,{explorationActive:s,exploreConcurrency:a,poolSize:l}=e;if(!r||n||o>0)return{abortCount:s,refillCount:0};if(t)return{abortCount:0,refillCount:0};let u=Math.min(a,l-1,l-i);return{abortCount:0,refillCount:Math.max(0,u-s)}}function YY(e){let t={active:new Map,backoffUntil:0,cancelBackoffTimer:null,cancelHeartbeat:null,holder:!1,prevInteractiveActive:e.probe().interactiveActive,stopped:!1};return jv(t,e),{explorationActive:()=>t.active.size,explorerHolder:()=>t.holder,notifyQueueChange:()=>{l5(t,e)},setExplorerHolder:r=>{t.holder=r,Ei(t,e)},stop:()=>{t.stopped=!0,t.cancelBackoffTimer?.(),t.cancelBackoffTimer=null,t.cancelHeartbeat?.(),t.cancelHeartbeat=null,Vv(t,t.active.size)}}}function jv(e,t){e.stopped||(e.cancelHeartbeat=t.setTimer(()=>{Ei(e,t),jv(e,t)},15e3))}function Ei(e,t){if(e.stopped)return;let r=t.probe(),n=a5({backoffActive:t.now()<e.backoffUntil,explorationActive:e.active.size,exploreConcurrency:t.exploreConcurrency,explorerHolder:e.holder&&t.exploreEnabled,headedActive:r.headedActive>0,interactiveActive:r.interactiveActive,interactiveQueued:r.interactiveQueued,poolSize:r.poolSize});Vv(e,n.abortCount),Bv({count:n.refillCount,params:t,state:e})}function Vv(e,t){[...e.active.values()].slice(0,t).forEach(({controller:r})=>{r.abort()})}function l5(e,t){let r=t.probe();r.interactiveActive<e.prevInteractiveActive&&u5(e,t),e.prevInteractiveActive=r.interactiveActive,Ei(e,t)}function u5(e,t){e.backoffUntil=t.now()+3e4,e.cancelBackoffTimer?.(),e.cancelBackoffTimer=t.setTimer(()=>{e.cancelBackoffTimer=null,Ei(e,t)},3e4)}function Bv({count:e,params:t,state:r}){if(e<=0)return;let n=c5(t.sources);n!=null&&(d5({params:t,pulled:n,state:r}),Bv({count:e-1,params:t,state:r}))}function c5(e){return e.reduce((t,r)=>{if(t!=null)return t;let n=r.next();return n==null?null:{job:n,source:r}},null)}function d5({params:e,pulled:t,state:r}){let{job:n,source:i}=t,o=new AbortController;r.active.set(n.id,{controller:o,job:n,source:i}),e.execute({job:n,priority:i.priority,signal:o.signal}).then(()=>{Fv({job:n,outcome:_v(o.signal,null),params:e,source:i,state:r})}).catch(s=>{Fv({job:n,outcome:_v(o.signal,{error:s}),params:e,source:i,state:r})})}function _v(e,t){return e.aborted?{kind:"aborted"}:t==null?{kind:"completed"}:{error:t.error,kind:"error"}}function Fv({job:e,outcome:t,params:r,source:n,state:i}){i.active.delete(e.id),n.onResult(e,t),Ei(i,r)}import f5 from"fs";import p5 from"path";async function nJ(e){let t=p5.join(e,".ripplo","index.ts");if(!f5.existsSync(t))return{appUrl:void 0,engineUrl:void 0,errors:[{message:".ripplo/index.ts not found",path:""}],valid:!1,warnings:[]};let r=await bn(e);return r.isErr()?{appUrl:void 0,engineUrl:void 0,errors:[{message:Xi(r.error),path:".ripplo/"}],valid:!1,warnings:[]}:ji().match(n=>({appUrl:n.appUrl,engineUrl:n.engineUrl,errors:[],valid:!0,warnings:[]}),n=>({appUrl:void 0,engineUrl:void 0,errors:[{message:Va(n),path:""}],valid:!1,warnings:[]}))}async function iJ(e){try{await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(5e3)});return}catch{return`appUrl (${e}) is not responding. Make sure your dev server is running on that port.`}}async function oJ({appUrl:e,engineUrl:t}){let r=t.startsWith("http://")||t.startsWith("https://")?t:`${e}${t}`;try{return(await fetch(`${r}/setup`,{body:JSON.stringify({}),headers:{"Content-Type":"application/json"},method:"PUT",signal:AbortSignal.timeout(5e3)})).ok?"Engine endpoint accepted an unsigned request \u2014 webhook signature verification may be missing.":void 0}catch{return}}import y5 from"fs";import h5 from"fs";import xf from"path";var m5=["MERGE_HEAD","rebase-merge","rebase-apply","CHERRY_PICK_HEAD","REVERT_HEAD"];function Uv(e){let t=g5(e);return t==null?!1:m5.some(r=>h5.existsSync(xf.join(t,r)))}function g5(e){try{let t=na(["rev-parse","--git-dir"],e).trim();return t.length===0?null:xf.isAbsolute(t)?t:xf.resolve(e,t)}catch{return null}}function b5(e){return Ut(e,"hooks-paused")}function mJ(e){return y5.existsSync(b5(e))||Uv(e)?!1:Ap(e)}import S5 from"fs";import{lockSync as w5}from"proper-lockfile";var v5="explorer.lock",x5=15e3,R5=15e3;function k5(){return lr(v5)}function wJ({onChange:e}){let t={release:null,stopped:!1},r=()=>{t.release=null,t.stopped||e(!1)},n=()=>{if(t.stopped||t.release!=null)return;let o=E5(r);o!=null&&(t.release=o,e(!0))};n();let i=setInterval(n,R5);return{holder:()=>t.release!=null,stop:()=>{t.stopped=!0,clearInterval(i),t.release?.(),t.release=null}}}function E5(e){try{fn();let t=k5(),r=w5(t,{onCompromised:e,realpath:!1,stale:x5});return S5.writeFileSync(t,String(process.pid)),()=>{try{r()}catch{}}}catch{return null}}import C5 from"path";import{randomUUID as A5}from"crypto";function Wv(e){return{axes:[ef("unit"),tf(e)]}}var zv=12,Gv=15,Hv=4,qv=2,Kv=18e4;var Zv={covered:0,deferred:0,findings:0,saturated:!1,total:0};function PJ(){return{priority:"p3",next:()=>null,onResult:()=>{},ready:()=>Promise.resolve(),status:()=>Zv,stop:()=>Promise.resolve()}}function TJ(e){let t={claimed:new Set,consecutiveErrors:0,covered:new Set,deferred:new Map,findings:0,haltedUntil:0,prepared:null,preparing:!1,refreshing:!1,saturated:!1,tick:0},r=Rf(e,t);return{priority:"p3",next:()=>O5(e,t),onResult:()=>{},ready:()=>r,status:()=>t.prepared==null?Zv:T5(t.prepared,t),stop:()=>Promise.resolve()}}async function Rf(e,t){if(!t.preparing){t.preparing=!0;try{let r=await e.loadLockfile();if(r==null)return;let n=await I5(r);if(n==null)return;await xi(Qv(e.cwd)).match(i=>{let o=vi(i);t.covered=new Set(o.covered),t.findings=[...o.findings.values()].filter(s=>s.resolvedAt==null).length,t.prepared=n,t.consecutiveErrors=0,t.haltedUntil=0,t.deferred.clear(),e.notifyWork()},i=>{Se.warn("explore ledger unreadable, exploration disabled: %s",i.kind)})}finally{t.preparing=!1}}}async function I5({fingerprint:e,lockfile:t}){let r=Wv(t),n=Nr(t);if(n.length===0)return null;let i=ff(t,{sweep:!1}),o=await P5(t,i),s=af({corpus:n,depots:o,lens:r,maxCount:qv,maxDepth:Hv});return{actionHashes:n.map(a=>nf(t,a)),corpus:n,depots:i,fingerprint:e,graph:s,lens:r,lensIdValue:Qd(r),lockfile:t,lockfileHashValue:of(t)}}async function P5(e,t){let r={generate:$r,materialize:fl($r,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await pf(e,i,r)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}var Yv=20,Xv=6e5,Jv=3e5;function T5(e,t){let r=uf(e.graph),n=lf({actionHashes:e.actionHashes,corpus:e.corpus,covered:t.covered,graph:e.graph,lensId:e.lensIdValue,tick:t.tick});return{covered:r-n,deferred:rx(t).size,findings:t.findings,saturated:t.saturated,total:r}}async function M5(e,t){if(!(t.refreshing||t.preparing||t.prepared==null)){t.refreshing=!0;try{let r=await e.loadLockfile();if(r==null||r.fingerprint===t.prepared.fingerprint)return;Se.info("exploration model changed, re-preparing target graph"),t.prepared=null,await Rf(e,t)}finally{t.refreshing=!1}}}function O5(e,t){M5(e,t);let r=t.prepared;if(r==null||Date.now()<t.haltedUntil)return null;let n=cf({actionHashes:r.actionHashes,corpus:r.corpus,covered:new Set([...t.covered,...t.claimed,...rx(t)]),graph:r.graph,lensId:r.lensIdValue,tick:t.tick});if(t.tick+=1,n.kind==="saturated")return t.saturated=!0,null;t.saturated=!1;let i=V5(r,n.target);return t.claimed.add(i),{id:`explore:${A5()}`,label:n.target.targetKey,run:o=>N5({choice:n.target,key:i,params:e,prepared:r,signal:o,state:t})}}async function N5({choice:e,key:t,params:r,prepared:n,signal:i,state:o}){try{let s=$5({choice:e,params:r,prepared:n});if(s==null)return;if(!await r.probeApp()){tx(o,"app-unreachable");return}let a=AbortSignal.timeout(Kv),l=await r.executeTrail(s,AbortSignal.any([i,a]));if(l.kind==="aborted"){_5({deadline:a,key:t,signal:i,state:o});return}if(l.kind==="error"){F5({key:t,params:r,reason:l.reason,state:o});return}o.consecutiveErrors=0,Se.info("exploration trail %s: %s @ %s",l.kind,l.trail.map(u=>u.label).join(" -> "),e.targetKey.slice(0,80)),r.onTrailDone?.({kind:l.kind,label:e.targetKey,trail:l.trail}),await D5({outcome:L5(l,e,n),params:r,state:o})}finally{o.claimed.delete(t)}}function L5(e,t,r){let n={actionHash:t.actionHash,at:new Date().toISOString(),kind:"covered",lensId:r.lensIdValue,targetKey:t.targetKey};return{...e,rows:[...e.rows,n]}}function $5({choice:e,params:t,prepared:r}){let n=r.depots.find(i=>i.name===e.witness.depot);return n==null?null:{depotTest:n.test,firings:e.witness.trail.map(i=>({idx:i.idx,params:i.params})),lensId:r.lensIdValue,lockfileFingerprint:r.fingerprint,lockfileHash:r.lockfileHashValue,maxLength:t.maxTrailLength??zv,shrinkBudget:Gv}}async function D5({outcome:e,params:t,state:r}){let n=e.rows.filter(i=>i.kind!=="covered"||!r.covered.has(ze(i)));n.forEach(i=>{(i.kind==="covered"||i.kind==="finding"||i.kind==="flaky-candidate")&&r.covered.add(ze(i))}),e.kind==="finding"&&(r.findings+=1,Se.info("exploration finding recorded")),n.length!==0&&await rf(Qv(t.cwd),n).match(()=>{},i=>{Se.warn("explore ledger append failed: %s",i.kind)})}function Qv(e){return C5.join(e,".ripplo",".local","explore-ledger.jsonl")}function _5({deadline:e,key:t,signal:r,state:n}){e.aborted&&!r.aborted&&(ex(n,t),Se.warn("exploration trail timed out, target deferred for %ds",Xv/1e3))}function F5({key:e,params:t,reason:r,state:n}){if(r==="lockfile:fingerprint-mismatch"){j5(t,n);return}ex(n,e),tx(n,r)}function j5(e,t){t.preparing||(t.prepared=null,Rf(e,t))}function ex(e,t){e.deferred.set(t,Date.now()+Xv)}function tx(e,t){e.consecutiveErrors+=1,Se.debug("exploration trail error: %s",t),e.consecutiveErrors>=Yv&&(e.haltedUntil=Date.now()+Jv,e.consecutiveErrors=0,Se.warn("exploration cooling down for %ds after %d consecutive trail errors (last: %s)",Jv/1e3,Yv,t))}function rx(e){let t=Date.now();return[...e.deferred].filter(([,r])=>r<=t).forEach(([r])=>e.deferred.delete(r)),new Set(e.deferred.keys())}function V5(e,t){return ze({actionHash:t.actionHash,lensId:e.lensIdValue,targetKey:t.targetKey})}import B5 from"path";var U5=3;function LJ(e){return xi(W5(e)).map(t=>z5(vi(t)))}function W5(e){return B5.join(e,".ripplo",".local","explore-ledger.jsonl")}function z5(e){let t=[...e.findings.entries()].filter(([,n])=>n.resolvedAt==null).map(([n,i])=>G5(n,i)).toSorted(q5),r=[...e.flaky.entries()].filter(([,n])=>n.occurrences>=U5).map(([n,i])=>H5(n,i)).toSorted((n,i)=>i.occurrences-n.occurrences);return{pending:t,recurrentFlaky:r}}function G5(e,t){let r=t.latest;return{depot:r.depot,evidence:r.evidence,firstSeen:t.first.at,id:Xs(e),lastSeen:r.at,occurrences:t.occurrences,oracleLayer:r.oracleLayer,parts:r.parts,runId:r.runId,trail:r.trail}}function H5(e,t){return{at:t.first.at,depot:t.first.depot,id:Xs(e),occurrences:t.occurrences,trail:t.first.trail}}var nx={crash:0,frame:3,invariant:1,law:2};function q5(e,t){let r=nx[e.oracleLayer]-nx[t.oracleLayer];return r===0?t.occurrences-e.occurrences:r}import{gzip as K5}from"zlib";import{promisify as Y5}from"util";import{existsSync as J5,readFileSync as Z5}from"fs";import ox from"path";import{graphql as Ci}from"gql.tada";function ix(e){return[e.kind,e.target,e.value].filter(t=>t.length>0).join(" ")}async function HJ({config:e,cwd:t,headed:r,lockfile:n,runId:i,session:o,signal:s,test:a}){if(!await hj(e,i))return{kind:"dispatch-failed",reason:"already-claimed",runId:i};let u=ox.join(t,".ripplo","debug"),c=[];return(await o.runOnce({capture:!0,lockfile:n,options:{baseUrl:e.appUrl,engineUrl:e.engineUrl,generate:$r,headed:r,secret:e.webhookSecret},params:void 0,runId:i,sequence:void 0,testName:a.name,onEvent:p=>{c.push(p)}},s)).match(async p=>{await X5({config:e,debugDir:u,events:c,runId:i,test:a,total:p.fired.length});let h=sx(c).flatMap(f=>f.findings);return h.length>0?{findings:h,kind:"findings",runId:i}:{kind:"pass",runId:i}},async p=>(await dj(e,i,Ct(p)),{error:p,kind:"error",runId:i}))}async function X5({config:e,debugDir:t,events:r,runId:n,test:i}){let o=sx(r),s=Q5(t,n);if(s==null)throw new Error("recording-missing");await Promise.all([aj({aliases:[...rj(r),...nj(o,i)],config:e,generated:ij(r),generatedSingletons:oj(r),origin:s.origin,records:o,runId:n,test:i}),fj(e,n,s)]),await pj(e,n,o)}function sx(e){return e.flatMap(t=>t.kind==="step"?[{endMs:t.endMs,findings:t.findings,index:t.index,startMs:t.startMs,state:t.state,url:t.url}]:[])}function Q5(e,t){let r=ox.join(e,t,"behavior.jsonl");if(!J5(r))return null;let n=Z5(r,"utf8").split(`
203
+ `).filter(o=>o.length>0).map(o=>ej(o)).flatMap(o=>tj(o)?[o.event]:[]),i=n[0];return i==null?null:{events:n,origin:i.timestamp}}function ej(e){return JSON.parse(e)}function tj(e){return typeof e=="object"&&e!=null&&Reflect.get(e,"kind")==="rrweb"}function rj(e){return e.flatMap(t=>t.kind==="world"?t.aliases:[])}function nj(e,t){return e.flatMap(r=>{let n=sj(t.steps[r.index]);return n.flatMap(i=>{let s=n.filter(l=>l.entity===i.entity).indexOf(i),a=r.state.rows.filter(l=>l.status==="created"&&l.entity===i.entity).at(s);return a==null?[]:[{alias:i.as,entity:i.entity,key:a.key}]})})}function ij(e){return new Set(e.flatMap(t=>t.kind==="world"?t.generated.map(r=>ax(r)):[]))}function ax({entity:e,field:t,key:r}){return`${e}\0${r}\0${t}`}function oj(e){return new Set(e.flatMap(t=>t.kind==="world"?t.generatedSingletons:[]))}function sj(e){return e==null?[]:e.expect.flatMap(t=>ia(t))}function ia(e){return e.kind==="state"&&e.assertion.kind==="created"?[{as:e.assertion.as,entity:e.entity}]:e.kind==="and"?e.predicates.flatMap(t=>ia(t)):e.kind==="when"?[...ia(e.consequence),...e.otherwise==null?[]:ia(e.otherwise)]:[]}async function aj({aliases:e,config:t,generated:r,generatedSingletons:n,origin:i,records:o,runId:s,test:a}){let l=o.map(u=>lj({aliases:e,generated:r,generatedSingletons:n,origin:i,record:u,test:a}));await _e({config:t,document:gj,variables:{items:[{runId:s,steps:l}]}})}function lj({aliases:e,generated:t,generatedSingletons:r,origin:n,record:i,test:o}){let s=o.steps[i.index];if(s==null)throw new Error("step-descriptor-missing");let a=Oa(s,i.index);return{assertions:i.findings.map(l=>({description:_n(l),detail:null,status:"failed"})),detail:null,duration:Math.max(0,i.endMs-i.startMs),nodeType:a.kind,recordingEndMs:Math.max(0,i.endMs-n),recordingStartMs:Math.max(0,i.startMs-n),rrwebIds:[],snapshotTimestamp:Math.max(0,i.endMs-n),stateRows:i.state.rows.map(l=>uj({aliases:e,generated:t,row:l})),stateSingletons:i.state.singletons.map(l=>({changed:l.changed,generated:r.has(l.name),name:l.name,value:l.value==null?null:String(l.value)})),status:i.findings.length>0?"failed":"passed",stepIndex:i.index,title:ix(a),url:i.url}}function uj({aliases:e,generated:t,row:r}){let n=e.find(i=>i.entity===r.entity&&i.key===r.key);return{entity:r.entity,fields:r.fields.map(i=>({changed:i.changed,field:i.field,generated:t.has(ax({entity:r.entity,field:i.field,key:r.key})),value:i.value==null?null:String(i.value)})),key:r.key,label:n?.alias??r.key,status:r.status}}var cj=Y5(K5);async function dj(e,t,r){await _e({config:e,document:Sj,variables:{reason:r,runId:t}}).catch(n=>{Se.error(n,"failRun submission failed")})}async function fj(e,t,r){let n=r.events.map(s=>JSON.stringify(s)).join(`
204
+ `),i=await cj(Buffer.from(n,"utf8")),o=r.events.at(-1);await _e({config:e,document:yj,variables:{input:{bodyBase64:i.toString("base64"),chunkIndex:0,endTimestamp:Math.max(0,(o?.timestamp??r.origin)-r.origin),eventCount:r.events.length,runId:t,startTimestamp:0}}})}async function pj(e,t,r){let n=r.filter(s=>s.findings.length>0).length,i=r.length-n,o=r.reduce((s,a)=>s+Math.max(0,a.endMs-a.startMs),0);await _e({config:e,document:bj,variables:{items:[{duration:o,failCount:n,passCount:i,runId:t,status:n>0?"failed":"passed",summary:null,warnCount:0}]}})}async function hj(e,t){return((await _e({config:e,document:mj,variables:{runIds:[t]}})).startRunsBatch??[]).some(n=>n.id===t)}var mj=Ci(`
205
205
  mutation StartRunsBatch($runIds: [String!]!) {
206
206
  startRunsBatch(runIds: $runIds) {
207
207
  id
208
208
  }
209
209
  }
210
- `),fj=Ci(`
210
+ `),gj=Ci(`
211
211
  mutation SubmitRunStepsBatch($items: [SubmitRunStepsItem!]!) {
212
212
  submitRunStepsBatch(items: $items)
213
213
  }
214
- `),pj=Ci(`
214
+ `),yj=Ci(`
215
215
  mutation SubmitRunRecordingChunk($input: SubmitRunRecordingChunkInput!) {
216
216
  submitRunRecordingChunk(input: $input)
217
217
  }
218
- `),hj=Ci(`
218
+ `),bj=Ci(`
219
219
  mutation CompleteRunsBatch($items: [CompleteRunItem!]!) {
220
220
  completeRunsBatch(items: $items) {
221
221
  id
222
222
  status
223
223
  }
224
224
  }
225
- `),mj=Ci(`
225
+ `),Sj=Ci(`
226
226
  mutation FailRun($runId: String!, $reason: String!) {
227
227
  failRun(runId: $runId, reason: $reason)
228
228
  }
229
- `);import{createMessageConnection as sx,IPCMessageReader as ax,IPCMessageWriter as lx,NotificationType as gj,NotificationType0 as ux,RequestType as Rf}from"vscode-jsonrpc/node";import{z as D}from"zod";var zJ=D.object({headed:D.boolean(),lockfileFingerprint:D.string(),runId:D.string().min(1),workflowSlug:D.string().min(1)}),GJ=D.object({fingerprint:D.string()}),HJ=D.object({lockfileJson:D.string().optional(),unavailable:D.string().optional()}),yj=D.enum(["unspecified","internal","server","client","producer","consumer"]),bj=D.enum(["unset","ok","error"]),Sj=D.object({attributes:D.record(D.string(),D.string()),durationMs:D.number(),kind:D.literal("span"),name:D.string(),parentSpanId:D.union([D.string(),D.undefined()]),source:D.literal("server"),spanId:D.string(),spanKind:yj,status:D.object({code:bj,message:D.union([D.string(),D.undefined()])}),timeNanos:D.string(),traceId:D.string()}),qJ=D.object({runId:D.string().min(1),span:Sj}),KJ=D.object({outcome:bf,serverNotified:D.boolean()}),YJ=D.object({depotTest:zi,firings:D.array(D.object({idx:D.number().int().nonnegative(),params:D.record(D.string(),D.union([Xe,D.null()]))})),lensId:D.string().min(1),lockfileFingerprint:D.string(),lockfileHash:D.string().min(1),maxLength:D.number().int().positive(),shrinkBudget:D.number().int().nonnegative()}),wj=D.object({actions:D.array(D.string()),label:D.string().min(1)}),JJ=D.object({kind:D.enum(["aborted","clean","error","flaky","finding"]),reason:D.string().optional(),rows:D.array(Zs),trail:D.array(wj).default([])}),ZJ=new ux("worker/ready"),XJ=new Rf("worker/run"),QJ=new Rf("worker/lockfile"),eZ=new Rf("worker/exploreTrail"),tZ=new gj("worker/span"),rZ=new ux("worker/shutdown");function nZ(e){let t=sx(new ax(e),new lx(e));return t.listen(),t}function iZ(){let e=sx(new ax(process),new lx(process));return e.listen(),e}export{Sx as a,Se as b,Ix as c,Er as d,Px as e,_e as f,ua as g,Ut as h,lr as i,da as j,Kx as k,Yx as l,zx as m,iR as n,oR as o,uV as p,yV as q,ji as r,pR as s,gR as t,yR as u,PR as v,rt as w,Zi as x,UR as y,bn as z,Pr as A,aB as B,Xi as C,dB as D,fB as E,pB as F,SB as G,ja as H,yp as I,Sp as J,OB as K,Ep as L,Ua as M,_B as N,na as O,Vv as P,KY as Q,YY as R,JY as S,dl as T,Nr as U,jC as V,zC as W,$r as X,W as Y,bI as Z,SI as _,wI as $,Wa as aa,wc as ba,G8 as ca,Xs as da,vi as ea,xi as fa,tf as ga,rf as ha,nf as ia,I9 as ja,df as ka,ff as la,D9 as ma,hF as na,sJ as oa,dJ as pa,Bv as qa,wJ as ra,vJ as sa,EJ as ta,jF as ua,aY as va,lY as wa,hv as xa,uY as ya,cY as za,dY as Aa,fY as Ba,pY as Ca,hY as Da,yv as Ea,bv as Fa,Sv as Ga,wv as Ha,vv as Ia,xv as Ja,NK as Ka,LK as La,$K as Ma,DK as Na,_K as Oa,FK as Pa,K9 as Qa,jK as Ra,UK as Sa,WK as Ta,hf as Ua,zK as Va,uv as Wa,rY as Xa,yf as Ya,L5 as Za,FY as _a,_J as $a,aj as ab,zJ as bb,GJ as cb,qJ as db,KJ as eb,YJ as fb,JJ as gb,ZJ as hb,XJ as ib,QJ as jb,eZ as kb,tZ as lb,rZ as mb,nZ as nb,iZ as ob,VY as pb};
229
+ `);import{createMessageConnection as lx,IPCMessageReader as ux,IPCMessageWriter as cx,NotificationType as wj,NotificationType0 as dx,RequestType as kf}from"vscode-jsonrpc/node";import{z as D}from"zod";var QJ=D.object({headed:D.boolean(),lockfileFingerprint:D.string(),runId:D.string().min(1),workflowSlug:D.string().min(1)}),eZ=D.object({fingerprint:D.string()}),tZ=D.object({lockfileJson:D.string().optional(),unavailable:D.string().optional()}),vj=D.enum(["unspecified","internal","server","client","producer","consumer"]),xj=D.enum(["unset","ok","error"]),Rj=D.object({attributes:D.record(D.string(),D.string()),durationMs:D.number(),kind:D.literal("span"),name:D.string(),parentSpanId:D.union([D.string(),D.undefined()]),source:D.literal("server"),spanId:D.string(),spanKind:vj,status:D.object({code:xj,message:D.union([D.string(),D.undefined()])}),timeNanos:D.string(),traceId:D.string()}),rZ=D.object({runId:D.string().min(1),span:Rj}),nZ=D.object({outcome:Sf,serverNotified:D.boolean()}),iZ=D.object({depotTest:zi,firings:D.array(D.object({idx:D.number().int().nonnegative(),params:D.record(D.string(),D.union([Xe,D.null()]))})),lensId:D.string().min(1),lockfileFingerprint:D.string(),lockfileHash:D.string().min(1),maxLength:D.number().int().positive(),shrinkBudget:D.number().int().nonnegative()}),kj=D.object({actions:D.array(D.string()),label:D.string().min(1)}),oZ=D.object({kind:D.enum(["aborted","clean","error","flaky","finding"]),reason:D.string().optional(),rows:D.array(Zs),trail:D.array(kj).default([])}),sZ=new dx("worker/ready"),aZ=new kf("worker/run"),lZ=new kf("worker/lockfile"),uZ=new kf("worker/exploreTrail"),cZ=new wj("worker/span"),dZ=new dx("worker/shutdown");function fZ(e){let t=lx(new ux(e),new cx(e));return t.listen(),t}function pZ(){let e=lx(new ux(process),new cx(process));return e.listen(),e}export{vx as a,Se as b,Tx as c,Er as d,Mx as e,_e as f,ua as g,Ut as h,lr as i,da as j,Jx as k,Zx as l,Hx as m,sR as n,aR as o,pV as p,vV as q,ji as r,mR as s,wa as t,wR as u,vR as v,NR as w,rt as x,Zi as y,HR as z,bn as A,Pr as B,hB as C,Xi as D,bB as E,SB as F,wB as G,CB as H,Va as I,Sp as J,vp as K,jB as L,Ap as M,Wa as N,zB as O,na as P,Uv as Q,nJ as R,iJ as S,oJ as T,fl as U,Nr as V,WC as W,KC as X,$r as Y,W as Z,xI as _,RI as $,kI as aa,za as ba,vc as ca,Y8 as da,Xs as ea,vi as fa,xi as ga,rf as ha,nf as ia,of as ja,O9 as ka,ff as la,pf as ma,V9 as na,b5 as oa,mJ as pa,wJ as qa,Wv as ra,PJ as sa,TJ as ta,LJ as ua,W5 as va,mY as wa,gY as xa,gv as ya,yY as za,bY as Aa,SY as Ba,wY as Ca,vY as Da,xY as Ea,Sv as Fa,wv as Ga,vv as Ha,xv as Ia,Rv as Ja,kv as Ka,VK as La,BK as Ma,UK as Na,WK as Oa,zK as Pa,GK as Qa,X9 as Ra,HK as Sa,qK as Ta,JK as Ua,ZK as Va,mf as Wa,XK as Xa,dv as Ya,cY as Za,bf as _a,FF as $a,qY as ab,HJ as bb,dj as cb,QJ as db,eZ as eb,rZ as fb,nZ as gb,iZ as hb,oZ as ib,sZ as jb,aZ as kb,lZ as lb,uZ as mb,cZ as nb,dZ as ob,fZ as pb,pZ as qb,YY as rb};
230
230
  /*! Bundled license information:
231
231
 
232
232
  rrweb/dist/rrweb.js: