ripplo 0.7.8 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- var px=Object.create;var Pf=Object.defineProperty;var hx=Object.getOwnPropertyDescriptor;var mx=Object.getOwnPropertyNames;var gx=Object.getPrototypeOf,yx=Object.prototype.hasOwnProperty;var kr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var bx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of mx(t))!yx.call(e,i)&&i!==r&&Pf(e,i,{get:()=>t[i],enumerable:!(n=hx(t,i))||n.enumerable});return e};var Pi=(e,t,r)=>(r=e!=null?px(gx(e)):{},bx(t||!e||!e.__esModule?Pf(r,"default",{value:e,enumerable:!0}):r,e));var _f=kr(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.timingSafeEqual=void 0;function Df(e,t=""){if(!e)throw new Error(t)}function Xx(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),Df(e instanceof DataView),Df(t instanceof DataView);let r=e.byteLength,n=0,i=-1;for(;++i<r;)n|=e.getUint8(i)^t.getUint8(i);return n===0}Mi.timingSafeEqual=Xx});var Vf=kr(He=>{"use strict";var Qx=He&&He.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(He,"__esModule",{value:!0});var Ae=256,fa=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var r="",n=0;n<t.length-2;n+=3){var i=t[n]<<16|t[n+1]<<8|t[n+2];r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),r+=this._encodeByte(i>>>6&63),r+=this._encodeByte(i>>>0&63)}var o=t.length-n;if(o>0){var i=t[n]<<16|(o===2?t[n+1]<<8:0);r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),o===2?r+=this._encodeByte(i>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(t),n=t.length-r,i=new Uint8Array(this.maxDecodedLength(n)),o=0,s=0,a=0,l=0,u=0,c=0,d=0;s<n-4;s+=4)l=this._decodeChar(t.charCodeAt(s+0)),u=this._decodeChar(t.charCodeAt(s+1)),c=this._decodeChar(t.charCodeAt(s+2)),d=this._decodeChar(t.charCodeAt(s+3)),i[o++]=l<<2|u>>>4,i[o++]=u<<4|c>>>2,i[o++]=c<<6|d,a|=l&Ae,a|=u&Ae,a|=c&Ae,a|=d&Ae;if(s<n-1&&(l=this._decodeChar(t.charCodeAt(s)),u=this._decodeChar(t.charCodeAt(s+1)),i[o++]=l<<2|u>>>4,a|=l&Ae,a|=u&Ae),s<n-2&&(c=this._decodeChar(t.charCodeAt(s+2)),i[o++]=u<<4|c>>>2,a|=c&Ae),s<n-3&&(d=this._decodeChar(t.charCodeAt(s+3)),i[o++]=c<<6|d,a|=d&Ae),a!==0)throw new Error("Base64Coder: incorrect characters for decoding");return i},e.prototype._encodeByte=function(t){var r=t;return r+=65,r+=25-t>>>8&6,r+=51-t>>>8&-75,r+=61-t>>>8&-15,r+=62-t>>>8&3,String.fromCharCode(r)},e.prototype._decodeChar=function(t){var r=Ae;return r+=(42-t&t-44)>>>8&-Ae+t-43+62,r+=(46-t&t-48)>>>8&-Ae+t-47+63,r+=(47-t&t-58)>>>8&-Ae+t-48+52,r+=(64-t&t-91)>>>8&-Ae+t-65+0,r+=(96-t&t-123)>>>8&-Ae+t-97+26,r},e.prototype._getPaddingLength=function(t){var r=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)r++;if(t.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},e})();He.Coder=fa;var hn=new fa;function eR(e){return hn.encode(e)}He.encode=eR;function tR(e){return hn.decode(e)}He.decode=tR;var Ff=(function(e){Qx(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},t.prototype._decodeChar=function(r){var n=Ae;return n+=(44-r&r-46)>>>8&-Ae+r-45+62,n+=(94-r&r-96)>>>8&-Ae+r-95+63,n+=(47-r&r-58)>>>8&-Ae+r-48+52,n+=(64-r&r-91)>>>8&-Ae+r-65+0,n+=(96-r&r-123)>>>8&-Ae+r-97+26,n},t})(fa);He.URLSafeCoder=Ff;var jf=new Ff;function rR(e){return jf.encode(e)}He.encodeURLSafe=rR;function nR(e){return jf.decode(e)}He.decodeURLSafe=nR;He.encodedLength=function(e){return hn.encodedLength(e)};He.maxDecodedLength=function(e){return hn.maxDecodedLength(e)};He.decodedLength=function(e){return hn.decodedLength(e)}});var Uf=kr((Bf,Oi)=>{"use strict";(function(e,t){var r={};t(r);var n=r.default;for(var i in r)n[i]=r[i];typeof Oi=="object"&&typeof Oi.exports=="object"?Oi.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):e.sha256=n})(Bf,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(d,p,h,f,m){for(var g,S,w,y,x,E,N,I,M,C,V,Z,X;m>=64;){for(g=p[0],S=p[1],w=p[2],y=p[3],x=p[4],E=p[5],N=p[6],I=p[7],C=0;C<16;C++)V=f+C*4,d[C]=(h[V]&255)<<24|(h[V+1]&255)<<16|(h[V+2]&255)<<8|h[V+3]&255;for(C=16;C<64;C++)M=d[C-2],Z=(M>>>17|M<<15)^(M>>>19|M<<13)^M>>>10,M=d[C-15],X=(M>>>7|M<<25)^(M>>>18|M<<14)^M>>>3,d[C]=(Z+d[C-7]|0)+(X+d[C-16]|0);for(C=0;C<64;C++)Z=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&E^~x&N)|0)+(I+(t[C]+d[C]|0)|0)|0,X=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&S^g&w^S&w)|0,I=N,N=E,E=x,x=y+Z|0,y=w,w=S,S=g,g=Z+X|0;p[0]+=g,p[1]+=S,p[2]+=w,p[3]+=y,p[4]+=x,p[5]+=E,p[6]+=N,p[7]+=I,f+=64,m-=64}return f}var n=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var p=0;p<this.buffer.length;p++)this.buffer[p]=0;for(var p=0;p<this.temp.length;p++)this.temp[p]=0;this.reset()},d.prototype.update=function(p,h){if(h===void 0&&(h=p.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this.bytesHashed+=h,this.bufferLength>0){for(;this.bufferLength<64&&h>0;)this.buffer[this.bufferLength++]=p[f++],h--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(h>=64&&(f=r(this.temp,this.state,p,f,h),h%=64);h>0;)this.buffer[this.bufferLength++]=p[f++],h--;return this},d.prototype.finish=function(p){if(!this.finished){var h=this.bytesHashed,f=this.bufferLength,m=h/536870912|0,g=h<<3,S=h%64<56?64:128;this.buffer[f]=128;for(var w=f+1;w<S-8;w++)this.buffer[w]=0;this.buffer[S-8]=m>>>24&255,this.buffer[S-7]=m>>>16&255,this.buffer[S-6]=m>>>8&255,this.buffer[S-5]=m>>>0&255,this.buffer[S-4]=g>>>24&255,this.buffer[S-3]=g>>>16&255,this.buffer[S-2]=g>>>8&255,this.buffer[S-1]=g>>>0&255,r(this.temp,this.state,this.buffer,0,S),this.finished=!0}for(var w=0;w<8;w++)p[w*4+0]=this.state[w]>>>24&255,p[w*4+1]=this.state[w]>>>16&255,p[w*4+2]=this.state[w]>>>8&255,p[w*4+3]=this.state[w]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var h=0;h<this.state.length;h++)p[h]=this.state[h]},d.prototype._restoreState=function(p,h){for(var f=0;f<this.state.length;f++)this.state[f]=p[f];this.bytesHashed=h,this.finished=!1,this.bufferLength=0},d})();e.Hash=n;var i=(function(){function d(p){this.inner=new n,this.outer=new n,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var h=new Uint8Array(this.blockSize);if(p.length>this.blockSize)new n().update(p).finish(h).clean();else for(var f=0;f<p.length;f++)h[f]=p[f];for(var f=0;f<h.length;f++)h[f]^=54;this.inner.update(h);for(var f=0;f<h.length;f++)h[f]^=106;this.outer.update(h),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var f=0;f<h.length;f++)h[f]=0}return d.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},d.prototype.clean=function(){for(var p=0;p<this.istate.length;p++)this.ostate[p]=this.istate[p]=0;this.inner.clean(),this.outer.clean()},d.prototype.update=function(p){return this.inner.update(p),this},d.prototype.finish=function(p){return this.outer.finished?this.outer.finish(p):(this.inner.finish(p),this.outer.update(p,this.digestLength).finish(p)),this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d})();e.HMAC=i;function o(d){var p=new n().update(d),h=p.digest();return p.clean(),h}e.hash=o,e.default=o;function s(d,p){var h=new i(d).update(p),f=h.digest();return h.clean(),f}e.hmac=s;function a(d,p,h,f){var m=f[0];if(m===0)throw new Error("hkdf: cannot expand more");p.reset(),m>1&&p.update(d),h&&p.update(h),p.update(f),p.finish(d),f[0]++}var l=new Uint8Array(e.digestLength);function u(d,p,h,f){p===void 0&&(p=l),f===void 0&&(f=32);for(var m=new Uint8Array([1]),g=s(p,d),S=new i(g),w=new Uint8Array(S.digestLength),y=w.length,x=new Uint8Array(f),E=0;E<f;E++)y===w.length&&(a(w,S,h,m),y=0),x[E]=w[y++];return S.clean(),w.fill(0),m.fill(0),x}e.hkdf=u;function c(d,p,h,f){for(var m=new i(d),g=m.digestLength,S=new Uint8Array(4),w=new Uint8Array(g),y=new Uint8Array(g),x=new Uint8Array(f),E=0;E*g<f;E++){var N=E+1;S[0]=N>>>24&255,S[1]=N>>>16&255,S[2]=N>>>8&255,S[3]=N>>>0&255,m.reset(),m.update(p),m.update(S),m.finish(y);for(var I=0;I<g;I++)w[I]=y[I];for(var I=2;I<=h;I++){m.reset(),m.update(y).finish(y);for(var M=0;M<g;M++)w[M]^=y[M]}for(var I=0;I<g&&E*g+I<f;I++)x[E*g+I]=w[I]}for(var E=0;E<g;E++)w[E]=y[E]=0;for(var E=0;E<4;E++)S[E]=0;return m.clean(),x}e.pbkdf2=c})});var ha=kr(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.Webhook=Cr.WebhookVerificationError=void 0;var iR=_f(),Wf=Vf(),oR=Uf(),zf=300,pa=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Wt=class e extends pa{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};Cr.WebhookVerificationError=Wt;var Ni=class e{constructor(t,r){if(!t)throw new Error("Secret can't be empty.");if(r?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,n=>n.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=Wf.decode(t)}}verify(t,r){let n={};for(let p of Object.keys(r))n[p.toLowerCase()]=r[p];let i=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!i||!s)throw new Wt("Missing required headers");let a=this.verifyTimestamp(s),u=this.sign(i,a,t).split(",")[1],c=o.split(" "),d=new globalThis.TextEncoder;for(let p of c){let[h,f]=p.split(",");if(h==="v1"&&(0,iR.timingSafeEqual)(d.encode(f),d.encode(u)))return JSON.parse(t.toString())}throw new Wt("No matching signature found")}sign(t,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=i.encode(`${t}.${o}.${n}`);return`v1,${Wf.encode(oR.hmac(this.key,s))}`}verifyTimestamp(t){let r=Math.floor(Date.now()/1e3),n=parseInt(t,10);if(isNaN(n))throw new Wt("Invalid Signature Headers");if(r-n>zf)throw new Wt("Message timestamp too old");if(n>r+zf)throw new Wt("Message timestamp too new");return new Date(n*1e3)}};Cr.Webhook=Ni;Ni.prefix="whsec_"});var Qp=kr((Xa,Xp)=>{"use strict";var{hasOwnProperty:xn}=Object.prototype,cr=Za();cr.configure=Za;cr.stringify=cr;cr.default=cr;Xa.stringify=cr;Xa.configure=Za;Xp.exports=cr;var Fk=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Gt(e){return e.length<5e3&&!Fk.test(e)?`"${e}"`:JSON.stringify(e)}function Ya(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var jk=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Ja(e){return jk.call(e)!==void 0&&e.length!==0}function Jp(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let o=1;o<r;o++)i+=`${t}"${o}":${n}${e[o]}`;return i}function Vk(e){if(xn.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function Bk(e){let t;if(xn.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function Uk(e,t){let r;if(xn.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function Zp(e,t){let r;if(xn.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function ur(e){return e===1?"1 item":`${e} items`}function Wk(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function zk(e){if(xn.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Za(e){e={...e};let t=zk(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=Vk(e),n=Uk(e,"bigint"),i=Bk(e),o=typeof i=="function"?i:void 0,s=Zp(e,"maximumDepth"),a=Zp(e,"maximumBreadth");function l(h,f,m,g,S,w){let y=f[h];switch(typeof y=="object"&&y!==null&&typeof y.toJSON=="function"&&(y=y.toJSON(h)),y=g.call(f,h,y),typeof y){case"string":return Gt(y);case"object":{if(y===null)return"null";if(m.indexOf(y)!==-1)return r;let x="",E=",",N=w;if(Array.isArray(y)){if(y.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(y),S!==""&&(w+=S,x+=`
2
+ var fx=Object.create;var Mf=Object.defineProperty;var px=Object.getOwnPropertyDescriptor;var hx=Object.getOwnPropertyNames;var mx=Object.getPrototypeOf,gx=Object.prototype.hasOwnProperty;var kr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var yx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of hx(t))!gx.call(e,i)&&i!==r&&Mf(e,i,{get:()=>t[i],enumerable:!(n=px(t,i))||n.enumerable});return e};var Pi=(e,t,r)=>(r=e!=null?fx(mx(e)):{},yx(t||!e||!e.__esModule?Mf(r,"default",{value:e,enumerable:!0}):r,e));var jf=kr(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.timingSafeEqual=void 0;function Ff(e,t=""){if(!e)throw new Error(t)}function Zx(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)),Ff(e instanceof DataView),Ff(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=Zx});var Uf=kr(He=>{"use strict";var Xx=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,pa=(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=pa;var hn=new pa;function Qx(e){return hn.encode(e)}He.encode=Qx;function eR(e){return hn.decode(e)}He.decode=eR;var Vf=(function(e){Xx(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})(pa);He.URLSafeCoder=Vf;var Bf=new Vf;function tR(e){return Bf.encode(e)}He.encodeURLSafe=tR;function rR(e){return Bf.decode(e)}He.decodeURLSafe=rR;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 zf=kr((Wf,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})(Wf,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 ma=kr(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.Webhook=Cr.WebhookVerificationError=void 0;var nR=jf(),Gf=Uf(),iR=zf(),Hf=300,ha=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 ha{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=Gf.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,nR.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,${Gf.encode(iR.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>Hf)throw new Wt("Message timestamp too old");if(n>r+Hf)throw new Wt("Message timestamp too new");return new Date(n*1e3)}};Cr.Webhook=Ni;Ni.prefix="whsec_"});var th=kr((Qa,eh)=>{"use strict";var{hasOwnProperty:xn}=Object.prototype,cr=Xa();cr.configure=Xa;cr.stringify=cr;cr.default=cr;Qa.stringify=cr;Qa.configure=Xa;eh.exports=cr;var _k=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Gt(e){return e.length<5e3&&!_k.test(e)?`"${e}"`:JSON.stringify(e)}function Ja(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 Fk=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Za(e){return Fk.call(e)!==void 0&&e.length!==0}function Xp(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 jk(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 Vk(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 Bk(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 Qp(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 Uk(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function Wk(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 Xa(e){e={...e};let t=Wk(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=jk(e),n=Bk(e,"bigint"),i=Vk(e),o=typeof i=="function"?i:void 0,s=Qp(e,"maximumDepth"),a=Qp(e,"maximumBreadth");function l(h,f,m,g,S,w){let y=f[h];switch(typeof y=="object"&&y!==null&&typeof y.toJSON=="function"&&(y=y.toJSON(h)),y=g.call(f,h,y),typeof y){case"string":return Gt(y);case"object":{if(y===null)return"null";if(m.indexOf(y)!==-1)return r;let x="",E=",",N=w;if(Array.isArray(y)){if(y.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(y),S!==""&&(w+=S,x+=`
3
3
  ${w}`,E=`,
4
4
  ${w}`);let X=Math.min(y.length,a),F=0;for(;F<X-1;F++){let pt=l(String(F),y,m,g,S,w);x+=pt!==void 0?pt:"null",x+=E}let $e=l(String(F),y,m,g,S,w);if(x+=$e!==void 0?$e:"null",y.length-1>a){let pt=y.length-a-1;x+=`${E}"... ${ur(pt)} not stringified"`}return S!==""&&(x+=`
5
5
  ${N}`),m.pop(),`[${x}]`}let I=Object.keys(y),M=I.length;if(M===0)return"{}";if(s<m.length+1)return'"[Object]"';let C="",V="";S!==""&&(w+=S,E=`,
6
- ${w}`,C=" ");let Z=Math.min(M,a);i&&!Ja(y)&&(I=Ya(I,o)),m.push(y);for(let X=0;X<Z;X++){let F=I[X],$e=l(F,y,m,g,S,w);$e!==void 0&&(x+=`${V}${Gt(F)}:${C}${$e}`,V=E)}if(M>a){let X=M-a;x+=`${V}"...":${C}"${ur(X)} not stringified"`,V=E}return S!==""&&V.length>1&&(x=`
6
+ ${w}`,C=" ");let Z=Math.min(M,a);i&&!Za(y)&&(I=Ja(I,o)),m.push(y);for(let X=0;X<Z;X++){let F=I[X],$e=l(F,y,m,g,S,w);$e!==void 0&&(x+=`${V}${Gt(F)}:${C}${$e}`,V=E)}if(M>a){let X=M-a;x+=`${V}"...":${C}"${ur(X)} not stringified"`,V=E}return S!==""&&V.length>1&&(x=`
7
7
  ${w}${x}
8
8
  ${N}`),m.pop(),`{${x}}`}case"number":return isFinite(y)?String(y):t?t(y):"null";case"boolean":return y===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(y);default:return t?t(y):void 0}}function u(h,f,m,g,S,w){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(h)),typeof f){case"string":return Gt(f);case"object":{if(f===null)return"null";if(m.indexOf(f)!==-1)return r;let y=w,x="",E=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f),S!==""&&(w+=S,x+=`
9
9
  ${w}`,E=`,
@@ -15,106 +15,106 @@ ${y}`),m.pop(),`{${x}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";
15
15
  ${S}`,V=`,
16
16
  ${S}`,Z=Math.min(f.length,a),X=0;for(;X<Z-1;X++){let $e=c(String(X),f[X],m,g,S);C+=$e!==void 0?$e:"null",C+=V}let F=c(String(X),f[X],m,g,S);if(C+=F!==void 0?F:"null",f.length-1>a){let $e=f.length-a-1;C+=`${V}"... ${ur($e)} not stringified"`}return C+=`
17
17
  ${w}`,m.pop(),`[${C}]`}let y=Object.keys(f),x=y.length;if(x===0)return"{}";if(s<m.length+1)return'"[Object]"';S+=g;let E=`,
18
- ${S}`,N="",I="",M=Math.min(x,a);Ja(f)&&(N+=Jp(f,E,a),y=y.slice(f.length),M-=f.length,I=E),i&&(y=Ya(y,o)),m.push(f);for(let C=0;C<M;C++){let V=y[C],Z=c(V,f[V],m,g,S);Z!==void 0&&(N+=`${I}${Gt(V)}: ${Z}`,I=E)}if(x>a){let C=x-a;N+=`${I}"...": "${ur(C)} not stringified"`,I=E}return I!==""&&(N=`
18
+ ${S}`,N="",I="",M=Math.min(x,a);Za(f)&&(N+=Xp(f,E,a),y=y.slice(f.length),M-=f.length,I=E),i&&(y=Ja(y,o)),m.push(f);for(let C=0;C<M;C++){let V=y[C],Z=c(V,f[V],m,g,S);Z!==void 0&&(N+=`${I}${Gt(V)}: ${Z}`,I=E)}if(x>a){let C=x-a;N+=`${I}"...": "${ur(C)} not stringified"`,I=E}return I!==""&&(N=`
19
19
  ${S}${N}
20
- ${w}`),m.pop(),`{${N}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function d(h,f,m){switch(typeof f){case"string":return Gt(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(h),typeof f!="object")return d(h,f,m);if(f===null)return"null"}if(m.indexOf(f)!==-1)return r;let g="",S=f.length!==void 0;if(S&&Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f);let N=Math.min(f.length,a),I=0;for(;I<N-1;I++){let C=d(String(I),f[I],m);g+=C!==void 0?C:"null",g+=","}let M=d(String(I),f[I],m);if(g+=M!==void 0?M:"null",f.length-1>a){let C=f.length-a-1;g+=`,"... ${ur(C)} not stringified"`}return m.pop(),`[${g}]`}let w=Object.keys(f),y=w.length;if(y===0)return"{}";if(s<m.length+1)return'"[Object]"';let x="",E=Math.min(y,a);S&&Ja(f)&&(g+=Jp(f,",",a),w=w.slice(f.length),E-=f.length,x=","),i&&(w=Ya(w,o)),m.push(f);for(let N=0;N<E;N++){let I=w[N],M=d(I,f[I],m);M!==void 0&&(g+=`${x}${Gt(I)}:${M}`,x=",")}if(y>a){let N=y-a;g+=`${x}"...":"${ur(N)} not stringified"`}return m.pop(),`{${g}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function p(h,f,m){if(arguments.length>1){let g="";if(typeof m=="number"?g=" ".repeat(Math.min(m,10)):typeof m=="string"&&(g=m.slice(0,10)),f!=null){if(typeof f=="function")return l("",{"":h},[],f,g,"");if(Array.isArray(f))return u("",h,[],Wk(f),g,"")}if(g.length!==0)return c("",h,[],g,"")}return d("",h,[])}return p}});var ym=kr((az,Ul)=>{"use strict";var vo=process||{},mm=vo.argv||[],wo=vo.env||{},fI=!(wo.NO_COLOR||mm.includes("--no-color"))&&(!!wo.FORCE_COLOR||mm.includes("--color")||vo.platform==="win32"||(vo.stdout||{}).isTTY&&wo.TERM!=="dumb"||!!wo.CI),pI=(e,t,r=e)=>n=>{let i=""+n,o=i.indexOf(t,e.length);return~o?e+hI(i,t,r,o)+t:e+i+t},hI=(e,t,r,n)=>{let i="",o=0;do i+=e.substring(o,n)+r,o=n+t.length,n=e.indexOf(t,o);while(~n);return i+e.substring(o)},gm=(e=fI)=>{let t=e?pI:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Ul.exports=gm();Ul.exports.createColors=gm});import{execFileSync as Sx}from"child_process";import wx from"fs";import Ti from"path";function vx(e){let t=Rx(e);return t??Tf(e)}function Tf(e){let t=Ti.dirname(e);return xx(Ti.join(e,".ripplo"))?e:t===e?null:Tf(t)}function xx(e){try{return wx.statSync(e).isDirectory()}catch{return!1}}function Rx(e){let t=kx(["rev-parse","--show-toplevel"],e);if(t==null)return null;let r=t.trim();return r.length===0?null:Ti.isAbsolute(r)?r:Ti.resolve(e,r)}function kx(e,t){try{return Sx("git",e,{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]})}catch{return null}}import Ex from"pino";import Cx from"pino-pretty";var Se=Ex({level:process.env.LOG_LEVEL??"info"},Cx({ignore:"pid,hostname"}));import{readdir as Ax,rm as Ix,stat as Px}from"fs/promises";import Nf from"path";var Mf=Nf.join(process.cwd(),".ripplo","debug"),Of=360*60*1e3;async function Tx({maxRuns:e}){try{let r=(await Ax(Mf,{withFileTypes:!0})).filter(u=>u.isDirectory()),n=Date.now(),i=await Promise.all(r.map(async u=>{let c=Nf.join(Mf,u.name),d=await Px(c);return{dirPath:c,mtime:d.mtimeMs}})),o=i.filter(u=>n-u.mtime>Of),a=i.filter(u=>n-u.mtime<=Of).toSorted((u,c)=>c.mtime-u.mtime).slice(e),l=[...o,...a];if(l.length===0)return;await Promise.allSettled(l.map(u=>Ix(u.dirPath,{force:!0,recursive:!0}))),Se.debug("Pruned %d old debug run(s)",l.length)}catch{Se.warn("Debug run pruning failed, ignoring")}}var Er=class extends Error{detail;serverUrl;constructor({detail:t,serverUrl:r}){super(`Failed to connect to Ripplo server at ${r}. Check the server is running and reachable. Details: ${t}`),this.name="GqlConnectionError",this.detail=t,this.serverUrl=r}},cn=class extends Error{errors;constructor(t){super(t.map(r=>r.message).join(", ")),this.name="GqlRequestError",this.errors=t}};function Mx(e){if(e instanceof cn)return e.errors[0]?.extensions?.code}async function _e(e){let{print:t}=await import("graphql"),r=t(e.document),n=JSON.stringify({query:r,variables:e.variables}),i=`${e.config.ripploServerUrl}/graphql`,o=await Ox({init:{body:n,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json"},method:"POST"},serverUrl:e.config.ripploServerUrl,url:i}),s=await $x({res:o,url:i});if(!Dx(s))throw new Error("Invalid GraphQL response");if(_x(s))throw new cn(s.errors);if(s.data==null)throw new Error("No data returned from server");return s.data}async function Ox({init:e,serverUrl:t,url:r}){let n=1,i=await Lf({init:e,url:r});for(;i.retryable&&n<3;)await Lx(Nx(n)),n+=1,i=await Lf({init:e,url:r});if(i.response!=null)return i.response;throw new Er({detail:i.detail,serverUrl:t})}async function Lf({init:e,url:t}){try{let r=await fetch(t,{...e,signal:AbortSignal.timeout(15e3)});return{detail:"",response:r,retryable:r.status>=500}}catch(r){return{detail:r instanceof Error?r.message:String(r),response:void 0,retryable:!0}}}function Nx(e){return 300*3**(e-1)*(.5+Math.random())}function Lx(e){return new Promise(t=>{setTimeout(t,e)})}async function $x({res:e,url:t}){let r=await e.text();if(r.length===0)throw new Error(`Empty response from Ripplo server at ${t} (status ${String(e.status)}). The server may have restarted or the request was rejected before a body was sent.`);try{return JSON.parse(r)}catch{throw new Error(`Non-JSON response from Ripplo server at ${t} (status ${String(e.status)}): ${r.slice(0,200)}`)}}function Dx(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function _x(e){return Array.isArray(e.errors)&&e.errors.length>0}import{Agent as Fx,RetryAgent as jx,setGlobalDispatcher as Vx}from"undici";var Bx=1500,Ux=4e3,Wx=3,zx=50,Gx=100,$f=!1;function Hx(){if($f)return;$f=!0;let e=new Fx({connections:Gx,keepAliveMaxTimeout:Ux,keepAliveTimeout:Bx}),t=new jx(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:Wx,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:zx});Vx(t)}import pn from"fs";import ar from"fs";import qx from"os";import dn from"path";var Kx=".local",Yx=".ripplo";function la(e){return dn.join(e,".ripplo",Kx)}function ua(e){let t=la(e);ar.existsSync(t)||ar.mkdirSync(t,{recursive:!0});let r=dn.join(t,".gitignore");return ar.existsSync(r)||ar.writeFileSync(r,`*
21
- `),t}function Ut(e,t){return dn.join(la(e),t)}function ca(){return dn.join(qx.homedir(),Yx)}function fn(){let e=ca();return ar.existsSync(e)?ar.chmodSync(e,448):ar.mkdirSync(e,{mode:448,recursive:!0}),e}function lr(e){return dn.join(ca(),e)}function da(){let e=process.env.RIPPLO_TOKEN;if(e!=null&&e.trim().length>0)return e.trim();let t=lr("token");if(!pn.existsSync(t))return null;let r=pn.readFileSync(t,"utf8").trim();return r.length===0?null:r}function Jx(e){fn(),pn.writeFileSync(lr("token"),e+`
22
- `,{mode:384})}function Zx(){let e=lr("token");return pn.existsSync(e)?(pn.unlinkSync(e),!0):!1}var Hf=Pi(ha(),1);import Gf from"crypto";function sR({body:e,secret:t}){let r=new Hf.Webhook(t),n=`msg_${Gf.randomUUID()}`,i=new Date,o=r.sign(n,i,e),s=Math.floor(i.getTime()/1e3);return{"webhook-id":n,"webhook-signature":o,"webhook-timestamp":String(s)}}function aR(){return`whsec_${Gf.randomBytes(24).toString("base64")}`}import Yf from"fs";import Fi from"path";import{config as fR}from"dotenv";import{z as Di}from"zod";import{err as pR,ok as Jf}from"neverthrow";import $i from"fs";import ya from"path";import{err as ma,ok as qf}from"neverthrow";import{z as Li}from"zod";var lR=ya.join(".ripplo","project.json"),ga=[".env",".env.local"],uR=Li.object({envFiles:Li.array(Li.string().min(1)).optional(),projectId:Li.string().min(1)});function Kf(e){return ya.join(e,lR)}function ba(e){let t=Kf(e);return $i.existsSync(t)?cR(t).andThen(r=>{let n=uR.safeParse(r);return n.success?qf({envFiles:n.data.envFiles??ga,projectId:n.data.projectId}):ma({issues:n.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`),kind:"project-file-invalid",path:t})}):ma({kind:"project-file-missing",path:t})}function Sa(e){return ba(e).match(t=>t,()=>{})}function cR(e){try{return qf(JSON.parse($i.readFileSync(e,"utf8")))}catch(t){return ma({issues:[t instanceof Error?t.message:String(t)],kind:"project-file-invalid",path:e})}}function pV({cwd:e,envFiles:t,projectId:r}){let n=Kf(e);$i.mkdirSync(ya.dirname(n),{recursive:!0});let i={projectId:r};t!=null&&!dR(t)&&(i.envFiles=[...t]),$i.writeFileSync(n,JSON.stringify(i,null,2)+`
23
- `)}function dR(e){return e.length!==ga.length?!1:e.every((t,r)=>t===ga[r])}function vV(e){let r=Sa(e)?.envFiles??[".env",".env.local"],n=Fi.join(e,".ripplo");r.forEach(i=>{let o=Fi.resolve(n,i);Yf.existsSync(o)&&fR({override:!0,path:o,quiet:!0})}),_i=void 0}var hR=Di.object({RIPPLO_APP_URL:Di.url(),RIPPLO_ENGINE_URL:Di.url(),RIPPLO_WEBHOOK_SECRET:Di.string().min(1)}),_i;function ji(){return _i!=null?Jf(_i):gR().map(e=>(_i=e,e))}function mR(e){let r=Sa(e)?.envFiles??[],n=Fi.join(e,".ripplo");return r.map(i=>Fi.resolve(n,i)).filter(i=>!Yf.existsSync(i))}function gR(){let e=hR.safeParse(process.env);if(!e.success)return pR({issues:e.error.issues.map(r=>`${r.path.join(".")}: ${r.message}`),kind:"env-invalid",missingEnvFiles:mR(process.cwd())});let t=e.data;return Jf({appUrl:t.RIPPLO_APP_URL,engineUrl:t.RIPPLO_ENGINE_URL,webhookSecret:t.RIPPLO_WEBHOOK_SECRET})}import{readFileSync as yR}from"fs";import{z as Zf}from"zod";var bR=Zf.object({version:Zf.string()});function wa(){let e=yR(new URL("../package.json",import.meta.url),"utf8");return bR.parse(JSON.parse(e)).version}import{z as Vi}from"zod";var SR=Vi.object({__codec:Vi.string().min(1),data:Vi.unknown(),version:Vi.number().int().positive()}),Bi=class extends Error{codec;currentVersion;gotVersion;constructor(t){super(`Unsupported ${t.codec} version ${String(t.gotVersion)} (current ${String(t.currentVersion)}). Upgrade Ripplo or rebuild with a compatible CLI.`),this.name="CodecVersionError",this.codec=t.codec,this.currentVersion=t.currentVersion,this.gotVersion=t.gotVersion}},Ui=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}};function va({name:e,schema:t}){return{currentVersion:1,name:e,decode:r=>xR({name:e,raw:r,schema:t}),encode:r=>({__codec:e,data:r,version:1})}}function wR(e,t){return JSON.stringify(e.encode(t))}function vR(e,t){let r=JSON.parse(t);return e.decode(r)}function xR({name:e,raw:t,schema:r}){let n=SR.parse(t);if(n.__codec!==e)throw new Ui({expected:e,got:n.__codec});if(n.version!==1)throw new Bi({codec:e,currentVersion:1,gotVersion:n.version});return r.parse(n.data)}import{z as P}from"zod";import{z as A}from"zod";var xa=A.enum(["fast","slow","async"]),Ar=A.object({ref:A.string().min(1)}),Xe=A.union([A.string(),A.number(),A.boolean()]),Ra=A.object({template:A.array(A.union([A.string(),Ar])).min(1)}),Ue=A.union([Ar,Xe,Ra,A.null()]),Xf=A.object({kind:A.literal("changed")}),ka=A.union([Ue,Xf]),xt=A.union([A.string(),Ar,Ra]),RR=A.object({by:A.literal("role"),name:A.union([xt,A.undefined()]).optional().transform(e=>e),role:A.string().min(1)}),kR=A.object({by:A.literal("testId"),value:xt}),ER=A.object({by:A.literal("inside"),scope:A.lazy(()=>Re),target:A.lazy(()=>Re)}),Re=A.discriminatedUnion("by",[RR,kR,ER]),Wi=A.enum(["string","number","boolean"]),Ea=A.enum(["strict","eventual"]),CR=A.object({kind:A.literal("string"),maxLength:A.number().int().positive().optional(),minLength:A.number().int().nonnegative().optional(),pattern:A.string().optional()}),AR=A.object({kind:A.literal("number"),max:A.number().int().optional(),min:A.number().int().optional()}),IR=A.object({kind:A.literal("datetime"),maxOffsetDays:A.number().int(),minOffsetDays:A.number().int()}),Qf=A.discriminatedUnion("kind",[CR,AR,IR]),ep=A.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),Ca=A.object({constraints:Qf.optional(),generator:ep,name:A.string().min(1),type:Wi,values:A.array(Xe).min(1).optional()}),tp=A.object({consistency:Ea.default("strict"),optional:A.boolean(),stable:A.boolean(),type:Wi,valueSpace:A.string().min(1).optional()}),Aa=A.enum(["backend","client"]),Ia=A.object({description:A.string().optional(),identity:A.array(A.string().min(1)).min(1),identityKind:A.enum(["surrogate","natural"]),name:A.string().min(1),props:A.record(A.string().min(1),tp),source:Aa.default("backend")}),Pa=A.object({consistency:Ea.default("strict"),default:Xe,description:A.string().optional(),name:A.string().min(1),source:Aa.default("backend"),type:Wi,valueSpace:A.string().min(1).optional()}),Rt=A.enum(["url","title","viewport"]);import{z as T}from"zod";var PR=T.discriminatedUnion("kind",[T.object({as:T.string().min(1),kind:T.literal("created"),props:T.record(T.string().min(1),Ue)}),T.object({as:T.string().min(1),kind:T.literal("updated"),props:T.record(T.string().min(1),ka)}),T.object({kind:T.literal("deleted")})]),TR=T.object({kind:T.literal("is"),value:Ue}),rp=T.lazy(()=>T.union([Ue,OR])),MR=T.object({entity:T.string().min(1),where:T.record(T.string().min(1),rp)}),OR=T.object({field:T.string().min(1),kind:T.literal("within"),selection:MR}),kt=T.union([xa,T.undefined()]).optional().transform(e=>e),zt=T.lazy(()=>T.discriminatedUnion("kind",[T.object({kind:T.literal("visible"),locator:Re,wait:kt}),T.object({kind:T.literal("disabled"),locator:Re,wait:kt}),T.object({kind:T.literal("enabled"),locator:Re,wait:kt}),T.object({kind:T.literal("focused"),locator:Re,wait:kt}),T.object({kind:T.literal("value"),locator:Re,value:xt,wait:kt}),T.object({kind:T.literal("text"),locator:Re,value:xt,wait:kt}),T.object({assertion:TR,kind:T.literal("singleton"),singleton:T.string().min(1),wait:kt}),T.object({kind:T.literal("browser"),name:Rt,value:xt,wait:kt}),T.object({assertion:PR,entity:T.string().min(1),key:T.record(T.string().min(1),rp),kind:T.literal("state"),wait:kt}),T.object({kind:T.literal("not"),predicate:zt}),T.object({kind:T.literal("and"),predicates:T.array(zt)}),T.object({entity:T.string().min(1),kind:T.literal("count"),value:T.number().int().nonnegative()}),T.object({condition:zt,consequence:zt,kind:T.literal("when"),otherwise:T.union([zt,T.undefined()]).optional().transform(e=>e)})]));var np=P.discriminatedUnion("kind",[P.object({kind:P.literal("goto"),url:xt}),P.object({kind:P.literal("fill"),locator:Re,value:Ue}),P.object({kind:P.literal("clear"),locator:Re}),P.object({kind:P.literal("click"),locator:Re}),P.object({kind:P.literal("dblclick"),locator:Re}),P.object({kind:P.literal("select"),locator:Re,value:Ue}),P.object({kind:P.literal("check"),locator:Re}),P.object({kind:P.literal("uncheck"),locator:Re}),P.object({kind:P.literal("hover"),locator:Re}),P.object({files:P.array(P.string().min(1)).min(1),kind:P.literal("upload"),locator:Re}),P.object({key:P.string().min(1),kind:P.literal("press"),locator:Re.optional()})]),ip=P.object({action:np,expect:P.array(zt).default([])}),op=P.object({example:Xe.optional(),valueSpace:P.string().min(1)}),Ta=P.object({as:P.string().min(1),entity:P.string().min(1),set:P.record(P.string().min(1),Ue)}),sp=P.object({entity:P.string().min(1),where:P.record(P.string().min(1),Ue)}),zi=P.object({absent:P.array(sp).default([]),exclusive:P.array(P.string().min(1)).default([]),intent:P.string().min(1),maybe:P.array(Ta).default([]),name:P.string().min(1),params:P.record(P.string().min(1),op),singletons:P.record(P.string().min(1),Ue).default({}),sourcePath:P.string().min(1).optional(),steps:P.array(ip).default([]),stub:P.boolean().default(!1),world:P.array(Ta).default([])}),ap=P.object({sha256:P.string().regex(/^[0-9a-f]{64}$/u),size:P.number().int().nonnegative()}),Gi=P.object({entities:P.array(Ia),fixtures:P.record(P.string().min(1),ap).default({}),singletons:P.array(Pa).default([]),tests:P.array(zi),valueSpaces:P.array(Ca)}),NR=va({name:"ripplo-lockfile",schema:Gi});var Hi="__ripplo__",Ma="__ripplo_seed__";import{z as mn}from"zod";var LR=mn.object({index:mn.number().int().nonnegative(),kind:mn.string(),target:mn.string(),value:mn.string()});function Oa(e,t){return{index:t,kind:e.action.kind,target:$R(e.action),value:DR(e.action)}}function rt(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function $R(e){return e.kind==="goto"?qi(e.url):e.kind==="press"&&e.locator==null?"":Ki(e.locator)}function qi(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join("")}function Ki(e){return e.by==="testId"?`testId=${qi(e.value)}`:e.by==="inside"?`${Ki(e.scope)} \u25B8 ${Ki(e.target)}`:`${e.role} ${e.name==null?"":qi(e.name)}`.trim()}function DR(e){return e.kind==="fill"||e.kind==="select"?_R(e.value):e.kind==="press"?e.key:""}function _R(e){return e==null?"":typeof e!="object"?String(e):qi(e)}import{z as ke}from"zod";var lp=ke.enum(["Strict","Lax","None"]),up=ke.object({domain:ke.string().min(1),expires:ke.number(),httpOnly:ke.boolean(),name:ke.string().min(1),path:ke.string().min(1),sameSite:lp,secure:ke.boolean(),value:ke.string()}),cp=ke.object({localStorage:ke.array(ke.object({name:ke.string().min(1),value:ke.string()})),origin:ke.string().min(1)}),Na=ke.object({cookies:ke.array(up),headers:ke.record(ke.string().min(1),ke.string()).optional(),origins:ke.array(cp)});import{z as K}from"zod";var La=K.union([Xe,K.null()]),$a=K.record(K.string().min(1),La),dp=K.object({as:K.string().min(1),entity:K.string().min(1),fields:K.record(K.string().min(1),Ue)}),FR=K.object({entities:K.array(dp),runId:K.string().min(1),singletons:K.record(K.string().min(1),La).default({})}),fp=K.object({as:K.string().min(1),row:$a,session:Na.optional()}),Da=K.object({rows:K.array(fp)}),jR=K.object({entities:K.array(K.string().min(1)),runId:K.string().min(1),singletons:K.array(K.string().min(1)).default([])}),_a=K.object({entities:K.record(K.string().min(1),K.array($a)),singletons:K.record(K.string().min(1),La).default({})}),VR=K.object({runId:K.string().min(1)}),Fa=K.object({ok:K.literal(!0)});import ja from"fs";import Yi from"path";import{createJiti as GR}from"jiti";import{err as Ji,ok as hp}from"neverthrow";import BR from"fs";import gn from"path";import Ir from"typescript";function pp(e){let t=gn.join(e,"index.ts"),r=zR(e);BR.mkdirSync(gn.dirname(r.tsBuildInfoFile??""),{recursive:!0});let n=Ir.createIncrementalCompilerHost(r),i=Ir.createIncrementalProgram({host:n,options:r,rootNames:[t]}),o=[...i.getSyntacticDiagnostics(),...i.getSemanticDiagnostics()];i.emit();let s=o.filter(u=>UR(u,e));if(s.length===0)return{diagnostics:[],ok:!0};let a={getCanonicalFileName:u=>u,getCurrentDirectory:()=>gn.dirname(e),getNewLine:()=>`
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&&Za(f)&&(g+=Xp(f,",",a),w=w.slice(f.length),E-=f.length,x=","),i&&(w=Ja(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,[],Uk(f),g,"")}if(g.length!==0)return c("",h,[],g,"")}return d("",h,[])}return p}});var Sm=kr((lz,Wl)=>{"use strict";var vo=process||{},ym=vo.argv||[],wo=vo.env||{},dI=!(wo.NO_COLOR||ym.includes("--no-color"))&&(!!wo.FORCE_COLOR||ym.includes("--color")||vo.platform==="win32"||(vo.stdout||{}).isTTY&&wo.TERM!=="dumb"||!!wo.CI),fI=(e,t,r=e)=>n=>{let i=""+n,o=i.indexOf(t,e.length);return~o?e+pI(i,t,r,o)+t:e+i+t},pI=(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)},bm=(e=dI)=>{let t=e?fI:()=>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")}};Wl.exports=bm();Wl.exports.createColors=bm});import{execFileSync as bx}from"child_process";import Sx from"fs";import Ti from"path";function wx(e){let t=xx(e);return t??Of(e)}function Of(e){let t=Ti.dirname(e);return vx(Ti.join(e,".ripplo"))?e:t===e?null:Of(t)}function vx(e){try{return Sx.statSync(e).isDirectory()}catch{return!1}}function xx(e){let t=Rx(["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 Rx(e,t){try{return bx("git",e,{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]})}catch{return null}}import kx from"pino";import Ex from"pino-pretty";var Se=kx({level:process.env.LOG_LEVEL??"info"},Ex({ignore:"pid,hostname"}));import{readdir as Cx,rm as Ax,stat as Ix}from"fs/promises";import $f from"path";var Nf=$f.join(process.cwd(),".ripplo","debug"),Lf=360*60*1e3;async function Px({maxRuns:e}){try{let r=(await Cx(Nf,{withFileTypes:!0})).filter(u=>u.isDirectory()),n=Date.now(),i=await Promise.all(r.map(async u=>{let c=$f.join(Nf,u.name),d=await Ix(c);return{dirPath:c,mtime:d.mtimeMs}})),o=i.filter(u=>n-u.mtime>Lf),a=i.filter(u=>n-u.mtime<=Lf).toSorted((u,c)=>c.mtime-u.mtime).slice(e),l=[...o,...a];if(l.length===0)return;await Promise.allSettled(l.map(u=>Ax(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 Tx(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 Mx({init:{body:n,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json"},method:"POST"},serverUrl:e.config.ripploServerUrl,url:i}),s=await Lx({res:o,url:i});if(!$x(s))throw new Error("Invalid GraphQL response");if(Dx(s))throw new cn(s.errors);if(s.data==null)throw new Error("No data returned from server");return s.data}async function Mx({init:e,serverUrl:t,url:r}){let n=1,i=await Df({init:e,url:r});for(;i.retryable&&n<3;)await Nx(Ox(n)),n+=1,i=await Df({init:e,url:r});if(i.response!=null)return i.response;throw new Er({detail:i.detail,serverUrl:t})}async function Df({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 Ox(e){return 300*3**(e-1)*(.5+Math.random())}function Nx(e){return new Promise(t=>{setTimeout(t,e)})}async function Lx({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 $x(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function Dx(e){return Array.isArray(e.errors)&&e.errors.length>0}import{Agent as _x,RetryAgent as Fx,setGlobalDispatcher as jx}from"undici";var Vx=1500,Bx=4e3,Ux=3,Wx=50,zx=100,_f=!1;function Gx(){if(_f)return;_f=!0;let e=new _x({connections:zx,keepAliveMaxTimeout:Bx,keepAliveTimeout:Vx}),t=new Fx(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:Ux,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:Wx});jx(t)}import pn from"fs";import ar from"fs";import Hx from"os";import dn from"path";var qx=".local",Kx=".ripplo";function ua(e){return dn.join(e,".ripplo",qx)}function ca(e){let t=ua(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(ua(e),t)}function da(){return dn.join(Hx.homedir(),Kx)}function fn(){let e=da();return ar.existsSync(e)?ar.chmodSync(e,448):ar.mkdirSync(e,{mode:448,recursive:!0}),e}function lr(e){return dn.join(da(),e)}function fa(){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 Yx(e){fn(),pn.writeFileSync(lr("token"),e+`
22
+ `,{mode:384})}function Jx(){let e=lr("token");return pn.existsSync(e)?(pn.unlinkSync(e),!0):!1}var Kf=Pi(ma(),1);import qf from"crypto";function oR({body:e,secret:t}){let r=new Kf.Webhook(t),n=`msg_${qf.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 sR(){return`whsec_${qf.randomBytes(24).toString("base64")}`}import Zf from"fs";import Fi from"path";import{config as dR}from"dotenv";import{z as Di}from"zod";import{err as fR,ok as Xf}from"neverthrow";import $i from"fs";import ba from"path";import{err as ga,ok as Yf}from"neverthrow";import{z as Li}from"zod";var aR=ba.join(".ripplo","project.json"),ya=[".env",".env.local"],lR=Li.object({envFiles:Li.array(Li.string().min(1)).optional(),projectId:Li.string().min(1)});function Jf(e){return ba.join(e,aR)}function Sa(e){let t=Jf(e);return $i.existsSync(t)?uR(t).andThen(r=>{let n=lR.safeParse(r);return n.success?Yf({envFiles:n.data.envFiles??ya,projectId:n.data.projectId}):ga({issues:n.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`),kind:"project-file-invalid",path:t})}):ga({kind:"project-file-missing",path:t})}function wa(e){return Sa(e).match(t=>t,()=>{})}function uR(e){try{return Yf(JSON.parse($i.readFileSync(e,"utf8")))}catch(t){return ga({issues:[t instanceof Error?t.message:String(t)],kind:"project-file-invalid",path:e})}}function hV({cwd:e,envFiles:t,projectId:r}){let n=Jf(e);$i.mkdirSync(ba.dirname(n),{recursive:!0});let i={projectId:r};t!=null&&!cR(t)&&(i.envFiles=[...t]),$i.writeFileSync(n,JSON.stringify(i,null,2)+`
23
+ `)}function cR(e){return e.length!==ya.length?!1:e.every((t,r)=>t===ya[r])}function xV(e){let r=wa(e)?.envFiles??[".env",".env.local"],n=Fi.join(e,".ripplo");r.forEach(i=>{let o=Fi.resolve(n,i);Zf.existsSync(o)&&dR({override:!0,path:o,quiet:!0})}),_i=void 0}var pR=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?Xf(_i):mR().map(e=>(_i=e,e))}function hR(e){let r=wa(e)?.envFiles??[],n=Fi.join(e,".ripplo");return r.map(i=>Fi.resolve(n,i)).filter(i=>!Zf.existsSync(i))}function mR(){let e=pR.safeParse(process.env);if(!e.success)return fR({issues:e.error.issues.map(r=>`${r.path.join(".")}: ${r.message}`),kind:"env-invalid",missingEnvFiles:hR(process.cwd())});let t=e.data;return Xf({appUrl:t.RIPPLO_APP_URL,engineUrl:t.RIPPLO_ENGINE_URL,webhookSecret:t.RIPPLO_WEBHOOK_SECRET})}import{readFileSync as gR}from"fs";import{z as Qf}from"zod";var yR=Qf.object({version:Qf.string()});function va(){let e=gR(new URL("../package.json",import.meta.url),"utf8");return yR.parse(JSON.parse(e)).version}import{z as Vi}from"zod";var bR=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 xa({name:e,schema:t}){return{currentVersion:1,name:e,decode:r=>vR({name:e,raw:r,schema:t}),encode:r=>({__codec:e,data:r,version:1})}}function SR(e,t){return JSON.stringify(e.encode(t))}function wR(e,t){let r=JSON.parse(t);return e.decode(r)}function vR({name:e,raw:t,schema:r}){let n=bR.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 Ra=A.enum(["fast","slow","async"]),Ar=A.object({ref:A.string().min(1)}),Xe=A.union([A.string(),A.number(),A.boolean()]),ka=A.object({template:A.array(A.union([A.string(),Ar])).min(1)}),Ue=A.union([Ar,Xe,ka,A.null()]),ep=A.object({kind:A.literal("changed")}),Ea=A.union([Ue,ep]),xt=A.union([A.string(),Ar,ka]),xR=A.object({by:A.literal("role"),name:A.union([xt,A.undefined()]).optional().transform(e=>e),role:A.string().min(1)}),RR=A.object({by:A.literal("testId"),value:xt}),kR=A.object({by:A.literal("inside"),scope:A.lazy(()=>Re),target:A.lazy(()=>Re)}),Re=A.discriminatedUnion("by",[xR,RR,kR]),Wi=A.enum(["string","number","boolean"]),Ca=A.enum(["strict","eventual"]),ER=A.object({kind:A.literal("string"),maxLength:A.number().int().positive().optional(),minLength:A.number().int().nonnegative().optional(),pattern:A.string().optional()}),CR=A.object({kind:A.literal("number"),max:A.number().int().optional(),min:A.number().int().optional()}),AR=A.object({kind:A.literal("datetime"),maxOffsetDays:A.number().int(),minOffsetDays:A.number().int()}),tp=A.discriminatedUnion("kind",[ER,CR,AR]),rp=A.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),Aa=A.object({constraints:tp.optional(),generator:rp,name:A.string().min(1),type:Wi,values:A.array(Xe).min(1).optional()}),np=A.object({consistency:Ca.default("strict"),optional:A.boolean(),stable:A.boolean(),type:Wi,valueSpace:A.string().min(1).optional()}),Ia=A.enum(["backend","client"]),Pa=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),np),source:Ia.default("backend")}),Ta=A.object({consistency:Ca.default("strict"),default:Xe,description:A.string().optional(),name:A.string().min(1),source:Ia.default("backend"),type:Wi,valueSpace:A.string().min(1).optional()}),Rt=A.enum(["url","title","viewport"]);import{z as T}from"zod";var IR=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),Ea)}),T.object({kind:T.literal("deleted")})]),PR=T.object({kind:T.literal("is"),value:Ue}),ip=T.lazy(()=>T.union([Ue,MR])),TR=T.object({entity:T.string().min(1),where:T.record(T.string().min(1),ip)}),MR=T.object({field:T.string().min(1),kind:T.literal("within"),selection:TR}),kt=T.union([Ra,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:PR,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:IR,entity:T.string().min(1),key:T.record(T.string().min(1),ip),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 op=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()})]),sp=P.object({action:op,expect:P.array(zt).default([])}),ap=P.object({example:Xe.optional(),valueSpace:P.string().min(1)}),Ma=P.object({as:P.string().min(1),entity:P.string().min(1),set:P.record(P.string().min(1),Ue)}),lp=P.object({entity:P.string().min(1),where:P.record(P.string().min(1),Ue)}),zi=P.object({absent:P.array(lp).default([]),exclusive:P.array(P.string().min(1)).default([]),intent:P.string().min(1),maybe:P.array(Ma).default([]),name:P.string().min(1),params:P.record(P.string().min(1),ap),singletons:P.record(P.string().min(1),Ue).default({}),sourcePath:P.string().min(1).optional(),steps:P.array(sp).default([]),stub:P.boolean().default(!1),world:P.array(Ma).default([])}),up=P.object({sha256:P.string().regex(/^[0-9a-f]{64}$/u),size:P.number().int().nonnegative()}),Gi=P.object({entities:P.array(Pa),fixtures:P.record(P.string().min(1),up).default({}),singletons:P.array(Ta).default([]),tests:P.array(zi),valueSpaces:P.array(Aa)}),OR=xa({name:"ripplo-lockfile",schema:Gi});var Hi="__ripplo__",Oa="__ripplo_seed__";import{z as mn}from"zod";var NR=mn.object({index:mn.number().int().nonnegative(),kind:mn.string(),target:mn.string(),value:mn.string()});function Na(e,t){return{index:t,kind:e.action.kind,target:LR(e.action),value:$R(e.action)}}function rt(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function LR(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 $R(e){return e.kind==="fill"||e.kind==="select"?DR(e.value):e.kind==="press"?e.key:""}function DR(e){return e==null?"":typeof e!="object"?String(e):qi(e)}import{z as ke}from"zod";var cp=ke.enum(["Strict","Lax","None"]),dp=ke.object({domain:ke.string().min(1),expires:ke.number(),httpOnly:ke.boolean(),name:ke.string().min(1),path:ke.string().min(1),sameSite:cp,secure:ke.boolean(),value:ke.string()}),fp=ke.object({localStorage:ke.array(ke.object({name:ke.string().min(1),value:ke.string()})),origin:ke.string().min(1)}),La=ke.object({cookies:ke.array(dp),headers:ke.record(ke.string().min(1),ke.string()).optional(),origins:ke.array(fp)});import{z as K}from"zod";var $a=K.union([Xe,K.null()]),Da=K.record(K.string().min(1),$a),pp=K.object({as:K.string().min(1),entity:K.string().min(1),fields:K.record(K.string().min(1),Ue)}),_R=K.object({entities:K.array(pp),runId:K.string().min(1),singletons:K.record(K.string().min(1),$a).default({})}),hp=K.object({as:K.string().min(1),row:Da,session:La.optional()}),_a=K.object({rows:K.array(hp)}),FR=K.object({entities:K.array(K.string().min(1)),runId:K.string().min(1),singletons:K.array(K.string().min(1)).default([])}),Fa=K.object({entities:K.record(K.string().min(1),K.array(Da)),singletons:K.record(K.string().min(1),$a).default({})}),jR=K.object({runId:K.string().min(1)}),ja=K.object({ok:K.literal(!0)});import Va from"fs";import Yi from"path";import{createJiti as zR}from"jiti";import{err as Ji,ok as gp}from"neverthrow";import VR from"fs";import gn from"path";import Ir from"typescript";function mp(e){let t=gn.join(e,"index.ts"),r=WR(e);VR.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=>BR(u,e));if(s.length===0)return{diagnostics:[],ok:!0};let a={getCanonicalFileName:u=>u,getCurrentDirectory:()=>gn.dirname(e),getNewLine:()=>`
24
24
  `};return{diagnostics:Ir.formatDiagnosticsWithColorAndContext(s,a).split(`
25
- `).filter(u=>u.length>0),ok:!1}}function UR(e,t){let r=e.file?.fileName;return r==null?!0:r.startsWith(t)}var WR=gn.join(".local","tsbuildinfo");function zR(e){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:Ir.ModuleKind.Preserve,moduleResolution:Ir.ModuleResolutionKind.Bundler,noEmit:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!1,target:Ir.ScriptTarget.ES2022,tsBuildInfoFile:gn.join(e,WR)}}var Zi=".ripplo/ripplo.lock",yn;async function mp(e){let{result:t}=await HR(e);return t}async function HR(e){let t=KR(Yi.join(e,".ripplo"));if(yn!=null&&yn.fingerprint===t&&yn.result.isOk())return{fingerprint:t,result:yn.result};let r=await bn(e);return yn={fingerprint:t,result:r},{fingerprint:t,result:r}}async function bn(e){let t=Yi.join(e,".ripplo"),r=Yi.join(t,"index.ts"),n=pp(t);return n.ok?(await YR(r)).andThen(o=>ZR({entryPath:r,exported:o})):Ji({diagnostics:n.diagnostics,kind:"typecheck-failed"})}var qR=new Set([".local","debug","node_modules"]);function KR(e){return gp(e).toSorted((t,r)=>t.localeCompare(r)).join("|")}function gp(e){return(ja.existsSync(e)?ja.readdirSync(e,{withFileTypes:!0}):[]).flatMap(r=>{if(qR.has(r.name))return[];let n=Yi.join(e,r.name);if(r.isDirectory())return gp(n);let i=ja.statSync(n);return[`${n}:${String(i.mtimeMs)}:${String(i.size)}`]})}async function YR(e){try{let r=await GR(import.meta.url,{fsCache:!1,moduleCache:!1,sourceMaps:!0}).import(e),n=r!=null&&typeof r=="object"&&"default"in r?Reflect.get(r,"default"):r;return hp(n)}catch(t){return Ji({kind:"load-threw",message:JR(t)})}}function JR(e){return e instanceof Error?e.message:String(e)}function ZR({entryPath:e,exported:t}){if(t==null||typeof t!="object"||!("lockfile"in t))return Ji({entryPath:e,kind:"not-ripplo"});let r=Gi.safeParse(Reflect.get(t,"lockfile"));return r.success?hp(r.data):Ji({issues:r.error.issues.map(n=>`${n.path.join(".")}: ${n.message}`),kind:"invalid-lockfile"})}function Pr(e,t){return t==null?`Load \`/ripplo:${e}\` skill for instructions.`:`Load \`/ripplo:${e}\` skill for instructions on ${t}.`}function hB(e){return e.length===1?Pr(e[0]):`REQUIRED before proceeding: load ${e.map(r=>`\`/ripplo:${r}\``).join(" AND ")} skills (load every one \u2014 each carries rules the others don't).`}function Xi(e){return[`Compilation failed: ${XR(e)}`,Pr("create","DSL authoring + lint rules")].join(`
26
- `)}function bB(){return`${Zi} is up to date`}function SB(e){return[`${Zi} is ${e==="missing"?"missing":"out of date"} \u2014 run \`ripplo compile\` and commit the result`,Pr("setup")].join(`
27
- `)}function wB(){return`wrote ${Zi}`}function XR(e){switch(e.kind){case"typecheck-failed":return["TypeScript errors in .ripplo/:",...yp(e.diagnostics)].join(`
28
- `);case"not-ripplo":return`${e.entryPath} must default-export a Ripplo (createRipplo({ entities, invariants, singletons, tests })). Check that the default export is the value returned by createRipplo, not a function or a re-export.`;case"invalid-lockfile":return["Lockfile failed schema validation (stale or hand-edited .ripplo/ripplo.lock?):",...yp(e.issues),"Regenerate with `npx ripplo compile` \u2014 never hand-edit the lockfile."].join(`
25
+ `).filter(u=>u.length>0),ok:!1}}function BR(e,t){let r=e.file?.fileName;return r==null?!0:r.startsWith(t)}var UR=gn.join(".local","tsbuildinfo");function WR(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,UR)}}var Zi=".ripplo/ripplo.lock",yn;async function yp(e){let{result:t}=await GR(e);return t}async function GR(e){let t=qR(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=mp(t);return n.ok?(await KR(r)).andThen(o=>JR({entryPath:r,exported:o})):Ji({diagnostics:n.diagnostics,kind:"typecheck-failed"})}var HR=new Set([".local","debug","node_modules"]);function qR(e){return bp(e).toSorted((t,r)=>t.localeCompare(r)).join("|")}function bp(e){return(Va.existsSync(e)?Va.readdirSync(e,{withFileTypes:!0}):[]).flatMap(r=>{if(HR.has(r.name))return[];let n=Yi.join(e,r.name);if(r.isDirectory())return bp(n);let i=Va.statSync(n);return[`${n}:${String(i.mtimeMs)}:${String(i.size)}`]})}async function KR(e){try{let r=await zR(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 gp(n)}catch(t){return Ji({kind:"load-threw",message:YR(t)})}}function YR(e){return e instanceof Error?e.message:String(e)}function JR({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?gp(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 mB(e){return e.length===1?Pr(e[0]):`Before proceeding, load the ${e.map(r=>`\`/ripplo:${r}\``).join(" and ")} skills \u2014 every one, each carries rules the others don't.`}function Xi(e){return[`Compilation failed: ${ZR(e)}`,Pr("create","DSL authoring + lint rules")].join(`
26
+ `)}function SB(){return`${Zi} is up to date`}function wB(e){return[`${Zi} is ${e==="missing"?"missing":"out of date"} \u2014 run \`npx ripplo compile\` and commit the result`,Pr("setup")].join(`
27
+ `)}function vB(){return`Wrote ${Zi}`}function ZR(e){switch(e.kind){case"typecheck-failed":return["TypeScript errors in .ripplo/:",...Sp(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?):",...Sp(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 yp(e,t=8){return e.length<=t?e:[...e.slice(0,t),`\u2026 and ${String(e.length-t)} more`]}var Qi=class extends Error{failure;constructor(t){super(t.kind),this.name="CliError",this.failure=t}};function CB(e){return e instanceof Qi?Va(e.failure):e instanceof Error?e.message:String(e)}function Va(e){switch(e.kind){case"project-file-missing":return[`Missing ${e.path} \u2014 this directory is not a Ripplo project.`,"Run `npx ripplo init` to create it (or cd into the project root).",Pr("setup")].join(`
30
+ `)}}function Sp(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 AB(e){return e instanceof Qi?Ba(e.failure):e instanceof Error?e.message:String(e)}function Ba(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
- `);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 QR(e);case"playwright-install-failed":return["Playwright browser installation failed (Chromium still missing after install).","Try manually: `npx playwright install chromium` \u2014 look for network/proxy or disk-space errors in its output."].join(`
32
+ `);case"not-authenticated":return["Not signed in. Run `npx ripplo auth login`.","(Claude Code: run it yourself in the background \u2014 the user just approves in the browser.)"].join(`
33
+ `);case"env-invalid":return XR(e);case"playwright-install-failed":return["Playwright browser install failed \u2014 Chromium is still missing.","Run `npx playwright install chromium` and check its output for network, proxy, or disk-space errors."].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
- `);case"oauth-authorization-failed":return[`Sign-in failed (${e.code}): ${e.description}`,e.code==="expired_token"?"The approval window expired \u2014 run `ripplo auth login` again.":"Run `ripplo auth login` to retry."].join(`
36
- `);case"compilation-failed":return Xi(e.error)}}function QR(e){let t=e.missingEnvFiles.length===0?[]:["Declared env file(s) not found at this path:",...e.missingEnvFiles.map(r=>` ${r}`),"If you're in a git worktree, the env file may not have been copied from the main checkout \u2014 recreate it (or symlink to a shared file outside the working tree)."];return["Env config invalid:",...e.issues.map(r=>` ${r}`),"Add missing values to the env file(s) declared in .ripplo/project.json.",...t].join(`
37
- `)}import{err as rk,ok as nk}from"neverthrow";import{z as Ba}from"zod";var ek="https://ripplo.ai";function Sp(){return vp().RIPPLO_SERVER_URL}function wp(){return vp().RIPPLO_PROJECT_ID}var tk=Ba.object({RIPPLO_PROJECT_ID:Ba.string().min(1).optional(),RIPPLO_SERVER_URL:Ba.string().min(1).default(ek)}),bp;function vp(){return bp??=tk.parse(process.env),bp}import xp from"fs";import Ua from"path";function Rp(e){let t=xp.realpathSync(e),r=t,n=Ua.dirname(r);for(;n!==r;){if(xp.existsSync(Ua.join(r,".git")))return r;r=n,n=Ua.dirname(r)}return t}function jB(e){return ba(e).andThen(t=>ji().andThen(r=>{let n=da();return n==null?rk({kind:"not-authenticated"}):nk({appUrl:r.appUrl,cwd:Rp(e),engineUrl:r.engineUrl,projectId:wp()??t.projectId,ripploServerUrl:Sp(),token:n,webhookSecret:r.webhookSecret})}))}import kp from"fs";import{checkSync as ik,lockSync as ok}from"proper-lockfile";var sk="dev.pid",Ep=15e3;function Cp(e){return Ut(e,sk)}function Ap(e){try{return ik(Cp(e),{realpath:!1,stale:Ep})}catch{return!1}}var Wa=class extends Error{pid;cwd;constructor({cwd:t,pid:r}){super("dev-lock-held"),this.name="DevLockHeldError",this.pid=r,this.cwd=t}};function zB({cwd:e,onCompromised:t}){ua(e);let r=Cp(e),n=ak({cwd:e,onCompromised:t,path:r});return kp.writeFileSync(r,String(process.pid)),()=>{try{n()}catch{}}}function ak({cwd:e,onCompromised:t,path:r}){try{return ok(r,{realpath:!1,stale:Ep,onCompromised:()=>{t()}})}catch(n){throw lk(n)?new Wa({cwd:e,pid:uk(r)}):n}}function lk(e){if(!(e instanceof Error)||!("code"in e))return!1;let{code:t}=e;return t==="ELOCKED"}function uk(e){try{let t=kp.readFileSync(e,"utf8").trim(),r=Number.parseInt(t,10);return Number.isFinite(r)&&r>0?r:null}catch{return null}}import{createServer as mk}from"http";import{mkdir as gk,rm as yk,writeFile as bk}from"fs/promises";import Sk from"path";import{z as te}from"zod";import ck from"path";import{z as Sn}from"zod";var dk=["unspecified","internal","server","client","producer","consumer"],fk=["unset","ok","error"];function Ip(e){return dk[e]??"unspecified"}function Pp(e){return fk[e]??"unset"}var KB=Sn.looseObject({data:Sn.looseObject({source:Sn.number().optional()}).optional(),timestamp:Sn.number(),type:Sn.number()});function Tp({debugDir:e,runId:t,worker:r}){let n=ck.join(e,t,"behavior.jsonl");return r.open({file:n,runId:t}),{close:i=>r.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(pk(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:hk(i.timeNanos)};r.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{r.rrwebBatch({data:i,runId:t})}}}function Tr(e){return String(BigInt(Math.round(e))*1000000n)}function pk(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function hk(e){return Number(BigInt(e)/1000000n)}var wk="otlp-port",Op=te.object({key:te.string(),value:te.object({boolValue:te.boolean().optional(),doubleValue:te.number().optional(),intValue:te.union([te.string(),te.number()]).optional(),stringValue:te.string().optional()})}),vk=te.object({attributes:te.array(Op).default([]),endTimeUnixNano:te.string(),kind:te.number().default(0),name:te.string(),parentSpanId:te.string().optional(),spanId:te.string(),startTimeUnixNano:te.string(),status:te.object({code:te.number(),message:te.string().optional()}).optional(),traceId:te.string()}),xk=te.object({resourceSpans:te.array(te.object({resource:te.object({attributes:te.array(Op).default([])}).optional(),scopeSpans:te.array(te.object({spans:te.array(vk).default([])})).default([])})).default([])});async function za({localDir:e,onRrwebBatch:t,onSpan:r,writePortFile:n}){let{port:i,server:o}=await Rk({onRrwebBatch:t,onSpan:r}),s=Sk.join(e,wk);return n&&(await gk(e,{recursive:!0}),await bk(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{n&&await yk(s,{force:!0}),await Ik(o)}}}function Rk(e){return new Promise((t,r)=>{let n=mk((i,o)=>{kk(i,o,e)});n.on("error",r),n.listen(0,()=>{let i=n.address();if(i==null||typeof i=="string"){r(new Error("otlp_receiver_no_port"));return}t({port:i.port,server:n})})})}function kk(e,t,r){let n=Ek(e.url);if(n!=null){Mp(e).then(i=>{r.onRrwebBatch(n,i),eo(t)}).catch(()=>{eo(t)});return}Mp(e).then(i=>{Ck(xk.parse(JSON.parse(i.toString("utf8"))),r.onSpan),eo(t)}).catch(()=>{eo(t)})}function Ek(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function Mp(e){return new Promise((t,r)=>{let n=[];e.on("data",i=>{n.push(i)}),e.on("end",()=>{t(Buffer.concat(n))}),e.on("error",r)})}function eo(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function Ck(e,t){e.resourceSpans.flatMap(r=>r.scopeSpans).flatMap(r=>r.spans).forEach(r=>{t({attributes:Ak(r.attributes),durationMs:Number((BigInt(r.endTimeUnixNano)-BigInt(r.startTimeUnixNano))/1000000n),kind:"span",name:r.name,parentSpanId:r.parentSpanId,source:"server",spanId:r.spanId,spanKind:Ip(r.kind),status:{code:Pp(r.status?.code??0),message:r.status?.message},timeNanos:r.startTimeUnixNano,traceId:r.traceId})})}function Ak(e){return Object.fromEntries(e.map(({key:t,value:r})=>[t,String(r.stringValue??r.intValue??r.doubleValue??r.boolValue??"")]))}function Ik(e){return new Promise((t,r)=>{e.close(n=>{if(n==null){t();return}r(n)}),e.closeAllConnections()})}function Et(e){let t=new URL(e,"https://ripplo.invalid"),r=[...t.searchParams.entries()].toSorted(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${n}=${i}`).join("&");return r.length===0?t.pathname:`${t.pathname}?${r}`}function Mr(e,t){return e==="url"?Et(t):t}function Ga(e,t,r){return Mr(e,String(t))===Mr(e,String(r))}function Lp(e,t,r){return e!=="url"?Ga(e,t,r):Np(String(t))===Np(String(r))}function Np(e){return new URL(e,"https://ripplo.invalid").pathname}function Ha({actual:e,canon:t,pre:r,predicted:n}){return[...[...new Set([...n.entities.keys(),...e.entities.keys()])].flatMap(s=>Pk({actual:e.entities.get(s),canon:t,entity:s,pre:r.entities.get(s),predicted:n.entities.get(s)})),...Mk(r.singletons,n.singletons,e.singletons)]}function Pk({actual:e,canon:t,entity:r,pre:n,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>Tk({actual:e?.get(s),canon:t,entity:r,key:s,predicted:i?.get(s),preHadKey:n?.has(s)??!1,preRow:n?.get(s)}))}function Tk({actual:e,canon:t,entity:r,key:n,predicted:i,preHadKey:o,preRow:s}){if(i==null)return[{divergence:{entity:r,key:n,kind:"ghost-write"},pending:o}];if(e==null)return[{divergence:{entity:r,key:n,kind:"absent"},pending:!o}];let a=(u,c,d)=>_p(t(r,u,c),t(r,u,d));return[...new Set([...Object.keys(i),...Object.keys(e)])].filter(u=>!a(u,i[u],e[u])).map(u=>({divergence:{entity:r,field:u,key:n,kind:"field-mismatch",snapshot:i[u],sut:e[u]},pending:s==null?e[u]===void 0:a(u,s[u],e[u])}))}function _p(e,t){return $p(e)===$p(t)}function $p(e){return e==null?"\u2205":JSON.stringify(e)}function Mk(e,t,r){return[...new Set([...Object.keys(t),...Object.keys(r)])].flatMap(i=>{let o=t[i],s=r[i];return o===void 0||s===void 0||Dp(i,o,s)?[]:[{divergence:{kind:"singleton-mismatch",singleton:i,snapshot:o,sut:s},pending:e[i]!==void 0&&Dp(i,e[i],s)}]})}function Dp(e,t,r){let n=Rt.safeParse(e);return n.success?Lp(n.data,t,r):_p(t,r)}function qa(e){let t=Ok(e.entities),r=Nk(e.singletons);return n=>Lk(n,t,r)}function Ok(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([r,n])=>[Fp(t.name,r),n.consistency])))}function Fp(e,t){return`${e}.${t}`}function Nk(e){return new Map(e.map(t=>[t.name,t.consistency]))}function Lk(e,t,r){return e.kind==="singleton-mismatch"?$k(e.singleton,r):e.kind==="ghost-write"||e.kind==="absent"?"strict":t.get(Fp(e.entity,e.field))??"strict"}function $k(e,t){return Rt.safeParse(e).success?t.get(e)??"eventual":t.get(e)??"strict"}function Ka(e){let t=new Set(e.valueSpaces.filter(r=>r.generator==="date.iso").map(r=>r.name));return(r,n,i)=>{if(!t.has(`${r}.${n}`)||typeof i!="string")return i;let o=Date.parse(i);return Number.isNaN(o)?i:new Date(o).toISOString()}}function Vp(e,t,r){return{detail:r.slice(0,500),kind:"engine-http",path:e,status:t}}function to(e,t){return{code:Yp(t),kind:"engine-network",message:vn(t),path:e}}function Bp(e){return{kind:"client-mount-missing",mountKey:e}}function Up(e,t){return{kind:"engine-decode",message:vn(t),path:e}}function Wp(e,t){return{entity:e,field:t,kind:"state-identity"}}function zp(e){return{as:e,kind:"setup-missing-row"}}function wn(e){return{kind:"driver-launch",message:vn(e)}}function Gp(e,t){return{action:e,kind:"action-failed",message:vn(t)}}function Hp(e){return{kind:"check-failed",message:vn(e)}}function qp(){return{kind:"aborted"}}var jp=300;function Ct(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${Dk(e.detail)}${_k(e.status)}`;case"engine-network":return`engine ${e.path} request failed: ${e.message}`;case"client-mount-missing":return`client bridge "${e.mountKey}" never mounted; client singletons unreadable`;case"engine-decode":return`engine ${e.path} response did not match schema: ${e.message}`;case"state-identity":return`row of "${e.entity}" is missing identity field "${e.field}"`;case"setup-missing-row":return`setup returned no row for "${e.as}"`;case"driver-launch":return`browser driver failed to launch: ${e.message}`;case"action-failed":return`action "${e.action}" failed: ${e.message}`;case"check-failed":return`check failed: ${e.message}`;case"aborted":return"run aborted"}}function Kp(e){throw new Error(Ct(e))}function ro(){}function Dk(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=jp?t:`${t.slice(0,jp)}\u2026 [truncated]`}function _k(e){return e===404?" \u2014 the engine adapter is not mounted at RIPPLO_ENGINE_URL (or the mount path differs). Verify the adapter is wired into the app server and ENABLE_RIPPLO_TESTING=true; `ripplo doctor` checks the endpoint.":e===403||e===401?" \u2014 the adapter rejected the request: ENABLE_RIPPLO_TESTING is not true in the app's env, or RIPPLO_WEBHOOK_SECRET differs between the app and .ripplo env.":""}function Yp(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?Yp(e.cause):void 0}function vn(e){return e instanceof Error?e.message:String(e)}var Qa=Pi(Qp(),1),cU=Qa.default.configure,no=Qa.default;function J(e){return no(e)??""}function At(e,t){return[...new Map(e.map(r=>[t(r),r])).values()]}function el(e){return At(e,J)}function eh(e){return J(e)}var Rn=class extends Error{name="AbortError";constructor(){super("aborted")}};function th(e){return e instanceof Error&&e.name==="AbortError"}function Ht(e){if(e.aborted)throw new Rn}function tl(e,t){return t.aborted?Promise.reject(new Rn):new Promise((r,n)=>{let i=()=>{clearTimeout(o),n(new Rn)},o=setTimeout(()=>{t.removeEventListener("abort",i),r()},e);t.addEventListener("abort",i,{once:!0})})}function ah(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var Gk=()=>[];async function il({canon:e,classify:t,initialSnapshot:r,lawObligations:n,observe:i,onAssertion:o,onStep:s,steps:a},l){return lh({acc:[],canon:e,classify:t,index:0,lawObligations:n??Gk,observe:i,onAssertion:o,onStep:s,signal:l,snapshot:r,steps:a})}async function lh({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,steps:c}){Ht(l);let d=c[n];if(d==null)return{finalModel:u,findings:e};let p=Date.now();if(!d.guard(u)){let h={kind:"illegal-transition",step:d.step};return rl(a,{endMs:Date.now(),findings:[h],index:n,post:u,pre:u,startMs:p,url:nl(u)}),{finalModel:u,findings:[...e,h]}}return d.perform().match(()=>Hk({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,startMs:p,step:d,steps:c}),h=>{let f=io(h,d);return rl(a,{endMs:Date.now(),findings:[f],index:n,post:u,pre:u,startMs:p,url:nl(u)}),Promise.resolve({finalModel:u,findings:[...e,f]})})}async function Hk({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,startMs:c,step:d,steps:p}){let h=d.effect(u),f=await Qk({canon:t,classify:r,observe:o,pre:u,predicted:h,signal:l,step:d}),m=[...d.obligations,...i(u,f.snapshot)],g=[...await qk({obligations:m,onAssertion:s,signal:l,step:d}),...f.findings];return rl(a,{endMs:Date.now(),findings:g,index:n,post:f.snapshot,pre:u,startMs:c,url:nl(f.snapshot)}),lh({acc:[...e,...g],canon:t,classify:r,index:n+1,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:f.snapshot,steps:p})}async function qk({obligations:e,onAssertion:t,signal:r,step:n}){let i=[...new Map(e.map(s=>[eh(s.source),s])).values()],o=await Promise.all(i.map(async s=>({obligation:s,outcome:await Kk(s,r)})));return o.forEach(s=>{Yk(t,s.obligation,s.outcome,n)}),o.flatMap(s=>Zk(s.obligation,s.outcome,n))}function Kk(e,t){if(e.check.kind==="decided"){let r=e.check.passed?"passed":"failed";return Promise.resolve({kind:r})}return eE(e.budget,e.check.run,t)}function Yk(e,t,r,n){e?.({outcome:Jk(r),source:t.source,step:n.step})}function Jk(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function Zk(e,t,r){return t.kind==="error"?[io(t.error,r)]:t.kind==="failed"?[{budget:e.budget,kind:"obligation",source:e.source,step:r.step}]:[]}function io(e,t){return{error:e,kind:"driver-error",step:t.step}}function rl(e,t){e?.(t)}function nl(e){let t=e.singletons.url;return typeof t=="string"?t:null}var kn={async:12e4,fast:5e3,slow:3e4},uh={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:kn.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:kn.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:kn.slow}};function ch(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function rh(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function Xk(e,t,r){return r.reconcile==null?e:r.reconcile(e,t)}function nh({canon:e,pre:t,predicted:r,step:n},i){let o=n.verifyChanges==null?[]:n.verifyChanges(r,i),s=Xk(r,i,n),a=o.map(l=>({divergence:l,pending:!0}));return{adopted:s,probed:[...a,...Ha({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function dh(e,t){return{budget:t.settle,divergence:e.divergence,kind:"consistency",pending:e.pending,step:t.step}}function ih(e,t,r){let n=e.probed.filter(i=>!i.pending&&r(i.divergence)==="strict");return n.length>0?{findings:n.map(i=>dh(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function oh(e,t,r){return{findings:[...e.probed.map(n=>dh(n,t)),...r],snapshot:e.adopted}}async function Qk({canon:e,classify:t,observe:r,pre:n,predicted:i,signal:o,step:s}){let a=uh[s.settle],l=Date.now()+a.timeoutMs,u=await rh(r);if(!u.ok)return{findings:[io(u.error,s)],snapshot:i};let c=nh({canon:e,pre:n,predicted:i,step:s},u.observed),d=0;for(;Date.now()<l;){Ht(o);let p=ih(c,s,t);if(p!=null)return p;await tl(ch(a,d),o),d+=1;let h=await rh(r);if(!h.ok)return oh(c,s,[io(h.error,s)]);c=nh({canon:e,pre:n,predicted:i,step:s},h.observed)}return ih(c,s,t)??oh(c,s,[])}async function eE(e,t,r){let n=uh[e],i=Date.now()+n.timeoutMs,o=await sh(t),s=0;for(;o.kind==="pending"&&Date.now()<i;)Ht(r),await tl(ch(n,s),r),s+=1,o=await sh(t);return o.kind==="pending"?{kind:"failed"}:o}function sh(e){return e().match(t=>t?{kind:"passed"}:{kind:"pending"},t=>({error:t,kind:"error"}))}import{z as tE}from"zod";var sl=tE.string().brand(),ee=sl.parse("");function It(e){return sl.parse(e)}function qe(e,t){return sl.parse(e.length===0?t:`${e}.${t}`)}function Ie(e){return Ar.safeParse(e).success}function mt(e){return typeof e=="object"&&e!==null&&"template"in e}function ol(e,t,r){let n=qe(t,e.ref);if(!r.has(n))throw new Error(`unresolved binding ref "${n}"`);return r.get(n)??null}function oo(e,t,r){return rE(e).every(n=>r.has(qe(t,n)))}function nt(e,t,r){return typeof e=="string"?e:Ie(e)?String(ol(e,t,r)):e.template.map(n=>typeof n=="string"?n:String(ol(n,t,r))).join("")}function it(e,t,r){return e===null||typeof e=="number"||typeof e=="boolean"?e:Ie(e)?ol(e,t,r):nt(e,t,r)}function fh(e,t){return it(e,ee,t)}function En(e){return no(e)}function Or(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,it(i,t,r)]))}function rE(e){return e==null||typeof e!="object"?[]:mt(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}function qt(e){return typeof e=="object"&&e!==null&&"kind"in e}function dr(e){return Object.fromEntries(Object.entries(e).filter(t=>!qt(t[1])))}function ph(e,t,r){return t.reduce((n,i)=>nE(n,i,r,e),e)}function hh(e,t){return Object.keys(t).length===0?e:{...e,singletons:{...e.singletons,...t}}}function nE(e,t,r,n){if(!iE(t,r))return e;if(t.assertion.kind==="created"){let o=Or(t.assertion.props,ee,r);return oE(e,t.entity,En(o),o)}if(t.assertion.kind==="deleted")return al(e,t.entity,uE(t.key,r,n));let i=Or(dr(t.assertion.props),ee,r);return al(e,t.entity,cE(t.key,i,r,n))}function iE(e,t){return("props"in e.assertion?[e.key,dr(e.assertion.props)]:[e.key]).every(n=>Object.values(n).every(i=>yh(i)||!Ie(i)||t.has(It(i.ref))))}function oE(e,t,r,n){let i=new Map([...e.entities.get(t)??[],[r,n]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function al(e,t,r){let n=r(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,n]])}}function Cn(e,t,r,n){let i={env:n,key:r,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>ao(o,i))}function mh(e,t,r,n,i){let o={env:n,key:r,snapshot:e};return al(e,t,s=>new Map([...s].map(([a,l])=>[a,ao(l,o)?i(l):l])))}function ao(e,t){return Object.entries(t.key).every(([r,n])=>gh(e[r],n,t))}function gh(e,t,r){return yh(t)?sE(t,r).has(so(e)):so(e)===so(lE(t,r.env))}function yh(e){return typeof e=="object"&&e!==null&&"kind"in e}function sE(e,t){let r=t.snapshot.entities.get(e.selection.entity);return r==null?new Set:new Set([...r.values()].filter(n=>aE(n,e.selection.where,t)).map(n=>so(n[e.field])))}function aE(e,t,r){return Object.entries(t).every(([n,i])=>gh(e[n],i,r))}function so(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function lE(e,t){return it(e,ee,t)}function uE(e,t,r){let n={env:t,key:e,snapshot:r};return i=>new Map([...i].filter(([,o])=>!ao(o,n)))}function cE(e,t,r,n){let i={env:r,key:e,snapshot:n};return o=>new Map([...o].map(([s,a])=>ao(a,i)?[s,{...a,...t}]:[s,a]))}function wh(e){let t=e.predicates.filter(o=>kh(o)),r=t.filter(o=>o.assertion.kind==="created"),n=Rh(t);if(r.length===0&&n.length===0&&e.deferred.length===0&&e.adopt.length===0)return;let i=t.filter(o=>o.assertion.kind==="updated");return(o,s)=>{let a=r.reduce((c,d)=>yE(c,s,d,e.env),{env:e.env,snapshot:o}),l=n.reduce((c,d)=>gE(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>fE(c,s,d),a.env);return dE(SE(l,e.deferred,u),s,e.adopt)}}function dE(e,t,r){if(r.length===0)return e;let n=r.reduce((i,o)=>{let s=t.snapshot.singletons[o];return s===void 0?i:{...i,[o]:s}},e.singletons);return{...e,singletons:n}}function vh(e,t,r){return new Map([...e,...Object.entries(r).map(([n,i])=>[qe(ee,`${t}.${n}`),i])])}function fE(e,t,r){let n=Cn(t.snapshot,r.entity,r.key,e).at(0);return n==null?e:vh(e,r.assertion.as,n)}function xh(e){let t=Rh(e.predicates.filter(r=>kh(r)));if(t.length!==0)return(r,n)=>t.flatMap(i=>pE(i,r,n,e.env))}function Rh(e){return e.filter(t=>t.assertion.kind==="updated"&&ll(t.assertion.props).length>0)}function ll(e){return Object.entries(e).filter(([,t])=>qt(t)).map(([t])=>t)}function kh(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function pE(e,t,r,n){let i=Cn(t,e.entity,e.key,n).at(0),o=Cn(r.snapshot,e.entity,e.key,n).at(0);if(i==null||o==null)return[];let s=En(hE(e.key,n));return ll(e.assertion.props).flatMap(a=>bh(i[a])===bh(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function hE(e,t){let r=Object.fromEntries(Object.entries(e).filter(n=>!mE(n[1])));return Or(r,ee,t)}function mE(e){return typeof e=="object"&&e!==null&&"kind"in e}function bh(e){return e==null?"\u2205":JSON.stringify(e)}function gE(e,t,r,n){let i=ll(r.assertion.props),o=Cn(t.snapshot,r.entity,r.key,n).at(0);return o==null?e:mh(e,r.entity,r.key,n,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function yE(e,t,r,n){if(r.assertion.kind!=="created")return e;let i=Or(r.assertion.props,ee,n),o=En(i),s=e.snapshot.entities.get(r.entity);if(s==null||!s.has(o))return e;let a=bE(t.snapshot.entities.get(r.entity),s,i);if(a==null)return e;let[l,u]=a,c=new Map(s);return c.delete(o),c.set(l,u),{env:vh(e.env,r.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(r.entity,c)}}}function bE(e,t,r){if(e!=null)return[...e].find(([n,i])=>!t.has(n)&&Object.entries(r).every(([o,s])=>Sh(i[o])===Sh(s)))}function Sh(e){return e==null?"\u2205":JSON.stringify(e)}function SE(e,t,r){let n=t.reduce((i,o)=>{let s=wE(o.value,r);return s==null?i:{...i,[o.name]:Mr(o.name,s)}},e.singletons);return{...e,singletons:n}}function wE(e,t){try{return nt(e,ee,t)}catch{return}}function lo(e,t){if(e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused")return{kind:e.kind,locator:An(e.locator,t)};if(e.kind==="not"){let r=lo(e.predicate,t);return r==null?null:{inner:r,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:An(e.locator,t),value:nt(e.value,ee,t)}:e.kind!=="browser"?null:{kind:"browser",name:e.name,value:nt(e.value,ee,t)}}function In(e,t){let r=e.expect.filter(l=>l.kind==="state"),n=AE(r),{adopt:i,conditional:o,deferred:s,immediate:a}=RE(e,t,n);return{action:IE(e.action,t),label:e.action.kind,obligations:e.expect.flatMap(l=>TE(l,t)),reconcile:wh({adopt:i,deferred:s,env:t,predicates:r}),verifyChanges:xh({adopt:i,deferred:s,env:t,predicates:r}),effect:l=>{let u=ph(l,r,t),c=o.reduce((d,p)=>({...d,...ul(p,u,t)}),{});return hh(u,{...a,...c})}}}function An(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:nt(e.name,ee,t),role:e.role}:e.by==="inside"?{by:"inside",scope:An(e.scope,t),target:An(e.target,t)}:{by:"testId",value:nt(e.value,ee,t)}}function ul(e,t,r){return e==null?{}:e.kind==="when"?cl(e.condition,t,r)?ul(e.consequence,t,r):ul(e.otherwise,t,r):xE(e,r)}function cl(e,t,r){if(!vE(e))throw new Error(`when() condition cannot be a "${e.kind}" predicate`);switch(e.kind){case"singleton":return t.singletons[e.singleton]===it(e.assertion.value,ee,r);case"count":return(t.entities.get(e.entity)?.size??0)===e.value;case"not":return!cl(e.predicate,t,r);case"and":return e.predicates.every(n=>cl(n,t,r))}}function vE(e){return e.kind==="singleton"||e.kind==="count"||e.kind==="not"||e.kind==="and"}function xE(e,t){if(e.kind!=="browser"&&e.kind!=="singleton")return{};let r=e.kind==="browser"?e.value:e.assertion.value;return oo(r,ee,t)?Eh(e,t):{}}function RE(e,t,r){let n=e.action.kind==="goto"&&!e.expect.some(s=>s.kind==="browser"&&s.name==="url"),i=e.action.kind==="goto"&&!n?{url:Et(nt(e.action.url,ee,t))}:{},o=n?["url"]:[];return e.expect.reduce((s,a)=>a.kind==="browser"&&kE(a.value,r)?{...s,deferred:[...s.deferred,{name:a.name,value:a.value}]}:a.kind==="browser"||a.kind==="singleton"?{...s,immediate:{...s.immediate,...Eh(a,t)}}:a.kind==="when"?{...s,conditional:[...s.conditional,a]}:s,{adopt:o,conditional:[],deferred:[],immediate:i})}function kE(e,t){return EE(e).some(r=>t.has(r.split(".")[0]??r))}function EE(e){return typeof e=="string"?[]:Ie(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function Eh(e,t){if(e.kind==="browser")return{[e.name]:CE(e,t)};if(e.kind==="singleton")return{[e.singleton]:it(e.assertion.value,ee,t)};throw new Error("when() consequence must be a url (browser) or singleton assertion")}function CE(e,t){return Mr(e.name,nt(e.value,ee,t))}function AE(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function IE(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:PE(e,t),url:e.kind==="goto"?nt(e.url,ee,t):void 0,value:"value"in e?fh(e.value,t):void 0}}function PE(e,t){if(!(!("locator"in e)||e.locator==null))return An(e.locator,t)}function TE(e,t){if(e.kind==="browser"||e.kind==="singleton")return[];let r=lo(e,t),n="wait"in e?e.wait??"fast":"fast";return r==null?[]:[{budget:n,check:r}]}import{err as ME,ok as OE,okAsync as NE,Result as LE}from"neverthrow";function Pn(e,t,r){let n=e.tests.find(a=>a.name===t);if(n==null)throw new Error(`test "${t}" not found in lockfile`);let i=BE(e),o={env:new Map,generate:r.generate,generatedParams:new Set,indexed:i,overrides:new Map(Object.entries(r.params??{}).map(([a,l])=>[It(a),l]))};UE(n.params,ee,o);let s=n.world.map(a=>WE(a,ee,o));return r.materialize(s).map(a=>$E({base:qE(a,o.env,i),generatedParams:o.generatedParams,lockfile:e,test:n}))}function fl(e,t){let r=new Map(t.map(n=>[n.name,n]));return n=>NE(FE(n,e,r).rows)}function pl(e){return t=>{let r=t.map(n=>({as:n.as,entity:n.entity,fields:n.fields}));return e(r).andThen(n=>_E(t,n))}}function Ch(e,t){let r=uo(t);return Object.fromEntries(Object.entries(e).filter(([n,i])=>r.includes(n)&&i!=null))}function uo(e){return Object.entries(e.props).filter(([,t])=>t.stable).map(([t])=>t)}function $E({base:e,generatedParams:t,lockfile:r,test:n}){let i=Object.fromEntries(r.singletons.map(c=>[c.name,c.default])),o=Object.fromEntries(Object.entries(n.singletons).map(([c,d])=>[c,it(d,ee,e.env)])),s=Object.entries(n.singletons).filter(([,c])=>DE(c,t)).map(([c])=>c),a={...i,...o},l=new Set(r.singletons.filter(c=>c.source==="client").map(c=>c.name)),u=Object.fromEntries(Object.entries(a).filter(([c])=>l.has(c)));return{...e,clientState:u,generatedSingletons:s,snapshot:{...e.snapshot,singletons:a}}}function DE(e,t){return Ie(e)?t.has(qe(ee,e.ref)):mt(e)?e.template.some(r=>typeof r!="string"&&t.has(qe(ee,r.ref))):!1}function _E(e,t){let r=new Map(t.map(n=>[n.as,n]));return LE.combine(e.map(n=>{let i=r.get(n.as);return i==null?ME(zp(n.as)):OE({as:n.as,entity:n.entity,generatedFields:n.generatedFields,row:i.row,session:i.session})}))}function FE(e,t,r){return e.reduce((n,i)=>{let o=jE(i.fields,n.env),s=YE({generate:t,model:i.model,seedPrefix:i.seedPrefix,set:o,valueSpaces:r}),a=Object.entries(s).map(([u,c])=>[`${i.as}.${u}`,c]),l=Object.keys(s).filter(u=>!(u in o));return{env:new Map([...n.env,...a]),rows:[...n.rows,{as:i.as,entity:i.entity,generatedFields:[...new Set([...i.generatedFields,...l])],row:s,session:void 0}]}},{env:new Map,rows:[]})}function jE(e,t){return Object.fromEntries(Object.entries(e).map(([r,n])=>{if(Ie(n))return[r,VE(t,n.ref)];if(mt(n))throw new Error(`template value not allowed in entity field "${r}"`);return[r,n]}))}function VE(e,t){let r=e.get(t);if(r==null)throw new Error(`setup ref "${t}" was not produced by an earlier entity`);return r}function BE(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function UE(e,t,r){Object.entries(e).forEach(([n,i])=>{let o=qe(t,n),s=r.indexed.valueSpaces.get(i.valueSpace);if(s==null)throw new Error(`unknown valueSpace "${i.valueSpace}" for param "${o}"`);let a=r.overrides.get(o)??i.example;a==null&&r.generatedParams.add(o);let l=a??r.generate.value({anchor:void 0,constraints:s.constraints,generator:s.generator,nullable:!1,seed:o,type:s.type,values:s.values,valueSpace:i.valueSpace});r.env.set(o,l)})}function WE(e,t,r){let n=r.indexed.models.get(e.entity);if(n==null)throw new Error(`model "${e.entity}" not found for setup "${e.as}"`);let i=qe(t,e.as),o=zE(e.set,t,r.env),s=HE(n,o,i,r),a=Object.entries(e.set).filter(([,l])=>Ie(l)&&r.generatedParams.has(qe(t,l.ref))).map(([l])=>l);return{as:i,entity:e.entity,fields:{...s,...o},generatedFields:[...Object.keys(s),...a],model:n,seedPrefix:i}}function zE(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,GE(i,t,r)]))}function GE(e,t,r){if(!Ie(e))return e;let n=qe(t,e.ref);return r.get(n)??{ref:n}}function HE(e,t,r,n){return Object.fromEntries(Object.entries(e.props).filter(([i,o])=>!o.optional&&!e.identity.includes(i)&&!(i in t)).map(([i,o])=>[i,Ah({field:i,generate:n.generate,model:e,seedPrefix:r,spec:o,valueSpaces:n.indexed.valueSpaces})]))}function qE(e,t,r){let n=new Map,i=e.flatMap(a=>{let l=r.models.get(a.entity);if(l==null)throw new Error(`model "${a.entity}" not found for setup "${a.as}"`);Object.entries(a.row).forEach(([c,d])=>t.set(qe(It(a.as),c),d));let u=n.get(a.entity)??new Map;return u.set(dl(a.row,l),Ch(a.row,l)),n.set(a.entity,u),a.session==null?[]:[a.session]}),o=e.flatMap(a=>{let l=r.models.get(a.entity);return l==null?[]:[{alias:a.as,entity:a.entity,key:dl(a.row,l)}]}),s=e.flatMap(a=>{let l=r.models.get(a.entity);if(l==null)return[];let u=dl(a.row,l);return a.generatedFields.map(c=>({entity:a.entity,field:c,key:u}))});return{aliases:o,auth:KE(i),env:t,generated:s,snapshot:{entities:JE(n),singletons:{}}}}function KE(e){if(e.length===0)return;let t=e.flatMap(r=>Object.entries(r.headers??{}));return{cookies:e.flatMap(r=>r.cookies),headers:t.length===0?void 0:Object.fromEntries(t),origins:e.flatMap(r=>r.origins)}}function YE({generate:e,model:t,seedPrefix:r,set:n,valueSpaces:i}){return{...Object.fromEntries(Object.entries(t.props).filter(([s])=>!(s in n)).map(([s,a])=>[s,Ah({field:s,generate:e,model:t,seedPrefix:r,spec:a,valueSpaces:i})])),...n}}function Ah({field:e,generate:t,model:r,seedPrefix:n,spec:i,valueSpaces:o}){let s=`${r.name}.${e}`;return t.value({anchor:void 0,constraints:o.get(s)?.constraints,generator:o.get(s)?.generator??"lorem.word",nullable:i.optional,seed:qe(n,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function dl(e,t){return t.identity.map(r=>String(e[r])).join(":")}function JE(e){return new Map([...e].map(([t,r])=>[t,new Map(r)]))}function gt(e){return`${e.test}#${String(e.index)}`}function Nr(e){let t=e.tests.flatMap(r=>co(e,r.name));return At(t,r=>`${r.test}:${J(r.steps)}`)}function co(e,t){let r=Lh(e,t),n=Th(r,e),i=Ih(n,r.singletons),o=SC(r,bC(e));return ZE(i,wC(r.steps),n).map(({chunk:a,guard:l},u)=>gC({chunk:a,guard:l,index:u,intent:r.intent,namespace:n.namespace,paramSpaceOf:o,testName:t}))}function Ih(e,t){return{absences:hC(e),entities:mC(e),exclusives:e.exclusives,optionals:Nh(e.optionals,e),singletons:Object.fromEntries(Object.entries(t).filter(([,r])=>!Ie(r)&&!mt(r)))}}function fo(e,t,r){return Object.values(e).flatMap(n=>Ie(n)?ml(n.ref,r):[]).find(n=>n.entity===t)?.aliasPath}function ZE(e,t,r){return t.reduce((n,i)=>({guard:XE(n.guard,i,r),guarded:[...n.guarded,{chunk:i,guard:cC(n.guard,i)}]}),{guard:e,guarded:[]}).guarded}function XE(e,t,r){let n=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>QE(i,o,r),e);return{...n,singletons:{...n.singletons,...aC(t)}}}function QE(e,t,r){return t.assertion.kind==="deleted"?eC(e,t,r):t.assertion.kind==="created"?nC(e,t.entity,t.assertion.as,t.assertion.props,r):oC(e,t,r)}function eC(e,t,r){let n=fo(t.key,t.entity,r.namespace),i=e.entities.find(a=>a.alias===n),o=Tn(tC(t.key),t.entity,r),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...rC(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==n)}}function tC(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let r=t[1];return Oh(r)?[]:[[t[0],r]]}))}function rC(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(r=>!t.relations.some(n=>n.field===r.field)),...t.relations]}}function nC(e,t,r,n,i){let o=Tn(n,t,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!iC(o,s)),entities:[...e.entities,{alias:r,entity:t,...o}]}}function iC(e,t){return Object.entries(t.literals).every(([n,i])=>e.literals[n]===i)&&t.relations.every(n=>e.relations.some(i=>i.field===n.field&&i.targetAlias===n.targetAlias&&i.targetField===n.targetField))}function oC(e,t,r){if(t.assertion.kind!=="updated")return e;let n=fo(t.key,t.entity,r.namespace);if(n==null)return e;let i=Tn(dr(t.assertion.props),t.entity,r),o=Object.entries(t.assertion.props).filter(([,a])=>qt(a)).map(([a])=>a),s=a=>a.alias===n?sC(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a)),optionals:e.optionals.map(a=>s(a))}}function sC(e,t,r){let n=Object.entries(e.literals).filter(([i])=>!r.includes(i)&&!(i in t.literals));return{...e,literals:{...Object.fromEntries(n),...t.literals},relations:[...e.relations.filter(i=>!t.relations.some(o=>o.field===i.field)),...t.relations]}}function aC(e){return e.reduce((t,r)=>({...t,...lC(r),...uC(r)}),{})}function lC(e){return e.action.kind==="goto"?{url:e.action.url}:{}}function uC(e){return Object.fromEntries(e.expect.flatMap(t=>t.kind==="browser"?[[t.name,t.value]]:t.kind==="singleton"?[[t.singleton,t.assertion.value]]:[]))}function cC(e,t){return t[0]?.action.kind!=="goto"?e:{...e,singletons:Object.fromEntries(Object.entries(e.singletons).filter(([r])=>r!=="url"))}}function po(e,t){let r=Lh(e,t),n=Th(r,e);return{guard:Ih(n,r.singletons),namespace:n.namespace,stable:n.stable}}function Ph(e,t){return[...new Set(e)].flatMap(r=>ml(r,t))}function ot(e){return Ie(e)?[e.ref]:mt(e)?e.template.flatMap(t=>Ie(t)?[t.ref]:[]):[]}function Kt(e){switch(e.kind){case"visible":case"disabled":case"enabled":case"focused":return Yt(e.locator);case"value":case"text":return[...Yt(e.locator),...ot(e.value)];case"singleton":return ot(e.assertion.value);case"browser":return ot(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(dr(e.assertion.props)).flatMap(t=>ot(t)),...Object.values(e.key).flatMap(t=>Mh(t))];case"not":return Kt(e.predicate);case"when":return[...Kt(e.condition),...Kt(e.consequence),...e.otherwise==null?[]:Kt(e.otherwise)];case"and":return e.predicates.flatMap(t=>Kt(t));case"count":return[]}}function Th(e,t){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map([...e.world,...e.maybe].map(r=>[r.as,r.entity])),optionals:e.maybe,setups:e.world,stable:dC(t)}}function dC(e){let t=new Map(e.entities.map(r=>[r.name,r]));return(r,n)=>t.get(r)?.props[n]?.stable===!0}function Yt(e){return e.by==="inside"?[...Yt(e.scope),...Yt(e.target)]:e.by==="role"?e.name==null?[]:ot(e.name):ot(e.value)}function Mh(e){return Oh(e)?Object.values(e.selection.where).flatMap(t=>Mh(t)):ot(e)}function Oh(e){return typeof e=="object"&&e!==null&&"kind"in e}function fC(e){return e.kind==="goto"?ot(e.url):e.kind==="fill"||e.kind==="select"?[...Yt(e.locator),...ot(e.value)]:e.kind==="press"?e.locator==null?[]:Yt(e.locator):(e.kind==="upload",Yt(e.locator))}function pC(e){return[...fC(e.action),...e.expect.flatMap(t=>Kt(t))]}function hC(e){return e.absences.map(t=>({entity:t.entity,...Tn(t.where,t.entity,e)}))}function Tn(e,t,r){let n=Object.entries(e).filter(([s])=>r.stable(t,s)),i=Object.fromEntries(n.flatMap(([s,a])=>Ie(a)||mt(a)?[]:[[s,a]])),o=n.flatMap(s=>{let a=s[1];if(!Ie(a))return[];let l=ml(a.ref,r.namespace).at(0);return l==null?[]:[{entity:l.entity,field:s[0],targetAlias:l.aliasPath,targetField:l.field}]});return{literals:i,relations:o}}function Nh(e,t){return e.map(r=>({alias:r.as,entity:r.entity,...Tn(r.set,r.entity,t)}))}function mC(e){return Nh(e.setups,e)}function gC(e){let t=e.chunk.findIndex(s=>s.action.kind!=="goto"),r=t===-1?e.chunk:e.chunk.slice(0,t),n=e.chunk.slice(r.length),i=n.at(-1)??e.chunk.at(-1);if(i==null)throw new Error("empty transition chunk");let o=[...new Set(e.chunk.flatMap(s=>pC(s)))];return{effectStep:i,guard:e.guard,index:e.index,intent:e.intent,namespace:e.namespace,nav:r,paramSpaces:Object.fromEntries(o.filter(s=>e.paramSpaceOf.has(s)).map(s=>[s,e.paramSpaceOf.get(s)])),steps:n,test:e.testName,wait:ah(n.flatMap(s=>yC(s)))}}function yC(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function ml(e,t){let r=e.lastIndexOf(".");if(r===-1)return[];let n=e.slice(0,r),i=t.get(n);return i==null?[]:[{aliasPath:n,entity:i,field:e.slice(r+1),ref:e}]}function Lh(e,t){let r=e.tests.find(n=>n.name===t);if(r==null)throw new Error(`test "${t}" not found in lockfile`);return r}function bC(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function SC(e,t){return new Map(Object.entries(e.params).map(([r,n])=>[r,t.get(n.valueSpace)]))}function wC(e){return hl(e,0,[],[])}function hl(e,t,r,n){let i=e[t];if(i==null)return r.length===0?n:[...n,r];let o=[...r,i];return vC(i)?hl(e,t+1,[],[...n,o]):hl(e,t+1,o,n)}function vC(e){return e.expect.some(t=>t.kind==="state")}function $h(e){return Dh(e,new Map)}function xC(e,t){return e.reduce((r,n)=>r??t(n),null)}function Dh(e,t){let r=e.variables.find(n=>!t.has(n));return r==null?t:xC(e.domain(r),n=>{let i=new Map([...t,[r,n]]);return e.consistent(i)?Dh(e,i):null})}function yt(e,t){let r=RC(e,t);if(r==null)return null;let n=PC(r);return TC(e.singletons,t,n)?n:null}function RC(e,t){let{absences:r,entities:n,exclusives:i,optionals:o}=e,s=new Map(n.map(u=>[u.alias,u])),a=$h({variables:n.map(u=>u.alias),consistent:u=>kC(u)&&EC(n,u)&&AC(r,u,t),domain:u=>jh(s.get(u),t)});if(a==null)return null;let l=Vh(o,a,t);return IC(i,[...n,...o],l,t)?l:null}function kC(e){let t=[...e.values()];return new Set(t).size===t.length}function EC(e,t){return e.every(r=>t.has(r.alias)?r.relations.every(n=>CC(r,n,t)):!0)}function CC(e,t,r){if(!r.has(t.targetAlias))return!0;let n=r.get(t.targetAlias)?.[t.targetField];return n==null?!0:r.get(e.alias)?.[t.field]===n}function AC(e,t,r){return e.every(n=>![...r.entities.get(n.entity)?.values()??[]].some(i=>_h(i,n,t)))}function _h(e,t,r){return Fh(e,t)?t.relations.every(n=>{if(!r.has(n.targetAlias))return!1;let i=r.get(n.targetAlias)?.[n.targetField];return i!=null&&e[n.field]===i}):!1}function Fh(e,t){return Object.entries(t.literals).every(([r,n])=>n===null?e[r]==null:e[r]===n)}function jh(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(r=>Fh(r,e))}function Vh(e,t,r){let n=e.reduce((i,o)=>{if(i.has(o.alias))return i;let s=new Set(i.values()),a=jh(o,r).find(l=>!s.has(l)&&_h(l,o,i));return a==null?i:new Map([...i,[o.alias,a]])},t);return n.size===t.size?n:Vh(e,n,r)}function IC(e,t,r,n){return e.every(i=>{let o=t.filter(a=>a.entity===i&&r.has(a.alias)).length;return(n.entities.get(i)?.size??0)===o})}function PC(e){return new Map([...e].flatMap(([t,r])=>Object.entries(r).flatMap(n=>{let i=n[1];return typeof i=="string"||typeof i=="number"||typeof i=="boolean"?[[It(`${t}.${n[0]}`),i]]:[]})))}function TC(e,t,r){return Object.entries(e).every(([n,i])=>{if(!oo(i,ee,r))return!1;let o=it(i,ee,r),s=t.singletons[n],a=Rt.safeParse(n);return a.success?Ga(a.data,o,s):s===o})}function ho(e,t,r){let n=yt(e.guard,t);return n==null?null:new Map([...n,...Object.entries(r).map(([i,o])=>[It(i),o])])}function mo(e,t){let r=In(e.effectStep,t),n=NC(e,t),i=[...e.nav,...e.steps].map(o=>In(o,t));return{effect:LC(r.effect,n),steps:i.map(o=>({action:o.action,effect:o.effect,obligations:o.obligations,reconcile:o.reconcile,verifyChanges:o.verifyChanges}))}}function gl(e,t,r){return yt(e.guard,r)==null?!1:fr(t(r))!==fr(r)||$C(e)||MC(e)}function MC(e){return[...e.nav,...e.steps].every(t=>t.expect.every(r=>r.kind!=="state"))}var Bh=new WeakMap;function fr(e){let t=Bh.get(e);if(t!=null)return t;let r=J({entities:[...e.entities].map(([n,i])=>[n,[...i]]),singletons:OC(e.singletons)});return Bh.set(e,r),r}function OC(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>t==="url"&&typeof r=="string"?[t,Et(r)]:[t,r]))}function NC(e,t){let r=e.nav.at(-1);return r==null?void 0:In(r,t).action.url}function LC(e,t){if(t==null)return e;let r=Et(t);return n=>{let i=e(n);return{...i,singletons:{...i.singletons,url:r}}}}function $C(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(r=>qt(r)))}function Mn(e,t,r){let n=ho(e,t.snapshot,r);if(n==null)return null;let i=DC(e,n);return i==null||!gl(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function Uh(e,t,r){let n=ho(e,t.snapshot,r);if(n==null)return"guard-unsatisfied";try{return mo(e,n),"no-effect"}catch{return"unresolvable"}}function DC(e,t){try{return mo(e,t)}catch{return null}}function Lr(e,t,r){return e.flatMap((n,i)=>{let o=r(n),s=Mn(n,t,o);return s==null?[]:[{firing:s,idx:i,label:gt(n),params:o}]})}var _C={absences:[],entities:[],exclusives:[],optionals:[],singletons:{}};function On(e){return{..._C,...e}}function yl(e){return FC(e).flatMap(t=>jC(t))}function FC(e){return[...e.reduce((r,n)=>{let i=J([n.when.singletons,n.consequence]);return new Map([...r,[i,[...r.get(i)??[],n]]])},new Map).values()]}function jC(e){if(e.length<2)return[];let t=e.map(o=>new Set(o.when.entities.map(s=>Wh(s)))),[r]=t;if(r==null)return[];let n=[...r].filter(o=>t.every(s=>s.has(o))),i=e.toSorted((o,s)=>o.when.entities.length-s.when.entities.length)[0];return i==null||n.length===i.when.entities.length?[]:VC(i,n,UC(e))}function Wh(e){return J([e.entity,e.literals])}function VC(e,t,r){let n=e.when.entities.filter(s=>t.includes(Wh(s))),i=new Set(n.map(s=>s.alias));if(![...e.refs].every(s=>i.has(s)))return[];let o=On({entities:n.map(s=>BC(s,i)),optionals:e.when.optionals.filter(s=>i.has(s.alias)),singletons:e.when.singletons});return[{consequence:e.consequence,origin:{kind:"generalized",tests:r},refs:e.refs,when:o}]}function BC(e,t){return{...e,relations:e.relations.filter(r=>t.has(r.targetAlias))}}function UC(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function WC(e){return e.flatMap((t,r)=>e.slice(r+1).flatMap(n=>qh(t,n)))}function Hh(e,t){return qh(e,t).length>0}function qh(e,t){let r=zh(e.when,t.when);return!r&&!zh(t.when,e.when)||!GC(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:r?t.when:e.when}]}function zh(e,t){return bl(e.entities,t.entities)&&bl(e.absences,t.absences)&&bl(e.optionals,t.optionals)&&e.exclusives.every(r=>t.exclusives.includes(r))&&zC(e.singletons,t.singletons)}function bl(e,t){let r=new Set(t.map(n=>J(n)));return e.every(n=>r.has(J(n)))}function zC(e,t){return Object.entries(e).every(([r,n])=>J(t[r])===J(n))}function GC(e,t){return e.kind==="not"?Sl(e.predicate,t):t.kind==="not"?Sl(e,t.predicate):HC(e,t)||qC(e,t)}function Sl(e,t){return e.kind===t.kind&&"locator"in e&&"locator"in t&&Kh(e,t)}function Kh(e,t){return"locator"in t&&J(e.locator)===J(t.locator)}function HC(e,t){let r=new Set([e.kind,t.kind]);return r.has("enabled")&&r.has("disabled")&&"locator"in e&&"locator"in t?Kh(e,t):!1}function qC(e,t){let r=Gh(e),n=Gh(t);return r==null||n==null||e.kind!==t.kind?!1:Sl(e,t)&&J(r)!==J(n)}function Gh(e){return e.kind==="value"||e.kind==="text"?e.value:null}function KC(e,t){return e.flatMap(r=>{let n=YC(r),i=new Set(r.guard.absences.map(o=>o.entity));return t.flatMap(o=>JC(r,o,n,i))})}function YC(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(r=>r.kind==="state"&&r.assertion.kind==="deleted"?[r.entity]:[])))}function JC(e,t,r,n){let{source:i,target:o}=t.reference;return!r.has(o)||r.has(i)||n.has(i)?[]:[{invariant:t,source:i,target:o,transition:gt(e)}]}function vl(e){return J({consequence:e.consequence,when:e.when})}function xl(e){let t=[...ZC(e),...aA(e)],r=yl(t).reduce((n,i)=>[...t,...n].some(s=>Hh(i,s))?n:[...n,i],[]);return At([...t,...r],vl)}function Rl(e){return e.kind==="not"?Rl(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="value"||e.kind==="text"}function kl(e,t,r){if(yt(e.when,t)!=null)return null;let n=yt(e.when,r);return n==null?null:uA(e,n)}function ZC(e){return At(e.tests.flatMap(t=>XC(e,t)),vl)}function XC(e,t){let r=po(e,t.name);return t.steps.reduce((n,i)=>({guard:QC(n.guard,i,r),laws:[...n.laws,...sA(i,n.guard,r.namespace,{kind:"test",test:t.name})]}),{guard:r.guard,laws:[]}).laws}function QC(e,t,r){return t.expect.reduce((n,i)=>i.kind==="state"?eA(n,i,r):n,e)}function eA(e,t,r){if(t.assertion.kind==="created"){let o=tA(t.assertion.as,t.entity,t.assertion.props,r);return{...e,entities:[...e.entities,o]}}let n=fo(t.key,t.entity,r.namespace);if(n==null)return e;if(t.assertion.kind==="deleted")return iA(e,n);let i=dr(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===n?wl(o,i,r):o),optionals:e.optionals.map(o=>o.alias===n?wl(o,i,r):o)}}function tA(e,t,r,n){return wl({alias:e,entity:t,literals:{},relations:[]},r,n)}function wl(e,t,r){return Object.entries(t).reduce((n,[i,o])=>{if(mt(o)||!r.stable(e.entity,i))return n;if(Ie(o)){let s=rA(o.ref,i,r.namespace);return{...n,literals:nA(n.literals,i),relations:s==null?n.relations:[...Yh(n.relations,i),s]}}return{...n,literals:{...n.literals,[i]:o},relations:Yh(n.relations,i)}},e)}function rA(e,t,r){let n=e.lastIndexOf(".");if(n===-1)return;let i=e.slice(0,n),o=r.get(i);return o==null?void 0:{entity:o,field:t,targetAlias:i,targetField:e.slice(n+1)}}function nA(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>r!==t))}function Yh(e,t){return e.filter(r=>r.field!==t)}function iA(e,t){let r=[...e.entities,...e.optionals].find(i=>i.alias===t),n=oA(e,t);return r==null?n:{...n,absences:[...n.absences,{entity:r.entity,literals:r.literals,relations:r.relations}]}}function oA(e,t){return{...e,entities:e.entities.filter(r=>r.alias!==t),optionals:e.optionals.filter(r=>r.alias!==t)}}function sA(e,t,r,n){if(e.action.kind!=="goto")return[];let i=e.action.url;return e.expect.filter(o=>Rl(o)).map(o=>Jh({consequence:o,guard:t,namespace:r,origin:n,url:i}))}function Jh({consequence:e,guard:t,namespace:r,origin:n,url:i}){return{consequence:e,origin:n,refs:new Set(Ph([...ot(i),...Kt(e)],r).map(o=>o.aliasPath)),when:{...t,singletons:{...t.singletons,url:i}}}}function aA(e){return At(Nr(e).flatMap(t=>lA(t)),vl)}function lA(e){let t=e.nav.at(-1),r=e.steps[0]?.action,n=r!=null&&"locator"in r?r.locator:void 0;return t==null||t.action.kind!=="goto"||n==null?[]:[Jh({consequence:{kind:"enabled",locator:n,wait:void 0},guard:e.guard,namespace:e.namespace,origin:{intent:e.intent,kind:"trigger",test:e.test},url:t.action.url})]}function uA(e,t){try{let r=lo(e.consequence,t);return r==null?null:{check:r}}catch{return null}}function El(e){return el(e.tests.flatMap(t=>cA(e,t.name)))}function Cl(e,t){return yt(e.when,t)==null?!1:yt(e.holds,t)==null}function cA(e,t){let r=po(e,t);return r.guard.entities.flatMap(n=>n.relations.flatMap(i=>dA(e,n,i,r.namespace)?hA(n,i,r.namespace):[]))}function dA(e,t,r,n){let i=n.get(r.targetAlias);return i!=null&&!fA(e,t.entity,r.field)&&pA(e,i,r.targetField)}function fA(e,t,r){return e.entities.find(n=>n.name===t)?.props[r]?.optional===!0}function pA(e,t,r){return e.entities.find(n=>n.name===t)?.identity.includes(r)===!0}function hA(e,t,r){let n=r.get(t.targetAlias);if(n==null)return[];let i=Zh(e.alias,e.entity),o=Zh(t.targetAlias,n);return[{holds:On({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:n,targetField:t.targetField},when:On({entities:[i]})}]}function Zh(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function Xh(e,t){let r=[...t.entities].flatMap(([o,s])=>[...s].map(([a,l])=>mA({entity:o,key:a,pre:e,row:l}))),n=[...e.entities].flatMap(([o,s])=>[...s].flatMap(([a,l])=>gA({entity:o,key:a,post:t,row:l}))),i=Object.entries(t.singletons).map(([o,s])=>({changed:e.singletons[o]!==s,name:o,value:s}));return{rows:[...r,...n],singletons:i}}function mA({entity:e,key:t,pre:r,row:n}){let i=yA(r.entities.get(e),t),o=Object.entries(n).map(([s,a])=>({changed:i==null||i[s]!==a,field:s,value:a}));return{changed:i==null||o.some(s=>s.changed),entity:e,fields:o,key:t,status:i==null?"created":"present"}}function gA({entity:e,key:t,post:r,row:n}){if(r.entities.get(e)?.has(t)===!0)return[];let i=Object.entries(n).map(([o,s])=>({changed:!1,field:o,value:s}));return[{changed:!0,entity:e,fields:i,key:t,status:"deleted"}]}function yA(e,t){return e?.get(t)}function Al(e,t,r){return t.steps.map(n=>({effect:n.effect,obligations:n.obligations.map(i=>({budget:i.budget,check:{kind:"poll",run:()=>r.evaluate(i.check)},source:{check:i.check,kind:"step"}})),reconcile:n.reconcile,settle:e.wait,step:{action:n.action,intent:e.intent,test:e.test},verifyChanges:n.verifyChanges,guard:()=>!0,perform:()=>r.perform(n.action)}))}async function Qh(e,t){let{params:r,transition:n}=e.firing,i=Mn(n,e.state,r);if(i==null){let s={intent:n.intent,kind:"unfireable",reason:Uh(n,e.state,r),test:n.test};return{label:gt(n),next:e.state,result:{finalModel:e.state.snapshot,findings:[s]}}}let o=await il({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,lawObligations:SA(e.laws,e.invariants,e.driver),observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,steps:Al(e.firing.transition,i.resolved,e.driver)},t);return{label:gt(e.firing.transition),next:{snapshot:o.finalModel},result:o}}function bA(e,t){return Cl(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},source:{invariant:e,kind:"invariant"}}]:[]}function SA(e,t,r){return(n,i)=>[...e.flatMap(o=>wA(o,n,i,r)),...t.flatMap(o=>bA(o,i))]}function wA(e,t,r,n){let i=kl(e,t,r);return i==null?[]:[{budget:"fast",check:{kind:"poll",run:()=>n.evaluate(i.check)},source:{check:i.check,kind:"law",origin:e.origin}}]}function Pl(e,t){return Il({acc:{findings:[],fired:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function Il({acc:e,index:t,params:r,signal:n,state:i,stepBase:o}){Ht(n);let s=r.sequence[t];if(s==null)return e;let a=Date.now(),l=[],u=await Qh({canon:r.canon,classify:r.classify,driver:r.driver,firing:s,invariants:r.invariants,laws:r.laws,onAssertion:r.onAssertion,state:i,onStep:d=>{l.push(d.index),r.onEvent({endMs:d.endMs,findings:d.findings,index:o+d.index,kind:"step",startMs:d.startMs,state:Xh(d.pre,d.post),url:d.url})}},n);if(u==null)return Il({acc:e,index:t+1,params:r,signal:n,state:i,stepBase:o});r.onEvent({endMs:Date.now(),intent:s.transition.intent,kind:"fired",startMs:a}),u.result.findings.forEach(d=>{r.onEvent({finding:d,kind:"finding"})});let c={findings:[...e.findings,...u.result.findings],fired:[...e.fired,u.label]};return Il({acc:c,index:t+1,params:r,signal:n,state:u.next,stepBase:o+l.length})}var $r={value:e=>vA(e)};function Ml(e,t){return{value:r=>e.value({...r,seed:`${t}:${r.seed}`})}}function Ol(e,t){return{value:r=>e.value({...r,anchor:t})}}function vA({anchor:e,constraints:t,generator:r,nullable:n,seed:i,type:o,values:s,valueSpace:a}){let l=Tl(`${a}:${i}`);return n&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:r==="date.iso"?xA({anchor:e,constraints:t,n:l,timeHash:Tl(`${a}:${i}#tod`)}):o==="number"?RA(l,t):o==="boolean"?l%2===0:IA(r,l)}var go=864e5;function xA({anchor:e,constraints:t,n:r,timeHash:n}){if(t?.kind!=="datetime")throw new Error("datetime value space requires offsetDays constraints");if(e==null)throw new Error("datetime value space requires a run anchor timestamp");let i=Date.parse(e);if(Number.isNaN(i))throw new TypeError(`datetime anchor "${e}" is not a valid ISO timestamp`);let o=t.maxOffsetDays-t.minOffsetDays+1,s=o<=0?t.minOffsetDays:t.minOffsetDays+r%o,a=Math.floor(i/go)*go;return new Date(a+s*go+n%go).toISOString()}function Tl(e,t=0,r=7){return t>=e.length?r>>>0:Tl(e,t+1,r*31+(e.codePointAt(t)??0)>>>0)}function RA(e,t){if(t?.kind!=="number"||t.min==null||t.max==null)throw new Error("number value space requires min and max constraints");let r=t.max-t.min+1;return r<=0?t.min:t.min+e%r}var kA=["ada","bruno","carmen","dario","elena","felix","greta","hugo","iris","jonas","kira","lena","mateo","nadia","oscar","petra","quinn","rosa","stefan","tara","ugo","vera","wim","yara"],EA=["abreu","berg","costa","duval","eriksen","fischer","garza","holm","ito","jansen","kovac","laurent","moreau","novak","okafor","petrov","quist","rossi","sato","tanaka","ueda","vargas","weber","zhang"],CA=["amber","brisk","calm","deep","early","fond","glad","hazel","ivory","jade","keen","lush","mauve","noble","opal","plum","quiet","rapid","sage","teal","umber","vivid","warm","zesty"],AA=["aspen","brook","cedar","dune","ember","fjord","grove","harbor","isle","juniper","knoll","lagoon","meadow","nimbus","orchid","prairie","quartz","ridge","summit","thicket","umbra","vale","willow","zephyr"];function yo(e,t){let r=e[t%e.length];if(r==null)throw new Error("empty word list");return r}function bo(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function IA(e,t){let r=yo(kA,t),n=yo(EA,Math.floor(t/31)),i=yo(CA,t),o=yo(AA,Math.floor(t/29));return e==="internet.email"?`${r}.${n}${String(t%100)}@test.ripplo.ai`:e==="internet.url"?`https://${i}-${o}.example.com`:e==="person.fullName"?`${bo(r)} ${bo(n)}`:e==="company.name"?`${bo(i)} ${bo(o)}`:e==="lorem.slug"?`${i}-${o}`:`${o}-${String(t%1e3)}`}import{ResultAsync as Ll}from"neverthrow";var Nn=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}};function Nl(e){return{read:t=>PA(t,e),seedScript:t=>`globalThis[${JSON.stringify(Ma)}] = ${JSON.stringify(t)};`}}async function PA(e,t){let r={title:await e.title(),url:Et(e.url()),viewport:OA(e.viewportSize())};if(t.length===0)return r;let n=await e.evaluate(MA,{mountKey:Hi,names:t,timeoutMs:TA});if(n.kind==="unmounted")throw new Nn(Hi);return{...r,...n.values}}var TA=5e3;async function MA(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(n=>setTimeout(n,25));let r=Reflect.get(globalThis,e.mountKey);return r==null?{kind:"unmounted"}:{kind:"values",values:Object.fromEntries(e.names.map(n=>[n,r.readSingleton(n)??null]))}}function OA(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}function Dl(e,t,r){return{evaluate:n=>Ll.fromPromise(rm(NA(e,r,n),`check ${n.kind}`),em),observe:()=>t.read().andThen(n=>Ll.fromPromise(rm(nm(e,r,0),"observe"),em).map(i=>({snapshot:{...n,singletons:{...n.singletons,...i}}}))),perform:n=>Ll.fromPromise(om(e,n,0),i=>Gp(n.kind,i))}}async function NA(e,t,r){try{return await lm(e,t,r)}catch(n){if(im(n))return!1;throw n}}function em(e){return e instanceof Nn?Bp(e.mountKey):Hp(e)}var LA=[100,250,500];async function nm(e,t,r){try{return await t.read(e)}catch(n){let i=LA[r];if(i==null||!im(n))throw n;return await am(i),nm(e,t,r+1)}}function im(e){let t=e instanceof Error?e.message:String(e);return/Execution context was destroyed|Cannot find context with specified id|[Ff]rame was detached|frame got detached/.test(t)}var tm=35e3;function rm(e,t){let r,n=new Promise((i,o)=>{r=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(tm)}ms`))},tm)});return Promise.race([e,n]).finally(()=>{clearTimeout(r)})}var $A=[250,750,2e3];async function om(e,t,r){try{await DA(e,t)}catch(n){let i=$A[r];if(i==null||!jA(n))throw n;await am(i),await om(e,t,r+1)}}async function DA(e,t){if(t.kind==="goto"){await e.goto(Dr(t.url,t,"url"));return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(Dr(t.key,t,"key"));return}await _A(sm(e,t.locator),t)}function Dr(e,t,r){if(e==null)throw new Error(`action "${t.kind}" requires ${r}`);return e}function _A(e,t){switch(t.kind){case"goto":throw new Error("goto must not be located");case"fill":return e.fill(String(Dr(t.value,t,"value")));case"clear":return e.clear();case"click":return e.click();case"dblclick":return e.dblclick();case"check":return e.check();case"uncheck":return e.uncheck();case"hover":return e.hover();case"select":return e.selectOption(String(Dr(t.value,t,"value")));case"upload":return e.setInputFiles(Dr(t.files,t,"files"));case"press":return e.press(Dr(t.key,t,"key"))}}function sm(e,t){if(t==null)throw new Error("action requires a locator");return $l(e,t)}function $l(e,t){return t.by==="testId"?e.getByTestId(t.value):t.by==="inside"?$l($l(e,t.scope),t.target):e.locator(FA(t.role,t.name))}function FA(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function jA(e){let t=e instanceof Error?e.message:String(e);return/net::ERR_|ERR_HTTP_RESPONSE_CODE_FAILURE|ECONNREFUSED|ECONNRESET|socket hang up|fetch failed|page\.goto: Timeout/.test(t)}function am(e){return new Promise(t=>{setTimeout(t,e)})}async function lm(e,t,r){if(r.kind==="browser")return VA(e,t,r.name,r.value);if(r.kind==="not")return!await lm(e,t,r.inner);let n=sm(e,r.locator);return r.kind==="visible"?n.isVisible():r.kind==="disabled"?n.isDisabled():r.kind==="enabled"?n.isEnabled():r.kind==="focused"?n.evaluate(i=>i===i.ownerDocument.activeElement):r.kind==="value"?await n.inputValue()===r.value:(await n.textContent()??"").includes(r.value)}async function VA(e,t,r,n){let o=(await t.read(e))[r];return typeof o=="string"&&o.includes(n)}async function _l({baseUrl:e,browser:t,capture:r,clientState:n,engine:i,reader:o,session:s}){let a=await t.newContext({baseURL:e,reducedMotion:"reduce",storageState:s==null?void 0:{cookies:s.cookies,origins:s.origins}});s?.headers!=null&&await a.setExtraHTTPHeaders(s.headers),await a.addInitScript(i.seedScript(n));let l=r==null?BA():await r.hub.attach(a,r.runId),u=await a.newPage();return l.onPage(u),{driver:UA(Dl(u,o,i),l),emitAssertion:l.emitAssertion,close:()=>WA({context:a,handle:l})}}async function Fl(e,t){let r=await cm(e);try{return await t(r)}finally{await r.close()}}function BA(){return{emitAction:()=>{},emitAssertion:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function cm(e){let{chromium:t}=await import("playwright");return t.launch({headless:!e})}function dm({headed:e}){let t;return{acquire:async()=>{let i=t;if(i!=null){let o=await i.catch(()=>{});if(o?.isConnected()===!0)return o;t===i&&(t=void 0)}return t??=cm(e),t},close:async()=>{let i=t;t=void 0,i!=null&&await i.then(o=>o.close()).catch(()=>{})}}}function UA(e,t){return{evaluate:e.evaluate,observe:e.observe,perform:r=>(t.emitAction(r),e.perform(r))}}async function WA({context:e,handle:t}){await um(t.finish()),await um(e.close())}var zA=15e3;async function um(e){let t,r=new Promise(n=>{t=setTimeout(n,zA)});await Promise.race([e.catch(()=>{}),r]).finally(()=>{clearTimeout(t)})}import{err as GA,ok as HA,Result as jl}from"neverthrow";function Vl(e,t,r){return{read:()=>r.read(e.map(n=>n.name),t).andThen(n=>qA(e,n))}}function qA(e,t){return jl.combine(e.map(r=>KA(r,t.entities[r.name]??[]).map(n=>[r.name,n]))).map(r=>({entities:new Map(r),singletons:t.singletons}))}function KA(e,t){let r=uo(e);return jl.combine(t.map(n=>YA(n,e).map(i=>[i,JA(n,r)]))).map(n=>new Map(n))}function YA(e,t){return jl.combine(t.identity.map(r=>{let n=e[r];return n==null?GA(Wp(t.name,r)):HA(String(n))})).map(r=>r.join(":"))}function JA(e,t){let r=t.map(n=>[n,e[n]]).filter(n=>n[1]!=null);return Object.fromEntries(r)}var pm=Pi(ha(),1);import ZA from"crypto";import{err as XA,errAsync as fm,ok as QA,ResultAsync as So}from"neverthrow";var eI=3e4,tI=[250,750,2e3];function Bl({baseUrl:e,runId:t,secret:r},n){let i=new pm.Webhook(r),o=(s,a,l)=>rI({baseUrl:e,body:a,path:s,retry:l.retry,schema:l.schema,signal:l.signal,webhook:i});return{query:{read:(s,a)=>o("/state",{entities:s,runId:t,singletons:a},{retry:"transient",schema:_a,signal:n}).map(l=>({entities:l.entities,singletons:l.singletons}))},setupWorld:s=>o("/setup",{entities:s,runId:t},{retry:"connection",schema:Da,signal:n}).map(a=>a.rows),teardown:()=>o("/teardown",{runId:t},{retry:"connection",schema:Fa,signal:void 0}).map(()=>{})}}function rI(e){return hm(e.retry,()=>aI(e),0)}function hm(e,t,r){return t().orElse(n=>{let i=tI[r];return i==null||!iI(n,e)?fm(n):So.fromSafePromise(sI(i)).andThen(()=>hm(e,t,r+1))})}var nI=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function iI(e,t){return e.kind==="aborted"?!1:oI(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function oI(e){return e.kind==="engine-network"&&e.code!=null&&nI.has(e.code)}function sI(e){return new Promise(t=>{setTimeout(t,e)})}function aI({baseUrl:e,body:t,path:r,schema:n,signal:i,webhook:o}){let s=JSON.stringify(t);return So.fromPromise(fetch(`${e}${r}`,{body:s,headers:{"Content-Type":"application/json",...lI(o,s)},method:"PUT",signal:uI(i)}),a=>to(r,a)).andThen(a=>cI(a,r)).andThen(a=>dI(n,a,r)).mapErr(a=>i?.aborted===!0?qp():a)}function lI(e,t){let r=`msg_${ZA.randomUUID()}`,n=new Date;return{"webhook-id":r,"webhook-signature":e.sign(r,n,t),"webhook-timestamp":String(Math.floor(n.getTime()/1e3))}}function uI(e){let t=AbortSignal.timeout(eI);return e==null?t:AbortSignal.any([e,t])}function cI(e,t){return e.ok?So.fromPromise(e.json(),r=>to(t,r)):So.fromPromise(e.text().catch(()=>""),r=>to(t,r)).andThen(r=>fm(Vp(t,e.status,r)))}function dI(e,t,r){let n=e.safeParse(t);return n.success?QA(n.data):XA(Up(r,n.error))}var le=Pi(ym(),1),W={actual:e=>le.default.red(e),bad:e=>le.default.red(le.default.bold(e)),bold:e=>le.default.bold(e),dim:e=>le.default.dim(e),expected:e=>le.default.green(e),good:e=>le.default.green(le.default.bold(e)),heading:e=>le.default.bold(le.default.cyan(e)),path:e=>le.default.cyan(le.default.underline(e)),warn:e=>le.default.yellow(le.default.bold(e))},mI={assertion:le.default.yellow,consistency:le.default.magenta,driver:le.default.red,illegal:le.default.cyan,invariant:le.default.yellow,unfireable:le.default.red};function Ln(e){return`${le.default.red(le.default.bold("\u2717"))} ${mI[e](le.default.bold(e.toUpperCase()))}`}var gI=le.default.red("\u2717"),lz=le.default.green("\u2713"),bm=le.default.dim("\u203A"),yI=8;function re(e,t,r){let n=r==null?"":` ${W.dim(r)}`;return` ${W.dim(e.padStart(yI))} ${t}${n}`}function _r(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${_r(e.scope)} \u25B8 ${_r(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function zl(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${_r(e.locator)}`:e.kind}function $n(e){return e.kind==="not"?`not ${$n(e.inner)}`:e.kind==="browser"?`${e.name}="${e.value}"`:e.kind==="value"||e.kind==="text"?`${e.kind} ${_r(e.locator)}="${e.value}"`:`${e.kind} ${_r(e.locator)}`}function Dn(e){let{field:t,source:r,target:n,targetField:i}=e.reference;return`${r}.${t} \u2192 ${n}.${i}`}function vm(e){return`${e.intent} \u203A ${zl(e.action)}`}function xm(e){return e.kind==="invariant"?`invariant ${Dn(e.invariant)}`:`${e.kind} ${$n(e.check)}`}function st(e){return e==null?"\u2205":JSON.stringify(e)}function Rm(e){return e.kind==="ghost-write"?`${e.entity} "${e.key}" exists in SUT but model expected none`:e.kind==="absent"?`${e.entity} "${e.key}" expected by model but absent in SUT`:e.kind==="field-mismatch"?`${e.entity}.${e.field} [${e.key}] model=${st(e.snapshot)} sut=${st(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${st(e.value)}`:`${e.singleton} model=${st(e.snapshot)} sut=${st(e.sut)}`}function Gl(e){return{label:xm(e.source),step:vm(e.step)}}function _n(e){return e.kind==="consistency"?CI(e):e.kind==="obligation"?OI(e.source,e.step,e.budget):e.kind==="illegal-transition"?pr("illegal","guard was false before this step",e.step,[re("meaning",W.dim("the action fired from a state the model says is unreachable"),void 0)]):e.kind==="unfireable"?pr("unfireable",`could not fire "${e.intent}"`,void 0,[re("reason",W.actual(Em(e.reason)),void 0),re("meaning",W.dim("a planned move was skipped \u2014 never silently drop it"),void 0)]):pr("driver","the browser failed to run this step",e.step,[re("cause",W.actual(Ct(e.error)),void 0),re("decide",W.dim("environment/infra failure \u2014 fix the run environment (daemon, dev server, ports); never weaken the model or app for a driver failure"),void 0)])}function km(e){return SI(wI(e))}var bI=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function SI(e){return e.replaceAll(bI,"").replaceAll(/\s+/g," ").trim()}function wI(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${Rm(e.divergence)}${t}`}return e.kind==="obligation"?`${LI(e.source)} failed at "${e.step.intent}": ${$I(e.source)}`:e.kind==="illegal-transition"?`guard was false before "${e.step.intent}" \u2014 the action fired from a state the model says is unreachable`:e.kind==="unfireable"?`could not fire "${e.intent}" \u2014 ${Em(e.reason)}`:`driver failed at "${e.step.intent}": ${Ct(e.error)}`}var vI={"guard-unsatisfied":"the guard isn't satisfied by the live state","no-effect":"the move has no observable effect from this state",unresolvable:"a step references a value the model can't resolve yet (e.g. a not-yet-created id)"};function Em(e){return vI[e]}function xI({debugDir:e,runId:t}){let r=`${e}/${t}`;return re("behavior",W.path(`${r}/behavior.jsonl`),void 0)}function RI(e){if(e.kind==="cascade-gap"){let{gap:n}=e,i=`${n.transition} deletes ${n.target} but leaves ${n.source} dangling`;return`${Ln("invariant")} ${W.bold(i)}
35
+ `);case"oauth-authorization-failed":return[`Sign-in failed (${e.code}): ${e.description}`,e.code==="expired_token"?"The approval window expired \u2014 run `npx ripplo auth login` again.":"Run `npx ripplo auth login` to retry."].join(`
36
+ `);case"compilation-failed":return Xi(e.error)}}function XR(e){let t=e.missingEnvFiles.length===0?[]:["Declared env files not found:",...e.missingEnvFiles.map(r=>` ${r}`),"In a git worktree? Env files aren't copied from the main checkout \u2014 recreate them, or symlink to a shared file outside the working tree."];return["Env config invalid:",...e.issues.map(r=>` ${r}`),"Add the missing values to the env files declared in .ripplo/project.json.",...t].join(`
37
+ `)}import{err as tk,ok as rk}from"neverthrow";import{z as Ua}from"zod";var QR="https://ripplo.ai";function vp(){return Rp().RIPPLO_SERVER_URL}function xp(){return Rp().RIPPLO_PROJECT_ID}var ek=Ua.object({RIPPLO_PROJECT_ID:Ua.string().min(1).optional(),RIPPLO_SERVER_URL:Ua.string().min(1).default(QR)}),wp;function Rp(){return wp??=ek.parse(process.env),wp}import kp from"fs";import Wa from"path";function Ep(e){let t=kp.realpathSync(e),r=t,n=Wa.dirname(r);for(;n!==r;){if(kp.existsSync(Wa.join(r,".git")))return r;r=n,n=Wa.dirname(r)}return t}function VB(e){return Sa(e).andThen(t=>ji().andThen(r=>{let n=fa();return n==null?tk({kind:"not-authenticated"}):rk({appUrl:r.appUrl,cwd:Ep(e),engineUrl:r.engineUrl,projectId:xp()??t.projectId,ripploServerUrl:vp(),token:n,webhookSecret:r.webhookSecret})}))}import Cp from"fs";import{checkSync as nk,lockSync as ik}from"proper-lockfile";var ok="dev.pid",Ap=15e3;function Ip(e){return Ut(e,ok)}function Pp(e){try{return nk(Ip(e),{realpath:!1,stale:Ap})}catch{return!1}}var za=class extends Error{pid;cwd;constructor({cwd:t,pid:r}){super("dev-lock-held"),this.name="DevLockHeldError",this.pid=r,this.cwd=t}};function GB({cwd:e,onCompromised:t}){ca(e);let r=Ip(e),n=sk({cwd:e,onCompromised:t,path:r});return Cp.writeFileSync(r,String(process.pid)),()=>{try{n()}catch{}}}function sk({cwd:e,onCompromised:t,path:r}){try{return ik(r,{realpath:!1,stale:Ap,onCompromised:()=>{t()}})}catch(n){throw ak(n)?new za({cwd:e,pid:lk(r)}):n}}function ak(e){if(!(e instanceof Error)||!("code"in e))return!1;let{code:t}=e;return t==="ELOCKED"}function lk(e){try{let t=Cp.readFileSync(e,"utf8").trim(),r=Number.parseInt(t,10);return Number.isFinite(r)&&r>0?r:null}catch{return null}}import{createServer as hk}from"http";import{mkdir as mk,rm as gk,writeFile as yk}from"fs/promises";import bk from"path";import{z as te}from"zod";import uk from"path";import{z as Sn}from"zod";var ck=["unspecified","internal","server","client","producer","consumer"],dk=["unset","ok","error"];function Tp(e){return ck[e]??"unspecified"}function Mp(e){return dk[e]??"unset"}var YB=Sn.looseObject({data:Sn.looseObject({source:Sn.number().optional()}).optional(),timestamp:Sn.number(),type:Sn.number()});function Op({debugDir:e,runId:t,worker:r}){let n=uk.join(e,t,"behavior.jsonl");return r.open({file:n,runId:t}),{close:i=>r.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(fk(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:pk(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 fk(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function pk(e){return Number(BigInt(e)/1000000n)}var Sk="otlp-port",Lp=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()})}),wk=te.object({attributes:te.array(Lp).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()}),vk=te.object({resourceSpans:te.array(te.object({resource:te.object({attributes:te.array(Lp).default([])}).optional(),scopeSpans:te.array(te.object({spans:te.array(wk).default([])})).default([])})).default([])});async function Ga({localDir:e,onRrwebBatch:t,onSpan:r,writePortFile:n}){let{port:i,server:o}=await xk({onRrwebBatch:t,onSpan:r}),s=bk.join(e,Sk);return n&&(await mk(e,{recursive:!0}),await yk(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{n&&await gk(s,{force:!0}),await Ak(o)}}}function xk(e){return new Promise((t,r)=>{let n=hk((i,o)=>{Rk(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 Rk(e,t,r){let n=kk(e.url);if(n!=null){Np(e).then(i=>{r.onRrwebBatch(n,i),eo(t)}).catch(()=>{eo(t)});return}Np(e).then(i=>{Ek(vk.parse(JSON.parse(i.toString("utf8"))),r.onSpan),eo(t)}).catch(()=>{eo(t)})}function kk(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function Np(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 Ek(e,t){e.resourceSpans.flatMap(r=>r.scopeSpans).flatMap(r=>r.spans).forEach(r=>{t({attributes:Ck(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:Tp(r.kind),status:{code:Mp(r.status?.code??0),message:r.status?.message},timeNanos:r.startTimeUnixNano,traceId:r.traceId})})}function Ck(e){return Object.fromEntries(e.map(({key:t,value:r})=>[t,String(r.stringValue??r.intValue??r.doubleValue??r.boolValue??"")]))}function Ak(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 Ha(e,t,r){return Mr(e,String(t))===Mr(e,String(r))}function Dp(e,t,r){return e!=="url"?Ha(e,t,r):$p(String(t))===$p(String(r))}function $p(e){return new URL(e,"https://ripplo.invalid").pathname}function qa({actual:e,canon:t,pre:r,predicted:n}){return[...[...new Set([...n.entities.keys(),...e.entities.keys()])].flatMap(s=>Ik({actual:e.entities.get(s),canon:t,entity:s,pre:r.entities.get(s),predicted:n.entities.get(s)})),...Tk(r.singletons,n.singletons,e.singletons)]}function Ik({actual:e,canon:t,entity:r,pre:n,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>Pk({actual:e?.get(s),canon:t,entity:r,key:s,predicted:i?.get(s),preHadKey:n?.has(s)??!1,preRow:n?.get(s)}))}function Pk({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)=>jp(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 jp(e,t){return _p(e)===_p(t)}function _p(e){return e==null?"\u2205":JSON.stringify(e)}function Tk(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||Fp(i,o,s)?[]:[{divergence:{kind:"singleton-mismatch",singleton:i,snapshot:o,sut:s},pending:e[i]!==void 0&&Fp(i,e[i],s)}]})}function Fp(e,t,r){let n=Rt.safeParse(e);return n.success?Dp(n.data,t,r):jp(t,r)}function Ka(e){let t=Mk(e.entities),r=Ok(e.singletons);return n=>Nk(n,t,r)}function Mk(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([r,n])=>[Vp(t.name,r),n.consistency])))}function Vp(e,t){return`${e}.${t}`}function Ok(e){return new Map(e.map(t=>[t.name,t.consistency]))}function Nk(e,t,r){return e.kind==="singleton-mismatch"?Lk(e.singleton,r):e.kind==="ghost-write"||e.kind==="absent"?"strict":t.get(Vp(e.entity,e.field))??"strict"}function Lk(e,t){return Rt.safeParse(e).success?t.get(e)??"eventual":t.get(e)??"strict"}function Ya(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 Up(e,t,r){return{detail:r.slice(0,500),kind:"engine-http",path:e,status:t}}function to(e,t){return{code:Zp(t),kind:"engine-network",message:vn(t),path:e}}function Wp(e){return{kind:"client-mount-missing",mountKey:e}}function zp(e,t){return{kind:"engine-decode",message:vn(t),path:e}}function Gp(e,t){return{entity:e,field:t,kind:"state-identity"}}function Hp(e){return{as:e,kind:"setup-missing-row"}}function wn(e){return{kind:"driver-launch",message:vn(e)}}function qp(e,t){return{action:e,kind:"action-failed",message:vn(t)}}function Kp(e){return{kind:"check-failed",message:vn(e)}}function Yp(){return{kind:"aborted"}}var Bp=300;function Ct(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${$k(e.detail)}${Dk(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 Jp(e){throw new Error(Ct(e))}function ro(){}function $k(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=Bp?t:`${t.slice(0,Bp)}\u2026 [truncated]`}function Dk(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 vn(e){return e instanceof Error?e.message:String(e)}var el=Pi(th(),1),dU=el.default.configure,no=el.default;function J(e){return no(e)??""}function At(e,t){return[...new Map(e.map(r=>[t(r),r])).values()]}function tl(e){return At(e,J)}function rh(e){return J(e)}var Rn=class extends Error{name="AbortError";constructor(){super("aborted")}};function nh(e){return e instanceof Error&&e.name==="AbortError"}function Ht(e){if(e.aborted)throw new Rn}function rl(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 uh(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var zk=()=>[];async function ol({canon:e,classify:t,initialSnapshot:r,lawObligations:n,observe:i,onAssertion:o,onStep:s,steps:a},l){return ch({acc:[],canon:e,classify:t,index:0,lawObligations:n??zk,observe:i,onAssertion:o,onStep:s,signal:l,snapshot:r,steps:a})}async function ch({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 nl(a,{endMs:Date.now(),findings:[h],index:n,post:u,pre:u,startMs:p,url:il(u)}),{finalModel:u,findings:[...e,h]}}return d.perform().match(()=>Gk({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 nl(a,{endMs:Date.now(),findings:[f],index:n,post:u,pre:u,startMs:p,url:il(u)}),Promise.resolve({finalModel:u,findings:[...e,f]})})}async function Gk({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 Xk({canon:t,classify:r,observe:o,pre:u,predicted:h,signal:l,step:d}),m=[...d.obligations,...i(u,f.snapshot)],g=[...await Hk({obligations:m,onAssertion:s,signal:l,step:d}),...f.findings];return nl(a,{endMs:Date.now(),findings:g,index:n,post:f.snapshot,pre:u,startMs:c,url:il(f.snapshot)}),ch({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 Hk({obligations:e,onAssertion:t,signal:r,step:n}){let i=[...new Map(e.map(s=>[rh(s.source),s])).values()],o=await Promise.all(i.map(async s=>({obligation:s,outcome:await qk(s,r)})));return o.forEach(s=>{Kk(t,s.obligation,s.outcome,n)}),o.flatMap(s=>Jk(s.obligation,s.outcome,n))}function qk(e,t){if(e.check.kind==="decided"){let r=e.check.passed?"passed":"failed";return Promise.resolve({kind:r})}return Qk(e.budget,e.check.run,t)}function Kk(e,t,r,n){e?.({outcome:Yk(r),source:t.source,step:n.step})}function Yk(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function Jk(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 nl(e,t){e?.(t)}function il(e){let t=e.singletons.url;return typeof t=="string"?t:null}var kn={async:12e4,fast:5e3,slow:3e4},dh={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 fh(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function ih(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 oh({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,...qa({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function ph(e,t){return{budget:t.settle,divergence:e.divergence,kind:"consistency",pending:e.pending,step:t.step}}function sh(e,t,r){let n=e.probed.filter(i=>!i.pending&&r(i.divergence)==="strict");return n.length>0?{findings:n.map(i=>ph(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function ah(e,t,r){return{findings:[...e.probed.map(n=>ph(n,t)),...r],snapshot:e.adopted}}async function Xk({canon:e,classify:t,observe:r,pre:n,predicted:i,signal:o,step:s}){let a=dh[s.settle],l=Date.now()+a.timeoutMs,u=await ih(r);if(!u.ok)return{findings:[io(u.error,s)],snapshot:i};let c=oh({canon:e,pre:n,predicted:i,step:s},u.observed),d=0;for(;Date.now()<l;){Ht(o);let p=sh(c,s,t);if(p!=null)return p;await rl(fh(a,d),o),d+=1;let h=await ih(r);if(!h.ok)return ah(c,s,[io(h.error,s)]);c=oh({canon:e,pre:n,predicted:i,step:s},h.observed)}return sh(c,s,t)??ah(c,s,[])}async function Qk(e,t,r){let n=dh[e],i=Date.now()+n.timeoutMs,o=await lh(t),s=0;for(;o.kind==="pending"&&Date.now()<i;)Ht(r),await rl(fh(n,s),r),s+=1,o=await lh(t);return o.kind==="pending"?{kind:"failed"}:o}function lh(e){return e().match(t=>t?{kind:"passed"}:{kind:"pending"},t=>({error:t,kind:"error"}))}import{z as eE}from"zod";var al=eE.string().brand(),ee=al.parse("");function It(e){return al.parse(e)}function qe(e,t){return al.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 sl(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 tE(e).every(n=>r.has(qe(t,n)))}function nt(e,t,r){return typeof e=="string"?e:Ie(e)?String(sl(e,t,r)):e.template.map(n=>typeof n=="string"?n:String(sl(n,t,r))).join("")}function it(e,t,r){return e===null||typeof e=="number"||typeof e=="boolean"?e:Ie(e)?sl(e,t,r):nt(e,t,r)}function hh(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 tE(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 mh(e,t,r){return t.reduce((n,i)=>rE(n,i,r,e),e)}function gh(e,t){return Object.keys(t).length===0?e:{...e,singletons:{...e.singletons,...t}}}function rE(e,t,r,n){if(!nE(t,r))return e;if(t.assertion.kind==="created"){let o=Or(t.assertion.props,ee,r);return iE(e,t.entity,En(o),o)}if(t.assertion.kind==="deleted")return ll(e,t.entity,lE(t.key,r,n));let i=Or(dr(t.assertion.props),ee,r);return ll(e,t.entity,uE(t.key,i,r,n))}function nE(e,t){return("props"in e.assertion?[e.key,dr(e.assertion.props)]:[e.key]).every(n=>Object.values(n).every(i=>Sh(i)||!Ie(i)||t.has(It(i.ref))))}function iE(e,t,r,n){let i=new Map([...e.entities.get(t)??[],[r,n]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function ll(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 yh(e,t,r,n,i){let o={env:n,key:r,snapshot:e};return ll(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])=>bh(e[r],n,t))}function bh(e,t,r){return Sh(t)?oE(t,r).has(so(e)):so(e)===so(aE(t,r.env))}function Sh(e){return typeof e=="object"&&e!==null&&"kind"in e}function oE(e,t){let r=t.snapshot.entities.get(e.selection.entity);return r==null?new Set:new Set([...r.values()].filter(n=>sE(n,e.selection.where,t)).map(n=>so(n[e.field])))}function sE(e,t,r){return Object.entries(t).every(([n,i])=>bh(e[n],i,r))}function so(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function aE(e,t){return it(e,ee,t)}function lE(e,t,r){let n={env:t,key:e,snapshot:r};return i=>new Map([...i].filter(([,o])=>!ao(o,n)))}function uE(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 xh(e){let t=e.predicates.filter(o=>Ch(o)),r=t.filter(o=>o.assertion.kind==="created"),n=Eh(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)=>gE(c,s,d,e.env),{env:e.env,snapshot:o}),l=n.reduce((c,d)=>mE(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>dE(c,s,d),a.env);return cE(bE(l,e.deferred,u),s,e.adopt)}}function cE(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 Rh(e,t,r){return new Map([...e,...Object.entries(r).map(([n,i])=>[qe(ee,`${t}.${n}`),i])])}function dE(e,t,r){let n=Cn(t.snapshot,r.entity,r.key,e).at(0);return n==null?e:Rh(e,r.assertion.as,n)}function kh(e){let t=Eh(e.predicates.filter(r=>Ch(r)));if(t.length!==0)return(r,n)=>t.flatMap(i=>fE(i,r,n,e.env))}function Eh(e){return e.filter(t=>t.assertion.kind==="updated"&&ul(t.assertion.props).length>0)}function ul(e){return Object.entries(e).filter(([,t])=>qt(t)).map(([t])=>t)}function Ch(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function fE(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(pE(e.key,n));return ul(e.assertion.props).flatMap(a=>wh(i[a])===wh(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function pE(e,t){let r=Object.fromEntries(Object.entries(e).filter(n=>!hE(n[1])));return Or(r,ee,t)}function hE(e){return typeof e=="object"&&e!==null&&"kind"in e}function wh(e){return e==null?"\u2205":JSON.stringify(e)}function mE(e,t,r,n){let i=ul(r.assertion.props),o=Cn(t.snapshot,r.entity,r.key,n).at(0);return o==null?e:yh(e,r.entity,r.key,n,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function gE(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=yE(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:Rh(e.env,r.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(r.entity,c)}}}function yE(e,t,r){if(e!=null)return[...e].find(([n,i])=>!t.has(n)&&Object.entries(r).every(([o,s])=>vh(i[o])===vh(s)))}function vh(e){return e==null?"\u2205":JSON.stringify(e)}function bE(e,t,r){let n=t.reduce((i,o)=>{let s=SE(o.value,r);return s==null?i:{...i,[o.name]:Mr(o.name,s)}},e.singletons);return{...e,singletons:n}}function SE(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=CE(r),{adopt:i,conditional:o,deferred:s,immediate:a}=xE(e,t,n);return{action:AE(e.action,t),label:e.action.kind,obligations:e.expect.flatMap(l=>PE(l,t)),reconcile:xh({adopt:i,deferred:s,env:t,predicates:r}),verifyChanges:kh({adopt:i,deferred:s,env:t,predicates:r}),effect:l=>{let u=mh(l,r,t),c=o.reduce((d,p)=>({...d,...cl(p,u,t)}),{});return gh(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 cl(e,t,r){return e==null?{}:e.kind==="when"?dl(e.condition,t,r)?cl(e.consequence,t,r):cl(e.otherwise,t,r):vE(e,r)}function dl(e,t,r){if(!wE(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!dl(e.predicate,t,r);case"and":return e.predicates.every(n=>dl(n,t,r))}}function wE(e){return e.kind==="singleton"||e.kind==="count"||e.kind==="not"||e.kind==="and"}function vE(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)?Ah(e,t):{}}function xE(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"&&RE(a.value,r)?{...s,deferred:[...s.deferred,{name:a.name,value:a.value}]}:a.kind==="browser"||a.kind==="singleton"?{...s,immediate:{...s.immediate,...Ah(a,t)}}:a.kind==="when"?{...s,conditional:[...s.conditional,a]}:s,{adopt:o,conditional:[],deferred:[],immediate:i})}function RE(e,t){return kE(e).some(r=>t.has(r.split(".")[0]??r))}function kE(e){return typeof e=="string"?[]:Ie(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function Ah(e,t){if(e.kind==="browser")return{[e.name]:EE(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 EE(e,t){return Mr(e.name,nt(e.value,ee,t))}function CE(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function AE(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:IE(e,t),url:e.kind==="goto"?nt(e.url,ee,t):void 0,value:"value"in e?hh(e.value,t):void 0}}function IE(e,t){if(!(!("locator"in e)||e.locator==null))return An(e.locator,t)}function PE(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 TE,ok as ME,okAsync as OE,Result as NE}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=VE(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]))};BE(n.params,ee,o);let s=n.world.map(a=>UE(a,ee,o));return r.materialize(s).map(a=>LE({base:HE(a,o.env,i),generatedParams:o.generatedParams,lockfile:e,test:n}))}function pl(e,t){let r=new Map(t.map(n=>[n.name,n]));return n=>OE(_E(n,e,r).rows)}function hl(e){return t=>{let r=t.map(n=>({as:n.as,entity:n.entity,fields:n.fields}));return e(r).andThen(n=>DE(t,n))}}function Ih(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 LE({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])=>$E(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 $E(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 DE(e,t){let r=new Map(t.map(n=>[n.as,n]));return NE.combine(e.map(n=>{let i=r.get(n.as);return i==null?TE(Hp(n.as)):ME({as:n.as,entity:n.entity,generatedFields:n.generatedFields,row:i.row,session:i.session})}))}function _E(e,t,r){return e.reduce((n,i)=>{let o=FE(i.fields,n.env),s=KE({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 FE(e,t){return Object.fromEntries(Object.entries(e).map(([r,n])=>{if(Ie(n))return[r,jE(t,n.ref)];if(mt(n))throw new Error(`template value not allowed in entity field "${r}"`);return[r,n]}))}function jE(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 VE(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function BE(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 UE(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=WE(e.set,t,r.env),s=GE(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 WE(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,zE(i,t,r)]))}function zE(e,t,r){if(!Ie(e))return e;let n=qe(t,e.ref);return r.get(n)??{ref:n}}function GE(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,Ph({field:i,generate:n.generate,model:e,seedPrefix:r,spec:o,valueSpaces:n.indexed.valueSpaces})]))}function HE(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(fl(a.row,l),Ih(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:fl(a.row,l)}]}),s=e.flatMap(a=>{let l=r.models.get(a.entity);if(l==null)return[];let u=fl(a.row,l);return a.generatedFields.map(c=>({entity:a.entity,field:c,key:u}))});return{aliases:o,auth:qE(i),env:t,generated:s,snapshot:{entities:YE(n),singletons:{}}}}function qE(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 KE({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,Ph({field:s,generate:e,model:t,seedPrefix:r,spec:a,valueSpaces:i})])),...n}}function Ph({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 fl(e,t){return t.identity.map(r=>String(e[r])).join(":")}function YE(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=Dh(e,t),n=Oh(r,e),i=Th(n,r.singletons),o=bC(r,yC(e));return JE(i,SC(r.steps),n).map(({chunk:a,guard:l},u)=>mC({chunk:a,guard:l,index:u,intent:r.intent,namespace:n.namespace,paramSpaceOf:o,testName:t}))}function Th(e,t){return{absences:pC(e),entities:hC(e),exclusives:e.exclusives,optionals:$h(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)?gl(n.ref,r):[]).find(n=>n.entity===t)?.aliasPath}function JE(e,t,r){return t.reduce((n,i)=>({guard:ZE(n.guard,i,r),guarded:[...n.guarded,{chunk:i,guard:uC(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)=>XE(i,o,r),e);return{...n,singletons:{...n.singletons,...sC(t)}}}function XE(e,t,r){return t.assertion.kind==="deleted"?QE(e,t,r):t.assertion.kind==="created"?rC(e,t.entity,t.assertion.as,t.assertion.props,r):iC(e,t,r)}function QE(e,t,r){let n=fo(t.key,t.entity,r.namespace),i=e.entities.find(a=>a.alias===n),o=Tn(eC(t.key),t.entity,r),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...tC(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==n)}}function eC(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let r=t[1];return Lh(r)?[]:[[t[0],r]]}))}function tC(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(r=>!t.relations.some(n=>n.field===r.field)),...t.relations]}}function rC(e,t,r,n,i){let o=Tn(n,t,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!nC(o,s)),entities:[...e.entities,{alias:r,entity:t,...o}]}}function nC(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 iC(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?oC(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a)),optionals:e.optionals.map(a=>s(a))}}function oC(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 sC(e){return e.reduce((t,r)=>({...t,...aC(r),...lC(r)}),{})}function aC(e){return e.action.kind==="goto"?{url:e.action.url}:{}}function lC(e){return Object.fromEntries(e.expect.flatMap(t=>t.kind==="browser"?[[t.name,t.value]]:t.kind==="singleton"?[[t.singleton,t.assertion.value]]:[]))}function uC(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=Dh(e,t),n=Oh(r,e);return{guard:Th(n,r.singletons),namespace:n.namespace,stable:n.stable}}function Mh(e,t){return[...new Set(e)].flatMap(r=>gl(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=>Nh(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 Oh(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:cC(t)}}function cC(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 Nh(e){return Lh(e)?Object.values(e.selection.where).flatMap(t=>Nh(t)):ot(e)}function Lh(e){return typeof e=="object"&&e!==null&&"kind"in e}function dC(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 fC(e){return[...dC(e.action),...e.expect.flatMap(t=>Kt(t))]}function pC(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=gl(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 $h(e,t){return e.map(r=>({alias:r.as,entity:r.entity,...Tn(r.set,r.entity,t)}))}function hC(e){return $h(e.setups,e)}function mC(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=>fC(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:uh(n.flatMap(s=>gC(s)))}}function gC(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function gl(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 Dh(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 yC(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function bC(e,t){return new Map(Object.entries(e.params).map(([r,n])=>[r,t.get(n.valueSpace)]))}function SC(e){return ml(e,0,[],[])}function ml(e,t,r,n){let i=e[t];if(i==null)return r.length===0?n:[...n,r];let o=[...r,i];return wC(i)?ml(e,t+1,[],[...n,o]):ml(e,t+1,o,n)}function wC(e){return e.expect.some(t=>t.kind==="state")}function _h(e){return Fh(e,new Map)}function vC(e,t){return e.reduce((r,n)=>r??t(n),null)}function Fh(e,t){let r=e.variables.find(n=>!t.has(n));return r==null?t:vC(e.domain(r),n=>{let i=new Map([...t,[r,n]]);return e.consistent(i)?Fh(e,i):null})}function yt(e,t){let r=xC(e,t);if(r==null)return null;let n=IC(r);return PC(e.singletons,t,n)?n:null}function xC(e,t){let{absences:r,entities:n,exclusives:i,optionals:o}=e,s=new Map(n.map(u=>[u.alias,u])),a=_h({variables:n.map(u=>u.alias),consistent:u=>RC(u)&&kC(n,u)&&CC(r,u,t),domain:u=>Bh(s.get(u),t)});if(a==null)return null;let l=Uh(o,a,t);return AC(i,[...n,...o],l,t)?l:null}function RC(e){let t=[...e.values()];return new Set(t).size===t.length}function kC(e,t){return e.every(r=>t.has(r.alias)?r.relations.every(n=>EC(r,n,t)):!0)}function EC(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 CC(e,t,r){return e.every(n=>![...r.entities.get(n.entity)?.values()??[]].some(i=>jh(i,n,t)))}function jh(e,t,r){return Vh(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 Vh(e,t){return Object.entries(t.literals).every(([r,n])=>n===null?e[r]==null:e[r]===n)}function Bh(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(r=>Vh(r,e))}function Uh(e,t,r){let n=e.reduce((i,o)=>{if(i.has(o.alias))return i;let s=new Set(i.values()),a=Bh(o,r).find(l=>!s.has(l)&&jh(l,o,i));return a==null?i:new Map([...i,[o.alias,a]])},t);return n.size===t.size?n:Uh(e,n,r)}function AC(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 IC(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 PC(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?Ha(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=OC(e,t),i=[...e.nav,...e.steps].map(o=>In(o,t));return{effect:NC(r.effect,n),steps:i.map(o=>({action:o.action,effect:o.effect,obligations:o.obligations,reconcile:o.reconcile,verifyChanges:o.verifyChanges}))}}function yl(e,t,r){return yt(e.guard,r)==null?!1:fr(t(r))!==fr(r)||LC(e)||TC(e)}function TC(e){return[...e.nav,...e.steps].every(t=>t.expect.every(r=>r.kind!=="state"))}var Wh=new WeakMap;function fr(e){let t=Wh.get(e);if(t!=null)return t;let r=J({entities:[...e.entities].map(([n,i])=>[n,[...i]]),singletons:MC(e.singletons)});return Wh.set(e,r),r}function MC(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>t==="url"&&typeof r=="string"?[t,Et(r)]:[t,r]))}function OC(e,t){let r=e.nav.at(-1);return r==null?void 0:In(r,t).action.url}function NC(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 LC(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=$C(e,n);return i==null||!yl(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function zh(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 $C(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 DC={absences:[],entities:[],exclusives:[],optionals:[],singletons:{}};function On(e){return{...DC,...e}}function bl(e){return _C(e).flatMap(t=>FC(t))}function _C(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 FC(e){if(e.length<2)return[];let t=e.map(o=>new Set(o.when.entities.map(s=>Gh(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?[]:jC(i,n,BC(e))}function Gh(e){return J([e.entity,e.literals])}function jC(e,t,r){let n=e.when.entities.filter(s=>t.includes(Gh(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=>VC(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 VC(e,t){return{...e,relations:e.relations.filter(r=>t.has(r.targetAlias))}}function BC(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function UC(e){return e.flatMap((t,r)=>e.slice(r+1).flatMap(n=>Yh(t,n)))}function Kh(e,t){return Yh(e,t).length>0}function Yh(e,t){let r=Hh(e.when,t.when);return!r&&!Hh(t.when,e.when)||!zC(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:r?t.when:e.when}]}function Hh(e,t){return Sl(e.entities,t.entities)&&Sl(e.absences,t.absences)&&Sl(e.optionals,t.optionals)&&e.exclusives.every(r=>t.exclusives.includes(r))&&WC(e.singletons,t.singletons)}function Sl(e,t){let r=new Set(t.map(n=>J(n)));return e.every(n=>r.has(J(n)))}function WC(e,t){return Object.entries(e).every(([r,n])=>J(t[r])===J(n))}function zC(e,t){return e.kind==="not"?wl(e.predicate,t):t.kind==="not"?wl(e,t.predicate):GC(e,t)||HC(e,t)}function wl(e,t){return e.kind===t.kind&&"locator"in e&&"locator"in t&&Jh(e,t)}function Jh(e,t){return"locator"in t&&J(e.locator)===J(t.locator)}function GC(e,t){let r=new Set([e.kind,t.kind]);return r.has("enabled")&&r.has("disabled")&&"locator"in e&&"locator"in t?Jh(e,t):!1}function HC(e,t){let r=qh(e),n=qh(t);return r==null||n==null||e.kind!==t.kind?!1:wl(e,t)&&J(r)!==J(n)}function qh(e){return e.kind==="value"||e.kind==="text"?e.value:null}function qC(e,t){return e.flatMap(r=>{let n=KC(r),i=new Set(r.guard.absences.map(o=>o.entity));return t.flatMap(o=>YC(r,o,n,i))})}function KC(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(r=>r.kind==="state"&&r.assertion.kind==="deleted"?[r.entity]:[])))}function YC(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 xl(e){return J({consequence:e.consequence,when:e.when})}function Rl(e){let t=[...JC(e),...sA(e)],r=bl(t).reduce((n,i)=>[...t,...n].some(s=>Kh(i,s))?n:[...n,i],[]);return At([...t,...r],xl)}function kl(e){return e.kind==="not"?kl(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="value"||e.kind==="text"}function El(e,t,r){if(yt(e.when,t)!=null)return null;let n=yt(e.when,r);return n==null?null:lA(e,n)}function JC(e){return At(e.tests.flatMap(t=>ZC(e,t)),xl)}function ZC(e,t){let r=po(e,t.name);return t.steps.reduce((n,i)=>({guard:XC(n.guard,i,r),laws:[...n.laws,...oA(i,n.guard,r.namespace,{kind:"test",test:t.name})]}),{guard:r.guard,laws:[]}).laws}function XC(e,t,r){return t.expect.reduce((n,i)=>i.kind==="state"?QC(n,i,r):n,e)}function QC(e,t,r){if(t.assertion.kind==="created"){let o=eA(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 nA(e,n);let i=dr(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===n?vl(o,i,r):o),optionals:e.optionals.map(o=>o.alias===n?vl(o,i,r):o)}}function eA(e,t,r,n){return vl({alias:e,entity:t,literals:{},relations:[]},r,n)}function vl(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=tA(o.ref,i,r.namespace);return{...n,literals:rA(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 tA(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 rA(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>r!==t))}function Zh(e,t){return e.filter(r=>r.field!==t)}function nA(e,t){let r=[...e.entities,...e.optionals].find(i=>i.alias===t),n=iA(e,t);return r==null?n:{...n,absences:[...n.absences,{entity:r.entity,literals:r.literals,relations:r.relations}]}}function iA(e,t){return{...e,entities:e.entities.filter(r=>r.alias!==t),optionals:e.optionals.filter(r=>r.alias!==t)}}function oA(e,t,r,n){if(e.action.kind!=="goto")return[];let i=e.action.url;return e.expect.filter(o=>kl(o)).map(o=>Xh({consequence:o,guard:t,namespace:r,origin:n,url:i}))}function Xh({consequence:e,guard:t,namespace:r,origin:n,url:i}){return{consequence:e,origin:n,refs:new Set(Mh([...ot(i),...Kt(e)],r).map(o=>o.aliasPath)),when:{...t,singletons:{...t.singletons,url:i}}}}function sA(e){return At(Nr(e).flatMap(t=>aA(t)),xl)}function aA(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?[]:[Xh({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 lA(e,t){try{let r=lo(e.consequence,t);return r==null?null:{check:r}}catch{return null}}function Cl(e){return tl(e.tests.flatMap(t=>uA(e,t.name)))}function Al(e,t){return yt(e.when,t)==null?!1:yt(e.holds,t)==null}function uA(e,t){let r=po(e,t);return r.guard.entities.flatMap(n=>n.relations.flatMap(i=>cA(e,n,i,r.namespace)?pA(n,i,r.namespace):[]))}function cA(e,t,r,n){let i=n.get(r.targetAlias);return i!=null&&!dA(e,t.entity,r.field)&&fA(e,i,r.targetField)}function dA(e,t,r){return e.entities.find(n=>n.name===t)?.props[r]?.optional===!0}function fA(e,t,r){return e.entities.find(n=>n.name===t)?.identity.includes(r)===!0}function pA(e,t,r){let n=r.get(t.targetAlias);if(n==null)return[];let i=Qh(e.alias,e.entity),o=Qh(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 Qh(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function em(e,t){let r=[...t.entities].flatMap(([o,s])=>[...s].map(([a,l])=>hA({entity:o,key:a,pre:e,row:l}))),n=[...e.entities].flatMap(([o,s])=>[...s].flatMap(([a,l])=>mA({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 hA({entity:e,key:t,pre:r,row:n}){let i=gA(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 mA({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 gA(e,t){return e?.get(t)}function Il(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 tm(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:zh(n,e.state,r),test:n.test};return{label:gt(n),next:e.state,result:{finalModel:e.state.snapshot,findings:[s]}}}let o=await ol({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,lawObligations:bA(e.laws,e.invariants,e.driver),observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,steps:Il(e.firing.transition,i.resolved,e.driver)},t);return{label:gt(e.firing.transition),next:{snapshot:o.finalModel},result:o}}function yA(e,t){return Al(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},source:{invariant:e,kind:"invariant"}}]:[]}function bA(e,t,r){return(n,i)=>[...e.flatMap(o=>SA(o,n,i,r)),...t.flatMap(o=>yA(o,i))]}function SA(e,t,r,n){let i=El(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 Tl(e,t){return Pl({acc:{findings:[],fired:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function Pl({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 tm({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:em(d.pre,d.post),url:d.url})}},n);if(u==null)return Pl({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 Pl({acc:c,index:t+1,params:r,signal:n,state:u.next,stepBase:o+l.length})}var $r={value:e=>wA(e)};function Ol(e,t){return{value:r=>e.value({...r,seed:`${t}:${r.seed}`})}}function Nl(e,t){return{value:r=>e.value({...r,anchor:t})}}function wA({anchor:e,constraints:t,generator:r,nullable:n,seed:i,type:o,values:s,valueSpace:a}){let l=Ml(`${a}:${i}`);return n&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:r==="date.iso"?vA({anchor:e,constraints:t,n:l,timeHash:Ml(`${a}:${i}#tod`)}):o==="number"?xA(l,t):o==="boolean"?l%2===0:AA(r,l)}var go=864e5;function vA({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 Ml(e,t=0,r=7){return t>=e.length?r>>>0:Ml(e,t+1,r*31+(e.codePointAt(t)??0)>>>0)}function xA(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 RA=["ada","bruno","carmen","dario","elena","felix","greta","hugo","iris","jonas","kira","lena","mateo","nadia","oscar","petra","quinn","rosa","stefan","tara","ugo","vera","wim","yara"],kA=["abreu","berg","costa","duval","eriksen","fischer","garza","holm","ito","jansen","kovac","laurent","moreau","novak","okafor","petrov","quist","rossi","sato","tanaka","ueda","vargas","weber","zhang"],EA=["amber","brisk","calm","deep","early","fond","glad","hazel","ivory","jade","keen","lush","mauve","noble","opal","plum","quiet","rapid","sage","teal","umber","vivid","warm","zesty"],CA=["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 AA(e,t){let r=yo(RA,t),n=yo(kA,Math.floor(t/31)),i=yo(EA,t),o=yo(CA,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 $l}from"neverthrow";var Nn=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}};function Ll(e){return{read:t=>IA(t,e),seedScript:t=>`globalThis[${JSON.stringify(Oa)}] = ${JSON.stringify(t)};`}}async function IA(e,t){let r={title:await e.title(),url:Et(e.url()),viewport:MA(e.viewportSize())};if(t.length===0)return r;let n=await e.evaluate(TA,{mountKey:Hi,names:t,timeoutMs:PA});if(n.kind==="unmounted")throw new Nn(Hi);return{...r,...n.values}}var PA=5e3;async function TA(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 MA(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}function _l(e,t,r){return{evaluate:n=>$l.fromPromise(im(OA(e,r,n),`check ${n.kind}`),rm),observe:()=>t.read().andThen(n=>$l.fromPromise(im(om(e,r,0),"observe"),rm).map(i=>({snapshot:{...n,singletons:{...n.singletons,...i}}}))),perform:n=>$l.fromPromise(am(e,n,0),i=>qp(n.kind,i))}}async function OA(e,t,r){try{return await cm(e,t,r)}catch(n){if(sm(n))return!1;throw n}}function rm(e){return e instanceof Nn?Wp(e.mountKey):Kp(e)}var NA=[100,250,500];async function om(e,t,r){try{return await t.read(e)}catch(n){let i=NA[r];if(i==null||!sm(n))throw n;return await um(i),om(e,t,r+1)}}function sm(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 nm=35e3;function im(e,t){let r,n=new Promise((i,o)=>{r=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(nm)}ms`))},nm)});return Promise.race([e,n]).finally(()=>{clearTimeout(r)})}var LA=[250,750,2e3];async function am(e,t,r){try{await $A(e,t)}catch(n){let i=LA[r];if(i==null||!FA(n))throw n;await um(i),await am(e,t,r+1)}}async function $A(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 DA(lm(e,t.locator),t)}function Dr(e,t,r){if(e==null)throw new Error(`action "${t.kind}" requires ${r}`);return e}function DA(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 lm(e,t){if(t==null)throw new Error("action requires a locator");return Dl(e,t)}function Dl(e,t){return t.by==="testId"?e.getByTestId(t.value):t.by==="inside"?Dl(Dl(e,t.scope),t.target):e.locator(_A(t.role,t.name))}function _A(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function FA(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 um(e){return new Promise(t=>{setTimeout(t,e)})}async function cm(e,t,r){if(r.kind==="browser")return jA(e,t,r.name,r.value);if(r.kind==="not")return!await cm(e,t,r.inner);let n=lm(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 jA(e,t,r,n){let o=(await t.read(e))[r];return typeof o=="string"&&o.includes(n)}async function Fl({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?VA():await r.hub.attach(a,r.runId),u=await a.newPage();return l.onPage(u),{driver:BA(_l(u,o,i),l),emitAssertion:l.emitAssertion,close:()=>UA({context:a,handle:l})}}async function jl(e,t){let r=await fm(e);try{return await t(r)}finally{await r.close()}}function VA(){return{emitAction:()=>{},emitAssertion:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function fm(e){let{chromium:t}=await import("playwright");return t.launch({headless:!e})}function pm({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??=fm(e),t},close:async()=>{let i=t;t=void 0,i!=null&&await i.then(o=>o.close()).catch(()=>{})}}}function BA(e,t){return{evaluate:e.evaluate,observe:e.observe,perform:r=>(t.emitAction(r),e.perform(r))}}async function UA({context:e,handle:t}){await dm(t.finish()),await dm(e.close())}var WA=15e3;async function dm(e){let t,r=new Promise(n=>{t=setTimeout(n,WA)});await Promise.race([e.catch(()=>{}),r]).finally(()=>{clearTimeout(t)})}import{err as zA,ok as GA,Result as Vl}from"neverthrow";function Bl(e,t,r){return{read:()=>r.read(e.map(n=>n.name),t).andThen(n=>HA(e,n))}}function HA(e,t){return Vl.combine(e.map(r=>qA(r,t.entities[r.name]??[]).map(n=>[r.name,n]))).map(r=>({entities:new Map(r),singletons:t.singletons}))}function qA(e,t){let r=uo(e);return Vl.combine(t.map(n=>KA(n,e).map(i=>[i,YA(n,r)]))).map(n=>new Map(n))}function KA(e,t){return Vl.combine(t.identity.map(r=>{let n=e[r];return n==null?zA(Gp(t.name,r)):GA(String(n))})).map(r=>r.join(":"))}function YA(e,t){let r=t.map(n=>[n,e[n]]).filter(n=>n[1]!=null);return Object.fromEntries(r)}var mm=Pi(ma(),1);import JA from"crypto";import{err as ZA,errAsync as hm,ok as XA,ResultAsync as So}from"neverthrow";var QA=3e4,eI=[250,750,2e3];function Ul({baseUrl:e,runId:t,secret:r},n){let i=new mm.Webhook(r),o=(s,a,l)=>tI({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:Fa,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:ja,signal:void 0}).map(()=>{})}}function tI(e){return gm(e.retry,()=>sI(e),0)}function gm(e,t,r){return t().orElse(n=>{let i=eI[r];return i==null||!nI(n,e)?hm(n):So.fromSafePromise(oI(i)).andThen(()=>gm(e,t,r+1))})}var rI=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function nI(e,t){return e.kind==="aborted"?!1:iI(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function iI(e){return e.kind==="engine-network"&&e.code!=null&&rI.has(e.code)}function oI(e){return new Promise(t=>{setTimeout(t,e)})}function sI({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",...aI(o,s)},method:"PUT",signal:lI(i)}),a=>to(r,a)).andThen(a=>uI(a,r)).andThen(a=>cI(n,a,r)).mapErr(a=>i?.aborted===!0?Yp():a)}function aI(e,t){let r=`msg_${JA.randomUUID()}`,n=new Date;return{"webhook-id":r,"webhook-signature":e.sign(r,n,t),"webhook-timestamp":String(Math.floor(n.getTime()/1e3))}}function lI(e){let t=AbortSignal.timeout(QA);return e==null?t:AbortSignal.any([e,t])}function uI(e,t){return e.ok?So.fromPromise(e.json(),r=>to(t,r)):So.fromPromise(e.text().catch(()=>""),r=>to(t,r)).andThen(r=>hm(Up(t,e.status,r)))}function cI(e,t,r){let n=e.safeParse(t);return n.success?XA(n.data):ZA(zp(r,n.error))}var le=Pi(Sm(),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))},hI={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"))} ${hI[e](le.default.bold(e))}`}var mI=le.default.red("\u2717"),uz=le.default.green("\u2713"),wm=le.default.dim("\u203A"),gI=8;function re(e,t,r){let n=r==null?"":` ${W.dim(r)}`;return` ${W.dim(e.padStart(gI))} ${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 Gl(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 Rm(e){return`${e.intent} \u203A ${Gl(e.action)}`}function km(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 Em(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 Hl(e){return{label:km(e.source),step:Rm(e.step)}}function _n(e){return e.kind==="consistency"?EI(e):e.kind==="obligation"?MI(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(Am(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 Cm(e){return bI(SI(e))}var yI=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function bI(e){return e.replaceAll(yI,"").replaceAll(/\s+/g," ").trim()}function SI(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${Em(e.divergence)}${t}`}return e.kind==="obligation"?`${NI(e.source)} failed at "${e.step.intent}": ${LI(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 ${Am(e.reason)}`:`driver failed at "${e.step.intent}": ${Ct(e.error)}`}var wI={"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 Am(e){return wI[e]}function vI({debugDir:e,runId:t}){let r=`${e}/${t}`;return re("behavior",W.path(`${r}/behavior.jsonl`),void 0)}function xI(e){if(e.kind==="cascade-gap"){let{gap:n}=e,i=`${n.transition} deletes ${n.target} but leaves ${n.source} dangling`;return`${Ln("invariant")} ${W.bold(i)}
38
38
  ${re("breaks",W.dim(Dn(n.invariant)),void 0)}`}if(e.kind==="create-gap"){let{gap:n}=e,i=`${n.transition} creates ${n.entity} without setting required field(s)`;return`${Ln("invariant")} ${W.bold(i)}
39
39
  ${re("missing",W.dim(n.missing.join(", ")),void 0)}`}let{conflict:t}=e,r=`view laws contradict: ${t.a.kind} vs ${t.b.kind}`;return`${Ln("invariant")} ${W.bold(r)}
40
- ${re("when",W.dim(JSON.stringify(t.when.singletons)),void 0)}`}function kI(e){return"locator"in e&&e.locator!=null?`${e.kind} ${Wl(e.locator)}`:"url"in e?`${e.kind} ${EI(e.url)}`:e.kind}function EI(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:Cm(e)}function Wl(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${Sm(e.name)}`:e.by==="inside"?`${Wl(e.scope)} \u25B8 ${Wl(e.target)}`:Sm(e.value)}function Sm(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:Cm(e)}function Cm(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function pr(e,t,r,n){let i=r==null?[]:[` ${r.intent} ${bm} ${W.dim(zl(r.action))}`];return[`${Ln(e)} ${W.bold(t)}`,...i,...n].join(`
41
- `)}function CI(e){return e.pending?pr("consistency",PI(e.divergence),e.step,[...wm(e.divergence),re("meaning",W.dim(`the write never landed within the ${TI(e.budget)} settle budget \u2014 the app still showed the pre-step value, not a wrong one`),void 0),re("fix",W.dim("declare wait: on the expectation (or a slower tier) if this write is legitimately slow"),void 0)]):pr("consistency",MI(e.divergence),e.step,[...wm(e.divergence),re("decide",W.dim(II(e.divergence)),void 0)])}var AI={absent:"app bug if the write was promised; if it only happens from a different starting state, restrict this test's given and cover that state in its own test","expected-change":"app bug if this action should change it; if the change needs other preconditions, split that case into its own test with the right given","field-mismatch":"app bug if the model value is the promised behavior; if the app legitimately owns this value, mark the field stable: false or assert changed() instead","ghost-write":"declare the missing effect on the acting step (Entity.created/updated/deleted), or if this write belongs to a different flow, cover it in that flow's test","singleton-mismatch":"app bug if the model value is the promised behavior; otherwise correct the singleton's expected value at the step that sets it"};function II(e){return AI[e.kind]}function PI(e){return e.kind==="field-mismatch"?`${e.entity}.${e.field} write never landed`:e.kind==="ghost-write"?`${e.entity} "${e.key}" delete never landed`:e.kind==="absent"?`${e.entity} "${e.key}" create never landed`:e.kind==="expected-change"?`${e.entity}.${e.field} never changed`:`${e.singleton} write never landed`}function wm(e){if(e.kind==="field-mismatch")return[re("row",W.dim(`${e.entity} ${e.key}`),void 0),re("expected",W.expected(st(e.snapshot)),"model predicted this"),re("actual",W.actual(st(e.sut)),"app showed this")];if(e.kind==="singleton-mismatch")return[re("expected",W.expected(st(e.snapshot)),"model predicted this"),re("actual",W.actual(st(e.sut)),"app showed this")];if(e.kind==="expected-change")return[re("row",W.dim(`${e.entity} ${e.key}`),void 0),re("expected",W.expected("a different value"),"changed() asserted a change"),re("actual",W.actual(st(e.value)),"app left it unchanged")];let t=e.kind==="ghost-write"?"an app write the model never declared \u2014 unmodeled side effect":"the model expected this row but the app has none";return[re("meaning",W.dim(t),void 0)]}function TI(e){return`${String(kn[e]/1e3)}s "${e}"`}function MI(e){return e.kind==="field-mismatch"?`${e.entity}.${e.field} diverged`:e.kind==="ghost-write"?`${e.entity} "${e.key}" written but never modeled`:e.kind==="absent"?`${e.entity} "${e.key}" missing in the app`:e.kind==="expected-change"?`${e.entity}.${e.field} never changed`:`${e.singleton} diverged`}function OI(e,t,r){if(e.kind==="invariant")return pr("invariant",`${Dn(e.invariant)} violated`,t,[re("meaning",W.dim("a referenced row went missing after this step"),void 0)]);let n=e.kind==="law"?"view law never held":"expectation never held",i=e.kind==="law"&&e.origin!=null?[NI(e.origin)]:[];return pr("assertion",n,t,[re("check",W.warn($n(e.check)),void 0),...i,re("budget",W.dim(`${r} (polled until timeout)`),void 0),re("decide",W.dim("wrong locator/accessible name, UI regression, or the expectation only holds under a narrower given \u2014 confirm in behavior.jsonl before changing the test"),void 0)])}function NI(e){if(e.kind==="test")return re("law from",W.dim(`an assertion in test "${e.test}"`),void 0);if(e.kind==="trigger")return re("law from",W.dim(`the trigger of "${e.intent}" (test "${e.test}")`),void 0);let t=e.tests.map(r=>JSON.stringify(r)).join(", ");return re("law from",W.dim(`generalized across tests ${t}`),void 0)}function LI(e){return e.kind==="invariant"?"invariant":e.kind==="law"?"law":"assertion"}function $I(e){return e.kind==="invariant"?Dn(e.invariant):$n(e.check)}import{err as H8,ok as q8,ResultAsync as K8}from"neverthrow";import Tb from"path";import{existsSync as DI}from"fs";import{createRequire as _I}from"module";import{fileURLToPath as FI}from"url";import{Worker as jI}from"worker_threads";var VI=_I(import.meta.url);function Am(e){let t=new jI(BI(),{workerData:e});t.unref();let r=new Map,n={next:0};t.on("message",o=>{let s=r.get(o.seq);s!=null&&(r.delete(o.seq),s())});let i=o=>{t.postMessage(o)};return{close:({noticeLineIfNoRrweb:o,runId:s})=>{let a=n.next;return n.next+=1,new Promise(l=>{r.set(a,l),i({noticeLineIfNoRrweb:o,runId:s,seq:a,t:"close"})})},line:({line:o,runId:s,timeNanos:a})=>{i({line:o,runId:s,t:"line",timeNanos:a})},open:({file:o,runId:s})=>{i({file:o,runId:s,t:"open"})},rrwebBatch:({data:o,runId:s})=>{i({data:o,runId:s,t:"rrweb-batch"})},terminate:async()=>{await t.terminate()}}}function BI(){try{return VI.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(r=>FI(new URL(r,import.meta.url))),t=e.find(r=>DI(r));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}import{readFile as UI}from"fs/promises";import{createRequire as WI}from"module";import{fileURLToPath as zI}from"url";var GI=WI(import.meta.url);function Hl(e,t){try{return GI.resolve(e)}catch{return zI(new URL(`assets/${t}`,import.meta.url))}}var HI=Hl("@ripplo/browser-trace/bundle","browser-trace.js");async function Pm(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await qI())}var Im;function qI(){return Im??=UI(HI,{encoding:"utf8"}),Im}import{readFile as g6}from"fs/promises";var KI=Object.defineProperty,YI=(e,t,r)=>t in e?KI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k=(e,t,r)=>YI(e,typeof t!="symbol"?t+"":t,r),Tm,JI=Object.defineProperty,ZI=(e,t,r)=>t in e?JI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mm=(e,t,r)=>ZI(e,typeof t!="symbol"?t+"":t,r),Te=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Te||{}),Om={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Nm={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xo={},XI=()=>!!globalThis.Zone;function Ju(e){if(xo[e])return xo[e];let t=globalThis[e],r=t.prototype,n=e in Om?Om[e]:void 0,i=!!(n&&n.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in Nm?Nm[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!XI())return xo[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let u=l[e].prototype;return document.body.removeChild(a),u?xo[e]=u:r}catch{return r}}var ql={};function Ot(e,t,r){var n;let i=`${e}.${String(r)}`;if(ql[i])return ql[i].call(t);let o=Ju(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(ql[i]=s,s.call(t)):t[r]}var Kl={};function Tg(e,t,r){let n=`${e}.${String(r)}`;if(Kl[n])return Kl[n].bind(t);let o=Ju(e)[r];return typeof o!="function"?t[r]:(Kl[n]=o,o.bind(t))}function QI(e){return Ot("Node",e,"ownerDocument")}function eP(e){return Ot("Node",e,"childNodes")}function tP(e){return Ot("Node",e,"parentNode")}function rP(e){return Ot("Node",e,"parentElement")}function nP(e){return Ot("Node",e,"textContent")}function iP(e,t){return Tg("Node",e,"contains")(t)}function oP(e){return Tg("Node",e,"getRootNode")()}function sP(e){return!e||!("host"in e)?null:Ot("ShadowRoot",e,"host")}function aP(e){return e.styleSheets}function lP(e){return!e||!("shadowRoot"in e)?null:Ot("Element",e,"shadowRoot")}function uP(e,t){return Ot("Element",e,"querySelector")(t)}function cP(e,t){return Ot("Element",e,"querySelectorAll")(t)}function dP(){return Ju("MutationObserver").constructor}function fP(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var De={ownerDocument:QI,childNodes:eP,parentNode:tP,parentElement:rP,textContent:nP,contains:iP,getRootNode:oP,host:sP,styleSheets:aP,shadowRoot:lP,querySelector:uP,querySelectorAll:cP,mutationObserver:dP,patch:fP};function Mg(e){return e.nodeType===e.ELEMENT_NODE}function Wn(e){let t=e&&"host"in e&&"mode"in e&&De.host(e)||null;return!!(t&&"shadowRoot"in t&&De.shadowRoot(t)===e)}function zn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function pP(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function hP(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function au(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,i=>Og(i,r)).join("");return pP(n)}catch{return null}}function Og(e,t){if(gP(e)){let r;try{r=au(e.styleSheet)||hP(e)}catch{r=e.cssText}return e.styleSheet.href?es(r,e.styleSheet.href):r}else{let r=e.cssText;return yP(e)&&e.selectorText.includes(":")&&(r=mP(r)),t?es(r,t):r}}function mP(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function gP(e){return"styleSheet"in e}function yP(e){return"selectorText"in e}var Zo=class{constructor(){Mm(this,"idNodeMap",new Map),Mm(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function bP(){return new Zo}function Xo({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"",a=n&&mr(n);return(t[r.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function mr(e){return e.toLowerCase()}var Lm="__rrweb_original__";function SP(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let i=0;i<e.height;i+=r){let o=t.getImageData,s=Lm in o?o[Lm]:o;if(new Uint32Array(s.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function Qo(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?mr(t):null}function Ng(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(n);return i?.[1]??null}function wP(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var vP=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,xP=/^(?:[a-z+]+:)?\/\//i,RP=/^www\..*/i,kP=/^(data:)([^,]*),(.*)/i;function es(e,t){return(e||"").replace(vP,(r,n,i,o,s,a)=>{let l=i||s||a,u=n||o||"";if(!l)return r;if(xP.test(l)||RP.test(l))return`url(${u}${l}${u})`;if(kP.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${wP(t)+l}${u})`;let c=t.split("/"),d=l.split("/");c.pop();for(let p of d)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function Ro(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function EP(e,t,r=!1){let n=Array.from(t.childNodes),i=[],o=0;if(n.length>1&&e&&typeof e=="string"){let s=Ro(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let u=Ro(n[l].textContent,r),c=100,d=3;for(;d<u.length&&(u[d].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,d),1)!==-1);d++);for(;d<u.length;d++){let p=u.substring(0,d),h=s.split(p),f=-1;if(h.length===2)f=h[0].length;else if(h.length>2&&h[0]===""&&n[l-1].textContent!=="")f=s.indexOf(p,1);else if(h.length===1){if(p=p.substring(0,p.length-1),h=s.split(p),h.length<=1)return i.push(e),i;d=c+1}else d===u.length-1&&(f=s.indexOf(p));if(h.length>=2&&d>c){let m=n[l-1].textContent;if(m&&typeof m=="string"){let g=Ro(m).length;f=s.indexOf(p,g)}f===-1&&(f=h[0].length)}if(f!==-1){let m=Math.floor(f/a);for(;m>0&&m<e.length;){if(o+=1,o>50*n.length)return i.push(e),i;let g=Ro(e.substring(0,m),r);if(g.length===f){i.push(e.substring(0,m)),e=e.substring(m),s=s.substring(f);break}else g.length<f?m+=Math.max(1,Math.floor((f-g.length)/a)):m-=Math.max(1,Math.floor((g.length-f)*a))}break}}}}return i.push(e),i}function CP(e,t){return EP(e,t).join("/* rr_split */")}var AP=1,IP=new RegExp("[^a-z0-9-_:]"),Hn=-2;function Lg(){return AP++}function PP(e){if(e instanceof HTMLFormElement)return"form";let t=mr(e.tagName);return IP.test(t)?"div":t}var Fr,$m,TP=/^[^ \t\n\r\u000c]+/,MP=/^[, \t\n\r\u000c]+/;function OP(e,t){if(t.trim()==="")return t;let r=0;function n(o){let s,a=o.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let i=[];for(;n(MP),!(r>=t.length);){let o=n(TP);if(o.slice(-1)===",")o=Br(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=Br(e,o);let a=!1;for(;;){let l=t.charAt(r);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return i.join(", ")}var Dm=new WeakMap;function Br(e,t){return!t||t.trim()===""?t:Zu(e,t)}function NP(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Zu(e,t){let r=Dm.get(e);if(r||(r=e.createElement("a"),Dm.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function $g(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?Br(e,n):r==="srcset"?OP(e,n):r==="style"?es(n,Zu(e)):t==="object"&&r==="data"?Br(e,n):n)}function Dg(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function LP(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function ts(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ts(De.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}return r?ts(De.parentNode(e),t,r):!1}function _g(e,t,r,n){let i;if(Mg(e)){if(i=e,!De.childNodes(i).length)return!1}else{if(De.parentElement(e)===null)return!1;i=De.parentElement(e)}try{if(typeof t=="string"){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(ts(i,t,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function $P(e,t,r){let n=e.contentWindow;if(!n)return;let i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){let a=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function DP(e,t,r){let n=!1,i;try{i=e.sheet}catch{return}if(i)return;let o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}function _P(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,S=FP(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Te.Document,childNodes:[],compatMode:e.compatMode}:{type:Te.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Te.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return VP(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m,rootId:S});case e.TEXT_NODE:return jP(e,{doc:r,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Te.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Te.Comment,textContent:De.textContent(e)||"",rootId:S};default:return!1}}function FP(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function jP(e,t){let{needsMask:r,maskTextFn:n,rootId:i,cssCaptured:o}=t,s=De.parentNode(e),a=s&&s.tagName,l="",u=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;return c?l="SCRIPT_PLACEHOLDER":o||(l=De.textContent(e),u&&l&&(l=es(l,Zu(t.doc)))),!u&&!c&&l&&r&&(l=n?n(l,De.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Te.Text,textContent:l||"",rootId:i}}function VP(e,t){let{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:h}=t,f=LP(e,n,i),m=PP(e),g={},S=e.attributes.length;for(let y=0;y<S;y++){let x=e.attributes[y];Dg(m,x.name,x.value)||(g[x.name]=$g(r,m,mr(x.name),x.value))}if(m==="link"&&o){let y=Array.from(r.styleSheets).find(E=>E.href===e.href),x=null;y&&(x=au(y)),x&&(delete g.rel,delete g.href,g._cssText=x)}if(m==="style"&&e.sheet){let y=au(e.sheet);y&&(e.childNodes.length>1&&(y=CP(y,e)),g._cssText=y)}if(["input","textarea","select"].includes(m)){let y=e.value,x=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&y?g.value=Xo({element:e,type:Qo(e),tagName:m,value:y,maskInputOptions:s,maskInputFn:a}):x&&(g.checked=x)}if(m==="option"&&(e.selected&&!s.select?g.selected=!0:delete g.selected),m==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(e.__context==="2d")SP(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let y=e.toDataURL(l.type,l.quality),x=r.createElement("canvas");x.width=e.width,x.height=e.height;let E=x.toDataURL(l.type,l.quality);y!==E&&(g.rr_dataURL=y)}}if(m==="img"&&u){Fr||(Fr=r.createElement("canvas"),$m=Fr.getContext("2d"));let y=e,x=y.currentSrc||y.getAttribute("src")||"<unknown-src>",E=y.crossOrigin,N=()=>{y.removeEventListener("load",N);try{Fr.width=y.naturalWidth,Fr.height=y.naturalHeight,$m.drawImage(y,0,0),g.rr_dataURL=Fr.toDataURL(l.type,l.quality)}catch(I){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${x}! Error: ${I}`)}y.crossOrigin==="anonymous"&&(E?g.crossOrigin=E:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N)}if(["audio","video"].includes(m)){let y=g;y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime,y.rr_mediaPlaybackRate=e.playbackRate,y.rr_mediaMuted=e.muted,y.rr_mediaLoop=e.loop,y.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),f){let{width:y,height:x}=e.getBoundingClientRect();g={class:g.class,rr_width:`${y}px`,rr_height:`${x}px`}}m==="iframe"&&!d(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch{}return{type:Te.Element,tagName:m,attributes:g,childNodes:[],isSVG:NP(e)||void 0,needBlock:f,rootId:h,isCustom:w}}function ue(e){return e==null?"":e.toLowerCase()}function Fg(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function BP(e,t){if(t.comment&&e.type===Te.Comment)return!0;if(e.type===Te.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Ng(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ue(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ue(e.attributes.name)==="application-name"||ue(e.attributes.rel)==="icon"||ue(e.attributes.rel)==="apple-touch-icon"||ue(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ue(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ue(e.attributes.property).match(/^(og|twitter|fb):/)||ue(e.attributes.name).match(/^(og|twitter):/)||ue(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ue(e.attributes.name)==="robots"||ue(e.attributes.name)==="googlebot"||ue(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ue(e.attributes.name)==="author"||ue(e.attributes.name)==="generator"||ue(e.attributes.name)==="framework"||ue(e.attributes.name)==="publisher"||ue(e.attributes.name)==="progid"||ue(e.attributes.property).match(/^article:/)||ue(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ue(e.attributes.name)==="google-site-verification"||ue(e.attributes.name)==="yandex-verification"||ue(e.attributes.name)==="csrf-token"||ue(e.attributes.name)==="p:domain_verify"||ue(e.attributes.name)==="verify-v1"||ue(e.attributes.name)==="verification"||ue(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ur(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:I=!1,cssCaptured:M=!1}=t,{needsMask:C}=t,{preserveWhiteSpace:V=!0}=t;C||(C=_g(e,s,a,C===void 0));let Z=_P(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:N,newlyAddedElement:I,cssCaptured:M});if(!Z)return console.warn(e,"not serialized"),null;let X;n.hasNode(e)?X=n.getId(e):BP(Z,h)||!V&&Z.type===Te.Text&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?X=Hn:X=Lg();let F=Object.assign(Z,{id:X});if(n.add(e,F),X===Hn)return null;S&&S(e);let $e=!l;if(F.type===Te.Element){$e=$e&&!F.needBlock,delete F.needBlock;let Pe=De.shadowRoot(e);Pe&&zn(Pe)&&(F.isShadowHost=!0)}if((F.type===Te.Document||F.type===Te.Element)&&$e){h.headWhitespace&&F.type===Te.Element&&F.tagName==="head"&&(V=!1);let Pe={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N,cssCaptured:!1};if(!(F.type===Te.Element&&F.tagName==="textarea"&&F.attributes.value!==void 0)){F.type===Te.Element&&F.attributes._cssText!==void 0&&typeof F.attributes._cssText=="string"&&(Pe.cssCaptured=!0);for(let ir of Array.from(De.childNodes(e))){let ht=Ur(ir,Pe);ht&&F.childNodes.push(ht)}}let Ze=null;if(Mg(e)&&(Ze=De.shadowRoot(e)))for(let ir of Array.from(De.childNodes(Ze))){let ht=Ur(ir,Pe);ht&&(zn(Ze)&&(ht.isShadow=!0),F.childNodes.push(ht))}}let pt=De.parentNode(e);return pt&&Wn(pt)&&zn(pt)&&(F.isShadow=!0),F.type===Te.Element&&F.tagName==="iframe"&&$P(e,()=>{let Pe=e.contentDocument;if(Pe&&w){let Ze=Ur(Pe,{doc:Pe,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N});Ze&&w(e,Ze)}},y),F.type===Te.Element&&F.tagName==="link"&&typeof F.attributes.rel=="string"&&(F.attributes.rel==="stylesheet"||F.attributes.rel==="preload"&&typeof F.attributes.href=="string"&&Ng(F.attributes.href)==="css")&&DP(e,()=>{if(x){let Pe=Ur(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N});Pe&&x(e,Pe)}},E),F}function UP(e,t){let{mirror:r=new Zo,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:p,slimDOM:h=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:E=()=>!1}=t||{},N=c===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:c===!1?{password:!0}:c,I=Fg(h);return Ur(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:N,maskTextFn:d,maskInputFn:p,slimDOMOptions:I,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:E,newlyAddedElement:!1})}var WP=/(max|min)-device-(width|height)/,kz=new RegExp(WP.source,"g");function zP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function GP(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Xu={exports:{}},fe=String,jg=function(){return{isColorSupported:!1,reset:fe,bold:fe,dim:fe,italic:fe,underline:fe,inverse:fe,hidden:fe,strikethrough:fe,black:fe,red:fe,green:fe,yellow:fe,blue:fe,magenta:fe,cyan:fe,white:fe,gray:fe,bgBlack:fe,bgRed:fe,bgGreen:fe,bgYellow:fe,bgBlue:fe,bgMagenta:fe,bgCyan:fe,bgWhite:fe}};Xu.exports=jg();Xu.exports.createColors=jg;var HP=Xu.exports,qP={},KP=Object.freeze(Object.defineProperty({__proto__:null,default:qP},Symbol.toStringTag,{value:"Module"})),lt=GP(KP),_m=HP,Fm=lt,lu=class Vg extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof r<"u"&&typeof n<"u"&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Vg)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=_m.isColorSupported),Fm&&t&&(r=Fm(r));let n=r.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=_m.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return n.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let h=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
40
+ ${re("when",W.dim(JSON.stringify(t.when.singletons)),void 0)}`}function RI(e){return"locator"in e&&e.locator!=null?`${e.kind} ${zl(e.locator)}`:"url"in e?`${e.kind} ${kI(e.url)}`:e.kind}function kI(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:Im(e)}function zl(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${vm(e.name)}`:e.by==="inside"?`${zl(e.scope)} \u25B8 ${zl(e.target)}`:vm(e.value)}function vm(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:Im(e)}function Im(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function pr(e,t,r,n){let i=r==null?[]:[` ${r.intent} ${wm} ${W.dim(Gl(r.action))}`];return[`${Ln(e)} ${W.bold(t)}`,...i,...n].join(`
41
+ `)}function EI(e){return e.pending?pr("consistency",II(e.divergence),e.step,[...xm(e.divergence),re("meaning",W.dim(`the write never landed within the ${PI(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",TI(e.divergence),e.step,[...xm(e.divergence),re("decide",W.dim(AI(e.divergence)),void 0)])}var CI={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 AI(e){return CI[e.kind]}function II(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 xm(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 PI(e){return`${String(kn[e]/1e3)}s "${e}"`}function TI(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 MI(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?[OI(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 OI(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 NI(e){return e.kind==="invariant"?"invariant":e.kind==="law"?"law":"assertion"}function LI(e){return e.kind==="invariant"?Dn(e.invariant):$n(e.check)}import{err as G8,ok as H8,ResultAsync as q8}from"neverthrow";import Ob from"path";import{existsSync as $I}from"fs";import{createRequire as DI}from"module";import{fileURLToPath as _I}from"url";import{Worker as FI}from"worker_threads";var jI=DI(import.meta.url);function Pm(e){let t=new FI(VI(),{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 VI(){try{return jI.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(r=>_I(new URL(r,import.meta.url))),t=e.find(r=>$I(r));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}import{readFile as BI}from"fs/promises";import{createRequire as UI}from"module";import{fileURLToPath as WI}from"url";var zI=UI(import.meta.url);function ql(e,t){try{return zI.resolve(e)}catch{return WI(new URL(`assets/${t}`,import.meta.url))}}var GI=ql("@ripplo/browser-trace/bundle","browser-trace.js");async function Mm(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await HI())}var Tm;function HI(){return Tm??=BI(GI,{encoding:"utf8"}),Tm}import{readFile as m6}from"fs/promises";var qI=Object.defineProperty,KI=(e,t,r)=>t in e?qI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k=(e,t,r)=>KI(e,typeof t!="symbol"?t+"":t,r),Om,YI=Object.defineProperty,JI=(e,t,r)=>t in e?YI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nm=(e,t,r)=>JI(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||{}),Lm={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},$m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xo={},ZI=()=>!!globalThis.Zone;function Zu(e){if(xo[e])return xo[e];let t=globalThis[e],r=t.prototype,n=e in Lm?Lm[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 $m?$m[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&&!ZI())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 Kl={};function Ot(e,t,r){var n;let i=`${e}.${String(r)}`;if(Kl[i])return Kl[i].call(t);let o=Zu(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(Kl[i]=s,s.call(t)):t[r]}var Yl={};function Og(e,t,r){let n=`${e}.${String(r)}`;if(Yl[n])return Yl[n].bind(t);let o=Zu(e)[r];return typeof o!="function"?t[r]:(Yl[n]=o,o.bind(t))}function XI(e){return Ot("Node",e,"ownerDocument")}function QI(e){return Ot("Node",e,"childNodes")}function eP(e){return Ot("Node",e,"parentNode")}function tP(e){return Ot("Node",e,"parentElement")}function rP(e){return Ot("Node",e,"textContent")}function nP(e,t){return Og("Node",e,"contains")(t)}function iP(e){return Og("Node",e,"getRootNode")()}function oP(e){return!e||!("host"in e)?null:Ot("ShadowRoot",e,"host")}function sP(e){return e.styleSheets}function aP(e){return!e||!("shadowRoot"in e)?null:Ot("Element",e,"shadowRoot")}function lP(e,t){return Ot("Element",e,"querySelector")(t)}function uP(e,t){return Ot("Element",e,"querySelectorAll")(t)}function cP(){return Zu("MutationObserver").constructor}function dP(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:XI,childNodes:QI,parentNode:eP,parentElement:tP,textContent:rP,contains:nP,getRootNode:iP,host:oP,styleSheets:sP,shadowRoot:aP,querySelector:lP,querySelectorAll:uP,mutationObserver:cP,patch:dP};function Ng(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 fP(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 pP(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 lu(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=>Lg(i,r)).join("");return fP(n)}catch{return null}}function Lg(e,t){if(mP(e)){let r;try{r=lu(e.styleSheet)||pP(e)}catch{r=e.cssText}return e.styleSheet.href?es(r,e.styleSheet.href):r}else{let r=e.cssText;return gP(e)&&e.selectorText.includes(":")&&(r=hP(r)),t?es(r,t):r}}function hP(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function mP(e){return"styleSheet"in e}function gP(e){return"selectorText"in e}var Zo=class{constructor(){Nm(this,"idNodeMap",new Map),Nm(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 yP(){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 Dm="__rrweb_original__";function bP(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=Dm in o?o[Dm]: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 $g(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 SP(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var wP=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,vP=/^(?:[a-z+]+:)?\/\//i,xP=/^www\..*/i,RP=/^(data:)([^,]*),(.*)/i;function es(e,t){return(e||"").replace(wP,(r,n,i,o,s,a)=>{let l=i||s||a,u=n||o||"";if(!l)return r;if(vP.test(l)||xP.test(l))return`url(${u}${l}${u})`;if(RP.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${SP(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 kP(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 EP(e,t){return kP(e,t).join("/* rr_split */")}var CP=1,AP=new RegExp("[^a-z0-9-_:]"),Hn=-2;function Dg(){return CP++}function IP(e){if(e instanceof HTMLFormElement)return"form";let t=mr(e.tagName);return AP.test(t)?"div":t}var Fr,_m,PP=/^[^ \t\n\r\u000c]+/,TP=/^[, \t\n\r\u000c]+/;function MP(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(TP),!(r>=t.length);){let o=n(PP);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 Fm=new WeakMap;function Br(e,t){return!t||t.trim()===""?t:Xu(e,t)}function OP(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Xu(e,t){let r=Fm.get(e);if(r||(r=e.createElement("a"),Fm.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function _g(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?Br(e,n):r==="srcset"?MP(e,n):r==="style"?es(n,Xu(e)):t==="object"&&r==="data"?Br(e,n):n)}function Fg(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function NP(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 jg(e,t,r,n){let i;if(Ng(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 LP(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 $P(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 DP(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=_P(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 jP(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 FP(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 _P(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function FP(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,Xu(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 jP(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=NP(e,n,i),m=IP(e),g={},S=e.attributes.length;for(let y=0;y<S;y++){let x=e.attributes[y];Fg(m,x.name,x.value)||(g[x.name]=_g(r,m,mr(x.name),x.value))}if(m==="link"&&o){let y=Array.from(r.styleSheets).find(E=>E.href===e.href),x=null;y&&(x=lu(y)),x&&(delete g.rel,delete g.href,g._cssText=x)}if(m==="style"&&e.sheet){let y=lu(e.sheet);y&&(e.childNodes.length>1&&(y=EP(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")bP(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let y=e.toDataURL(l.type,l.quality),x=r.createElement("canvas");x.width=e.width,x.height=e.height;let E=x.toDataURL(l.type,l.quality);y!==E&&(g.rr_dataURL=y)}}if(m==="img"&&u){Fr||(Fr=r.createElement("canvas"),_m=Fr.getContext("2d"));let y=e,x=y.currentSrc||y.getAttribute("src")||"<unknown-src>",E=y.crossOrigin,N=()=>{y.removeEventListener("load",N);try{Fr.width=y.naturalWidth,Fr.height=y.naturalHeight,_m.drawImage(y,0,0),g.rr_dataURL=Fr.toDataURL(l.type,l.quality)}catch(I){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${x}! Error: ${I}`)}y.crossOrigin==="anonymous"&&(E?g.crossOrigin=E:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N)}if(["audio","video"].includes(m)){let y=g;y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime,y.rr_mediaPlaybackRate=e.playbackRate,y.rr_mediaMuted=e.muted,y.rr_mediaLoop=e.loop,y.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),f){let{width:y,height:x}=e.getBoundingClientRect();g={class:g.class,rr_width:`${y}px`,rr_height:`${x}px`}}m==="iframe"&&!d(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch{}return{type:Te.Element,tagName:m,attributes:g,childNodes:[],isSVG:OP(e)||void 0,needBlock:f,rootId:h,isCustom:w}}function ue(e){return e==null?"":e.toLowerCase()}function Vg(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 VP(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"&&$g(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=jg(e,s,a,C===void 0));let Z=DP(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):VP(Z,h)||!V&&Z.type===Te.Text&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?X=Hn:X=Dg();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(Ng(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"&&LP(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"&&$g(F.attributes.href)==="css")&&$P(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 BP(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=Vg(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 UP=/(max|min)-device-(width|height)/,Ez=new RegExp(UP.source,"g");function WP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zP(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,Bg=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=Bg();Qu.exports.createColors=Bg;var GP=Qu.exports,HP={},qP=Object.freeze(Object.defineProperty({__proto__:null,default:HP},Symbol.toStringTag,{value:"Module"})),lt=zP(qP),jm=GP,Vm=lt,uu=class Ug 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,Ug)}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=jm.isColorSupported),Vm&&t&&(r=Vm(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}=jm.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}},Qu=lu;lu.default=lu;var ri={};ri.isClean=Symbol("isClean");ri.my=Symbol("my");var jm={after:`
46
+ `),this.name+": "+this.message+t}},ec=uu;uu.default=uu;var ri={};ri.isClean=Symbol("isClean");ri.my=Symbol("my");var Bm={after:`
47
47
  `,beforeClose:`
48
48
  `,beforeComment:`
49
49
  `,beforeDecl:`
50
50
  `,beforeOpen:" ",beforeRule:`
51
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function YP(e){return e[0].toUpperCase()+e.slice(1)}var uu=class{constructor(t){this.builder=t}atrule(t,r){let n="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?n+=t.raws.afterName:i&&(n+=" "),t.nodes)this.block(t,n+i);else{let o=(t.raws.between||"")+(r?";":"");this.builder(n+i+o,t)}}beforeAfter(t,r){let n;t.type==="decl"?n=this.raw(t,null,"beforeDecl"):t.type==="comment"?n=this.raw(t,null,"beforeComment"):r==="before"?n=this.raw(t,null,"beforeRule"):n=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(n.includes(`
52
- `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return jm[n];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[n]<"u")return s.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(t,n);{let a="raw"+YP(n);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[r],typeof i<"u")return!1})}return typeof i>"u"&&(i=jm[n]),s.rawCache[n]=i,i}rawBeforeClose(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return r=n.raws.after,r.includes(`
51
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function KP(e){return e[0].toUpperCase()+e.slice(1)}var cu=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 Bm[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"+KP(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=Bm[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)}},Bg=uu;uu.default=uu;var JP=Bg;function cu(e,t){new JP(t).stringify(e)}var hs=cu;cu.default=cu;var{isClean:ko,my:ZP}=ri,XP=Qu,QP=Bg,eT=hs;function du(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let i=e[n],o=typeof i;n==="parent"&&o==="object"?t&&(r[n]=t):n==="source"?r[n]=i:Array.isArray(i)?r[n]=i.map(s=>du(s,r)):(o==="object"&&i!==null&&(i=du(i)),r[n]=i)}return r}var fu=class{constructor(t={}){this.raws={},this[ko]=!1,this[ZP]=!0;for(let r in t)if(r==="nodes"){this.nodes=[];for(let n of t[r])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[r]=t[r]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${r.input.from}:${r.start.line}:${r.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let r in t)this[r]=t[r];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let r=du(this);for(let n in t)r[n]=t[n];return r}cloneAfter(t={}){let r=this.clone(t);return this.parent.insertAfter(this,r),r}cloneBefore(t={}){let r=this.clone(t);return this.parent.insertBefore(this,r),r}error(t,r={}){if(this.source){let{end:n,start:i}=this.rangeBy(r);return this.source.input.error(t,{column:i.column,line:i.line},{column:n.column,line:n.line},r)}return new XP(t)}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:r==="root"?()=>t.root().toProxy():t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}}markDirty(){if(this[ko]){this[ko]=!1;let t=this;for(;t=t.parent;)t[ko]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,r){let n=this.source.start;if(t.index)n=this.positionInside(t.index,r);else if(t.word){r=this.toString();let i=r.indexOf(t.word);i!==-1&&(n=this.positionInside(i,r))}return n}positionInside(t,r){let n=r||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)n[s]===`
58
- `?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new QP().raw(this,t,r)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let r=this,n=!1;for(let i of t)i===this?n=!0:n?(this.parent.insertAfter(r,i),r=i):this.parent.insertBefore(r,i);n||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,r){let n={},i=r==null;r=r||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))n[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,r):l);else if(typeof a=="object"&&a.toJSON)n[s]=a.toJSON(null,r);else if(s==="source"){let l=r.get(a.input);l==null&&(l=o,r.set(a.input,o),o++),n[s]={end:a.end,inputId:l,start:a.start}}else n[s]=a}return i&&(n.inputs=[...r.keys()].map(s=>s.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=eT){t.stringify&&(t=t.stringify);let r="";return t(this,n=>{r+=n}),r}warn(t,r,n){let i={node:this};for(let o in n)i[o]=n[o];return t.warn(r,i)}get proxyOf(){return this}},ms=fu;fu.default=fu;var tT=ms,pu=class extends tT{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},gs=pu;pu.default=pu;var rT="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",nT=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},iT=(e=21)=>{let t="",r=e;for(;r--;)t+=rT[Math.random()*64|0];return t},oT={nanoid:iT,customAlphabet:nT},{SourceMapConsumer:Vm,SourceMapGenerator:Bm}=lt,{existsSync:sT,readFileSync:aT}=lt,{dirname:Yl,join:lT}=lt;function uT(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var hu=class{constructor(t,r){if(r.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let n=r.map?r.map.prev:void 0,i=this.loadMap(r.from,n);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=Yl(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Vm(this.text)),this.consumerCache}decodeInline(t){let r=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(r.test(t)||n.test(t))return uT(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!r)return;let n=t.lastIndexOf(r.pop()),i=t.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(n,i)))}loadFile(t){if(this.root=Yl(t),sT(t))return this.mapFile=t,aT(t,"utf-8").toString().trim()}loadMap(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){let n=r(t);if(n){let i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(r instanceof Vm)return Bm.fromSourceMap(r).toString();if(r instanceof Bm)return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let n=this.annotation;return t&&(n=lT(Yl(t),n)),this.loadFile(n)}}}startWith(t,r){return t?t.substr(0,r.length)===r:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Ug=hu;hu.default=hu;var{SourceMapConsumer:cT,SourceMapGenerator:dT}=lt,{fileURLToPath:Um,pathToFileURL:Eo}=lt,{isAbsolute:mu,resolve:gu}=lt,{nanoid:fT}=oT,Jl=lt,Wm=Qu,pT=Ug,Zl=Symbol("fromOffsetCache"),hT=!!(cT&&dT),zm=!!(gu&&mu),rs=class{constructor(t,r={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,r.from&&(!zm||/^\w+:\/\//.test(r.from)||mu(r.from)?this.file=r.from:this.file=gu(r.from)),zm&&hT){let n=new pT(this.css,r);if(n.text){this.map=n;let i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+fT(6)+">"),this.map&&(this.map.file=this.from)}error(t,r,n,i={}){let o,s,a;if(r&&typeof r=="object"){let u=r,c=n;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);r=d.line,n=d.col}else r=u.line,n=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);s=d.line,a=d.col}else s=c.line,a=c.column}else if(!n){let u=this.fromOffset(r);r=u.line,n=u.col}let l=this.origin(r,n,s,a);return l?o=new Wm(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new Wm(t,s===void 0?r:{column:n,line:r},s===void 0?n:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:n,endColumn:a,endLine:s,line:r,source:this.css},this.file&&(Eo&&(o.input.url=Eo(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let r,n;if(this[Zl])n=this[Zl];else{let o=this.css.split(`
59
- `);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[Zl]=n}r=n[n.length-1];let i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<n[s])o=s-1;else if(t>=n[s+1])i=s+1;else{i=s;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:gu(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,n,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:r,line:t});if(!s.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:i,line:n}));let l;mu(s.source)?l=Eo(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||Eo(this.map.mapFile));let u={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(Um)u.file=Um(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let t={};for(let r of["hasBOM","css","file","id"])this[r]!=null&&(t[r]=this[r]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},ys=rs;rs.default=rs;Jl&&Jl.registerInput&&Jl.registerInput(rs);var{SourceMapConsumer:Wg,SourceMapGenerator:Go}=lt,{dirname:Ho,relative:zg,resolve:Gg,sep:Hg}=lt,{pathToFileURL:Gm}=lt,mT=ys,gT=!!(Wg&&Go),yT=!!(Ho&&Gg&&zg&&Hg),bT=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let r=`
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)}},Wg=cu;cu.default=cu;var YP=Wg;function du(e,t){new YP(t).stringify(e)}var hs=du;du.default=du;var{isClean:ko,my:JP}=ri,ZP=ec,XP=Wg,QP=hs;function fu(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=>fu(s,r)):(o==="object"&&i!==null&&(i=fu(i)),r[n]=i)}return r}var pu=class{constructor(t={}){this.raws={},this[ko]=!1,this[JP]=!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=fu(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 ZP(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 XP().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=QP){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=pu;pu.default=pu;var eT=ms,hu=class extends eT{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=hu;hu.default=hu;var tT="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",rT=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},nT=(e=21)=>{let t="",r=e;for(;r--;)t+=tT[Math.random()*64|0];return t},iT={nanoid:nT,customAlphabet:rT},{SourceMapConsumer:Um,SourceMapGenerator:Wm}=lt,{existsSync:oT,readFileSync:sT}=lt,{dirname:Jl,join:aT}=lt;function lT(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var mu=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=Jl(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Um(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 lT(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=Jl(t),oT(t))return this.mapFile=t,sT(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 Um)return Wm.fromSourceMap(r).toString();if(r instanceof Wm)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=aT(Jl(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)}},zg=mu;mu.default=mu;var{SourceMapConsumer:uT,SourceMapGenerator:cT}=lt,{fileURLToPath:zm,pathToFileURL:Eo}=lt,{isAbsolute:gu,resolve:yu}=lt,{nanoid:dT}=iT,Zl=lt,Gm=ec,fT=zg,Xl=Symbol("fromOffsetCache"),pT=!!(uT&&cT),Hm=!!(yu&&gu),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&&(!Hm||/^\w+:\/\//.test(r.from)||gu(r.from)?this.file=r.from:this.file=yu(r.from)),Hm&&pT){let n=new fT(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 "+dT(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 Gm(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 Gm(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[Xl])n=this[Xl];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[Xl]=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:yu(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;gu(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(zm)u.file=zm(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;Zl&&Zl.registerInput&&Zl.registerInput(rs);var{SourceMapConsumer:Gg,SourceMapGenerator:Go}=lt,{dirname:Ho,relative:Hg,resolve:qg,sep:Kg}=lt,{pathToFileURL:qm}=lt,hT=ys,mT=!!(Gg&&Go),gT=!!(Ho&&qg&&Hg&&Kg),yT=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let r=`
60
60
  `;this.css.includes(`\r
61
61
  `)&&(r=`\r
62
- `),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||Ho(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Wg(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),yT&&gT&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,r=>{t+=r}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Go.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Go({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Go({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,r=1,n="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=t,i.generated.column=r-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
63
- `),r=a.length-s):r+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(r=>r.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?Ho(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=Ho(Gg(n,this.mapOpts.annotation)));let i=zg(n,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new mT(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let r=this.memoizedFileURLs.get(t);if(r)return r;if(Gm){let n=Gm(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;Hg==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},qg=bT,ST=ms,yu=class extends ST{constructor(t){super(t),this.type="comment"}},bs=yu;yu.default=yu;var{isClean:Kg,my:Yg}=ri,Jg=gs,Zg=bs,wT=ms,Xg,ec,tc,Qg;function ey(e){return e.map(t=>(t.nodes&&(t.nodes=ey(t.nodes)),delete t.source,t))}function ty(e){if(e[Kg]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ty(t)}var Tt=class ry extends wT{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=ey(Xg(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Jg(t)]}else if(t.selector)t=[new ec(t)];else if(t.name)t=[new tc(t)];else if(t.text)t=[new Zg(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Yg]||ry.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Kg]&&ty(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Tt.registerParse=e=>{Xg=e};Tt.registerRule=e=>{ec=e};Tt.registerAtRule=e=>{tc=e};Tt.registerRoot=e=>{Qg=e};var gr=Tt;Tt.default=Tt;Tt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,tc.prototype):e.type==="rule"?Object.setPrototypeOf(e,ec.prototype):e.type==="decl"?Object.setPrototypeOf(e,Jg.prototype):e.type==="comment"?Object.setPrototypeOf(e,Zg.prototype):e.type==="root"&&Object.setPrototypeOf(e,Qg.prototype),e[Yg]=!0,e.nodes&&e.nodes.forEach(t=>{Tt.rebuild(t)})};var vT=gr,ny,iy,qn=class extends vT{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new ny(new iy,this,t).stringify()}};qn.registerLazyResult=e=>{ny=e};qn.registerProcessor=e=>{iy=e};var rc=qn;qn.default=qn;var Hm={},oy=function(t){Hm[t]||(Hm[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},bu=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},sy=bu;bu.default=bu;var xT=sy,Su=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new xT(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},nc=Su;Su.default=Su;var Xl=39,qm=34,Co=92,Km=47,Ao=10,Fn=32,Io=12,Po=9,To=13,RT=91,kT=93,ET=40,CT=41,AT=123,IT=125,PT=59,TT=42,MT=58,OT=64,Mo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Oo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,NT=/.[\r\n"'(/\\]/,Ym=/[\da-f]/i,LT=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=n.length,g=0,S=[],w=[];function y(){return g}function x(M){throw t.error("Unclosed "+M,g)}function E(){return w.length===0&&g>=m}function N(M){if(w.length)return w.pop();if(g>=m)return;let C=M?M.ignoreUnclosed:!1;switch(o=n.charCodeAt(g),o){case Ao:case Fn:case Po:case To:case Io:{s=g;do s+=1,o=n.charCodeAt(s);while(o===Fn||o===Ao||o===Po||o===To||o===Io);f=["space",n.slice(g,s)],g=s-1;break}case RT:case kT:case AT:case IT:case MT:case PT:case CT:{let V=String.fromCharCode(o);f=[V,V,g];break}case ET:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==Xl&&h!==qm&&h!==Fn&&h!==Ao&&h!==Po&&h!==Io&&h!==To){s=g;do{if(c=!1,s=n.indexOf(")",s+1),s===-1)if(i||C){s=g;break}else x("bracket");for(d=s;n.charCodeAt(d-1)===Co;)d-=1,c=!c}while(c);f=["brackets",n.slice(g,s+1),g,s],g=s}else s=n.indexOf(")",g+1),l=n.slice(g,s+1),s===-1||NT.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case Xl:case qm:{a=o===Xl?"'":'"',s=g;do{if(c=!1,s=n.indexOf(a,s+1),s===-1)if(i||C){s=g+1;break}else x("string");for(d=s;n.charCodeAt(d-1)===Co;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case OT:{Mo.lastIndex=g+1,Mo.test(n),Mo.lastIndex===0?s=n.length-1:s=Mo.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case Co:{for(s=g,u=!0;n.charCodeAt(s+1)===Co;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==Km&&o!==Fn&&o!==Ao&&o!==Po&&o!==To&&o!==Io&&(s+=1,Ym.test(n.charAt(s)))){for(;Ym.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===Fn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===Km&&n.charCodeAt(g+1)===TT?(s=n.indexOf("*/",g+2)+1,s===0&&(i||C?s=n.length:x("comment")),f=["comment",n.slice(g,s+1),g,s],g=s):(Oo.lastIndex=g+1,Oo.test(n),Oo.lastIndex===0?s=n.length-1:s=Oo.lastIndex-2,f=["word",n.slice(g,s+1),g,s],S.push(f),g=s);break}}return g++,f}function I(M){w.push(M)}return{back:I,endOfFile:E,nextToken:N,position:y}},ay=gr,ns=class extends ay{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}},ic=ns;ns.default=ns;ay.registerAtRule(ns);var ly=gr,uy,cy,zr=class extends ly{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new uy(new cy,this,t).stringify()}};zr.registerLazyResult=e=>{uy=e};zr.registerProcessor=e=>{cy=e};var ni=zr;zr.default=zr;ly.registerRoot(zr);var Kn={comma(e){return Kn.split(e,[","],!0)},space(e){let t=[" ",`
64
- `," "];return Kn.split(e,t)},split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let c of e)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?s+=1:c===")"?s>0&&(s-=1):s===0&&t.includes(c)&&(o=!0),o?(i!==""&&n.push(i.trim()),i="",o=!1):i+=c;return(r||i!=="")&&n.push(i.trim()),n}},dy=Kn;Kn.default=Kn;var fy=gr,$T=dy,is=class extends fy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return $T.comma(this.selector)}set selectors(t){let r=this.selector?this.selector.match(/,\s*/):null,n=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(n)}},oc=is;is.default=is;fy.registerRule(is);var DT=gs,_T=LT,FT=bs,jT=ic,VT=ni,Jm=oc,Zm={empty:!0,space:!0};function BT(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var UT=class{constructor(t){this.input=t,this.root=new VT,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let r=new jT;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),n=t[0],n==="("||n==="["?u.push(n==="("?")":"]"):n==="{"&&u.length>0?u.push("}"):n===u[u.length-1]&&u.pop(),u.length===0)if(n===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){a=!0;break}else if(n==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(r.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(r,"params",l),s&&(t=l[l.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let r=this.colon(t);if(r===!1)return;let n=0,i;for(let o=r-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(n+=1,n===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let r=0,n,i,o;for(let[s,a]of t.entries()){if(n=a,i=n[0],i==="("&&(r+=1),i===")"&&(r-=1),r===0&&i===":")if(!o)this.doubleColon(n);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=n}return!1}comment(t){let r=new FT;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;let n=t[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=i[2],r.raws.left=i[1],r.raws.right=i[3]}}createTokenizer(){this.tokenizer=_T(this.input)}decl(t,r){let n=new DT;this.init(n,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(i[3]||i[2]||BT(t)),n.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;n.prop+=t.shift()[1]}n.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){n.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){n.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(n.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let p=u;p>0;p--){let h=c[p][0];if(d.trim().indexOf("!")===0&&h!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(n.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(n,"value",s.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let r=new Jm;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}}init(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let r=!1,n=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(n=u[0],l.push(u),n==="("||n==="[")o||(o=u),s.push(n==="("?")":"]");else if(a&&i&&n==="{")o||(o=u),s.push("}");else if(s.length===0)if(n===";")if(i){this.decl(l,a);return}else break;else if(n==="{"){this.rule(l);return}else if(n==="}"){this.tokenizer.back(l.pop()),r=!0;break}else n===":"&&(i=!0);else n===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),s.length>0&&this.unclosedBracket(o),r&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,r,n,i){let o,s,a=n.length,l="",u=!0,c,d;for(let p=0;p<a;p+=1)o=n[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=n[p-1]?n[p-1][0]:"empty",c=n[p+1]?n[p+1][0]:"empty",!Zm[d]&&!Zm[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=n.reduce((h,f)=>h+f[1],"");t.raws[r]={raw:p,value:l}}t[r]=l}rule(t){t.pop();let r=new Jm;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r}spacesAndCommentsFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)n=t.pop()[1]+n;return n}spacesAndCommentsFromStart(t){let r,n="";for(;t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)n+=t.shift()[1];return n}spacesFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],r==="space");)n=t.pop()[1]+n;return n}stringFrom(t,r){let n="";for(let i=r;i<t.length;i++)n+=t[i][1];return t.splice(r,t.length-r),n}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})}},WT=UT,zT=gr,GT=WT,HT=ys;function os(e,t){let r=new HT(e,t),n=new GT(r);try{n.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
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 Gg(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(),gT&&mT&&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(qg(n,this.mapOpts.annotation)));let i=Hg(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 hT(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(qm){let n=qm(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;Kg==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Yg=yT,bT=ms,bu=class extends bT{constructor(t){super(t),this.type="comment"}},bs=bu;bu.default=bu;var{isClean:Jg,my:Zg}=ri,Xg=gs,Qg=bs,ST=ms,ey,tc,rc,ty;function ry(e){return e.map(t=>(t.nodes&&(t.nodes=ry(t.nodes)),delete t.source,t))}function ny(e){if(e[Jg]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ny(t)}var Tt=class iy extends ST{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=ry(ey(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 Xg(t)]}else if(t.selector)t=[new tc(t)];else if(t.name)t=[new rc(t)];else if(t.text)t=[new Qg(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Zg]||iy.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Jg]&&ny(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=>{ey=e};Tt.registerRule=e=>{tc=e};Tt.registerAtRule=e=>{rc=e};Tt.registerRoot=e=>{ty=e};var gr=Tt;Tt.default=Tt;Tt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,rc.prototype):e.type==="rule"?Object.setPrototypeOf(e,tc.prototype):e.type==="decl"?Object.setPrototypeOf(e,Xg.prototype):e.type==="comment"?Object.setPrototypeOf(e,Qg.prototype):e.type==="root"&&Object.setPrototypeOf(e,ty.prototype),e[Zg]=!0,e.nodes&&e.nodes.forEach(t=>{Tt.rebuild(t)})};var wT=gr,oy,sy,qn=class extends wT{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new oy(new sy,this,t).stringify()}};qn.registerLazyResult=e=>{oy=e};qn.registerProcessor=e=>{sy=e};var nc=qn;qn.default=qn;var Km={},ay=function(t){Km[t]||(Km[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Su=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}},ly=Su;Su.default=Su;var vT=ly,wu=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 vT(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},ic=wu;wu.default=wu;var Ql=39,Ym=34,Co=92,Jm=47,Ao=10,Fn=32,Io=12,Po=9,To=13,xT=91,RT=93,kT=40,ET=41,CT=123,AT=125,IT=59,PT=42,TT=58,MT=64,Mo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Oo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,OT=/.[\r\n"'(/\\]/,Zm=/[\da-f]/i,NT=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 xT:case RT:case CT:case AT:case TT:case IT:case ET:{let V=String.fromCharCode(o);f=[V,V,g];break}case kT:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==Ql&&h!==Ym&&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||OT.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case Ql:case Ym:{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)===Co;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case MT:{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!==Jm&&o!==Fn&&o!==Ao&&o!==Po&&o!==To&&o!==Io&&(s+=1,Zm.test(n.charAt(s)))){for(;Zm.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===Jm&&n.charCodeAt(g+1)===PT?(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}},uy=gr,ns=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)}},oc=ns;ns.default=ns;uy.registerAtRule(ns);var cy=gr,dy,fy,zr=class extends cy{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 dy(new fy,this,t).stringify()}};zr.registerLazyResult=e=>{dy=e};zr.registerProcessor=e=>{fy=e};var ni=zr;zr.default=zr;cy.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}},py=Kn;Kn.default=Kn;var hy=gr,LT=py,is=class extends hy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return LT.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)}},sc=is;is.default=is;hy.registerRule(is);var $T=gs,DT=NT,_T=bs,FT=oc,jT=ni,Xm=sc,Qm={empty:!0,space:!0};function VT(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var BT=class{constructor(t){this.input=t,this.root=new jT,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 FT;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 _T;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=DT(this.input)}decl(t,r){let n=new $T;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]||VT(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 Xm;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",!Qm[d]&&!Qm[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 Xm;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})}},UT=BT,WT=gr,zT=UT,GT=ys;function os(e,t){let r=new GT(e,t),n=new zT(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 sc=os;os.default=os;zT.registerParse(os);var{isClean:bt,my:qT}=ri,KT=qg,YT=hs,JT=gr,ZT=rc,XT=oy,Xm=nc,QT=sc,eM=ni,tM={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},rM={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},nM={Once:!0,postcssPlugin:!0,prepare:!0},Gr=0;function jn(e){return typeof e=="object"&&typeof e.then=="function"}function py(e){let t=!1,r=tM[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Gr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Gr,r+"Exit"]:[r,r+"Exit"]}function Qm(e){let t;return e.type==="document"?t=["Document",Gr,"DocumentExit"]:e.type==="root"?t=["Root",Gr,"RootExit"]:t=py(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function wu(e){return e[bt]=!1,e.nodes&&e.nodes.forEach(t=>wu(t)),e}var vu={},Hr=class hy{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=wu(r);else if(r instanceof hy||r instanceof Xm)i=wu(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=QT;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[qT]&&JT.rebuild(i)}this.result=new Xm(t,i,n),this.helpers={...vu,postcss:vu,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!rM[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!nM[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(jn(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[bt];){t[bt]=!0;let r=[Qm(t)];for(;r.length>0;){let n=this.visitTick(r);if(jn(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return jn(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=YT;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new KT(r,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let r=this.runOnRoot(t);if(jn(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[bt];)t[bt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||XT("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(jn(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[bt]){a[bt]=!0,t.push(Qm(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Gr){n.nodes&&n.nodes.length&&(n[bt]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[bt]=!0;let r=py(t);for(let n of r)if(n===Gr)t.nodes&&t.each(i=>{i[bt]||this.walkSync(i)});else{let i=this.listeners[n];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Hr.registerPostcss=e=>{vu=e};var my=Hr;Hr.default=Hr;eM.registerLazyResult(Hr);ZT.registerLazyResult(Hr);var iM=qg,oM=hs,sM=oy,aM=sc,lM=nc,xu=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=oM;this.result=new lM(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new iM(o,i,this._opts,r);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||sM("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,r=aM;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},uM=xu;xu.default=xu;var cM=uM,dM=my,fM=rc,pM=ni,Yn=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new cM(this,t,r):new dM(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},hM=Yn;Yn.default=Yn;pM.registerProcessor(Yn);fM.registerProcessor(Yn);var mM=gs,gM=Ug,yM=bs,bM=ic,SM=ys,wM=ni,vM=oc;function Jn(e,t){if(Array.isArray(e))return e.map(i=>Jn(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:SM.prototype};o.map&&(o.map={...o.map,__proto__:gM.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>Jn(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new wM(n);if(n.type==="decl")return new mM(n);if(n.type==="rule")return new vM(n);if(n.type==="comment")return new yM(n);if(n.type==="atrule")return new bM(n);throw new Error("Unknown node type: "+e.type)}var xM=Jn;Jn.default=Jn;var RM=Qu,gy=gs,kM=my,EM=gr,ac=hM,CM=hs,AM=xM,yy=rc,IM=sy,by=bs,Sy=ic,PM=nc,TM=ys,MM=sc,OM=dy,wy=oc,vy=ni,NM=ms;function ne(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new ac(e)}ne.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
67
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var ac=os;os.default=os;WT.registerParse(os);var{isClean:bt,my:HT}=ri,qT=Yg,KT=hs,YT=gr,JT=nc,ZT=ay,eg=ic,XT=ac,QT=ni,eM={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},tM={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},rM={Once:!0,postcssPlugin:!0,prepare:!0},Gr=0;function jn(e){return typeof e=="object"&&typeof e.then=="function"}function my(e){let t=!1,r=eM[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 tg(e){let t;return e.type==="document"?t=["Document",Gr,"DocumentExit"]:e.type==="root"?t=["Root",Gr,"RootExit"]:t=my(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function vu(e){return e[bt]=!1,e.nodes&&e.nodes.forEach(t=>vu(t)),e}var xu={},Hr=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=vu(r);else if(r instanceof gy||r instanceof eg)i=vu(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=XT;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[HT]&&YT.rebuild(i)}this.result=new eg(t,i,n),this.helpers={...xu,postcss:xu,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(!tM[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!rM[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=[tg(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=KT;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new qT(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||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}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(tg(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=my(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=>{xu=e};var yy=Hr;Hr.default=Hr;QT.registerLazyResult(Hr);JT.registerLazyResult(Hr);var nM=Yg,iM=hs,oM=ay,sM=ac,aM=ic,Ru=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=iM;this.result=new aM(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new nM(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||oM("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=sM;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"}},lM=Ru;Ru.default=Ru;var uM=lM,cM=yy,dM=nc,fM=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 uM(this,t,r):new cM(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},pM=Yn;Yn.default=Yn;fM.registerProcessor(Yn);dM.registerProcessor(Yn);var hM=gs,mM=zg,gM=bs,yM=oc,bM=ys,SM=ni,wM=sc;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__:bM.prototype};o.map&&(o.map={...o.map,__proto__:mM.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 SM(n);if(n.type==="decl")return new hM(n);if(n.type==="rule")return new wM(n);if(n.type==="comment")return new gM(n);if(n.type==="atrule")return new yM(n);throw new Error("Unknown node type: "+e.type)}var vM=Jn;Jn.default=Jn;var xM=ec,by=gs,RM=yy,kM=gr,lc=pM,EM=hs,CM=vM,Sy=nc,AM=ly,wy=bs,vy=oc,IM=ic,PM=ys,TM=ac,MM=py,xy=sc,Ry=ni,OM=ms;function ne(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new lc(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 ac().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return ne([i(l)]).process(s,a)},i};ne.stringify=CM;ne.parse=MM;ne.fromJSON=AM;ne.list=OM;ne.comment=e=>new by(e);ne.atRule=e=>new Sy(e);ne.decl=e=>new gy(e);ne.rule=e=>new wy(e);ne.root=e=>new vy(e);ne.document=e=>new yy(e);ne.CssSyntaxError=RM;ne.Declaration=gy;ne.Container=EM;ne.Processor=ac;ne.Document=yy;ne.Comment=by;ne.Warning=IM;ne.AtRule=Sy;ne.Result=PM;ne.Input=TM;ne.Rule=wy;ne.Root=vy;ne.Node=NM;kM.registerPostcss(ne);var LM=ne;ne.default=ne;var he=zP(LM);he.stringify;he.fromJSON;he.plugin;he.parse;he.list;he.document;he.comment;he.atRule;he.rule;he.decl;he.root;he.CssSyntaxError;he.Declaration;he.Container;he.Processor;he.Document;he.Comment;he.Warning;he.AtRule;he.Result;he.Input;he.Rule;he.Root;he.Node;var $M=Object.defineProperty,DM=(e,t,r)=>t in e?$M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qe=(e,t,r)=>DM(e,typeof t!="symbol"?t+"":t,r);function _M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function FM(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var lc={exports:{}},pe=String,xy=function(){return{isColorSupported:!1,reset:pe,bold:pe,dim:pe,italic:pe,underline:pe,inverse:pe,hidden:pe,strikethrough:pe,black:pe,red:pe,green:pe,yellow:pe,blue:pe,magenta:pe,cyan:pe,white:pe,gray:pe,bgBlack:pe,bgRed:pe,bgGreen:pe,bgYellow:pe,bgBlue:pe,bgMagenta:pe,bgCyan:pe,bgWhite:pe}};lc.exports=xy();lc.exports.createColors=xy;var jM=lc.exports,VM={},BM=Object.freeze(Object.defineProperty({__proto__:null,default:VM},Symbol.toStringTag,{value:"Module"})),ut=FM(BM),eg=jM,tg=ut,Ru=class Ry extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof r<"u"&&typeof n<"u"&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ry)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=eg.isColorSupported),tg&&t&&(r=tg(r));let n=r.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=eg.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return n.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let h=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
69
+ https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new lc().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=EM;ne.parse=TM;ne.fromJSON=CM;ne.list=MM;ne.comment=e=>new wy(e);ne.atRule=e=>new vy(e);ne.decl=e=>new by(e);ne.rule=e=>new xy(e);ne.root=e=>new Ry(e);ne.document=e=>new Sy(e);ne.CssSyntaxError=xM;ne.Declaration=by;ne.Container=kM;ne.Processor=lc;ne.Document=Sy;ne.Comment=wy;ne.Warning=AM;ne.AtRule=vy;ne.Result=IM;ne.Input=PM;ne.Rule=xy;ne.Root=Ry;ne.Node=OM;RM.registerPostcss(ne);var NM=ne;ne.default=ne;var he=WP(NM);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 LM=Object.defineProperty,$M=(e,t,r)=>t in e?LM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qe=(e,t,r)=>$M(e,typeof t!="symbol"?t+"":t,r);function DM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _M(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 uc={exports:{}},pe=String,ky=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}};uc.exports=ky();uc.exports.createColors=ky;var FM=uc.exports,jM={},VM=Object.freeze(Object.defineProperty({__proto__:null,default:jM},Symbol.toStringTag,{value:"Module"})),ut=_M(VM),rg=FM,ng=ut,ku=class Ey 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,Ey)}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=rg.isColorSupported),ng&&t&&(r=ng(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}=rg.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}},uc=Ru;Ru.default=Ru;var ii={};ii.isClean=Symbol("isClean");ii.my=Symbol("my");var rg={after:`
74
+ `),this.name+": "+this.message+t}},cc=ku;ku.default=ku;var ii={};ii.isClean=Symbol("isClean");ii.my=Symbol("my");var ig={after:`
75
75
  `,beforeClose:`
76
76
  `,beforeComment:`
77
77
  `,beforeDecl:`
78
78
  `,beforeOpen:" ",beforeRule:`
79
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function UM(e){return e[0].toUpperCase()+e.slice(1)}var ku=class{constructor(t){this.builder=t}atrule(t,r){let n="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?n+=t.raws.afterName:i&&(n+=" "),t.nodes)this.block(t,n+i);else{let o=(t.raws.between||"")+(r?";":"");this.builder(n+i+o,t)}}beforeAfter(t,r){let n;t.type==="decl"?n=this.raw(t,null,"beforeDecl"):t.type==="comment"?n=this.raw(t,null,"beforeComment"):r==="before"?n=this.raw(t,null,"beforeRule"):n=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(n.includes(`
80
- `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return rg[n];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[n]<"u")return s.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(t,n);{let a="raw"+UM(n);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[r],typeof i<"u")return!1})}return typeof i>"u"&&(i=rg[n]),s.rawCache[n]=i,i}rawBeforeClose(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return r=n.raws.after,r.includes(`
79
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function BM(e){return e[0].toUpperCase()+e.slice(1)}var Eu=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 ig[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"+BM(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=ig[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)}},ky=ku;ku.default=ku;var WM=ky;function Eu(e,t){new WM(t).stringify(e)}var Ss=Eu;Eu.default=Eu;var{isClean:No,my:zM}=ii,GM=uc,HM=ky,qM=Ss;function Cu(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let i=e[n],o=typeof i;n==="parent"&&o==="object"?t&&(r[n]=t):n==="source"?r[n]=i:Array.isArray(i)?r[n]=i.map(s=>Cu(s,r)):(o==="object"&&i!==null&&(i=Cu(i)),r[n]=i)}return r}var Au=class{constructor(t={}){this.raws={},this[No]=!1,this[zM]=!0;for(let r in t)if(r==="nodes"){this.nodes=[];for(let n of t[r])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[r]=t[r]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${r.input.from}:${r.start.line}:${r.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let r in t)this[r]=t[r];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let r=Cu(this);for(let n in t)r[n]=t[n];return r}cloneAfter(t={}){let r=this.clone(t);return this.parent.insertAfter(this,r),r}cloneBefore(t={}){let r=this.clone(t);return this.parent.insertBefore(this,r),r}error(t,r={}){if(this.source){let{end:n,start:i}=this.rangeBy(r);return this.source.input.error(t,{column:i.column,line:i.line},{column:n.column,line:n.line},r)}return new GM(t)}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:r==="root"?()=>t.root().toProxy():t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}}markDirty(){if(this[No]){this[No]=!1;let t=this;for(;t=t.parent;)t[No]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,r){let n=this.source.start;if(t.index)n=this.positionInside(t.index,r);else if(t.word){r=this.toString();let i=r.indexOf(t.word);i!==-1&&(n=this.positionInside(i,r))}return n}positionInside(t,r){let n=r||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)n[s]===`
86
- `?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new HM().raw(this,t,r)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let r=this,n=!1;for(let i of t)i===this?n=!0:n?(this.parent.insertAfter(r,i),r=i):this.parent.insertBefore(r,i);n||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,r){let n={},i=r==null;r=r||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))n[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,r):l);else if(typeof a=="object"&&a.toJSON)n[s]=a.toJSON(null,r);else if(s==="source"){let l=r.get(a.input);l==null&&(l=o,r.set(a.input,o),o++),n[s]={end:a.end,inputId:l,start:a.start}}else n[s]=a}return i&&(n.inputs=[...r.keys()].map(s=>s.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=qM){t.stringify&&(t=t.stringify);let r="";return t(this,n=>{r+=n}),r}warn(t,r,n){let i={node:this};for(let o in n)i[o]=n[o];return t.warn(r,i)}get proxyOf(){return this}},ws=Au;Au.default=Au;var KM=ws,Iu=class extends KM{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},vs=Iu;Iu.default=Iu;var YM="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",JM=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},ZM=(e=21)=>{let t="",r=e;for(;r--;)t+=YM[Math.random()*64|0];return t},XM={nanoid:ZM,customAlphabet:JM},{SourceMapConsumer:ng,SourceMapGenerator:ig}=ut,{existsSync:QM,readFileSync:eO}=ut,{dirname:Ql,join:tO}=ut;function rO(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Pu=class{constructor(t,r){if(r.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let n=r.map?r.map.prev:void 0,i=this.loadMap(r.from,n);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=Ql(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new ng(this.text)),this.consumerCache}decodeInline(t){let r=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(r.test(t)||n.test(t))return rO(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!r)return;let n=t.lastIndexOf(r.pop()),i=t.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(n,i)))}loadFile(t){if(this.root=Ql(t),QM(t))return this.mapFile=t,eO(t,"utf-8").toString().trim()}loadMap(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){let n=r(t);if(n){let i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(r instanceof ng)return ig.fromSourceMap(r).toString();if(r instanceof ig)return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let n=this.annotation;return t&&(n=tO(Ql(t),n)),this.loadFile(n)}}}startWith(t,r){return t?t.substr(0,r.length)===r:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Ey=Pu;Pu.default=Pu;var{SourceMapConsumer:nO,SourceMapGenerator:iO}=ut,{fileURLToPath:og,pathToFileURL:Lo}=ut,{isAbsolute:Tu,resolve:Mu}=ut,{nanoid:oO}=XM,eu=ut,sg=uc,sO=Ey,tu=Symbol("fromOffsetCache"),aO=!!(nO&&iO),ag=!!(Mu&&Tu),ss=class{constructor(t,r={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,r.from&&(!ag||/^\w+:\/\//.test(r.from)||Tu(r.from)?this.file=r.from:this.file=Mu(r.from)),ag&&aO){let n=new sO(this.css,r);if(n.text){this.map=n;let i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+oO(6)+">"),this.map&&(this.map.file=this.from)}error(t,r,n,i={}){let o,s,a;if(r&&typeof r=="object"){let u=r,c=n;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);r=d.line,n=d.col}else r=u.line,n=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);s=d.line,a=d.col}else s=c.line,a=c.column}else if(!n){let u=this.fromOffset(r);r=u.line,n=u.col}let l=this.origin(r,n,s,a);return l?o=new sg(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new sg(t,s===void 0?r:{column:n,line:r},s===void 0?n:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:n,endColumn:a,endLine:s,line:r,source:this.css},this.file&&(Lo&&(o.input.url=Lo(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let r,n;if(this[tu])n=this[tu];else{let o=this.css.split(`
87
- `);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[tu]=n}r=n[n.length-1];let i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<n[s])o=s-1;else if(t>=n[s+1])i=s+1;else{i=s;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Mu(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,n,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:r,line:t});if(!s.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:i,line:n}));let l;Tu(s.source)?l=Lo(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||Lo(this.map.mapFile));let u={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(og)u.file=og(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let t={};for(let r of["hasBOM","css","file","id"])this[r]!=null&&(t[r]=this[r]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},xs=ss;ss.default=ss;eu&&eu.registerInput&&eu.registerInput(ss);var{SourceMapConsumer:Cy,SourceMapGenerator:qo}=ut,{dirname:Ko,relative:Ay,resolve:Iy,sep:Py}=ut,{pathToFileURL:lg}=ut,lO=xs,uO=!!(Cy&&qo),cO=!!(Ko&&Iy&&Ay&&Py),dO=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let r=`
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)}},Cy=Eu;Eu.default=Eu;var UM=Cy;function Cu(e,t){new UM(t).stringify(e)}var Ss=Cu;Cu.default=Cu;var{isClean:No,my:WM}=ii,zM=cc,GM=Cy,HM=Ss;function Au(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=>Au(s,r)):(o==="object"&&i!==null&&(i=Au(i)),r[n]=i)}return r}var Iu=class{constructor(t={}){this.raws={},this[No]=!1,this[WM]=!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=Au(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 zM(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 GM().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=HM){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=Iu;Iu.default=Iu;var qM=ws,Pu=class extends qM{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=Pu;Pu.default=Pu;var KM="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",YM=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},JM=(e=21)=>{let t="",r=e;for(;r--;)t+=KM[Math.random()*64|0];return t},ZM={nanoid:JM,customAlphabet:YM},{SourceMapConsumer:og,SourceMapGenerator:sg}=ut,{existsSync:XM,readFileSync:QM}=ut,{dirname:eu,join:eO}=ut;function tO(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Tu=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=eu(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new og(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 tO(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=eu(t),XM(t))return this.mapFile=t,QM(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 og)return sg.fromSourceMap(r).toString();if(r instanceof sg)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=eO(eu(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)}},Ay=Tu;Tu.default=Tu;var{SourceMapConsumer:rO,SourceMapGenerator:nO}=ut,{fileURLToPath:ag,pathToFileURL:Lo}=ut,{isAbsolute:Mu,resolve:Ou}=ut,{nanoid:iO}=ZM,tu=ut,lg=cc,oO=Ay,ru=Symbol("fromOffsetCache"),sO=!!(rO&&nO),ug=!!(Ou&&Mu),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&&(!ug||/^\w+:\/\//.test(r.from)||Mu(r.from)?this.file=r.from:this.file=Ou(r.from)),ug&&sO){let n=new oO(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 "+iO(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 lg(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 lg(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[ru])n=this[ru];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[ru]=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:Ou(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,n,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:r,line:t});if(!s.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:i,line:n}));let l;Mu(s.source)?l=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(ag)u.file=ag(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;tu&&tu.registerInput&&tu.registerInput(ss);var{SourceMapConsumer:Iy,SourceMapGenerator:qo}=ut,{dirname:Ko,relative:Py,resolve:Ty,sep:My}=ut,{pathToFileURL:cg}=ut,aO=xs,lO=!!(Iy&&qo),uO=!!(Ko&&Ty&&Py&&My),cO=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let r=`
88
88
  `;this.css.includes(`\r
89
89
  `)&&(r=`\r
90
- `),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||Ko(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Cy(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),cO&&uO&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,r=>{t+=r}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=qo.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new qo({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new qo({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,r=1,n="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=t,i.generated.column=r-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
91
- `),r=a.length-s):r+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(r=>r.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?Ko(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=Ko(Iy(n,this.mapOpts.annotation)));let i=Ay(n,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new lO(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let r=this.memoizedFileURLs.get(t);if(r)return r;if(lg){let n=lg(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;Py==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Ty=dO,fO=ws,Ou=class extends fO{constructor(t){super(t),this.type="comment"}},Rs=Ou;Ou.default=Ou;var{isClean:My,my:Oy}=ii,Ny=vs,Ly=Rs,pO=ws,$y,cc,dc,Dy;function _y(e){return e.map(t=>(t.nodes&&(t.nodes=_y(t.nodes)),delete t.source,t))}function Fy(e){if(e[My]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Fy(t)}var Mt=class jy extends pO{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=_y($y(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Ny(t)]}else if(t.selector)t=[new cc(t)];else if(t.name)t=[new dc(t)];else if(t.text)t=[new Ly(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Oy]||jy.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[My]&&Fy(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Mt.registerParse=e=>{$y=e};Mt.registerRule=e=>{cc=e};Mt.registerAtRule=e=>{dc=e};Mt.registerRoot=e=>{Dy=e};var yr=Mt;Mt.default=Mt;Mt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,dc.prototype):e.type==="rule"?Object.setPrototypeOf(e,cc.prototype):e.type==="decl"?Object.setPrototypeOf(e,Ny.prototype):e.type==="comment"?Object.setPrototypeOf(e,Ly.prototype):e.type==="root"&&Object.setPrototypeOf(e,Dy.prototype),e[Oy]=!0,e.nodes&&e.nodes.forEach(t=>{Mt.rebuild(t)})};var hO=yr,Vy,By,Zn=class extends hO{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Vy(new By,this,t).stringify()}};Zn.registerLazyResult=e=>{Vy=e};Zn.registerProcessor=e=>{By=e};var fc=Zn;Zn.default=Zn;var ug={},Uy=function(t){ug[t]||(ug[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Nu=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},Wy=Nu;Nu.default=Nu;var mO=Wy,Lu=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new mO(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},pc=Lu;Lu.default=Lu;var ru=39,cg=34,$o=92,dg=47,Do=10,Vn=32,_o=12,Fo=9,jo=13,gO=91,yO=93,bO=40,SO=41,wO=123,vO=125,xO=59,RO=42,kO=58,EO=64,Vo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Bo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,CO=/.[\r\n"'(/\\]/,fg=/[\da-f]/i,AO=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=n.length,g=0,S=[],w=[];function y(){return g}function x(M){throw t.error("Unclosed "+M,g)}function E(){return w.length===0&&g>=m}function N(M){if(w.length)return w.pop();if(g>=m)return;let C=M?M.ignoreUnclosed:!1;switch(o=n.charCodeAt(g),o){case Do:case Vn:case Fo:case jo:case _o:{s=g;do s+=1,o=n.charCodeAt(s);while(o===Vn||o===Do||o===Fo||o===jo||o===_o);f=["space",n.slice(g,s)],g=s-1;break}case gO:case yO:case wO:case vO:case kO:case xO:case SO:{let V=String.fromCharCode(o);f=[V,V,g];break}case bO:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==ru&&h!==cg&&h!==Vn&&h!==Do&&h!==Fo&&h!==_o&&h!==jo){s=g;do{if(c=!1,s=n.indexOf(")",s+1),s===-1)if(i||C){s=g;break}else x("bracket");for(d=s;n.charCodeAt(d-1)===$o;)d-=1,c=!c}while(c);f=["brackets",n.slice(g,s+1),g,s],g=s}else s=n.indexOf(")",g+1),l=n.slice(g,s+1),s===-1||CO.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case ru:case cg:{a=o===ru?"'":'"',s=g;do{if(c=!1,s=n.indexOf(a,s+1),s===-1)if(i||C){s=g+1;break}else x("string");for(d=s;n.charCodeAt(d-1)===$o;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case EO:{Vo.lastIndex=g+1,Vo.test(n),Vo.lastIndex===0?s=n.length-1:s=Vo.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case $o:{for(s=g,u=!0;n.charCodeAt(s+1)===$o;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==dg&&o!==Vn&&o!==Do&&o!==Fo&&o!==jo&&o!==_o&&(s+=1,fg.test(n.charAt(s)))){for(;fg.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===Vn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===dg&&n.charCodeAt(g+1)===RO?(s=n.indexOf("*/",g+2)+1,s===0&&(i||C?s=n.length:x("comment")),f=["comment",n.slice(g,s+1),g,s],g=s):(Bo.lastIndex=g+1,Bo.test(n),Bo.lastIndex===0?s=n.length-1:s=Bo.lastIndex-2,f=["word",n.slice(g,s+1),g,s],S.push(f),g=s);break}}return g++,f}function I(M){w.push(M)}return{back:I,endOfFile:E,nextToken:N,position:y}},zy=yr,as=class extends zy{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}},hc=as;as.default=as;zy.registerAtRule(as);var Gy=yr,Hy,qy,qr=class extends Gy{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new Hy(new qy,this,t).stringify()}};qr.registerLazyResult=e=>{Hy=e};qr.registerProcessor=e=>{qy=e};var oi=qr;qr.default=qr;Gy.registerRoot(qr);var Xn={comma(e){return Xn.split(e,[","],!0)},space(e){let t=[" ",`
92
- `," "];return Xn.split(e,t)},split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let c of e)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?s+=1:c===")"?s>0&&(s-=1):s===0&&t.includes(c)&&(o=!0),o?(i!==""&&n.push(i.trim()),i="",o=!1):i+=c;return(r||i!=="")&&n.push(i.trim()),n}},Ky=Xn;Xn.default=Xn;var Yy=yr,IO=Ky,ls=class extends Yy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return IO.comma(this.selector)}set selectors(t){let r=this.selector?this.selector.match(/,\s*/):null,n=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(n)}},mc=ls;ls.default=ls;Yy.registerRule(ls);var PO=vs,TO=AO,MO=Rs,OO=hc,NO=oi,pg=mc,hg={empty:!0,space:!0};function LO(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var $O=class{constructor(t){this.input=t,this.root=new NO,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let r=new OO;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),n=t[0],n==="("||n==="["?u.push(n==="("?")":"]"):n==="{"&&u.length>0?u.push("}"):n===u[u.length-1]&&u.pop(),u.length===0)if(n===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){a=!0;break}else if(n==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(r.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(r,"params",l),s&&(t=l[l.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let r=this.colon(t);if(r===!1)return;let n=0,i;for(let o=r-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(n+=1,n===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let r=0,n,i,o;for(let[s,a]of t.entries()){if(n=a,i=n[0],i==="("&&(r+=1),i===")"&&(r-=1),r===0&&i===":")if(!o)this.doubleColon(n);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=n}return!1}comment(t){let r=new MO;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;let n=t[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=i[2],r.raws.left=i[1],r.raws.right=i[3]}}createTokenizer(){this.tokenizer=TO(this.input)}decl(t,r){let n=new PO;this.init(n,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(i[3]||i[2]||LO(t)),n.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;n.prop+=t.shift()[1]}n.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){n.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){n.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(n.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let p=u;p>0;p--){let h=c[p][0];if(d.trim().indexOf("!")===0&&h!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(n.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(n,"value",s.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let r=new pg;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}}init(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let r=!1,n=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(n=u[0],l.push(u),n==="("||n==="[")o||(o=u),s.push(n==="("?")":"]");else if(a&&i&&n==="{")o||(o=u),s.push("}");else if(s.length===0)if(n===";")if(i){this.decl(l,a);return}else break;else if(n==="{"){this.rule(l);return}else if(n==="}"){this.tokenizer.back(l.pop()),r=!0;break}else n===":"&&(i=!0);else n===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),s.length>0&&this.unclosedBracket(o),r&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,r,n,i){let o,s,a=n.length,l="",u=!0,c,d;for(let p=0;p<a;p+=1)o=n[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=n[p-1]?n[p-1][0]:"empty",c=n[p+1]?n[p+1][0]:"empty",!hg[d]&&!hg[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=n.reduce((h,f)=>h+f[1],"");t.raws[r]={raw:p,value:l}}t[r]=l}rule(t){t.pop();let r=new pg;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r}spacesAndCommentsFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)n=t.pop()[1]+n;return n}spacesAndCommentsFromStart(t){let r,n="";for(;t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)n+=t.shift()[1];return n}spacesFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],r==="space");)n=t.pop()[1]+n;return n}stringFrom(t,r){let n="";for(let i=r;i<t.length;i++)n+=t[i][1];return t.splice(r,t.length-r),n}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})}},DO=$O,_O=yr,FO=DO,jO=xs;function us(e,t){let r=new jO(e,t),n=new FO(r);try{n.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
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 Iy(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(),uO&&lO&&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(Ty(n,this.mapOpts.annotation)));let i=Py(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 aO(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(cg){let n=cg(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;My==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Oy=cO,dO=ws,Nu=class extends dO{constructor(t){super(t),this.type="comment"}},Rs=Nu;Nu.default=Nu;var{isClean:Ny,my:Ly}=ii,$y=vs,Dy=Rs,fO=ws,_y,dc,fc,Fy;function jy(e){return e.map(t=>(t.nodes&&(t.nodes=jy(t.nodes)),delete t.source,t))}function Vy(e){if(e[Ny]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Vy(t)}var Mt=class By extends fO{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=jy(_y(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new $y(t)]}else if(t.selector)t=[new dc(t)];else if(t.name)t=[new fc(t)];else if(t.text)t=[new Dy(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Ly]||By.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Ny]&&Vy(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Mt.registerParse=e=>{_y=e};Mt.registerRule=e=>{dc=e};Mt.registerAtRule=e=>{fc=e};Mt.registerRoot=e=>{Fy=e};var yr=Mt;Mt.default=Mt;Mt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,fc.prototype):e.type==="rule"?Object.setPrototypeOf(e,dc.prototype):e.type==="decl"?Object.setPrototypeOf(e,$y.prototype):e.type==="comment"?Object.setPrototypeOf(e,Dy.prototype):e.type==="root"&&Object.setPrototypeOf(e,Fy.prototype),e[Ly]=!0,e.nodes&&e.nodes.forEach(t=>{Mt.rebuild(t)})};var pO=yr,Uy,Wy,Zn=class extends pO{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Uy(new Wy,this,t).stringify()}};Zn.registerLazyResult=e=>{Uy=e};Zn.registerProcessor=e=>{Wy=e};var pc=Zn;Zn.default=Zn;var dg={},zy=function(t){dg[t]||(dg[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Lu=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}},Gy=Lu;Lu.default=Lu;var hO=Gy,$u=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 hO(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},hc=$u;$u.default=$u;var nu=39,fg=34,$o=92,pg=47,Do=10,Vn=32,_o=12,Fo=9,jo=13,mO=91,gO=93,yO=40,bO=41,SO=123,wO=125,vO=59,xO=42,RO=58,kO=64,Vo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Bo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,EO=/.[\r\n"'(/\\]/,hg=/[\da-f]/i,CO=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 mO:case gO:case SO:case wO:case RO:case vO:case bO:{let V=String.fromCharCode(o);f=[V,V,g];break}case yO:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==nu&&h!==fg&&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||EO.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case nu:case fg:{a=o===nu?"'":'"',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 kO:{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!==pg&&o!==Vn&&o!==Do&&o!==Fo&&o!==jo&&o!==_o&&(s+=1,hg.test(n.charAt(s)))){for(;hg.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===pg&&n.charCodeAt(g+1)===xO?(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}},Hy=yr,as=class extends Hy{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)}},mc=as;as.default=as;Hy.registerAtRule(as);var qy=yr,Ky,Yy,qr=class extends qy{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 Ky(new Yy,this,t).stringify()}};qr.registerLazyResult=e=>{Ky=e};qr.registerProcessor=e=>{Yy=e};var oi=qr;qr.default=qr;qy.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}},Jy=Xn;Xn.default=Xn;var Zy=yr,AO=Jy,ls=class extends Zy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return AO.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)}},gc=ls;ls.default=ls;Zy.registerRule(ls);var IO=vs,PO=CO,TO=Rs,MO=mc,OO=oi,mg=gc,gg={empty:!0,space:!0};function NO(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var LO=class{constructor(t){this.input=t,this.root=new OO,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 MO;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 TO;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=PO(this.input)}decl(t,r){let n=new IO;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]||NO(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 mg;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",!gg[d]&&!gg[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 mg;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})}},$O=LO,DO=yr,_O=$O,FO=xs;function us(e,t){let r=new FO(e,t),n=new _O(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 gc=us;us.default=us;_O.registerParse(us);var{isClean:St,my:VO}=ii,BO=Ty,UO=Ss,WO=yr,zO=fc,GO=Uy,mg=pc,HO=gc,qO=oi,KO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},YO={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},JO={Once:!0,postcssPlugin:!0,prepare:!0},Kr=0;function Bn(e){return typeof e=="object"&&typeof e.then=="function"}function Jy(e){let t=!1,r=KO[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Kr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Kr,r+"Exit"]:[r,r+"Exit"]}function gg(e){let t;return e.type==="document"?t=["Document",Kr,"DocumentExit"]:e.type==="root"?t=["Root",Kr,"RootExit"]:t=Jy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function $u(e){return e[St]=!1,e.nodes&&e.nodes.forEach(t=>$u(t)),e}var Du={},Yr=class Zy{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=$u(r);else if(r instanceof Zy||r instanceof mg)i=$u(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=HO;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[VO]&&WO.rebuild(i)}this.result=new mg(t,i,n),this.helpers={...Du,postcss:Du,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!YO[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!JO[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(Bn(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[St];){t[St]=!0;let r=[gg(t)];for(;r.length>0;){let n=this.visitTick(r);if(Bn(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return Bn(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=UO;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new BO(r,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let r=this.runOnRoot(t);if(Bn(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[St];)t[St]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||GO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Bn(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[St]){a[St]=!0,t.push(gg(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Kr){n.nodes&&n.nodes.length&&(n[St]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[St]=!0;let r=Jy(t);for(let n of r)if(n===Kr)t.nodes&&t.each(i=>{i[St]||this.walkSync(i)});else{let i=this.listeners[n];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Yr.registerPostcss=e=>{Du=e};var Xy=Yr;Yr.default=Yr;qO.registerLazyResult(Yr);zO.registerLazyResult(Yr);var ZO=Ty,XO=Ss,QO=Uy,e2=gc,t2=pc,_u=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=XO;this.result=new t2(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new ZO(o,i,this._opts,r);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||QO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,r=e2;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},r2=_u;_u.default=_u;var n2=r2,i2=Xy,o2=fc,s2=oi,Qn=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new n2(this,t,r):new i2(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},a2=Qn;Qn.default=Qn;s2.registerProcessor(Qn);o2.registerProcessor(Qn);var l2=vs,u2=Ey,c2=Rs,d2=hc,f2=xs,p2=oi,h2=mc;function ei(e,t){if(Array.isArray(e))return e.map(i=>ei(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:f2.prototype};o.map&&(o.map={...o.map,__proto__:u2.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>ei(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new p2(n);if(n.type==="decl")return new l2(n);if(n.type==="rule")return new h2(n);if(n.type==="comment")return new c2(n);if(n.type==="atrule")return new d2(n);throw new Error("Unknown node type: "+e.type)}var m2=ei;ei.default=ei;var g2=uc,Qy=vs,y2=Xy,b2=yr,yc=a2,S2=Ss,w2=m2,eb=fc,v2=Wy,tb=Rs,rb=hc,x2=pc,R2=xs,k2=gc,E2=Ky,nb=mc,ib=oi,C2=ws;function ie(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new yc(e)}ie.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
95
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var yc=us;us.default=us;DO.registerParse(us);var{isClean:St,my:jO}=ii,VO=Oy,BO=Ss,UO=yr,WO=pc,zO=zy,yg=hc,GO=yc,HO=oi,qO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},KO={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},YO={Once:!0,postcssPlugin:!0,prepare:!0},Kr=0;function Bn(e){return typeof e=="object"&&typeof e.then=="function"}function Xy(e){let t=!1,r=qO[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 bg(e){let t;return e.type==="document"?t=["Document",Kr,"DocumentExit"]:e.type==="root"?t=["Root",Kr,"RootExit"]:t=Xy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Du(e){return e[St]=!1,e.nodes&&e.nodes.forEach(t=>Du(t)),e}var _u={},Yr=class Qy{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=Du(r);else if(r instanceof Qy||r instanceof yg)i=Du(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=GO;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[jO]&&UO.rebuild(i)}this.result=new yg(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(!KO[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!YO[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=[bg(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=BO;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new VO(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||zO("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(bg(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=Xy(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 eb=Yr;Yr.default=Yr;HO.registerLazyResult(Yr);WO.registerLazyResult(Yr);var JO=Oy,ZO=Ss,XO=zy,QO=yc,e2=hc,Fu=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=ZO;this.result=new e2(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new JO(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||XO("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=QO;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"}},t2=Fu;Fu.default=Fu;var r2=t2,n2=eb,i2=pc,o2=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 r2(this,t,r):new n2(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},s2=Qn;Qn.default=Qn;o2.registerProcessor(Qn);i2.registerProcessor(Qn);var a2=vs,l2=Ay,u2=Rs,c2=mc,d2=xs,f2=oi,p2=gc;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__:d2.prototype};o.map&&(o.map={...o.map,__proto__:l2.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 f2(n);if(n.type==="decl")return new a2(n);if(n.type==="rule")return new p2(n);if(n.type==="comment")return new u2(n);if(n.type==="atrule")return new c2(n);throw new Error("Unknown node type: "+e.type)}var h2=ei;ei.default=ei;var m2=cc,tb=vs,g2=eb,y2=yr,bc=s2,b2=Ss,S2=h2,rb=pc,w2=Gy,nb=Rs,ib=mc,v2=hc,x2=xs,R2=yc,k2=Jy,ob=gc,sb=oi,E2=ws;function ie(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new bc(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 yc().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return ie([i(l)]).process(s,a)},i};ie.stringify=S2;ie.parse=k2;ie.fromJSON=w2;ie.list=E2;ie.comment=e=>new tb(e);ie.atRule=e=>new rb(e);ie.decl=e=>new Qy(e);ie.rule=e=>new nb(e);ie.root=e=>new ib(e);ie.document=e=>new eb(e);ie.CssSyntaxError=g2;ie.Declaration=Qy;ie.Container=b2;ie.Processor=yc;ie.Document=eb;ie.Comment=tb;ie.Warning=v2;ie.AtRule=rb;ie.Result=x2;ie.Input=R2;ie.Rule=nb;ie.Root=ib;ie.Node=C2;y2.registerPostcss(ie);var A2=ie;ie.default=ie;var me=_M(A2);me.stringify;me.fromJSON;me.plugin;me.parse;me.list;me.document;me.comment;me.atRule;me.rule;me.decl;me.root;me.CssSyntaxError;me.Declaration;me.Container;me.Processor;me.Document;me.Comment;me.Warning;me.AtRule;me.Result;me.Input;me.Rule;me.Root;me.Node;var Fu=class e{constructor(...t){Qe(this,"parentElement",null),Qe(this,"parentNode",null),Qe(this,"ownerDocument"),Qe(this,"firstChild",null),Qe(this,"lastChild",null),Qe(this,"previousSibling",null),Qe(this,"nextSibling",null),Qe(this,"ELEMENT_NODE",1),Qe(this,"TEXT_NODE",3),Qe(this,"nodeType"),Qe(this,"nodeName"),Qe(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var yg={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},bg={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Uo={},I2=()=>!!globalThis.Zone;function bc(e){if(Uo[e])return Uo[e];let t=globalThis[e],r=t.prototype,n=e in yg?yg[e]:void 0,i=!!(n&&n.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in bg?bg[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!I2())return Uo[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let u=l[e].prototype;return document.body.removeChild(a),u?Uo[e]=u:r}catch{return r}}var nu={};function Nt(e,t,r){var n;let i=`${e}.${String(r)}`;if(nu[i])return nu[i].call(t);let o=bc(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(nu[i]=s,s.call(t)):t[r]}var iu={};function ob(e,t,r){let n=`${e}.${String(r)}`;if(iu[n])return iu[n].bind(t);let o=bc(e)[r];return typeof o!="function"?t[r]:(iu[n]=o,o.bind(t))}function P2(e){return Nt("Node",e,"ownerDocument")}function T2(e){return Nt("Node",e,"childNodes")}function M2(e){return Nt("Node",e,"parentNode")}function O2(e){return Nt("Node",e,"parentElement")}function N2(e){return Nt("Node",e,"textContent")}function L2(e,t){return ob("Node",e,"contains")(t)}function $2(e){return ob("Node",e,"getRootNode")()}function D2(e){return!e||!("host"in e)?null:Nt("ShadowRoot",e,"host")}function _2(e){return e.styleSheets}function F2(e){return!e||!("shadowRoot"in e)?null:Nt("Element",e,"shadowRoot")}function j2(e,t){return Nt("Element",e,"querySelector")(t)}function V2(e,t){return Nt("Element",e,"querySelectorAll")(t)}function sb(){return bc("MutationObserver").constructor}function br(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var U={ownerDocument:P2,childNodes:T2,parentNode:M2,parentElement:O2,textContent:N2,contains:L2,getRootNode:$2,host:D2,styleSheets:_2,shadowRoot:F2,querySelector:j2,querySelectorAll:V2,mutationObserver:sb,patch:br};function Fe(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var jr=`Please stop import mirror directly. Instead of that,\r
97
+ https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new bc().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=b2;ie.parse=R2;ie.fromJSON=S2;ie.list=k2;ie.comment=e=>new nb(e);ie.atRule=e=>new ib(e);ie.decl=e=>new tb(e);ie.rule=e=>new ob(e);ie.root=e=>new sb(e);ie.document=e=>new rb(e);ie.CssSyntaxError=m2;ie.Declaration=tb;ie.Container=y2;ie.Processor=bc;ie.Document=rb;ie.Comment=nb;ie.Warning=w2;ie.AtRule=ib;ie.Result=v2;ie.Input=x2;ie.Rule=ob;ie.Root=sb;ie.Node=E2;g2.registerPostcss(ie);var C2=ie;ie.default=ie;var me=DM(C2);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 ju=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 Sg={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},wg={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Uo={},A2=()=>!!globalThis.Zone;function Sc(e){if(Uo[e])return Uo[e];let t=globalThis[e],r=t.prototype,n=e in Sg?Sg[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 wg?wg[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&&!A2())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 iu={};function Nt(e,t,r){var n;let i=`${e}.${String(r)}`;if(iu[i])return iu[i].call(t);let o=Sc(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(iu[i]=s,s.call(t)):t[r]}var ou={};function ab(e,t,r){let n=`${e}.${String(r)}`;if(ou[n])return ou[n].bind(t);let o=Sc(e)[r];return typeof o!="function"?t[r]:(ou[n]=o,o.bind(t))}function I2(e){return Nt("Node",e,"ownerDocument")}function P2(e){return Nt("Node",e,"childNodes")}function T2(e){return Nt("Node",e,"parentNode")}function M2(e){return Nt("Node",e,"parentElement")}function O2(e){return Nt("Node",e,"textContent")}function N2(e,t){return ab("Node",e,"contains")(t)}function L2(e){return ab("Node",e,"getRootNode")()}function $2(e){return!e||!("host"in e)?null:Nt("ShadowRoot",e,"host")}function D2(e){return e.styleSheets}function _2(e){return!e||!("shadowRoot"in e)?null:Nt("Element",e,"shadowRoot")}function F2(e,t){return Nt("Element",e,"querySelector")(t)}function j2(e,t){return Nt("Element",e,"querySelectorAll")(t)}function lb(){return Sc("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:I2,childNodes:P2,parentNode:T2,parentElement:M2,textContent:O2,contains:N2,getRootNode:L2,host:$2,styleSheets:D2,shadowRoot:_2,querySelector:F2,querySelectorAll:j2,mutationObserver:lb,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.`,Sg={map:{},getId(){return console.error(jr),-1},getNode(){return console.error(jr),null},removeNodeFromMap(){console.error(jr)},has(){return console.error(jr),!1},reset(){console.error(jr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Sg=new Proxy(Sg,{get(e,t,r){return t==="map"&&console.error(jr),Reflect.get(e,t,r)}}));function ti(e,t,r={}){let n=null,i=0;return function(...o){let s=Date.now();!i&&r.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(l,o)},a))}}function ks(e,t,r,n,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>ks(e,t,o||{},!0)}var cs=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(cs=()=>new Date().getTime());function ab(e){var t,r,n,i;let o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||o?.body&&((t=U.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o?.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:o?.documentElement.scrollTop||o?.body&&((n=U.parentElement(o.body))==null?void 0:n.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}function lb(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ub(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function cb(e){return e?e.nodeType===e.ELEMENT_NODE?e:U.parentElement(e):null}function je(e,t,r,n){if(!e)return!1;let i=cb(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(ts(i,t,n))return!0}catch{}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function B2(e,t){return t.getId(e)!==-1}function ou(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===Hn}function db(e,t){if(Wn(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=U.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?db(n,t):!0}function ju(e){return!!e.changedTouches}function U2(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function fb(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function pb(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Vu(e){return e?e instanceof Fu&&"shadowRoot"in e?!!e.shadowRoot:!!U.shadowRoot(e):!1}var Bu=class{constructor(){k(this,"id",1),k(this,"styleIDMap",new WeakMap),k(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function hb(e){var t;let r=null;return"getRootNode"in e&&((t=U.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&U.host(U.getRootNode(e))&&(r=U.host(U.getRootNode(e))),r}function W2(e){let t=e,r;for(;r=hb(t);)t=r;return t}function z2(e){let t=U.ownerDocument(e);if(!t)return!1;let r=W2(e);return U.contains(t,r)}function mb(e){let t=U.ownerDocument(e);return t?U.contains(t,e)||z2(e):!1}var H=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(H||{}),z=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(z||{}),We=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(We||{}),Pt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Pt||{}),Jr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Jr||{}),Vr=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Vr||{});var gb=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(gb||{});function wg(e){return"__ln"in e}var Uu=class{constructor(){k(this,"length",0),k(this,"head",null),k(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){let r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&wg(t.previousSibling)){let n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&wg(t.nextSibling)&&t.nextSibling.__ln.previous){let n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){let r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},vg=(e,t)=>`${e}@${t}`,Wu=class{constructor(){k(this,"frozen",!1),k(this,"locked",!1),k(this,"texts",[]),k(this,"attributes",[]),k(this,"attributeMap",new WeakMap),k(this,"removes",[]),k(this,"mapRemoves",[]),k(this,"movedMap",{}),k(this,"addedSet",new Set),k(this,"movedSet",new Set),k(this,"droppedSet",new Set),k(this,"removesSubTreeCache",new Set),k(this,"mutationCb"),k(this,"blockClass"),k(this,"blockSelector"),k(this,"maskTextClass"),k(this,"maskTextSelector"),k(this,"inlineStylesheet"),k(this,"maskInputOptions"),k(this,"maskTextFn"),k(this,"maskInputFn"),k(this,"keepIframeSrcFn"),k(this,"recordCanvas"),k(this,"inlineImages"),k(this,"slimDOMOptions"),k(this,"dataURLOptions"),k(this,"doc"),k(this,"mirror"),k(this,"iframeManager"),k(this,"stylesheetManager"),k(this,"shadowDomManager"),k(this,"canvasManager"),k(this,"processedNodeManager"),k(this,"unattachedDoc"),k(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),k(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set,n=new Uu,i=l=>{let u=l,c=Hn;for(;c===Hn;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=U.parentNode(l);if(!u||!mb(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let f=u.tagName;if(f==="TEXTAREA")return;f==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=Wn(u)?this.mirror.getId(hb(l)):this.mirror.getId(u),p=i(l);if(d===-1||p===-1)return n.addNode(l);let h=Ur(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{fb(f,this.mirror)&&this.iframeManager.addIframe(f),pb(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Vu(l)&&this.shadowDomManager.addShadowRoot(U.shadowRoot(l),this.doc)},onIframeLoad:(f,m)=>{this.iframeManager.attachIframe(f,m),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,m)=>{this.stylesheetManager.attachLinkElement(f,m)},cssCaptured:c});h&&(t.push({parentId:d,nextId:p,node:h}),r.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)xg(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(U.parentNode(l))||o(l);for(let l of this.addedSet)!Rg(this.droppedSet,l)&&!xg(this.removesSubTreeCache,l,this.mirror)||Rg(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;n.length;){let l=null;if(s){let u=this.mirror.getId(U.parentNode(s.value)),c=i(s.value);u!==-1&&c!==-1&&(l=s)}if(!l){let u=n.tail;for(;u;){let c=u;if(u=u.previous,c){let d=this.mirror.getId(U.parentNode(c.value));if(i(c.value)===-1)continue;if(d!==-1){l=c;break}else{let h=c.value,f=U.parentNode(h);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=U.host(f);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}s=l.previous,n.removeNode(l.value),o(l.value)}let a={texts:this.texts.map(l=>{let u=l.node,c=U.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:u}=l;if(typeof u.style=="string"){let c=JSON.stringify(l.styleDiff),d=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+d).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),k(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(U.childNodes(t),i=>U.textContent(i)||"").join("");r.attributes.value=Xo({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Qo(t),value:n,maskInputFn:this.maskInputFn})}),k(this,"processMutation",t=>{if(!ou(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=U.textContent(t.target);!je(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:_g(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,cb(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){let s=Qo(r);i=Xo({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(je(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Dg(r.tagName,n))if(o.attributes[n]=$g(this.doc,mr(r.tagName),mr(n),i),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let s=this.unattachedDoc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue);for(let a of Array.from(r.style)){let l=r.style.getPropertyValue(a),u=r.style.getPropertyPriority(a);l!==s.style.getPropertyValue(a)||u!==s.style.getPropertyPriority(a)?u===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,u]:o._unchangedStyles[a]=[l,u]}for(let a of Array.from(s.style))r.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(je(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),i=Wn(t.target)?this.mirror.getId(U.host(t.target)):this.mirror.getId(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||ou(r,this.mirror,this.slimDOMOptions)||!B2(r,this.mirror)||(this.addedSet.has(r)?(zu(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||db(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[vg(n,i)]?zu(this.movedSet,r):(this.removes.push({parentId:i,id:n,isShadow:Wn(t.target)&&zn(t.target)?!0:void 0}),G2(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),k(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(ou(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[vg(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);je(t,this.blockClass,this.blockSelector,!1)||(U.childNodes(t).forEach(n=>this.genAdds(n)),Vu(t)&&U.childNodes(U.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function zu(e,t){e.delete(t),U.childNodes(t).forEach(r=>zu(e,r))}function G2(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),U.childNodes(n).forEach(i=>r.push(i)))}}function xg(e,t,r){return e.size===0?!1:H2(e,t)}function H2(e,t,r){let n=U.parentNode(t);return n?e.has(n):!1}function Rg(e,t){return e.size===0?!1:yb(e,t)}function yb(e,t){let r=U.parentNode(t);return r?e.has(r)?!0:yb(e,r):!1}var Gn;function q2(e){Gn=e}function K2(){Gn=void 0}var Y=e=>Gn?(...r)=>{try{return e(...r)}catch(n){if(Gn&&Gn(n)===!0)return;throw n}}:e,hr=[];function si(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function bb(e,t){let r=new Wu;hr.push(r),r.init(e);let n=new(sb())(Y(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Y2({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=ti(Y(d=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),d),s=[],a=null}),o),u=Y(ti(Y(d=>{let p=si(d),{clientX:h,clientY:f}=ju(d)?d.changedTouches[0]:d;a||(a=cs()),s.push({x:h,y:f,id:n.getId(p),timeOffset:cs()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?z.Drag:d instanceof MouseEvent?z.MouseMove:z.TouchMove)}),i,{trailing:!1})),c=[Fe("mousemove",u,r),Fe("touchmove",u,r),Fe("drag",u,r)];return Y(()=>{c.forEach(d=>d())})}function J2({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=null,u=c=>d=>{let p=si(d);if(je(p,n,i,!0))return;let h=null,f=c;if("pointerType"in d){switch(d.pointerType){case"mouse":h=Pt.Mouse;break;case"touch":h=Pt.Touch;break;case"pen":h=Pt.Pen;break}h===Pt.Touch?We[c]===We.MouseDown?f="TouchStart":We[c]===We.MouseUp&&(f="TouchEnd"):Pt.Pen}else ju(d)&&(h=Pt.Touch);h!==null?(l=h,(f.startsWith("Touch")&&h===Pt.Touch||f.startsWith("Mouse")&&h===Pt.Mouse)&&(h=null)):We[c]===We.Click&&(h=l,l=null);let m=ju(d)?d.changedTouches[0]:d;if(!m)return;let g=r.getId(p),{clientX:S,clientY:w}=m;Y(e)({type:We[f],id:g,x:S,y:w,...h!==null&&{pointerType:h}})};return Object.keys(We).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=mr(c),p=u(c);if(window.PointerEvent)switch(We[c]){case We.MouseDown:case We.MouseUp:d=d.replace("mouse","pointer");break;case We.TouchStart:case We.TouchEnd:return}a.push(Fe(d,p,t))}),Y(()=>{a.forEach(c=>c())})}function Sb({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){let s=Y(ti(Y(a=>{let l=si(a);if(!l||je(l,n,i,!0))return;let u=r.getId(l);if(l===t&&t.defaultView){let c=ab(t.defaultView);e({id:u,x:c.left,y:c.top})}else e({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return Fe("scroll",s,t)}function Z2({viewportResizeCb:e},{win:t}){let r=-1,n=-1,i=Y(ti(Y(()=>{let o=lb(),s=ub();(r!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),r=o,n=s)}),200));return Fe("resize",i,t)}var X2=["INPUT","TEXTAREA","SELECT"],kg=new WeakMap;function Q2({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(w){let y=si(w),x=w.isTrusted,E=y&&y.tagName;if(y&&E==="OPTION"&&(y=U.parentElement(y)),!y||!E||X2.indexOf(E)<0||je(y,n,i,!0)||y.classList.contains(o)||s&&y.matches(s))return;let N=y.value,I=!1,M=Qo(y)||"";M==="radio"||M==="checkbox"?I=y.checked:(a[E.toLowerCase()]||a[M])&&(N=Xo({element:y,maskInputOptions:a,tagName:E,type:M,value:N,maskInputFn:l})),p(y,c?{text:N,isChecked:I,userTriggered:x}:{text:N,isChecked:I});let C=y.name;M==="radio"&&C&&I&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(V=>{if(V!==y){let Z=V.value;p(V,c?{text:Z,isChecked:!I,userTriggered:!1}:{text:Z,isChecked:!I})}})}function p(w,y){let x=kg.get(w);if(!x||x.text!==y.text||x.isChecked!==y.isChecked){kg.set(w,y);let E=r.getId(w);Y(e)({...y,id:E})}}let f=(u.input==="last"?["change"]:["input","change"]).map(w=>Fe(w,Y(d),t)),m=t.defaultView;if(!m)return()=>{f.forEach(w=>w())};let g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),S=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&f.push(...S.map(w=>ks(w[0],w[1],{set(){Y(d)({target:this,isTrusted:!1})}},!1,m))),Y(()=>{f.forEach(w=>w())})}function ds(e){let t=[];function r(n,i){if(Wo("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Wo("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Wo("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Wo("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(s)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(s)}return i}return r(e,t)}function Jt(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function e6({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Y((c,d,p)=>{let[h,f]=p,{id:m,styleId:g}=Jt(d,t,r.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,adds:[{rule:h,index:f}]}),c.apply(d,p)})}),n.CSSStyleSheet.prototype.addRule=function(c,d,p=this.cssRules.length){let h=`${c} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,p])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Jt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,removes:[{index:h}]}),c.apply(d,p)})}),n.CSSStyleSheet.prototype.removeRule=function(c){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Jt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replace:h}),c.apply(d,p)})}));let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Jt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replaceSync:h}),c.apply(d,p)})}));let l={};zo("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(zo("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),zo("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),zo("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));let u={};return Object.entries(l).forEach(([c,d])=>{u[c]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[c].insertRule,{apply:Y((p,h,f)=>{let[m,g]=f,{id:S,styleId:w}=Jt(h.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:m,index:[...ds(h),g||0]}]}),p.apply(h,f)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:Y((p,h,f)=>{let[m]=f,{id:g,styleId:S}=Jt(h.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,removes:[{index:[...ds(h),m]}]}),p.apply(h,f)})})}),Y(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function wb({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(U.host(r));let a=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(i=r.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;let d=(c=l.set)==null?void 0:c.call(this,u);if(s!==null&&s!==-1)try{t.adoptStyleSheets(u,s)}catch{}return d}}),Y(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function t6({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Y((a,l,u)=>{var c;let[d,p,h]=u;if(r.has(d))return o.apply(l,[d,p,h]);let{id:f,styleId:m}=Jt((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,set:{property:d,value:p,priority:h},index:ds(l.parentRule)}),a.apply(l,u)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Y((a,l,u)=>{var c;let[d]=u;if(r.has(d))return s.apply(l,[d]);let{id:p,styleId:h}=Jt((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,remove:{property:d},index:ds(l.parentRule)}),a.apply(l,u)})}),Y(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function r6({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){let s=Y(l=>ti(Y(u=>{let c=si(u);if(!c||je(c,t,r,!0))return;let{currentTime:d,volume:p,muted:h,playbackRate:f,loop:m}=c;e({type:l,id:n.getId(c),currentTime:d,volume:p,muted:h,playbackRate:f,loop:m})}),i.media||500)),a=[Fe("play",s(Vr.Play),o),Fe("pause",s(Vr.Pause),o),Fe("seeked",s(Vr.Seeked),o),Fe("volumechange",s(Vr.VolumeChange),o),Fe("ratechange",s(Vr.RateChange),o)];return Y(()=>{a.forEach(l=>l())})}function n6({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(l,u,c){let d=new o(l,u,c);return i.set(d,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};let s=br(t.fonts,"add",function(a){return function(l){return setTimeout(Y(()=>{let u=i.get(l);u&&(e(u),i.delete(l))}),0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=o}),n.push(s),Y(()=>{n.forEach(a=>a())})}function i6(e){let{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,s=!0,a=Y(()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let u=[],c=l.rangeCount||0;for(let d=0;d<c;d++){let p=l.getRangeAt(d),{startContainer:h,startOffset:f,endContainer:m,endOffset:g}=p;je(h,n,i,!0)||je(m,n,i,!0)||u.push({start:r.getId(h),startOffset:f,end:r.getId(m),endOffset:g})}o({ranges:u})});return a(),Fe("selectionchange",a)}function o6({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:br(r.customElements,"define",function(i){return function(o,s,a){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,s,a])}})}function s6(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),i(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),o(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),s(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),a(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),l(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),u(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),c(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),p(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),h(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),f(...m)}}function a6(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};s6(e,t);let n;e.recordDOM&&(n=bb(e,e.doc));let i=Y2(e),o=J2(e),s=Sb(e),a=Z2(e,{win:r}),l=Q2(e),u=r6(e),c=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(c=e6(e,{win:r}),d=wb(e,e.doc),p=t6(e,{win:r}),e.collectFonts&&(h=n6(e)));let f=i6(e),m=o6(e),g=[];for(let S of e.plugins)g.push(S.observer(S.callback,r,S.options));return Y(()=>{hr.forEach(S=>S.reset()),n?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),p(),h(),f(),m(),g.forEach(S=>S())})}function Wo(e){return typeof window[e]<"u"}function zo(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var fs=class{constructor(t){k(this,"iframeIdToRemoteIdMap",new WeakMap),k(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,i){let o=n||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(r);return a||(a=this.generateIdFn(),o.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){let i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=i.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},Gu=class{constructor(t){k(this,"iframes",new WeakMap),k(this,"crossOriginIframeMap",new WeakMap),k(this,"crossOriginIframeMirror",new fs(Lg)),k(this,"crossOriginIframeStyleMirror"),k(this,"crossOriginIframeRootIdMap",new WeakMap),k(this,"mirror"),k(this,"mutationCb"),k(this,"wrappedEmit"),k(this,"loadListener"),k(this,"stylesheetManager"),k(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new fs(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let i=this.crossOriginIframeMap.get(t.source);if(!i)return;let o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case H.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:H.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case H.Meta:case H.Load:case H.DomContentLoaded:return!1;case H.Plugin:return r;case H.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case H.IncrementalSnapshot:switch(r.data.source){case z.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case z.Drag:case z.TouchMove:case z.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(r.data,t,["id"]),r;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case z.Font:return r;case z.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case z.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,n,i){for(let o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==gb.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},Hu=class{constructor(t){k(this,"shadowDoms",new WeakSet),k(this,"mutationCb"),k(this,"scrollCb"),k(this,"bypassOptions"),k(this,"mirror"),k(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!zn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let n=bb({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Sb({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(U.host(t))),this.restoreHandlers.push(wb({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(br(t.prototype,"attachShadow",function(i){return function(o){let s=i.call(this,o),a=U.shadowRoot(this);return a&&mb(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l6=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Un=0;Un<Wr.length;Un++)l6[Wr.charCodeAt(Un)]=Un;var Un,u6=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=Wr[t[r]>>2],i+=Wr[(t[r]&3)<<4|t[r+1]>>4],i+=Wr[(t[r+1]&15)<<2|t[r+2]>>6],i+=Wr[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Eg=new Map;function c6(e,t){let r=Eg.get(e);return r||(r=new Map,Eg.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var vb=(e,t,r)=>{if(!e||!(Rb(e,t)||typeof e=="object"))return;let n=e.constructor.name,i=c6(r,n),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Yo(e,t,r){if(e instanceof Array)return e.map(n=>Yo(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,i=u6(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Yo(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Yo(e.data,t,r),e.width,e.height]};if(Rb(e,t)||typeof e=="object"){let n=e.constructor.name,i=vb(e,t,r);return{rr_type:n,index:i}}}}return e}var xb=(e,t,r)=>e.map(n=>Yo(n,t,r)),Rb=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function d6(e,t,r,n){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=br(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...u){return je(this.canvas,r,n,!0)||setTimeout(()=>{let c=xb(u,t,this);e(this.canvas,{type:Jr["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=ks(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:Jr["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function f6(e){return e==="experimental-webgl"?"webgl":e}function Cg(e,t,r,n){let i=[];try{let o=br(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!je(this,t,r,!0)){let u=f6(a);if("__context"in this||(this.__context=u),n&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){let c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[a,...l])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function Ag(e,t,r,n,i,o){let s=[],a=Object.getOwnPropertyNames(e);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let u=br(e,l,function(c){return function(...d){let p=c.apply(this,d);if(vb(p,o,this),"tagName"in this.canvas&&!je(this.canvas,n,i,!0)){let h=xb(d,o,this),f={type:t,property:l,args:h};r(this.canvas,f)}return p}});s.push(u)}catch{let u=ks(e,l,{set(c){r(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function p6(e,t,r,n){let i=[];return i.push(...Ag(t.WebGLRenderingContext.prototype,Jr.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Ag(t.WebGL2RenderingContext.prototype,Jr.WebGL2,e,r,n,t)),()=>{i.forEach(o=>o())}}var kb="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",h6=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Ig=typeof window<"u"&&window.Blob&&new Blob([h6(kb)],{type:"text/javascript;charset=utf-8"});function m6(e){let t;try{if(t=Ig&&(window.URL||window.webkitURL).createObjectURL(Ig),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;base64,"+kb,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var qu=class{constructor(t){k(this,"pendingCanvasMutations",new Map),k(this,"rafStamps",{latestId:0,invokeId:null}),k(this,"mirror"),k(this,"mutationCb"),k(this,"resetObservers"),k(this,"frozen",!1),k(this,"locked",!1),k(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});let{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,i,o){let s=Cg(r,n,i,!0),a=new Map,l=new m6;l.onmessage=f=>{let{id:m}=f.data;if(a.set(m,!1),!("base64"in f.data))return;let{base64:g,type:S,width:w,height:y}=f.data;this.mutationCb({id:m,type:Jr["2D"],commands:[{property:"clearRect",args:[0,0,w,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:S}]},0,0]}]})};let u=1e3/t,c=0,d,p=()=>{let f=[];return r.document.querySelectorAll("canvas").forEach(m=>{je(m,n,i,!0)||f.push(m)}),f},h=f=>{if(c&&f-c<u){d=requestAnimationFrame(h);return}c=f,p().forEach(async m=>{var g;let S=this.mirror.getId(m);if(a.get(S)||m.width===0||m.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(m.__context)){let y=m.getContext(m.__context);((g=y?.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let w=await createImageBitmap(m);l.postMessage({id:S,bitmap:w,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[w])}),d=requestAnimationFrame(h)};d=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Cg(t,r,n,!1),o=d6(this.processMutation.bind(this),t,r,n),s=p6(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let i=n.map(s=>{let{type:a,...l}=s;return l}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}},Ku=class{constructor(t){k(this,"trackedLinkElements",new WeakSet),k(this,"mutationCb"),k(this,"adoptedStyleSheetCb"),k(this,"styleMirror",new Bu),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},i=[];for(let o of t){let s;this.styleMirror.has(o)?s=this.styleMirror.getId(o):(s=this.styleMirror.add(o),i.push({styleId:s,rules:Array.from(o.rules||CSSRule,(a,l)=>({rule:Og(a,o.href),index:l}))})),n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Yu=class{constructor(){k(this,"nodeMap",new WeakMap),k(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},we,Jo,su,ps=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Tm=e.contentWindow)==null?void 0:Tm.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var at=bP();function Sr(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:h,maskInputFn:f,maskTextFn:m,hooks:g,packFn:S,sampling:w={},dataURLOptions:y={},mousemoveWait:x,recordDOM:E=!0,recordCanvas:N=!1,recordCrossOriginIframes:I=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:C=!1,collectFonts:V=!1,inlineImages:Z=!1,plugins:X,keepIframeSrcFn:F=()=>!1,ignoreCSSAttributes:$e=new Set([]),errorHandler:pt}=e;q2(pt);let Pe=I?window.parent===window:!0,Ze=!1;if(!Pe)try{window.parent.document&&(Ze=!1)}catch{Ze=!0}if(Pe&&!t)throw new Error("emit function is required");if(!Pe&&!Ze)return()=>{};x!==void 0&&w.mousemove===void 0&&(w.mousemove=x),at.reset();let ir=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},ht=Fg(h);U2();let Ef,oa=0,Cf=Q=>{for(let tt of X||[])tt.eventProcessor&&(Q=tt.eventProcessor(Q));return S&&!Ze&&(Q=S(Q)),Q};we=(Q,tt)=>{var ye;let be=Q;if(be.timestamp=cs(),(ye=hr[0])!=null&&ye.isFrozen()&&be.type!==H.FullSnapshot&&!(be.type===H.IncrementalSnapshot&&be.data.source===z.Mutation)&&hr.forEach(Ge=>Ge.unfreeze()),Pe)t?.(Cf(be),tt);else if(Ze){let Ge={type:"rrweb",event:Cf(be),origin:window.location.origin,isCheckout:tt};window.parent.postMessage(Ge,"*")}if(be.type===H.FullSnapshot)Ef=be,oa=0;else if(be.type===H.IncrementalSnapshot){if(be.data.source===z.Mutation&&be.data.isAttachIframe)return;oa++;let Ge=n&&oa>=n,se=r&&be.timestamp-Ef.timestamp>r;(Ge||se)&&Jo(!0)}};let Ai=Q=>{we({type:H.IncrementalSnapshot,data:{source:z.Mutation,...Q}})},Af=Q=>we({type:H.IncrementalSnapshot,data:{source:z.Scroll,...Q}}),If=Q=>we({type:H.IncrementalSnapshot,data:{source:z.CanvasMutation,...Q}}),fx=Q=>we({type:H.IncrementalSnapshot,data:{source:z.AdoptedStyleSheet,...Q}}),or=new Ku({mutationCb:Ai,adoptedStyleSheetCb:fx}),sr=new Gu({mirror:at,mutationCb:Ai,stylesheetManager:or,recordCrossOriginIframes:I,wrappedEmit:we});for(let Q of X||[])Q.getMirror&&Q.getMirror({nodeMirror:at,crossOriginIframeMirror:sr.crossOriginIframeMirror,crossOriginIframeStyleMirror:sr.crossOriginIframeStyleMirror});let sa=new Yu;su=new qu({recordCanvas:N,mutationCb:If,win:window,blockClass:i,blockSelector:o,mirror:at,sampling:w.canvas,dataURLOptions:y});let Ii=new Hu({mutationCb:Ai,scrollCb:Af,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ir,dataURLOptions:y,maskTextFn:m,maskInputFn:f,recordCanvas:N,inlineImages:Z,sampling:w,slimDOMOptions:ht,iframeManager:sr,stylesheetManager:or,canvasManager:su,keepIframeSrcFn:F,processedNodeManager:sa},mirror:at});Jo=(Q=!1)=>{if(!E)return;we({type:H.Meta,data:{href:window.location.href,width:ub(),height:lb()}},Q),or.reset(),Ii.init(),hr.forEach(ye=>ye.lock());let tt=UP(document,{mirror:at,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ir,maskTextFn:m,maskInputFn:f,slimDOM:ht,dataURLOptions:y,recordCanvas:N,inlineImages:Z,onSerialize:ye=>{fb(ye,at)&&sr.addIframe(ye),pb(ye,at)&&or.trackLinkElement(ye),Vu(ye)&&Ii.addShadowRoot(U.shadowRoot(ye),document)},onIframeLoad:(ye,be)=>{sr.attachIframe(ye,be),Ii.observeAttachShadow(ye)},onStylesheetLoad:(ye,be)=>{or.attachLinkElement(ye,be)},keepIframeSrcFn:F});if(!tt)return console.warn("Failed to snapshot the document");we({type:H.FullSnapshot,data:{node:tt,initialOffset:ab(window)}},Q),hr.forEach(ye=>ye.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&or.adoptStyleSheets(document.adoptedStyleSheets,at.getId(document))};try{let Q=[],tt=be=>{var Ge;return Y(a6)({mutationCb:Ai,mousemoveCb:(se,aa)=>we({type:H.IncrementalSnapshot,data:{source:aa,positions:se}}),mouseInteractionCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.MouseInteraction,...se}}),scrollCb:Af,viewportResizeCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.ViewportResize,...se}}),inputCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.Input,...se}}),mediaInteractionCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.MediaInteraction,...se}}),styleSheetRuleCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.StyleSheetRule,...se}}),styleDeclarationCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.StyleDeclaration,...se}}),canvasMutationCb:If,fontCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.Font,...se}}),selectionCb:se=>{we({type:H.IncrementalSnapshot,data:{source:z.Selection,...se}})},customElementCb:se=>{we({type:H.IncrementalSnapshot,data:{source:z.CustomElement,...se}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:ir,inlineStylesheet:c,sampling:w,recordDOM:E,recordCanvas:N,inlineImages:Z,userTriggeredOnInput:C,collectFonts:V,doc:be,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:F,blockSelector:o,slimDOMOptions:ht,dataURLOptions:y,mirror:at,iframeManager:sr,stylesheetManager:or,shadowDomManager:Ii,processedNodeManager:sa,canvasManager:su,ignoreCSSAttributes:$e,plugins:((Ge=X?.filter(se=>se.observer))==null?void 0:Ge.map(se=>({observer:se.observer,options:se.options,callback:aa=>we({type:H.Plugin,data:{plugin:se.name,payload:aa}})})))||[]},g)};sr.addLoadListener(be=>{try{Q.push(tt(be.contentDocument))}catch(Ge){console.warn(Ge)}});let ye=()=>{Jo(),Q.push(tt(document)),ps=!0};return["interactive","complete"].includes(document.readyState)?ye():(Q.push(Fe("DOMContentLoaded",()=>{we({type:H.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&ye()})),Q.push(Fe("load",()=>{we({type:H.Load,data:{}}),M==="load"&&ye()},window))),()=>{Q.forEach(be=>{try{be()}catch(Ge){String(Ge).toLowerCase().includes("cross-origin")||console.warn(Ge)}}),sa.destroy(),ps=!1,K2()}}catch(Q){console.warn(Q)}}Sr.addCustomEvent=(e,t)=>{if(!ps)throw new Error("please add custom event after start recording");we({type:H.Custom,data:{tag:e,payload:t}})};Sr.freezePage=()=>{hr.forEach(e=>e.freeze())};Sr.takeFullSnapshot=e=>{if(!ps)throw new Error("please take full snapshot after start recording");Jo(e)};Sr.mirror=at;var Pg;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Pg||(Pg={}));var nG=5*1e3;var{addCustomEvent:iG}=Sr,{freezePage:oG}=Sr,{takeFullSnapshot:sG}=Sr;var Ab="__ripploEmitRrwebEvent";function Ib(){return{eventTypes:Eb(H),incrementalSources:Eb(z)}}function Eb(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,r])=>[r,t]))}var y6=Hl("@ripplo/rrweb-bundle/bundle","rrweb.js"),Cb;function Pb(){return Cb??=g6(y6,{encoding:"utf8"}),Cb}async function wc({clientVersion:e,debugDir:t,writeOtlpPortFile:r}){let n=new Map,i=Am(Ib()),o=await za({localDir:Tb.join(Tb.dirname(t),".local"),writePortFile:r,onRrwebBatch:(l,u)=>{n.get(l)?.emitRrwebBatch(u)},onSpan:l=>{let u=l.attributes["ripplo.run"];u!=null&&n.get(u)?.emit(l)}}),s=await Pb();return{attach:async(l,u)=>{let c=Tp({debugDir:t,runId:u,worker:i});c.emit({clientVersion:e,kind:"meta",source:"capture",timeNanos:"0"}),n.set(u,c),await Pm(l,u),await l.addInitScript(`globalThis.__ripploCapturePort = ${String(o.port)};`),await S6(l,c);let d=[];return{emitAction:p=>{x6(c,p)},emitAssertion:p=>{R6(c,p)},finish:()=>w6(c,{pages:d,registry:n,runId:u}),onPage:p=>{d.push(p),v6(c,s,p)}}},close:async()=>{await o.stop(),await i.terminate()},injectSpan:(l,u)=>{n.get(l)?.emit(u)}}}async function b6(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function S6(e,t){await e.exposeBinding(Ab,(r,n)=>{let i=typeof n=="string"?n:JSON.stringify(n);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}async function w6(e,t){await b6(t.pages),t.registry.delete(t.runId),await e.close({noticeIfNoRrweb:"rrweb capture unavailable: recorder never pushed an event \u2014 page never loaded the recorder (blank page, failed navigation, or CSP block)"})}function v6(e,t,r){r.on("load",()=>{r.addScriptTag({content:t}).catch(()=>{})}),r.on("response",n=>{A6(e,n)}),r.on("console",n=>{e.emit({kind:"console",level:n.type(),source:"browser",text:n.text(),timeNanos:Tr(Date.now())})}),r.on("pageerror",n=>{e.emit({kind:"error",message:n.message,source:"browser",stack:n.stack,timeNanos:Tr(Date.now())})})}function x6(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:k6(t),timeNanos:Tr(Date.now()),value:E6(t)})}function R6(e,t){let r=Gl(t);e.emit({kind:"assertion",label:r.label,outcome:t.outcome,source:"test",step:r.step,timeNanos:Tr(Date.now())})}function k6(e){if(e.url!=null)return e.url;if(e.locator!=null)return Sc(e.locator)}function Sc(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${Sc(e.scope)} \u25B8 ${Sc(e.target)}`:`${e.role} ${e.name??""}`.trim()}function E6(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var C6=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;function A6(e,t){let r=t.request(),n=r.resourceType();if(n!=="fetch"&&n!=="xhr"||C6.test(r.url()))return;let i=r.headers().traceparent?.split("-");e.emit({kind:"network",method:r.method(),resourceType:n,source:"browser",spanId:i?.[2],status:t.status(),timeNanos:Tr(Date.now()),traceId:i?.[1],url:t.url()})}import{err as H0,ok as Zd,ResultAsync as D8}from"neverthrow";function vc(e){return{invariants:El(e),laws:xl(e)}}var Mb=Object.defineProperty,Ob=(e,t)=>{let r={};for(var n in e)Mb(r,n,{get:e[n],enumerable:!0});return t||Mb(r,Symbol.toStringTag,{value:"Module"}),r};var I6=class Nb{constructor(t){this.seed=t}clone(){return new Nb(this.seed)}next(){let t=xc(this.seed),r=Rc(t),n=xc(t),i=Rc(n);return this.seed=xc(n),Rc(this.seed)+(i+(r<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function xc(e){return Math.imul(e,214013)+2531011&4294967295}function Rc(e){return(e&-2147483649)>>16}function Lb(e){return new I6(e)}var P6="SUSgbA\\W`E[]KN2RUSo8XVU?HKBFRl11E\\KoWOg5B]XEWG;BE;1:oVK[`B^Z9Qd23^XTnhL>]Unda4f[X;_j9H5QD=cN<5H`3bW>9bk1mjoI2fK0obmAAINOV:>Mek_V9dd<hZ\\gC3?Fm7FEk07QH_3PLm^@?^i\\QMkgP<]oLHmFnlecg5F@7U^@4jhZ?WZS0k@GHehmM36:5^9;>Hmm`co>k:KOSkSbIINb1VFf>LXgP>GUAQTD>Ci>XMGkUflLlb?_FaFUk@?5N7i70@;1o68ah@I<HFH7R2^J:G][Gf962ITWID9GWK8ElD2G5=DcHcL]cA]P2n7A=[<bInM;IHDQnJMReRXDWbVldnGEIPij`E08Xdci3@0c:IBbD4:Nk]?lEN9j^;T`0blZX7eiWE8c`<ak7j05FZi>AjUDh?M1B?^??FAXKThf<aBOXZf7jXYGK>R<;NHk3S9YhM7STJ6`:MIE`S@7298X8W>PNK=@;lLX<i\\TXLL<W@X[X54H]in8M;;n?kkQbajgAMY=Tf9b;ZKf0QUB2FHYWfnfkDoU9YkcLd95T>lK6GM1YL\\lid:J>KYS=iJ]Y>QlF>?R5_[5QeYC=66;A32Ac>OHk_ne^0g>bK:g;KFPgbGUcPR_Z=TX3H9d03bKZ2IhEPKBo>LSGWd0iFdV8C<Y:<>T[O6lC\\blaZ>GoAYP4clf^j1IfnZJ]QeDe2X<HE[LJNWnaCg[P]Co^:IRbWPY?97UePBlZNNHY6LOBM8P>=h?Ye:_f_Sb9Ki5GDYBF4dWeMfdg^ccPllNWM7G1\\UMdoYeOOD5^e@foA22G?ADYo5:FVG[bWo96;>3kc_c1Ab30>30;1@4F8g2hY?DJ4[LOL;ZLLKo2]jo>[KMDUcR279N_kF=3WL@Dd620bMTdA\\U9k``ef2iD9JgJ8CZBHS>F^Uk;<laeaeHS<15OSeS`PcSSKBRBFY]aQ=EgUXGNg=?d56`KA@2BejY0^[_DCX`L=CGMT=BW^6S1i@2ATBVk>3_ocRA>2U:4GPQ6o>5jX2HIcV3S@On6KB<[SKB?FC_AAji9agbBFkAi\\;4I\\UJ]c36Ub@[;gQACVGY<V]SDJBUU]La\\_a@JdOO8gm2T0DJMa:8Hf7>E]noQ[1Kambn??QQ]S?1i0oMGOijb\\aGY6lQ^CJ?9bFle8<eH4UUjBINX;n8@VOA5ah^URV49B[A?ONHhHAC1J5;;h0SXYlG^0W=eJdHh^K4SGe=1HZLLam;D<Q3AOdbPcdX``82\\jo0En8jRVGC73WMCF9`d:0heS?80?C188cSn7H9<daZ]MgS4Pb^1HkA:1PU^5>^h_g[RQV@PnYBRI_]`B]Bh@Uk03eXGY`I16L76H28X`R>IROMeNVUdU[:lghLhPCQZ:4a<30YBZCYnXe[?;jc8gKI2QH2MjnWBm4nGCZW`aVU2a;P<AMI25mlW_Nm][2?b6o851X@lAm]YZ`bWRF1g<Ga:T]1NXH5Veja5P9S9>:aNg:Th1Y=5o78K>LQ8hW@5S?I83Lk5Xk;j5@I3o[d:4RjE^oS30:WP9gC\\i8aSI>QRE@4lP:7lDg8g2`Ql[2I8aBU\\BQ?B4_clL9Q]S;^e1Ob5[>3JER2`c7B=o]fPOWO<DGi;Niba1PoWPPE_Q3aX0OB0mZej\\f_M[J4Y6]1`h2MkF[GiW8Q^d3^_=<I1N2Q7]2<2j[iP7V3V821FaI]A`93bC^Z\\G=WJ;^Ih?B97_iIF@\\Dl<eK1je8SNTWo_=XFMZH<<JYLZ^YQMPgYOV45K_:]kSI8^XlO0]GY=VUfe_C_F6TOcoAlVUH:o=WhhT@K`2KFhe<3\\KXQ>W:M?S_4S5d@J^`[AGA7@3]DnGSCO`\\?E8HT75^d9\\:m\\m1egIfk8cd6bD9\\eU8\\n[Pb0Cgd^S0n9kGJHb]i5XodlKHc34Fhi9K>0U5WK`>7Ff2^KL=WC6:kc?e5C^a1T1:4:^S5flXlGNIj08AfO?Dh7T7dWO>E]NI9?ob7B7P_h[4TEP[EU;GllFTnSmg9:\\[N]<SAoKP_kPlG56A:I3T6EG8Hj=XnUE`KT5U@OQ?]7[N^MFN1_NU4KO_3::Le`8IL9[1Z1H1;V3SC\\N3]S@4U[F2mhT5dYM7[4Pg_Na0_8WTH0`bgceQS8]EG;XgD4Ib4iLTP@kE79Mn>AYRJA1U5^Blhgno:aHVYc03c3J0Vc9FjEV^M75Zfd8kVC9>iJDk`AJ[6f7DK2D^DL\\AX:6b5h31XH;RQB\\N<ZSM=J;6L[`UW^eOIFc1Y]6_dfedIe4ARh72mTXC0WND_IDHVCZRDE0eODARCEETQI5TPUQE=jEH5bS?LP[ai`F5ABRYDo2o\\@=]GT?_9;hc4Lm:\\SF9k1T<0E@fX9BG[]g0nY7k[Qmi@la8`PF0j6@Q?Ii7bLkXQ<lLHf]`:DCh@9JY5>hEVLTdhL\\b1EB0lLh<=WaO@F<;8g<d:@e:LA:cFIEdmQh7hNHfSRToW?8N4:Z1K;XEDRO;OIDh<UdVln?bjgL>?VE98[B\\K<BVjkG8LiSX;fb>jf?DUK00Aih<WY6QD6cEnHBZ8iN_fd<G8Ci`11RUW2QlW]IXV:m?;J0GXXHfGNQ>:D`=fLPbO?VOTEYLj^cNj5PM>jKB5HVjJ4U7lXaTQNL9<@\\1`m\\Ug@VQHd7>jW=ca0`miF7;N0F=GjoQ`RFchKMGTmn8cF@Oh4GGCm7m2`U9j93Tb>=kSERjE_J939F01I1;`<ijk_=_Vn=7RVAI6fnQI5KlF:C44bN<<8K=Z<2TP<1]5?<dB>^LA=ebloE2Y2:9lkh0\\<YKbHD97iE`<C5oj^1>X:??`H6BXF2hG1Q[dF0Q=>W=J?7C\\k1T?<;R44oW?1hY^G8Zm]ZKnfOf0eCFYo6?=D8?<`6HU5SXh1;=:23LmV_FSi;OJfV<^?GkIDPISeHg1LaGE:V3Y3K3H<QJfbY?=;ldZRhnhQT_mGXDLFXXhSONE6Do_0iNZagB:BPGOTH;VhHUTd6LhQm^[;dO]5Hlkg<R:F<Kn\\:I:EGojgWZ2X@SYO_dlH;G8S<>oEKabY`:oU;=JW7ig?S?EYb86b7n8ce\\]IRa]koiWY<RfO;5kUI;7lVeC?[@ZaXDiF04B8R]bg@>O<mQDoUcBLcf^f>m2kMBUloD>Ze@NN^Z11TM`inXYhE_I=kA`:ZF4d\\>`L@;ZP[`ENU5cL[BV6\\Z?Di76:jg3hE6oG6jFc8kP=[GS1;WSedYQW1:U4\\OF32GgmMC<AjO]872bdBb`bKAA?8j78b>T3VfcUB2m4J^CPRU;8dScI]LU]^bBYA5_3:Y0N5i^?200000",T6=class Db{constructor(t,r){this.states=t,this.index=r}clone(){return new Db(this.states.slice(),this.index)}next(){let t=this.states[this.index];return t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,this.index=Es(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),r=this.index;this.index=Es(this.states,this.index);for(let n=19932;n>0;--n)P6.charCodeAt(n/6|0)-48&1<<n%6&&$b(this.states,this.index,t,r),this.index=Es(this.states,this.index);$b(this.states,this.index,t,r)}};function $b(e,t,r,n){let i=0;if(n>=t){for(;i<624-n;i++)e[i+t]^=r[i+n];for(;i<624-t;i++)e[i+t]^=r[i+n-624];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}else{for(;i<624-t;i++)e[i+t]^=r[i+n];for(;i<624-n;i++)e[i+t-624]^=r[i+n];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}}function Es(e,t){if(t<227){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397]^r>>>1^-(r&1)&2567483615,t+1}else if(t<623){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397-624]^r>>>1^-(r&1)&2567483615,t+1}else{let r=e[t]&2147483648|e[0]&2147483647;return e[t]=e[396]^r>>>1^-(r&1)&2567483615,0}}function M6(e){for(let t=0;t!==624;++t)Es(e,t)}function _b(e){let t=[e|0];for(let r=1;r!==624;++r){let n=t[r-1]^t[r-1]>>>30;t.push(Math.imul(1812433253,n)+r|0)}return M6(t),new T6(t,0)}var O6=class Fb{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new Fb(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00^this.s00<<23,r=this.s01^(this.s01<<23|this.s00>>>9),n=t^this.s10^(t>>>18|r<<14)^(this.s10>>>5|this.s11<<27),i=r^this.s11^r>>>18^this.s11>>>5,o=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=i,this.s10=n,o}jump(){let t=0,r=0,n=0,i=0,o=[1667051007,2321340297,1548169110,304075285];for(let s=0;s!==4;++s)for(let a=1;a;a<<=1)o[s]&a&&(t^=this.s01,r^=this.s00,n^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=r,this.s11=n,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function kc(e){return new O6(-1,~e,e|0,0)}var N6=class jb{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new jb(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00+this.s10|0,r=this.s10^this.s00,n=this.s11^this.s01,i=this.s00,o=this.s01;return this.s00=i<<24^o>>>8^r^r<<16,this.s01=o<<24^i>>>8^n^(n<<16|r>>>16),this.s10=n<<5^r>>>27,this.s11=r<<5^n>>>27,t}jump(){let t=0,r=0,n=0,i=0,o=[3639956645,3750757012,1261568508,386426335];for(let s=0;s!==4;++s)for(let a=1;a;a<<=1)o[s]&a&&(t^=this.s01,r^=this.s00,n^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=r,this.s11=n,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Vb(e){return new N6(-1,~e,e|0,0)}function Bb(e,t){for(let r=0;r!==t;++r)e.next()}var Ub=BigInt,L6=4294967296n;function zb(e,t,r){let n=r-t+1n,i=L6,o=1;for(;i<n;)i<<=32n,++o;let s=Wb(o,e);if(s<n)return s+t;if(s+n<i)return s%n+t;let a=i-i%n;for(;s>=a;)s=Wb(o,e);return s%n+t}function Wb(e,t){let r=Ub(t.next()+2147483648);for(let n=1;n<e;++n){let i=t.next();r=(r<<32n)+Ub(i+2147483648)}return r}function ai(e,t){let r=t>2?~~(4294967296/t)*t:4294967296,n=e.next()+2147483648;for(;n>=r;)n=e.next()+2147483648;return n%t}function Ec(e,t){if(t<0){let r=-t;e.sign=-1,e.data[0]=~~(r/4294967296),e.data[1]=r>>>0}else e.sign=1,e.data[0]=~~(t/4294967296),e.data[1]=t>>>0;return e}function $6(e,t,r){let n=t.data[1],i=t.data[0],o=t.sign,s=r.data[1],a=r.data[0],l=r.sign;if(e.sign=1,o===1&&l===-1){let m=n+s,g=i+a+(m>4294967295?1:0);return e.data[0]=g>>>0,e.data[1]=m>>>0,e}let u=n,c=i,d=s,p=a;o===-1&&(u=s,c=a,d=n,p=i);let h=0,f=u-d;return f<0&&(h=1,f=f>>>0),e.data[0]=c-p-h,e.data[1]=f,e}function D6(e,t,r){let n=r[0]+1;for(t[0]=ai(e,n),t[1]=ai(e,4294967296);t[0]>=r[0]&&(t[0]!==r[0]||t[1]>=r[1]);)t[0]=ai(e,n),t[1]=ai(e,4294967296);return t}var _6=Number.MAX_SAFE_INTEGER,F6={sign:1,data:[0,0]},j6={sign:1,data:[0,0]},Gb={sign:1,data:[0,0]},Cc=[0,0];function V6(e,t,r,n){let i=n<=_6?Ec(Gb,n):$6(Gb,Ec(F6,r),Ec(j6,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,D6(e,Cc,i.data),Cc[0]*4294967296+Cc[1]+t}function Cs(e,t,r){let n=r-t;return n<=4294967295?ai(e,n+1)+t:V6(e,t,r,n)}var Hb=Symbol.for("fast-check/PreconditionFailure"),nr=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=Hb}static isFailure(e){return e!=null&&e.footprint===Hb}};function B6(e){if(!e)throw new nr}var U6=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},W6=new U6;function z6(){return W6}function*G6(e,t){for(let r of e)yield t(r)}function*H6(e,t){for(let r of e)yield*t(r)}function*q6(e,t){for(let r of e)t(r)&&(yield r)}function*K6(e,t){for(let r=0;r<t;++r){let n=e.next();if(n.done)break;yield n.value}}function*Y6(e,t){let r=e.next();for(;!r.done&&t(r.value);)yield r.value,r=e.next()}function*J6(e,t){for(let r=e.next();!r.done;r=e.next())yield r.value;for(let r of t)for(let n=r.next();!n.done;n=r.next())yield n.value}var Z6=Symbol.iterator,j=class Lt{static nil(){return new Lt(z6())}static of(...t){return new Lt(t[Z6]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Lt(G6(this.g,t))}flatMap(t){return new Lt(H6(this.g,t))}dropWhile(t){let r=!1;function*n(i){(r||!t(i))&&(r=!0,yield i)}return this.flatMap(n)}drop(t){if(t<=0)return this;let r=0;function n(){return r++<t}return this.dropWhile(n)}takeWhile(t){return new Lt(Y6(this.g,t))}take(t){return new Lt(K6(this.g,t))}filter(t){return new Lt(q6(this.g,t))}every(t){for(let r of this.g)if(!t(r))return!1;return!0}has(t){for(let r of this.g)if(t(r))return[!0,r];return[!1,null]}join(...t){return new Lt(J6(this.g,t))}getNthOrLast(t){let r=t,n=null;for(let i of this.g){if(r--===0)return i;n=i}return n}};function tr(e){return new j(e)}var Oe=Symbol.for("fast-check/cloneMethod");function vr(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Oe in e&&typeof e[Oe]=="function"}function tn(e){return vr(e)?e[Oe]():e}var X6=Object.defineProperty,_=class{constructor(e,t,r){this.value_=e,this.context=t,this.hasToBeCloned=r!==void 0||vr(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&X6(this,"value",{get:r!==void 0?r:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[Oe]():(this.readOnce=!0,this.value_):this.value_}},de=class{filter(e){return new t4(this,e)}map(e,t){return new e4(this,e,t)}chain(e){return new Q6(this,e)}},Q6=class extends de{constructor(e,t){super(),this.arb=e,this.chainer=t}generate(e,t){let r=e.clone(),n=this.arb.generate(e,t);return this.valueChainer(n,e,r,t)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?(t.stoppedForOriginal?j.nil():this.arb.shrink(t.originalValue,t.originalContext).map(r=>this.valueChainer(r,t.clonedMrng.clone(),t.clonedMrng,t.originalBias))).join(t.chainedArbitrary.shrink(e,t.chainedContext).map(r=>{let n={...t,chainedContext:r.context,stoppedForOriginal:!0};return new _(r.value_,n)})):j.nil()}valueChainer(e,t,r,n){let i=this.chainer(e.value_),o=i.generate(t,n),s={originalBias:n,originalValue:e.value_,originalContext:e.context,stoppedForOriginal:!1,chainedArbitrary:i,chainedContext:o.context,clonedMrng:r};return new _(o.value_,s)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalBias"in e&&"originalValue"in e&&"originalContext"in e&&"stoppedForOriginal"in e&&"chainedArbitrary"in e&&"chainedContext"in e&&"clonedMrng"in e}},e4=class extends de{constructor(e,t,r){super(),this.arb=e,this.mapper=t,this.unmapper=r,this.bindValueMapper=n=>this.valueMapper(n)}generate(e,t){let r=this.arb.generate(e,t);return this.valueMapper(r)}canShrinkWithoutContext(e){if(this.unmapper!==void 0)try{let t=this.unmapper(e);return this.arb.canShrinkWithoutContext(t)}catch{return!1}return!1}shrink(e,t){if(this.isSafeContext(t))return this.arb.shrink(t.originalValue,t.originalContext).map(this.bindValueMapper);if(this.unmapper!==void 0){let r=this.unmapper(e);return this.arb.shrink(r,void 0).map(this.bindValueMapper)}return j.nil()}mapperWithCloneIfNeeded(e){let t=e.value,r=this.mapper(t);return e.hasToBeCloned&&(typeof r=="object"&&r!==null||typeof r=="function")&&Object.isExtensible(r)&&!vr(r)&&Object.defineProperty(r,Oe,{get:()=>()=>this.mapperWithCloneIfNeeded(e)[0]}),[r,t]}valueMapper(e){let[t,r]=this.mapperWithCloneIfNeeded(e);return new _(t,{originalValue:r,originalContext:e.context})}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalValue"in e&&"originalContext"in e}},t4=class extends de{constructor(e,t){super(),this.arb=e,this.refinement=t,this.bindRefinementOnValue=r=>this.refinementOnValue(r)}generate(e,t){for(;;){let r=this.arb.generate(e,t);if(this.refinementOnValue(r))return r}}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)&&this.refinement(e)}shrink(e,t){return this.arb.shrink(e,t).filter(this.bindRefinementOnValue)}refinementOnValue(e){return this.refinement(e.value)}};function Hw(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function qw(e){if(!Hw(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Kw=Function.prototype.apply,Ac=Symbol("apply");function r4(e){try{return e.apply}catch{return}}function n4(e,t,r){let n=e;n[Ac]=Kw;let i=n[Ac](t,r);return delete n[Ac],i}function q(e,t,r){return r4(e)===Kw?e.apply(t,r):n4(e,t,r)}var Yw=Array,O=BigInt,i4=BigInt64Array,o4=BigUint64Array,Jw=Boolean,Bs=Date,L=Error,Zw=Float32Array,Xw=Float64Array,s4=Int8Array,a4=Int16Array,l4=Int32Array,Dt=Number,Ve=String,rn=Set,u4=Uint8Array,c4=Uint8ClampedArray,d4=Uint16Array,f4=Uint32Array,p4=encodeURIComponent,_t=Map,Ls=Symbol,qb=Array.prototype.forEach,Kb=Array.prototype.indexOf,Yb=Array.prototype.join,Jb=Array.prototype.map,Zb=Array.prototype.flat,Xb=Array.prototype.filter,Qb=Array.prototype.push,eS=Array.prototype.pop,tS=Array.prototype.splice,rS=Array.prototype.slice,nS=Array.prototype.sort,iS=Array.prototype.every;function h4(e){try{return e.forEach}catch{return}}function m4(e){try{return e.indexOf}catch{return}}function g4(e){try{return e.join}catch{return}}function y4(e){try{return e.map}catch{return}}function b4(e){try{return e.flat}catch{return}}function S4(e){try{return e.filter}catch{return}}function w4(e){try{return e.push}catch{return}}function v4(e){try{return e.pop}catch{return}}function x4(e){try{return e.splice}catch{return}}function R4(e){try{return e.slice}catch{return}}function k4(e){try{return e.sort}catch{return}}function E4(e){try{return e.every}catch{return}}function Qw(e,t){return h4(e)===qb?e.forEach(t):q(qb,e,[t])}function $t(e,...t){return m4(e)===Kb?e.indexOf(...t):q(Kb,e,t)}function ce(e,...t){return g4(e)===Yb?e.join(...t):q(Yb,e,t)}function G(e,t){return y4(e)===Jb?e.map(t):q(Jb,e,[t])}function C4(e,t){return b4(e)===Zb?([].flat(),e.flat(t)):q(Zb,e,[t])}function A4(e,t){return S4(e)===Xb?e.filter(t):q(Xb,e,[t])}function $(e,...t){return w4(e)===Qb?e.push(...t):q(Qb,e,t)}function e1(e){return v4(e)===eS?e.pop():q(eS,e,[])}function t1(e,...t){return x4(e)===tS?e.splice(...t):q(tS,e,t)}function Le(e,...t){return R4(e)===rS?e.slice(...t):q(rS,e,t)}function r1(e,...t){return k4(e)===nS?e.sort(...t):q(nS,e,t)}function n1(e,...t){return E4(e)===iS?e.every(...t):q(iS,e,t)}var oS=Date.prototype.getTime,sS=Date.prototype.toISOString;function I4(e){try{return e.getTime}catch{return}}function P4(e){try{return e.toISOString}catch{return}}function Us(e){return I4(e)===oS?e.getTime():q(oS,e,[])}function T4(e){return P4(e)===sS?e.toISOString():q(sS,e,[])}var aS=Set.prototype.add,lS=Set.prototype.has;function M4(e){try{return e.add}catch{return}}function O4(e){try{return e.has}catch{return}}function fi(e,t){return M4(e)===aS?e.add(t):q(aS,e,[t])}function Ws(e,t){return O4(e)===lS?e.has(t):q(lS,e,[t])}var uS=WeakMap.prototype.set,cS=WeakMap.prototype.get;function N4(e){try{return e.set}catch{return}}function L4(e){try{return e.get}catch{return}}function $4(e,t,r){return N4(e)===uS?e.set(t,r):q(uS,e,[t,r])}function D4(e,t){return L4(e)===cS?e.get(t):q(cS,e,[t])}var dS=Map.prototype.set,fS=Map.prototype.get,pS=Map.prototype.has;function _4(e){try{return e.set}catch{return}}function F4(e){try{return e.get}catch{return}}function j4(e){try{return e.has}catch{return}}function ct(e,t,r){return _4(e)===dS?e.set(t,r):q(dS,e,[t,r])}function Je(e,t){return F4(e)===fS?e.get(t):q(fS,e,[t])}function V4(e,t){return j4(e)===pS?e.has(t):q(pS,e,[t])}var hS=String.prototype.split,mS=String.prototype.startsWith,gS=String.prototype.endsWith,yS=String.prototype.substring,bS=String.prototype.toLowerCase,SS=String.prototype.toUpperCase,wS=String.prototype.padStart,vS=String.prototype.charCodeAt,xS=String.prototype.normalize,RS=String.prototype.replace;function B4(e){try{return e.split}catch{return}}function U4(e){try{return e.startsWith}catch{return}}function W4(e){try{return e.endsWith}catch{return}}function z4(e){try{return e.substring}catch{return}}function G4(e){try{return e.toLowerCase}catch{return}}function H4(e){try{return e.toUpperCase}catch{return}}function q4(e){try{return e.padStart}catch{return}}function K4(e){try{return e.charCodeAt}catch{return}}function Y4(e){try{return e.normalize}catch{return}}function J4(e){try{return e.replace}catch{return}}function Be(e,...t){return B4(e)===hS?e.split(...t):q(hS,e,t)}function Z4(e,...t){return U4(e)===mS?e.startsWith(...t):q(mS,e,t)}function X4(e,...t){return W4(e)===gS?e.endsWith(...t):q(gS,e,t)}function ge(e,...t){return z4(e)===yS?e.substring(...t):q(yS,e,t)}function Xc(e){return G4(e)===bS?e.toLowerCase():q(bS,e,[])}function kd(e){return H4(e)===SS?e.toUpperCase():q(SS,e,[])}function Q4(e,...t){return q4(e)===wS?e.padStart(...t):q(wS,e,t)}function nn(e,t){return K4(e)===vS?e.charCodeAt(t):q(vS,e,[t])}function eN(e,t){return Y4(e)===xS?e.normalize(t):q(xS,e,[t])}function tN(e,t,r){return J4(e)===RS?e.replace(t,r):q(RS,e,[t,r])}var kS=Number.prototype.toString;function rN(e){try{return e.toString}catch{return}}function pi(e,...t){return rN(e)===kS?e.toString(...t):q(kS,e,t)}var nN=Object.prototype.hasOwnProperty,iN=Object.prototype.toString;function i1(e,t){return q(nN,e,[t])}function Qc(e){return q(iN,e,[])}var oN=Error.prototype.toString;function sN(e){return q(oN,e,[])}var aN=class{constructor(e){this.producer=e}[Symbol.iterator](){return this.it===void 0&&(this.it=this.producer()),this.it}next(){return this.it===void 0&&(this.it=this.producer()),this.it.next()}};function er(e){return new aN(e)}var o1=Array.isArray,lN=Object.defineProperty;function s1(e,t){return lN(e,Oe,{value:()=>{let r=[];for(let n=0;n!==t.length;++n)$(r,t[n].value);return s1(r,t),r}})}function a1(e){let t=!1,r=[],n=[];for(let i=0;i!==e.length;++i){let o=e[i];t=t||o.hasToBeCloned,$(r,o.value),$(n,o.context)}return t&&s1(r,e),new _(r,n)}function l1(e,t,r){let n=[],i=o1(r)?r:[];for(let o=0;o!==e.length;++o)$(n,er(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=G(t,(l,u)=>new _(tn(l),i[u]));return[...Le(a,0,o),s,...Le(a,o+1)]}).map(a1)));return j.nil().join(...n)}var uN=class extends de{constructor(e){super(),this.arbs=e;for(let t=0;t!==e.length;++t){let r=e[t];if(r==null||r.generate===null||r.generate===void 0)throw new Error(`Invalid parameter encountered at index ${t}: expecting an Arbitrary`)}}generate(e,t){let r=[];for(let n=0;n!==this.arbs.length;++n)$(r,this.arbs[n].generate(e,t));return a1(r)}canShrinkWithoutContext(e){if(!o1(e)||e.length!==this.arbs.length)return!1;for(let t=0;t!==this.arbs.length;++t)if(!this.arbs[t].canShrinkWithoutContext(e[t]))return!1;return!0}shrink(e,t){return l1(this.arbs,e,t)}};function B(...e){return new uN(e)}var cN=Math.log;function u1(e){return 2+~~(cN(e+1)*.4342944819032518)}var Ed={};function dN(e){Ed=e}function dt(){return Ed}function fN(){Ed={}}var hi=Symbol("UndefinedContextPlaceholder");function on(e){return e.context!==void 0?e:e.hasToBeCloned?new _(e.value_,hi,()=>e.value):new _(e.value_,hi)}var ES=()=>{},pN=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:r,asyncAfterEach:n,beforeEach:i,afterEach:o}=dt()||{};if(r!==void 0&&i!==void 0)throw L(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(n!==void 0&&o!==void 0)throw L(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=r||i||ES,this.afterEachHook=n||o||ES}isAsync(){return!0}generate(e,t){return on(this.arb.generate(e,t!==void 0?u1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==hi?e.context:void 0;return this.arb.shrink(e.value_,t).map(on)}async runBeforeEach(){await this.beforeEachHook()}async runAfterEach(){await this.afterEachHook()}async run(e){try{let t=await this.predicate(e);return t===void 0||t===!0?null:{error:new L("Property failed by returning false")}}catch(t){return nr.isFailure(t)?t:{error:t}}}beforeEach(e){let t=this.beforeEachHook;return this.beforeEachHook=()=>e(t),this}afterEach(e){let t=this.afterEachHook;return this.afterEachHook=()=>e(t),this}},c1=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return on(this.arb.generate(e,t))}canShrinkWithoutContext(e){return!0}shrink(e,t){if(t===void 0&&!this.arb.canShrinkWithoutContext(e))return j.nil();let r=t!==hi?t:void 0;return this.arb.shrink(e,r).map(on)}};function hN(...e){if(e.length<2)throw new Error("asyncProperty expects at least two parameters");let t=Le(e,0,e.length-1),r=e[e.length-1];return Qw(t,qw),new pN(B(...G(t,n=>new c1(n))),n=>r(...n))}var CS=()=>{},d1=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:r=CS,afterEach:n=CS,asyncBeforeEach:i,asyncAfterEach:o}=dt()||{};if(i!==void 0)throw L(`"asyncBeforeEach" can't be set when running synchronous properties`);if(o!==void 0)throw L(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=r,this.afterEachHook=n}isAsync(){return!1}generate(e,t){return on(this.arb.generate(e,t!==void 0?u1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==hi?e.context:void 0;return this.arb.shrink(e.value_,t).map(on)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(e){try{let t=this.predicate(e);return t===void 0||t===!0?null:{error:new L("Property failed by returning false")}}catch(t){return nr.isFailure(t)?t:{error:t}}}beforeEach(e){let t=this.beforeEachHook;return this.beforeEachHook=()=>e(t),this}afterEach(e){let t=this.afterEachHook;return this.afterEachHook=()=>e(t),this}};function mN(...e){if(e.length<2)throw new Error("property expects at least two parameters");let t=Le(e,0,e.length-1),r=e[e.length-1];return Qw(t,qw),new d1(B(...G(t,n=>new c1(n))),n=>r(...n))}var gN=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function ed(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>ed(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>ed(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function f1(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>f1(e),next:()=>e.next(),jump:()=>Bb(e,42),getState:()=>e.getState()}}function qs(e){return f1(ed(e))}var yN=Date.now,bN=Math.min,SN=Math.random,wN=class{constructor(e){let t=e||{};this.seed=vN(t),this.randomType=xN(t),this.numRuns=RN(t),this.verbose=kN(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=Pc(t.timeout),this.skipAllAfterTimeLimit=Pc(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=Pc(t.interruptAfterTimeLimit),this.markInterruptAsFailure=t.markInterruptAsFailure===!0,this.skipEqualValues=t.skipEqualValues===!0,this.ignoreEqualValues=t.ignoreEqualValues===!0,this.logger=t.logger!==void 0?t.logger:r=>{console.log(r)},this.path=t.path!==void 0?t.path:"",this.unbiased=t.unbiased===!0,this.examples=t.examples!==void 0?t.examples:[],this.endOnFailure=t.endOnFailure===!0,this.reporter=t.reporter,this.asyncReporter=t.asyncReporter,this.includeErrorInReport=t.includeErrorInReport===!0}toParameters(){return{seed:this.seed,randomType:this.randomType,numRuns:this.numRuns,maxSkipsPerRun:this.maxSkipsPerRun,timeout:this.timeout,skipAllAfterTimeLimit:this.skipAllAfterTimeLimit,interruptAfterTimeLimit:this.interruptAfterTimeLimit,markInterruptAsFailure:this.markInterruptAsFailure,skipEqualValues:this.skipEqualValues,ignoreEqualValues:this.ignoreEqualValues,path:this.path,logger:this.logger,unbiased:this.unbiased,verbose:this.verbose,examples:this.examples,endOnFailure:this.endOnFailure,reporter:this.reporter,asyncReporter:this.asyncReporter,includeErrorInReport:this.includeErrorInReport}}};function Ic(e){return t=>qs(e(t))}function vN(e){if(e.seed===void 0)return yN()^SN()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function xN(e){if(e.randomType===void 0)return kc;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return Ic(_b);case"congruential":case"congruential32":return Ic(Lb);case"xorshift128plus":return kc;case"xoroshiro128plus":return Vb;default:throw new Error(`Invalid random specified: '${e.randomType}'`)}let t=e.randomType(0);if("min"in t&&t.min!==-2147483648)throw new Error(`Invalid random number generator: min must equal -0x80000000, got ${String(t.min)}`);if("max"in t&&t.max!==2147483647)throw new Error(`Invalid random number generator: max must equal 0x7fffffff, got ${String(t.max)}`);return t===qs(t)?e.randomType:Ic(e.randomType)}function RN(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function kN(e){return e.verbose===void 0?0:typeof e.verbose=="boolean"?e.verbose===!0?1:0:e.verbose<=0?0:e.verbose>=2?2:e.verbose|0}function Pc(e){if(e!==void 0)return bN(e,2147483647)}function Cd(e){return new wN(e)}function EN(e,t,r){let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i(new nr(!0))},e)})}}var AS=class{constructor(e,t,r,n,i,o){this.property=e,this.getTime=t,this.interruptExecution=n,this.setTimeoutSafe=i,this.clearTimeoutSafe=o,this.skipAfterTime=this.getTime()+r}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}run(e){let t=this.skipAfterTime-this.getTime();if(t<=0){let r=new nr(this.interruptExecution);return this.isAsync()?Promise.resolve(r):r}if(this.interruptExecution&&this.isAsync()){let r=EN(t,this.setTimeoutSafe,this.clearTimeoutSafe),n=Promise.race([this.property.run(e),r.promise]);return n.then(r.clear,r.clear),n}return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},CN=(e,t,r)=>{let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i({error:new L(`Property timeout: exceeded limit of ${e} milliseconds`)})},e)})}},AN=class{constructor(e,t,r,n){this.property=e,this.timeMs=t,this.setTimeoutSafe=r,this.clearTimeoutSafe=n}isAsync(){return!0}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}async run(e){let t=CN(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),r=Promise.race([this.property.run(e),t.promise]);return r.then(t.clear,t.clear),r}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},p1=class{constructor(e){this.property=e}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,void 0)}shrink(e){return this.property.shrink(e)}run(e){return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},IS=Array.from,PS=typeof Buffer<"u"?Buffer.isBuffer:void 0,Zr=JSON.stringify,TS=Number.isNaN,IN=Object.keys,PN=Object.getOwnPropertySymbols,TN=Object.getOwnPropertyDescriptor,MS=Object.getPrototypeOf,OS=Number.NEGATIVE_INFINITY,MN=Number.POSITIVE_INFINITY,ft=Symbol.for("fast-check/toStringMethod");function Ad(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&ft in e&&typeof e[ft]=="function"}var Ft=Symbol.for("fast-check/asyncToStringMethod");function Id(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Ft in e&&typeof e[Ft]=="function"}var ON=/^Symbol\((.*)\)$/;function NN(e){if(e.description!==void 0)return e.description;let t=ON.exec(Ve(e));return t&&t[1].length?t[1]:null}function NS(e){switch(e){case 0:return 1/e===OS?"-0":"0";case OS:return"Number.NEGATIVE_INFINITY";case MN:return"Number.POSITIVE_INFINITY";default:return e===e?Ve(e):"Number.NaN"}}function LN(e){let t=-1;for(let r in e){let n=Number(r);if(n!==t+1)return!0;t=n}return t+1!==e.length}function Ye(e,t,r){let n=[...t,e];if(typeof e=="object"&&$t(t,e)!==-1)return"[cyclic]";if(Id(e)){let i=r(e);if(i.state==="fulfilled")return i.value}if(Ad(e))try{return e[ft]()}catch{}switch(Qc(e)){case"[object Array]":{let i=e;if(i.length>=50&&LN(i)){let s=[];for(let a in i)TS(Number(a))||$(s,`${a}:${Ye(i[a],n,r)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${ce(s,",")}})`:`Array(${i.length})`}let o=ce(G(i,s=>Ye(s,n,r)),",");return i.length===0||i.length-1 in i?`[${o}]`:`[${o},]`}case"[object BigInt]":return`${e}n`;case"[object Boolean]":{let i=e==!0?"true":"false";return typeof e=="boolean"?i:`new Boolean(${i})`}case"[object Date]":{let i=e;return TS(Us(i))?"new Date(NaN)":`new Date(${Zr(T4(i))})`}case"[object Map]":return`new Map(${Ye(Array.from(e),n,r)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?NS(e):`new Number(${NS(Number(e))})`;case"[object Object]":{try{let o=e.toString;if(typeof o=="function"&&o!==Object.prototype.toString)return e.toString()}catch{return"[object Object]"}let i=o=>`${o==="__proto__"?'["__proto__"]':typeof o=="symbol"?`[${Ye(o,n,r)}]`:Zr(o)}:${Ye(e[o],n,r)}`;return"{"+ce([...MS(e)===null?["__proto__:null"]:[],...G(IN(e),i),...G(A4(PN(e),o=>{let s=TN(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${Ye(Array.from(e),n,r)})`;case"[object String]":return typeof e=="string"?Zr(e):`new String(${Zr(e)})`;case"[object Symbol]":{let i=e;if(Ls.keyFor(i)!==void 0)return`Symbol.for(${Zr(Ls.keyFor(i))})`;let o=NN(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&Ls[o.substring(7)])?o:`Symbol(${Zr(o)})`}case"[object Promise]":{let i=r(e);switch(i.state){case"fulfilled":return`Promise.resolve(${Ye(i.value,n,r)})`;case"rejected":return`Promise.reject(${Ye(i.value,n,r)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(e instanceof Error)return`new Error(${Ye(e.message,n,r)})`;break;case"[object Undefined]":return"undefined";case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object BigInt64Array]":case"[object BigUint64Array]":{if(typeof PS=="function"&&PS(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":Ye(IS(e.values()),n,r)})`;let i=MS(e),o=i&&i.constructor&&i.constructor.name;if(typeof o=="string"){let s=e;return s.buffer.detached?`${o}.from(/*detached ArrayBuffer*/)`:`${o}.from(${Ye(IS(s.values()),n,r)})`}break}}try{return e.toString()}catch{return Qc(e)}}function xe(e){return Ye(e,[],()=>({state:"unknown",value:void 0}))}function h1(e){let t=Ls(),r=[],n=new _t;function i(){let l=null,u=()=>{l!==null&&clearTimeout(l)};return{delay:new Promise(c=>{l=setTimeout(()=>{l=null,c(t)},0)}),cancel:u}}let o={state:"unknown",value:void 0},s=function(u){let c=u;if(n.has(c))return n.get(c);let d=i(),p=Ft in u?Promise.resolve().then(()=>u[Ft]()):u;return p.catch(()=>{}),r.push(Promise.race([p,d.delay]).then(h=>{h===t?n.set(c,{state:"pending",value:void 0}):n.set(c,{state:"fulfilled",value:h}),d.cancel()},h=>{n.set(c,{state:"rejected",value:h}),d.cancel()})),n.set(c,o),o};function a(){let l=Ye(e,[],s);return r.length===0?l:Promise.all(r.splice(0)).then(a)}return a()}async function Pd(e){return Promise.resolve(h1(e))}function LS(e){return e===null?new nr:e}function $N(...e){return e[1]?e[0].then(LS):LS(e[0])}function DN(e,t){return $N(e,t)}var $S=class{constructor(e,t){this.property=e,this.skipRuns=t,this.coveredCases=new Map}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}run(e){let t=xe(e);if(this.coveredCases.has(t)){let n=this.coveredCases.get(t);return this.skipRuns?DN(n,this.property.isAsync()):n}let r=this.property.run(e);return this.coveredCases.set(t,r),r}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},DS=Date.now,Tc=setTimeout,Mc=clearTimeout;function _N(e,t){let r=e;return e.isAsync()&&t.timeout!==void 0&&(r=new AN(r,t.timeout,Tc,Mc)),t.unbiased&&(r=new p1(r)),t.skipAllAfterTimeLimit!==void 0&&(r=new AS(r,DS,t.skipAllAfterTimeLimit,!1,Tc,Mc)),t.interruptAfterTimeLimit!==void 0&&(r=new AS(r,DS,t.interruptAfterTimeLimit,!0,Tc,Mc)),t.skipEqualValues&&(r=new $S(r,!0)),t.ignoreEqualValues&&(r=new $S(r,!1)),r}var FN=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),jN=class m1{constructor(t,r){this.verbosity=t,this.interruptedAsFailure=r,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(t,r){let n={status:t,value:r,children:[]};return this.currentLevelExecutionTrees.push(n),n}fail(t,r,n){if(this.verbosity>=1){let i=this.appendExecutionTree(1,t);this.currentLevelExecutionTrees=i.children}this.pathToFailure===void 0?this.pathToFailure=`${r}`:this.pathToFailure+=`:${r}`,this.value=t,this.failure=n}skip(t){this.verbosity>=2&&this.appendExecutionTree(-1,t),this.pathToFailure===void 0&&++this.numSkips}success(t){this.verbosity>=2&&this.appendExecutionTree(0,t),this.pathToFailure===void 0&&++this.numSuccesses}interrupt(){this.interrupted=!0}isSuccess(){return this.pathToFailure===void 0}firstFailure(){return this.pathToFailure!==void 0?+Be(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?Be(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let t=[],r=this.rootExecutionTrees;for(;r.length>0&&r[r.length-1].status===1;){let n=r[r.length-1];t.push(n.value),r=n.children}return t}static mergePaths(t,r){if(t.length===0)return r;let n=t.split(":"),i=r.split(":"),o=+n[n.length-1]+ +i[0];return[...n.slice(0,n.length-1),`${o}`,...i.slice(1)].join(":")}toRunDetails(t,r,n,i){if(!this.isSuccess())return{failed:!0,interrupted:this.interrupted,numRuns:this.firstFailure()+1-this.numSkips,numSkips:this.numSkips,numShrinks:this.numShrinks(),seed:t,counterexample:this.value,counterexamplePath:m1.mergePaths(r,this.pathToFailure),errorInstance:this.failure.error,failures:this.extractFailures(),executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:i.toParameters()};let o=this.interruptedAsFailure||this.numSuccesses===0;return{failed:this.numSkips>n||this.interrupted&&o,interrupted:this.interrupted,numRuns:this.numSuccesses,numSkips:this.numSkips,numShrinks:0,seed:t,counterexample:null,counterexamplePath:null,error:null,errorInstance:null,failures:[],executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:i.toParameters()}}},g1=class{constructor(e,t,r,n){this.sourceValues=e,this.shrink=t,this.runExecution=new jN(r,n),this.currentIdx=-1,this.nextValues=e}[Symbol.iterator](){return this}next(){let e=this.nextValues.next();return e.done||this.runExecution.interrupted?{done:!0,value:void 0}:(this.currentValue=e.value,++this.currentIdx,{done:!1,value:e.value.value_})}handleResult(e){e!==null&&typeof e=="object"&&!nr.isFailure(e)?(this.runExecution.fail(this.currentValue.value_,this.currentIdx,e),this.currentIdx=-1,this.nextValues=this.shrink(this.currentValue)):e!==null?e.interruptExecution?this.runExecution.interrupt():(this.runExecution.skip(this.currentValue.value_),this.sourceValues.skippedOne()):this.runExecution.success(this.currentValue.value_)}},VN=class{constructor(e,t,r){this.initialValues=e,this.maxInitialIterations=t,this.remainingSkips=r}[Symbol.iterator](){return this}next(){if(--this.maxInitialIterations!==-1&&this.remainingSkips>=0){let e=this.initialValues.next();if(!e.done)return{value:e.value,done:!1}}return{value:void 0,done:!0}}skippedOne(){--this.remainingSkips,++this.maxInitialIterations}},BN=-2147483648,UN=2147483647,WN=Math.pow(2,27),zN=Math.pow(2,-53),Td=class y1{constructor(t){this.internalRng=qs(t.clone())}clone(){return new y1(this.internalRng)}next(t){return Cs(this.internalRng,0,(1<<t)-1)}nextBoolean(){return Cs(this.internalRng,0,1)===1}nextInt(t,r){return Cs(this.internalRng,t===void 0?BN:t,r===void 0?UN:r)}nextBigInt(t,r){return zb(this.internalRng,t,r)}nextDouble(){let t=this.next(26),r=this.next(27);return(t*WN+r)*zN}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function GN(e,t,r){return t.jump(),e.generate(new Td(t),r)}function*b1(e,t,r,n){for(let i=0;i!==n.length;++i)yield new _(n[i],void 0);for(let i=0,o=r(t);;++i)yield GN(e,o,i)}function HN(e,t,r){return()=>e.generate(new Td(t),r)}function*S1(e,t,r,n){yield*G(n,s=>()=>new _(s,void 0));let i=0,o=qs(r(t));for(;;)o.jump(),yield HN(e,o,i++)}function _S(e){return e()}function w1(e,t,r){let n=t,i=e.split(":").map(s=>+s);if(i.length===0)return n.map(_S);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=n.drop(i[0]).map(_S);for(let s of i.slice(1)){let a=o.getNthOrLast(0);if(a===null)throw new Error(`Unable to replay, got wrong path=${e}`);o=r(a).drop(s)}return o}var qN=Object.assign;function KN(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,r)=>`Hint (${r+1}): ${t}`).join(`
100
- `)}function YN(e,t){return`Encountered failures were:
99
+ or you can use record.mirror to access the mirror instance during recording.`,vg={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&&(vg=new Proxy(vg,{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 ub(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 cb(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function db(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function fb(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=fb(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 V2(e,t){return t.getId(e)!==-1}function su(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===Hn}function pb(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?pb(n,t):!0}function Vu(e){return!!e.changedTouches}function B2(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 hb(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function mb(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Bu(e){return e?e instanceof ju&&"shadowRoot"in e?!!e.shadowRoot:!!U.shadowRoot(e):!1}var Uu=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 gb(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 U2(e){let t=e,r;for(;r=gb(t);)t=r;return t}function W2(e){let t=U.ownerDocument(e);if(!t)return!1;let r=U2(e);return U.contains(t,r)}function yb(e){let t=U.ownerDocument(e);return t?U.contains(t,e)||W2(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 bb=(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))(bb||{});function xg(e){return"__ln"in e}var Wu=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&&xg(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&&xg(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--)}},Rg=(e,t)=>`${e}@${t}`,zu=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 Wu,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||!yb(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(gb(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=>{hb(f,this.mirror)&&this.iframeManager.addIframe(f),mb(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Bu(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)kg(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(U.parentNode(l))||o(l);for(let l of this.addedSet)!Eg(this.droppedSet,l)&&!kg(this.removesSubTreeCache,l,this.mirror)||Eg(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(!su(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:jg(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,fb(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"),!Fg(r.tagName,n))if(o.attributes[n]=_g(this.doc,mr(r.tagName),mr(n),i),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let s=this.unattachedDoc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue);for(let a of Array.from(r.style)){let l=r.style.getPropertyValue(a),u=r.style.getPropertyPriority(a);l!==s.style.getPropertyValue(a)||u!==s.style.getPropertyPriority(a)?u===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,u]:o._unchangedStyles[a]=[l,u]}for(let a of Array.from(s.style))r.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(je(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),i=Wn(t.target)?this.mirror.getId(U.host(t.target)):this.mirror.getId(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||su(r,this.mirror,this.slimDOMOptions)||!V2(r,this.mirror)||(this.addedSet.has(r)?(Gu(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||pb(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Rg(n,i)]?Gu(this.movedSet,r):(this.removes.push({parentId:i,id:n,isShadow:Wn(t.target)&&zn(t.target)?!0:void 0}),z2(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(su(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[Rg(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)),Bu(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 Gu(e,t){e.delete(t),U.childNodes(t).forEach(r=>Gu(e,r))}function z2(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 kg(e,t,r){return e.size===0?!1:G2(e,t)}function G2(e,t,r){let n=U.parentNode(t);return n?e.has(n):!1}function Eg(e,t){return e.size===0?!1:Sb(e,t)}function Sb(e,t){let r=U.parentNode(t);return r?e.has(r)?!0:Sb(e,r):!1}var Gn;function H2(e){Gn=e}function q2(){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 wb(e,t){let r=new zu;hr.push(r),r.init(e);let n=new(lb())(Y(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function K2({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}=Vu(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 Y2({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 Vu(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=Vu(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 vb({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=ub(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 J2({viewportResizeCb:e},{win:t}){let r=-1,n=-1,i=Y(ti(Y(()=>{let o=cb(),s=db();(r!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),r=o,n=s)}),200));return Fe("resize",i,t)}var Z2=["INPUT","TEXTAREA","SELECT"],Cg=new WeakMap;function X2({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||Z2.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=Cg.get(w);if(!x||x.text!==y.text||x.isChecked!==y.isChecked){Cg.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 Q2({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 xb({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 e6({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 t6({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 r6({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 n6(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 i6({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 o6(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 s6(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};o6(e,t);let n;e.recordDOM&&(n=wb(e,e.doc));let i=K2(e),o=Y2(e),s=vb(e),a=J2(e,{win:r}),l=X2(e),u=t6(e),c=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(c=Q2(e,{win:r}),d=xb(e,e.doc),p=e6(e,{win:r}),e.collectFonts&&(h=r6(e)));let f=n6(e),m=i6(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}},Hu=class{constructor(t){k(this,"iframes",new WeakMap),k(this,"crossOriginIframeMap",new WeakMap),k(this,"crossOriginIframeMirror",new fs(Dg)),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!==bb.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},qu=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=wb({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(vb({...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(xb({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&&yb(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a6=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Un=0;Un<Wr.length;Un++)a6[Wr.charCodeAt(Un)]=Un;var Un,l6=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 Ag=new Map;function u6(e,t){let r=Ag.get(e);return r||(r=new Map,Ag.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var Rb=(e,t,r)=>{if(!e||!(Eb(e,t)||typeof e=="object"))return;let n=e.constructor.name,i=u6(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=l6(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(Eb(e,t)||typeof e=="object"){let n=e.constructor.name,i=Rb(e,t,r);return{rr_type:n,index:i}}}}return e}var kb=(e,t,r)=>e.map(n=>Yo(n,t,r)),Eb=(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 c6(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=kb(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 d6(e){return e==="experimental-webgl"?"webgl":e}function Ig(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=d6(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 Pg(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(Rb(p,o,this),"tagName"in this.canvas&&!je(this.canvas,n,i,!0)){let h=kb(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 f6(e,t,r,n){let i=[];return i.push(...Pg(t.WebGLRenderingContext.prototype,Jr.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Pg(t.WebGL2RenderingContext.prototype,Jr.WebGL2,e,r,n,t)),()=>{i.forEach(o=>o())}}var Cb="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",p6=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Tg=typeof window<"u"&&window.Blob&&new Blob([p6(Cb)],{type:"text/javascript;charset=utf-8"});function h6(e){let t;try{if(t=Tg&&(window.URL||window.webkitURL).createObjectURL(Tg),!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,"+Cb,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var Ku=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=Ig(r,n,i,!0),a=new Map,l=new h6;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=Ig(t,r,n,!1),o=c6(this.processMutation.bind(this),t,r,n),s=f6(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)}},Yu=class{constructor(t){k(this,"trackedLinkElements",new WeakSet),k(this,"mutationCb"),k(this,"adoptedStyleSheetCb"),k(this,"styleMirror",new Uu),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:Lg(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){}},Ju=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,au,ps=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Om=e.contentWindow)==null?void 0:Om.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var at=yP();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;H2(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=Vg(h);B2();let Af,sa=0,If=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?.(If(be),tt);else if(Ze){let Ge={type:"rrweb",event:If(be),origin:window.location.origin,isCheckout:tt};window.parent.postMessage(Ge,"*")}if(be.type===H.FullSnapshot)Af=be,sa=0;else if(be.type===H.IncrementalSnapshot){if(be.data.source===z.Mutation&&be.data.isAttachIframe)return;sa++;let Ge=n&&sa>=n,se=r&&be.timestamp-Af.timestamp>r;(Ge||se)&&Jo(!0)}};let Ai=Q=>{we({type:H.IncrementalSnapshot,data:{source:z.Mutation,...Q}})},Pf=Q=>we({type:H.IncrementalSnapshot,data:{source:z.Scroll,...Q}}),Tf=Q=>we({type:H.IncrementalSnapshot,data:{source:z.CanvasMutation,...Q}}),dx=Q=>we({type:H.IncrementalSnapshot,data:{source:z.AdoptedStyleSheet,...Q}}),or=new Yu({mutationCb:Ai,adoptedStyleSheetCb:dx}),sr=new Hu({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 aa=new Ju;au=new Ku({recordCanvas:N,mutationCb:Tf,win:window,blockClass:i,blockSelector:o,mirror:at,sampling:w.canvas,dataURLOptions:y});let Ii=new qu({mutationCb:Ai,scrollCb:Pf,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:au,keepIframeSrcFn:F,processedNodeManager:aa},mirror:at});Jo=(Q=!1)=>{if(!E)return;we({type:H.Meta,data:{href:window.location.href,width:db(),height:cb()}},Q),or.reset(),Ii.init(),hr.forEach(ye=>ye.lock());let tt=BP(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=>{hb(ye,at)&&sr.addIframe(ye),mb(ye,at)&&or.trackLinkElement(ye),Bu(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:ub(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(s6)({mutationCb:Ai,mousemoveCb:(se,la)=>we({type:H.IncrementalSnapshot,data:{source:la,positions:se}}),mouseInteractionCb:se=>we({type:H.IncrementalSnapshot,data:{source:z.MouseInteraction,...se}}),scrollCb:Pf,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:Tf,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:aa,canvasManager:au,ignoreCSSAttributes:$e,plugins:((Ge=X?.filter(se=>se.observer))==null?void 0:Ge.map(se=>({observer:se.observer,options:se.options,callback:la=>we({type:H.Plugin,data:{plugin:se.name,payload:la}})})))||[]},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)}}),aa.destroy(),ps=!1,q2()}}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 Mg;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Mg||(Mg={}));var iG=5*1e3;var{addCustomEvent:oG}=Sr,{freezePage:sG}=Sr,{takeFullSnapshot:aG}=Sr;var Pb="__ripploEmitRrwebEvent";function Tb(){return{eventTypes:Ab(H),incrementalSources:Ab(z)}}function Ab(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,r])=>[r,t]))}var g6=ql("@ripplo/rrweb-bundle/bundle","rrweb.js"),Ib;function Mb(){return Ib??=m6(g6,{encoding:"utf8"}),Ib}async function vc({clientVersion:e,debugDir:t,writeOtlpPortFile:r}){let n=new Map,i=Pm(Tb()),o=await Ga({localDir:Ob.join(Ob.dirname(t),".local"),writePortFile:r,onRrwebBatch:(l,u)=>{n.get(l)?.emitRrwebBatch(u)},onSpan:l=>{let u=l.attributes["ripplo.run"];u!=null&&n.get(u)?.emit(l)}}),s=await Mb();return{attach:async(l,u)=>{let c=Op({debugDir:t,runId:u,worker:i});c.emit({clientVersion:e,kind:"meta",source:"capture",timeNanos:"0"}),n.set(u,c),await Mm(l,u),await l.addInitScript(`globalThis.__ripploCapturePort = ${String(o.port)};`),await b6(l,c);let d=[];return{emitAction:p=>{v6(c,p)},emitAssertion:p=>{x6(c,p)},finish:()=>S6(c,{pages:d,registry:n,runId:u}),onPage:p=>{d.push(p),w6(c,s,p)}}},close:async()=>{await o.stop(),await i.terminate()},injectSpan:(l,u)=>{n.get(l)?.emit(u)}}}async function y6(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function b6(e,t){await e.exposeBinding(Pb,(r,n)=>{let i=typeof n=="string"?n:JSON.stringify(n);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}async function S6(e,t){await y6(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 w6(e,t,r){r.on("load",()=>{r.addScriptTag({content:t}).catch(()=>{})}),r.on("response",n=>{C6(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 v6(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:R6(t),timeNanos:Tr(Date.now()),value:k6(t)})}function x6(e,t){let r=Hl(t);e.emit({kind:"assertion",label:r.label,outcome:t.outcome,source:"test",step:r.step,timeNanos:Tr(Date.now())})}function R6(e){if(e.url!=null)return e.url;if(e.locator!=null)return wc(e.locator)}function wc(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${wc(e.scope)} \u25B8 ${wc(e.target)}`:`${e.role} ${e.name??""}`.trim()}function k6(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var E6=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;function C6(e,t){let r=t.request(),n=r.resourceType();if(n!=="fetch"&&n!=="xhr"||E6.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 K0,ok as Xd,ResultAsync as $8}from"neverthrow";function xc(e){return{invariants:Cl(e),laws:Rl(e)}}var Nb=Object.defineProperty,Lb=(e,t)=>{let r={};for(var n in e)Nb(r,n,{get:e[n],enumerable:!0});return t||Nb(r,Symbol.toStringTag,{value:"Module"}),r};var A6=class $b{constructor(t){this.seed=t}clone(){return new $b(this.seed)}next(){let t=Rc(this.seed),r=kc(t),n=Rc(t),i=kc(n);return this.seed=Rc(n),kc(this.seed)+(i+(r<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function Rc(e){return Math.imul(e,214013)+2531011&4294967295}function kc(e){return(e&-2147483649)>>16}function Db(e){return new A6(e)}var I6="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",P6=class Fb{constructor(t,r){this.states=t,this.index=r}clone(){return new Fb(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)I6.charCodeAt(n/6|0)-48&1<<n%6&&_b(this.states,this.index,t,r),this.index=Es(this.states,this.index);_b(this.states,this.index,t,r)}};function _b(e,t,r,n){let i=0;if(n>=t){for(;i<624-n;i++)e[i+t]^=r[i+n];for(;i<624-t;i++)e[i+t]^=r[i+n-624];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}else{for(;i<624-t;i++)e[i+t]^=r[i+n];for(;i<624-n;i++)e[i+t-624]^=r[i+n];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}}function Es(e,t){if(t<227){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397]^r>>>1^-(r&1)&2567483615,t+1}else if(t<623){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397-624]^r>>>1^-(r&1)&2567483615,t+1}else{let r=e[t]&2147483648|e[0]&2147483647;return e[t]=e[396]^r>>>1^-(r&1)&2567483615,0}}function T6(e){for(let t=0;t!==624;++t)Es(e,t)}function jb(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 T6(t),new P6(t,0)}var M6=class Vb{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new Vb(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 Ec(e){return new M6(-1,~e,e|0,0)}var O6=class Bb{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new Bb(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 Ub(e){return new O6(-1,~e,e|0,0)}function Wb(e,t){for(let r=0;r!==t;++r)e.next()}var zb=BigInt,N6=4294967296n;function Hb(e,t,r){let n=r-t+1n,i=N6,o=1;for(;i<n;)i<<=32n,++o;let s=Gb(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=Gb(o,e);return s%n+t}function Gb(e,t){let r=zb(t.next()+2147483648);for(let n=1;n<e;++n){let i=t.next();r=(r<<32n)+zb(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 Cc(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 L6(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 $6(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 D6=Number.MAX_SAFE_INTEGER,_6={sign:1,data:[0,0]},F6={sign:1,data:[0,0]},qb={sign:1,data:[0,0]},Ac=[0,0];function j6(e,t,r,n){let i=n<=D6?Cc(qb,n):L6(qb,Cc(_6,r),Cc(F6,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,$6(e,Ac,i.data),Ac[0]*4294967296+Ac[1]+t}function Cs(e,t,r){let n=r-t;return n<=4294967295?ai(e,n+1)+t:j6(e,t,r,n)}var Kb=Symbol.for("fast-check/PreconditionFailure"),nr=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=Kb}static isFailure(e){return e!=null&&e.footprint===Kb}};function V6(e){if(!e)throw new nr}var B6=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},U6=new B6;function W6(){return U6}function*z6(e,t){for(let r of e)yield t(r)}function*G6(e,t){for(let r of e)yield*t(r)}function*H6(e,t){for(let r of e)t(r)&&(yield r)}function*q6(e,t){for(let r=0;r<t;++r){let n=e.next();if(n.done)break;yield n.value}}function*K6(e,t){let r=e.next();for(;!r.done&&t(r.value);)yield r.value,r=e.next()}function*Y6(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 J6=Symbol.iterator,j=class Lt{static nil(){return new Lt(W6())}static of(...t){return new Lt(t[J6]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Lt(z6(this.g,t))}flatMap(t){return new Lt(G6(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(K6(this.g,t))}take(t){return new Lt(q6(this.g,t))}filter(t){return new Lt(H6(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(Y6(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 Z6=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&&Z6(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 e4(this,e)}map(e,t){return new Q6(this,e,t)}chain(e){return new X6(this,e)}},X6=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}},Q6=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}},e4=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 Kw(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function Yw(e){if(!Kw(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Jw=Function.prototype.apply,Ic=Symbol("apply");function t4(e){try{return e.apply}catch{return}}function r4(e,t,r){let n=e;n[Ic]=Jw;let i=n[Ic](t,r);return delete n[Ic],i}function q(e,t,r){return t4(e)===Jw?e.apply(t,r):r4(e,t,r)}var Zw=Array,O=BigInt,n4=BigInt64Array,i4=BigUint64Array,Xw=Boolean,Bs=Date,L=Error,Qw=Float32Array,e1=Float64Array,o4=Int8Array,s4=Int16Array,a4=Int32Array,Dt=Number,Ve=String,rn=Set,l4=Uint8Array,u4=Uint8ClampedArray,c4=Uint16Array,d4=Uint32Array,f4=encodeURIComponent,_t=Map,Ls=Symbol,Yb=Array.prototype.forEach,Jb=Array.prototype.indexOf,Zb=Array.prototype.join,Xb=Array.prototype.map,Qb=Array.prototype.flat,eS=Array.prototype.filter,tS=Array.prototype.push,rS=Array.prototype.pop,nS=Array.prototype.splice,iS=Array.prototype.slice,oS=Array.prototype.sort,sS=Array.prototype.every;function p4(e){try{return e.forEach}catch{return}}function h4(e){try{return e.indexOf}catch{return}}function m4(e){try{return e.join}catch{return}}function g4(e){try{return e.map}catch{return}}function y4(e){try{return e.flat}catch{return}}function b4(e){try{return e.filter}catch{return}}function S4(e){try{return e.push}catch{return}}function w4(e){try{return e.pop}catch{return}}function v4(e){try{return e.splice}catch{return}}function x4(e){try{return e.slice}catch{return}}function R4(e){try{return e.sort}catch{return}}function k4(e){try{return e.every}catch{return}}function t1(e,t){return p4(e)===Yb?e.forEach(t):q(Yb,e,[t])}function $t(e,...t){return h4(e)===Jb?e.indexOf(...t):q(Jb,e,t)}function ce(e,...t){return m4(e)===Zb?e.join(...t):q(Zb,e,t)}function G(e,t){return g4(e)===Xb?e.map(t):q(Xb,e,[t])}function E4(e,t){return y4(e)===Qb?([].flat(),e.flat(t)):q(Qb,e,[t])}function C4(e,t){return b4(e)===eS?e.filter(t):q(eS,e,[t])}function $(e,...t){return S4(e)===tS?e.push(...t):q(tS,e,t)}function r1(e){return w4(e)===rS?e.pop():q(rS,e,[])}function n1(e,...t){return v4(e)===nS?e.splice(...t):q(nS,e,t)}function Le(e,...t){return x4(e)===iS?e.slice(...t):q(iS,e,t)}function i1(e,...t){return R4(e)===oS?e.sort(...t):q(oS,e,t)}function o1(e,...t){return k4(e)===sS?e.every(...t):q(sS,e,t)}var aS=Date.prototype.getTime,lS=Date.prototype.toISOString;function A4(e){try{return e.getTime}catch{return}}function I4(e){try{return e.toISOString}catch{return}}function Us(e){return A4(e)===aS?e.getTime():q(aS,e,[])}function P4(e){return I4(e)===lS?e.toISOString():q(lS,e,[])}var uS=Set.prototype.add,cS=Set.prototype.has;function T4(e){try{return e.add}catch{return}}function M4(e){try{return e.has}catch{return}}function fi(e,t){return T4(e)===uS?e.add(t):q(uS,e,[t])}function Ws(e,t){return M4(e)===cS?e.has(t):q(cS,e,[t])}var dS=WeakMap.prototype.set,fS=WeakMap.prototype.get;function O4(e){try{return e.set}catch{return}}function N4(e){try{return e.get}catch{return}}function L4(e,t,r){return O4(e)===dS?e.set(t,r):q(dS,e,[t,r])}function $4(e,t){return N4(e)===fS?e.get(t):q(fS,e,[t])}var pS=Map.prototype.set,hS=Map.prototype.get,mS=Map.prototype.has;function D4(e){try{return e.set}catch{return}}function _4(e){try{return e.get}catch{return}}function F4(e){try{return e.has}catch{return}}function ct(e,t,r){return D4(e)===pS?e.set(t,r):q(pS,e,[t,r])}function Je(e,t){return _4(e)===hS?e.get(t):q(hS,e,[t])}function j4(e,t){return F4(e)===mS?e.has(t):q(mS,e,[t])}var gS=String.prototype.split,yS=String.prototype.startsWith,bS=String.prototype.endsWith,SS=String.prototype.substring,wS=String.prototype.toLowerCase,vS=String.prototype.toUpperCase,xS=String.prototype.padStart,RS=String.prototype.charCodeAt,kS=String.prototype.normalize,ES=String.prototype.replace;function V4(e){try{return e.split}catch{return}}function B4(e){try{return e.startsWith}catch{return}}function U4(e){try{return e.endsWith}catch{return}}function W4(e){try{return e.substring}catch{return}}function z4(e){try{return e.toLowerCase}catch{return}}function G4(e){try{return e.toUpperCase}catch{return}}function H4(e){try{return e.padStart}catch{return}}function q4(e){try{return e.charCodeAt}catch{return}}function K4(e){try{return e.normalize}catch{return}}function Y4(e){try{return e.replace}catch{return}}function Be(e,...t){return V4(e)===gS?e.split(...t):q(gS,e,t)}function J4(e,...t){return B4(e)===yS?e.startsWith(...t):q(yS,e,t)}function Z4(e,...t){return U4(e)===bS?e.endsWith(...t):q(bS,e,t)}function ge(e,...t){return W4(e)===SS?e.substring(...t):q(SS,e,t)}function Qc(e){return z4(e)===wS?e.toLowerCase():q(wS,e,[])}function Ed(e){return G4(e)===vS?e.toUpperCase():q(vS,e,[])}function X4(e,...t){return H4(e)===xS?e.padStart(...t):q(xS,e,t)}function nn(e,t){return q4(e)===RS?e.charCodeAt(t):q(RS,e,[t])}function Q4(e,t){return K4(e)===kS?e.normalize(t):q(kS,e,[t])}function eN(e,t,r){return Y4(e)===ES?e.replace(t,r):q(ES,e,[t,r])}var CS=Number.prototype.toString;function tN(e){try{return e.toString}catch{return}}function pi(e,...t){return tN(e)===CS?e.toString(...t):q(CS,e,t)}var rN=Object.prototype.hasOwnProperty,nN=Object.prototype.toString;function s1(e,t){return q(rN,e,[t])}function ed(e){return q(nN,e,[])}var iN=Error.prototype.toString;function oN(e){return q(iN,e,[])}var sN=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 sN(e)}var a1=Array.isArray,aN=Object.defineProperty;function l1(e,t){return aN(e,Oe,{value:()=>{let r=[];for(let n=0;n!==t.length;++n)$(r,t[n].value);return l1(r,t),r}})}function u1(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&&l1(r,e),new _(r,n)}function c1(e,t,r){let n=[],i=a1(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(u1)));return j.nil().join(...n)}var lN=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 u1(r)}canShrinkWithoutContext(e){if(!a1(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 c1(this.arbs,e,t)}};function B(...e){return new lN(e)}var uN=Math.log;function d1(e){return 2+~~(uN(e+1)*.4342944819032518)}var Cd={};function cN(e){Cd=e}function dt(){return Cd}function dN(){Cd={}}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 AS=()=>{},fN=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||AS,this.afterEachHook=n||o||AS}isAsync(){return!0}generate(e,t){return on(this.arb.generate(e,t!==void 0?d1(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}},f1=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 pN(...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 t1(t,Yw),new fN(B(...G(t,n=>new f1(n))),n=>r(...n))}var IS=()=>{},p1=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:r=IS,afterEach:n=IS,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?d1(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 hN(...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 t1(t,Yw),new p1(B(...G(t,n=>new f1(n))),n=>r(...n))}var mN=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function td(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>td(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>td(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function h1(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>h1(e),next:()=>e.next(),jump:()=>Wb(e,42),getState:()=>e.getState()}}function qs(e){return h1(td(e))}var gN=Date.now,yN=Math.min,bN=Math.random,SN=class{constructor(e){let t=e||{};this.seed=wN(t),this.randomType=vN(t),this.numRuns=xN(t),this.verbose=RN(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=Tc(t.timeout),this.skipAllAfterTimeLimit=Tc(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=Tc(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 Pc(e){return t=>qs(e(t))}function wN(e){if(e.seed===void 0)return gN()^bN()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function vN(e){if(e.randomType===void 0)return Ec;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return Pc(jb);case"congruential":case"congruential32":return Pc(Db);case"xorshift128plus":return Ec;case"xoroshiro128plus":return Ub;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:Pc(e.randomType)}function xN(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function RN(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 Tc(e){if(e!==void 0)return yN(e,2147483647)}function Ad(e){return new SN(e)}function kN(e,t,r){let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i(new nr(!0))},e)})}}var PS=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=kN(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()}},EN=(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)})}},CN=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=EN(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())}},m1=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()}},TS=Array.from,MS=typeof Buffer<"u"?Buffer.isBuffer:void 0,Zr=JSON.stringify,OS=Number.isNaN,AN=Object.keys,IN=Object.getOwnPropertySymbols,PN=Object.getOwnPropertyDescriptor,NS=Object.getPrototypeOf,LS=Number.NEGATIVE_INFINITY,TN=Number.POSITIVE_INFINITY,ft=Symbol.for("fast-check/toStringMethod");function Id(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 Pd(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Ft in e&&typeof e[Ft]=="function"}var MN=/^Symbol\((.*)\)$/;function ON(e){if(e.description!==void 0)return e.description;let t=MN.exec(Ve(e));return t&&t[1].length?t[1]:null}function $S(e){switch(e){case 0:return 1/e===LS?"-0":"0";case LS:return"Number.NEGATIVE_INFINITY";case TN:return"Number.POSITIVE_INFINITY";default:return e===e?Ve(e):"Number.NaN"}}function NN(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(Pd(e)){let i=r(e);if(i.state==="fulfilled")return i.value}if(Id(e))try{return e[ft]()}catch{}switch(ed(e)){case"[object Array]":{let i=e;if(i.length>=50&&NN(i)){let s=[];for(let a in i)OS(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 OS(Us(i))?"new Date(NaN)":`new Date(${Zr(P4(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"?$S(e):`new Number(${$S(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([...NS(e)===null?["__proto__:null"]:[],...G(AN(e),i),...G(C4(IN(e),o=>{let s=PN(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=ON(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 MS=="function"&&MS(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":Ye(TS(e.values()),n,r)})`;let i=NS(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(TS(s.values()),n,r)})`}break}}try{return e.toString()}catch{return ed(e)}}function xe(e){return Ye(e,[],()=>({state:"unknown",value:void 0}))}function g1(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 Td(e){return Promise.resolve(g1(e))}function DS(e){return e===null?new nr:e}function LN(...e){return e[1]?e[0].then(DS):DS(e[0])}function $N(e,t){return LN(e,t)}var _S=class{constructor(e,t){this.property=e,this.skipRuns=t,this.coveredCases=new Map}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}run(e){let t=xe(e);if(this.coveredCases.has(t)){let n=this.coveredCases.get(t);return this.skipRuns?$N(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()}},FS=Date.now,Mc=setTimeout,Oc=clearTimeout;function DN(e,t){let r=e;return e.isAsync()&&t.timeout!==void 0&&(r=new CN(r,t.timeout,Mc,Oc)),t.unbiased&&(r=new m1(r)),t.skipAllAfterTimeLimit!==void 0&&(r=new PS(r,FS,t.skipAllAfterTimeLimit,!1,Mc,Oc)),t.interruptAfterTimeLimit!==void 0&&(r=new PS(r,FS,t.interruptAfterTimeLimit,!0,Mc,Oc)),t.skipEqualValues&&(r=new _S(r,!0)),t.ignoreEqualValues&&(r=new _S(r,!1)),r}var _N=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),FN=class y1{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:y1.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()}}},b1=class{constructor(e,t,r,n){this.sourceValues=e,this.shrink=t,this.runExecution=new FN(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_)}},jN=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}},VN=-2147483648,BN=2147483647,UN=Math.pow(2,27),WN=Math.pow(2,-53),Md=class S1{constructor(t){this.internalRng=qs(t.clone())}clone(){return new S1(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?VN:t,r===void 0?BN:r)}nextBigInt(t,r){return Hb(this.internalRng,t,r)}nextDouble(){let t=this.next(26),r=this.next(27);return(t*UN+r)*WN}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function zN(e,t,r){return t.jump(),e.generate(new Md(t),r)}function*w1(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 zN(e,o,i)}function GN(e,t,r){return()=>e.generate(new Md(t),r)}function*v1(e,t,r,n){yield*G(n,s=>()=>new _(s,void 0));let i=0,o=qs(r(t));for(;;)o.jump(),yield GN(e,o,i++)}function jS(e){return e()}function x1(e,t,r){let n=t,i=e.split(":").map(s=>+s);if(i.length===0)return n.map(jS);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=n.drop(i[0]).map(jS);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 HN=Object.assign;function qN(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,r)=>`Hint (${r+1}): ${t}`).join(`
100
+ `)}function KN(e,t){return`Encountered failures were:
101
101
  - ${e.map(t).join(`
102
- - `)}`}function Md(e,t){let r=[],n=[];for(let i=e.length-1;i>=0;--i)n.push({depth:1,tree:e[i]});for(;n.length!==0;){let i=n.pop(),o=i.tree,s=i.depth,a=o.status===0?"\x1B[32m\u221A\x1B[0m":o.status===1?"\x1B[31m\xD7\x1B[0m":"\x1B[33m!\x1B[0m",l=s!==0?". ".repeat(s-1):"";r.push(`${l}${a} ${t(o.value)}`);for(let u=o.children.length-1;u>=0;--u)n.push({depth:s+1,tree:o.children[u]})}return`Execution summary:
102
+ - `)}`}function Od(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 JN(e,t){let r=`Failed to run property, too many pre-condition failures encountered
104
+ `)}`}function YN(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=Md(e.executionSummary,t):$(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:r,details:n,hints:i}}function ZN(e){if(e instanceof L&&e.stack!==void 0)return e.stack;try{return Ve(e)}catch{}if(e instanceof L)try{return sN(e)}catch{}if(e!==null&&typeof e=="object")try{return Qc(e)}catch{}return"Failed to serialize errorInstance"}function XN(e,t){let r=e.runConfiguration.includeErrorInReport?`
109
- Got ${tN(ZN(e.errorInstance),/^Error: /,"error: ")}`:"",n=`Property failed after ${e.numRuns} tests
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=Od(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 JN(e){if(e instanceof L&&e.stack!==void 0)return e.stack;try{return Ve(e)}catch{}if(e instanceof L)try{return oN(e)}catch{}if(e!==null&&typeof e=="object")try{return ed(e)}catch{}return"Failed to serialize errorInstance"}function ZN(e,t){let r=e.runConfiguration.includeErrorInReport?`
109
+ Got ${eN(JN(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=Md(e.executionSummary,t):e.verbose===1?i=YN(e.failures,t):$(o,"Enable verbose mode in order to have the list of all failing values encountered during the run"),{message:n,details:i,hints:o}}function QN(e,t){let r=`Property interrupted after ${e.numRuns} tests
113
- { seed: ${e.seed} }`,n=null,i=[];return e.verbose>=2?n=Md(e.executionSummary,t):$(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:r,details:n,hints:i}}function td(e,t){if(!e.failed)return;let{message:r,details:n,hints:i}=e.counterexamplePath===null?e.interrupted?QN(e,t):JN(e,t):XN(e,t),o=r;return n!==null&&(o+=`
112
+ Shrunk ${e.numShrinks} time(s)${r}`,i=null,o=[];return e.verbose>=2?i=Od(e.executionSummary,t):e.verbose===1?i=KN(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 XN(e,t){let r=`Property interrupted after ${e.numRuns} tests
113
+ { seed: ${e.seed} }`,n=null,i=[];return e.verbose>=2?n=Od(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 rd(e,t){if(!e.failed)return;let{message:r,details:n,hints:i}=e.counterexamplePath===null?e.interrupted?XN(e,t):YN(e,t):ZN(e,t),o=r;return n!==null&&(o+=`
114
114
 
115
115
  ${n}`),i.length>0&&(o+=`
116
116
 
117
- ${KN(i)}`),o}function v1(e){return td(e,xe)}async function x1(e){let t=[];function r(s){let a=h1(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let n=td(e,r);if(t.length===0)return n;let i=new _t(await Promise.all(t));function o(s){let a=Je(i,s);return a!==void 0?a:xe(s)}return td(e,o)}function R1(e,t){if(t.runConfiguration.includeErrorInReport)throw new L(e);let r=new L(e,{cause:t.errorInstance});return"cause"in r||qN(r,{cause:t.errorInstance}),r}function e3(e){if(e.failed)throw R1(v1(e),e)}async function t3(e){if(e.failed)throw R1(await x1(e),e)}function r3(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):e3(e)}async function n3(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):t3(e)}function i3(e,t,r,n,i){let o=new g1(r,t,n,i);for(let s of o){e.runBeforeEach();let a=e.run(s);e.runAfterEach(),o.handleResult(a)}return o.runExecution}async function o3(e,t,r,n,i){let o=new g1(r,t,n,i);for(let s of o){await e.runBeforeEach();let a=await e.run(s);await e.runAfterEach(),o.handleResult(a)}return o.runExecution}function k1(e,t){if(e==null||e.generate===null||e.generate===void 0)throw new Error("Invalid property encountered, please use a valid property");if(e.run===null||e.run===void 0)throw new Error("Invalid property encountered, please use a valid property not an arbitrary");let r=Cd({...dt(),...t});if(r.reporter!==void 0&&r.asyncReporter!==void 0)throw new Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(r.asyncReporter!==void 0&&!e.isAsync())throw new Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let n=_N(e,r),i=r.path.length===0||r.path.indexOf(":")===-1?r.numRuns:-1,o=r.numRuns*r.maxSkipsPerRun,s=(...u)=>n.shrink(...u),a=new VN(r.path.length===0?b1(n,r.seed,r.randomType,r.examples):w1(r.path,tr(S1(n,r.seed,r.randomType,r.examples)),s),i,o),l=r.endOnFailure?j.nil:s;return n.isAsync()?o3(n,l,a,r.verbose,r.markInterruptAsFailure).then(u=>u.toRunDetails(r.seed,r.path,o,r)):i3(n,l,a,r.verbose,r.markInterruptAsFailure).toRunDetails(r.seed,r.path,o,r)}function s3(e,t){let r=k1(e,t);if(e.isAsync())return r.then(n3);r3(r)}function a3(e,t){let r=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new d1(e,()=>!0);return t.unbiased===!0?new p1(r):r}function E1(e,t){let r=Cd(typeof t=="number"?{...dt(),numRuns:t}:{...dt(),...t}),n=a3(e,r),i=n.shrink.bind(n);return(r.path.length===0?tr(b1(n,r.seed,r.randomType,r.examples)):w1(r.path,tr(S1(n,r.seed,r.randomType,r.examples)),i)).take(r.numRuns).map(o=>o.value_)}function l3(e,t){return[...E1(e,t)]}function u3(e){return(Math.round(e*100)/100).toFixed(2)}function c3(e,t,r){let n=Cd(typeof r=="number"?{...dt(),numRuns:r}:{...dt(),...r}),i={};for(let l of E1(e,r)){let u=t(l),c=Array.isArray(u)?u:[u];for(let d of c)i[d]=(i[d]||0)+1}let o=Object.entries(i).sort((l,u)=>u[1]-l[1]).map(l=>[l[0],`${u3(l[1]*100/n.numRuns)}%`]),s=o.map(l=>l[0].length).reduce((l,u)=>Math.max(l,u),0),a=o.map(l=>l[1].length).reduce((l,u)=>Math.max(l,u),0);for(let l of o)n.logger(`${l[0].padEnd(s,".")}..${l[1].padStart(a,".")}`)}var d3=Object.assign;function rd(e,t,r,n){let i=r(),o=e.clone(),s={mrng:e.clone(),biasFactor:t,history:[]},a=u=>{let c=i[s.history.length];if(c!==void 0&&c.arb===u){let p=c.value;return $(s.history,{arb:u,value:p,context:c.context,mrng:c.mrng}),o=c.mrng.clone(),p}let d=u.generate(o,t);return $(s.history,{arb:u,value:d.value_,context:d.context,mrng:o.clone()}),d.value},l=(u,...c)=>a(n(u,c));return new _(d3(l,{values(){return G(s.history,u=>u.value)},[Oe](){return rd(e,t,r,n).value},[ft](){return xe(G(s.history,u=>u.value))}}),s)}var Oc=Array.isArray,FS=Object.keys,f3=Object.is;function p3(e){let t=new _t;return function(n,i){let o=Je(t,n);if(o===void 0){let l=n(...i);return ct(t,n,[{args:i,value:l}]),l}let s=o;for(let l of s)if(e(i,l.args))return l.value;let a=n(...i);return $(s,{args:i,value:a}),a}}function C1(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if(Oc(e)){if(!Oc(t)||e.length!==t.length)return!1}else if(Oc(t))return!1;if(FS(e).length!==FS(t).length)return!1;for(let r in e)if(!(r in t)||!C1(e[r],t[r]))return!1;return!0}else return f3(e,t)}var h3=class extends de{constructor(...e){super(...e),this.arbitraryCache=p3(C1)}generate(e,t){return rd(e,t,()=>[],this.arbitraryCache)}canShrinkWithoutContext(e){return!1}shrink(e,t){if(t===void 0)return j.nil();let r=t,n=r.mrng,i=r.biasFactor,o=r.history;return l1(o.map(s=>s.arb),o.map(s=>s.value),o.map(s=>s.context)).map(s=>{function a(){let l=s.value,u=s.context;return G(o,(c,d)=>({arb:c.arb,value:l[d],context:u[d],mrng:c.mrng}))}return rd(n,i,a,this.arbitraryCache)})}};function m3(){return new h3}var g3=Math.floor,jS=Math.log;function y3(e){return g3(jS(e)/jS(2))}function b3(e){return e===O(0)?O(0):O(Ve(e).length)}function A1(e,t,r){if(e===t)return[{min:e,max:t}];if(e<0&&t>0){let s=r(-e),a=r(t);return[{min:-s,max:a},{min:t-a,max:t},{min:e,max:e+s}]}let n=r(t-e),i={min:e,max:e+n},o={min:t-n,max:t};return e<0?[o,i]:[i,o]}var S3=Math.ceil,w3=Math.floor;function VS(e){return w3(e/2)}function BS(e){return S3(e/2)}function US(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:VS(n);for(let l=a;l>0;l=VS(l)){let u=l===n?t:e-l;yield new _(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:BS(n);for(let l=a;l<0;l=BS(l)){let u=l===n?t:e-l;yield new _(u,s),s=u}}return n>0?tr(i()):tr(o())}var WS=Math.sign,v3=Number.isInteger,x3=Object.is,sn=class I1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new _(t.nextInt(n.min,n.max),void 0)}canShrinkWithoutContext(t){return typeof t=="number"&&v3(t)&&!x3(t,-0)&&this.min<=t&&t<=this.max}shrink(t,r){return I1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new _(r,void 0)):US(t,r,!1):US(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?0:this.min<0?this.max:this.min}computeGenerateRange(t,r){if(r===void 0||t.nextInt(1,r)!==1)return{min:this.min,max:this.max};let n=A1(this.min,this.max,y3);if(n.length===1)return n[0];let i=t.nextInt(-2*(n.length-1),n.length-2);return i<0?n[0]:n[i+1]}isLastChanceTry(t,r){return t>0?t===r+1&&t>this.min:t<0?t===r-1&&t<this.max:!1}static isValidContext(t,r){if(r===void 0)return!1;if(typeof r!="number")throw new Error("Invalid context type passed to IntegerArbitrary (#1)");if(r!==0&&WS(t)!==WS(r))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},zS=Number.isInteger;function R3(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function oe(e={}){let t=R3(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!zS(t.min))throw new Error("fc.integer minimum value should be an integer");if(!zS(t.max))throw new Error("fc.integer maximum value should be an integer");return new sn(t.min,t.max)}var GS=new Map;function Od(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=Je(GS,e);if(t!==void 0)return t;let r={depth:0};return ct(GS,e,r),r}function Nd(){return{depth:0}}var k3=class{constructor(e,t,r){this.arb=e,this.mrng=t,this.biasFactor=r}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},E3=Math.min,C3=Math.max,A3=class{constructor(e,t,r,n){this.arb=e,this.mrng=t,this.slices=r,this.biasFactor=n,this.activeSliceIndex=0,this.nextIndexInSlice=0,this.lastIndexInSlice=-1}attemptExact(e){if(e!==0&&this.mrng.nextInt(1,this.biasFactor)===1){let t=[];for(let r=0;r!==this.slices.length;++r)this.slices[r].length===e&&$(t,r);if(t.length===0)return;this.activeSliceIndex=t[this.mrng.nextInt(0,t.length-1)],this.nextIndexInSlice=0,this.lastIndexInSlice=e-1}}next(){if(this.nextIndexInSlice<=this.lastIndexInSlice)return new _(this.slices[this.activeSliceIndex][this.nextIndexInSlice++],void 0);if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.arb.generate(this.mrng,this.biasFactor);this.activeSliceIndex=this.mrng.nextInt(0,this.slices.length-1);let e=this.slices[this.activeSliceIndex];if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.nextIndexInSlice=1,this.lastIndexInSlice=e.length-1,new _(e[0],void 0);let t=this.mrng.nextInt(0,e.length-1),r=this.mrng.nextInt(0,e.length-1);return this.nextIndexInSlice=E3(t,r),this.lastIndexInSlice=C3(t,r),new _(e[this.nextIndexInSlice++],void 0)}};function HS(e,t,r,n){return n===void 0||r.length===0||t.nextInt(1,n)!==1?new k3(e,t,n):new A3(e,t,r,n)}var I3=Math.floor,qS=Math.log,KS=Math.max,P3=Array.isArray;function Nc(e,t){return e===t?e:e+I3(qS(t-e)/qS(2))}var P1=class T1 extends de{constructor(t,r,n,i,o,s,a){super(),this.arb=t,this.minLength=r,this.maxGeneratedLength=n,this.maxLength=i,this.setBuilder=s,this.customSlices=a,this.lengthArb=oe({min:r,max:n}),this.depthContext=Od(o)}preFilter(t){if(this.setBuilder===void 0)return t;let r=this.setBuilder();for(let n=0;n!==t.length;++n)r.tryAdd(t[n]);return r.getData()}static makeItCloneable(t,r){return t[Oe]=()=>{let n=[];for(let i=0;i!==r.length;++i)$(n,r[i].value);return this.makeItCloneable(n,r),n},t}generateNItemsNoDuplicates(t,r,n,i){let o=0,s=t(),a=HS(this.arb,n,this.customSlices,i);for(;s.size()<r&&o<this.maxGeneratedLength;){let l=a.next();s.tryAdd(l)?o=0:o+=1}return s.getData()}safeGenerateNItemsNoDuplicates(t,r,n,i){let o=KS(0,r-Nc(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=o;try{return this.generateNItemsNoDuplicates(t,r,n,i)}finally{this.depthContext.depth-=o}}generateNItems(t,r,n){let i=[],o=HS(this.arb,r,this.customSlices,n);o.attemptExact(t);for(let s=0;s!==t;++s)$(i,o.next());return i}safeGenerateNItems(t,r,n){let i=KS(0,t-Nc(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=i;try{return this.generateNItems(t,r,n)}finally{this.depthContext.depth-=i}}wrapper(t,r,n,i){let o=r?this.preFilter(t):t,s=!1,a=[],l=[];for(let u=0;u!==o.length;++u){let c=o[u];s=s||c.hasToBeCloned,$(a,c.value),$(l,c.context)}return s&&T1.makeItCloneable(a,o),new _(a,{shrunkOnce:r,lengthContext:t.length===o.length&&n!==void 0?n:void 0,itemsContexts:l,startIndex:i})}generate(t,r){let n=this.applyBias(t,r),i=n.size,o=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,i,t,n.biasFactorItems):this.safeGenerateNItems(i,t,n.biasFactorItems);return this.wrapper(o,!1,void 0,0)}applyBias(t,r){if(r===void 0)return{size:this.lengthArb.generate(t,void 0).value};if(this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:r};if(t.nextInt(1,r)!==1)return{size:this.lengthArb.generate(t,void 0).value};if(t.nextInt(1,r)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:r};let n=Nc(this.minLength,this.maxGeneratedLength);return{size:oe({min:this.minLength,max:n}).generate(t,void 0).value,biasFactorItems:r}}canShrinkWithoutContext(t){if(!P3(t)||this.minLength>t.length||t.length>this.maxLength)return!1;for(let r=0;r!==t.length;++r)if(!(r in t)||!this.arb.canShrinkWithoutContext(t[r]))return!1;return this.preFilter(G(t,r=>new _(r,void 0))).length===t.length}shrinkItemByItem(t,r,n){let i=[];for(let o=r.startIndex;o<n;++o)$(i,er(()=>this.arb.shrink(t[o],r.itemsContexts[o]).map(s=>{let a=G(Le(t,0,o),(u,c)=>new _(tn(u),r.itemsContexts[c])),l=G(Le(t,o+1),(u,c)=>new _(tn(u),r.itemsContexts[c+o+1]));return[[...a,s,...l],void 0,o]})));return j.nil().join(...i)}shrinkImpl(t,r){if(t.length===0)return j.nil();let n=r!==void 0?r:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(t.length,n.lengthContext).drop(n.shrunkOnce&&n.lengthContext===void 0&&t.length>this.minLength+1?1:0).map(i=>{let o=t.length-i.value;return[G(Le(t,o),(s,a)=>new _(tn(s),n.itemsContexts[a+o])),i.context,0]}).join(er(()=>t.length>this.minLength?this.shrinkItemByItem(t,n,1):this.shrinkItemByItem(t,n,t.length))).join(t.length>this.minLength?er(()=>{let i={shrunkOnce:!1,lengthContext:void 0,itemsContexts:Le(n.itemsContexts,1),startIndex:0};return this.shrinkImpl(Le(t,1),i).filter(o=>this.minLength<=o[0].length+1).map(o=>[[new _(tn(t[0]),n.itemsContexts[0]),...o[0]],void 0,0])}):j.nil())}shrink(t,r){return this.shrinkImpl(t,r).map(n=>this.wrapper(n[0],!0,n[1],n[2]))}},T3=Math.floor,M3=Math.min,xr=2147483647,Xr=["xsmall","small","medium","large","xlarge"],O3=["-4","-3","-2","-1","=","+1","+2","+3","+4"],Ld="small";function N3(e,t){switch(t){case"xsmall":return T3(1.1*e)+1;case"small":return 2*e+10;case"medium":return 11*e+100;case"large":return 101*e+1e3;case"xlarge":return 1001*e+1e4;default:throw new Error(`Unable to compute lengths based on received size: ${t}`)}}function yi(e,t){let r=$t(O3,e);if(r===-1)return e;let n=$t(Xr,t);if(n===-1)throw new Error(`Unable to offset size based on the unknown defaulted one: ${t}`);let i=n+r-4;return i<0?Xr[0]:i>=Xr.length?Xr[Xr.length-1]:Xr[i]}function mi(e,t,r,n){let{baseSize:i=Ld,defaultSizeToMaxWhenMaxSpecified:o}=dt()||{},s=e!==void 0?e:n&&o?"max":i;return s==="max"?r:M3(N3(t,yi(s,i)),r)}function L3(e,t){if(typeof e=="number")return 1/e;let{baseSize:r=Ld,defaultSizeToMaxWhenMaxSpecified:n}=dt()||{},i=e!==void 0?e:t&&n?"max":r;if(i==="max")return 0;switch(yi(i,r)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function $d(e){let{baseSize:t=Ld}=dt()||{};return e===void 0?t:yi(e,t)}function ae(e,t={}){let r=t.size,n=t.minLength||0,i=t.maxLength,o=t.depthIdentifier,s=i!==void 0?i:xr;return new P1(e,n,mi(r,n,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function As(e){return e/O(2)}function YS(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:As(n);for(let l=a;l>0;l=As(l)){let u=e-l;yield new _(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:As(n);for(let l=a;l<0;l=As(l)){let u=e-l;yield new _(u,s),s=u}}return n>0?tr(i()):tr(o())}var $3=class M1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new _(t.nextBigInt(n.min,n.max),void 0)}computeGenerateRange(t,r){if(r===void 0||t.nextInt(1,r)!==1)return{min:this.min,max:this.max};let n=A1(this.min,this.max,b3);if(n.length===1)return n[0];let i=t.nextInt(-2*(n.length-1),n.length-2);return i<0?n[0]:n[i+1]}canShrinkWithoutContext(t){return typeof t=="bigint"&&this.min<=t&&t<=this.max}shrink(t,r){return M1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new _(r,void 0)):YS(t,r,!1):YS(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?O(0):this.min<0?this.max:this.min}isLastChanceTry(t,r){return t>0?t===r+O(1)&&t>this.min:t<0?t===r-O(1)&&t<this.max:!1}static isValidContext(t,r){if(r===void 0)return!1;if(typeof r!="bigint")throw new Error("Invalid context type passed to BigIntArbitrary (#1)");let n=t>0&&r<0||t<0&&r>0;if(r!==O(0)&&n)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function D3(e){let r=O(-1)<<O(255),n=(O(1)<<O(255))-O(1),i=e.min,o=e.max;return{min:i!==void 0?i:r-(o!==void 0&&o<O(0)?o*o:O(0)),max:o!==void 0?o:n+(i!==void 0&&i>O(0)?i*i:O(0))}}function _3(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function rr(...e){let t=D3(_3(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new $3(t.min,t.max)}var F3=Object.getPrototypeOf,li=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return this.arb.generate(e,void 0)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return this.arb.shrink(e,t)}};function zs(e){return F3(e)===li.prototype&&e.generate===li.prototype.generate&&e.canShrinkWithoutContext===li.prototype.canShrinkWithoutContext&&e.shrink===li.prototype.shrink?e:new li(e)}function j3(e){return e===1}function V3(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function bi(){return zs(oe({min:0,max:1}).map(j3,V3))}var di=Object.is,B3=class{constructor(e){this.values=e,this.fastValues=new rn(this.values);let t=!1,r=!1;if(Ws(this.fastValues,0))for(let n=0;n!==this.values.length;++n){let i=this.values[n];t=t||di(i,-0),r=r||di(i,0)}this.hasMinusZero=t,this.hasPlusZero=r}has(e){return e===0?di(e,0)?this.hasPlusZero:this.hasMinusZero:Ws(this.fastValues,e)}},O1=class extends de{constructor(e){super(),this.values=e}generate(e,t){let r=this.values.length===1?0:e.nextInt(0,this.values.length-1),n=this.values[r];return vr(n)?new _(n,r,()=>n[Oe]()):new _(n,r)}canShrinkWithoutContext(e){return this.values.length===1?di(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new B3(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||di(e,this.values[0])?j.nil():j.of(new _(this.values[0],0))}};function vt(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new O1(e)}function U3(e){return!e||!e.withBigInt?vt(!1,null,void 0,0,"",NaN):vt(!1,null,void 0,0,"",NaN,O(0))}function ve(e){return new O1([e])}var W3=class N1{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Oe](){return new N1}};function z3(){return ve(new W3)}var G3=NaN,H3=Number.isNaN;function L1(e){return new Bs(e)}function $1(e){if(!(e instanceof Bs)||e.constructor!==Bs)throw new L("Not a valid value for date unmapper");return Us(e)}function q3(e){return t=>t===e?new Bs(G3):L1(t)}function K3(e){return t=>{let r=$1(t);return H3(r)?e:r}}var JS=Number.isNaN;function D1(e={}){let t=e.min!==void 0?Us(e.min):-864e13,r=e.max!==void 0?Us(e.max):864e13,n=e.noInvalidDate;if(JS(t))throw new Error("fc.date min must be valid instance of Date");if(JS(r))throw new Error("fc.date max must be valid instance of Date");if(t>r)throw new Error("fc.date max must be greater or equal to min");if(n)return oe({min:t,max:r}).map(L1,$1);let i=r+1;return oe({min:t,max:r+1}).map(q3(i),K3(i))}var Y3=class extends de{constructor(e,t){super(),this.startArb=e,this.chainer=t}generate(e,t){let r=[],n=e.clone(),i=this.startArb.generate(e,t);for(r.push({arbitrary:this.startArb,value:i.value_,context:i.context,clonedMrng:n});;){let s=this.chainer(i.value_);if(s===void 0)break;let a=e.clone();i=s.generate(e,t),r.push({arbitrary:s,value:i.value_,context:i.context,clonedMrng:a})}let o={biasFactor:t,entries:r,currentShrinkLevel:0};return new _(i.value_,o)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?new j(this.shrinkIterator(t)):j.nil()}*shrinkIterator(e){let{entries:t,currentShrinkLevel:r,biasFactor:n}=e;for(let i=r;i<t.length;++i){let o=t[i],s=o.arbitrary.shrink(o.value,o.context);for(let a of s){let l=t.slice(0,i);l.push({arbitrary:o.arbitrary,value:a.value_,context:a.context,clonedMrng:o.clonedMrng});let u=a,c=o.clonedMrng.clone();for(;;){let h=this.chainer(u.value_);if(h===void 0)break;let f=c.clone(),m=h.generate(c,n);l.push({arbitrary:h,value:m.value_,context:m.context,clonedMrng:f}),u=m}let d=l[l.length-1],p={biasFactor:n,entries:l,currentShrinkLevel:i};yield new _(d.value,p)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function J3(e,t){return new Y3(e,t)}var Z3=Symbol.iterator,X3=Array.isArray,Q3=Object.is,eL=class _1 extends de{constructor(t,r){super(),this.arb=t,this.numValues=r}generate(t,r){let n=[];if(this.numValues<=0)return this.wrapper(n);for(let i=0;i!==this.numValues-1;++i)$(n,this.arb.generate(t.clone(),r));return $(n,this.arb.generate(t,r)),this.wrapper(n)}canShrinkWithoutContext(t){if(!X3(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let r=1;r<t.length;++r)if(!Q3(t[0],t[r]))return!1;return this.arb.canShrinkWithoutContext(t[0])}shrink(t,r){return t.length===0?j.nil():new j(this.shrinkImpl(t,r!==void 0?r:[])).map(n=>this.wrapper(n))}*shrinkImpl(t,r){let n=G(t,(o,s)=>this.arb.shrink(o,r[s])[Z3]()),i=G(n,o=>o.next());for(;!i[0].done;)yield G(i,o=>o.value),i=G(n,o=>o.next())}static makeItCloneable(t,r){return t[Oe]=()=>{let n=[];for(let i=0;i!==r.length;++i)$(n,r[i].value);return this.makeItCloneable(n,r),n},t}wrapper(t){let r=!1,n=[],i=[];for(let o=0;o!==t.length;++o){let s=t[o];r=r||s.hasToBeCloned,$(n,s.value),$(i,s.context)}return r&&_1.makeItCloneable(n,t),new _(n,i)}};function tL(e,t){return new eL(e,t)}var ZS=class{constructor(e){this.isEqual=e,this.data=[]}tryAdd(e){for(let t=0;t!==this.data.length;++t)if(this.isEqual(this.data[t],e))return!1;return $(this.data,e),!0}size(){return this.data.length}getData(){return this.data}},rL=Number.isNaN,nL=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new rn,this.data=[]}tryAdd(e){let t=this.selector(e);if(rL(t))return $(this.data,e),!0;let r=this.selectedItemsExceptNaN.size;return fi(this.selectedItemsExceptNaN,t),r!==this.selectedItemsExceptNaN.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},iL=Object.is,oL=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new rn,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(iL(t,-0))return this.hasMinusZero?!1:($(this.data,e),this.hasMinusZero=!0,!0);let r=this.selectedItemsExceptMinusZero.size;return fi(this.selectedItemsExceptMinusZero,t),r!==this.selectedItemsExceptMinusZero.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},sL=class{constructor(e){this.selector=e,this.selectedItems=new rn,this.data=[]}tryAdd(e){let t=this.selector(e),r=this.selectedItems.size;return fi(this.selectedItems,t),r!==this.selectedItems.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function aL(e){if(typeof e.comparator=="function"){if(e.selector===void 0){let a=e.comparator,l=(u,c)=>a(u.value_,c.value_);return()=>new ZS(l)}let n=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>n(o(a),o(l));return()=>new ZS(s)}let t=e.selector||(n=>n),r=n=>t(n.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new nL(r);case"SameValueZero":return()=>new sL(r);case"SameValue":case void 0:return()=>new oL(r)}}function Rr(e,t={}){let r=t.minLength!==void 0?t.minLength:0,n=t.maxLength!==void 0?t.maxLength:xr,i=mi(t.size,r,n,t.maxLength!==void 0),o=t.depthIdentifier,s=new P1(e,r,i,n,o,aL(t),[]);return r===0?s:s.filter(a=>a.length>=r)}var lL=Object.create,uL=Object.defineProperty,cL=Object.getOwnPropertyDescriptor,XS=Object.getPrototypeOf,dL=Object.prototype,fL=Reflect.ownKeys;function pL(e){let t=e[1]?lL(null):{};for(let r of e[0])uL(t,r[0],{enumerable:!0,configurable:!0,writable:!0,value:r[1]});return t}function hL(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function mL(e){if(typeof e!="object"||e===null)throw new L("Incompatible instance received: should be a non-null object");let t=XS(e)===null,r=XS(e)===dL;if(!t&&!r)throw new L("Incompatible instance received: should be of exact type Object");let n=G(fL(e),i=>[i,cL(e,i)]);if(!n1(n,([,i])=>hL(i)))throw new L("Incompatible instance received: should contain only c/e/w properties without get/set");return[G(n,([i,o])=>[i,o.value]),t]}function gL(e){return e[0]}function Dd(e,t,r={}){let n=!!r.noNullPrototype;return B(Rr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:gL,depthIdentifier:r.depthIdentifier}),n?ve(!1):bi()).map(pL,mL)}var yL=Number.POSITIVE_INFINITY,bL=Number.MAX_SAFE_INTEGER,SL=Number.isInteger,wL=Math.floor,vL=Math.pow,xL=Math.min,nd=class F1 extends de{static from(t,r,n){if(t.length===0)throw new Error(`${n} expects at least one weighted arbitrary`);let i=0;for(let o=0;o!==t.length;++o){if(t[o].arbitrary===void 0)throw new Error(`${n} expects arbitraries to be specified`);let s=t[o].weight;if(i+=s,!SL(s))throw new Error(`${n} expects weights to be integer values`);if(s<0)throw new Error(`${n} expects weights to be superior or equal to 0`)}if(i<=0)throw new Error(`${n} expects the sum of weights to be strictly superior to 0`);return new F1(t,{depthBias:L3(r.depthSize,r.maxDepth!==void 0),maxDepth:r.maxDepth!==void 0?r.maxDepth:yL,withCrossShrink:!!r.withCrossShrink},Od(r.depthIdentifier))}constructor(t,r,n){super(),this.warbs=t,this.constraints=r,this.context=n;let i=0;this.cumulatedWeights=[];for(let o=0;o!==t.length;++o)i+=t[o].weight,$(this.cumulatedWeights,i);this.totalWeight=i}generate(t,r){if(this.mustGenerateFirst())return this.safeGenerateForIndex(t,0,r);let n=t.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let i=0;i!==this.cumulatedWeights.length;++i)if(n<this.cumulatedWeights[i])return this.safeGenerateForIndex(t,i,r);throw new Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(t){return this.canShrinkWithoutContextIndex(t)!==-1}shrink(t,r){if(r!==void 0){let i=r,o=i.selectedIndex,s=i.originalBias,a=this.warbs[o].arbitrary.shrink(t,i.originalContext).map(l=>this.mapIntoValue(o,l,null,s));if(i.clonedMrngForFallbackFirst!==null){i.cachedGeneratedForFirst===void 0&&(i.cachedGeneratedForFirst=this.safeGenerateForIndex(i.clonedMrngForFallbackFirst,0,s));let l=i.cachedGeneratedForFirst;return j.of(l).join(a)}return a}let n=this.canShrinkWithoutContextIndex(t);return n===-1?j.nil():this.defaultShrinkForFirst(n).join(this.warbs[n].arbitrary.shrink(t,void 0).map(i=>this.mapIntoValue(n,i,null,void 0)))}defaultShrinkForFirst(t){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(t)||this.warbs[0].fallbackValue===void 0)return j.nil()}finally{--this.context.depth}let r=new _(this.warbs[0].fallbackValue.default,void 0);return j.of(this.mapIntoValue(0,r,null,void 0))}canShrinkWithoutContextIndex(t){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(t)?0:-1;try{++this.context.depth;for(let r=0;r!==this.warbs.length;++r){let n=this.warbs[r];if(n.weight!==0&&n.arbitrary.canShrinkWithoutContext(t))return r}return-1}finally{--this.context.depth}}mapIntoValue(t,r,n,i){let o={selectedIndex:t,originalBias:i,originalContext:r.context,clonedMrngForFallbackFirst:n};return new _(r.value,o)}safeGenerateForIndex(t,r,n){++this.context.depth;try{let i=this.warbs[r].arbitrary.generate(t,n),o=this.mustFallbackToFirstInShrink(r)?t.clone():null;return this.mapIntoValue(r,i,o,n)}finally{--this.context.depth}}mustGenerateFirst(){return this.constraints.maxDepth<=this.context.depth}mustFallbackToFirstInShrink(t){return t!==0&&this.constraints.withCrossShrink&&this.warbs[0].weight!==0}computeNegDepthBenefit(){let t=this.constraints.depthBias;if(t<=0||this.warbs[0].weight===0)return 0;let r=wL(vL(1+t,this.context.depth))-1;return-xL(this.totalWeight*r,bL)||0}};function RL(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function QS(e){return Hw(e)?{arbitrary:e,weight:1}:e}function Me(...e){let t=e[0];if(RL(t)){let n=G(Le(e,1),QS);return nd.from(n,t,"fc.oneof")}let r=G(e,QS);return nd.from(r,{},"fc.oneof")}var kL=Number.isInteger;function Qt(e){let t=typeof e=="number"?e:e&&e.max!==void 0?e.max:2147483647;if(t<0)throw new Error("fc.nat value should be greater than or equal to 0");if(!kL(t))throw new Error("fc.nat maximum value should be an integer");return new sn(0,t)}var EL=Object.is;function CL(e){let t=0,r=[];for(let n of e){let i=t;t=i+n.num;let o=t-1;r.push({from:i,to:o,entry:n})}return r}function AL(e,t){let r=0,n=e.length;for(;n-r>1;){let i=~~((r+n)/2);t<e[i].from?n=i:r=i}return e[r]}function IL(e){let t=CL(e);return function(n){let i=AL(t,n);return i.entry.build(n-i.from)}}function PL(e){let t={mapping:new _t,negativeZeroIndex:void 0},r=0;for(let n=0;n!==e.length;++n){let i=e[n];for(let o=0;o!==i.num;++o){let s=i.build(o);s===0&&1/s===Dt.NEGATIVE_INFINITY?t.negativeZeroIndex=r:ct(t.mapping,s,r),++r}}return t}function TL(e){let t=null;return function(n){t===null&&(t=PL(e));let i=EL(n,-0)?t.negativeZeroIndex:Je(t.mapping,n);if(i===void 0)throw new L("Unknown value encountered cannot be built using this mapToConstant");return i}}function ML(e){if(e.length===0)throw new L("fc.mapToConstant expects at least one option");let t=0;for(let r=0;r!==e.length;++r){if(e[r].num<0)throw new L("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");t+=e[r].num}if(t===0)throw new L("fc.mapToConstant expects at least one choice among options");return t}function an(...e){return Qt({max:ML(e)-1}).map(IL(e),TL(e))}function j1(e,t,r,n){if(t.length===0)return r>0?void 0:[];if(n<=0)return;let i=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];for(;i.length>0;){let o=e1(i);for(let s=o.nextStartIndex;s<=t.length;++s){let a=ge(t,o.endIndexChunks,s);if(e.canShrinkWithoutContext(a)){let l=[...o.chunks,a];if(s===t.length){if(l.length<r)break;return l}$(i,{endIndexChunks:o.endIndexChunks,nextStartIndex:s+1,chunks:o.chunks}),l.length<n&&$(i,{endIndexChunks:s,nextStartIndex:s+1,chunks:l});break}}}}function OL(e){return ce(e,"")}function V1(e){return e.minLength!==void 0?e.minLength:0}function B1(e){return e.maxLength!==void 0?e.maxLength:xr}function NL(e,t){return V1(t)<=e.length&&e.length<=B1(t)}function LL(e,t){return function(n){if(typeof n!="string")throw new L("Unsupported value");let i=j1(e,n,V1(t),B1(t));if(i===void 0)throw new L("Unable to unmap received string");return i}}var U1=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function $L(e,t,r){let n;try{n=r(e)}catch{return}for(let i of n)if(!t.canShrinkWithoutContext(i))return;return n}function DL(e,t){let r=[];for(let n of U1){let i=$L(n,e,t);i!==void 0&&$(r,i)}return r}var ew=new WeakMap;function _L(e){let t=[];for(let r of U1){let n=j1(e,r,0,xr);n!==void 0&&$(t,n)}return t}function FL(e,t){let r=D4(ew,e);r===void 0&&(r=_L(e),$4(ew,e,r));let n=[];for(let i of r)NL(i,t)&&$(n,i);return n}var jL=[[0,127]],VL=[[0,55295],[57344,1114111]],BL=[[32,126],[160,172],[174,767],[880,887],[890,895],[900,906],[908],[910,929],[931,1154],[1162,1327],[1329,1366],[1369,1418],[1421,1423],[1470],[1472],[1475],[1478],[1488,1514],[1519,1524],[1542,1551],[1563],[1565,1610],[1632,1647],[1649,1749],[1758],[1765,1766],[1769],[1774,1805],[1808],[1810,1839],[1869,1957],[1969],[1984,2026],[2036,2042],[2046,2069],[2074],[2084],[2088],[2096,2110],[2112,2136],[2142],[2144,2154],[2160,2190],[2208,2249],[2308,2361],[2365],[2384],[2392,2401],[2404,2432],[2437,2444],[2447,2448],[2451,2472],[2474,2480],[2482],[2486,2489],[2493],[2510],[2524,2525],[2527,2529],[2534,2557],[2565,2570],[2575,2576],[2579,2600],[2602,2608],[2610,2611],[2613,2614],[2616,2617],[2649,2652],[2654],[2662,2671],[2674,2676],[2678],[2693,2701],[2703,2705],[2707,2728],[2730,2736],[2738,2739],[2741,2745],[2749],[2768],[2784,2785],[2790,2801],[2809],[2821,2828],[2831,2832],[2835,2856],[2858,2864],[2866,2867],[2869,2873],[2877],[2908,2909],[2911,2913],[2918,2935],[2947],[2949,2954],[2958,2960],[2962,2965],[2969,2970],[2972],[2974,2975],[2979,2980],[2984,2986],[2990,3001],[3024],[3046,3066],[3077,3084],[3086,3088],[3090,3112],[3114,3129],[3133],[3160,3162],[3165],[3168,3169],[3174,3183],[3191,3200],[3204,3212],[3214,3216],[3218,3240],[3242,3251],[3253,3257],[3261],[3293,3294],[3296,3297],[3302,3311],[3313,3314],[3332,3340],[3342,3344],[3346,3386],[3389],[3407],[3412,3414],[3416,3425],[3430,3455],[3461,3478],[3482,3505],[3507,3515],[3517],[3520,3526],[3558,3567],[3572],[3585,3632],[3634],[3647,3654],[3663,3675],[3713,3714],[3716],[3718,3722],[3724,3747],[3749],[3751,3760],[3762],[3773],[3776,3780],[3782],[3792,3801],[3804,3807],[3840,3863],[3866,3892],[3894],[3896],[3898,3901],[3904,3911],[3913,3948],[3973],[3976,3980],[4030,4037],[4039,4044],[4046,4058],[4096,4138],[4159,4181],[4186,4189],[4193],[4197,4198],[4206,4208],[4213,4225],[4238],[4240,4249],[4254,4293],[4295],[4301],[4304,4351],[4608,4680],[4682,4685],[4688,4694],[4696],[4698,4701],[4704,4744],[4746,4749],[4752,4784],[4786,4789],[4792,4798],[4800],[4802,4805],[4808,4822],[4824,4880],[4882,4885],[4888,4954],[4960,4988],[4992,5017],[5024,5109],[5112,5117],[5120,5788],[5792,5880],[5888,5905],[5919,5937],[5941,5942],[5952,5969],[5984,5996],[5998,6e3],[6016,6067],[6100,6108],[6112,6121],[6128,6137],[6144,6154],[6160,6169],[6176,6264],[6272,6276],[6279,6312],[6314],[6320,6389],[6400,6430],[6464],[6468,6509],[6512,6516],[6528,6571],[6576,6601],[6608,6618],[6622,6678],[6686,6740],[6784,6793],[6800,6809],[6816,6829],[6917,6963],[6981,6988],[6992,7018],[7028,7038],[7043,7072],[7086,7141],[7164,7203],[7227,7241],[7245,7304],[7312,7354],[7357,7367],[7379],[7401,7404],[7406,7411],[7413,7414],[7418],[7424,7615],[7680,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8061],[8064,8116],[8118,8132],[8134,8147],[8150,8155],[8157,8175],[8178,8180],[8182,8190],[8192,8202],[8208,8233],[8239,8287],[8304,8305],[8308,8334],[8336,8348],[8352,8384],[8448,8587],[8592,9254],[9280,9290],[9312,11123],[11126,11157],[11159,11502],[11506,11507],[11513,11557],[11559],[11565],[11568,11623],[11631,11632],[11648,11670],[11680,11686],[11688,11694],[11696,11702],[11704,11710],[11712,11718],[11720,11726],[11728,11734],[11736,11742],[11776,11869],[11904,11929],[11931,12019],[12032,12245],[12272,12329],[12336,12351],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12771],[12783,12830],[12832,13312],[19903,19968],[40959,42124],[42128,42182],[42192,42539],[42560,42606],[42611],[42622,42653],[42656,42735],[42738,42743],[42752,42954],[42960,42961],[42963],[42965,42969],[42994,43009],[43011,43013],[43015,43018],[43020,43042],[43048,43051],[43056,43065],[43072,43127],[43138,43187],[43214,43225],[43250,43262],[43264,43301],[43310,43334],[43359],[43396,43442],[43457,43469],[43471,43481],[43486,43492],[43494,43518],[43520,43560],[43584,43586],[43588,43595],[43600,43609],[43612,43642],[43646,43695],[43697],[43701,43702],[43705,43709],[43712],[43714],[43739,43754],[43760,43764],[43777,43782],[43785,43790],[43793,43798],[43808,43814],[43816,43822],[43824,43883],[43888,44002],[44011],[44016,44025],[44032],[55203],[63744,64109],[64112,64217],[64256,64262],[64275,64279],[64285],[64287,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64450],[64467,64911],[64914,64967],[64975],[65008,65023],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65136,65140],[65142,65276],[65281,65437],[65440,65470],[65474,65479],[65482,65487],[65490,65495],[65498,65500],[65504,65510],[65512,65518],[65532,65533],[65536,65547],[65549,65574],[65576,65594],[65596,65597],[65599,65613],[65616,65629],[65664,65786],[65792,65794],[65799,65843],[65847,65934],[65936,65948],[65952],[66e3,66044],[66176,66204],[66208,66256],[66273,66299],[66304,66339],[66349,66378],[66384,66421],[66432,66461],[66463,66499],[66504,66517],[66560,66717],[66720,66729],[66736,66771],[66776,66811],[66816,66855],[66864,66915],[66927,66938],[66940,66954],[66956,66962],[66964,66965],[66967,66977],[66979,66993],[66995,67001],[67003,67004],[67072,67382],[67392,67413],[67424,67431],[67456,67461],[67463,67504],[67506,67514],[67584,67589],[67592],[67594,67637],[67639,67640],[67644],[67647,67669],[67671,67742],[67751,67759],[67808,67826],[67828,67829],[67835,67867],[67871,67897],[67903],[67968,68023],[68028,68047],[68050,68096],[68112,68115],[68117,68119],[68121,68149],[68160,68168],[68176,68184],[68192,68255],[68288,68324],[68331,68342],[68352,68405],[68409,68437],[68440,68466],[68472,68497],[68505,68508],[68521,68527],[68608,68680],[68736,68786],[68800,68850],[68858,68899],[68912,68921],[69216,69246],[69248,69289],[69293],[69296,69297],[69376,69415],[69424,69445],[69457,69465],[69488,69505],[69510,69513],[69552,69579],[69600,69622],[69635,69687],[69703,69709],[69714,69743],[69745,69746],[69749],[69763,69807],[69819,69820],[69822,69825],[69840,69864],[69872,69881],[69891,69926],[69942,69956],[69959],[69968,70002],[70004,70006],[70019,70066],[70081],[70084,70088],[70093],[70096,70111],[70113,70132],[70144,70161],[70163,70187],[70200,70205],[70207,70208],[70272,70278],[70280],[70282,70285],[70287,70301],[70303,70313],[70320,70366],[70384,70393],[70405,70412],[70415,70416],[70419,70440],[70442,70448],[70450,70451],[70453,70457],[70461],[70480],[70493,70497],[70656,70708],[70727,70747],[70749],[70751,70753],[70784,70831],[70852,70855],[70864,70873],[71040,71086],[71105,71131],[71168,71215],[71233,71236],[71248,71257],[71264,71276],[71296,71338],[71352,71353],[71360,71369],[71424,71450],[71472,71494],[71680,71723],[71739],[71840,71922],[71935,71942],[71945],[71948,71955],[71957,71958],[71960,71983],[72004,72006],[72016,72025],[72096,72103],[72106,72144],[72161,72163],[72192],[72203,72242],[72255,72262],[72272],[72284,72323],[72346,72354],[72368,72440],[72448,72457],[72704,72712],[72714,72750],[72768,72773],[72784,72812],[72816,72847],[72960,72966],[72968,72969],[72971,73008],[73040,73049],[73056,73061],[73063,73064],[73066,73097],[73112],[73120,73129],[73440,73458],[73463,73464],[73476,73488],[73490,73523],[73539,73561],[73648],[73664,73713],[73727,74649],[74752,74862],[74864,74868],[74880,75075],[77712,77810],[77824,78895],[78913,78918],[82944,83526],[92160,92728],[92736,92766],[92768,92777],[92782,92862],[92864,92873],[92880,92909],[92917],[92928,92975],[92983,92997],[93008,93017],[93019,93025],[93027,93047],[93053,93071],[93760,93850],[93952,94026],[94032],[94099,94111],[94176,94179],[94208],[100343],[100352,101589],[101632],[101640],[110576,110579],[110581,110587],[110589,110590],[110592,110882],[110898],[110928,110930],[110933],[110948,110951],[110960,111355],[113664,113770],[113776,113788],[113792,113800],[113808,113817],[113820],[113823],[118608,118723],[118784,119029],[119040,119078],[119081,119140],[119146,119148],[119171,119172],[119180,119209],[119214,119274],[119296,119361],[119365],[119488,119507],[119520,119539],[119552,119638],[119648,119672],[119808,119892],[119894,119964],[119966,119967],[119970],[119973,119974],[119977,119980],[119982,119993],[119995],[119997,120003],[120005,120069],[120071,120074],[120077,120084],[120086,120092],[120094,120121],[120123,120126],[120128,120132],[120134],[120138,120144],[120146,120485],[120488,120779],[120782,121343],[121399,121402],[121453,121460],[121462,121475],[121477,121483],[122624,122654],[122661,122666],[122928,122989],[123136,123180],[123191,123197],[123200,123209],[123214,123215],[123536,123565],[123584,123627],[123632,123641],[123647],[124112,124139],[124144,124153],[124896,124902],[124904,124907],[124909,124910],[124912,124926],[124928,125124],[125127,125135],[125184,125251],[125259],[125264,125273],[125278,125279],[126065,126132],[126209,126269],[126464,126467],[126469,126495],[126497,126498],[126500],[126503],[126505,126514],[126516,126519],[126521],[126523],[126530],[126535],[126537],[126539],[126541,126543],[126545,126546],[126548],[126551],[126553],[126555],[126557],[126559],[126561,126562],[126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[126704,126705],[126976,127019],[127024,127123],[127136,127150],[127153,127167],[127169,127183],[127185,127221],[127232,127405],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127994],[128e3,128727],[128732,128748],[128752,128764],[128768,128886],[128891,128985],[128992,129003],[129008],[129024,129035],[129040,129095],[129104,129113],[129120,129159],[129168,129197],[129200,129201],[129280,129619],[129632,129645],[129648,129660],[129664,129672],[129680,129725],[129727,129733],[129742,129755],[129760,129768],[129776,129784],[129792,129938],[129940,129994],[130032,130041],[131072],[173791],[173824],[177977],[177984],[178205],[178208],[183969],[183984],[191456],[191472],[192093],[194560,195101],[196608],[201546],[201552],[205743]],UL=[[192,197],[199,207],[209,214],[217,221],[224,229],[231,239],[241,246],[249,253],[255,271],[274,293],[296,304],[308,311],[313,318],[323,328],[332,337],[340,357],[360,382],[416,417],[431,432],[461,476],[478,483],[486,496],[500,501],[504,539],[542,543],[550,563],[901,902],[904,906],[908],[910,912],[938,944],[970,974],[979,980],[1024,1025],[1027],[1031],[1036,1038],[1049],[1081],[1104,1105],[1107],[1111],[1116,1118],[1142,1143],[1217,1218],[1232,1235],[1238,1239],[1242,1247],[1250,1255],[1258,1269],[1272,1273],[1570,1574],[1728],[1730],[1747],[2345],[2353],[2356],[2392,2399],[2524,2525],[2527],[2611],[2614],[2649,2651],[2654],[2908,2909],[2964],[3907],[3917],[3922],[3927],[3932],[3945],[4134],[6918],[6920],[6922],[6924],[6926],[6930],[7680,7833],[7835],[7840,7929],[7936,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8048],[8050],[8052],[8054],[8056],[8058],[8060],[8064,8116],[8118,8122],[8124],[8129,8132],[8134,8136],[8138],[8140,8146],[8150,8154],[8157,8162],[8164,8170],[8172,8173],[8178,8180],[8182,8184],[8186],[8188],[8602,8603],[8622],[8653,8655],[8708],[8713],[8716],[8740],[8742],[8769],[8772],[8775],[8777],[8800],[8802],[8813,8817],[8820,8821],[8824,8825],[8832,8833],[8836,8837],[8840,8841],[8876,8879],[8928,8931],[8938,8941],[10972],[12364],[12366],[12368],[12370],[12372],[12374],[12376],[12378],[12380],[12382],[12384],[12386],[12389],[12391],[12393],[12400,12401],[12403,12404],[12406,12407],[12409,12410],[12412,12413],[12436],[12446],[12460],[12462],[12464],[12466],[12468],[12470],[12472],[12474],[12476],[12478],[12480],[12482],[12485],[12487],[12489],[12496,12497],[12499,12500],[12502,12503],[12505,12506],[12508,12509],[12532],[12535,12538],[12542],[44032],[55203],[64285],[64287],[64298,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64334],[69786],[69788],[69803],[119134,119140],[119227,119232]],tw=String.fromCodePoint,WL=Math.min,zL=Math.max;function id(e){if(e.length===1){let r=tw(e[0]);return{num:1,build:()=>r}}let t=e[0];return{num:e[1]-e[0]+1,build:r=>tw(t+r)}}function rw(e,t){let r=[],n=0,i=0;for(;n<e.length&&i<t.length;){let o=e[n],s=o[0],a=o.length===1?o[0]:o[1],l=t[i],u=l[0],c=l.length===1?l[0]:l[1];if(a<u)n+=1;else if(c<s)i+=1;else{let d=zL(s,u),p=WL(a,c);if(r.length>=1){let h=r[r.length-1];(h.length===1?h[0]:h[1])+1===d&&(d=h[0],e1(r))}$(r,d===p?[d]:[d,p]),a<=p&&(n+=1),c<=p&&(i+=1)}}return r}var nw=Object.create(null);function GL(e){switch(e){case"full":return VL;case"ascii":return jL}}function HL(e,t){let r=`${e}:${t}`,n=nw[r];if(n!==void 0)return n;let i=GL(t),o=e==="binary"?i:rw(i,BL),s=[];for(let l of o)$(s,id(l));if(e==="grapheme"){let l=rw(i,UL);for(let u of l){let c=id(u);$(s,{num:c.num,build:d=>eN(c.build(d),"NFD")})}}let a=an(...s);return nw[r]=a,a}function ui(e,t){return HL(e,t)}function qL(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return ui("grapheme","full");case"grapheme-composite":return ui("composite","full");case"grapheme-ascii":case void 0:return ui("grapheme","ascii");case"binary":return ui("binary","full");case"binary-ascii":return ui("binary","ascii")}}function Ce(e={}){let t=qL(e),r=LL(t,e),n=FL(t,e);return ae(t,{...e,experimentalCustomSlices:n}).map(OL,r)}var W1=Map,_d=String.fromCharCode,Fd={num:26,build:e=>_d(e+97)},KL={num:26,build:e=>_d(e+65)},z1={num:10,build:e=>_d(e+48)};function YL(e){let t=p4(e);return e!==t?t:`%${pi(nn(e,0),16)}`}function JL(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var ZL=()=>Ce({unit:"binary",minLength:1,maxLength:1}).map(YL,JL),Lc;function XL(){return Lc===void 0&&(Lc=an(Fd)),Lc}var Is;function od(e){Is===void 0&&(Is=new W1);let t=Je(Is,e);return t===void 0&&(t=an(Fd,z1,{num:e.length,build:r=>e[r]}),ct(Is,e,t)),t}function QL(e){return an(Fd,KL,z1,{num:e.length,build:t=>e[t]})}var Ps;function jd(e){Ps===void 0&&(Ps=new W1);let t=Je(Ps,e);return t===void 0&&(t=Me({weight:10,arbitrary:QL(e)},{weight:1,arbitrary:ZL()}),ct(Ps,e,t)),t}function jt(e,t={}){let r=t.freq===void 0?6:t.freq,n=i1(t,"nil")?t.nil:null,i=[{arbitrary:ve(n),weight:1,fallbackValue:{default:n}},{arbitrary:e,weight:r-1}],o={withCrossShrink:!0,depthSize:t.depthSize,maxDepth:t.maxDepth,depthIdentifier:t.depthIdentifier};return nd.from(i,o,"fc.option")}function e$(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var G1=Symbol("adapted-value");function t$(e,t){let r=t(e.value_);return r.adapted?new _(r.value,G1):e}var r$=class extends de{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=r=>t$(r,t)}generate(e,t){let r=this.sourceArb.generate(e,t);return this.adaptValue(r)}canShrinkWithoutContext(e){return this.sourceArb.canShrinkWithoutContext(e)&&!this.adapter(e).adapted}shrink(e,t){return t===G1?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):j.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function H1(e,t){return new r$(e,t)}function n$([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function i$(e){if(typeof e!="string"||e.length===0)throw new Error("Unsupported");return e.length===1?[e[0],null]:[e[0],[ge(e,1,e.length-1),e[e.length-1]]]}function o$(e){let t=od("");return B(t,jt(B(Ce({unit:od("-"),size:e,maxLength:61}),t))).map(n$,i$).filter(e$)}function s$(e){return`${ce(e[0],".")}.${e[1]}`}function a$(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e.lastIndexOf(".");return[Be(ge(e,0,t),"."),ge(e,t+1)]}function l$(e){let[t,r]=e,n=r.length;for(let i=0;i!==t.length;++i)if(n+=1+t[i].length,n>255)return{adapted:!0,value:[Le(t,0,i),r]};return{adapted:!1,value:e}}function Vd(e={}){let t=$d(e.size),r=yi("-1",t),n=Ce({unit:XL(),minLength:2,maxLength:63,size:r});return H1(B(ae(o$(t),{size:r,minLength:1,maxLength:127}),n),l$).map(s$,a$)}function u$(e){let t=e[0].length;for(let r=1;r!==e.length;++r)if(t+=1+e[r].length,t>64)return{adapted:!0,value:Le(e,0,r)};return{adapted:!1,value:e}}function c$(e){return ce(e,".")}function d$(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,".")}function f$(e){return`${e[0]}@${e[1]}`}function p$(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,"@",2)}function h$(e={}){return B(H1(ae(Ce({unit:od("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),u$).map(c$,d$),Vd({size:e.size})).map(f$,p$)}var m$=Dt.NEGATIVE_INFINITY,sd=Dt.POSITIVE_INFINITY,q1=Dt.EPSILON,Bd=O(2146435072)*O(4294967296),g$=-Bd-O(1),iw=4503599627370496,y$=O(0xfffffffffffff),ow=O("9007199254740992"),ad=new Float64Array(1),sw=new Uint32Array(ad.buffer,ad.byteOffset);function b$(e){return ad[0]=e,[sw[1],sw[0]]}function S$(e){let{0:t,1:r}=b$(e),n=t>>>31,i=t>>>20&2047,o=(t&1048575)*4294967296+r,s=i===0?-1022:i-1023,a=i===0?0:1;return a+=o*q1,a*=n===0?1:-1,{exponent:s,significand:a}}function aw(e,t){return e===-1022?O(t*iw):O((t-1)*iw)+(O(e+1023)<<O(52))}function Ud(e){if(e===sd)return Bd;if(e===m$)return g$;let t=S$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===sd?aw(r,n):-aw(r,-n)-O(1)}function ld(e){if(e<0)return-ld(-e-O(1));if(e===Bd)return sd;if(e<ow)return Dt(e)*2**-1074;let t=e-ow,r=-1021+Dt(t>>O(52));return(1+Dt(t&y$)*q1)*2**r}var lw=Number.isInteger,uw=Object.is,$c=Number.NEGATIVE_INFINITY,Dc=Number.POSITIVE_INFINITY;function K1(e,t,r,n){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:$c,max:l=i?t:Dc}=e,u=o?a<-r?-n:Math.max(a,-r):a===$c?Math.max(a,-n):Math.max(a,-r),c=s?l>r?n:Math.min(l,r):l===Dc?Math.min(l,n):Math.min(l,r);return{noDefaultInfinity:!1,minExcluded:o||(a!==$c||o)&&lw(u),maxExcluded:s||(l!==Dc||s)&&lw(c),min:uw(u,-0)?0:u,max:uw(c,0)?-0:c,noNaN:e.noNaN||!1}}var Y1=Number.NEGATIVE_INFINITY,J1=Number.POSITIVE_INFINITY,w$=Number.MAX_VALUE,v$=45035996273704955e-1,ud=4503599627370496;function x$(e){return K1(e,w$,v$,ud)}function R$(e){return e===4503599627370496?J1:e===-4503599627370496?Y1:e}function k$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===J1?ud:e===Y1?-ud:e}var E$=Number.isInteger,Z1=Number.isNaN,C$=Number.NEGATIVE_INFINITY,A$=Number.POSITIVE_INFINITY,cw=Number.MAX_VALUE,I$=NaN;function dw(e,t){if(Z1(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return Ud(e)}function P$(e){if(typeof e!="number")throw new Error("Unsupported type");return Ud(e)}function T$(e){return!E$(e)}function fw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-cw:C$,max:s=t?cw:A$}=e,a=dw(o,"min"),l=n?a+O(1):a,u=dw(s,"max"),c=i?u-O(1):u;if(c<l)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(r)return rr({min:l,max:c}).map(ld,P$);let d=c>O(0),p=d?l:l-O(1),h=d?c+O(1):c;return rr({min:p,max:h}).map(f=>c<f||f<l?I$:ld(f),f=>{if(typeof f!="number")throw new Error("Unsupported type");return Z1(f)?c!==h?h:p:Ud(f)})}function Ks(e={}){return e.noInteger?fw(x$(e)).map(R$,k$).filter(T$):fw(e)}var M$=Number.NEGATIVE_INFINITY,cd=Number.POSITIVE_INFINITY,O$=Math.imul,dd=2**127*(1+(2**23-1)/2**23),X1=2139095040,N$=-2139095041,fd=new Float32Array(1),L$=new Uint32Array(fd.buffer,fd.byteOffset);function $$(e){return fd[0]=e,L$[0]}function D$(e){let t=$$(e),r=t>>>31,n=t>>>23&255,i=t&8388607,o=n===0?-126:n-127,s=n===0?0:1;return s+=i/2**23,s*=r===0?1:-1,{exponent:o,significand:s}}function pw(e,t){return e===-126?t*8388608:O$(e+127,8388608)+(t-1)*8388608}function Wd(e){if(e===cd)return X1;if(e===M$)return N$;let t=D$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===cd?pw(r,n):-pw(r,-n)-1}function pd(e){if(e<0)return-pd(-e-1);if(e===X1)return cd;if(e<16777216)return e*2**-149;let t=e-16777216,r=-125+(t>>23);return(1+(t&8388607)/8388608)*2**r}var Q1=Number.NEGATIVE_INFINITY,e0=Number.POSITIVE_INFINITY,_$=dd,F$=83886075e-1,hd=8388608;function j$(e){return K1(e,_$,F$,hd)}function V$(e){return e===8388608?e0:e===-8388608?Q1:e}function B$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===e0?hd:e===Q1?-hd:e}var U$=Number.isInteger,t0=Number.isNaN,W$=Math.fround,z$=Number.NEGATIVE_INFINITY,G$=Number.POSITIVE_INFINITY,H$=NaN;function hw(e,t){let r="fc.float constraints."+t+" must be a 32-bit float - you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";if(t0(e)||W$(e)!==e)throw new Error(r);return Wd(e)}function q$(e){if(typeof e!="number")throw new Error("Unsupported type");return Wd(e)}function K$(e){return!U$(e)}function mw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-dd:z$,max:s=t?dd:G$}=e,a=hw(o,"min"),l=n?a+1:a,u=hw(s,"max"),c=i?u-1:u;if(l>c)throw new Error("fc.float constraints.min must be smaller or equal to constraints.max");if(r)return oe({min:l,max:c}).map(pd,q$);let d=c>0?l:l-1,p=c>0?c+1:c;return oe({min:d,max:p}).map(h=>h>c||h<l?H$:pd(h),h=>{if(typeof h!="number")throw new Error("Unsupported type");return t0(h)?c!==p?p:d:Wd(h)})}function r0(e={}){return e.noInteger?mw(j$(e)).map(V$,B$).filter(K$):mw(e)}function Y$(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function n0(e){return e.replace(/\*\//g,"*\\/")}var Ke=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function Gs(e){let t=4294967295;for(let r=0;r<e.length;++r){let n=nn(e,r);if(n<128)t=Ke[t&255^n]^t>>8;else if(n<2048)t=Ke[t&255^(192|n>>6&31)]^t>>8,t=Ke[t&255^(128|n&63)]^t>>8;else if(n>=55296&&n<57344){let i=nn(e,++r);if(n>=56320||i<56320||i>57343||Number.isNaN(i))r-=1,t=Ke[t&255^239]^t>>8,t=Ke[t&255^191]^t>>8,t=Ke[t&255^189]^t>>8;else{let o=(n&1023)+64,s=i&1023;t=Ke[t&255^(240|o>>8&7)]^t>>8,t=Ke[t&255^(128|o>>2&63)]^t>>8,t=Ke[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=Ke[t&255^(128|s&63)]^t>>8}}else t=Ke[t&255^(224|n>>12&15)]^t>>8,t=Ke[t&255^(128|n>>6&63)]^t>>8,t=Ke[t&255^(128|n&63)]^t>>8}return(t|0)+2147483648}var J$=Object.getPrototypeOf,ci=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return this.arb.generate(e,t)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return j.nil()}};function Hs(e){return J$(e)===ci.prototype&&e.generate===ci.prototype.generate&&e.canShrinkWithoutContext===ci.prototype.canShrinkWithoutContext&&e.shrink===ci.prototype.shrink?e:new ci(e)}var Z$=Object.assign,X$=Object.keys;function i0(e){return B(Hs(oe()),Hs(oe({min:1,max:4294967295}))).map(([t,r])=>{let n=()=>{let i={};return Z$((s,a)=>{let l=xe(s),u=xe(a),c=e(Gs(`${t}${l}`)%r,Gs(`${t}${u}`)%r);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=X$(i).sort().map(a=>`${a} => ${xe(i[a])}`).map(a=>`/* ${n0(a)} */`);return`function(a, b) {
117
+ ${qN(i)}`),o}function R1(e){return rd(e,xe)}async function k1(e){let t=[];function r(s){let a=g1(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let n=rd(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 rd(e,o)}function E1(e,t){if(t.runConfiguration.includeErrorInReport)throw new L(e);let r=new L(e,{cause:t.errorInstance});return"cause"in r||HN(r,{cause:t.errorInstance}),r}function QN(e){if(e.failed)throw E1(R1(e),e)}async function e3(e){if(e.failed)throw E1(await k1(e),e)}function t3(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):QN(e)}async function r3(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):e3(e)}function n3(e,t,r,n,i){let o=new b1(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 i3(e,t,r,n,i){let o=new b1(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 C1(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=Ad({...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=DN(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 jN(r.path.length===0?w1(n,r.seed,r.randomType,r.examples):x1(r.path,tr(v1(n,r.seed,r.randomType,r.examples)),s),i,o),l=r.endOnFailure?j.nil:s;return n.isAsync()?i3(n,l,a,r.verbose,r.markInterruptAsFailure).then(u=>u.toRunDetails(r.seed,r.path,o,r)):n3(n,l,a,r.verbose,r.markInterruptAsFailure).toRunDetails(r.seed,r.path,o,r)}function o3(e,t){let r=C1(e,t);if(e.isAsync())return r.then(r3);t3(r)}function s3(e,t){let r=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new p1(e,()=>!0);return t.unbiased===!0?new m1(r):r}function A1(e,t){let r=Ad(typeof t=="number"?{...dt(),numRuns:t}:{...dt(),...t}),n=s3(e,r),i=n.shrink.bind(n);return(r.path.length===0?tr(w1(n,r.seed,r.randomType,r.examples)):x1(r.path,tr(v1(n,r.seed,r.randomType,r.examples)),i)).take(r.numRuns).map(o=>o.value_)}function a3(e,t){return[...A1(e,t)]}function l3(e){return(Math.round(e*100)/100).toFixed(2)}function u3(e,t,r){let n=Ad(typeof r=="number"?{...dt(),numRuns:r}:{...dt(),...r}),i={};for(let l of A1(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],`${l3(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 c3=Object.assign;function nd(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 _(c3(l,{values(){return G(s.history,u=>u.value)},[Oe](){return nd(e,t,r,n).value},[ft](){return xe(G(s.history,u=>u.value))}}),s)}var Nc=Array.isArray,VS=Object.keys,d3=Object.is;function f3(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 I1(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if(Nc(e)){if(!Nc(t)||e.length!==t.length)return!1}else if(Nc(t))return!1;if(VS(e).length!==VS(t).length)return!1;for(let r in e)if(!(r in t)||!I1(e[r],t[r]))return!1;return!0}else return d3(e,t)}var p3=class extends de{constructor(...e){super(...e),this.arbitraryCache=f3(I1)}generate(e,t){return nd(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 c1(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 nd(n,i,a,this.arbitraryCache)})}};function h3(){return new p3}var m3=Math.floor,BS=Math.log;function g3(e){return m3(BS(e)/BS(2))}function y3(e){return e===O(0)?O(0):O(Ve(e).length)}function P1(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 b3=Math.ceil,S3=Math.floor;function US(e){return S3(e/2)}function WS(e){return b3(e/2)}function zS(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:US(n);for(let l=a;l>0;l=US(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:WS(n);for(let l=a;l<0;l=WS(l)){let u=l===n?t:e-l;yield new _(u,s),s=u}}return n>0?tr(i()):tr(o())}var GS=Math.sign,w3=Number.isInteger,v3=Object.is,sn=class T1 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"&&w3(t)&&!v3(t,-0)&&this.min<=t&&t<=this.max}shrink(t,r){return T1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new _(r,void 0)):zS(t,r,!1):zS(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=P1(this.min,this.max,g3);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&&GS(t)!==GS(r))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},HS=Number.isInteger;function x3(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function oe(e={}){let t=x3(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!HS(t.min))throw new Error("fc.integer minimum value should be an integer");if(!HS(t.max))throw new Error("fc.integer maximum value should be an integer");return new sn(t.min,t.max)}var qS=new Map;function Nd(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=Je(qS,e);if(t!==void 0)return t;let r={depth:0};return ct(qS,e,r),r}function Ld(){return{depth:0}}var R3=class{constructor(e,t,r){this.arb=e,this.mrng=t,this.biasFactor=r}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},k3=Math.min,E3=Math.max,C3=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=k3(t,r),this.lastIndexInSlice=E3(t,r),new _(e[this.nextIndexInSlice++],void 0)}};function KS(e,t,r,n){return n===void 0||r.length===0||t.nextInt(1,n)!==1?new R3(e,t,n):new C3(e,t,r,n)}var A3=Math.floor,YS=Math.log,JS=Math.max,I3=Array.isArray;function Lc(e,t){return e===t?e:e+A3(YS(t-e)/YS(2))}var M1=class O1 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=Nd(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=KS(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=JS(0,r-Lc(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=KS(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=JS(0,t-Lc(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&&O1.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=Lc(this.minLength,this.maxGeneratedLength);return{size:oe({min:this.minLength,max:n}).generate(t,void 0).value,biasFactorItems:r}}canShrinkWithoutContext(t){if(!I3(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]))}},P3=Math.floor,T3=Math.min,xr=2147483647,Xr=["xsmall","small","medium","large","xlarge"],M3=["-4","-3","-2","-1","=","+1","+2","+3","+4"],$d="small";function O3(e,t){switch(t){case"xsmall":return P3(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(M3,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=$d,defaultSizeToMaxWhenMaxSpecified:o}=dt()||{},s=e!==void 0?e:n&&o?"max":i;return s==="max"?r:T3(O3(t,yi(s,i)),r)}function N3(e,t){if(typeof e=="number")return 1/e;let{baseSize:r=$d,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 Dd(e){let{baseSize:t=$d}=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 M1(e,n,mi(r,n,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function As(e){return e/O(2)}function ZS(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 L3=class N1 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=P1(this.min,this.max,y3);if(n.length===1)return n[0];let i=t.nextInt(-2*(n.length-1),n.length-2);return i<0?n[0]:n[i+1]}canShrinkWithoutContext(t){return typeof t=="bigint"&&this.min<=t&&t<=this.max}shrink(t,r){return N1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new _(r,void 0)):ZS(t,r,!1):ZS(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 $3(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 D3(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function rr(...e){let t=$3(D3(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new L3(t.min,t.max)}var _3=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 _3(e)===li.prototype&&e.generate===li.prototype.generate&&e.canShrinkWithoutContext===li.prototype.canShrinkWithoutContext&&e.shrink===li.prototype.shrink?e:new li(e)}function F3(e){return e===1}function j3(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(F3,j3))}var di=Object.is,V3=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)}},L1=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 V3(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 L1(e)}function B3(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 L1([e])}var U3=class $1{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Oe](){return new $1}};function W3(){return ve(new U3)}var z3=NaN,G3=Number.isNaN;function D1(e){return new Bs(e)}function _1(e){if(!(e instanceof Bs)||e.constructor!==Bs)throw new L("Not a valid value for date unmapper");return Us(e)}function H3(e){return t=>t===e?new Bs(z3):D1(t)}function q3(e){return t=>{let r=_1(t);return G3(r)?e:r}}var XS=Number.isNaN;function F1(e={}){let t=e.min!==void 0?Us(e.min):-864e13,r=e.max!==void 0?Us(e.max):864e13,n=e.noInvalidDate;if(XS(t))throw new Error("fc.date min must be valid instance of Date");if(XS(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(D1,_1);let i=r+1;return oe({min:t,max:r+1}).map(H3(i),q3(i))}var K3=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 Y3(e,t){return new K3(e,t)}var J3=Symbol.iterator,Z3=Array.isArray,X3=Object.is,Q3=class j1 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(!Z3(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let r=1;r<t.length;++r)if(!X3(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])[J3]()),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&&j1.makeItCloneable(n,t),new _(n,i)}};function eL(e,t){return new Q3(e,t)}var QS=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}},tL=Number.isNaN,rL=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new rn,this.data=[]}tryAdd(e){let t=this.selector(e);if(tL(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}},nL=Object.is,iL=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new rn,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(nL(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}},oL=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 sL(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 QS(l)}let n=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>n(o(a),o(l));return()=>new QS(s)}let t=e.selector||(n=>n),r=n=>t(n.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new rL(r);case"SameValueZero":return()=>new oL(r);case"SameValue":case void 0:return()=>new iL(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 M1(e,r,i,n,o,sL(t),[]);return r===0?s:s.filter(a=>a.length>=r)}var aL=Object.create,lL=Object.defineProperty,uL=Object.getOwnPropertyDescriptor,ew=Object.getPrototypeOf,cL=Object.prototype,dL=Reflect.ownKeys;function fL(e){let t=e[1]?aL(null):{};for(let r of e[0])lL(t,r[0],{enumerable:!0,configurable:!0,writable:!0,value:r[1]});return t}function pL(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function hL(e){if(typeof e!="object"||e===null)throw new L("Incompatible instance received: should be a non-null object");let t=ew(e)===null,r=ew(e)===cL;if(!t&&!r)throw new L("Incompatible instance received: should be of exact type Object");let n=G(dL(e),i=>[i,uL(e,i)]);if(!o1(n,([,i])=>pL(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 mL(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:mL,depthIdentifier:r.depthIdentifier}),n?ve(!1):bi()).map(fL,hL)}var gL=Number.POSITIVE_INFINITY,yL=Number.MAX_SAFE_INTEGER,bL=Number.isInteger,SL=Math.floor,wL=Math.pow,vL=Math.min,id=class V1 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,!bL(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 V1(t,{depthBias:N3(r.depthSize,r.maxDepth!==void 0),maxDepth:r.maxDepth!==void 0?r.maxDepth:gL,withCrossShrink:!!r.withCrossShrink},Nd(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=SL(wL(1+t,this.context.depth))-1;return-vL(this.totalWeight*r,yL)||0}};function xL(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function tw(e){return Kw(e)?{arbitrary:e,weight:1}:e}function Me(...e){let t=e[0];if(xL(t)){let n=G(Le(e,1),tw);return id.from(n,t,"fc.oneof")}let r=G(e,tw);return id.from(r,{},"fc.oneof")}var RL=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(!RL(t))throw new Error("fc.nat maximum value should be an integer");return new sn(0,t)}var kL=Object.is;function EL(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 CL(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 AL(e){let t=EL(e);return function(n){let i=CL(t,n);return i.entry.build(n-i.from)}}function IL(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 PL(e){let t=null;return function(n){t===null&&(t=IL(e));let i=kL(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 TL(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:TL(e)-1}).map(AL(e),PL(e))}function B1(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=r1(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 ML(e){return ce(e,"")}function U1(e){return e.minLength!==void 0?e.minLength:0}function W1(e){return e.maxLength!==void 0?e.maxLength:xr}function OL(e,t){return U1(t)<=e.length&&e.length<=W1(t)}function NL(e,t){return function(n){if(typeof n!="string")throw new L("Unsupported value");let i=B1(e,n,U1(t),W1(t));if(i===void 0)throw new L("Unable to unmap received string");return i}}var z1=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function LL(e,t,r){let n;try{n=r(e)}catch{return}for(let i of n)if(!t.canShrinkWithoutContext(i))return;return n}function $L(e,t){let r=[];for(let n of z1){let i=LL(n,e,t);i!==void 0&&$(r,i)}return r}var rw=new WeakMap;function DL(e){let t=[];for(let r of z1){let n=B1(e,r,0,xr);n!==void 0&&$(t,n)}return t}function _L(e,t){let r=$4(rw,e);r===void 0&&(r=DL(e),L4(rw,e,r));let n=[];for(let i of r)OL(i,t)&&$(n,i);return n}var FL=[[0,127]],jL=[[0,55295],[57344,1114111]],VL=[[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]],BL=[[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]],nw=String.fromCodePoint,UL=Math.min,WL=Math.max;function od(e){if(e.length===1){let r=nw(e[0]);return{num:1,build:()=>r}}let t=e[0];return{num:e[1]-e[0]+1,build:r=>nw(t+r)}}function iw(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=WL(s,u),p=UL(a,c);if(r.length>=1){let h=r[r.length-1];(h.length===1?h[0]:h[1])+1===d&&(d=h[0],r1(r))}$(r,d===p?[d]:[d,p]),a<=p&&(n+=1),c<=p&&(i+=1)}}return r}var ow=Object.create(null);function zL(e){switch(e){case"full":return jL;case"ascii":return FL}}function GL(e,t){let r=`${e}:${t}`,n=ow[r];if(n!==void 0)return n;let i=zL(t),o=e==="binary"?i:iw(i,VL),s=[];for(let l of o)$(s,od(l));if(e==="grapheme"){let l=iw(i,BL);for(let u of l){let c=od(u);$(s,{num:c.num,build:d=>Q4(c.build(d),"NFD")})}}let a=an(...s);return ow[r]=a,a}function ui(e,t){return GL(e,t)}function HL(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=HL(e),r=NL(t,e),n=_L(t,e);return ae(t,{...e,experimentalCustomSlices:n}).map(ML,r)}var G1=Map,Fd=String.fromCharCode,jd={num:26,build:e=>Fd(e+97)},qL={num:26,build:e=>Fd(e+65)},H1={num:10,build:e=>Fd(e+48)};function KL(e){let t=f4(e);return e!==t?t:`%${pi(nn(e,0),16)}`}function YL(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var JL=()=>Ce({unit:"binary",minLength:1,maxLength:1}).map(KL,YL),$c;function ZL(){return $c===void 0&&($c=an(jd)),$c}var Is;function sd(e){Is===void 0&&(Is=new G1);let t=Je(Is,e);return t===void 0&&(t=an(jd,H1,{num:e.length,build:r=>e[r]}),ct(Is,e,t)),t}function XL(e){return an(jd,qL,H1,{num:e.length,build:t=>e[t]})}var Ps;function Vd(e){Ps===void 0&&(Ps=new G1);let t=Je(Ps,e);return t===void 0&&(t=Me({weight:10,arbitrary:XL(e)},{weight:1,arbitrary:JL()}),ct(Ps,e,t)),t}function jt(e,t={}){let r=t.freq===void 0?6:t.freq,n=s1(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 id.from(i,o,"fc.option")}function QL(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var q1=Symbol("adapted-value");function e$(e,t){let r=t(e.value_);return r.adapted?new _(r.value,q1):e}var t$=class extends de{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=r=>e$(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===q1?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):j.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function K1(e,t){return new t$(e,t)}function r$([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function n$(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 i$(e){let t=sd("");return B(t,jt(B(Ce({unit:sd("-"),size:e,maxLength:61}),t))).map(r$,n$).filter(QL)}function o$(e){return`${ce(e[0],".")}.${e[1]}`}function s$(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 a$(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 Bd(e={}){let t=Dd(e.size),r=yi("-1",t),n=Ce({unit:ZL(),minLength:2,maxLength:63,size:r});return K1(B(ae(i$(t),{size:r,minLength:1,maxLength:127}),n),a$).map(o$,s$)}function l$(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 u$(e){return ce(e,".")}function c$(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,".")}function d$(e){return`${e[0]}@${e[1]}`}function f$(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,"@",2)}function p$(e={}){return B(K1(ae(Ce({unit:sd("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),l$).map(u$,c$),Bd({size:e.size})).map(d$,f$)}var h$=Dt.NEGATIVE_INFINITY,ad=Dt.POSITIVE_INFINITY,Y1=Dt.EPSILON,Ud=O(2146435072)*O(4294967296),m$=-Ud-O(1),sw=4503599627370496,g$=O(0xfffffffffffff),aw=O("9007199254740992"),ld=new Float64Array(1),lw=new Uint32Array(ld.buffer,ld.byteOffset);function y$(e){return ld[0]=e,[lw[1],lw[0]]}function b$(e){let{0:t,1:r}=y$(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*Y1,a*=n===0?1:-1,{exponent:s,significand:a}}function uw(e,t){return e===-1022?O(t*sw):O((t-1)*sw)+(O(e+1023)<<O(52))}function Wd(e){if(e===ad)return Ud;if(e===h$)return m$;let t=b$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===ad?uw(r,n):-uw(r,-n)-O(1)}function ud(e){if(e<0)return-ud(-e-O(1));if(e===Ud)return ad;if(e<aw)return Dt(e)*2**-1074;let t=e-aw,r=-1021+Dt(t>>O(52));return(1+Dt(t&g$)*Y1)*2**r}var cw=Number.isInteger,dw=Object.is,Dc=Number.NEGATIVE_INFINITY,_c=Number.POSITIVE_INFINITY;function J1(e,t,r,n){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:Dc,max:l=i?t:_c}=e,u=o?a<-r?-n:Math.max(a,-r):a===Dc?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!==Dc||o)&&cw(u),maxExcluded:s||(l!==_c||s)&&cw(c),min:dw(u,-0)?0:u,max:dw(c,0)?-0:c,noNaN:e.noNaN||!1}}var Z1=Number.NEGATIVE_INFINITY,X1=Number.POSITIVE_INFINITY,S$=Number.MAX_VALUE,w$=45035996273704955e-1,cd=4503599627370496;function v$(e){return J1(e,S$,w$,cd)}function x$(e){return e===4503599627370496?X1:e===-4503599627370496?Z1:e}function R$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===X1?cd:e===Z1?-cd:e}var k$=Number.isInteger,Q1=Number.isNaN,E$=Number.NEGATIVE_INFINITY,C$=Number.POSITIVE_INFINITY,fw=Number.MAX_VALUE,A$=NaN;function pw(e,t){if(Q1(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return Wd(e)}function I$(e){if(typeof e!="number")throw new Error("Unsupported type");return Wd(e)}function P$(e){return!k$(e)}function hw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-fw:E$,max:s=t?fw:C$}=e,a=pw(o,"min"),l=n?a+O(1):a,u=pw(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(ud,I$);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?A$:ud(f),f=>{if(typeof f!="number")throw new Error("Unsupported type");return Q1(f)?c!==h?h:p:Wd(f)})}function Ks(e={}){return e.noInteger?hw(v$(e)).map(x$,R$).filter(P$):hw(e)}var T$=Number.NEGATIVE_INFINITY,dd=Number.POSITIVE_INFINITY,M$=Math.imul,fd=2**127*(1+(2**23-1)/2**23),e0=2139095040,O$=-2139095041,pd=new Float32Array(1),N$=new Uint32Array(pd.buffer,pd.byteOffset);function L$(e){return pd[0]=e,N$[0]}function $$(e){let t=L$(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 mw(e,t){return e===-126?t*8388608:M$(e+127,8388608)+(t-1)*8388608}function zd(e){if(e===dd)return e0;if(e===T$)return O$;let t=$$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===dd?mw(r,n):-mw(r,-n)-1}function hd(e){if(e<0)return-hd(-e-1);if(e===e0)return dd;if(e<16777216)return e*2**-149;let t=e-16777216,r=-125+(t>>23);return(1+(t&8388607)/8388608)*2**r}var t0=Number.NEGATIVE_INFINITY,r0=Number.POSITIVE_INFINITY,D$=fd,_$=83886075e-1,md=8388608;function F$(e){return J1(e,D$,_$,md)}function j$(e){return e===8388608?r0:e===-8388608?t0:e}function V$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===r0?md:e===t0?-md:e}var B$=Number.isInteger,n0=Number.isNaN,U$=Math.fround,W$=Number.NEGATIVE_INFINITY,z$=Number.POSITIVE_INFINITY,G$=NaN;function gw(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(n0(e)||U$(e)!==e)throw new Error(r);return zd(e)}function H$(e){if(typeof e!="number")throw new Error("Unsupported type");return zd(e)}function q$(e){return!B$(e)}function yw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-fd:W$,max:s=t?fd:z$}=e,a=gw(o,"min"),l=n?a+1:a,u=gw(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(hd,H$);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?G$:hd(h),h=>{if(typeof h!="number")throw new Error("Unsupported type");return n0(h)?c!==p?p:d:zd(h)})}function i0(e={}){return e.noInteger?yw(F$(e)).map(j$,V$).filter(q$):yw(e)}function K$(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function o0(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 Y$=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 Y$(e)===ci.prototype&&e.generate===ci.prototype.generate&&e.canShrinkWithoutContext===ci.prototype.canShrinkWithoutContext&&e.shrink===ci.prototype.shrink?e:new ci(e)}var J$=Object.assign,Z$=Object.keys;function s0(e){return B(Hs(oe()),Hs(oe({min:1,max:4294967295}))).map(([t,r])=>{let n=()=>{let i={};return J$((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=Z$(i).sort().map(a=>`${a} => ${xe(i[a])}`).map(a=>`/* ${o0(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 @@ ${KN(i)}`),o}function v1(e){return td(e,xe)}async function x1(e){let t=[];functi
122
122
  const hA = hash('${t}' + stringify(a)) % ${r};
123
123
  const hB = hash('${t}' + stringify(b)) % ${r};
124
124
  return cmp(hA, hB);
125
- }`},[Oe]:n})};return n()})}var Q$=Object.assign;function eD(){return i0(Q$((e,t)=>e<t,{toString(){return"(hA, hB) => hA < hB"}}))}var tD=Object.assign;function rD(){return i0(tD((e,t)=>e-t,{toString(){return"(hA, hB) => hA - hB"}}))}var nD=Object.defineProperties,iD=Object.keys;function oD(e){return B(ae(e,{minLength:1}),Hs(oe())).map(([t,r])=>{let n=()=>{let i={},o=(...a)=>{let l=xe(a),u=t[Gs(`${r}${l}`)%t.length];return i[l]=u,vr(u)?u[Oe]():u};function s(a){let l=G(G(r1(iD(i)),u=>`${u} => ${xe(i[u])}`),u=>`/* ${n0(u)} */`);return`function(...args) {
125
+ }`},[Oe]:n})};return n()})}var X$=Object.assign;function Q$(){return s0(X$((e,t)=>e<t,{toString(){return"(hA, hB) => hA < hB"}}))}var eD=Object.assign;function tD(){return s0(eD((e,t)=>e-t,{toString(){return"(hA, hB) => hA - hB"}}))}var rD=Object.defineProperties,nD=Object.keys;function iD(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(i1(nD(i)),u=>`${u} => ${xe(i[u])}`),u=>`/* ${o0(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 nD(o,{toString:{value:()=>s(xe(t))},[ft]:{value:()=>s(xe(t))},[Ft]:{value:async()=>s(await Pd(t))},[Oe]:{value:n,configurable:!0}})};return n()})}var sD=Number.MIN_SAFE_INTEGER,aD=Number.MAX_SAFE_INTEGER;function o0(){return new sn(sD,aD)}var lD=Number.MAX_SAFE_INTEGER;function uD(){return new sn(0,lD)}var cD=Number.parseInt;function dD(e){let[t,r]=e;switch(t){case"oct":return`0${pi(r,8)}`;case"hex":return`0x${pi(r,16)}`;default:return`${r}`}}function $s(e,t){let r=cD(e,t);if(pi(r,t)!==e)throw new Error("Invalid value");return r}function fD(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",$s(ge(e,2),16)]:["oct",$s(ge(e,1),8)]:["dec",$s(e,10)]}function pD(e){return ce(e,".")}function hD(e){if(typeof e!="string")throw new Error("Invalid type");return G(Be(e,"."),t=>$s(t,10))}function zd(){return B(Qt(255),Qt(255),Qt(255),Qt(255)).map(pD,hD)}function wt(e){return B(vt("dec","oct","hex"),Qt(e)).map(dD,fD)}function _c(e){return ce(e,".")}function Fc(e){if(typeof e!="string")throw new Error("Invalid type");return Be(e,".")}function s0(){return Me(B(wt(255),wt(255),wt(255),wt(255)).map(_c,Fc),B(wt(255),wt(255),wt(65535)).map(_c,Fc),B(wt(255),wt(16777215)).map(_c,Fc),wt(4294967295))}function Gd(e){return e.length===0?[]:Be(e,":")}function Hd(e){let t=Be(e,":");return t.length>=2&&t[t.length-1].length<=4?[Le(t,0,t.length-2),`${t[t.length-2]}:${t[t.length-1]}`]:[Le(t,0,t.length-1),t[t.length-1]]}function mD(e){return`${ce(e[0],":")}:${e[1]}`}function gD(e){if(typeof e!="string")throw new Error("Invalid type");return Hd(e)}function yD(e){return`::${ce(e[0],":")}:${e[1]}`}function bD(e){if(typeof e!="string")throw new Error("Invalid type");if(!Z4(e,"::"))throw new Error("Invalid value");return Hd(ge(e,2))}function Ds(e){return`${ce(e[0],":")}::${ce(e[1],":")}:${e[2]}`}function _s(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2),[n,i]=Hd(r);return[Gd(t),n,i]}function SD(e){return Ds([e[0],[e[1]],e[2]])}function wD(e){let t=_s(e);return[t[0],ce(t[1],":"),t[2]]}function gw(e){return`${ce(e[0],":")}::${e[1]}`}function yw(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2);return[Gd(t),r]}function vD(e){return`${ce(e[0],":")}::`}function xD(e){if(typeof e!="string")throw new Error("Invalid type");if(!X4(e,"::"))throw new Error("Invalid value");return[Gd(ge(e,0,e.length-2))]}function RD([e,t]){return`${e}:${t}`}function kD(e){if(typeof e!="string")throw new L("Invalid type");if(!e.includes(":"))throw new L("Invalid value");return e.split(":",2)}var ED="0123456789abcdef",jc;function CD(){return jc===void 0&&(jc=oe({min:0,max:15}).map(e=>ED[e],e=>{if(typeof e!="string")throw new L("Not a string");if(e.length!==1)throw new L("Invalid length");let t=nn(e,0);if(t<=57)return t-48;if(t<97)throw new L("Invalid character");return t-87})),jc}function a0(){let e=Ce({unit:CD(),minLength:1,maxLength:4,size:"max"}),t=Me(B(e,e).map(RD,kD),zd());return Me(B(ae(e,{minLength:6,maxLength:6,size:"max"}),t).map(mD,gD),B(ae(e,{minLength:5,maxLength:5,size:"max"}),t).map(yD,bD),B(ae(e,{minLength:0,maxLength:1,size:"max"}),ae(e,{minLength:4,maxLength:4,size:"max"}),t).map(Ds,_s),B(ae(e,{minLength:0,maxLength:2,size:"max"}),ae(e,{minLength:3,maxLength:3,size:"max"}),t).map(Ds,_s),B(ae(e,{minLength:0,maxLength:3,size:"max"}),ae(e,{minLength:2,maxLength:2,size:"max"}),t).map(Ds,_s),B(ae(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(SD,wD),B(ae(e,{minLength:0,maxLength:5,size:"max"}),t).map(gw,yw),B(ae(e,{minLength:0,maxLength:6,size:"max"}),e).map(gw,yw),B(ae(e,{minLength:0,maxLength:7,size:"max"})).map(vD,xD))}var AD=class extends de{constructor(e){super(),this.name=e,this.underlying=null}generate(e,t){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.generate(e,t)}canShrinkWithoutContext(e){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.canShrinkWithoutContext(e)}shrink(e,t){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.shrink(e,t)}},ID=Object.getOwnPropertyNames;function PD(){let e=new _t;return r=>{let n=Je(e,r);return n!==void 0||(n=new AD(String(r)),ct(e,r,n)),n}}function l0(e){let t=PD(),r=e(t),n=ID(r);for(let i of n){let o=t(i);o.underlying=r[i]}return r}function TD(e,t){for(let r of e){let n=t[r]||{};if(n.maxLength===void 0||n.maxLength>0)return!0}return!1}function MD(e,t){if(e.length===0)return ve([]);if(!TD(e,t))throw new L("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return B(...e.map(r=>ae(ve(r),t[r]))).map(r=>C4(r)).filter(r=>r.length>0)}var bw=Object.assign,Fs=Object.create,u0=Object.defineProperty,Sw=Object.getPrototypeOf,OD=Object.prototype;function ND(e){return u0(Fs(null),ft,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function ww(e,t){return ND(`<${Ve(e)}#${t}>`)}function LD(e,t){let r=Fs(OD);for(let n in e){let i=e[n],o=[];for(let s of i){let a=bw(Fs(Sw(s)),s);o.push(a)}r[n]=o}for(let n in t){let i=t[n];for(let o=0;o!==i.length;++o){let s=i[o],a=r[n][o];for(let l in s){let u=s[l];a[l]=u.index===void 0?void 0:typeof u.index=="number"?r[u.type][u.index]:G(u.index,c=>r[u.type][c])}u0(a,ft,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[n][o],u=bw(Fs(Sw(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?ww(d.type,d.index):G(d.index,p=>ww(d.type,p))}return xe(u)}})}}return r}function $D(e){let t=0,r=new _t;for(let i in e){let o=e[i];for(let s in o){let a=o[s];if(a.arity!=="inverse")continue;let l=Je(r,a.type);if(l===void 0&&(l=new _t,ct(r,a.type,l)),V4(l,a.forwardRelationship))throw new L(`Cannot declare multiple inverse relationships for the same forward relationship ${Ve(a.forwardRelationship)} on type ${Ve(a.type)}`);ct(l,a.forwardRelationship,{type:i,property:s}),t+=1}}let n=new _t;if(t===0)return n;for(let i in e){let o=e[i],s=Je(r,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=Je(s,a);if(u!==void 0){if(u.type!==l.type)throw new L(`Inverse relationship ${Ve(u.property)} on type ${Ve(u.type)} references forward relationship ${Ve(a)} but types do not match`);ct(n,l,u)}}}if(n.size!==t)throw new L("Some inverse relationships could not be matched with their corresponding forward relationships");return n}var vw=Object.create;function DD(e,t,r){switch(e){case"exclusive":return ve(r);case"successor":return zs(oe({min:t!==void 0?t+1:0,max:r}));case"any":return zs(oe({min:0,max:r}))}}function _D(e,t,r,n,i,o,s){let a=DD(t,r,n);switch(e){case"0-1":return jt(a,{nil:void 0,depthIdentifier:i}).generate(o,s).value;case"1":return a.generate(o,s).value;case"many":{let l=0,u=jt(Rr(a,{depthIdentifier:i,selector:d=>d===n?d+ ++l:d,minLength:1}),{nil:[],depthIdentifier:i}).generate(o,s).value,c=0;return G(u,d=>d===n?d+c++:d)}}}var FD=class extends de{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let r=new rn,n=new rn;for(let i in e){let o=e[i];for(let s in o){let a=o[s];if(a.arity!=="inverse"){if(a.strategy==="exclusive"){if(Ws(r,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);fi(n,a.type)}else{if(Ws(n,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);fi(r,a.type)}if(a.strategy==="successor"&&a.type!==i)throw new L("Cannot mix types for the strategy successor");if(a.strategy==="successor"&&a.arity==="1")throw new L("Cannot use an arity of 1 for the strategy successor")}}}this.inversedRelations=$D(e)}createEmptyLinksInstanceFor(e){let t=vw(null),r=this.relations[e];for(let n in r){let i=r[n];i.arity==="inverse"&&(t[n]={type:i.type,index:[]})}return t}generate(e,t){let r=vw(null);for(let o in this.relations)r[o]=[];let n=[];for(let o of this.defaultEntities)$(n,{type:o,indexInType:r[o].length,depth:0}),$(r[o],this.createEmptyLinksInstanceFor(o));let i=-1;for(;++i<n.length;){let o=n[i],s=this.relations[o.type],a=r[o.type][o.indexInType],l=Nd();l.depth=o.depth;for(let u in s){let c=s[u];if(c.arity==="inverse")continue;let d=c.type,p=r[d],h=p.length,f=_D(c.arity,c.strategy||"any",d===o.type?o.indexInType:void 0,p.length,l,e,t);a[u]={type:d,index:f};let m=f===void 0?[]:typeof f=="number"?[f]:f;for(let g of m){g>=h&&($(n,{type:d,indexInType:g,depth:o.depth+1}),$(p,this.createEmptyLinksInstanceFor(d)));let S=Je(this.inversedRelations,c);if(S!==void 0){let w=p[g][S.property].index;$(w,o.indexInType)}}}}return n.length=0,new _(r,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function jD(e,t){return new FD(e,t)}var VD=Object.keys,BD=Object.getOwnPropertySymbols,UD=Object.getOwnPropertyDescriptor;function WD(e){let t=VD(e),r=BD(e);for(let n=0;n!==r.length;++n){let i=r[n],o=UD(e,i);o&&o.enumerable&&t.push(i)}return t}var zD=Object.create,GD=Object.defineProperty,HD=Object.getOwnPropertyDescriptor,qD=Object.getOwnPropertyNames,KD=Object.getOwnPropertySymbols;function YD(e,t){return function(n){let i=n[1]?zD(null):{};for(let o=0;o!==e.length;++o){let s=n[0][o];s!==t&&GD(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function JD(e,t){return function(n){if(typeof n!="object"||n===null)throw new Error("Incompatible instance received: should be a non-null object");let i=Object.getPrototypeOf(n)===null,o="constructor"in n&&n.constructor===Object;if(!i&&!o)throw new Error("Incompatible instance received: should be of exact type Object");let s=0,a=[];for(let c=0;c!==e.length;++c){let d=HD(n,e[c]);if(d!==void 0){if(!d.configurable||!d.enumerable||!d.writable)throw new Error("Incompatible instance received: should contain only c/e/w properties");if(d.get!==void 0||d.set!==void 0)throw new Error("Incompatible instance received: should contain only no get/set properties");++s,$(a,d.value)}else $(a,t)}let l=qD(n).length,u=KD(n).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var Vc=Symbol("no-key");function Bc(e,t,r){let n=WD(e),i=[];for(let o=0;o!==n.length;++o){let s=n[o],a=e[s];t===void 0||$t(t,s)!==-1?$(i,a):$(i,jt(a,{nil:Vc}))}return B(B(...i),r?ve(!1):bi()).map(YD(n,Vc),JD(n,Vc))}function md(e,t){let r=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return Bc(e,void 0,r);let n=("requiredKeys"in t?t.requiredKeys:void 0)||[];for(let i=0;i!==n.length;++i){let o=Object.getOwnPropertyDescriptor(e,n[i]);if(o===void 0)throw new Error("requiredKeys cannot reference keys that have not been defined in recordModel");if(!o.enumerable)throw new Error("requiredKeys cannot reference keys that are not enumerable in recordModel")}return Bc(e,n,r)}var ZD=Object.create;function XD(e,t,r,n){let i=ZD(null);for(let o in e){let s=e[o],a=md(s,n),l=t(o),u=r(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?Rr(a,{...c,selector:u}):ae(a,c)}return md(i)}var xw=Object.create,QD=Object.keys;function e_(e,t,r={}){let n=QD(e),i=r.initialPoolConstraints||xw(null),o=r.unicityConstraints||xw(null),s={noNullPrototype:r.noNullPrototype};return MD(n,i).chain(a=>jD(t,a).chain(l=>XD(e,u=>l[u].length,u=>o[u],s).map(u=>LD(u,l))))}function t_(e){return ce(G(e,t=>t[t.length-1]===","?ge(t,0,t.length-1):t)," ")}function r_(e){return function(r){if(typeof r!="string")throw new Error("Unsupported type");let n=[];for(let i of Be(r," "))if(e.canShrinkWithoutContext(i))$(n,i);else if(e.canShrinkWithoutContext(i+","))$(n,i+",");else throw new Error("Unsupported word");return n}}function n_(e){let t=ce(e," ");return t[t.length-1]===","&&(t=ge(t,0,t.length-1)),kd(t[0])+ge(t,1)+"."}function i_(e){return function(r){if(typeof r!="string")throw new Error("Unsupported type");if(r.length<2||r[r.length-1]!=="."||r[r.length-2]===","||kd(Xc(r[0]))!==r[0])throw new Error("Unsupported value");let n=Xc(r[0])+ge(r,1,r.length-1),i=[],o=Be(n," ");for(let s=0;s!==o.length;++s){let a=o[s];if(e.canShrinkWithoutContext(a))$(i,a);else if(s===o.length-1&&e.canShrinkWithoutContext(a+","))$(i,a+",");else throw new Error("Unsupported word")}return i}}function o_(e){return ce(e," ")}function s_(e){if(typeof e!="string")throw new Error("Unsupported type");let t=Be(e,". ");for(let r=0;r<t.length-1;++r)t[r]+=".";return t}var b=(e,t)=>({arbitrary:ve(e),weight:t});function a_(){return Me(b("non",6),b("adipiscing",5),b("ligula",5),b("enim",5),b("pellentesque",5),b("in",5),b("augue",5),b("et",5),b("nulla",5),b("lorem",4),b("sit",4),b("sed",4),b("diam",4),b("fermentum",4),b("ut",4),b("eu",4),b("aliquam",4),b("mauris",4),b("vitae",4),b("felis",4),b("ipsum",3),b("dolor",3),b("amet,",3),b("elit",3),b("euismod",3),b("mi",3),b("orci",3),b("erat",3),b("praesent",3),b("egestas",3),b("leo",3),b("vel",3),b("sapien",3),b("integer",3),b("curabitur",3),b("convallis",3),b("purus",3),b("risus",2),b("suspendisse",2),b("lectus",2),b("nec,",2),b("ultricies",2),b("sed,",2),b("cras",2),b("elementum",2),b("ultrices",2),b("maecenas",2),b("massa,",2),b("varius",2),b("a,",2),b("semper",2),b("proin",2),b("nec",2),b("nisl",2),b("amet",2),b("duis",2),b("congue",2),b("libero",2),b("vestibulum",2),b("pede",2),b("blandit",2),b("sodales",2),b("ante",2),b("nibh",2),b("ac",2),b("aenean",2),b("massa",2),b("suscipit",2),b("sollicitudin",2),b("fusce",2),b("tempus",2),b("aliquam,",2),b("nunc",2),b("ullamcorper",2),b("rhoncus",2),b("metus",2),b("faucibus,",2),b("justo",2),b("magna",2),b("at",2),b("tincidunt",2),b("consectetur",1),b("tortor,",1),b("dignissim",1),b("congue,",1),b("non,",1),b("porttitor,",1),b("nonummy",1),b("molestie,",1),b("est",1),b("eleifend",1),b("mi,",1),b("arcu",1),b("scelerisque",1),b("vitae,",1),b("consequat",1),b("in,",1),b("pretium",1),b("volutpat",1),b("pharetra",1),b("tempor",1),b("bibendum",1),b("odio",1),b("dui",1),b("primis",1),b("faucibus",1),b("luctus",1),b("posuere",1),b("cubilia",1),b("curae,",1),b("hendrerit",1),b("velit",1),b("mauris,",1),b("gravida",1),b("ornare",1),b("ut,",1),b("pulvinar",1),b("varius,",1),b("turpis",1),b("nibh,",1),b("eros",1),b("id",1),b("aliquet",1),b("quis",1),b("lobortis",1),b("consectetuer",1),b("morbi",1),b("vehicula",1),b("tortor",1),b("tellus,",1),b("id,",1),b("eu,",1),b("quam",1),b("feugiat,",1),b("posuere,",1),b("iaculis",1),b("lectus,",1),b("tristique",1),b("mollis,",1),b("nisl,",1),b("vulputate",1),b("sem",1),b("vivamus",1),b("placerat",1),b("imperdiet",1),b("cursus",1),b("rutrum",1),b("iaculis,",1),b("augue,",1),b("lacus",1))}function l_(e={}){let{maxCount:t,mode:r="words",size:n}=e;if(t!==void 0&&t<1)throw new Error("lorem has to produce at least one word/sentence");let i=a_();return r==="sentences"?ae(ae(i,{minLength:1,size:"small"}).map(n_,i_(i)),{minLength:1,maxLength:t,size:n}).map(o_,s_):ae(i,{minLength:1,maxLength:t,size:n}).map(t_,r_(i))}function u_(e){return new Map(e)}function c_(e){if(typeof e!="object"||e===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in e)||e.constructor!==Map)throw new Error("Incompatible instance received: should be of exact type Map");return Array.from(e)}function d_(e){return e[0]}function gd(e,t,r={}){return Rr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:d_,depthIdentifier:r.depthIdentifier,comparator:"SameValueZero"}).map(u_,c_)}var Ts=10;function f_(e){let t={};return(r=>{let n=r!==void 0?r:Ts;if(!i1(t,n)){let i=Ts;Ts=n-1,t[n]=e(n),Ts=i}return t[n]})}function p_(e){let t=0;for(;e>O(0);)e&O(1)&&++t,e>>=O(1);return t}function h_(e,t){let r=(O(1)<<O(t))-O(1),n=e&r,i=p_(e-n),o=n;for(let s=O(1);s<=r&&i!==0;s<<=O(1))o&s||(o|=s,--i);return o}function Ms(e,t){let r=[];for(let n=e.length-1;n!==-1;--n)t(e[n])!==e[n]&&$(r,n);return r}function m_(e,t,r){let n=O(0);for(let i=0,o=O(1);i!==r.length;++i,o<<=O(1))e[r[i]]!==t[r[i]]&&(n|=o);return n}function Uc(e,t,r,n){for(let i=0,o=O(1);i!==r.length;++i,o<<=O(1))t&o&&(e[r[i]]=n(e[r[i]]))}var g_=class extends de{constructor(e,t,r){super(),this.stringArb=e,this.toggleCase=t,this.untoggleAll=r}buildContextFor(e,t){return{rawString:e.value,rawStringContext:e.context,flags:t.value,flagsContext:t.context}}generate(e,t){let r=this.stringArb.generate(e,t),n=[...r.value],i=Ms(n,this.toggleCase),o=rr(O(0),(O(1)<<O(i.length))-O(1)).generate(e,void 0);return Uc(n,o.value,i,this.toggleCase),new _(ce(n,""),this.buildContextFor(r,o))}canShrinkWithoutContext(e){return typeof e!="string"?!1:this.untoggleAll!==void 0?this.stringArb.canShrinkWithoutContext(this.untoggleAll(e)):this.stringArb.canShrinkWithoutContext(e)}shrink(e,t){let r;if(t!==void 0)r=t;else if(this.untoggleAll!==void 0){let o=this.untoggleAll(e),s=[...e],a=[...o];r={rawString:o,rawStringContext:void 0,flags:m_(a,s,Ms(a,this.toggleCase)),flagsContext:void 0}}else r={rawString:e,rawStringContext:void 0,flags:O(0),flagsContext:void 0};let n=r.rawString,i=r.flags;return this.stringArb.shrink(n,r.rawStringContext).map(o=>{let s=[...o.value],a=Ms(s,this.toggleCase),l=h_(i,a.length);return Uc(s,l,a,this.toggleCase),new _(ce(s,""),this.buildContextFor(o,new _(l,void 0)))}).join(er(()=>{let o=[...n],s=Ms(o,this.toggleCase);return rr(O(0),(O(1)<<O(s.length))-O(1)).shrink(i,r.flagsContext).map(a=>{let l=Le(o);return Uc(l,a.value,s,this.toggleCase),new _(ce(l,""),this.buildContextFor(new _(n,r.rawStringContext),a))})}))}};function y_(e){let t=kd(e);return t!==e?t:Xc(e)}function b_(e,t){return new g_(e,t&&t.toggleCase||y_,t&&t.untoggleAll)}function S_(e){return Zw.from(e)}function w_(e){if(!(e instanceof Zw))throw new Error("Unexpected type");return[...e]}function c0(e={}){return ae(r0(e),e).map(S_,w_)}function v_(e){return Xw.from(e)}function x_(e){if(!(e instanceof Xw))throw new Error("Unexpected type");return[...e]}function d0(e={}){return ae(Ks(e),e).map(v_,x_)}function Vt(e,t,r,n,i){let o=n.name,{min:s=t,max:a=r,...l}=e;if(s>a)throw new Error(`Invalid range passed to ${o}: min must be lower than or equal to max`);if(s<t)throw new Error(`Invalid min value passed to ${o}: min must be greater than or equal to ${t}`);if(a>r)throw new Error(`Invalid max value passed to ${o}: max must be lower than or equal to ${r}`);return ae(i({min:s,max:a}),l).map(u=>n.from(u),u=>{if(!(u instanceof n))throw new Error("Invalid type");return[...u]})}function f0(e={}){return Vt(e,-32768,32767,a4,oe)}function p0(e={}){return Vt(e,-2147483648,2147483647,l4,oe)}function h0(e={}){return Vt(e,-128,127,s4,oe)}function m0(e={}){return Vt(e,0,65535,d4,oe)}function g0(e={}){return Vt(e,0,4294967295,f4,oe)}function y0(e={}){return Vt(e,0,255,u4,oe)}function b0(e={}){return Vt(e,0,255,c4,oe)}function R_(e){return e!==void 0}function Rw(e){return e.hasToBeCloned?new _(e.value_,{generatorContext:e.context},()=>e.value):new _(e.value_,{generatorContext:e.context})}function kw(e){return e.hasToBeCloned?new _(e.value_,{shrinkerContext:e.context},()=>e.value):new _(e.value_,{shrinkerContext:e.context})}var k_=class extends de{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return Rw(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return R_(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(Rw):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(kw):this.shrinkerArbitrary.shrink(e,void 0).map(kw)}};function yd(e,t,r){let n=oe({min:e,max:t});return t===r?n:new k_(n,oe({min:e,max:r}))}var E_=Math.min,bd=Math.max,Ew=Yw.isArray,C_=Object.entries;function A_(e){let t=-1;for(let r=0;r!==e.length;++r)t=bd(t,e[r][0]);return t}function I_(e,t){let r=Yw(e);for(let n=0;n!==t.length;++n){let i=t[n];i[0]<e&&(r[i[0]]=i[1])}return r}function S0(e,t={}){let{size:r,minNumElements:n=0,maxLength:i=xr,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=mi(r,mi(r,n,o,t.maxNumElements!==void 0),i,t.maxLength!==void 0);if(n>i)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(n>o)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let u=E_(o,i),c=t.maxNumElements!==void 0||r!==void 0?r:"=",d=Rr(B(yd(0,bd(l-1,0),bd(i-1,0)),e),{size:c,minLength:n,maxLength:u,selector:p=>p[0],depthIdentifier:a}).map(p=>I_(A_(p)+1,p),p=>{if(!Ew(p))throw new Error("Not supported entry type");if(s&&p.length!==0&&!(p.length-1 in p))throw new Error("No trailing hole");return G(C_(p),h=>[Number(h[0]),h[1]])});return s||i===n?d:B(d,yd(n,l,i)).map(p=>{let h=p[0],f=p[1];if(h.length>=f)return h;let m=Le(h);return m.length=f,m},p=>{if(!Ew(p))throw new Error("Not supported entry type");return[p,p.length]})}function P_(e){return new Set(e)}function T_(e){if(typeof e!="object"||e===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in e)||e.constructor!==Set)throw new Error("Incompatible instance received: should be of exact type Set");return Array.from(e)}function w0(e,t={}){return Rr(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(P_,T_)}function M_(e,t,r,n,i,o){return Dd(e,t,{maxKeys:r,noNullPrototype:!o,size:n,depthIdentifier:i})}function O_(e){return Me(h0(e),y0(e),b0(e),f0(e),m0(e),p0(e),g0(e),c0(e),d0(e))}function v0(e){let t=e.values,r=e.depthSize,n=Nd(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Me(...t,...e.withBigInt?[rr()]:[],...e.withDate?[D1()]:[]);return l0(l=>({anything:Me({maxDepth:i,depthSize:r,depthIdentifier:n},a,l("array"),l("object"),...e.withMap?[l("map")]:[],...e.withSet?[l("set")]:[],...e.withObjectString?[l("anything").map(u=>xe(u))]:[],...e.withTypedArray?[O_({maxLength:o,size:s})]:[],...e.withSparseArray?[S0(l("anything"),{maxNumElements:o,size:s,depthIdentifier:n})]:[]),keys:e.withObjectString?Me({arbitrary:e.key,weight:10},{arbitrary:l("anything").map(u=>xe(u)),weight:1}):e.key,array:ae(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),set:w0(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),map:Me(gd(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n}),gd(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n})),object:M_(l("keys"),l("anything"),o,s,n,e.withNullPrototype)})).anything}function N_(e){switch(typeof e){case"boolean":return new Jw(e);case"number":return new Dt(e);case"string":return new Ve(e);default:return e}}function L_(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===Jw||e.constructor===Dt||e.constructor===Ve?e.valueOf():e}function $_(e){return e.map(N_,L_)}function D_(e,t){return[bi(),o0(),Ks(),t(e),Me(t(e),ve(null),ve(void 0))]}function __(e){return e.map(t=>$_(t))}function F_(e,t){return t?__(e).concat(e):e}function x0(e={}){let t={size:e.size,unit:"stringUnit"in e?e.stringUnit:e.withUnicodeString?"binary":void 0};return{key:e.key!==void 0?e.key:Ce(t),values:F_(e.values!==void 0?e.values:D_(t,Ce),e.withBoxedValues===!0),depthSize:e.depthSize,maxDepth:e.maxDepth,maxKeys:e.maxKeys,size:e.size,withSet:e.withSet===!0,withMap:e.withMap===!0,withObjectString:e.withObjectString===!0,withNullPrototype:e.withNullPrototype===!0,withBigInt:e.withBigInt===!0,withDate:e.withDate===!0,withTypedArray:e.withTypedArray===!0,withSparseArray:e.withSparseArray===!0}}function j_(e){return Dd(e.key,v0(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function V_(e){return j_(x0(e))}function B_(e,t){let{depthSize:r,maxDepth:n}=t;return{key:e,values:[bi(),Ks({noDefaultInfinity:!0,noNaN:!0}),e,ve(null)],depthSize:r,maxDepth:n}}function R0(e){return v0(x0(e))}function k0(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return R0(B_("stringUnit"in e?Ce({unit:e.stringUnit}):t?Ce():Ce({unit:"binary"}),e))}var U_=JSON.stringify,W_=JSON.parse;function z_(e){if(typeof e!="string")throw new L("Cannot unmap the passed value");return W_(e)}function G_(e={}){return k0(e).map(U_,z_)}var H_=Object.defineProperties;function Wc(e,t){return`Stream(${t!==void 0?`${ce(t,",")}\u2026`:`${e} emitted`})`}var q_=class extends de{constructor(e,t){super(),this.arb=e,this.history=t}generate(e,t){let r=t!==void 0&&e.nextInt(1,t)===1?t:void 0,n=()=>{let i=this.history?[]:null,o=0,s=function*(a,l){for(;;){let u=a.generate(l,r).value;o++,i!==null&&$(i,u),yield u}};return H_(new j(s(this.arb,e.clone())),{toString:{value:()=>Wc(o,i!==null?i.map(xe):void 0)},[ft]:{value:()=>Wc(o,i!==null?i.map(xe):void 0)},[Ft]:{value:async()=>Wc(o,i!==null?await Promise.all(i.map(Pd)):void 0)},[Oe]:{value:n,enumerable:!0}})};return new _(n(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function K_(e,t){return new q_(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function Y_(e){return ce(e,"")}function Cw(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function J_(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return ge(e,1)}}function Z_(e){if(typeof e!="string"||e.length%4!==0)throw new Error("Invalid string received");let t=e.indexOf("=");if(t===-1)return e;if(e.length-t>2)throw new Error("Cannot unmap the passed value");return ge(e,0,t)}var zc=String.fromCharCode;function X_(e){return e<26?zc(e+65):e<52?zc(e+97-26):e<62?zc(e+48-52):e===62?"+":"/"}function Q_(e){if(typeof e!="string"||e.length!==1)throw new L("Invalid entry");let t=nn(e,0);return t>=65&&t<=90?t-65:t>=97&&t<=122?t-97+26:t>=48&&t<=57?t-48+52:t===43?62:t===47?63:-1}function e7(){return oe({min:0,max:63}).map(X_,Q_)}function t7(e={}){let{minLength:t=0,maxLength:r=xr,size:n}=e,i=t+3-(t+3)%4,o=r-r%4,s=e.maxLength===void 0&&n===void 0?"=":n;if(i>o)throw new L("Minimal length should be inferior or equal to maximal length");if(i%4!==0)throw new L("Minimal length of base64 strings must be a multiple of 4");if(o%4!==0)throw new L("Maximal length of base64 strings must be a multiple of 4");let a=e7();return ae(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:DL(a,Cw)}).map(Y_,Cw).map(J_,Z_)}var Aw=Object.is;function r7(e,t){let r=new _t,n=0;for(let i of e)Aw(i,-0)?++n:ct(r,i,(Je(r,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(Aw(o,-0)){if(n===0)return!1;--n}else{let s=Je(r,o)||0;if(s===0)return!1;ct(r,o,s-1)}}return!0}var n7=Math.floor,Iw=Math.log,i7=Array.isArray,E0=class extends de{constructor(e,t,r,n){if(super(),this.originalArray=e,this.isOrdered=t,this.minLength=r,this.maxLength=n,r<0||r>e.length)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be between 0 and the size of the original array");if(n<0||n>e.length)throw new Error("fc.*{s|S}ubarrayOf expects the maximal length to be between 0 and the size of the original array");if(r>n)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new sn(r,n),this.biasedLengthArb=r!==n?new sn(r,r+n7(Iw(n-r)/Iw(2))):this.lengthArb}generate(e,t){let r=(t!==void 0&&e.nextInt(1,t)===1?this.biasedLengthArb:this.lengthArb).generate(e,void 0),n=r.value,i=G(this.originalArray,(s,a)=>a),o=[];for(let s=0;s!==n;++s){let a=e.nextInt(0,i.length-1);$(o,i[a]),t1(i,a,1)}return this.isOrdered&&r1(o,(s,a)=>s-a),new _(G(o,s=>this.originalArray[s]),r.context)}canShrinkWithoutContext(e){return!i7(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:r7(this.originalArray,e)}shrink(e,t){return e.length===0?j.nil():this.lengthArb.shrink(e.length,t).map(r=>new _(Le(e,e.length-r.value),r.context)).join(e.length>this.minLength?er(()=>this.shrink(Le(e,1),void 0).filter(r=>this.minLength<=r.value.length+1).map(r=>new _([e[0],...r.value],void 0))):j.nil())}};function o7(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new E0(e,!0,r,n)}function s7(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new E0(e,!1,r,n)}var a7={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F",16:"G",17:"H",18:"J",19:"K",20:"M",21:"N",22:"P",23:"Q",24:"R",25:"S",26:"T",27:"V",28:"W",29:"X",30:"Y",31:"Z"},l7={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,J:18,K:19,M:20,N:21,P:22,Q:23,R:24,S:25,T:26,V:27,W:28,X:29,Y:30,Z:31};function u7(e){return e<10?Ve(e):a7[e]}function Pw(e,t){let r="";for(;e.length+r.length<t;)r+="0";return r+e}function Tw(e){let t="";for(let r=e;r!==0;){let n=r>>5;t=u7(r-(n<<5))+t,r=n}return t}function c7(e,t){let r=~~(e/1073741824),n=e&1073741823;return Pw(Tw(r),t-6)+Pw(Tw(n),6)}function C0(e){return function(r){return c7(r,e)}}function Gc(e){if(typeof e!="string")throw new L("Unsupported type");let t=0,r=1;for(let n=e.length-1;n>=0;--n){let i=l7[e[n]];if(i===void 0)throw new L("Unsupported type");t+=i*r,r*=32}return t}var d7=C0(10),Mw=C0(8);function f7(e){return d7(e[0])+Mw(e[1])+Mw(e[2])}function p7(e){if(typeof e!="string"||e.length!==26)throw new Error("Unsupported type");return[Gc(e.slice(0,10)),Gc(e.slice(10,18)),Gc(e.slice(18))]}function h7(){return B(oe({min:0,max:0xffffffffffff}),oe({min:0,max:0xffffffffff}),oe({min:0,max:0xffffffffff})).map(f7,p7)}function A0(e){return Q4(pi(e,16),8,"0")}function m7(e){if(typeof e!="string")throw new Error("Unsupported type");if(e.length!==8)throw new Error("Unsupported value: invalid length");let t=parseInt(e,16);if(e!==A0(t))throw new Error("Unsupported value: invalid content");return t}function Hc(e,t){return oe({min:e,max:t}).map(A0,m7)}function g7(e){return`${e[0]}-${ge(e[1],4)}-${ge(e[1],0,4)}-${ge(e[2],0,4)}-${ge(e[2],4)}${e[3]}`}var y7=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function b7(e){if(typeof e!="string")throw new Error("Unsupported type");let t=y7.exec(e);if(t===null)throw new Error("Unsupported type");return[t[1],t[3]+t[2],t[4]+ge(t[5],0,4),ge(t[5],4)]}var Ow="0123456789abcdef";function S7(e){let t={},r={};for(let o=0;o!==e.length;++o){let s=Ow[o],a=Ow[e[o]];t[s]=a,r[a]=s}function n(o){return t[o[0]]+ge(o,1)}function i(o){if(typeof o!="string")throw new L("Cannot produce non-string values");let s=r[o[0]];if(s===void 0)throw new L("Cannot produce strings not starting by the version in hexa code");return s+ge(o,1)}return{versionsApplierMapper:n,versionsApplierUnmapper:i}}function w7(e){let t={};for(let r of e){if(t[r])throw new L(`Version ${r} has been requested at least twice for uuid`);if(t[r]=!0,r<1||r>15)throw new L(`Version must be a value in [1-15] for uuid, but received ${r}`);if(~~r!==r)throw new L(`Version must be an integer value for uuid, but received ${r}`)}if(e.length===0)throw new L("Must provide at least one version for uuid")}function v7(e={}){let t=Hc(0,4294967295),r=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];w7(r);let{versionsApplierMapper:n,versionsApplierUnmapper:i}=S7(r);return B(t,Hc(0,268435456*r.length-1).map(n,i),Hc(2147483648,3221225471),t).map(g7,b7)}function x7(e){return Ce({unit:jd("-._~!$&'()*+,;=:"),size:e})}function R7([e,t,r]){return(e===null?"":`${e}@`)+t+(r===null?"":`:${r}`)}function k7(e){if(typeof e!="string")throw new Error("Unsupported");let t=e.indexOf("@"),r=t!==-1?e.substring(0,t):null,n=/:(\d+)$/.exec(e),i=n!==null?Number(n[1]):null;return[r,n!==null?e.substring(t+1,e.length-n[1].length-1):e.substring(t+1),i]}function E7(e){return`[${e}]`}function C7(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function I0(e){let t=e||{},r=t.size,n=[Vd({size:r}),...t.withIPv4===!0?[zd()]:[],...t.withIPv6===!0?[a0().map(E7,C7)]:[],...t.withIPv4Extended===!0?[s0()]:[]];return B(t.withUserInfo===!0?jt(x7(r)):ve(null),Me(...n),t.withPort===!0?jt(Qt(65535)):ve(null)).map(R7,k7)}function P0(e){return Ce({unit:jd("-._~!$&'()*+,;=:@/?"),size:e})}function T0(e={}){return P0(e.size)}function M0(e={}){return Ce({unit:jd("-._~!$&'()*+,;=:@"),size:e.size})}function A7(e){return ce(G(e,t=>`/${t}`),"")}function I7(e){if(typeof e!="string")throw new Error("Incompatible value received: type");if(e.length!==0&&e[0]!=="/")throw new Error("Incompatible value received: start");return t1(Be(e,"/"),1)}function P7(e){switch(e){case"xsmall":return["xsmall","xsmall"];case"small":return["small","xsmall"];case"medium":return["small","small"];case"large":return["medium","small"];case"xlarge":return["medium","medium"]}}function qc(e,t){return ae(M0({size:e}),{size:t}).map(A7,I7)}function T7(e){let[t,r]=P7(e);return t===r?qc(t,r):Me(qc(t,r),qc(r,t))}function O0(e){return T7($d((e||{}).size))}function N0(e={}){return P0(e.size)}function M7(e){let[t,r,n]=e;return`${t}://${r}${n}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var O7=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function N7(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=O7.exec(e);if(t===null)throw new Error("Incompatible value received");let r=t[1],n=t[2],i=t[3],o=t[4],s=t[5];return[r,n,i,o!==void 0?o.substring(1):null,s!==void 0?s.substring(1):null]}function L7(e){let t=e||{},r=$d(t.size),n=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?yi(t.authoritySettings.size,r):r,i={...t.authoritySettings,size:n};return B(vt(...t.validSchemes||["http","https"]),I0(i),O0({size:r}),t.withQueryParameters===!0?jt(N0({size:r})):ve(null),t.withFragments===!0?jt(T0({size:r})):ve(null)).map(M7,N7)}var $7=class L0{constructor(t,r){this.commands=t,this.metadataForReplay=r,this[Oe]=function(){return new L0(this.commands.map(n=>n.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let t=this.commands.filter(n=>n.hasRan).map(n=>n.toString()).join(","),r=this.metadataForReplay();return r.length!==0?`${t} /*${r}*/`:t}},D7=class Sd{constructor(t){if(this.cmd=t,this.hasRan=!1,Ad(t)){let r=t[ft];this[ft]=function(){return r.call(t)}}if(Id(t)){let r=t[Ft];this[Ft]=function(){return r.call(t)}}}check(t){return this.cmd.check(t)}run(t,r){return this.hasRan=!0,this.cmd.run(t,r)}clone(){return vr(this.cmd)?new Sd(this.cmd[Oe]()):new Sd(this.cmd)}toString(){return this.cmd.toString()}},Nw=class{static parse(e){let[t,r]=e.split(":"),n=this.parseCounts(t),i=this.parseChanges(r);return this.parseOccurences(n,i)}static stringify(e){let t=this.countOccurences(e);return`${this.stringifyCounts(t)}:${this.stringifyChanges(t)}`}static intToB64(e){return e<26?String.fromCharCode(e+65):e<52?String.fromCharCode(e+97-26):e<62?String.fromCharCode(e+48-52):String.fromCharCode(e===62?43:47)}static b64ToInt(e){return e>="a"?e.charCodeAt(0)-97+26:e>="A"?e.charCodeAt(0)-65:e>="0"?e.charCodeAt(0)-48+52:e==="+"?62:63}static countOccurences(e){return e.reduce((t,r)=>(t.length===0||t[t.length-1].count===64||t[t.length-1].value!==r?t.push({value:r,count:1}):t[t.length-1].count+=1,t),[])}static parseOccurences(e,t){let r=[];for(let n=0;n!==e.length;++n){let i=e[n],o=t[n];for(let s=0;s!==i;++s)r.push(o)}return r}static stringifyChanges(e){let t="";for(let r=0;r<e.length;r+=6){let n=e.slice(r,r+6).reduceRight((i,o)=>(i<<1)+(o.value?1:0),0);t+=this.intToB64(n)}return t}static parseChanges(e){let t=e.split("").map(n=>this.b64ToInt(n)),r=[];for(let n=0;n!==t.length;++n){let i=t[n];for(let o=0;o!==6;++o,i>>=1)r.push(i%2===1)}return r}static stringifyCounts(e){return e.map(({count:t})=>this.intToB64(t-1)).join("")}static parseCounts(e){return e.split("").map(t=>this.b64ToInt(t)+1)}},_7=class extends de{constructor(e,t,r,n,i){super(),this.sourceReplayPath=n,this.disableReplayLog=i,this.oneCommandArb=Me(...e).map(o=>new D7(o)),this.lengthArb=yd(0,t,r),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(Nw.stringify(this.replayPath))}`}buildValueFor(e,t){let r=e.map(i=>i.value_),n={shrunkOnce:t,items:e};return new _(new $7(r,()=>this.metadataForReplay()),n)}generate(e){let t=this.lengthArb.generate(e,void 0).value,r=Array(t);for(let n=0;n!==t;++n)r[n]=this.oneCommandArb.generate(e,void 0);return this.replayPathPosition=0,this.buildValueFor(r,!1)}canShrinkWithoutContext(e){return!1}filterOnExecution(e){let t=[];for(let r of e)r.value_.hasRan?(this.replayPath.push(!0),t.push(r)):this.replayPath.push(!1);return t}filterOnReplay(e){return e.filter((t,r)=>{let n=this.replayPath[this.replayPathPosition+r];if(n===void 0)throw new Error("Too short replayPath");if(!n&&t.value_.hasRan)throw new Error("Mismatch between replayPath and real execution");return n})}filterForShrinkImpl(e){this.replayPathPosition===0&&(this.replayPath=this.sourceReplayPath!==null?Nw.parse(this.sourceReplayPath):[]);let t=this.replayPathPosition<this.replayPath.length?this.filterOnReplay(e):this.filterOnExecution(e);return this.replayPathPosition+=e.length,t}shrink(e,t){if(t===void 0)return j.nil();let r=t,n=r.shrunkOnce,i=r.items,o=this.filterForShrinkImpl(i);if(o.length===0)return j.nil();let s=n?j.nil():new j([[]][Symbol.iterator]()),a=[];for(let l=0;l!==o.length;++l)a.push(er(()=>{let u=o.slice(0,l);return this.lengthArb.shrink(o.length-1-l,void 0).map(c=>u.concat(o.slice(o.length-(c.value+1))))}));for(let l=0;l!==o.length;++l)a.push(er(()=>this.oneCommandArb.shrink(o[l].value_,o[l].context).map(u=>o.slice(0,l).concat([u],o.slice(l+1)))));return s.join(...a).map(l=>this.buildValueFor(l.map(u=>new _(u.value_.clone(),u.context)),!0))}};function F7(e,t={}){let{size:r,maxCommands:n=xr,disableReplayLog:i=!1,replayPath:o=null}=t;return new _7(e,mi(r,0,n,t.maxCommands!==void 0),n,o,i)}var j7=class{constructor(e,t){this.s=e,this.cmd=t}async check(e){let t=null,r=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{r=await Promise.resolve(this.cmd.check(e))}catch(n){throw t=n,n}}}]).task).faulty)throw t;return r}async run(e,t){let r=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(e,t)}catch(n){throw r=n,n}}}]).task).faulty)throw r}},V7=function*(e,t){for(let r of t)yield new j7(e,r)},$0=(e,t,r,n,i)=>e.then(o=>{let{model:s,real:a}=o,l=r;for(let u of t)l=i(l,()=>n(u,s,a));return l}),B7=(e,t)=>$0({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),U7=e=>typeof e.then=="function",D0=async(e,t,r=Promise.resolve())=>await $0({then:s=>{let a=e();return U7(a)?a.then(s):s(a)}},t,r,async(s,a,l)=>{await s.check(a)&&await s.run(a,l)},(s,a)=>s.then(a));function W7(e,t){B7(e,t)}async function z7(e,t){await D0(e,t)}async function G7(e,t,r){let n=D0(t,V7(e,r),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(n),await e.waitAll()}var Os=e=>e(),_0=class wd{constructor(t,r){this.act=t,this.taskSelector=r,this.lastTaskId=0,this.sourceTaskSelector=r.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Oe]=function(){return new wd(this.act,this.sourceTaskSelector)}}static buildLog(t){return`[task\${${t.taskId}}] ${t.label.length!==0?`${t.schedulingType}::${t.label}`:t.schedulingType} ${t.status}${t.outputValue!==void 0?` with value ${Y$(t.outputValue)}`:""}`}log(t,r,n,i,o,s){this.triggeredTasks.push({status:o,schedulingType:t,taskId:r,label:n,metadata:i,outputValue:s!==void 0?xe(s):void 0})}scheduleInternal(t,r,n,i,o,s){let a=++this.lastTaskId,l,u=new Promise((c,d)=>{l=()=>{let p=Promise.resolve(s!==void 0?n.then(()=>s()):n);return p.then(h=>{this.log(t,a,r,i,"resolved",h),c(h)},h=>{this.log(t,a,r,i,"rejected",h),d(h)}),p}});return this.scheduledTasks.push({original:n,trigger:l,schedulingType:t,taskId:a,label:r,metadata:i,customAct:o}),this.scheduledWatchers.length!==0&&this.scheduledWatchers[0](),u}schedule(t,r,n,i){return this.scheduleInternal("promise",r||"",t,n,i||Os)}scheduleFunction(t,r){return(...n)=>this.scheduleInternal("function",`${t.name}(${n.map(xe).join(",")})`,t(...n),void 0,r||Os)}scheduleSequence(t,r){let n={done:!1,faulty:!1},i={then:c=>c()},o=()=>{},s=new Promise(c=>{o=()=>c({done:n.done,faulty:n.faulty})}),a=()=>{n.faulty=!0,o()},l=()=>{n.done=!0,o()},u=(c,d)=>{if(c>=t.length){d.then(l,a);return}d.then(()=>{let p=t[c],[h,f,m]=typeof p=="function"?[p,p.name,void 0]:[p.builder,p.label,p.metadata],g=this.scheduleInternal("sequence",f,i,m,r||Os,()=>h());u(c+1,g)},a)};return u(0,i),Object.assign(n,{task:s})}count(){return this.scheduledTasks.length}internalWaitOne(){if(this.scheduledTasks.length===0)throw new Error("No task scheduled");let t=this.taskSelector.nextTaskIndex(this.scheduledTasks),[r]=this.scheduledTasks.splice(t,1);return r.customAct(()=>r.trigger().catch(n=>{}))}waitOne(t){let r=t||Os;return this.act(()=>r(()=>this.internalWaitOne()))}async waitAll(t){for(;this.scheduledTasks.length>0;)await this.waitOne(t)}async internalWaitFor(t,r){let n=!1,i=r.customAct,o=r.onWaitStart,s=r.onWaitIdle,a=r.launchAwaiterOnInit,l,u,c=0,d=null,p=null,h=async()=>{for(c=50,c=50;!n&&c>0;--c)await Promise.resolve();if(!n&&this.scheduledTasks.length>0)return o!==void 0&&o(),p=this.waitOne(i),p.then(()=>(p=null,h()),S=>{throw p=null,n=!0,u(S),S});!n&&s!==void 0&&s(),d=null},f=()=>{if(d!==null){c=51;return}d=h().catch(()=>{})},m=()=>{let S=this.scheduledWatchers.indexOf(f);S!==-1&&this.scheduledWatchers.splice(S,1),S===0&&this.scheduledWatchers.length!==0&&this.scheduledWatchers[0]()},g=new Promise((S,w)=>{l=y=>{m(),S(y)},u=y=>{m(),w(y)}});return t.then(S=>{n=!0,p===null?l(S):p.then(()=>l(S),w=>u(w))},S=>{n=!0,p===null?u(S):p.then(()=>u(S),()=>u(S))}),(this.scheduledTasks.length>0||a)&&this.scheduledWatchers.length===0&&f(),this.scheduledWatchers.push(f),g}waitNext(t,r){let n,i=t,o=i<=0?Promise.resolve():new Promise(s=>{n=()=>{--i<=0&&s()}});return this.internalWaitFor(o,{customAct:r,onWaitStart:n,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(t){let r,n=new Promise(i=>r=i);return this.internalWaitFor(n,{customAct:t,onWaitStart:void 0,onWaitIdle:r,launchAwaiterOnInit:!0})}waitFor(t,r){return this.internalWaitFor(t,{customAct:r,onWaitStart:void 0,onWaitIdle:void 0,launchAwaiterOnInit:!1})}report(){return[...this.triggeredTasks,...this.scheduledTasks.map(t=>({status:"pending",schedulingType:t.schedulingType,taskId:t.taskId,label:t.label,metadata:t.metadata}))]}toString(){return"schedulerFor()`\n"+this.report().map(wd.buildLog).map(t=>`-> ${t}`).join(`
132
- `)+"`"}};function F0(e){let t=0;return{clone:()=>F0(e),nextTaskIndex:r=>{if(e.length<=t)throw new Error("Invalid schedulerFor defined: too many tasks have been scheduled");let n=r.findIndex(i=>i.taskId===e[t]);if(n===-1)throw new Error("Invalid schedulerFor defined: unable to find next task");return++t,n}}}function Lw(e,t){return new _0(e,F0(t))}function j0(e){let t=e.clone();return{clone:()=>j0(t),nextTaskIndex:r=>e.nextInt(0,r.length-1)}}var H7=class extends de{constructor(e){super(),this.act=e}generate(e,t){return new _(new _0(this.act,j0(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function q7(e){let{act:t=r=>r()}=e||{};return new H7(t)}function K7(e,t){let{act:r=n=>n()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?Lw(r,e):function(n,...i){return Lw(r,i)}}function Y7(e={}){return Vt(e,O("-9223372036854775808"),O("9223372036854775807"),i4,rr)}function J7(e={}){return Vt(e,O(0),O("18446744073709551615"),o4,rr)}function Z7(e,t){return t}var Kc=Math.floor,X7=Math.min;function et(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let r=et(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:r.astNode},minLength:0}}case"+":{let r=et(e.expression,t),n=r.minLength>1?r.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:Kc(t/n)},expression:r.astNode},minLength:r.minLength}}case"?":{let r=et(e.expression,t);return t<r.minLength?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:0},expression:r.astNode},minLength:0}:{astNode:{...e,expression:r.astNode},minLength:0}}case"Range":{let r=e.quantifier.from>1?Kc(t/e.quantifier.from):t,n=et(e.expression,r),i=n.minLength>1?n.minLength:1;return e.quantifier.to===void 0||e.quantifier.to*i>t?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",to:Kc(t/i)},expression:n.astNode},minLength:e.quantifier.from*n.minLength}:{astNode:{...e,expression:n.astNode},minLength:e.quantifier.from*n.minLength}}default:return Z7(e.quantifier,{astNode:e,minLength:0})}case"Quantifier":return{astNode:e,minLength:0};case"Alternative":{let r=0,n=[];for(let o=0;o!==e.expressions.length;++o){let s=t-r,a=et(e.expressions[o],s);r+=a.minLength,$(n,{value:a,allowance:s})}let i=[];for(let o=0;o!==n.length;++o){let s=n[o].value,a=n[o].allowance,l=t-r+s.minLength;$(i,(l!==a?et(s.astNode,l):s).astNode)}return{astNode:{...e,expressions:i},minLength:r}}case"CharacterClass":return{astNode:e,minLength:1};case"ClassRange":return{astNode:e,minLength:1};case"Group":{let r=et(e.expression,t);return{astNode:{...e,expression:r.astNode},minLength:r.minLength}}case"Disjunction":{if(e.left===null){if(e.right===null)return{astNode:e,minLength:0};let i=et(e.right,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:null,right:o},minLength:0}}if(e.right===null){let i=et(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let r=et(e.left,t),n=et(e.right,t);return r.minLength>t?n:n.minLength>t?r:{astNode:{...e,left:r.astNode,right:n.astNode},minLength:X7(r.minLength,n.minLength)}}case"Assertion":return{astNode:e,minLength:0};case"Backreference":return{astNode:e,minLength:0};case"UnicodeProperty":return{astNode:e,minLength:1}}}function Q7(e,t){return et(e,t).astNode}function e8(e){return new Error(`Unsupported AST node! Received: ${xe(e)}`)}function js(e,t,r){if(!t&&!r)return e;let n={hasStart:!1,hasEnd:!1},i=V0(e,t,r,n),o=t&&!n.hasStart,s=r&&!n.hasEnd;if(!o&&!s)return i;let a=[];return o&&(a.push({type:"Assertion",kind:"^"}),a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}})),a.push(i),s&&(a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}}),a.push({type:"Assertion",kind:"$"})),{type:"Group",capturing:!1,expression:{type:"Alternative",expressions:a}}}function V0(e,t,r,n){switch(e.type){case"Char":return e;case"Repetition":return e;case"Quantifier":throw new Error("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return n.hasStart=!0,n.hasEnd=!0,{...e,expressions:e.expressions.map((i,o)=>js(i,t&&o===0,r&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:V0(e.expression,t,r,n)};case"Disjunction":return n.hasStart=!0,n.hasEnd=!0,{...e,left:e.left!==null?js(e.left,t,r):null,right:e.right!==null?js(e.right,t,r):null};case"Assertion":if(e.kind==="^"||e.kind==="Lookahead")return n.hasStart=!0,e;if(e.kind==="$"||e.kind==="Lookbehind")return n.hasEnd=!0,e;throw new Error(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":return e;case"UnicodeProperty":return e;default:throw e8(e)}}function t8(e){return js(e,!0,!0)}function $w(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Ee(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function vd(e){return e>="0"&&e<="9"}function B0(e,t){for(let r=t;r!==e.length;++r){let n=e[r];if(n==="\\")r+=1;else if(n==="]")return r}throw new Error("Missing closing ']'")}function r8(e,t){let r=0;for(let n=t;n!==e.length;++n){let i=e[n];if(i==="\\")n+=1;else if(i===")"){if(r===0)return n;r-=1}else i==="["?n=B0(e,n):i==="("&&(r+=1)}throw new Error("Missing closing ')'")}function n8(e,t){let r=!1;for(let n=t;n!==e.length;++n){let i=e[n];if(!vd(i)){if(t===n)return-1;if(i===","){if(r)return-1;r=!0}else return i==="}"?n:-1}}return-1}function i8(e,t,r,n){switch(e[t]){case"[":return n===1?t+1:B0(e,t+1)+1;case"{":{if(n===1)return t+1;let i=n8(e,t+1);return i===-1?t+1:i+1}case"(":return n===1?t+1:r8(e,t+1)+1;case"]":case"}":case")":return t+1;case"\\":{let i=e[t+1];switch(i){case"x":if(Ee(e[t+2])&&Ee(e[t+3]))return t+4;throw new Error(`Unexpected token '${e.substring(t,t+4)}' found`);case"u":if(e[t+2]==="{"){if(!r)return t+2;if(e[t+4]==="}"){if(Ee(e[t+3]))return t+5;throw new Error(`Unexpected token '${e.substring(t,t+5)}' found`)}if(e[t+5]==="}"){if(Ee(e[t+3])&&Ee(e[t+4]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`)}if(e[t+6]==="}"){if(Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5]))return t+7;throw new Error(`Unexpected token '${e.substring(t,t+7)}' found`)}if(e[t+7]==="}"){if(Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5])&&Ee(e[t+6]))return t+8;throw new Error(`Unexpected token '${e.substring(t,t+8)}' found`)}if(e[t+8]==="}"&&Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5])&&Ee(e[t+6])&&Ee(e[t+7]))return t+9;throw new Error(`Unexpected token '${e.substring(t,t+9)}' found`)}if(Ee(e[t+2])&&Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`);case"p":case"P":{if(!r)return t+2;let o=t+2;for(;o<e.length&&e[o]!=="}";o+=e[o]==="\\"?2:1);if(e[o]!=="}")throw new Error("Invalid \\P definition");return o+1}case"k":{let o=t+2;for(;o<e.length&&e[o]!==">";++o);if(e[o]!==">"){if(!r)return t+2;throw new Error("Invalid \\k definition")}return o+1}default:if(vd(i)){let o=r?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&vd(e[s]);++s);return s}return t+(r?$w(e,t+1):1)+1}}default:return t+(r?$w(e,t):1)}}function Ns(e,t,r,n){let i=i8(e,t,r,n);return e.substring(t,i)}var Dw={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},Ys={ASCII:"ASCII",ASCII_Hex_Digit:"AHex",Alphabetic:"Alpha",Any:"Any",Assigned:"Assigned",Bidi_Control:"Bidi_C",Bidi_Mirrored:"Bidi_M",Case_Ignorable:"CI",Cased:"Cased",Changes_When_Casefolded:"CWCF",Changes_When_Casemapped:"CWCM",Changes_When_Lowercased:"CWL",Changes_When_NFKC_Casefolded:"CWKCF",Changes_When_Titlecased:"CWT",Changes_When_Uppercased:"CWU",Dash:"Dash",Default_Ignorable_Code_Point:"DI",Deprecated:"Dep",Diacritic:"Dia",Emoji:"Emoji",Emoji_Component:"Emoji_Component",Emoji_Modifier:"Emoji_Modifier",Emoji_Modifier_Base:"Emoji_Modifier_Base",Emoji_Presentation:"Emoji_Presentation",Extended_Pictographic:"Extended_Pictographic",Extender:"Ext",Grapheme_Base:"Gr_Base",Grapheme_Extend:"Gr_Ext",Hex_Digit:"Hex",IDS_Binary_Operator:"IDSB",IDS_Trinary_Operator:"IDST",ID_Continue:"IDC",ID_Start:"IDS",Ideographic:"Ideo",Join_Control:"Join_C",Logical_Order_Exception:"LOE",Lowercase:"Lower",Math:"Math",Noncharacter_Code_Point:"NChar",Pattern_Syntax:"Pat_Syn",Pattern_White_Space:"Pat_WS",Quotation_Mark:"QMark",Radical:"Radical",Regional_Indicator:"RI",Sentence_Terminal:"STerm",Soft_Dotted:"SD",Terminal_Punctuation:"Term",Unified_Ideograph:"UIdeo",Uppercase:"Upper",Variation_Selector:"VS",White_Space:"space",XID_Continue:"XIDC",XID_Start:"XIDS"},gi=Kd(Ys),qd={Cased_Letter:"LC",Close_Punctuation:"Pe",Connector_Punctuation:"Pc",Control:["Cc","cntrl"],Currency_Symbol:"Sc",Dash_Punctuation:"Pd",Decimal_Number:["Nd","digit"],Enclosing_Mark:"Me",Final_Punctuation:"Pf",Format:"Cf",Initial_Punctuation:"Pi",Letter:"L",Letter_Number:"Nl",Line_Separator:"Zl",Lowercase_Letter:"Ll",Mark:["M","Combining_Mark"],Math_Symbol:"Sm",Modifier_Letter:"Lm",Modifier_Symbol:"Sk",Nonspacing_Mark:"Mn",Number:"N",Open_Punctuation:"Ps",Other:"C",Other_Letter:"Lo",Other_Number:"No",Other_Punctuation:"Po",Other_Symbol:"So",Paragraph_Separator:"Zp",Private_Use:"Co",Punctuation:["P","punct"],Separator:"Z",Space_Separator:"Zs",Spacing_Mark:"Mc",Surrogate:"Cs",Symbol:"S",Titlecase_Letter:"Lt",Unassigned:"Cn",Uppercase_Letter:"Lu"},xd=Kd(qd),U0={Adlam:"Adlm",Ahom:"Ahom",Anatolian_Hieroglyphs:"Hluw",Arabic:"Arab",Armenian:"Armn",Avestan:"Avst",Balinese:"Bali",Bamum:"Bamu",Bassa_Vah:"Bass",Batak:"Batk",Bengali:"Beng",Bhaiksuki:"Bhks",Bopomofo:"Bopo",Brahmi:"Brah",Braille:"Brai",Buginese:"Bugi",Buhid:"Buhd",Canadian_Aboriginal:"Cans",Carian:"Cari",Caucasian_Albanian:"Aghb",Chakma:"Cakm",Cham:"Cham",Cherokee:"Cher",Common:"Zyyy",Coptic:["Copt","Qaac"],Cuneiform:"Xsux",Cypriot:"Cprt",Cyrillic:"Cyrl",Deseret:"Dsrt",Devanagari:"Deva",Dogra:"Dogr",Duployan:"Dupl",Egyptian_Hieroglyphs:"Egyp",Elbasan:"Elba",Ethiopic:"Ethi",Georgian:"Geor",Glagolitic:"Glag",Gothic:"Goth",Grantha:"Gran",Greek:"Grek",Gujarati:"Gujr",Gunjala_Gondi:"Gong",Gurmukhi:"Guru",Han:"Hani",Hangul:"Hang",Hanifi_Rohingya:"Rohg",Hanunoo:"Hano",Hatran:"Hatr",Hebrew:"Hebr",Hiragana:"Hira",Imperial_Aramaic:"Armi",Inherited:["Zinh","Qaai"],Inscriptional_Pahlavi:"Phli",Inscriptional_Parthian:"Prti",Javanese:"Java",Kaithi:"Kthi",Kannada:"Knda",Katakana:"Kana",Kayah_Li:"Kali",Kharoshthi:"Khar",Khmer:"Khmr",Khojki:"Khoj",Khudawadi:"Sind",Lao:"Laoo",Latin:"Latn",Lepcha:"Lepc",Limbu:"Limb",Linear_A:"Lina",Linear_B:"Linb",Lisu:"Lisu",Lycian:"Lyci",Lydian:"Lydi",Mahajani:"Mahj",Makasar:"Maka",Malayalam:"Mlym",Mandaic:"Mand",Manichaean:"Mani",Marchen:"Marc",Medefaidrin:"Medf",Masaram_Gondi:"Gonm",Meetei_Mayek:"Mtei",Mende_Kikakui:"Mend",Meroitic_Cursive:"Merc",Meroitic_Hieroglyphs:"Mero",Miao:"Plrd",Modi:"Modi",Mongolian:"Mong",Mro:"Mroo",Multani:"Mult",Myanmar:"Mymr",Nabataean:"Nbat",New_Tai_Lue:"Talu",Newa:"Newa",Nko:"Nkoo",Nushu:"Nshu",Ogham:"Ogam",Ol_Chiki:"Olck",Old_Hungarian:"Hung",Old_Italic:"Ital",Old_North_Arabian:"Narb",Old_Permic:"Perm",Old_Persian:"Xpeo",Old_Sogdian:"Sogo",Old_South_Arabian:"Sarb",Old_Turkic:"Orkh",Oriya:"Orya",Osage:"Osge",Osmanya:"Osma",Pahawh_Hmong:"Hmng",Palmyrene:"Palm",Pau_Cin_Hau:"Pauc",Phags_Pa:"Phag",Phoenician:"Phnx",Psalter_Pahlavi:"Phlp",Rejang:"Rjng",Runic:"Runr",Samaritan:"Samr",Saurashtra:"Saur",Sharada:"Shrd",Shavian:"Shaw",Siddham:"Sidd",SignWriting:"Sgnw",Sinhala:"Sinh",Sogdian:"Sogd",Sora_Sompeng:"Sora",Soyombo:"Soyo",Sundanese:"Sund",Syloti_Nagri:"Sylo",Syriac:"Syrc",Tagalog:"Tglg",Tagbanwa:"Tagb",Tai_Le:"Tale",Tai_Tham:"Lana",Tai_Viet:"Tavt",Takri:"Takr",Tamil:"Taml",Tangut:"Tang",Telugu:"Telu",Thaana:"Thaa",Thai:"Thai",Tibetan:"Tibt",Tifinagh:"Tfng",Tirhuta:"Tirh",Ugaritic:"Ugar",Vai:"Vaii",Warang_Citi:"Wara",Yi:"Yiii",Zanabazar_Square:"Zanb"},_w=Kd(U0);function Kd(e){let t={};for(let r of Object.keys(e)){let n=e[r];if(Array.isArray(n))for(let i=0;i!==n.length;++i)t[n[i]]=r;else t[n]=r}return t}function o8(e){return e in qd||e in xd}function s8(e){return e in Ys||e in gi}function Fw(e){if(e in Dw)return Dw[e];if(e in gi)return gi[e];if(e in Ys||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function jw(e){if(e in xd)return xd[e];if(e in _w)return _w[e];if(e in gi)return gi[e];if(e in qd||e in U0||e in Ys)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function a8(e,t){let r=e.indexOf("=");if(r!==-1){let n=e.substring(0,r),i=e.substring(r+1);return{type:"UnicodeProperty",name:n,value:i,negative:t,shorthand:!1,binary:!1,canonicalName:Fw(n),canonicalValue:jw(i)}}if(o8(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:jw(e)};if(s8(e)){let n=Fw(e);return{type:"UnicodeProperty",name:e,value:e,negative:t,shorthand:!1,binary:!0,canonicalName:n,canonicalValue:n}}throw new Error(`Invalid Unicode property: ${e}`)}var Yc=String.fromCodePoint;function Jc(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function W0(e){return e>="0"&&e<="9"}function Vs(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function Qr(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function Zt(e,t){if(e.length>1)return{type:"Alternative",expressions:e};if(!t&&e.length===0)throw new Error("Unsupported no token");return e[0]}function Zc(e){if(e[0]==="\\"){let t=e[1];switch(t){case"x":{let r=e.substring(2),n=Number.parseInt(r,16);return{type:"Char",kind:"hex",symbol:Yc(n),value:e,codePoint:n}}case"u":{if(e==="\\u")return Vs("u",!0);let r=e[2]==="{"?e.substring(3,e.length-1):e.substring(2),n=Number.parseInt(r,16);return{type:"Char",kind:"unicode",symbol:Yc(n),value:e,codePoint:n}}case"0":return Qr(e,"\0");case"n":return Qr(e,`
133
- `);case"f":return Qr(e,"\f");case"r":return Qr(e,"\r");case"t":return Qr(e," ");case"v":return Qr(e,"\v");case"w":case"W":case"d":case"D":case"s":case"S":case"b":case"B":return{type:"Char",kind:"meta",symbol:void 0,value:e,codePoint:NaN};default:if(W0(t)){let r=e.substring(1),n=Number(r);return{type:"Char",kind:"decimal",symbol:Yc(n),value:e,codePoint:n}}if(e.length>2&&(t==="p"||t==="P")){let r=t==="P";return a8(e.substring(3,e.length-1),r)}return Vs(e.substring(1),!0)}}return Vs(e)}function en(e,t,r,n){let i=null;for(let o=0,s=Ns(t,o,r,0);o!==t.length;o+=s.length,s=Ns(t,o,r,0)){let a=s[0];switch(a){case"|":i===null&&(i=[]),i.push(Zt(e.splice(0),!0)||null);break;case".":e.push({type:"Char",kind:"meta",symbol:s,value:s,codePoint:NaN});break;case"*":case"+":{let l=Jc(e);e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"?":{let l=Jc(e);l.type==="Repetition"?(l.quantifier.greedy=!1,e.push(l)):e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"{":{if(s==="{"){e.push(Vs(s));break}let l=Jc(e),u=s.substring(1,s.length-1).split(","),c=Number(u[0]),d=u.length===1?c:u[1].length!==0?Number(u[1]):void 0;e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:"Range",greedy:!0,from:c,to:d}});break}case"[":{let l=s.substring(1,s.length-1),u=[],c,d=!1;for(let p=0,h=Ns(l,p,r,1);p!==l.length;p+=h.length,h=Ns(l,p,r,1)){if(p===0&&h==="^"){c=!0;continue}let f=Zc(h);if(h==="-")u.push(f),d=!0;else{let m=u.length>=2?u[u.length-2]:void 0;d&&m!==void 0&&m.type==="Char"&&f.type==="Char"?(u.pop(),u.pop(),u.push({type:"ClassRange",from:m,to:f})):u.push(f),d=!1}}e.push({type:"CharacterClass",expressions:u,negative:c});break}case"(":{let l=s.substring(1,s.length-1),u=[];if(l[0]==="?")if(l[1]===":")en(u,l.substring(2),r,n),e.push({type:"Group",capturing:!1,expression:Zt(u)});else if(l[1]==="="||l[1]==="!")en(u,l.substring(2),r,n),e.push({type:"Assertion",kind:"Lookahead",negative:l[1]==="!"?!0:void 0,assertion:Zt(u)});else if(l[1]==="<"&&(l[2]==="="||l[2]==="!"))en(u,l.substring(3),r,n),e.push({type:"Assertion",kind:"Lookbehind",negative:l[2]==="!"?!0:void 0,assertion:Zt(u)});else{let c=l.split(">");if(c.length<2||c[0][1]!=="<")throw new Error(`Unsupported regex content found at ${JSON.stringify(s)}`);let d=++n.lastIndex,p=c[0].substring(2);n.named.set(p,d),en(u,c.slice(1).join(">"),r,n),e.push({type:"Group",capturing:!0,nameRaw:p,name:p,number:d,expression:Zt(u)})}else{let c=++n.lastIndex;en(u,l,r,n),e.push({type:"Group",capturing:!0,number:c,expression:Zt(u)})}break}default:if(s==="^")e.push({type:"Assertion",kind:s});else if(s==="$")e.push({type:"Assertion",kind:s});else if(s[0]==="\\"&&W0(s[1])){let l=Number(s.substring(1));r||l<=n.lastIndex?e.push({type:"Backreference",kind:"number",number:l,reference:l}):e.push(Zc(s))}else if(s[0]==="\\"&&s[1]==="k"&&s.length!==2){let l=s.substring(3,s.length-1);e.push({type:"Backreference",kind:"name",number:n.named.get(l)||0,referenceRaw:l,reference:l})}else e.push(Zc(s));break}}if(i!==null){i.push(Zt(e.splice(0),!0)||null);let o={type:"Disjunction",left:i[0],right:i[1]};for(let s=2;s<i.length;++s)o={type:"Disjunction",left:o,right:i[s]};e.push(o)}}function l8(e){let t=$t([...e.flags],"u")!==-1,r=e.source,n=[];return en(n,r,t,{lastIndex:0,named:new Map}),Zt(n)}var u8=String.fromCodePoint;function c8(e){return e.binary||e.shorthand?e.canonicalValue:`${e.canonicalName}=${e.canonicalValue}`}function Vw(e,t,r,n){let i=-1;for(let o=t;o<=r;++o)if(e.test(u8(o)))i===-1&&(i=o);else if(i!==-1){let s=o-1;n.push(i===s?[s]:[i,s]),i=-1}i!==-1&&n.push(i===r?[r]:[i,r])}function d8(e,t){let r=new RegExp(`^\\${t?"P":"p"}{${e}}$`,"u"),n=[];return Vw(r,0,55295,n),Vw(r,57344,1114111,n),n}var Bw=new Map;function f8(e,t){let r=`${t?"P":"p"}:${e}`,n=Bw.get(r);if(n!==void 0)return n;let i=d8(e,t);return Bw.set(r,i),i}function p8(e){return an(...G(f8(c8(e),e.negative),t=>id(t)))}var h8=String.fromCodePoint,Uw=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],Ww=[..."0123456789"],zw=[...` \r
134
- \v\f`],Rd=[...`\r
135
- `],z0=[...""],m8=[...Rd,...z0],wr=()=>Ce({unit:"grapheme-ascii",minLength:1,maxLength:1});function Gw(e){return new L(`Unsupported AST node! Received: ${xe(e)}`)}function Xt(e,t,r){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return vt(...Uw);case"\\W":return wr().filter(n=>$t(Uw,n)===-1);case"\\d":return vt(...Ww);case"\\D":return wr().filter(n=>$t(Ww,n)===-1);case"\\s":return vt(...zw);case"\\S":return wr().filter(n=>$t(zw,n)===-1);case"\\b":case"\\B":throw new L(`Meta character ${e.value} not implemented yet!`);case".":{let n=r.dotAll?z0:m8;return wr().filter(i=>$t(n,i)===-1)}}if(e.symbol===void 0)throw new L(`Unexpected undefined symbol received for non-meta Char! Received: ${xe(e)}`);return ve(e.symbol);case"Repetition":{let n=Xt(e.expression,t,r);switch(e.quantifier.kind){case"*":return Ce({...t,unit:n});case"+":return Ce({...t,minLength:1,unit:n});case"?":return Ce({...t,minLength:0,maxLength:1,unit:n});case"Range":return Ce({...t,minLength:e.quantifier.from,maxLength:e.quantifier.to,unit:n});default:throw Gw(e.quantifier)}}case"Quantifier":throw new L("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return B(...G(e.expressions,n=>Xt(n,t,r))).map(n=>ce(n,""));case"CharacterClass":if(e.negative){let n=G(e.expressions,i=>Xt(i,t,r));return wr().filter(i=>n1(n,o=>!o.canShrinkWithoutContext(i)))}return Me(...G(e.expressions,n=>Xt(n,t,r)));case"ClassRange":{let n=e.from.codePoint,i=e.to.codePoint;return oe({min:n,max:i}).map(o=>h8(o),o=>{if(typeof o!="string")throw new L("Invalid type");if([...o].length!==1)throw new L("Invalid length");return nn(o,0)})}case"Group":return Xt(e.expression,t,r);case"Disjunction":return Me(e.left!==null?Xt(e.left,t,r):ve(""),e.right!==null?Xt(e.right,t,r):ve(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return r.multiline?e.kind==="^"?Me(ve(""),B(Ce({unit:wr()}),vt(...Rd)).map(n=>`${n[0]}${n[1]}`,n=>{if(typeof n!="string"||n.length===0)throw new L("Invalid type");return[ge(n,0,n.length-1),n[n.length-1]]})):Me(ve(""),B(vt(...Rd),Ce({unit:wr()})).map(n=>`${n[0]}${n[1]}`,n=>{if(typeof n!="string"||n.length===0)throw new L("Invalid type");return[n[0],ge(n,1)]})):ve("");throw new L(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":throw new L("Backreference nodes not implemented yet!");case"UnicodeProperty":return p8(e);default:throw Gw(e)}}function g8(e,t={}){for(let a of e.flags)if(a!=="d"&&a!=="g"&&a!=="m"&&a!=="s"&&a!=="u")throw new L(`Unable to use "stringMatching" against a regex using the flag ${a}`);let r=t.maxLength,n={size:t.size,maxLength:r},i={multiline:e.multiline,dotAll:e.dotAll},o=t8(l8(e));r!==void 0&&(o=Q7(o,r));let s=Xt(o,n,i);return r!==void 0?s.filter(a=>[...a].length<=r):s}function y8(e){let t=[];for(let r=0;r!==e.length;++r)t.push(e[r].next());return t}function b8(e,t){for(let r=0;r!==e.length;++r)t[r]=e[r].next()}function S8(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*w8(...e){let t=y8(e);for(;!S8(t);)yield t.map(r=>r.value),b8(e,t)}function*v8(e){let t=e;for(;;)yield t,++t}var x8=class extends de{constructor(e,t){super(),this.arb=e,this.maxShrinks=t}generate(e,t){let r=this.arb.generate(e,t);return this.valueMapper(r,0)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return this.isSafeContext(t)?this.safeShrink(e,t.originalContext,t.length):this.safeShrink(e,void 0,0)}safeShrink(e,t,r){let n=this.maxShrinks-r;return n<=0?j.nil():new j(w8(this.arb.shrink(e,t),v8(r+1))).take(n).map(i=>this.valueMapper(i[0],i[1]))}valueMapper(e,t){let r={originalContext:e.context,length:t};return new _(e.value,r)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalContext"in e&&"length"in e}};function R8(e,t){return new x8(e,t)}var k8=Ob({Arbitrary:()=>de,ExecutionStatus:()=>FN,PreconditionFailure:()=>nr,Random:()=>Td,Stream:()=>j,Value:()=>_,VerbosityLevel:()=>gN,__commitHash:()=>A8,__type:()=>E8,__version:()=>C8,anything:()=>R0,array:()=>ae,assert:()=>s3,asyncDefaultReportMessage:()=>x1,asyncModelRun:()=>z7,asyncProperty:()=>hN,asyncStringify:()=>Pd,asyncToStringMethod:()=>Ft,base64String:()=>t7,bigInt:()=>rr,bigInt64Array:()=>Y7,bigUint64Array:()=>J7,boolean:()=>bi,chainUntil:()=>J3,check:()=>k1,clone:()=>tL,cloneIfNeeded:()=>tn,cloneMethod:()=>Oe,commands:()=>F7,compareBooleanFunc:()=>eD,compareFunc:()=>rD,configureGlobal:()=>dN,constant:()=>ve,constantFrom:()=>vt,context:()=>z3,createDepthIdentifier:()=>Nd,date:()=>D1,defaultReportMessage:()=>v1,dictionary:()=>Dd,domain:()=>Vd,double:()=>Ks,emailAddress:()=>h$,entityGraph:()=>e_,falsy:()=>U3,float:()=>r0,float32Array:()=>c0,float64Array:()=>d0,func:()=>oD,gen:()=>m3,getDepthContextFor:()=>Od,hasAsyncToStringMethod:()=>Id,hasCloneMethod:()=>vr,hasToStringMethod:()=>Ad,hash:()=>Gs,infiniteStream:()=>K_,int16Array:()=>f0,int32Array:()=>p0,int8Array:()=>h0,integer:()=>oe,ipV4:()=>zd,ipV4Extended:()=>s0,ipV6:()=>a0,json:()=>G_,jsonValue:()=>k0,letrec:()=>l0,limitShrink:()=>R8,lorem:()=>l_,map:()=>gd,mapToConstant:()=>an,maxSafeInteger:()=>o0,maxSafeNat:()=>uD,memo:()=>f_,mixedCase:()=>b_,modelRun:()=>W7,nat:()=>Qt,noBias:()=>zs,noShrink:()=>Hs,object:()=>V_,oneof:()=>Me,option:()=>jt,pre:()=>B6,property:()=>mN,readConfigureGlobal:()=>dt,record:()=>md,resetConfigureGlobal:()=>fN,sample:()=>l3,scheduledModelRun:()=>G7,scheduler:()=>q7,schedulerFor:()=>K7,set:()=>w0,shuffledSubarray:()=>s7,sparseArray:()=>S0,statistics:()=>c3,stream:()=>tr,string:()=>Ce,stringMatching:()=>g8,stringify:()=>xe,subarray:()=>o7,toStringMethod:()=>ft,tuple:()=>B,uint16Array:()=>m0,uint32Array:()=>g0,uint8Array:()=>y0,uint8ClampedArray:()=>b0,ulid:()=>h7,uniqueArray:()=>Rr,uuid:()=>v7,webAuthority:()=>I0,webFragments:()=>T0,webPath:()=>O0,webQueryParameters:()=>N0,webSegment:()=>M0,webUrl:()=>L7}),E8="module",C8="4.8.0",A8="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",Ne=k8;function Js(e){return e?.values!=null&&e.values.length>0?Ne.constantFrom(...e.values):I8(e)}function I8(e){if(e?.type==="number")return Ne.integer();if(e?.type==="boolean")return Ne.boolean();let t=e?.generator==null?void 0:T8[e.generator];if(t!=null)return t;let r=e?.constraints?.kind==="string"?e.constraints:void 0;return Ne.string({maxLength:r?.maxLength,minLength:r?.minLength??1}).filter(n=>n.trim().length>0&&n===n.trim())}var P8="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],ln=e=>Ne.array(Ne.constantFrom(...P8),{maxLength:e,minLength:1}).map(t=>t.join("")),Yd=(e,t)=>Ne.array(ln(10),{maxLength:t,minLength:1}).map(r=>r.join(e)),T8={"company.name":Yd(" ",3),"date.iso":M8(),"internet.email":O8(),"internet.url":N8(),"lorem.slug":Yd("-",3),"lorem.word":ln(10),"person.fullName":Yd(" ",2)};function M8(){return Ne.date({max:new Date("2030-12-31T23:59:59.999Z"),min:new Date("2020-01-01T00:00:00.000Z"),noInvalidDate:!0}).map(e=>e.toISOString())}function O8(){return Ne.tuple(ln(12),ln(10),Ne.constantFrom("com","dev","io","org","ai")).map(([e,t,r])=>`${e}@${t}.${r}`)}function N8(){return Ne.tuple(Ne.constantFrom("http","https"),ln(12),Ne.constantFrom("app","com","dev","io","org"),Ne.array(ln(8),{maxLength:3})).map(([e,t,r,n])=>{let i=n.length===0?"":`/${n.join("/")}`;return`${e}://${t}.${r}${i}`})}var G0=new WeakMap;function Jd(e){let t=G0.get(e);if(t!=null)return t;let r=Object.fromEntries(Object.entries(e.paramSpaces).map(([n,i])=>[n,$8(i)]));return G0.set(e,r),r}var L8=24301;function $8(e){let[t]=Ne.sample(Js(e),{numRuns:1,seed:L8});if(t==null)throw new Error("arbitrary produced no sample");return t}function Si(e){return{aborted:!0,findings:[],fired:[],teardown:e}}function Xd(e,t){return new D8(_8(e,t))}async function _8({browser:e,hub:t,request:r},n){if(n.aborted)return Zd(Si("skipped"));let i=W8({lockfile:r.lockfile,options:r.options,runId:r.runId,signal:n}),o=async s=>{try{return Zd(await j8({browser:e,established:s,hub:t,request:r,signal:n}))}catch(a){return H0(wn(a))}};return U8(i,r).match(o,s=>F8(s,i.teardown))}async function F8(e,t){return e.kind!=="aborted"?H0(e):Zd(Si(await q0(t)))}function q0(e){return e().match(()=>"done",()=>"failed")}async function j8(e){let t=await V8(e);if(t.kind==="completed")return await e.established.teardown().match(ro,Kp),{aborted:!1,...t.result};let r=await q0(e.established.teardown);if(t.kind==="aborted")return Si(r);throw t.error}async function V8({browser:e,established:t,hub:r,request:n,signal:i}){try{Ht(i);let{close:o,driver:s,emitAssertion:a}=await _l({baseUrl:n.options.baseUrl,browser:e,capture:n.capture?{hub:r,runId:n.runId}:null,clientState:t.clientState,engine:Nl(G8(n.lockfile)),reader:t.reader,session:t.auth});try{return n.onEvent?.({aliases:t.aliases,generated:t.generated,generatedSingletons:t.generatedSingletons,kind:"world"}),{kind:"completed",result:await Pl({canon:Ka(n.lockfile),classify:qa(n.lockfile),driver:s,initialState:{snapshot:t.snapshot},onAssertion:a,onEvent:n.onEvent??ro,sequence:n.sequence??B8(n.lockfile,n.testName,n.params),...vc(n.lockfile)},i)}}finally{await o()}}catch(o){return th(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function B8(e,t,r){return co(e,t).map(n=>({params:{...Jd(n),...r},transition:n}))}function U8(e,t){return Pn(t.lockfile,t.testName,{generate:Ol(Ml(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(r=>({aliases:r.aliases,auth:r.auth,clientState:r.clientState,generated:r.generated,generatedSingletons:r.generatedSingletons,reader:e.reader,snapshot:r.snapshot,teardown:e.teardown}))}function W8({lockfile:e,options:t,runId:r,signal:n}){let i=Bl({baseUrl:t.engineUrl,runId:r,secret:t.secret},n);return{materialize:pl(i.setupWorld),reader:Vl(e.entities,z8(e),i.query),teardown:i.teardown}}function z8(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function G8(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}function Y8({clientVersion:e,debugDir:t,headed:r,writeOtlpPortFile:n}){let i=dm({headed:r}),o,s,a=async()=>(o??=wc({clientVersion:e,debugDir:t,writeOtlpPortFile:n}),s=await o,s),l=async(c,d)=>{if(d.aborted)return q8(Si("skipped"));try{let p=await a();return c.options.headed&&!r?await Fl(!0,async h=>Xd({browser:h,hub:p,request:c},d)):await Xd({browser:await i.acquire(),hub:p,request:c},d)}catch(p){return H8(wn(p))}};return{close:async()=>{await i.close();let c=o;o=void 0,s=void 0,c!=null&&await c.then(d=>d.close()).catch(()=>{})},injectSpan:(c,d)=>{s?.injectSpan(c,d)},runOnce:(c,d)=>new K8(l(c,d))}}function wi(e,t){let r=e.axes.flatMap(n=>n.classify(t).map(([i,o])=>`${i}:${o}`));return[t.label,...r.toSorted((n,i)=>n.localeCompare(i))].join("|")}function Qd(e){return e.axes.map(t=>t.name).join("+")}function ef(e){return{name:`counts(${e})`,classify:({pre:t})=>[...t.entities].flatMap(([r,n])=>n.size===0?[]:[[r,Z8(e,n.size)]])}}function tf(e){let t=K0(e);return{name:"enum-fields",classify:({pre:r})=>[...r.entities].flatMap(([n,i])=>[...i.values()].flatMap(o=>J8(n,o,t)))}}function J8(e,t,r){return Object.entries(t).flatMap(([n,i])=>r.has(`${e}.${n}`)?[[`${e}.${n}`,X8(i)]]:[])}function K0(e){let t=e.valueSpaces.flatMap(n=>n.values==null?[]:[n.name]),r=new Set(t);return new Set(e.entities.flatMap(n=>Object.entries(n.props).flatMap(([i,o])=>o.type==="boolean"||o.valueSpace!=null&&r.has(o.valueSpace)?[`${n.name}.${i}`]:[])))}function Z8(e,t){return e==="presence"?"1+":e==="unit"?t===1?"1":"2+":t<=2?String(t):"3+"}function X8(e){return e==null?"\u2205":String(e)}import{createHash as Q8}from"crypto";import{appendFile as e9,mkdir as t9,readFile as r9}from"fs/promises";import n9 from"path";import{ResultAsync as J0}from"neverthrow";import{z as R}from"zod";var un=R.enum(["crash","invariant","law","frame"]),Y0=R.object({intent:R.string().min(1),test:R.string().min(1)}),i9=R.union([R.object({kind:R.literal("singleton-mismatch"),singleton:R.string().min(1)}),R.object({entity:R.string().min(1),kind:R.string().min(1)})]),Z0=R.discriminatedUnion("kind",[R.object({divergence:i9,kind:R.literal("consistency"),layer:un,step:Y0.nullable()}),R.object({kind:R.literal("obligation"),layer:un,source:R.string().min(1),step:Y0}),R.object({intent:R.string().min(1),kind:R.literal("unfireable"),layer:un,reason:R.string().min(1),test:R.string().min(1)}),R.object({error:R.string().min(1),kind:R.literal("driver-error"),layer:un,step:R.string().min(1)}),R.object({kind:R.literal("illegal-transition"),layer:un,step:R.string().min(1)})]),o9=R.object({actionHash:R.string().min(1),at:R.string().min(1),kind:R.literal("covered"),lensId:R.string().min(1),targetKey:R.string().min(1)}),s9=R.object({actionHash:R.string().min(1),at:R.string().min(1),depot:R.string().min(1),evidence:R.array(R.string().min(1)),kind:R.literal("finding"),lensId:R.string().min(1),lockfileHash:R.string().min(1),oracleLayer:un,parts:R.array(Z0),runId:R.string().min(1).optional(),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1)),trailParams:R.array(R.record(R.string(),R.union([Xe,R.null()])))}),a9=R.object({actionHash:R.string().min(1),at:R.string().min(1),depot:R.string().min(1),evidence:R.array(R.string().min(1)),kind:R.literal("flaky-candidate"),lensId:R.string().min(1),parts:R.array(Z0),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1))}),l9=R.object({at:R.string().min(1),kind:R.literal("saturation"),lensId:R.string().min(1),lockfileHash:R.string().min(1),ring:R.number().int().nonnegative()}),u9=R.object({at:R.string().min(1),kind:R.literal("resolution"),signature:R.string().min(1)}),c9=R.object({arrangement:R.string().min(1),at:R.string().min(1),canonicalKey:R.string().min(1),kind:R.literal("derived-depot")}),Zs=R.discriminatedUnion("kind",[o9,s9,a9,l9,u9,c9]);function Xs(e){return sf(e).slice(0,12)}function ze(e){return`${e.lensId} ${e.actionHash} ${e.targetKey}`}function vi(e){return e.reduce((t,r)=>g9(t,r),m9())}function xi(e){return J0.fromPromise(d9(e),t=>({error:t,kind:"io"})).map(t=>p9(t))}function rf(e,t){let r=t.map(n=>`${JSON.stringify(n)}
136
- `).join("");return J0.fromPromise(t9(n9.dirname(e),{recursive:!0}).then(()=>e9(e,r)),n=>({error:n,kind:"io"}))}function nf(e,t){let r=J({effect:t.effectStep,guard:t.guard,nav:t.nav,params:t.paramSpaces,steps:t.steps}),n=e.entities.filter(i=>r.includes(`"${i.name}"`));return sf(J({entities:n,spec:r}))}function of(e){return sf(J(e))}async function d9(e){return(await r9(e,"utf8").catch(r=>{if(f9(r))return"";throw r})).split(`
137
- `).filter(r=>r.length>0)}function f9(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}function p9(e){return e.flatMap(t=>{let r=Zs.safeParse(h9(t));return r.success?[r.data]:[]})}function h9(e){try{return JSON.parse(e)}catch{return null}}function sf(e){return Q8("sha256").update(e).digest("hex")}function m9(){return{covered:new Set,findings:new Map,flaky:new Map,saturations:new Map}}function g9(e,t){if(t.kind==="covered")return{...e,covered:new Set([...e.covered,ze(t)])};if(t.kind==="flaky-candidate")return{...e,covered:new Set([...e.covered,ze(t)]),flaky:y9(e.flaky,t)};if(t.kind==="finding")return{...e,covered:new Set([...e.covered,ze(t)]),findings:b9(e.findings,t)};if(t.kind==="resolution")return{...e,findings:S9(e.findings,t)};if(t.kind==="saturation"){let r=`${t.lensId} ${String(t.ring)}`;return{...e,saturations:new Map([...e.saturations,[r,t]])}}return e}function y9(e,t){let r=e.get(t.signature),n=r==null?{first:t,occurrences:1}:{first:r.first,occurrences:r.occurrences+1};return new Map([...e,[t.signature,n]])}function b9(e,t){let r=e.get(t.signature),n=r==null?{first:t,latest:t,occurrences:1,resolvedAt:void 0}:{first:r.first,latest:t,occurrences:r.occurrences+1,resolvedAt:void 0};return new Map([...e,[t.signature,n]])}function S9(e,t){let r=e.get(t.signature);return r==null?e:new Map([...e,[t.signature,{...r,resolvedAt:t.at}]])}function af(e){let t={edges:new Map,saturationDepth:0,seen:new Set,states:0,targets:new Map},r=e.depots.map(n=>(t.seen.add(fr(n.snapshot)),{depot:n.name,lastLabel:null,snapshot:n.snapshot,trail:[]}));return v9(e,r,t),{edges:t.edges,saturationDepth:t.saturationDepth,states:t.seen.size,targets:t.targets}}var w9=24301,X0=new WeakMap;function Qs(e,t){let r=X0.get(e)??new Map;X0.set(e,r);let n=r.get(t);if(n!=null)return n;let i=Object.fromEntries(Object.entries(e.paramSpaces).map(([o,s])=>[o,A9(s,t)]));return r.set(t,i),i}function v9(e,t,r){let n=[...t],i=0;for(;i<n.length;){let o=n[i];i+=1,o!=null&&x9(e,o,r).forEach(s=>n.push(s))}}function x9(e,t,r){let n={snapshot:t.snapshot},i=o=>Qs(o,C9(t.trail,e.corpus,o));return Lr(e.corpus,n,i).flatMap(o=>{let s=e.corpus[o.idx];if(s==null)return[];let a=[...t.trail,{idx:o.idx,params:o.params}],l={depot:t.depot,trail:a,transitionIndex:o.idx};return R9({acc:r,node:t,option:o,params:e,transition:s,witness:l}),k9({acc:r,node:t,option:o,params:e,trail:a})})}function R9({acc:e,node:t,option:r,params:n,transition:i,witness:o}){let s={label:r.label,params:r.params,pre:t.snapshot,spaces:i.paramSpaces},a=wi(n.lens,s);if(e.targets.has(a)||(e.targets.set(a,o),e.saturationDepth=Math.max(e.saturationDepth,o.trail.length)),t.lastLabel!=null){let l=`${t.lastLabel} \u2192 ${r.label}`;e.edges.has(l)||e.edges.set(l,o)}}function k9({acc:e,node:t,option:r,params:n,trail:i}){if(i.length>=n.maxDepth)return[];let o=r.firing.next.snapshot;if(E9(t.snapshot,o,n.maxCount))return[];let s=fr(o);return e.seen.has(s)?[]:(e.seen.add(s),[{depot:t.depot,lastLabel:r.label,snapshot:o,trail:i}])}function E9(e,t,r){return[...t.entities].some(([n,i])=>{let o=e.entities.get(n)?.size??0;return i.size>o&&i.size>r})}function C9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function A9(e,t){let[r]=Ne.sample(Js(e),{numRuns:1,seed:w9+t});if(r==null)throw new Error("arbitrary produced no sample");return r}var I9=10;function lf(e){return df(e).reduce((t,r)=>t+ev(e,r).length,0)}function uf(e){return e.targets.size+e.edges.size}function cf(e){let t=df(e).map(o=>ev(e,o)),r=P9(e,t);if(r!=null)return r;let n=t.find(o=>o.length>0);return n==null?{kind:"saturated",ring:t.length}:{kind:"cover",target:n.reduce((o,s)=>Q0(e,s)>Q0(e,o)?s:o)}}function df(e){return[{entries:e.graph.targets,index:1},{entries:e.graph.edges,index:2}]}function ev(e,t){return[...t.entries].flatMap(([r,n])=>{let i=tv({params:e,ring:t.index,targetKey:r,witness:n});return e.covered.has(rv(e,i))?[]:[i]})}function tv({params:e,ring:t,targetKey:r,witness:n}){let i=e.actionHashes[n.transitionIndex];if(i==null)throw new Error("transition index out of corpus range");return{actionHash:i,ring:t,targetKey:r,witness:n}}function rv(e,t){return ze({actionHash:t.actionHash,lensId:e.lensId,targetKey:t.targetKey})}function P9(e,t){if(e.tick===0||e.tick%I9!==0)return null;let r=df(e).flatMap(i=>[...i.entries].flatMap(([o,s])=>{let a=tv({params:e,ring:i.index,targetKey:o,witness:s});return e.covered.has(rv(e,a))?[a]:[]}));if(r.length===0||t.every(i=>i.length===0))return null;let n=r[e.tick%r.length];return n==null?null:{kind:"revalidate",target:n}}var T9=/delete|remove|cancel|deactivate|revoke|archive/i;function Q0(e,t){let r=t.ring===2&&M9(e,t)?4:0,n=T9.test(t.targetKey)?2:0,i=1/(1+t.witness.trail.length);return r+n+i}function M9(e,t){return new Set(t.witness.trail.flatMap(n=>{let i=e.corpus[n.idx];return i==null?[]:[i.test]})).size>1}function O9(e){let t=N9(e,e.witnessTrail);return t==null?{covers:[],firings:[]}:$9(e,t)}function N9(e,t){return t.reduce((r,n)=>r==null?null:L9(e,r,n),{covers:[],firings:[],snapshot:e.depotSnapshot})}function L9(e,t,r){let n=e.corpus[r.idx];if(n==null)return null;let i=Mn(n,{snapshot:t.snapshot},r.params);if(i==null)return null;let o=nv({params:e,planned:r,pre:t.snapshot,transition:n});return{covers:[...t.covers,o],firings:[...t.firings,r],snapshot:i.next.snapshot}}function nv({params:e,planned:t,pre:r,transition:n}){let i={label:`${n.test}#${String(n.index)}`,params:t.params,pre:r,spaces:n.paramSpaces},o=e.actionHashes[t.idx];if(o==null)throw new Error("transition index out of corpus range");return{actionHash:o,targetKey:wi(e.lens,i)}}function $9(e,t){let r=new Set([...e.covered,...t.covers.map(i=>ze({...i,lensId:e.lensId}))]),n=iv({params:e,seen:r,state:t});return{covers:n.covers,firings:n.firings}}function iv({params:e,seen:t,state:r}){if(r.firings.length>=e.maxLength)return r;let n=D9({params:e,seen:t,state:r});return n==null?r:(t.add(ze({...n.coverage,lensId:e.lensId})),iv({params:e,seen:t,state:{covers:[...r.covers,n.coverage],firings:[...r.firings,n.planned],snapshot:n.snapshot}}))}function D9({params:e,seen:t,state:r}){let n=o=>Qs(o,_9(r.firings,e.corpus,o));return Lr(e.corpus,{snapshot:r.snapshot},n).map(o=>{let s=e.corpus[o.idx];if(s==null)return null;let a={idx:o.idx,params:o.params};return{coverage:nv({params:e,planned:a,pre:r.snapshot,transition:s}),planned:a,snapshot:o.firing.next.snapshot}}).find(o=>o!=null&&!t.has(ze({...o.coverage,lensId:e.lensId})))??null}function _9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function ff(e,{sweep:t}){let r=At(e.tests.filter(n=>!n.stub),n=>J({s:n.singletons,w:n.world})).map(n=>({name:n.name,test:n}));return t?[...r,...r.flatMap(n=>F9(n))]:r}function pf(e,t,r){return Pn({...e,tests:[t.test]},t.test.name,r)}function F9(e){return j9(e.test).map(t=>{let r={...t,as:`${t.as}~2`},n=`${e.name} +${t.entity}`;return{name:n,test:{...e.test,name:n,world:[...e.test.world,r]}}})}function j9(e){return e.world.filter(t=>{let r=J({...e,world:e.world.filter(n=>n!==t)});return!r.includes(`"${t.as}.`)&&!r.includes(`"ref":"${t.as}"`)})}async function V9(e,t){let r=await ea({attemptIndex:0,capture:!1,firings:e.trail.firings,params:e},t);return r.kind!=="completed"?sv(r):r.findings.length===0?{kind:"clean",rows:H9(e)}:B9(e,Ri(e.depot.name,r.findings),t)}function sv(e){return e.kind==="aborted"?{kind:"aborted"}:{error:e.error,kind:"error"}}async function B9(e,t,r){let n=await ea({attemptIndex:1,capture:!1,firings:e.trail.firings,params:e},r);return n.kind!=="completed"?sv(n):Ri(e.depot.name,n.findings).signature!==t.signature?{kind:"flaky",rows:[q9(e,t)]}:U9({digest:t,params:e,signal:r})}async function ea({attemptIndex:e,capture:t,firings:r,params:n},i){let o=n.runIdFor(e);return(await n.session.runOnce({capture:t,lockfile:G9(n),onEvent:void 0,options:n.options,params:void 0,runId:o,sequence:z9(n,r),testName:n.depot.test.name},i)).match(a=>a.aborted?{kind:"aborted"}:{findings:a.findings,kind:"completed",runId:o},a=>({error:a,kind:"error"}))}async function U9({digest:e,params:t,signal:r}){let n=await av({attemptIndex:2,budget:t.shrinkBudget,firings:t.trail.firings,params:t,signal:r,signature:e.signature});if(n.kind!=="shrunk")return n.outcome;let i=await W9({firings:n.firings,params:t,signal:r,signature:e.signature});if(i.kind==="aborted")return{kind:"aborted"};let o=Z9({digest:e,minimal:n.firings,params:t,runId:i.kind==="reproduced"?i.runId:void 0});return{finding:o,kind:"finding",minimal:n.firings,rows:[o],runId:i.kind==="reproduced"?i.runId:n.runId}}async function W9({firings:e,params:t,signal:r,signature:n}){let i=await ea({attemptIndex:t.shrinkBudget+2,capture:!0,firings:e,params:t},r);return i.kind==="aborted"?{kind:"aborted"}:i.kind==="completed"&&Ri(t.depot.name,i.findings).signature===n?{kind:"reproduced",runId:i.runId}:{kind:"no-repro"}}async function av(e){let t={firings:e.firings,kind:"shrunk",runId:e.params.runIdFor(e.attemptIndex-1)};if(e.budget<=0||e.firings.length<=1)return t;let r=e.firings.map((n,i)=>e.firings.filter((o,s)=>s!==i));return lv(e,r,t)}async function lv(e,t,r){let[n,...i]=t;if(n==null||e.budget-1<0)return r;let o=await ea({attemptIndex:e.attemptIndex,capture:!1,firings:n,params:e.params},e.signal);if(o.kind==="aborted")return{kind:"halted",outcome:{kind:"aborted"}};let s={...e,attemptIndex:e.attemptIndex+1,budget:e.budget-1};return o.kind==="completed"&&Ri(e.params.depot.name,o.findings).signature===e.signature?av({...s,firings:n}):lv(s,i,r)}function z9(e,t){return t.map(r=>{let n=e.corpus[r.idx];if(n==null)throw new Error("transition index out of corpus range");return{params:r.params,transition:n}})}function G9(e){return e.lockfile.tests.some(r=>r.name===e.depot.test.name)?e.lockfile:{...e.lockfile,tests:[...e.lockfile.tests,e.depot.test]}}function H9(e){return e.trail.covers.map(t=>({actionHash:t.actionHash,at:e.now(),kind:"covered",lensId:e.lensId,targetKey:t.targetKey}))}function q9(e,t){return{actionHash:hf(e).actionHash,at:e.now(),depot:e.depot.name,evidence:[...t.evidence],kind:"flaky-candidate",lensId:e.lensId,parts:[...t.parts],signature:t.signature,targetKey:hf(e).targetKey,trail:e.trail.covers.map(r=>r.targetKey)}}function uv(e){return e.kind==="driver-error"||e.kind==="unfireable"?"crash":e.kind==="obligation"?e.source.kind==="invariant"?"invariant":e.source.kind==="law"?"law":"frame":"frame"}function Ri(e,t){let r=t.map(i=>({line:km(i),part:Y9(i)})).toSorted((i,o)=>J(i.part).localeCompare(J(o.part))),n=r.map(i=>i.part);return{evidence:r.map(i=>i.line),layer:K9(n),parts:n,signature:J({depot:e,parts:n.map(i=>J(i))})}}var ov={crash:0,frame:3,invariant:1,law:2};function K9(e){return e.map(r=>r.layer).toSorted((r,n)=>ov[r]-ov[n]).at(0)??"frame"}function Y9(e){let t=uv(e);switch(e.kind){case"consistency":return{divergence:J9(e.divergence),kind:"consistency",layer:t,step:e.step==null?null:{intent:e.step.intent,test:e.step.test}};case"obligation":return{kind:"obligation",layer:t,source:e.source.kind,step:{intent:e.step.intent,test:e.step.test}};case"unfireable":return{intent:e.intent,kind:"unfireable",layer:t,reason:e.reason,test:e.test};case"driver-error":return{error:e.error.kind,kind:"driver-error",layer:t,step:e.step.intent};case"illegal-transition":return{kind:"illegal-transition",layer:t,step:e.step.intent}}}function J9(e){return e.kind==="singleton-mismatch"?{kind:e.kind,singleton:e.singleton}:{entity:e.entity,kind:e.kind}}function Z9({digest:e,minimal:t,params:r,runId:n}){let i=hf(r);return{actionHash:i.actionHash,at:r.now(),depot:r.depot.name,evidence:[...e.evidence],kind:"finding",lensId:r.lensId,lockfileHash:r.lockfileHash,oracleLayer:e.layer,parts:[...e.parts],runId:n,signature:e.signature,targetKey:i.targetKey,trail:t.map(o=>{let s=r.corpus[o.idx];if(s==null)throw new Error("transition index out of corpus range");return`${s.test}#${String(s.index)}`}),trailParams:t.map(o=>o.params)}}function hf(e){let t=e.trail.covers.at(-1);if(t==null)throw new Error("trail has no coverage");return t}function VK(e){switch(e.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${e.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${e.message}`}}function BK({projectId:e,serverUrl:t}){return[`Project "${e}" (from .ripplo/project.json) was not found on ${t}, or this account does not have access to it.`,"Run `npx ripplo projects list` to see your projects, then update .ripplo/project.json (or re-run `npx ripplo init --project <id>`)."].join(`
138
- `)}function UK({devSessionId:e,version:t}){return`ripplo daemon: v${t} ready as local executor for session ${e} (sync happens on each \`ripplo run\`; Ctrl-C to stop)`}function WK({cwd:e,pid:t}){return`ripplo daemon: another daemon is already running for this project${t==null?"":` (pid ${String(t)})`} (cwd ${e}).`}function zK(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project; shutting down."}function GK(e){if(e.kind==="not-running")return"daemon: not running";if(e.kind==="unresponsive")return`daemon: running but did not reply within ${String(e.timeoutMs/1e3)}s \u2014 likely busy executing runs (event loop saturated); retry when the batch drains`;let{status:t}=e,r=t.version==null?"version unknown (pre-0.7.8)":`v${t.version}`,n=`${String(t.active)} active, ${String(t.queued)} queued`,i=`explorer: ${t.explorer}, ${String(t.exploring)} exploring`;return`daemon: running (${r}; ${n}; ${i}; ${X9(t.progress)})`}function X9(e){if(e.total===0)return"explore: idle";let t=`covered ${String(e.covered)}/${String(e.total)} targets`,r=e.deferred===0?"":` (${String(e.deferred)} deferred \u2014 timed out or errored, auto-retried after cooldown)`,n=Q9(e);return`explore: ${t}${r}, ${String(e.findings)} findings, ${n}`}function HK(e){let t=e.daemonVersion==null?"an older version":`v${e.daemonVersion}`;return e.kind==="restarted"?`ripplo: daemon was ${t} \u2014 restarted on the current version`:`ripplo: daemon is ${t} (older than this CLI) with runs in flight \u2014 it will keep running; restart it when idle to pick up the new version`}function qK(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:e.findings.map(t=>_n(t)),kind:"findings"};case"error":return{detail:Ct(e.error),kind:"error"};case"dispatch-failed":return{detail:e.reason,kind:"dispatch-error"}}}function Q9(e){return e.saturated?e.deferred===0?"saturated":"waiting \u2014 every open target is deferred, retrying after cooldown":"searching"}import eF from"p-queue";var tF=4,rF={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},ta=new eF({concurrency:tF}),Bt={headedActive:0,interactiveActive:0,interactiveQueued:0},cv={current:null};function JK({headed:e,task:t,workClass:r}){let n=rF[r];return r==="p3-explore"?ta.add(t,{priority:n}):(Bt.interactiveQueued+=1,ra(),ta.add(()=>nF({headed:e,task:t}),{priority:n}))}function ZK(e){!Number.isFinite(e)||e<1||(ta.concurrency=Math.floor(e),ra())}function mf(){return{active:Bt.interactiveActive,headedActive:Bt.headedActive,poolSize:ta.concurrency,queued:Bt.interactiveQueued}}function XK(e){cv.current=e}async function nF({headed:e,task:t}){Bt.interactiveQueued-=1,Bt.interactiveActive+=1,Bt.headedActive+=e?1:0,ra();try{return await t()}finally{Bt.interactiveActive-=1,Bt.headedActive-=e?1:0,ra()}}function ra(){cv.current?.()}import gf from"fs";import yf from"path";function dv(e){try{let t=iF(e);if(t==null)return;let r=yf.join(t,"HEAD"),n=gf.readFileSync(r,"utf8").trim(),i="ref: refs/heads/";return n.startsWith(i)?n.slice(i.length):n.length===0?void 0:n.slice(0,7)}catch{return}}function iF(e){let t=yf.join(e,".git");if(gf.statSync(t).isDirectory())return t;let n=gf.readFileSync(t,"utf8").trim(),i="gitdir:";if(!n.startsWith(i))return;let o=n.slice(i.length).trim();if(o.length!==0)return yf.resolve(e,o)}import oF from"crypto";import{graphql as sF}from"gql.tada";import{err as aF,ok as lF}from"neverthrow";var uF=sF(`
131
+ }`}return rD(o,{toString:{value:()=>s(xe(t))},[ft]:{value:()=>s(xe(t))},[Ft]:{value:async()=>s(await Td(t))},[Oe]:{value:n,configurable:!0}})};return n()})}var oD=Number.MIN_SAFE_INTEGER,sD=Number.MAX_SAFE_INTEGER;function a0(){return new sn(oD,sD)}var aD=Number.MAX_SAFE_INTEGER;function lD(){return new sn(0,aD)}var uD=Number.parseInt;function cD(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=uD(e,t);if(pi(r,t)!==e)throw new Error("Invalid value");return r}function dD(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 fD(e){return ce(e,".")}function pD(e){if(typeof e!="string")throw new Error("Invalid type");return G(Be(e,"."),t=>$s(t,10))}function Gd(){return B(Qt(255),Qt(255),Qt(255),Qt(255)).map(fD,pD)}function wt(e){return B(vt("dec","oct","hex"),Qt(e)).map(cD,dD)}function Fc(e){return ce(e,".")}function jc(e){if(typeof e!="string")throw new Error("Invalid type");return Be(e,".")}function l0(){return Me(B(wt(255),wt(255),wt(255),wt(255)).map(Fc,jc),B(wt(255),wt(255),wt(65535)).map(Fc,jc),B(wt(255),wt(16777215)).map(Fc,jc),wt(4294967295))}function Hd(e){return e.length===0?[]:Be(e,":")}function qd(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 hD(e){return`${ce(e[0],":")}:${e[1]}`}function mD(e){if(typeof e!="string")throw new Error("Invalid type");return qd(e)}function gD(e){return`::${ce(e[0],":")}:${e[1]}`}function yD(e){if(typeof e!="string")throw new Error("Invalid type");if(!J4(e,"::"))throw new Error("Invalid value");return qd(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]=qd(r);return[Hd(t),n,i]}function bD(e){return Ds([e[0],[e[1]],e[2]])}function SD(e){let t=_s(e);return[t[0],ce(t[1],":"),t[2]]}function bw(e){return`${ce(e[0],":")}::${e[1]}`}function Sw(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2);return[Hd(t),r]}function wD(e){return`${ce(e[0],":")}::`}function vD(e){if(typeof e!="string")throw new Error("Invalid type");if(!Z4(e,"::"))throw new Error("Invalid value");return[Hd(ge(e,0,e.length-2))]}function xD([e,t]){return`${e}:${t}`}function RD(e){if(typeof e!="string")throw new L("Invalid type");if(!e.includes(":"))throw new L("Invalid value");return e.split(":",2)}var kD="0123456789abcdef",Vc;function ED(){return Vc===void 0&&(Vc=oe({min:0,max:15}).map(e=>kD[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})),Vc}function u0(){let e=Ce({unit:ED(),minLength:1,maxLength:4,size:"max"}),t=Me(B(e,e).map(xD,RD),Gd());return Me(B(ae(e,{minLength:6,maxLength:6,size:"max"}),t).map(hD,mD),B(ae(e,{minLength:5,maxLength:5,size:"max"}),t).map(gD,yD),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(bD,SD),B(ae(e,{minLength:0,maxLength:5,size:"max"}),t).map(bw,Sw),B(ae(e,{minLength:0,maxLength:6,size:"max"}),e).map(bw,Sw),B(ae(e,{minLength:0,maxLength:7,size:"max"})).map(wD,vD))}var CD=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)}},AD=Object.getOwnPropertyNames;function ID(){let e=new _t;return r=>{let n=Je(e,r);return n!==void 0||(n=new CD(String(r)),ct(e,r,n)),n}}function c0(e){let t=ID(),r=e(t),n=AD(r);for(let i of n){let o=t(i);o.underlying=r[i]}return r}function PD(e,t){for(let r of e){let n=t[r]||{};if(n.maxLength===void 0||n.maxLength>0)return!0}return!1}function TD(e,t){if(e.length===0)return ve([]);if(!PD(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=>E4(r)).filter(r=>r.length>0)}var ww=Object.assign,Fs=Object.create,d0=Object.defineProperty,vw=Object.getPrototypeOf,MD=Object.prototype;function OD(e){return d0(Fs(null),ft,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function xw(e,t){return OD(`<${Ve(e)}#${t}>`)}function ND(e,t){let r=Fs(MD);for(let n in e){let i=e[n],o=[];for(let s of i){let a=ww(Fs(vw(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])}d0(a,ft,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[n][o],u=ww(Fs(vw(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?xw(d.type,d.index):G(d.index,p=>xw(d.type,p))}return xe(u)}})}}return r}function LD(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)),j4(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 Rw=Object.create;function $D(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 DD(e,t,r,n,i,o,s){let a=$D(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 _D=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=LD(e)}createEmptyLinksInstanceFor(e){let t=Rw(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=Rw(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=Ld();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=DD(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 FD(e,t){return new _D(e,t)}var jD=Object.keys,VD=Object.getOwnPropertySymbols,BD=Object.getOwnPropertyDescriptor;function UD(e){let t=jD(e),r=VD(e);for(let n=0;n!==r.length;++n){let i=r[n],o=BD(e,i);o&&o.enumerable&&t.push(i)}return t}var WD=Object.create,zD=Object.defineProperty,GD=Object.getOwnPropertyDescriptor,HD=Object.getOwnPropertyNames,qD=Object.getOwnPropertySymbols;function KD(e,t){return function(n){let i=n[1]?WD(null):{};for(let o=0;o!==e.length;++o){let s=n[0][o];s!==t&&zD(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function YD(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=GD(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=HD(n).length,u=qD(n).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var Bc=Symbol("no-key");function Uc(e,t,r){let n=UD(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:Bc}))}return B(B(...i),r?ve(!1):bi()).map(KD(n,Bc),YD(n,Bc))}function gd(e,t){let r=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return Uc(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 Uc(e,n,r)}var JD=Object.create;function ZD(e,t,r,n){let i=JD(null);for(let o in e){let s=e[o],a=gd(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 gd(i)}var kw=Object.create,XD=Object.keys;function QD(e,t,r={}){let n=XD(e),i=r.initialPoolConstraints||kw(null),o=r.unicityConstraints||kw(null),s={noNullPrototype:r.noNullPrototype};return TD(n,i).chain(a=>FD(t,a).chain(l=>ZD(e,u=>l[u].length,u=>o[u],s).map(u=>ND(u,l))))}function e_(e){return ce(G(e,t=>t[t.length-1]===","?ge(t,0,t.length-1):t)," ")}function t_(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 r_(e){let t=ce(e," ");return t[t.length-1]===","&&(t=ge(t,0,t.length-1)),Ed(t[0])+ge(t,1)+"."}function n_(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]===","||Ed(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 i_(e){return ce(e," ")}function o_(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 s_(){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 a_(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=s_();return r==="sentences"?ae(ae(i,{minLength:1,size:"small"}).map(r_,n_(i)),{minLength:1,maxLength:t,size:n}).map(i_,o_):ae(i,{minLength:1,maxLength:t,size:n}).map(e_,t_(i))}function l_(e){return new Map(e)}function u_(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 c_(e){return e[0]}function yd(e,t,r={}){return Rr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:c_,depthIdentifier:r.depthIdentifier,comparator:"SameValueZero"}).map(l_,u_)}var Ts=10;function d_(e){let t={};return(r=>{let n=r!==void 0?r:Ts;if(!s1(t,n)){let i=Ts;Ts=n-1,t[n]=e(n),Ts=i}return t[n]})}function f_(e){let t=0;for(;e>O(0);)e&O(1)&&++t,e>>=O(1);return t}function p_(e,t){let r=(O(1)<<O(t))-O(1),n=e&r,i=f_(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 h_(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 Wc(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 m_=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 Wc(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:h_(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=p_(i,a.length);return Wc(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 Wc(l,a.value,s,this.toggleCase),new _(ce(l,""),this.buildContextFor(new _(n,r.rawStringContext),a))})}))}};function g_(e){let t=Ed(e);return t!==e?t:Qc(e)}function y_(e,t){return new m_(e,t&&t.toggleCase||g_,t&&t.untoggleAll)}function b_(e){return Qw.from(e)}function S_(e){if(!(e instanceof Qw))throw new Error("Unexpected type");return[...e]}function f0(e={}){return ae(i0(e),e).map(b_,S_)}function w_(e){return e1.from(e)}function v_(e){if(!(e instanceof e1))throw new Error("Unexpected type");return[...e]}function p0(e={}){return ae(Ks(e),e).map(w_,v_)}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 h0(e={}){return Vt(e,-32768,32767,s4,oe)}function m0(e={}){return Vt(e,-2147483648,2147483647,a4,oe)}function g0(e={}){return Vt(e,-128,127,o4,oe)}function y0(e={}){return Vt(e,0,65535,c4,oe)}function b0(e={}){return Vt(e,0,4294967295,d4,oe)}function S0(e={}){return Vt(e,0,255,l4,oe)}function w0(e={}){return Vt(e,0,255,u4,oe)}function x_(e){return e!==void 0}function Ew(e){return e.hasToBeCloned?new _(e.value_,{generatorContext:e.context},()=>e.value):new _(e.value_,{generatorContext:e.context})}function Cw(e){return e.hasToBeCloned?new _(e.value_,{shrinkerContext:e.context},()=>e.value):new _(e.value_,{shrinkerContext:e.context})}var R_=class extends de{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return Ew(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return x_(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(Ew):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(Cw):this.shrinkerArbitrary.shrink(e,void 0).map(Cw)}};function bd(e,t,r){let n=oe({min:e,max:t});return t===r?n:new R_(n,oe({min:e,max:r}))}var k_=Math.min,Sd=Math.max,Aw=Zw.isArray,E_=Object.entries;function C_(e){let t=-1;for(let r=0;r!==e.length;++r)t=Sd(t,e[r][0]);return t}function A_(e,t){let r=Zw(e);for(let n=0;n!==t.length;++n){let i=t[n];i[0]<e&&(r[i[0]]=i[1])}return r}function v0(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=k_(o,i),c=t.maxNumElements!==void 0||r!==void 0?r:"=",d=Rr(B(bd(0,Sd(l-1,0),Sd(i-1,0)),e),{size:c,minLength:n,maxLength:u,selector:p=>p[0],depthIdentifier:a}).map(p=>A_(C_(p)+1,p),p=>{if(!Aw(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(E_(p),h=>[Number(h[0]),h[1]])});return s||i===n?d:B(d,bd(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(!Aw(p))throw new Error("Not supported entry type");return[p,p.length]})}function I_(e){return new Set(e)}function P_(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 x0(e,t={}){return Rr(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(I_,P_)}function T_(e,t,r,n,i,o){return _d(e,t,{maxKeys:r,noNullPrototype:!o,size:n,depthIdentifier:i})}function M_(e){return Me(g0(e),S0(e),w0(e),h0(e),y0(e),m0(e),b0(e),f0(e),p0(e))}function R0(e){let t=e.values,r=e.depthSize,n=Ld(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Me(...t,...e.withBigInt?[rr()]:[],...e.withDate?[F1()]:[]);return c0(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?[M_({maxLength:o,size:s})]:[],...e.withSparseArray?[v0(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:x0(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),map:Me(yd(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n}),yd(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n})),object:T_(l("keys"),l("anything"),o,s,n,e.withNullPrototype)})).anything}function O_(e){switch(typeof e){case"boolean":return new Xw(e);case"number":return new Dt(e);case"string":return new Ve(e);default:return e}}function N_(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===Xw||e.constructor===Dt||e.constructor===Ve?e.valueOf():e}function L_(e){return e.map(O_,N_)}function $_(e,t){return[bi(),a0(),Ks(),t(e),Me(t(e),ve(null),ve(void 0))]}function D_(e){return e.map(t=>L_(t))}function __(e,t){return t?D_(e).concat(e):e}function k0(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:__(e.values!==void 0?e.values:$_(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 F_(e){return _d(e.key,R0(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function j_(e){return F_(k0(e))}function V_(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 E0(e){return R0(k0(e))}function C0(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return E0(V_("stringUnit"in e?Ce({unit:e.stringUnit}):t?Ce():Ce({unit:"binary"}),e))}var B_=JSON.stringify,U_=JSON.parse;function W_(e){if(typeof e!="string")throw new L("Cannot unmap the passed value");return U_(e)}function z_(e={}){return C0(e).map(B_,W_)}var G_=Object.defineProperties;function zc(e,t){return`Stream(${t!==void 0?`${ce(t,",")}\u2026`:`${e} emitted`})`}var H_=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 G_(new j(s(this.arb,e.clone())),{toString:{value:()=>zc(o,i!==null?i.map(xe):void 0)},[ft]:{value:()=>zc(o,i!==null?i.map(xe):void 0)},[Ft]:{value:async()=>zc(o,i!==null?await Promise.all(i.map(Td)):void 0)},[Oe]:{value:n,enumerable:!0}})};return new _(n(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function q_(e,t){return new H_(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function K_(e){return ce(e,"")}function Iw(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function Y_(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return ge(e,1)}}function J_(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 Gc=String.fromCharCode;function Z_(e){return e<26?Gc(e+65):e<52?Gc(e+97-26):e<62?Gc(e+48-52):e===62?"+":"/"}function X_(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 Q_(){return oe({min:0,max:63}).map(Z_,X_)}function e7(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=Q_();return ae(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:$L(a,Iw)}).map(K_,Iw).map(Y_,J_)}var Pw=Object.is;function t7(e,t){let r=new _t,n=0;for(let i of e)Pw(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(Pw(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 r7=Math.floor,Tw=Math.log,n7=Array.isArray,A0=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+r7(Tw(n-r)/Tw(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]),n1(i,a,1)}return this.isOrdered&&i1(o,(s,a)=>s-a),new _(G(o,s=>this.originalArray[s]),r.context)}canShrinkWithoutContext(e){return!n7(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:t7(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 i7(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new A0(e,!0,r,n)}function o7(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new A0(e,!1,r,n)}var s7={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"},a7={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 l7(e){return e<10?Ve(e):s7[e]}function Mw(e,t){let r="";for(;e.length+r.length<t;)r+="0";return r+e}function Ow(e){let t="";for(let r=e;r!==0;){let n=r>>5;t=l7(r-(n<<5))+t,r=n}return t}function u7(e,t){let r=~~(e/1073741824),n=e&1073741823;return Mw(Ow(r),t-6)+Mw(Ow(n),6)}function I0(e){return function(r){return u7(r,e)}}function Hc(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=a7[e[n]];if(i===void 0)throw new L("Unsupported type");t+=i*r,r*=32}return t}var c7=I0(10),Nw=I0(8);function d7(e){return c7(e[0])+Nw(e[1])+Nw(e[2])}function f7(e){if(typeof e!="string"||e.length!==26)throw new Error("Unsupported type");return[Hc(e.slice(0,10)),Hc(e.slice(10,18)),Hc(e.slice(18))]}function p7(){return B(oe({min:0,max:0xffffffffffff}),oe({min:0,max:0xffffffffff}),oe({min:0,max:0xffffffffff})).map(d7,f7)}function P0(e){return X4(pi(e,16),8,"0")}function h7(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!==P0(t))throw new Error("Unsupported value: invalid content");return t}function qc(e,t){return oe({min:e,max:t}).map(P0,h7)}function m7(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 g7=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function y7(e){if(typeof e!="string")throw new Error("Unsupported type");let t=g7.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 Lw="0123456789abcdef";function b7(e){let t={},r={};for(let o=0;o!==e.length;++o){let s=Lw[o],a=Lw[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 S7(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 w7(e={}){let t=qc(0,4294967295),r=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];S7(r);let{versionsApplierMapper:n,versionsApplierUnmapper:i}=b7(r);return B(t,qc(0,268435456*r.length-1).map(n,i),qc(2147483648,3221225471),t).map(m7,y7)}function v7(e){return Ce({unit:Vd("-._~!$&'()*+,;=:"),size:e})}function x7([e,t,r]){return(e===null?"":`${e}@`)+t+(r===null?"":`:${r}`)}function R7(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 k7(e){return`[${e}]`}function E7(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function T0(e){let t=e||{},r=t.size,n=[Bd({size:r}),...t.withIPv4===!0?[Gd()]:[],...t.withIPv6===!0?[u0().map(k7,E7)]:[],...t.withIPv4Extended===!0?[l0()]:[]];return B(t.withUserInfo===!0?jt(v7(r)):ve(null),Me(...n),t.withPort===!0?jt(Qt(65535)):ve(null)).map(x7,R7)}function M0(e){return Ce({unit:Vd("-._~!$&'()*+,;=:@/?"),size:e})}function O0(e={}){return M0(e.size)}function N0(e={}){return Ce({unit:Vd("-._~!$&'()*+,;=:@"),size:e.size})}function C7(e){return ce(G(e,t=>`/${t}`),"")}function A7(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 n1(Be(e,"/"),1)}function I7(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 Kc(e,t){return ae(N0({size:e}),{size:t}).map(C7,A7)}function P7(e){let[t,r]=I7(e);return t===r?Kc(t,r):Me(Kc(t,r),Kc(r,t))}function L0(e){return P7(Dd((e||{}).size))}function $0(e={}){return M0(e.size)}function T7(e){let[t,r,n]=e;return`${t}://${r}${n}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var M7=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function O7(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=M7.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 N7(e){let t=e||{},r=Dd(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"]),T0(i),L0({size:r}),t.withQueryParameters===!0?jt($0({size:r})):ve(null),t.withFragments===!0?jt(O0({size:r})):ve(null)).map(T7,O7)}var L7=class D0{constructor(t,r){this.commands=t,this.metadataForReplay=r,this[Oe]=function(){return new D0(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}},$7=class wd{constructor(t){if(this.cmd=t,this.hasRan=!1,Id(t)){let r=t[ft];this[ft]=function(){return r.call(t)}}if(Pd(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 wd(this.cmd[Oe]()):new wd(this.cmd)}toString(){return this.cmd.toString()}},$w=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)}},D7=class extends de{constructor(e,t,r,n,i){super(),this.sourceReplayPath=n,this.disableReplayLog=i,this.oneCommandArb=Me(...e).map(o=>new $7(o)),this.lengthArb=bd(0,t,r),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify($w.stringify(this.replayPath))}`}buildValueFor(e,t){let r=e.map(i=>i.value_),n={shrunkOnce:t,items:e};return new _(new L7(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?$w.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 _7(e,t={}){let{size:r,maxCommands:n=xr,disableReplayLog:i=!1,replayPath:o=null}=t;return new D7(e,mi(r,0,n,t.maxCommands!==void 0),n,o,i)}var F7=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}},j7=function*(e,t){for(let r of t)yield new F7(e,r)},_0=(e,t,r,n,i)=>e.then(o=>{let{model:s,real:a}=o,l=r;for(let u of t)l=i(l,()=>n(u,s,a));return l}),V7=(e,t)=>_0({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),B7=e=>typeof e.then=="function",F0=async(e,t,r=Promise.resolve())=>await _0({then:s=>{let a=e();return B7(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 U7(e,t){V7(e,t)}async function W7(e,t){await F0(e,t)}async function z7(e,t,r){let n=F0(t,j7(e,r),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(n),await e.waitAll()}var Os=e=>e(),j0=class vd{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 vd(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 ${K$(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(vd.buildLog).map(t=>`-> ${t}`).join(`
132
+ `)+"`"}};function V0(e){let t=0;return{clone:()=>V0(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 Dw(e,t){return new j0(e,V0(t))}function B0(e){let t=e.clone();return{clone:()=>B0(t),nextTaskIndex:r=>e.nextInt(0,r.length-1)}}var G7=class extends de{constructor(e){super(),this.act=e}generate(e,t){return new _(new j0(this.act,B0(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function H7(e){let{act:t=r=>r()}=e||{};return new G7(t)}function q7(e,t){let{act:r=n=>n()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?Dw(r,e):function(n,...i){return Dw(r,i)}}function K7(e={}){return Vt(e,O("-9223372036854775808"),O("9223372036854775807"),n4,rr)}function Y7(e={}){return Vt(e,O(0),O("18446744073709551615"),i4,rr)}function J7(e,t){return t}var Yc=Math.floor,Z7=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:Yc(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?Yc(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:Yc(t/i)},expression:n.astNode},minLength:e.quantifier.from*n.minLength}:{astNode:{...e,expression:n.astNode},minLength:e.quantifier.from*n.minLength}}default:return J7(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:Z7(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 X7(e,t){return et(e,t).astNode}function Q7(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=U0(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 U0(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:U0(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 Q7(e)}}function e8(e){return js(e,!0,!0)}function _w(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Ee(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function xd(e){return e>="0"&&e<="9"}function W0(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 t8(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=W0(e,n):i==="("&&(r+=1)}throw new Error("Missing closing ')'")}function r8(e,t){let r=!1;for(let n=t;n!==e.length;++n){let i=e[n];if(!xd(i)){if(t===n)return-1;if(i===","){if(r)return-1;r=!0}else return i==="}"?n:-1}}return-1}function n8(e,t,r,n){switch(e[t]){case"[":return n===1?t+1:W0(e,t+1)+1;case"{":{if(n===1)return t+1;let i=r8(e,t+1);return i===-1?t+1:i+1}case"(":return n===1?t+1:t8(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(xd(i)){let o=r?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&xd(e[s]);++s);return s}return t+(r?_w(e,t+1):1)+1}}default:return t+(r?_w(e,t):1)}}function Ns(e,t,r,n){let i=n8(e,t,r,n);return e.substring(t,i)}var Fw={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=Yd(Ys),Kd={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"},Rd=Yd(Kd),z0={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"},jw=Yd(z0);function Yd(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 i8(e){return e in Kd||e in Rd}function o8(e){return e in Ys||e in gi}function Vw(e){if(e in Fw)return Fw[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 Bw(e){if(e in Rd)return Rd[e];if(e in jw)return jw[e];if(e in gi)return gi[e];if(e in Kd||e in z0||e in Ys)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function s8(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:Vw(n),canonicalValue:Bw(i)}}if(i8(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:Bw(e)};if(o8(e)){let n=Vw(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 Jc=String.fromCodePoint;function Zc(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function G0(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 Xc(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:Jc(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:Jc(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(G0(t)){let r=e.substring(1),n=Number(r);return{type:"Char",kind:"decimal",symbol:Jc(n),value:e,codePoint:n}}if(e.length>2&&(t==="p"||t==="P")){let r=t==="P";return s8(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=Zc(e);e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"?":{let l=Zc(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=Zc(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=Xc(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]==="\\"&&G0(s[1])){let l=Number(s.substring(1));r||l<=n.lastIndex?e.push({type:"Backreference",kind:"number",number:l,reference:l}):e.push(Xc(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(Xc(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 a8(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 l8=String.fromCodePoint;function u8(e){return e.binary||e.shorthand?e.canonicalValue:`${e.canonicalName}=${e.canonicalValue}`}function Uw(e,t,r,n){let i=-1;for(let o=t;o<=r;++o)if(e.test(l8(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 c8(e,t){let r=new RegExp(`^\\${t?"P":"p"}{${e}}$`,"u"),n=[];return Uw(r,0,55295,n),Uw(r,57344,1114111,n),n}var Ww=new Map;function d8(e,t){let r=`${t?"P":"p"}:${e}`,n=Ww.get(r);if(n!==void 0)return n;let i=c8(e,t);return Ww.set(r,i),i}function f8(e){return an(...G(d8(u8(e),e.negative),t=>od(t)))}var p8=String.fromCodePoint,zw=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],Gw=[..."0123456789"],Hw=[...` \r
134
+ \v\f`],kd=[...`\r
135
+ `],H0=[...""],h8=[...kd,...H0],wr=()=>Ce({unit:"grapheme-ascii",minLength:1,maxLength:1});function qw(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(...zw);case"\\W":return wr().filter(n=>$t(zw,n)===-1);case"\\d":return vt(...Gw);case"\\D":return wr().filter(n=>$t(Gw,n)===-1);case"\\s":return vt(...Hw);case"\\S":return wr().filter(n=>$t(Hw,n)===-1);case"\\b":case"\\B":throw new L(`Meta character ${e.value} not implemented yet!`);case".":{let n=r.dotAll?H0:h8;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 qw(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=>o1(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=>p8(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(...kd)).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(...kd),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 f8(e);default:throw qw(e)}}function m8(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=e8(a8(e));r!==void 0&&(o=X7(o,r));let s=Xt(o,n,i);return r!==void 0?s.filter(a=>[...a].length<=r):s}function g8(e){let t=[];for(let r=0;r!==e.length;++r)t.push(e[r].next());return t}function y8(e,t){for(let r=0;r!==e.length;++r)t[r]=e[r].next()}function b8(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*S8(...e){let t=g8(e);for(;!b8(t);)yield t.map(r=>r.value),y8(e,t)}function*w8(e){let t=e;for(;;)yield t,++t}var v8=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(S8(this.arb.shrink(e,t),w8(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 x8(e,t){return new v8(e,t)}var R8=Lb({Arbitrary:()=>de,ExecutionStatus:()=>_N,PreconditionFailure:()=>nr,Random:()=>Md,Stream:()=>j,Value:()=>_,VerbosityLevel:()=>mN,__commitHash:()=>C8,__type:()=>k8,__version:()=>E8,anything:()=>E0,array:()=>ae,assert:()=>o3,asyncDefaultReportMessage:()=>k1,asyncModelRun:()=>W7,asyncProperty:()=>pN,asyncStringify:()=>Td,asyncToStringMethod:()=>Ft,base64String:()=>e7,bigInt:()=>rr,bigInt64Array:()=>K7,bigUint64Array:()=>Y7,boolean:()=>bi,chainUntil:()=>Y3,check:()=>C1,clone:()=>eL,cloneIfNeeded:()=>tn,cloneMethod:()=>Oe,commands:()=>_7,compareBooleanFunc:()=>Q$,compareFunc:()=>tD,configureGlobal:()=>cN,constant:()=>ve,constantFrom:()=>vt,context:()=>W3,createDepthIdentifier:()=>Ld,date:()=>F1,defaultReportMessage:()=>R1,dictionary:()=>_d,domain:()=>Bd,double:()=>Ks,emailAddress:()=>p$,entityGraph:()=>QD,falsy:()=>B3,float:()=>i0,float32Array:()=>f0,float64Array:()=>p0,func:()=>iD,gen:()=>h3,getDepthContextFor:()=>Nd,hasAsyncToStringMethod:()=>Pd,hasCloneMethod:()=>vr,hasToStringMethod:()=>Id,hash:()=>Gs,infiniteStream:()=>q_,int16Array:()=>h0,int32Array:()=>m0,int8Array:()=>g0,integer:()=>oe,ipV4:()=>Gd,ipV4Extended:()=>l0,ipV6:()=>u0,json:()=>z_,jsonValue:()=>C0,letrec:()=>c0,limitShrink:()=>x8,lorem:()=>a_,map:()=>yd,mapToConstant:()=>an,maxSafeInteger:()=>a0,maxSafeNat:()=>lD,memo:()=>d_,mixedCase:()=>y_,modelRun:()=>U7,nat:()=>Qt,noBias:()=>zs,noShrink:()=>Hs,object:()=>j_,oneof:()=>Me,option:()=>jt,pre:()=>V6,property:()=>hN,readConfigureGlobal:()=>dt,record:()=>gd,resetConfigureGlobal:()=>dN,sample:()=>a3,scheduledModelRun:()=>z7,scheduler:()=>H7,schedulerFor:()=>q7,set:()=>x0,shuffledSubarray:()=>o7,sparseArray:()=>v0,statistics:()=>u3,stream:()=>tr,string:()=>Ce,stringMatching:()=>m8,stringify:()=>xe,subarray:()=>i7,toStringMethod:()=>ft,tuple:()=>B,uint16Array:()=>y0,uint32Array:()=>b0,uint8Array:()=>S0,uint8ClampedArray:()=>w0,ulid:()=>p7,uniqueArray:()=>Rr,uuid:()=>w7,webAuthority:()=>T0,webFragments:()=>O0,webPath:()=>L0,webQueryParameters:()=>$0,webSegment:()=>N0,webUrl:()=>N7}),k8="module",E8="4.8.0",C8="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",Ne=R8;function Js(e){return e?.values!=null&&e.values.length>0?Ne.constantFrom(...e.values):A8(e)}function A8(e){if(e?.type==="number")return Ne.integer();if(e?.type==="boolean")return Ne.boolean();let t=e?.generator==null?void 0:P8[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 I8="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],ln=e=>Ne.array(Ne.constantFrom(...I8),{maxLength:e,minLength:1}).map(t=>t.join("")),Jd=(e,t)=>Ne.array(ln(10),{maxLength:t,minLength:1}).map(r=>r.join(e)),P8={"company.name":Jd(" ",3),"date.iso":T8(),"internet.email":M8(),"internet.url":O8(),"lorem.slug":Jd("-",3),"lorem.word":ln(10),"person.fullName":Jd(" ",2)};function T8(){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 M8(){return Ne.tuple(ln(12),ln(10),Ne.constantFrom("com","dev","io","org","ai")).map(([e,t,r])=>`${e}@${t}.${r}`)}function O8(){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 q0=new WeakMap;function Zd(e){let t=q0.get(e);if(t!=null)return t;let r=Object.fromEntries(Object.entries(e.paramSpaces).map(([n,i])=>[n,L8(i)]));return q0.set(e,r),r}var N8=24301;function L8(e){let[t]=Ne.sample(Js(e),{numRuns:1,seed:N8});if(t==null)throw new Error("arbitrary produced no sample");return t}function Si(e){return{aborted:!0,findings:[],fired:[],teardown:e}}function Qd(e,t){return new $8(D8(e,t))}async function D8({browser:e,hub:t,request:r},n){if(n.aborted)return Xd(Si("skipped"));let i=U8({lockfile:r.lockfile,options:r.options,runId:r.runId,signal:n}),o=async s=>{try{return Xd(await F8({browser:e,established:s,hub:t,request:r,signal:n}))}catch(a){return K0(wn(a))}};return B8(i,r).match(o,s=>_8(s,i.teardown))}async function _8(e,t){return e.kind!=="aborted"?K0(e):Xd(Si(await Y0(t)))}function Y0(e){return e().match(()=>"done",()=>"failed")}async function F8(e){let t=await j8(e);if(t.kind==="completed")return await e.established.teardown().match(ro,Jp),{aborted:!1,...t.result};let r=await Y0(e.established.teardown);if(t.kind==="aborted")return Si(r);throw t.error}async function j8({browser:e,established:t,hub:r,request:n,signal:i}){try{Ht(i);let{close:o,driver:s,emitAssertion:a}=await Fl({baseUrl:n.options.baseUrl,browser:e,capture:n.capture?{hub:r,runId:n.runId}:null,clientState:t.clientState,engine:Ll(z8(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 Tl({canon:Ya(n.lockfile),classify:Ka(n.lockfile),driver:s,initialState:{snapshot:t.snapshot},onAssertion:a,onEvent:n.onEvent??ro,sequence:n.sequence??V8(n.lockfile,n.testName,n.params),...xc(n.lockfile)},i)}}finally{await o()}}catch(o){return nh(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function V8(e,t,r){return co(e,t).map(n=>({params:{...Zd(n),...r},transition:n}))}function B8(e,t){return Pn(t.lockfile,t.testName,{generate:Nl(Ol(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 U8({lockfile:e,options:t,runId:r,signal:n}){let i=Ul({baseUrl:t.engineUrl,runId:r,secret:t.secret},n);return{materialize:hl(i.setupWorld),reader:Bl(e.entities,W8(e),i.query),teardown:i.teardown}}function W8(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function z8(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}function K8({clientVersion:e,debugDir:t,headed:r,writeOtlpPortFile:n}){let i=pm({headed:r}),o,s,a=async()=>(o??=vc({clientVersion:e,debugDir:t,writeOtlpPortFile:n}),s=await o,s),l=async(c,d)=>{if(d.aborted)return H8(Si("skipped"));try{let p=await a();return c.options.headed&&!r?await jl(!0,async h=>Qd({browser:h,hub:p,request:c},d)):await Qd({browser:await i.acquire(),hub:p,request:c},d)}catch(p){return G8(wn(p))}};return{close:async()=>{await i.close();let c=o;o=void 0,s=void 0,c!=null&&await c.then(d=>d.close()).catch(()=>{})},injectSpan:(c,d)=>{s?.injectSpan(c,d)},runOnce:(c,d)=>new q8(l(c,d))}}function wi(e,t){let r=e.axes.flatMap(n=>n.classify(t).map(([i,o])=>`${i}:${o}`));return[t.label,...r.toSorted((n,i)=>n.localeCompare(i))].join("|")}function ef(e){return e.axes.map(t=>t.name).join("+")}function tf(e){return{name:`counts(${e})`,classify:({pre:t})=>[...t.entities].flatMap(([r,n])=>n.size===0?[]:[[r,J8(e,n.size)]])}}function rf(e){let t=J0(e);return{name:"enum-fields",classify:({pre:r})=>[...r.entities].flatMap(([n,i])=>[...i.values()].flatMap(o=>Y8(n,o,t)))}}function Y8(e,t,r){return Object.entries(t).flatMap(([n,i])=>r.has(`${e}.${n}`)?[[`${e}.${n}`,Z8(i)]]:[])}function J0(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 J8(e,t){return e==="presence"?"1+":e==="unit"?t===1?"1":"2+":t<=2?String(t):"3+"}function Z8(e){return e==null?"\u2205":String(e)}import{createHash as X8}from"crypto";import{appendFile as Q8,mkdir as e9,readFile as t9}from"fs/promises";import r9 from"path";import{ResultAsync as X0}from"neverthrow";import{z as R}from"zod";var un=R.enum(["crash","invariant","law","frame"]),Z0=R.object({intent:R.string().min(1),test:R.string().min(1)}),n9=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)})]),Q0=R.discriminatedUnion("kind",[R.object({divergence:n9,kind:R.literal("consistency"),layer:un,step:Z0.nullable()}),R.object({kind:R.literal("obligation"),layer:un,source:R.string().min(1),step:Z0}),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)})]),i9=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)}),o9=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(Q0),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()])))}),s9=R.object({actionHash:R.string().min(1),at:R.string().min(1),depot:R.string().min(1),evidence:R.array(R.string().min(1)),kind:R.literal("flaky-candidate"),lensId:R.string().min(1),parts:R.array(Q0),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1))}),a9=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()}),l9=R.object({at:R.string().min(1),kind:R.literal("resolution"),signature:R.string().min(1)}),u9=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",[i9,o9,s9,a9,l9,u9]);function Xs(e){return af(e).slice(0,12)}function ze(e){return`${e.lensId} ${e.actionHash} ${e.targetKey}`}function vi(e){return e.reduce((t,r)=>m9(t,r),h9())}function xi(e){return X0.fromPromise(c9(e),t=>({error:t,kind:"io"})).map(t=>f9(t))}function nf(e,t){let r=t.map(n=>`${JSON.stringify(n)}
136
+ `).join("");return X0.fromPromise(e9(r9.dirname(e),{recursive:!0}).then(()=>Q8(e,r)),n=>({error:n,kind:"io"}))}function of(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 af(J({entities:n,spec:r}))}function sf(e){return af(J(e))}async function c9(e){return(await t9(e,"utf8").catch(r=>{if(d9(r))return"";throw r})).split(`
137
+ `).filter(r=>r.length>0)}function d9(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}function f9(e){return e.flatMap(t=>{let r=Zs.safeParse(p9(t));return r.success?[r.data]:[]})}function p9(e){try{return JSON.parse(e)}catch{return null}}function af(e){return X8("sha256").update(e).digest("hex")}function h9(){return{covered:new Set,findings:new Map,flaky:new Map,saturations:new Map}}function m9(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:g9(e.flaky,t)};if(t.kind==="finding")return{...e,covered:new Set([...e.covered,ze(t)]),findings:y9(e.findings,t)};if(t.kind==="resolution")return{...e,findings:b9(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 g9(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 y9(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 b9(e,t){let r=e.get(t.signature);return r==null?e:new Map([...e,[t.signature,{...r,resolvedAt:t.at}]])}function lf(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 w9(e,r,t),{edges:t.edges,saturationDepth:t.saturationDepth,states:t.seen.size,targets:t.targets}}var S9=24301,ev=new WeakMap;function Qs(e,t){let r=ev.get(e)??new Map;ev.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,C9(s,t)]));return r.set(t,i),i}function w9(e,t,r){let n=[...t],i=0;for(;i<n.length;){let o=n[i];i+=1,o!=null&&v9(e,o,r).forEach(s=>n.push(s))}}function v9(e,t,r){let n={snapshot:t.snapshot},i=o=>Qs(o,E9(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 x9({acc:r,node:t,option:o,params:e,transition:s,witness:l}),R9({acc:r,node:t,option:o,params:e,trail:a})})}function x9({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 R9({acc:e,node:t,option:r,params:n,trail:i}){if(i.length>=n.maxDepth)return[];let o=r.firing.next.snapshot;if(k9(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 k9(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 E9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function C9(e,t){let[r]=Ne.sample(Js(e),{numRuns:1,seed:S9+t});if(r==null)throw new Error("arbitrary produced no sample");return r}var A9=10;function uf(e){return ff(e).reduce((t,r)=>t+rv(e,r).length,0)}function cf(e){return e.targets.size+e.edges.size}function df(e){let t=ff(e).map(o=>rv(e,o)),r=I9(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)=>tv(e,s)>tv(e,o)?s:o)}}function ff(e){return[{entries:e.graph.targets,index:1},{entries:e.graph.edges,index:2}]}function rv(e,t){return[...t.entries].flatMap(([r,n])=>{let i=nv({params:e,ring:t.index,targetKey:r,witness:n});return e.covered.has(iv(e,i))?[]:[i]})}function nv({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 iv(e,t){return ze({actionHash:t.actionHash,lensId:e.lensId,targetKey:t.targetKey})}function I9(e,t){if(e.tick===0||e.tick%A9!==0)return null;let r=ff(e).flatMap(i=>[...i.entries].flatMap(([o,s])=>{let a=nv({params:e,ring:i.index,targetKey:o,witness:s});return e.covered.has(iv(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 P9=/delete|remove|cancel|deactivate|revoke|archive/i;function tv(e,t){let r=t.ring===2&&T9(e,t)?4:0,n=P9.test(t.targetKey)?2:0,i=1/(1+t.witness.trail.length);return r+n+i}function T9(e,t){return new Set(t.witness.trail.flatMap(n=>{let i=e.corpus[n.idx];return i==null?[]:[i.test]})).size>1}function M9(e){let t=O9(e,e.witnessTrail);return t==null?{covers:[],firings:[]}:L9(e,t)}function O9(e,t){return t.reduce((r,n)=>r==null?null:N9(e,r,n),{covers:[],firings:[],snapshot:e.depotSnapshot})}function N9(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=ov({params:e,planned:r,pre:t.snapshot,transition:n});return{covers:[...t.covers,o],firings:[...t.firings,r],snapshot:i.next.snapshot}}function ov({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 L9(e,t){let r=new Set([...e.covered,...t.covers.map(i=>ze({...i,lensId:e.lensId}))]),n=sv({params:e,seen:r,state:t});return{covers:n.covers,firings:n.firings}}function sv({params:e,seen:t,state:r}){if(r.firings.length>=e.maxLength)return r;let n=$9({params:e,seen:t,state:r});return n==null?r:(t.add(ze({...n.coverage,lensId:e.lensId})),sv({params:e,seen:t,state:{covers:[...r.covers,n.coverage],firings:[...r.firings,n.planned],snapshot:n.snapshot}}))}function $9({params:e,seen:t,state:r}){let n=o=>Qs(o,D9(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:ov({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 D9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function pf(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=>_9(n))]:r}function hf(e,t,r){return Pn({...e,tests:[t.test]},t.test.name,r)}function _9(e){return F9(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 F9(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 j9(e,t){let r=await ta({attemptIndex:0,capture:!1,firings:e.trail.firings,params:e},t);return r.kind!=="completed"?lv(r):r.findings.length===0?{kind:"clean",rows:q9(e)}:V9(e,Ri(e.depot.name,r.findings),t)}function lv(e){return e.kind==="error"?{error:e.error,kind:"error"}:{kind:e.kind}}async function V9(e,t,r){let n=await ta({attemptIndex:1,capture:!1,firings:e.trail.firings,params:e},r);return n.kind!=="completed"?lv(n):Ri(e.depot.name,n.findings).signature!==t.signature?{kind:"flaky",rows:[K9(e,t)]}:B9({digest:t,params:e,signal:r})}async function ta({attemptIndex:e,capture:t,firings:r,params:n},i){let o=n.runIdFor(e);return(await n.session.runOnce({capture:t,lockfile:H9(n),onEvent:void 0,options:n.options,params:void 0,runId:o,sequence:G9(n,r),testName:n.depot.test.name},AbortSignal.any([i,AbortSignal.timeout(n.attemptTimeoutMs)]))).match(a=>a.aborted?{kind:i.aborted?"aborted":"timeout"}:{findings:a.findings,kind:"completed",runId:o},a=>({error:a,kind:"error"}))}async function B9({digest:e,params:t,signal:r}){let n=await gf({attemptIndex:2,budget:t.shrinkBudget,chunks:2,firings:t.trail.firings,params:t,runId:t.runIdFor(1),signal:r,signature:e.signature});if(n.kind!=="shrunk")return n.outcome;let i=await U9({firings:n.firings,params:t,signal:r,signature:e.signature});if(i.kind==="aborted")return{kind:"aborted"};let o=X9({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 U9({firings:e,params:t,signal:r,signature:n}){let i=await ta({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 gf(e){return e.budget<=0||e.firings.length<=1?ea(e):uv(e,z9(e.firings,e.chunks))}function ea(e){return{firings:e.firings,kind:"shrunk",runId:e.runId}}async function uv(e,t){let[r,...n]=t;if(r==null)return W9(e);if(e.budget<=0)return ea(e);let i=await ta({attemptIndex:e.attemptIndex,capture:!1,firings:r,params:e.params},e.signal);if(i.kind==="aborted")return{kind:"halted",outcome:{kind:"aborted"}};if(i.kind==="timeout")return ea(e);let o={...e,attemptIndex:e.attemptIndex+1,budget:e.budget-1};return i.kind==="completed"&&Ri(e.params.depot.name,i.findings).signature===e.signature?gf({...o,chunks:2,firings:r,runId:i.runId}):uv(o,n)}function W9(e){return e.chunks>=e.firings.length?Promise.resolve(ea(e)):gf({...e,chunks:e.chunks*2})}function z9(e,t){let r=Math.min(t,e.length),n=Math.ceil(e.length/r);return Array.from({length:r},(i,o)=>e.filter((s,a)=>a<o*n||a>=(o+1)*n)).filter(i=>i.length>0&&i.length<e.length)}function G9(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 H9(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 q9(e){return e.trail.covers.map(t=>({actionHash:t.actionHash,at:e.now(),kind:"covered",lensId:e.lensId,targetKey:t.targetKey}))}function K9(e,t){return{actionHash:mf(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:mf(e).targetKey,trail:e.trail.covers.map(r=>r.targetKey)}}function cv(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:Cm(i),part:J9(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:Y9(n),parts:n,signature:J({depot:e,parts:n.map(i=>J(i))})}}var av={crash:0,frame:3,invariant:1,law:2};function Y9(e){return e.map(r=>r.layer).toSorted((r,n)=>av[r]-av[n]).at(0)??"frame"}function J9(e){let t=cv(e);switch(e.kind){case"consistency":return{divergence:Z9(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 Z9(e){return e.kind==="singleton-mismatch"?{kind:e.kind,singleton:e.singleton}:{entity:e.entity,kind:e.kind}}function X9({digest:e,minimal:t,params:r,runId:n}){let i=mf(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 mf(e){let t=e.trail.covers.at(-1);if(t==null)throw new Error("trail has no coverage");return t}function BK(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 UK({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 WK({devSessionId:e,version:t}){return`ripplo daemon: v${t} ready as local executor for session ${e} (syncs on every \`npx ripplo run\` \u2014 Ctrl-C to stop)`}function zK({cwd:e,pid:t}){return`ripplo daemon: another daemon is already running for this project${t==null?"":` (pid ${String(t)})`} (cwd ${e}).`}function GK(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function HK(e){if(e.kind==="not-running")return"daemon: not running";if(e.kind==="unresponsive")return`daemon: running but no reply within ${String(e.timeoutMs/1e3)}s \u2014 likely busy executing runs, retry when the batch drains`;let{status:t}=e,r=t.version==null?"version unknown (pre-0.7.8)":`v${t.version}`,n=`${String(t.active)} active, ${String(t.queued)} queued`,i=`explorer: ${t.explorer}, ${String(t.exploring)} exploring`;return`daemon: running (${r} | ${n} | ${i} | ${Q9(t.progress)})`}function Q9(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, retried after cooldown)`,n=eF(e);return`explore: ${t}${r}, ${String(e.findings)} findings, ${n}`}function qK(e){let t=e.daemonVersion==null?"an older version":`v${e.daemonVersion}`;return e.kind==="restarted"?`ripplo: daemon was ${t} \u2014 restarted on the current version`:`ripplo: daemon ${t} is older than this CLI but has runs in flight \u2014 restart it when idle to update`}function KK(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 eF(e){return e.saturated?e.deferred===0?"saturated":"waiting \u2014 every open target is deferred, retrying after cooldown":"searching"}import tF from"p-queue";var rF=4,nF={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},ra=new tF({concurrency:rF}),Bt={headedActive:0,interactiveActive:0,interactiveQueued:0},dv={current:null};function ZK({headed:e,task:t,workClass:r}){let n=nF[r];return r==="p3-explore"?ra.add(t,{priority:n}):(Bt.interactiveQueued+=1,na(),ra.add(()=>iF({headed:e,task:t}),{priority:n}))}function XK(e){!Number.isFinite(e)||e<1||(ra.concurrency=Math.floor(e),na())}function yf(){return{active:Bt.interactiveActive,headedActive:Bt.headedActive,poolSize:ra.concurrency,queued:Bt.interactiveQueued}}function QK(e){dv.current=e}async function iF({headed:e,task:t}){Bt.interactiveQueued-=1,Bt.interactiveActive+=1,Bt.headedActive+=e?1:0,na();try{return await t()}finally{Bt.interactiveActive-=1,Bt.headedActive-=e?1:0,na()}}function na(){dv.current?.()}import bf from"fs";import Sf from"path";function fv(e){try{let t=oF(e);if(t==null)return;let r=Sf.join(t,"HEAD"),n=bf.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 oF(e){let t=Sf.join(e,".git");if(bf.statSync(t).isDirectory())return t;let n=bf.readFileSync(t,"utf8").trim(),i="gitdir:";if(!n.startsWith(i))return;let o=n.slice(i.length).trim();if(o.length!==0)return Sf.resolve(e,o)}import sF from"crypto";import{graphql as aF}from"gql.tada";import{err as lF,ok as uF}from"neverthrow";var cF=aF(`
139
139
  mutation SyncDevSession(
140
140
  $projectId: String!
141
141
  $cwd: String!
@@ -154,13 +154,13 @@ ${KN(i)}`),o}function v1(e){return td(e,xe)}async function x1(e){let t=[];functi
154
154
  hooksPaused
155
155
  }
156
156
  }
157
- `);async function cY(e,t){let r=await bn(e);if(r.isErr())return aF({error:r.error,kind:"compilation-failed"});let n=await bf({config:t,cwd:e,lockfile:r.value});return lF({devSessionId:n.devSessionId,lockfile:r.value})}async function bf(e){let t=cF(e.lockfile);return bF({config:e.config,cwd:e.cwd,payload:t})}function cF(e){let t=dF(e);return{preconditions:e.entities.map(r=>({depends:t.get(r.name)??[],description:r.description??"",name:r.name,returns:r.identity})),workflows:e.tests.map(r=>({expectedOutcome:r.intent,name:r.intent,preconditions:mF(gF(r),t),requiresKeys:r.world.map(n=>({namespace:n.as,preconditionName:n.entity})),slug:rt(r.name),sourcePath:r.sourcePath??null,spec:JSON.stringify(r)}))}}function dF(e){let t=e.tests.reduce((r,n)=>fF(r,n),new Map);return new Map([...t].map(([r,n])=>[r,[...n]]))}function fF(e,t){let r=[...t.world,...t.maybe],n=new Map(r.map(i=>[i.as,i.entity]));return r.reduce((i,o)=>{let s=pF(o,n),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function pF(e,t){return Object.values(e.set).flatMap(r=>hF(r)).map(r=>t.get(r)).filter(r=>r!=null&&r!==e.entity)}function hF(e){return e==null||typeof e!="object"?[]:"ref"in e?[fv(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>fv(t.ref))}function fv(e){let[t]=e.split(".");return t??e}function mF(e,t){let r=(n,i)=>n.has(i)?n:(t.get(i)??[]).reduce((o,s)=>r(o,s),new Set([...n,i]));return[...e.reduce((n,i)=>r(n,i),new Set)]}function gF(e){return[...new Set(e.world.map(t=>t.entity))]}function yF(e){return oF.createHash("sha256").update(JSON.stringify(e)).digest("hex")}async function bF({config:e,cwd:t,payload:r}){let n=yF(r),i=dv(t),o=await _e({config:e,document:uF,variables:{branch:i??null,cwd:t,preconditions:r.preconditions.map(s=>({depends:[...s.depends],description:s.description,name:s.name,returns:[...s.returns]})),projectId:e.projectId,workflows:r.workflows.map(s=>({expectedOutcome:s.expectedOutcome,name:s.name,preconditions:[...s.preconditions],requiresKeys:s.requiresKeys.map(a=>({namespace:a.namespace,preconditionName:a.preconditionName})),slug:s.slug,sourcePath:s.sourcePath,spec:s.spec??null}))}});if(o.syncDevSession==null)throw new Error("syncDevSession returned null");return{devSessionId:o.syncDevSession.id,hash:n,hooksPaused:o.syncDevSession.hooksPaused}}import{randomUUID as NF}from"crypto";import{CancellationTokenSource as LF,ResponseError as $F}from"vscode-jsonrpc/node";import{graphql as Nv}from"gql.tada";import{createMessageConnection as SF,NotificationType as pv,RequestType as hv,RequestType0 as mv,SocketMessageReader as wF,SocketMessageWriter as vF}from"vscode-jsonrpc/node";import{z as v}from"zod";var xF="daemon.sock",RF="daemon.log";function mY(e){return Ut(e,xF)}function gY(e){return Ut(e,RF)}function gv(e){return SF(new wF(e),new vF(e))}var yv=v.object({all:v.boolean(),headed:v.boolean(),tests:v.array(v.string())}),yY=v.object({jobId:v.string(),total:v.number()}),kF=v.enum(["holder","standby","off"]),EF=v.object({covered:v.number(),deferred:v.number(),findings:v.number(),saturated:v.boolean(),total:v.number()}),bY=v.object({active:v.number(),explorer:kF,exploring:v.number(),progress:EF,queued:v.number(),version:v.string().optional()}),Sf=v.discriminatedUnion("kind",[v.object({kind:v.literal("pass")}),v.object({findingLines:v.array(v.string()),kind:v.literal("findings")}),v.object({detail:v.string(),kind:v.literal("error")}),v.object({detail:v.string(),kind:v.literal("dispatch-error")}),v.object({detail:v.string(),kind:v.literal("infra-error")})]),CF=v.discriminatedUnion("kind",[v.object({kind:v.literal("test-started"),runId:v.string(),testName:v.string()}),v.object({kind:v.literal("test-outcome"),outcome:Sf,runId:v.string(),testName:v.string()})]),SY=v.object({event:CF,jobId:v.string()}),wY=v.object({failed:v.number(),jobId:v.string(),notRun:v.number(),passed:v.number()}),vY=v.discriminatedUnion("code",[v.object({code:v.literal("compile-failed"),detail:v.string(),diagnostics:v.array(v.string()).default([])}),v.object({code:v.literal("selection-conflicting-flags")}),v.object({code:v.literal("selection-nothing-selected")}),v.object({code:v.literal("selection-unknown-ids"),known:v.array(v.string()),unknown:v.array(v.string())}),v.object({code:v.literal("scope-failed"),detail:v.string()}),v.object({code:v.literal("app-unreachable"),detail:v.string(),url:v.string()}),v.object({code:v.literal("sync-failed"),detail:v.string()}),v.object({code:v.literal("bad-message")})]),bv=v.object({findingId:v.string().min(1)}),xY=v.discriminatedUnion("kind",[v.object({kind:v.literal("resolved")}),v.object({kind:v.literal("unreachable")}),v.object({kind:v.literal("still-failing"),runId:v.string().optional()}),v.object({kind:v.literal("diverged"),runId:v.string().optional()}),v.object({kind:v.literal("flaky")}),v.object({kind:v.literal("aborted")}),v.object({kind:v.literal("finding-not-found")}),v.object({kind:v.literal("unreplayable"),reason:v.enum(["depot-missing","transition-missing","ledger-unreadable"])}),v.object({kind:v.literal("error"),reason:v.string()})]),Sv=new hv("ripplo/exploreReplay"),wv=new hv("ripplo/enqueue"),vv=new mv("ripplo/status"),xv=new mv("ripplo/shutdownIfIdle"),Rv=new pv("ripplo/jobEvent"),kv=new pv("ripplo/jobDone");import{err as wf,ok as Ev}from"neverthrow";function Cv({all:e,ids:t,lockfile:r}){let n=r.tests.map(a=>a.name);if(e&&t.length>0)return wf({kind:"conflicting-flags"});if(e)return Ev(r.tests.filter(a=>!a.stub).map(a=>a.name));if(t.length===0)return wf({kind:"nothing-selected"});let i=new Map(n.map(a=>[rt(a),a])),o=t.map(a=>({id:a,name:n.includes(a)?a:i.get(rt(a))})),s=o.filter(a=>a.name==null).map(a=>a.id);return s.length>0?wf({kind:"unknown-ids",known:n,unknown:s}):Ev(o.flatMap(a=>a.name==null?[]:[a.name]))}import{err as vf,ok as Iv}from"neverthrow";import{graphql as Pv}from"gql.tada";import{execFileSync as AF}from"child_process";function na(e,t){return AF("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}async function Tv({config:e,cwd:t,lockfile:r}){await PF({config:e,cwd:t,lockfile:r});let n=await MF(e);if(n.isErr())return vf(n.error);let i=new Map(r.tests.filter(s=>!s.stub).map(s=>[rt(s.name),s.name])),o=[...new Set(n.value)].flatMap(s=>{let a=i.get(s);return a==null?[]:[a]});return o.length===0?vf({kind:"scope-empty"}):Iv(o)}var IF=Pv(`
157
+ `);async function dY(e,t){let r=await bn(e);if(r.isErr())return lF({error:r.error,kind:"compilation-failed"});let n=await wf({config:t,cwd:e,lockfile:r.value});return uF({devSessionId:n.devSessionId,lockfile:r.value})}async function wf(e){let t=dF(e.lockfile);return SF({config:e.config,cwd:e.cwd,payload:t})}function dF(e){let t=fF(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:gF(yF(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 fF(e){let t=e.tests.reduce((r,n)=>pF(r,n),new Map);return new Map([...t].map(([r,n])=>[r,[...n]]))}function pF(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=hF(o,n),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function hF(e,t){return Object.values(e.set).flatMap(r=>mF(r)).map(r=>t.get(r)).filter(r=>r!=null&&r!==e.entity)}function mF(e){return e==null||typeof e!="object"?[]:"ref"in e?[pv(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>pv(t.ref))}function pv(e){let[t]=e.split(".");return t??e}function gF(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 yF(e){return[...new Set(e.world.map(t=>t.entity))]}function bF(e){return sF.createHash("sha256").update(JSON.stringify(e)).digest("hex")}async function SF({config:e,cwd:t,payload:r}){let n=bF(r),i=fv(t),o=await _e({config:e,document:cF,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 LF}from"crypto";import{CancellationTokenSource as $F,ResponseError as DF}from"vscode-jsonrpc/node";import{graphql as Lv}from"gql.tada";import{createMessageConnection as wF,NotificationType as hv,RequestType as mv,RequestType0 as gv,SocketMessageReader as vF,SocketMessageWriter as xF}from"vscode-jsonrpc/node";import{z as v}from"zod";var RF="daemon.sock",kF="daemon.log";function gY(e){return Ut(e,RF)}function yY(e){return Ut(e,kF)}function yv(e){return wF(new vF(e),new xF(e))}var bv=v.object({all:v.boolean(),headed:v.boolean(),tests:v.array(v.string())}),bY=v.object({jobId:v.string(),total:v.number()}),EF=v.enum(["holder","standby","off"]),CF=v.object({covered:v.number(),deferred:v.number(),findings:v.number(),saturated:v.boolean(),total:v.number()}),SY=v.object({active:v.number(),explorer:EF,exploring:v.number(),progress:CF,queued:v.number(),version:v.string().optional()}),vf=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")})]),AF=v.discriminatedUnion("kind",[v.object({kind:v.literal("test-started"),runId:v.string(),testName:v.string()}),v.object({kind:v.literal("test-outcome"),outcome:vf,runId:v.string(),testName:v.string()})]),wY=v.object({event:AF,jobId:v.string()}),vY=v.object({failed:v.number(),jobId:v.string(),notRun:v.number(),passed:v.number()}),xY=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")})]),Sv=v.object({findingId:v.string().min(1)}),RY=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()})]),wv=new mv("ripplo/exploreReplay"),vv=new mv("ripplo/enqueue"),xv=new gv("ripplo/status"),Rv=new gv("ripplo/shutdownIfIdle"),kv=new hv("ripplo/jobEvent"),Ev=new hv("ripplo/jobDone");import{err as xf,ok as Cv}from"neverthrow";function Av({all:e,ids:t,lockfile:r}){let n=r.tests.map(a=>a.name);if(e&&t.length>0)return xf({kind:"conflicting-flags"});if(e)return Cv(r.tests.filter(a=>!a.stub).map(a=>a.name));if(t.length===0)return xf({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?xf({kind:"unknown-ids",known:n,unknown:s}):Cv(o.flatMap(a=>a.name==null?[]:[a.name]))}import{err as Rf,ok as Pv}from"neverthrow";import{graphql as Tv}from"gql.tada";import{execFileSync as IF}from"child_process";function ia(e,t){return IF("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}async function Mv({config:e,cwd:t,lockfile:r}){await TF({config:e,cwd:t,lockfile:r});let n=await OF(e);if(n.isErr())return Rf(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?Rf({kind:"scope-empty"}):Pv(o)}var PF=Tv(`
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 PF({config:e,cwd:t,lockfile:r}){let n=new Set(OF(t)),i=r.tests.filter(o=>o.sourcePath!=null&&n.has(o.sourcePath)).map(o=>rt(o.name));i.length!==0&&await _e({config:e,document:IF,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:i}}).catch(o=>{Se.warn({err:o},"auto-scope of dirty tests failed")})}var TF=Pv(`
163
+ `);async function TF({config:e,cwd:t,lockfile:r}){let n=new Set(NF(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:PF,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:i}}).catch(o=>{Se.warn({err:o},"auto-scope of dirty tests failed")})}var MF=Tv(`
164
164
  query ScopeSelection($projectId: String!, $cwd: String!) {
165
165
  project(id: $projectId) {
166
166
  id
@@ -176,8 +176,8 @@ ${KN(i)}`),o}function v1(e){return td(e,xe)}async function x1(e){let t=[];functi
176
176
  }
177
177
  }
178
178
  }
179
- `);async function MF(e){try{let r=(await _e({config:e,document:TF,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession?.scopeItems??[];return Iv(r.flatMap(n=>n.workflow==null?[]:[n.workflow.slug]))}catch(t){return vf({detail:t instanceof Error?t.message:String(t),kind:"scope-fetch-failed"})}}var Av=".ripplo/tests/";function OF(e){try{return na(["status","--porcelain","--",".ripplo/tests"],e).split(`
180
- `).map(t=>t.slice(3).trim()).filter(t=>t.startsWith(Av)&&t.endsWith(".ts")).map(t=>t.slice(Av.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}catch{return[]}}var DF=12e4,_F=-32099;function FF(e){let t=new AbortController;return e.isCancellationRequested?(t.abort(),t.signal):(e.onCancellationRequested(()=>{t.abort()}),t.signal)}function qY(e){let t={...e,expectations:new Map,jobs:new Map};return{claim:r=>GF(t,r),handleConnection:r=>{jF(t,r)},idle:()=>Lv(t)}}function jF(e,t){let r=gv(t);r.onRequest(wv,(n,i)=>VF({connection:r,ctx:e,params:n,token:i})),r.onRequest(vv,()=>{let n=mf();return{active:n.active,queued:n.queued,version:wa(),...e.explorationStatus()}}),r.onRequest(Sv,async(n,i)=>{let o=bv.safeParse(n);return o.success?(await e.ready,e.replayFinding(o.data.findingId,FF(i))):{kind:"error",reason:"bad-message"}}),r.onRequest(xv,()=>{let n=Lv(e);return n&&e.onShutdownRequest(),n}),r.onClose(()=>{BF(e,r)}),r.onError(n=>{Se.warn({err:n},"ipc connection error")}),t.on("error",n=>{Se.warn({err:n},"ipc socket error")}),r.listen()}function Lv(e){let t=mf();return e.jobs.size===0&&t.active===0&&t.queued===0}async function VF({connection:e,ctx:t,params:r,token:n}){let i=yv.safeParse(r);if(!i.success)throw Mv({code:"bad-message"});await t.ready;let o=await qF({config:t.config,cwd:t.cwd,message:i.data});if(o.kind==="error")throw Mv(o.error);let s=NF(),a=new LF;return n.onCancellationRequested(()=>{$v(t,s)}),t.jobs.set(s,{cancellation:a,connection:e,failed:0,notRun:0,passed:0,total:o.testNames.length}),i5({ctx:t,headed:i.data.headed,jobId:s,testNames:o.testNames,token:a.token,workflowIdsBySlug:o.workflowIdsBySlug}).catch(l=>{Se.error({err:l},"ipc dispatch failed")}),{jobId:s,total:o.testNames.length}}function Mv(e){return new $F(_F,e.code,e)}function $v(e,t){let r=e.jobs.get(t);r!=null&&(r.cancellation.cancel(),e.jobs.delete(t),e.expectations.forEach((n,i)=>{n.filter(o=>o.jobId===t).forEach(o=>{clearTimeout(o.timer)}),e.expectations.set(i,n.filter(o=>o.jobId!==t))}))}function BF(e,t){[...e.jobs.entries()].filter(([,r])=>r.connection===t).forEach(([r])=>{$v(e,r)})}function ki(e,t,r){let n=e.jobs.get(t);n!=null&&(Ov(()=>n.connection.sendNotification(Rv,{event:r,jobId:t})),r.kind==="test-outcome"&&(UF(n,r.outcome.kind),n.passed+n.failed+n.notRun>=n.total&&(Ov(()=>n.connection.sendNotification(kv,{failed:n.failed,jobId:t,notRun:n.notRun,passed:n.passed})),e.jobs.delete(t))))}function Ov(e){e().catch(t=>{Se.warn({err:t},"ipc notification failed")})}function UF(e,t){if(t==="pass"){e.passed+=1;return}if(t==="dispatch-error"||t==="infra-error"){e.notRun+=1;return}e.failed+=1}function Dv(e,t){let n=e.expectations.get(t)?.shift();return n==null?null:(clearTimeout(n.timer),n)}function WF(e,t){let{headed:r,jobId:n,slug:i,testName:o}=t,s=setTimeout(()=>{zF({ctx:e,jobId:n,slug:i,testName:o,timer:s})},DF);e.expectations.set(i,[...e.expectations.get(i)??[],{headed:r,jobId:n,testName:o,timer:s}])}function zF({ctx:e,jobId:t,slug:r,testName:n,timer:i}){let o=e.expectations.get(r)??[],s=o.findIndex(a=>a.timer===i);s!==-1&&(e.expectations.set(r,o.toSpliced(s,1)),ki(e,t,{kind:"test-outcome",outcome:{detail:"dispatch-timeout",kind:"dispatch-error"},runId:"",testName:n}))}function GF(e,t){let r=Dv(e,t);if(r==null)return null;let n=e.jobs.get(r.jobId);return n==null?null:{headed:r.headed,token:n.cancellation.token,finished:(i,o)=>{ki(e,r.jobId,{kind:"test-outcome",outcome:o,runId:i,testName:r.testName})},started:i=>{ki(e,r.jobId,{kind:"test-started",runId:i,testName:r.testName})}}}function HF(e){return e.kind==="typecheck-failed"?e.diagnostics.slice(0,5):e.kind==="invalid-lockfile"?e.issues.slice(0,5):e.kind==="load-threw"?[e.message]:[]}async function qF({config:e,cwd:t,message:r}){return(await mp(t)).match(i=>KF({config:e,cwd:t,lockfile:i,message:r}),i=>Promise.resolve({error:{code:"compile-failed",detail:i.kind,diagnostics:[...HF(i)]},kind:"error"}))}async function KF({config:e,cwd:t,lockfile:r,message:n}){let i=await JF(e.appUrl);if(i!=null)return{error:{code:"app-unreachable",detail:i,url:e.appUrl},kind:"error"};let o=await ZF({config:e,cwd:t,lockfile:r});return o!=null?{error:{code:"sync-failed",detail:o},kind:"error"}:(await XF({config:e,cwd:t,lockfile:r,message:n})).match(async a=>({kind:"ready",testNames:a,workflowIdsBySlug:await r5(e,t)}),a=>Promise.resolve({error:a,kind:"error"}))}var YF=2e3;async function JF(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(YF)}),null}catch(t){return t instanceof Error?t.message:String(t)}}async function ZF(e){try{return await bf(e),null}catch(t){return t instanceof Error?t.message:String(t)}}async function XF({config:e,cwd:t,lockfile:r,message:n}){return!n.all&&n.tests.length===0?(await Tv({config:e,cwd:t,lockfile:r})).mapErr(QF):Cv({all:n.all,ids:n.tests,lockfile:r}).mapErr(e5)}function QF(e){return e.kind==="scope-empty"?{code:"selection-nothing-selected"}:{code:"scope-failed",detail:e.detail}}function e5(e){switch(e.kind){case"conflicting-flags":return{code:"selection-conflicting-flags"};case"nothing-selected":return{code:"selection-nothing-selected"};case"unknown-ids":return{code:"selection-unknown-ids",known:[...e.known],unknown:[...e.unknown]}}}var t5=Nv(`
179
+ `);async function OF(e){try{let r=(await _e({config:e,document:MF,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession?.scopeItems??[];return Pv(r.flatMap(n=>n.workflow==null?[]:[n.workflow.slug]))}catch(t){return Rf({detail:t instanceof Error?t.message:String(t),kind:"scope-fetch-failed"})}}var Iv=".ripplo/tests/";function NF(e){try{return ia(["status","--porcelain","--",".ripplo/tests"],e).split(`
180
+ `).map(t=>t.slice(3).trim()).filter(t=>t.startsWith(Iv)&&t.endsWith(".ts")).map(t=>t.slice(Iv.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}catch{return[]}}var _F=12e4,FF=-32099;function jF(e){let t=new AbortController;return e.isCancellationRequested?(t.abort(),t.signal):(e.onCancellationRequested(()=>{t.abort()}),t.signal)}function KY(e){let t={...e,expectations:new Map,jobs:new Map};return{claim:r=>HF(t,r),handleConnection:r=>{VF(t,r)},idle:()=>$v(t)}}function VF(e,t){let r=yv(t);r.onRequest(vv,(n,i)=>BF({connection:r,ctx:e,params:n,token:i})),r.onRequest(xv,()=>{let n=yf();return{active:n.active,queued:n.queued,version:va(),...e.explorationStatus()}}),r.onRequest(wv,async(n,i)=>{let o=Sv.safeParse(n);return o.success?(await e.ready,e.replayFinding(o.data.findingId,jF(i))):{kind:"error",reason:"bad-message"}}),r.onRequest(Rv,()=>{let n=$v(e);return n&&e.onShutdownRequest(),n}),r.onClose(()=>{UF(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 $v(e){let t=yf();return e.jobs.size===0&&t.active===0&&t.queued===0}async function BF({connection:e,ctx:t,params:r,token:n}){let i=bv.safeParse(r);if(!i.success)throw Ov({code:"bad-message"});await t.ready;let o=await KF({config:t.config,cwd:t.cwd,message:i.data});if(o.kind==="error")throw Ov(o.error);let s=LF(),a=new $F;return n.onCancellationRequested(()=>{Dv(t,s)}),t.jobs.set(s,{cancellation:a,connection:e,failed:0,notRun:0,passed:0,total:o.testNames.length}),o5({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 Ov(e){return new DF(FF,e.code,e)}function Dv(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 UF(e,t){[...e.jobs.entries()].filter(([,r])=>r.connection===t).forEach(([r])=>{Dv(e,r)})}function ki(e,t,r){let n=e.jobs.get(t);n!=null&&(Nv(()=>n.connection.sendNotification(kv,{event:r,jobId:t})),r.kind==="test-outcome"&&(WF(n,r.outcome.kind),n.passed+n.failed+n.notRun>=n.total&&(Nv(()=>n.connection.sendNotification(Ev,{failed:n.failed,jobId:t,notRun:n.notRun,passed:n.passed})),e.jobs.delete(t))))}function Nv(e){e().catch(t=>{Se.warn({err:t},"ipc notification failed")})}function WF(e,t){if(t==="pass"){e.passed+=1;return}if(t==="dispatch-error"||t==="infra-error"){e.notRun+=1;return}e.failed+=1}function _v(e,t){let n=e.expectations.get(t)?.shift();return n==null?null:(clearTimeout(n.timer),n)}function zF(e,t){let{headed:r,jobId:n,slug:i,testName:o}=t,s=setTimeout(()=>{GF({ctx:e,jobId:n,slug:i,testName:o,timer:s})},_F);e.expectations.set(i,[...e.expectations.get(i)??[],{headed:r,jobId:n,testName:o,timer:s}])}function GF({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 HF(e,t){let r=_v(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 qF(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 KF({config:e,cwd:t,message:r}){return(await yp(t)).match(i=>YF({config:e,cwd:t,lockfile:i,message:r}),i=>Promise.resolve({error:{code:"compile-failed",detail:i.kind,diagnostics:[...qF(i)]},kind:"error"}))}async function YF({config:e,cwd:t,lockfile:r,message:n}){let i=await ZF(e.appUrl);if(i!=null)return{error:{code:"app-unreachable",detail:i,url:e.appUrl},kind:"error"};let o=await XF({config:e,cwd:t,lockfile:r});return o!=null?{error:{code:"sync-failed",detail:o},kind:"error"}:(await QF({config:e,cwd:t,lockfile:r,message:n})).match(async a=>({kind:"ready",testNames:a,workflowIdsBySlug:await n5(e,t)}),a=>Promise.resolve({error:a,kind:"error"}))}var JF=2e3;async function ZF(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(JF)}),null}catch(t){return t instanceof Error?t.message:String(t)}}async function XF(e){try{return await wf(e),null}catch(t){return t instanceof Error?t.message:String(t)}}async function QF({config:e,cwd:t,lockfile:r,message:n}){return!n.all&&n.tests.length===0?(await Mv({config:e,cwd:t,lockfile:r})).mapErr(e5):Av({all:n.all,ids:n.tests,lockfile:r}).mapErr(t5)}function e5(e){return e.kind==="scope-empty"?{code:"selection-nothing-selected"}:{code:"scope-failed",detail:e.detail}}function t5(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 r5=Lv(`
181
181
  query DaemonWorkflows($projectId: String!, $cwd: String!) {
182
182
  project(id: $projectId) {
183
183
  id
@@ -190,7 +190,7 @@ ${KN(i)}`),o}function v1(e){return td(e,xe)}async function x1(e){let t=[];functi
190
190
  }
191
191
  }
192
192
  }
193
- `);async function r5(e,t){let n=(await _e({config:e,document:t5,variables:{cwd:t,projectId:e.projectId}})).project?.devSession?.workflows??[];return new Map(n.map(i=>[i.slug,i.id]))}var n5=Nv(`
193
+ `);async function n5(e,t){let n=(await _e({config:e,document:r5,variables:{cwd:t,projectId:e.projectId}})).project?.devSession?.workflows??[];return new Map(n.map(i=>[i.slug,i.id]))}var i5=Lv(`
194
194
  mutation DaemonCreateRun($workflowId: String!, $clientVersion: String) {
195
195
  createRun(workflowId: $workflowId, executor: local, clientVersion: $clientVersion) {
196
196
  __typename
@@ -199,34 +199,34 @@ ${KN(i)}`),o}function v1(e){return td(e,xe)}async function x1(e){let t=[];functi
199
199
  }
200
200
  }
201
201
  }
202
- `);async function i5(e){await e.testNames.reduce((t,r)=>t.then(()=>o5(e,r)),Promise.resolve())}async function o5(e,t){let{ctx:r,headed:n,jobId:i,token:o,workflowIdsBySlug:s}=e;if(o.isCancellationRequested)return;let a=rt(t),l=s.get(a);if(l==null){ki(r,i,{kind:"test-outcome",outcome:{detail:"workflow-not-found",kind:"dispatch-error"},runId:"",testName:t});return}WF(r,{headed:n,jobId:i,slug:a,testName:t});let u=await s5(r.config,l);u!=null&&(Dv(r,a),ki(r,i,{kind:"test-outcome",outcome:u,runId:"",testName:t}))}async function s5(e,t){try{let n=(await _e({config:e,document:n5,variables:{clientVersion:wa(),workflowId:t}})).createRun;return n==null?{detail:"create-run-null",kind:"dispatch-error"}:n.__typename==="Run"?null:{detail:n.__typename,kind:"dispatch-error"}}catch(r){return r instanceof Er?{detail:r.message,kind:"infra-error"}:{detail:r instanceof Error?r.message:String(r),kind:"dispatch-error"}}}function a5(e){let{backoffActive:t,explorerHolder:r,headedActive:n,interactiveActive:i,interactiveQueued:o}=e,{explorationActive:s,exploreConcurrency:a,poolSize:l}=e;if(!r||n||o>0)return{abortCount:s,refillCount:0};if(t)return{abortCount:0,refillCount:0};let u=Math.min(a,l-1,l-i);return{abortCount:0,refillCount:Math.max(0,u-s)}}function YY(e){let t={active:new Map,backoffUntil:0,cancelBackoffTimer:null,cancelHeartbeat:null,holder:!1,prevInteractiveActive:e.probe().interactiveActive,stopped:!1};return jv(t,e),{explorationActive:()=>t.active.size,explorerHolder:()=>t.holder,notifyQueueChange:()=>{l5(t,e)},setExplorerHolder:r=>{t.holder=r,Ei(t,e)},stop:()=>{t.stopped=!0,t.cancelBackoffTimer?.(),t.cancelBackoffTimer=null,t.cancelHeartbeat?.(),t.cancelHeartbeat=null,Vv(t,t.active.size)}}}function jv(e,t){e.stopped||(e.cancelHeartbeat=t.setTimer(()=>{Ei(e,t),jv(e,t)},15e3))}function Ei(e,t){if(e.stopped)return;let r=t.probe(),n=a5({backoffActive:t.now()<e.backoffUntil,explorationActive:e.active.size,exploreConcurrency:t.exploreConcurrency,explorerHolder:e.holder&&t.exploreEnabled,headedActive:r.headedActive>0,interactiveActive:r.interactiveActive,interactiveQueued:r.interactiveQueued,poolSize:r.poolSize});Vv(e,n.abortCount),Bv({count:n.refillCount,params:t,state:e})}function Vv(e,t){[...e.active.values()].slice(0,t).forEach(({controller:r})=>{r.abort()})}function l5(e,t){let r=t.probe();r.interactiveActive<e.prevInteractiveActive&&u5(e,t),e.prevInteractiveActive=r.interactiveActive,Ei(e,t)}function u5(e,t){e.backoffUntil=t.now()+3e4,e.cancelBackoffTimer?.(),e.cancelBackoffTimer=t.setTimer(()=>{e.cancelBackoffTimer=null,Ei(e,t)},3e4)}function Bv({count:e,params:t,state:r}){if(e<=0)return;let n=c5(t.sources);n!=null&&(d5({params:t,pulled:n,state:r}),Bv({count:e-1,params:t,state:r}))}function c5(e){return e.reduce((t,r)=>{if(t!=null)return t;let n=r.next();return n==null?null:{job:n,source:r}},null)}function d5({params:e,pulled:t,state:r}){let{job:n,source:i}=t,o=new AbortController;r.active.set(n.id,{controller:o,job:n,source:i}),e.execute({job:n,priority:i.priority,signal:o.signal}).then(()=>{Fv({job:n,outcome:_v(o.signal,null),params:e,source:i,state:r})}).catch(s=>{Fv({job:n,outcome:_v(o.signal,{error:s}),params:e,source:i,state:r})})}function _v(e,t){return e.aborted?{kind:"aborted"}:t==null?{kind:"completed"}:{error:t.error,kind:"error"}}function Fv({job:e,outcome:t,params:r,source:n,state:i}){i.active.delete(e.id),n.onResult(e,t),Ei(i,r)}import f5 from"fs";import p5 from"path";async function nJ(e){let t=p5.join(e,".ripplo","index.ts");if(!f5.existsSync(t))return{appUrl:void 0,engineUrl:void 0,errors:[{message:".ripplo/index.ts not found",path:""}],valid:!1,warnings:[]};let r=await bn(e);return r.isErr()?{appUrl:void 0,engineUrl:void 0,errors:[{message:Xi(r.error),path:".ripplo/"}],valid:!1,warnings:[]}:ji().match(n=>({appUrl:n.appUrl,engineUrl:n.engineUrl,errors:[],valid:!0,warnings:[]}),n=>({appUrl:void 0,engineUrl:void 0,errors:[{message:Va(n),path:""}],valid:!1,warnings:[]}))}async function iJ(e){try{await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(5e3)});return}catch{return`appUrl (${e}) is not responding. Make sure your dev server is running on that port.`}}async function oJ({appUrl:e,engineUrl:t}){let r=t.startsWith("http://")||t.startsWith("https://")?t:`${e}${t}`;try{return(await fetch(`${r}/setup`,{body:JSON.stringify({}),headers:{"Content-Type":"application/json"},method:"PUT",signal:AbortSignal.timeout(5e3)})).ok?"Engine endpoint accepted an unsigned request \u2014 webhook signature verification may be missing.":void 0}catch{return}}import y5 from"fs";import h5 from"fs";import xf from"path";var m5=["MERGE_HEAD","rebase-merge","rebase-apply","CHERRY_PICK_HEAD","REVERT_HEAD"];function Uv(e){let t=g5(e);return t==null?!1:m5.some(r=>h5.existsSync(xf.join(t,r)))}function g5(e){try{let t=na(["rev-parse","--git-dir"],e).trim();return t.length===0?null:xf.isAbsolute(t)?t:xf.resolve(e,t)}catch{return null}}function b5(e){return Ut(e,"hooks-paused")}function mJ(e){return y5.existsSync(b5(e))||Uv(e)?!1:Ap(e)}import S5 from"fs";import{lockSync as w5}from"proper-lockfile";var v5="explorer.lock",x5=15e3,R5=15e3;function k5(){return lr(v5)}function wJ({onChange:e}){let t={release:null,stopped:!1},r=()=>{t.release=null,t.stopped||e(!1)},n=()=>{if(t.stopped||t.release!=null)return;let o=E5(r);o!=null&&(t.release=o,e(!0))};n();let i=setInterval(n,R5);return{holder:()=>t.release!=null,stop:()=>{t.stopped=!0,clearInterval(i),t.release?.(),t.release=null}}}function E5(e){try{fn();let t=k5(),r=w5(t,{onCompromised:e,realpath:!1,stale:x5});return S5.writeFileSync(t,String(process.pid)),()=>{try{r()}catch{}}}catch{return null}}import C5 from"path";import{randomUUID as A5}from"crypto";function Wv(e){return{axes:[ef("unit"),tf(e)]}}var zv=12,Gv=15,Hv=4,qv=2,Kv=18e4;var Zv={covered:0,deferred:0,findings:0,saturated:!1,total:0};function PJ(){return{priority:"p3",next:()=>null,onResult:()=>{},ready:()=>Promise.resolve(),status:()=>Zv,stop:()=>Promise.resolve()}}function TJ(e){let t={claimed:new Set,consecutiveErrors:0,covered:new Set,deferred:new Map,findings:0,haltedUntil:0,prepared:null,preparing:!1,refreshing:!1,saturated:!1,tick:0},r=Rf(e,t);return{priority:"p3",next:()=>O5(e,t),onResult:()=>{},ready:()=>r,status:()=>t.prepared==null?Zv:T5(t.prepared,t),stop:()=>Promise.resolve()}}async function Rf(e,t){if(!t.preparing){t.preparing=!0;try{let r=await e.loadLockfile();if(r==null)return;let n=await I5(r);if(n==null)return;await xi(Qv(e.cwd)).match(i=>{let o=vi(i);t.covered=new Set(o.covered),t.findings=[...o.findings.values()].filter(s=>s.resolvedAt==null).length,t.prepared=n,t.consecutiveErrors=0,t.haltedUntil=0,t.deferred.clear(),e.notifyWork()},i=>{Se.warn("explore ledger unreadable, exploration disabled: %s",i.kind)})}finally{t.preparing=!1}}}async function I5({fingerprint:e,lockfile:t}){let r=Wv(t),n=Nr(t);if(n.length===0)return null;let i=ff(t,{sweep:!1}),o=await P5(t,i),s=af({corpus:n,depots:o,lens:r,maxCount:qv,maxDepth:Hv});return{actionHashes:n.map(a=>nf(t,a)),corpus:n,depots:i,fingerprint:e,graph:s,lens:r,lensIdValue:Qd(r),lockfile:t,lockfileHashValue:of(t)}}async function P5(e,t){let r={generate:$r,materialize:fl($r,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await pf(e,i,r)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}var Yv=20,Xv=6e5,Jv=3e5;function T5(e,t){let r=uf(e.graph),n=lf({actionHashes:e.actionHashes,corpus:e.corpus,covered:t.covered,graph:e.graph,lensId:e.lensIdValue,tick:t.tick});return{covered:r-n,deferred:rx(t).size,findings:t.findings,saturated:t.saturated,total:r}}async function M5(e,t){if(!(t.refreshing||t.preparing||t.prepared==null)){t.refreshing=!0;try{let r=await e.loadLockfile();if(r==null||r.fingerprint===t.prepared.fingerprint)return;Se.info("exploration model changed, re-preparing target graph"),t.prepared=null,await Rf(e,t)}finally{t.refreshing=!1}}}function O5(e,t){M5(e,t);let r=t.prepared;if(r==null||Date.now()<t.haltedUntil)return null;let n=cf({actionHashes:r.actionHashes,corpus:r.corpus,covered:new Set([...t.covered,...t.claimed,...rx(t)]),graph:r.graph,lensId:r.lensIdValue,tick:t.tick});if(t.tick+=1,n.kind==="saturated")return t.saturated=!0,null;t.saturated=!1;let i=V5(r,n.target);return t.claimed.add(i),{id:`explore:${A5()}`,label:n.target.targetKey,run:o=>N5({choice:n.target,key:i,params:e,prepared:r,signal:o,state:t})}}async function N5({choice:e,key:t,params:r,prepared:n,signal:i,state:o}){try{let s=$5({choice:e,params:r,prepared:n});if(s==null)return;if(!await r.probeApp()){tx(o,"app-unreachable");return}let a=AbortSignal.timeout(Kv),l=await r.executeTrail(s,AbortSignal.any([i,a]));if(l.kind==="aborted"){_5({deadline:a,key:t,signal:i,state:o});return}if(l.kind==="error"){F5({key:t,params:r,reason:l.reason,state:o});return}o.consecutiveErrors=0,Se.info("exploration trail %s: %s @ %s",l.kind,l.trail.map(u=>u.label).join(" -> "),e.targetKey.slice(0,80)),r.onTrailDone?.({kind:l.kind,label:e.targetKey,trail:l.trail}),await D5({outcome:L5(l,e,n),params:r,state:o})}finally{o.claimed.delete(t)}}function L5(e,t,r){let n={actionHash:t.actionHash,at:new Date().toISOString(),kind:"covered",lensId:r.lensIdValue,targetKey:t.targetKey};return{...e,rows:[...e.rows,n]}}function $5({choice:e,params:t,prepared:r}){let n=r.depots.find(i=>i.name===e.witness.depot);return n==null?null:{depotTest:n.test,firings:e.witness.trail.map(i=>({idx:i.idx,params:i.params})),lensId:r.lensIdValue,lockfileFingerprint:r.fingerprint,lockfileHash:r.lockfileHashValue,maxLength:t.maxTrailLength??zv,shrinkBudget:Gv}}async function D5({outcome:e,params:t,state:r}){let n=e.rows.filter(i=>i.kind!=="covered"||!r.covered.has(ze(i)));n.forEach(i=>{(i.kind==="covered"||i.kind==="finding"||i.kind==="flaky-candidate")&&r.covered.add(ze(i))}),e.kind==="finding"&&(r.findings+=1,Se.info("exploration finding recorded")),n.length!==0&&await rf(Qv(t.cwd),n).match(()=>{},i=>{Se.warn("explore ledger append failed: %s",i.kind)})}function Qv(e){return C5.join(e,".ripplo",".local","explore-ledger.jsonl")}function _5({deadline:e,key:t,signal:r,state:n}){e.aborted&&!r.aborted&&(ex(n,t),Se.warn("exploration trail timed out, target deferred for %ds",Xv/1e3))}function F5({key:e,params:t,reason:r,state:n}){if(r==="lockfile:fingerprint-mismatch"){j5(t,n);return}ex(n,e),tx(n,r)}function j5(e,t){t.preparing||(t.prepared=null,Rf(e,t))}function ex(e,t){e.deferred.set(t,Date.now()+Xv)}function tx(e,t){e.consecutiveErrors+=1,Se.debug("exploration trail error: %s",t),e.consecutiveErrors>=Yv&&(e.haltedUntil=Date.now()+Jv,e.consecutiveErrors=0,Se.warn("exploration cooling down for %ds after %d consecutive trail errors (last: %s)",Jv/1e3,Yv,t))}function rx(e){let t=Date.now();return[...e.deferred].filter(([,r])=>r<=t).forEach(([r])=>e.deferred.delete(r)),new Set(e.deferred.keys())}function V5(e,t){return ze({actionHash:t.actionHash,lensId:e.lensIdValue,targetKey:t.targetKey})}import B5 from"path";var U5=3;function LJ(e){return xi(W5(e)).map(t=>z5(vi(t)))}function W5(e){return B5.join(e,".ripplo",".local","explore-ledger.jsonl")}function z5(e){let t=[...e.findings.entries()].filter(([,n])=>n.resolvedAt==null).map(([n,i])=>G5(n,i)).toSorted(q5),r=[...e.flaky.entries()].filter(([,n])=>n.occurrences>=U5).map(([n,i])=>H5(n,i)).toSorted((n,i)=>i.occurrences-n.occurrences);return{pending:t,recurrentFlaky:r}}function G5(e,t){let r=t.latest;return{depot:r.depot,evidence:r.evidence,firstSeen:t.first.at,id:Xs(e),lastSeen:r.at,occurrences:t.occurrences,oracleLayer:r.oracleLayer,parts:r.parts,runId:r.runId,trail:r.trail}}function H5(e,t){return{at:t.first.at,depot:t.first.depot,id:Xs(e),occurrences:t.occurrences,trail:t.first.trail}}var nx={crash:0,frame:3,invariant:1,law:2};function q5(e,t){let r=nx[e.oracleLayer]-nx[t.oracleLayer];return r===0?t.occurrences-e.occurrences:r}import{gzip as K5}from"zlib";import{promisify as Y5}from"util";import{existsSync as J5,readFileSync as Z5}from"fs";import ox from"path";import{graphql as Ci}from"gql.tada";function ix(e){return[e.kind,e.target,e.value].filter(t=>t.length>0).join(" ")}async function HJ({config:e,cwd:t,headed:r,lockfile:n,runId:i,session:o,signal:s,test:a}){if(!await hj(e,i))return{kind:"dispatch-failed",reason:"already-claimed",runId:i};let u=ox.join(t,".ripplo","debug"),c=[];return(await o.runOnce({capture:!0,lockfile:n,options:{baseUrl:e.appUrl,engineUrl:e.engineUrl,generate:$r,headed:r,secret:e.webhookSecret},params:void 0,runId:i,sequence:void 0,testName:a.name,onEvent:p=>{c.push(p)}},s)).match(async p=>{await X5({config:e,debugDir:u,events:c,runId:i,test:a,total:p.fired.length});let h=sx(c).flatMap(f=>f.findings);return h.length>0?{findings:h,kind:"findings",runId:i}:{kind:"pass",runId:i}},async p=>(await dj(e,i,Ct(p)),{error:p,kind:"error",runId:i}))}async function X5({config:e,debugDir:t,events:r,runId:n,test:i}){let o=sx(r),s=Q5(t,n);if(s==null)throw new Error("recording-missing");await Promise.all([aj({aliases:[...rj(r),...nj(o,i)],config:e,generated:ij(r),generatedSingletons:oj(r),origin:s.origin,records:o,runId:n,test:i}),fj(e,n,s)]),await pj(e,n,o)}function sx(e){return e.flatMap(t=>t.kind==="step"?[{endMs:t.endMs,findings:t.findings,index:t.index,startMs:t.startMs,state:t.state,url:t.url}]:[])}function Q5(e,t){let r=ox.join(e,t,"behavior.jsonl");if(!J5(r))return null;let n=Z5(r,"utf8").split(`
203
- `).filter(o=>o.length>0).map(o=>ej(o)).flatMap(o=>tj(o)?[o.event]:[]),i=n[0];return i==null?null:{events:n,origin:i.timestamp}}function ej(e){return JSON.parse(e)}function tj(e){return typeof e=="object"&&e!=null&&Reflect.get(e,"kind")==="rrweb"}function rj(e){return e.flatMap(t=>t.kind==="world"?t.aliases:[])}function nj(e,t){return e.flatMap(r=>{let n=sj(t.steps[r.index]);return n.flatMap(i=>{let s=n.filter(l=>l.entity===i.entity).indexOf(i),a=r.state.rows.filter(l=>l.status==="created"&&l.entity===i.entity).at(s);return a==null?[]:[{alias:i.as,entity:i.entity,key:a.key}]})})}function ij(e){return new Set(e.flatMap(t=>t.kind==="world"?t.generated.map(r=>ax(r)):[]))}function ax({entity:e,field:t,key:r}){return`${e}\0${r}\0${t}`}function oj(e){return new Set(e.flatMap(t=>t.kind==="world"?t.generatedSingletons:[]))}function sj(e){return e==null?[]:e.expect.flatMap(t=>ia(t))}function ia(e){return e.kind==="state"&&e.assertion.kind==="created"?[{as:e.assertion.as,entity:e.entity}]:e.kind==="and"?e.predicates.flatMap(t=>ia(t)):e.kind==="when"?[...ia(e.consequence),...e.otherwise==null?[]:ia(e.otherwise)]:[]}async function aj({aliases:e,config:t,generated:r,generatedSingletons:n,origin:i,records:o,runId:s,test:a}){let l=o.map(u=>lj({aliases:e,generated:r,generatedSingletons:n,origin:i,record:u,test:a}));await _e({config:t,document:gj,variables:{items:[{runId:s,steps:l}]}})}function lj({aliases:e,generated:t,generatedSingletons:r,origin:n,record:i,test:o}){let s=o.steps[i.index];if(s==null)throw new Error("step-descriptor-missing");let a=Oa(s,i.index);return{assertions:i.findings.map(l=>({description:_n(l),detail:null,status:"failed"})),detail:null,duration:Math.max(0,i.endMs-i.startMs),nodeType:a.kind,recordingEndMs:Math.max(0,i.endMs-n),recordingStartMs:Math.max(0,i.startMs-n),rrwebIds:[],snapshotTimestamp:Math.max(0,i.endMs-n),stateRows:i.state.rows.map(l=>uj({aliases:e,generated:t,row:l})),stateSingletons:i.state.singletons.map(l=>({changed:l.changed,generated:r.has(l.name),name:l.name,value:l.value==null?null:String(l.value)})),status:i.findings.length>0?"failed":"passed",stepIndex:i.index,title:ix(a),url:i.url}}function uj({aliases:e,generated:t,row:r}){let n=e.find(i=>i.entity===r.entity&&i.key===r.key);return{entity:r.entity,fields:r.fields.map(i=>({changed:i.changed,field:i.field,generated:t.has(ax({entity:r.entity,field:i.field,key:r.key})),value:i.value==null?null:String(i.value)})),key:r.key,label:n?.alias??r.key,status:r.status}}var cj=Y5(K5);async function dj(e,t,r){await _e({config:e,document:Sj,variables:{reason:r,runId:t}}).catch(n=>{Se.error(n,"failRun submission failed")})}async function fj(e,t,r){let n=r.events.map(s=>JSON.stringify(s)).join(`
204
- `),i=await cj(Buffer.from(n,"utf8")),o=r.events.at(-1);await _e({config:e,document:yj,variables:{input:{bodyBase64:i.toString("base64"),chunkIndex:0,endTimestamp:Math.max(0,(o?.timestamp??r.origin)-r.origin),eventCount:r.events.length,runId:t,startTimestamp:0}}})}async function pj(e,t,r){let n=r.filter(s=>s.findings.length>0).length,i=r.length-n,o=r.reduce((s,a)=>s+Math.max(0,a.endMs-a.startMs),0);await _e({config:e,document:bj,variables:{items:[{duration:o,failCount:n,passCount:i,runId:t,status:n>0?"failed":"passed",summary:null,warnCount:0}]}})}async function hj(e,t){return((await _e({config:e,document:mj,variables:{runIds:[t]}})).startRunsBatch??[]).some(n=>n.id===t)}var mj=Ci(`
202
+ `);async function o5(e){await e.testNames.reduce((t,r)=>t.then(()=>s5(e,r)),Promise.resolve())}async function s5(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}zF(r,{headed:n,jobId:i,slug:a,testName:t});let u=await a5(r.config,l);u!=null&&(_v(r,a),ki(r,i,{kind:"test-outcome",outcome:u,runId:"",testName:t}))}async function a5(e,t){try{let n=(await _e({config:e,document:i5,variables:{clientVersion:va(),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 l5(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 JY(e){let t={active:new Map,backoffUntil:0,cancelBackoffTimer:null,cancelHeartbeat:null,holder:!1,prevInteractiveActive:e.probe().interactiveActive,stopped:!1};return Vv(t,e),{explorationActive:()=>t.active.size,explorerHolder:()=>t.holder,notifyQueueChange:()=>{u5(t,e)},setExplorerHolder:r=>{t.holder=r,Ei(t,e)},stop:()=>{t.stopped=!0,t.cancelBackoffTimer?.(),t.cancelBackoffTimer=null,t.cancelHeartbeat?.(),t.cancelHeartbeat=null,Bv(t,t.active.size)}}}function Vv(e,t){e.stopped||(e.cancelHeartbeat=t.setTimer(()=>{Ei(e,t),Vv(e,t)},15e3))}function Ei(e,t){if(e.stopped)return;let r=t.probe(),n=l5({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});Bv(e,n.abortCount),Uv({count:n.refillCount,params:t,state:e})}function Bv(e,t){[...e.active.values()].slice(0,t).forEach(({controller:r})=>{r.abort()})}function u5(e,t){let r=t.probe();r.interactiveActive<e.prevInteractiveActive&&c5(e,t),e.prevInteractiveActive=r.interactiveActive,Ei(e,t)}function c5(e,t){e.backoffUntil=t.now()+3e4,e.cancelBackoffTimer?.(),e.cancelBackoffTimer=t.setTimer(()=>{e.cancelBackoffTimer=null,Ei(e,t)},3e4)}function Uv({count:e,params:t,state:r}){if(e<=0)return;let n=d5(t.sources);n!=null&&(f5({params:t,pulled:n,state:r}),Uv({count:e-1,params:t,state:r}))}function d5(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 f5({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(()=>{jv({job:n,outcome:Fv(o.signal,null),params:e,source:i,state:r})}).catch(s=>{jv({job:n,outcome:Fv(o.signal,{error:s}),params:e,source:i,state:r})})}function Fv(e,t){return e.aborted?{kind:"aborted"}:t==null?{kind:"completed"}:{error:t.error,kind:"error"}}function jv({job:e,outcome:t,params:r,source:n,state:i}){i.active.delete(e.id),n.onResult(e,t),Ei(i,r)}import p5 from"fs";import h5 from"path";async function iJ(e){let t=h5.join(e,".ripplo","index.ts");if(!p5.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:Ba(n),path:""}],valid:!1,warnings:[]}))}async function oJ(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 sJ({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 b5 from"fs";import m5 from"fs";import kf from"path";var g5=["MERGE_HEAD","rebase-merge","rebase-apply","CHERRY_PICK_HEAD","REVERT_HEAD"];function Wv(e){let t=y5(e);return t==null?!1:g5.some(r=>m5.existsSync(kf.join(t,r)))}function y5(e){try{let t=ia(["rev-parse","--git-dir"],e).trim();return t.length===0?null:kf.isAbsolute(t)?t:kf.resolve(e,t)}catch{return null}}function S5(e){return Ut(e,"hooks-paused")}function gJ(e){return b5.existsSync(S5(e))||Wv(e)?!1:Pp(e)}import w5 from"fs";import{lockSync as v5}from"proper-lockfile";var x5="explorer.lock",R5=15e3,k5=15e3;function E5(){return lr(x5)}function vJ({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=C5(r);o!=null&&(t.release=o,e(!0))};n();let i=setInterval(n,k5);return{holder:()=>t.release!=null,stop:()=>{t.stopped=!0,clearInterval(i),t.release?.(),t.release=null}}}function C5(e){try{fn();let t=E5(),r=v5(t,{onCompromised:e,realpath:!1,stale:R5});return w5.writeFileSync(t,String(process.pid)),()=>{try{r()}catch{}}}catch{return null}}import A5 from"path";import{randomUUID as I5}from"crypto";function zv(e){return{axes:[tf("unit"),rf(e)]}}var Gv=12,Hv=15,qv=4,Kv=2,kJ=12e4;var Zv={covered:0,deferred:0,findings:0,saturated:!1,total:0};function MJ(){return{priority:"p3",next:()=>null,onResult:()=>{},ready:()=>Promise.resolve(),status:()=>Zv,stop:()=>Promise.resolve()}}function OJ(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=Ef(e,t);return{priority:"p3",next:()=>N5(e,t),onResult:()=>{},ready:()=>r,status:()=>t.prepared==null?Zv:M5(t.prepared,t),stop:()=>Promise.resolve()}}async function Ef(e,t){if(!t.preparing){t.preparing=!0;try{let r=await e.loadLockfile();if(r==null)return;let n=await P5(r);if(n==null)return;await xi(Qv(e.cwd)).match(i=>{let o=vi(i);t.covered=new Set(o.covered),t.findings=[...o.findings.values()].filter(s=>s.resolvedAt==null).length,t.prepared=n,t.consecutiveErrors=0,t.haltedUntil=0,t.deferred.clear(),e.notifyWork()},i=>{Se.warn("explore ledger unreadable, exploration disabled: %s",i.kind)})}finally{t.preparing=!1}}}async function P5({fingerprint:e,lockfile:t}){let r=zv(t),n=Nr(t);if(n.length===0)return null;let i=pf(t,{sweep:!1}),o=await T5(t,i),s=lf({corpus:n,depots:o,lens:r,maxCount:Kv,maxDepth:qv});return{actionHashes:n.map(a=>of(t,a)),corpus:n,depots:i,fingerprint:e,graph:s,lens:r,lensIdValue:ef(r),lockfile:t,lockfileHashValue:sf(t)}}async function T5(e,t){let r={generate:$r,materialize:pl($r,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await hf(e,i,r)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}var Yv=20,Xv=6e5,Jv=3e5;function M5(e,t){let r=cf(e.graph),n=uf({actionHashes:e.actionHashes,corpus:e.corpus,covered:t.covered,graph:e.graph,lensId:e.lensIdValue,tick:t.tick});return{covered:r-n,deferred:tx(t).size,findings:t.findings,saturated:t.saturated,total:r}}async function O5(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 Ef(e,t)}finally{t.refreshing=!1}}}function N5(e,t){O5(e,t);let r=t.prepared;if(r==null||Date.now()<t.haltedUntil)return null;let n=df({actionHashes:r.actionHashes,corpus:r.corpus,covered:new Set([...t.covered,...t.claimed,...tx(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=B5(r,n.target);return t.claimed.add(i),{id:`explore:${I5()}`,label:n.target.targetKey,run:o=>L5({choice:n.target,key:i,params:e,prepared:r,signal:o,state:t})}}async function L5({choice:e,key:t,params:r,prepared:n,signal:i,state:o}){try{let s=D5({choice:e,params:r,prepared:n});if(s==null)return;if(!await r.probeApp()){ex(o,"app-unreachable");return}let a=await r.executeTrail(s,i);if(a.kind==="aborted")return;if(a.kind==="error"){F5({key:t,params:r,reason:a.reason,state:o});return}o.consecutiveErrors=0,Se.info("exploration trail %s: %s @ %s",a.kind,a.trail.map(l=>l.label).join(" -> "),e.targetKey.slice(0,80)),r.onTrailDone?.({kind:a.kind,label:e.targetKey,trail:a.trail}),await _5({outcome:$5(a,e,n),params:r,state:o})}finally{o.claimed.delete(t)}}function $5(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 D5({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??Gv,shrinkBudget:Hv}}async function _5({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 nf(Qv(t.cwd),n).match(()=>{},i=>{Se.warn("explore ledger append failed: %s",i.kind)})}function Qv(e){return A5.join(e,".ripplo",".local","explore-ledger.jsonl")}function F5({key:e,params:t,reason:r,state:n}){if(r==="lockfile:fingerprint-mismatch"){j5(t,n);return}if(V5(n,e),r==="trail-timeout"){Se.warn("exploration attempt timed out, target deferred for %ds",Xv/1e3);return}ex(n,r)}function j5(e,t){t.preparing||(t.prepared=null,Ef(e,t))}function V5(e,t){e.deferred.set(t,Date.now()+Xv)}function ex(e,t){e.consecutiveErrors+=1,Se.debug("exploration trail error: %s",t),e.consecutiveErrors>=Yv&&(e.haltedUntil=Date.now()+Jv,e.consecutiveErrors=0,Se.warn("exploration cooling down for %ds after %d consecutive trail errors (last: %s)",Jv/1e3,Yv,t))}function tx(e){let t=Date.now();return[...e.deferred].filter(([,r])=>r<=t).forEach(([r])=>e.deferred.delete(r)),new Set(e.deferred.keys())}function B5(e,t){return ze({actionHash:t.actionHash,lensId:e.lensIdValue,targetKey:t.targetKey})}import U5 from"path";var W5=3;function DJ(e){return xi(z5(e)).map(t=>G5(vi(t)))}function z5(e){return U5.join(e,".ripplo",".local","explore-ledger.jsonl")}function G5(e){let t=[...e.findings.entries()].filter(([,n])=>n.resolvedAt==null).map(([n,i])=>H5(n,i)).toSorted(K5),r=[...e.flaky.entries()].filter(([,n])=>n.occurrences>=W5).map(([n,i])=>q5(n,i)).toSorted((n,i)=>i.occurrences-n.occurrences);return{pending:t,recurrentFlaky:r}}function H5(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 q5(e,t){return{at:t.first.at,depot:t.first.depot,id:Xs(e),occurrences:t.occurrences,trail:t.first.trail}}var rx={crash:0,frame:3,invariant:1,law:2};function K5(e,t){let r=rx[e.oracleLayer]-rx[t.oracleLayer];return r===0?t.occurrences-e.occurrences:r}import{gzip as Y5}from"zlib";import{promisify as J5}from"util";import{existsSync as Z5,readFileSync as X5}from"fs";import ix from"path";import{graphql as Ci}from"gql.tada";function nx(e){return[e.kind,e.target,e.value].filter(t=>t.length>0).join(" ")}async function KJ({config:e,cwd:t,headed:r,lockfile:n,runId:i,session:o,signal:s,test:a}){if(!await mj(e,i))return{kind:"dispatch-failed",reason:"already-claimed",runId:i};let u=ix.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 Q5({config:e,debugDir:u,events:c,runId:i,test:a,total:p.fired.length});let h=ox(c).flatMap(f=>f.findings);return h.length>0?{findings:h,kind:"findings",runId:i}:{kind:"pass",runId:i}},async p=>(await fj(e,i,Ct(p)),{error:p,kind:"error",runId:i}))}async function Q5({config:e,debugDir:t,events:r,runId:n,test:i}){let o=ox(r),s=ej(t,n);if(s==null)throw new Error("recording-missing");await Promise.all([lj({aliases:[...nj(r),...ij(o,i)],config:e,generated:oj(r),generatedSingletons:sj(r),origin:s.origin,records:o,runId:n,test:i}),pj(e,n,s)]),await hj(e,n,o)}function ox(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 ej(e,t){let r=ix.join(e,t,"behavior.jsonl");if(!Z5(r))return null;let n=X5(r,"utf8").split(`
203
+ `).filter(o=>o.length>0).map(o=>tj(o)).flatMap(o=>rj(o)?[o.event]:[]),i=n[0];return i==null?null:{events:n,origin:i.timestamp}}function tj(e){return JSON.parse(e)}function rj(e){return typeof e=="object"&&e!=null&&Reflect.get(e,"kind")==="rrweb"}function nj(e){return e.flatMap(t=>t.kind==="world"?t.aliases:[])}function ij(e,t){return e.flatMap(r=>{let n=aj(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 oj(e){return new Set(e.flatMap(t=>t.kind==="world"?t.generated.map(r=>sx(r)):[]))}function sx({entity:e,field:t,key:r}){return`${e}\0${r}\0${t}`}function sj(e){return new Set(e.flatMap(t=>t.kind==="world"?t.generatedSingletons:[]))}function aj(e){return e==null?[]:e.expect.flatMap(t=>oa(t))}function oa(e){return e.kind==="state"&&e.assertion.kind==="created"?[{as:e.assertion.as,entity:e.entity}]:e.kind==="and"?e.predicates.flatMap(t=>oa(t)):e.kind==="when"?[...oa(e.consequence),...e.otherwise==null?[]:oa(e.otherwise)]:[]}async function lj({aliases:e,config:t,generated:r,generatedSingletons:n,origin:i,records:o,runId:s,test:a}){let l=o.map(u=>uj({aliases:e,generated:r,generatedSingletons:n,origin:i,record:u,test:a}));await _e({config:t,document:yj,variables:{items:[{runId:s,steps:l}]}})}function uj({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=Na(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=>cj({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:nx(a),url:i.url}}function cj({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(sx({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 dj=J5(Y5);async function fj(e,t,r){await _e({config:e,document:wj,variables:{reason:r,runId:t}}).catch(n=>{Se.error(n,"failRun submission failed")})}async function pj(e,t,r){let n=r.events.map(s=>JSON.stringify(s)).join(`
204
+ `),i=await dj(Buffer.from(n,"utf8")),o=r.events.at(-1);await _e({config:e,document:bj,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 hj(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:Sj,variables:{items:[{duration:o,failCount:n,passCount:i,runId:t,status:n>0?"failed":"passed",summary:null,warnCount:0}]}})}async function mj(e,t){return((await _e({config:e,document:gj,variables:{runIds:[t]}})).startRunsBatch??[]).some(n=>n.id===t)}var gj=Ci(`
205
205
  mutation StartRunsBatch($runIds: [String!]!) {
206
206
  startRunsBatch(runIds: $runIds) {
207
207
  id
208
208
  }
209
209
  }
210
- `),gj=Ci(`
210
+ `),yj=Ci(`
211
211
  mutation SubmitRunStepsBatch($items: [SubmitRunStepsItem!]!) {
212
212
  submitRunStepsBatch(items: $items)
213
213
  }
214
- `),yj=Ci(`
214
+ `),bj=Ci(`
215
215
  mutation SubmitRunRecordingChunk($input: SubmitRunRecordingChunkInput!) {
216
216
  submitRunRecordingChunk(input: $input)
217
217
  }
218
- `),bj=Ci(`
218
+ `),Sj=Ci(`
219
219
  mutation CompleteRunsBatch($items: [CompleteRunItem!]!) {
220
220
  completeRunsBatch(items: $items) {
221
221
  id
222
222
  status
223
223
  }
224
224
  }
225
- `),Sj=Ci(`
225
+ `),wj=Ci(`
226
226
  mutation FailRun($runId: String!, $reason: String!) {
227
227
  failRun(runId: $runId, reason: $reason)
228
228
  }
229
- `);import{createMessageConnection as lx,IPCMessageReader as ux,IPCMessageWriter as cx,NotificationType as wj,NotificationType0 as dx,RequestType as kf}from"vscode-jsonrpc/node";import{z as D}from"zod";var QJ=D.object({headed:D.boolean(),lockfileFingerprint:D.string(),runId:D.string().min(1),workflowSlug:D.string().min(1)}),eZ=D.object({fingerprint:D.string()}),tZ=D.object({lockfileJson:D.string().optional(),unavailable:D.string().optional()}),vj=D.enum(["unspecified","internal","server","client","producer","consumer"]),xj=D.enum(["unset","ok","error"]),Rj=D.object({attributes:D.record(D.string(),D.string()),durationMs:D.number(),kind:D.literal("span"),name:D.string(),parentSpanId:D.union([D.string(),D.undefined()]),source:D.literal("server"),spanId:D.string(),spanKind:vj,status:D.object({code:xj,message:D.union([D.string(),D.undefined()])}),timeNanos:D.string(),traceId:D.string()}),rZ=D.object({runId:D.string().min(1),span:Rj}),nZ=D.object({outcome:Sf,serverNotified:D.boolean()}),iZ=D.object({depotTest:zi,firings:D.array(D.object({idx:D.number().int().nonnegative(),params:D.record(D.string(),D.union([Xe,D.null()]))})),lensId:D.string().min(1),lockfileFingerprint:D.string(),lockfileHash:D.string().min(1),maxLength:D.number().int().positive(),shrinkBudget:D.number().int().nonnegative()}),kj=D.object({actions:D.array(D.string()),label:D.string().min(1)}),oZ=D.object({kind:D.enum(["aborted","clean","error","flaky","finding"]),reason:D.string().optional(),rows:D.array(Zs),trail:D.array(kj).default([])}),sZ=new dx("worker/ready"),aZ=new kf("worker/run"),lZ=new kf("worker/lockfile"),uZ=new kf("worker/exploreTrail"),cZ=new wj("worker/span"),dZ=new dx("worker/shutdown");function fZ(e){let t=lx(new ux(e),new cx(e));return t.listen(),t}function pZ(){let e=lx(new ux(process),new cx(process));return e.listen(),e}export{vx as a,Se as b,Tx as c,Er as d,Mx as e,_e as f,ua as g,Ut as h,lr as i,da as j,Jx as k,Zx as l,Hx as m,sR as n,aR as o,pV as p,vV as q,ji as r,mR as s,wa as t,wR as u,vR as v,NR as w,rt as x,Zi as y,HR as z,bn as A,Pr as B,hB as C,Xi as D,bB as E,SB as F,wB as G,CB as H,Va as I,Sp as J,vp as K,jB as L,Ap as M,Wa as N,zB as O,na as P,Uv as Q,nJ as R,iJ as S,oJ as T,fl as U,Nr as V,WC as W,KC as X,$r as Y,W as Z,xI as _,RI as $,kI as aa,za as ba,vc as ca,Y8 as da,Xs as ea,vi as fa,xi as ga,rf as ha,nf as ia,of as ja,O9 as ka,ff as la,pf as ma,V9 as na,b5 as oa,mJ as pa,wJ as qa,Wv as ra,PJ as sa,TJ as ta,LJ as ua,W5 as va,mY as wa,gY as xa,gv as ya,yY as za,bY as Aa,SY as Ba,wY as Ca,vY as Da,xY as Ea,Sv as Fa,wv as Ga,vv as Ha,xv as Ia,Rv as Ja,kv as Ka,VK as La,BK as Ma,UK as Na,WK as Oa,zK as Pa,GK as Qa,X9 as Ra,HK as Sa,qK as Ta,JK as Ua,ZK as Va,mf as Wa,XK as Xa,dv as Ya,cY as Za,bf as _a,FF as $a,qY as ab,HJ as bb,dj as cb,QJ as db,eZ as eb,rZ as fb,nZ as gb,iZ as hb,oZ as ib,sZ as jb,aZ as kb,lZ as lb,uZ as mb,cZ as nb,dZ as ob,fZ as pb,pZ as qb,YY as rb};
229
+ `);import{createMessageConnection as ax,IPCMessageReader as lx,IPCMessageWriter as ux,NotificationType as vj,NotificationType0 as cx,RequestType as Cf}from"vscode-jsonrpc/node";import{z as D}from"zod";var tZ=D.object({headed:D.boolean(),lockfileFingerprint:D.string(),runId:D.string().min(1),workflowSlug:D.string().min(1)}),rZ=D.object({fingerprint:D.string()}),nZ=D.object({lockfileJson:D.string().optional(),unavailable:D.string().optional()}),xj=D.enum(["unspecified","internal","server","client","producer","consumer"]),Rj=D.enum(["unset","ok","error"]),kj=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:xj,status:D.object({code:Rj,message:D.union([D.string(),D.undefined()])}),timeNanos:D.string(),traceId:D.string()}),iZ=D.object({runId:D.string().min(1),span:kj}),oZ=D.object({outcome:vf,serverNotified:D.boolean()}),sZ=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()}),Ej=D.object({actions:D.array(D.string()),label:D.string().min(1)}),aZ=D.object({kind:D.enum(["aborted","clean","error","flaky","finding"]),reason:D.string().optional(),rows:D.array(Zs),trail:D.array(Ej).default([])}),lZ=new cx("worker/ready"),uZ=new Cf("worker/run"),cZ=new Cf("worker/lockfile"),dZ=new Cf("worker/exploreTrail"),fZ=new vj("worker/span"),pZ=new cx("worker/shutdown");function hZ(e){let t=ax(new lx(e),new ux(e));return t.listen(),t}function mZ(){let e=ax(new lx(process),new ux(process));return e.listen(),e}export{wx as a,Se as b,Px as c,Er as d,Tx as e,_e as f,ca as g,Ut as h,lr as i,fa as j,Yx as k,Jx as l,Gx as m,oR as n,sR as o,hV as p,xV as q,ji as r,hR as s,va as t,SR as u,wR as v,OR as w,rt as x,Zi as y,GR as z,bn as A,Pr as B,mB as C,Xi as D,SB as E,wB as F,vB as G,AB as H,Ba as I,vp as J,Rp as K,VB as L,Pp as M,za as N,GB as O,ia as P,Wv as Q,iJ as R,oJ as S,sJ as T,pl as U,Nr as V,UC as W,qC as X,$r as Y,W as Z,vI as _,xI as $,RI as aa,Ga as ba,xc as ca,K8 as da,Xs as ea,vi as fa,xi as ga,nf as ha,of as ia,sf as ja,M9 as ka,pf as la,hf as ma,j9 as na,S5 as oa,gJ as pa,vJ as qa,zv as ra,kJ as sa,MJ as ta,OJ as ua,DJ as va,z5 as wa,gY as xa,yY as ya,yv as za,bY as Aa,SY as Ba,wY as Ca,vY as Da,xY as Ea,RY as Fa,wv as Ga,vv as Ha,xv as Ia,Rv as Ja,kv as Ka,Ev as La,BK as Ma,UK as Na,WK as Oa,zK as Pa,GK as Qa,HK as Ra,Q9 as Sa,qK as Ta,KK as Ua,ZK as Va,XK as Wa,yf as Xa,QK as Ya,fv as Za,dY as _a,wf as $a,jF as ab,KY as bb,KJ as cb,fj as db,tZ as eb,rZ as fb,iZ as gb,oZ as hb,sZ as ib,aZ as jb,lZ as kb,uZ as lb,cZ as mb,dZ as nb,fZ as ob,pZ as pb,hZ as qb,mZ as rb,JY as sb};
230
230
  /*! Bundled license information:
231
231
 
232
232
  rrweb/dist/rrweb.js: