ripplo 0.7.5 → 0.7.7

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,120 +1,120 @@
1
1
  #!/usr/bin/env node
2
- var ax=Object.create;var kf=Object.defineProperty;var lx=Object.getOwnPropertyDescriptor;var ux=Object.getOwnPropertyNames;var cx=Object.getPrototypeOf,dx=Object.prototype.hasOwnProperty;var Er=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var fx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ux(t))!dx.call(e,i)&&i!==r&&kf(e,i,{get:()=>t[i],enumerable:!(n=lx(t,i))||n.enumerable});return e};var Ti=(e,t,r)=>(r=e!=null?ax(cx(e)):{},fx(t||!e||!e.__esModule?kf(r,"default",{value:e,enumerable:!0}):r,e));var Of=Er(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.timingSafeEqual=void 0;function Mf(e,t=""){if(!e)throw new Error(t)}function Hx(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)),Mf(e instanceof DataView),Mf(t instanceof DataView);let r=e.byteLength,n=0,i=-1;for(;++i<r;)n|=e.getUint8(i)^t.getUint8(i);return n===0}Oi.timingSafeEqual=Hx});var $f=Er(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,ca=(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=ca;var mn=new ca;function Kx(e){return mn.encode(e)}He.encode=Kx;function Yx(e){return mn.decode(e)}He.decode=Yx;var Nf=(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})(ca);He.URLSafeCoder=Nf;var Lf=new Nf;function Jx(e){return Lf.encode(e)}He.encodeURLSafe=Jx;function Zx(e){return Lf.decode(e)}He.decodeURLSafe=Zx;He.encodedLength=function(e){return mn.encodedLength(e)};He.maxDecodedLength=function(e){return mn.maxDecodedLength(e)};He.decodedLength=function(e){return mn.decodedLength(e)}});var _f=Er((Df,Ni)=>{"use strict";(function(e,t){var r={};t(r);var n=r.default;for(var i in r)n[i]=r[i];typeof Ni=="object"&&typeof Ni.exports=="object"?Ni.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):e.sha256=n})(Df,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 fa=Er(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.Webhook=Ar.WebhookVerificationError=void 0;var Xx=Of(),Ff=$f(),Qx=_f(),jf=300,da=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 da{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};Ar.WebhookVerificationError=Wt;var Li=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=Ff.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,Xx.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,${Ff.encode(Qx.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>jf)throw new Wt("Message timestamp too old");if(n>r+jf)throw new Wt("Message timestamp too new");return new Date(n*1e3)}};Ar.Webhook=Li;Li.prefix="whsec_"});var Kp=Er((Ka,qp)=>{"use strict";var{hasOwnProperty:Rn}=Object.prototype,dr=qa();dr.configure=qa;dr.stringify=dr;dr.default=dr;Ka.stringify=dr;Ka.configure=qa;qp.exports=dr;var Tk=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Ht(e){return e.length<5e3&&!Tk.test(e)?`"${e}"`:JSON.stringify(e)}function Ga(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 Mk=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Ha(e){return Mk.call(e)!==void 0&&e.length!==0}function Gp(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 Ok(e){if(Rn.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 Nk(e){let t;if(Rn.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 Lk(e,t){let r;if(Rn.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 Hp(e,t){let r;if(Rn.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 cr(e){return e===1?"1 item":`${e} items`}function $k(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function Dk(e){if(Rn.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 qa(e){e={...e};let t=Dk(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=Ok(e),n=Lk(e,"bigint"),i=Nk(e),o=typeof i=="function"?i:void 0,s=Hp(e,"maximumDepth"),a=Hp(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 Ht(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 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+=`
3
3
  ${w}`,E=`,
4
- ${w}`);let X=Math.min(y.length,a),F=0;for(;F<X-1;F++){let ft=l(String(F),y,m,g,S,w);x+=ft!==void 0?ft:"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 ft=y.length-a-1;x+=`${E}"... ${cr(ft)} not stringified"`}return S!==""&&(x+=`
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&&!Ha(y)&&(I=Ga(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}${Ht(F)}:${C}${$e}`,V=E)}if(M>a){let X=M-a;x+=`${V}"...":${C}"${cr(X)} not stringified"`,V=E}return S!==""&&V.length>1&&(x=`
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=`
7
7
  ${w}${x}
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 Ht(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+=`
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=`,
10
- ${w}`);let M=Math.min(f.length,a),C=0;for(;C<M-1;C++){let Z=u(String(C),f[C],m,g,S,w);x+=Z!==void 0?Z:"null",x+=E}let V=u(String(C),f[C],m,g,S,w);if(x+=V!==void 0?V:"null",f.length-1>a){let Z=f.length-a-1;x+=`${E}"... ${cr(Z)} not stringified"`}return S!==""&&(x+=`
10
+ ${w}`);let M=Math.min(f.length,a),C=0;for(;C<M-1;C++){let Z=u(String(C),f[C],m,g,S,w);x+=Z!==void 0?Z:"null",x+=E}let V=u(String(C),f[C],m,g,S,w);if(x+=V!==void 0?V:"null",f.length-1>a){let Z=f.length-a-1;x+=`${E}"... ${ur(Z)} not stringified"`}return S!==""&&(x+=`
11
11
  ${y}`),m.pop(),`[${x}]`}m.push(f);let N="";S!==""&&(w+=S,E=`,
12
- ${w}`,N=" ");let I="";for(let M of g){let C=u(M,f[M],m,g,S,w);C!==void 0&&(x+=`${I}${Ht(M)}:${N}${C}`,I=E)}return S!==""&&I.length>1&&(x=`
12
+ ${w}`,N=" ");let I="";for(let M of g){let C=u(M,f[M],m,g,S,w);C!==void 0&&(x+=`${I}${Gt(M)}:${N}${C}`,I=E)}return S!==""&&I.length>1&&(x=`
13
13
  ${w}${x}
14
- ${y}`),m.pop(),`{${x}}`}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 c(h,f,m,g,S){switch(typeof f){case"string":return Ht(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(h),typeof f!="object")return c(h,f,m,g,S);if(f===null)return"null"}if(m.indexOf(f)!==-1)return r;let w=S;if(Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f),S+=g;let C=`
14
+ ${y}`),m.pop(),`{${x}}`}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 c(h,f,m,g,S){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 c(h,f,m,g,S);if(f===null)return"null"}if(m.indexOf(f)!==-1)return r;let w=S;if(Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f),S+=g;let C=`
15
15
  ${S}`,V=`,
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}"... ${cr($e)} not stringified"`}return C+=`
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);Ha(f)&&(N+=Gp(f,E,a),y=y.slice(f.length),M-=f.length,I=E),i&&(y=Ga(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}${Ht(V)}: ${Z}`,I=E)}if(x>a){let C=x-a;N+=`${I}"...": "${cr(C)} not stringified"`,I=E}return I!==""&&(N=`
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=`
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 Ht(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+=`,"... ${cr(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&&Ha(f)&&(g+=Gp(f,",",a),w=w.slice(f.length),E-=f.length,x=","),i&&(w=Ga(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}${Ht(I)}:${M}`,x=",")}if(y>a){let N=y-a;g+=`${x}"...":"${cr(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,[],$k(f),g,"")}if(g.length!==0)return c("",h,[],g,"")}return d("",h,[])}return p}});var dm=Er((LW,Dl)=>{"use strict";var wo=process||{},um=wo.argv||[],So=wo.env||{},ZA=!(So.NO_COLOR||um.includes("--no-color"))&&(!!So.FORCE_COLOR||um.includes("--color")||wo.platform==="win32"||(wo.stdout||{}).isTTY&&So.TERM!=="dumb"||!!So.CI),XA=(e,t,r=e)=>n=>{let i=""+n,o=i.indexOf(t,e.length);return~o?e+QA(i,t,r,o)+t:e+i+t},QA=(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)},cm=(e=ZA)=>{let t=e?XA:()=>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")}};Dl.exports=cm();Dl.exports.createColors=cm});import{execFileSync as px}from"child_process";import hx from"fs";import Mi from"path";function mx(e){let t=yx(e);return t??Ef(e)}function Ef(e){let t=Mi.dirname(e);return gx(Mi.join(e,".ripplo"))?e:t===e?null:Ef(t)}function gx(e){try{return hx.statSync(e).isDirectory()}catch{return!1}}function yx(e){let t=bx(["rev-parse","--show-toplevel"],e);if(t==null)return null;let r=t.trim();return r.length===0?null:Mi.isAbsolute(r)?r:Mi.resolve(e,r)}function bx(e,t){try{return px("git",e,{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]})}catch{return null}}import Sx from"pino";import wx from"pino-pretty";var Se=Sx({level:process.env.LOG_LEVEL??"info"},wx({ignore:"pid,hostname"}));import{readdir as vx,rm as xx,stat as Rx}from"fs/promises";import If from"path";var Cf=If.join(process.cwd(),".ripplo","debug"),Af=360*60*1e3;async function kx({maxRuns:e}){try{let r=(await vx(Cf,{withFileTypes:!0})).filter(u=>u.isDirectory()),n=Date.now(),i=await Promise.all(r.map(async u=>{let c=If.join(Cf,u.name),d=await Rx(c);return{dirPath:c,mtime:d.mtimeMs}})),o=i.filter(u=>n-u.mtime>Af),a=i.filter(u=>n-u.mtime<=Af).toSorted((u,c)=>c.mtime-u.mtime).slice(e),l=[...o,...a];if(l.length===0)return;await Promise.allSettled(l.map(u=>xx(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 Cr=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}},dn=class extends Error{errors;constructor(t){super(t.map(r=>r.message).join(", ")),this.name="GqlRequestError",this.errors=t}};function Ex(e){if(e instanceof dn)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 Cx({init:{body:n,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json"},method:"POST"},serverUrl:e.config.ripploServerUrl,url:i}),s=await Px({res:o,url:i});if(!Tx(s))throw new Error("Invalid GraphQL response");if(Mx(s))throw new dn(s.errors);if(s.data==null)throw new Error("No data returned from server");return s.data}async function Cx({init:e,serverUrl:t,url:r}){let n=1,i=await Pf({init:e,url:r});for(;i.retryable&&n<3;)await Ix(Ax(n)),n+=1,i=await Pf({init:e,url:r});if(i.response!=null)return i.response;throw new Cr({detail:i.detail,serverUrl:t})}async function Pf({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 Ax(e){return 300*3**(e-1)*(.5+Math.random())}function Ix(e){return new Promise(t=>{setTimeout(t,e)})}async function Px({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 Tx(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function Mx(e){return Array.isArray(e.errors)&&e.errors.length>0}import{Agent as Ox,RetryAgent as Nx,setGlobalDispatcher as Lx}from"undici";var $x=1500,Dx=4e3,_x=3,Fx=50,jx=100,Tf=!1;function Vx(){if(Tf)return;Tf=!0;let e=new Ox({connections:jx,keepAliveMaxTimeout:Dx,keepAliveTimeout:$x}),t=new Nx(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:_x,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:Fx});Lx(t)}import hn from"fs";import lr from"fs";import Bx from"os";import fn from"path";var Ux=".local",Wx=".ripplo";function sa(e){return fn.join(e,".ripplo",Ux)}function aa(e){let t=sa(e);lr.existsSync(t)||lr.mkdirSync(t,{recursive:!0});let r=fn.join(t,".gitignore");return lr.existsSync(r)||lr.writeFileSync(r,`*
21
- `),t}function Ut(e,t){return fn.join(sa(e),t)}function la(){return fn.join(Bx.homedir(),Wx)}function pn(){let e=la();return lr.existsSync(e)?lr.chmodSync(e,448):lr.mkdirSync(e,{mode:448,recursive:!0}),e}function ur(e){return fn.join(la(),e)}function ua(){let e=process.env.RIPPLO_TOKEN;if(e!=null&&e.trim().length>0)return e.trim();let t=ur("token");if(!hn.existsSync(t))return null;let r=hn.readFileSync(t,"utf8").trim();return r.length===0?null:r}function zx(e){pn(),hn.writeFileSync(ur("token"),e+`
22
- `,{mode:384})}function Gx(){let e=ur("token");return hn.existsSync(e)?(hn.unlinkSync(e),!0):!1}var Bf=Ti(fa(),1);import Vf from"crypto";function eR({body:e,secret:t}){let r=new Bf.Webhook(t),n=`msg_${Vf.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 tR(){return`whsec_${Vf.randomBytes(24).toString("base64")}`}import zf from"fs";import ji from"path";import{config as sR}from"dotenv";import{z as _i}from"zod";import{err as aR,ok as Gf}from"neverthrow";import Di from"fs";import ma from"path";import{err as pa,ok as Uf}from"neverthrow";import{z as $i}from"zod";var rR=ma.join(".ripplo","project.json"),ha=[".env",".env.local"],nR=$i.object({envFiles:$i.array($i.string().min(1)).optional(),projectId:$i.string().min(1)});function Wf(e){return ma.join(e,rR)}function ga(e){let t=Wf(e);return Di.existsSync(t)?iR(t).andThen(r=>{let n=nR.safeParse(r);return n.success?Uf({envFiles:n.data.envFiles??ha,projectId:n.data.projectId}):pa({issues:n.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`),kind:"project-file-invalid",path:t})}):pa({kind:"project-file-missing",path:t})}function ya(e){return ga(e).match(t=>t,()=>{})}function iR(e){try{return Uf(JSON.parse(Di.readFileSync(e,"utf8")))}catch(t){return pa({issues:[t instanceof Error?t.message:String(t)],kind:"project-file-invalid",path:e})}}function Gj({cwd:e,envFiles:t,projectId:r}){let n=Wf(e);Di.mkdirSync(ma.dirname(n),{recursive:!0});let i={projectId:r};t!=null&&!oR(t)&&(i.envFiles=[...t]),Di.writeFileSync(n,JSON.stringify(i,null,2)+`
23
- `)}function oR(e){return e.length!==ha.length?!1:e.every((t,r)=>t===ha[r])}function Qj(e){let r=ya(e)?.envFiles??[".env",".env.local"],n=ji.join(e,".ripplo");r.forEach(i=>{let o=ji.resolve(n,i);zf.existsSync(o)&&sR({override:!0,path:o,quiet:!0})}),Fi=void 0}var lR=_i.object({RIPPLO_APP_URL:_i.url(),RIPPLO_ENGINE_URL:_i.url(),RIPPLO_WEBHOOK_SECRET:_i.string().min(1)}),Fi;function Vi(){return Fi!=null?Gf(Fi):cR().map(e=>(Fi=e,e))}function uR(e){let r=ya(e)?.envFiles??[],n=ji.join(e,".ripplo");return r.map(i=>ji.resolve(n,i)).filter(i=>!zf.existsSync(i))}function cR(){let e=lR.safeParse(process.env);if(!e.success)return aR({issues:e.error.issues.map(r=>`${r.path.join(".")}: ${r.message}`),kind:"env-invalid",missingEnvFiles:uR(process.cwd())});let t=e.data;return Gf({appUrl:t.RIPPLO_APP_URL,engineUrl:t.RIPPLO_ENGINE_URL,webhookSecret:t.RIPPLO_WEBHOOK_SECRET})}import{z as Bi}from"zod";var dR=Bi.object({__codec:Bi.string().min(1),data:Bi.unknown(),version:Bi.number().int().positive()}),Ui=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}},Wi=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}};function ba({name:e,schema:t}){return{currentVersion:1,name:e,decode:r=>hR({name:e,raw:r,schema:t}),encode:r=>({__codec:e,data:r,version:1})}}function fR(e,t){return JSON.stringify(e.encode(t))}function pR(e,t){let r=JSON.parse(t);return e.decode(r)}function hR({name:e,raw:t,schema:r}){let n=dR.parse(t);if(n.__codec!==e)throw new Wi({expected:e,got:n.__codec});if(n.version!==1)throw new Ui({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 Sa=A.enum(["fast","slow","async"]),Ir=A.object({ref:A.string().min(1)}),Ze=A.union([A.string(),A.number(),A.boolean()]),wa=A.object({template:A.array(A.union([A.string(),Ir])).min(1)}),Ue=A.union([Ir,Ze,wa,A.null()]),Hf=A.object({kind:A.literal("changed")}),va=A.union([Ue,Hf]),vt=A.union([A.string(),Ir,wa]),mR=A.object({by:A.literal("role"),name:A.union([vt,A.undefined()]).optional().transform(e=>e),role:A.string().min(1)}),gR=A.object({by:A.literal("testId"),value:vt}),yR=A.object({by:A.literal("inside"),scope:A.lazy(()=>Re),target:A.lazy(()=>Re)}),Re=A.discriminatedUnion("by",[mR,gR,yR]),zi=A.enum(["string","number","boolean"]),xa=A.enum(["strict","eventual"]),bR=A.object({kind:A.literal("string"),maxLength:A.number().int().positive().optional(),minLength:A.number().int().nonnegative().optional(),pattern:A.string().optional()}),SR=A.object({kind:A.literal("number"),max:A.number().int().optional(),min:A.number().int().optional()}),wR=A.object({kind:A.literal("datetime"),maxOffsetDays:A.number().int(),minOffsetDays:A.number().int()}),qf=A.discriminatedUnion("kind",[bR,SR,wR]),Kf=A.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),Ra=A.object({constraints:qf.optional(),generator:Kf,name:A.string().min(1),type:zi,values:A.array(Ze).min(1).optional()}),Yf=A.object({consistency:xa.default("strict"),optional:A.boolean(),stable:A.boolean(),type:zi,valueSpace:A.string().min(1).optional()}),ka=A.enum(["backend","client"]),Ea=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),Yf),source:ka.default("backend")}),Ca=A.object({consistency:xa.default("strict"),default:Ze,description:A.string().optional(),name:A.string().min(1),source:ka.default("backend"),type:zi,valueSpace:A.string().min(1).optional()}),xt=A.enum(["url","title","viewport"]);import{z as T}from"zod";var vR=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),va)}),T.object({kind:T.literal("deleted")})]),xR=T.object({kind:T.literal("is"),value:Ue}),Jf=T.lazy(()=>T.union([Ue,kR])),RR=T.object({entity:T.string().min(1),where:T.record(T.string().min(1),Jf)}),kR=T.object({field:T.string().min(1),kind:T.literal("within"),selection:RR}),Rt=T.union([Sa,T.undefined()]).optional().transform(e=>e),zt=T.lazy(()=>T.discriminatedUnion("kind",[T.object({kind:T.literal("visible"),locator:Re,wait:Rt}),T.object({kind:T.literal("disabled"),locator:Re,wait:Rt}),T.object({kind:T.literal("enabled"),locator:Re,wait:Rt}),T.object({kind:T.literal("focused"),locator:Re,wait:Rt}),T.object({kind:T.literal("value"),locator:Re,value:vt,wait:Rt}),T.object({kind:T.literal("text"),locator:Re,value:vt,wait:Rt}),T.object({assertion:xR,kind:T.literal("singleton"),singleton:T.string().min(1),wait:Rt}),T.object({kind:T.literal("browser"),name:xt,value:vt,wait:Rt}),T.object({assertion:vR,entity:T.string().min(1),key:T.record(T.string().min(1),Jf),kind:T.literal("state"),wait:Rt}),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 Zf=P.discriminatedUnion("kind",[P.object({kind:P.literal("goto"),url:vt}),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()})]),Xf=P.object({action:Zf,expect:P.array(zt).default([])}),Qf=P.object({example:Ze.optional(),valueSpace:P.string().min(1)}),Aa=P.object({as:P.string().min(1),entity:P.string().min(1),set:P.record(P.string().min(1),Ue)}),ep=P.object({entity:P.string().min(1),where:P.record(P.string().min(1),Ue)}),Gi=P.object({absent:P.array(ep).default([]),exclusive:P.array(P.string().min(1)).default([]),intent:P.string().min(1),maybe:P.array(Aa).default([]),name:P.string().min(1),params:P.record(P.string().min(1),Qf),singletons:P.record(P.string().min(1),Ue).default({}),sourcePath:P.string().min(1).optional(),steps:P.array(Xf).default([]),stub:P.boolean().default(!1),world:P.array(Aa).default([])}),tp=P.object({sha256:P.string().regex(/^[0-9a-f]{64}$/u),size:P.number().int().nonnegative()}),Hi=P.object({entities:P.array(Ea),fixtures:P.record(P.string().min(1),tp).default({}),singletons:P.array(Ca).default([]),tests:P.array(Gi),valueSpaces:P.array(Ra)}),ER=ba({name:"ripplo-lockfile",schema:Hi});var qi="__ripplo__",Ia="__ripplo_seed__";import{z as Gt}from"zod";var rp=Gt.object({index:Gt.number().int().nonnegative(),kind:Gt.string(),target:Gt.string(),value:Gt.string()}),CR=Gt.object({steps:Gt.array(rp),stub:Gt.boolean().default(!1)});function gn(e,t){return{index:t,kind:e.action.kind,target:AR(e.action),value:IR(e.action)}}function tt(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function AR(e){return e.kind==="goto"?Ki(e.url):e.kind==="press"&&e.locator==null?"":Yi(e.locator)}function Ki(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join("")}function Yi(e){return e.by==="testId"?`testId=${Ki(e.value)}`:e.by==="inside"?`${Yi(e.scope)} \u25B8 ${Yi(e.target)}`:`${e.role} ${e.name==null?"":Ki(e.name)}`.trim()}function IR(e){return e.kind==="fill"||e.kind==="select"?PR(e.value):e.kind==="press"?e.key:""}function PR(e){return e==null?"":typeof e!="object"?String(e):Ki(e)}import{z as ke}from"zod";var np=ke.enum(["Strict","Lax","None"]),ip=ke.object({domain:ke.string().min(1),expires:ke.number(),httpOnly:ke.boolean(),name:ke.string().min(1),path:ke.string().min(1),sameSite:np,secure:ke.boolean(),value:ke.string()}),op=ke.object({localStorage:ke.array(ke.object({name:ke.string().min(1),value:ke.string()})),origin:ke.string().min(1)}),Pa=ke.object({cookies:ke.array(ip),headers:ke.record(ke.string().min(1),ke.string()).optional(),origins:ke.array(op)});import{z as K}from"zod";var Ta=K.union([Ze,K.null()]),Ma=K.record(K.string().min(1),Ta),sp=K.object({as:K.string().min(1),entity:K.string().min(1),fields:K.record(K.string().min(1),Ue)}),TR=K.object({entities:K.array(sp),runId:K.string().min(1),singletons:K.record(K.string().min(1),Ta).default({})}),ap=K.object({as:K.string().min(1),row:Ma,session:Pa.optional()}),Oa=K.object({rows:K.array(ap)}),MR=K.object({entities:K.array(K.string().min(1)),runId:K.string().min(1),singletons:K.array(K.string().min(1)).default([])}),Na=K.object({entities:K.record(K.string().min(1),K.array(Ma)),singletons:K.record(K.string().min(1),Ta).default({})}),OR=K.object({runId:K.string().min(1)}),La=K.object({ok:K.literal(!0)});import $a from"fs";import Ji from"path";import{createJiti as _R}from"jiti";import{err as Zi,ok as up}from"neverthrow";import NR from"fs";import yn from"path";import Pr from"typescript";function lp(e){let t=yn.join(e,"index.ts"),r=DR(e);NR.mkdirSync(yn.dirname(r.tsBuildInfoFile??""),{recursive:!0});let n=Pr.createIncrementalCompilerHost(r),i=Pr.createIncrementalProgram({host:n,options:r,rootNames:[t]}),o=[...i.getSyntacticDiagnostics(),...i.getSemanticDiagnostics()];i.emit();let s=o.filter(u=>LR(u,e));if(s.length===0)return{diagnostics:[],ok:!0};let a={getCanonicalFileName:u=>u,getCurrentDirectory:()=>yn.dirname(e),getNewLine:()=>`
24
- `};return{diagnostics:Pr.formatDiagnosticsWithColorAndContext(s,a).split(`
25
- `).filter(u=>u.length>0),ok:!1}}function LR(e,t){let r=e.file?.fileName;return r==null?!0:r.startsWith(t)}var $R=yn.join(".local","tsbuildinfo");function DR(e){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:Pr.ModuleKind.Preserve,moduleResolution:Pr.ModuleResolutionKind.Bundler,noEmit:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!1,target:Pr.ScriptTarget.ES2022,tsBuildInfoFile:yn.join(e,$R)}}var Xi=".ripplo/ripplo.lock",bn;async function cp(e){let{result:t}=await FR(e);return t}async function FR(e){let t=VR(Ji.join(e,".ripplo"));if(bn!=null&&bn.fingerprint===t&&bn.result.isOk())return{fingerprint:t,result:bn.result};let r=await Sn(e);return bn={fingerprint:t,result:r},{fingerprint:t,result:r}}async function Sn(e){let t=Ji.join(e,".ripplo"),r=Ji.join(t,"index.ts"),n=lp(t);return n.ok?(await BR(r)).andThen(o=>WR({entryPath:r,exported:o})):Zi({diagnostics:n.diagnostics,kind:"typecheck-failed"})}var jR=new Set([".local","debug","node_modules"]);function VR(e){return dp(e).toSorted((t,r)=>t.localeCompare(r)).join("|")}function dp(e){return($a.existsSync(e)?$a.readdirSync(e,{withFileTypes:!0}):[]).flatMap(r=>{if(jR.has(r.name))return[];let n=Ji.join(e,r.name);if(r.isDirectory())return dp(n);let i=$a.statSync(n);return[`${n}:${String(i.mtimeMs)}:${String(i.size)}`]})}async function BR(e){try{let r=await _R(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 up(n)}catch(t){return Zi({kind:"load-threw",message:UR(t)})}}function UR(e){return e instanceof Error?e.message:String(e)}function WR({entryPath:e,exported:t}){if(t==null||typeof t!="object"||!("lockfile"in t))return Zi({entryPath:e,kind:"not-ripplo"});let r=Hi.safeParse(Reflect.get(t,"lockfile"));return r.success?up(r.data):Zi({issues:r.error.issues.map(n=>`${n.path.join(".")}: ${n.message}`),kind:"invalid-lockfile"})}function Tr(e,t){return t==null?`Load \`/ripplo:${e}\` skill for instructions.`:`Load \`/ripplo:${e}\` skill for instructions on ${t}.`}function WV(e){return e.length===1?Tr(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 Qi(e){return[`Compilation failed: ${zR(e)}`,Tr("create","DSL authoring + lint rules")].join(`
26
- `)}function qV(){return`${Xi} is up to date`}function KV(e){return[`${Xi} is ${e==="missing"?"missing":"out of date"} \u2014 run \`ripplo compile\` and commit the result`,Tr("setup")].join(`
27
- `)}function YV(){return`wrote ${Xi}`}function zR(e){switch(e.kind){case"typecheck-failed":return["TypeScript errors in .ripplo/:",...fp(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?):",...fp(e.issues),"Regenerate with `npx ripplo compile` \u2014 never hand-edit the lockfile."].join(`
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:()=>`
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(`
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 fp(e,t=8){return e.length<=t?e:[...e.slice(0,t),`\u2026 and ${String(e.length-t)} more`]}var eo=class extends Error{failure;constructor(t){super(t.kind),this.name="CliError",this.failure=t}};function tB(e){return e instanceof eo?Da(e.failure):e instanceof Error?e.message:String(e)}function Da(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).",Tr("setup")].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(`
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 GR(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 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(`
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 Qi(e.error)}}function GR(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 KR,ok as YR}from"neverthrow";import{z as _a}from"zod";var HR="https://ripplo.ai";function hp(){return gp().RIPPLO_SERVER_URL}function mp(){return gp().RIPPLO_PROJECT_ID}var qR=_a.object({RIPPLO_PROJECT_ID:_a.string().min(1).optional(),RIPPLO_SERVER_URL:_a.string().min(1).default(HR)}),pp;function gp(){return pp??=qR.parse(process.env),pp}import yp from"fs";import Fa from"path";function bp(e){let t=yp.realpathSync(e),r=t,n=Fa.dirname(r);for(;n!==r;){if(yp.existsSync(Fa.join(r,".git")))return r;r=n,n=Fa.dirname(r)}return t}function hB(e){return ga(e).andThen(t=>Vi().andThen(r=>{let n=ua();return n==null?KR({kind:"not-authenticated"}):YR({appUrl:r.appUrl,cwd:bp(e),engineUrl:r.engineUrl,projectId:mp()??t.projectId,ripploServerUrl:hp(),token:n,webhookSecret:r.webhookSecret})}))}import Sp from"fs";import{checkSync as JR,lockSync as ZR}from"proper-lockfile";var XR="dev.pid",wp=15e3;function vp(e){return Ut(e,XR)}function xp(e){try{return JR(vp(e),{realpath:!1,stale:wp})}catch{return!1}}var ja=class extends Error{pid;cwd;constructor({cwd:t,pid:r}){super("dev-lock-held"),this.name="DevLockHeldError",this.pid=r,this.cwd=t}};function SB({cwd:e,onCompromised:t}){aa(e);let r=vp(e),n=QR({cwd:e,onCompromised:t,path:r});return Sp.writeFileSync(r,String(process.pid)),()=>{try{n()}catch{}}}function QR({cwd:e,onCompromised:t,path:r}){try{return ZR(r,{realpath:!1,stale:wp,onCompromised:()=>{t()}})}catch(n){throw ek(n)?new ja({cwd:e,pid:tk(r)}):n}}function ek(e){if(!(e instanceof Error)||!("code"in e))return!1;let{code:t}=e;return t==="ELOCKED"}function tk(e){try{let t=Sp.readFileSync(e,"utf8").trim(),r=Number.parseInt(t,10);return Number.isFinite(r)&&r>0?r:null}catch{return null}}import{createServer as ak}from"http";import{mkdir as lk,rm as uk,writeFile as ck}from"fs/promises";import dk from"path";import{z as ee}from"zod";import rk from"path";import{z as wn}from"zod";var nk=["unspecified","internal","server","client","producer","consumer"],ik=["unset","ok","error"];function Rp(e){return nk[e]??"unspecified"}function kp(e){return ik[e]??"unset"}var RB=wn.looseObject({data:wn.looseObject({source:wn.number().optional()}).optional(),timestamp:wn.number(),type:wn.number()});function Ep({debugDir:e,runId:t,worker:r}){let n=rk.join(e,t,"behavior.jsonl");return r.open({file:n,runId:t}),{close:i=>r.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(ok(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:sk(i.timeNanos)};r.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{r.rrwebBatch({data:i,runId:t})}}}function Mr(e){return String(BigInt(Math.round(e))*1000000n)}function ok(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function sk(e){return Number(BigInt(e)/1000000n)}var fk="otlp-port",Ap=ee.object({key:ee.string(),value:ee.object({boolValue:ee.boolean().optional(),doubleValue:ee.number().optional(),intValue:ee.union([ee.string(),ee.number()]).optional(),stringValue:ee.string().optional()})}),pk=ee.object({attributes:ee.array(Ap).default([]),endTimeUnixNano:ee.string(),kind:ee.number().default(0),name:ee.string(),parentSpanId:ee.string().optional(),spanId:ee.string(),startTimeUnixNano:ee.string(),status:ee.object({code:ee.number(),message:ee.string().optional()}).optional(),traceId:ee.string()}),hk=ee.object({resourceSpans:ee.array(ee.object({resource:ee.object({attributes:ee.array(Ap).default([])}).optional(),scopeSpans:ee.array(ee.object({spans:ee.array(pk).default([])})).default([])})).default([])});async function Va({localDir:e,onRrwebBatch:t,onSpan:r,writePortFile:n}){let{port:i,server:o}=await mk({onRrwebBatch:t,onSpan:r}),s=dk.join(e,fk);return n&&(await lk(e,{recursive:!0}),await ck(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{n&&await uk(s,{force:!0}),await wk(o)}}}function mk(e){return new Promise((t,r)=>{let n=ak((i,o)=>{gk(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 gk(e,t,r){let n=yk(e.url);if(n!=null){Cp(e).then(i=>{r.onRrwebBatch(n,i),to(t)}).catch(()=>{to(t)});return}Cp(e).then(i=>{bk(hk.parse(JSON.parse(i.toString("utf8"))),r.onSpan),to(t)}).catch(()=>{to(t)})}function yk(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function Cp(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 to(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function bk(e,t){e.resourceSpans.flatMap(r=>r.scopeSpans).flatMap(r=>r.spans).forEach(r=>{t({attributes:Sk(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:Rp(r.kind),status:{code:kp(r.status?.code??0),message:r.status?.message},timeNanos:r.startTimeUnixNano,traceId:r.traceId})})}function Sk(e){return Object.fromEntries(e.map(({key:t,value:r})=>[t,String(r.stringValue??r.intValue??r.doubleValue??r.boolValue??"")]))}function wk(e){return new Promise((t,r)=>{e.close(n=>{if(n==null){t();return}r(n)}),e.closeAllConnections()})}function kt(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 Or(e,t){return e==="url"?kt(t):t}function Ba(e,t,r){return Or(e,String(t))===Or(e,String(r))}function Pp(e,t,r){return e!=="url"?Ba(e,t,r):Ip(String(t))===Ip(String(r))}function Ip(e){return new URL(e,"https://ripplo.invalid").pathname}function Ua({actual:e,canon:t,pre:r,predicted:n}){return[...[...new Set([...n.entities.keys(),...e.entities.keys()])].flatMap(s=>vk({actual:e.entities.get(s),canon:t,entity:s,pre:r.entities.get(s),predicted:n.entities.get(s)})),...Rk(r.singletons,n.singletons,e.singletons)]}function vk({actual:e,canon:t,entity:r,pre:n,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>xk({actual:e?.get(s),canon:t,entity:r,key:s,predicted:i?.get(s),preHadKey:n?.has(s)??!1,preRow:n?.get(s)}))}function xk({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)=>Op(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 Op(e,t){return Tp(e)===Tp(t)}function Tp(e){return e==null?"\u2205":JSON.stringify(e)}function Rk(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||Mp(i,o,s)?[]:[{divergence:{kind:"singleton-mismatch",singleton:i,snapshot:o,sut:s},pending:e[i]!==void 0&&Mp(i,e[i],s)}]})}function Mp(e,t,r){let n=xt.safeParse(e);return n.success?Pp(n.data,t,r):Op(t,r)}function Wa(e){let t=kk(e.entities),r=Ek(e.singletons);return n=>Ck(n,t,r)}function kk(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([r,n])=>[Np(t.name,r),n.consistency])))}function Np(e,t){return`${e}.${t}`}function Ek(e){return new Map(e.map(t=>[t.name,t.consistency]))}function Ck(e,t,r){return e.kind==="singleton-mismatch"?Ak(e.singleton,r):e.kind==="ghost-write"||e.kind==="absent"?"strict":t.get(Np(e.entity,e.field))??"strict"}function Ak(e,t){return xt.safeParse(e).success?t.get(e)??"eventual":t.get(e)??"strict"}function za(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 $p(e,t,r){return{detail:r.slice(0,500),kind:"engine-http",path:e,status:t}}function ro(e,t){return{code:zp(t),kind:"engine-network",message:xn(t),path:e}}function Dp(e){return{kind:"client-mount-missing",mountKey:e}}function _p(e,t){return{kind:"engine-decode",message:xn(t),path:e}}function Fp(e,t){return{entity:e,field:t,kind:"state-identity"}}function jp(e){return{as:e,kind:"setup-missing-row"}}function vn(e){return{kind:"driver-launch",message:xn(e)}}function Vp(e,t){return{action:e,kind:"action-failed",message:xn(t)}}function Bp(e){return{kind:"check-failed",message:xn(e)}}function Up(){return{kind:"aborted"}}var Lp=300;function Et(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${Ik(e.detail)}${Pk(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 Wp(e){throw new Error(Et(e))}function no(){}function Ik(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=Lp?t:`${t.slice(0,Lp)}\u2026 [truncated]`}function Pk(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 zp(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?zp(e.cause):void 0}function xn(e){return e instanceof Error?e.message:String(e)}var Ya=Ti(Kp(),1),jB=Ya.default.configure,io=Ya.default;function J(e){return io(e)??""}function Ct(e,t){return[...new Map(e.map(r=>[t(r),r])).values()]}function Ja(e){return Ct(e,J)}function Yp(e){return J(e)}var kn=class extends Error{name="AbortError";constructor(){super("aborted")}};function Jp(e){return e instanceof Error&&e.name==="AbortError"}function qt(e){if(e.aborted)throw new kn}function Za(e,t){return t.aborted?Promise.reject(new kn):new Promise((r,n)=>{let i=()=>{clearTimeout(o),n(new kn)},o=setTimeout(()=>{t.removeEventListener("abort",i),r()},e);t.addEventListener("abort",i,{once:!0})})}function rh(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var _k=()=>[];async function Qa({canon:e,classify:t,initialSnapshot:r,lawObligations:n,observe:i,onAssertion:o,onStep:s,steps:a},l){return nh({acc:[],canon:e,classify:t,index:0,lawObligations:n??_k,observe:i,onAssertion:o,onStep:s,signal:l,snapshot:r,steps:a})}async function nh({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,steps:c}){qt(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 Xa(a,{endMs:Date.now(),findings:[h],index:n,startMs:p}),{finalModel:u,findings:[...e,h]}}return d.perform().match(()=>Fk({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=oo(h,d);return Xa(a,{endMs:Date.now(),findings:[f],index:n,startMs:p}),Promise.resolve({finalModel:u,findings:[...e,f]})})}async function Fk({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 Gk({canon:t,classify:r,observe:o,pre:u,predicted:h,signal:l,step:d}),m=[...d.obligations,...i(u,f.snapshot)],g=[...await jk({obligations:m,onAssertion:s,signal:l,step:d}),...f.findings];return Xa(a,{endMs:Date.now(),findings:g,index:n,startMs:c}),nh({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 jk({obligations:e,onAssertion:t,signal:r,step:n}){let i=[...new Map(e.map(s=>[Yp(s.source),s])).values()],o=await Promise.all(i.map(async s=>({obligation:s,outcome:await Vk(s,r)})));return o.forEach(s=>{Bk(t,s.obligation,s.outcome,n)}),o.flatMap(s=>Wk(s.obligation,s.outcome,n))}function Vk(e,t){if(e.check.kind==="decided"){let r=e.check.passed?"passed":"failed";return Promise.resolve({kind:r})}return Hk(e.budget,e.check.run,t)}function Bk(e,t,r,n){e?.({outcome:Uk(r),source:t.source,step:n.step})}function Uk(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function Wk(e,t,r){return t.kind==="error"?[oo(t.error,r)]:t.kind==="failed"?[{budget:e.budget,kind:"obligation",source:e.source,step:r.step}]:[]}function oo(e,t){return{error:e,kind:"driver-error",step:t.step}}function Xa(e,t){e?.(t)}var En={async:12e4,fast:5e3,slow:3e4},ih={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:En.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:En.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:En.slow}};function oh(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function Zp(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function zk(e,t,r){return r.reconcile==null?e:r.reconcile(e,t)}function Xp({canon:e,pre:t,predicted:r,step:n},i){let o=n.verifyChanges==null?[]:n.verifyChanges(r,i),s=zk(r,i,n),a=o.map(l=>({divergence:l,pending:!0}));return{adopted:s,probed:[...a,...Ua({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function sh(e,t){return{budget:t.settle,divergence:e.divergence,kind:"consistency",pending:e.pending,step:t.step}}function Qp(e,t,r){let n=e.probed.filter(i=>!i.pending&&r(i.divergence)==="strict");return n.length>0?{findings:n.map(i=>sh(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function eh(e,t,r){return{findings:[...e.probed.map(n=>sh(n,t)),...r],snapshot:e.adopted}}async function Gk({canon:e,classify:t,observe:r,pre:n,predicted:i,signal:o,step:s}){let a=ih[s.settle],l=Date.now()+a.timeoutMs,u=await Zp(r);if(!u.ok)return{findings:[oo(u.error,s)],snapshot:i};let c=Xp({canon:e,pre:n,predicted:i,step:s},u.observed),d=0;for(;Date.now()<l;){qt(o);let p=Qp(c,s,t);if(p!=null)return p;await Za(oh(a,d),o),d+=1;let h=await Zp(r);if(!h.ok)return eh(c,s,[oo(h.error,s)]);c=Xp({canon:e,pre:n,predicted:i,step:s},h.observed)}return Qp(c,s,t)??eh(c,s,[])}async function Hk(e,t,r){let n=ih[e],i=Date.now()+n.timeoutMs,o=await th(t),s=0;for(;o.kind==="pending"&&Date.now()<i;)qt(r),await Za(oh(n,s),r),s+=1,o=await th(t);return o.kind==="pending"?{kind:"failed"}:o}function th(e){return e().match(t=>t?{kind:"passed"}:{kind:"pending"},t=>({error:t,kind:"error"}))}import{z as qk}from"zod";var tl=qk.string().brand(),se=tl.parse("");function At(e){return tl.parse(e)}function ht(e,t){return tl.parse(e.length===0?t:`${e}.${t}`)}function Ne(e){return Ir.safeParse(e).success}function It(e){return typeof e=="object"&&e!==null&&"template"in e}function el(e,t,r){let n=ht(t,e.ref);if(!r.has(n))throw new Error(`unresolved binding ref "${n}"`);return r.get(n)??null}function so(e,t,r){return Kk(e).every(n=>r.has(ht(t,n)))}function rt(e,t,r){return typeof e=="string"?e:Ne(e)?String(el(e,t,r)):e.template.map(n=>typeof n=="string"?n:String(el(n,t,r))).join("")}function nt(e,t,r){return e===null||typeof e=="number"||typeof e=="boolean"?e:Ne(e)?el(e,t,r):rt(e,t,r)}function ah(e,t){return nt(e,se,t)}function Cn(e){return io(e)}function Nr(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,nt(i,t,r)]))}function Kk(e){return e==null||typeof e!="object"?[]:It(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}function Kt(e){return typeof e=="object"&&e!==null&&"kind"in e}function fr(e){return Object.fromEntries(Object.entries(e).filter(t=>!Kt(t[1])))}function lh(e,t,r){return t.reduce((n,i)=>Yk(n,i,r,e),e)}function uh(e,t){return Object.keys(t).length===0?e:{...e,singletons:{...e.singletons,...t}}}function Yk(e,t,r,n){if(!Jk(t,r))return e;if(t.assertion.kind==="created"){let o=Nr(t.assertion.props,se,r);return Zk(e,t.entity,Cn(o),o)}if(t.assertion.kind==="deleted")return rl(e,t.entity,tE(t.key,r,n));let i=Nr(fr(t.assertion.props),se,r);return rl(e,t.entity,rE(t.key,i,r,n))}function Jk(e,t){return("props"in e.assertion?[e.key,fr(e.assertion.props)]:[e.key]).every(n=>Object.values(n).every(i=>fh(i)||!Ne(i)||t.has(At(i.ref))))}function Zk(e,t,r,n){let i=new Map([...e.entities.get(t)??[],[r,n]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function rl(e,t,r){let n=r(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,n]])}}function An(e,t,r,n){let i={env:n,key:r,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>lo(o,i))}function ch(e,t,r,n,i){let o={env:n,key:r,snapshot:e};return rl(e,t,s=>new Map([...s].map(([a,l])=>[a,lo(l,o)?i(l):l])))}function lo(e,t){return Object.entries(t.key).every(([r,n])=>dh(e[r],n,t))}function dh(e,t,r){return fh(t)?Xk(t,r).has(ao(e)):ao(e)===ao(eE(t,r.env))}function fh(e){return typeof e=="object"&&e!==null&&"kind"in e}function Xk(e,t){let r=t.snapshot.entities.get(e.selection.entity);return r==null?new Set:new Set([...r.values()].filter(n=>Qk(n,e.selection.where,t)).map(n=>ao(n[e.field])))}function Qk(e,t,r){return Object.entries(t).every(([n,i])=>dh(e[n],i,r))}function ao(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function eE(e,t){return nt(e,se,t)}function tE(e,t,r){let n={env:t,key:e,snapshot:r};return i=>new Map([...i].filter(([,o])=>!lo(o,n)))}function rE(e,t,r,n){let i={env:r,key:e,snapshot:n};return o=>new Map([...o].map(([s,a])=>lo(a,i)?[s,{...a,...t}]:[s,a]))}function mh(e){let t=e.predicates.filter(o=>Sh(o)),r=t.filter(o=>o.assertion.kind==="created"),n=bh(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)=>uE(c,s,d,e.env),{env:e.env,snapshot:o}),l=n.reduce((c,d)=>lE(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>iE(c,s,d),a.env);return nE(dE(l,e.deferred,u),s,e.adopt)}}function nE(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 gh(e,t,r){return new Map([...e,...Object.entries(r).map(([n,i])=>[ht(se,`${t}.${n}`),i])])}function iE(e,t,r){let n=An(t.snapshot,r.entity,r.key,e).at(0);return n==null?e:gh(e,r.assertion.as,n)}function yh(e){let t=bh(e.predicates.filter(r=>Sh(r)));if(t.length!==0)return(r,n)=>t.flatMap(i=>oE(i,r,n,e.env))}function bh(e){return e.filter(t=>t.assertion.kind==="updated"&&nl(t.assertion.props).length>0)}function nl(e){return Object.entries(e).filter(([,t])=>Kt(t)).map(([t])=>t)}function Sh(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function oE(e,t,r,n){let i=An(t,e.entity,e.key,n).at(0),o=An(r.snapshot,e.entity,e.key,n).at(0);if(i==null||o==null)return[];let s=Cn(sE(e.key,n));return nl(e.assertion.props).flatMap(a=>ph(i[a])===ph(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function sE(e,t){let r=Object.fromEntries(Object.entries(e).filter(n=>!aE(n[1])));return Nr(r,se,t)}function aE(e){return typeof e=="object"&&e!==null&&"kind"in e}function ph(e){return e==null?"\u2205":JSON.stringify(e)}function lE(e,t,r,n){let i=nl(r.assertion.props),o=An(t.snapshot,r.entity,r.key,n).at(0);return o==null?e:ch(e,r.entity,r.key,n,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function uE(e,t,r,n){if(r.assertion.kind!=="created")return e;let i=Nr(r.assertion.props,se,n),o=Cn(i),s=e.snapshot.entities.get(r.entity);if(s==null||!s.has(o))return e;let a=cE(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:gh(e.env,r.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(r.entity,c)}}}function cE(e,t,r){if(e!=null)return[...e].find(([n,i])=>!t.has(n)&&Object.entries(r).every(([o,s])=>hh(i[o])===hh(s)))}function hh(e){return e==null?"\u2205":JSON.stringify(e)}function dE(e,t,r){let n=t.reduce((i,o)=>{let s=fE(o.value,r);return s==null?i:{...i,[o.name]:Or(o.name,s)}},e.singletons);return{...e,singletons:n}}function fE(e,t){try{return rt(e,se,t)}catch{return}}function uo(e,t){if(e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused")return{kind:e.kind,locator:In(e.locator,t)};if(e.kind==="not"){let r=uo(e.predicate,t);return r==null?null:{inner:r,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:In(e.locator,t),value:rt(e.value,se,t)}:e.kind!=="browser"?null:{kind:"browser",name:e.name,value:rt(e.value,se,t)}}function Pn(e,t){let r=e.expect.filter(l=>l.kind==="state"),n=SE(r),{adopt:i,conditional:o,deferred:s,immediate:a}=mE(e,t,n);return{action:wE(e.action,t),label:e.action.kind,obligations:e.expect.flatMap(l=>xE(l,t)),reconcile:mh({adopt:i,deferred:s,env:t,predicates:r}),verifyChanges:yh({adopt:i,deferred:s,env:t,predicates:r}),effect:l=>{let u=lh(l,r,t),c=o.reduce((d,p)=>({...d,...il(p,u,t)}),{});return uh(u,{...a,...c})}}}function In(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:rt(e.name,se,t),role:e.role}:e.by==="inside"?{by:"inside",scope:In(e.scope,t),target:In(e.target,t)}:{by:"testId",value:rt(e.value,se,t)}}function il(e,t,r){return e==null?{}:e.kind==="when"?ol(e.condition,t,r)?il(e.consequence,t,r):il(e.otherwise,t,r):hE(e,r)}function ol(e,t,r){if(!pE(e))throw new Error(`when() condition cannot be a "${e.kind}" predicate`);switch(e.kind){case"singleton":return t.singletons[e.singleton]===nt(e.assertion.value,se,r);case"count":return(t.entities.get(e.entity)?.size??0)===e.value;case"not":return!ol(e.predicate,t,r);case"and":return e.predicates.every(n=>ol(n,t,r))}}function pE(e){return e.kind==="singleton"||e.kind==="count"||e.kind==="not"||e.kind==="and"}function hE(e,t){if(e.kind!=="browser"&&e.kind!=="singleton")return{};let r=e.kind==="browser"?e.value:e.assertion.value;return so(r,se,t)?wh(e,t):{}}function mE(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:kt(rt(e.action.url,se,t))}:{},o=n?["url"]:[];return e.expect.reduce((s,a)=>a.kind==="browser"&&gE(a.value,r)?{...s,deferred:[...s.deferred,{name:a.name,value:a.value}]}:a.kind==="browser"||a.kind==="singleton"?{...s,immediate:{...s.immediate,...wh(a,t)}}:a.kind==="when"?{...s,conditional:[...s.conditional,a]}:s,{adopt:o,conditional:[],deferred:[],immediate:i})}function gE(e,t){return yE(e).some(r=>t.has(r.split(".")[0]??r))}function yE(e){return typeof e=="string"?[]:Ne(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function wh(e,t){if(e.kind==="browser")return{[e.name]:bE(e,t)};if(e.kind==="singleton")return{[e.singleton]:nt(e.assertion.value,se,t)};throw new Error("when() consequence must be a url (browser) or singleton assertion")}function bE(e,t){return Or(e.name,rt(e.value,se,t))}function SE(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function wE(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:vE(e,t),url:e.kind==="goto"?rt(e.url,se,t):void 0,value:"value"in e?ah(e.value,t):void 0}}function vE(e,t){if(!(!("locator"in e)||e.locator==null))return In(e.locator,t)}function xE(e,t){if(e.kind==="browser"||e.kind==="singleton")return[];let r=uo(e,t),n="wait"in e?e.wait??"fast":"fast";return r==null?[]:[{budget:n,check:r}]}import{err as RE,ok as kE,okAsync as EE,Result as CE}from"neverthrow";function Tn(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=OE(e),o={env:new Map,generate:r.generate,indexed:i,overrides:new Map(Object.entries(r.params??{}).map(([a,l])=>[At(a),l]))};NE(n.params,se,o);let s=n.world.map(a=>LE(a,se,o));return r.materialize(s).map(a=>AE(FE(a,o.env,i),n,e))}function sl(e,t){let r=new Map(t.map(n=>[n.name,n]));return n=>EE(PE(n,e,r).rows)}function al(e){return t=>{let r=t.map(n=>({as:n.as,entity:n.entity,fields:n.fields}));return e(r).andThen(n=>IE(t,n))}}function vh(e,t){let r=co(t);return Object.fromEntries(Object.entries(e).filter(([n,i])=>r.includes(n)&&i!=null))}function co(e){return Object.entries(e.props).filter(([,t])=>t.stable).map(([t])=>t)}function AE(e,t,r){let n=Object.fromEntries(r.singletons.map(l=>[l.name,l.default])),i=Object.fromEntries(Object.entries(t.singletons).map(([l,u])=>[l,nt(u,se,e.env)])),o={...n,...i},s=new Set(r.singletons.filter(l=>l.source==="client").map(l=>l.name)),a=Object.fromEntries(Object.entries(o).filter(([l])=>s.has(l)));return{...e,clientState:a,snapshot:{...e.snapshot,singletons:o}}}function IE(e,t){let r=new Map(t.map(n=>[n.as,n]));return CE.combine(e.map(n=>{let i=r.get(n.as);return i==null?RE(jp(n.as)):kE({as:n.as,entity:n.entity,row:i.row,session:i.session})}))}function PE(e,t,r){return e.reduce((n,i)=>{let o=TE(i.fields,n.env),s=VE({generate:t,model:i.model,seedPrefix:i.seedPrefix,set:o,valueSpaces:r}),a=Object.entries(s).map(([l,u])=>[`${i.as}.${l}`,u]);return{env:new Map([...n.env,...a]),rows:[...n.rows,{as:i.as,entity:i.entity,row:s,session:void 0}]}},{env:new Map,rows:[]})}function TE(e,t){return Object.fromEntries(Object.entries(e).map(([r,n])=>{if(Ne(n))return[r,ME(t,n.ref)];if(It(n))throw new Error(`template value not allowed in entity field "${r}"`);return[r,n]}))}function ME(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 OE(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function NE(e,t,r){Object.entries(e).forEach(([n,i])=>{let o=ht(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??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,a)})}function LE(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=ht(t,e.as),o=$E(e.set,t,r.env);return{as:i,entity:e.entity,fields:{..._E(n,o,i,r),...o},model:n,seedPrefix:i}}function $E(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,DE(i,t,r)]))}function DE(e,t,r){if(!Ne(e))return e;let n=ht(t,e.ref);return r.get(n)??{ref:n}}function _E(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,xh({field:i,generate:n.generate,model:e,seedPrefix:r,spec:o,valueSpaces:n.indexed.valueSpaces})]))}function FE(e,t,r){let n=new Map,i=e.flatMap(o=>{let s=r.models.get(o.entity);if(s==null)throw new Error(`model "${o.entity}" not found for setup "${o.as}"`);Object.entries(o.row).forEach(([l,u])=>t.set(ht(At(o.as),l),u));let a=n.get(o.entity)??new Map;return a.set(BE(o.row,s),vh(o.row,s)),n.set(o.entity,a),o.session==null?[]:[o.session]});return{auth:jE(i),env:t,snapshot:{entities:UE(n),singletons:{}}}}function jE(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 VE({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,xh({field:s,generate:e,model:t,seedPrefix:r,spec:a,valueSpaces:i})])),...n}}function xh({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:ht(n,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function BE(e,t){return t.identity.map(r=>String(e[r])).join(":")}function UE(e){return new Map([...e].map(([t,r])=>[t,new Map(r)]))}function mt(e){return`${e.test}#${String(e.index)}`}function Lr(e){let t=e.tests.flatMap(r=>fo(e,r.name));return Ct(t,r=>`${r.test}:${J(r.steps)}`)}function fo(e,t){let r=Ph(e,t),n=Eh(r,e),i=Rh(n,r.singletons),o=dC(r,cC(e));return WE(i,fC(r.steps),n).map(({chunk:a,guard:l},u)=>lC({chunk:a,guard:l,index:u,intent:r.intent,namespace:n.namespace,paramSpaceOf:o,testName:t}))}function Rh(e,t){return{absences:sC(e),entities:aC(e),exclusives:e.exclusives,optionals:Ih(e.optionals,e),singletons:Object.fromEntries(Object.entries(t).filter(([,r])=>!Ne(r)&&!It(r)))}}function po(e,t,r){return Object.values(e).flatMap(n=>Ne(n)?ul(n.ref,r):[]).find(n=>n.entity===t)?.aliasPath}function WE(e,t,r){return t.reduce((n,i)=>({guard:zE(n.guard,i,r),guarded:[...n.guarded,{chunk:i,guard:rC(n.guard,i)}]}),{guard:e,guarded:[]}).guarded}function zE(e,t,r){let n=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>GE(i,o,r),e);return{...n,singletons:{...n.singletons,...QE(t)}}}function GE(e,t,r){return t.assertion.kind==="deleted"?HE(e,t,r):t.assertion.kind==="created"?YE(e,t.entity,t.assertion.as,t.assertion.props,r):ZE(e,t,r)}function HE(e,t,r){let n=po(t.key,t.entity,r.namespace),i=e.entities.find(a=>a.alias===n),o=Mn(qE(t.key),t.entity,r),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...KE(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==n)}}function qE(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let r=t[1];return Ah(r)?[]:[[t[0],r]]}))}function KE(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(r=>!t.relations.some(n=>n.field===r.field)),...t.relations]}}function YE(e,t,r,n,i){let o=Mn(n,t,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!JE(o,s)),entities:[...e.entities,{alias:r,entity:t,...o}]}}function JE(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 ZE(e,t,r){if(t.assertion.kind!=="updated")return e;let n=po(t.key,t.entity,r.namespace);if(n==null)return e;let i=Mn(fr(t.assertion.props),t.entity,r),o=Object.entries(t.assertion.props).filter(([,a])=>Kt(a)).map(([a])=>a),s=a=>a.alias===n?XE(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a)),optionals:e.optionals.map(a=>s(a))}}function XE(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 QE(e){return e.reduce((t,r)=>({...t,...eC(r),...tC(r)}),{})}function eC(e){return e.action.kind==="goto"?{url:e.action.url}:{}}function tC(e){return Object.fromEntries(e.expect.flatMap(t=>t.kind==="browser"?[[t.name,t.value]]:t.kind==="singleton"?[[t.singleton,t.assertion.value]]:[]))}function rC(e,t){return t[0]?.action.kind!=="goto"?e:{...e,singletons:Object.fromEntries(Object.entries(e.singletons).filter(([r])=>r!=="url"))}}function ho(e,t){let r=Ph(e,t),n=Eh(r,e);return{guard:Rh(n,r.singletons),namespace:n.namespace,stable:n.stable}}function kh(e,t){return[...new Set(e)].flatMap(r=>ul(r,t))}function it(e){return Ne(e)?[e.ref]:It(e)?e.template.flatMap(t=>Ne(t)?[t.ref]:[]):[]}function Yt(e){switch(e.kind){case"visible":case"disabled":case"enabled":case"focused":return Jt(e.locator);case"value":case"text":return[...Jt(e.locator),...it(e.value)];case"singleton":return it(e.assertion.value);case"browser":return it(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(fr(e.assertion.props)).flatMap(t=>it(t)),...Object.values(e.key).flatMap(t=>Ch(t))];case"not":return Yt(e.predicate);case"when":return[...Yt(e.condition),...Yt(e.consequence),...e.otherwise==null?[]:Yt(e.otherwise)];case"and":return e.predicates.flatMap(t=>Yt(t));case"count":return[]}}function Eh(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:nC(t)}}function nC(e){let t=new Map(e.entities.map(r=>[r.name,r]));return(r,n)=>t.get(r)?.props[n]?.stable===!0}function Jt(e){return e.by==="inside"?[...Jt(e.scope),...Jt(e.target)]:e.by==="role"?e.name==null?[]:it(e.name):it(e.value)}function Ch(e){return Ah(e)?Object.values(e.selection.where).flatMap(t=>Ch(t)):it(e)}function Ah(e){return typeof e=="object"&&e!==null&&"kind"in e}function iC(e){return e.kind==="goto"?it(e.url):e.kind==="fill"||e.kind==="select"?[...Jt(e.locator),...it(e.value)]:e.kind==="press"?e.locator==null?[]:Jt(e.locator):(e.kind==="upload",Jt(e.locator))}function oC(e){return[...iC(e.action),...e.expect.flatMap(t=>Yt(t))]}function sC(e){return e.absences.map(t=>({entity:t.entity,...Mn(t.where,t.entity,e)}))}function Mn(e,t,r){let n=Object.entries(e).filter(([s])=>r.stable(t,s)),i=Object.fromEntries(n.flatMap(([s,a])=>Ne(a)||It(a)?[]:[[s,a]])),o=n.flatMap(s=>{let a=s[1];if(!Ne(a))return[];let l=ul(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 Ih(e,t){return e.map(r=>({alias:r.as,entity:r.entity,...Mn(r.set,r.entity,t)}))}function aC(e){return Ih(e.setups,e)}function lC(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=>oC(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:rh(n.flatMap(s=>uC(s)))}}function uC(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function ul(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 Ph(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 cC(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function dC(e,t){return new Map(Object.entries(e.params).map(([r,n])=>[r,t.get(n.valueSpace)]))}function fC(e){return ll(e,0,[],[])}function ll(e,t,r,n){let i=e[t];if(i==null)return r.length===0?n:[...n,r];let o=[...r,i];return pC(i)?ll(e,t+1,[],[...n,o]):ll(e,t+1,o,n)}function pC(e){return e.expect.some(t=>t.kind==="state")}function Th(e){return Mh(e,new Map)}function hC(e,t){return e.reduce((r,n)=>r??t(n),null)}function Mh(e,t){let r=e.variables.find(n=>!t.has(n));return r==null?t:hC(e.domain(r),n=>{let i=new Map([...t,[r,n]]);return e.consistent(i)?Mh(e,i):null})}function gt(e,t){let r=mC(e,t);if(r==null)return null;let n=vC(r);return xC(e.singletons,t,n)?n:null}function mC(e,t){let{absences:r,entities:n,exclusives:i,optionals:o}=e,s=new Map(n.map(u=>[u.alias,u])),a=Th({variables:n.map(u=>u.alias),consistent:u=>gC(u)&&yC(n,u)&&SC(r,u,t),domain:u=>Lh(s.get(u),t)});if(a==null)return null;let l=$h(o,a,t);return wC(i,[...n,...o],l,t)?l:null}function gC(e){let t=[...e.values()];return new Set(t).size===t.length}function yC(e,t){return e.every(r=>t.has(r.alias)?r.relations.every(n=>bC(r,n,t)):!0)}function bC(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 SC(e,t,r){return e.every(n=>![...r.entities.get(n.entity)?.values()??[]].some(i=>Oh(i,n,t)))}function Oh(e,t,r){return Nh(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 Nh(e,t){return Object.entries(t.literals).every(([r,n])=>n===null?e[r]==null:e[r]===n)}function Lh(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(r=>Nh(r,e))}function $h(e,t,r){let n=e.reduce((i,o)=>{if(i.has(o.alias))return i;let s=new Set(i.values()),a=Lh(o,r).find(l=>!s.has(l)&&Oh(l,o,i));return a==null?i:new Map([...i,[o.alias,a]])},t);return n.size===t.size?n:$h(e,n,r)}function wC(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 vC(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"?[[At(`${t}.${n[0]}`),i]]:[]})))}function xC(e,t,r){return Object.entries(e).every(([n,i])=>{if(!so(i,se,r))return!1;let o=nt(i,se,r),s=t.singletons[n],a=xt.safeParse(n);return a.success?Ba(a.data,o,s):s===o})}function mo(e,t,r){let n=gt(e.guard,t);return n==null?null:new Map([...n,...Object.entries(r).map(([i,o])=>[At(i),o])])}function go(e,t){let r=Pn(e.effectStep,t),n=EC(e,t),i=[...e.nav,...e.steps].map(o=>Pn(o,t));return{effect:CC(r.effect,n),steps:i.map(o=>({action:o.action,effect:o.effect,obligations:o.obligations,reconcile:o.reconcile,verifyChanges:o.verifyChanges}))}}function cl(e,t,r){return gt(e.guard,r)==null?!1:pr(t(r))!==pr(r)||AC(e)||RC(e)}function RC(e){return[...e.nav,...e.steps].every(t=>t.expect.every(r=>r.kind!=="state"))}var Dh=new WeakMap;function pr(e){let t=Dh.get(e);if(t!=null)return t;let r=J({entities:[...e.entities].map(([n,i])=>[n,[...i]]),singletons:kC(e.singletons)});return Dh.set(e,r),r}function kC(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>t==="url"&&typeof r=="string"?[t,kt(r)]:[t,r]))}function EC(e,t){let r=e.nav.at(-1);return r==null?void 0:Pn(r,t).action.url}function CC(e,t){if(t==null)return e;let r=kt(t);return n=>{let i=e(n);return{...i,singletons:{...i.singletons,url:r}}}}function AC(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(r=>Kt(r)))}function On(e,t,r){let n=mo(e,t.snapshot,r);if(n==null)return null;let i=IC(e,n);return i==null||!cl(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function _h(e,t,r){let n=mo(e,t.snapshot,r);if(n==null)return"guard-unsatisfied";try{return go(e,n),"no-effect"}catch{return"unresolvable"}}function IC(e,t){try{return go(e,t)}catch{return null}}function $r(e,t,r){return e.flatMap((n,i)=>{let o=r(n),s=On(n,t,o);return s==null?[]:[{firing:s,idx:i,label:mt(n),params:o}]})}var PC={absences:[],entities:[],exclusives:[],optionals:[],singletons:{}};function Nn(e){return{...PC,...e}}function dl(e){return TC(e).flatMap(t=>MC(t))}function TC(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 MC(e){if(e.length<2)return[];let t=e.map(o=>new Set(o.when.entities.map(s=>Fh(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?[]:OC(i,n,LC(e))}function Fh(e){return J([e.entity,e.literals])}function OC(e,t,r){let n=e.when.entities.filter(s=>t.includes(Fh(s))),i=new Set(n.map(s=>s.alias));if(![...e.refs].every(s=>i.has(s)))return[];let o=Nn({entities:n.map(s=>NC(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 NC(e,t){return{...e,relations:e.relations.filter(r=>t.has(r.targetAlias))}}function LC(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function $C(e){return e.flatMap((t,r)=>e.slice(r+1).flatMap(n=>Uh(t,n)))}function Bh(e,t){return Uh(e,t).length>0}function Uh(e,t){let r=jh(e.when,t.when);return!r&&!jh(t.when,e.when)||!_C(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:r?t.when:e.when}]}function jh(e,t){return fl(e.entities,t.entities)&&fl(e.absences,t.absences)&&fl(e.optionals,t.optionals)&&e.exclusives.every(r=>t.exclusives.includes(r))&&DC(e.singletons,t.singletons)}function fl(e,t){let r=new Set(t.map(n=>J(n)));return e.every(n=>r.has(J(n)))}function DC(e,t){return Object.entries(e).every(([r,n])=>J(t[r])===J(n))}function _C(e,t){return e.kind==="not"?pl(e.predicate,t):t.kind==="not"?pl(e,t.predicate):FC(e,t)||jC(e,t)}function pl(e,t){return e.kind===t.kind&&"locator"in e&&"locator"in t&&Wh(e,t)}function Wh(e,t){return"locator"in t&&J(e.locator)===J(t.locator)}function FC(e,t){let r=new Set([e.kind,t.kind]);return r.has("enabled")&&r.has("disabled")&&"locator"in e&&"locator"in t?Wh(e,t):!1}function jC(e,t){let r=Vh(e),n=Vh(t);return r==null||n==null||e.kind!==t.kind?!1:pl(e,t)&&J(r)!==J(n)}function Vh(e){return e.kind==="value"||e.kind==="text"?e.value:null}function VC(e,t){return e.flatMap(r=>{let n=BC(r),i=new Set(r.guard.absences.map(o=>o.entity));return t.flatMap(o=>UC(r,o,n,i))})}function BC(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(r=>r.kind==="state"&&r.assertion.kind==="deleted"?[r.entity]:[])))}function UC(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:mt(e)}]}function ml(e){return J({consequence:e.consequence,when:e.when})}function gl(e){let t=[...WC(e),...QC(e)],r=dl(t).reduce((n,i)=>[...t,...n].some(s=>Bh(i,s))?n:[...n,i],[]);return Ct([...t,...r],ml)}function yl(e){return e.kind==="not"?yl(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="value"||e.kind==="text"}function bl(e,t,r){if(gt(e.when,t)!=null)return null;let n=gt(e.when,r);return n==null?null:tA(e,n)}function WC(e){return Ct(e.tests.flatMap(t=>zC(e,t)),ml)}function zC(e,t){let r=ho(e,t.name);return t.steps.reduce((n,i)=>({guard:GC(n.guard,i,r),laws:[...n.laws,...XC(i,n.guard,r.namespace,{kind:"test",test:t.name})]}),{guard:r.guard,laws:[]}).laws}function GC(e,t,r){return t.expect.reduce((n,i)=>i.kind==="state"?HC(n,i,r):n,e)}function HC(e,t,r){if(t.assertion.kind==="created"){let o=qC(t.assertion.as,t.entity,t.assertion.props,r);return{...e,entities:[...e.entities,o]}}let n=po(t.key,t.entity,r.namespace);if(n==null)return e;if(t.assertion.kind==="deleted")return JC(e,n);let i=fr(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===n?hl(o,i,r):o),optionals:e.optionals.map(o=>o.alias===n?hl(o,i,r):o)}}function qC(e,t,r,n){return hl({alias:e,entity:t,literals:{},relations:[]},r,n)}function hl(e,t,r){return Object.entries(t).reduce((n,[i,o])=>{if(It(o)||!r.stable(e.entity,i))return n;if(Ne(o)){let s=KC(o.ref,i,r.namespace);return{...n,literals:YC(n.literals,i),relations:s==null?n.relations:[...zh(n.relations,i),s]}}return{...n,literals:{...n.literals,[i]:o},relations:zh(n.relations,i)}},e)}function KC(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 YC(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>r!==t))}function zh(e,t){return e.filter(r=>r.field!==t)}function JC(e,t){let r=[...e.entities,...e.optionals].find(i=>i.alias===t),n=ZC(e,t);return r==null?n:{...n,absences:[...n.absences,{entity:r.entity,literals:r.literals,relations:r.relations}]}}function ZC(e,t){return{...e,entities:e.entities.filter(r=>r.alias!==t),optionals:e.optionals.filter(r=>r.alias!==t)}}function XC(e,t,r,n){if(e.action.kind!=="goto")return[];let i=e.action.url;return e.expect.filter(o=>yl(o)).map(o=>Gh({consequence:o,guard:t,namespace:r,origin:n,url:i}))}function Gh({consequence:e,guard:t,namespace:r,origin:n,url:i}){return{consequence:e,origin:n,refs:new Set(kh([...it(i),...Yt(e)],r).map(o=>o.aliasPath)),when:{...t,singletons:{...t.singletons,url:i}}}}function QC(e){return Ct(Lr(e).flatMap(t=>eA(t)),ml)}function eA(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?[]:[Gh({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 tA(e,t){try{let r=uo(e.consequence,t);return r==null?null:{check:r}}catch{return null}}function Sl(e){return Ja(e.tests.flatMap(t=>rA(e,t.name)))}function wl(e,t){return gt(e.when,t)==null?!1:gt(e.holds,t)==null}function rA(e,t){let r=ho(e,t);return r.guard.entities.flatMap(n=>n.relations.flatMap(i=>nA(e,n,i,r.namespace)?sA(n,i,r.namespace):[]))}function nA(e,t,r,n){let i=n.get(r.targetAlias);return i!=null&&!iA(e,t.entity,r.field)&&oA(e,i,r.targetField)}function iA(e,t,r){return e.entities.find(n=>n.name===t)?.props[r]?.optional===!0}function oA(e,t,r){return e.entities.find(n=>n.name===t)?.identity.includes(r)===!0}function sA(e,t,r){let n=r.get(t.targetAlias);if(n==null)return[];let i=Hh(e.alias,e.entity),o=Hh(t.targetAlias,n);return[{holds:Nn({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:n,targetField:t.targetField},when:Nn({entities:[i]})}]}function Hh(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function vl(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=On(n,e.state,r);if(i==null){let s={intent:n.intent,kind:"unfireable",reason:_h(n,e.state,r),test:n.test};return{label:mt(n),next:e.state,result:{finalModel:e.state.snapshot,findings:[s]}}}let o=await Qa({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,lawObligations:lA(e.laws,e.invariants,e.driver),observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,steps:vl(e.firing.transition,i.resolved,e.driver)},t);return{label:mt(e.firing.transition),next:{snapshot:o.finalModel},result:o}}function aA(e,t){return wl(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},source:{invariant:e,kind:"invariant"}}]:[]}function lA(e,t,r){return(n,i)=>[...e.flatMap(o=>uA(o,n,i,r)),...t.flatMap(o=>aA(o,i))]}function uA(e,t,r,n){let i=bl(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 Rl(e,t){return xl({acc:{findings:[],fired:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function xl({acc:e,index:t,params:r,signal:n,state:i,stepBase:o}){qt(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})}},n);if(u==null)return xl({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 xl({acc:c,index:t+1,params:r,signal:n,state:u.next,stepBase:o+l.length})}var Dr={value:e=>cA(e)};function El(e,t){return{value:r=>e.value({...r,seed:`${t}:${r.seed}`})}}function Cl(e,t){return{value:r=>e.value({...r,anchor:t})}}function cA({anchor:e,constraints:t,generator:r,nullable:n,seed:i,type:o,values:s,valueSpace:a}){let l=kl(`${a}:${i}`);return n&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:r==="date.iso"?dA({anchor:e,constraints:t,n:l,timeHash:kl(`${a}:${i}#tod`)}):o==="number"?fA(l,t):o==="boolean"?l%2===0:pA(r,l.toString(36))}var yo=864e5;function dA({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/yo)*yo;return new Date(a+s*yo+n%yo).toISOString()}function kl(e,t=0,r=7){return t>=e.length?r>>>0:kl(e,t+1,r*31+(e.codePointAt(t)??0)>>>0)}function fA(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}function pA(e,t){if(e==="internet.email")return`${t}@test.ripplo.ai`;if(e==="internet.url")return`https://${t}.example.com`;let r=e.split(".").at(-1);if(r==null)throw new Error(`generator "${e}" has no "."-suffix`);return`${r}-${t}`}import{ResultAsync as Il}from"neverthrow";var Ln=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}};function Al(e){return{read:t=>hA(t,e),seedScript:t=>`globalThis[${JSON.stringify(Ia)}] = ${JSON.stringify(t)};`}}async function hA(e,t){let r={title:await e.title(),url:kt(e.url()),viewport:yA(e.viewportSize())};if(t.length===0)return r;let n=await e.evaluate(gA,{mountKey:qi,names:t,timeoutMs:mA});if(n.kind==="unmounted")throw new Ln(qi);return{...r,...n.values}}var mA=5e3;async function gA(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 yA(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}function Tl(e,t,r){return{evaluate:n=>Il.fromPromise(Jh(bA(e,r,n),`check ${n.kind}`),Kh),observe:()=>t.read().andThen(n=>Il.fromPromise(Jh(Zh(e,r,0),"observe"),Kh).map(i=>({snapshot:{...n,singletons:{...n.singletons,...i}}}))),perform:n=>Il.fromPromise(Qh(e,n,0),i=>Vp(n.kind,i))}}async function bA(e,t,r){try{return await rm(e,t,r)}catch(n){if(Xh(n))return!1;throw n}}function Kh(e){return e instanceof Ln?Dp(e.mountKey):Bp(e)}var SA=[100,250,500];async function Zh(e,t,r){try{return await t.read(e)}catch(n){let i=SA[r];if(i==null||!Xh(n))throw n;return await tm(i),Zh(e,t,r+1)}}function Xh(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 Yh=35e3;function Jh(e,t){let r,n=new Promise((i,o)=>{r=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(Yh)}ms`))},Yh)});return Promise.race([e,n]).finally(()=>{clearTimeout(r)})}var wA=[250,750,2e3];async function Qh(e,t,r){try{await vA(e,t)}catch(n){let i=wA[r];if(i==null||!kA(n))throw n;await tm(i),await Qh(e,t,r+1)}}async function vA(e,t){if(t.kind==="goto"){await e.goto(_r(t.url,t,"url"));return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(_r(t.key,t,"key"));return}await xA(em(e,t.locator),t)}function _r(e,t,r){if(e==null)throw new Error(`action "${t.kind}" requires ${r}`);return e}function xA(e,t){switch(t.kind){case"goto":throw new Error("goto must not be located");case"fill":return e.fill(String(_r(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(_r(t.value,t,"value")));case"upload":return e.setInputFiles(_r(t.files,t,"files"));case"press":return e.press(_r(t.key,t,"key"))}}function em(e,t){if(t==null)throw new Error("action requires a locator");return Pl(e,t)}function Pl(e,t){return t.by==="testId"?e.getByTestId(t.value):t.by==="inside"?Pl(Pl(e,t.scope),t.target):e.locator(RA(t.role,t.name))}function RA(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function kA(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 tm(e){return new Promise(t=>{setTimeout(t,e)})}async function rm(e,t,r){if(r.kind==="browser")return EA(e,t,r.name,r.value);if(r.kind==="not")return!await rm(e,t,r.inner);let n=em(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 EA(e,t,r,n){let o=(await t.read(e))[r];return typeof o=="string"&&o.includes(n)}async function Ml({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?CA():await r.hub.attach(a,r.runId),u=await a.newPage();return l.onPage(u),{driver:AA(Tl(u,o,i),l),emitAssertion:l.emitAssertion,close:()=>IA({context:a,handle:l})}}async function Ol(e,t){let r=await im(e);try{return await t(r)}finally{await r.close()}}function CA(){return{emitAction:()=>{},emitAssertion:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function im(e){let{chromium:t}=await import("playwright");return t.launch({headless:!e})}function om({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??=im(e),t},close:async()=>{let i=t;t=void 0,i!=null&&await i.then(o=>o.close()).catch(()=>{})}}}function AA(e,t){return{evaluate:e.evaluate,observe:e.observe,perform:r=>(t.emitAction(r),e.perform(r))}}async function IA({context:e,handle:t}){await nm(t.finish()),await nm(e.close())}var PA=15e3;async function nm(e){let t,r=new Promise(n=>{t=setTimeout(n,PA)});await Promise.race([e.catch(()=>{}),r]).finally(()=>{clearTimeout(t)})}import{err as TA,ok as MA,Result as Nl}from"neverthrow";function Ll(e,t,r){return{read:()=>r.read(e.map(n=>n.name),t).andThen(n=>OA(e,n))}}function OA(e,t){return Nl.combine(e.map(r=>NA(r,t.entities[r.name]??[]).map(n=>[r.name,n]))).map(r=>({entities:new Map(r),singletons:t.singletons}))}function NA(e,t){let r=co(e);return Nl.combine(t.map(n=>LA(n,e).map(i=>[i,$A(n,r)]))).map(n=>new Map(n))}function LA(e,t){return Nl.combine(t.identity.map(r=>{let n=e[r];return n==null?TA(Fp(t.name,r)):MA(String(n))})).map(r=>r.join(":"))}function $A(e,t){let r=t.map(n=>[n,e[n]]).filter(n=>n[1]!=null);return Object.fromEntries(r)}var am=Ti(fa(),1);import DA from"crypto";import{err as _A,errAsync as sm,ok as FA,ResultAsync as bo}from"neverthrow";var jA=3e4,VA=[250,750,2e3];function $l({baseUrl:e,runId:t,secret:r},n){let i=new am.Webhook(r),o=(s,a,l)=>BA({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:Na,signal:n}).map(l=>({entities:l.entities,singletons:l.singletons}))},setupWorld:s=>o("/setup",{entities:s,runId:t},{retry:"connection",schema:Oa,signal:n}).map(a=>a.rows),teardown:()=>o("/teardown",{runId:t},{retry:"connection",schema:La,signal:void 0}).map(()=>{})}}function BA(e){return lm(e.retry,()=>HA(e),0)}function lm(e,t,r){return t().orElse(n=>{let i=VA[r];return i==null||!WA(n,e)?sm(n):bo.fromSafePromise(GA(i)).andThen(()=>lm(e,t,r+1))})}var UA=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function WA(e,t){return e.kind==="aborted"?!1:zA(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function zA(e){return e.kind==="engine-network"&&e.code!=null&&UA.has(e.code)}function GA(e){return new Promise(t=>{setTimeout(t,e)})}function HA({baseUrl:e,body:t,path:r,schema:n,signal:i,webhook:o}){let s=JSON.stringify(t);return bo.fromPromise(fetch(`${e}${r}`,{body:s,headers:{"Content-Type":"application/json",...qA(o,s)},method:"PUT",signal:KA(i)}),a=>ro(r,a)).andThen(a=>YA(a,r)).andThen(a=>JA(n,a,r)).mapErr(a=>i?.aborted===!0?Up():a)}function qA(e,t){let r=`msg_${DA.randomUUID()}`,n=new Date;return{"webhook-id":r,"webhook-signature":e.sign(r,n,t),"webhook-timestamp":String(Math.floor(n.getTime()/1e3))}}function KA(e){let t=AbortSignal.timeout(jA);return e==null?t:AbortSignal.any([e,t])}function YA(e,t){return e.ok?bo.fromPromise(e.json(),r=>ro(t,r)):bo.fromPromise(e.text().catch(()=>""),r=>ro(t,r)).andThen(r=>sm($p(t,e.status,r)))}function JA(e,t,r){let n=e.safeParse(t);return n.success?FA(n.data):_A(_p(r,n.error))}var le=Ti(dm(),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))},eI={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 $n(e){return`${le.default.red(le.default.bold("\u2717"))} ${eI[e](le.default.bold(e.toUpperCase()))}`}var tI=le.default.red("\u2717"),$W=le.default.green("\u2713"),fm=le.default.dim("\u203A"),rI=8;function te(e,t,r){let n=r==null?"":` ${W.dim(r)}`;return` ${W.dim(e.padStart(rI))} ${t}${n}`}function Fr(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${Fr(e.scope)} \u25B8 ${Fr(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function Fl(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${Fr(e.locator)}`:e.kind}function Dn(e){return e.kind==="not"?`not ${Dn(e.inner)}`:e.kind==="browser"?`${e.name}="${e.value}"`:e.kind==="value"||e.kind==="text"?`${e.kind} ${Fr(e.locator)}="${e.value}"`:`${e.kind} ${Fr(e.locator)}`}function _n(e){let{field:t,source:r,target:n,targetField:i}=e.reference;return`${r}.${t} \u2192 ${n}.${i}`}function mm(e){return`${e.intent} \u203A ${Fl(e.action)}`}function gm(e){return e.kind==="invariant"?`invariant ${_n(e.invariant)}`:`${e.kind} ${Dn(e.check)}`}function ot(e){return e==null?"\u2205":JSON.stringify(e)}function ym(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=${ot(e.snapshot)} sut=${ot(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${ot(e.value)}`:`${e.singleton} model=${ot(e.snapshot)} sut=${ot(e.sut)}`}function jl(e){return{label:gm(e.source),step:mm(e.step)}}function Fn(e){return e.kind==="consistency"?cI(e):e.kind==="obligation"?gI(e.source,e.step,e.budget):e.kind==="illegal-transition"?hr("illegal","guard was false before this step",e.step,[te("meaning",W.dim("the action fired from a state the model says is unreachable"),void 0)]):e.kind==="unfireable"?hr("unfireable",`could not fire "${e.intent}"`,void 0,[te("reason",W.actual(Sm(e.reason)),void 0),te("meaning",W.dim("a planned move was skipped \u2014 never silently drop it"),void 0)]):hr("driver","the browser failed to run this step",e.step,[te("cause",W.actual(Et(e.error)),void 0),te("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 bm(e){return iI(oI(e))}var nI=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function iI(e){return e.replaceAll(nI,"").replaceAll(/\s+/g," ").trim()}function oI(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${ym(e.divergence)}${t}`}return e.kind==="obligation"?`${bI(e.source)} failed at "${e.step.intent}": ${SI(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 ${Sm(e.reason)}`:`driver failed at "${e.step.intent}": ${Et(e.error)}`}var sI={"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 Sm(e){return sI[e]}function aI({debugDir:e,runId:t}){let r=`${e}/${t}`;return te("behavior",W.path(`${r}/behavior.jsonl`),void 0)}function lI(e){if(e.kind==="cascade-gap"){let{gap:n}=e,i=`${n.transition} deletes ${n.target} but leaves ${n.source} dangling`;return`${$n("invariant")} ${W.bold(i)}
38
- ${te("breaks",W.dim(_n(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`${$n("invariant")} ${W.bold(i)}
39
- ${te("missing",W.dim(n.missing.join(", ")),void 0)}`}let{conflict:t}=e,r=`view laws contradict: ${t.a.kind} vs ${t.b.kind}`;return`${$n("invariant")} ${W.bold(r)}
40
- ${te("when",W.dim(JSON.stringify(t.when.singletons)),void 0)}`}function Vl(e){return"locator"in e&&e.locator!=null?`${e.kind} ${_l(e.locator)}`:"url"in e?`${e.kind} ${uI(e.url)}`:e.kind}function uI(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:wm(e)}function _l(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${pm(e.name)}`:e.by==="inside"?`${_l(e.scope)} \u25B8 ${_l(e.target)}`:pm(e.value)}function pm(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:wm(e)}function wm(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function hr(e,t,r,n){let i=r==null?[]:[` ${r.intent} ${fm} ${W.dim(Fl(r.action))}`];return[`${$n(e)} ${W.bold(t)}`,...i,...n].join(`
41
- `)}function cI(e){return e.pending?hr("consistency",pI(e.divergence),e.step,[...hm(e.divergence),te("meaning",W.dim(`the write never landed within the ${hI(e.budget)} settle budget \u2014 the app still showed the pre-step value, not a wrong one`),void 0),te("fix",W.dim("declare wait: on the expectation (or a slower tier) if this write is legitimately slow"),void 0)]):hr("consistency",mI(e.divergence),e.step,[...hm(e.divergence),te("decide",W.dim(fI(e.divergence)),void 0)])}var dI={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 fI(e){return dI[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 hm(e){if(e.kind==="field-mismatch")return[te("row",W.dim(`${e.entity} ${e.key}`),void 0),te("expected",W.expected(ot(e.snapshot)),"model predicted this"),te("actual",W.actual(ot(e.sut)),"app showed this")];if(e.kind==="singleton-mismatch")return[te("expected",W.expected(ot(e.snapshot)),"model predicted this"),te("actual",W.actual(ot(e.sut)),"app showed this")];if(e.kind==="expected-change")return[te("row",W.dim(`${e.entity} ${e.key}`),void 0),te("expected",W.expected("a different value"),"changed() asserted a change"),te("actual",W.actual(ot(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[te("meaning",W.dim(t),void 0)]}function hI(e){return`${String(En[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 gI(e,t,r){if(e.kind==="invariant")return hr("invariant",`${_n(e.invariant)} violated`,t,[te("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?[yI(e.origin)]:[];return hr("assertion",n,t,[te("check",W.warn(Dn(e.check)),void 0),...i,te("budget",W.dim(`${r} (polled until timeout)`),void 0),te("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 yI(e){if(e.kind==="test")return te("law from",W.dim(`an assertion in test "${e.test}"`),void 0);if(e.kind==="trigger")return te("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 te("law from",W.dim(`generalized across tests ${t}`),void 0)}function bI(e){return e.kind==="invariant"?"invariant":e.kind==="law"?"law":"assertion"}function SI(e){return e.kind==="invariant"?_n(e.invariant):Dn(e.check)}import{err as T8,ok as M8,ResultAsync as O8}from"neverthrow";import kb from"path";import{existsSync as wI}from"fs";import{createRequire as vI}from"module";import{fileURLToPath as xI}from"url";import{Worker as RI}from"worker_threads";var kI=vI(import.meta.url);function vm(e){let t=new RI(EI(),{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 EI(){try{return kI.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(r=>xI(new URL(r,import.meta.url))),t=e.find(r=>wI(r));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}import{readFile as CI}from"fs/promises";import{createRequire as AI}from"module";import{fileURLToPath as II}from"url";var PI=AI(import.meta.url);function Bl(e,t){try{return PI.resolve(e)}catch{return II(new URL(`assets/${t}`,import.meta.url))}}var TI=Bl("@ripplo/browser-trace/bundle","browser-trace.js");async function Rm(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await MI())}var xm;function MI(){return xm??=CI(TI,{encoding:"utf8"}),xm}import{readFile as e6}from"fs/promises";var OI=Object.defineProperty,NI=(e,t,r)=>t in e?OI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k=(e,t,r)=>NI(e,typeof t!="symbol"?t+"":t,r),km,LI=Object.defineProperty,$I=(e,t,r)=>t in e?LI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Em=(e,t,r)=>$I(e,typeof t!="symbol"?t+"":t,r),Pe=(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))(Pe||{}),Cm={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Am={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},vo={},DI=()=>!!globalThis.Zone;function Gu(e){if(vo[e])return vo[e];let t=globalThis[e],r=t.prototype,n=e in Cm?Cm[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 Am?Am[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&&!DI())return vo[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?vo[e]=u:r}catch{return r}}var Ul={};function Ot(e,t,r){var n;let i=`${e}.${String(r)}`;if(Ul[i])return Ul[i].call(t);let o=Gu(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(Ul[i]=s,s.call(t)):t[r]}var Wl={};function kg(e,t,r){let n=`${e}.${String(r)}`;if(Wl[n])return Wl[n].bind(t);let o=Gu(e)[r];return typeof o!="function"?t[r]:(Wl[n]=o,o.bind(t))}function _I(e){return Ot("Node",e,"ownerDocument")}function FI(e){return Ot("Node",e,"childNodes")}function jI(e){return Ot("Node",e,"parentNode")}function VI(e){return Ot("Node",e,"parentElement")}function BI(e){return Ot("Node",e,"textContent")}function UI(e,t){return kg("Node",e,"contains")(t)}function WI(e){return kg("Node",e,"getRootNode")()}function zI(e){return!e||!("host"in e)?null:Ot("ShadowRoot",e,"host")}function GI(e){return e.styleSheets}function HI(e){return!e||!("shadowRoot"in e)?null:Ot("Element",e,"shadowRoot")}function qI(e,t){return Ot("Element",e,"querySelector")(t)}function KI(e,t){return Ot("Element",e,"querySelectorAll")(t)}function YI(){return Gu("MutationObserver").constructor}function JI(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:_I,childNodes:FI,parentNode:jI,parentElement:VI,textContent:BI,contains:UI,getRootNode:WI,host:zI,styleSheets:GI,shadowRoot:HI,querySelector:qI,querySelectorAll:KI,mutationObserver:YI,patch:JI};function Eg(e){return e.nodeType===e.ELEMENT_NODE}function zn(e){let t=e&&"host"in e&&"mode"in e&&De.host(e)||null;return!!(t&&"shadowRoot"in t&&De.shadowRoot(t)===e)}function Gn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function ZI(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 XI(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 ru(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=>Cg(i,r)).join("");return ZI(n)}catch{return null}}function Cg(e,t){if(eP(e)){let r;try{r=ru(e.styleSheet)||XI(e)}catch{r=e.cssText}return e.styleSheet.href?Qo(r,e.styleSheet.href):r}else{let r=e.cssText;return tP(e)&&e.selectorText.includes(":")&&(r=QI(r)),t?Qo(r,t):r}}function QI(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function eP(e){return"styleSheet"in e}function tP(e){return"selectorText"in e}var Jo=class{constructor(){Em(this,"idNodeMap",new Map),Em(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 rP(){return new Jo}function Zo({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"",a=n&&gr(n);return(t[r.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function gr(e){return e.toLowerCase()}var Im="__rrweb_original__";function nP(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=Im in o?o[Im]: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 Xo(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?gr(t):null}function Ag(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 iP(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var oP=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,sP=/^(?:[a-z+]+:)?\/\//i,aP=/^www\..*/i,lP=/^(data:)([^,]*),(.*)/i;function Qo(e,t){return(e||"").replace(oP,(r,n,i,o,s,a)=>{let l=i||s||a,u=n||o||"";if(!l)return r;if(sP.test(l)||aP.test(l))return`url(${u}${l}${u})`;if(lP.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${iP(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 xo(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function uP(e,t,r=!1){let n=Array.from(t.childNodes),i=[],o=0;if(n.length>1&&e&&typeof e=="string"){let s=xo(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=xo(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=xo(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=xo(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 uP(e,t).join("/* rr_split */")}var dP=1,fP=new RegExp("[^a-z0-9-_:]"),qn=-2;function Ig(){return dP++}function pP(e){if(e instanceof HTMLFormElement)return"form";let t=gr(e.tagName);return fP.test(t)?"div":t}var jr,Pm,hP=/^[^ \t\n\r\u000c]+/,mP=/^[, \t\n\r\u000c]+/;function gP(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(hP);if(o.slice(-1)===",")o=Ur(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=Ur(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 Tm=new WeakMap;function Ur(e,t){return!t||t.trim()===""?t:Hu(e,t)}function yP(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Hu(e,t){let r=Tm.get(e);if(r||(r=e.createElement("a"),Tm.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Pg(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)?Ur(e,n):r==="srcset"?gP(e,n):r==="style"?Qo(n,Hu(e)):t==="object"&&r==="data"?Ur(e,n):n)}function Tg(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function bP(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 es(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?es(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?es(De.parentNode(e),t,r):!1}function Mg(e,t,r,n){let i;if(Eg(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(es(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 SP(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 wP(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 vP(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=xP(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Pe.Document,childNodes:[],compatMode:e.compatMode}:{type:Pe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Pe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return kP(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 RP(e,{doc:r,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Pe.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Pe.Comment,textContent:De.textContent(e)||"",rootId:S};default:return!1}}function xP(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function RP(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=Qo(l,Hu(t.doc)))),!u&&!c&&l&&r&&(l=n?n(l,De.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Pe.Text,textContent:l||"",rootId:i}}function kP(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=bP(e,n,i),m=pP(e),g={},S=e.attributes.length;for(let y=0;y<S;y++){let x=e.attributes[y];Tg(m,x.name,x.value)||(g[x.name]=Pg(r,m,gr(x.name),x.value))}if(m==="link"&&o){let y=Array.from(r.styleSheets).find(E=>E.href===e.href),x=null;y&&(x=ru(y)),x&&(delete g.rel,delete g.href,g._cssText=x)}if(m==="style"&&e.sheet){let y=ru(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=Zo({element:e,type:Xo(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")nP(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){jr||(jr=r.createElement("canvas"),Pm=jr.getContext("2d"));let y=e,x=y.currentSrc||y.getAttribute("src")||"<unknown-src>",E=y.crossOrigin,N=()=>{y.removeEventListener("load",N);try{jr.width=y.naturalWidth,jr.height=y.naturalHeight,Pm.drawImage(y,0,0),g.rr_dataURL=jr.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:Pe.Element,tagName:m,attributes:g,childNodes:[],isSVG:yP(e)||void 0,needBlock:f,rootId:h,isCustom:w}}function ue(e){return e==null?"":e.toLowerCase()}function Og(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 EP(e,t){if(t.comment&&e.type===Pe.Comment)return!0;if(e.type===Pe.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"&&Ag(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 Wr(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=Mg(e,s,a,C===void 0));let Z=vP(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):EP(Z,h)||!V&&Z.type===Pe.Text&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?X=qn:X=Ig();let F=Object.assign(Z,{id:X});if(n.add(e,F),X===qn)return null;S&&S(e);let $e=!l;if(F.type===Pe.Element){$e=$e&&!F.needBlock,delete F.needBlock;let Ie=De.shadowRoot(e);Ie&&Gn(Ie)&&(F.isShadowHost=!0)}if((F.type===Pe.Document||F.type===Pe.Element)&&$e){h.headWhitespace&&F.type===Pe.Element&&F.tagName==="head"&&(V=!1);let Ie={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===Pe.Element&&F.tagName==="textarea"&&F.attributes.value!==void 0)){F.type===Pe.Element&&F.attributes._cssText!==void 0&&typeof F.attributes._cssText=="string"&&(Ie.cssCaptured=!0);for(let or of Array.from(De.childNodes(e))){let pt=Wr(or,Ie);pt&&F.childNodes.push(pt)}}let Je=null;if(Eg(e)&&(Je=De.shadowRoot(e)))for(let or of Array.from(De.childNodes(Je))){let pt=Wr(or,Ie);pt&&(Gn(Je)&&(pt.isShadow=!0),F.childNodes.push(pt))}}let ft=De.parentNode(e);return ft&&zn(ft)&&Gn(ft)&&(F.isShadow=!0),F.type===Pe.Element&&F.tagName==="iframe"&&SP(e,()=>{let Ie=e.contentDocument;if(Ie&&w){let Je=Wr(Ie,{doc:Ie,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});Je&&w(e,Je)}},y),F.type===Pe.Element&&F.tagName==="link"&&typeof F.attributes.rel=="string"&&(F.attributes.rel==="stylesheet"||F.attributes.rel==="preload"&&typeof F.attributes.href=="string"&&Ag(F.attributes.href)==="css")&&wP(e,()=>{if(x){let Ie=Wr(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});Ie&&x(e,Ie)}},E),F}function CP(e,t){let{mirror:r=new Jo,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=Og(h);return Wr(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 AP=/(max|min)-device-(width|height)/,ZW=new RegExp(AP.source,"g");function IP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function PP(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 qu={exports:{}},fe=String,Ng=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}};qu.exports=Ng();qu.exports.createColors=Ng;var TP=qu.exports,MP={},OP=Object.freeze(Object.defineProperty({__proto__:null,default:MP},Symbol.toStringTag,{value:"Module"})),at=PP(OP),Mm=TP,Om=at,nu=class Lg 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,Lg)}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=Mm.isColorSupported),Om&&t&&(r=Om(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}=Mm.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+`
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)}
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
+ ${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+`
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}},Ku=nu;nu.default=nu;var ni={};ni.isClean=Symbol("isClean");ni.my=Symbol("my");var Nm={after:`
46
+ `),this.name+": "+this.message+t}},Xu=au;au.default=au;var ri={};ri.isClean=Symbol("isClean");ri.my=Symbol("my");var _m={after:`
47
47
  `,beforeClose:`
48
48
  `,beforeComment:`
49
49
  `,beforeDecl:`
50
50
  `,beforeOpen:" ",beforeRule:`
51
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function NP(e){return e[0].toUpperCase()+e.slice(1)}var iu=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 Nm[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"+NP(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=Nm[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 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(`
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)}},$g=iu;iu.default=iu;var LP=$g;function ou(e,t){new LP(t).stringify(e)}var ps=ou;ou.default=ou;var{isClean:Ro,my:$P}=ni,DP=Ku,_P=$g,FP=ps;function su(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=>su(s,r)):(o==="object"&&i!==null&&(i=su(i)),r[n]=i)}return r}var au=class{constructor(t={}){this.raws={},this[Ro]=!1,this[$P]=!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=su(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 DP(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[Ro]){this[Ro]=!1;let t=this;for(;t=t.parent;)t[Ro]=!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 _P().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=FP){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}},hs=au;au.default=au;var jP=hs,lu=class extends jP{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]==="$"}},ms=lu;lu.default=lu;var VP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",BP=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},UP=(e=21)=>{let t="",r=e;for(;r--;)t+=VP[Math.random()*64|0];return t},WP={nanoid:UP,customAlphabet:BP},{SourceMapConsumer:Lm,SourceMapGenerator:$m}=at,{existsSync:zP,readFileSync:GP}=at,{dirname:zl,join:HP}=at;function qP(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var uu=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=zl(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Lm(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 qP(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=zl(t),zP(t))return this.mapFile=t,GP(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 Lm)return $m.fromSourceMap(r).toString();if(r instanceof $m)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=HP(zl(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)}},Dg=uu;uu.default=uu;var{SourceMapConsumer:KP,SourceMapGenerator:YP}=at,{fileURLToPath:Dm,pathToFileURL:ko}=at,{isAbsolute:cu,resolve:du}=at,{nanoid:JP}=WP,Gl=at,_m=Ku,ZP=Dg,Hl=Symbol("fromOffsetCache"),XP=!!(KP&&YP),Fm=!!(du&&cu),ts=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&&(!Fm||/^\w+:\/\//.test(r.from)||cu(r.from)?this.file=r.from:this.file=du(r.from)),Fm&&XP){let n=new ZP(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 "+JP(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 _m(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 _m(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&&(ko&&(o.input.url=ko(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let r,n;if(this[Hl])n=this[Hl];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[Hl]=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:du(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;cu(s.source)?l=ko(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||ko(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(Dm)u.file=Dm(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}},gs=ts;ts.default=ts;Gl&&Gl.registerInput&&Gl.registerInput(ts);var{SourceMapConsumer:_g,SourceMapGenerator:zo}=at,{dirname:Go,relative:Fg,resolve:jg,sep:Vg}=at,{pathToFileURL:jm}=at,QP=gs,eT=!!(_g&&zo),tT=!!(Go&&jg&&Fg&&Vg),rT=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)}},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=`
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||Go(t.file),i;this.mapOpts.sourcesContent===!1?(i=new _g(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(),tT&&eT&&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=zo.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new zo({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 zo({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?Go(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=Go(jg(n,this.mapOpts.annotation)));let i=Fg(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 QP(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(jm){let n=jm(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;Vg==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Bg=rT,nT=hs,fu=class extends nT{constructor(t){super(t),this.type="comment"}},ys=fu;fu.default=fu;var{isClean:Ug,my:Wg}=ni,zg=ms,Gg=ys,iT=hs,Hg,Yu,Ju,qg;function Kg(e){return e.map(t=>(t.nodes&&(t.nodes=Kg(t.nodes)),delete t.source,t))}function Yg(e){if(e[Ug]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Yg(t)}var Tt=class Jg extends iT{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=Kg(Hg(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 zg(t)]}else if(t.selector)t=[new Yu(t)];else if(t.name)t=[new Ju(t)];else if(t.text)t=[new Gg(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Wg]||Jg.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Ug]&&Yg(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=>{Hg=e};Tt.registerRule=e=>{Yu=e};Tt.registerAtRule=e=>{Ju=e};Tt.registerRoot=e=>{qg=e};var yr=Tt;Tt.default=Tt;Tt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Ju.prototype):e.type==="rule"?Object.setPrototypeOf(e,Yu.prototype):e.type==="decl"?Object.setPrototypeOf(e,zg.prototype):e.type==="comment"?Object.setPrototypeOf(e,Gg.prototype):e.type==="root"&&Object.setPrototypeOf(e,qg.prototype),e[Wg]=!0,e.nodes&&e.nodes.forEach(t=>{Tt.rebuild(t)})};var oT=yr,Zg,Xg,Kn=class extends oT{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Zg(new Xg,this,t).stringify()}};Kn.registerLazyResult=e=>{Zg=e};Kn.registerProcessor=e=>{Xg=e};var Zu=Kn;Kn.default=Kn;var Vm={},Qg=function(t){Vm[t]||(Vm[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},pu=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}},ey=pu;pu.default=pu;var sT=ey,hu=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 sT(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},Xu=hu;hu.default=hu;var ql=39,Bm=34,Eo=92,Um=47,Co=10,jn=32,Ao=12,Io=9,Po=13,aT=91,lT=93,uT=40,cT=41,dT=123,fT=125,pT=59,hT=42,mT=58,gT=64,To=/[\t\n\f\r "#'()/;[\\\]{}]/g,Mo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,yT=/.[\r\n"'(/\\]/,Wm=/[\da-f]/i,bT=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 Co:case jn:case Io:case Po:case Ao:{s=g;do s+=1,o=n.charCodeAt(s);while(o===jn||o===Co||o===Io||o===Po||o===Ao);f=["space",n.slice(g,s)],g=s-1;break}case aT:case lT:case dT:case fT:case mT:case pT:case cT:{let V=String.fromCharCode(o);f=[V,V,g];break}case uT:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==ql&&h!==Bm&&h!==jn&&h!==Co&&h!==Io&&h!==Ao&&h!==Po){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)===Eo;)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||yT.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case ql:case Bm:{a=o===ql?"'":'"',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)===Eo;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case gT:{To.lastIndex=g+1,To.test(n),To.lastIndex===0?s=n.length-1:s=To.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case Eo:{for(s=g,u=!0;n.charCodeAt(s+1)===Eo;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==Um&&o!==jn&&o!==Co&&o!==Io&&o!==Po&&o!==Ao&&(s+=1,Wm.test(n.charAt(s)))){for(;Wm.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===jn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===Um&&n.charCodeAt(g+1)===hT?(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):(Mo.lastIndex=g+1,Mo.test(n),Mo.lastIndex===0?s=n.length-1:s=Mo.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}},ty=yr,rs=class extends ty{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)}},Qu=rs;rs.default=rs;ty.registerAtRule(rs);var ry=yr,ny,iy,Gr=class extends ry{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 ny(new iy,this,t).stringify()}};Gr.registerLazyResult=e=>{ny=e};Gr.registerProcessor=e=>{iy=e};var ii=Gr;Gr.default=Gr;ry.registerRoot(Gr);var Yn={comma(e){return Yn.split(e,[","],!0)},space(e){let t=[" ",`
64
- `," "];return Yn.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}},oy=Yn;Yn.default=Yn;var sy=yr,ST=oy,ns=class extends sy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ST.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)}},ec=ns;ns.default=ns;sy.registerRule(ns);var wT=ms,vT=bT,xT=ys,RT=Qu,kT=ii,zm=ec,Gm={empty:!0,space:!0};function ET(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var CT=class{constructor(t){this.input=t,this.root=new kT,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 RT;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 xT;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=vT(this.input)}decl(t,r){let n=new wT;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]||ET(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 zm;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",!Gm[d]&&!Gm[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 zm;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})}},AT=CT,IT=yr,PT=AT,TT=gs;function is(e,t){let r=new TT(e,t),n=new PT(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 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+=`
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 tc=is;is.default=is;IT.registerParse(is);var{isClean:yt,my:MT}=ni,OT=Bg,NT=ps,LT=yr,$T=Zu,DT=Qg,Hm=Xu,_T=tc,FT=ii,jT={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},VT={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},BT={Once:!0,postcssPlugin:!0,prepare:!0},Hr=0;function Vn(e){return typeof e=="object"&&typeof e.then=="function"}function ay(e){let t=!1,r=jT[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Hr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Hr,r+"Exit"]:[r,r+"Exit"]}function qm(e){let t;return e.type==="document"?t=["Document",Hr,"DocumentExit"]:e.type==="root"?t=["Root",Hr,"RootExit"]:t=ay(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function mu(e){return e[yt]=!1,e.nodes&&e.nodes.forEach(t=>mu(t)),e}var gu={},qr=class ly{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=mu(r);else if(r instanceof ly||r instanceof Hm)i=mu(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=_T;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[MT]&&LT.rebuild(i)}this.result=new Hm(t,i,n),this.helpers={...gu,postcss:gu,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(!VT[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!BT[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(Vn(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[yt];){t[yt]=!0;let r=[qm(t)];for(;r.length>0;){let n=this.visitTick(r);if(Vn(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 Vn(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=NT;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new OT(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(Vn(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[yt];)t[yt]=!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||DT("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(Vn(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[yt]){a[yt]=!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===Hr){n.nodes&&n.nodes.length&&(n[yt]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[yt]=!0;let r=ay(t);for(let n of r)if(n===Hr)t.nodes&&t.each(i=>{i[yt]||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"}};qr.registerPostcss=e=>{gu=e};var uy=qr;qr.default=qr;FT.registerLazyResult(qr);$T.registerLazyResult(qr);var UT=Bg,WT=ps,zT=Qg,GT=tc,HT=Xu,yu=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=WT;this.result=new HT(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new UT(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||zT("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=GT;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"}},qT=yu;yu.default=yu;var KT=qT,YT=uy,JT=Zu,ZT=ii,Jn=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 KT(this,t,r):new YT(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},XT=Jn;Jn.default=Jn;ZT.registerProcessor(Jn);JT.registerProcessor(Jn);var QT=ms,eM=Dg,tM=ys,rM=Qu,nM=gs,iM=ii,oM=ec;function Zn(e,t){if(Array.isArray(e))return e.map(i=>Zn(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:nM.prototype};o.map&&(o.map={...o.map,__proto__:eM.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>Zn(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 iM(n);if(n.type==="decl")return new QT(n);if(n.type==="rule")return new oM(n);if(n.type==="comment")return new tM(n);if(n.type==="atrule")return new rM(n);throw new Error("Unknown node type: "+e.type)}var sM=Zn;Zn.default=Zn;var aM=Ku,cy=ms,lM=uy,uM=yr,rc=XT,cM=ps,dM=sM,dy=Zu,fM=ey,fy=ys,py=Qu,pM=Xu,hM=gs,mM=tc,gM=oy,hy=ec,my=ii,yM=hs;function re(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new rc(e)}re.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 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:
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 rc().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return re([i(l)]).process(s,a)},i};re.stringify=cM;re.parse=mM;re.fromJSON=dM;re.list=gM;re.comment=e=>new fy(e);re.atRule=e=>new py(e);re.decl=e=>new cy(e);re.rule=e=>new hy(e);re.root=e=>new my(e);re.document=e=>new dy(e);re.CssSyntaxError=aM;re.Declaration=cy;re.Container=uM;re.Processor=rc;re.Document=dy;re.Comment=fy;re.Warning=fM;re.AtRule=py;re.Result=pM;re.Input=hM;re.Rule=hy;re.Root=my;re.Node=yM;lM.registerPostcss(re);var bM=re;re.default=re;var he=IP(bM);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 SM=Object.defineProperty,wM=(e,t,r)=>t in e?SM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xe=(e,t,r)=>wM(e,typeof t!="symbol"?t+"":t,r);function vM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xM(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 nc={exports:{}},pe=String,gy=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}};nc.exports=gy();nc.exports.createColors=gy;var RM=nc.exports,kM={},EM=Object.freeze(Object.defineProperty({__proto__:null,default:kM},Symbol.toStringTag,{value:"Module"})),lt=xM(EM),Km=RM,Ym=lt,bu=class yy 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,yy)}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=Km.isColorSupported),Ym&&t&&(r=Ym(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}=Km.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 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+`
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}},ic=bu;bu.default=bu;var oi={};oi.isClean=Symbol("isClean");oi.my=Symbol("my");var Jm={after:`
74
+ `),this.name+": "+this.message+t}},lc=xu;xu.default=xu;var ii={};ii.isClean=Symbol("isClean");ii.my=Symbol("my");var eg={after:`
75
75
  `,beforeClose:`
76
76
  `,beforeComment:`
77
77
  `,beforeDecl:`
78
78
  `,beforeOpen:" ",beforeRule:`
79
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function CM(e){return e[0].toUpperCase()+e.slice(1)}var Su=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 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"+CM(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(`
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(`
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)}},by=Su;Su.default=Su;var AM=by;function wu(e,t){new AM(t).stringify(e)}var bs=wu;wu.default=wu;var{isClean:Oo,my:IM}=oi,PM=ic,TM=by,MM=bs;function vu(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=>vu(s,r)):(o==="object"&&i!==null&&(i=vu(i)),r[n]=i)}return r}var xu=class{constructor(t={}){this.raws={},this[Oo]=!1,this[IM]=!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=vu(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 PM(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[Oo]){this[Oo]=!1;let t=this;for(;t=t.parent;)t[Oo]=!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 TM().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=MM){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}},Ss=xu;xu.default=xu;var OM=Ss,Ru=class extends OM{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]==="$"}},ws=Ru;Ru.default=Ru;var NM="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",LM=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},$M=(e=21)=>{let t="",r=e;for(;r--;)t+=NM[Math.random()*64|0];return t},DM={nanoid:$M,customAlphabet:LM},{SourceMapConsumer:Zm,SourceMapGenerator:Xm}=lt,{existsSync:_M,readFileSync:FM}=lt,{dirname:Kl,join:jM}=lt;function VM(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var ku=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 Zm(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 VM(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),_M(t))return this.mapFile=t,FM(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 Zm)return Xm.fromSourceMap(r).toString();if(r instanceof Xm)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=jM(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)}},Sy=ku;ku.default=ku;var{SourceMapConsumer:BM,SourceMapGenerator:UM}=lt,{fileURLToPath:Qm,pathToFileURL:No}=lt,{isAbsolute:Eu,resolve:Cu}=lt,{nanoid:WM}=DM,Yl=lt,eg=ic,zM=Sy,Jl=Symbol("fromOffsetCache"),GM=!!(BM&&UM),tg=!!(Cu&&Eu),os=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&&(!tg||/^\w+:\/\//.test(r.from)||Eu(r.from)?this.file=r.from:this.file=Cu(r.from)),tg&&GM){let n=new zM(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 "+WM(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 eg(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 eg(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&&(No&&(o.input.url=No(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(`
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[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:Cu(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;Eu(s.source)?l=No(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||No(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(Qm)u.file=Qm(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}},vs=os;os.default=os;Yl&&Yl.registerInput&&Yl.registerInput(os);var{SourceMapConsumer:wy,SourceMapGenerator:Ho}=lt,{dirname:qo,relative:vy,resolve:xy,sep:Ry}=lt,{pathToFileURL:rg}=lt,HM=vs,qM=!!(wy&&Ho),KM=!!(qo&&xy&&vy&&Ry),YM=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)}},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=`
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||qo(t.file),i;this.mapOpts.sourcesContent===!1?(i=new wy(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(),KM&&qM&&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=Ho.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Ho({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 Ho({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?qo(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=qo(xy(n,this.mapOpts.annotation)));let i=vy(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 HM(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(rg){let n=rg(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;Ry==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},ky=YM,JM=Ss,Au=class extends JM{constructor(t){super(t),this.type="comment"}},xs=Au;Au.default=Au;var{isClean:Ey,my:Cy}=oi,Ay=ws,Iy=xs,ZM=Ss,Py,oc,sc,Ty;function My(e){return e.map(t=>(t.nodes&&(t.nodes=My(t.nodes)),delete t.source,t))}function Oy(e){if(e[Ey]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Oy(t)}var Mt=class Ny extends ZM{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=My(Py(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 Ay(t)]}else if(t.selector)t=[new oc(t)];else if(t.name)t=[new sc(t)];else if(t.text)t=[new Iy(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Cy]||Ny.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Ey]&&Oy(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=>{Py=e};Mt.registerRule=e=>{oc=e};Mt.registerAtRule=e=>{sc=e};Mt.registerRoot=e=>{Ty=e};var br=Mt;Mt.default=Mt;Mt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,sc.prototype):e.type==="rule"?Object.setPrototypeOf(e,oc.prototype):e.type==="decl"?Object.setPrototypeOf(e,Ay.prototype):e.type==="comment"?Object.setPrototypeOf(e,Iy.prototype):e.type==="root"&&Object.setPrototypeOf(e,Ty.prototype),e[Cy]=!0,e.nodes&&e.nodes.forEach(t=>{Mt.rebuild(t)})};var XM=br,Ly,$y,Xn=class extends XM{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Ly(new $y,this,t).stringify()}};Xn.registerLazyResult=e=>{Ly=e};Xn.registerProcessor=e=>{$y=e};var ac=Xn;Xn.default=Xn;var ng={},Dy=function(t){ng[t]||(ng[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Iu=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}},_y=Iu;Iu.default=Iu;var QM=_y,Pu=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 QM(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},lc=Pu;Pu.default=Pu;var Zl=39,ig=34,Lo=92,og=47,$o=10,Bn=32,Do=12,_o=9,Fo=13,eO=91,tO=93,rO=40,nO=41,iO=123,oO=125,sO=59,aO=42,lO=58,uO=64,jo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Vo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,cO=/.[\r\n"'(/\\]/,sg=/[\da-f]/i,dO=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 $o:case Bn:case _o:case Fo:case Do:{s=g;do s+=1,o=n.charCodeAt(s);while(o===Bn||o===$o||o===_o||o===Fo||o===Do);f=["space",n.slice(g,s)],g=s-1;break}case eO:case tO:case iO:case oO:case lO:case sO:case nO:{let V=String.fromCharCode(o);f=[V,V,g];break}case rO:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==Zl&&h!==ig&&h!==Bn&&h!==$o&&h!==_o&&h!==Do&&h!==Fo){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)===Lo;)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 Zl:case ig:{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)===Lo;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case uO:{jo.lastIndex=g+1,jo.test(n),jo.lastIndex===0?s=n.length-1:s=jo.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case Lo:{for(s=g,u=!0;n.charCodeAt(s+1)===Lo;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==og&&o!==Bn&&o!==$o&&o!==_o&&o!==Fo&&o!==Do&&(s+=1,sg.test(n.charAt(s)))){for(;sg.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===Bn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===og&&n.charCodeAt(g+1)===aO?(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):(Vo.lastIndex=g+1,Vo.test(n),Vo.lastIndex===0?s=n.length-1:s=Vo.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}},Fy=br,ss=class extends Fy{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)}},uc=ss;ss.default=ss;Fy.registerAtRule(ss);var jy=br,Vy,By,Kr=class extends jy{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 Vy(new By,this,t).stringify()}};Kr.registerLazyResult=e=>{Vy=e};Kr.registerProcessor=e=>{By=e};var si=Kr;Kr.default=Kr;jy.registerRoot(Kr);var Qn={comma(e){return Qn.split(e,[","],!0)},space(e){let t=[" ",`
92
- `," "];return Qn.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=Qn;Qn.default=Qn;var Wy=br,fO=Uy,as=class extends Wy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return fO.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)}},cc=as;as.default=as;Wy.registerRule(as);var pO=ws,hO=dO,mO=xs,gO=uc,yO=si,ag=cc,lg={empty:!0,space:!0};function bO(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var SO=class{constructor(t){this.input=t,this.root=new yO,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 gO;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=hO(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]||bO(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 ag;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",!lg[d]&&!lg[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 ag;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})}},wO=SO,vO=br,xO=wO,RO=vs;function ls(e,t){let r=new RO(e,t),n=new xO(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 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+=`
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 dc=ls;ls.default=ls;vO.registerParse(ls);var{isClean:bt,my:kO}=oi,EO=ky,CO=bs,AO=br,IO=ac,PO=Dy,ug=lc,TO=dc,MO=si,OO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},NO={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},LO={Once:!0,postcssPlugin:!0,prepare:!0},Yr=0;function Un(e){return typeof e=="object"&&typeof e.then=="function"}function zy(e){let t=!1,r=OO[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Yr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Yr,r+"Exit"]:[r,r+"Exit"]}function cg(e){let t;return e.type==="document"?t=["Document",Yr,"DocumentExit"]:e.type==="root"?t=["Root",Yr,"RootExit"]:t=zy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Tu(e){return e[bt]=!1,e.nodes&&e.nodes.forEach(t=>Tu(t)),e}var Mu={},Jr=class Gy{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=Tu(r);else if(r instanceof Gy||r instanceof ug)i=Tu(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=TO;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[kO]&&AO.rebuild(i)}this.result=new ug(t,i,n),this.helpers={...Mu,postcss:Mu,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(!NO[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!LO[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(Un(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=[cg(t)];for(;r.length>0;){let n=this.visitTick(r);if(Un(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 Un(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=CO;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new EO(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(Un(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||PO("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(Un(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(cg(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===Yr){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=zy(t);for(let n of r)if(n===Yr)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"}};Jr.registerPostcss=e=>{Mu=e};var Hy=Jr;Jr.default=Jr;MO.registerLazyResult(Jr);IO.registerLazyResult(Jr);var $O=ky,DO=bs,_O=Dy,FO=dc,jO=lc,Ou=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=DO;this.result=new jO(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new $O(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||_O("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=FO;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"}},VO=Ou;Ou.default=Ou;var BO=VO,UO=Hy,WO=ac,zO=si,ei=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 BO(this,t,r):new UO(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},GO=ei;ei.default=ei;zO.registerProcessor(ei);WO.registerProcessor(ei);var HO=ws,qO=Sy,KO=xs,YO=uc,JO=vs,ZO=si,XO=cc;function ti(e,t){if(Array.isArray(e))return e.map(i=>ti(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:JO.prototype};o.map&&(o.map={...o.map,__proto__:qO.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>ti(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 ZO(n);if(n.type==="decl")return new HO(n);if(n.type==="rule")return new XO(n);if(n.type==="comment")return new KO(n);if(n.type==="atrule")return new YO(n);throw new Error("Unknown node type: "+e.type)}var QO=ti;ti.default=ti;var e2=ic,qy=ws,t2=Hy,r2=br,fc=GO,n2=bs,i2=QO,Ky=ac,o2=_y,Yy=xs,Jy=uc,s2=lc,a2=vs,l2=dc,u2=Uy,Zy=cc,Xy=si,c2=Ss;function ne(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new fc(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:
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:
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 fc().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=n2;ne.parse=l2;ne.fromJSON=i2;ne.list=u2;ne.comment=e=>new Yy(e);ne.atRule=e=>new Jy(e);ne.decl=e=>new qy(e);ne.rule=e=>new Zy(e);ne.root=e=>new Xy(e);ne.document=e=>new Ky(e);ne.CssSyntaxError=e2;ne.Declaration=qy;ne.Container=r2;ne.Processor=fc;ne.Document=Ky;ne.Comment=Yy;ne.Warning=o2;ne.AtRule=Jy;ne.Result=s2;ne.Input=a2;ne.Rule=Zy;ne.Root=Xy;ne.Node=c2;t2.registerPostcss(ne);var d2=ne;ne.default=ne;var me=vM(d2);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 Nu=class e{constructor(...t){Xe(this,"parentElement",null),Xe(this,"parentNode",null),Xe(this,"ownerDocument"),Xe(this,"firstChild",null),Xe(this,"lastChild",null),Xe(this,"previousSibling",null),Xe(this,"nextSibling",null),Xe(this,"ELEMENT_NODE",1),Xe(this,"TEXT_NODE",3),Xe(this,"nodeType"),Xe(this,"nodeName"),Xe(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 dg={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fg={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Bo={},f2=()=>!!globalThis.Zone;function pc(e){if(Bo[e])return Bo[e];let t=globalThis[e],r=t.prototype,n=e in dg?dg[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 fg?fg[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&&!f2())return Bo[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?Bo[e]=u:r}catch{return r}}var Xl={};function Nt(e,t,r){var n;let i=`${e}.${String(r)}`;if(Xl[i])return Xl[i].call(t);let o=pc(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(Xl[i]=s,s.call(t)):t[r]}var Ql={};function Qy(e,t,r){let n=`${e}.${String(r)}`;if(Ql[n])return Ql[n].bind(t);let o=pc(e)[r];return typeof o!="function"?t[r]:(Ql[n]=o,o.bind(t))}function p2(e){return Nt("Node",e,"ownerDocument")}function h2(e){return Nt("Node",e,"childNodes")}function m2(e){return Nt("Node",e,"parentNode")}function g2(e){return Nt("Node",e,"parentElement")}function y2(e){return Nt("Node",e,"textContent")}function b2(e,t){return Qy("Node",e,"contains")(t)}function S2(e){return Qy("Node",e,"getRootNode")()}function w2(e){return!e||!("host"in e)?null:Nt("ShadowRoot",e,"host")}function v2(e){return e.styleSheets}function x2(e){return!e||!("shadowRoot"in e)?null:Nt("Element",e,"shadowRoot")}function R2(e,t){return Nt("Element",e,"querySelector")(t)}function k2(e,t){return Nt("Element",e,"querySelectorAll")(t)}function eb(){return pc("MutationObserver").constructor}function Sr(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:h2,parentNode:m2,parentElement:g2,textContent:y2,contains:b2,getRootNode:S2,host:w2,styleSheets:v2,shadowRoot:x2,querySelector:R2,querySelectorAll:k2,mutationObserver:eb,patch:Sr};function Fe(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var Vr=`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 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
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.`,pg={map:{},getId(){return console.error(Vr),-1},getNode(){return console.error(Vr),null},removeNodeFromMap(){console.error(Vr)},has(){return console.error(Vr),!1},reset(){console.error(Vr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(pg=new Proxy(pg,{get(e,t,r){return t==="map"&&console.error(Vr),Reflect.get(e,t,r)}}));function ri(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 Rs(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)}}),()=>Rs(e,t,o||{},!0)}var us=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(us=()=>new Date().getTime());function tb(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 rb(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function nb(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ib(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=ib(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(es(i,t,n))return!0}catch{}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function E2(e,t){return t.getId(e)!==-1}function eu(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===qn}function ob(e,t){if(zn(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?ob(n,t):!0}function Lu(e){return!!e.changedTouches}function C2(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 sb(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ab(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function $u(e){return e?e instanceof Nu&&"shadowRoot"in e?!!e.shadowRoot:!!U.shadowRoot(e):!1}var Du=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 lb(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 A2(e){let t=e,r;for(;r=lb(t);)t=r;return t}function I2(e){let t=U.ownerDocument(e);if(!t)return!1;let r=A2(e);return U.contains(t,r)}function ub(e){let t=U.ownerDocument(e);return t?U.contains(t,e)||I2(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||{}),Zr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Zr||{}),Br=(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))(Br||{});var cb=(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))(cb||{});function hg(e){return"__ln"in e}var _u=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&&hg(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&&hg(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--)}},mg=(e,t)=>`${e}@${t}`,Fu=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 _u,i=l=>{let u=l,c=qn;for(;c===qn;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=U.parentNode(l);if(!u||!ub(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=zn(u)?this.mirror.getId(lb(l)):this.mirror.getId(u),p=i(l);if(d===-1||p===-1)return n.addNode(l);let h=Wr(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=>{sb(f,this.mirror)&&this.iframeManager.addIframe(f),ab(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),$u(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)gg(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(U.parentNode(l))||o(l);for(let l of this.addedSet)!yg(this.droppedSet,l)&&!gg(this.removesSubTreeCache,l,this.mirror)||yg(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=Zo({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Xo(t),value:n,maskInputFn:this.maskInputFn})}),k(this,"processMutation",t=>{if(!eu(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:Mg(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,ib(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=Xo(r);i=Zo({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"),!Tg(r.tagName,n))if(o.attributes[n]=Pg(this.doc,gr(r.tagName),gr(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=zn(t.target)?this.mirror.getId(U.host(t.target)):this.mirror.getId(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||eu(r,this.mirror,this.slimDOMOptions)||!E2(r,this.mirror)||(this.addedSet.has(r)?(ju(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||ob(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[mg(n,i)]?ju(this.movedSet,r):(this.removes.push({parentId:i,id:n,isShadow:zn(t.target)&&Gn(t.target)?!0:void 0}),P2(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(eu(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[mg(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)),$u(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 ju(e,t){e.delete(t),U.childNodes(t).forEach(r=>ju(e,r))}function P2(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 gg(e,t,r){return e.size===0?!1:T2(e,t)}function T2(e,t,r){let n=U.parentNode(t);return n?e.has(n):!1}function yg(e,t){return e.size===0?!1:db(e,t)}function db(e,t){let r=U.parentNode(t);return r?e.has(r)?!0:db(e,r):!1}var Hn;function M2(e){Hn=e}function O2(){Hn=void 0}var Y=e=>Hn?(...r)=>{try{return e(...r)}catch(n){if(Hn&&Hn(n)===!0)return;throw n}}:e,mr=[];function ai(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 fb(e,t){let r=new Fu;mr.push(r),r.init(e);let n=new(eb())(Y(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function N2({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=ri(Y(d=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),d),s=[],a=null}),o),u=Y(ri(Y(d=>{let p=ai(d),{clientX:h,clientY:f}=Lu(d)?d.changedTouches[0]:d;a||(a=us()),s.push({x:h,y:f,id:n.getId(p),timeOffset:us()-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 L2({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=ai(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 Lu(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=Lu(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=gr(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 pb({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){let s=Y(ri(Y(a=>{let l=ai(a);if(!l||je(l,n,i,!0))return;let u=r.getId(l);if(l===t&&t.defaultView){let c=tb(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 $2({viewportResizeCb:e},{win:t}){let r=-1,n=-1,i=Y(ri(Y(()=>{let o=rb(),s=nb();(r!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),r=o,n=s)}),200));return Fe("resize",i,t)}var D2=["INPUT","TEXTAREA","SELECT"],bg=new WeakMap;function _2({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=ai(w),x=w.isTrusted,E=y&&y.tagName;if(y&&E==="OPTION"&&(y=U.parentElement(y)),!y||!E||D2.indexOf(E)<0||je(y,n,i,!0)||y.classList.contains(o)||s&&y.matches(s))return;let N=y.value,I=!1,M=Xo(y)||"";M==="radio"||M==="checkbox"?I=y.checked:(a[E.toLowerCase()]||a[M])&&(N=Zo({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=bg.get(w);if(!x||x.text!==y.text||x.isChecked!==y.isChecked){bg.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=>Rs(w[0],w[1],{set(){Y(d)({target:this,isTrusted:!1})}},!1,m))),Y(()=>{f.forEach(w=>w())})}function cs(e){let t=[];function r(n,i){if(Uo("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Uo("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Uo("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Uo("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 Zt(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function F2({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}=Zt(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}=Zt(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}=Zt(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}=Zt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replaceSync:h}),c.apply(d,p)})}));let l={};Wo("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Wo("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Wo("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Wo("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}=Zt(h.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:m,index:[...cs(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}=Zt(h.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,removes:[{index:[...cs(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 hb({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 j2({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}=Zt((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:cs(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}=Zt((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:cs(l.parentRule)}),a.apply(l,u)})}),Y(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function V2({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){let s=Y(l=>ri(Y(u=>{let c=ai(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(Br.Play),o),Fe("pause",s(Br.Pause),o),Fe("seeked",s(Br.Seeked),o),Fe("volumechange",s(Br.VolumeChange),o),Fe("ratechange",s(Br.RateChange),o)];return Y(()=>{a.forEach(l=>l())})}function B2({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=Sr(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 U2(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 W2({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:Sr(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 z2(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 G2(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};z2(e,t);let n;e.recordDOM&&(n=fb(e,e.doc));let i=N2(e),o=L2(e),s=pb(e),a=$2(e,{win:r}),l=_2(e),u=V2(e),c=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(c=F2(e,{win:r}),d=hb(e,e.doc),p=j2(e,{win:r}),e.collectFonts&&(h=B2(e)));let f=U2(e),m=W2(e),g=[];for(let S of e.plugins)g.push(S.observer(S.callback,r,S.options));return Y(()=>{mr.forEach(S=>S.reset()),n?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),p(),h(),f(),m(),g.forEach(S=>S())})}function Uo(e){return typeof window[e]<"u"}function Wo(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ds=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}},Vu=class{constructor(t){k(this,"iframes",new WeakMap),k(this,"crossOriginIframeMap",new WeakMap),k(this,"crossOriginIframeMirror",new ds(Ig)),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 ds(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!==cb.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},Bu=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(!Gn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let n=fb({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(pb({...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(hb({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(Sr(t.prototype,"attachShadow",function(i){return function(o){let s=i.call(this,o),a=U.shadowRoot(this);return a&&ub(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},zr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",H2=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Wn=0;Wn<zr.length;Wn++)H2[zr.charCodeAt(Wn)]=Wn;var Wn,q2=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=zr[t[r]>>2],i+=zr[(t[r]&3)<<4|t[r+1]>>4],i+=zr[(t[r+1]&15)<<2|t[r+2]>>6],i+=zr[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 Sg=new Map;function K2(e,t){let r=Sg.get(e);return r||(r=new Map,Sg.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var mb=(e,t,r)=>{if(!e||!(yb(e,t)||typeof e=="object"))return;let n=e.constructor.name,i=K2(r,n),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Ko(e,t,r){if(e instanceof Array)return e.map(n=>Ko(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=q2(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ko(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:[Ko(e.data,t,r),e.width,e.height]};if(yb(e,t)||typeof e=="object"){let n=e.constructor.name,i=mb(e,t,r);return{rr_type:n,index:i}}}}return e}var gb=(e,t,r)=>e.map(n=>Ko(n,t,r)),yb=(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 Y2(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=Sr(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...u){return je(this.canvas,r,n,!0)||setTimeout(()=>{let c=gb(u,t,this);e(this.canvas,{type:Zr["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=Rs(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:Zr["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function J2(e){return e==="experimental-webgl"?"webgl":e}function wg(e,t,r,n){let i=[];try{let o=Sr(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!je(this,t,r,!0)){let u=J2(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 vg(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=Sr(e,l,function(c){return function(...d){let p=c.apply(this,d);if(mb(p,o,this),"tagName"in this.canvas&&!je(this.canvas,n,i,!0)){let h=gb(d,o,this),f={type:t,property:l,args:h};r(this.canvas,f)}return p}});s.push(u)}catch{let u=Rs(e,l,{set(c){r(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function Z2(e,t,r,n){let i=[];return i.push(...vg(t.WebGLRenderingContext.prototype,Zr.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...vg(t.WebGL2RenderingContext.prototype,Zr.WebGL2,e,r,n,t)),()=>{i.forEach(o=>o())}}var bb="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",X2=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),xg=typeof window<"u"&&window.Blob&&new Blob([X2(bb)],{type:"text/javascript;charset=utf-8"});function Q2(e){let t;try{if(t=xg&&(window.URL||window.webkitURL).createObjectURL(xg),!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,"+bb,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var Uu=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=wg(r,n,i,!0),a=new Map,l=new Q2;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:Zr["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=wg(t,r,n,!1),o=Y2(this.processMutation.bind(this),t,r,n),s=Z2(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)}},Wu=class{constructor(t){k(this,"trackedLinkElements",new WeakSet),k(this,"mutationCb"),k(this,"adoptedStyleSheetCb"),k(this,"styleMirror",new Du),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:Cg(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){}},zu=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,Yo,tu,fs=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((km=e.contentWindow)==null?void 0:km.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var st=rP();function wr(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:ft}=e;M2(ft);let Ie=I?window.parent===window:!0,Je=!1;if(!Ie)try{window.parent.document&&(Je=!1)}catch{Je=!0}if(Ie&&!t)throw new Error("emit function is required");if(!Ie&&!Je)return()=>{};x!==void 0&&w.mousemove===void 0&&(w.mousemove=x),st.reset();let or=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},pt=Og(h);C2();let wf,na=0,vf=Q=>{for(let et of X||[])et.eventProcessor&&(Q=et.eventProcessor(Q));return S&&!Je&&(Q=S(Q)),Q};we=(Q,et)=>{var ye;let be=Q;if(be.timestamp=us(),(ye=mr[0])!=null&&ye.isFrozen()&&be.type!==H.FullSnapshot&&!(be.type===H.IncrementalSnapshot&&be.data.source===z.Mutation)&&mr.forEach(Ge=>Ge.unfreeze()),Ie)t?.(vf(be),et);else if(Je){let Ge={type:"rrweb",event:vf(be),origin:window.location.origin,isCheckout:et};window.parent.postMessage(Ge,"*")}if(be.type===H.FullSnapshot)wf=be,na=0;else if(be.type===H.IncrementalSnapshot){if(be.data.source===z.Mutation&&be.data.isAttachIframe)return;na++;let Ge=n&&na>=n,oe=r&&be.timestamp-wf.timestamp>r;(Ge||oe)&&Yo(!0)}};let Ii=Q=>{we({type:H.IncrementalSnapshot,data:{source:z.Mutation,...Q}})},xf=Q=>we({type:H.IncrementalSnapshot,data:{source:z.Scroll,...Q}}),Rf=Q=>we({type:H.IncrementalSnapshot,data:{source:z.CanvasMutation,...Q}}),sx=Q=>we({type:H.IncrementalSnapshot,data:{source:z.AdoptedStyleSheet,...Q}}),sr=new Wu({mutationCb:Ii,adoptedStyleSheetCb:sx}),ar=new Vu({mirror:st,mutationCb:Ii,stylesheetManager:sr,recordCrossOriginIframes:I,wrappedEmit:we});for(let Q of X||[])Q.getMirror&&Q.getMirror({nodeMirror:st,crossOriginIframeMirror:ar.crossOriginIframeMirror,crossOriginIframeStyleMirror:ar.crossOriginIframeStyleMirror});let ia=new zu;tu=new Uu({recordCanvas:N,mutationCb:Rf,win:window,blockClass:i,blockSelector:o,mirror:st,sampling:w.canvas,dataURLOptions:y});let Pi=new Bu({mutationCb:Ii,scrollCb:xf,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:or,dataURLOptions:y,maskTextFn:m,maskInputFn:f,recordCanvas:N,inlineImages:Z,sampling:w,slimDOMOptions:pt,iframeManager:ar,stylesheetManager:sr,canvasManager:tu,keepIframeSrcFn:F,processedNodeManager:ia},mirror:st});Yo=(Q=!1)=>{if(!E)return;we({type:H.Meta,data:{href:window.location.href,width:nb(),height:rb()}},Q),sr.reset(),Pi.init(),mr.forEach(ye=>ye.lock());let et=CP(document,{mirror:st,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:or,maskTextFn:m,maskInputFn:f,slimDOM:pt,dataURLOptions:y,recordCanvas:N,inlineImages:Z,onSerialize:ye=>{sb(ye,st)&&ar.addIframe(ye),ab(ye,st)&&sr.trackLinkElement(ye),$u(ye)&&Pi.addShadowRoot(U.shadowRoot(ye),document)},onIframeLoad:(ye,be)=>{ar.attachIframe(ye,be),Pi.observeAttachShadow(ye)},onStylesheetLoad:(ye,be)=>{sr.attachLinkElement(ye,be)},keepIframeSrcFn:F});if(!et)return console.warn("Failed to snapshot the document");we({type:H.FullSnapshot,data:{node:et,initialOffset:tb(window)}},Q),mr.forEach(ye=>ye.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&sr.adoptStyleSheets(document.adoptedStyleSheets,st.getId(document))};try{let Q=[],et=be=>{var Ge;return Y(G2)({mutationCb:Ii,mousemoveCb:(oe,oa)=>we({type:H.IncrementalSnapshot,data:{source:oa,positions:oe}}),mouseInteractionCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.MouseInteraction,...oe}}),scrollCb:xf,viewportResizeCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.ViewportResize,...oe}}),inputCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.Input,...oe}}),mediaInteractionCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.MediaInteraction,...oe}}),styleSheetRuleCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.StyleSheetRule,...oe}}),styleDeclarationCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.StyleDeclaration,...oe}}),canvasMutationCb:Rf,fontCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.Font,...oe}}),selectionCb:oe=>{we({type:H.IncrementalSnapshot,data:{source:z.Selection,...oe}})},customElementCb:oe=>{we({type:H.IncrementalSnapshot,data:{source:z.CustomElement,...oe}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:or,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:pt,dataURLOptions:y,mirror:st,iframeManager:ar,stylesheetManager:sr,shadowDomManager:Pi,processedNodeManager:ia,canvasManager:tu,ignoreCSSAttributes:$e,plugins:((Ge=X?.filter(oe=>oe.observer))==null?void 0:Ge.map(oe=>({observer:oe.observer,options:oe.options,callback:oa=>we({type:H.Plugin,data:{plugin:oe.name,payload:oa}})})))||[]},g)};ar.addLoadListener(be=>{try{Q.push(et(be.contentDocument))}catch(Ge){console.warn(Ge)}});let ye=()=>{Yo(),Q.push(et(document)),fs=!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)}}),ia.destroy(),fs=!1,O2()}}catch(Q){console.warn(Q)}}wr.addCustomEvent=(e,t)=>{if(!fs)throw new Error("please add custom event after start recording");we({type:H.Custom,data:{tag:e,payload:t}})};wr.freezePage=()=>{mr.forEach(e=>e.freeze())};wr.takeFullSnapshot=e=>{if(!fs)throw new Error("please take full snapshot after start recording");Yo(e)};wr.mirror=st;var Rg;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Rg||(Rg={}));var Tz=5*1e3;var{addCustomEvent:Mz}=wr,{freezePage:Oz}=wr,{takeFullSnapshot:Nz}=wr;var vb="__ripploEmitRrwebEvent";function xb(){return{eventTypes:Sb(H),incrementalSources:Sb(z)}}function Sb(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,r])=>[r,t]))}var t6=Bl("@ripplo/rrweb-bundle/bundle","rrweb.js"),wb;function Rb(){return wb??=e6(t6,{encoding:"utf8"}),wb}async function mc({debugDir:e,writeOtlpPortFile:t}){let r=new Map,n=vm(xb()),i=await Va({localDir:kb.join(kb.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 Rb();return{attach:async(a,l)=>{let u=Ep({debugDir:e,runId:l,worker:n});r.set(l,u),await Rm(a,l),await a.addInitScript(`globalThis.__ripploCapturePort = ${String(i.port)};`),await n6(a,u);let c=[];return{emitAction:d=>{s6(u,d)},emitAssertion:d=>{a6(u,d)},finish:()=>i6(u,{pages:c,registry:r,runId:l}),onPage:d=>{c.push(d),o6(u,o,d)}}},close:async()=>{await i.stop(),await n.terminate()},injectSpan:(a,l)=>{r.get(a)?.emit(l)}}}async function r6(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function n6(e,t){await e.exposeBinding(vb,(r,n)=>{let i=typeof n=="string"?n:JSON.stringify(n);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}async function i6(e,t){await r6(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 o6(e,t,r){r.on("load",()=>{r.addScriptTag({content:t}).catch(()=>{})}),r.on("response",n=>{d6(e,n)}),r.on("console",n=>{e.emit({kind:"console",level:n.type(),source:"browser",text:n.text(),timeNanos:Mr(Date.now())})}),r.on("pageerror",n=>{e.emit({kind:"error",message:n.message,source:"browser",stack:n.stack,timeNanos:Mr(Date.now())})})}function s6(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:l6(t),timeNanos:Mr(Date.now()),value:u6(t)})}function a6(e,t){let r=jl(t);e.emit({kind:"assertion",label:r.label,outcome:t.outcome,source:"test",step:r.step,timeNanos:Mr(Date.now())})}function l6(e){if(e.url!=null)return e.url;if(e.locator!=null)return hc(e.locator)}function hc(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${hc(e.scope)} \u25B8 ${hc(e.target)}`:`${e.role} ${e.name??""}`.trim()}function u6(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 d6(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:Mr(Date.now()),traceId:i?.[1],url:t.url()})}import{err as V0,ok as Hd,ResultAsync as w8}from"neverthrow";function gc(e){return{invariants:Sl(e),laws:gl(e)}}var Eb=Object.defineProperty,Cb=(e,t)=>{let r={};for(var n in e)Eb(r,n,{get:e[n],enumerable:!0});return t||Eb(r,Symbol.toStringTag,{value:"Module"}),r};var f6=class Ab{constructor(t){this.seed=t}clone(){return new Ab(this.seed)}next(){let t=yc(this.seed),r=bc(t),n=yc(t),i=bc(n);return this.seed=yc(n),bc(this.seed)+(i+(r<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function yc(e){return Math.imul(e,214013)+2531011&4294967295}function bc(e){return(e&-2147483649)>>16}function Ib(e){return new f6(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",h6=class Tb{constructor(t,r){this.states=t,this.index=r}clone(){return new Tb(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=ks(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),r=this.index;this.index=ks(this.states,this.index);for(let n=19932;n>0;--n)p6.charCodeAt(n/6|0)-48&1<<n%6&&Pb(this.states,this.index,t,r),this.index=ks(this.states,this.index);Pb(this.states,this.index,t,r)}};function Pb(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 ks(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)ks(e,t)}function Mb(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 h6(t,0)}var g6=class Ob{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new Ob(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 Sc(e){return new g6(-1,~e,e|0,0)}var y6=class Nb{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new Nb(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 Lb(e){return new y6(-1,~e,e|0,0)}function $b(e,t){for(let r=0;r!==t;++r)e.next()}var Db=BigInt,b6=4294967296n;function Fb(e,t,r){let n=r-t+1n,i=b6,o=1;for(;i<n;)i<<=32n,++o;let s=_b(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=_b(o,e);return s%n+t}function _b(e,t){let r=Db(t.next()+2147483648);for(let n=1;n<e;++n){let i=t.next();r=(r<<32n)+Db(i+2147483648)}return r}function li(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 wc(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 S6(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 w6(e,t,r){let n=r[0]+1;for(t[0]=li(e,n),t[1]=li(e,4294967296);t[0]>=r[0]&&(t[0]!==r[0]||t[1]>=r[1]);)t[0]=li(e,n),t[1]=li(e,4294967296);return t}var v6=Number.MAX_SAFE_INTEGER,x6={sign:1,data:[0,0]},R6={sign:1,data:[0,0]},jb={sign:1,data:[0,0]},vc=[0,0];function k6(e,t,r,n){let i=n<=v6?wc(jb,n):S6(jb,wc(x6,r),wc(R6,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,w6(e,vc,i.data),vc[0]*4294967296+vc[1]+t}function Es(e,t,r){let n=r-t;return n<=4294967295?li(e,n+1)+t:k6(e,t,r,n)}var Vb=Symbol.for("fast-check/PreconditionFailure"),ir=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=Vb}static isFailure(e){return e!=null&&e.footprint===Vb}};function E6(e){if(!e)throw new ir}var C6=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},A6=new C6;function I6(){return A6}function*P6(e,t){for(let r of e)yield t(r)}function*T6(e,t){for(let r of e)yield*t(r)}function*M6(e,t){for(let r of e)t(r)&&(yield r)}function*O6(e,t){for(let r=0;r<t;++r){let n=e.next();if(n.done)break;yield n.value}}function*N6(e,t){let r=e.next();for(;!r.done&&t(r.value);)yield r.value,r=e.next()}function*L6(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 $6=Symbol.iterator,j=class Lt{static nil(){return new Lt(I6())}static of(...t){return new Lt(t[$6]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Lt(P6(this.g,t))}flatMap(t){return new Lt(T6(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(N6(this.g,t))}take(t){return new Lt(O6(this.g,t))}filter(t){return new Lt(M6(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(L6(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 rr(e){return new j(e)}var Me=Symbol.for("fast-check/cloneMethod");function xr(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Me in e&&typeof e[Me]=="function"}function rn(e){return xr(e)?e[Me]():e}var D6=Object.defineProperty,D=class{constructor(e,t,r){this.value_=e,this.context=t,this.hasToBeCloned=r!==void 0||xr(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&D6(this,"value",{get:r!==void 0?r:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[Me]():(this.readOnce=!0,this.value_):this.value_}},de=class{filter(e){return new j6(this,e)}map(e,t){return new F6(this,e,t)}chain(e){return new _6(this,e)}},_6=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 D(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 D(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}},F6=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)&&!xr(r)&&Object.defineProperty(r,Me,{get:()=>()=>this.mapperWithCloneIfNeeded(e)[0]}),[r,t]}valueMapper(e){let[t,r]=this.mapperWithCloneIfNeeded(e);return new D(t,{originalValue:r,originalContext:e.context})}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalValue"in e&&"originalContext"in e}},j6=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 Vw(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function Bw(e){if(!Vw(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Uw=Function.prototype.apply,xc=Symbol("apply");function V6(e){try{return e.apply}catch{return}}function B6(e,t,r){let n=e;n[xc]=Uw;let i=n[xc](t,r);return delete n[xc],i}function q(e,t,r){return V6(e)===Uw?e.apply(t,r):B6(e,t,r)}var Ww=Array,O=BigInt,U6=BigInt64Array,W6=BigUint64Array,zw=Boolean,Vs=Date,L=Error,Gw=Float32Array,Hw=Float64Array,z6=Int8Array,G6=Int16Array,H6=Int32Array,Dt=Number,Ve=String,nn=Set,q6=Uint8Array,K6=Uint8ClampedArray,Y6=Uint16Array,J6=Uint32Array,Z6=encodeURIComponent,_t=Map,Ns=Symbol,Bb=Array.prototype.forEach,Ub=Array.prototype.indexOf,Wb=Array.prototype.join,zb=Array.prototype.map,Gb=Array.prototype.flat,Hb=Array.prototype.filter,qb=Array.prototype.push,Kb=Array.prototype.pop,Yb=Array.prototype.splice,Jb=Array.prototype.slice,Zb=Array.prototype.sort,Xb=Array.prototype.every;function X6(e){try{return e.forEach}catch{return}}function Q6(e){try{return e.indexOf}catch{return}}function e4(e){try{return e.join}catch{return}}function t4(e){try{return e.map}catch{return}}function r4(e){try{return e.flat}catch{return}}function n4(e){try{return e.filter}catch{return}}function i4(e){try{return e.push}catch{return}}function o4(e){try{return e.pop}catch{return}}function s4(e){try{return e.splice}catch{return}}function a4(e){try{return e.slice}catch{return}}function l4(e){try{return e.sort}catch{return}}function u4(e){try{return e.every}catch{return}}function qw(e,t){return X6(e)===Bb?e.forEach(t):q(Bb,e,[t])}function $t(e,...t){return Q6(e)===Ub?e.indexOf(...t):q(Ub,e,t)}function ce(e,...t){return e4(e)===Wb?e.join(...t):q(Wb,e,t)}function G(e,t){return t4(e)===zb?e.map(t):q(zb,e,[t])}function c4(e,t){return r4(e)===Gb?([].flat(),e.flat(t)):q(Gb,e,[t])}function d4(e,t){return n4(e)===Hb?e.filter(t):q(Hb,e,[t])}function $(e,...t){return i4(e)===qb?e.push(...t):q(qb,e,t)}function Kw(e){return o4(e)===Kb?e.pop():q(Kb,e,[])}function Yw(e,...t){return s4(e)===Yb?e.splice(...t):q(Yb,e,t)}function Le(e,...t){return a4(e)===Jb?e.slice(...t):q(Jb,e,t)}function Jw(e,...t){return l4(e)===Zb?e.sort(...t):q(Zb,e,t)}function Zw(e,...t){return u4(e)===Xb?e.every(...t):q(Xb,e,t)}var Qb=Date.prototype.getTime,eS=Date.prototype.toISOString;function f4(e){try{return e.getTime}catch{return}}function p4(e){try{return e.toISOString}catch{return}}function Bs(e){return f4(e)===Qb?e.getTime():q(Qb,e,[])}function h4(e){return p4(e)===eS?e.toISOString():q(eS,e,[])}var tS=Set.prototype.add,rS=Set.prototype.has;function m4(e){try{return e.add}catch{return}}function g4(e){try{return e.has}catch{return}}function pi(e,t){return m4(e)===tS?e.add(t):q(tS,e,[t])}function Us(e,t){return g4(e)===rS?e.has(t):q(rS,e,[t])}var nS=WeakMap.prototype.set,iS=WeakMap.prototype.get;function y4(e){try{return e.set}catch{return}}function b4(e){try{return e.get}catch{return}}function S4(e,t,r){return y4(e)===nS?e.set(t,r):q(nS,e,[t,r])}function w4(e,t){return b4(e)===iS?e.get(t):q(iS,e,[t])}var oS=Map.prototype.set,sS=Map.prototype.get,aS=Map.prototype.has;function v4(e){try{return e.set}catch{return}}function x4(e){try{return e.get}catch{return}}function R4(e){try{return e.has}catch{return}}function ut(e,t,r){return v4(e)===oS?e.set(t,r):q(oS,e,[t,r])}function Ye(e,t){return x4(e)===sS?e.get(t):q(sS,e,[t])}function k4(e,t){return R4(e)===aS?e.has(t):q(aS,e,[t])}var lS=String.prototype.split,uS=String.prototype.startsWith,cS=String.prototype.endsWith,dS=String.prototype.substring,fS=String.prototype.toLowerCase,pS=String.prototype.toUpperCase,hS=String.prototype.padStart,mS=String.prototype.charCodeAt,gS=String.prototype.normalize,yS=String.prototype.replace;function E4(e){try{return e.split}catch{return}}function C4(e){try{return e.startsWith}catch{return}}function A4(e){try{return e.endsWith}catch{return}}function I4(e){try{return e.substring}catch{return}}function P4(e){try{return e.toLowerCase}catch{return}}function T4(e){try{return e.toUpperCase}catch{return}}function M4(e){try{return e.padStart}catch{return}}function O4(e){try{return e.charCodeAt}catch{return}}function N4(e){try{return e.normalize}catch{return}}function L4(e){try{return e.replace}catch{return}}function Be(e,...t){return E4(e)===lS?e.split(...t):q(lS,e,t)}function $4(e,...t){return C4(e)===uS?e.startsWith(...t):q(uS,e,t)}function D4(e,...t){return A4(e)===cS?e.endsWith(...t):q(cS,e,t)}function ge(e,...t){return I4(e)===dS?e.substring(...t):q(dS,e,t)}function qc(e){return P4(e)===fS?e.toLowerCase():q(fS,e,[])}function Sd(e){return T4(e)===pS?e.toUpperCase():q(pS,e,[])}function _4(e,...t){return M4(e)===hS?e.padStart(...t):q(hS,e,t)}function on(e,t){return O4(e)===mS?e.charCodeAt(t):q(mS,e,[t])}function F4(e,t){return N4(e)===gS?e.normalize(t):q(gS,e,[t])}function j4(e,t,r){return L4(e)===yS?e.replace(t,r):q(yS,e,[t,r])}var bS=Number.prototype.toString;function V4(e){try{return e.toString}catch{return}}function hi(e,...t){return V4(e)===bS?e.toString(...t):q(bS,e,t)}var B4=Object.prototype.hasOwnProperty,U4=Object.prototype.toString;function Xw(e,t){return q(B4,e,[t])}function Kc(e){return q(U4,e,[])}var W4=Error.prototype.toString;function z4(e){return q(W4,e,[])}var G4=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 tr(e){return new G4(e)}var Qw=Array.isArray,H4=Object.defineProperty;function e1(e,t){return H4(e,Me,{value:()=>{let r=[];for(let n=0;n!==t.length;++n)$(r,t[n].value);return e1(r,t),r}})}function t1(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&&e1(r,e),new D(r,n)}function r1(e,t,r){let n=[],i=Qw(r)?r:[];for(let o=0;o!==e.length;++o)$(n,tr(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=G(t,(l,u)=>new D(rn(l),i[u]));return[...Le(a,0,o),s,...Le(a,o+1)]}).map(t1)));return j.nil().join(...n)}var q4=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 t1(r)}canShrinkWithoutContext(e){if(!Qw(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 r1(this.arbs,e,t)}};function B(...e){return new q4(e)}var K4=Math.log;function n1(e){return 2+~~(K4(e+1)*.4342944819032518)}var wd={};function Y4(e){wd=e}function ct(){return wd}function J4(){wd={}}var mi=Symbol("UndefinedContextPlaceholder");function sn(e){return e.context!==void 0?e:e.hasToBeCloned?new D(e.value_,mi,()=>e.value):new D(e.value_,mi)}var SS=()=>{},Z4=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:r,asyncAfterEach:n,beforeEach:i,afterEach:o}=ct()||{};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||SS,this.afterEachHook=n||o||SS}isAsync(){return!0}generate(e,t){return sn(this.arb.generate(e,t!==void 0?n1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==mi?e.context:void 0;return this.arb.shrink(e.value_,t).map(sn)}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 ir.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}},i1=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return sn(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!==mi?t:void 0;return this.arb.shrink(e,r).map(sn)}};function X4(...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,Bw),new Z4(B(...G(t,n=>new i1(n))),n=>r(...n))}var wS=()=>{},o1=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:r=wS,afterEach:n=wS,asyncBeforeEach:i,asyncAfterEach:o}=ct()||{};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 sn(this.arb.generate(e,t!==void 0?n1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==mi?e.context:void 0;return this.arb.shrink(e.value_,t).map(sn)}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 ir.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 Q4(...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,Bw),new o1(B(...G(t,n=>new i1(n))),n=>r(...n))}var eN=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function Yc(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>Yc(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>Yc(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function s1(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>s1(e),next:()=>e.next(),jump:()=>$b(e,42),getState:()=>e.getState()}}function Hs(e){return s1(Yc(e))}var tN=Date.now,rN=Math.min,nN=Math.random,iN=class{constructor(e){let t=e||{};this.seed=oN(t),this.randomType=sN(t),this.numRuns=aN(t),this.verbose=lN(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=kc(t.timeout),this.skipAllAfterTimeLimit=kc(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=kc(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 Rc(e){return t=>Hs(e(t))}function oN(e){if(e.seed===void 0)return tN()^nN()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function sN(e){if(e.randomType===void 0)return Sc;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return Rc(Mb);case"congruential":case"congruential32":return Rc(Ib);case"xorshift128plus":return Sc;case"xoroshiro128plus":return Lb;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===Hs(t)?e.randomType:Rc(e.randomType)}function aN(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function lN(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 kc(e){if(e!==void 0)return rN(e,2147483647)}function vd(e){return new iN(e)}function uN(e,t,r){let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i(new ir(!0))},e)})}}var vS=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 ir(this.interruptExecution);return this.isAsync()?Promise.resolve(r):r}if(this.interruptExecution&&this.isAsync()){let r=uN(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)})}},dN=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())}},a1=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()}},xS=Array.from,RS=typeof Buffer<"u"?Buffer.isBuffer:void 0,Xr=JSON.stringify,kS=Number.isNaN,fN=Object.keys,pN=Object.getOwnPropertySymbols,hN=Object.getOwnPropertyDescriptor,ES=Object.getPrototypeOf,CS=Number.NEGATIVE_INFINITY,mN=Number.POSITIVE_INFINITY,dt=Symbol.for("fast-check/toStringMethod");function xd(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&dt in e&&typeof e[dt]=="function"}var Ft=Symbol.for("fast-check/asyncToStringMethod");function Rd(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Ft in e&&typeof e[Ft]=="function"}var gN=/^Symbol\((.*)\)$/;function yN(e){if(e.description!==void 0)return e.description;let t=gN.exec(Ve(e));return t&&t[1].length?t[1]:null}function AS(e){switch(e){case 0:return 1/e===CS?"-0":"0";case CS:return"Number.NEGATIVE_INFINITY";case mN:return"Number.POSITIVE_INFINITY";default:return e===e?Ve(e):"Number.NaN"}}function bN(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 Ke(e,t,r){let n=[...t,e];if(typeof e=="object"&&$t(t,e)!==-1)return"[cyclic]";if(Rd(e)){let i=r(e);if(i.state==="fulfilled")return i.value}if(xd(e))try{return e[dt]()}catch{}switch(Kc(e)){case"[object Array]":{let i=e;if(i.length>=50&&bN(i)){let s=[];for(let a in i)kS(Number(a))||$(s,`${a}:${Ke(i[a],n,r)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${ce(s,",")}})`:`Array(${i.length})`}let o=ce(G(i,s=>Ke(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 kS(Bs(i))?"new Date(NaN)":`new Date(${Xr(h4(i))})`}case"[object Map]":return`new Map(${Ke(Array.from(e),n,r)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?AS(e):`new Number(${AS(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"?`[${Ke(o,n,r)}]`:Xr(o)}:${Ke(e[o],n,r)}`;return"{"+ce([...ES(e)===null?["__proto__:null"]:[],...G(fN(e),i),...G(d4(pN(e),o=>{let s=hN(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${Ke(Array.from(e),n,r)})`;case"[object String]":return typeof e=="string"?Xr(e):`new String(${Xr(e)})`;case"[object Symbol]":{let i=e;if(Ns.keyFor(i)!==void 0)return`Symbol.for(${Xr(Ns.keyFor(i))})`;let o=yN(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&Ns[o.substring(7)])?o:`Symbol(${Xr(o)})`}case"[object Promise]":{let i=r(e);switch(i.state){case"fulfilled":return`Promise.resolve(${Ke(i.value,n,r)})`;case"rejected":return`Promise.reject(${Ke(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(${Ke(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 RS=="function"&&RS(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":Ke(xS(e.values()),n,r)})`;let i=ES(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(${Ke(xS(s.values()),n,r)})`}break}}try{return e.toString()}catch{return Kc(e)}}function xe(e){return Ke(e,[],()=>({state:"unknown",value:void 0}))}function l1(e){let t=Ns(),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=Ke(e,[],s);return r.length===0?l:Promise.all(r.splice(0)).then(a)}return a()}async function kd(e){return Promise.resolve(l1(e))}function IS(e){return e===null?new ir:e}function SN(...e){return e[1]?e[0].then(IS):IS(e[0])}function wN(e,t){return SN(e,t)}var PS=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?wN(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()}},TS=Date.now,Ec=setTimeout,Cc=clearTimeout;function vN(e,t){let r=e;return e.isAsync()&&t.timeout!==void 0&&(r=new dN(r,t.timeout,Ec,Cc)),t.unbiased&&(r=new a1(r)),t.skipAllAfterTimeLimit!==void 0&&(r=new vS(r,TS,t.skipAllAfterTimeLimit,!1,Ec,Cc)),t.interruptAfterTimeLimit!==void 0&&(r=new vS(r,TS,t.interruptAfterTimeLimit,!0,Ec,Cc)),t.skipEqualValues&&(r=new PS(r,!0)),t.ignoreEqualValues&&(r=new PS(r,!1)),r}var xN=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),RN=class u1{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:u1.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()}}},c1=class{constructor(e,t,r,n){this.sourceValues=e,this.shrink=t,this.runExecution=new RN(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"&&!ir.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_)}},kN=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}},EN=-2147483648,CN=2147483647,AN=Math.pow(2,27),IN=Math.pow(2,-53),Ed=class d1{constructor(t){this.internalRng=Hs(t.clone())}clone(){return new d1(this.internalRng)}next(t){return Es(this.internalRng,0,(1<<t)-1)}nextBoolean(){return Es(this.internalRng,0,1)===1}nextInt(t,r){return Es(this.internalRng,t===void 0?EN:t,r===void 0?CN:r)}nextBigInt(t,r){return Fb(this.internalRng,t,r)}nextDouble(){let t=this.next(26),r=this.next(27);return(t*AN+r)*IN}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function PN(e,t,r){return t.jump(),e.generate(new Ed(t),r)}function*f1(e,t,r,n){for(let i=0;i!==n.length;++i)yield new D(n[i],void 0);for(let i=0,o=r(t);;++i)yield PN(e,o,i)}function TN(e,t,r){return()=>e.generate(new Ed(t),r)}function*p1(e,t,r,n){yield*G(n,s=>()=>new D(s,void 0));let i=0,o=Hs(r(t));for(;;)o.jump(),yield TN(e,o,i++)}function MS(e){return e()}function h1(e,t,r){let n=t,i=e.split(":").map(s=>+s);if(i.length===0)return n.map(MS);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=n.drop(i[0]).map(MS);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 MN=Object.assign;function ON(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,r)=>`Hint (${r+1}): ${t}`).join(`
100
- `)}function NN(e,t){return`Encountered failures were:
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:
101
101
  - ${e.map(t).join(`
102
- - `)}`}function Cd(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 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:
103
103
  ${r.join(`
104
- `)}`}function LN(e,t){let r=`Failed to run property, too many pre-condition failures encountered
104
+ `)}`}function HN(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=Cd(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 $N(e){if(e instanceof L&&e.stack!==void 0)return e.stack;try{return Ve(e)}catch{}if(e instanceof L)try{return z4(e)}catch{}if(e!==null&&typeof e=="object")try{return Kc(e)}catch{}return"Failed to serialize errorInstance"}function DN(e,t){let r=e.runConfiguration.includeErrorInReport?`
109
- Got ${j4($N(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=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
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=Cd(e.executionSummary,t):e.verbose===1?i=NN(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 _N(e,t){let r=`Property interrupted after ${e.numRuns} tests
113
- { seed: ${e.seed} }`,n=null,i=[];return e.verbose>=2?n=Cd(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 Jc(e,t){if(!e.failed)return;let{message:r,details:n,hints:i}=e.counterexamplePath===null?e.interrupted?_N(e,t):LN(e,t):DN(e,t),o=r;return n!==null&&(o+=`
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+=`
114
114
 
115
115
  ${n}`),i.length>0&&(o+=`
116
116
 
117
- ${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(e){let t=[];function r(s){let a=l1(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let n=Jc(e,r);if(t.length===0)return n;let i=new _t(await Promise.all(t));function o(s){let a=Ye(i,s);return a!==void 0?a:xe(s)}return Jc(e,o)}function y1(e,t){if(t.runConfiguration.includeErrorInReport)throw new L(e);let r=new L(e,{cause:t.errorInstance});return"cause"in r||MN(r,{cause:t.errorInstance}),r}function FN(e){if(e.failed)throw y1(m1(e),e)}async function jN(e){if(e.failed)throw y1(await g1(e),e)}function VN(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):FN(e)}async function BN(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):jN(e)}function UN(e,t,r,n,i){let o=new c1(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 WN(e,t,r,n,i){let o=new c1(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 b1(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=vd({...ct(),...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=vN(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 kN(r.path.length===0?f1(n,r.seed,r.randomType,r.examples):h1(r.path,rr(p1(n,r.seed,r.randomType,r.examples)),s),i,o),l=r.endOnFailure?j.nil:s;return n.isAsync()?WN(n,l,a,r.verbose,r.markInterruptAsFailure).then(u=>u.toRunDetails(r.seed,r.path,o,r)):UN(n,l,a,r.verbose,r.markInterruptAsFailure).toRunDetails(r.seed,r.path,o,r)}function zN(e,t){let r=b1(e,t);if(e.isAsync())return r.then(BN);VN(r)}function GN(e,t){let r=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new o1(e,()=>!0);return t.unbiased===!0?new a1(r):r}function S1(e,t){let r=vd(typeof t=="number"?{...ct(),numRuns:t}:{...ct(),...t}),n=GN(e,r),i=n.shrink.bind(n);return(r.path.length===0?rr(f1(n,r.seed,r.randomType,r.examples)):h1(r.path,rr(p1(n,r.seed,r.randomType,r.examples)),i)).take(r.numRuns).map(o=>o.value_)}function HN(e,t){return[...S1(e,t)]}function qN(e){return(Math.round(e*100)/100).toFixed(2)}function KN(e,t,r){let n=vd(typeof r=="number"?{...ct(),numRuns:r}:{...ct(),...r}),i={};for(let l of S1(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],`${qN(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 YN=Object.assign;function Zc(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 D(YN(l,{values(){return G(s.history,u=>u.value)},[Me](){return Zc(e,t,r,n).value},[dt](){return xe(G(s.history,u=>u.value))}}),s)}var Ac=Array.isArray,OS=Object.keys,JN=Object.is;function ZN(e){let t=new _t;return function(n,i){let o=Ye(t,n);if(o===void 0){let l=n(...i);return ut(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 w1(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if(Ac(e)){if(!Ac(t)||e.length!==t.length)return!1}else if(Ac(t))return!1;if(OS(e).length!==OS(t).length)return!1;for(let r in e)if(!(r in t)||!w1(e[r],t[r]))return!1;return!0}else return JN(e,t)}var XN=class extends de{constructor(...e){super(...e),this.arbitraryCache=ZN(w1)}generate(e,t){return Zc(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 r1(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 Zc(n,i,a,this.arbitraryCache)})}};function QN(){return new XN}var e3=Math.floor,NS=Math.log;function t3(e){return e3(NS(e)/NS(2))}function r3(e){return e===O(0)?O(0):O(Ve(e).length)}function v1(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 n3=Math.ceil,i3=Math.floor;function LS(e){return i3(e/2)}function $S(e){return n3(e/2)}function DS(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:LS(n);for(let l=a;l>0;l=LS(l)){let u=l===n?t:e-l;yield new D(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:$S(n);for(let l=a;l<0;l=$S(l)){let u=l===n?t:e-l;yield new D(u,s),s=u}}return n>0?rr(i()):rr(o())}var _S=Math.sign,o3=Number.isInteger,s3=Object.is,an=class x1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new D(t.nextInt(n.min,n.max),void 0)}canShrinkWithoutContext(t){return typeof t=="number"&&o3(t)&&!s3(t,-0)&&this.min<=t&&t<=this.max}shrink(t,r){return x1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new D(r,void 0)):DS(t,r,!1):DS(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=v1(this.min,this.max,t3);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&&_S(t)!==_S(r))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},FS=Number.isInteger;function a3(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function ie(e={}){let t=a3(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!FS(t.min))throw new Error("fc.integer minimum value should be an integer");if(!FS(t.max))throw new Error("fc.integer maximum value should be an integer");return new an(t.min,t.max)}var jS=new Map;function Ad(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=Ye(jS,e);if(t!==void 0)return t;let r={depth:0};return ut(jS,e,r),r}function Id(){return{depth:0}}var l3=class{constructor(e,t,r){this.arb=e,this.mrng=t,this.biasFactor=r}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},u3=Math.min,c3=Math.max,d3=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 D(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 D(e[0],void 0);let t=this.mrng.nextInt(0,e.length-1),r=this.mrng.nextInt(0,e.length-1);return this.nextIndexInSlice=u3(t,r),this.lastIndexInSlice=c3(t,r),new D(e[this.nextIndexInSlice++],void 0)}};function VS(e,t,r,n){return n===void 0||r.length===0||t.nextInt(1,n)!==1?new l3(e,t,n):new d3(e,t,r,n)}var f3=Math.floor,BS=Math.log,US=Math.max,p3=Array.isArray;function Ic(e,t){return e===t?e:e+f3(BS(t-e)/BS(2))}var R1=class k1 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=ie({min:r,max:n}),this.depthContext=Ad(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[Me]=()=>{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=VS(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=US(0,r-Ic(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=VS(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=US(0,t-Ic(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&&k1.makeItCloneable(a,o),new D(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=Ic(this.minLength,this.maxGeneratedLength);return{size:ie({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 D(r,void 0))).length===t.length}shrinkItemByItem(t,r,n){let i=[];for(let o=r.startIndex;o<n;++o)$(i,tr(()=>this.arb.shrink(t[o],r.itemsContexts[o]).map(s=>{let a=G(Le(t,0,o),(u,c)=>new D(rn(u),r.itemsContexts[c])),l=G(Le(t,o+1),(u,c)=>new D(rn(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 D(rn(s),n.itemsContexts[a+o])),i.context,0]}).join(tr(()=>t.length>this.minLength?this.shrinkItemByItem(t,n,1):this.shrinkItemByItem(t,n,t.length))).join(t.length>this.minLength?tr(()=>{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 D(rn(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]))}},h3=Math.floor,m3=Math.min,Rr=2147483647,Qr=["xsmall","small","medium","large","xlarge"],g3=["-4","-3","-2","-1","=","+1","+2","+3","+4"],Pd="small";function y3(e,t){switch(t){case"xsmall":return h3(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 bi(e,t){let r=$t(g3,e);if(r===-1)return e;let n=$t(Qr,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?Qr[0]:i>=Qr.length?Qr[Qr.length-1]:Qr[i]}function gi(e,t,r,n){let{baseSize:i=Pd,defaultSizeToMaxWhenMaxSpecified:o}=ct()||{},s=e!==void 0?e:n&&o?"max":i;return s==="max"?r:m3(y3(t,bi(s,i)),r)}function b3(e,t){if(typeof e=="number")return 1/e;let{baseSize:r=Pd,defaultSizeToMaxWhenMaxSpecified:n}=ct()||{},i=e!==void 0?e:t&&n?"max":r;if(i==="max")return 0;switch(bi(i,r)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function Td(e){let{baseSize:t=Pd}=ct()||{};return e===void 0?t:bi(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:Rr;return new R1(e,n,gi(r,n,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function Cs(e){return e/O(2)}function WS(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:Cs(n);for(let l=a;l>0;l=Cs(l)){let u=e-l;yield new D(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:Cs(n);for(let l=a;l<0;l=Cs(l)){let u=e-l;yield new D(u,s),s=u}}return n>0?rr(i()):rr(o())}var S3=class E1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new D(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=v1(this.min,this.max,r3);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 E1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new D(r,void 0)):WS(t,r,!1):WS(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 w3(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 v3(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function nr(...e){let t=w3(v3(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new S3(t.min,t.max)}var x3=Object.getPrototypeOf,ui=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 Ws(e){return x3(e)===ui.prototype&&e.generate===ui.prototype.generate&&e.canShrinkWithoutContext===ui.prototype.canShrinkWithoutContext&&e.shrink===ui.prototype.shrink?e:new ui(e)}function R3(e){return e===1}function k3(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function Si(){return Ws(ie({min:0,max:1}).map(R3,k3))}var fi=Object.is,E3=class{constructor(e){this.values=e,this.fastValues=new nn(this.values);let t=!1,r=!1;if(Us(this.fastValues,0))for(let n=0;n!==this.values.length;++n){let i=this.values[n];t=t||fi(i,-0),r=r||fi(i,0)}this.hasMinusZero=t,this.hasPlusZero=r}has(e){return e===0?fi(e,0)?this.hasPlusZero:this.hasMinusZero:Us(this.fastValues,e)}},C1=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 xr(n)?new D(n,r,()=>n[Me]()):new D(n,r)}canShrinkWithoutContext(e){return this.values.length===1?fi(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new E3(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||fi(e,this.values[0])?j.nil():j.of(new D(this.values[0],0))}};function wt(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new C1(e)}function C3(e){return!e||!e.withBigInt?wt(!1,null,void 0,0,"",NaN):wt(!1,null,void 0,0,"",NaN,O(0))}function ve(e){return new C1([e])}var A3=class A1{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Me](){return new A1}};function I3(){return ve(new A3)}var P3=NaN,T3=Number.isNaN;function I1(e){return new Vs(e)}function P1(e){if(!(e instanceof Vs)||e.constructor!==Vs)throw new L("Not a valid value for date unmapper");return Bs(e)}function M3(e){return t=>t===e?new Vs(P3):I1(t)}function O3(e){return t=>{let r=P1(t);return T3(r)?e:r}}var zS=Number.isNaN;function T1(e={}){let t=e.min!==void 0?Bs(e.min):-864e13,r=e.max!==void 0?Bs(e.max):864e13,n=e.noInvalidDate;if(zS(t))throw new Error("fc.date min must be valid instance of Date");if(zS(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 ie({min:t,max:r}).map(I1,P1);let i=r+1;return ie({min:t,max:r+1}).map(M3(i),O3(i))}var N3=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 D(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(d.value,p)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function L3(e,t){return new N3(e,t)}var $3=Symbol.iterator,D3=Array.isArray,_3=Object.is,F3=class M1 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(!D3(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let r=1;r<t.length;++r)if(!_3(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])[$3]()),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[Me]=()=>{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&&M1.makeItCloneable(n,t),new D(n,i)}};function j3(e,t){return new F3(e,t)}var GS=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}},V3=Number.isNaN,B3=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new nn,this.data=[]}tryAdd(e){let t=this.selector(e);if(V3(t))return $(this.data,e),!0;let r=this.selectedItemsExceptNaN.size;return pi(this.selectedItemsExceptNaN,t),r!==this.selectedItemsExceptNaN.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},U3=Object.is,W3=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new nn,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(U3(t,-0))return this.hasMinusZero?!1:($(this.data,e),this.hasMinusZero=!0,!0);let r=this.selectedItemsExceptMinusZero.size;return pi(this.selectedItemsExceptMinusZero,t),r!==this.selectedItemsExceptMinusZero.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},z3=class{constructor(e){this.selector=e,this.selectedItems=new nn,this.data=[]}tryAdd(e){let t=this.selector(e),r=this.selectedItems.size;return pi(this.selectedItems,t),r!==this.selectedItems.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function G3(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 GS(l)}let n=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>n(o(a),o(l));return()=>new GS(s)}let t=e.selector||(n=>n),r=n=>t(n.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new B3(r);case"SameValueZero":return()=>new z3(r);case"SameValue":case void 0:return()=>new W3(r)}}function kr(e,t={}){let r=t.minLength!==void 0?t.minLength:0,n=t.maxLength!==void 0?t.maxLength:Rr,i=gi(t.size,r,n,t.maxLength!==void 0),o=t.depthIdentifier,s=new R1(e,r,i,n,o,G3(t),[]);return r===0?s:s.filter(a=>a.length>=r)}var H3=Object.create,q3=Object.defineProperty,K3=Object.getOwnPropertyDescriptor,HS=Object.getPrototypeOf,Y3=Object.prototype,J3=Reflect.ownKeys;function Z3(e){let t=e[1]?H3(null):{};for(let r of e[0])q3(t,r[0],{enumerable:!0,configurable:!0,writable:!0,value:r[1]});return t}function X3(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function Q3(e){if(typeof e!="object"||e===null)throw new L("Incompatible instance received: should be a non-null object");let t=HS(e)===null,r=HS(e)===Y3;if(!t&&!r)throw new L("Incompatible instance received: should be of exact type Object");let n=G(J3(e),i=>[i,K3(e,i)]);if(!Zw(n,([,i])=>X3(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 eL(e){return e[0]}function Md(e,t,r={}){let n=!!r.noNullPrototype;return B(kr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:eL,depthIdentifier:r.depthIdentifier}),n?ve(!1):Si()).map(Z3,Q3)}var tL=Number.POSITIVE_INFINITY,rL=Number.MAX_SAFE_INTEGER,nL=Number.isInteger,iL=Math.floor,oL=Math.pow,sL=Math.min,Xc=class O1 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,!nL(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 O1(t,{depthBias:b3(r.depthSize,r.maxDepth!==void 0),maxDepth:r.maxDepth!==void 0?r.maxDepth:tL,withCrossShrink:!!r.withCrossShrink},Ad(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 D(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 D(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=iL(oL(1+t,this.context.depth))-1;return-sL(this.totalWeight*r,rL)||0}};function aL(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function qS(e){return Vw(e)?{arbitrary:e,weight:1}:e}function Te(...e){let t=e[0];if(aL(t)){let n=G(Le(e,1),qS);return Xc.from(n,t,"fc.oneof")}let r=G(e,qS);return Xc.from(r,{},"fc.oneof")}var lL=Number.isInteger;function er(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(!lL(t))throw new Error("fc.nat maximum value should be an integer");return new an(0,t)}var uL=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 dL(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 fL(e){let t=cL(e);return function(n){let i=dL(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:ut(t.mapping,s,r),++r}}return t}function hL(e){let t=null;return function(n){t===null&&(t=pL(e));let i=uL(n,-0)?t.negativeZeroIndex:Ye(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 ln(...e){return er({max:mL(e)-1}).map(fL(e),hL(e))}function N1(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=Kw(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 gL(e){return ce(e,"")}function L1(e){return e.minLength!==void 0?e.minLength:0}function $1(e){return e.maxLength!==void 0?e.maxLength:Rr}function yL(e,t){return L1(t)<=e.length&&e.length<=$1(t)}function bL(e,t){return function(n){if(typeof n!="string")throw new L("Unsupported value");let i=N1(e,n,L1(t),$1(t));if(i===void 0)throw new L("Unable to unmap received string");return i}}var D1=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function SL(e,t,r){let n;try{n=r(e)}catch{return}for(let i of n)if(!t.canShrinkWithoutContext(i))return;return n}function wL(e,t){let r=[];for(let n of D1){let i=SL(n,e,t);i!==void 0&&$(r,i)}return r}var KS=new WeakMap;function vL(e){let t=[];for(let r of D1){let n=N1(e,r,0,Rr);n!==void 0&&$(t,n)}return t}function xL(e,t){let r=w4(KS,e);r===void 0&&(r=vL(e),S4(KS,e,r));let n=[];for(let i of r)yL(i,t)&&$(n,i);return n}var RL=[[0,127]],kL=[[0,55295],[57344,1114111]],EL=[[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]],CL=[[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]],YS=String.fromCodePoint,AL=Math.min,IL=Math.max;function Qc(e){if(e.length===1){let r=YS(e[0]);return{num:1,build:()=>r}}let t=e[0];return{num:e[1]-e[0]+1,build:r=>YS(t+r)}}function JS(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=IL(s,u),p=AL(a,c);if(r.length>=1){let h=r[r.length-1];(h.length===1?h[0]:h[1])+1===d&&(d=h[0],Kw(r))}$(r,d===p?[d]:[d,p]),a<=p&&(n+=1),c<=p&&(i+=1)}}return r}var ZS=Object.create(null);function PL(e){switch(e){case"full":return kL;case"ascii":return RL}}function TL(e,t){let r=`${e}:${t}`,n=ZS[r];if(n!==void 0)return n;let i=PL(t),o=e==="binary"?i:JS(i,EL),s=[];for(let l of o)$(s,Qc(l));if(e==="grapheme"){let l=JS(i,CL);for(let u of l){let c=Qc(u);$(s,{num:c.num,build:d=>F4(c.build(d),"NFD")})}}let a=ln(...s);return ZS[r]=a,a}function ci(e,t){return TL(e,t)}function ML(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return ci("grapheme","full");case"grapheme-composite":return ci("composite","full");case"grapheme-ascii":case void 0:return ci("grapheme","ascii");case"binary":return ci("binary","full");case"binary-ascii":return ci("binary","ascii")}}function Ce(e={}){let t=ML(e),r=bL(t,e),n=xL(t,e);return ae(t,{...e,experimentalCustomSlices:n}).map(gL,r)}var _1=Map,Od=String.fromCharCode,Nd={num:26,build:e=>Od(e+97)},OL={num:26,build:e=>Od(e+65)},F1={num:10,build:e=>Od(e+48)};function NL(e){let t=Z6(e);return e!==t?t:`%${hi(on(e,0),16)}`}function LL(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var $L=()=>Ce({unit:"binary",minLength:1,maxLength:1}).map(NL,LL),Pc;function DL(){return Pc===void 0&&(Pc=ln(Nd)),Pc}var As;function ed(e){As===void 0&&(As=new _1);let t=Ye(As,e);return t===void 0&&(t=ln(Nd,F1,{num:e.length,build:r=>e[r]}),ut(As,e,t)),t}function _L(e){return ln(Nd,OL,F1,{num:e.length,build:t=>e[t]})}var Is;function Ld(e){Is===void 0&&(Is=new _1);let t=Ye(Is,e);return t===void 0&&(t=Te({weight:10,arbitrary:_L(e)},{weight:1,arbitrary:$L()}),ut(Is,e,t)),t}function jt(e,t={}){let r=t.freq===void 0?6:t.freq,n=Xw(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 Xc.from(i,o,"fc.option")}function FL(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var j1=Symbol("adapted-value");function jL(e,t){let r=t(e.value_);return r.adapted?new D(r.value,j1):e}var VL=class extends de{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=r=>jL(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===j1?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):j.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function V1(e,t){return new VL(e,t)}function BL([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function UL(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 WL(e){let t=ed("");return B(t,jt(B(Ce({unit:ed("-"),size:e,maxLength:61}),t))).map(BL,UL).filter(FL)}function zL(e){return`${ce(e[0],".")}.${e[1]}`}function GL(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 HL(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 $d(e={}){let t=Td(e.size),r=bi("-1",t),n=Ce({unit:DL(),minLength:2,maxLength:63,size:r});return V1(B(ae(WL(t),{size:r,minLength:1,maxLength:127}),n),HL).map(zL,GL)}function qL(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 KL(e){return ce(e,".")}function YL(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,".")}function JL(e){return`${e[0]}@${e[1]}`}function ZL(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,"@",2)}function XL(e={}){return B(V1(ae(Ce({unit:ed("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),qL).map(KL,YL),$d({size:e.size})).map(JL,ZL)}var QL=Dt.NEGATIVE_INFINITY,td=Dt.POSITIVE_INFINITY,B1=Dt.EPSILON,Dd=O(2146435072)*O(4294967296),e$=-Dd-O(1),XS=4503599627370496,t$=O(0xfffffffffffff),QS=O("9007199254740992"),rd=new Float64Array(1),ew=new Uint32Array(rd.buffer,rd.byteOffset);function r$(e){return rd[0]=e,[ew[1],ew[0]]}function n$(e){let{0:t,1:r}=r$(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*B1,a*=n===0?1:-1,{exponent:s,significand:a}}function tw(e,t){return e===-1022?O(t*XS):O((t-1)*XS)+(O(e+1023)<<O(52))}function _d(e){if(e===td)return Dd;if(e===QL)return e$;let t=n$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===td?tw(r,n):-tw(r,-n)-O(1)}function nd(e){if(e<0)return-nd(-e-O(1));if(e===Dd)return td;if(e<QS)return Dt(e)*2**-1074;let t=e-QS,r=-1021+Dt(t>>O(52));return(1+Dt(t&t$)*B1)*2**r}var rw=Number.isInteger,nw=Object.is,Tc=Number.NEGATIVE_INFINITY,Mc=Number.POSITIVE_INFINITY;function U1(e,t,r,n){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:Tc,max:l=i?t:Mc}=e,u=o?a<-r?-n:Math.max(a,-r):a===Tc?Math.max(a,-n):Math.max(a,-r),c=s?l>r?n:Math.min(l,r):l===Mc?Math.min(l,n):Math.min(l,r);return{noDefaultInfinity:!1,minExcluded:o||(a!==Tc||o)&&rw(u),maxExcluded:s||(l!==Mc||s)&&rw(c),min:nw(u,-0)?0:u,max:nw(c,0)?-0:c,noNaN:e.noNaN||!1}}var W1=Number.NEGATIVE_INFINITY,z1=Number.POSITIVE_INFINITY,i$=Number.MAX_VALUE,o$=45035996273704955e-1,id=4503599627370496;function s$(e){return U1(e,i$,o$,id)}function a$(e){return e===4503599627370496?z1:e===-4503599627370496?W1:e}function l$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===z1?id:e===W1?-id:e}var u$=Number.isInteger,G1=Number.isNaN,c$=Number.NEGATIVE_INFINITY,d$=Number.POSITIVE_INFINITY,iw=Number.MAX_VALUE,f$=NaN;function ow(e,t){if(G1(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return _d(e)}function p$(e){if(typeof e!="number")throw new Error("Unsupported type");return _d(e)}function h$(e){return!u$(e)}function sw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-iw:c$,max:s=t?iw:d$}=e,a=ow(o,"min"),l=n?a+O(1):a,u=ow(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 nr({min:l,max:c}).map(nd,p$);let d=c>O(0),p=d?l:l-O(1),h=d?c+O(1):c;return nr({min:p,max:h}).map(f=>c<f||f<l?f$:nd(f),f=>{if(typeof f!="number")throw new Error("Unsupported type");return G1(f)?c!==h?h:p:_d(f)})}function qs(e={}){return e.noInteger?sw(s$(e)).map(a$,l$).filter(h$):sw(e)}var m$=Number.NEGATIVE_INFINITY,od=Number.POSITIVE_INFINITY,g$=Math.imul,sd=2**127*(1+(2**23-1)/2**23),H1=2139095040,y$=-2139095041,ad=new Float32Array(1),b$=new Uint32Array(ad.buffer,ad.byteOffset);function S$(e){return ad[0]=e,b$[0]}function w$(e){let t=S$(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 aw(e,t){return e===-126?t*8388608:g$(e+127,8388608)+(t-1)*8388608}function Fd(e){if(e===od)return H1;if(e===m$)return y$;let t=w$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===od?aw(r,n):-aw(r,-n)-1}function ld(e){if(e<0)return-ld(-e-1);if(e===H1)return od;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,K1=Number.POSITIVE_INFINITY,v$=sd,x$=83886075e-1,ud=8388608;function R$(e){return U1(e,v$,x$,ud)}function k$(e){return e===8388608?K1:e===-8388608?q1:e}function E$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===K1?ud:e===q1?-ud:e}var C$=Number.isInteger,Y1=Number.isNaN,A$=Math.fround,I$=Number.NEGATIVE_INFINITY,P$=Number.POSITIVE_INFINITY,T$=NaN;function lw(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(Y1(e)||A$(e)!==e)throw new Error(r);return Fd(e)}function M$(e){if(typeof e!="number")throw new Error("Unsupported type");return Fd(e)}function O$(e){return!C$(e)}function uw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-sd:I$,max:s=t?sd:P$}=e,a=lw(o,"min"),l=n?a+1:a,u=lw(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 ie({min:l,max:c}).map(ld,M$);let d=c>0?l:l-1,p=c>0?c+1:c;return ie({min:d,max:p}).map(h=>h>c||h<l?T$:ld(h),h=>{if(typeof h!="number")throw new Error("Unsupported type");return Y1(h)?c!==p?p:d:Fd(h)})}function J1(e={}){return e.noInteger?uw(R$(e)).map(k$,E$).filter(O$):uw(e)}function N$(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function Z1(e){return e.replace(/\*\//g,"*\\/")}var qe=[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 zs(e){let t=4294967295;for(let r=0;r<e.length;++r){let n=on(e,r);if(n<128)t=qe[t&255^n]^t>>8;else if(n<2048)t=qe[t&255^(192|n>>6&31)]^t>>8,t=qe[t&255^(128|n&63)]^t>>8;else if(n>=55296&&n<57344){let i=on(e,++r);if(n>=56320||i<56320||i>57343||Number.isNaN(i))r-=1,t=qe[t&255^239]^t>>8,t=qe[t&255^191]^t>>8,t=qe[t&255^189]^t>>8;else{let o=(n&1023)+64,s=i&1023;t=qe[t&255^(240|o>>8&7)]^t>>8,t=qe[t&255^(128|o>>2&63)]^t>>8,t=qe[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=qe[t&255^(128|s&63)]^t>>8}}else t=qe[t&255^(224|n>>12&15)]^t>>8,t=qe[t&255^(128|n>>6&63)]^t>>8,t=qe[t&255^(128|n&63)]^t>>8}return(t|0)+2147483648}var L$=Object.getPrototypeOf,di=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 Gs(e){return L$(e)===di.prototype&&e.generate===di.prototype.generate&&e.canShrinkWithoutContext===di.prototype.canShrinkWithoutContext&&e.shrink===di.prototype.shrink?e:new di(e)}var $$=Object.assign,D$=Object.keys;function X1(e){return B(Gs(ie()),Gs(ie({min:1,max:4294967295}))).map(([t,r])=>{let n=()=>{let i={};return $$((s,a)=>{let l=xe(s),u=xe(a),c=e(zs(`${t}${l}`)%r,zs(`${t}${u}`)%r);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=D$(i).sort().map(a=>`${a} => ${xe(i[a])}`).map(a=>`/* ${Z1(a)} */`);return`function(a, b) {
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) {
118
118
  // With hash and stringify coming from fast-check${s.length!==0?`
119
119
  ${ce(s,`
120
120
  `)}`:""}
@@ -122,20 +122,20 @@ ${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(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
- }`},[Me]:n})};return n()})}var _$=Object.assign;function F$(){return X1(_$((e,t)=>e<t,{toString(){return"(hA, hB) => hA < hB"}}))}var j$=Object.assign;function V$(){return X1(j$((e,t)=>e-t,{toString(){return"(hA, hB) => hA - hB"}}))}var B$=Object.defineProperties,U$=Object.keys;function W$(e){return B(ae(e,{minLength:1}),Gs(ie())).map(([t,r])=>{let n=()=>{let i={},o=(...a)=>{let l=xe(a),u=t[zs(`${r}${l}`)%t.length];return i[l]=u,xr(u)?u[Me]():u};function s(a){let l=G(G(Jw(U$(i)),u=>`${u} => ${xe(i[u])}`),u=>`/* ${Z1(u)} */`);return`function(...args) {
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) {
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 B$(o,{toString:{value:()=>s(xe(t))},[dt]:{value:()=>s(xe(t))},[Ft]:{value:async()=>s(await kd(t))},[Me]:{value:n,configurable:!0}})};return n()})}var z$=Number.MIN_SAFE_INTEGER,G$=Number.MAX_SAFE_INTEGER;function Q1(){return new an(z$,G$)}var H$=Number.MAX_SAFE_INTEGER;function q$(){return new an(0,H$)}var K$=Number.parseInt;function Y$(e){let[t,r]=e;switch(t){case"oct":return`0${hi(r,8)}`;case"hex":return`0x${hi(r,16)}`;default:return`${r}`}}function Ls(e,t){let r=K$(e,t);if(hi(r,t)!==e)throw new Error("Invalid value");return r}function J$(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",Ls(ge(e,2),16)]:["oct",Ls(ge(e,1),8)]:["dec",Ls(e,10)]}function Z$(e){return ce(e,".")}function X$(e){if(typeof e!="string")throw new Error("Invalid type");return G(Be(e,"."),t=>Ls(t,10))}function jd(){return B(er(255),er(255),er(255),er(255)).map(Z$,X$)}function St(e){return B(wt("dec","oct","hex"),er(e)).map(Y$,J$)}function Oc(e){return ce(e,".")}function Nc(e){if(typeof e!="string")throw new Error("Invalid type");return Be(e,".")}function e0(){return Te(B(St(255),St(255),St(255),St(255)).map(Oc,Nc),B(St(255),St(255),St(65535)).map(Oc,Nc),B(St(255),St(16777215)).map(Oc,Nc),St(4294967295))}function Vd(e){return e.length===0?[]:Be(e,":")}function Bd(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 Q$(e){return`${ce(e[0],":")}:${e[1]}`}function eD(e){if(typeof e!="string")throw new Error("Invalid type");return Bd(e)}function tD(e){return`::${ce(e[0],":")}:${e[1]}`}function rD(e){if(typeof e!="string")throw new Error("Invalid type");if(!$4(e,"::"))throw new Error("Invalid value");return Bd(ge(e,2))}function $s(e){return`${ce(e[0],":")}::${ce(e[1],":")}:${e[2]}`}function Ds(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2),[n,i]=Bd(r);return[Vd(t),n,i]}function nD(e){return $s([e[0],[e[1]],e[2]])}function iD(e){let t=Ds(e);return[t[0],ce(t[1],":"),t[2]]}function cw(e){return`${ce(e[0],":")}::${e[1]}`}function dw(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2);return[Vd(t),r]}function oD(e){return`${ce(e[0],":")}::`}function sD(e){if(typeof e!="string")throw new Error("Invalid type");if(!D4(e,"::"))throw new Error("Invalid value");return[Vd(ge(e,0,e.length-2))]}function aD([e,t]){return`${e}:${t}`}function lD(e){if(typeof e!="string")throw new L("Invalid type");if(!e.includes(":"))throw new L("Invalid value");return e.split(":",2)}var uD="0123456789abcdef",Lc;function cD(){return Lc===void 0&&(Lc=ie({min:0,max:15}).map(e=>uD[e],e=>{if(typeof e!="string")throw new L("Not a string");if(e.length!==1)throw new L("Invalid length");let t=on(e,0);if(t<=57)return t-48;if(t<97)throw new L("Invalid character");return t-87})),Lc}function t0(){let e=Ce({unit:cD(),minLength:1,maxLength:4,size:"max"}),t=Te(B(e,e).map(aD,lD),jd());return Te(B(ae(e,{minLength:6,maxLength:6,size:"max"}),t).map(Q$,eD),B(ae(e,{minLength:5,maxLength:5,size:"max"}),t).map(tD,rD),B(ae(e,{minLength:0,maxLength:1,size:"max"}),ae(e,{minLength:4,maxLength:4,size:"max"}),t).map($s,Ds),B(ae(e,{minLength:0,maxLength:2,size:"max"}),ae(e,{minLength:3,maxLength:3,size:"max"}),t).map($s,Ds),B(ae(e,{minLength:0,maxLength:3,size:"max"}),ae(e,{minLength:2,maxLength:2,size:"max"}),t).map($s,Ds),B(ae(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(nD,iD),B(ae(e,{minLength:0,maxLength:5,size:"max"}),t).map(cw,dw),B(ae(e,{minLength:0,maxLength:6,size:"max"}),e).map(cw,dw),B(ae(e,{minLength:0,maxLength:7,size:"max"})).map(oD,sD))}var dD=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)}},fD=Object.getOwnPropertyNames;function pD(){let e=new _t;return r=>{let n=Ye(e,r);return n!==void 0||(n=new dD(String(r)),ut(e,r,n)),n}}function r0(e){let t=pD(),r=e(t),n=fD(r);for(let i of n){let o=t(i);o.underlying=r[i]}return r}function hD(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(!hD(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 fw=Object.assign,_s=Object.create,n0=Object.defineProperty,pw=Object.getPrototypeOf,gD=Object.prototype;function yD(e){return n0(_s(null),dt,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function hw(e,t){return yD(`<${Ve(e)}#${t}>`)}function bD(e,t){let r=_s(gD);for(let n in e){let i=e[n],o=[];for(let s of i){let a=fw(_s(pw(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])}n0(a,dt,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[n][o],u=fw(_s(pw(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?hw(d.type,d.index):G(d.index,p=>hw(d.type,p))}return xe(u)}})}}return r}function SD(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=Ye(r,a.type);if(l===void 0&&(l=new _t,ut(r,a.type,l)),k4(l,a.forwardRelationship))throw new L(`Cannot declare multiple inverse relationships for the same forward relationship ${Ve(a.forwardRelationship)} on type ${Ve(a.type)}`);ut(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=Ye(r,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=Ye(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`);ut(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 mw=Object.create;function wD(e,t,r){switch(e){case"exclusive":return ve(r);case"successor":return Ws(ie({min:t!==void 0?t+1:0,max:r}));case"any":return Ws(ie({min:0,max:r}))}}function vD(e,t,r,n,i,o,s){let a=wD(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(kr(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 xD=class extends de{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let r=new nn,n=new nn;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(Us(r,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);pi(n,a.type)}else{if(Us(n,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);pi(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=SD(e)}createEmptyLinksInstanceFor(e){let t=mw(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=mw(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=Id();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=vD(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=Ye(this.inversedRelations,c);if(S!==void 0){let w=p[g][S.property].index;$(w,o.indexInType)}}}}return n.length=0,new D(r,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function RD(e,t){return new xD(e,t)}var kD=Object.keys,ED=Object.getOwnPropertySymbols,CD=Object.getOwnPropertyDescriptor;function AD(e){let t=kD(e),r=ED(e);for(let n=0;n!==r.length;++n){let i=r[n],o=CD(e,i);o&&o.enumerable&&t.push(i)}return t}var ID=Object.create,PD=Object.defineProperty,TD=Object.getOwnPropertyDescriptor,MD=Object.getOwnPropertyNames,OD=Object.getOwnPropertySymbols;function ND(e,t){return function(n){let i=n[1]?ID(null):{};for(let o=0;o!==e.length;++o){let s=n[0][o];s!==t&&PD(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function LD(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=TD(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=MD(n).length,u=OD(n).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var $c=Symbol("no-key");function Dc(e,t,r){let n=AD(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:$c}))}return B(B(...i),r?ve(!1):Si()).map(ND(n,$c),LD(n,$c))}function cd(e,t){let r=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return Dc(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 Dc(e,n,r)}var $D=Object.create;function DD(e,t,r,n){let i=$D(null);for(let o in e){let s=e[o],a=cd(s,n),l=t(o),u=r(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?kr(a,{...c,selector:u}):ae(a,c)}return cd(i)}var gw=Object.create,_D=Object.keys;function FD(e,t,r={}){let n=_D(e),i=r.initialPoolConstraints||gw(null),o=r.unicityConstraints||gw(null),s={noNullPrototype:r.noNullPrototype};return mD(n,i).chain(a=>RD(t,a).chain(l=>DD(e,u=>l[u].length,u=>o[u],s).map(u=>bD(u,l))))}function jD(e){return ce(G(e,t=>t[t.length-1]===","?ge(t,0,t.length-1):t)," ")}function VD(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 BD(e){let t=ce(e," ");return t[t.length-1]===","&&(t=ge(t,0,t.length-1)),Sd(t[0])+ge(t,1)+"."}function UD(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]===","||Sd(qc(r[0]))!==r[0])throw new Error("Unsupported value");let n=qc(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 WD(e){return ce(e," ")}function zD(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 GD(){return Te(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 HD(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=GD();return r==="sentences"?ae(ae(i,{minLength:1,size:"small"}).map(BD,UD(i)),{minLength:1,maxLength:t,size:n}).map(WD,zD):ae(i,{minLength:1,maxLength:t,size:n}).map(jD,VD(i))}function qD(e){return new Map(e)}function KD(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 YD(e){return e[0]}function dd(e,t,r={}){return kr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:YD,depthIdentifier:r.depthIdentifier,comparator:"SameValueZero"}).map(qD,KD)}var Ps=10;function JD(e){let t={};return(r=>{let n=r!==void 0?r:Ps;if(!Xw(t,n)){let i=Ps;Ps=n-1,t[n]=e(n),Ps=i}return t[n]})}function ZD(e){let t=0;for(;e>O(0);)e&O(1)&&++t,e>>=O(1);return t}function XD(e,t){let r=(O(1)<<O(t))-O(1),n=e&r,i=ZD(e-n),o=n;for(let s=O(1);s<=r&&i!==0;s<<=O(1))o&s||(o|=s,--i);return o}function Ts(e,t){let r=[];for(let n=e.length-1;n!==-1;--n)t(e[n])!==e[n]&&$(r,n);return r}function QD(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 _c(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 e_=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=Ts(n,this.toggleCase),o=nr(O(0),(O(1)<<O(i.length))-O(1)).generate(e,void 0);return _c(n,o.value,i,this.toggleCase),new D(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:QD(a,s,Ts(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=Ts(s,this.toggleCase),l=XD(i,a.length);return _c(s,l,a,this.toggleCase),new D(ce(s,""),this.buildContextFor(o,new D(l,void 0)))}).join(tr(()=>{let o=[...n],s=Ts(o,this.toggleCase);return nr(O(0),(O(1)<<O(s.length))-O(1)).shrink(i,r.flagsContext).map(a=>{let l=Le(o);return _c(l,a.value,s,this.toggleCase),new D(ce(l,""),this.buildContextFor(new D(n,r.rawStringContext),a))})}))}};function t_(e){let t=Sd(e);return t!==e?t:qc(e)}function r_(e,t){return new e_(e,t&&t.toggleCase||t_,t&&t.untoggleAll)}function n_(e){return Gw.from(e)}function i_(e){if(!(e instanceof Gw))throw new Error("Unexpected type");return[...e]}function i0(e={}){return ae(J1(e),e).map(n_,i_)}function o_(e){return Hw.from(e)}function s_(e){if(!(e instanceof Hw))throw new Error("Unexpected type");return[...e]}function o0(e={}){return ae(qs(e),e).map(o_,s_)}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 s0(e={}){return Vt(e,-32768,32767,G6,ie)}function a0(e={}){return Vt(e,-2147483648,2147483647,H6,ie)}function l0(e={}){return Vt(e,-128,127,z6,ie)}function u0(e={}){return Vt(e,0,65535,Y6,ie)}function c0(e={}){return Vt(e,0,4294967295,J6,ie)}function d0(e={}){return Vt(e,0,255,q6,ie)}function f0(e={}){return Vt(e,0,255,K6,ie)}function a_(e){return e!==void 0}function yw(e){return e.hasToBeCloned?new D(e.value_,{generatorContext:e.context},()=>e.value):new D(e.value_,{generatorContext:e.context})}function bw(e){return e.hasToBeCloned?new D(e.value_,{shrinkerContext:e.context},()=>e.value):new D(e.value_,{shrinkerContext:e.context})}var l_=class extends de{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return yw(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return a_(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(yw):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(bw):this.shrinkerArbitrary.shrink(e,void 0).map(bw)}};function fd(e,t,r){let n=ie({min:e,max:t});return t===r?n:new l_(n,ie({min:e,max:r}))}var u_=Math.min,pd=Math.max,Sw=Ww.isArray,c_=Object.entries;function d_(e){let t=-1;for(let r=0;r!==e.length;++r)t=pd(t,e[r][0]);return t}function f_(e,t){let r=Ww(e);for(let n=0;n!==t.length;++n){let i=t[n];i[0]<e&&(r[i[0]]=i[1])}return r}function p0(e,t={}){let{size:r,minNumElements:n=0,maxLength:i=Rr,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=gi(r,gi(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=u_(o,i),c=t.maxNumElements!==void 0||r!==void 0?r:"=",d=kr(B(fd(0,pd(l-1,0),pd(i-1,0)),e),{size:c,minLength:n,maxLength:u,selector:p=>p[0],depthIdentifier:a}).map(p=>f_(d_(p)+1,p),p=>{if(!Sw(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,fd(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(!Sw(p))throw new Error("Not supported entry type");return[p,p.length]})}function p_(e){return new Set(e)}function h_(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 h0(e,t={}){return kr(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(p_,h_)}function m_(e,t,r,n,i,o){return Md(e,t,{maxKeys:r,noNullPrototype:!o,size:n,depthIdentifier:i})}function g_(e){return Te(l0(e),d0(e),f0(e),s0(e),u0(e),a0(e),c0(e),i0(e),o0(e))}function m0(e){let t=e.values,r=e.depthSize,n=Id(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Te(...t,...e.withBigInt?[nr()]:[],...e.withDate?[T1()]:[]);return r0(l=>({anything:Te({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?[g_({maxLength:o,size:s})]:[],...e.withSparseArray?[p0(l("anything"),{maxNumElements:o,size:s,depthIdentifier:n})]:[]),keys:e.withObjectString?Te({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:h0(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),map:Te(dd(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n}),dd(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n})),object:m_(l("keys"),l("anything"),o,s,n,e.withNullPrototype)})).anything}function y_(e){switch(typeof e){case"boolean":return new zw(e);case"number":return new Dt(e);case"string":return new Ve(e);default:return e}}function b_(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===zw||e.constructor===Dt||e.constructor===Ve?e.valueOf():e}function S_(e){return e.map(y_,b_)}function w_(e,t){return[Si(),Q1(),qs(),t(e),Te(t(e),ve(null),ve(void 0))]}function v_(e){return e.map(t=>S_(t))}function x_(e,t){return t?v_(e).concat(e):e}function g0(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:x_(e.values!==void 0?e.values:w_(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 R_(e){return Md(e.key,m0(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function k_(e){return R_(g0(e))}function E_(e,t){let{depthSize:r,maxDepth:n}=t;return{key:e,values:[Si(),qs({noDefaultInfinity:!0,noNaN:!0}),e,ve(null)],depthSize:r,maxDepth:n}}function y0(e){return m0(g0(e))}function b0(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return y0(E_("stringUnit"in e?Ce({unit:e.stringUnit}):t?Ce():Ce({unit:"binary"}),e))}var C_=JSON.stringify,A_=JSON.parse;function I_(e){if(typeof e!="string")throw new L("Cannot unmap the passed value");return A_(e)}function P_(e={}){return b0(e).map(C_,I_)}var T_=Object.defineProperties;function Fc(e,t){return`Stream(${t!==void 0?`${ce(t,",")}\u2026`:`${e} emitted`})`}var M_=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 T_(new j(s(this.arb,e.clone())),{toString:{value:()=>Fc(o,i!==null?i.map(xe):void 0)},[dt]:{value:()=>Fc(o,i!==null?i.map(xe):void 0)},[Ft]:{value:async()=>Fc(o,i!==null?await Promise.all(i.map(kd)):void 0)},[Me]:{value:n,enumerable:!0}})};return new D(n(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function O_(e,t){return new M_(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function N_(e){return ce(e,"")}function ww(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function L_(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return ge(e,1)}}function $_(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 jc=String.fromCharCode;function D_(e){return e<26?jc(e+65):e<52?jc(e+97-26):e<62?jc(e+48-52):e===62?"+":"/"}function __(e){if(typeof e!="string"||e.length!==1)throw new L("Invalid entry");let t=on(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 F_(){return ie({min:0,max:63}).map(D_,__)}function j_(e={}){let{minLength:t=0,maxLength:r=Rr,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=F_();return ae(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:wL(a,ww)}).map(N_,ww).map(L_,$_)}var vw=Object.is;function V_(e,t){let r=new _t,n=0;for(let i of e)vw(i,-0)?++n:ut(r,i,(Ye(r,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(vw(o,-0)){if(n===0)return!1;--n}else{let s=Ye(r,o)||0;if(s===0)return!1;ut(r,o,s-1)}}return!0}var B_=Math.floor,xw=Math.log,U_=Array.isArray,S0=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 an(r,n),this.biasedLengthArb=r!==n?new an(r,r+B_(xw(n-r)/xw(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]),Yw(i,a,1)}return this.isOrdered&&Jw(o,(s,a)=>s-a),new D(G(o,s=>this.originalArray[s]),r.context)}canShrinkWithoutContext(e){return!U_(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:V_(this.originalArray,e)}shrink(e,t){return e.length===0?j.nil():this.lengthArb.shrink(e.length,t).map(r=>new D(Le(e,e.length-r.value),r.context)).join(e.length>this.minLength?tr(()=>this.shrink(Le(e,1),void 0).filter(r=>this.minLength<=r.value.length+1).map(r=>new D([e[0],...r.value],void 0))):j.nil())}};function W_(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new S0(e,!0,r,n)}function z_(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new S0(e,!1,r,n)}var G_={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"},H_={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 q_(e){return e<10?Ve(e):G_[e]}function Rw(e,t){let r="";for(;e.length+r.length<t;)r+="0";return r+e}function kw(e){let t="";for(let r=e;r!==0;){let n=r>>5;t=q_(r-(n<<5))+t,r=n}return t}function K_(e,t){let r=~~(e/1073741824),n=e&1073741823;return Rw(kw(r),t-6)+Rw(kw(n),6)}function w0(e){return function(r){return K_(r,e)}}function Vc(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=H_[e[n]];if(i===void 0)throw new L("Unsupported type");t+=i*r,r*=32}return t}var Y_=w0(10),Ew=w0(8);function J_(e){return Y_(e[0])+Ew(e[1])+Ew(e[2])}function Z_(e){if(typeof e!="string"||e.length!==26)throw new Error("Unsupported type");return[Vc(e.slice(0,10)),Vc(e.slice(10,18)),Vc(e.slice(18))]}function X_(){return B(ie({min:0,max:0xffffffffffff}),ie({min:0,max:0xffffffffff}),ie({min:0,max:0xffffffffff})).map(J_,Z_)}function v0(e){return _4(hi(e,16),8,"0")}function Q_(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!==v0(t))throw new Error("Unsupported value: invalid content");return t}function Bc(e,t){return ie({min:e,max:t}).map(v0,Q_)}function e7(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 t7=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function r7(e){if(typeof e!="string")throw new Error("Unsupported type");let t=t7.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 Cw="0123456789abcdef";function n7(e){let t={},r={};for(let o=0;o!==e.length;++o){let s=Cw[o],a=Cw[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 i7(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 o7(e={}){let t=Bc(0,4294967295),r=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];i7(r);let{versionsApplierMapper:n,versionsApplierUnmapper:i}=n7(r);return B(t,Bc(0,268435456*r.length-1).map(n,i),Bc(2147483648,3221225471),t).map(e7,r7)}function s7(e){return Ce({unit:Ld("-._~!$&'()*+,;=:"),size:e})}function a7([e,t,r]){return(e===null?"":`${e}@`)+t+(r===null?"":`:${r}`)}function l7(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 u7(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 x0(e){let t=e||{},r=t.size,n=[$d({size:r}),...t.withIPv4===!0?[jd()]:[],...t.withIPv6===!0?[t0().map(u7,c7)]:[],...t.withIPv4Extended===!0?[e0()]:[]];return B(t.withUserInfo===!0?jt(s7(r)):ve(null),Te(...n),t.withPort===!0?jt(er(65535)):ve(null)).map(a7,l7)}function R0(e){return Ce({unit:Ld("-._~!$&'()*+,;=:@/?"),size:e})}function k0(e={}){return R0(e.size)}function E0(e={}){return Ce({unit:Ld("-._~!$&'()*+,;=:@"),size:e.size})}function d7(e){return ce(G(e,t=>`/${t}`),"")}function f7(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 Yw(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 Uc(e,t){return ae(E0({size:e}),{size:t}).map(d7,f7)}function h7(e){let[t,r]=p7(e);return t===r?Uc(t,r):Te(Uc(t,r),Uc(r,t))}function C0(e){return h7(Td((e||{}).size))}function A0(e={}){return R0(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 g7=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function y7(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=g7.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 b7(e){let t=e||{},r=Td(t.size),n=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?bi(t.authoritySettings.size,r):r,i={...t.authoritySettings,size:n};return B(wt(...t.validSchemes||["http","https"]),x0(i),C0({size:r}),t.withQueryParameters===!0?jt(A0({size:r})):ve(null),t.withFragments===!0?jt(k0({size:r})):ve(null)).map(m7,y7)}var S7=class I0{constructor(t,r){this.commands=t,this.metadataForReplay=r,this[Me]=function(){return new I0(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}},w7=class hd{constructor(t){if(this.cmd=t,this.hasRan=!1,xd(t)){let r=t[dt];this[dt]=function(){return r.call(t)}}if(Rd(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 xr(this.cmd)?new hd(this.cmd[Me]()):new hd(this.cmd)}toString(){return this.cmd.toString()}},Aw=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)}},v7=class extends de{constructor(e,t,r,n,i){super(),this.sourceReplayPath=n,this.disableReplayLog=i,this.oneCommandArb=Te(...e).map(o=>new w7(o)),this.lengthArb=fd(0,t,r),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(Aw.stringify(this.replayPath))}`}buildValueFor(e,t){let r=e.map(i=>i.value_),n={shrunkOnce:t,items:e};return new D(new S7(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?Aw.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(tr(()=>{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(tr(()=>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 D(u.value_.clone(),u.context)),!0))}};function x7(e,t={}){let{size:r,maxCommands:n=Rr,disableReplayLog:i=!1,replayPath:o=null}=t;return new v7(e,gi(r,0,n,t.maxCommands!==void 0),n,o,i)}var R7=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}},k7=function*(e,t){for(let r of t)yield new R7(e,r)},P0=(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}),E7=(e,t)=>P0({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),C7=e=>typeof e.then=="function",T0=async(e,t,r=Promise.resolve())=>await P0({then:s=>{let a=e();return C7(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 A7(e,t){E7(e,t)}async function I7(e,t){await T0(e,t)}async function P7(e,t,r){let n=T0(t,k7(e,r),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(n),await e.waitAll()}var Ms=e=>e(),M0=class md{constructor(t,r){this.act=t,this.taskSelector=r,this.lastTaskId=0,this.sourceTaskSelector=r.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Me]=function(){return new md(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 ${N$(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||Ms)}scheduleFunction(t,r){return(...n)=>this.scheduleInternal("function",`${t.name}(${n.map(xe).join(",")})`,t(...n),void 0,r||Ms)}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||Ms,()=>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||Ms;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(md.buildLog).map(t=>`-> ${t}`).join(`
132
- `)+"`"}};function O0(e){let t=0;return{clone:()=>O0(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 Iw(e,t){return new M0(e,O0(t))}function N0(e){let t=e.clone();return{clone:()=>N0(t),nextTaskIndex:r=>e.nextInt(0,r.length-1)}}var T7=class extends de{constructor(e){super(),this.act=e}generate(e,t){return new D(new M0(this.act,N0(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function M7(e){let{act:t=r=>r()}=e||{};return new T7(t)}function O7(e,t){let{act:r=n=>n()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?Iw(r,e):function(n,...i){return Iw(r,i)}}function N7(e={}){return Vt(e,O("-9223372036854775808"),O("9223372036854775807"),U6,nr)}function L7(e={}){return Vt(e,O(0),O("18446744073709551615"),W6,nr)}function $7(e,t){return t}var Wc=Math.floor,D7=Math.min;function Qe(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let r=Qe(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:r.astNode},minLength:0}}case"+":{let r=Qe(e.expression,t),n=r.minLength>1?r.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:Wc(t/n)},expression:r.astNode},minLength:r.minLength}}case"?":{let r=Qe(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?Wc(t/e.quantifier.from):t,n=Qe(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:Wc(t/i)},expression:n.astNode},minLength:e.quantifier.from*n.minLength}:{astNode:{...e,expression:n.astNode},minLength:e.quantifier.from*n.minLength}}default:return $7(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=Qe(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?Qe(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=Qe(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=Qe(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=Qe(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let r=Qe(e.left,t),n=Qe(e.right,t);return r.minLength>t?n:n.minLength>t?r:{astNode:{...e,left:r.astNode,right:n.astNode},minLength:D7(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 _7(e,t){return Qe(e,t).astNode}function F7(e){return new Error(`Unsupported AST node! Received: ${xe(e)}`)}function Fs(e,t,r){if(!t&&!r)return e;let n={hasStart:!1,hasEnd:!1},i=L0(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 L0(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)=>Fs(i,t&&o===0,r&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:L0(e.expression,t,r,n)};case"Disjunction":return n.hasStart=!0,n.hasEnd=!0,{...e,left:e.left!==null?Fs(e.left,t,r):null,right:e.right!==null?Fs(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 F7(e)}}function j7(e){return Fs(e,!0,!0)}function Pw(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 gd(e){return e>="0"&&e<="9"}function $0(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 V7(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=$0(e,n):i==="("&&(r+=1)}throw new Error("Missing closing ')'")}function B7(e,t){let r=!1;for(let n=t;n!==e.length;++n){let i=e[n];if(!gd(i)){if(t===n)return-1;if(i===","){if(r)return-1;r=!0}else return i==="}"?n:-1}}return-1}function U7(e,t,r,n){switch(e[t]){case"[":return n===1?t+1:$0(e,t+1)+1;case"{":{if(n===1)return t+1;let i=B7(e,t+1);return i===-1?t+1:i+1}case"(":return n===1?t+1:V7(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(gd(i)){let o=r?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&gd(e[s]);++s);return s}return t+(r?Pw(e,t+1):1)+1}}default:return t+(r?Pw(e,t):1)}}function Os(e,t,r,n){let i=U7(e,t,r,n);return e.substring(t,i)}var Tw={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},Ks={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"},yi=Wd(Ks),Ud={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"},yd=Wd(Ud),D0={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"},Mw=Wd(D0);function Wd(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 W7(e){return e in Ud||e in yd}function z7(e){return e in Ks||e in yi}function Ow(e){if(e in Tw)return Tw[e];if(e in yi)return yi[e];if(e in Ks||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function Nw(e){if(e in yd)return yd[e];if(e in Mw)return Mw[e];if(e in yi)return yi[e];if(e in Ud||e in D0||e in Ks)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function G7(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:Ow(n),canonicalValue:Nw(i)}}if(W7(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:Nw(e)};if(z7(e)){let n=Ow(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 zc=String.fromCodePoint;function Gc(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function _0(e){return e>="0"&&e<="9"}function js(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function en(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function Xt(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 Hc(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:zc(n),value:e,codePoint:n}}case"u":{if(e==="\\u")return js("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:zc(n),value:e,codePoint:n}}case"0":return en(e,"\0");case"n":return en(e,`
133
- `);case"f":return en(e,"\f");case"r":return en(e,"\r");case"t":return en(e," ");case"v":return en(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(_0(t)){let r=e.substring(1),n=Number(r);return{type:"Char",kind:"decimal",symbol:zc(n),value:e,codePoint:n}}if(e.length>2&&(t==="p"||t==="P")){let r=t==="P";return G7(e.substring(3,e.length-1),r)}return js(e.substring(1),!0)}}return js(e)}function tn(e,t,r,n){let i=null;for(let o=0,s=Os(t,o,r,0);o!==t.length;o+=s.length,s=Os(t,o,r,0)){let a=s[0];switch(a){case"|":i===null&&(i=[]),i.push(Xt(e.splice(0),!0)||null);break;case".":e.push({type:"Char",kind:"meta",symbol:s,value:s,codePoint:NaN});break;case"*":case"+":{let l=Gc(e);e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"?":{let l=Gc(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(js(s));break}let l=Gc(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=Os(l,p,r,1);p!==l.length;p+=h.length,h=Os(l,p,r,1)){if(p===0&&h==="^"){c=!0;continue}let f=Hc(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]===":")tn(u,l.substring(2),r,n),e.push({type:"Group",capturing:!1,expression:Xt(u)});else if(l[1]==="="||l[1]==="!")tn(u,l.substring(2),r,n),e.push({type:"Assertion",kind:"Lookahead",negative:l[1]==="!"?!0:void 0,assertion:Xt(u)});else if(l[1]==="<"&&(l[2]==="="||l[2]==="!"))tn(u,l.substring(3),r,n),e.push({type:"Assertion",kind:"Lookbehind",negative:l[2]==="!"?!0:void 0,assertion:Xt(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),tn(u,c.slice(1).join(">"),r,n),e.push({type:"Group",capturing:!0,nameRaw:p,name:p,number:d,expression:Xt(u)})}else{let c=++n.lastIndex;tn(u,l,r,n),e.push({type:"Group",capturing:!0,number:c,expression:Xt(u)})}break}default:if(s==="^")e.push({type:"Assertion",kind:s});else if(s==="$")e.push({type:"Assertion",kind:s});else if(s[0]==="\\"&&_0(s[1])){let l=Number(s.substring(1));r||l<=n.lastIndex?e.push({type:"Backreference",kind:"number",number:l,reference:l}):e.push(Hc(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(Hc(s));break}}if(i!==null){i.push(Xt(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 H7(e){let t=$t([...e.flags],"u")!==-1,r=e.source,n=[];return tn(n,r,t,{lastIndex:0,named:new Map}),Xt(n)}var q7=String.fromCodePoint;function K7(e){return e.binary||e.shorthand?e.canonicalValue:`${e.canonicalName}=${e.canonicalValue}`}function Lw(e,t,r,n){let i=-1;for(let o=t;o<=r;++o)if(e.test(q7(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 Y7(e,t){let r=new RegExp(`^\\${t?"P":"p"}{${e}}$`,"u"),n=[];return Lw(r,0,55295,n),Lw(r,57344,1114111,n),n}var $w=new Map;function J7(e,t){let r=`${t?"P":"p"}:${e}`,n=$w.get(r);if(n!==void 0)return n;let i=Y7(e,t);return $w.set(r,i),i}function Z7(e){return ln(...G(J7(K7(e),e.negative),t=>Qc(t)))}var X7=String.fromCodePoint,Dw=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],_w=[..."0123456789"],Fw=[...` \r
134
- \v\f`],bd=[...`\r
135
- `],F0=[...""],Q7=[...bd,...F0],vr=()=>Ce({unit:"grapheme-ascii",minLength:1,maxLength:1});function jw(e){return new L(`Unsupported AST node! Received: ${xe(e)}`)}function Qt(e,t,r){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return wt(...Dw);case"\\W":return vr().filter(n=>$t(Dw,n)===-1);case"\\d":return wt(..._w);case"\\D":return vr().filter(n=>$t(_w,n)===-1);case"\\s":return wt(...Fw);case"\\S":return vr().filter(n=>$t(Fw,n)===-1);case"\\b":case"\\B":throw new L(`Meta character ${e.value} not implemented yet!`);case".":{let n=r.dotAll?F0:Q7;return vr().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=Qt(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 jw(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=>Qt(n,t,r))).map(n=>ce(n,""));case"CharacterClass":if(e.negative){let n=G(e.expressions,i=>Qt(i,t,r));return vr().filter(i=>Zw(n,o=>!o.canShrinkWithoutContext(i)))}return Te(...G(e.expressions,n=>Qt(n,t,r)));case"ClassRange":{let n=e.from.codePoint,i=e.to.codePoint;return ie({min:n,max:i}).map(o=>X7(o),o=>{if(typeof o!="string")throw new L("Invalid type");if([...o].length!==1)throw new L("Invalid length");return on(o,0)})}case"Group":return Qt(e.expression,t,r);case"Disjunction":return Te(e.left!==null?Qt(e.left,t,r):ve(""),e.right!==null?Qt(e.right,t,r):ve(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return r.multiline?e.kind==="^"?Te(ve(""),B(Ce({unit:vr()}),wt(...bd)).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]]})):Te(ve(""),B(wt(...bd),Ce({unit:vr()})).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 Z7(e);default:throw jw(e)}}function e8(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=j7(H7(e));r!==void 0&&(o=_7(o,r));let s=Qt(o,n,i);return r!==void 0?s.filter(a=>[...a].length<=r):s}function t8(e){let t=[];for(let r=0;r!==e.length;++r)t.push(e[r].next());return t}function r8(e,t){for(let r=0;r!==e.length;++r)t[r]=e[r].next()}function n8(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*i8(...e){let t=t8(e);for(;!n8(t);)yield t.map(r=>r.value),r8(e,t)}function*o8(e){let t=e;for(;;)yield t,++t}var s8=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(i8(this.arb.shrink(e,t),o8(r+1))).take(n).map(i=>this.valueMapper(i[0],i[1]))}valueMapper(e,t){let r={originalContext:e.context,length:t};return new D(e.value,r)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalContext"in e&&"length"in e}};function a8(e,t){return new s8(e,t)}var l8=Cb({Arbitrary:()=>de,ExecutionStatus:()=>xN,PreconditionFailure:()=>ir,Random:()=>Ed,Stream:()=>j,Value:()=>D,VerbosityLevel:()=>eN,__commitHash:()=>d8,__type:()=>u8,__version:()=>c8,anything:()=>y0,array:()=>ae,assert:()=>zN,asyncDefaultReportMessage:()=>g1,asyncModelRun:()=>I7,asyncProperty:()=>X4,asyncStringify:()=>kd,asyncToStringMethod:()=>Ft,base64String:()=>j_,bigInt:()=>nr,bigInt64Array:()=>N7,bigUint64Array:()=>L7,boolean:()=>Si,chainUntil:()=>L3,check:()=>b1,clone:()=>j3,cloneIfNeeded:()=>rn,cloneMethod:()=>Me,commands:()=>x7,compareBooleanFunc:()=>F$,compareFunc:()=>V$,configureGlobal:()=>Y4,constant:()=>ve,constantFrom:()=>wt,context:()=>I3,createDepthIdentifier:()=>Id,date:()=>T1,defaultReportMessage:()=>m1,dictionary:()=>Md,domain:()=>$d,double:()=>qs,emailAddress:()=>XL,entityGraph:()=>FD,falsy:()=>C3,float:()=>J1,float32Array:()=>i0,float64Array:()=>o0,func:()=>W$,gen:()=>QN,getDepthContextFor:()=>Ad,hasAsyncToStringMethod:()=>Rd,hasCloneMethod:()=>xr,hasToStringMethod:()=>xd,hash:()=>zs,infiniteStream:()=>O_,int16Array:()=>s0,int32Array:()=>a0,int8Array:()=>l0,integer:()=>ie,ipV4:()=>jd,ipV4Extended:()=>e0,ipV6:()=>t0,json:()=>P_,jsonValue:()=>b0,letrec:()=>r0,limitShrink:()=>a8,lorem:()=>HD,map:()=>dd,mapToConstant:()=>ln,maxSafeInteger:()=>Q1,maxSafeNat:()=>q$,memo:()=>JD,mixedCase:()=>r_,modelRun:()=>A7,nat:()=>er,noBias:()=>Ws,noShrink:()=>Gs,object:()=>k_,oneof:()=>Te,option:()=>jt,pre:()=>E6,property:()=>Q4,readConfigureGlobal:()=>ct,record:()=>cd,resetConfigureGlobal:()=>J4,sample:()=>HN,scheduledModelRun:()=>P7,scheduler:()=>M7,schedulerFor:()=>O7,set:()=>h0,shuffledSubarray:()=>z_,sparseArray:()=>p0,statistics:()=>KN,stream:()=>rr,string:()=>Ce,stringMatching:()=>e8,stringify:()=>xe,subarray:()=>W_,toStringMethod:()=>dt,tuple:()=>B,uint16Array:()=>u0,uint32Array:()=>c0,uint8Array:()=>d0,uint8ClampedArray:()=>f0,ulid:()=>X_,uniqueArray:()=>kr,uuid:()=>o7,webAuthority:()=>x0,webFragments:()=>k0,webPath:()=>C0,webQueryParameters:()=>A0,webSegment:()=>E0,webUrl:()=>b7}),u8="module",c8="4.8.0",d8="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",Oe=l8;function Ys(e){return e?.values!=null&&e.values.length>0?Oe.constantFrom(...e.values):f8(e)}function f8(e){if(e?.type==="number")return Oe.integer();if(e?.type==="boolean")return Oe.boolean();let t=e?.generator==null?void 0:h8[e.generator];if(t!=null)return t;let r=e?.constraints?.kind==="string"?e.constraints:void 0;return Oe.string({maxLength:r?.maxLength,minLength:r?.minLength??1}).filter(n=>n.trim().length>0&&n===n.trim())}var p8="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],un=e=>Oe.array(Oe.constantFrom(...p8),{maxLength:e,minLength:1}).map(t=>t.join("")),zd=(e,t)=>Oe.array(un(10),{maxLength:t,minLength:1}).map(r=>r.join(e)),h8={"company.name":zd(" ",3),"date.iso":m8(),"internet.email":g8(),"internet.url":y8(),"lorem.slug":zd("-",3),"lorem.word":un(10),"person.fullName":zd(" ",2)};function m8(){return Oe.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 g8(){return Oe.tuple(un(12),un(10),Oe.constantFrom("com","dev","io","org","ai")).map(([e,t,r])=>`${e}@${t}.${r}`)}function y8(){return Oe.tuple(Oe.constantFrom("http","https"),un(12),Oe.constantFrom("app","com","dev","io","org"),Oe.array(un(8),{maxLength:3})).map(([e,t,r,n])=>{let i=n.length===0?"":`/${n.join("/")}`;return`${e}://${t}.${r}${i}`})}var j0=new WeakMap;function Gd(e){let t=j0.get(e);if(t!=null)return t;let r=Object.fromEntries(Object.entries(e.paramSpaces).map(([n,i])=>[n,S8(i)]));return j0.set(e,r),r}var b8=24301;function S8(e){let[t]=Oe.sample(Ys(e),{numRuns:1,seed:b8});if(t==null)throw new Error("arbitrary produced no sample");return t}function wi(e){return{aborted:!0,findings:[],fired:[],teardown:e}}function qd(e,t){return new w8(v8(e,t))}async function v8({browser:e,hub:t,request:r},n){if(n.aborted)return Hd(wi("skipped"));let i=A8({lockfile:r.lockfile,options:r.options,runId:r.runId,signal:n}),o=async s=>{try{return Hd(await R8({browser:e,established:s,hub:t,request:r,signal:n}))}catch(a){return V0(vn(a))}};return C8(i,r).match(o,s=>x8(s,i.teardown))}async function x8(e,t){return e.kind!=="aborted"?V0(e):Hd(wi(await B0(t)))}function B0(e){return e().match(()=>"done",()=>"failed")}async function R8(e){let t=await k8(e);if(t.kind==="completed")return await e.established.teardown().match(no,Wp),{aborted:!1,...t.result};let r=await B0(e.established.teardown);if(t.kind==="aborted")return wi(r);throw t.error}async function k8({browser:e,established:t,hub:r,request:n,signal:i}){try{qt(i);let{close:o,driver:s,emitAssertion:a}=await Ml({baseUrl:n.options.baseUrl,browser:e,capture:n.capture?{hub:r,runId:n.runId}:null,clientState:t.clientState,engine:Al(P8(n.lockfile)),reader:t.reader,session:t.auth});try{return{kind:"completed",result:await Rl({canon:za(n.lockfile),classify:Wa(n.lockfile),driver:s,initialState:{snapshot:t.snapshot},onAssertion:a,onEvent:n.onEvent??no,sequence:n.sequence??E8(n.lockfile,n.testName,n.params),...gc(n.lockfile)},i)}}finally{await o()}}catch(o){return Jp(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function E8(e,t,r){return fo(e,t).map(n=>({params:{...Gd(n),...r},transition:n}))}function C8(e,t){return Tn(t.lockfile,t.testName,{generate:Cl(El(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(r=>({auth:r.auth,clientState:r.clientState,reader:e.reader,snapshot:r.snapshot,teardown:e.teardown}))}function A8({lockfile:e,options:t,runId:r,signal:n}){let i=$l({baseUrl:t.engineUrl,runId:r,secret:t.secret},n);return{materialize:al(i.setupWorld),reader:Ll(e.entities,I8(e),i.query),teardown:i.teardown}}function I8(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function P8(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}function N8({debugDir:e,headed:t,writeOtlpPortFile:r}){let n=om({headed:t}),i,o,s=async()=>(i??=mc({debugDir:e,writeOtlpPortFile:r}),o=await i,o),a=async(u,c)=>{if(c.aborted)return M8(wi("skipped"));try{let d=await s();return u.options.headed&&!t?await Ol(!0,async p=>qd({browser:p,hub:d,request:u},c)):await qd({browser:await n.acquire(),hub:d,request:u},c)}catch(d){return T8(vn(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 O8(a(u,c))}}function vi(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 Kd(e){return e.axes.map(t=>t.name).join("+")}function Yd(e){return{name:`counts(${e})`,classify:({pre:t})=>[...t.entities].flatMap(([r,n])=>n.size===0?[]:[[r,$8(e,n.size)]])}}function Jd(e){let t=U0(e);return{name:"enum-fields",classify:({pre:r})=>[...r.entities].flatMap(([n,i])=>[...i.values()].flatMap(o=>L8(n,o,t)))}}function L8(e,t,r){return Object.entries(t).flatMap(([n,i])=>r.has(`${e}.${n}`)?[[`${e}.${n}`,D8(i)]]:[])}function U0(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 $8(e,t){return e==="presence"?"1+":e==="unit"?t===1?"1":"2+":t<=2?String(t):"3+"}function D8(e){return e==null?"\u2205":String(e)}import{createHash as _8}from"crypto";import{appendFile as F8,mkdir as j8,readFile as V8}from"fs/promises";import B8 from"path";import{ResultAsync as z0}from"neverthrow";import{z as R}from"zod";var cn=R.enum(["crash","invariant","law","frame"]),W0=R.object({intent:R.string().min(1),test:R.string().min(1)}),U8=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)})]),G0=R.discriminatedUnion("kind",[R.object({divergence:U8,kind:R.literal("consistency"),layer:cn,step:W0.nullable()}),R.object({kind:R.literal("obligation"),layer:cn,source:R.string().min(1),step:W0}),R.object({intent:R.string().min(1),kind:R.literal("unfireable"),layer:cn,reason:R.string().min(1),test:R.string().min(1)}),R.object({error:R.string().min(1),kind:R.literal("driver-error"),layer:cn,step:R.string().min(1)}),R.object({kind:R.literal("illegal-transition"),layer:cn,step:R.string().min(1)})]),W8=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)}),z8=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:cn,parts:R.array(G0),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([Ze,R.null()])))}),G8=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(G0),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1))}),H8=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()}),q8=R.object({at:R.string().min(1),kind:R.literal("resolution"),signature:R.string().min(1)}),K8=R.object({arrangement:R.string().min(1),at:R.string().min(1),canonicalKey:R.string().min(1),kind:R.literal("derived-depot")}),Js=R.discriminatedUnion("kind",[W8,z8,G8,H8,q8,K8]);function Zs(e){return ef(e).slice(0,12)}function ze(e){return`${e.lensId} ${e.actionHash} ${e.targetKey}`}function xi(e){return e.reduce((t,r)=>e9(t,r),Q8())}function Ri(e){return z0.fromPromise(Y8(e),t=>({error:t,kind:"io"})).map(t=>Z8(t))}function Zd(e,t){let r=t.map(n=>`${JSON.stringify(n)}
136
- `).join("");return z0.fromPromise(j8(B8.dirname(e),{recursive:!0}).then(()=>F8(e,r)),n=>({error:n,kind:"io"}))}function Xd(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 ef(J({entities:n,spec:r}))}function Qd(e){return ef(J(e))}async function Y8(e){return(await V8(e,"utf8").catch(r=>{if(J8(r))return"";throw r})).split(`
137
- `).filter(r=>r.length>0)}function J8(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}function Z8(e){return e.flatMap(t=>{let r=Js.safeParse(X8(t));return r.success?[r.data]:[]})}function X8(e){try{return JSON.parse(e)}catch{return null}}function ef(e){return _8("sha256").update(e).digest("hex")}function Q8(){return{covered:new Set,findings:new Map,flaky:new Map,saturations:new Map}}function e9(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:t9(e.flaky,t)};if(t.kind==="finding")return{...e,covered:new Set([...e.covered,ze(t)]),findings:r9(e.findings,t)};if(t.kind==="resolution")return{...e,findings:n9(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 t9(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 r9(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 n9(e,t){let r=e.get(t.signature);return r==null?e:new Map([...e,[t.signature,{...r,resolvedAt:t.at}]])}function tf(e){let t={edges:new Map,saturationDepth:0,seen:new Set,states:0,targets:new Map},r=e.depots.map(n=>(t.seen.add(pr(n.snapshot)),{depot:n.name,lastLabel:null,snapshot:n.snapshot,trail:[]}));return o9(e,r,t),{edges:t.edges,saturationDepth:t.saturationDepth,states:t.seen.size,targets:t.targets}}var i9=24301,H0=new WeakMap;function Xs(e,t){let r=H0.get(e)??new Map;H0.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,d9(s,t)]));return r.set(t,i),i}function o9(e,t,r){let n=[...t],i=0;for(;i<n.length;){let o=n[i];i+=1,o!=null&&s9(e,o,r).forEach(s=>n.push(s))}}function s9(e,t,r){let n={snapshot:t.snapshot},i=o=>Xs(o,c9(t.trail,e.corpus,o));return $r(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 a9({acc:r,node:t,option:o,params:e,transition:s,witness:l}),l9({acc:r,node:t,option:o,params:e,trail:a})})}function a9({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=vi(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 l9({acc:e,node:t,option:r,params:n,trail:i}){if(i.length>=n.maxDepth)return[];let o=r.firing.next.snapshot;if(u9(t.snapshot,o,n.maxCount))return[];let s=pr(o);return e.seen.has(s)?[]:(e.seen.add(s),[{depot:t.depot,lastLabel:r.label,snapshot:o,trail:i}])}function u9(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 d9(e,t){let[r]=Oe.sample(Ys(e),{numRuns:1,seed:i9+t});if(r==null)throw new Error("arbitrary produced no sample");return r}var f9=10;function rf(e){return sf(e).reduce((t,r)=>t+K0(e,r).length,0)}function nf(e){return e.targets.size+e.edges.size}function of(e){let t=sf(e).map(o=>K0(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 sf(e){return[{entries:e.graph.targets,index:1},{entries:e.graph.edges,index:2}]}function K0(e,t){return[...t.entries].flatMap(([r,n])=>{let i=Y0({params:e,ring:t.index,targetKey:r,witness:n});return e.covered.has(J0(e,i))?[]:[i]})}function Y0({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 J0(e,t){return ze({actionHash:t.actionHash,lensId:e.lensId,targetKey:t.targetKey})}function p9(e,t){if(e.tick===0||e.tick%f9!==0)return null;let r=sf(e).flatMap(i=>[...i.entries].flatMap(([o,s])=>{let a=Y0({params:e,ring:i.index,targetKey:o,witness:s});return e.covered.has(J0(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 h9=/delete|remove|cancel|deactivate|revoke|archive/i;function q0(e,t){let r=t.ring===2&&m9(e,t)?4:0,n=h9.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 g9(e){let t=y9(e,e.witnessTrail);return t==null?{covers:[],firings:[]}:S9(e,t)}function y9(e,t){return t.reduce((r,n)=>r==null?null:b9(e,r,n),{covers:[],firings:[],snapshot:e.depotSnapshot})}function b9(e,t,r){let n=e.corpus[r.idx];if(n==null)return null;let i=On(n,{snapshot:t.snapshot},r.params);if(i==null)return null;let o=Z0({params:e,planned:r,pre:t.snapshot,transition:n});return{covers:[...t.covers,o],firings:[...t.firings,r],snapshot:i.next.snapshot}}function Z0({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:vi(e.lens,i)}}function S9(e,t){let r=new Set([...e.covered,...t.covers.map(i=>ze({...i,lensId:e.lensId}))]),n=X0({params:e,seen:r,state:t});return{covers:n.covers,firings:n.firings}}function X0({params:e,seen:t,state:r}){if(r.firings.length>=e.maxLength)return r;let n=w9({params:e,seen:t,state:r});return n==null?r:(t.add(ze({...n.coverage,lensId:e.lensId})),X0({params:e,seen:t,state:{covers:[...r.covers,n.coverage],firings:[...r.firings,n.planned],snapshot:n.snapshot}}))}function w9({params:e,seen:t,state:r}){let n=o=>Xs(o,v9(r.firings,e.corpus,o));return $r(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:Z0({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 v9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function af(e,{sweep:t}){let r=Ct(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=>x9(n))]:r}function lf(e,t,r){return Tn({...e,tests:[t.test]},t.test.name,r)}function x9(e){return R9(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 R9(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 k9(e,t){let r=await Qs({attemptIndex:0,capture:!1,firings:e.trail.firings,params:e},t);return r.kind!=="completed"?ev(r):r.findings.length===0?{kind:"clean",rows:T9(e)}:E9(e,ki(e.depot.name,r.findings),t)}function ev(e){return e.kind==="aborted"?{kind:"aborted"}:{error:e.error,kind:"error"}}async function E9(e,t,r){let n=await Qs({attemptIndex:1,capture:!1,firings:e.trail.firings,params:e},r);return n.kind!=="completed"?ev(n):ki(e.depot.name,n.findings).signature!==t.signature?{kind:"flaky",rows:[M9(e,t)]}:C9({digest:t,params:e,signal:r})}async function Qs({attemptIndex:e,capture:t,firings:r,params:n},i){let o=n.runIdFor(e);return(await n.session.runOnce({capture:t,lockfile:P9(n),onEvent:void 0,options:n.options,params:void 0,runId:o,sequence:I9(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 C9({digest:e,params:t,signal:r}){let n=await tv({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 A9({firings:n.firings,params:t,signal:r,signature:e.signature});if(i.kind==="aborted")return{kind:"aborted"};let o=$9({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 A9({firings:e,params:t,signal:r,signature:n}){let i=await Qs({attemptIndex:t.shrinkBudget+2,capture:!0,firings:e,params:t},r);return i.kind==="aborted"?{kind:"aborted"}:i.kind==="completed"&&ki(t.depot.name,i.findings).signature===n?{kind:"reproduced",runId:i.runId}:{kind:"no-repro"}}async function tv(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 rv(e,r,t)}async function rv(e,t,r){let[n,...i]=t;if(n==null||e.budget-1<0)return r;let o=await Qs({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"&&ki(e.params.depot.name,o.findings).signature===e.signature?tv({...s,firings:n}):rv(s,i,r)}function I9(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 P9(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 T9(e){return e.trail.covers.map(t=>({actionHash:t.actionHash,at:e.now(),kind:"covered",lensId:e.lensId,targetKey:t.targetKey}))}function M9(e,t){return{actionHash:uf(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:uf(e).targetKey,trail:e.trail.covers.map(r=>r.targetKey)}}function nv(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 ki(e,t){let r=t.map(i=>({line:bm(i),part:N9(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:O9(n),parts:n,signature:J({depot:e,parts:n.map(i=>J(i))})}}var Q0={crash:0,frame:3,invariant:1,law:2};function O9(e){return e.map(r=>r.layer).toSorted((r,n)=>Q0[r]-Q0[n]).at(0)??"frame"}function N9(e){let t=nv(e);switch(e.kind){case"consistency":return{divergence:L9(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 L9(e){return e.kind==="singleton-mismatch"?{kind:e.kind,singleton:e.singleton}:{entity:e.entity,kind:e.kind}}function $9({digest:e,minimal:t,params:r,runId:n}){let i=uf(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 uf(e){let t=e.trail.covers.at(-1);if(t==null)throw new Error("trail has no coverage");return t}function pK(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 hK({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 mK(e){return`ripplo daemon: ready as local executor for session ${e} (sync happens on each \`ripplo run\`; Ctrl-C to stop)`}function gK({cwd:e,pid:t}){return`ripplo daemon: another daemon is already running for this project${t==null?"":` (pid ${String(t)})`} (cwd ${e}).`}function yK(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project; shutting down."}function bK(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}; ${D9(t.progress)})`}function D9(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=_9(e);return`explore: ${t}${r}, ${String(e.findings)} findings, ${n}`}function SK(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:e.findings.map(t=>Fn(t)),kind:"findings"};case"error":return{detail:Et(e.error),kind:"error"};case"dispatch-failed":return{detail:e.reason,kind:"dispatch-error"}}}function _9(e){return e.saturated?e.deferred===0?"saturated":"waiting \u2014 every open target is deferred, retrying after cooldown":"searching"}import F9 from"p-queue";var j9=4,V9={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},ea=new F9({concurrency:j9}),Bt={headedActive:0,interactiveActive:0,interactiveQueued:0},iv={current:null};function xK({headed:e,task:t,workClass:r}){let n=V9[r];return r==="p3-explore"?ea.add(t,{priority:n}):(Bt.interactiveQueued+=1,ta(),ea.add(()=>B9({headed:e,task:t}),{priority:n}))}function RK(e){!Number.isFinite(e)||e<1||(ea.concurrency=Math.floor(e),ta())}function cf(){return{active:Bt.interactiveActive,headedActive:Bt.headedActive,poolSize:ea.concurrency,queued:Bt.interactiveQueued}}function kK(e){iv.current=e}async function B9({headed:e,task:t}){Bt.interactiveQueued-=1,Bt.interactiveActive+=1,Bt.headedActive+=e?1:0,ta();try{return await t()}finally{Bt.interactiveActive-=1,Bt.headedActive-=e?1:0,ta()}}function ta(){iv.current?.()}import df from"fs";import ff from"path";function ov(e){try{let t=U9(e);if(t==null)return;let r=ff.join(t,"HEAD"),n=df.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 U9(e){let t=ff.join(e,".git");if(df.statSync(t).isDirectory())return t;let n=df.readFileSync(t,"utf8").trim(),i="gitdir:";if(!n.startsWith(i))return;let o=n.slice(i.length).trim();if(o.length!==0)return ff.resolve(e,o)}import W9 from"crypto";import{graphql as z9}from"gql.tada";import{err as G9,ok as H9}from"neverthrow";var q9=z9(`
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(`
139
139
  mutation SyncDevSession(
140
140
  $projectId: String!
141
141
  $cwd: String!
@@ -154,13 +154,13 @@ ${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(e){let t=[];functi
154
154
  hooksPaused
155
155
  }
156
156
  }
157
- `);async function DK(e,t){let r=await Sn(e);if(r.isErr())return G9({error:r.error,kind:"compilation-failed"});let n=await pf({config:t,cwd:e,lockfile:r.value});return H9({devSessionId:n.devSessionId,lockfile:r.value})}async function pf(e){let t=K9(e.lockfile);return r5({config:e.config,cwd:e.cwd,payload:t})}function K9(e){let t=Y9(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.name,preconditions:Q9(e5(r),t),requiresKeys:r.world.map(n=>({namespace:n.as,preconditionName:n.entity})),slug:tt(r.name),sourcePath:r.sourcePath??null,spec:JSON.stringify({steps:r.steps.map((n,i)=>gn(n,i)),stub:r.stub})}))}}function Y9(e){let t=e.tests.reduce((r,n)=>J9(r,n),new Map);return new Map([...t].map(([r,n])=>[r,[...n]]))}function J9(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=Z9(o,n),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function Z9(e,t){return Object.values(e.set).flatMap(r=>X9(r)).map(r=>t.get(r)).filter(r=>r!=null&&r!==e.entity)}function X9(e){return e==null||typeof e!="object"?[]:"ref"in e?[sv(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>sv(t.ref))}function sv(e){let[t]=e.split(".");return t??e}function Q9(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 e5(e){return[...new Set(e.world.map(t=>t.entity))]}function t5(e){return W9.createHash("sha256").update(JSON.stringify(e)).digest("hex")}async function r5({config:e,cwd:t,payload:r}){let n=t5(r),i=ov(t),o=await _e({config:e,document:q9,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 y5}from"crypto";import{CancellationTokenSource as b5,ResponseError as S5}from"vscode-jsonrpc/node";import{graphql as Av}from"gql.tada";import{createMessageConnection as n5,NotificationType as av,RequestType as lv,RequestType0 as uv,SocketMessageReader as i5,SocketMessageWriter as o5}from"vscode-jsonrpc/node";import{z as v}from"zod";var s5="daemon.sock",a5="daemon.log";function BK(e){return Ut(e,s5)}function UK(e){return Ut(e,a5)}function cv(e){return n5(new i5(e),new o5(e))}var dv=v.object({all:v.boolean(),headed:v.boolean(),tests:v.array(v.string())}),WK=v.object({jobId:v.string(),total:v.number()}),l5=v.enum(["holder","standby","off"]),u5=v.object({covered:v.number(),deferred:v.number(),findings:v.number(),saturated:v.boolean(),total:v.number()}),zK=v.object({active:v.number(),explorer:l5,exploring:v.number(),progress:u5,queued:v.number()}),hf=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")})]),c5=v.discriminatedUnion("kind",[v.object({kind:v.literal("test-started"),runId:v.string(),testName:v.string()}),v.object({kind:v.literal("test-outcome"),outcome:hf,runId:v.string(),testName:v.string()})]),GK=v.object({event:c5,jobId:v.string()}),HK=v.object({failed:v.number(),jobId:v.string(),notRun:v.number(),passed:v.number()}),qK=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")})]),fv=v.object({findingId:v.string().min(1)}),KK=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()})]),pv=new lv("ripplo/exploreReplay"),hv=new lv("ripplo/enqueue"),mv=new uv("ripplo/status"),gv=new uv("ripplo/shutdownIfIdle"),yv=new av("ripplo/jobEvent"),bv=new av("ripplo/jobDone");import{err as mf,ok as Sv}from"neverthrow";function wv({all:e,ids:t,lockfile:r}){let n=r.tests.map(a=>a.name);if(e&&t.length>0)return mf({kind:"conflicting-flags"});if(e)return Sv(r.tests.filter(a=>!a.stub).map(a=>a.name));if(t.length===0)return mf({kind:"nothing-selected"});let i=new Map(n.map(a=>[tt(a),a])),o=t.map(a=>({id:a,name:n.includes(a)?a:i.get(tt(a))})),s=o.filter(a=>a.name==null).map(a=>a.id);return s.length>0?mf({kind:"unknown-ids",known:n,unknown:s}):Sv(o.flatMap(a=>a.name==null?[]:[a.name]))}import{err as gf,ok as xv}from"neverthrow";import{graphql as Rv}from"gql.tada";import{execFileSync as d5}from"child_process";function ra(e,t){return d5("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}async function kv({config:e,cwd:t,lockfile:r}){await p5({config:e,cwd:t,lockfile:r});let n=await m5(e);if(n.isErr())return gf(n.error);let i=new Map(r.tests.filter(s=>!s.stub).map(s=>[tt(s.name),s.name])),o=[...new Set(n.value)].flatMap(s=>{let a=i.get(s);return a==null?[]:[a]});return o.length===0?gf({kind:"scope-empty"}):xv(o)}var f5=Rv(`
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(`
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 p5({config:e,cwd:t,lockfile:r}){let n=new Set(g5(t)),i=r.tests.filter(o=>o.sourcePath!=null&&n.has(o.sourcePath)).map(o=>tt(o.name));i.length!==0&&await _e({config:e,document:f5,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:i}}).catch(o=>{Se.warn({err:o},"auto-scope of dirty tests failed")})}var h5=Rv(`
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(`
164
164
  query ScopeSelection($projectId: String!, $cwd: String!) {
165
165
  project(id: $projectId) {
166
166
  id
@@ -176,8 +176,8 @@ ${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(e){let t=[];functi
176
176
  }
177
177
  }
178
178
  }
179
- `);async function m5(e){try{let r=(await _e({config:e,document:h5,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession?.scopeItems??[];return xv(r.flatMap(n=>n.workflow==null?[]:[n.workflow.slug]))}catch(t){return gf({detail:t instanceof Error?t.message:String(t),kind:"scope-fetch-failed"})}}var vv=".ripplo/tests/";function g5(e){try{return ra(["status","--porcelain","--",".ripplo/tests"],e).split(`
180
- `).map(t=>t.slice(3).trim()).filter(t=>t.startsWith(vv)&&t.endsWith(".ts")).map(t=>t.slice(vv.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}catch{return[]}}var w5=12e4,v5=-32099;function x5(e){let t=new AbortController;return e.isCancellationRequested?(t.abort(),t.signal):(e.onCancellationRequested(()=>{t.abort()}),t.signal)}function bY(e){let t={...e,expectations:new Map,jobs:new Map};return{claim:r=>P5(t,r),handleConnection:r=>{R5(t,r)},idle:()=>Iv(t)}}function R5(e,t){let r=cv(t);r.onRequest(hv,(n,i)=>k5({connection:r,ctx:e,params:n,token:i})),r.onRequest(mv,()=>{let n=cf();return{active:n.active,queued:n.queued,...e.explorationStatus()}}),r.onRequest(pv,async(n,i)=>{let o=fv.safeParse(n);return o.success?(await e.ready,e.replayFinding(o.data.findingId,x5(i))):{kind:"error",reason:"bad-message"}}),r.onRequest(gv,()=>{let n=Iv(e);return n&&e.onShutdownRequest(),n}),r.onClose(()=>{E5(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 Iv(e){let t=cf();return e.jobs.size===0&&t.active===0&&t.queued===0}async function k5({connection:e,ctx:t,params:r,token:n}){let i=dv.safeParse(r);if(!i.success)throw Ev({code:"bad-message"});await t.ready;let o=await M5({config:t.config,cwd:t.cwd,message:i.data});if(o.kind==="error")throw Ev(o.error);let s=y5(),a=new b5;return n.onCancellationRequested(()=>{Pv(t,s)}),t.jobs.set(s,{cancellation:a,connection:e,failed:0,notRun:0,passed:0,total:o.testNames.length}),U5({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 Ev(e){return new S5(v5,e.code,e)}function Pv(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 E5(e,t){[...e.jobs.entries()].filter(([,r])=>r.connection===t).forEach(([r])=>{Pv(e,r)})}function Ei(e,t,r){let n=e.jobs.get(t);n!=null&&(Cv(()=>n.connection.sendNotification(yv,{event:r,jobId:t})),r.kind==="test-outcome"&&(C5(n,r.outcome.kind),n.passed+n.failed+n.notRun>=n.total&&(Cv(()=>n.connection.sendNotification(bv,{failed:n.failed,jobId:t,notRun:n.notRun,passed:n.passed})),e.jobs.delete(t))))}function Cv(e){e().catch(t=>{Se.warn({err:t},"ipc notification failed")})}function C5(e,t){if(t==="pass"){e.passed+=1;return}if(t==="dispatch-error"||t==="infra-error"){e.notRun+=1;return}e.failed+=1}function Tv(e,t){let n=e.expectations.get(t)?.shift();return n==null?null:(clearTimeout(n.timer),n)}function A5(e,t){let{headed:r,jobId:n,slug:i,testName:o}=t,s=setTimeout(()=>{I5({ctx:e,jobId:n,slug:i,testName:o,timer:s})},w5);e.expectations.set(i,[...e.expectations.get(i)??[],{headed:r,jobId:n,testName:o,timer:s}])}function I5({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)),Ei(e,t,{kind:"test-outcome",outcome:{detail:"dispatch-timeout",kind:"dispatch-error"},runId:"",testName:n}))}function P5(e,t){let r=Tv(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)=>{Ei(e,r.jobId,{kind:"test-outcome",outcome:o,runId:i,testName:r.testName})},started:i=>{Ei(e,r.jobId,{kind:"test-started",runId:i,testName:r.testName})}}}function T5(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 M5({config:e,cwd:t,message:r}){return(await cp(t)).match(i=>O5({config:e,cwd:t,lockfile:i,message:r}),i=>Promise.resolve({error:{code:"compile-failed",detail:i.kind,diagnostics:[...T5(i)]},kind:"error"}))}async function O5({config:e,cwd:t,lockfile:r,message:n}){let i=await L5(e.appUrl);if(i!=null)return{error:{code:"app-unreachable",detail:i,url:e.appUrl},kind:"error"};let o=await $5({config:e,cwd:t,lockfile:r});return o!=null?{error:{code:"sync-failed",detail:o},kind:"error"}:(await D5({config:e,cwd:t,lockfile:r,message:n})).match(async a=>({kind:"ready",testNames:a,workflowIdsBySlug:await V5(e,t)}),a=>Promise.resolve({error:a,kind:"error"}))}var N5=2e3;async function L5(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(N5)}),null}catch(t){return t instanceof Error?t.message:String(t)}}async function $5(e){try{return await pf(e),null}catch(t){return t instanceof Error?t.message:String(t)}}async function D5({config:e,cwd:t,lockfile:r,message:n}){return!n.all&&n.tests.length===0?(await kv({config:e,cwd:t,lockfile:r})).mapErr(_5):wv({all:n.all,ids:n.tests,lockfile:r}).mapErr(F5)}function _5(e){return e.kind==="scope-empty"?{code:"selection-nothing-selected"}:{code:"scope-failed",detail:e.detail}}function F5(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 j5=Av(`
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(`
181
181
  query DaemonWorkflows($projectId: String!, $cwd: String!) {
182
182
  project(id: $projectId) {
183
183
  id
@@ -190,7 +190,7 @@ ${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(e){let t=[];functi
190
190
  }
191
191
  }
192
192
  }
193
- `);async function V5(e,t){let n=(await _e({config:e,document:j5,variables:{cwd:t,projectId:e.projectId}})).project?.devSession?.workflows??[];return new Map(n.map(i=>[i.slug,i.id]))}var B5=Av(`
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
194
  mutation DaemonCreateRun($workflowId: String!) {
195
195
  createRun(workflowId: $workflowId, executor: local) {
196
196
  __typename
@@ -199,34 +199,34 @@ ${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(e){let t=[];functi
199
199
  }
200
200
  }
201
201
  }
202
- `);async function U5(e){await e.testNames.reduce((t,r)=>t.then(()=>W5(e,r)),Promise.resolve())}async function W5(e,t){let{ctx:r,headed:n,jobId:i,token:o,workflowIdsBySlug:s}=e;if(o.isCancellationRequested)return;let a=tt(t),l=s.get(a);if(l==null){Ei(r,i,{kind:"test-outcome",outcome:{detail:"workflow-not-found",kind:"dispatch-error"},runId:"",testName:t});return}A5(r,{headed:n,jobId:i,slug:a,testName:t});let u=await z5(r.config,l);u!=null&&(Tv(r,a),Ei(r,i,{kind:"test-outcome",outcome:u,runId:"",testName:t}))}async function z5(e,t){try{let n=(await _e({config:e,document:B5,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 Cr?{detail:r.message,kind:"infra-error"}:{detail:r instanceof Error?r.message:String(r),kind:"dispatch-error"}}}function G5(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 wY(e){let t={active:new Map,backoffUntil:0,cancelBackoffTimer:null,cancelHeartbeat:null,holder:!1,prevInteractiveActive:e.probe().interactiveActive,stopped:!1};return Nv(t,e),{explorationActive:()=>t.active.size,explorerHolder:()=>t.holder,notifyQueueChange:()=>{H5(t,e)},setExplorerHolder:r=>{t.holder=r,Ci(t,e)},stop:()=>{t.stopped=!0,t.cancelBackoffTimer?.(),t.cancelBackoffTimer=null,t.cancelHeartbeat?.(),t.cancelHeartbeat=null,Lv(t,t.active.size)}}}function Nv(e,t){e.stopped||(e.cancelHeartbeat=t.setTimer(()=>{Ci(e,t),Nv(e,t)},15e3))}function Ci(e,t){if(e.stopped)return;let r=t.probe(),n=G5({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});Lv(e,n.abortCount),$v({count:n.refillCount,params:t,state:e})}function Lv(e,t){[...e.active.values()].slice(0,t).forEach(({controller:r})=>{r.abort()})}function H5(e,t){let r=t.probe();r.interactiveActive<e.prevInteractiveActive&&q5(e,t),e.prevInteractiveActive=r.interactiveActive,Ci(e,t)}function q5(e,t){e.backoffUntil=t.now()+3e4,e.cancelBackoffTimer?.(),e.cancelBackoffTimer=t.setTimer(()=>{e.cancelBackoffTimer=null,Ci(e,t)},3e4)}function $v({count:e,params:t,state:r}){if(e<=0)return;let n=K5(t.sources);n!=null&&(Y5({params:t,pulled:n,state:r}),$v({count:e-1,params:t,state:r}))}function K5(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 Y5({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(()=>{Ov({job:n,outcome:Mv(o.signal,null),params:e,source:i,state:r})}).catch(s=>{Ov({job:n,outcome:Mv(o.signal,{error:s}),params:e,source:i,state:r})})}function Mv(e,t){return e.aborted?{kind:"aborted"}:t==null?{kind:"completed"}:{error:t.error,kind:"error"}}function Ov({job:e,outcome:t,params:r,source:n,state:i}){i.active.delete(e.id),n.onResult(e,t),Ci(i,r)}import J5 from"fs";import Z5 from"path";async function IY(e){let t=Z5.join(e,".ripplo","index.ts");if(!J5.existsSync(t))return{appUrl:void 0,engineUrl:void 0,errors:[{message:".ripplo/index.ts not found",path:""}],valid:!1,warnings:[]};let r=await Sn(e);return r.isErr()?{appUrl:void 0,engineUrl:void 0,errors:[{message:Qi(r.error),path:".ripplo/"}],valid:!1,warnings:[]}:Vi().match(n=>({appUrl:n.appUrl,engineUrl:n.engineUrl,errors:[],valid:!0,warnings:[]}),n=>({appUrl:void 0,engineUrl:void 0,errors:[{message:Da(n),path:""}],valid:!1,warnings:[]}))}async function PY(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 TY({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 tF from"fs";import X5 from"fs";import yf from"path";var Q5=["MERGE_HEAD","rebase-merge","rebase-apply","CHERRY_PICK_HEAD","REVERT_HEAD"];function Dv(e){let t=eF(e);return t==null?!1:Q5.some(r=>X5.existsSync(yf.join(t,r)))}function eF(e){try{let t=ra(["rev-parse","--git-dir"],e).trim();return t.length===0?null:yf.isAbsolute(t)?t:yf.resolve(e,t)}catch{return null}}function rF(e){return Ut(e,"hooks-paused")}function VY(e){return tF.existsSync(rF(e))||Dv(e)?!1:xp(e)}import nF from"fs";import{lockSync as iF}from"proper-lockfile";var oF="explorer.lock",sF=15e3,aF=15e3;function lF(){return ur(oF)}function GY({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=uF(r);o!=null&&(t.release=o,e(!0))};n();let i=setInterval(n,aF);return{holder:()=>t.release!=null,stop:()=>{t.stopped=!0,clearInterval(i),t.release?.(),t.release=null}}}function uF(e){try{pn();let t=lF(),r=iF(t,{onCompromised:e,realpath:!1,stale:sF});return nF.writeFileSync(t,String(process.pid)),()=>{try{r()}catch{}}}catch{return null}}import cF from"path";import{randomUUID as dF}from"crypto";function _v(e){return{axes:[Yd("unit"),Jd(e)]}}var Fv=12,jv=15,Vv=4,Bv=2,Uv=18e4;var Gv={covered:0,deferred:0,findings:0,saturated:!1,total:0};function eJ(){return{priority:"p3",next:()=>null,onResult:()=>{},ready:()=>Promise.resolve(),status:()=>Gv,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=bf(e,t);return{priority:"p3",next:()=>gF(e,t),onResult:()=>{},ready:()=>r,status:()=>t.prepared==null?Gv:hF(t.prepared,t),stop:()=>Promise.resolve()}}async function bf(e,t){if(!t.preparing){t.preparing=!0;try{let r=await e.loadLockfile();if(r==null)return;let n=await fF(r);if(n==null)return;await Ri(Kv(e.cwd)).match(i=>{let o=xi(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 fF({fingerprint:e,lockfile:t}){let r=_v(t),n=Lr(t);if(n.length===0)return null;let i=af(t,{sweep:!1}),o=await pF(t,i),s=tf({corpus:n,depots:o,lens:r,maxCount:Bv,maxDepth:Vv});return{actionHashes:n.map(a=>Xd(t,a)),corpus:n,depots:i,fingerprint:e,graph:s,lens:r,lensIdValue:Kd(r),lockfile:t,lockfileHashValue:Qd(t)}}async function pF(e,t){let r={generate:Dr,materialize:sl(Dr,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await lf(e,i,r)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}var Wv=20,Hv=6e5,zv=3e5;function hF(e,t){let r=nf(e.graph),n=rf({actionHashes:e.actionHashes,corpus:e.corpus,covered:t.covered,graph:e.graph,lensId:e.lensIdValue,tick:t.tick});return{covered:r-n,deferred:Zv(t).size,findings:t.findings,saturated:t.saturated,total:r}}async function mF(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 bf(e,t)}finally{t.refreshing=!1}}}function gF(e,t){mF(e,t);let r=t.prepared;if(r==null||Date.now()<t.haltedUntil)return null;let n=of({actionHashes:r.actionHashes,corpus:r.corpus,covered:new Set([...t.covered,...t.claimed,...Zv(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=EF(r,n.target);return t.claimed.add(i),{firings:yF(r,n.target),id:`explore:${dF()}`,label:n.target.targetKey,path:qv(r,n.target),run:o=>bF({choice:n.target,key:i,params:e,prepared:r,signal:o,state:t})}}function yF(e,t){return t.witness.trail.flatMap(r=>{let n=e.corpus[r.idx];return n==null?[]:[{actions:[...n.nav,...n.steps].map(i=>Vl(i.action)),label:`${n.test}#${String(n.index)}`}]})}function qv(e,t){return t.witness.trail.map(r=>{let n=e.corpus[r.idx];return n==null?"?":`${n.test}#${String(n.index)}`}).join(" -> ")}async function bF({choice:e,key:t,params:r,prepared:n,signal:i,state:o}){try{let s=wF({choice:e,prepared:n});if(s==null)return;if(!await r.probeApp()){Jv(o,"app-unreachable");return}let a=AbortSignal.timeout(Uv),l=await r.executeTrail(s,AbortSignal.any([i,a]));if(l.kind==="aborted"){xF({deadline:a,key:t,signal:i,state:o});return}if(l.kind==="error"){RF({key:t,params:r,reason:l.reason,state:o});return}o.consecutiveErrors=0,Se.info("exploration trail %s: %s @ %s",l.kind,qv(n,e),e.targetKey.slice(0,80)),await vF({outcome:SF(l,e,n),params:r,state:o})}finally{o.claimed.delete(t)}}function SF(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 wF({choice:e,prepared:t}){let r=t.depots.find(n=>n.name===e.witness.depot);return r==null?null:{depotTest:r.test,firings:e.witness.trail.map(n=>({idx:n.idx,params:n.params})),lensId:t.lensIdValue,lockfileFingerprint:t.fingerprint,lockfileHash:t.lockfileHashValue,maxLength:Fv,shrinkBudget:jv}}async function vF({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 Zd(Kv(t.cwd),n).match(()=>{},i=>{Se.warn("explore ledger append failed: %s",i.kind)})}function Kv(e){return cF.join(e,".ripplo",".local","explore-ledger.jsonl")}function xF({deadline:e,key:t,signal:r,state:n}){e.aborted&&!r.aborted&&(Yv(n,t),Se.warn("exploration trail timed out, target deferred for %ds",Hv/1e3))}function RF({key:e,params:t,reason:r,state:n}){if(r==="lockfile:fingerprint-mismatch"){kF(t,n);return}Yv(n,e),Jv(n,r)}function kF(e,t){t.preparing||(t.prepared=null,bf(e,t))}function Yv(e,t){e.deferred.set(t,Date.now()+Hv)}function Jv(e,t){e.consecutiveErrors+=1,Se.debug("exploration trail error: %s",t),e.consecutiveErrors>=Wv&&(e.haltedUntil=Date.now()+zv,e.consecutiveErrors=0,Se.warn("exploration cooling down for %ds after %d consecutive trail errors (last: %s)",zv/1e3,Wv,t))}function Zv(e){let t=Date.now();return[...e.deferred].filter(([,r])=>r<=t).forEach(([r])=>e.deferred.delete(r)),new Set(e.deferred.keys())}function EF(e,t){return ze({actionHash:t.actionHash,lensId:e.lensIdValue,targetKey:t.targetKey})}import CF from"path";var AF=3;function oJ(e){return Ri(IF(e)).map(t=>PF(xi(t)))}function IF(e){return CF.join(e,".ripplo",".local","explore-ledger.jsonl")}function PF(e){let t=[...e.findings.entries()].filter(([,n])=>n.resolvedAt==null).map(([n,i])=>TF(n,i)).toSorted(OF),r=[...e.flaky.entries()].filter(([,n])=>n.occurrences>=AF).map(([n,i])=>MF(n,i)).toSorted((n,i)=>i.occurrences-n.occurrences);return{pending:t,recurrentFlaky:r}}function TF(e,t){let r=t.latest;return{depot:r.depot,evidence:r.evidence,firstSeen:t.first.at,id:Zs(e),lastSeen:r.at,occurrences:t.occurrences,oracleLayer:r.oracleLayer,parts:r.parts,runId:r.runId,trail:r.trail}}function MF(e,t){return{at:t.first.at,depot:t.first.depot,id:Zs(e),occurrences:t.occurrences,trail:t.first.trail}}var Xv={crash:0,frame:3,invariant:1,law:2};function OF(e,t){let r=Xv[e.oracleLayer]-Xv[t.oracleLayer];return r===0?t.occurrences-e.occurrences:r}import{gzip as NF}from"zlib";import{promisify as LF}from"util";import{existsSync as $F,readFileSync as DF}from"fs";import ex from"path";import{graphql as Ai}from"gql.tada";function Qv(e){return[e.kind,e.target,e.value].filter(t=>t.length>0).join(" ")}async function yJ({config:e,cwd:t,headed:r,lockfile:n,runId:i,session:o,signal:s,test:a}){if(!await qF(e,i))return{kind:"dispatch-failed",reason:"already-claimed",runId:i};let u=ex.join(t,".ripplo","debug"),c=[];return(await o.runOnce({capture:!0,lockfile:n,options:{baseUrl:e.appUrl,engineUrl:e.engineUrl,generate:Dr,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 _F({config:e,debugDir:u,events:c,runId:i,test:a,total:p.fired.length});let h=tx(c).flatMap(f=>f.findings);return h.length>0?{findings:h,kind:"findings",runId:i}:{kind:"pass",runId:i}},async p=>(await zF(e,i,Et(p)),{error:p,kind:"error",runId:i}))}async function _F({config:e,debugDir:t,events:r,runId:n,test:i}){let o=tx(r),s=FF(t,n);await Promise.all([BF({config:e,origin:s?.origin??0,records:o,runId:n,test:i}),s==null?Promise.resolve():GF(e,n,s)]),await HF(e,n,o)}function tx(e){return e.flatMap(t=>t.kind==="step"?[{endMs:t.endMs,findings:t.findings,index:t.index,startMs:t.startMs}]:[])}function FF(e,t){let r=ex.join(e,t,"behavior.jsonl");if(!$F(r))return null;let n=DF(r,"utf8").split(`
203
- `).filter(o=>o.length>0).map(o=>jF(o)).flatMap(o=>VF(o)?[o.event]:[]),i=n[0];return i==null?null:{events:n,origin:i.timestamp}}function jF(e){return JSON.parse(e)}function VF(e){return typeof e=="object"&&e!=null&&Reflect.get(e,"kind")==="rrweb"}async function BF({config:e,origin:t,records:r,runId:n,test:i}){let o=r.map(s=>UF({origin:t,record:s,test:i}));await _e({config:e,document:YF,variables:{items:[{runId:n,steps:o}]}})}function UF({origin:e,record:t,test:r}){let n=r.steps[t.index],i=n==null?null:gn(n,t.index);return{assertions:t.findings.map(o=>({description:Fn(o),detail:null,status:"failed"})),detail:null,duration:Math.max(0,t.endMs-t.startMs),nodeType:i?.kind??"step",recordingEndMs:Math.max(0,t.endMs-e),recordingStartMs:Math.max(0,t.startMs-e),rrwebIds:[],snapshotTimestamp:Math.max(0,t.endMs-e),status:t.findings.length>0?"failed":"passed",stepIndex:t.index,title:i==null?`step ${String(t.index)}`:Qv(i),url:""}}var WF=LF(NF);async function zF(e,t,r){await _e({config:e,document:XF,variables:{reason:r,runId:t}}).catch(n=>{Se.error(n,"failRun submission failed")})}async function GF(e,t,r){let n=r.events.map(s=>JSON.stringify(s)).join(`
204
- `),i=await WF(Buffer.from(n,"utf8")),o=r.events.at(-1);await _e({config:e,document:JF,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 HF(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:ZF,variables:{items:[{duration:o,failCount:n,passCount:i,runId:t,status:n>0?"failed":"passed",summary:null,warnCount:0}]}})}async function qF(e,t){return((await _e({config:e,document:KF,variables:{runIds:[t]}})).startRunsBatch??[]).some(n=>n.id===t)}var KF=Ai(`
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(`
205
205
  mutation StartRunsBatch($runIds: [String!]!) {
206
206
  startRunsBatch(runIds: $runIds) {
207
207
  id
208
208
  }
209
209
  }
210
- `),YF=Ai(`
210
+ `),fj=Ci(`
211
211
  mutation SubmitRunStepsBatch($items: [SubmitRunStepsItem!]!) {
212
212
  submitRunStepsBatch(items: $items)
213
213
  }
214
- `),JF=Ai(`
214
+ `),pj=Ci(`
215
215
  mutation SubmitRunRecordingChunk($input: SubmitRunRecordingChunkInput!) {
216
216
  submitRunRecordingChunk(input: $input)
217
217
  }
218
- `),ZF=Ai(`
218
+ `),hj=Ci(`
219
219
  mutation CompleteRunsBatch($items: [CompleteRunItem!]!) {
220
220
  completeRunsBatch(items: $items) {
221
221
  id
222
222
  status
223
223
  }
224
224
  }
225
- `),XF=Ai(`
225
+ `),mj=Ci(`
226
226
  mutation FailRun($runId: String!, $reason: String!) {
227
227
  failRun(runId: $runId, reason: $reason)
228
228
  }
229
- `);import{createMessageConnection as rx,IPCMessageReader as nx,IPCMessageWriter as ix,NotificationType as QF,NotificationType0 as ox,RequestType as Sf}from"vscode-jsonrpc/node";import{z as _}from"zod";var kJ=_.object({headed:_.boolean(),lockfileFingerprint:_.string(),runId:_.string().min(1),workflowSlug:_.string().min(1)}),EJ=_.object({fingerprint:_.string()}),CJ=_.object({lockfileJson:_.string().optional(),unavailable:_.string().optional()}),ej=_.enum(["unspecified","internal","server","client","producer","consumer"]),tj=_.enum(["unset","ok","error"]),rj=_.object({attributes:_.record(_.string(),_.string()),durationMs:_.number(),kind:_.literal("span"),name:_.string(),parentSpanId:_.union([_.string(),_.undefined()]),source:_.literal("server"),spanId:_.string(),spanKind:ej,status:_.object({code:tj,message:_.union([_.string(),_.undefined()])}),timeNanos:_.string(),traceId:_.string()}),AJ=_.object({runId:_.string().min(1),span:rj}),IJ=_.object({outcome:hf,serverNotified:_.boolean()}),PJ=_.object({depotTest:Gi,firings:_.array(_.object({idx:_.number().int().nonnegative(),params:_.record(_.string(),_.union([Ze,_.null()]))})),lensId:_.string().min(1),lockfileFingerprint:_.string(),lockfileHash:_.string().min(1),maxLength:_.number().int().positive(),shrinkBudget:_.number().int().nonnegative()}),TJ=_.object({kind:_.enum(["aborted","clean","error","flaky","finding"]),reason:_.string().optional(),rows:_.array(Js)}),MJ=new ox("worker/ready"),OJ=new Sf("worker/run"),NJ=new Sf("worker/lockfile"),LJ=new Sf("worker/exploreTrail"),$J=new QF("worker/span"),DJ=new ox("worker/shutdown");function _J(e){let t=rx(new nx(e),new ix(e));return t.listen(),t}function FJ(){let e=rx(new nx(process),new ix(process));return e.listen(),e}export{mx as a,Se as b,kx as c,Cr as d,Ex as e,_e as f,aa as g,Ut as h,ur as i,ua as j,zx as k,Gx as l,Vx as m,eR as n,tR as o,Gj as p,Qj as q,Vi as r,uR as s,fR as t,pR as u,ER as v,tt as w,Xi as x,FR as y,Sn as z,Tr as A,WV as B,Qi as C,qV as D,KV as E,YV as F,tB as G,Da as H,hp as I,gp as J,hB as K,xp as L,ja as M,SB as N,ra as O,Dv as P,IY as Q,PY as R,TY as S,sl as T,Lr as U,$C as V,VC as W,Dr as X,W as Y,aI as Z,lI as _,Va as $,gc as aa,N8 as ba,Zs as ca,xi as da,Ri as ea,Zd as fa,Xd as ga,Qd as ha,g9 as ia,af as ja,lf as ka,k9 as la,rF as ma,VY as na,GY as oa,_v as pa,eJ as qa,tJ as ra,oJ as sa,IF as ta,BK as ua,UK as va,cv as wa,WK as xa,zK as ya,GK as za,HK as Aa,qK as Ba,KK as Ca,pv as Da,hv as Ea,mv as Fa,gv as Ga,yv as Ha,bv as Ia,pK as Ja,hK as Ka,mK as La,gK as Ma,yK as Na,bK as Oa,D9 as Pa,SK as Qa,xK as Ra,RK as Sa,cf as Ta,kK as Ua,ov as Va,DK as Wa,pf as Xa,x5 as Ya,bY as Za,yJ as _a,zF as $a,kJ as ab,EJ as bb,AJ as cb,IJ as db,PJ as eb,TJ as fb,MJ as gb,OJ as hb,NJ as ib,LJ as jb,$J as kb,DJ as lb,_J as mb,FJ as nb,wY as ob};
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};
230
230
  /*! Bundled license information:
231
231
 
232
232
  rrweb/dist/rrweb.js: