ripplo 0.7.35 → 0.7.36

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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as bv}from"./chunk-IHSHBPJY.js";import{a as ih,b as tl}from"./chunk-7UWDMECF.js";var Ih=ih((Il,Ph)=>{"use strict";var{hasOwnProperty:Wr}=Object.prototype,kn=Pl();kn.configure=Pl;kn.stringify=kn;kn.default=kn;Il.stringify=kn;Il.configure=Pl;Ph.exports=kn;var Zv=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function ln(e){return e.length<5e3&&!Zv.test(e)?`"${e}"`:JSON.stringify(e)}function El(e,t){if(e.length>200||t)return e.sort(t);for(let n=1;n<e.length;n++){let r=e[n],i=n;for(;i!==0&&e[i-1]>r;)e[i]=e[i-1],i--;e[i]=r}return e}var Xv=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function kl(e){return Xv.call(e)!==void 0&&e.length!==0}function Eh(e,t,n){e.length<n&&(n=e.length);let r=t===","?"":" ",i=`"0":${r}${e[0]}`;for(let o=1;o<n;o++)i+=`${t}"${o}":${r}${e[o]}`;return i}function Jv(e){if(Wr.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 Qv(e){let t;if(Wr.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 eR(e,t){let n;if(Wr.call(e,t)&&(n=e[t],typeof n!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return n===void 0?!0:n}function kh(e,t){let n;if(Wr.call(e,t)){if(n=e[t],typeof n!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(n))throw new TypeError(`The "${t}" argument must be an integer`);if(n<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return n===void 0?1/0:n}function En(e){return e===1?"1 item":`${e} items`}function tR(e){let t=new Set;for(let n of e)(typeof n=="string"||typeof n=="number")&&t.add(String(n));return t}function nR(e){if(Wr.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 n=>{let r=`Object can not safely be stringified. Received type ${typeof n}`;throw typeof n!="function"&&(r+=` (${n.toString()})`),new Error(r)}}}function Pl(e){e={...e};let t=nR(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let n=Jv(e),r=eR(e,"bigint"),i=Qv(e),o=typeof i=="function"?i:void 0,s=kh(e,"maximumDepth"),a=kh(e,"maximumBreadth");function l(p,h,m,y,S,w){let g=h[p];switch(typeof g=="object"&&g!==null&&typeof g.toJSON=="function"&&(g=g.toJSON(p)),g=y.call(h,p,g),typeof g){case"string":return ln(g);case"object":{if(g===null)return"null";if(m.indexOf(g)!==-1)return n;let x="",P=",",N=w;if(Array.isArray(g)){if(g.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(g),S!==""&&(w+=S,x+=`
2
+ import{a as vv}from"./chunk-IHSHBPJY.js";import{a as ih,b as tl}from"./chunk-7UWDMECF.js";var Ih=ih((Il,Ph)=>{"use strict";var{hasOwnProperty:Wr}=Object.prototype,kn=Pl();kn.configure=Pl;kn.stringify=kn;kn.default=kn;Il.stringify=kn;Il.configure=Pl;Ph.exports=kn;var eR=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function ln(e){return e.length<5e3&&!eR.test(e)?`"${e}"`:JSON.stringify(e)}function El(e,t){if(e.length>200||t)return e.sort(t);for(let n=1;n<e.length;n++){let r=e[n],i=n;for(;i!==0&&e[i-1]>r;)e[i]=e[i-1],i--;e[i]=r}return e}var tR=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function kl(e){return tR.call(e)!==void 0&&e.length!==0}function Eh(e,t,n){e.length<n&&(n=e.length);let r=t===","?"":" ",i=`"0":${r}${e[0]}`;for(let o=1;o<n;o++)i+=`${t}"${o}":${r}${e[o]}`;return i}function nR(e){if(Wr.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 rR(e){let t;if(Wr.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 iR(e,t){let n;if(Wr.call(e,t)&&(n=e[t],typeof n!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return n===void 0?!0:n}function kh(e,t){let n;if(Wr.call(e,t)){if(n=e[t],typeof n!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(n))throw new TypeError(`The "${t}" argument must be an integer`);if(n<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return n===void 0?1/0:n}function En(e){return e===1?"1 item":`${e} items`}function oR(e){let t=new Set;for(let n of e)(typeof n=="string"||typeof n=="number")&&t.add(String(n));return t}function sR(e){if(Wr.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 n=>{let r=`Object can not safely be stringified. Received type ${typeof n}`;throw typeof n!="function"&&(r+=` (${n.toString()})`),new Error(r)}}}function Pl(e){e={...e};let t=sR(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let n=nR(e),r=iR(e,"bigint"),i=rR(e),o=typeof i=="function"?i:void 0,s=kh(e,"maximumDepth"),a=kh(e,"maximumBreadth");function l(p,h,m,y,S,w){let g=h[p];switch(typeof g=="object"&&g!==null&&typeof g.toJSON=="function"&&(g=g.toJSON(p)),g=y.call(h,p,g),typeof g){case"string":return ln(g);case"object":{if(g===null)return"null";if(m.indexOf(g)!==-1)return n;let x="",P=",",N=w;if(Array.isArray(g)){if(g.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(g),S!==""&&(w+=S,x+=`
3
3
  ${w}`,P=`,
4
4
  ${w}`);let se=Math.min(g.length,a),L=0;for(;L<se-1;L++){let Ze=l(String(L),g,m,y,S,w);x+=Ze!==void 0?Ze:"null",x+=P}let $e=l(String(L),g,m,y,S,w);if(x+=$e!==void 0?$e:"null",g.length-1>a){let Ze=g.length-a-1;x+=`${P}"... ${En(Ze)} not stringified"`}return S!==""&&(x+=`
5
5
  ${N}`),m.pop(),`[${x}]`}let $=Object.keys(g),_=$.length;if(_===0)return"{}";if(s<m.length+1)return'"[Object]"';let I="",j="";S!==""&&(w+=S,P=`,
@@ -17,25 +17,25 @@ ${S}`,V=Math.min(h.length,a),se=0;for(;se<V-1;se++){let $e=c(String(se),h[se],m,
17
17
  ${w}`,m.pop(),`[${I}]`}let g=Object.keys(h),x=g.length;if(x===0)return"{}";if(s<m.length+1)return'"[Object]"';S+=y;let P=`,
18
18
  ${S}`,N="",$="",_=Math.min(x,a);kl(h)&&(N+=Eh(h,P,a),g=g.slice(h.length),_-=h.length,$=P),i&&(g=El(g,o)),m.push(h);for(let I=0;I<_;I++){let j=g[I],V=c(j,h[j],m,y,S);V!==void 0&&(N+=`${$}${ln(j)}: ${V}`,$=P)}if(x>a){let I=x-a;N+=`${$}"...": "${En(I)} not stringified"`,$=P}return $!==""&&(N=`
19
19
  ${S}${N}
20
- ${w}`),m.pop(),`{${N}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(h);default:return t?t(h):void 0}}function d(p,h,m){switch(typeof h){case"string":return ln(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(p),typeof h!="object")return d(p,h,m);if(h===null)return"null"}if(m.indexOf(h)!==-1)return n;let y="",S=h.length!==void 0;if(S&&Array.isArray(h)){if(h.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(h);let N=Math.min(h.length,a),$=0;for(;$<N-1;$++){let I=d(String($),h[$],m);y+=I!==void 0?I:"null",y+=","}let _=d(String($),h[$],m);if(y+=_!==void 0?_:"null",h.length-1>a){let I=h.length-a-1;y+=`,"... ${En(I)} not stringified"`}return m.pop(),`[${y}]`}let w=Object.keys(h),g=w.length;if(g===0)return"{}";if(s<m.length+1)return'"[Object]"';let x="",P=Math.min(g,a);S&&kl(h)&&(y+=Eh(h,",",a),w=w.slice(h.length),P-=h.length,x=","),i&&(w=El(w,o)),m.push(h);for(let N=0;N<P;N++){let $=w[N],_=d($,h[$],m);_!==void 0&&(y+=`${x}${ln($)}:${_}`,x=",")}if(g>a){let N=g-a;y+=`${x}"...":"${En(N)} not stringified"`}return m.pop(),`{${y}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(h);default:return t?t(h):void 0}}function f(p,h,m){if(arguments.length>1){let y="";if(typeof m=="number"?y=" ".repeat(Math.min(m,10)):typeof m=="string"&&(y=m.slice(0,10)),h!=null){if(typeof h=="function")return l("",{"":p},[],h,y,"");if(Array.isArray(h))return u("",p,[],tR(h),y,"")}if(y.length!==0)return c("",p,[],y,"")}return d("",p,[])}return f}});var hm=ih((xj,wu)=>{"use strict";var Xo=process||{},dm=Xo.argv||[],Zo=Xo.env||{},TE=!(Zo.NO_COLOR||dm.includes("--no-color"))&&(!!Zo.FORCE_COLOR||dm.includes("--color")||Xo.platform==="win32"||(Xo.stdout||{}).isTTY&&Zo.TERM!=="dumb"||!!Zo.CI),OE=(e,t,n=e)=>r=>{let i=""+r,o=i.indexOf(t,e.length);return~o?e+NE(i,t,n,o)+t:e+i+t},NE=(e,t,n,r)=>{let i="",o=0;do i+=e.substring(o,r)+n,o=r+t.length,r=e.indexOf(t,o);while(~r);return i+e.substring(o)},fm=(e=TE)=>{let t=e?OE:()=>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")}};wu.exports=fm();wu.exports.createColors=fm});import{z as E}from"zod";var nl=E.enum(["fast","slow","async"]),Yn=E.object({ref:E.string().min(1)}),Lt=E.union([E.string(),E.number(),E.boolean()]),rl=E.object({template:E.array(E.union([E.string(),Yn])).min(1)}),Fe=E.union([Yn,Lt,rl,E.null()]),oh=E.object({kind:E.literal("changed")}),il=E.union([Fe,oh]),Dt=E.union([E.string(),Yn,rl]),Sv=E.object({by:E.literal("role"),name:E.union([Dt,E.undefined()]).optional().transform(e=>e),role:E.string().min(1)}),wv=E.object({by:E.literal("testId"),value:Dt}),xv=E.object({by:E.literal("inside"),scope:E.lazy(()=>ve),target:E.lazy(()=>ve)}),ve=E.discriminatedUnion("by",[Sv,wv,xv]),io=E.enum(["string","number","boolean"]),ol=E.enum(["strict","eventual"]),vv=E.object({kind:E.literal("string"),maxLength:E.number().int().positive().optional(),minLength:E.number().int().nonnegative().optional(),pattern:E.string().optional()}),Rv=E.object({kind:E.literal("number"),max:E.number().int().optional(),min:E.number().int().optional()}),Av=E.object({kind:E.literal("datetime"),maxOffsetDays:E.number().int(),minOffsetDays:E.number().int()}),sh=E.discriminatedUnion("kind",[vv,Rv,Av]),ah=E.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),sl=E.object({constraints:sh.optional(),generator:ah,name:E.string().min(1),type:io,values:E.array(Lt).min(1).optional()}),lh=E.object({consistency:ol.default("strict"),optional:E.boolean(),type:io,valueSpace:E.string().min(1).optional()}),al=E.enum(["backend","client"]),ll=E.object({description:E.string().optional(),identity:E.array(E.string().min(1)).min(1),identityKind:E.enum(["surrogate","natural"]),name:E.string().min(1),props:E.record(E.string().min(1),lh),source:al.default("backend")}),ul=E.object({consistency:ol.default("strict"),default:Lt,description:E.string().optional(),name:E.string().min(1),source:al.default("backend"),type:io,valueSpace:E.string().min(1).optional()}),jr=E.enum(["url","title","viewport"]);function cl(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${cl(e.scope)} \u25B8 ${cl(e.target)}`:`${e.role} ${e.name??""}`.trim()}import{z as R}from"zod";var dl=["unspecified","internal","server","client","producer","consumer"],fl=["unset","ok","error"],uh=R.looseObject({data:R.looseObject({source:R.number().optional()}).optional(),timestamp:R.number(),type:R.number()}),kt=R.string(),Cv=R.object({action:R.string(),kind:R.literal("action"),source:R.literal("test"),target:R.string().optional(),timeNanos:kt,value:R.string().optional()}),Ev=R.object({kind:R.literal("assertion"),label:R.string(),outcome:R.enum(["passed","failed","error"]),source:R.literal("test"),step:R.string(),timeNanos:kt,wait:R.enum(["fast","slow","async"]).optional(),waitMs:R.number().optional()}),kv=R.object({event:uh,kind:R.literal("rrweb"),rrwebType:R.string(),source:R.literal("browser"),timeNanos:kt}),Pv=R.object({kind:R.literal("network"),method:R.string(),requestBody:R.string().optional(),resourceType:R.string(),responseBody:R.string().optional(),source:R.literal("browser"),spanId:R.string().optional(),status:R.number(),timeNanos:kt,traceId:R.string().optional(),url:R.string()}),Iv=R.object({kind:R.literal("console"),level:R.string(),source:R.literal("browser"),text:R.string(),timeNanos:kt}),Mv=R.object({kind:R.literal("error"),message:R.string(),source:R.literal("browser"),stack:R.string().optional(),timeNanos:kt}),Tv=R.object({clientVersion:R.string(),kind:R.literal("meta"),source:R.literal("capture"),timeNanos:kt}),Ov=R.object({kind:R.literal("notice"),message:R.string(),source:R.literal("capture"),timeNanos:kt}),Nv=R.object({actual:R.string().optional(),expected:R.string().optional(),findingKind:R.string(),kind:R.literal("finding"),mismatchKind:R.string().optional(),pending:R.boolean().optional(),source:R.literal("verifier"),step:R.string(),subject:R.string(),timeNanos:kt,wait:R.enum(["fast","slow","async"]).optional(),waitMs:R.number().optional()}),ch=R.object({attributes:R.record(R.string(),R.string()),durationMs:R.number(),kind:R.literal("span"),name:R.string(),parentSpanId:R.string().optional(),source:R.literal("server"),spanId:R.string(),spanKind:R.enum(dl),status:R.object({code:R.enum(fl),message:R.string().optional()}),timeNanos:kt,traceId:R.string()}),dh=R.discriminatedUnion("kind",[Cv,Ev,kv,Pv,Iv,Mv,Tv,Ov,Nv,ch]);function hl(e){let t=$v(e);if(t==null)return null;let n=dh.safeParse(t);return n.success?n.data:null}function pl(e){return Number(BigInt(e)/1000000n)}function ml(e){return dl[e]??"unspecified"}function yl(e){return fl[e]??"unset"}function $v(e){try{return JSON.parse(e)}catch{return null}}import{z as v}from"zod";var _v=v.discriminatedUnion("kind",[v.object({as:v.string().min(1),kind:v.literal("created"),props:v.record(v.string().min(1),Fe)}),v.object({as:v.string().min(1),kind:v.literal("updated"),props:v.record(v.string().min(1),il)}),v.object({kind:v.literal("deleted")})]),Lv=v.object({kind:v.literal("is"),value:Fe}),Dv=v.discriminatedUnion("kind",[v.object({kind:v.literal("path")}),v.object({key:v.string().min(1),kind:v.literal("query")}),v.object({kind:v.literal("hash")})]),fh=v.lazy(()=>v.union([Fe,Fv])),Bv=v.object({entity:v.string().min(1),where:v.record(v.string().min(1),fh)}),Fv=v.object({field:v.string().min(1),kind:v.literal("within"),selection:Bv}),Pt=v.union([nl,v.undefined()]).optional().transform(e=>e),hh=v.object({assertion:Lv,kind:v.literal("singleton"),singleton:v.string().min(1),wait:Pt}),ph=v.object({entity:v.string().min(1),kind:v.literal("count"),value:v.number().int().nonnegative()}),oo=v.lazy(()=>v.discriminatedUnion("kind",[hh,ph,v.object({kind:v.literal("not"),predicate:oo}),v.object({kind:v.literal("and"),predicates:v.array(oo)})])),Uv=v.lazy(()=>v.object({condition:v.union([oo,v.undefined()]).optional().transform(e=>e),consequence:v.array(Zn),name:v.string().min(1)})),Zn=v.lazy(()=>v.discriminatedUnion("kind",[v.object({kind:v.literal("visible"),locator:ve,wait:Pt}),v.object({kind:v.literal("disabled"),locator:ve,wait:Pt}),v.object({kind:v.literal("enabled"),locator:ve,wait:Pt}),v.object({kind:v.literal("focused"),locator:ve,wait:Pt}),v.object({kind:v.literal("checked"),locator:ve,wait:Pt}),v.object({kind:v.literal("value"),locator:ve,value:Dt,wait:Pt}),v.object({kind:v.literal("text"),locator:ve,value:Dt,wait:Pt}),hh,v.object({kind:v.literal("browser"),name:jr,part:v.union([Dv,v.undefined()]).optional().transform(e=>e),value:v.union([Dt,v.null()]),wait:Pt}),v.object({assertion:_v,entity:v.string().min(1),key:v.record(v.string().min(1),fh),kind:v.literal("state"),wait:Pt}),v.object({kind:v.literal("not"),predicate:Zn}),v.object({kind:v.literal("and"),predicates:v.array(Zn)}),ph,v.object({branches:v.array(Uv),kind:v.literal("when")})]));import{z as so}from"zod";var jv=so.object({__codec:so.string().min(1),data:so.unknown(),version:so.number().int().positive()}),ao=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}},lo=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}};function gl({name:e,schema:t}){return{currentVersion:1,name:e,decode:n=>zv({name:e,raw:n,schema:t}),encode:n=>({__codec:e,data:n,version:1})}}function Vv(e,t){return JSON.stringify(e.encode(t))}function Wv(e,t){let n=JSON.parse(t);return e.decode(n)}function zv({name:e,raw:t,schema:n}){let r=jv.parse(t);if(r.__codec!==e)throw new lo({expected:e,got:r.__codec});if(r.version!==1)throw new ao({codec:e,currentVersion:1,gotVersion:r.version});return n.parse(r.data)}var Cn="__ripplo__",bl="__ripplo_seed__";import{z as A}from"zod";var mh=A.discriminatedUnion("kind",[A.object({kind:A.literal("goto"),url:Dt}),A.object({kind:A.literal("fill"),locator:ve,value:Fe}),A.object({kind:A.literal("clear"),locator:ve}),A.object({kind:A.literal("click"),locator:ve}),A.object({kind:A.literal("dblclick"),locator:ve}),A.object({kind:A.literal("select"),locator:ve,value:Fe}),A.object({kind:A.literal("check"),locator:ve}),A.object({kind:A.literal("uncheck"),locator:ve}),A.object({kind:A.literal("hover"),locator:ve}),A.object({files:A.array(A.string().min(1)).min(1),kind:A.literal("upload"),locator:ve}),A.object({key:A.string().min(1),kind:A.literal("press"),locator:ve.optional()})]),Sl=A.object({action:mh,expect:A.array(Zn).default([])}),wl=A.object({valueSpace:A.string().min(1)}),uo=A.object({as:A.string().min(1),entity:A.string().min(1),set:A.record(A.string().min(1),Fe)}),xl=A.object({entity:A.string().min(1),where:A.record(A.string().min(1),Fe)}),co=A.object({absent:A.array(xl).default([]),exclusive:A.array(A.string().min(1)).default([]),intent:A.string().min(1),name:A.string().min(1),params:A.record(A.string().min(1),wl),singletons:A.record(A.string().min(1),Fe).default({}),slug:A.string().min(1),steps:A.array(Sl).default([]),workflow:A.string().min(1),world:A.array(uo).default([])}),vl=A.object({absent:A.array(xl).default([]),exclusive:A.array(A.string().min(1)).default([]),intent:A.string().min(1),maybe:A.array(uo).default([]),name:A.string().min(1),params:A.record(A.string().min(1),wl),singletons:A.record(A.string().min(1),Fe).default({}),sourcePath:A.string().min(1).optional(),steps:A.array(Sl).default([]),stub:A.boolean().default(!1),tests:A.array(co).default([]),world:A.array(uo).default([])}),yh=A.object({sha256:A.string().regex(/^[0-9a-f]{64}$/u),size:A.number().int().nonnegative()}),gh=A.object({entities:A.array(ll),fixtures:A.record(A.string().min(1),yh).default({}),singletons:A.array(ul).default([]),valueSpaces:A.array(sl),workflows:A.array(vl)}),Gv=gl({name:"ripplo-lockfile",schema:gh});function Hv(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function fo(e,t,n=""){let r=Hv(e),i=e?.length,o=t!==void 0;if(!r||o&&i!==t){let s=n&&`"${n}" `,a=o?` of length ${t}`:"",l=r?`length=${i}`:`type=${typeof e}`,u=s+"expected Uint8Array"+a+", got "+l;throw r?new RangeError(u):new TypeError(u)}return e}function Rl(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function bh(e,t){fo(e,void 0,"digestInto() output");let n=t.outputLen;if(e.length<n)throw new RangeError('"digestInto() output" expected to be of length >='+n)}function Vr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ho(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function dt(e,t){return e<<32-t|e>>>t}var Kv=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",qv=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Sh(e){if(fo(e),Kv)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=qv[e[n]];return t}function wh(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function xh(e,t={}){let n=(i,o)=>e(o).update(i).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=i=>e(i),Object.assign(n,t),Object.freeze(n)}var vh=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function Rh(e,t,n){return e&t^~e&n}function Ah(e,t,n){return e&t^e&n^t&n}var po=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,n,r,i){this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=ho(this.buffer)}update(t){Rl(this),fo(t);let{view:n,buffer:r,blockLen:i}=this,o=t.length;for(let s=0;s<o;){let a=Math.min(i-this.pos,o-s);if(a===i){let l=ho(t);for(;i<=o-s;s+=i)this.process(l,s);continue}r.set(t.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Rl(this),bh(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:i,isLE:o}=this,{pos:s}=this;n[s++]=128,Vr(this.buffer.subarray(s)),this.padOffset>i-s&&(this.process(r,0),s=0);for(let d=s;d<i;d++)n[d]=0;r.setBigUint64(i-8,BigInt(this.length*8),o),this.process(r,0);let a=ho(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let u=l/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)a.setUint32(4*d,c[d],o)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||=new this.constructor,t.set(...this.get());let{blockLen:n,buffer:r,length:i,finished:o,destroyed:s,pos:a}=this;return t.destroyed=s,t.finished=o,t.length=i,t.pos=a,i%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}},Bt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var Yv=Uint32Array.from([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]),an=new Uint32Array(64),Al=class extends po{constructor(t){super(64,t,8,!1)}get(){let{A:t,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[t,n,r,i,o,s,a,l]}set(t,n,r,i,o,s,a,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(t,n){for(let d=0;d<16;d++,n+=4)an[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){let f=an[d-15],p=an[d-2],h=dt(f,7)^dt(f,18)^f>>>3,m=dt(p,17)^dt(p,19)^p>>>10;an[d]=m+an[d-7]+h+an[d-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let d=0;d<64;d++){let f=dt(a,6)^dt(a,11)^dt(a,25),p=c+f+Rh(a,l,u)+Yv[d]+an[d]|0,m=(dt(r,2)^dt(r,13)^dt(r,22))+Ah(r,i,o)|0;c=u,u=l,l=a,a=s+p|0,s=o,o=i,i=r,r=p+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){Vr(an)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Vr(this.buffer)}},Cl=class extends Al{A=Bt[0]|0;B=Bt[1]|0;C=Bt[2]|0;D=Bt[3]|0;E=Bt[4]|0;F=Bt[5]|0;G=Bt[6]|0;H=Bt[7]|0;constructor(){super(32)}};var Ch=xh(()=>new Cl,vh(1));var Ml=tl(Ih(),1),RB=Ml.default.configure,zr=Ml.default;function Tl(e){return Sh(Ch(wh(zr(e))))}function F(e){let t=zr(e);if(t==null)throw new Error("structuralKey: value is not serializable");return t}import{z as Gr}from"zod";var iR=Gr.object({index:Gr.number().int().nonnegative(),kind:Gr.string(),target:Gr.string(),value:Gr.string()});function oR(e){let t=sR(e);return{preconditions:e.entities.map(n=>({depends:t.get(n.name)??[],description:n.description??"",name:n.name,returns:n.identity})),singletons:e.singletons.map(n=>({defaultValue:String(n.default),description:n.description??"",name:n.name,type:n.type})),workflows:e.workflows.map(n=>({expectedOutcome:n.intent,name:n.intent,preconditions:cR(dR(n),t),requiresKeys:n.world.map(r=>({namespace:r.as,preconditionName:r.entity})),slug:Oh(n.name),sourcePath:n.sourcePath??null,spec:n}))}}function Th(e,t){return{index:t,kind:e.action.kind,target:fR(e.action),value:hR(e.action)}}function Oh(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function sR(e){let t=e.workflows.reduce((n,r)=>aR(n,r),new Map);return new Map([...t].map(([n,r])=>[n,[...r]]))}function aR(e,t){let n=[...t.world,...t.maybe],r=new Map(n.map(i=>[i.as,i.entity]));return n.reduce((i,o)=>{let s=lR(o,r),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function lR(e,t){return Object.values(e.set).flatMap(n=>uR(n)).map(n=>t.get(n)).filter(n=>n!=null&&n!==e.entity)}function uR(e){return e==null||typeof e!="object"?[]:"ref"in e?[Mh(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>Mh(t.ref))}function Mh(e){let[t]=e.split(".");return t??e}function cR(e,t){let n=(r,i)=>r.has(i)?r:(t.get(i)??[]).reduce((o,s)=>n(o,s),new Set([...r,i]));return[...e.reduce((r,i)=>n(r,i),new Set)]}function dR(e){return[...new Set(e.world.map(t=>t.entity))]}function fR(e){return e.kind==="goto"?mo(e.url):e.kind==="press"&&e.locator==null?"":yo(e.locator)}function mo(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join("")}function yo(e){return e.by==="testId"?`testId=${mo(e.value)}`:e.by==="inside"?`${yo(e.scope)} \u25B8 ${yo(e.target)}`:`${e.role} ${e.name==null?"":mo(e.name)}`.trim()}function hR(e){return e.kind==="fill"||e.kind==="select"?pR(e.value):e.kind==="press"?e.key:""}function pR(e){return e==null?"":typeof e!="object"?String(e):mo(e)}function Ol({actionOffsets:e,durationMs:t}){let n=bR({anchors:yR({actionOffsets:e,durationMs:t}),durationMs:t});return{delayMs:xR(Math.round(8e3/n.length),500,1800),offsets:n}}function yR({actionOffsets:e,durationMs:t}){let n=e.map(i=>Math.min(i+150,t)),r=[...new Set([0,...n,t])].toSorted((i,o)=>i-o);return gR(r)}function gR(e){return e.reduce((t,n)=>{let r=t.at(-1);return r!=null&&n-r<120?t:[...t,n]},[])}function bR({anchors:e,durationMs:t}){return e.length>60?SR(e):e.length>=5?e:[...new Set([...e,...wR(t,5)])].toSorted((n,r)=>n-r)}function SR(e){return Array.from({length:60},(t,n)=>e[Math.round(n/59*(e.length-1))]??0)}function wR(e,t){return Array.from({length:t},(n,r)=>Math.round(r/(t-1)*e))}function xR(e,t,n){return Math.min(n,Math.max(t,e))}import{z as Ee}from"zod";var Nh=Ee.enum(["Strict","Lax","None"]),$h=Ee.object({domain:Ee.string().min(1),expires:Ee.number(),httpOnly:Ee.boolean(),name:Ee.string().min(1),path:Ee.string().min(1),sameSite:Nh,secure:Ee.boolean(),value:Ee.string()}),_h=Ee.object({localStorage:Ee.array(Ee.object({name:Ee.string().min(1),value:Ee.string()})),origin:Ee.string().min(1)}),Nl=Ee.object({cookies:Ee.array($h),headers:Ee.record(Ee.string().min(1),Ee.string()).optional(),origins:Ee.array(_h)});import{z as Y}from"zod";var $l=Y.union([Lt,Y.null()]),_l=Y.record(Y.string().min(1),$l),Lh=Y.object({as:Y.string().min(1),entity:Y.string().min(1),fields:Y.record(Y.string().min(1),Fe)}),vR=Y.object({entities:Y.array(Lh),runId:Y.string().min(1),singletons:Y.record(Y.string().min(1),$l).default({})}),Dh=Y.object({as:Y.string().min(1),row:_l,session:Nl.optional()}),Ll=Y.object({rows:Y.array(Dh)}),RR=Y.object({entities:Y.array(Y.string().min(1)),runId:Y.string().min(1),singletons:Y.array(Y.string().min(1)).default([])}),Dl=Y.object({entities:Y.record(Y.string().min(1),Y.array(_l)),singletons:Y.record(Y.string().min(1),$l).default({})}),AR=Y.object({runId:Y.string().min(1)}),Bl=Y.object({ok:Y.literal(!0)});function go({actual:e,canon:t,pre:n,predicted:r}){return[...[...new Set([...r.entities.keys(),...e.entities.keys()])].flatMap(s=>PR({actual:e.entities.get(s),canon:t,entity:s,pre:n.entities.get(s),predicted:r.entities.get(s)})),...MR(n.singletons,r.singletons,e.singletons),...CR(n.browser,r.browser,e.browser)]}function CR(e,t,n){return ER(t,n).flatMap(({got:r,key:i,want:o})=>{if(o===void 0||r===void 0||o===r)return[];let s=kR(e,i);return[{mismatch:{key:i,kind:"browser-mismatch",snapshot:o,sut:r},pending:s!==void 0&&s===r}]})}function ER(e,t){let n=[...new Set([...Object.keys(e.query),...Object.keys(t.query)])];return[{got:t.path,key:{kind:"path"},want:e.path},{got:t.hash,key:{kind:"hash"},want:e.hash},{got:t.title,key:{kind:"title"},want:e.title},{got:t.viewport,key:{kind:"viewport"},want:e.viewport},...n.map(r=>({got:t.query[r],key:{key:r,kind:"query"},want:e.query[r]}))]}function kR(e,t){return t.kind==="query"?e.query[t.key]:e[t.kind]}function PR({actual:e,canon:t,entity:n,pre:r,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>IR({actual:e?.get(s),canon:t,entity:n,key:s,predicted:i?.get(s),preHadKey:r?.has(s)??!1,preRow:r?.get(s)}))}function IR({actual:e,canon:t,entity:n,key:r,predicted:i,preHadKey:o,preRow:s}){if(i==null)return[{mismatch:{entity:n,key:r,kind:"unexpected-row"},pending:o}];if(e==null)return[{mismatch:{entity:n,key:r,kind:"missing-row"},pending:!o}];let a=(u,c,d)=>Fl(t(n,u,c),t(n,u,d));return[...new Set([...Object.keys(i),...Object.keys(e)])].filter(u=>!a(u,i[u],e[u])).map(u=>({mismatch:{entity:n,field:u,key:r,kind:"wrong-value",snapshot:i[u],sut:e[u]},pending:s==null?e[u]===void 0:a(u,s[u],e[u])}))}function Fl(e,t){return Bh(e)===Bh(t)}function Bh(e){return e==null?"\u2205":JSON.stringify(e)}function MR(e,t,n){return[...new Set([...Object.keys(t),...Object.keys(n)])].flatMap(i=>{let o=t[i],s=n[i];return o===void 0||s===void 0||Fl(o,s)?[]:[{mismatch:{kind:"singleton-mismatch",singleton:i,snapshot:o,sut:s},pending:e[i]!==void 0&&Fl(e[i],s)}]})}function Hr(e){let t=TR(e.entities),n=OR(e.singletons);return r=>NR(r,t,n)}function TR(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([n,r])=>[Fh(t.name,n),r.consistency])))}function Fh(e,t){return`${e}.${t}`}function OR(e){return new Map(e.map(t=>[t.name,t.consistency]))}function NR(e,t,n){return e.kind==="singleton-mismatch"?$R(e.singleton,n):e.kind==="browser-mismatch"?"eventual":e.kind==="unexpected-row"||e.kind==="missing-row"?"strict":t.get(Fh(e.entity,e.field))??"strict"}function $R(e,t){return jr.safeParse(e).success?t.get(e)??"eventual":t.get(e)??"strict"}function Kr(e){let t=new Set(e.valueSpaces.filter(n=>n.generator==="date.iso").map(n=>n.name));return(n,r,i)=>{if(!t.has(`${n}.${r}`)||typeof i!="string")return i;let o=Date.parse(i);return Number.isNaN(o)?i:new Date(o).toISOString()}}function Ul({onlyFirst:e=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,e?void 0:"g")}var _R=Ul();function jl(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(_R,"")}function Vl(e,t,n){return{detail:n.slice(0,500),kind:"engine-http",path:e,status:t}}function Xn(e,t){return{code:Hh(t),kind:"engine-network",message:qr(t),path:e}}function bo(e){return{kind:"client-mount-missing",mountKey:e}}function Wl(e,t){return{kind:"engine-decode",message:qr(t),path:e}}function zl(e,t){return{entity:e,field:t,kind:"state-identity"}}function jh(e){return{as:e,kind:"setup-missing-row"}}function Vh(e){return{count:e,kind:"conflicting-sessions"}}function Ft(e){return{kind:"driver-launch",message:qr(e)}}function Gl(e){return{kind:"engine-unreachable",url:e}}function Hl(e,t){return{action:e,kind:"action-failed",message:qr(t)}}function Kl(e){return{kind:"check-failed",message:qr(e)}}function ql(){return{kind:"aborted"}}var LR=["client-mount-missing","driver-launch","engine-decode","engine-http","engine-network","engine-unreachable"],Wh=new Set(LR);function So(e){return Wh.has(e.kind)}function zh(e){return Wh.has(e)}var Uh=300;function un(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${Gh(e.detail)}${DR(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"conflicting-sessions":return`world established ${String(e.count)} distinct auth sessions in one browser context; sessions are exclusive \u2014 a single context holds one signed-in user`;case"engine-unreachable":return`the engine at ${e.url} did not respond in time \u2014 the dev server may still be recompiling. Re-run once it settles.`;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 Yl(e){throw new Error(un(e))}function ft(){}function Gh(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=Uh?t:`${t.slice(0,Uh)}\u2026 [truncated]`}function DR(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 Hh(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?Hh(e.cause):void 0}function qr(e){let t=e instanceof Error?e.message:String(e);return Gh(jl(t))}import{z as BR}from"zod";var Xl=BR.string().brand(),J=Xl.parse("");function It(e){return Xl.parse(e)}function Je(e,t){return Xl.parse(e.length===0?t:`${e}.${t}`)}function de(e){return Yn.safeParse(e).success}function Pn(e){let t=e.lastIndexOf(".");return t===-1?void 0:{alias:e.slice(0,t),field:e.slice(t+1)}}function Qe(e){return typeof e=="object"&&e!==null&&"template"in e}function Zl(e,t,n){let r=Je(t,e.ref);if(!n.has(r))throw new Error(`unresolved binding ref "${r}"`);return n.get(r)??null}function Jl(e,t,n){return FR(e).every(r=>n.has(Je(t,r)))}function ht(e,t,n){return typeof e=="string"?e:de(e)?String(Zl(e,t,n)):e.template.map(r=>typeof r=="string"?r:String(Zl(r,t,n))).join("")}function et(e,t,n){return e===null||typeof e=="number"||typeof e=="boolean"?e:de(e)?Zl(e,t,n):ht(e,t,n)}function Kh(e,t){return et(e,J,t)}function Yr(e){return zr(e)}function Jn(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,et(i,t,n)]))}function FR(e){return e==null||typeof e!="object"?[]:Qe(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}var UR="https://ripplo.invalid",In={hash:void 0,path:void 0,query:{},title:void 0,viewport:void 0},tt={hash:void 0,path:void 0,query:{},title:void 0,viewport:void 0};function Yh(e){return e.kind!=="title"&&e.kind!=="viewport"}function Ke(e){return e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:`url ${e.kind}`}function jt(e,t){return e==="title"?{kind:"title"}:e==="viewport"?{kind:"viewport"}:t===void 0||t.kind==="path"?{kind:"path"}:t.kind==="hash"?{kind:"hash"}:{key:t.key,kind:"query"}}function Ut(e){let t=new URL(e,UR),n=Object.fromEntries(t.searchParams.entries());return{hash:t.hash.length>0?t.hash.slice(1):void 0,path:t.pathname,query:n,title:void 0,viewport:void 0}}function Zr(e){if(typeof e=="string")return qh(Ut(e));let t=de(e)?[e]:e.template,n=t.findIndex(u=>typeof u=="string"&&/[?#]/.test(u)),r=t[n];if(n===-1||typeof r!="string")return{...tt,path:e};let i=[...t.slice(0,n),r.slice(0,r.search(/[?#]/))],o=t.slice(n),s={template:i};if(o.some(u=>typeof u!="string"))return{...tt,path:s};let a=o.filter(u=>typeof u=="string").join(""),l=Ut(`/p${a.slice(a.search(/[?#]/))}`);return{...qh(l),path:s}}function wo(e,t,n){return t.kind==="query"?{...e,query:{...e.query,[t.key]:n}}:{...e,[t.kind]:n}}function xo(e,t,n){return t.kind==="query"?{...e,query:{...e.query,[t.key]:n}}:{...e,[t.kind]:n}}function Zh(e,t){if(t.kind==="query"){let n=Object.fromEntries(Object.entries(e.query).filter(([r])=>r!==t.key));return{...e,query:n}}return{...e,[t.kind]:void 0}}function Qn(e,t){return t.kind==="query"?e.query[t.key]??void 0:e[t.kind]}function Mn(e){let n=[[{kind:"path"},e.path],[{kind:"hash"},e.hash],[{kind:"title"},e.title],[{kind:"viewport"},e.viewport]].flatMap(([i,o])=>o===void 0?[]:[{clause:o,key:i}]),r=Object.entries(e.query).map(([i,o])=>({clause:o,key:{key:i,kind:"query"}}));return[...n,...r]}function vo(e,t){return Xh(e,t)}function cn(e,t){return Xh(e,t)}function Xh(e,t){return{hash:t.hash??e.hash,path:t.path??e.path,query:{...e.query,...t.query},title:t.title??e.title,viewport:t.viewport??e.viewport}}function qh(e){return{hash:e.hash,path:e.path,query:e.query,title:e.title,viewport:e.viewport}}function Jh(e){return F(e)}var dn=class extends Error{name="AbortError";constructor(){super("aborted")}};function Ql(e){return e instanceof Error&&e.name==="AbortError"}function ot(e){if(e.aborted)throw new dn}function er(e,t){return t.aborted?Promise.reject(new dn):new Promise((n,r)=>{let i=()=>{clearTimeout(o),r(new dn)},o=setTimeout(()=>{t.removeEventListener("abort",i),n()},e);t.addEventListener("abort",i,{once:!0})})}var jR={check:"Check",clear:"Clear",click:"Click",dblclick:"Double-click",fill:"Fill",goto:"Go to",hover:"Hover",press:"Press",select:"Select",uncheck:"Uncheck",upload:"Upload"};function Qh(e){let t=jR[e.kind]??e.kind;return e.kind==="press"&&e.key!=null?`${t}: ${e.key}`:t}function ep(e){return e.kind==="data-rule"?"data rule":tp(e.check)}function tp(e){return e.kind==="not"?`not ${tp(e.inner)}`:e.kind==="browser"?Ke(e.key):`${np(e.locator)} ${e.kind}`}function np(e){return e.by==="testId"?"element":e.by==="inside"?np(e.target):e.role}function lp(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var VR=()=>[];async function Ao({canon:e,classify:t,initialSnapshot:n,observe:r,onAssertion:i,onStep:o,pageRulePendingChecks:s,steps:a,stopAfterStep:l},u){return up({acc:[],canon:e,classify:t,index:0,observe:r,onAssertion:i,onStep:o,pageRulePendingChecks:s??VR,signal:u,snapshot:n,steps:a,stopAfterStep:l})}async function up({acc:e,canon:t,classify:n,index:r,observe:i,onAssertion:o,onStep:s,pageRulePendingChecks:a,signal:l,snapshot:u,steps:c,stopAfterStep:d}){ot(l);let f=c[r];if(f==null)return{finalModel:u,findings:e};let p=Date.now(),h=await f.targetIds(),m=Qh(f.step.action);if(!f.requiredState(u)){let y={kind:"impossible-action",step:f.step};return tu(s,{annotations:[eu({actionLabel:m,outcome:"failed",rrwebIds:h,startMs:p})],endMs:Date.now(),findings:[y],index:r,post:u,pre:u,source:f.source,startMs:p,url:nu(u)}),{finalModel:u,findings:[...e,y]}}return f.perform().match(()=>zR({acc:e,actionLabel:m,canon:t,classify:n,index:r,observe:i,onAssertion:o,onStep:s,pageRulePendingChecks:a,rrwebIds:h,signal:l,snapshot:u,startMs:p,step:f,steps:c,stopAfterStep:d}),y=>{let S=Ro(y,f);return tu(s,{annotations:[eu({actionLabel:m,outcome:"failed",rrwebIds:h,startMs:p})],endMs:Date.now(),findings:[S],index:r,post:u,pre:u,source:f.source,startMs:p,url:nu(u)}),Promise.resolve({finalModel:u,findings:[...e,S]})})}function eu({actionLabel:e,outcome:t,rrwebIds:n,startMs:r}){return{atMs:r,kind:"action",label:e,outcome:t,rrwebIds:n,url:!1}}function WR(e){return e.kind==="data-rule"?!1:cp(e.check)}function cp(e){return e.kind==="not"?cp(e.inner):e.kind==="browser"&&Yh(e.key)}async function zR({acc:e,actionLabel:t,canon:n,classify:r,index:i,observe:o,onAssertion:s,onStep:a,pageRulePendingChecks:l,rrwebIds:u,signal:c,snapshot:d,startMs:f,step:p,steps:h,stopAfterStep:m}){let y=p.effect(d),S=await ZR({canon:n,classify:r,observe:o,pre:d,predicted:y,signal:c,step:p}),w=[...p.pendingChecks,...l(d,S.snapshot)],g=await GR({onAssertion:s,pendingChecks:w,signal:c,step:p}),x=[...g.findings,...S.findings];tu(a,{annotations:[eu({actionLabel:t,outcome:x.length>0?"failed":"passed",rrwebIds:u,startMs:f}),...g.annotations],endMs:Date.now(),findings:x,index:i,post:S.snapshot,pre:d,source:p.source,startMs:f,url:nu(S.snapshot)});let P=[...e,...x];return x.length>0?{finalModel:S.snapshot,findings:P}:m!=null&&i+1>=m?{finalModel:S.snapshot,findings:P}:up({acc:P,canon:n,classify:r,index:i+1,observe:o,onAssertion:s,onStep:a,pageRulePendingChecks:l,signal:c,snapshot:S.snapshot,steps:h,stopAfterStep:m})}async function GR({onAssertion:e,pendingChecks:t,signal:n,step:r}){let i=[...new Map(t.map(s=>[Jh(s.source),s])).values()],o=await Promise.all(i.map(async s=>{let a=await HR(s,n),l=Date.now(),u=await s.targetIds();return{atMs:l,outcome:a,pendingCheck:s,rrwebIds:u}}));return o.forEach(s=>{KR(e,s.pendingCheck,s.outcome,r)}),{annotations:o.filter(s=>s.pendingCheck.source.kind==="step").map(s=>({atMs:s.atMs,kind:"assertion",label:ep(s.pendingCheck.source),outcome:dp(s.outcome),rrwebIds:s.rrwebIds,url:WR(s.pendingCheck.source)})),findings:o.flatMap(s=>qR(s.pendingCheck,s.outcome,r))}}function HR(e,t){if(e.check.kind==="decided"){let n=e.check.passed?"passed":"failed";return Promise.resolve({kind:n})}return XR(e.budget,e.check.run,t)}function KR(e,t,n,r){e?.({outcome:dp(n),source:t.source,step:r.step,waitBudget:t.budget,waitMs:Vt[t.budget]})}function dp(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function qR(e,t,n){return t.kind==="error"?[Ro(t.error,n)]:t.kind==="failed"?[{budget:e.budget,kind:"pending-check",source:e.source,step:n.step}]:[]}function Ro(e,t){return{error:e,kind:"driver-error",step:t.step}}function tu(e,t){e?.(t)}function nu(e){let t=e.browser.path;return typeof t=="string"?t:null}var Vt={async:12e4,fast:5e3,slow:3e4},fp={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:Vt.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:Vt.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:Vt.slow}};function hp(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function rp(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function YR(e,t,n){return n.reconcile==null?e:n.reconcile(e,t)}function ip({canon:e,pre:t,predicted:n,step:r},i){let o=r.verifyChanges==null?[]:r.verifyChanges(n,i),s=YR(n,i,r),a=o.map(l=>({mismatch:l,pending:!0}));return{adopted:s,probed:[...a,...go({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function pp(e,t){return{budget:t.sync,kind:"consistency",mismatch:e.mismatch,pending:e.pending,step:t.step}}function op(e,t,n){let r=e.probed.filter(i=>!i.pending&&n(i.mismatch)==="strict");return r.length>0?{findings:r.map(i=>pp(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function sp(e,t,n){return{findings:[...e.probed.map(r=>pp(r,t)),...n],snapshot:e.adopted}}async function ZR({canon:e,classify:t,observe:n,pre:r,predicted:i,signal:o,step:s}){let a=fp[s.sync],l=Date.now()+a.timeoutMs,u=await rp(n);if(!u.ok)return{findings:[Ro(u.error,s)],snapshot:i};let c=ip({canon:e,pre:r,predicted:i,step:s},u.observed),d=0;for(;Date.now()<l;){ot(o);let f=op(c,s,t);if(f!=null)return f;await er(hp(a,d),o),d+=1;let p=await rp(n);if(!p.ok)return sp(c,s,[Ro(p.error,s)]);c=ip({canon:e,pre:r,predicted:i,step:s},p.observed)}return op(c,s,t)??sp(c,s,[])}async function XR(e,t,n){let r=fp[e],i=Date.now()+r.timeoutMs,o=await ap(t),s=0;for(;o.kind==="pending"&&Date.now()<i;)ot(n),await er(hp(r,s),n),s+=1,o=await ap(t);return o.kind==="pending"?{kind:"failed"}:o}function ap(e){return e().match(t=>t?{kind:"passed"}:{kind:"pending"},t=>({error:t,kind:"error"}))}function mp(e){return Xr(e.expect).some(t=>t.assertion.kind==="deleted")}var yp=new Set(["created","updated","deleted"]);function gp(e){return Xr(e.expect).some(t=>yp.has(t.assertion.kind))}function bp(e){return new Set(Xr(e.expect).flatMap(t=>yp.has(t.assertion.kind)?[t.entity]:[]))}function fn(e){return typeof e=="object"&&e!==null&&"kind"in e}function Tn(e){return Object.fromEntries(Object.entries(e).filter(t=>!fn(t[1])))}function Jr(e,t,n){return t.reduce((r,i)=>JR(r,i,n,e),e)}function Sp(e,t){return Object.keys(t).length===0?e:{...e,singletons:{...e.singletons,...t}}}function wp(e,t){return{...e,browser:vo(e.browser,t)}}function xp(e,t){return{...e,browser:t.reduce((n,r)=>Zh(n,r),e.browser)}}function Xr(e){return e.flatMap(t=>t.kind==="state"?[t]:t.kind==="and"?Xr(t.predicates):t.kind==="when"?Xr(t.branches.flatMap(n=>n.consequence)):[])}function JR(e,t,n,r){if(!QR(t,n))return e;if(t.assertion.kind==="created"){let o=Jn(t.assertion.props,J,n);return eA(e,t.entity,Yr(o),o)}if(t.assertion.kind==="deleted")return ru(e,t.entity,iA(t.key,n,r));let i=Jn(Tn(t.assertion.props),J,n);return ru(e,t.entity,oA(t.key,i,n,r))}function QR(e,t){return("props"in e.assertion?[e.key,Tn(e.assertion.props)]:[e.key]).every(r=>Object.values(r).every(i=>Ap(i)||!de(i)||t.has(It(i.ref))))}function eA(e,t,n,r){let i=new Map([...e.entities.get(t)??[],[n,r]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function ru(e,t,n){let r=n(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,r]])}}function On(e,t,n,r){let i={env:r,key:n,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>Eo(o,i))}function vp(e,t,n,r,i){let o={env:r,key:n,snapshot:e};return ru(e,t,s=>new Map([...s].map(([a,l])=>[a,Eo(l,o)?i(l):l])))}function Eo(e,t){return Object.entries(t.key).every(([n,r])=>Rp(e[n],r,t))}function Rp(e,t,n){return Ap(t)?tA(t,n).has(Co(e)):Co(e)===Co(rA(t,n.env))}function Ap(e){return typeof e=="object"&&e!==null&&"kind"in e}function tA(e,t){let n=t.snapshot.entities.get(e.selection.entity);return n==null?new Set:new Set([...n.values()].filter(r=>nA(r,e.selection.where,t)).map(r=>Co(r[e.field])))}function nA(e,t,n){return Object.entries(t).every(([r,i])=>Rp(e[r],i,n))}function Co(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function rA(e,t){return et(e,J,t)}function iA(e,t,n){let r={env:t,key:e,snapshot:n};return i=>new Map([...i].filter(([,o])=>!Eo(o,r)))}function oA(e,t,n,r){let i={env:n,key:e,snapshot:r};return o=>new Map([...o].map(([s,a])=>Eo(a,i)?[s,{...a,...t}]:[s,a]))}function iu(e){let t=e.predicates.filter(o=>Ip(o)),n=t.filter(o=>o.assertion.kind==="created"),r=Pp(t);if(n.length===0&&r.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=n.reduce((c,d)=>fA(c,s,d,e.env),{env:e.env,snapshot:o}),l=r.reduce((c,d)=>dA(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>aA(c,s,d),a.env);return sA(mA(l,e.deferred,u),s,e.adopt)}}function sA(e,t,n){if(n.length===0)return e;let r=n.reduce((i,o)=>{let s=t.snapshot.singletons[o];return s===void 0?i:{...i,[o]:s}},e.singletons);return{...e,singletons:r}}function kp(e,t,n){return new Map([...e,...Object.entries(n).map(([r,i])=>[Je(J,`${t}.${r}`),i])])}function aA(e,t,n){let r=On(t.snapshot,n.entity,n.key,e).at(0);return r==null?e:kp(e,n.assertion.as,r)}function ou(e){let t=Pp(e.predicates.filter(n=>Ip(n)));if(t.length!==0)return(n,r)=>t.flatMap(i=>lA(i,n,r,e.env))}function Pp(e){return e.filter(t=>t.assertion.kind==="updated"&&su(t.assertion.props).length>0)}function su(e){return Object.entries(e).filter(([,t])=>fn(t)).map(([t])=>t)}function Ip(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function lA(e,t,n,r){let i=On(t,e.entity,e.key,r).at(0),o=On(n.snapshot,e.entity,e.key,r).at(0);if(i==null||o==null)return[];let s=Yr(uA(e.key,r));return su(e.assertion.props).flatMap(a=>Cp(i[a])===Cp(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function uA(e,t){let n=Object.fromEntries(Object.entries(e).filter(r=>!cA(r[1])));return Jn(n,J,t)}function cA(e){return typeof e=="object"&&e!==null&&"kind"in e}function Cp(e){return e==null?"\u2205":JSON.stringify(e)}function dA(e,t,n,r){let i=su(n.assertion.props),o=On(t.snapshot,n.entity,n.key,r).at(0);return o==null?e:vp(e,n.entity,n.key,r,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function fA(e,t,n,r){if(n.assertion.kind!=="created")return e;let i=Jn(n.assertion.props,J,r),o=Yr(i),s=e.snapshot.entities.get(n.entity);if(s==null||!s.has(o))return e;let a=hA(t.snapshot.entities.get(n.entity),s,i);if(a==null)return e;let[l,u]=a,c=new Map(s);return c.delete(o),c.set(l,{...u,...i}),{env:kp(e.env,n.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(n.entity,c)}}}function hA(e,t,n){if(e==null)return;let r=Object.entries(n),i=[...e].filter(([o])=>!t.has(o)).map(([o,s])=>({entry:[o,s],score:r.filter(([a,l])=>Ep(s[a])===Ep(l)).length}));return pA(i,r.length)}function Ep(e){return e==null?"\u2205":JSON.stringify(e)}function pA(e,t){let n=e.reduce((i,o)=>Math.max(i,o.score),0);if(n===0)return;let r=e.filter(i=>i.score===n);if(!(n<t&&r.length!==1))return r[0]?.entry}function mA(e,t,n){let r=t.reduce((i,o)=>{let s=yA(o.value,n);return s==null||typeof s!="string"?i:xo(i,o.key,s)},e.browser);return{...e,browser:r}}function yA(e,t){try{return ht(e,J,t)}catch{return}}function ko(e,t){if(e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked")return{kind:e.kind,locator:Qr(e.locator,t)};if(e.kind==="not"){let n=ko(e.predicate,t);return n==null?null:{inner:n,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:Qr(e.locator,t),value:ht(e.value,J,t)}:e.kind!=="browser"?null:{key:jt(e.name,e.part),kind:"browser",value:e.value===null?null:ht(e.value,J,t)}}function tr(e,t){let n=e.expect.filter(l=>l.kind==="state"),r=wA(n),{browser:i,clears:o,deferred:s,singletons:a}=gA(e,t,r);return{action:xA(e.action,t),label:e.action.kind,pendingChecks:e.expect.flatMap(l=>RA(l,t)),reconcile:iu({adopt:[],deferred:s,env:t,predicates:n}),verifyChanges:ou({adopt:[],deferred:s,env:t,predicates:n}),effect:l=>xp(wp(Sp(Jr(l,n,t),a),i),o)}}function Qr(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:ht(e.name,J,t),role:e.role}:e.by==="inside"?{by:"inside",scope:Qr(e.scope,t),target:Qr(e.target,t)}:{by:"testId",value:ht(e.value,J,t)}}function Mp(e){return e.flatMap(t=>t.kind==="and"?Mp(t.predicates):[t])}function gA(e,t,n){let r=e.action.kind==="goto"?Ut(ht(e.action.url,J,t)):In;return Mp(e.expect).reduce((i,o)=>{if(o.kind==="browser"&&o.value===null){let s=jt(o.name,o.part);return{...i,clears:[...i.clears,s]}}if(o.kind==="browser"&&o.value!==null&&bA(o.value,n)){let s=jt(o.name,o.part);return{...i,deferred:[...i.deferred,{key:s,value:o.value}]}}if(o.kind==="browser"&&o.value!==null){let s=jt(o.name,o.part),a=ht(o.value,J,t);return{...i,browser:xo(i.browser,s,a)}}if(o.kind==="singleton"){let s=et(o.assertion.value,J,t);return{...i,singletons:{...i.singletons,[o.singleton]:s}}}return i},{browser:r,clears:[],deferred:[],singletons:{}})}function bA(e,t){return SA(e).some(n=>t.has(n.split(".")[0]??n))}function SA(e){return typeof e=="string"?[]:de(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function wA(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function xA(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:vA(e,t),url:e.kind==="goto"?ht(e.url,J,t):void 0,value:"value"in e?Kh(e.value,t):void 0}}function vA(e,t){if(!(!("locator"in e)||e.locator==null))return Qr(e.locator,t)}function RA(e,t){if(e.kind==="browser"||e.kind==="singleton")return[];let n=ko(e,t),r="wait"in e?e.wait??"fast":"fast";return n==null?[]:[{budget:r,check:n}]}import{err as Tp,ok as lu,okAsync as AA,Result as CA}from"neverthrow";function nr(e,t,n){let r=OA(e),i={env:new Map,generate:n.generate,generatedParams:new Set,indexed:r,overrides:new Map(Object.entries(n.params??{}).map(([s,a])=>[It(s),a]))};NA(t.params,J,i);let o=t.world.map(s=>$A(s,J,i));return n.materialize(o).andThen(s=>BA(s,i.env,r).map(a=>EA({base:a,generatedParams:i.generatedParams,lockfile:e,test:t})))}function Po(e,t){let n=new Map(t.map(r=>[r.name,r]));return r=>AA(IA(r,e,n).rows)}function Io(e){return t=>{let n=t.map(r=>({as:r.as,entity:r.entity,fields:r.fields}));return e(n).andThen(r=>PA(t,r))}}function uu(e,t){let n=ei(t);return Object.fromEntries(Object.entries(e).filter(([r,i])=>n.includes(r)&&i!=null))}function ei(e){return Object.keys(e.props)}function EA({base:e,generatedParams:t,lockfile:n,test:r}){let i=Object.fromEntries(n.singletons.map(c=>[c.name,c.default])),o=Object.fromEntries(Object.entries(r.singletons).map(([c,d])=>[c,et(d,J,e.env)])),s=Object.entries(r.singletons).filter(([,c])=>kA(c,t)).map(([c])=>c),a={...i,...o},l=new Set(n.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 kA(e,t){return de(e)?t.has(Je(J,e.ref)):Qe(e)?e.template.some(n=>typeof n!="string"&&t.has(Je(J,n.ref))):!1}function PA(e,t){let n=new Map(t.map(r=>[r.as,r]));return CA.combine(e.map(r=>{let i=n.get(r.as);return i==null?Tp(jh(r.as)):lu({as:r.as,entity:r.entity,generatedFields:r.generatedFields,row:i.row,session:i.session})}))}function IA(e,t,n){return e.reduce((r,i)=>{let o=MA(i.fields,r.env),s=UA({generate:t,model:i.model,seedPrefix:i.seedPrefix,set:o,valueSpaces:n}),a=Object.entries(s).map(([u,c])=>[`${i.as}.${u}`,c]),l=Object.keys(s).filter(u=>!(u in o));return{env:new Map([...r.env,...a]),rows:[...r.rows,{as:i.as,entity:i.entity,generatedFields:[...new Set([...i.generatedFields,...l])],row:s,session:void 0}]}},{env:new Map,rows:[]})}function MA(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>{if(de(r))return[n,TA(t,r.ref)];if(Qe(r))throw new Error(`template value not allowed in entity field "${n}"`);return[n,r]}))}function TA(e,t){let n=e.get(t);if(n==null)throw new Error(`setup ref "${t}" was not produced by an earlier entity`);return n}function OA(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function NA(e,t,n){Object.entries(e).forEach(([r,i])=>{let o=Je(t,r),s=n.indexed.valueSpaces.get(i.valueSpace);if(s==null)throw new Error(`unknown valueSpace "${i.valueSpace}" for param "${o}"`);let a=n.overrides.get(o);a==null&&n.generatedParams.add(o);let l=a??n.generate.value({anchor:void 0,constraints:s.constraints,generator:s.generator,nullable:!1,seed:o,type:s.type,values:s.values,valueSpace:i.valueSpace});n.env.set(o,l)})}function $A(e,t,n){let r=n.indexed.models.get(e.entity);if(r==null)throw new Error(`model "${e.entity}" not found for setup "${e.as}"`);let i=Je(t,e.as),o=_A(e.set,t,n.env),s=DA(r,o,i,n),a=Object.entries(e.set).filter(([,l])=>de(l)&&n.generatedParams.has(Je(t,l.ref))).map(([l])=>l);return{as:i,entity:e.entity,fields:{...s,...o},generatedFields:[...Object.keys(s),...a],model:r,seedPrefix:i}}function _A(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,LA(i,t,n)]))}function LA(e,t,n){if(!de(e))return e;let r=Je(t,e.ref);return n.get(r)??{ref:r}}function DA(e,t,n,r){return Object.fromEntries(Object.entries(e.props).filter(([i,o])=>!o.optional&&!e.identity.includes(i)&&!(i in t)).map(([i,o])=>[i,Op({field:i,generate:r.generate,model:e,seedPrefix:n,spec:o,valueSpaces:r.indexed.valueSpaces})]))}function BA(e,t,n){let r=new Map,i=e.flatMap(a=>{let l=n.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(Je(It(a.as),c),d));let u=r.get(a.entity)??new Map;return u.set(au(a.row,l),uu(a.row,l)),r.set(a.entity,u),a.session==null?[]:[a.session]}),o=e.flatMap(a=>{let l=n.models.get(a.entity);return l==null?[]:[{alias:a.as,entity:a.entity,key:au(a.row,l)}]}),s=e.flatMap(a=>{let l=n.models.get(a.entity);if(l==null)return[];let u=au(a.row,l);return a.generatedFields.map(c=>({entity:a.entity,field:c,key:u}))});return FA(i).map(a=>({aliases:o,auth:a,env:t,generated:s,snapshot:{browser:In,entities:jA(r),singletons:{}}}))}function FA(e){if(e.length===0)return lu(void 0);let t=new Set(e.map(r=>JSON.stringify(r.cookies))).size;if(t>1)return Tp(Vh(t));let n=e.flatMap(r=>Object.entries(r.headers??{}));return lu({cookies:e.flatMap(r=>r.cookies),headers:n.length===0?void 0:Object.fromEntries(n),origins:e.flatMap(r=>r.origins)})}function UA({generate:e,model:t,seedPrefix:n,set:r,valueSpaces:i}){return{...Object.fromEntries(Object.entries(t.props).filter(([s])=>!(s in r)).map(([s,a])=>[s,Op({field:s,generate:e,model:t,seedPrefix:n,spec:a,valueSpaces:i})])),...r}}function Op({field:e,generate:t,model:n,seedPrefix:r,spec:i,valueSpaces:o}){let s=`${n.name}.${e}`;return t.value({anchor:void 0,constraints:o.get(s)?.constraints,generator:o.get(s)?.generator??"lorem.word",nullable:i.optional,seed:Je(r,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function au(e,t){return t.identity.map(n=>String(e[n])).join(":")}function jA(e){return new Map([...e].map(([t,n])=>[t,new Map(n)]))}function Wt(e,t){return[...new Map(e.map(n=>[t(n),n])).values()]}function Np(e){return Wt(e,F)}function st(e){return`${e.workflow}/${e.slug}`}function Mt(e){return e.workflows.flatMap(t=>t.tests.map(n=>({ref:st(n),test:n,workflow:t})))}function Tt(e){return`${e.test}#${String(e.index)}`}function $n(e){let t=Mt(e).flatMap(n=>ti(e,n.test));return Wt(t,n=>`${n.test}:${F(n.steps)}`)}function ti(e,t){let n=Lp(t),r=$p(n,t.singletons),i=fC(t,dC(e)),o=VA(e,t);return WA(r,hC(t.steps),n).reduce((a,{chunk:l,requiredState:u},c)=>({offset:a.offset+l.length,transitions:[...a.transitions,uC({chunk:l,index:c,intent:t.intent,namespace:n.namespace,paramSpaceOf:i,requiredState:u,testRef:st(t),whenChunk:o.slice(a.offset,a.offset+l.length)})]}),{offset:0,transitions:[]}).transitions}function $p(e,t){return{absences:sC(e),browser:tt,entities:lC(e),exclusives:e.exclusives,singletons:Object.fromEntries(Object.entries(t).filter(([,n])=>!de(n)&&!Qe(n)))}}function VA(e,t){let n=e.workflows.find(r=>r.name===t.workflow);return n==null||n.steps.length!==t.steps.length?t.steps:n.steps}function Mo(e,t,n){return Object.values(e).flatMap(r=>de(r)?fu(r.ref,n):[]).find(r=>r.entity===t)?.aliasPath}function WA(e,t,n){return t.reduce((r,i)=>({requiredState:zA(r.requiredState,i,n),withRequiredState:[...r.withRequiredState,{chunk:i,requiredState:rC(r.requiredState,i)}]}),{requiredState:e,withRequiredState:[]}).withRequiredState}function zA(e,t,n){let r=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>GA(i,o,n),e);return{...r,browser:cn(r.browser,QA(t)),singletons:{...r.singletons,...nC(t)}}}function GA(e,t,n){return t.assertion.kind==="deleted"?HA(e,t,n):t.assertion.kind==="created"?YA(e,t.entity,t.assertion.as,t.assertion.props,n):XA(e,t,n)}function HA(e,t,n){let r=Mo(t.key,t.entity,n.namespace),i=e.entities.find(a=>a.alias===r),o=ni(KA(t.key),n),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...qA(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==r)}}function KA(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let n=t[1];return Bp(n)?[]:[[t[0],n]]}))}function qA(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(n=>!t.relations.some(r=>r.field===n.field)),...t.relations]}}function YA(e,t,n,r,i){let o=ni(r,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!ZA(o,s)),entities:[...e.entities,{alias:n,entity:t,...o}]}}function ZA(e,t){return Object.entries(t.literals).every(([r,i])=>e.literals[r]===i)&&t.relations.every(r=>e.relations.some(i=>i.field===r.field&&i.targetAlias===r.targetAlias&&i.targetField===r.targetField))}function XA(e,t,n){if(t.assertion.kind!=="updated")return e;let r=Mo(t.key,t.entity,n.namespace);if(r==null)return e;let i=ni(Tn(t.assertion.props),n),o=Object.entries(t.assertion.props).filter(([,a])=>fn(a)).map(([a])=>a),s=a=>a.alias===r?JA(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a))}}function JA(e,t,n){let r=Object.entries(e.literals).filter(([i])=>!n.includes(i)&&!(i in t.literals));return{...e,literals:{...Object.fromEntries(r),...t.literals},relations:[...e.relations.filter(i=>!t.relations.some(o=>o.field===i.field)),...t.relations]}}function QA(e){return e.reduce((t,n)=>cn(cn(t,eC(n)),tC(n)),tt)}function eC(e){return e.action.kind==="goto"?Zr(e.action.url):tt}function tC(e){return du(e.expect).reduce((t,n)=>n.kind==="browser"?wo(t,jt(n.name,n.part),n.value):t,tt)}function du(e){return e.flatMap(t=>t.kind==="and"?du(t.predicates):[t])}function nC(e){return Object.fromEntries(e.flatMap(t=>du(t.expect).flatMap(n=>n.kind==="singleton"?[[n.singleton,n.assertion.value]]:[])))}function rC(e,t){return t[0]?.action.kind!=="goto"?e:{...e,browser:tt}}function To(e,t){let n=Lp(t);return{namespace:n.namespace,requiredState:$p(n,t.singletons)}}function _p(e,t){return[...new Set(e)].flatMap(n=>fu(n,t))}function pt(e){return de(e)?[e.ref]:Qe(e)?e.template.flatMap(t=>de(t)?[t.ref]:[]):[]}function Nn(e){switch(e.kind){case"visible":case"disabled":case"enabled":case"focused":case"checked":return hn(e.locator);case"value":case"text":return[...hn(e.locator),...pt(e.value)];case"singleton":return pt(e.assertion.value);case"browser":return pt(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(Tn(e.assertion.props)).flatMap(t=>pt(t)),...Object.values(e.key).flatMap(t=>Dp(t))];case"not":return Nn(e.predicate);case"when":return e.branches.flatMap(t=>t.consequence.flatMap(n=>Nn(n)));case"and":return e.predicates.flatMap(t=>Nn(t));case"count":return[]}}function Lp(e){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map(e.world.map(t=>[t.as,t.entity])),setups:e.world}}function hn(e){return e.by==="inside"?[...hn(e.scope),...hn(e.target)]:e.by==="role"?e.name==null?[]:pt(e.name):pt(e.value)}function Dp(e){return Bp(e)?Object.values(e.selection.where).flatMap(t=>Dp(t)):pt(e)}function Bp(e){return typeof e=="object"&&e!==null&&"kind"in e}function iC(e){return e.kind==="goto"?pt(e.url):e.kind==="fill"||e.kind==="select"?[...hn(e.locator),...pt(e.value)]:e.kind==="press"?e.locator==null?[]:hn(e.locator):(e.kind==="upload",hn(e.locator))}function oC(e){return[...iC(e.action),...e.expect.flatMap(t=>Nn(t))]}function sC(e){return e.absences.map(t=>({entity:t.entity,...ni(t.where,e)}))}function ni(e,t){let n=Object.entries(e),r=Object.fromEntries(n.flatMap(([o,s])=>de(s)||Qe(s)?[]:[[o,s]])),i=n.flatMap(o=>{let s=o[1];if(!de(s))return[];let a=fu(s.ref,t.namespace).at(0);return a==null?[]:[{entity:a.entity,field:o[0],targetAlias:a.aliasPath,targetField:a.field}]});return{literals:r,relations:i}}function aC(e,t){return e.map(n=>({alias:n.as,entity:n.entity,...ni(n.set,t)}))}function lC(e){return aC(e.setups,e)}function uC(e){let t=e.chunk.findIndex(s=>s.action.kind!=="goto"),n=t===-1?e.chunk:e.chunk.slice(0,t),r=e.chunk.slice(n.length),i=r.at(-1)??e.chunk.at(-1);if(i==null)throw new Error("empty transition chunk");let o=[...new Set(e.chunk.flatMap(s=>oC(s)))];return{effectStep:i,index:e.index,intent:e.intent,namespace:e.namespace,nav:n,paramSpaces:Object.fromEntries(o.filter(s=>e.paramSpaceOf.has(s)).map(s=>[s,e.paramSpaceOf.get(s)])),requiredState:e.requiredState,steps:r,test:e.testRef,wait:lp(r.flatMap(s=>cC(s))),whenSteps:e.whenChunk}}function cC(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function fu(e,t){let n=Pn(e);if(n==null)return[];let r=t.get(n.alias);return r==null?[]:[{aliasPath:n.alias,entity:r,field:n.field,ref:e}]}function dC(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function fC(e,t){return new Map(Object.entries(e.params).map(([n,r])=>[n,t.get(r.valueSpace)]))}function hC(e){return cu(e,0,[],[])}function cu(e,t,n,r){let i=e[t];if(i==null)return n.length===0?r:[...r,n];let o=[...n,i];return pC(i)?cu(e,t+1,[],[...r,o]):cu(e,t+1,o,r)}function pC(e){return e.expect.some(t=>t.kind==="state")}function Fp(e){return Up(e,new Map)}function mC(e,t){return e.reduce((n,r)=>n??t(r),null)}function Up(e,t){let n=e.variables.find(r=>!t.has(r));return n==null?t:mC(e.domain(n),r=>{let i=new Map([...t,[n,r]]);return e.consistent(i)?Up(e,i):null})}function mt(e,t){let n=jp(e,t);if(n==null)return null;let r=RC(n);return AC(e.singletons,t.singletons,r)&&CC(e.browser,t.browser,r)?r:null}function jp(e,t){let{absences:n,entities:r,exclusives:i}=e,o=new Map(r.map(a=>[a.alias,a])),s=Fp({variables:r.map(a=>a.alias),consistent:a=>yC(a)&&gC(r,a)&&SC(n,a,t),domain:a=>xC(o.get(a),t)});return s==null?null:vC(i,r,s,t)?s:null}function yC(e){let t=[...e.values()];return new Set(t).size===t.length}function gC(e,t){return e.every(n=>t.has(n.alias)?n.relations.every(r=>bC(n,r,t)):!0)}function bC(e,t,n){if(!n.has(t.targetAlias))return!0;let r=n.get(t.targetAlias)?.[t.targetField];return r==null?!0:n.get(e.alias)?.[t.field]===r}function SC(e,t,n){return e.every(r=>![...n.entities.get(r.entity)?.values()??[]].some(i=>wC(i,r,t)))}function wC(e,t,n){return Vp(e,t)?t.relations.every(r=>{if(!n.has(r.targetAlias))return!1;let i=n.get(r.targetAlias)?.[r.targetField];return i!=null&&e[r.field]===i}):!1}function Vp(e,t){return Object.entries(t.literals).every(([n,r])=>r===null?e[n]==null:e[n]===r)}function xC(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(n=>Vp(n,e))}function vC(e,t,n,r){return e.every(i=>{let o=t.filter(a=>a.entity===i&&n.has(a.alias)).length;return(r.entities.get(i)?.size??0)===o})}function RC(e){return new Map([...e].flatMap(([t,n])=>Object.entries(n).flatMap(r=>{let i=r[1];return typeof i=="string"||typeof i=="number"||typeof i=="boolean"?[[It(`${t}.${r[0]}`),i]]:[]})))}function AC(e,t,n){return Object.entries(e).every(([r,i])=>Jl(i,J,n)?t[r]===et(i,J,n):!1)}function CC(e,t,n){return Mn(e).every(({clause:r,key:i})=>{if(r===null)return Qn(t,i)===void 0;if(!Jl(r,J,n))return!1;let o=et(r,J,n);return Qn(t,i)===(typeof o=="string"?o:void 0)})}function zp(e,t,n){return e.reduce((r,i)=>{let o=Jr(r.snapshot,EC(i),n);return{resolved:[...r.resolved,kC(i,o,n)],snapshot:o}},{resolved:[],snapshot:t}).resolved}function EC(e){return e.expect.filter(t=>t.kind==="state")}function kC(e,t,n){return e.expect.some(r=>r.kind==="when")?{...e,expect:e.expect.flatMap(r=>Gp(r,{env:n,snapshot:t}))}:e}function Gp(e,t){if(e.kind!=="when")return[e];let n=PC(e,t);return n==null?[]:n.flatMap(r=>Gp(r,t))}function PC(e,t){return e.branches.find(n=>n.condition==null||hu(n.condition,t))?.consequence}function hu(e,t){if(e.kind==="count")return On(t.snapshot,e.entity,{},t.env).length===e.value;if(e.kind==="singleton"){let n=et(e.assertion.value,J,t.env);return Wp(t.snapshot.singletons[e.singleton])===Wp(n)}return e.kind==="not"?!hu(e.predicate,t):e.predicates.every(n=>hu(n,t))}function Wp(e){return e==null?"\u2205":JSON.stringify(e)}function ri(e,t,n){let r=mt(e.requiredState,t);return r==null?null:new Map([...r,...Object.entries(n).map(([i,o])=>[It(i),o])])}function ii(e,t,n){let r=zp(e.whenSteps,n,t),i=r.at(-1)??e.effectStep,o=tr(i,t),s=MC(e,t);return{effect:TC(o.effect,s),steps:r.map(a=>{let l=tr(a,t);return{action:l.action,effect:l.effect,pendingChecks:l.pendingChecks,reconcile:l.reconcile,source:a,verifyChanges:l.verifyChanges}})}}function No(e,t,n){return mt(e.requiredState,n)==null?!1:Oo(t(n))!==Oo(n)||OC(e)||IC(e)}function IC(e){return[...e.nav,...e.steps].every(t=>t.expect.every(n=>n.kind!=="state"))}var Hp=new WeakMap;function Oo(e){let t=Hp.get(e);if(t!=null)return t;let n=F({browser:{...e.browser},entities:[...e.entities].map(([r,i])=>[r,[...i]]),singletons:{...e.singletons}});return Hp.set(e,n),n}function MC(e,t){let n=e.nav.at(-1);return n==null?void 0:tr(n,t).action.url}function TC(e,t){if(t==null)return e;let n=Ut(t);return r=>{let i=e(r);return{...i,browser:vo(i.browser,n)}}}function OC(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(n=>fn(n)))}function $o(e,t,n){let r=ri(e,t.snapshot,n);if(r==null)return null;let i=NC(e,r,t.snapshot);return i==null||!No(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function Kp(e,t,n){let r=ri(e,t.snapshot,n);if(r==null)return"required-state-unsatisfied";try{return ii(e,r,t.snapshot),"no-effect"}catch{return"unresolvable"}}function NC(e,t,n){try{return ii(e,t,n)}catch{return null}}function oi(e,t,n){return e.flatMap((r,i)=>{let o=n(r),s=$o(r,t,o);return s==null?[]:[{idx:i,label:Tt(r),params:o,stepRun:s}]})}var $C={absences:[],browser:tt,entities:[],exclusives:[],singletons:{}};function rr(e){return{...$C,...e}}function si(e,t){if(e==null)return new Set;if(e.by==="inside")return new Set([...si(e.scope,t),...si(e.target,t)]);let n=e.by==="role"?e.name:e.value;return new Set(t(n))}function _o(e){return _C(e).flatMap(t=>LC(t))}function _C(e){return[...e.reduce((n,r)=>{let i=F([r.when.singletons,r.when.browser,r.consequence]);return new Map([...n,[i,[...n.get(i)??[],r]]])},new Map).values()]}function LC(e){if(e.length<2)return[];let t=e.map(o=>new Set(o.when.entities.map(s=>pu(s)))),[n]=t;if(n==null)return[];let r=[...n].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||r.length===i.when.entities.length?[]:DC(e,r)?[]:jC(i,r,WC(e))}function pu(e){return F([e.entity,e.literals])}function DC(e,t){return e.some(n=>{let r=qp(n.consequence),i=BC(r),o=FC(r);return n.when.entities.some(s=>!t.includes(pu(s))&&(UC(s,i)||o.has(s.alias)))})}function qp(e){return e.kind==="not"?qp(e.predicate):"locator"in e?e.locator:void 0}function BC(e){return si(e,t=>t==null||de(t)||Qe(t)?[]:[t])}function FC(e){return si(e,t=>{if(t==null||!de(t))return[];let n=Pn(t.ref);return n==null?[]:[n.alias]})}function UC(e,t){return Object.values(e.literals).some(n=>typeof n=="string"&&t.has(n))}function jC(e,t,n){let r=e.when.entities.filter(l=>t.includes(pu(l))),i=e.when.entities.filter(l=>!r.includes(l)).filter(l=>e.when.exclusives.includes(l.entity)).map(l=>({...l,literals:{},relations:[]})),o=[...r,...i],s=new Set(o.map(l=>l.alias));if(![...e.refs].every(l=>s.has(l)))return[];let a=rr({browser:e.when.browser,entities:o.map(l=>VC(l,s)),exclusives:e.when.exclusives.filter(l=>o.some(u=>u.entity===l)),singletons:e.when.singletons});return[{consequence:e.consequence,origin:{kind:"generalized",tests:n},refs:e.refs,when:a}]}function VC(e,t){return{...e,relations:e.relations.filter(n=>t.has(n.targetAlias))}}function WC(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function Jp(e){return e.flatMap((t,n)=>e.slice(n+1).flatMap(r=>em(t,r)))}function Qp(e,t){return em(e,t).length>0}function em(e,t){let n=Yp(e.when,t.when);return!n&&!Yp(t.when,e.when)||!HC(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:n?t.when:e.when}]}function Yp(e,t){return Zp(e.entities,t.entities)&&Zp(e.absences,t.absences)&&e.exclusives.every(n=>t.exclusives.includes(n))&&zC(e.singletons,t.singletons)&&GC(e.browser,t.browser)}function Zp(e,t){let n=new Set(t.map(r=>F(r)));return e.every(r=>n.has(F(r)))}function zC(e,t){return Object.entries(e).every(([n,r])=>n in t&&F(t[n])===F(r))}function GC(e,t){let n=new Map(Mn(t).map(r=>[F(r.key),r.clause]));return Mn(e).every(r=>{let i=F(r.key);return n.has(i)&&F(n.get(i))===F(r.clause)})}function HC(e,t){return e.kind==="not"?mu(e.predicate,t):t.kind==="not"?mu(e,t.predicate):KC(e,t)||qC(e,t)}function mu(e,t){return e.kind===t.kind&&"locator"in e&&"locator"in t&&tm(e,t)}function tm(e,t){return"locator"in t&&F(e.locator)===F(t.locator)}function KC(e,t){let n=new Set([e.kind,t.kind]);return n.has("enabled")&&n.has("disabled")&&"locator"in e&&"locator"in t?tm(e,t):!1}function qC(e,t){let n=Xp(e),r=Xp(t);return n==null||r==null||e.kind!==t.kind?!1:mu(e,t)&&F(n)!==F(r)}function Xp(e){return e.kind==="value"||e.kind==="text"?e.value:null}function nm(e,t){return e.flatMap(n=>{let r=YC(n),i=new Set(n.requiredState.absences.map(o=>o.entity));return t.flatMap(o=>ZC(n,o,r,i))})}function YC(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(n=>n.kind==="state"&&n.assertion.kind==="deleted"?[n.entity]:[])))}function ZC(e,t,n,r){let{source:i,target:o}=t.reference;return!n.has(o)||n.has(i)||r.has(i)?[]:[{dataRule:t,source:i,target:o,transition:Tt(e)}]}function yu(e){return F({consequence:e.consequence,when:e.when})}function Do(e){let t=[...XC(e),...cE(e)],n=_o(t).reduce((r,i)=>[...t,...r].some(s=>Qp(i,s))?r:[...r,i],[]);return Wt([...t,...n],yu)}function Bo(e,t){return e.filter(n=>!JC(n)||QC(n)===t)}function Fo(e){return e.kind==="not"?Fo(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="value"||e.kind==="text"}function Uo(e,t,n){if(mt(e.when,t)!=null)return null;let r=mt(e.when,n);return r==null?null:fE(e,r)}function XC(e){return Wt(Mt(e).flatMap(t=>eE(e,t)),yu)}function JC(e){return e.origin==null||e.origin.kind==="generalized"?!1:Nn(e.consequence).some(t=>Pn(t)!=null)}function QC(e){let{origin:t}=e;if(!(t==null||t.kind==="generalized"))return t.test}function eE(e,{test:t,workflow:n}){let r=To(e,t),i=tE(n.steps);return t.steps.reduce((o,s)=>({pageRules:[...o.pageRules,...uE({branchScoped:i,namespace:r.namespace,origin:{kind:"test",test:st(t)},requiredState:o.requiredState,step:s})],requiredState:nE(o.requiredState,s,r)}),{pageRules:[],requiredState:r.requiredState}).pageRules}function tE(e){let t=e.flatMap(n=>n.expect).flatMap(n=>Lo(n)).map(n=>F(n));return new Set(t)}function Lo(e){return e.kind==="not"?Lo(e.predicate):e.kind==="and"?e.predicates.flatMap(t=>Lo(t)):e.kind!=="when"?[]:e.branches.flatMap(t=>t.consequence.flatMap(n=>[n,...Lo(n)]))}function nE(e,t,n){return t.expect.reduce((r,i)=>i.kind==="state"?rE(r,i,n):r,e)}function rE(e,t,n){if(t.assertion.kind==="created"){let o=iE(t.assertion.as,t.entity,t.assertion.props,n);return{...e,entities:[...e.entities,o]}}let r=Mo(t.key,t.entity,n.namespace);if(r==null)return e;if(t.assertion.kind==="deleted")return aE(e,r);let i=Tn(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===r?im(o,i,n):o)}}function iE(e,t,n,r){return im({alias:e,entity:t,literals:{},relations:[]},n,r)}function im(e,t,n){return Object.entries(t).reduce((r,[i,o])=>{if(Qe(o))return r;if(de(o)){let s=oE(o.ref,i,n.namespace);return{...r,literals:sE(r.literals,i),relations:s==null?r.relations:[...rm(r.relations,i),s]}}return{...r,literals:{...r.literals,[i]:o},relations:rm(r.relations,i)}},e)}function oE(e,t,n){let r=Pn(e);if(r==null)return;let i=n.get(r.alias);return i==null?void 0:{entity:i,field:t,targetAlias:r.alias,targetField:r.field}}function sE(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>n!==t))}function rm(e,t){return e.filter(n=>n.field!==t)}function aE(e,t){let n=e.entities.find(i=>i.alias===t),r=lE(e,t);return n==null?r:{...r,absences:[...r.absences,{entity:n.entity,literals:n.literals,relations:n.relations}]}}function lE(e,t){return{...e,entities:e.entities.filter(n=>n.alias!==t)}}function uE({branchScoped:e,namespace:t,origin:n,requiredState:r,step:i}){if(i.action.kind!=="goto")return[];let o=i.action.url,s=cn(Zr(o),om(i));return i.expect.filter(a=>Fo(a)).filter(a=>!e.has(F(a))).map(a=>am({browser:s,consequence:a,namespace:t,origin:n,requiredState:r,url:o}))}function om(e){return sm(e.expect).reduce((t,n)=>n.kind==="browser"?wo(t,jt(n.name,n.part),n.value):t,tt)}function sm(e){return e.flatMap(t=>t.kind==="and"?sm(t.predicates):[t])}function am({browser:e,consequence:t,namespace:n,origin:r,requiredState:i,url:o}){return{consequence:t,origin:r,refs:new Set(_p([...pt(o),...Nn(t)],n).map(s=>s.aliasPath)),when:{...i,browser:cn(i.browser,e)}}}function cE(e){return Wt($n(e).flatMap(t=>dE(t)),yu)}function dE(e){let t=e.nav.at(-1),n=e.steps[0]?.action,r=n!=null&&"locator"in n?n.locator:void 0;if(t==null||t.action.kind!=="goto"||r==null)return[];let i={kind:"enabled",locator:r,wait:void 0};return[am({browser:cn(Zr(t.action.url),om(t)),consequence:i,namespace:e.namespace,origin:{intent:e.intent,kind:"trigger",test:e.test},requiredState:e.requiredState,url:t.action.url})]}function fE(e,t){try{let n=ko(e.consequence,t);return n==null?null:{check:n}}catch{return null}}function jo(e){return Np(Mt(e).flatMap(t=>hE(e,t.test)))}function Vo(e,t){return mt(e.when,t)==null?!1:mt(e.holds,t)==null}function hE(e,t){let n=To(e,t);return n.requiredState.entities.flatMap(r=>r.relations.flatMap(i=>pE(e,r,i,n.namespace)?gE(r,i,n.namespace):[]))}function pE(e,t,n,r){let i=r.get(n.targetAlias);return i!=null&&!mE(e,t.entity,n.field)&&yE(e,i,n.targetField)}function mE(e,t,n){return e.entities.find(r=>r.name===t)?.props[n]?.optional===!0}function yE(e,t,n){return e.entities.find(r=>r.name===t)?.identity.includes(n)===!0}function gE(e,t,n){let r=n.get(t.targetAlias);if(r==null)return[];let i=lm(e.alias,e.entity),o=lm(t.targetAlias,r);return[{holds:rr({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:r,targetField:t.targetField},when:rr({entities:[i]})}]}function lm(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function um(e,t){let n=[...t.entities].flatMap(([o,s])=>[...s].map(([a,l])=>bE({entity:o,key:a,pre:e,row:l}))),r=[...e.entities].flatMap(([o,s])=>[...s].flatMap(([a,l])=>SE({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:[...n,...r],singletons:i}}function bE({entity:e,key:t,pre:n,row:r}){let i=wE(n.entities.get(e),t),o=Object.entries(r).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 SE({entity:e,key:t,post:n,row:r}){if(n.entities.get(e)?.has(t)===!0)return[];let i=Object.entries(r).map(([o,s])=>({changed:!1,field:o,value:s}));return[{changed:!0,entity:e,fields:i,key:t,status:"deleted"}]}function wE(e,t){return e?.get(t)}function Wo(e,t,n){return t.steps.map(r=>({effect:r.effect,pendingChecks:r.pendingChecks.map(i=>({budget:i.budget,check:{kind:"poll",run:()=>n.evaluate(i.check)},source:{check:i.check,kind:"step"},targetIds:()=>n.locateIds(zo(i.check))})),reconcile:r.reconcile,source:r.source,step:{action:r.action,intent:e.intent,test:e.test},sync:e.wait,verifyChanges:r.verifyChanges,perform:()=>n.perform(r.action),requiredState:()=>!0,targetIds:()=>n.locateIds(r.action.locator)}))}function zo(e){if(e.kind==="not")return zo(e.inner);if(e.kind!=="browser")return e.locator}async function bu(e,t){let{params:n,transition:r}=e.stepRun,i=$o(r,e.state,n);if(i==null){let s={intent:r.intent,kind:"unrunnable",reason:Kp(r,e.state,n),test:r.test};return{label:Tt(r),next:e.state,result:{finalModel:e.state.snapshot,findings:[s]}}}let o=await Ao({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,pageRulePendingChecks:xE(e.pageRules,e.dataRules,e.driver),steps:Wo(e.stepRun.transition,i.resolved,e.driver),stopAfterStep:e.stopAfterStep==null?void 0:e.stopAfterStep-e.stepBase},t);return{label:Tt(e.stepRun.transition),next:{snapshot:o.finalModel},result:o}}function cm(e,t){return Vo(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},source:{dataRule:e,kind:"data-rule"},targetIds:()=>Promise.resolve([])}]:[]}function xE(e,t,n){return(r,i)=>[...e.flatMap(o=>vE(o,r,i,n)),...t.flatMap(o=>cm(o,i))]}function vE(e,t,n,r){let i=Uo(e,t,n);return i==null?[]:[{budget:"fast",check:{kind:"poll",run:()=>r.evaluate(i.check)},source:{check:i.check,kind:"page-rule",origin:e.origin},targetIds:()=>r.locateIds(zo(i.check))}]}function ai(e,t){return gu({acc:{findings:[],ran:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function gu({acc:e,index:t,params:n,signal:r,state:i,stepBase:o}){ot(r);let s=n.sequence[t];if(s==null)return e;let a=Date.now(),l=[],u=await bu({canon:n.canon,classify:n.classify,dataRules:n.dataRules,driver:n.driver,onAssertion:n.onAssertion,pageRules:n.pageRules,state:i,stepBase:o,stepRun:s,stopAfterStep:n.stopAfterStep,onStep:d=>{l.push(d.index),n.onEvent({annotations:d.annotations,endMs:d.endMs,findings:d.findings,index:o+d.index,kind:"step",source:d.source,startMs:d.startMs,state:um(d.pre,d.post),url:d.url})}},r);if(u==null)return gu({acc:e,index:t+1,params:n,signal:r,state:i,stepBase:o});n.onEvent({endMs:Date.now(),intent:s.transition.intent,kind:"ran",startMs:a}),u.result.findings.forEach(d=>{n.onEvent({finding:d,kind:"finding"})});let c={findings:[...e.findings,...u.result.findings],ran:[...e.ran,u.label]};return u.result.findings.length>0||n.stopAfterStep!=null&&o+l.length>=n.stopAfterStep?c:gu({acc:c,index:t+1,params:n,signal:r,state:u.next,stepBase:o+l.length})}var li={value:e=>RE(e)};function qo(e,t){return{value:n=>e.value({...n,seed:`${t}:${n.seed}`})}}function Yo(e,t){return{value:n=>e.value({...n,anchor:t})}}function RE({anchor:e,constraints:t,generator:n,nullable:r,seed:i,type:o,values:s,valueSpace:a}){let l=Su(`${a}:${i}`);return r&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:n==="date.iso"?AE({anchor:e,constraints:t,n:l,timeHash:Su(`${a}:${i}#tod`)}):o==="number"?CE(l,t):o==="boolean"?l%2===0:ME(n,l)}var Go=864e5;function AE({anchor:e,constraints:t,n,timeHash:r}){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+n%o,a=Math.floor(i/Go)*Go;return new Date(a+s*Go+r%Go).toISOString()}function Su(e,t=0,n=7){return t>=e.length?n>>>0:Su(e,t+1,n*31+(e.codePointAt(t)??0)>>>0)}function CE(e,t){if(t?.kind!=="number"||t.min==null||t.max==null)throw new Error("number value space requires min and max constraints");let n=t.max-t.min+1;return n<=0?t.min:t.min+e%n}var EE=["ada","bruno","carmen","dario","elena","felix","greta","hugo","iris","jonas","kira","lena","mateo","nadia","oscar","petra","quinn","rosa","stefan","tara","ugo","vera","wim","yara"],kE=["abreu","berg","costa","duval","eriksen","fischer","garza","holm","ito","jansen","kovac","laurent","moreau","novak","okafor","petrov","quist","rossi","sato","tanaka","ueda","vargas","weber","zhang"],PE=["amber","brisk","calm","deep","early","fond","glad","hazel","ivory","jade","keen","lush","mauve","noble","opal","plum","quiet","rapid","sage","teal","umber","vivid","warm","zesty"],IE=["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 Ho(e,t){let n=e[t%e.length];if(n==null)throw new Error("empty word list");return n}function Ko(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function ME(e,t){let n=Ho(EE,t),r=Ho(kE,Math.floor(t/31)),i=Ho(PE,t),o=Ho(IE,Math.floor(t/29));return e==="internet.email"?`${n}.${r}${String(t%100)}@test.ripplo.ai`:e==="internet.url"?`https://${i}-${o}.example.com`:e==="person.fullName"?`${Ko(n)} ${Ko(r)}`:e==="company.name"?`${Ko(i)} ${Ko(o)}`:e==="lorem.slug"?`${i}-${o}`:`${o}-${String(t%1e3)}`}var le=tl(hm(),1),ke={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))},$E={assertion:le.default.yellow,consistency:le.default.magenta,"data rule":le.default.yellow,driver:le.default.red,"impossible action":le.default.cyan,"page rule":le.default.yellow,skipped:le.default.red};function yt(e){return`${le.default.red(le.default.bold("\u2717"))} ${$E[e](le.default.bold(e))}`}var _E=le.default.red("\u2717"),vj=le.default.green("\u2713"),LE=le.default.dim("\u203A"),DE=8;function pm(e,t,n){let r=n==null?"":` ${ke.dim(n)}`;return` ${ke.dim(e.padStart(DE))} ${t}${r}`}function _n(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${_n(e.scope)} \u25B8 ${_n(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function ts(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${_n(e.locator)}`:e.kind}function zt(e){if(e.kind==="not")return`not ${zt(e.inner)}`;if(e.kind==="browser"){let t=Ke(e.key);return e.value===null?`${t} absent`:`${t}="${e.value}"`}return e.kind==="value"||e.kind==="text"?`${e.kind} ${_n(e.locator)}="${e.value}"`:`${e.kind} ${_n(e.locator)}`}function or(e){let{field:t,source:n,target:r,targetField:i}=e.reference;return`${n}.${t} \u2192 ${r}.${i}`}function Gt(e){return`${e.intent} \u203A ${ts(e.action)}`}function xu(e){return e.kind==="data-rule"?`data rule ${or(e.dataRule)}`:`${e.kind} ${zt(e.check)}`}function ee(e){return e==null?"\u2205":JSON.stringify(e)}function vu(e){return e.kind==="unexpected-row"?`${e.entity} "${e.key}" present in the app but the test expected none`:e.kind==="missing-row"?`${e.entity} "${e.key}" expected by the test but missing in the app`:e.kind==="wrong-value"?`${e.entity}.${e.field} [${e.key}] expected=${ee(e.snapshot)} actual=${ee(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${ee(e.value)}`:e.kind==="browser-mismatch"?`${Ke(e.key)} expected=${ee(e.snapshot)} actual=${ee(e.sut)}`:`${e.singleton} expected=${ee(e.snapshot)} actual=${ee(e.sut)}`}function ns(e){return{label:xu(e.source),step:Gt(e.step)}}function rs({evidencePath:e,finding:t}){let n=BE(t);return e==null?n:`${n} Evidence: ${ke.path(e)}`}function Ru(e){return UE(jE(e))}function BE(e){return e.kind==="consistency"?YE(e):e.kind==="pending-check"?JE(e.source,e.step,e.budget):e.kind==="impossible-action"?`${yt("impossible action")} The step "${e.step.intent}" ran ${ts(e.step.action)} from a state the test says can't happen. Either the test's required state is stricter than the app really is, or the app exposes this action somewhere it shouldn't \u2014 check which before loosening the test.`:e.kind==="unrunnable"?`${yt("skipped")} The planned step "${e.intent}" could not run \u2014 ${mm(e.reason)}. A planned move was skipped, so this run proved less than it claims \u2014 fix the plan or the starting state rather than ignoring the skip.`:`${yt("driver")} The browser failed while running "${e.step.intent}" \u2014 ${un(e.error)}. This is an environment failure (daemon, dev server, ports), not an app or test bug \u2014 fix the run environment and rerun.`}var FE=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function UE(e){return e.replaceAll(FE,"").replaceAll(/\s+/g," ").trim()}function jE(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${vu(e.mismatch)}${t}`}return e.kind==="pending-check"?`${ek(e.source)} failed at "${e.step.intent}": ${tk(e.source)}`:e.kind==="impossible-action"?`"${e.step.intent}" ran from a state the test says can't happen`:e.kind==="unrunnable"?`planned step "${e.intent}" could not run \u2014 ${mm(e.reason)}`:`driver failed at "${e.step.intent}": ${un(e.error)}`}var VE={"no-effect":"the action has no observable effect from this state","required-state-unsatisfied":"the live state doesn't satisfy the step's required state",unresolvable:"a step references a value that doesn't exist yet (e.g. a not-yet-created id)"};function mm(e){return VE[e]}function ym({debugDir:e,runId:t}){let n=`${e}/${t}`;return pm("behavior",ke.path(`${n}/behavior.jsonl`),void 0)}function gm(e){if(e.kind==="cascade-gap"){let{gap:n}=e;return`${yt("data rule")} ${n.transition} deletes ${n.target} but leaves ${n.source} rows pointing at the deleted row. That breaks the data rule ${or(n.dataRule)} \u2014 cascade the delete in the app or declare the cleanup on the deleting step.`}if(e.kind==="create-gap"){let{gap:n}=e,r=n.missing.length===1?"field":"fields",i=n.missing.length===1?"it":"them";return`${yt("data rule")} ${n.transition} creates ${n.entity} without setting the required ${r} ${n.missing.join(", ")}. Set ${i} on the creating step or drop the requirement from the entity.`}let{conflict:t}=e;return`${yt("page rule")} Two page rules contradict each other \u2014 ${t.a.kind} vs ${t.b.kind} when ${JSON.stringify(t.when.singletons)}. They were learned from different tests asserting opposite things about the same page \u2014 one of those tests is wrong, fix it before trusting either rule.`}function bm(e){return"locator"in e&&e.locator!=null?`${e.kind} ${Qo(e.locator)}`:"url"in e?`${e.kind} ${WE(e.url)}`:e.kind}function WE(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:xm(e)}function Jo(e){return e.kind==="not"?`not ${Jo(e.predicate)}`:e.kind==="and"?e.predicates.map(t=>Jo(t)).join(" \u2227 "):e.kind==="when"?e.branches.map(t=>t.name).join(" | "):zE(e)}function Sm(e){let t=e.browser.path;return t==null?"(any view)":typeof t!="object"?String(t):"template"in t?t.template.map(n=>typeof n=="string"?n:":id").join(""):`{${t.ref}}`}function wm(e){let t=[...e.entities.map(n=>GE(n)),...Mn(e.browser).filter(n=>n.key.kind!=="path").map(n=>`${Ke(n.key)}=${pn(n.clause)}`),...Object.entries(e.singletons).map(([n,r])=>`${n}=${pn(r)}`)];return t.length===0?"always":t.join(" \u2227 ")}function zE(e){if("locator"in e){let t=Qo(e.locator);return e.kind==="value"||e.kind==="text"?`${e.kind} ${t}=${pn(e.value)}`:`${e.kind} ${t}`}return e.kind==="browser"?`${e.name}=${pn(e.value)}`:e.kind==="singleton"?`${e.singleton}=${pn(e.assertion.value)}`:e.kind==="count"?`${e.entity} count ${String(e.value)}`:""}function Qo(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${pn(e.name)}`:e.by==="inside"?`${Qo(e.scope)} \u25B8 ${Qo(e.target)}`:pn(e.value)}function pn(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:xm(e)}function xm(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function GE(e){let t=Object.entries(e.literals).map(([n,r])=>`${n}=${pn(r)}`);return t.length===0?e.entity:`${e.entity}(${t.join(", ")})`}function es(e){return e==null?"At the end of the run":`After ${KE(e.action)} in ${e.intent}`}var HE={click:"clicking",fill:"filling",goto:"opening",hover:"hovering over",press:"pressing",select:"selecting",upload:"uploading to"};function KE(e){return e.url!=null?`opening ${e.url}`:e.locator!=null?`${HE[e.kind]??e.kind} ${ir(e.locator)}`:e.kind}function ir(e){return e.by==="testId"?`the element with testId "${e.value}"`:e.by==="inside"?`${ir(e.target)} inside ${ir(e.scope)}`:e.name==null?`the ${e.role}`:`the "${e.name}" ${e.role}`}function qE(e){return e.kind==="not"&&e.inner.kind==="visible"?`${ir(e.inner.locator)} never disappeared`:e.kind==="visible"?`${ir(e.locator)} never appeared`:e.kind==="value"||e.kind==="text"?`${ir(e.locator)} never showed "${e.value}"`:`the check ${zt(e)} never held`}function YE(e){let t=e.pending?ZE(e):XE(e.mismatch,e.step);return`${yt("consistency")} ${t}`}function ZE(e){let t=`${vm(e.budget)} wait window`,n="If this write is legitimately slow, declare wait: on the expectation or move it to a slower tier.",{mismatch:r}=e,i=es(e.step);return r.kind==="wrong-value"?`${i}, ${r.entity}.${r.field} on row "${r.key}" never changed within the ${t} \u2014 it still showed ${ke.actual(ee(r.sut))} instead of ${ke.expected(ee(r.snapshot))}, so the write may not have landed at all. ${n}`:r.kind==="unexpected-row"?`${i}, the ${r.entity} row "${r.key}" was still there at the end of the ${t} \u2014 the delete may not have landed. ${n}`:r.kind==="missing-row"?`${i}, the ${r.entity} row "${r.key}" never appeared within the ${t} \u2014 the create may not have landed. ${n}`:r.kind==="expected-change"?`${i}, ${r.entity}.${r.field} on row "${r.key}" was expected to change but stayed ${ke.actual(ee(r.value))} through the ${t}, so the write may not have landed at all. ${n}`:r.kind==="browser-mismatch"?`${i}, ${Ke(r.key)} never changed within the ${t} \u2014 it still showed ${ke.actual(ee(r.sut))} instead of ${ke.expected(ee(r.snapshot))}, so the write may not have landed at all. ${n}`:`${i}, ${r.singleton} never changed within the ${t} \u2014 it still showed ${ke.actual(ee(r.sut))} instead of ${ke.expected(ee(r.snapshot))}, so the write may not have landed at all. ${n}`}function vm(e){return`${String(Vt[e]/1e3)}s`}function XE(e,t){let n=es(t);return e.kind==="wrong-value"?`${n}, ${e.entity}.${e.field} on row "${e.key}" showed ${ke.actual(ee(e.sut))} but the test expected ${ke.expected(ee(e.snapshot))}. This is an app bug if the expected value is the promised behavior \u2014 if the app legitimately owns this value, assert changed() instead.`:e.kind==="singleton-mismatch"?`${n}, ${e.singleton} showed ${ke.actual(ee(e.sut))} but the test expected ${ke.expected(ee(e.snapshot))}. This is an app bug if the expected value is the promised behavior \u2014 otherwise correct the expected value at the step that sets it.`:e.kind==="unexpected-row"?`${n}, the app held a ${e.entity} row "${e.key}" the test never expected. Some step writes this row without declaring it \u2014 declare the effect on the acting step (${e.entity}.created, updated, or deleted), or if this write belongs to a different flow, cover it in that flow's test.`:e.kind==="missing-row"?`${n}, the test expected a ${e.entity} row "${e.key}" but the app had none. This is an app bug if the write was promised \u2014 if it only happens from a different starting state, restrict this test's given and cover that state in its own test.`:e.kind==="browser-mismatch"?`${n}, ${Ke(e.key)} showed ${ke.actual(ee(e.sut))} but the test expected ${ke.expected(ee(e.snapshot))}. This is an app bug if the expected value is the promised behavior \u2014 otherwise correct the expected value at the step that sets it.`:`${n}, ${e.entity}.${e.field} on row "${e.key}" was expected to change but stayed ${ke.actual(ee(e.value))}. This is an app bug if this action should change it \u2014 if the change needs other preconditions, split that case into its own test with the right given.`}function JE(e,t,n){let r=`${vm(n)} wait window`;if(e.kind==="data-rule")return`${yt("data rule")} ${es(t)}, the data rule ${or(e.dataRule)} stopped holding \u2014 a referenced row went missing. This is an app bug if the reference should survive this action \u2014 confirm in behavior.jsonl before relaxing the rule.`;if(e.kind==="page-rule")return`${yt("page rule")} A page rule learned from ${QE(e.origin)} says ${zt(e.check)} at this URL \u2014 it never held here within the ${r}. Either the rule is broader than the app guarantees or this page regressed \u2014 confirm in behavior.jsonl before narrowing the rule.`;let i=`${yt("assertion")} ${es(t)}, ${qE(e.check)} within the ${r}.`;return t.action.locator!=null?`${i} If the page never changed after this action \u2014 the recording goes quiet right after it \u2014 the interaction was likely lost: its target re-rendered or unmounted as it fired, so the click landed on nothing. That is an unstable-render bug in the app, not a missing element. Otherwise it is a wrong accessible name, a UI regression, or a starting state this page doesn't have. Confirm in behavior.jsonl before changing the test.`:`${i} This is usually a wrong accessible name, a UI regression, or a starting state this page doesn't have \u2014 confirm in behavior.jsonl before changing the test.`}function QE(e){return e==null?"another workflow":e.kind==="test"?`an assertion in test "${e.test}"`:e.kind==="trigger"?`the trigger of "${e.intent}" in test "${e.test}"`:`tests ${e.tests.map(n=>JSON.stringify(n)).join(", ")}`}function ek(e){return e.kind==="data-rule"?"data rule":e.kind==="page-rule"?"page rule":"assertion"}function tk(e){return e.kind==="data-rule"?or(e.dataRule):zt(e.check)}function ui(e){return{dataRules:jo(e),pageRules:Do(e)}}var Rm=Object.defineProperty,Am=(e,t)=>{let n={};for(var r in e)Rm(n,r,{get:e[r],enumerable:!0});return t||Rm(n,Symbol.toStringTag,{value:"Module"}),n};var nk=class Cm{constructor(t){this.seed=t}clone(){return new Cm(this.seed)}next(){let t=Au(this.seed),n=Cu(t),r=Au(t),i=Cu(r);return this.seed=Au(r),Cu(this.seed)+(i+(n<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function Au(e){return Math.imul(e,214013)+2531011&4294967295}function Cu(e){return(e&-2147483649)>>16}function Em(e){return new nk(e)}var rk="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",ik=class Pm{constructor(t,n){this.states=t,this.index=n}clone(){return new Pm(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=is(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),n=this.index;this.index=is(this.states,this.index);for(let r=19932;r>0;--r)rk.charCodeAt(r/6|0)-48&1<<r%6&&km(this.states,this.index,t,n),this.index=is(this.states,this.index);km(this.states,this.index,t,n)}};function km(e,t,n,r){let i=0;if(r>=t){for(;i<624-r;i++)e[i+t]^=n[i+r];for(;i<624-t;i++)e[i+t]^=n[i+r-624];for(;i<624;i++)e[i+t-624]^=n[i+r-624]}else{for(;i<624-t;i++)e[i+t]^=n[i+r];for(;i<624-r;i++)e[i+t-624]^=n[i+r];for(;i<624;i++)e[i+t-624]^=n[i+r-624]}}function is(e,t){if(t<227){let n=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397]^n>>>1^-(n&1)&2567483615,t+1}else if(t<623){let n=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397-624]^n>>>1^-(n&1)&2567483615,t+1}else{let n=e[t]&2147483648|e[0]&2147483647;return e[t]=e[396]^n>>>1^-(n&1)&2567483615,0}}function ok(e){for(let t=0;t!==624;++t)is(e,t)}function Im(e){let t=[e|0];for(let n=1;n!==624;++n){let r=t[n-1]^t[n-1]>>>30;t.push(Math.imul(1812433253,r)+n|0)}return ok(t),new ik(t,0)}var sk=class Mm{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new Mm(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00^this.s00<<23,n=this.s01^(this.s01<<23|this.s00>>>9),r=t^this.s10^(t>>>18|n<<14)^(this.s10>>>5|this.s11<<27),i=n^this.s11^n>>>18^this.s11>>>5,o=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=i,this.s10=r,o}jump(){let t=0,n=0,r=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,n^=this.s00,r^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=n,this.s11=r,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Eu(e){return new sk(-1,~e,e|0,0)}var ak=class Tm{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new Tm(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00+this.s10|0,n=this.s10^this.s00,r=this.s11^this.s01,i=this.s00,o=this.s01;return this.s00=i<<24^o>>>8^n^n<<16,this.s01=o<<24^i>>>8^r^(r<<16|n>>>16),this.s10=r<<5^n>>>27,this.s11=n<<5^r>>>27,t}jump(){let t=0,n=0,r=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,n^=this.s00,r^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=n,this.s11=r,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Om(e){return new ak(-1,~e,e|0,0)}function Nm(e,t){for(let n=0;n!==t;++n)e.next()}var $m=BigInt,lk=4294967296n;function Lm(e,t,n){let r=n-t+1n,i=lk,o=1;for(;i<r;)i<<=32n,++o;let s=_m(o,e);if(s<r)return s+t;if(s+r<i)return s%r+t;let a=i-i%r;for(;s>=a;)s=_m(o,e);return s%r+t}function _m(e,t){let n=$m(t.next()+2147483648);for(let r=1;r<e;++r){let i=t.next();n=(n<<32n)+$m(i+2147483648)}return n}function ci(e,t){let n=t>2?~~(4294967296/t)*t:4294967296,r=e.next()+2147483648;for(;r>=n;)r=e.next()+2147483648;return r%t}function ku(e,t){if(t<0){let n=-t;e.sign=-1,e.data[0]=~~(n/4294967296),e.data[1]=n>>>0}else e.sign=1,e.data[0]=~~(t/4294967296),e.data[1]=t>>>0;return e}function uk(e,t,n){let r=t.data[1],i=t.data[0],o=t.sign,s=n.data[1],a=n.data[0],l=n.sign;if(e.sign=1,o===1&&l===-1){let m=r+s,y=i+a+(m>4294967295?1:0);return e.data[0]=y>>>0,e.data[1]=m>>>0,e}let u=r,c=i,d=s,f=a;o===-1&&(u=s,c=a,d=r,f=i);let p=0,h=u-d;return h<0&&(p=1,h=h>>>0),e.data[0]=c-f-p,e.data[1]=h,e}function ck(e,t,n){let r=n[0]+1;for(t[0]=ci(e,r),t[1]=ci(e,4294967296);t[0]>=n[0]&&(t[0]!==n[0]||t[1]>=n[1]);)t[0]=ci(e,r),t[1]=ci(e,4294967296);return t}var dk=Number.MAX_SAFE_INTEGER,fk={sign:1,data:[0,0]},hk={sign:1,data:[0,0]},Dm={sign:1,data:[0,0]},Pu=[0,0];function pk(e,t,n,r){let i=r<=dk?ku(Dm,r):uk(Dm,ku(fk,n),ku(hk,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,ck(e,Pu,i.data),Pu[0]*4294967296+Pu[1]+t}function os(e,t,n){let r=n-t;return r<=4294967295?ci(e,r+1)+t:pk(e,t,n,r)}var Bm=Symbol.for("fast-check/PreconditionFailure"),xn=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=Bm}static isFailure(e){return e!=null&&e.footprint===Bm}};function mk(e){if(!e)throw new xn}var yk=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},gk=new yk;function bk(){return gk}function*Sk(e,t){for(let n of e)yield t(n)}function*wk(e,t){for(let n of e)yield*t(n)}function*xk(e,t){for(let n of e)t(n)&&(yield n)}function*vk(e,t){for(let n=0;n<t;++n){let r=e.next();if(r.done)break;yield r.value}}function*Rk(e,t){let n=e.next();for(;!n.done&&t(n.value);)yield n.value,n=e.next()}function*Ak(e,t){for(let n=e.next();!n.done;n=e.next())yield n.value;for(let n of t)for(let r=n.next();!r.done;r=n.next())yield r.value}var Ck=Symbol.iterator,D=class Ht{static nil(){return new Ht(bk())}static of(...t){return new Ht(t[Ck]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Ht(Sk(this.g,t))}flatMap(t){return new Ht(wk(this.g,t))}dropWhile(t){let n=!1;function*r(i){(n||!t(i))&&(n=!0,yield i)}return this.flatMap(r)}drop(t){if(t<=0)return this;let n=0;function r(){return n++<t}return this.dropWhile(r)}takeWhile(t){return new Ht(Rk(this.g,t))}take(t){return new Ht(vk(this.g,t))}filter(t){return new Ht(xk(this.g,t))}every(t){for(let n of this.g)if(!t(n))return!1;return!0}has(t){for(let n of this.g)if(t(n))return[!0,n];return[!1,null]}join(...t){return new Ht(Ak(this.g,t))}getNthOrLast(t){let n=t,r=null;for(let i of this.g){if(n--===0)return i;r=i}return r}};function Sn(e){return new D(e)}var Oe=Symbol.for("fast-check/cloneMethod");function Dn(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Oe in e&&typeof e[Oe]=="function"}function cr(e){return Dn(e)?e[Oe]():e}var Ek=Object.defineProperty,O=class{constructor(e,t,n){this.value_=e,this.context=t,this.hasToBeCloned=n!==void 0||Dn(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&Ek(this,"value",{get:n!==void 0?n:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[Oe]():(this.readOnce=!0,this.value_):this.value_}},he=class{filter(e){return new Ik(this,e)}map(e,t){return new Pk(this,e,t)}chain(e){return new kk(this,e)}},kk=class extends he{constructor(e,t){super(),this.arb=e,this.chainer=t}generate(e,t){let n=e.clone(),r=this.arb.generate(e,t);return this.valueChainer(r,e,n,t)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?(t.stoppedForOriginal?D.nil():this.arb.shrink(t.originalValue,t.originalContext).map(n=>this.valueChainer(n,t.clonedMrng.clone(),t.clonedMrng,t.originalBias))).join(t.chainedArbitrary.shrink(e,t.chainedContext).map(n=>{let r={...t,chainedContext:n.context,stoppedForOriginal:!0};return new O(n.value_,r)})):D.nil()}valueChainer(e,t,n,r){let i=this.chainer(e.value_),o=i.generate(t,r),s={originalBias:r,originalValue:e.value_,originalContext:e.context,stoppedForOriginal:!1,chainedArbitrary:i,chainedContext:o.context,clonedMrng:n};return new O(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}},Pk=class extends he{constructor(e,t,n){super(),this.arb=e,this.mapper=t,this.unmapper=n,this.bindValueMapper=r=>this.valueMapper(r)}generate(e,t){let n=this.arb.generate(e,t);return this.valueMapper(n)}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 n=this.unmapper(e);return this.arb.shrink(n,void 0).map(this.bindValueMapper)}return D.nil()}mapperWithCloneIfNeeded(e){let t=e.value,n=this.mapper(t);return e.hasToBeCloned&&(typeof n=="object"&&n!==null||typeof n=="function")&&Object.isExtensible(n)&&!Dn(n)&&Object.defineProperty(n,Oe,{get:()=>()=>this.mapperWithCloneIfNeeded(e)[0]}),[n,t]}valueMapper(e){let[t,n]=this.mapperWithCloneIfNeeded(e);return new O(t,{originalValue:n,originalContext:e.context})}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalValue"in e&&"originalContext"in e}},Ik=class extends he{constructor(e,t){super(),this.arb=e,this.refinement=t,this.bindRefinementOnValue=n=>this.refinementOnValue(n)}generate(e,t){for(;;){let n=this.arb.generate(e,t);if(this.refinementOnValue(n))return n}}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 Bg(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function Fg(e){if(!Bg(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Ug=Function.prototype.apply,Iu=Symbol("apply");function Mk(e){try{return e.apply}catch{return}}function Tk(e,t,n){let r=e;r[Iu]=Ug;let i=r[Iu](t,n);return delete r[Iu],i}function K(e,t,n){return Mk(e)===Ug?e.apply(t,n):Tk(e,t,n)}var jg=Array,k=BigInt,Ok=BigInt64Array,Nk=BigUint64Array,Vg=Boolean,ws=Date,M=Error,Wg=Float32Array,zg=Float64Array,$k=Int8Array,_k=Int16Array,Lk=Int32Array,qt=Number,Ue=String,dr=Set,Dk=Uint8Array,Bk=Uint8ClampedArray,Fk=Uint16Array,Uk=Uint32Array,jk=encodeURIComponent,Yt=Map,hs=Symbol,Fm=Array.prototype.forEach,Um=Array.prototype.indexOf,jm=Array.prototype.join,Vm=Array.prototype.map,Wm=Array.prototype.flat,zm=Array.prototype.filter,Gm=Array.prototype.push,Hm=Array.prototype.pop,Km=Array.prototype.splice,qm=Array.prototype.slice,Ym=Array.prototype.sort,Zm=Array.prototype.every;function Vk(e){try{return e.forEach}catch{return}}function Wk(e){try{return e.indexOf}catch{return}}function zk(e){try{return e.join}catch{return}}function Gk(e){try{return e.map}catch{return}}function Hk(e){try{return e.flat}catch{return}}function Kk(e){try{return e.filter}catch{return}}function qk(e){try{return e.push}catch{return}}function Yk(e){try{return e.pop}catch{return}}function Zk(e){try{return e.splice}catch{return}}function Xk(e){try{return e.slice}catch{return}}function Jk(e){try{return e.sort}catch{return}}function Qk(e){try{return e.every}catch{return}}function Gg(e,t){return Vk(e)===Fm?e.forEach(t):K(Fm,e,[t])}function Kt(e,...t){return Wk(e)===Um?e.indexOf(...t):K(Um,e,t)}function fe(e,...t){return zk(e)===jm?e.join(...t):K(jm,e,t)}function W(e,t){return Gk(e)===Vm?e.map(t):K(Vm,e,[t])}function e2(e,t){return Hk(e)===Wm?([].flat(),e.flat(t)):K(Wm,e,[t])}function t2(e,t){return Kk(e)===zm?e.filter(t):K(zm,e,[t])}function T(e,...t){return qk(e)===Gm?e.push(...t):K(Gm,e,t)}function Hg(e){return Yk(e)===Hm?e.pop():K(Hm,e,[])}function Kg(e,...t){return Zk(e)===Km?e.splice(...t):K(Km,e,t)}function _e(e,...t){return Xk(e)===qm?e.slice(...t):K(qm,e,t)}function qg(e,...t){return Jk(e)===Ym?e.sort(...t):K(Ym,e,t)}function Yg(e,...t){return Qk(e)===Zm?e.every(...t):K(Zm,e,t)}var Xm=Date.prototype.getTime,Jm=Date.prototype.toISOString;function n2(e){try{return e.getTime}catch{return}}function r2(e){try{return e.toISOString}catch{return}}function xs(e){return n2(e)===Xm?e.getTime():K(Xm,e,[])}function i2(e){return r2(e)===Jm?e.toISOString():K(Jm,e,[])}var Qm=Set.prototype.add,ey=Set.prototype.has;function o2(e){try{return e.add}catch{return}}function s2(e){try{return e.has}catch{return}}function mi(e,t){return o2(e)===Qm?e.add(t):K(Qm,e,[t])}function vs(e,t){return s2(e)===ey?e.has(t):K(ey,e,[t])}var ty=WeakMap.prototype.set,ny=WeakMap.prototype.get;function a2(e){try{return e.set}catch{return}}function l2(e){try{return e.get}catch{return}}function u2(e,t,n){return a2(e)===ty?e.set(t,n):K(ty,e,[t,n])}function c2(e,t){return l2(e)===ny?e.get(t):K(ny,e,[t])}var ry=Map.prototype.set,iy=Map.prototype.get,oy=Map.prototype.has;function d2(e){try{return e.set}catch{return}}function f2(e){try{return e.get}catch{return}}function h2(e){try{return e.has}catch{return}}function gt(e,t,n){return d2(e)===ry?e.set(t,n):K(ry,e,[t,n])}function it(e,t){return f2(e)===iy?e.get(t):K(iy,e,[t])}function p2(e,t){return h2(e)===oy?e.has(t):K(oy,e,[t])}var sy=String.prototype.split,ay=String.prototype.startsWith,ly=String.prototype.endsWith,uy=String.prototype.substring,cy=String.prototype.toLowerCase,dy=String.prototype.toUpperCase,fy=String.prototype.padStart,hy=String.prototype.charCodeAt,py=String.prototype.normalize,my=String.prototype.replace;function m2(e){try{return e.split}catch{return}}function y2(e){try{return e.startsWith}catch{return}}function g2(e){try{return e.endsWith}catch{return}}function b2(e){try{return e.substring}catch{return}}function S2(e){try{return e.toLowerCase}catch{return}}function w2(e){try{return e.toUpperCase}catch{return}}function x2(e){try{return e.padStart}catch{return}}function v2(e){try{return e.charCodeAt}catch{return}}function R2(e){try{return e.normalize}catch{return}}function A2(e){try{return e.replace}catch{return}}function je(e,...t){return m2(e)===sy?e.split(...t):K(sy,e,t)}function C2(e,...t){return y2(e)===ay?e.startsWith(...t):K(ay,e,t)}function E2(e,...t){return g2(e)===ly?e.endsWith(...t):K(ly,e,t)}function be(e,...t){return b2(e)===uy?e.substring(...t):K(uy,e,t)}function ec(e){return S2(e)===cy?e.toLowerCase():K(cy,e,[])}function Ec(e){return w2(e)===dy?e.toUpperCase():K(dy,e,[])}function k2(e,...t){return x2(e)===fy?e.padStart(...t):K(fy,e,t)}function fr(e,t){return v2(e)===hy?e.charCodeAt(t):K(hy,e,[t])}function P2(e,t){return R2(e)===py?e.normalize(t):K(py,e,[t])}function I2(e,t,n){return A2(e)===my?e.replace(t,n):K(my,e,[t,n])}var yy=Number.prototype.toString;function M2(e){try{return e.toString}catch{return}}function yi(e,...t){return M2(e)===yy?e.toString(...t):K(yy,e,t)}var T2=Object.prototype.hasOwnProperty,O2=Object.prototype.toString;function Zg(e,t){return K(T2,e,[t])}function tc(e){return K(O2,e,[])}var N2=Error.prototype.toString;function $2(e){return K(N2,e,[])}var _2=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 bn(e){return new _2(e)}var Xg=Array.isArray,L2=Object.defineProperty;function Jg(e,t){return L2(e,Oe,{value:()=>{let n=[];for(let r=0;r!==t.length;++r)T(n,t[r].value);return Jg(n,t),n}})}function Qg(e){let t=!1,n=[],r=[];for(let i=0;i!==e.length;++i){let o=e[i];t=t||o.hasToBeCloned,T(n,o.value),T(r,o.context)}return t&&Jg(n,e),new O(n,r)}function eb(e,t,n){let r=[],i=Xg(n)?n:[];for(let o=0;o!==e.length;++o)T(r,bn(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=W(t,(l,u)=>new O(cr(l),i[u]));return[..._e(a,0,o),s,..._e(a,o+1)]}).map(Qg)));return D.nil().join(...r)}var D2=class extends he{constructor(e){super(),this.arbs=e;for(let t=0;t!==e.length;++t){let n=e[t];if(n==null||n.generate===null||n.generate===void 0)throw new Error(`Invalid parameter encountered at index ${t}: expecting an Arbitrary`)}}generate(e,t){let n=[];for(let r=0;r!==this.arbs.length;++r)T(n,this.arbs[r].generate(e,t));return Qg(n)}canShrinkWithoutContext(e){if(!Xg(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 eb(this.arbs,e,t)}};function B(...e){return new D2(e)}var B2=Math.log;function tb(e){return 2+~~(B2(e+1)*.4342944819032518)}var kc={};function F2(e){kc=e}function bt(){return kc}function U2(){kc={}}var gi=Symbol("UndefinedContextPlaceholder");function hr(e){return e.context!==void 0?e:e.hasToBeCloned?new O(e.value_,gi,()=>e.value):new O(e.value_,gi)}var gy=()=>{},j2=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:n,asyncAfterEach:r,beforeEach:i,afterEach:o}=bt()||{};if(n!==void 0&&i!==void 0)throw M(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(r!==void 0&&o!==void 0)throw M(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=n||i||gy,this.afterEachHook=r||o||gy}isAsync(){return!0}generate(e,t){return hr(this.arb.generate(e,t!==void 0?tb(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return D.nil();let t=e.context!==gi?e.context:void 0;return this.arb.shrink(e.value_,t).map(hr)}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 M("Property failed by returning false")}}catch(t){return xn.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}},nb=class extends he{constructor(e){super(),this.arb=e}generate(e,t){return hr(this.arb.generate(e,t))}canShrinkWithoutContext(e){return!0}shrink(e,t){if(t===void 0&&!this.arb.canShrinkWithoutContext(e))return D.nil();let n=t!==gi?t:void 0;return this.arb.shrink(e,n).map(hr)}};function V2(...e){if(e.length<2)throw new Error("asyncProperty expects at least two parameters");let t=_e(e,0,e.length-1),n=e[e.length-1];return Gg(t,Fg),new j2(B(...W(t,r=>new nb(r))),r=>n(...r))}var by=()=>{},rb=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:n=by,afterEach:r=by,asyncBeforeEach:i,asyncAfterEach:o}=bt()||{};if(i!==void 0)throw M(`"asyncBeforeEach" can't be set when running synchronous properties`);if(o!==void 0)throw M(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=n,this.afterEachHook=r}isAsync(){return!1}generate(e,t){return hr(this.arb.generate(e,t!==void 0?tb(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return D.nil();let t=e.context!==gi?e.context:void 0;return this.arb.shrink(e.value_,t).map(hr)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(e){try{let t=this.predicate(e);return t===void 0||t===!0?null:{error:new M("Property failed by returning false")}}catch(t){return xn.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 W2(...e){if(e.length<2)throw new Error("property expects at least two parameters");let t=_e(e,0,e.length-1),n=e[e.length-1];return Gg(t,Fg),new rb(B(...W(t,r=>new nb(r))),r=>n(...r))}var z2=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function nc(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>nc(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>nc(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function ib(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>ib(e),next:()=>e.next(),jump:()=>Nm(e,42),getState:()=>e.getState()}}function Es(e){return ib(nc(e))}var G2=Date.now,H2=Math.min,K2=Math.random,q2=class{constructor(e){let t=e||{};this.seed=Y2(t),this.randomType=Z2(t),this.numRuns=X2(t),this.verbose=J2(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=Tu(t.timeout),this.skipAllAfterTimeLimit=Tu(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=Tu(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:n=>{console.log(n)},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 Mu(e){return t=>Es(e(t))}function Y2(e){if(e.seed===void 0)return G2()^K2()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function Z2(e){if(e.randomType===void 0)return Eu;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return Mu(Im);case"congruential":case"congruential32":return Mu(Em);case"xorshift128plus":return Eu;case"xoroshiro128plus":return Om;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===Es(t)?e.randomType:Mu(e.randomType)}function X2(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function J2(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 Tu(e){if(e!==void 0)return H2(e,2147483647)}function Pc(e){return new q2(e)}function Q2(e,t,n){let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i(new xn(!0))},e)})}}var Sy=class{constructor(e,t,n,r,i,o){this.property=e,this.getTime=t,this.interruptExecution=r,this.setTimeoutSafe=i,this.clearTimeoutSafe=o,this.skipAfterTime=this.getTime()+n}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 n=new xn(this.interruptExecution);return this.isAsync()?Promise.resolve(n):n}if(this.interruptExecution&&this.isAsync()){let n=Q2(t,this.setTimeoutSafe,this.clearTimeoutSafe),r=Promise.race([this.property.run(e),n.promise]);return r.then(n.clear,n.clear),r}return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},eP=(e,t,n)=>{let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i({error:new M(`Property timeout: exceeded limit of ${e} milliseconds`)})},e)})}},tP=class{constructor(e,t,n,r){this.property=e,this.timeMs=t,this.setTimeoutSafe=n,this.clearTimeoutSafe=r}isAsync(){return!0}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}async run(e){let t=eP(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),n=Promise.race([this.property.run(e),t.promise]);return n.then(t.clear,t.clear),n}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},ob=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()}},wy=Array.from,xy=typeof Buffer<"u"?Buffer.isBuffer:void 0,sr=JSON.stringify,vy=Number.isNaN,nP=Object.keys,rP=Object.getOwnPropertySymbols,iP=Object.getOwnPropertyDescriptor,Ry=Object.getPrototypeOf,Ay=Number.NEGATIVE_INFINITY,oP=Number.POSITIVE_INFINITY,St=Symbol.for("fast-check/toStringMethod");function Ic(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&St in e&&typeof e[St]=="function"}var Zt=Symbol.for("fast-check/asyncToStringMethod");function Mc(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Zt in e&&typeof e[Zt]=="function"}var sP=/^Symbol\((.*)\)$/;function aP(e){if(e.description!==void 0)return e.description;let t=sP.exec(Ue(e));return t&&t[1].length?t[1]:null}function Cy(e){switch(e){case 0:return 1/e===Ay?"-0":"0";case Ay:return"Number.NEGATIVE_INFINITY";case oP:return"Number.POSITIVE_INFINITY";default:return e===e?Ue(e):"Number.NaN"}}function lP(e){let t=-1;for(let n in e){let r=Number(n);if(r!==t+1)return!0;t=r}return t+1!==e.length}function rt(e,t,n){let r=[...t,e];if(typeof e=="object"&&Kt(t,e)!==-1)return"[cyclic]";if(Mc(e)){let i=n(e);if(i.state==="fulfilled")return i.value}if(Ic(e))try{return e[St]()}catch{}switch(tc(e)){case"[object Array]":{let i=e;if(i.length>=50&&lP(i)){let s=[];for(let a in i)vy(Number(a))||T(s,`${a}:${rt(i[a],r,n)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${fe(s,",")}})`:`Array(${i.length})`}let o=fe(W(i,s=>rt(s,r,n)),",");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 vy(xs(i))?"new Date(NaN)":`new Date(${sr(i2(i))})`}case"[object Map]":return`new Map(${rt(Array.from(e),r,n)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?Cy(e):`new Number(${Cy(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"?`[${rt(o,r,n)}]`:sr(o)}:${rt(e[o],r,n)}`;return"{"+fe([...Ry(e)===null?["__proto__:null"]:[],...W(nP(e),i),...W(t2(rP(e),o=>{let s=iP(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${rt(Array.from(e),r,n)})`;case"[object String]":return typeof e=="string"?sr(e):`new String(${sr(e)})`;case"[object Symbol]":{let i=e;if(hs.keyFor(i)!==void 0)return`Symbol.for(${sr(hs.keyFor(i))})`;let o=aP(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&hs[o.substring(7)])?o:`Symbol(${sr(o)})`}case"[object Promise]":{let i=n(e);switch(i.state){case"fulfilled":return`Promise.resolve(${rt(i.value,r,n)})`;case"rejected":return`Promise.reject(${rt(i.value,r,n)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(e instanceof Error)return`new Error(${rt(e.message,r,n)})`;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 xy=="function"&&xy(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":rt(wy(e.values()),r,n)})`;let i=Ry(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(${rt(wy(s.values()),r,n)})`}break}}try{return e.toString()}catch{return tc(e)}}function Ae(e){return rt(e,[],()=>({state:"unknown",value:void 0}))}function sb(e){let t=hs(),n=[],r=new Yt;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(r.has(c))return r.get(c);let d=i(),f=Zt in u?Promise.resolve().then(()=>u[Zt]()):u;return f.catch(()=>{}),n.push(Promise.race([f,d.delay]).then(p=>{p===t?r.set(c,{state:"pending",value:void 0}):r.set(c,{state:"fulfilled",value:p}),d.cancel()},p=>{r.set(c,{state:"rejected",value:p}),d.cancel()})),r.set(c,o),o};function a(){let l=rt(e,[],s);return n.length===0?l:Promise.all(n.splice(0)).then(a)}return a()}async function Tc(e){return Promise.resolve(sb(e))}function Ey(e){return e===null?new xn:e}function uP(...e){return e[1]?e[0].then(Ey):Ey(e[0])}function cP(e,t){return uP(e,t)}var ky=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=Ae(e);if(this.coveredCases.has(t)){let r=this.coveredCases.get(t);return this.skipRuns?cP(r,this.property.isAsync()):r}let n=this.property.run(e);return this.coveredCases.set(t,n),n}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},Py=Date.now,Ou=setTimeout,Nu=clearTimeout;function dP(e,t){let n=e;return e.isAsync()&&t.timeout!==void 0&&(n=new tP(n,t.timeout,Ou,Nu)),t.unbiased&&(n=new ob(n)),t.skipAllAfterTimeLimit!==void 0&&(n=new Sy(n,Py,t.skipAllAfterTimeLimit,!1,Ou,Nu)),t.interruptAfterTimeLimit!==void 0&&(n=new Sy(n,Py,t.interruptAfterTimeLimit,!0,Ou,Nu)),t.skipEqualValues&&(n=new ky(n,!0)),t.ignoreEqualValues&&(n=new ky(n,!1)),n}var fP=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),hP=class ab{constructor(t,n){this.verbosity=t,this.interruptedAsFailure=n,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(t,n){let r={status:t,value:n,children:[]};return this.currentLevelExecutionTrees.push(r),r}fail(t,n,r){if(this.verbosity>=1){let i=this.appendExecutionTree(1,t);this.currentLevelExecutionTrees=i.children}this.pathToFailure===void 0?this.pathToFailure=`${n}`:this.pathToFailure+=`:${n}`,this.value=t,this.failure=r}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?+je(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?je(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let t=[],n=this.rootExecutionTrees;for(;n.length>0&&n[n.length-1].status===1;){let r=n[n.length-1];t.push(r.value),n=r.children}return t}static mergePaths(t,n){if(t.length===0)return n;let r=t.split(":"),i=n.split(":"),o=+r[r.length-1]+ +i[0];return[...r.slice(0,r.length-1),`${o}`,...i.slice(1)].join(":")}toRunDetails(t,n,r,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:ab.mergePaths(n,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>r||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()}}},lb=class{constructor(e,t,n,r){this.sourceValues=e,this.shrink=t,this.runExecution=new hP(n,r),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"&&!xn.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_)}},pP=class{constructor(e,t,n){this.initialValues=e,this.maxInitialIterations=t,this.remainingSkips=n}[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}},mP=-2147483648,yP=2147483647,gP=Math.pow(2,27),bP=Math.pow(2,-53),Oc=class ub{constructor(t){this.internalRng=Es(t.clone())}clone(){return new ub(this.internalRng)}next(t){return os(this.internalRng,0,(1<<t)-1)}nextBoolean(){return os(this.internalRng,0,1)===1}nextInt(t,n){return os(this.internalRng,t===void 0?mP:t,n===void 0?yP:n)}nextBigInt(t,n){return Lm(this.internalRng,t,n)}nextDouble(){let t=this.next(26),n=this.next(27);return(t*gP+n)*bP}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function SP(e,t,n){return t.jump(),e.generate(new Oc(t),n)}function*cb(e,t,n,r){for(let i=0;i!==r.length;++i)yield new O(r[i],void 0);for(let i=0,o=n(t);;++i)yield SP(e,o,i)}function wP(e,t,n){return()=>e.generate(new Oc(t),n)}function*db(e,t,n,r){yield*W(r,s=>()=>new O(s,void 0));let i=0,o=Es(n(t));for(;;)o.jump(),yield wP(e,o,i++)}function Iy(e){return e()}function fb(e,t,n){let r=t,i=e.split(":").map(s=>+s);if(i.length===0)return r.map(Iy);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=r.drop(i[0]).map(Iy);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=n(a).drop(s)}return o}var xP=Object.assign;function vP(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,n)=>`Hint (${n+1}): ${t}`).join(`
21
- `)}function RP(e,t){return`Encountered failures were:
20
+ ${w}`),m.pop(),`{${N}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(h);default:return t?t(h):void 0}}function d(p,h,m){switch(typeof h){case"string":return ln(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(p),typeof h!="object")return d(p,h,m);if(h===null)return"null"}if(m.indexOf(h)!==-1)return n;let y="",S=h.length!==void 0;if(S&&Array.isArray(h)){if(h.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(h);let N=Math.min(h.length,a),$=0;for(;$<N-1;$++){let I=d(String($),h[$],m);y+=I!==void 0?I:"null",y+=","}let _=d(String($),h[$],m);if(y+=_!==void 0?_:"null",h.length-1>a){let I=h.length-a-1;y+=`,"... ${En(I)} not stringified"`}return m.pop(),`[${y}]`}let w=Object.keys(h),g=w.length;if(g===0)return"{}";if(s<m.length+1)return'"[Object]"';let x="",P=Math.min(g,a);S&&kl(h)&&(y+=Eh(h,",",a),w=w.slice(h.length),P-=h.length,x=","),i&&(w=El(w,o)),m.push(h);for(let N=0;N<P;N++){let $=w[N],_=d($,h[$],m);_!==void 0&&(y+=`${x}${ln($)}:${_}`,x=",")}if(g>a){let N=g-a;y+=`${x}"...":"${En(N)} not stringified"`}return m.pop(),`{${y}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(h);default:return t?t(h):void 0}}function f(p,h,m){if(arguments.length>1){let y="";if(typeof m=="number"?y=" ".repeat(Math.min(m,10)):typeof m=="string"&&(y=m.slice(0,10)),h!=null){if(typeof h=="function")return l("",{"":p},[],h,y,"");if(Array.isArray(h))return u("",p,[],oR(h),y,"")}if(y.length!==0)return c("",p,[],y,"")}return d("",p,[])}return f}});var gm=ih((Ej,wu)=>{"use strict";var Xo=process||{},mm=Xo.argv||[],Zo=Xo.env||{},$E=!(Zo.NO_COLOR||mm.includes("--no-color"))&&(!!Zo.FORCE_COLOR||mm.includes("--color")||Xo.platform==="win32"||(Xo.stdout||{}).isTTY&&Zo.TERM!=="dumb"||!!Zo.CI),_E=(e,t,n=e)=>r=>{let i=""+r,o=i.indexOf(t,e.length);return~o?e+LE(i,t,n,o)+t:e+i+t},LE=(e,t,n,r)=>{let i="",o=0;do i+=e.substring(o,r)+n,o=r+t.length,r=e.indexOf(t,o);while(~r);return i+e.substring(o)},ym=(e=$E)=>{let t=e?_E:()=>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")}};wu.exports=ym();wu.exports.createColors=ym});import{z as E}from"zod";var nl=E.enum(["fast","slow","async"]),Yn=E.object({ref:E.string().min(1)}),Lt=E.union([E.string(),E.number(),E.boolean()]),rl=E.object({template:E.array(E.union([E.string(),Yn])).min(1)}),Fe=E.union([Yn,Lt,rl,E.null()]),oh=E.object({kind:E.literal("changed")}),il=E.union([Fe,oh]),Dt=E.union([E.string(),Yn,rl]),Rv=E.object({by:E.literal("role"),name:E.union([Dt,E.undefined()]).optional().transform(e=>e),role:E.string().min(1)}),Av=E.object({by:E.literal("testId"),value:Dt}),Cv=E.object({by:E.literal("inside"),scope:E.lazy(()=>ve),target:E.lazy(()=>ve)}),ve=E.discriminatedUnion("by",[Rv,Av,Cv]),io=E.enum(["string","number","boolean"]),ol=E.enum(["strict","eventual"]),Ev=E.object({kind:E.literal("string"),maxLength:E.number().int().positive().optional(),minLength:E.number().int().nonnegative().optional(),pattern:E.string().optional()}),kv=E.object({kind:E.literal("number"),max:E.number().int().optional(),min:E.number().int().optional()}),Pv=E.object({kind:E.literal("datetime"),maxOffsetDays:E.number().int(),minOffsetDays:E.number().int()}),sh=E.discriminatedUnion("kind",[Ev,kv,Pv]),ah=E.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),sl=E.object({constraints:sh.optional(),generator:ah,name:E.string().min(1),type:io,values:E.array(Lt).min(1).optional()}),lh=E.object({consistency:ol.default("strict"),optional:E.boolean(),type:io,valueSpace:E.string().min(1).optional()}),al=E.enum(["backend","client"]),ll=E.object({description:E.string().optional(),identity:E.array(E.string().min(1)).min(1),identityKind:E.enum(["surrogate","natural"]),name:E.string().min(1),props:E.record(E.string().min(1),lh),source:al.default("backend")}),ul=E.object({consistency:ol.default("strict"),default:Lt,description:E.string().optional(),name:E.string().min(1),source:al.default("backend"),type:io,valueSpace:E.string().min(1).optional()}),jr=E.enum(["url","title","viewport"]);function cl(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${cl(e.scope)} \u25B8 ${cl(e.target)}`:`${e.role} ${e.name??""}`.trim()}import{z as R}from"zod";var dl=["unspecified","internal","server","client","producer","consumer"],fl=["unset","ok","error"],uh=R.looseObject({data:R.looseObject({source:R.number().optional()}).optional(),timestamp:R.number(),type:R.number()}),kt=R.string(),Iv=R.object({action:R.string(),kind:R.literal("action"),source:R.literal("test"),target:R.string().optional(),timeNanos:kt,value:R.string().optional()}),Mv=R.object({kind:R.literal("assertion"),label:R.string(),outcome:R.enum(["passed","failed","error"]),source:R.literal("test"),step:R.string(),timeNanos:kt,wait:R.enum(["fast","slow","async"]).optional(),waitMs:R.number().optional()}),Tv=R.object({event:uh,kind:R.literal("rrweb"),rrwebType:R.string(),source:R.literal("browser"),timeNanos:kt}),Ov=R.object({kind:R.literal("network"),method:R.string(),requestBody:R.string().optional(),resourceType:R.string(),responseBody:R.string().optional(),source:R.literal("browser"),spanId:R.string().optional(),status:R.number(),timeNanos:kt,traceId:R.string().optional(),url:R.string()}),Nv=R.object({kind:R.literal("console"),level:R.string(),source:R.literal("browser"),text:R.string(),timeNanos:kt}),$v=R.object({kind:R.literal("error"),message:R.string(),source:R.literal("browser"),stack:R.string().optional(),timeNanos:kt}),_v=R.object({clientVersion:R.string(),kind:R.literal("meta"),source:R.literal("capture"),timeNanos:kt}),Lv=R.object({kind:R.literal("notice"),message:R.string(),source:R.literal("capture"),timeNanos:kt}),Dv=R.object({actual:R.string().optional(),expected:R.string().optional(),findingKind:R.string(),kind:R.literal("finding"),mismatchKind:R.string().optional(),pending:R.boolean().optional(),source:R.literal("verifier"),step:R.string(),subject:R.string(),timeNanos:kt,wait:R.enum(["fast","slow","async"]).optional(),waitMs:R.number().optional()}),ch=R.object({attributes:R.record(R.string(),R.string()),durationMs:R.number(),kind:R.literal("span"),name:R.string(),parentSpanId:R.string().optional(),source:R.literal("server"),spanId:R.string(),spanKind:R.enum(dl),status:R.object({code:R.enum(fl),message:R.string().optional()}),timeNanos:kt,traceId:R.string()}),dh=R.discriminatedUnion("kind",[Iv,Mv,Tv,Ov,Nv,$v,_v,Lv,Dv,ch]);function hl(e){let t=Bv(e);if(t==null)return null;let n=dh.safeParse(t);return n.success?n.data:null}function pl(e){return Number(BigInt(e)/1000000n)}function ml(e){return dl[e]??"unspecified"}function yl(e){return fl[e]??"unset"}function Bv(e){try{return JSON.parse(e)}catch{return null}}import{z as v}from"zod";var Fv=v.discriminatedUnion("kind",[v.object({as:v.string().min(1),kind:v.literal("created"),props:v.record(v.string().min(1),Fe)}),v.object({as:v.string().min(1),kind:v.literal("updated"),props:v.record(v.string().min(1),il)}),v.object({kind:v.literal("deleted")})]),Uv=v.object({kind:v.literal("is"),value:Fe}),jv=v.discriminatedUnion("kind",[v.object({kind:v.literal("path")}),v.object({key:v.string().min(1),kind:v.literal("query")}),v.object({kind:v.literal("hash")})]),fh=v.lazy(()=>v.union([Fe,Wv])),Vv=v.object({entity:v.string().min(1),where:v.record(v.string().min(1),fh)}),Wv=v.object({field:v.string().min(1),kind:v.literal("within"),selection:Vv}),Pt=v.union([nl,v.undefined()]).optional().transform(e=>e),hh=v.object({assertion:Uv,kind:v.literal("singleton"),singleton:v.string().min(1),wait:Pt}),ph=v.object({entity:v.string().min(1),kind:v.literal("count"),value:v.number().int().nonnegative()}),oo=v.lazy(()=>v.discriminatedUnion("kind",[hh,ph,v.object({kind:v.literal("not"),predicate:oo}),v.object({kind:v.literal("and"),predicates:v.array(oo)})])),zv=v.lazy(()=>v.object({condition:v.union([oo,v.undefined()]).optional().transform(e=>e),consequence:v.array(Zn),name:v.string().min(1)})),Zn=v.lazy(()=>v.discriminatedUnion("kind",[v.object({kind:v.literal("visible"),locator:ve,wait:Pt}),v.object({kind:v.literal("disabled"),locator:ve,wait:Pt}),v.object({kind:v.literal("enabled"),locator:ve,wait:Pt}),v.object({kind:v.literal("focused"),locator:ve,wait:Pt}),v.object({kind:v.literal("checked"),locator:ve,wait:Pt}),v.object({kind:v.literal("value"),locator:ve,value:Dt,wait:Pt}),v.object({kind:v.literal("text"),locator:ve,value:Dt,wait:Pt}),hh,v.object({kind:v.literal("browser"),name:jr,part:v.union([jv,v.undefined()]).optional().transform(e=>e),value:v.union([Dt,v.null()]),wait:Pt}),v.object({assertion:Fv,entity:v.string().min(1),key:v.record(v.string().min(1),fh),kind:v.literal("state"),wait:Pt}),v.object({kind:v.literal("not"),predicate:Zn}),v.object({kind:v.literal("and"),predicates:v.array(Zn)}),ph,v.object({branches:v.array(zv),kind:v.literal("when")})]));import{z as so}from"zod";var Gv=so.object({__codec:so.string().min(1),data:so.unknown(),version:so.number().int().positive()}),ao=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}},lo=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}};function gl({name:e,schema:t}){return{currentVersion:1,name:e,decode:n=>qv({name:e,raw:n,schema:t}),encode:n=>({__codec:e,data:n,version:1})}}function Hv(e,t){return JSON.stringify(e.encode(t))}function Kv(e,t){let n=JSON.parse(t);return e.decode(n)}function qv({name:e,raw:t,schema:n}){let r=Gv.parse(t);if(r.__codec!==e)throw new lo({expected:e,got:r.__codec});if(r.version!==1)throw new ao({codec:e,currentVersion:1,gotVersion:r.version});return n.parse(r.data)}var Cn="__ripplo__",bl="__ripplo_seed__";import{z as A}from"zod";var mh=A.discriminatedUnion("kind",[A.object({kind:A.literal("goto"),url:Dt}),A.object({kind:A.literal("fill"),locator:ve,value:Fe}),A.object({kind:A.literal("clear"),locator:ve}),A.object({kind:A.literal("click"),locator:ve}),A.object({kind:A.literal("dblclick"),locator:ve}),A.object({kind:A.literal("select"),locator:ve,value:Fe}),A.object({kind:A.literal("check"),locator:ve}),A.object({kind:A.literal("uncheck"),locator:ve}),A.object({kind:A.literal("hover"),locator:ve}),A.object({files:A.array(A.string().min(1)).min(1),kind:A.literal("upload"),locator:ve}),A.object({key:A.string().min(1),kind:A.literal("press"),locator:ve.optional()})]),Sl=A.object({action:mh,expect:A.array(Zn).default([])}),wl=A.object({valueSpace:A.string().min(1)}),uo=A.object({as:A.string().min(1),entity:A.string().min(1),set:A.record(A.string().min(1),Fe)}),xl=A.object({entity:A.string().min(1),where:A.record(A.string().min(1),Fe)}),co=A.object({absent:A.array(xl).default([]),exclusive:A.array(A.string().min(1)).default([]),intent:A.string().min(1),name:A.string().min(1),params:A.record(A.string().min(1),wl),singletons:A.record(A.string().min(1),Fe).default({}),slug:A.string().min(1),steps:A.array(Sl).default([]),workflow:A.string().min(1),world:A.array(uo).default([])}),vl=A.object({absent:A.array(xl).default([]),exclusive:A.array(A.string().min(1)).default([]),intent:A.string().min(1),maybe:A.array(uo).default([]),name:A.string().min(1),params:A.record(A.string().min(1),wl),singletons:A.record(A.string().min(1),Fe).default({}),sourcePath:A.string().min(1).optional(),steps:A.array(Sl).default([]),stub:A.boolean().default(!1),tests:A.array(co).default([]),world:A.array(uo).default([])}),yh=A.object({sha256:A.string().regex(/^[0-9a-f]{64}$/u),size:A.number().int().nonnegative()}),gh=A.object({entities:A.array(ll),fixtures:A.record(A.string().min(1),yh).default({}),singletons:A.array(ul).default([]),valueSpaces:A.array(sl),workflows:A.array(vl)}),Yv=gl({name:"ripplo-lockfile",schema:gh});function Zv(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function fo(e,t,n=""){let r=Zv(e),i=e?.length,o=t!==void 0;if(!r||o&&i!==t){let s=n&&`"${n}" `,a=o?` of length ${t}`:"",l=r?`length=${i}`:`type=${typeof e}`,u=s+"expected Uint8Array"+a+", got "+l;throw r?new RangeError(u):new TypeError(u)}return e}function Rl(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function bh(e,t){fo(e,void 0,"digestInto() output");let n=t.outputLen;if(e.length<n)throw new RangeError('"digestInto() output" expected to be of length >='+n)}function Vr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ho(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function dt(e,t){return e<<32-t|e>>>t}var Xv=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Jv=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Sh(e){if(fo(e),Xv)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Jv[e[n]];return t}function wh(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function xh(e,t={}){let n=(i,o)=>e(o).update(i).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=i=>e(i),Object.assign(n,t),Object.freeze(n)}var vh=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function Rh(e,t,n){return e&t^~e&n}function Ah(e,t,n){return e&t^e&n^t&n}var po=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,n,r,i){this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=ho(this.buffer)}update(t){Rl(this),fo(t);let{view:n,buffer:r,blockLen:i}=this,o=t.length;for(let s=0;s<o;){let a=Math.min(i-this.pos,o-s);if(a===i){let l=ho(t);for(;i<=o-s;s+=i)this.process(l,s);continue}r.set(t.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Rl(this),bh(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:i,isLE:o}=this,{pos:s}=this;n[s++]=128,Vr(this.buffer.subarray(s)),this.padOffset>i-s&&(this.process(r,0),s=0);for(let d=s;d<i;d++)n[d]=0;r.setBigUint64(i-8,BigInt(this.length*8),o),this.process(r,0);let a=ho(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let u=l/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)a.setUint32(4*d,c[d],o)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||=new this.constructor,t.set(...this.get());let{blockLen:n,buffer:r,length:i,finished:o,destroyed:s,pos:a}=this;return t.destroyed=s,t.finished=o,t.length=i,t.pos=a,i%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}},Bt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var Qv=Uint32Array.from([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]),an=new Uint32Array(64),Al=class extends po{constructor(t){super(64,t,8,!1)}get(){let{A:t,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[t,n,r,i,o,s,a,l]}set(t,n,r,i,o,s,a,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(t,n){for(let d=0;d<16;d++,n+=4)an[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){let f=an[d-15],p=an[d-2],h=dt(f,7)^dt(f,18)^f>>>3,m=dt(p,17)^dt(p,19)^p>>>10;an[d]=m+an[d-7]+h+an[d-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let d=0;d<64;d++){let f=dt(a,6)^dt(a,11)^dt(a,25),p=c+f+Rh(a,l,u)+Qv[d]+an[d]|0,m=(dt(r,2)^dt(r,13)^dt(r,22))+Ah(r,i,o)|0;c=u,u=l,l=a,a=s+p|0,s=o,o=i,i=r,r=p+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){Vr(an)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Vr(this.buffer)}},Cl=class extends Al{A=Bt[0]|0;B=Bt[1]|0;C=Bt[2]|0;D=Bt[3]|0;E=Bt[4]|0;F=Bt[5]|0;G=Bt[6]|0;H=Bt[7]|0;constructor(){super(32)}};var Ch=xh(()=>new Cl,vh(1));var Ml=tl(Ih(),1),EB=Ml.default.configure,zr=Ml.default;function Tl(e){return Sh(Ch(wh(zr(e))))}function F(e){let t=zr(e);if(t==null)throw new Error("structuralKey: value is not serializable");return t}import{z as Gr}from"zod";var lR=Gr.object({index:Gr.number().int().nonnegative(),kind:Gr.string(),target:Gr.string(),value:Gr.string()});function uR(e){let t=cR(e);return{preconditions:e.entities.map(n=>({depends:t.get(n.name)??[],description:n.description??"",name:n.name,returns:n.identity})),singletons:e.singletons.map(n=>({defaultValue:String(n.default),description:n.description??"",name:n.name,type:n.type})),workflows:e.workflows.map(n=>({expectedOutcome:n.intent,name:n.intent,preconditions:pR(mR(n),t),requiresKeys:n.world.map(r=>({namespace:r.as,preconditionName:r.entity})),slug:Oh(n.name),sourcePath:n.sourcePath??null,spec:n}))}}function Th(e,t){return{index:t,kind:e.action.kind,target:yR(e.action),value:gR(e.action)}}function Oh(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function cR(e){let t=e.workflows.reduce((n,r)=>dR(n,r),new Map);return new Map([...t].map(([n,r])=>[n,[...r]]))}function dR(e,t){let n=[...t.world,...t.maybe],r=new Map(n.map(i=>[i.as,i.entity]));return n.reduce((i,o)=>{let s=fR(o,r),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function fR(e,t){return Object.values(e.set).flatMap(n=>hR(n)).map(n=>t.get(n)).filter(n=>n!=null&&n!==e.entity)}function hR(e){return e==null||typeof e!="object"?[]:"ref"in e?[Mh(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>Mh(t.ref))}function Mh(e){let[t]=e.split(".");return t??e}function pR(e,t){let n=(r,i)=>r.has(i)?r:(t.get(i)??[]).reduce((o,s)=>n(o,s),new Set([...r,i]));return[...e.reduce((r,i)=>n(r,i),new Set)]}function mR(e){return[...new Set(e.world.map(t=>t.entity))]}function yR(e){return e.kind==="goto"?mo(e.url):e.kind==="press"&&e.locator==null?"":yo(e.locator)}function mo(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join("")}function yo(e){return e.by==="testId"?`testId=${mo(e.value)}`:e.by==="inside"?`${yo(e.scope)} \u25B8 ${yo(e.target)}`:`${e.role} ${e.name==null?"":mo(e.name)}`.trim()}function gR(e){return e.kind==="fill"||e.kind==="select"?bR(e.value):e.kind==="press"?e.key:""}function bR(e){return e==null?"":typeof e!="object"?String(e):mo(e)}function Ol({actionOffsets:e,durationMs:t}){let n=vR({anchors:wR({actionOffsets:e,durationMs:t}),durationMs:t});return{delayMs:CR(Math.round(8e3/n.length),500,1800),offsets:n}}function wR({actionOffsets:e,durationMs:t}){let n=e.map(i=>Math.min(i+150,t)),r=[...new Set([0,...n,t])].toSorted((i,o)=>i-o);return xR(r)}function xR(e){return e.reduce((t,n)=>{let r=t.at(-1);return r!=null&&n-r<120?t:[...t,n]},[])}function vR({anchors:e,durationMs:t}){return e.length>60?RR(e):e.length>=5?e:[...new Set([...e,...AR(t,5)])].toSorted((n,r)=>n-r)}function RR(e){return Array.from({length:60},(t,n)=>e[Math.round(n/59*(e.length-1))]??0)}function AR(e,t){return Array.from({length:t},(n,r)=>Math.round(r/(t-1)*e))}function CR(e,t,n){return Math.min(n,Math.max(t,e))}import{z as Ee}from"zod";var Nh=Ee.enum(["Strict","Lax","None"]),$h=Ee.object({domain:Ee.string().min(1),expires:Ee.number(),httpOnly:Ee.boolean(),name:Ee.string().min(1),path:Ee.string().min(1),sameSite:Nh,secure:Ee.boolean(),value:Ee.string()}),_h=Ee.object({localStorage:Ee.array(Ee.object({name:Ee.string().min(1),value:Ee.string()})),origin:Ee.string().min(1)}),Nl=Ee.object({cookies:Ee.array($h),headers:Ee.record(Ee.string().min(1),Ee.string()).optional(),origins:Ee.array(_h)});import{z as Y}from"zod";var $l=Y.union([Lt,Y.null()]),_l=Y.record(Y.string().min(1),$l),Lh=Y.object({as:Y.string().min(1),entity:Y.string().min(1),fields:Y.record(Y.string().min(1),Fe)}),ER=Y.object({entities:Y.array(Lh),runId:Y.string().min(1),singletons:Y.record(Y.string().min(1),$l).default({})}),Dh=Y.object({as:Y.string().min(1),row:_l,session:Nl.optional()}),Ll=Y.object({rows:Y.array(Dh)}),kR=Y.object({entities:Y.array(Y.string().min(1)),runId:Y.string().min(1),singletons:Y.array(Y.string().min(1)).default([])}),Dl=Y.object({entities:Y.record(Y.string().min(1),Y.array(_l)),singletons:Y.record(Y.string().min(1),$l).default({})}),PR=Y.object({runId:Y.string().min(1)}),Bl=Y.object({ok:Y.literal(!0)});function go({actual:e,canon:t,pre:n,predicted:r}){return[...[...new Set([...r.entities.keys(),...e.entities.keys()])].flatMap(s=>OR({actual:e.entities.get(s),canon:t,entity:s,pre:n.entities.get(s),predicted:r.entities.get(s)})),...$R(n.singletons,r.singletons,e.singletons),...IR(n.browser,r.browser,e.browser)]}function IR(e,t,n){return MR(t,n).flatMap(({got:r,key:i,want:o})=>{if(o===void 0||r===void 0||o===r)return[];let s=TR(e,i);return[{mismatch:{key:i,kind:"browser-mismatch",snapshot:o,sut:r},pending:s!==void 0&&s===r}]})}function MR(e,t){let n=[...new Set([...Object.keys(e.query),...Object.keys(t.query)])];return[{got:t.path,key:{kind:"path"},want:e.path},{got:t.hash,key:{kind:"hash"},want:e.hash},{got:t.title,key:{kind:"title"},want:e.title},{got:t.viewport,key:{kind:"viewport"},want:e.viewport},...n.map(r=>({got:t.query[r],key:{key:r,kind:"query"},want:e.query[r]}))]}function TR(e,t){return t.kind==="query"?e.query[t.key]:e[t.kind]}function OR({actual:e,canon:t,entity:n,pre:r,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>NR({actual:e?.get(s),canon:t,entity:n,key:s,predicted:i?.get(s),preHadKey:r?.has(s)??!1,preRow:r?.get(s)}))}function NR({actual:e,canon:t,entity:n,key:r,predicted:i,preHadKey:o,preRow:s}){if(i==null)return[{mismatch:{entity:n,key:r,kind:"unexpected-row"},pending:o}];if(e==null)return[{mismatch:{entity:n,key:r,kind:"missing-row"},pending:!o}];let a=(u,c,d)=>Fl(t(n,u,c),t(n,u,d));return[...new Set([...Object.keys(i),...Object.keys(e)])].filter(u=>!a(u,i[u],e[u])).map(u=>({mismatch:{entity:n,field:u,key:r,kind:"wrong-value",snapshot:i[u],sut:e[u]},pending:s==null?e[u]===void 0:a(u,s[u],e[u])}))}function Fl(e,t){return Bh(e)===Bh(t)}function Bh(e){return e==null?"\u2205":JSON.stringify(e)}function $R(e,t,n){return[...new Set([...Object.keys(t),...Object.keys(n)])].flatMap(i=>{let o=t[i],s=n[i];return o===void 0||s===void 0||Fl(o,s)?[]:[{mismatch:{kind:"singleton-mismatch",singleton:i,snapshot:o,sut:s},pending:e[i]!==void 0&&Fl(e[i],s)}]})}function Hr(e){let t=_R(e.entities),n=LR(e.singletons);return r=>DR(r,t,n)}function _R(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([n,r])=>[Fh(t.name,n),r.consistency])))}function Fh(e,t){return`${e}.${t}`}function LR(e){return new Map(e.map(t=>[t.name,t.consistency]))}function DR(e,t,n){return e.kind==="singleton-mismatch"?BR(e.singleton,n):e.kind==="browser-mismatch"?"eventual":e.kind==="unexpected-row"||e.kind==="missing-row"?"strict":t.get(Fh(e.entity,e.field))??"strict"}function BR(e,t){return jr.safeParse(e).success?t.get(e)??"eventual":t.get(e)??"strict"}function Kr(e){let t=new Set(e.valueSpaces.filter(n=>n.generator==="date.iso").map(n=>n.name));return(n,r,i)=>{if(!t.has(`${n}.${r}`)||typeof i!="string")return i;let o=Date.parse(i);return Number.isNaN(o)?i:new Date(o).toISOString()}}function Ul({onlyFirst:e=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,e?void 0:"g")}var FR=Ul();function jl(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(FR,"")}function Vl(e,t,n){return{detail:n.slice(0,500),kind:"engine-http",path:e,status:t}}function Xn(e,t){return{code:Hh(t),kind:"engine-network",message:qr(t),path:e}}function bo(e){return{kind:"client-mount-missing",mountKey:e}}function Wl(e,t){return{kind:"engine-decode",message:qr(t),path:e}}function zl(e,t){return{entity:e,field:t,kind:"state-identity"}}function jh(e){return{as:e,kind:"setup-missing-row"}}function Vh(e){return{count:e,kind:"conflicting-sessions"}}function Ft(e){return{kind:"driver-launch",message:qr(e)}}function Gl(e){return{kind:"engine-unreachable",url:e}}function Hl(e,t){return{action:e,kind:"action-failed",message:qr(t)}}function Kl(e){return{kind:"check-failed",message:qr(e)}}function ql(){return{kind:"aborted"}}var UR=["client-mount-missing","driver-launch","engine-decode","engine-http","engine-network","engine-unreachable"],Wh=new Set(UR);function So(e){return Wh.has(e.kind)}function zh(e){return Wh.has(e)}var Uh=300;function un(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${Gh(e.detail)}${jR(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"conflicting-sessions":return`world established ${String(e.count)} distinct auth sessions in one browser context; sessions are exclusive \u2014 a single context holds one signed-in user`;case"engine-unreachable":return`the engine at ${e.url} did not respond in time \u2014 the dev server may still be recompiling. Re-run once it settles.`;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 Yl(e){throw new Error(un(e))}function ft(){}function Gh(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=Uh?t:`${t.slice(0,Uh)}\u2026 [truncated]`}function jR(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 Hh(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?Hh(e.cause):void 0}function qr(e){let t=e instanceof Error?e.message:String(e);return Gh(jl(t))}function Kh(e){return F(e)}var cn=class extends Error{name="AbortError";constructor(){super("aborted")}};function Zl(e){return e instanceof Error&&e.name==="AbortError"}function ot(e){if(e.aborted)throw new cn}function Jn(e,t){return t.aborted?Promise.reject(new cn):new Promise((n,r)=>{let i=()=>{clearTimeout(o),r(new cn)},o=setTimeout(()=>{t.removeEventListener("abort",i),n()},e);t.addEventListener("abort",i,{once:!0})})}import{z as VR}from"zod";var Jl=VR.string().brand(),J=Jl.parse("");function It(e){return Jl.parse(e)}function Je(e,t){return Jl.parse(e.length===0?t:`${e}.${t}`)}function de(e){return Yn.safeParse(e).success}function Pn(e){let t=e.lastIndexOf(".");return t===-1?void 0:{alias:e.slice(0,t),field:e.slice(t+1)}}function Qe(e){return typeof e=="object"&&e!==null&&"template"in e}function Xl(e,t,n){let r=Je(t,e.ref);if(!n.has(r))throw new Error(`unresolved binding ref "${r}"`);return n.get(r)??null}function Ql(e,t,n){return WR(e).every(r=>n.has(Je(t,r)))}function ht(e,t,n){return typeof e=="string"?e:de(e)?String(Xl(e,t,n)):e.template.map(r=>typeof r=="string"?r:String(Xl(r,t,n))).join("")}function et(e,t,n){return e===null||typeof e=="number"||typeof e=="boolean"?e:de(e)?Xl(e,t,n):ht(e,t,n)}function qh(e,t){return et(e,J,t)}function Yr(e){return zr(e)}function Qn(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,et(i,t,n)]))}function WR(e){return e==null||typeof e!="object"?[]:Qe(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}var zR="https://ripplo.invalid",In={hash:void 0,path:void 0,query:{},title:void 0,viewport:void 0},tt={hash:void 0,path:void 0,query:{},title:void 0,viewport:void 0};function Zh(e){return e.kind!=="title"&&e.kind!=="viewport"}function Ke(e){return e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:`url ${e.kind}`}function jt(e,t){return e==="title"?{kind:"title"}:e==="viewport"?{kind:"viewport"}:t===void 0||t.kind==="path"?{kind:"path"}:t.kind==="hash"?{kind:"hash"}:{key:t.key,kind:"query"}}function Ut(e){let t=new URL(e,zR),n=Object.fromEntries(t.searchParams.entries());return{hash:t.hash.length>0?t.hash.slice(1):void 0,path:t.pathname,query:n,title:void 0,viewport:void 0}}function Zr(e){if(typeof e=="string")return Yh(Ut(e));let t=de(e)?[e]:e.template,n=t.findIndex(u=>typeof u=="string"&&/[?#]/.test(u)),r=t[n];if(n===-1||typeof r!="string")return{...tt,path:e};let i=[...t.slice(0,n),r.slice(0,r.search(/[?#]/))],o=t.slice(n),s={template:i};if(o.some(u=>typeof u!="string"))return{...tt,path:s};let a=o.filter(u=>typeof u=="string").join(""),l=Ut(`/p${a.slice(a.search(/[?#]/))}`);return{...Yh(l),path:s}}function wo(e,t,n){return t.kind==="query"?{...e,query:{...e.query,[t.key]:n}}:{...e,[t.kind]:n}}function xo(e,t,n){return t.kind==="query"?{...e,query:{...e.query,[t.key]:n}}:{...e,[t.kind]:n}}function Xh(e,t){if(t.kind==="query"){let n=Object.fromEntries(Object.entries(e.query).filter(([r])=>r!==t.key));return{...e,query:n}}return{...e,[t.kind]:void 0}}function er(e,t){return t.kind==="query"?e.query[t.key]??void 0:e[t.kind]}function Mn(e){let n=[[{kind:"path"},e.path],[{kind:"hash"},e.hash],[{kind:"title"},e.title],[{kind:"viewport"},e.viewport]].flatMap(([i,o])=>o===void 0?[]:[{clause:o,key:i}]),r=Object.entries(e.query).map(([i,o])=>({clause:o,key:{key:i,kind:"query"}}));return[...n,...r]}function vo(e,t){return Jh(e,t)}function dn(e,t){return Jh(e,t)}function Jh(e,t){return{hash:t.hash??e.hash,path:t.path??e.path,query:{...e.query,...t.query},title:t.title??e.title,viewport:t.viewport??e.viewport}}function Yh(e){return{hash:e.hash,path:e.path,query:e.query,title:e.title,viewport:e.viewport}}var GR={check:"Check",clear:"Clear",click:"Click",dblclick:"Double-click",fill:"Fill",goto:"Go to",hover:"Hover",press:"Press",select:"Select",uncheck:"Uncheck",upload:"Upload"};function Qh(e){let t=GR[e.kind]??e.kind;return e.kind==="press"&&e.key!=null?`${t}: ${e.key}`:t}function ep(e){return e.kind==="data-rule"?"data rule":tp(e.check)}function tp(e){return e.kind==="not"?`not ${tp(e.inner)}`:e.kind==="browser"?Ke(e.key):`${np(e.locator)} ${e.kind}`}function np(e){return e.by==="testId"?"element":e.by==="inside"?np(e.target):e.role}function rp(e){return e.kind==="goto"?e.url:e.kind==="press"?e.key:e.value==null?void 0:String(e.value)}function ip(e){return e.kind==="data-rule"?void 0:sp(e.check)}function op(e){return e.kind==="data-rule"?!1:ap(e.check)}function sp(e){if(e.kind==="not")return sp(e.inner);if(e.kind==="value"||e.kind==="text"||e.kind==="browser")return e.value??void 0}function ap(e){return e.kind==="not"?ap(e.inner):e.kind==="browser"&&Zh(e.key)}function hp(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var HR=()=>[];async function Ao({canon:e,classify:t,initialSnapshot:n,observe:r,onAssertion:i,onStep:o,pageRulePendingChecks:s,steps:a,stopAfterStep:l},u){return pp({acc:[],canon:e,classify:t,index:0,observe:r,onAssertion:i,onStep:o,pageRulePendingChecks:s??HR,signal:u,snapshot:n,steps:a,stopAfterStep:l})}async function pp({acc:e,canon:t,classify:n,index:r,observe:i,onAssertion:o,onStep:s,pageRulePendingChecks:a,signal:l,snapshot:u,steps:c,stopAfterStep:d}){ot(l);let f=c[r];if(f==null)return{finalModel:u,findings:e};let p=Date.now(),h=await f.targetIds(),m=Qh(f.step.action);if(!f.requiredState(u)){let y={kind:"impossible-action",step:f.step};return tu(s,{annotations:[eu({action:f.step.action,actionLabel:m,outcome:"failed",rrwebIds:h,startMs:p})],endMs:Date.now(),findings:[y],index:r,post:u,pre:u,source:f.source,startMs:p,url:nu(u)}),{finalModel:u,findings:[...e,y]}}return f.perform().match(()=>KR({acc:e,actionLabel:m,canon:t,classify:n,index:r,observe:i,onAssertion:o,onStep:s,pageRulePendingChecks:a,rrwebIds:h,signal:l,snapshot:u,startMs:p,step:f,steps:c,stopAfterStep:d}),y=>{let S=Ro(y,f);return tu(s,{annotations:[eu({action:f.step.action,actionLabel:m,outcome:"failed",rrwebIds:h,startMs:p})],endMs:Date.now(),findings:[S],index:r,post:u,pre:u,source:f.source,startMs:p,url:nu(u)}),Promise.resolve({finalModel:u,findings:[...e,S]})})}function eu({action:e,actionLabel:t,outcome:n,rrwebIds:r,startMs:i}){return{atMs:i,kind:"action",label:t,outcome:n,rrwebIds:r,url:!1,value:rp(e)}}async function KR({acc:e,actionLabel:t,canon:n,classify:r,index:i,observe:o,onAssertion:s,onStep:a,pageRulePendingChecks:l,rrwebIds:u,signal:c,snapshot:d,startMs:f,step:p,steps:h,stopAfterStep:m}){let y=p.effect(d),S=await QR({canon:n,classify:r,observe:o,pre:d,predicted:y,signal:c,step:p}),w=[...p.pendingChecks,...l(d,S.snapshot)],g=await qR({onAssertion:s,pendingChecks:w,signal:c,step:p}),x=[...g.findings,...S.findings];tu(a,{annotations:[eu({action:p.step.action,actionLabel:t,outcome:x.length>0?"failed":"passed",rrwebIds:u,startMs:f}),...g.annotations],endMs:Date.now(),findings:x,index:i,post:S.snapshot,pre:d,source:p.source,startMs:f,url:nu(S.snapshot)});let P=[...e,...x];return x.length>0?{finalModel:S.snapshot,findings:P}:m!=null&&i+1>=m?{finalModel:S.snapshot,findings:P}:pp({acc:P,canon:n,classify:r,index:i+1,observe:o,onAssertion:s,onStep:a,pageRulePendingChecks:l,signal:c,snapshot:S.snapshot,steps:h,stopAfterStep:m})}async function qR({onAssertion:e,pendingChecks:t,signal:n,step:r}){let i=[...new Map(t.map(s=>[Kh(s.source),s])).values()],o=await Promise.all(i.map(async s=>{let a=await YR(s,n),l=Date.now(),u=await s.targetIds();return{atMs:l,outcome:a,pendingCheck:s,rrwebIds:u}}));return o.forEach(s=>{ZR(e,s.pendingCheck,s.outcome,r)}),{annotations:o.filter(s=>s.pendingCheck.source.kind==="step").map(s=>({atMs:s.atMs,kind:"assertion",label:ep(s.pendingCheck.source),outcome:mp(s.outcome),rrwebIds:s.rrwebIds,url:op(s.pendingCheck.source),value:ip(s.pendingCheck.source)})),findings:o.flatMap(s=>XR(s.pendingCheck,s.outcome,r))}}function YR(e,t){if(e.check.kind==="decided"){let n=e.check.passed?"passed":"failed";return Promise.resolve({kind:n})}return eA(e.budget,e.check.run,t)}function ZR(e,t,n,r){e?.({outcome:mp(n),source:t.source,step:r.step,waitBudget:t.budget,waitMs:Vt[t.budget]})}function mp(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function XR(e,t,n){return t.kind==="error"?[Ro(t.error,n)]:t.kind==="failed"?[{budget:e.budget,kind:"pending-check",source:e.source,step:n.step}]:[]}function Ro(e,t){return{error:e,kind:"driver-error",step:t.step}}function tu(e,t){e?.(t)}function nu(e){let t=e.browser.path;return typeof t=="string"?t:null}var Vt={async:12e4,fast:5e3,slow:3e4},yp={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:Vt.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:Vt.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:Vt.slow}};function gp(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function lp(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function JR(e,t,n){return n.reconcile==null?e:n.reconcile(e,t)}function up({canon:e,pre:t,predicted:n,step:r},i){let o=r.verifyChanges==null?[]:r.verifyChanges(n,i),s=JR(n,i,r),a=o.map(l=>({mismatch:l,pending:!0}));return{adopted:s,probed:[...a,...go({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function bp(e,t){return{budget:t.sync,kind:"consistency",mismatch:e.mismatch,pending:e.pending,step:t.step}}function cp(e,t,n){let r=e.probed.filter(i=>!i.pending&&n(i.mismatch)==="strict");return r.length>0?{findings:r.map(i=>bp(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function dp(e,t,n){return{findings:[...e.probed.map(r=>bp(r,t)),...n],snapshot:e.adopted}}async function QR({canon:e,classify:t,observe:n,pre:r,predicted:i,signal:o,step:s}){let a=yp[s.sync],l=Date.now()+a.timeoutMs,u=await lp(n);if(!u.ok)return{findings:[Ro(u.error,s)],snapshot:i};let c=up({canon:e,pre:r,predicted:i,step:s},u.observed),d=0;for(;Date.now()<l;){ot(o);let f=cp(c,s,t);if(f!=null)return f;await Jn(gp(a,d),o),d+=1;let p=await lp(n);if(!p.ok)return dp(c,s,[Ro(p.error,s)]);c=up({canon:e,pre:r,predicted:i,step:s},p.observed)}return cp(c,s,t)??dp(c,s,[])}async function eA(e,t,n){let r=yp[e],i=Date.now()+r.timeoutMs,o=await fp(t),s=0;for(;o.kind==="pending"&&Date.now()<i;)ot(n),await Jn(gp(r,s),n),s+=1,o=await fp(t);return o.kind==="pending"?{kind:"failed"}:o}function fp(e){return e().match(t=>t?{kind:"passed"}:{kind:"pending"},t=>({error:t,kind:"error"}))}function Sp(e){return Xr(e.expect).some(t=>t.assertion.kind==="deleted")}var wp=new Set(["created","updated","deleted"]);function xp(e){return Xr(e.expect).some(t=>wp.has(t.assertion.kind))}function vp(e){return new Set(Xr(e.expect).flatMap(t=>wp.has(t.assertion.kind)?[t.entity]:[]))}function fn(e){return typeof e=="object"&&e!==null&&"kind"in e}function Tn(e){return Object.fromEntries(Object.entries(e).filter(t=>!fn(t[1])))}function Jr(e,t,n){return t.reduce((r,i)=>tA(r,i,n,e),e)}function Rp(e,t){return Object.keys(t).length===0?e:{...e,singletons:{...e.singletons,...t}}}function Ap(e,t){return{...e,browser:vo(e.browser,t)}}function Cp(e,t){return{...e,browser:t.reduce((n,r)=>Xh(n,r),e.browser)}}function Xr(e){return e.flatMap(t=>t.kind==="state"?[t]:t.kind==="and"?Xr(t.predicates):t.kind==="when"?Xr(t.branches.flatMap(n=>n.consequence)):[])}function tA(e,t,n,r){if(!nA(t,n))return e;if(t.assertion.kind==="created"){let o=Qn(t.assertion.props,J,n);return rA(e,t.entity,Yr(o),o)}if(t.assertion.kind==="deleted")return ru(e,t.entity,aA(t.key,n,r));let i=Qn(Tn(t.assertion.props),J,n);return ru(e,t.entity,lA(t.key,i,n,r))}function nA(e,t){return("props"in e.assertion?[e.key,Tn(e.assertion.props)]:[e.key]).every(r=>Object.values(r).every(i=>Pp(i)||!de(i)||t.has(It(i.ref))))}function rA(e,t,n,r){let i=new Map([...e.entities.get(t)??[],[n,r]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function ru(e,t,n){let r=n(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,r]])}}function On(e,t,n,r){let i={env:r,key:n,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>Eo(o,i))}function Ep(e,t,n,r,i){let o={env:r,key:n,snapshot:e};return ru(e,t,s=>new Map([...s].map(([a,l])=>[a,Eo(l,o)?i(l):l])))}function Eo(e,t){return Object.entries(t.key).every(([n,r])=>kp(e[n],r,t))}function kp(e,t,n){return Pp(t)?iA(t,n).has(Co(e)):Co(e)===Co(sA(t,n.env))}function Pp(e){return typeof e=="object"&&e!==null&&"kind"in e}function iA(e,t){let n=t.snapshot.entities.get(e.selection.entity);return n==null?new Set:new Set([...n.values()].filter(r=>oA(r,e.selection.where,t)).map(r=>Co(r[e.field])))}function oA(e,t,n){return Object.entries(t).every(([r,i])=>kp(e[r],i,n))}function Co(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function sA(e,t){return et(e,J,t)}function aA(e,t,n){let r={env:t,key:e,snapshot:n};return i=>new Map([...i].filter(([,o])=>!Eo(o,r)))}function lA(e,t,n,r){let i={env:n,key:e,snapshot:r};return o=>new Map([...o].map(([s,a])=>Eo(a,i)?[s,{...a,...t}]:[s,a]))}function iu(e){let t=e.predicates.filter(o=>Np(o)),n=t.filter(o=>o.assertion.kind==="created"),r=Op(t);if(n.length===0&&r.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=n.reduce((c,d)=>mA(c,s,d,e.env),{env:e.env,snapshot:o}),l=r.reduce((c,d)=>pA(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>cA(c,s,d),a.env);return uA(bA(l,e.deferred,u),s,e.adopt)}}function uA(e,t,n){if(n.length===0)return e;let r=n.reduce((i,o)=>{let s=t.snapshot.singletons[o];return s===void 0?i:{...i,[o]:s}},e.singletons);return{...e,singletons:r}}function Tp(e,t,n){return new Map([...e,...Object.entries(n).map(([r,i])=>[Je(J,`${t}.${r}`),i])])}function cA(e,t,n){let r=On(t.snapshot,n.entity,n.key,e).at(0);return r==null?e:Tp(e,n.assertion.as,r)}function ou(e){let t=Op(e.predicates.filter(n=>Np(n)));if(t.length!==0)return(n,r)=>t.flatMap(i=>dA(i,n,r,e.env))}function Op(e){return e.filter(t=>t.assertion.kind==="updated"&&su(t.assertion.props).length>0)}function su(e){return Object.entries(e).filter(([,t])=>fn(t)).map(([t])=>t)}function Np(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function dA(e,t,n,r){let i=On(t,e.entity,e.key,r).at(0),o=On(n.snapshot,e.entity,e.key,r).at(0);if(i==null||o==null)return[];let s=Yr(fA(e.key,r));return su(e.assertion.props).flatMap(a=>Ip(i[a])===Ip(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function fA(e,t){let n=Object.fromEntries(Object.entries(e).filter(r=>!hA(r[1])));return Qn(n,J,t)}function hA(e){return typeof e=="object"&&e!==null&&"kind"in e}function Ip(e){return e==null?"\u2205":JSON.stringify(e)}function pA(e,t,n,r){let i=su(n.assertion.props),o=On(t.snapshot,n.entity,n.key,r).at(0);return o==null?e:Ep(e,n.entity,n.key,r,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function mA(e,t,n,r){if(n.assertion.kind!=="created")return e;let i=Qn(n.assertion.props,J,r),o=Yr(i),s=e.snapshot.entities.get(n.entity);if(s==null||!s.has(o))return e;let a=yA(t.snapshot.entities.get(n.entity),s,i);if(a==null)return e;let[l,u]=a,c=new Map(s);return c.delete(o),c.set(l,{...u,...i}),{env:Tp(e.env,n.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(n.entity,c)}}}function yA(e,t,n){if(e==null)return;let r=Object.entries(n),i=[...e].filter(([o])=>!t.has(o)).map(([o,s])=>({entry:[o,s],score:r.filter(([a,l])=>Mp(s[a])===Mp(l)).length}));return gA(i,r.length)}function Mp(e){return e==null?"\u2205":JSON.stringify(e)}function gA(e,t){let n=e.reduce((i,o)=>Math.max(i,o.score),0);if(n===0)return;let r=e.filter(i=>i.score===n);if(!(n<t&&r.length!==1))return r[0]?.entry}function bA(e,t,n){let r=t.reduce((i,o)=>{let s=SA(o.value,n);return s==null||typeof s!="string"?i:xo(i,o.key,s)},e.browser);return{...e,browser:r}}function SA(e,t){try{return ht(e,J,t)}catch{return}}function ko(e,t){if(e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked")return{kind:e.kind,locator:Qr(e.locator,t)};if(e.kind==="not"){let n=ko(e.predicate,t);return n==null?null:{inner:n,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:Qr(e.locator,t),value:ht(e.value,J,t)}:e.kind!=="browser"?null:{key:jt(e.name,e.part),kind:"browser",value:e.value===null?null:ht(e.value,J,t)}}function tr(e,t){let n=e.expect.filter(l=>l.kind==="state"),r=RA(n),{browser:i,clears:o,deferred:s,singletons:a}=wA(e,t,r);return{action:AA(e.action,t),label:e.action.kind,pendingChecks:e.expect.flatMap(l=>EA(l,t)),reconcile:iu({adopt:[],deferred:s,env:t,predicates:n}),verifyChanges:ou({adopt:[],deferred:s,env:t,predicates:n}),effect:l=>Cp(Ap(Rp(Jr(l,n,t),a),i),o)}}function Qr(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:ht(e.name,J,t),role:e.role}:e.by==="inside"?{by:"inside",scope:Qr(e.scope,t),target:Qr(e.target,t)}:{by:"testId",value:ht(e.value,J,t)}}function $p(e){return e.flatMap(t=>t.kind==="and"?$p(t.predicates):[t])}function wA(e,t,n){let r=e.action.kind==="goto"?Ut(ht(e.action.url,J,t)):In;return $p(e.expect).reduce((i,o)=>{if(o.kind==="browser"&&o.value===null){let s=jt(o.name,o.part);return{...i,clears:[...i.clears,s]}}if(o.kind==="browser"&&o.value!==null&&xA(o.value,n)){let s=jt(o.name,o.part);return{...i,deferred:[...i.deferred,{key:s,value:o.value}]}}if(o.kind==="browser"&&o.value!==null){let s=jt(o.name,o.part),a=ht(o.value,J,t);return{...i,browser:xo(i.browser,s,a)}}if(o.kind==="singleton"){let s=et(o.assertion.value,J,t);return{...i,singletons:{...i.singletons,[o.singleton]:s}}}return i},{browser:r,clears:[],deferred:[],singletons:{}})}function xA(e,t){return vA(e).some(n=>t.has(n.split(".")[0]??n))}function vA(e){return typeof e=="string"?[]:de(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function RA(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function AA(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:CA(e,t),url:e.kind==="goto"?ht(e.url,J,t):void 0,value:"value"in e?qh(e.value,t):void 0}}function CA(e,t){if(!(!("locator"in e)||e.locator==null))return Qr(e.locator,t)}function EA(e,t){if(e.kind==="browser"||e.kind==="singleton")return[];let n=ko(e,t),r="wait"in e?e.wait??"fast":"fast";return n==null?[]:[{budget:r,check:n}]}import{err as _p,ok as lu,okAsync as kA,Result as PA}from"neverthrow";function nr(e,t,n){let r=_A(e),i={env:new Map,generate:n.generate,generatedParams:new Set,indexed:r,overrides:new Map(Object.entries(n.params??{}).map(([s,a])=>[It(s),a]))};LA(t.params,J,i);let o=t.world.map(s=>DA(s,J,i));return n.materialize(o).andThen(s=>jA(s,i.env,r).map(a=>IA({base:a,generatedParams:i.generatedParams,lockfile:e,test:t})))}function Po(e,t){let n=new Map(t.map(r=>[r.name,r]));return r=>kA(OA(r,e,n).rows)}function Io(e){return t=>{let n=t.map(r=>({as:r.as,entity:r.entity,fields:r.fields}));return e(n).andThen(r=>TA(t,r))}}function uu(e,t){let n=ei(t);return Object.fromEntries(Object.entries(e).filter(([r,i])=>n.includes(r)&&i!=null))}function ei(e){return Object.keys(e.props)}function IA({base:e,generatedParams:t,lockfile:n,test:r}){let i=Object.fromEntries(n.singletons.map(c=>[c.name,c.default])),o=Object.fromEntries(Object.entries(r.singletons).map(([c,d])=>[c,et(d,J,e.env)])),s=Object.entries(r.singletons).filter(([,c])=>MA(c,t)).map(([c])=>c),a={...i,...o},l=new Set(n.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 MA(e,t){return de(e)?t.has(Je(J,e.ref)):Qe(e)?e.template.some(n=>typeof n!="string"&&t.has(Je(J,n.ref))):!1}function TA(e,t){let n=new Map(t.map(r=>[r.as,r]));return PA.combine(e.map(r=>{let i=n.get(r.as);return i==null?_p(jh(r.as)):lu({as:r.as,entity:r.entity,generatedFields:r.generatedFields,row:i.row,session:i.session})}))}function OA(e,t,n){return e.reduce((r,i)=>{let o=NA(i.fields,r.env),s=WA({generate:t,model:i.model,seedPrefix:i.seedPrefix,set:o,valueSpaces:n}),a=Object.entries(s).map(([u,c])=>[`${i.as}.${u}`,c]),l=Object.keys(s).filter(u=>!(u in o));return{env:new Map([...r.env,...a]),rows:[...r.rows,{as:i.as,entity:i.entity,generatedFields:[...new Set([...i.generatedFields,...l])],row:s,session:void 0}]}},{env:new Map,rows:[]})}function NA(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>{if(de(r))return[n,$A(t,r.ref)];if(Qe(r))throw new Error(`template value not allowed in entity field "${n}"`);return[n,r]}))}function $A(e,t){let n=e.get(t);if(n==null)throw new Error(`setup ref "${t}" was not produced by an earlier entity`);return n}function _A(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function LA(e,t,n){Object.entries(e).forEach(([r,i])=>{let o=Je(t,r),s=n.indexed.valueSpaces.get(i.valueSpace);if(s==null)throw new Error(`unknown valueSpace "${i.valueSpace}" for param "${o}"`);let a=n.overrides.get(o);a==null&&n.generatedParams.add(o);let l=a??n.generate.value({anchor:void 0,constraints:s.constraints,generator:s.generator,nullable:!1,seed:o,type:s.type,values:s.values,valueSpace:i.valueSpace});n.env.set(o,l)})}function DA(e,t,n){let r=n.indexed.models.get(e.entity);if(r==null)throw new Error(`model "${e.entity}" not found for setup "${e.as}"`);let i=Je(t,e.as),o=BA(e.set,t,n.env),s=UA(r,o,i,n),a=Object.entries(e.set).filter(([,l])=>de(l)&&n.generatedParams.has(Je(t,l.ref))).map(([l])=>l);return{as:i,entity:e.entity,fields:{...s,...o},generatedFields:[...Object.keys(s),...a],model:r,seedPrefix:i}}function BA(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,FA(i,t,n)]))}function FA(e,t,n){if(!de(e))return e;let r=Je(t,e.ref);return n.get(r)??{ref:r}}function UA(e,t,n,r){return Object.fromEntries(Object.entries(e.props).filter(([i,o])=>!o.optional&&!e.identity.includes(i)&&!(i in t)).map(([i,o])=>[i,Lp({field:i,generate:r.generate,model:e,seedPrefix:n,spec:o,valueSpaces:r.indexed.valueSpaces})]))}function jA(e,t,n){let r=new Map,i=e.flatMap(a=>{let l=n.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(Je(It(a.as),c),d));let u=r.get(a.entity)??new Map;return u.set(au(a.row,l),uu(a.row,l)),r.set(a.entity,u),a.session==null?[]:[a.session]}),o=e.flatMap(a=>{let l=n.models.get(a.entity);return l==null?[]:[{alias:a.as,entity:a.entity,key:au(a.row,l)}]}),s=e.flatMap(a=>{let l=n.models.get(a.entity);if(l==null)return[];let u=au(a.row,l);return a.generatedFields.map(c=>({entity:a.entity,field:c,key:u}))});return VA(i).map(a=>({aliases:o,auth:a,env:t,generated:s,snapshot:{browser:In,entities:zA(r),singletons:{}}}))}function VA(e){if(e.length===0)return lu(void 0);let t=new Set(e.map(r=>JSON.stringify(r.cookies))).size;if(t>1)return _p(Vh(t));let n=e.flatMap(r=>Object.entries(r.headers??{}));return lu({cookies:e.flatMap(r=>r.cookies),headers:n.length===0?void 0:Object.fromEntries(n),origins:e.flatMap(r=>r.origins)})}function WA({generate:e,model:t,seedPrefix:n,set:r,valueSpaces:i}){return{...Object.fromEntries(Object.entries(t.props).filter(([s])=>!(s in r)).map(([s,a])=>[s,Lp({field:s,generate:e,model:t,seedPrefix:n,spec:a,valueSpaces:i})])),...r}}function Lp({field:e,generate:t,model:n,seedPrefix:r,spec:i,valueSpaces:o}){let s=`${n.name}.${e}`;return t.value({anchor:void 0,constraints:o.get(s)?.constraints,generator:o.get(s)?.generator??"lorem.word",nullable:i.optional,seed:Je(r,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function au(e,t){return t.identity.map(n=>String(e[n])).join(":")}function zA(e){return new Map([...e].map(([t,n])=>[t,new Map(n)]))}function Wt(e,t){return[...new Map(e.map(n=>[t(n),n])).values()]}function Dp(e){return Wt(e,F)}function st(e){return`${e.workflow}/${e.slug}`}function Mt(e){return e.workflows.flatMap(t=>t.tests.map(n=>({ref:st(n),test:n,workflow:t})))}function Tt(e){return`${e.test}#${String(e.index)}`}function $n(e){let t=Mt(e).flatMap(n=>ti(e,n.test));return Wt(t,n=>`${n.test}:${F(n.steps)}`)}function ti(e,t){let n=Up(t),r=Bp(n,t.singletons),i=mC(t,pC(e)),o=GA(e,t);return HA(r,yC(t.steps),n).reduce((a,{chunk:l,requiredState:u},c)=>({offset:a.offset+l.length,transitions:[...a.transitions,fC({chunk:l,index:c,intent:t.intent,namespace:n.namespace,paramSpaceOf:i,requiredState:u,testRef:st(t),whenChunk:o.slice(a.offset,a.offset+l.length)})]}),{offset:0,transitions:[]}).transitions}function Bp(e,t){return{absences:uC(e),browser:tt,entities:dC(e),exclusives:e.exclusives,singletons:Object.fromEntries(Object.entries(t).filter(([,n])=>!de(n)&&!Qe(n)))}}function GA(e,t){let n=e.workflows.find(r=>r.name===t.workflow);return n==null||n.steps.length!==t.steps.length?t.steps:n.steps}function Mo(e,t,n){return Object.values(e).flatMap(r=>de(r)?fu(r.ref,n):[]).find(r=>r.entity===t)?.aliasPath}function HA(e,t,n){return t.reduce((r,i)=>({requiredState:KA(r.requiredState,i,n),withRequiredState:[...r.withRequiredState,{chunk:i,requiredState:sC(r.requiredState,i)}]}),{requiredState:e,withRequiredState:[]}).withRequiredState}function KA(e,t,n){let r=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>qA(i,o,n),e);return{...r,browser:dn(r.browser,nC(t)),singletons:{...r.singletons,...oC(t)}}}function qA(e,t,n){return t.assertion.kind==="deleted"?YA(e,t,n):t.assertion.kind==="created"?JA(e,t.entity,t.assertion.as,t.assertion.props,n):eC(e,t,n)}function YA(e,t,n){let r=Mo(t.key,t.entity,n.namespace),i=e.entities.find(a=>a.alias===r),o=ni(ZA(t.key),n),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...XA(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==r)}}function ZA(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let n=t[1];return Vp(n)?[]:[[t[0],n]]}))}function XA(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(n=>!t.relations.some(r=>r.field===n.field)),...t.relations]}}function JA(e,t,n,r,i){let o=ni(r,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!QA(o,s)),entities:[...e.entities,{alias:n,entity:t,...o}]}}function QA(e,t){return Object.entries(t.literals).every(([r,i])=>e.literals[r]===i)&&t.relations.every(r=>e.relations.some(i=>i.field===r.field&&i.targetAlias===r.targetAlias&&i.targetField===r.targetField))}function eC(e,t,n){if(t.assertion.kind!=="updated")return e;let r=Mo(t.key,t.entity,n.namespace);if(r==null)return e;let i=ni(Tn(t.assertion.props),n),o=Object.entries(t.assertion.props).filter(([,a])=>fn(a)).map(([a])=>a),s=a=>a.alias===r?tC(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a))}}function tC(e,t,n){let r=Object.entries(e.literals).filter(([i])=>!n.includes(i)&&!(i in t.literals));return{...e,literals:{...Object.fromEntries(r),...t.literals},relations:[...e.relations.filter(i=>!t.relations.some(o=>o.field===i.field)),...t.relations]}}function nC(e){return e.reduce((t,n)=>dn(dn(t,rC(n)),iC(n)),tt)}function rC(e){return e.action.kind==="goto"?Zr(e.action.url):tt}function iC(e){return du(e.expect).reduce((t,n)=>n.kind==="browser"?wo(t,jt(n.name,n.part),n.value):t,tt)}function du(e){return e.flatMap(t=>t.kind==="and"?du(t.predicates):[t])}function oC(e){return Object.fromEntries(e.flatMap(t=>du(t.expect).flatMap(n=>n.kind==="singleton"?[[n.singleton,n.assertion.value]]:[])))}function sC(e,t){return t[0]?.action.kind!=="goto"?e:{...e,browser:tt}}function To(e,t){let n=Up(t);return{namespace:n.namespace,requiredState:Bp(n,t.singletons)}}function Fp(e,t){return[...new Set(e)].flatMap(n=>fu(n,t))}function pt(e){return de(e)?[e.ref]:Qe(e)?e.template.flatMap(t=>de(t)?[t.ref]:[]):[]}function Nn(e){switch(e.kind){case"visible":case"disabled":case"enabled":case"focused":case"checked":return hn(e.locator);case"value":case"text":return[...hn(e.locator),...pt(e.value)];case"singleton":return pt(e.assertion.value);case"browser":return pt(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(Tn(e.assertion.props)).flatMap(t=>pt(t)),...Object.values(e.key).flatMap(t=>jp(t))];case"not":return Nn(e.predicate);case"when":return e.branches.flatMap(t=>t.consequence.flatMap(n=>Nn(n)));case"and":return e.predicates.flatMap(t=>Nn(t));case"count":return[]}}function Up(e){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map(e.world.map(t=>[t.as,t.entity])),setups:e.world}}function hn(e){return e.by==="inside"?[...hn(e.scope),...hn(e.target)]:e.by==="role"?e.name==null?[]:pt(e.name):pt(e.value)}function jp(e){return Vp(e)?Object.values(e.selection.where).flatMap(t=>jp(t)):pt(e)}function Vp(e){return typeof e=="object"&&e!==null&&"kind"in e}function aC(e){return e.kind==="goto"?pt(e.url):e.kind==="fill"||e.kind==="select"?[...hn(e.locator),...pt(e.value)]:e.kind==="press"?e.locator==null?[]:hn(e.locator):(e.kind==="upload",hn(e.locator))}function lC(e){return[...aC(e.action),...e.expect.flatMap(t=>Nn(t))]}function uC(e){return e.absences.map(t=>({entity:t.entity,...ni(t.where,e)}))}function ni(e,t){let n=Object.entries(e),r=Object.fromEntries(n.flatMap(([o,s])=>de(s)||Qe(s)?[]:[[o,s]])),i=n.flatMap(o=>{let s=o[1];if(!de(s))return[];let a=fu(s.ref,t.namespace).at(0);return a==null?[]:[{entity:a.entity,field:o[0],targetAlias:a.aliasPath,targetField:a.field}]});return{literals:r,relations:i}}function cC(e,t){return e.map(n=>({alias:n.as,entity:n.entity,...ni(n.set,t)}))}function dC(e){return cC(e.setups,e)}function fC(e){let t=e.chunk.findIndex(s=>s.action.kind!=="goto"),n=t===-1?e.chunk:e.chunk.slice(0,t),r=e.chunk.slice(n.length),i=r.at(-1)??e.chunk.at(-1);if(i==null)throw new Error("empty transition chunk");let o=[...new Set(e.chunk.flatMap(s=>lC(s)))];return{effectStep:i,index:e.index,intent:e.intent,namespace:e.namespace,nav:n,paramSpaces:Object.fromEntries(o.filter(s=>e.paramSpaceOf.has(s)).map(s=>[s,e.paramSpaceOf.get(s)])),requiredState:e.requiredState,steps:r,test:e.testRef,wait:hp(r.flatMap(s=>hC(s))),whenSteps:e.whenChunk}}function hC(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function fu(e,t){let n=Pn(e);if(n==null)return[];let r=t.get(n.alias);return r==null?[]:[{aliasPath:n.alias,entity:r,field:n.field,ref:e}]}function pC(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function mC(e,t){return new Map(Object.entries(e.params).map(([n,r])=>[n,t.get(r.valueSpace)]))}function yC(e){return cu(e,0,[],[])}function cu(e,t,n,r){let i=e[t];if(i==null)return n.length===0?r:[...r,n];let o=[...n,i];return gC(i)?cu(e,t+1,[],[...r,o]):cu(e,t+1,o,r)}function gC(e){return e.expect.some(t=>t.kind==="state")}function Wp(e){return zp(e,new Map)}function bC(e,t){return e.reduce((n,r)=>n??t(r),null)}function zp(e,t){let n=e.variables.find(r=>!t.has(r));return n==null?t:bC(e.domain(n),r=>{let i=new Map([...t,[n,r]]);return e.consistent(i)?zp(e,i):null})}function mt(e,t){let n=Gp(e,t);if(n==null)return null;let r=EC(n);return kC(e.singletons,t.singletons,r)&&PC(e.browser,t.browser,r)?r:null}function Gp(e,t){let{absences:n,entities:r,exclusives:i}=e,o=new Map(r.map(a=>[a.alias,a])),s=Wp({variables:r.map(a=>a.alias),consistent:a=>SC(a)&&wC(r,a)&&vC(n,a,t),domain:a=>AC(o.get(a),t)});return s==null?null:CC(i,r,s,t)?s:null}function SC(e){let t=[...e.values()];return new Set(t).size===t.length}function wC(e,t){return e.every(n=>t.has(n.alias)?n.relations.every(r=>xC(n,r,t)):!0)}function xC(e,t,n){if(!n.has(t.targetAlias))return!0;let r=n.get(t.targetAlias)?.[t.targetField];return r==null?!0:n.get(e.alias)?.[t.field]===r}function vC(e,t,n){return e.every(r=>![...n.entities.get(r.entity)?.values()??[]].some(i=>RC(i,r,t)))}function RC(e,t,n){return Hp(e,t)?t.relations.every(r=>{if(!n.has(r.targetAlias))return!1;let i=n.get(r.targetAlias)?.[r.targetField];return i!=null&&e[r.field]===i}):!1}function Hp(e,t){return Object.entries(t.literals).every(([n,r])=>r===null?e[n]==null:e[n]===r)}function AC(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(n=>Hp(n,e))}function CC(e,t,n,r){return e.every(i=>{let o=t.filter(a=>a.entity===i&&n.has(a.alias)).length;return(r.entities.get(i)?.size??0)===o})}function EC(e){return new Map([...e].flatMap(([t,n])=>Object.entries(n).flatMap(r=>{let i=r[1];return typeof i=="string"||typeof i=="number"||typeof i=="boolean"?[[It(`${t}.${r[0]}`),i]]:[]})))}function kC(e,t,n){return Object.entries(e).every(([r,i])=>Ql(i,J,n)?t[r]===et(i,J,n):!1)}function PC(e,t,n){return Mn(e).every(({clause:r,key:i})=>{if(r===null)return er(t,i)===void 0;if(!Ql(r,J,n))return!1;let o=et(r,J,n);return er(t,i)===(typeof o=="string"?o:void 0)})}function qp(e,t,n){return e.reduce((r,i)=>{let o=Jr(r.snapshot,IC(i),n);return{resolved:[...r.resolved,MC(i,o,n)],snapshot:o}},{resolved:[],snapshot:t}).resolved}function IC(e){return e.expect.filter(t=>t.kind==="state")}function MC(e,t,n){return e.expect.some(r=>r.kind==="when")?{...e,expect:e.expect.flatMap(r=>Yp(r,{env:n,snapshot:t}))}:e}function Yp(e,t){if(e.kind!=="when")return[e];let n=TC(e,t);return n==null?[]:n.flatMap(r=>Yp(r,t))}function TC(e,t){return e.branches.find(n=>n.condition==null||hu(n.condition,t))?.consequence}function hu(e,t){if(e.kind==="count")return On(t.snapshot,e.entity,{},t.env).length===e.value;if(e.kind==="singleton"){let n=et(e.assertion.value,J,t.env);return Kp(t.snapshot.singletons[e.singleton])===Kp(n)}return e.kind==="not"?!hu(e.predicate,t):e.predicates.every(n=>hu(n,t))}function Kp(e){return e==null?"\u2205":JSON.stringify(e)}function ri(e,t,n){let r=mt(e.requiredState,t);return r==null?null:new Map([...r,...Object.entries(n).map(([i,o])=>[It(i),o])])}function ii(e,t,n){let r=qp(e.whenSteps,n,t),i=r.at(-1)??e.effectStep,o=tr(i,t),s=NC(e,t);return{effect:$C(o.effect,s),steps:r.map(a=>{let l=tr(a,t);return{action:l.action,effect:l.effect,pendingChecks:l.pendingChecks,reconcile:l.reconcile,source:a,verifyChanges:l.verifyChanges}})}}function No(e,t,n){return mt(e.requiredState,n)==null?!1:Oo(t(n))!==Oo(n)||_C(e)||OC(e)}function OC(e){return[...e.nav,...e.steps].every(t=>t.expect.every(n=>n.kind!=="state"))}var Zp=new WeakMap;function Oo(e){let t=Zp.get(e);if(t!=null)return t;let n=F({browser:{...e.browser},entities:[...e.entities].map(([r,i])=>[r,[...i]]),singletons:{...e.singletons}});return Zp.set(e,n),n}function NC(e,t){let n=e.nav.at(-1);return n==null?void 0:tr(n,t).action.url}function $C(e,t){if(t==null)return e;let n=Ut(t);return r=>{let i=e(r);return{...i,browser:vo(i.browser,n)}}}function _C(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(n=>fn(n)))}function $o(e,t,n){let r=ri(e,t.snapshot,n);if(r==null)return null;let i=LC(e,r,t.snapshot);return i==null||!No(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function Xp(e,t,n){let r=ri(e,t.snapshot,n);if(r==null)return"required-state-unsatisfied";try{return ii(e,r,t.snapshot),"no-effect"}catch{return"unresolvable"}}function LC(e,t,n){try{return ii(e,t,n)}catch{return null}}function oi(e,t,n){return e.flatMap((r,i)=>{let o=n(r),s=$o(r,t,o);return s==null?[]:[{idx:i,label:Tt(r),params:o,stepRun:s}]})}var DC={absences:[],browser:tt,entities:[],exclusives:[],singletons:{}};function rr(e){return{...DC,...e}}function si(e,t){if(e==null)return new Set;if(e.by==="inside")return new Set([...si(e.scope,t),...si(e.target,t)]);let n=e.by==="role"?e.name:e.value;return new Set(t(n))}function _o(e){return BC(e).flatMap(t=>FC(t))}function BC(e){return[...e.reduce((n,r)=>{let i=F([r.when.singletons,r.when.browser,r.consequence]);return new Map([...n,[i,[...n.get(i)??[],r]]])},new Map).values()]}function FC(e){if(e.length<2)return[];let t=e.map(o=>new Set(o.when.entities.map(s=>pu(s)))),[n]=t;if(n==null)return[];let r=[...n].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||r.length===i.when.entities.length?[]:UC(e,r)?[]:zC(i,r,HC(e))}function pu(e){return F([e.entity,e.literals])}function UC(e,t){return e.some(n=>{let r=Jp(n.consequence),i=jC(r),o=VC(r);return n.when.entities.some(s=>!t.includes(pu(s))&&(WC(s,i)||o.has(s.alias)))})}function Jp(e){return e.kind==="not"?Jp(e.predicate):"locator"in e?e.locator:void 0}function jC(e){return si(e,t=>t==null||de(t)||Qe(t)?[]:[t])}function VC(e){return si(e,t=>{if(t==null||!de(t))return[];let n=Pn(t.ref);return n==null?[]:[n.alias]})}function WC(e,t){return Object.values(e.literals).some(n=>typeof n=="string"&&t.has(n))}function zC(e,t,n){let r=e.when.entities.filter(l=>t.includes(pu(l))),i=e.when.entities.filter(l=>!r.includes(l)).filter(l=>e.when.exclusives.includes(l.entity)).map(l=>({...l,literals:{},relations:[]})),o=[...r,...i],s=new Set(o.map(l=>l.alias));if(![...e.refs].every(l=>s.has(l)))return[];let a=rr({browser:e.when.browser,entities:o.map(l=>GC(l,s)),exclusives:e.when.exclusives.filter(l=>o.some(u=>u.entity===l)),singletons:e.when.singletons});return[{consequence:e.consequence,origin:{kind:"generalized",tests:n},refs:e.refs,when:a}]}function GC(e,t){return{...e,relations:e.relations.filter(n=>t.has(n.targetAlias))}}function HC(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function nm(e){return e.flatMap((t,n)=>e.slice(n+1).flatMap(r=>im(t,r)))}function rm(e,t){return im(e,t).length>0}function im(e,t){let n=Qp(e.when,t.when);return!n&&!Qp(t.when,e.when)||!YC(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:n?t.when:e.when}]}function Qp(e,t){return em(e.entities,t.entities)&&em(e.absences,t.absences)&&e.exclusives.every(n=>t.exclusives.includes(n))&&KC(e.singletons,t.singletons)&&qC(e.browser,t.browser)}function em(e,t){let n=new Set(t.map(r=>F(r)));return e.every(r=>n.has(F(r)))}function KC(e,t){return Object.entries(e).every(([n,r])=>n in t&&F(t[n])===F(r))}function qC(e,t){let n=new Map(Mn(t).map(r=>[F(r.key),r.clause]));return Mn(e).every(r=>{let i=F(r.key);return n.has(i)&&F(n.get(i))===F(r.clause)})}function YC(e,t){return e.kind==="not"?mu(e.predicate,t):t.kind==="not"?mu(e,t.predicate):ZC(e,t)||XC(e,t)}function mu(e,t){return e.kind===t.kind&&"locator"in e&&"locator"in t&&om(e,t)}function om(e,t){return"locator"in t&&F(e.locator)===F(t.locator)}function ZC(e,t){let n=new Set([e.kind,t.kind]);return n.has("enabled")&&n.has("disabled")&&"locator"in e&&"locator"in t?om(e,t):!1}function XC(e,t){let n=tm(e),r=tm(t);return n==null||r==null||e.kind!==t.kind?!1:mu(e,t)&&F(n)!==F(r)}function tm(e){return e.kind==="value"||e.kind==="text"?e.value:null}function sm(e,t){return e.flatMap(n=>{let r=JC(n),i=new Set(n.requiredState.absences.map(o=>o.entity));return t.flatMap(o=>QC(n,o,r,i))})}function JC(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(n=>n.kind==="state"&&n.assertion.kind==="deleted"?[n.entity]:[])))}function QC(e,t,n,r){let{source:i,target:o}=t.reference;return!n.has(o)||n.has(i)||r.has(i)?[]:[{dataRule:t,source:i,target:o,transition:Tt(e)}]}function yu(e){return F({consequence:e.consequence,when:e.when})}function Do(e){let t=[...eE(e),...hE(e)],n=_o(t).reduce((r,i)=>[...t,...r].some(s=>rm(i,s))?r:[...r,i],[]);return Wt([...t,...n],yu)}function Bo(e,t){return e.filter(n=>!tE(n)||nE(n)===t)}function Fo(e){return e.kind==="not"?Fo(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="value"||e.kind==="text"}function Uo(e,t,n){if(mt(e.when,t)!=null)return null;let r=mt(e.when,n);return r==null?null:mE(e,r)}function eE(e){return Wt(Mt(e).flatMap(t=>rE(e,t)),yu)}function tE(e){return e.origin==null||e.origin.kind==="generalized"?!1:Nn(e.consequence).some(t=>Pn(t)!=null)}function nE(e){let{origin:t}=e;if(!(t==null||t.kind==="generalized"))return t.test}function rE(e,{test:t,workflow:n}){let r=To(e,t),i=iE(n.steps);return t.steps.reduce((o,s)=>({pageRules:[...o.pageRules,...fE({branchScoped:i,namespace:r.namespace,origin:{kind:"test",test:st(t)},requiredState:o.requiredState,step:s})],requiredState:oE(o.requiredState,s,r)}),{pageRules:[],requiredState:r.requiredState}).pageRules}function iE(e){let t=e.flatMap(n=>n.expect).flatMap(n=>Lo(n)).map(n=>F(n));return new Set(t)}function Lo(e){return e.kind==="not"?Lo(e.predicate):e.kind==="and"?e.predicates.flatMap(t=>Lo(t)):e.kind!=="when"?[]:e.branches.flatMap(t=>t.consequence.flatMap(n=>[n,...Lo(n)]))}function oE(e,t,n){return t.expect.reduce((r,i)=>i.kind==="state"?sE(r,i,n):r,e)}function sE(e,t,n){if(t.assertion.kind==="created"){let o=aE(t.assertion.as,t.entity,t.assertion.props,n);return{...e,entities:[...e.entities,o]}}let r=Mo(t.key,t.entity,n.namespace);if(r==null)return e;if(t.assertion.kind==="deleted")return cE(e,r);let i=Tn(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===r?lm(o,i,n):o)}}function aE(e,t,n,r){return lm({alias:e,entity:t,literals:{},relations:[]},n,r)}function lm(e,t,n){return Object.entries(t).reduce((r,[i,o])=>{if(Qe(o))return r;if(de(o)){let s=lE(o.ref,i,n.namespace);return{...r,literals:uE(r.literals,i),relations:s==null?r.relations:[...am(r.relations,i),s]}}return{...r,literals:{...r.literals,[i]:o},relations:am(r.relations,i)}},e)}function lE(e,t,n){let r=Pn(e);if(r==null)return;let i=n.get(r.alias);return i==null?void 0:{entity:i,field:t,targetAlias:r.alias,targetField:r.field}}function uE(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>n!==t))}function am(e,t){return e.filter(n=>n.field!==t)}function cE(e,t){let n=e.entities.find(i=>i.alias===t),r=dE(e,t);return n==null?r:{...r,absences:[...r.absences,{entity:n.entity,literals:n.literals,relations:n.relations}]}}function dE(e,t){return{...e,entities:e.entities.filter(n=>n.alias!==t)}}function fE({branchScoped:e,namespace:t,origin:n,requiredState:r,step:i}){if(i.action.kind!=="goto")return[];let o=i.action.url,s=dn(Zr(o),um(i));return i.expect.filter(a=>Fo(a)).filter(a=>!e.has(F(a))).map(a=>dm({browser:s,consequence:a,namespace:t,origin:n,requiredState:r,url:o}))}function um(e){return cm(e.expect).reduce((t,n)=>n.kind==="browser"?wo(t,jt(n.name,n.part),n.value):t,tt)}function cm(e){return e.flatMap(t=>t.kind==="and"?cm(t.predicates):[t])}function dm({browser:e,consequence:t,namespace:n,origin:r,requiredState:i,url:o}){return{consequence:t,origin:r,refs:new Set(Fp([...pt(o),...Nn(t)],n).map(s=>s.aliasPath)),when:{...i,browser:dn(i.browser,e)}}}function hE(e){return Wt($n(e).flatMap(t=>pE(t)),yu)}function pE(e){let t=e.nav.at(-1),n=e.steps[0]?.action,r=n!=null&&"locator"in n?n.locator:void 0;if(t==null||t.action.kind!=="goto"||r==null)return[];let i={kind:"enabled",locator:r,wait:void 0};return[dm({browser:dn(Zr(t.action.url),um(t)),consequence:i,namespace:e.namespace,origin:{intent:e.intent,kind:"trigger",test:e.test},requiredState:e.requiredState,url:t.action.url})]}function mE(e,t){try{let n=ko(e.consequence,t);return n==null?null:{check:n}}catch{return null}}function jo(e){return Dp(Mt(e).flatMap(t=>yE(e,t.test)))}function Vo(e,t){return mt(e.when,t)==null?!1:mt(e.holds,t)==null}function yE(e,t){let n=To(e,t);return n.requiredState.entities.flatMap(r=>r.relations.flatMap(i=>gE(e,r,i,n.namespace)?wE(r,i,n.namespace):[]))}function gE(e,t,n,r){let i=r.get(n.targetAlias);return i!=null&&!bE(e,t.entity,n.field)&&SE(e,i,n.targetField)}function bE(e,t,n){return e.entities.find(r=>r.name===t)?.props[n]?.optional===!0}function SE(e,t,n){return e.entities.find(r=>r.name===t)?.identity.includes(n)===!0}function wE(e,t,n){let r=n.get(t.targetAlias);if(r==null)return[];let i=fm(e.alias,e.entity),o=fm(t.targetAlias,r);return[{holds:rr({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:r,targetField:t.targetField},when:rr({entities:[i]})}]}function fm(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function hm(e,t){let n=[...t.entities].flatMap(([o,s])=>[...s].map(([a,l])=>xE({entity:o,key:a,pre:e,row:l}))),r=[...e.entities].flatMap(([o,s])=>[...s].flatMap(([a,l])=>vE({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:[...n,...r],singletons:i}}function xE({entity:e,key:t,pre:n,row:r}){let i=RE(n.entities.get(e),t),o=Object.entries(r).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 vE({entity:e,key:t,post:n,row:r}){if(n.entities.get(e)?.has(t)===!0)return[];let i=Object.entries(r).map(([o,s])=>({changed:!1,field:o,value:s}));return[{changed:!0,entity:e,fields:i,key:t,status:"deleted"}]}function RE(e,t){return e?.get(t)}function Wo(e,t,n){return t.steps.map(r=>({effect:r.effect,pendingChecks:r.pendingChecks.map(i=>({budget:i.budget,check:{kind:"poll",run:()=>n.evaluate(i.check)},source:{check:i.check,kind:"step"},targetIds:()=>n.locateIds(zo(i.check))})),reconcile:r.reconcile,source:r.source,step:{action:r.action,intent:e.intent,test:e.test},sync:e.wait,verifyChanges:r.verifyChanges,perform:()=>n.perform(r.action),requiredState:()=>!0,targetIds:()=>n.locateIds(r.action.locator)}))}function zo(e){if(e.kind==="not")return zo(e.inner);if(e.kind!=="browser")return e.locator}async function bu(e,t){let{params:n,transition:r}=e.stepRun,i=$o(r,e.state,n);if(i==null){let s={intent:r.intent,kind:"unrunnable",reason:Xp(r,e.state,n),test:r.test};return{label:Tt(r),next:e.state,result:{finalModel:e.state.snapshot,findings:[s]}}}let o=await Ao({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,pageRulePendingChecks:AE(e.pageRules,e.dataRules,e.driver),steps:Wo(e.stepRun.transition,i.resolved,e.driver),stopAfterStep:e.stopAfterStep==null?void 0:e.stopAfterStep-e.stepBase},t);return{label:Tt(e.stepRun.transition),next:{snapshot:o.finalModel},result:o}}function pm(e,t){return Vo(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},source:{dataRule:e,kind:"data-rule"},targetIds:()=>Promise.resolve([])}]:[]}function AE(e,t,n){return(r,i)=>[...e.flatMap(o=>CE(o,r,i,n)),...t.flatMap(o=>pm(o,i))]}function CE(e,t,n,r){let i=Uo(e,t,n);return i==null?[]:[{budget:"fast",check:{kind:"poll",run:()=>r.evaluate(i.check)},source:{check:i.check,kind:"page-rule",origin:e.origin},targetIds:()=>r.locateIds(zo(i.check))}]}function ai(e,t){return gu({acc:{findings:[],ran:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function gu({acc:e,index:t,params:n,signal:r,state:i,stepBase:o}){ot(r);let s=n.sequence[t];if(s==null)return e;let a=Date.now(),l=[],u=await bu({canon:n.canon,classify:n.classify,dataRules:n.dataRules,driver:n.driver,onAssertion:n.onAssertion,pageRules:n.pageRules,state:i,stepBase:o,stepRun:s,stopAfterStep:n.stopAfterStep,onStep:d=>{l.push(d.index),n.onEvent({annotations:d.annotations,endMs:d.endMs,findings:d.findings,index:o+d.index,kind:"step",source:d.source,startMs:d.startMs,state:hm(d.pre,d.post),url:d.url})}},r);if(u==null)return gu({acc:e,index:t+1,params:n,signal:r,state:i,stepBase:o});n.onEvent({endMs:Date.now(),intent:s.transition.intent,kind:"ran",startMs:a}),u.result.findings.forEach(d=>{n.onEvent({finding:d,kind:"finding"})});let c={findings:[...e.findings,...u.result.findings],ran:[...e.ran,u.label]};return u.result.findings.length>0||n.stopAfterStep!=null&&o+l.length>=n.stopAfterStep?c:gu({acc:c,index:t+1,params:n,signal:r,state:u.next,stepBase:o+l.length})}var li={value:e=>EE(e)};function qo(e,t){return{value:n=>e.value({...n,seed:`${t}:${n.seed}`})}}function Yo(e,t){return{value:n=>e.value({...n,anchor:t})}}function EE({anchor:e,constraints:t,generator:n,nullable:r,seed:i,type:o,values:s,valueSpace:a}){let l=Su(`${a}:${i}`);return r&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:n==="date.iso"?kE({anchor:e,constraints:t,n:l,timeHash:Su(`${a}:${i}#tod`)}):o==="number"?PE(l,t):o==="boolean"?l%2===0:NE(n,l)}var Go=864e5;function kE({anchor:e,constraints:t,n,timeHash:r}){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+n%o,a=Math.floor(i/Go)*Go;return new Date(a+s*Go+r%Go).toISOString()}function Su(e,t=0,n=7){return t>=e.length?n>>>0:Su(e,t+1,n*31+(e.codePointAt(t)??0)>>>0)}function PE(e,t){if(t?.kind!=="number"||t.min==null||t.max==null)throw new Error("number value space requires min and max constraints");let n=t.max-t.min+1;return n<=0?t.min:t.min+e%n}var IE=["ada","bruno","carmen","dario","elena","felix","greta","hugo","iris","jonas","kira","lena","mateo","nadia","oscar","petra","quinn","rosa","stefan","tara","ugo","vera","wim","yara"],ME=["abreu","berg","costa","duval","eriksen","fischer","garza","holm","ito","jansen","kovac","laurent","moreau","novak","okafor","petrov","quist","rossi","sato","tanaka","ueda","vargas","weber","zhang"],TE=["amber","brisk","calm","deep","early","fond","glad","hazel","ivory","jade","keen","lush","mauve","noble","opal","plum","quiet","rapid","sage","teal","umber","vivid","warm","zesty"],OE=["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 Ho(e,t){let n=e[t%e.length];if(n==null)throw new Error("empty word list");return n}function Ko(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function NE(e,t){let n=Ho(IE,t),r=Ho(ME,Math.floor(t/31)),i=Ho(TE,t),o=Ho(OE,Math.floor(t/29));return e==="internet.email"?`${n}.${r}${String(t%100)}@test.ripplo.ai`:e==="internet.url"?`https://${i}-${o}.example.com`:e==="person.fullName"?`${Ko(n)} ${Ko(r)}`:e==="company.name"?`${Ko(i)} ${Ko(o)}`:e==="lorem.slug"?`${i}-${o}`:`${o}-${String(t%1e3)}`}var le=tl(gm(),1),ke={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))},DE={assertion:le.default.yellow,consistency:le.default.magenta,"data rule":le.default.yellow,driver:le.default.red,"impossible action":le.default.cyan,"page rule":le.default.yellow,skipped:le.default.red};function yt(e){return`${le.default.red(le.default.bold("\u2717"))} ${DE[e](le.default.bold(e))}`}var BE=le.default.red("\u2717"),kj=le.default.green("\u2713"),FE=le.default.dim("\u203A"),UE=8;function bm(e,t,n){let r=n==null?"":` ${ke.dim(n)}`;return` ${ke.dim(e.padStart(UE))} ${t}${r}`}function _n(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${_n(e.scope)} \u25B8 ${_n(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function ts(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${_n(e.locator)}`:e.kind}function zt(e){if(e.kind==="not")return`not ${zt(e.inner)}`;if(e.kind==="browser"){let t=Ke(e.key);return e.value===null?`${t} absent`:`${t}="${e.value}"`}return e.kind==="value"||e.kind==="text"?`${e.kind} ${_n(e.locator)}="${e.value}"`:`${e.kind} ${_n(e.locator)}`}function or(e){let{field:t,source:n,target:r,targetField:i}=e.reference;return`${n}.${t} \u2192 ${r}.${i}`}function Gt(e){return`${e.intent} \u203A ${ts(e.action)}`}function xu(e){return e.kind==="data-rule"?`data rule ${or(e.dataRule)}`:`${e.kind} ${zt(e.check)}`}function ee(e){return e==null?"\u2205":JSON.stringify(e)}function vu(e){return e.kind==="unexpected-row"?`${e.entity} "${e.key}" present in the app but the test expected none`:e.kind==="missing-row"?`${e.entity} "${e.key}" expected by the test but missing in the app`:e.kind==="wrong-value"?`${e.entity}.${e.field} [${e.key}] expected=${ee(e.snapshot)} actual=${ee(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${ee(e.value)}`:e.kind==="browser-mismatch"?`${Ke(e.key)} expected=${ee(e.snapshot)} actual=${ee(e.sut)}`:`${e.singleton} expected=${ee(e.snapshot)} actual=${ee(e.sut)}`}function ns(e){return{label:xu(e.source),step:Gt(e.step)}}function rs({evidencePath:e,finding:t}){let n=jE(t);return e==null?n:`${n} Evidence: ${ke.path(e)}`}function Ru(e){return WE(zE(e))}function jE(e){return e.kind==="consistency"?JE(e):e.kind==="pending-check"?tk(e.source,e.step,e.budget):e.kind==="impossible-action"?`${yt("impossible action")} The step "${e.step.intent}" ran ${ts(e.step.action)} from a state the test says can't happen. Either the test's required state is stricter than the app really is, or the app exposes this action somewhere it shouldn't \u2014 check which before loosening the test.`:e.kind==="unrunnable"?`${yt("skipped")} The planned step "${e.intent}" could not run \u2014 ${Sm(e.reason)}. A planned move was skipped, so this run proved less than it claims \u2014 fix the plan or the starting state rather than ignoring the skip.`:`${yt("driver")} The browser failed while running "${e.step.intent}" \u2014 ${un(e.error)}. This is an environment failure (daemon, dev server, ports), not an app or test bug \u2014 fix the run environment and rerun.`}var VE=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function WE(e){return e.replaceAll(VE,"").replaceAll(/\s+/g," ").trim()}function zE(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${vu(e.mismatch)}${t}`}return e.kind==="pending-check"?`${rk(e.source)} failed at "${e.step.intent}": ${ik(e.source)}`:e.kind==="impossible-action"?`"${e.step.intent}" ran from a state the test says can't happen`:e.kind==="unrunnable"?`planned step "${e.intent}" could not run \u2014 ${Sm(e.reason)}`:`driver failed at "${e.step.intent}": ${un(e.error)}`}var GE={"no-effect":"the action has no observable effect from this state","required-state-unsatisfied":"the live state doesn't satisfy the step's required state",unresolvable:"a step references a value that doesn't exist yet (e.g. a not-yet-created id)"};function Sm(e){return GE[e]}function wm({debugDir:e,runId:t}){let n=`${e}/${t}`;return bm("behavior",ke.path(`${n}/behavior.jsonl`),void 0)}function xm(e){if(e.kind==="cascade-gap"){let{gap:n}=e;return`${yt("data rule")} ${n.transition} deletes ${n.target} but leaves ${n.source} rows pointing at the deleted row. That breaks the data rule ${or(n.dataRule)} \u2014 cascade the delete in the app or declare the cleanup on the deleting step.`}if(e.kind==="create-gap"){let{gap:n}=e,r=n.missing.length===1?"field":"fields",i=n.missing.length===1?"it":"them";return`${yt("data rule")} ${n.transition} creates ${n.entity} without setting the required ${r} ${n.missing.join(", ")}. Set ${i} on the creating step or drop the requirement from the entity.`}let{conflict:t}=e;return`${yt("page rule")} Two page rules contradict each other \u2014 ${t.a.kind} vs ${t.b.kind} when ${JSON.stringify(t.when.singletons)}. They were learned from different tests asserting opposite things about the same page \u2014 one of those tests is wrong, fix it before trusting either rule.`}function vm(e){return"locator"in e&&e.locator!=null?`${e.kind} ${Qo(e.locator)}`:"url"in e?`${e.kind} ${HE(e.url)}`:e.kind}function HE(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:Cm(e)}function Jo(e){return e.kind==="not"?`not ${Jo(e.predicate)}`:e.kind==="and"?e.predicates.map(t=>Jo(t)).join(" \u2227 "):e.kind==="when"?e.branches.map(t=>t.name).join(" | "):KE(e)}function Rm(e){let t=e.browser.path;return t==null?"(any view)":typeof t!="object"?String(t):"template"in t?t.template.map(n=>typeof n=="string"?n:":id").join(""):`{${t.ref}}`}function Am(e){let t=[...e.entities.map(n=>qE(n)),...Mn(e.browser).filter(n=>n.key.kind!=="path").map(n=>`${Ke(n.key)}=${pn(n.clause)}`),...Object.entries(e.singletons).map(([n,r])=>`${n}=${pn(r)}`)];return t.length===0?"always":t.join(" \u2227 ")}function KE(e){if("locator"in e){let t=Qo(e.locator);return e.kind==="value"||e.kind==="text"?`${e.kind} ${t}=${pn(e.value)}`:`${e.kind} ${t}`}return e.kind==="browser"?`${e.name}=${pn(e.value)}`:e.kind==="singleton"?`${e.singleton}=${pn(e.assertion.value)}`:e.kind==="count"?`${e.entity} count ${String(e.value)}`:""}function Qo(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${pn(e.name)}`:e.by==="inside"?`${Qo(e.scope)} \u25B8 ${Qo(e.target)}`:pn(e.value)}function pn(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 qE(e){let t=Object.entries(e.literals).map(([n,r])=>`${n}=${pn(r)}`);return t.length===0?e.entity:`${e.entity}(${t.join(", ")})`}function es(e){return e==null?"At the end of the run":`After ${ZE(e.action)} in ${e.intent}`}var YE={click:"clicking",fill:"filling",goto:"opening",hover:"hovering over",press:"pressing",select:"selecting",upload:"uploading to"};function ZE(e){return e.url!=null?`opening ${e.url}`:e.locator!=null?`${YE[e.kind]??e.kind} ${ir(e.locator)}`:e.kind}function ir(e){return e.by==="testId"?`the element with testId "${e.value}"`:e.by==="inside"?`${ir(e.target)} inside ${ir(e.scope)}`:e.name==null?`the ${e.role}`:`the "${e.name}" ${e.role}`}function XE(e){return e.kind==="not"&&e.inner.kind==="visible"?`${ir(e.inner.locator)} never disappeared`:e.kind==="visible"?`${ir(e.locator)} never appeared`:e.kind==="value"||e.kind==="text"?`${ir(e.locator)} never showed "${e.value}"`:`the check ${zt(e)} never held`}function JE(e){let t=e.pending?QE(e):ek(e.mismatch,e.step);return`${yt("consistency")} ${t}`}function QE(e){let t=`${Em(e.budget)} wait window`,n="If this write is legitimately slow, declare wait: on the expectation or move it to a slower tier.",{mismatch:r}=e,i=es(e.step);return r.kind==="wrong-value"?`${i}, ${r.entity}.${r.field} on row "${r.key}" never changed within the ${t} \u2014 it still showed ${ke.actual(ee(r.sut))} instead of ${ke.expected(ee(r.snapshot))}, so the write may not have landed at all. ${n}`:r.kind==="unexpected-row"?`${i}, the ${r.entity} row "${r.key}" was still there at the end of the ${t} \u2014 the delete may not have landed. ${n}`:r.kind==="missing-row"?`${i}, the ${r.entity} row "${r.key}" never appeared within the ${t} \u2014 the create may not have landed. ${n}`:r.kind==="expected-change"?`${i}, ${r.entity}.${r.field} on row "${r.key}" was expected to change but stayed ${ke.actual(ee(r.value))} through the ${t}, so the write may not have landed at all. ${n}`:r.kind==="browser-mismatch"?`${i}, ${Ke(r.key)} never changed within the ${t} \u2014 it still showed ${ke.actual(ee(r.sut))} instead of ${ke.expected(ee(r.snapshot))}, so the write may not have landed at all. ${n}`:`${i}, ${r.singleton} never changed within the ${t} \u2014 it still showed ${ke.actual(ee(r.sut))} instead of ${ke.expected(ee(r.snapshot))}, so the write may not have landed at all. ${n}`}function Em(e){return`${String(Vt[e]/1e3)}s`}function ek(e,t){let n=es(t);return e.kind==="wrong-value"?`${n}, ${e.entity}.${e.field} on row "${e.key}" showed ${ke.actual(ee(e.sut))} but the test expected ${ke.expected(ee(e.snapshot))}. This is an app bug if the expected value is the promised behavior \u2014 if the app legitimately owns this value, assert changed() instead.`:e.kind==="singleton-mismatch"?`${n}, ${e.singleton} showed ${ke.actual(ee(e.sut))} but the test expected ${ke.expected(ee(e.snapshot))}. This is an app bug if the expected value is the promised behavior \u2014 otherwise correct the expected value at the step that sets it.`:e.kind==="unexpected-row"?`${n}, the app held a ${e.entity} row "${e.key}" the test never expected. Some step writes this row without declaring it \u2014 declare the effect on the acting step (${e.entity}.created, updated, or deleted), or if this write belongs to a different flow, cover it in that flow's test.`:e.kind==="missing-row"?`${n}, the test expected a ${e.entity} row "${e.key}" but the app had none. This is an app bug if the write was promised \u2014 if it only happens from a different starting state, restrict this test's given and cover that state in its own test.`:e.kind==="browser-mismatch"?`${n}, ${Ke(e.key)} showed ${ke.actual(ee(e.sut))} but the test expected ${ke.expected(ee(e.snapshot))}. This is an app bug if the expected value is the promised behavior \u2014 otherwise correct the expected value at the step that sets it.`:`${n}, ${e.entity}.${e.field} on row "${e.key}" was expected to change but stayed ${ke.actual(ee(e.value))}. This is an app bug if this action should change it \u2014 if the change needs other preconditions, split that case into its own test with the right given.`}function tk(e,t,n){let r=`${Em(n)} wait window`;if(e.kind==="data-rule")return`${yt("data rule")} ${es(t)}, the data rule ${or(e.dataRule)} stopped holding \u2014 a referenced row went missing. This is an app bug if the reference should survive this action \u2014 confirm in behavior.jsonl before relaxing the rule.`;if(e.kind==="page-rule")return`${yt("page rule")} A page rule learned from ${nk(e.origin)} says ${zt(e.check)} at this URL \u2014 it never held here within the ${r}. Either the rule is broader than the app guarantees or this page regressed \u2014 confirm in behavior.jsonl before narrowing the rule.`;let i=`${yt("assertion")} ${es(t)}, ${XE(e.check)} within the ${r}.`;return t.action.locator!=null?`${i} If the page never changed after this action \u2014 the recording goes quiet right after it \u2014 the interaction was likely lost: its target re-rendered or unmounted as it fired, so the click landed on nothing. That is an unstable-render bug in the app, not a missing element. Otherwise it is a wrong accessible name, a UI regression, or a starting state this page doesn't have. Confirm in behavior.jsonl before changing the test.`:`${i} This is usually a wrong accessible name, a UI regression, or a starting state this page doesn't have \u2014 confirm in behavior.jsonl before changing the test.`}function nk(e){return e==null?"another workflow":e.kind==="test"?`an assertion in test "${e.test}"`:e.kind==="trigger"?`the trigger of "${e.intent}" in test "${e.test}"`:`tests ${e.tests.map(n=>JSON.stringify(n)).join(", ")}`}function rk(e){return e.kind==="data-rule"?"data rule":e.kind==="page-rule"?"page rule":"assertion"}function ik(e){return e.kind==="data-rule"?or(e.dataRule):zt(e.check)}function ui(e){return{dataRules:jo(e),pageRules:Do(e)}}var km=Object.defineProperty,Pm=(e,t)=>{let n={};for(var r in e)km(n,r,{get:e[r],enumerable:!0});return t||km(n,Symbol.toStringTag,{value:"Module"}),n};var ok=class Im{constructor(t){this.seed=t}clone(){return new Im(this.seed)}next(){let t=Au(this.seed),n=Cu(t),r=Au(t),i=Cu(r);return this.seed=Au(r),Cu(this.seed)+(i+(n<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function Au(e){return Math.imul(e,214013)+2531011&4294967295}function Cu(e){return(e&-2147483649)>>16}function Mm(e){return new ok(e)}var sk="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",ak=class Om{constructor(t,n){this.states=t,this.index=n}clone(){return new Om(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=is(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),n=this.index;this.index=is(this.states,this.index);for(let r=19932;r>0;--r)sk.charCodeAt(r/6|0)-48&1<<r%6&&Tm(this.states,this.index,t,n),this.index=is(this.states,this.index);Tm(this.states,this.index,t,n)}};function Tm(e,t,n,r){let i=0;if(r>=t){for(;i<624-r;i++)e[i+t]^=n[i+r];for(;i<624-t;i++)e[i+t]^=n[i+r-624];for(;i<624;i++)e[i+t-624]^=n[i+r-624]}else{for(;i<624-t;i++)e[i+t]^=n[i+r];for(;i<624-r;i++)e[i+t-624]^=n[i+r];for(;i<624;i++)e[i+t-624]^=n[i+r-624]}}function is(e,t){if(t<227){let n=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397]^n>>>1^-(n&1)&2567483615,t+1}else if(t<623){let n=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397-624]^n>>>1^-(n&1)&2567483615,t+1}else{let n=e[t]&2147483648|e[0]&2147483647;return e[t]=e[396]^n>>>1^-(n&1)&2567483615,0}}function lk(e){for(let t=0;t!==624;++t)is(e,t)}function Nm(e){let t=[e|0];for(let n=1;n!==624;++n){let r=t[n-1]^t[n-1]>>>30;t.push(Math.imul(1812433253,r)+n|0)}return lk(t),new ak(t,0)}var uk=class $m{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new $m(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00^this.s00<<23,n=this.s01^(this.s01<<23|this.s00>>>9),r=t^this.s10^(t>>>18|n<<14)^(this.s10>>>5|this.s11<<27),i=n^this.s11^n>>>18^this.s11>>>5,o=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=i,this.s10=r,o}jump(){let t=0,n=0,r=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,n^=this.s00,r^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=n,this.s11=r,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Eu(e){return new uk(-1,~e,e|0,0)}var ck=class _m{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new _m(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00+this.s10|0,n=this.s10^this.s00,r=this.s11^this.s01,i=this.s00,o=this.s01;return this.s00=i<<24^o>>>8^n^n<<16,this.s01=o<<24^i>>>8^r^(r<<16|n>>>16),this.s10=r<<5^n>>>27,this.s11=n<<5^r>>>27,t}jump(){let t=0,n=0,r=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,n^=this.s00,r^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=n,this.s11=r,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Lm(e){return new ck(-1,~e,e|0,0)}function Dm(e,t){for(let n=0;n!==t;++n)e.next()}var Bm=BigInt,dk=4294967296n;function Um(e,t,n){let r=n-t+1n,i=dk,o=1;for(;i<r;)i<<=32n,++o;let s=Fm(o,e);if(s<r)return s+t;if(s+r<i)return s%r+t;let a=i-i%r;for(;s>=a;)s=Fm(o,e);return s%r+t}function Fm(e,t){let n=Bm(t.next()+2147483648);for(let r=1;r<e;++r){let i=t.next();n=(n<<32n)+Bm(i+2147483648)}return n}function ci(e,t){let n=t>2?~~(4294967296/t)*t:4294967296,r=e.next()+2147483648;for(;r>=n;)r=e.next()+2147483648;return r%t}function ku(e,t){if(t<0){let n=-t;e.sign=-1,e.data[0]=~~(n/4294967296),e.data[1]=n>>>0}else e.sign=1,e.data[0]=~~(t/4294967296),e.data[1]=t>>>0;return e}function fk(e,t,n){let r=t.data[1],i=t.data[0],o=t.sign,s=n.data[1],a=n.data[0],l=n.sign;if(e.sign=1,o===1&&l===-1){let m=r+s,y=i+a+(m>4294967295?1:0);return e.data[0]=y>>>0,e.data[1]=m>>>0,e}let u=r,c=i,d=s,f=a;o===-1&&(u=s,c=a,d=r,f=i);let p=0,h=u-d;return h<0&&(p=1,h=h>>>0),e.data[0]=c-f-p,e.data[1]=h,e}function hk(e,t,n){let r=n[0]+1;for(t[0]=ci(e,r),t[1]=ci(e,4294967296);t[0]>=n[0]&&(t[0]!==n[0]||t[1]>=n[1]);)t[0]=ci(e,r),t[1]=ci(e,4294967296);return t}var pk=Number.MAX_SAFE_INTEGER,mk={sign:1,data:[0,0]},yk={sign:1,data:[0,0]},jm={sign:1,data:[0,0]},Pu=[0,0];function gk(e,t,n,r){let i=r<=pk?ku(jm,r):fk(jm,ku(mk,n),ku(yk,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,hk(e,Pu,i.data),Pu[0]*4294967296+Pu[1]+t}function os(e,t,n){let r=n-t;return r<=4294967295?ci(e,r+1)+t:gk(e,t,n,r)}var Vm=Symbol.for("fast-check/PreconditionFailure"),xn=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=Vm}static isFailure(e){return e!=null&&e.footprint===Vm}};function bk(e){if(!e)throw new xn}var Sk=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},wk=new Sk;function xk(){return wk}function*vk(e,t){for(let n of e)yield t(n)}function*Rk(e,t){for(let n of e)yield*t(n)}function*Ak(e,t){for(let n of e)t(n)&&(yield n)}function*Ck(e,t){for(let n=0;n<t;++n){let r=e.next();if(r.done)break;yield r.value}}function*Ek(e,t){let n=e.next();for(;!n.done&&t(n.value);)yield n.value,n=e.next()}function*kk(e,t){for(let n=e.next();!n.done;n=e.next())yield n.value;for(let n of t)for(let r=n.next();!r.done;r=n.next())yield r.value}var Pk=Symbol.iterator,D=class Ht{static nil(){return new Ht(xk())}static of(...t){return new Ht(t[Pk]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Ht(vk(this.g,t))}flatMap(t){return new Ht(Rk(this.g,t))}dropWhile(t){let n=!1;function*r(i){(n||!t(i))&&(n=!0,yield i)}return this.flatMap(r)}drop(t){if(t<=0)return this;let n=0;function r(){return n++<t}return this.dropWhile(r)}takeWhile(t){return new Ht(Ek(this.g,t))}take(t){return new Ht(Ck(this.g,t))}filter(t){return new Ht(Ak(this.g,t))}every(t){for(let n of this.g)if(!t(n))return!1;return!0}has(t){for(let n of this.g)if(t(n))return[!0,n];return[!1,null]}join(...t){return new Ht(kk(this.g,t))}getNthOrLast(t){let n=t,r=null;for(let i of this.g){if(n--===0)return i;r=i}return r}};function Sn(e){return new D(e)}var Oe=Symbol.for("fast-check/cloneMethod");function Dn(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Oe in e&&typeof e[Oe]=="function"}function cr(e){return Dn(e)?e[Oe]():e}var Ik=Object.defineProperty,O=class{constructor(e,t,n){this.value_=e,this.context=t,this.hasToBeCloned=n!==void 0||Dn(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&Ik(this,"value",{get:n!==void 0?n:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[Oe]():(this.readOnce=!0,this.value_):this.value_}},he=class{filter(e){return new Ok(this,e)}map(e,t){return new Tk(this,e,t)}chain(e){return new Mk(this,e)}},Mk=class extends he{constructor(e,t){super(),this.arb=e,this.chainer=t}generate(e,t){let n=e.clone(),r=this.arb.generate(e,t);return this.valueChainer(r,e,n,t)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?(t.stoppedForOriginal?D.nil():this.arb.shrink(t.originalValue,t.originalContext).map(n=>this.valueChainer(n,t.clonedMrng.clone(),t.clonedMrng,t.originalBias))).join(t.chainedArbitrary.shrink(e,t.chainedContext).map(n=>{let r={...t,chainedContext:n.context,stoppedForOriginal:!0};return new O(n.value_,r)})):D.nil()}valueChainer(e,t,n,r){let i=this.chainer(e.value_),o=i.generate(t,r),s={originalBias:r,originalValue:e.value_,originalContext:e.context,stoppedForOriginal:!1,chainedArbitrary:i,chainedContext:o.context,clonedMrng:n};return new O(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}},Tk=class extends he{constructor(e,t,n){super(),this.arb=e,this.mapper=t,this.unmapper=n,this.bindValueMapper=r=>this.valueMapper(r)}generate(e,t){let n=this.arb.generate(e,t);return this.valueMapper(n)}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 n=this.unmapper(e);return this.arb.shrink(n,void 0).map(this.bindValueMapper)}return D.nil()}mapperWithCloneIfNeeded(e){let t=e.value,n=this.mapper(t);return e.hasToBeCloned&&(typeof n=="object"&&n!==null||typeof n=="function")&&Object.isExtensible(n)&&!Dn(n)&&Object.defineProperty(n,Oe,{get:()=>()=>this.mapperWithCloneIfNeeded(e)[0]}),[n,t]}valueMapper(e){let[t,n]=this.mapperWithCloneIfNeeded(e);return new O(t,{originalValue:n,originalContext:e.context})}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalValue"in e&&"originalContext"in e}},Ok=class extends he{constructor(e,t){super(),this.arb=e,this.refinement=t,this.bindRefinementOnValue=n=>this.refinementOnValue(n)}generate(e,t){for(;;){let n=this.arb.generate(e,t);if(this.refinementOnValue(n))return n}}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 Vg(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function Wg(e){if(!Vg(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var zg=Function.prototype.apply,Iu=Symbol("apply");function Nk(e){try{return e.apply}catch{return}}function $k(e,t,n){let r=e;r[Iu]=zg;let i=r[Iu](t,n);return delete r[Iu],i}function K(e,t,n){return Nk(e)===zg?e.apply(t,n):$k(e,t,n)}var Gg=Array,k=BigInt,_k=BigInt64Array,Lk=BigUint64Array,Hg=Boolean,ws=Date,M=Error,Kg=Float32Array,qg=Float64Array,Dk=Int8Array,Bk=Int16Array,Fk=Int32Array,qt=Number,Ue=String,dr=Set,Uk=Uint8Array,jk=Uint8ClampedArray,Vk=Uint16Array,Wk=Uint32Array,zk=encodeURIComponent,Yt=Map,hs=Symbol,Wm=Array.prototype.forEach,zm=Array.prototype.indexOf,Gm=Array.prototype.join,Hm=Array.prototype.map,Km=Array.prototype.flat,qm=Array.prototype.filter,Ym=Array.prototype.push,Zm=Array.prototype.pop,Xm=Array.prototype.splice,Jm=Array.prototype.slice,Qm=Array.prototype.sort,ey=Array.prototype.every;function Gk(e){try{return e.forEach}catch{return}}function Hk(e){try{return e.indexOf}catch{return}}function Kk(e){try{return e.join}catch{return}}function qk(e){try{return e.map}catch{return}}function Yk(e){try{return e.flat}catch{return}}function Zk(e){try{return e.filter}catch{return}}function Xk(e){try{return e.push}catch{return}}function Jk(e){try{return e.pop}catch{return}}function Qk(e){try{return e.splice}catch{return}}function e2(e){try{return e.slice}catch{return}}function t2(e){try{return e.sort}catch{return}}function n2(e){try{return e.every}catch{return}}function Yg(e,t){return Gk(e)===Wm?e.forEach(t):K(Wm,e,[t])}function Kt(e,...t){return Hk(e)===zm?e.indexOf(...t):K(zm,e,t)}function fe(e,...t){return Kk(e)===Gm?e.join(...t):K(Gm,e,t)}function W(e,t){return qk(e)===Hm?e.map(t):K(Hm,e,[t])}function r2(e,t){return Yk(e)===Km?([].flat(),e.flat(t)):K(Km,e,[t])}function i2(e,t){return Zk(e)===qm?e.filter(t):K(qm,e,[t])}function T(e,...t){return Xk(e)===Ym?e.push(...t):K(Ym,e,t)}function Zg(e){return Jk(e)===Zm?e.pop():K(Zm,e,[])}function Xg(e,...t){return Qk(e)===Xm?e.splice(...t):K(Xm,e,t)}function _e(e,...t){return e2(e)===Jm?e.slice(...t):K(Jm,e,t)}function Jg(e,...t){return t2(e)===Qm?e.sort(...t):K(Qm,e,t)}function Qg(e,...t){return n2(e)===ey?e.every(...t):K(ey,e,t)}var ty=Date.prototype.getTime,ny=Date.prototype.toISOString;function o2(e){try{return e.getTime}catch{return}}function s2(e){try{return e.toISOString}catch{return}}function xs(e){return o2(e)===ty?e.getTime():K(ty,e,[])}function a2(e){return s2(e)===ny?e.toISOString():K(ny,e,[])}var ry=Set.prototype.add,iy=Set.prototype.has;function l2(e){try{return e.add}catch{return}}function u2(e){try{return e.has}catch{return}}function mi(e,t){return l2(e)===ry?e.add(t):K(ry,e,[t])}function vs(e,t){return u2(e)===iy?e.has(t):K(iy,e,[t])}var oy=WeakMap.prototype.set,sy=WeakMap.prototype.get;function c2(e){try{return e.set}catch{return}}function d2(e){try{return e.get}catch{return}}function f2(e,t,n){return c2(e)===oy?e.set(t,n):K(oy,e,[t,n])}function h2(e,t){return d2(e)===sy?e.get(t):K(sy,e,[t])}var ay=Map.prototype.set,ly=Map.prototype.get,uy=Map.prototype.has;function p2(e){try{return e.set}catch{return}}function m2(e){try{return e.get}catch{return}}function y2(e){try{return e.has}catch{return}}function gt(e,t,n){return p2(e)===ay?e.set(t,n):K(ay,e,[t,n])}function it(e,t){return m2(e)===ly?e.get(t):K(ly,e,[t])}function g2(e,t){return y2(e)===uy?e.has(t):K(uy,e,[t])}var cy=String.prototype.split,dy=String.prototype.startsWith,fy=String.prototype.endsWith,hy=String.prototype.substring,py=String.prototype.toLowerCase,my=String.prototype.toUpperCase,yy=String.prototype.padStart,gy=String.prototype.charCodeAt,by=String.prototype.normalize,Sy=String.prototype.replace;function b2(e){try{return e.split}catch{return}}function S2(e){try{return e.startsWith}catch{return}}function w2(e){try{return e.endsWith}catch{return}}function x2(e){try{return e.substring}catch{return}}function v2(e){try{return e.toLowerCase}catch{return}}function R2(e){try{return e.toUpperCase}catch{return}}function A2(e){try{return e.padStart}catch{return}}function C2(e){try{return e.charCodeAt}catch{return}}function E2(e){try{return e.normalize}catch{return}}function k2(e){try{return e.replace}catch{return}}function je(e,...t){return b2(e)===cy?e.split(...t):K(cy,e,t)}function P2(e,...t){return S2(e)===dy?e.startsWith(...t):K(dy,e,t)}function I2(e,...t){return w2(e)===fy?e.endsWith(...t):K(fy,e,t)}function be(e,...t){return x2(e)===hy?e.substring(...t):K(hy,e,t)}function ec(e){return v2(e)===py?e.toLowerCase():K(py,e,[])}function Ec(e){return R2(e)===my?e.toUpperCase():K(my,e,[])}function M2(e,...t){return A2(e)===yy?e.padStart(...t):K(yy,e,t)}function fr(e,t){return C2(e)===gy?e.charCodeAt(t):K(gy,e,[t])}function T2(e,t){return E2(e)===by?e.normalize(t):K(by,e,[t])}function O2(e,t,n){return k2(e)===Sy?e.replace(t,n):K(Sy,e,[t,n])}var wy=Number.prototype.toString;function N2(e){try{return e.toString}catch{return}}function yi(e,...t){return N2(e)===wy?e.toString(...t):K(wy,e,t)}var $2=Object.prototype.hasOwnProperty,_2=Object.prototype.toString;function eb(e,t){return K($2,e,[t])}function tc(e){return K(_2,e,[])}var L2=Error.prototype.toString;function D2(e){return K(L2,e,[])}var B2=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 bn(e){return new B2(e)}var tb=Array.isArray,F2=Object.defineProperty;function nb(e,t){return F2(e,Oe,{value:()=>{let n=[];for(let r=0;r!==t.length;++r)T(n,t[r].value);return nb(n,t),n}})}function rb(e){let t=!1,n=[],r=[];for(let i=0;i!==e.length;++i){let o=e[i];t=t||o.hasToBeCloned,T(n,o.value),T(r,o.context)}return t&&nb(n,e),new O(n,r)}function ib(e,t,n){let r=[],i=tb(n)?n:[];for(let o=0;o!==e.length;++o)T(r,bn(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=W(t,(l,u)=>new O(cr(l),i[u]));return[..._e(a,0,o),s,..._e(a,o+1)]}).map(rb)));return D.nil().join(...r)}var U2=class extends he{constructor(e){super(),this.arbs=e;for(let t=0;t!==e.length;++t){let n=e[t];if(n==null||n.generate===null||n.generate===void 0)throw new Error(`Invalid parameter encountered at index ${t}: expecting an Arbitrary`)}}generate(e,t){let n=[];for(let r=0;r!==this.arbs.length;++r)T(n,this.arbs[r].generate(e,t));return rb(n)}canShrinkWithoutContext(e){if(!tb(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 ib(this.arbs,e,t)}};function B(...e){return new U2(e)}var j2=Math.log;function ob(e){return 2+~~(j2(e+1)*.4342944819032518)}var kc={};function V2(e){kc=e}function bt(){return kc}function W2(){kc={}}var gi=Symbol("UndefinedContextPlaceholder");function hr(e){return e.context!==void 0?e:e.hasToBeCloned?new O(e.value_,gi,()=>e.value):new O(e.value_,gi)}var xy=()=>{},z2=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:n,asyncAfterEach:r,beforeEach:i,afterEach:o}=bt()||{};if(n!==void 0&&i!==void 0)throw M(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(r!==void 0&&o!==void 0)throw M(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=n||i||xy,this.afterEachHook=r||o||xy}isAsync(){return!0}generate(e,t){return hr(this.arb.generate(e,t!==void 0?ob(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return D.nil();let t=e.context!==gi?e.context:void 0;return this.arb.shrink(e.value_,t).map(hr)}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 M("Property failed by returning false")}}catch(t){return xn.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}},sb=class extends he{constructor(e){super(),this.arb=e}generate(e,t){return hr(this.arb.generate(e,t))}canShrinkWithoutContext(e){return!0}shrink(e,t){if(t===void 0&&!this.arb.canShrinkWithoutContext(e))return D.nil();let n=t!==gi?t:void 0;return this.arb.shrink(e,n).map(hr)}};function G2(...e){if(e.length<2)throw new Error("asyncProperty expects at least two parameters");let t=_e(e,0,e.length-1),n=e[e.length-1];return Yg(t,Wg),new z2(B(...W(t,r=>new sb(r))),r=>n(...r))}var vy=()=>{},ab=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:n=vy,afterEach:r=vy,asyncBeforeEach:i,asyncAfterEach:o}=bt()||{};if(i!==void 0)throw M(`"asyncBeforeEach" can't be set when running synchronous properties`);if(o!==void 0)throw M(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=n,this.afterEachHook=r}isAsync(){return!1}generate(e,t){return hr(this.arb.generate(e,t!==void 0?ob(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return D.nil();let t=e.context!==gi?e.context:void 0;return this.arb.shrink(e.value_,t).map(hr)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(e){try{let t=this.predicate(e);return t===void 0||t===!0?null:{error:new M("Property failed by returning false")}}catch(t){return xn.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 H2(...e){if(e.length<2)throw new Error("property expects at least two parameters");let t=_e(e,0,e.length-1),n=e[e.length-1];return Yg(t,Wg),new ab(B(...W(t,r=>new sb(r))),r=>n(...r))}var K2=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function nc(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>nc(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>nc(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function lb(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>lb(e),next:()=>e.next(),jump:()=>Dm(e,42),getState:()=>e.getState()}}function Es(e){return lb(nc(e))}var q2=Date.now,Y2=Math.min,Z2=Math.random,X2=class{constructor(e){let t=e||{};this.seed=J2(t),this.randomType=Q2(t),this.numRuns=eP(t),this.verbose=tP(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=Tu(t.timeout),this.skipAllAfterTimeLimit=Tu(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=Tu(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:n=>{console.log(n)},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 Mu(e){return t=>Es(e(t))}function J2(e){if(e.seed===void 0)return q2()^Z2()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function Q2(e){if(e.randomType===void 0)return Eu;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return Mu(Nm);case"congruential":case"congruential32":return Mu(Mm);case"xorshift128plus":return Eu;case"xoroshiro128plus":return Lm;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===Es(t)?e.randomType:Mu(e.randomType)}function eP(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function tP(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 Tu(e){if(e!==void 0)return Y2(e,2147483647)}function Pc(e){return new X2(e)}function nP(e,t,n){let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i(new xn(!0))},e)})}}var Ry=class{constructor(e,t,n,r,i,o){this.property=e,this.getTime=t,this.interruptExecution=r,this.setTimeoutSafe=i,this.clearTimeoutSafe=o,this.skipAfterTime=this.getTime()+n}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 n=new xn(this.interruptExecution);return this.isAsync()?Promise.resolve(n):n}if(this.interruptExecution&&this.isAsync()){let n=nP(t,this.setTimeoutSafe,this.clearTimeoutSafe),r=Promise.race([this.property.run(e),n.promise]);return r.then(n.clear,n.clear),r}return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},rP=(e,t,n)=>{let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i({error:new M(`Property timeout: exceeded limit of ${e} milliseconds`)})},e)})}},iP=class{constructor(e,t,n,r){this.property=e,this.timeMs=t,this.setTimeoutSafe=n,this.clearTimeoutSafe=r}isAsync(){return!0}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}async run(e){let t=rP(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),n=Promise.race([this.property.run(e),t.promise]);return n.then(t.clear,t.clear),n}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},ub=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()}},Ay=Array.from,Cy=typeof Buffer<"u"?Buffer.isBuffer:void 0,sr=JSON.stringify,Ey=Number.isNaN,oP=Object.keys,sP=Object.getOwnPropertySymbols,aP=Object.getOwnPropertyDescriptor,ky=Object.getPrototypeOf,Py=Number.NEGATIVE_INFINITY,lP=Number.POSITIVE_INFINITY,St=Symbol.for("fast-check/toStringMethod");function Ic(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&St in e&&typeof e[St]=="function"}var Zt=Symbol.for("fast-check/asyncToStringMethod");function Mc(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Zt in e&&typeof e[Zt]=="function"}var uP=/^Symbol\((.*)\)$/;function cP(e){if(e.description!==void 0)return e.description;let t=uP.exec(Ue(e));return t&&t[1].length?t[1]:null}function Iy(e){switch(e){case 0:return 1/e===Py?"-0":"0";case Py:return"Number.NEGATIVE_INFINITY";case lP:return"Number.POSITIVE_INFINITY";default:return e===e?Ue(e):"Number.NaN"}}function dP(e){let t=-1;for(let n in e){let r=Number(n);if(r!==t+1)return!0;t=r}return t+1!==e.length}function rt(e,t,n){let r=[...t,e];if(typeof e=="object"&&Kt(t,e)!==-1)return"[cyclic]";if(Mc(e)){let i=n(e);if(i.state==="fulfilled")return i.value}if(Ic(e))try{return e[St]()}catch{}switch(tc(e)){case"[object Array]":{let i=e;if(i.length>=50&&dP(i)){let s=[];for(let a in i)Ey(Number(a))||T(s,`${a}:${rt(i[a],r,n)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${fe(s,",")}})`:`Array(${i.length})`}let o=fe(W(i,s=>rt(s,r,n)),",");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 Ey(xs(i))?"new Date(NaN)":`new Date(${sr(a2(i))})`}case"[object Map]":return`new Map(${rt(Array.from(e),r,n)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?Iy(e):`new Number(${Iy(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"?`[${rt(o,r,n)}]`:sr(o)}:${rt(e[o],r,n)}`;return"{"+fe([...ky(e)===null?["__proto__:null"]:[],...W(oP(e),i),...W(i2(sP(e),o=>{let s=aP(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${rt(Array.from(e),r,n)})`;case"[object String]":return typeof e=="string"?sr(e):`new String(${sr(e)})`;case"[object Symbol]":{let i=e;if(hs.keyFor(i)!==void 0)return`Symbol.for(${sr(hs.keyFor(i))})`;let o=cP(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&hs[o.substring(7)])?o:`Symbol(${sr(o)})`}case"[object Promise]":{let i=n(e);switch(i.state){case"fulfilled":return`Promise.resolve(${rt(i.value,r,n)})`;case"rejected":return`Promise.reject(${rt(i.value,r,n)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(e instanceof Error)return`new Error(${rt(e.message,r,n)})`;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 Cy=="function"&&Cy(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":rt(Ay(e.values()),r,n)})`;let i=ky(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(${rt(Ay(s.values()),r,n)})`}break}}try{return e.toString()}catch{return tc(e)}}function Ae(e){return rt(e,[],()=>({state:"unknown",value:void 0}))}function cb(e){let t=hs(),n=[],r=new Yt;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(r.has(c))return r.get(c);let d=i(),f=Zt in u?Promise.resolve().then(()=>u[Zt]()):u;return f.catch(()=>{}),n.push(Promise.race([f,d.delay]).then(p=>{p===t?r.set(c,{state:"pending",value:void 0}):r.set(c,{state:"fulfilled",value:p}),d.cancel()},p=>{r.set(c,{state:"rejected",value:p}),d.cancel()})),r.set(c,o),o};function a(){let l=rt(e,[],s);return n.length===0?l:Promise.all(n.splice(0)).then(a)}return a()}async function Tc(e){return Promise.resolve(cb(e))}function My(e){return e===null?new xn:e}function fP(...e){return e[1]?e[0].then(My):My(e[0])}function hP(e,t){return fP(e,t)}var Ty=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=Ae(e);if(this.coveredCases.has(t)){let r=this.coveredCases.get(t);return this.skipRuns?hP(r,this.property.isAsync()):r}let n=this.property.run(e);return this.coveredCases.set(t,n),n}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},Oy=Date.now,Ou=setTimeout,Nu=clearTimeout;function pP(e,t){let n=e;return e.isAsync()&&t.timeout!==void 0&&(n=new iP(n,t.timeout,Ou,Nu)),t.unbiased&&(n=new ub(n)),t.skipAllAfterTimeLimit!==void 0&&(n=new Ry(n,Oy,t.skipAllAfterTimeLimit,!1,Ou,Nu)),t.interruptAfterTimeLimit!==void 0&&(n=new Ry(n,Oy,t.interruptAfterTimeLimit,!0,Ou,Nu)),t.skipEqualValues&&(n=new Ty(n,!0)),t.ignoreEqualValues&&(n=new Ty(n,!1)),n}var mP=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),yP=class db{constructor(t,n){this.verbosity=t,this.interruptedAsFailure=n,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(t,n){let r={status:t,value:n,children:[]};return this.currentLevelExecutionTrees.push(r),r}fail(t,n,r){if(this.verbosity>=1){let i=this.appendExecutionTree(1,t);this.currentLevelExecutionTrees=i.children}this.pathToFailure===void 0?this.pathToFailure=`${n}`:this.pathToFailure+=`:${n}`,this.value=t,this.failure=r}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?+je(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?je(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let t=[],n=this.rootExecutionTrees;for(;n.length>0&&n[n.length-1].status===1;){let r=n[n.length-1];t.push(r.value),n=r.children}return t}static mergePaths(t,n){if(t.length===0)return n;let r=t.split(":"),i=n.split(":"),o=+r[r.length-1]+ +i[0];return[...r.slice(0,r.length-1),`${o}`,...i.slice(1)].join(":")}toRunDetails(t,n,r,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:db.mergePaths(n,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>r||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()}}},fb=class{constructor(e,t,n,r){this.sourceValues=e,this.shrink=t,this.runExecution=new yP(n,r),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"&&!xn.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_)}},gP=class{constructor(e,t,n){this.initialValues=e,this.maxInitialIterations=t,this.remainingSkips=n}[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}},bP=-2147483648,SP=2147483647,wP=Math.pow(2,27),xP=Math.pow(2,-53),Oc=class hb{constructor(t){this.internalRng=Es(t.clone())}clone(){return new hb(this.internalRng)}next(t){return os(this.internalRng,0,(1<<t)-1)}nextBoolean(){return os(this.internalRng,0,1)===1}nextInt(t,n){return os(this.internalRng,t===void 0?bP:t,n===void 0?SP:n)}nextBigInt(t,n){return Um(this.internalRng,t,n)}nextDouble(){let t=this.next(26),n=this.next(27);return(t*wP+n)*xP}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function vP(e,t,n){return t.jump(),e.generate(new Oc(t),n)}function*pb(e,t,n,r){for(let i=0;i!==r.length;++i)yield new O(r[i],void 0);for(let i=0,o=n(t);;++i)yield vP(e,o,i)}function RP(e,t,n){return()=>e.generate(new Oc(t),n)}function*mb(e,t,n,r){yield*W(r,s=>()=>new O(s,void 0));let i=0,o=Es(n(t));for(;;)o.jump(),yield RP(e,o,i++)}function Ny(e){return e()}function yb(e,t,n){let r=t,i=e.split(":").map(s=>+s);if(i.length===0)return r.map(Ny);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=r.drop(i[0]).map(Ny);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=n(a).drop(s)}return o}var AP=Object.assign;function CP(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,n)=>`Hint (${n+1}): ${t}`).join(`
21
+ `)}function EP(e,t){return`Encountered failures were:
22
22
  - ${e.map(t).join(`
23
23
  - `)}`}function Nc(e,t){let n=[],r=[];for(let i=e.length-1;i>=0;--i)r.push({depth:1,tree:e[i]});for(;r.length!==0;){let i=r.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):"";n.push(`${l}${a} ${t(o.value)}`);for(let u=o.children.length-1;u>=0;--u)r.push({depth:s+1,tree:o.children[u]})}return`Execution summary:
24
24
  ${n.join(`
25
- `)}`}function AP(e,t){let n=`Failed to run property, too many pre-condition failures encountered
25
+ `)}`}function kP(e,t){let n=`Failed to run property, too many pre-condition failures encountered
26
26
  { seed: ${e.seed} }
27
27
 
28
28
  Ran ${e.numRuns} time(s)
29
- Skipped ${e.numSkips} time(s)`,r=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?r=Nc(e.executionSummary,t):T(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:n,details:r,hints:i}}function CP(e){if(e instanceof M&&e.stack!==void 0)return e.stack;try{return Ue(e)}catch{}if(e instanceof M)try{return $2(e)}catch{}if(e!==null&&typeof e=="object")try{return tc(e)}catch{}return"Failed to serialize errorInstance"}function EP(e,t){let n=e.runConfiguration.includeErrorInReport?`
30
- Got ${I2(CP(e.errorInstance),/^Error: /,"error: ")}`:"",r=`Property failed after ${e.numRuns} tests
29
+ Skipped ${e.numSkips} time(s)`,r=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?r=Nc(e.executionSummary,t):T(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:n,details:r,hints:i}}function PP(e){if(e instanceof M&&e.stack!==void 0)return e.stack;try{return Ue(e)}catch{}if(e instanceof M)try{return D2(e)}catch{}if(e!==null&&typeof e=="object")try{return tc(e)}catch{}return"Failed to serialize errorInstance"}function IP(e,t){let n=e.runConfiguration.includeErrorInReport?`
30
+ Got ${O2(PP(e.errorInstance),/^Error: /,"error: ")}`:"",r=`Property failed after ${e.numRuns} tests
31
31
  { seed: ${e.seed}, path: "${e.counterexamplePath}", endOnFailure: true }
32
32
  Counterexample: ${t(e.counterexample)}
33
- Shrunk ${e.numShrinks} time(s)${n}`,i=null,o=[];return e.verbose>=2?i=Nc(e.executionSummary,t):e.verbose===1?i=RP(e.failures,t):T(o,"Enable verbose mode in order to have the list of all failing values encountered during the run"),{message:r,details:i,hints:o}}function kP(e,t){let n=`Property interrupted after ${e.numRuns} tests
34
- { seed: ${e.seed} }`,r=null,i=[];return e.verbose>=2?r=Nc(e.executionSummary,t):T(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:n,details:r,hints:i}}function rc(e,t){if(!e.failed)return;let{message:n,details:r,hints:i}=e.counterexamplePath===null?e.interrupted?kP(e,t):AP(e,t):EP(e,t),o=n;return r!==null&&(o+=`
33
+ Shrunk ${e.numShrinks} time(s)${n}`,i=null,o=[];return e.verbose>=2?i=Nc(e.executionSummary,t):e.verbose===1?i=EP(e.failures,t):T(o,"Enable verbose mode in order to have the list of all failing values encountered during the run"),{message:r,details:i,hints:o}}function MP(e,t){let n=`Property interrupted after ${e.numRuns} tests
34
+ { seed: ${e.seed} }`,r=null,i=[];return e.verbose>=2?r=Nc(e.executionSummary,t):T(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:n,details:r,hints:i}}function rc(e,t){if(!e.failed)return;let{message:n,details:r,hints:i}=e.counterexamplePath===null?e.interrupted?MP(e,t):kP(e,t):IP(e,t),o=n;return r!==null&&(o+=`
35
35
 
36
36
  ${r}`),i.length>0&&(o+=`
37
37
 
38
- ${vP(i)}`),o}function hb(e){return rc(e,Ae)}async function pb(e){let t=[];function n(s){let a=sb(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let r=rc(e,n);if(t.length===0)return r;let i=new Yt(await Promise.all(t));function o(s){let a=it(i,s);return a!==void 0?a:Ae(s)}return rc(e,o)}function mb(e,t){if(t.runConfiguration.includeErrorInReport)throw new M(e);let n=new M(e,{cause:t.errorInstance});return"cause"in n||xP(n,{cause:t.errorInstance}),n}function PP(e){if(e.failed)throw mb(hb(e),e)}async function IP(e){if(e.failed)throw mb(await pb(e),e)}function MP(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):PP(e)}async function TP(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):IP(e)}function OP(e,t,n,r,i){let o=new lb(n,t,r,i);for(let s of o){e.runBeforeEach();let a=e.run(s);e.runAfterEach(),o.handleResult(a)}return o.runExecution}async function NP(e,t,n,r,i){let o=new lb(n,t,r,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 yb(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 n=Pc({...bt(),...t});if(n.reporter!==void 0&&n.asyncReporter!==void 0)throw new Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(n.asyncReporter!==void 0&&!e.isAsync())throw new Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let r=dP(e,n),i=n.path.length===0||n.path.indexOf(":")===-1?n.numRuns:-1,o=n.numRuns*n.maxSkipsPerRun,s=(...u)=>r.shrink(...u),a=new pP(n.path.length===0?cb(r,n.seed,n.randomType,n.examples):fb(n.path,Sn(db(r,n.seed,n.randomType,n.examples)),s),i,o),l=n.endOnFailure?D.nil:s;return r.isAsync()?NP(r,l,a,n.verbose,n.markInterruptAsFailure).then(u=>u.toRunDetails(n.seed,n.path,o,n)):OP(r,l,a,n.verbose,n.markInterruptAsFailure).toRunDetails(n.seed,n.path,o,n)}function $P(e,t){let n=yb(e,t);if(e.isAsync())return n.then(TP);MP(n)}function _P(e,t){let n=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new rb(e,()=>!0);return t.unbiased===!0?new ob(n):n}function gb(e,t){let n=Pc(typeof t=="number"?{...bt(),numRuns:t}:{...bt(),...t}),r=_P(e,n),i=r.shrink.bind(r);return(n.path.length===0?Sn(cb(r,n.seed,n.randomType,n.examples)):fb(n.path,Sn(db(r,n.seed,n.randomType,n.examples)),i)).take(n.numRuns).map(o=>o.value_)}function LP(e,t){return[...gb(e,t)]}function DP(e){return(Math.round(e*100)/100).toFixed(2)}function BP(e,t,n){let r=Pc(typeof n=="number"?{...bt(),numRuns:n}:{...bt(),...n}),i={};for(let l of gb(e,n)){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],`${DP(l[1]*100/r.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)r.logger(`${l[0].padEnd(s,".")}..${l[1].padStart(a,".")}`)}var FP=Object.assign;function ic(e,t,n,r){let i=n(),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 f=c.value;return T(s.history,{arb:u,value:f,context:c.context,mrng:c.mrng}),o=c.mrng.clone(),f}let d=u.generate(o,t);return T(s.history,{arb:u,value:d.value_,context:d.context,mrng:o.clone()}),d.value},l=(u,...c)=>a(r(u,c));return new O(FP(l,{values(){return W(s.history,u=>u.value)},[Oe](){return ic(e,t,n,r).value},[St](){return Ae(W(s.history,u=>u.value))}}),s)}var $u=Array.isArray,My=Object.keys,UP=Object.is;function jP(e){let t=new Yt;return function(r,i){let o=it(t,r);if(o===void 0){let l=r(...i);return gt(t,r,[{args:i,value:l}]),l}let s=o;for(let l of s)if(e(i,l.args))return l.value;let a=r(...i);return T(s,{args:i,value:a}),a}}function bb(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if($u(e)){if(!$u(t)||e.length!==t.length)return!1}else if($u(t))return!1;if(My(e).length!==My(t).length)return!1;for(let n in e)if(!(n in t)||!bb(e[n],t[n]))return!1;return!0}else return UP(e,t)}var VP=class extends he{constructor(...e){super(...e),this.arbitraryCache=jP(bb)}generate(e,t){return ic(e,t,()=>[],this.arbitraryCache)}canShrinkWithoutContext(e){return!1}shrink(e,t){if(t===void 0)return D.nil();let n=t,r=n.mrng,i=n.biasFactor,o=n.history;return eb(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 W(o,(c,d)=>({arb:c.arb,value:l[d],context:u[d],mrng:c.mrng}))}return ic(r,i,a,this.arbitraryCache)})}};function WP(){return new VP}var zP=Math.floor,Ty=Math.log;function GP(e){return zP(Ty(e)/Ty(2))}function HP(e){return e===k(0)?k(0):k(Ue(e).length)}function Sb(e,t,n){if(e===t)return[{min:e,max:t}];if(e<0&&t>0){let s=n(-e),a=n(t);return[{min:-s,max:a},{min:t-a,max:t},{min:e,max:e+s}]}let r=n(t-e),i={min:e,max:e+r},o={min:t-r,max:t};return e<0?[o,i]:[i,o]}var KP=Math.ceil,qP=Math.floor;function Oy(e){return qP(e/2)}function Ny(e){return KP(e/2)}function $y(e,t,n){let r=e-t;function*i(){let s=n?void 0:t,a=n?r:Oy(r);for(let l=a;l>0;l=Oy(l)){let u=l===r?t:e-l;yield new O(u,s),s=u}}function*o(){let s=n?void 0:t,a=n?r:Ny(r);for(let l=a;l<0;l=Ny(l)){let u=l===r?t:e-l;yield new O(u,s),s=u}}return r>0?Sn(i()):Sn(o())}var _y=Math.sign,YP=Number.isInteger,ZP=Object.is,pr=class wb extends he{constructor(t,n){super(),this.min=t,this.max=n}generate(t,n){let r=this.computeGenerateRange(t,n);return new O(t.nextInt(r.min,r.max),void 0)}canShrinkWithoutContext(t){return typeof t=="number"&&YP(t)&&!ZP(t,-0)&&this.min<=t&&t<=this.max}shrink(t,n){return wb.isValidContext(t,n)?this.isLastChanceTry(t,n)?D.of(new O(n,void 0)):$y(t,n,!1):$y(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?0:this.min<0?this.max:this.min}computeGenerateRange(t,n){if(n===void 0||t.nextInt(1,n)!==1)return{min:this.min,max:this.max};let r=Sb(this.min,this.max,GP);if(r.length===1)return r[0];let i=t.nextInt(-2*(r.length-1),r.length-2);return i<0?r[0]:r[i+1]}isLastChanceTry(t,n){return t>0?t===n+1&&t>this.min:t<0?t===n-1&&t<this.max:!1}static isValidContext(t,n){if(n===void 0)return!1;if(typeof n!="number")throw new Error("Invalid context type passed to IntegerArbitrary (#1)");if(n!==0&&_y(t)!==_y(n))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},Ly=Number.isInteger;function XP(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function ne(e={}){let t=XP(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!Ly(t.min))throw new Error("fc.integer minimum value should be an integer");if(!Ly(t.max))throw new Error("fc.integer maximum value should be an integer");return new pr(t.min,t.max)}var Dy=new Map;function $c(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=it(Dy,e);if(t!==void 0)return t;let n={depth:0};return gt(Dy,e,n),n}function _c(){return{depth:0}}var JP=class{constructor(e,t,n){this.arb=e,this.mrng=t,this.biasFactor=n}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},QP=Math.min,eI=Math.max,tI=class{constructor(e,t,n,r){this.arb=e,this.mrng=t,this.slices=n,this.biasFactor=r,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 n=0;n!==this.slices.length;++n)this.slices[n].length===e&&T(t,n);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 O(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 O(e[0],void 0);let t=this.mrng.nextInt(0,e.length-1),n=this.mrng.nextInt(0,e.length-1);return this.nextIndexInSlice=QP(t,n),this.lastIndexInSlice=eI(t,n),new O(e[this.nextIndexInSlice++],void 0)}};function By(e,t,n,r){return r===void 0||n.length===0||t.nextInt(1,r)!==1?new JP(e,t,r):new tI(e,t,n,r)}var nI=Math.floor,Fy=Math.log,Uy=Math.max,rI=Array.isArray;function _u(e,t){return e===t?e:e+nI(Fy(t-e)/Fy(2))}var xb=class vb extends he{constructor(t,n,r,i,o,s,a){super(),this.arb=t,this.minLength=n,this.maxGeneratedLength=r,this.maxLength=i,this.setBuilder=s,this.customSlices=a,this.lengthArb=ne({min:n,max:r}),this.depthContext=$c(o)}preFilter(t){if(this.setBuilder===void 0)return t;let n=this.setBuilder();for(let r=0;r!==t.length;++r)n.tryAdd(t[r]);return n.getData()}static makeItCloneable(t,n){return t[Oe]=()=>{let r=[];for(let i=0;i!==n.length;++i)T(r,n[i].value);return this.makeItCloneable(r,n),r},t}generateNItemsNoDuplicates(t,n,r,i){let o=0,s=t(),a=By(this.arb,r,this.customSlices,i);for(;s.size()<n&&o<this.maxGeneratedLength;){let l=a.next();s.tryAdd(l)?o=0:o+=1}return s.getData()}safeGenerateNItemsNoDuplicates(t,n,r,i){let o=Uy(0,n-_u(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=o;try{return this.generateNItemsNoDuplicates(t,n,r,i)}finally{this.depthContext.depth-=o}}generateNItems(t,n,r){let i=[],o=By(this.arb,n,this.customSlices,r);o.attemptExact(t);for(let s=0;s!==t;++s)T(i,o.next());return i}safeGenerateNItems(t,n,r){let i=Uy(0,t-_u(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=i;try{return this.generateNItems(t,n,r)}finally{this.depthContext.depth-=i}}wrapper(t,n,r,i){let o=n?this.preFilter(t):t,s=!1,a=[],l=[];for(let u=0;u!==o.length;++u){let c=o[u];s=s||c.hasToBeCloned,T(a,c.value),T(l,c.context)}return s&&vb.makeItCloneable(a,o),new O(a,{shrunkOnce:n,lengthContext:t.length===o.length&&r!==void 0?r:void 0,itemsContexts:l,startIndex:i})}generate(t,n){let r=this.applyBias(t,n),i=r.size,o=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,i,t,r.biasFactorItems):this.safeGenerateNItems(i,t,r.biasFactorItems);return this.wrapper(o,!1,void 0,0)}applyBias(t,n){if(n===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:n};if(t.nextInt(1,n)!==1)return{size:this.lengthArb.generate(t,void 0).value};if(t.nextInt(1,n)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:n};let r=_u(this.minLength,this.maxGeneratedLength);return{size:ne({min:this.minLength,max:r}).generate(t,void 0).value,biasFactorItems:n}}canShrinkWithoutContext(t){if(!rI(t)||this.minLength>t.length||t.length>this.maxLength)return!1;for(let n=0;n!==t.length;++n)if(!(n in t)||!this.arb.canShrinkWithoutContext(t[n]))return!1;return this.preFilter(W(t,n=>new O(n,void 0))).length===t.length}shrinkItemByItem(t,n,r){let i=[];for(let o=n.startIndex;o<r;++o)T(i,bn(()=>this.arb.shrink(t[o],n.itemsContexts[o]).map(s=>{let a=W(_e(t,0,o),(u,c)=>new O(cr(u),n.itemsContexts[c])),l=W(_e(t,o+1),(u,c)=>new O(cr(u),n.itemsContexts[c+o+1]));return[[...a,s,...l],void 0,o]})));return D.nil().join(...i)}shrinkImpl(t,n){if(t.length===0)return D.nil();let r=n!==void 0?n:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(t.length,r.lengthContext).drop(r.shrunkOnce&&r.lengthContext===void 0&&t.length>this.minLength+1?1:0).map(i=>{let o=t.length-i.value;return[W(_e(t,o),(s,a)=>new O(cr(s),r.itemsContexts[a+o])),i.context,0]}).join(bn(()=>t.length>this.minLength?this.shrinkItemByItem(t,r,1):this.shrinkItemByItem(t,r,t.length))).join(t.length>this.minLength?bn(()=>{let i={shrunkOnce:!1,lengthContext:void 0,itemsContexts:_e(r.itemsContexts,1),startIndex:0};return this.shrinkImpl(_e(t,1),i).filter(o=>this.minLength<=o[0].length+1).map(o=>[[new O(cr(t[0]),r.itemsContexts[0]),...o[0]],void 0,0])}):D.nil())}shrink(t,n){return this.shrinkImpl(t,n).map(r=>this.wrapper(r[0],!0,r[1],r[2]))}},iI=Math.floor,oI=Math.min,Bn=2147483647,ar=["xsmall","small","medium","large","xlarge"],sI=["-4","-3","-2","-1","=","+1","+2","+3","+4"],Lc="small";function aI(e,t){switch(t){case"xsmall":return iI(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 wi(e,t){let n=Kt(sI,e);if(n===-1)return e;let r=Kt(ar,t);if(r===-1)throw new Error(`Unable to offset size based on the unknown defaulted one: ${t}`);let i=r+n-4;return i<0?ar[0]:i>=ar.length?ar[ar.length-1]:ar[i]}function bi(e,t,n,r){let{baseSize:i=Lc,defaultSizeToMaxWhenMaxSpecified:o}=bt()||{},s=e!==void 0?e:r&&o?"max":i;return s==="max"?n:oI(aI(t,wi(s,i)),n)}function lI(e,t){if(typeof e=="number")return 1/e;let{baseSize:n=Lc,defaultSizeToMaxWhenMaxSpecified:r}=bt()||{},i=e!==void 0?e:t&&r?"max":n;if(i==="max")return 0;switch(wi(i,n)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function Dc(e){let{baseSize:t=Lc}=bt()||{};return e===void 0?t:wi(e,t)}function ue(e,t={}){let n=t.size,r=t.minLength||0,i=t.maxLength,o=t.depthIdentifier,s=i!==void 0?i:Bn;return new xb(e,r,bi(n,r,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function ss(e){return e/k(2)}function jy(e,t,n){let r=e-t;function*i(){let s=n?void 0:t,a=n?r:ss(r);for(let l=a;l>0;l=ss(l)){let u=e-l;yield new O(u,s),s=u}}function*o(){let s=n?void 0:t,a=n?r:ss(r);for(let l=a;l<0;l=ss(l)){let u=e-l;yield new O(u,s),s=u}}return r>0?Sn(i()):Sn(o())}var uI=class Rb extends he{constructor(t,n){super(),this.min=t,this.max=n}generate(t,n){let r=this.computeGenerateRange(t,n);return new O(t.nextBigInt(r.min,r.max),void 0)}computeGenerateRange(t,n){if(n===void 0||t.nextInt(1,n)!==1)return{min:this.min,max:this.max};let r=Sb(this.min,this.max,HP);if(r.length===1)return r[0];let i=t.nextInt(-2*(r.length-1),r.length-2);return i<0?r[0]:r[i+1]}canShrinkWithoutContext(t){return typeof t=="bigint"&&this.min<=t&&t<=this.max}shrink(t,n){return Rb.isValidContext(t,n)?this.isLastChanceTry(t,n)?D.of(new O(n,void 0)):jy(t,n,!1):jy(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?k(0):this.min<0?this.max:this.min}isLastChanceTry(t,n){return t>0?t===n+k(1)&&t>this.min:t<0?t===n-k(1)&&t<this.max:!1}static isValidContext(t,n){if(n===void 0)return!1;if(typeof n!="bigint")throw new Error("Invalid context type passed to BigIntArbitrary (#1)");let r=t>0&&n<0||t<0&&n>0;if(n!==k(0)&&r)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function cI(e){let n=k(-1)<<k(255),r=(k(1)<<k(255))-k(1),i=e.min,o=e.max;return{min:i!==void 0?i:n-(o!==void 0&&o<k(0)?o*o:k(0)),max:o!==void 0?o:r+(i!==void 0&&i>k(0)?i*i:k(0))}}function dI(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function wn(...e){let t=cI(dI(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new uI(t.min,t.max)}var fI=Object.getPrototypeOf,di=class extends he{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 Rs(e){return fI(e)===di.prototype&&e.generate===di.prototype.generate&&e.canShrinkWithoutContext===di.prototype.canShrinkWithoutContext&&e.shrink===di.prototype.shrink?e:new di(e)}function hI(e){return e===1}function pI(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function xi(){return Rs(ne({min:0,max:1}).map(hI,pI))}var pi=Object.is,mI=class{constructor(e){this.values=e,this.fastValues=new dr(this.values);let t=!1,n=!1;if(vs(this.fastValues,0))for(let r=0;r!==this.values.length;++r){let i=this.values[r];t=t||pi(i,-0),n=n||pi(i,0)}this.hasMinusZero=t,this.hasPlusZero=n}has(e){return e===0?pi(e,0)?this.hasPlusZero:this.hasMinusZero:vs(this.fastValues,e)}},Ab=class extends he{constructor(e){super(),this.values=e}generate(e,t){let n=this.values.length===1?0:e.nextInt(0,this.values.length-1),r=this.values[n];return Dn(r)?new O(r,n,()=>r[Oe]()):new O(r,n)}canShrinkWithoutContext(e){return this.values.length===1?pi(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new mI(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||pi(e,this.values[0])?D.nil():D.of(new O(this.values[0],0))}};function Nt(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new Ab(e)}function yI(e){return!e||!e.withBigInt?Nt(!1,null,void 0,0,"",NaN):Nt(!1,null,void 0,0,"",NaN,k(0))}function Re(e){return new Ab([e])}var gI=class Cb{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Oe](){return new Cb}};function bI(){return Re(new gI)}var SI=NaN,wI=Number.isNaN;function Eb(e){return new ws(e)}function kb(e){if(!(e instanceof ws)||e.constructor!==ws)throw new M("Not a valid value for date unmapper");return xs(e)}function xI(e){return t=>t===e?new ws(SI):Eb(t)}function vI(e){return t=>{let n=kb(t);return wI(n)?e:n}}var Vy=Number.isNaN;function Pb(e={}){let t=e.min!==void 0?xs(e.min):-864e13,n=e.max!==void 0?xs(e.max):864e13,r=e.noInvalidDate;if(Vy(t))throw new Error("fc.date min must be valid instance of Date");if(Vy(n))throw new Error("fc.date max must be valid instance of Date");if(t>n)throw new Error("fc.date max must be greater or equal to min");if(r)return ne({min:t,max:n}).map(Eb,kb);let i=n+1;return ne({min:t,max:n+1}).map(xI(i),vI(i))}var RI=class extends he{constructor(e,t){super(),this.startArb=e,this.chainer=t}generate(e,t){let n=[],r=e.clone(),i=this.startArb.generate(e,t);for(n.push({arbitrary:this.startArb,value:i.value_,context:i.context,clonedMrng:r});;){let s=this.chainer(i.value_);if(s===void 0)break;let a=e.clone();i=s.generate(e,t),n.push({arbitrary:s,value:i.value_,context:i.context,clonedMrng:a})}let o={biasFactor:t,entries:n,currentShrinkLevel:0};return new O(i.value_,o)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?new D(this.shrinkIterator(t)):D.nil()}*shrinkIterator(e){let{entries:t,currentShrinkLevel:n,biasFactor:r}=e;for(let i=n;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 p=this.chainer(u.value_);if(p===void 0)break;let h=c.clone(),m=p.generate(c,r);l.push({arbitrary:p,value:m.value_,context:m.context,clonedMrng:h}),u=m}let d=l[l.length-1],f={biasFactor:r,entries:l,currentShrinkLevel:i};yield new O(d.value,f)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function AI(e,t){return new RI(e,t)}var CI=Symbol.iterator,EI=Array.isArray,kI=Object.is,PI=class Ib extends he{constructor(t,n){super(),this.arb=t,this.numValues=n}generate(t,n){let r=[];if(this.numValues<=0)return this.wrapper(r);for(let i=0;i!==this.numValues-1;++i)T(r,this.arb.generate(t.clone(),n));return T(r,this.arb.generate(t,n)),this.wrapper(r)}canShrinkWithoutContext(t){if(!EI(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let n=1;n<t.length;++n)if(!kI(t[0],t[n]))return!1;return this.arb.canShrinkWithoutContext(t[0])}shrink(t,n){return t.length===0?D.nil():new D(this.shrinkImpl(t,n!==void 0?n:[])).map(r=>this.wrapper(r))}*shrinkImpl(t,n){let r=W(t,(o,s)=>this.arb.shrink(o,n[s])[CI]()),i=W(r,o=>o.next());for(;!i[0].done;)yield W(i,o=>o.value),i=W(r,o=>o.next())}static makeItCloneable(t,n){return t[Oe]=()=>{let r=[];for(let i=0;i!==n.length;++i)T(r,n[i].value);return this.makeItCloneable(r,n),r},t}wrapper(t){let n=!1,r=[],i=[];for(let o=0;o!==t.length;++o){let s=t[o];n=n||s.hasToBeCloned,T(r,s.value),T(i,s.context)}return n&&Ib.makeItCloneable(r,t),new O(r,i)}};function II(e,t){return new PI(e,t)}var Wy=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 T(this.data,e),!0}size(){return this.data.length}getData(){return this.data}},MI=Number.isNaN,TI=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new dr,this.data=[]}tryAdd(e){let t=this.selector(e);if(MI(t))return T(this.data,e),!0;let n=this.selectedItemsExceptNaN.size;return mi(this.selectedItemsExceptNaN,t),n!==this.selectedItemsExceptNaN.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},OI=Object.is,NI=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new dr,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(OI(t,-0))return this.hasMinusZero?!1:(T(this.data,e),this.hasMinusZero=!0,!0);let n=this.selectedItemsExceptMinusZero.size;return mi(this.selectedItemsExceptMinusZero,t),n!==this.selectedItemsExceptMinusZero.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},$I=class{constructor(e){this.selector=e,this.selectedItems=new dr,this.data=[]}tryAdd(e){let t=this.selector(e),n=this.selectedItems.size;return mi(this.selectedItems,t),n!==this.selectedItems.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function _I(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 Wy(l)}let r=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>r(o(a),o(l));return()=>new Wy(s)}let t=e.selector||(r=>r),n=r=>t(r.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new TI(n);case"SameValueZero":return()=>new $I(n);case"SameValue":case void 0:return()=>new NI(n)}}function Fn(e,t={}){let n=t.minLength!==void 0?t.minLength:0,r=t.maxLength!==void 0?t.maxLength:Bn,i=bi(t.size,n,r,t.maxLength!==void 0),o=t.depthIdentifier,s=new xb(e,n,i,r,o,_I(t),[]);return n===0?s:s.filter(a=>a.length>=n)}var LI=Object.create,DI=Object.defineProperty,BI=Object.getOwnPropertyDescriptor,zy=Object.getPrototypeOf,FI=Object.prototype,UI=Reflect.ownKeys;function jI(e){let t=e[1]?LI(null):{};for(let n of e[0])DI(t,n[0],{enumerable:!0,configurable:!0,writable:!0,value:n[1]});return t}function VI(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function WI(e){if(typeof e!="object"||e===null)throw new M("Incompatible instance received: should be a non-null object");let t=zy(e)===null,n=zy(e)===FI;if(!t&&!n)throw new M("Incompatible instance received: should be of exact type Object");let r=W(UI(e),i=>[i,BI(e,i)]);if(!Yg(r,([,i])=>VI(i)))throw new M("Incompatible instance received: should contain only c/e/w properties without get/set");return[W(r,([i,o])=>[i,o.value]),t]}function zI(e){return e[0]}function Bc(e,t,n={}){let r=!!n.noNullPrototype;return B(Fn(B(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:zI,depthIdentifier:n.depthIdentifier}),r?Re(!1):xi()).map(jI,WI)}var GI=Number.POSITIVE_INFINITY,HI=Number.MAX_SAFE_INTEGER,KI=Number.isInteger,qI=Math.floor,YI=Math.pow,ZI=Math.min,oc=class Mb extends he{static from(t,n,r){if(t.length===0)throw new Error(`${r} 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(`${r} expects arbitraries to be specified`);let s=t[o].weight;if(i+=s,!KI(s))throw new Error(`${r} expects weights to be integer values`);if(s<0)throw new Error(`${r} expects weights to be superior or equal to 0`)}if(i<=0)throw new Error(`${r} expects the sum of weights to be strictly superior to 0`);return new Mb(t,{depthBias:lI(n.depthSize,n.maxDepth!==void 0),maxDepth:n.maxDepth!==void 0?n.maxDepth:GI,withCrossShrink:!!n.withCrossShrink},$c(n.depthIdentifier))}constructor(t,n,r){super(),this.warbs=t,this.constraints=n,this.context=r;let i=0;this.cumulatedWeights=[];for(let o=0;o!==t.length;++o)i+=t[o].weight,T(this.cumulatedWeights,i);this.totalWeight=i}generate(t,n){if(this.mustGenerateFirst())return this.safeGenerateForIndex(t,0,n);let r=t.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let i=0;i!==this.cumulatedWeights.length;++i)if(r<this.cumulatedWeights[i])return this.safeGenerateForIndex(t,i,n);throw new Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(t){return this.canShrinkWithoutContextIndex(t)!==-1}shrink(t,n){if(n!==void 0){let i=n,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 D.of(l).join(a)}return a}let r=this.canShrinkWithoutContextIndex(t);return r===-1?D.nil():this.defaultShrinkForFirst(r).join(this.warbs[r].arbitrary.shrink(t,void 0).map(i=>this.mapIntoValue(r,i,null,void 0)))}defaultShrinkForFirst(t){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(t)||this.warbs[0].fallbackValue===void 0)return D.nil()}finally{--this.context.depth}let n=new O(this.warbs[0].fallbackValue.default,void 0);return D.of(this.mapIntoValue(0,n,null,void 0))}canShrinkWithoutContextIndex(t){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(t)?0:-1;try{++this.context.depth;for(let n=0;n!==this.warbs.length;++n){let r=this.warbs[n];if(r.weight!==0&&r.arbitrary.canShrinkWithoutContext(t))return n}return-1}finally{--this.context.depth}}mapIntoValue(t,n,r,i){let o={selectedIndex:t,originalBias:i,originalContext:n.context,clonedMrngForFallbackFirst:r};return new O(n.value,o)}safeGenerateForIndex(t,n,r){++this.context.depth;try{let i=this.warbs[n].arbitrary.generate(t,r),o=this.mustFallbackToFirstInShrink(n)?t.clone():null;return this.mapIntoValue(n,i,o,r)}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 n=qI(YI(1+t,this.context.depth))-1;return-ZI(this.totalWeight*n,HI)||0}};function XI(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function Gy(e){return Bg(e)?{arbitrary:e,weight:1}:e}function Te(...e){let t=e[0];if(XI(t)){let r=W(_e(e,1),Gy);return oc.from(r,t,"fc.oneof")}let n=W(e,Gy);return oc.from(n,{},"fc.oneof")}var JI=Number.isInteger;function gn(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(!JI(t))throw new Error("fc.nat maximum value should be an integer");return new pr(0,t)}var QI=Object.is;function eM(e){let t=0,n=[];for(let r of e){let i=t;t=i+r.num;let o=t-1;n.push({from:i,to:o,entry:r})}return n}function tM(e,t){let n=0,r=e.length;for(;r-n>1;){let i=~~((n+r)/2);t<e[i].from?r=i:n=i}return e[n]}function nM(e){let t=eM(e);return function(r){let i=tM(t,r);return i.entry.build(r-i.from)}}function rM(e){let t={mapping:new Yt,negativeZeroIndex:void 0},n=0;for(let r=0;r!==e.length;++r){let i=e[r];for(let o=0;o!==i.num;++o){let s=i.build(o);s===0&&1/s===qt.NEGATIVE_INFINITY?t.negativeZeroIndex=n:gt(t.mapping,s,n),++n}}return t}function iM(e){let t=null;return function(r){t===null&&(t=rM(e));let i=QI(r,-0)?t.negativeZeroIndex:it(t.mapping,r);if(i===void 0)throw new M("Unknown value encountered cannot be built using this mapToConstant");return i}}function oM(e){if(e.length===0)throw new M("fc.mapToConstant expects at least one option");let t=0;for(let n=0;n!==e.length;++n){if(e[n].num<0)throw new M("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");t+=e[n].num}if(t===0)throw new M("fc.mapToConstant expects at least one choice among options");return t}function mr(...e){return gn({max:oM(e)-1}).map(nM(e),iM(e))}function Tb(e,t,n,r){if(t.length===0)return n>0?void 0:[];if(r<=0)return;let i=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];for(;i.length>0;){let o=Hg(i);for(let s=o.nextStartIndex;s<=t.length;++s){let a=be(t,o.endIndexChunks,s);if(e.canShrinkWithoutContext(a)){let l=[...o.chunks,a];if(s===t.length){if(l.length<n)break;return l}T(i,{endIndexChunks:o.endIndexChunks,nextStartIndex:s+1,chunks:o.chunks}),l.length<r&&T(i,{endIndexChunks:s,nextStartIndex:s+1,chunks:l});break}}}}function sM(e){return fe(e,"")}function Ob(e){return e.minLength!==void 0?e.minLength:0}function Nb(e){return e.maxLength!==void 0?e.maxLength:Bn}function aM(e,t){return Ob(t)<=e.length&&e.length<=Nb(t)}function lM(e,t){return function(r){if(typeof r!="string")throw new M("Unsupported value");let i=Tb(e,r,Ob(t),Nb(t));if(i===void 0)throw new M("Unable to unmap received string");return i}}var $b=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function uM(e,t,n){let r;try{r=n(e)}catch{return}for(let i of r)if(!t.canShrinkWithoutContext(i))return;return r}function cM(e,t){let n=[];for(let r of $b){let i=uM(r,e,t);i!==void 0&&T(n,i)}return n}var Hy=new WeakMap;function dM(e){let t=[];for(let n of $b){let r=Tb(e,n,0,Bn);r!==void 0&&T(t,r)}return t}function fM(e,t){let n=c2(Hy,e);n===void 0&&(n=dM(e),u2(Hy,e,n));let r=[];for(let i of n)aM(i,t)&&T(r,i);return r}var hM=[[0,127]],pM=[[0,55295],[57344,1114111]],mM=[[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]],yM=[[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]],Ky=String.fromCodePoint,gM=Math.min,bM=Math.max;function sc(e){if(e.length===1){let n=Ky(e[0]);return{num:1,build:()=>n}}let t=e[0];return{num:e[1]-e[0]+1,build:n=>Ky(t+n)}}function qy(e,t){let n=[],r=0,i=0;for(;r<e.length&&i<t.length;){let o=e[r],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)r+=1;else if(c<s)i+=1;else{let d=bM(s,u),f=gM(a,c);if(n.length>=1){let p=n[n.length-1];(p.length===1?p[0]:p[1])+1===d&&(d=p[0],Hg(n))}T(n,d===f?[d]:[d,f]),a<=f&&(r+=1),c<=f&&(i+=1)}}return n}var Yy=Object.create(null);function SM(e){switch(e){case"full":return pM;case"ascii":return hM}}function wM(e,t){let n=`${e}:${t}`,r=Yy[n];if(r!==void 0)return r;let i=SM(t),o=e==="binary"?i:qy(i,mM),s=[];for(let l of o)T(s,sc(l));if(e==="grapheme"){let l=qy(i,yM);for(let u of l){let c=sc(u);T(s,{num:c.num,build:d=>P2(c.build(d),"NFD")})}}let a=mr(...s);return Yy[n]=a,a}function fi(e,t){return wM(e,t)}function xM(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return fi("grapheme","full");case"grapheme-composite":return fi("composite","full");case"grapheme-ascii":case void 0:return fi("grapheme","ascii");case"binary":return fi("binary","full");case"binary-ascii":return fi("binary","ascii")}}function Ie(e={}){let t=xM(e),n=lM(t,e),r=fM(t,e);return ue(t,{...e,experimentalCustomSlices:r}).map(sM,n)}var _b=Map,Fc=String.fromCharCode,Uc={num:26,build:e=>Fc(e+97)},vM={num:26,build:e=>Fc(e+65)},Lb={num:10,build:e=>Fc(e+48)};function RM(e){let t=jk(e);return e!==t?t:`%${yi(fr(e,0),16)}`}function AM(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var CM=()=>Ie({unit:"binary",minLength:1,maxLength:1}).map(RM,AM),Lu;function EM(){return Lu===void 0&&(Lu=mr(Uc)),Lu}var as;function ac(e){as===void 0&&(as=new _b);let t=it(as,e);return t===void 0&&(t=mr(Uc,Lb,{num:e.length,build:n=>e[n]}),gt(as,e,t)),t}function kM(e){return mr(Uc,vM,Lb,{num:e.length,build:t=>e[t]})}var ls;function jc(e){ls===void 0&&(ls=new _b);let t=it(ls,e);return t===void 0&&(t=Te({weight:10,arbitrary:kM(e)},{weight:1,arbitrary:CM()}),gt(ls,e,t)),t}function Xt(e,t={}){let n=t.freq===void 0?6:t.freq,r=Zg(t,"nil")?t.nil:null,i=[{arbitrary:Re(r),weight:1,fallbackValue:{default:r}},{arbitrary:e,weight:n-1}],o={withCrossShrink:!0,depthSize:t.depthSize,maxDepth:t.maxDepth,depthIdentifier:t.depthIdentifier};return oc.from(i,o,"fc.option")}function PM(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var Db=Symbol("adapted-value");function IM(e,t){let n=t(e.value_);return n.adapted?new O(n.value,Db):e}var MM=class extends he{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=n=>IM(n,t)}generate(e,t){let n=this.sourceArb.generate(e,t);return this.adaptValue(n)}canShrinkWithoutContext(e){return this.sourceArb.canShrinkWithoutContext(e)&&!this.adapter(e).adapted}shrink(e,t){return t===Db?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):D.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function Bb(e,t){return new MM(e,t)}function TM([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function OM(e){if(typeof e!="string"||e.length===0)throw new Error("Unsupported");return e.length===1?[e[0],null]:[e[0],[be(e,1,e.length-1),e[e.length-1]]]}function NM(e){let t=ac("");return B(t,Xt(B(Ie({unit:ac("-"),size:e,maxLength:61}),t))).map(TM,OM).filter(PM)}function $M(e){return`${fe(e[0],".")}.${e[1]}`}function _M(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e.lastIndexOf(".");return[je(be(e,0,t),"."),be(e,t+1)]}function LM(e){let[t,n]=e,r=n.length;for(let i=0;i!==t.length;++i)if(r+=1+t[i].length,r>255)return{adapted:!0,value:[_e(t,0,i),n]};return{adapted:!1,value:e}}function Vc(e={}){let t=Dc(e.size),n=wi("-1",t),r=Ie({unit:EM(),minLength:2,maxLength:63,size:n});return Bb(B(ue(NM(t),{size:n,minLength:1,maxLength:127}),r),LM).map($M,_M)}function DM(e){let t=e[0].length;for(let n=1;n!==e.length;++n)if(t+=1+e[n].length,t>64)return{adapted:!0,value:_e(e,0,n)};return{adapted:!1,value:e}}function BM(e){return fe(e,".")}function FM(e){if(typeof e!="string")throw new Error("Unsupported");return je(e,".")}function UM(e){return`${e[0]}@${e[1]}`}function jM(e){if(typeof e!="string")throw new Error("Unsupported");return je(e,"@",2)}function VM(e={}){return B(Bb(ue(Ie({unit:ac("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),DM).map(BM,FM),Vc({size:e.size})).map(UM,jM)}var WM=qt.NEGATIVE_INFINITY,lc=qt.POSITIVE_INFINITY,Fb=qt.EPSILON,Wc=k(2146435072)*k(4294967296),zM=-Wc-k(1),Zy=4503599627370496,GM=k(0xfffffffffffff),Xy=k("9007199254740992"),uc=new Float64Array(1),Jy=new Uint32Array(uc.buffer,uc.byteOffset);function HM(e){return uc[0]=e,[Jy[1],Jy[0]]}function KM(e){let{0:t,1:n}=HM(e),r=t>>>31,i=t>>>20&2047,o=(t&1048575)*4294967296+n,s=i===0?-1022:i-1023,a=i===0?0:1;return a+=o*Fb,a*=r===0?1:-1,{exponent:s,significand:a}}function Qy(e,t){return e===-1022?k(t*Zy):k((t-1)*Zy)+(k(e+1023)<<k(52))}function zc(e){if(e===lc)return Wc;if(e===WM)return zM;let t=KM(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===lc?Qy(n,r):-Qy(n,-r)-k(1)}function cc(e){if(e<0)return-cc(-e-k(1));if(e===Wc)return lc;if(e<Xy)return qt(e)*2**-1074;let t=e-Xy,n=-1021+qt(t>>k(52));return(1+qt(t&GM)*Fb)*2**n}var eg=Number.isInteger,tg=Object.is,Du=Number.NEGATIVE_INFINITY,Bu=Number.POSITIVE_INFINITY;function Ub(e,t,n,r){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:Du,max:l=i?t:Bu}=e,u=o?a<-n?-r:Math.max(a,-n):a===Du?Math.max(a,-r):Math.max(a,-n),c=s?l>n?r:Math.min(l,n):l===Bu?Math.min(l,r):Math.min(l,n);return{noDefaultInfinity:!1,minExcluded:o||(a!==Du||o)&&eg(u),maxExcluded:s||(l!==Bu||s)&&eg(c),min:tg(u,-0)?0:u,max:tg(c,0)?-0:c,noNaN:e.noNaN||!1}}var jb=Number.NEGATIVE_INFINITY,Vb=Number.POSITIVE_INFINITY,qM=Number.MAX_VALUE,YM=45035996273704955e-1,dc=4503599627370496;function ZM(e){return Ub(e,qM,YM,dc)}function XM(e){return e===4503599627370496?Vb:e===-4503599627370496?jb:e}function JM(e){if(typeof e!="number")throw new Error("Unsupported type");return e===Vb?dc:e===jb?-dc:e}var QM=Number.isInteger,Wb=Number.isNaN,e6=Number.NEGATIVE_INFINITY,t6=Number.POSITIVE_INFINITY,ng=Number.MAX_VALUE,n6=NaN;function rg(e,t){if(Wb(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return zc(e)}function r6(e){if(typeof e!="number")throw new Error("Unsupported type");return zc(e)}function i6(e){return!QM(e)}function ig(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-ng:e6,max:s=t?ng:t6}=e,a=rg(o,"min"),l=r?a+k(1):a,u=rg(s,"max"),c=i?u-k(1):u;if(c<l)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(n)return wn({min:l,max:c}).map(cc,r6);let d=c>k(0),f=d?l:l-k(1),p=d?c+k(1):c;return wn({min:f,max:p}).map(h=>c<h||h<l?n6:cc(h),h=>{if(typeof h!="number")throw new Error("Unsupported type");return Wb(h)?c!==p?p:f:zc(h)})}function ks(e={}){return e.noInteger?ig(ZM(e)).map(XM,JM).filter(i6):ig(e)}var o6=Number.NEGATIVE_INFINITY,fc=Number.POSITIVE_INFINITY,s6=Math.imul,hc=2**127*(1+(2**23-1)/2**23),zb=2139095040,a6=-2139095041,pc=new Float32Array(1),l6=new Uint32Array(pc.buffer,pc.byteOffset);function u6(e){return pc[0]=e,l6[0]}function c6(e){let t=u6(e),n=t>>>31,r=t>>>23&255,i=t&8388607,o=r===0?-126:r-127,s=r===0?0:1;return s+=i/2**23,s*=n===0?1:-1,{exponent:o,significand:s}}function og(e,t){return e===-126?t*8388608:s6(e+127,8388608)+(t-1)*8388608}function Gc(e){if(e===fc)return zb;if(e===o6)return a6;let t=c6(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===fc?og(n,r):-og(n,-r)-1}function mc(e){if(e<0)return-mc(-e-1);if(e===zb)return fc;if(e<16777216)return e*2**-149;let t=e-16777216,n=-125+(t>>23);return(1+(t&8388607)/8388608)*2**n}var Gb=Number.NEGATIVE_INFINITY,Hb=Number.POSITIVE_INFINITY,d6=hc,f6=83886075e-1,yc=8388608;function h6(e){return Ub(e,d6,f6,yc)}function p6(e){return e===8388608?Hb:e===-8388608?Gb:e}function m6(e){if(typeof e!="number")throw new Error("Unsupported type");return e===Hb?yc:e===Gb?-yc:e}var y6=Number.isInteger,Kb=Number.isNaN,g6=Math.fround,b6=Number.NEGATIVE_INFINITY,S6=Number.POSITIVE_INFINITY,w6=NaN;function sg(e,t){let n="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(Kb(e)||g6(e)!==e)throw new Error(n);return Gc(e)}function x6(e){if(typeof e!="number")throw new Error("Unsupported type");return Gc(e)}function v6(e){return!y6(e)}function ag(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-hc:b6,max:s=t?hc:S6}=e,a=sg(o,"min"),l=r?a+1:a,u=sg(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(n)return ne({min:l,max:c}).map(mc,x6);let d=c>0?l:l-1,f=c>0?c+1:c;return ne({min:d,max:f}).map(p=>p>c||p<l?w6:mc(p),p=>{if(typeof p!="number")throw new Error("Unsupported type");return Kb(p)?c!==f?f:d:Gc(p)})}function qb(e={}){return e.noInteger?ag(h6(e)).map(p6,m6).filter(v6):ag(e)}function R6(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function Yb(e){return e.replace(/\*\//g,"*\\/")}var nt=[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 As(e){let t=4294967295;for(let n=0;n<e.length;++n){let r=fr(e,n);if(r<128)t=nt[t&255^r]^t>>8;else if(r<2048)t=nt[t&255^(192|r>>6&31)]^t>>8,t=nt[t&255^(128|r&63)]^t>>8;else if(r>=55296&&r<57344){let i=fr(e,++n);if(r>=56320||i<56320||i>57343||Number.isNaN(i))n-=1,t=nt[t&255^239]^t>>8,t=nt[t&255^191]^t>>8,t=nt[t&255^189]^t>>8;else{let o=(r&1023)+64,s=i&1023;t=nt[t&255^(240|o>>8&7)]^t>>8,t=nt[t&255^(128|o>>2&63)]^t>>8,t=nt[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=nt[t&255^(128|s&63)]^t>>8}}else t=nt[t&255^(224|r>>12&15)]^t>>8,t=nt[t&255^(128|r>>6&63)]^t>>8,t=nt[t&255^(128|r&63)]^t>>8}return(t|0)+2147483648}var A6=Object.getPrototypeOf,hi=class extends he{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 D.nil()}};function Cs(e){return A6(e)===hi.prototype&&e.generate===hi.prototype.generate&&e.canShrinkWithoutContext===hi.prototype.canShrinkWithoutContext&&e.shrink===hi.prototype.shrink?e:new hi(e)}var C6=Object.assign,E6=Object.keys;function Zb(e){return B(Cs(ne()),Cs(ne({min:1,max:4294967295}))).map(([t,n])=>{let r=()=>{let i={};return C6((s,a)=>{let l=Ae(s),u=Ae(a),c=e(As(`${t}${l}`)%n,As(`${t}${u}`)%n);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=E6(i).sort().map(a=>`${a} => ${Ae(i[a])}`).map(a=>`/* ${Yb(a)} */`);return`function(a, b) {
38
+ ${CP(i)}`),o}function gb(e){return rc(e,Ae)}async function bb(e){let t=[];function n(s){let a=cb(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let r=rc(e,n);if(t.length===0)return r;let i=new Yt(await Promise.all(t));function o(s){let a=it(i,s);return a!==void 0?a:Ae(s)}return rc(e,o)}function Sb(e,t){if(t.runConfiguration.includeErrorInReport)throw new M(e);let n=new M(e,{cause:t.errorInstance});return"cause"in n||AP(n,{cause:t.errorInstance}),n}function TP(e){if(e.failed)throw Sb(gb(e),e)}async function OP(e){if(e.failed)throw Sb(await bb(e),e)}function NP(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):TP(e)}async function $P(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):OP(e)}function _P(e,t,n,r,i){let o=new fb(n,t,r,i);for(let s of o){e.runBeforeEach();let a=e.run(s);e.runAfterEach(),o.handleResult(a)}return o.runExecution}async function LP(e,t,n,r,i){let o=new fb(n,t,r,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 wb(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 n=Pc({...bt(),...t});if(n.reporter!==void 0&&n.asyncReporter!==void 0)throw new Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(n.asyncReporter!==void 0&&!e.isAsync())throw new Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let r=pP(e,n),i=n.path.length===0||n.path.indexOf(":")===-1?n.numRuns:-1,o=n.numRuns*n.maxSkipsPerRun,s=(...u)=>r.shrink(...u),a=new gP(n.path.length===0?pb(r,n.seed,n.randomType,n.examples):yb(n.path,Sn(mb(r,n.seed,n.randomType,n.examples)),s),i,o),l=n.endOnFailure?D.nil:s;return r.isAsync()?LP(r,l,a,n.verbose,n.markInterruptAsFailure).then(u=>u.toRunDetails(n.seed,n.path,o,n)):_P(r,l,a,n.verbose,n.markInterruptAsFailure).toRunDetails(n.seed,n.path,o,n)}function DP(e,t){let n=wb(e,t);if(e.isAsync())return n.then($P);NP(n)}function BP(e,t){let n=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new ab(e,()=>!0);return t.unbiased===!0?new ub(n):n}function xb(e,t){let n=Pc(typeof t=="number"?{...bt(),numRuns:t}:{...bt(),...t}),r=BP(e,n),i=r.shrink.bind(r);return(n.path.length===0?Sn(pb(r,n.seed,n.randomType,n.examples)):yb(n.path,Sn(mb(r,n.seed,n.randomType,n.examples)),i)).take(n.numRuns).map(o=>o.value_)}function FP(e,t){return[...xb(e,t)]}function UP(e){return(Math.round(e*100)/100).toFixed(2)}function jP(e,t,n){let r=Pc(typeof n=="number"?{...bt(),numRuns:n}:{...bt(),...n}),i={};for(let l of xb(e,n)){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],`${UP(l[1]*100/r.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)r.logger(`${l[0].padEnd(s,".")}..${l[1].padStart(a,".")}`)}var VP=Object.assign;function ic(e,t,n,r){let i=n(),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 f=c.value;return T(s.history,{arb:u,value:f,context:c.context,mrng:c.mrng}),o=c.mrng.clone(),f}let d=u.generate(o,t);return T(s.history,{arb:u,value:d.value_,context:d.context,mrng:o.clone()}),d.value},l=(u,...c)=>a(r(u,c));return new O(VP(l,{values(){return W(s.history,u=>u.value)},[Oe](){return ic(e,t,n,r).value},[St](){return Ae(W(s.history,u=>u.value))}}),s)}var $u=Array.isArray,$y=Object.keys,WP=Object.is;function zP(e){let t=new Yt;return function(r,i){let o=it(t,r);if(o===void 0){let l=r(...i);return gt(t,r,[{args:i,value:l}]),l}let s=o;for(let l of s)if(e(i,l.args))return l.value;let a=r(...i);return T(s,{args:i,value:a}),a}}function vb(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if($u(e)){if(!$u(t)||e.length!==t.length)return!1}else if($u(t))return!1;if($y(e).length!==$y(t).length)return!1;for(let n in e)if(!(n in t)||!vb(e[n],t[n]))return!1;return!0}else return WP(e,t)}var GP=class extends he{constructor(...e){super(...e),this.arbitraryCache=zP(vb)}generate(e,t){return ic(e,t,()=>[],this.arbitraryCache)}canShrinkWithoutContext(e){return!1}shrink(e,t){if(t===void 0)return D.nil();let n=t,r=n.mrng,i=n.biasFactor,o=n.history;return ib(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 W(o,(c,d)=>({arb:c.arb,value:l[d],context:u[d],mrng:c.mrng}))}return ic(r,i,a,this.arbitraryCache)})}};function HP(){return new GP}var KP=Math.floor,_y=Math.log;function qP(e){return KP(_y(e)/_y(2))}function YP(e){return e===k(0)?k(0):k(Ue(e).length)}function Rb(e,t,n){if(e===t)return[{min:e,max:t}];if(e<0&&t>0){let s=n(-e),a=n(t);return[{min:-s,max:a},{min:t-a,max:t},{min:e,max:e+s}]}let r=n(t-e),i={min:e,max:e+r},o={min:t-r,max:t};return e<0?[o,i]:[i,o]}var ZP=Math.ceil,XP=Math.floor;function Ly(e){return XP(e/2)}function Dy(e){return ZP(e/2)}function By(e,t,n){let r=e-t;function*i(){let s=n?void 0:t,a=n?r:Ly(r);for(let l=a;l>0;l=Ly(l)){let u=l===r?t:e-l;yield new O(u,s),s=u}}function*o(){let s=n?void 0:t,a=n?r:Dy(r);for(let l=a;l<0;l=Dy(l)){let u=l===r?t:e-l;yield new O(u,s),s=u}}return r>0?Sn(i()):Sn(o())}var Fy=Math.sign,JP=Number.isInteger,QP=Object.is,pr=class Ab extends he{constructor(t,n){super(),this.min=t,this.max=n}generate(t,n){let r=this.computeGenerateRange(t,n);return new O(t.nextInt(r.min,r.max),void 0)}canShrinkWithoutContext(t){return typeof t=="number"&&JP(t)&&!QP(t,-0)&&this.min<=t&&t<=this.max}shrink(t,n){return Ab.isValidContext(t,n)?this.isLastChanceTry(t,n)?D.of(new O(n,void 0)):By(t,n,!1):By(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?0:this.min<0?this.max:this.min}computeGenerateRange(t,n){if(n===void 0||t.nextInt(1,n)!==1)return{min:this.min,max:this.max};let r=Rb(this.min,this.max,qP);if(r.length===1)return r[0];let i=t.nextInt(-2*(r.length-1),r.length-2);return i<0?r[0]:r[i+1]}isLastChanceTry(t,n){return t>0?t===n+1&&t>this.min:t<0?t===n-1&&t<this.max:!1}static isValidContext(t,n){if(n===void 0)return!1;if(typeof n!="number")throw new Error("Invalid context type passed to IntegerArbitrary (#1)");if(n!==0&&Fy(t)!==Fy(n))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},Uy=Number.isInteger;function eI(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function ne(e={}){let t=eI(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!Uy(t.min))throw new Error("fc.integer minimum value should be an integer");if(!Uy(t.max))throw new Error("fc.integer maximum value should be an integer");return new pr(t.min,t.max)}var jy=new Map;function $c(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=it(jy,e);if(t!==void 0)return t;let n={depth:0};return gt(jy,e,n),n}function _c(){return{depth:0}}var tI=class{constructor(e,t,n){this.arb=e,this.mrng=t,this.biasFactor=n}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},nI=Math.min,rI=Math.max,iI=class{constructor(e,t,n,r){this.arb=e,this.mrng=t,this.slices=n,this.biasFactor=r,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 n=0;n!==this.slices.length;++n)this.slices[n].length===e&&T(t,n);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 O(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 O(e[0],void 0);let t=this.mrng.nextInt(0,e.length-1),n=this.mrng.nextInt(0,e.length-1);return this.nextIndexInSlice=nI(t,n),this.lastIndexInSlice=rI(t,n),new O(e[this.nextIndexInSlice++],void 0)}};function Vy(e,t,n,r){return r===void 0||n.length===0||t.nextInt(1,r)!==1?new tI(e,t,r):new iI(e,t,n,r)}var oI=Math.floor,Wy=Math.log,zy=Math.max,sI=Array.isArray;function _u(e,t){return e===t?e:e+oI(Wy(t-e)/Wy(2))}var Cb=class Eb extends he{constructor(t,n,r,i,o,s,a){super(),this.arb=t,this.minLength=n,this.maxGeneratedLength=r,this.maxLength=i,this.setBuilder=s,this.customSlices=a,this.lengthArb=ne({min:n,max:r}),this.depthContext=$c(o)}preFilter(t){if(this.setBuilder===void 0)return t;let n=this.setBuilder();for(let r=0;r!==t.length;++r)n.tryAdd(t[r]);return n.getData()}static makeItCloneable(t,n){return t[Oe]=()=>{let r=[];for(let i=0;i!==n.length;++i)T(r,n[i].value);return this.makeItCloneable(r,n),r},t}generateNItemsNoDuplicates(t,n,r,i){let o=0,s=t(),a=Vy(this.arb,r,this.customSlices,i);for(;s.size()<n&&o<this.maxGeneratedLength;){let l=a.next();s.tryAdd(l)?o=0:o+=1}return s.getData()}safeGenerateNItemsNoDuplicates(t,n,r,i){let o=zy(0,n-_u(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=o;try{return this.generateNItemsNoDuplicates(t,n,r,i)}finally{this.depthContext.depth-=o}}generateNItems(t,n,r){let i=[],o=Vy(this.arb,n,this.customSlices,r);o.attemptExact(t);for(let s=0;s!==t;++s)T(i,o.next());return i}safeGenerateNItems(t,n,r){let i=zy(0,t-_u(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=i;try{return this.generateNItems(t,n,r)}finally{this.depthContext.depth-=i}}wrapper(t,n,r,i){let o=n?this.preFilter(t):t,s=!1,a=[],l=[];for(let u=0;u!==o.length;++u){let c=o[u];s=s||c.hasToBeCloned,T(a,c.value),T(l,c.context)}return s&&Eb.makeItCloneable(a,o),new O(a,{shrunkOnce:n,lengthContext:t.length===o.length&&r!==void 0?r:void 0,itemsContexts:l,startIndex:i})}generate(t,n){let r=this.applyBias(t,n),i=r.size,o=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,i,t,r.biasFactorItems):this.safeGenerateNItems(i,t,r.biasFactorItems);return this.wrapper(o,!1,void 0,0)}applyBias(t,n){if(n===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:n};if(t.nextInt(1,n)!==1)return{size:this.lengthArb.generate(t,void 0).value};if(t.nextInt(1,n)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:n};let r=_u(this.minLength,this.maxGeneratedLength);return{size:ne({min:this.minLength,max:r}).generate(t,void 0).value,biasFactorItems:n}}canShrinkWithoutContext(t){if(!sI(t)||this.minLength>t.length||t.length>this.maxLength)return!1;for(let n=0;n!==t.length;++n)if(!(n in t)||!this.arb.canShrinkWithoutContext(t[n]))return!1;return this.preFilter(W(t,n=>new O(n,void 0))).length===t.length}shrinkItemByItem(t,n,r){let i=[];for(let o=n.startIndex;o<r;++o)T(i,bn(()=>this.arb.shrink(t[o],n.itemsContexts[o]).map(s=>{let a=W(_e(t,0,o),(u,c)=>new O(cr(u),n.itemsContexts[c])),l=W(_e(t,o+1),(u,c)=>new O(cr(u),n.itemsContexts[c+o+1]));return[[...a,s,...l],void 0,o]})));return D.nil().join(...i)}shrinkImpl(t,n){if(t.length===0)return D.nil();let r=n!==void 0?n:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(t.length,r.lengthContext).drop(r.shrunkOnce&&r.lengthContext===void 0&&t.length>this.minLength+1?1:0).map(i=>{let o=t.length-i.value;return[W(_e(t,o),(s,a)=>new O(cr(s),r.itemsContexts[a+o])),i.context,0]}).join(bn(()=>t.length>this.minLength?this.shrinkItemByItem(t,r,1):this.shrinkItemByItem(t,r,t.length))).join(t.length>this.minLength?bn(()=>{let i={shrunkOnce:!1,lengthContext:void 0,itemsContexts:_e(r.itemsContexts,1),startIndex:0};return this.shrinkImpl(_e(t,1),i).filter(o=>this.minLength<=o[0].length+1).map(o=>[[new O(cr(t[0]),r.itemsContexts[0]),...o[0]],void 0,0])}):D.nil())}shrink(t,n){return this.shrinkImpl(t,n).map(r=>this.wrapper(r[0],!0,r[1],r[2]))}},aI=Math.floor,lI=Math.min,Bn=2147483647,ar=["xsmall","small","medium","large","xlarge"],uI=["-4","-3","-2","-1","=","+1","+2","+3","+4"],Lc="small";function cI(e,t){switch(t){case"xsmall":return aI(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 wi(e,t){let n=Kt(uI,e);if(n===-1)return e;let r=Kt(ar,t);if(r===-1)throw new Error(`Unable to offset size based on the unknown defaulted one: ${t}`);let i=r+n-4;return i<0?ar[0]:i>=ar.length?ar[ar.length-1]:ar[i]}function bi(e,t,n,r){let{baseSize:i=Lc,defaultSizeToMaxWhenMaxSpecified:o}=bt()||{},s=e!==void 0?e:r&&o?"max":i;return s==="max"?n:lI(cI(t,wi(s,i)),n)}function dI(e,t){if(typeof e=="number")return 1/e;let{baseSize:n=Lc,defaultSizeToMaxWhenMaxSpecified:r}=bt()||{},i=e!==void 0?e:t&&r?"max":n;if(i==="max")return 0;switch(wi(i,n)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function Dc(e){let{baseSize:t=Lc}=bt()||{};return e===void 0?t:wi(e,t)}function ue(e,t={}){let n=t.size,r=t.minLength||0,i=t.maxLength,o=t.depthIdentifier,s=i!==void 0?i:Bn;return new Cb(e,r,bi(n,r,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function ss(e){return e/k(2)}function Gy(e,t,n){let r=e-t;function*i(){let s=n?void 0:t,a=n?r:ss(r);for(let l=a;l>0;l=ss(l)){let u=e-l;yield new O(u,s),s=u}}function*o(){let s=n?void 0:t,a=n?r:ss(r);for(let l=a;l<0;l=ss(l)){let u=e-l;yield new O(u,s),s=u}}return r>0?Sn(i()):Sn(o())}var fI=class kb extends he{constructor(t,n){super(),this.min=t,this.max=n}generate(t,n){let r=this.computeGenerateRange(t,n);return new O(t.nextBigInt(r.min,r.max),void 0)}computeGenerateRange(t,n){if(n===void 0||t.nextInt(1,n)!==1)return{min:this.min,max:this.max};let r=Rb(this.min,this.max,YP);if(r.length===1)return r[0];let i=t.nextInt(-2*(r.length-1),r.length-2);return i<0?r[0]:r[i+1]}canShrinkWithoutContext(t){return typeof t=="bigint"&&this.min<=t&&t<=this.max}shrink(t,n){return kb.isValidContext(t,n)?this.isLastChanceTry(t,n)?D.of(new O(n,void 0)):Gy(t,n,!1):Gy(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?k(0):this.min<0?this.max:this.min}isLastChanceTry(t,n){return t>0?t===n+k(1)&&t>this.min:t<0?t===n-k(1)&&t<this.max:!1}static isValidContext(t,n){if(n===void 0)return!1;if(typeof n!="bigint")throw new Error("Invalid context type passed to BigIntArbitrary (#1)");let r=t>0&&n<0||t<0&&n>0;if(n!==k(0)&&r)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function hI(e){let n=k(-1)<<k(255),r=(k(1)<<k(255))-k(1),i=e.min,o=e.max;return{min:i!==void 0?i:n-(o!==void 0&&o<k(0)?o*o:k(0)),max:o!==void 0?o:r+(i!==void 0&&i>k(0)?i*i:k(0))}}function pI(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function wn(...e){let t=hI(pI(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new fI(t.min,t.max)}var mI=Object.getPrototypeOf,di=class extends he{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 Rs(e){return mI(e)===di.prototype&&e.generate===di.prototype.generate&&e.canShrinkWithoutContext===di.prototype.canShrinkWithoutContext&&e.shrink===di.prototype.shrink?e:new di(e)}function yI(e){return e===1}function gI(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function xi(){return Rs(ne({min:0,max:1}).map(yI,gI))}var pi=Object.is,bI=class{constructor(e){this.values=e,this.fastValues=new dr(this.values);let t=!1,n=!1;if(vs(this.fastValues,0))for(let r=0;r!==this.values.length;++r){let i=this.values[r];t=t||pi(i,-0),n=n||pi(i,0)}this.hasMinusZero=t,this.hasPlusZero=n}has(e){return e===0?pi(e,0)?this.hasPlusZero:this.hasMinusZero:vs(this.fastValues,e)}},Pb=class extends he{constructor(e){super(),this.values=e}generate(e,t){let n=this.values.length===1?0:e.nextInt(0,this.values.length-1),r=this.values[n];return Dn(r)?new O(r,n,()=>r[Oe]()):new O(r,n)}canShrinkWithoutContext(e){return this.values.length===1?pi(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new bI(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||pi(e,this.values[0])?D.nil():D.of(new O(this.values[0],0))}};function Nt(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new Pb(e)}function SI(e){return!e||!e.withBigInt?Nt(!1,null,void 0,0,"",NaN):Nt(!1,null,void 0,0,"",NaN,k(0))}function Re(e){return new Pb([e])}var wI=class Ib{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Oe](){return new Ib}};function xI(){return Re(new wI)}var vI=NaN,RI=Number.isNaN;function Mb(e){return new ws(e)}function Tb(e){if(!(e instanceof ws)||e.constructor!==ws)throw new M("Not a valid value for date unmapper");return xs(e)}function AI(e){return t=>t===e?new ws(vI):Mb(t)}function CI(e){return t=>{let n=Tb(t);return RI(n)?e:n}}var Hy=Number.isNaN;function Ob(e={}){let t=e.min!==void 0?xs(e.min):-864e13,n=e.max!==void 0?xs(e.max):864e13,r=e.noInvalidDate;if(Hy(t))throw new Error("fc.date min must be valid instance of Date");if(Hy(n))throw new Error("fc.date max must be valid instance of Date");if(t>n)throw new Error("fc.date max must be greater or equal to min");if(r)return ne({min:t,max:n}).map(Mb,Tb);let i=n+1;return ne({min:t,max:n+1}).map(AI(i),CI(i))}var EI=class extends he{constructor(e,t){super(),this.startArb=e,this.chainer=t}generate(e,t){let n=[],r=e.clone(),i=this.startArb.generate(e,t);for(n.push({arbitrary:this.startArb,value:i.value_,context:i.context,clonedMrng:r});;){let s=this.chainer(i.value_);if(s===void 0)break;let a=e.clone();i=s.generate(e,t),n.push({arbitrary:s,value:i.value_,context:i.context,clonedMrng:a})}let o={biasFactor:t,entries:n,currentShrinkLevel:0};return new O(i.value_,o)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?new D(this.shrinkIterator(t)):D.nil()}*shrinkIterator(e){let{entries:t,currentShrinkLevel:n,biasFactor:r}=e;for(let i=n;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 p=this.chainer(u.value_);if(p===void 0)break;let h=c.clone(),m=p.generate(c,r);l.push({arbitrary:p,value:m.value_,context:m.context,clonedMrng:h}),u=m}let d=l[l.length-1],f={biasFactor:r,entries:l,currentShrinkLevel:i};yield new O(d.value,f)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function kI(e,t){return new EI(e,t)}var PI=Symbol.iterator,II=Array.isArray,MI=Object.is,TI=class Nb extends he{constructor(t,n){super(),this.arb=t,this.numValues=n}generate(t,n){let r=[];if(this.numValues<=0)return this.wrapper(r);for(let i=0;i!==this.numValues-1;++i)T(r,this.arb.generate(t.clone(),n));return T(r,this.arb.generate(t,n)),this.wrapper(r)}canShrinkWithoutContext(t){if(!II(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let n=1;n<t.length;++n)if(!MI(t[0],t[n]))return!1;return this.arb.canShrinkWithoutContext(t[0])}shrink(t,n){return t.length===0?D.nil():new D(this.shrinkImpl(t,n!==void 0?n:[])).map(r=>this.wrapper(r))}*shrinkImpl(t,n){let r=W(t,(o,s)=>this.arb.shrink(o,n[s])[PI]()),i=W(r,o=>o.next());for(;!i[0].done;)yield W(i,o=>o.value),i=W(r,o=>o.next())}static makeItCloneable(t,n){return t[Oe]=()=>{let r=[];for(let i=0;i!==n.length;++i)T(r,n[i].value);return this.makeItCloneable(r,n),r},t}wrapper(t){let n=!1,r=[],i=[];for(let o=0;o!==t.length;++o){let s=t[o];n=n||s.hasToBeCloned,T(r,s.value),T(i,s.context)}return n&&Nb.makeItCloneable(r,t),new O(r,i)}};function OI(e,t){return new TI(e,t)}var Ky=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 T(this.data,e),!0}size(){return this.data.length}getData(){return this.data}},NI=Number.isNaN,$I=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new dr,this.data=[]}tryAdd(e){let t=this.selector(e);if(NI(t))return T(this.data,e),!0;let n=this.selectedItemsExceptNaN.size;return mi(this.selectedItemsExceptNaN,t),n!==this.selectedItemsExceptNaN.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},_I=Object.is,LI=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new dr,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(_I(t,-0))return this.hasMinusZero?!1:(T(this.data,e),this.hasMinusZero=!0,!0);let n=this.selectedItemsExceptMinusZero.size;return mi(this.selectedItemsExceptMinusZero,t),n!==this.selectedItemsExceptMinusZero.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},DI=class{constructor(e){this.selector=e,this.selectedItems=new dr,this.data=[]}tryAdd(e){let t=this.selector(e),n=this.selectedItems.size;return mi(this.selectedItems,t),n!==this.selectedItems.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function BI(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 Ky(l)}let r=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>r(o(a),o(l));return()=>new Ky(s)}let t=e.selector||(r=>r),n=r=>t(r.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new $I(n);case"SameValueZero":return()=>new DI(n);case"SameValue":case void 0:return()=>new LI(n)}}function Fn(e,t={}){let n=t.minLength!==void 0?t.minLength:0,r=t.maxLength!==void 0?t.maxLength:Bn,i=bi(t.size,n,r,t.maxLength!==void 0),o=t.depthIdentifier,s=new Cb(e,n,i,r,o,BI(t),[]);return n===0?s:s.filter(a=>a.length>=n)}var FI=Object.create,UI=Object.defineProperty,jI=Object.getOwnPropertyDescriptor,qy=Object.getPrototypeOf,VI=Object.prototype,WI=Reflect.ownKeys;function zI(e){let t=e[1]?FI(null):{};for(let n of e[0])UI(t,n[0],{enumerable:!0,configurable:!0,writable:!0,value:n[1]});return t}function GI(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function HI(e){if(typeof e!="object"||e===null)throw new M("Incompatible instance received: should be a non-null object");let t=qy(e)===null,n=qy(e)===VI;if(!t&&!n)throw new M("Incompatible instance received: should be of exact type Object");let r=W(WI(e),i=>[i,jI(e,i)]);if(!Qg(r,([,i])=>GI(i)))throw new M("Incompatible instance received: should contain only c/e/w properties without get/set");return[W(r,([i,o])=>[i,o.value]),t]}function KI(e){return e[0]}function Bc(e,t,n={}){let r=!!n.noNullPrototype;return B(Fn(B(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:KI,depthIdentifier:n.depthIdentifier}),r?Re(!1):xi()).map(zI,HI)}var qI=Number.POSITIVE_INFINITY,YI=Number.MAX_SAFE_INTEGER,ZI=Number.isInteger,XI=Math.floor,JI=Math.pow,QI=Math.min,oc=class $b extends he{static from(t,n,r){if(t.length===0)throw new Error(`${r} 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(`${r} expects arbitraries to be specified`);let s=t[o].weight;if(i+=s,!ZI(s))throw new Error(`${r} expects weights to be integer values`);if(s<0)throw new Error(`${r} expects weights to be superior or equal to 0`)}if(i<=0)throw new Error(`${r} expects the sum of weights to be strictly superior to 0`);return new $b(t,{depthBias:dI(n.depthSize,n.maxDepth!==void 0),maxDepth:n.maxDepth!==void 0?n.maxDepth:qI,withCrossShrink:!!n.withCrossShrink},$c(n.depthIdentifier))}constructor(t,n,r){super(),this.warbs=t,this.constraints=n,this.context=r;let i=0;this.cumulatedWeights=[];for(let o=0;o!==t.length;++o)i+=t[o].weight,T(this.cumulatedWeights,i);this.totalWeight=i}generate(t,n){if(this.mustGenerateFirst())return this.safeGenerateForIndex(t,0,n);let r=t.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let i=0;i!==this.cumulatedWeights.length;++i)if(r<this.cumulatedWeights[i])return this.safeGenerateForIndex(t,i,n);throw new Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(t){return this.canShrinkWithoutContextIndex(t)!==-1}shrink(t,n){if(n!==void 0){let i=n,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 D.of(l).join(a)}return a}let r=this.canShrinkWithoutContextIndex(t);return r===-1?D.nil():this.defaultShrinkForFirst(r).join(this.warbs[r].arbitrary.shrink(t,void 0).map(i=>this.mapIntoValue(r,i,null,void 0)))}defaultShrinkForFirst(t){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(t)||this.warbs[0].fallbackValue===void 0)return D.nil()}finally{--this.context.depth}let n=new O(this.warbs[0].fallbackValue.default,void 0);return D.of(this.mapIntoValue(0,n,null,void 0))}canShrinkWithoutContextIndex(t){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(t)?0:-1;try{++this.context.depth;for(let n=0;n!==this.warbs.length;++n){let r=this.warbs[n];if(r.weight!==0&&r.arbitrary.canShrinkWithoutContext(t))return n}return-1}finally{--this.context.depth}}mapIntoValue(t,n,r,i){let o={selectedIndex:t,originalBias:i,originalContext:n.context,clonedMrngForFallbackFirst:r};return new O(n.value,o)}safeGenerateForIndex(t,n,r){++this.context.depth;try{let i=this.warbs[n].arbitrary.generate(t,r),o=this.mustFallbackToFirstInShrink(n)?t.clone():null;return this.mapIntoValue(n,i,o,r)}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 n=XI(JI(1+t,this.context.depth))-1;return-QI(this.totalWeight*n,YI)||0}};function eM(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function Yy(e){return Vg(e)?{arbitrary:e,weight:1}:e}function Te(...e){let t=e[0];if(eM(t)){let r=W(_e(e,1),Yy);return oc.from(r,t,"fc.oneof")}let n=W(e,Yy);return oc.from(n,{},"fc.oneof")}var tM=Number.isInteger;function gn(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(!tM(t))throw new Error("fc.nat maximum value should be an integer");return new pr(0,t)}var nM=Object.is;function rM(e){let t=0,n=[];for(let r of e){let i=t;t=i+r.num;let o=t-1;n.push({from:i,to:o,entry:r})}return n}function iM(e,t){let n=0,r=e.length;for(;r-n>1;){let i=~~((n+r)/2);t<e[i].from?r=i:n=i}return e[n]}function oM(e){let t=rM(e);return function(r){let i=iM(t,r);return i.entry.build(r-i.from)}}function sM(e){let t={mapping:new Yt,negativeZeroIndex:void 0},n=0;for(let r=0;r!==e.length;++r){let i=e[r];for(let o=0;o!==i.num;++o){let s=i.build(o);s===0&&1/s===qt.NEGATIVE_INFINITY?t.negativeZeroIndex=n:gt(t.mapping,s,n),++n}}return t}function aM(e){let t=null;return function(r){t===null&&(t=sM(e));let i=nM(r,-0)?t.negativeZeroIndex:it(t.mapping,r);if(i===void 0)throw new M("Unknown value encountered cannot be built using this mapToConstant");return i}}function lM(e){if(e.length===0)throw new M("fc.mapToConstant expects at least one option");let t=0;for(let n=0;n!==e.length;++n){if(e[n].num<0)throw new M("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");t+=e[n].num}if(t===0)throw new M("fc.mapToConstant expects at least one choice among options");return t}function mr(...e){return gn({max:lM(e)-1}).map(oM(e),aM(e))}function _b(e,t,n,r){if(t.length===0)return n>0?void 0:[];if(r<=0)return;let i=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];for(;i.length>0;){let o=Zg(i);for(let s=o.nextStartIndex;s<=t.length;++s){let a=be(t,o.endIndexChunks,s);if(e.canShrinkWithoutContext(a)){let l=[...o.chunks,a];if(s===t.length){if(l.length<n)break;return l}T(i,{endIndexChunks:o.endIndexChunks,nextStartIndex:s+1,chunks:o.chunks}),l.length<r&&T(i,{endIndexChunks:s,nextStartIndex:s+1,chunks:l});break}}}}function uM(e){return fe(e,"")}function Lb(e){return e.minLength!==void 0?e.minLength:0}function Db(e){return e.maxLength!==void 0?e.maxLength:Bn}function cM(e,t){return Lb(t)<=e.length&&e.length<=Db(t)}function dM(e,t){return function(r){if(typeof r!="string")throw new M("Unsupported value");let i=_b(e,r,Lb(t),Db(t));if(i===void 0)throw new M("Unable to unmap received string");return i}}var Bb=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function fM(e,t,n){let r;try{r=n(e)}catch{return}for(let i of r)if(!t.canShrinkWithoutContext(i))return;return r}function hM(e,t){let n=[];for(let r of Bb){let i=fM(r,e,t);i!==void 0&&T(n,i)}return n}var Zy=new WeakMap;function pM(e){let t=[];for(let n of Bb){let r=_b(e,n,0,Bn);r!==void 0&&T(t,r)}return t}function mM(e,t){let n=h2(Zy,e);n===void 0&&(n=pM(e),f2(Zy,e,n));let r=[];for(let i of n)cM(i,t)&&T(r,i);return r}var yM=[[0,127]],gM=[[0,55295],[57344,1114111]],bM=[[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]],SM=[[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]],Xy=String.fromCodePoint,wM=Math.min,xM=Math.max;function sc(e){if(e.length===1){let n=Xy(e[0]);return{num:1,build:()=>n}}let t=e[0];return{num:e[1]-e[0]+1,build:n=>Xy(t+n)}}function Jy(e,t){let n=[],r=0,i=0;for(;r<e.length&&i<t.length;){let o=e[r],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)r+=1;else if(c<s)i+=1;else{let d=xM(s,u),f=wM(a,c);if(n.length>=1){let p=n[n.length-1];(p.length===1?p[0]:p[1])+1===d&&(d=p[0],Zg(n))}T(n,d===f?[d]:[d,f]),a<=f&&(r+=1),c<=f&&(i+=1)}}return n}var Qy=Object.create(null);function vM(e){switch(e){case"full":return gM;case"ascii":return yM}}function RM(e,t){let n=`${e}:${t}`,r=Qy[n];if(r!==void 0)return r;let i=vM(t),o=e==="binary"?i:Jy(i,bM),s=[];for(let l of o)T(s,sc(l));if(e==="grapheme"){let l=Jy(i,SM);for(let u of l){let c=sc(u);T(s,{num:c.num,build:d=>T2(c.build(d),"NFD")})}}let a=mr(...s);return Qy[n]=a,a}function fi(e,t){return RM(e,t)}function AM(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return fi("grapheme","full");case"grapheme-composite":return fi("composite","full");case"grapheme-ascii":case void 0:return fi("grapheme","ascii");case"binary":return fi("binary","full");case"binary-ascii":return fi("binary","ascii")}}function Ie(e={}){let t=AM(e),n=dM(t,e),r=mM(t,e);return ue(t,{...e,experimentalCustomSlices:r}).map(uM,n)}var Fb=Map,Fc=String.fromCharCode,Uc={num:26,build:e=>Fc(e+97)},CM={num:26,build:e=>Fc(e+65)},Ub={num:10,build:e=>Fc(e+48)};function EM(e){let t=zk(e);return e!==t?t:`%${yi(fr(e,0),16)}`}function kM(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var PM=()=>Ie({unit:"binary",minLength:1,maxLength:1}).map(EM,kM),Lu;function IM(){return Lu===void 0&&(Lu=mr(Uc)),Lu}var as;function ac(e){as===void 0&&(as=new Fb);let t=it(as,e);return t===void 0&&(t=mr(Uc,Ub,{num:e.length,build:n=>e[n]}),gt(as,e,t)),t}function MM(e){return mr(Uc,CM,Ub,{num:e.length,build:t=>e[t]})}var ls;function jc(e){ls===void 0&&(ls=new Fb);let t=it(ls,e);return t===void 0&&(t=Te({weight:10,arbitrary:MM(e)},{weight:1,arbitrary:PM()}),gt(ls,e,t)),t}function Xt(e,t={}){let n=t.freq===void 0?6:t.freq,r=eb(t,"nil")?t.nil:null,i=[{arbitrary:Re(r),weight:1,fallbackValue:{default:r}},{arbitrary:e,weight:n-1}],o={withCrossShrink:!0,depthSize:t.depthSize,maxDepth:t.maxDepth,depthIdentifier:t.depthIdentifier};return oc.from(i,o,"fc.option")}function TM(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var jb=Symbol("adapted-value");function OM(e,t){let n=t(e.value_);return n.adapted?new O(n.value,jb):e}var NM=class extends he{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=n=>OM(n,t)}generate(e,t){let n=this.sourceArb.generate(e,t);return this.adaptValue(n)}canShrinkWithoutContext(e){return this.sourceArb.canShrinkWithoutContext(e)&&!this.adapter(e).adapted}shrink(e,t){return t===jb?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):D.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function Vb(e,t){return new NM(e,t)}function $M([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function _M(e){if(typeof e!="string"||e.length===0)throw new Error("Unsupported");return e.length===1?[e[0],null]:[e[0],[be(e,1,e.length-1),e[e.length-1]]]}function LM(e){let t=ac("");return B(t,Xt(B(Ie({unit:ac("-"),size:e,maxLength:61}),t))).map($M,_M).filter(TM)}function DM(e){return`${fe(e[0],".")}.${e[1]}`}function BM(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e.lastIndexOf(".");return[je(be(e,0,t),"."),be(e,t+1)]}function FM(e){let[t,n]=e,r=n.length;for(let i=0;i!==t.length;++i)if(r+=1+t[i].length,r>255)return{adapted:!0,value:[_e(t,0,i),n]};return{adapted:!1,value:e}}function Vc(e={}){let t=Dc(e.size),n=wi("-1",t),r=Ie({unit:IM(),minLength:2,maxLength:63,size:n});return Vb(B(ue(LM(t),{size:n,minLength:1,maxLength:127}),r),FM).map(DM,BM)}function UM(e){let t=e[0].length;for(let n=1;n!==e.length;++n)if(t+=1+e[n].length,t>64)return{adapted:!0,value:_e(e,0,n)};return{adapted:!1,value:e}}function jM(e){return fe(e,".")}function VM(e){if(typeof e!="string")throw new Error("Unsupported");return je(e,".")}function WM(e){return`${e[0]}@${e[1]}`}function zM(e){if(typeof e!="string")throw new Error("Unsupported");return je(e,"@",2)}function GM(e={}){return B(Vb(ue(Ie({unit:ac("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),UM).map(jM,VM),Vc({size:e.size})).map(WM,zM)}var HM=qt.NEGATIVE_INFINITY,lc=qt.POSITIVE_INFINITY,Wb=qt.EPSILON,Wc=k(2146435072)*k(4294967296),KM=-Wc-k(1),eg=4503599627370496,qM=k(0xfffffffffffff),tg=k("9007199254740992"),uc=new Float64Array(1),ng=new Uint32Array(uc.buffer,uc.byteOffset);function YM(e){return uc[0]=e,[ng[1],ng[0]]}function ZM(e){let{0:t,1:n}=YM(e),r=t>>>31,i=t>>>20&2047,o=(t&1048575)*4294967296+n,s=i===0?-1022:i-1023,a=i===0?0:1;return a+=o*Wb,a*=r===0?1:-1,{exponent:s,significand:a}}function rg(e,t){return e===-1022?k(t*eg):k((t-1)*eg)+(k(e+1023)<<k(52))}function zc(e){if(e===lc)return Wc;if(e===HM)return KM;let t=ZM(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===lc?rg(n,r):-rg(n,-r)-k(1)}function cc(e){if(e<0)return-cc(-e-k(1));if(e===Wc)return lc;if(e<tg)return qt(e)*2**-1074;let t=e-tg,n=-1021+qt(t>>k(52));return(1+qt(t&qM)*Wb)*2**n}var ig=Number.isInteger,og=Object.is,Du=Number.NEGATIVE_INFINITY,Bu=Number.POSITIVE_INFINITY;function zb(e,t,n,r){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:Du,max:l=i?t:Bu}=e,u=o?a<-n?-r:Math.max(a,-n):a===Du?Math.max(a,-r):Math.max(a,-n),c=s?l>n?r:Math.min(l,n):l===Bu?Math.min(l,r):Math.min(l,n);return{noDefaultInfinity:!1,minExcluded:o||(a!==Du||o)&&ig(u),maxExcluded:s||(l!==Bu||s)&&ig(c),min:og(u,-0)?0:u,max:og(c,0)?-0:c,noNaN:e.noNaN||!1}}var Gb=Number.NEGATIVE_INFINITY,Hb=Number.POSITIVE_INFINITY,XM=Number.MAX_VALUE,JM=45035996273704955e-1,dc=4503599627370496;function QM(e){return zb(e,XM,JM,dc)}function e6(e){return e===4503599627370496?Hb:e===-4503599627370496?Gb:e}function t6(e){if(typeof e!="number")throw new Error("Unsupported type");return e===Hb?dc:e===Gb?-dc:e}var n6=Number.isInteger,Kb=Number.isNaN,r6=Number.NEGATIVE_INFINITY,i6=Number.POSITIVE_INFINITY,sg=Number.MAX_VALUE,o6=NaN;function ag(e,t){if(Kb(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return zc(e)}function s6(e){if(typeof e!="number")throw new Error("Unsupported type");return zc(e)}function a6(e){return!n6(e)}function lg(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-sg:r6,max:s=t?sg:i6}=e,a=ag(o,"min"),l=r?a+k(1):a,u=ag(s,"max"),c=i?u-k(1):u;if(c<l)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(n)return wn({min:l,max:c}).map(cc,s6);let d=c>k(0),f=d?l:l-k(1),p=d?c+k(1):c;return wn({min:f,max:p}).map(h=>c<h||h<l?o6:cc(h),h=>{if(typeof h!="number")throw new Error("Unsupported type");return Kb(h)?c!==p?p:f:zc(h)})}function ks(e={}){return e.noInteger?lg(QM(e)).map(e6,t6).filter(a6):lg(e)}var l6=Number.NEGATIVE_INFINITY,fc=Number.POSITIVE_INFINITY,u6=Math.imul,hc=2**127*(1+(2**23-1)/2**23),qb=2139095040,c6=-2139095041,pc=new Float32Array(1),d6=new Uint32Array(pc.buffer,pc.byteOffset);function f6(e){return pc[0]=e,d6[0]}function h6(e){let t=f6(e),n=t>>>31,r=t>>>23&255,i=t&8388607,o=r===0?-126:r-127,s=r===0?0:1;return s+=i/2**23,s*=n===0?1:-1,{exponent:o,significand:s}}function ug(e,t){return e===-126?t*8388608:u6(e+127,8388608)+(t-1)*8388608}function Gc(e){if(e===fc)return qb;if(e===l6)return c6;let t=h6(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===fc?ug(n,r):-ug(n,-r)-1}function mc(e){if(e<0)return-mc(-e-1);if(e===qb)return fc;if(e<16777216)return e*2**-149;let t=e-16777216,n=-125+(t>>23);return(1+(t&8388607)/8388608)*2**n}var Yb=Number.NEGATIVE_INFINITY,Zb=Number.POSITIVE_INFINITY,p6=hc,m6=83886075e-1,yc=8388608;function y6(e){return zb(e,p6,m6,yc)}function g6(e){return e===8388608?Zb:e===-8388608?Yb:e}function b6(e){if(typeof e!="number")throw new Error("Unsupported type");return e===Zb?yc:e===Yb?-yc:e}var S6=Number.isInteger,Xb=Number.isNaN,w6=Math.fround,x6=Number.NEGATIVE_INFINITY,v6=Number.POSITIVE_INFINITY,R6=NaN;function cg(e,t){let n="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(Xb(e)||w6(e)!==e)throw new Error(n);return Gc(e)}function A6(e){if(typeof e!="number")throw new Error("Unsupported type");return Gc(e)}function C6(e){return!S6(e)}function dg(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-hc:x6,max:s=t?hc:v6}=e,a=cg(o,"min"),l=r?a+1:a,u=cg(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(n)return ne({min:l,max:c}).map(mc,A6);let d=c>0?l:l-1,f=c>0?c+1:c;return ne({min:d,max:f}).map(p=>p>c||p<l?R6:mc(p),p=>{if(typeof p!="number")throw new Error("Unsupported type");return Xb(p)?c!==f?f:d:Gc(p)})}function Jb(e={}){return e.noInteger?dg(y6(e)).map(g6,b6).filter(C6):dg(e)}function E6(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function Qb(e){return e.replace(/\*\//g,"*\\/")}var nt=[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 As(e){let t=4294967295;for(let n=0;n<e.length;++n){let r=fr(e,n);if(r<128)t=nt[t&255^r]^t>>8;else if(r<2048)t=nt[t&255^(192|r>>6&31)]^t>>8,t=nt[t&255^(128|r&63)]^t>>8;else if(r>=55296&&r<57344){let i=fr(e,++n);if(r>=56320||i<56320||i>57343||Number.isNaN(i))n-=1,t=nt[t&255^239]^t>>8,t=nt[t&255^191]^t>>8,t=nt[t&255^189]^t>>8;else{let o=(r&1023)+64,s=i&1023;t=nt[t&255^(240|o>>8&7)]^t>>8,t=nt[t&255^(128|o>>2&63)]^t>>8,t=nt[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=nt[t&255^(128|s&63)]^t>>8}}else t=nt[t&255^(224|r>>12&15)]^t>>8,t=nt[t&255^(128|r>>6&63)]^t>>8,t=nt[t&255^(128|r&63)]^t>>8}return(t|0)+2147483648}var k6=Object.getPrototypeOf,hi=class extends he{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 D.nil()}};function Cs(e){return k6(e)===hi.prototype&&e.generate===hi.prototype.generate&&e.canShrinkWithoutContext===hi.prototype.canShrinkWithoutContext&&e.shrink===hi.prototype.shrink?e:new hi(e)}var P6=Object.assign,I6=Object.keys;function e0(e){return B(Cs(ne()),Cs(ne({min:1,max:4294967295}))).map(([t,n])=>{let r=()=>{let i={};return P6((s,a)=>{let l=Ae(s),u=Ae(a),c=e(As(`${t}${l}`)%n,As(`${t}${u}`)%n);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=I6(i).sort().map(a=>`${a} => ${Ae(i[a])}`).map(a=>`/* ${Qb(a)} */`);return`function(a, b) {
39
39
  // With hash and stringify coming from fast-check${s.length!==0?`
40
40
  ${fe(s,`
41
41
  `)}`:""}
@@ -43,18 +43,18 @@ ${vP(i)}`),o}function hb(e){return rc(e,Ae)}async function pb(e){let t=[];functi
43
43
  const hA = hash('${t}' + stringify(a)) % ${n};
44
44
  const hB = hash('${t}' + stringify(b)) % ${n};
45
45
  return cmp(hA, hB);
46
- }`},[Oe]:r})};return r()})}var k6=Object.assign;function P6(){return Zb(k6((e,t)=>e<t,{toString(){return"(hA, hB) => hA < hB"}}))}var I6=Object.assign;function M6(){return Zb(I6((e,t)=>e-t,{toString(){return"(hA, hB) => hA - hB"}}))}var T6=Object.defineProperties,O6=Object.keys;function N6(e){return B(ue(e,{minLength:1}),Cs(ne())).map(([t,n])=>{let r=()=>{let i={},o=(...a)=>{let l=Ae(a),u=t[As(`${n}${l}`)%t.length];return i[l]=u,Dn(u)?u[Oe]():u};function s(a){let l=W(W(qg(O6(i)),u=>`${u} => ${Ae(i[u])}`),u=>`/* ${Yb(u)} */`);return`function(...args) {
46
+ }`},[Oe]:r})};return r()})}var M6=Object.assign;function T6(){return e0(M6((e,t)=>e<t,{toString(){return"(hA, hB) => hA < hB"}}))}var O6=Object.assign;function N6(){return e0(O6((e,t)=>e-t,{toString(){return"(hA, hB) => hA - hB"}}))}var $6=Object.defineProperties,_6=Object.keys;function L6(e){return B(ue(e,{minLength:1}),Cs(ne())).map(([t,n])=>{let r=()=>{let i={},o=(...a)=>{let l=Ae(a),u=t[As(`${n}${l}`)%t.length];return i[l]=u,Dn(u)?u[Oe]():u};function s(a){let l=W(W(Jg(_6(i)),u=>`${u} => ${Ae(i[u])}`),u=>`/* ${Qb(u)} */`);return`function(...args) {
47
47
  // With hash and stringify coming from fast-check${l.length!==0?`
48
48
  ${l.join(`
49
49
  `)}`:""}
50
50
  const outs = ${a};
51
51
  return outs[hash('${n}' + stringify(args)) % outs.length];
52
- }`}return T6(o,{toString:{value:()=>s(Ae(t))},[St]:{value:()=>s(Ae(t))},[Zt]:{value:async()=>s(await Tc(t))},[Oe]:{value:r,configurable:!0}})};return r()})}var $6=Number.MIN_SAFE_INTEGER,_6=Number.MAX_SAFE_INTEGER;function Xb(){return new pr($6,_6)}var L6=Number.MAX_SAFE_INTEGER;function D6(){return new pr(0,L6)}var B6=Number.parseInt;function F6(e){let[t,n]=e;switch(t){case"oct":return`0${yi(n,8)}`;case"hex":return`0x${yi(n,16)}`;default:return`${n}`}}function ps(e,t){let n=B6(e,t);if(yi(n,t)!==e)throw new Error("Invalid value");return n}function U6(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",ps(be(e,2),16)]:["oct",ps(be(e,1),8)]:["dec",ps(e,10)]}function j6(e){return fe(e,".")}function V6(e){if(typeof e!="string")throw new Error("Invalid type");return W(je(e,"."),t=>ps(t,10))}function Hc(){return B(gn(255),gn(255),gn(255),gn(255)).map(j6,V6)}function Ot(e){return B(Nt("dec","oct","hex"),gn(e)).map(F6,U6)}function Fu(e){return fe(e,".")}function Uu(e){if(typeof e!="string")throw new Error("Invalid type");return je(e,".")}function Jb(){return Te(B(Ot(255),Ot(255),Ot(255),Ot(255)).map(Fu,Uu),B(Ot(255),Ot(255),Ot(65535)).map(Fu,Uu),B(Ot(255),Ot(16777215)).map(Fu,Uu),Ot(4294967295))}function Kc(e){return e.length===0?[]:je(e,":")}function qc(e){let t=je(e,":");return t.length>=2&&t[t.length-1].length<=4?[_e(t,0,t.length-2),`${t[t.length-2]}:${t[t.length-1]}`]:[_e(t,0,t.length-1),t[t.length-1]]}function W6(e){return`${fe(e[0],":")}:${e[1]}`}function z6(e){if(typeof e!="string")throw new Error("Invalid type");return qc(e)}function G6(e){return`::${fe(e[0],":")}:${e[1]}`}function H6(e){if(typeof e!="string")throw new Error("Invalid type");if(!C2(e,"::"))throw new Error("Invalid value");return qc(be(e,2))}function ms(e){return`${fe(e[0],":")}::${fe(e[1],":")}:${e[2]}`}function ys(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=je(e,"::",2),[r,i]=qc(n);return[Kc(t),r,i]}function K6(e){return ms([e[0],[e[1]],e[2]])}function q6(e){let t=ys(e);return[t[0],fe(t[1],":"),t[2]]}function lg(e){return`${fe(e[0],":")}::${e[1]}`}function ug(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=je(e,"::",2);return[Kc(t),n]}function Y6(e){return`${fe(e[0],":")}::`}function Z6(e){if(typeof e!="string")throw new Error("Invalid type");if(!E2(e,"::"))throw new Error("Invalid value");return[Kc(be(e,0,e.length-2))]}function X6([e,t]){return`${e}:${t}`}function J6(e){if(typeof e!="string")throw new M("Invalid type");if(!e.includes(":"))throw new M("Invalid value");return e.split(":",2)}var Q6="0123456789abcdef",ju;function e4(){return ju===void 0&&(ju=ne({min:0,max:15}).map(e=>Q6[e],e=>{if(typeof e!="string")throw new M("Not a string");if(e.length!==1)throw new M("Invalid length");let t=fr(e,0);if(t<=57)return t-48;if(t<97)throw new M("Invalid character");return t-87})),ju}function Qb(){let e=Ie({unit:e4(),minLength:1,maxLength:4,size:"max"}),t=Te(B(e,e).map(X6,J6),Hc());return Te(B(ue(e,{minLength:6,maxLength:6,size:"max"}),t).map(W6,z6),B(ue(e,{minLength:5,maxLength:5,size:"max"}),t).map(G6,H6),B(ue(e,{minLength:0,maxLength:1,size:"max"}),ue(e,{minLength:4,maxLength:4,size:"max"}),t).map(ms,ys),B(ue(e,{minLength:0,maxLength:2,size:"max"}),ue(e,{minLength:3,maxLength:3,size:"max"}),t).map(ms,ys),B(ue(e,{minLength:0,maxLength:3,size:"max"}),ue(e,{minLength:2,maxLength:2,size:"max"}),t).map(ms,ys),B(ue(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(K6,q6),B(ue(e,{minLength:0,maxLength:5,size:"max"}),t).map(lg,ug),B(ue(e,{minLength:0,maxLength:6,size:"max"}),e).map(lg,ug),B(ue(e,{minLength:0,maxLength:7,size:"max"})).map(Y6,Z6))}var t4=class extends he{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)}},n4=Object.getOwnPropertyNames;function r4(){let e=new Yt;return n=>{let r=it(e,n);return r!==void 0||(r=new t4(String(n)),gt(e,n,r)),r}}function e0(e){let t=r4(),n=e(t),r=n4(n);for(let i of r){let o=t(i);o.underlying=n[i]}return n}function i4(e,t){for(let n of e){let r=t[n]||{};if(r.maxLength===void 0||r.maxLength>0)return!0}return!1}function o4(e,t){if(e.length===0)return Re([]);if(!i4(e,t))throw new M("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return B(...e.map(n=>ue(Re(n),t[n]))).map(n=>e2(n)).filter(n=>n.length>0)}var cg=Object.assign,gs=Object.create,t0=Object.defineProperty,dg=Object.getPrototypeOf,s4=Object.prototype;function a4(e){return t0(gs(null),St,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function fg(e,t){return a4(`<${Ue(e)}#${t}>`)}function l4(e,t){let n=gs(s4);for(let r in e){let i=e[r],o=[];for(let s of i){let a=cg(gs(dg(s)),s);o.push(a)}n[r]=o}for(let r in t){let i=t[r];for(let o=0;o!==i.length;++o){let s=i[o],a=n[r][o];for(let l in s){let u=s[l];a[l]=u.index===void 0?void 0:typeof u.index=="number"?n[u.type][u.index]:W(u.index,c=>n[u.type][c])}t0(a,St,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[r][o],u=cg(gs(dg(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?fg(d.type,d.index):W(d.index,f=>fg(d.type,f))}return Ae(u)}})}}return n}function u4(e){let t=0,n=new Yt;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=it(n,a.type);if(l===void 0&&(l=new Yt,gt(n,a.type,l)),p2(l,a.forwardRelationship))throw new M(`Cannot declare multiple inverse relationships for the same forward relationship ${Ue(a.forwardRelationship)} on type ${Ue(a.type)}`);gt(l,a.forwardRelationship,{type:i,property:s}),t+=1}}let r=new Yt;if(t===0)return r;for(let i in e){let o=e[i],s=it(n,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=it(s,a);if(u!==void 0){if(u.type!==l.type)throw new M(`Inverse relationship ${Ue(u.property)} on type ${Ue(u.type)} references forward relationship ${Ue(a)} but types do not match`);gt(r,l,u)}}}if(r.size!==t)throw new M("Some inverse relationships could not be matched with their corresponding forward relationships");return r}var hg=Object.create;function c4(e,t,n){switch(e){case"exclusive":return Re(n);case"successor":return Rs(ne({min:t!==void 0?t+1:0,max:n}));case"any":return Rs(ne({min:0,max:n}))}}function d4(e,t,n,r,i,o,s){let a=c4(t,n,r);switch(e){case"0-1":return Xt(a,{nil:void 0,depthIdentifier:i}).generate(o,s).value;case"1":return a.generate(o,s).value;case"many":{let l=0,u=Xt(Fn(a,{depthIdentifier:i,selector:d=>d===r?d+ ++l:d,minLength:1}),{nil:[],depthIdentifier:i}).generate(o,s).value,c=0;return W(u,d=>d===r?d+c++:d)}}}var f4=class extends he{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let n=new dr,r=new dr;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(vs(n,a.type))throw new M(`Cannot mix exclusive with other strategies for type ${Ue(a.type)}`);mi(r,a.type)}else{if(vs(r,a.type))throw new M(`Cannot mix exclusive with other strategies for type ${Ue(a.type)}`);mi(n,a.type)}if(a.strategy==="successor"&&a.type!==i)throw new M("Cannot mix types for the strategy successor");if(a.strategy==="successor"&&a.arity==="1")throw new M("Cannot use an arity of 1 for the strategy successor")}}}this.inversedRelations=u4(e)}createEmptyLinksInstanceFor(e){let t=hg(null),n=this.relations[e];for(let r in n){let i=n[r];i.arity==="inverse"&&(t[r]={type:i.type,index:[]})}return t}generate(e,t){let n=hg(null);for(let o in this.relations)n[o]=[];let r=[];for(let o of this.defaultEntities)T(r,{type:o,indexInType:n[o].length,depth:0}),T(n[o],this.createEmptyLinksInstanceFor(o));let i=-1;for(;++i<r.length;){let o=r[i],s=this.relations[o.type],a=n[o.type][o.indexInType],l=_c();l.depth=o.depth;for(let u in s){let c=s[u];if(c.arity==="inverse")continue;let d=c.type,f=n[d],p=f.length,h=d4(c.arity,c.strategy||"any",d===o.type?o.indexInType:void 0,f.length,l,e,t);a[u]={type:d,index:h};let m=h===void 0?[]:typeof h=="number"?[h]:h;for(let y of m){y>=p&&(T(r,{type:d,indexInType:y,depth:o.depth+1}),T(f,this.createEmptyLinksInstanceFor(d)));let S=it(this.inversedRelations,c);if(S!==void 0){let w=f[y][S.property].index;T(w,o.indexInType)}}}}return r.length=0,new O(n,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return D.nil()}};function h4(e,t){return new f4(e,t)}var p4=Object.keys,m4=Object.getOwnPropertySymbols,y4=Object.getOwnPropertyDescriptor;function g4(e){let t=p4(e),n=m4(e);for(let r=0;r!==n.length;++r){let i=n[r],o=y4(e,i);o&&o.enumerable&&t.push(i)}return t}var b4=Object.create,S4=Object.defineProperty,w4=Object.getOwnPropertyDescriptor,x4=Object.getOwnPropertyNames,v4=Object.getOwnPropertySymbols;function R4(e,t){return function(r){let i=r[1]?b4(null):{};for(let o=0;o!==e.length;++o){let s=r[0][o];s!==t&&S4(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function A4(e,t){return function(r){if(typeof r!="object"||r===null)throw new Error("Incompatible instance received: should be a non-null object");let i=Object.getPrototypeOf(r)===null,o="constructor"in r&&r.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=w4(r,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,T(a,d.value)}else T(a,t)}let l=x4(r).length,u=v4(r).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var Vu=Symbol("no-key");function Wu(e,t,n){let r=g4(e),i=[];for(let o=0;o!==r.length;++o){let s=r[o],a=e[s];t===void 0||Kt(t,s)!==-1?T(i,a):T(i,Xt(a,{nil:Vu}))}return B(B(...i),n?Re(!1):xi()).map(R4(r,Vu),A4(r,Vu))}function gc(e,t){let n=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return Wu(e,void 0,n);let r=("requiredKeys"in t?t.requiredKeys:void 0)||[];for(let i=0;i!==r.length;++i){let o=Object.getOwnPropertyDescriptor(e,r[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 Wu(e,r,n)}var C4=Object.create;function E4(e,t,n,r){let i=C4(null);for(let o in e){let s=e[o],a=gc(s,r),l=t(o),u=n(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?Fn(a,{...c,selector:u}):ue(a,c)}return gc(i)}var pg=Object.create,k4=Object.keys;function P4(e,t,n={}){let r=k4(e),i=n.initialPoolConstraints||pg(null),o=n.unicityConstraints||pg(null),s={noNullPrototype:n.noNullPrototype};return o4(r,i).chain(a=>h4(t,a).chain(l=>E4(e,u=>l[u].length,u=>o[u],s).map(u=>l4(u,l))))}function I4(e){return fe(W(e,t=>t[t.length-1]===","?be(t,0,t.length-1):t)," ")}function M4(e){return function(n){if(typeof n!="string")throw new Error("Unsupported type");let r=[];for(let i of je(n," "))if(e.canShrinkWithoutContext(i))T(r,i);else if(e.canShrinkWithoutContext(i+","))T(r,i+",");else throw new Error("Unsupported word");return r}}function T4(e){let t=fe(e," ");return t[t.length-1]===","&&(t=be(t,0,t.length-1)),Ec(t[0])+be(t,1)+"."}function O4(e){return function(n){if(typeof n!="string")throw new Error("Unsupported type");if(n.length<2||n[n.length-1]!=="."||n[n.length-2]===","||Ec(ec(n[0]))!==n[0])throw new Error("Unsupported value");let r=ec(n[0])+be(n,1,n.length-1),i=[],o=je(r," ");for(let s=0;s!==o.length;++s){let a=o[s];if(e.canShrinkWithoutContext(a))T(i,a);else if(s===o.length-1&&e.canShrinkWithoutContext(a+","))T(i,a+",");else throw new Error("Unsupported word")}return i}}function N4(e){return fe(e," ")}function $4(e){if(typeof e!="string")throw new Error("Unsupported type");let t=je(e,". ");for(let n=0;n<t.length-1;++n)t[n]+=".";return t}var b=(e,t)=>({arbitrary:Re(e),weight:t});function _4(){return Te(b("non",6),b("adipiscing",5),b("ligula",5),b("enim",5),b("pellentesque",5),b("in",5),b("augue",5),b("et",5),b("nulla",5),b("lorem",4),b("sit",4),b("sed",4),b("diam",4),b("fermentum",4),b("ut",4),b("eu",4),b("aliquam",4),b("mauris",4),b("vitae",4),b("felis",4),b("ipsum",3),b("dolor",3),b("amet,",3),b("elit",3),b("euismod",3),b("mi",3),b("orci",3),b("erat",3),b("praesent",3),b("egestas",3),b("leo",3),b("vel",3),b("sapien",3),b("integer",3),b("curabitur",3),b("convallis",3),b("purus",3),b("risus",2),b("suspendisse",2),b("lectus",2),b("nec,",2),b("ultricies",2),b("sed,",2),b("cras",2),b("elementum",2),b("ultrices",2),b("maecenas",2),b("massa,",2),b("varius",2),b("a,",2),b("semper",2),b("proin",2),b("nec",2),b("nisl",2),b("amet",2),b("duis",2),b("congue",2),b("libero",2),b("vestibulum",2),b("pede",2),b("blandit",2),b("sodales",2),b("ante",2),b("nibh",2),b("ac",2),b("aenean",2),b("massa",2),b("suscipit",2),b("sollicitudin",2),b("fusce",2),b("tempus",2),b("aliquam,",2),b("nunc",2),b("ullamcorper",2),b("rhoncus",2),b("metus",2),b("faucibus,",2),b("justo",2),b("magna",2),b("at",2),b("tincidunt",2),b("consectetur",1),b("tortor,",1),b("dignissim",1),b("congue,",1),b("non,",1),b("porttitor,",1),b("nonummy",1),b("molestie,",1),b("est",1),b("eleifend",1),b("mi,",1),b("arcu",1),b("scelerisque",1),b("vitae,",1),b("consequat",1),b("in,",1),b("pretium",1),b("volutpat",1),b("pharetra",1),b("tempor",1),b("bibendum",1),b("odio",1),b("dui",1),b("primis",1),b("faucibus",1),b("luctus",1),b("posuere",1),b("cubilia",1),b("curae,",1),b("hendrerit",1),b("velit",1),b("mauris,",1),b("gravida",1),b("ornare",1),b("ut,",1),b("pulvinar",1),b("varius,",1),b("turpis",1),b("nibh,",1),b("eros",1),b("id",1),b("aliquet",1),b("quis",1),b("lobortis",1),b("consectetuer",1),b("morbi",1),b("vehicula",1),b("tortor",1),b("tellus,",1),b("id,",1),b("eu,",1),b("quam",1),b("feugiat,",1),b("posuere,",1),b("iaculis",1),b("lectus,",1),b("tristique",1),b("mollis,",1),b("nisl,",1),b("vulputate",1),b("sem",1),b("vivamus",1),b("placerat",1),b("imperdiet",1),b("cursus",1),b("rutrum",1),b("iaculis,",1),b("augue,",1),b("lacus",1))}function L4(e={}){let{maxCount:t,mode:n="words",size:r}=e;if(t!==void 0&&t<1)throw new Error("lorem has to produce at least one word/sentence");let i=_4();return n==="sentences"?ue(ue(i,{minLength:1,size:"small"}).map(T4,O4(i)),{minLength:1,maxLength:t,size:r}).map(N4,$4):ue(i,{minLength:1,maxLength:t,size:r}).map(I4,M4(i))}function D4(e){return new Map(e)}function B4(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 F4(e){return e[0]}function bc(e,t,n={}){return Fn(B(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:F4,depthIdentifier:n.depthIdentifier,comparator:"SameValueZero"}).map(D4,B4)}var us=10;function U4(e){let t={};return(n=>{let r=n!==void 0?n:us;if(!Zg(t,r)){let i=us;us=r-1,t[r]=e(r),us=i}return t[r]})}function j4(e){let t=0;for(;e>k(0);)e&k(1)&&++t,e>>=k(1);return t}function V4(e,t){let n=(k(1)<<k(t))-k(1),r=e&n,i=j4(e-r),o=r;for(let s=k(1);s<=n&&i!==0;s<<=k(1))o&s||(o|=s,--i);return o}function cs(e,t){let n=[];for(let r=e.length-1;r!==-1;--r)t(e[r])!==e[r]&&T(n,r);return n}function W4(e,t,n){let r=k(0);for(let i=0,o=k(1);i!==n.length;++i,o<<=k(1))e[n[i]]!==t[n[i]]&&(r|=o);return r}function zu(e,t,n,r){for(let i=0,o=k(1);i!==n.length;++i,o<<=k(1))t&o&&(e[n[i]]=r(e[n[i]]))}var z4=class extends he{constructor(e,t,n){super(),this.stringArb=e,this.toggleCase=t,this.untoggleAll=n}buildContextFor(e,t){return{rawString:e.value,rawStringContext:e.context,flags:t.value,flagsContext:t.context}}generate(e,t){let n=this.stringArb.generate(e,t),r=[...n.value],i=cs(r,this.toggleCase),o=wn(k(0),(k(1)<<k(i.length))-k(1)).generate(e,void 0);return zu(r,o.value,i,this.toggleCase),new O(fe(r,""),this.buildContextFor(n,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 n;if(t!==void 0)n=t;else if(this.untoggleAll!==void 0){let o=this.untoggleAll(e),s=[...e],a=[...o];n={rawString:o,rawStringContext:void 0,flags:W4(a,s,cs(a,this.toggleCase)),flagsContext:void 0}}else n={rawString:e,rawStringContext:void 0,flags:k(0),flagsContext:void 0};let r=n.rawString,i=n.flags;return this.stringArb.shrink(r,n.rawStringContext).map(o=>{let s=[...o.value],a=cs(s,this.toggleCase),l=V4(i,a.length);return zu(s,l,a,this.toggleCase),new O(fe(s,""),this.buildContextFor(o,new O(l,void 0)))}).join(bn(()=>{let o=[...r],s=cs(o,this.toggleCase);return wn(k(0),(k(1)<<k(s.length))-k(1)).shrink(i,n.flagsContext).map(a=>{let l=_e(o);return zu(l,a.value,s,this.toggleCase),new O(fe(l,""),this.buildContextFor(new O(r,n.rawStringContext),a))})}))}};function G4(e){let t=Ec(e);return t!==e?t:ec(e)}function H4(e,t){return new z4(e,t&&t.toggleCase||G4,t&&t.untoggleAll)}function K4(e){return Wg.from(e)}function q4(e){if(!(e instanceof Wg))throw new Error("Unexpected type");return[...e]}function n0(e={}){return ue(qb(e),e).map(K4,q4)}function Y4(e){return zg.from(e)}function Z4(e){if(!(e instanceof zg))throw new Error("Unexpected type");return[...e]}function r0(e={}){return ue(ks(e),e).map(Y4,Z4)}function Jt(e,t,n,r,i){let o=r.name,{min:s=t,max:a=n,...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>n)throw new Error(`Invalid max value passed to ${o}: max must be lower than or equal to ${n}`);return ue(i({min:s,max:a}),l).map(u=>r.from(u),u=>{if(!(u instanceof r))throw new Error("Invalid type");return[...u]})}function i0(e={}){return Jt(e,-32768,32767,_k,ne)}function o0(e={}){return Jt(e,-2147483648,2147483647,Lk,ne)}function s0(e={}){return Jt(e,-128,127,$k,ne)}function a0(e={}){return Jt(e,0,65535,Fk,ne)}function l0(e={}){return Jt(e,0,4294967295,Uk,ne)}function u0(e={}){return Jt(e,0,255,Dk,ne)}function c0(e={}){return Jt(e,0,255,Bk,ne)}function X4(e){return e!==void 0}function mg(e){return e.hasToBeCloned?new O(e.value_,{generatorContext:e.context},()=>e.value):new O(e.value_,{generatorContext:e.context})}function yg(e){return e.hasToBeCloned?new O(e.value_,{shrinkerContext:e.context},()=>e.value):new O(e.value_,{shrinkerContext:e.context})}var J4=class extends he{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return mg(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return X4(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(mg):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(yg):this.shrinkerArbitrary.shrink(e,void 0).map(yg)}};function Sc(e,t,n){let r=ne({min:e,max:t});return t===n?r:new J4(r,ne({min:e,max:n}))}var Q4=Math.min,wc=Math.max,gg=jg.isArray,eT=Object.entries;function tT(e){let t=-1;for(let n=0;n!==e.length;++n)t=wc(t,e[n][0]);return t}function nT(e,t){let n=jg(e);for(let r=0;r!==t.length;++r){let i=t[r];i[0]<e&&(n[i[0]]=i[1])}return n}function d0(e,t={}){let{size:n,minNumElements:r=0,maxLength:i=Bn,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=bi(n,bi(n,r,o,t.maxNumElements!==void 0),i,t.maxLength!==void 0);if(r>i)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(r>o)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let u=Q4(o,i),c=t.maxNumElements!==void 0||n!==void 0?n:"=",d=Fn(B(Sc(0,wc(l-1,0),wc(i-1,0)),e),{size:c,minLength:r,maxLength:u,selector:f=>f[0],depthIdentifier:a}).map(f=>nT(tT(f)+1,f),f=>{if(!gg(f))throw new Error("Not supported entry type");if(s&&f.length!==0&&!(f.length-1 in f))throw new Error("No trailing hole");return W(eT(f),p=>[Number(p[0]),p[1]])});return s||i===r?d:B(d,Sc(r,l,i)).map(f=>{let p=f[0],h=f[1];if(p.length>=h)return p;let m=_e(p);return m.length=h,m},f=>{if(!gg(f))throw new Error("Not supported entry type");return[f,f.length]})}function rT(e){return new Set(e)}function iT(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 f0(e,t={}){return Fn(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(rT,iT)}function oT(e,t,n,r,i,o){return Bc(e,t,{maxKeys:n,noNullPrototype:!o,size:r,depthIdentifier:i})}function sT(e){return Te(s0(e),u0(e),c0(e),i0(e),a0(e),o0(e),l0(e),n0(e),r0(e))}function h0(e){let t=e.values,n=e.depthSize,r=_c(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Te(...t,...e.withBigInt?[wn()]:[],...e.withDate?[Pb()]:[]);return e0(l=>({anything:Te({maxDepth:i,depthSize:n,depthIdentifier:r},a,l("array"),l("object"),...e.withMap?[l("map")]:[],...e.withSet?[l("set")]:[],...e.withObjectString?[l("anything").map(u=>Ae(u))]:[],...e.withTypedArray?[sT({maxLength:o,size:s})]:[],...e.withSparseArray?[d0(l("anything"),{maxNumElements:o,size:s,depthIdentifier:r})]:[]),keys:e.withObjectString?Te({arbitrary:e.key,weight:10},{arbitrary:l("anything").map(u=>Ae(u)),weight:1}):e.key,array:ue(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),set:f0(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),map:Te(bc(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r}),bc(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r})),object:oT(l("keys"),l("anything"),o,s,r,e.withNullPrototype)})).anything}function aT(e){switch(typeof e){case"boolean":return new Vg(e);case"number":return new qt(e);case"string":return new Ue(e);default:return e}}function lT(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===Vg||e.constructor===qt||e.constructor===Ue?e.valueOf():e}function uT(e){return e.map(aT,lT)}function cT(e,t){return[xi(),Xb(),ks(),t(e),Te(t(e),Re(null),Re(void 0))]}function dT(e){return e.map(t=>uT(t))}function fT(e,t){return t?dT(e).concat(e):e}function p0(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:Ie(t),values:fT(e.values!==void 0?e.values:cT(t,Ie),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 hT(e){return Bc(e.key,h0(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function pT(e){return hT(p0(e))}function mT(e,t){let{depthSize:n,maxDepth:r}=t;return{key:e,values:[xi(),ks({noDefaultInfinity:!0,noNaN:!0}),e,Re(null)],depthSize:n,maxDepth:r}}function m0(e){return h0(p0(e))}function y0(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return m0(mT("stringUnit"in e?Ie({unit:e.stringUnit}):t?Ie():Ie({unit:"binary"}),e))}var yT=JSON.stringify,gT=JSON.parse;function bT(e){if(typeof e!="string")throw new M("Cannot unmap the passed value");return gT(e)}function ST(e={}){return y0(e).map(yT,bT)}var wT=Object.defineProperties;function Gu(e,t){return`Stream(${t!==void 0?`${fe(t,",")}\u2026`:`${e} emitted`})`}var xT=class extends he{constructor(e,t){super(),this.arb=e,this.history=t}generate(e,t){let n=t!==void 0&&e.nextInt(1,t)===1?t:void 0,r=()=>{let i=this.history?[]:null,o=0,s=function*(a,l){for(;;){let u=a.generate(l,n).value;o++,i!==null&&T(i,u),yield u}};return wT(new D(s(this.arb,e.clone())),{toString:{value:()=>Gu(o,i!==null?i.map(Ae):void 0)},[St]:{value:()=>Gu(o,i!==null?i.map(Ae):void 0)},[Zt]:{value:async()=>Gu(o,i!==null?await Promise.all(i.map(Tc)):void 0)},[Oe]:{value:r,enumerable:!0}})};return new O(r(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return D.nil()}};function vT(e,t){return new xT(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function RT(e){return fe(e,"")}function bg(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function AT(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return be(e,1)}}function CT(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 be(e,0,t)}var Hu=String.fromCharCode;function ET(e){return e<26?Hu(e+65):e<52?Hu(e+97-26):e<62?Hu(e+48-52):e===62?"+":"/"}function kT(e){if(typeof e!="string"||e.length!==1)throw new M("Invalid entry");let t=fr(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 PT(){return ne({min:0,max:63}).map(ET,kT)}function IT(e={}){let{minLength:t=0,maxLength:n=Bn,size:r}=e,i=t+3-(t+3)%4,o=n-n%4,s=e.maxLength===void 0&&r===void 0?"=":r;if(i>o)throw new M("Minimal length should be inferior or equal to maximal length");if(i%4!==0)throw new M("Minimal length of base64 strings must be a multiple of 4");if(o%4!==0)throw new M("Maximal length of base64 strings must be a multiple of 4");let a=PT();return ue(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:cM(a,bg)}).map(RT,bg).map(AT,CT)}var Sg=Object.is;function MT(e,t){let n=new Yt,r=0;for(let i of e)Sg(i,-0)?++r:gt(n,i,(it(n,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(Sg(o,-0)){if(r===0)return!1;--r}else{let s=it(n,o)||0;if(s===0)return!1;gt(n,o,s-1)}}return!0}var TT=Math.floor,wg=Math.log,OT=Array.isArray,g0=class extends he{constructor(e,t,n,r){if(super(),this.originalArray=e,this.isOrdered=t,this.minLength=n,this.maxLength=r,n<0||n>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(r<0||r>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(n>r)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new pr(n,r),this.biasedLengthArb=n!==r?new pr(n,n+TT(wg(r-n)/wg(2))):this.lengthArb}generate(e,t){let n=(t!==void 0&&e.nextInt(1,t)===1?this.biasedLengthArb:this.lengthArb).generate(e,void 0),r=n.value,i=W(this.originalArray,(s,a)=>a),o=[];for(let s=0;s!==r;++s){let a=e.nextInt(0,i.length-1);T(o,i[a]),Kg(i,a,1)}return this.isOrdered&&qg(o,(s,a)=>s-a),new O(W(o,s=>this.originalArray[s]),n.context)}canShrinkWithoutContext(e){return!OT(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:MT(this.originalArray,e)}shrink(e,t){return e.length===0?D.nil():this.lengthArb.shrink(e.length,t).map(n=>new O(_e(e,e.length-n.value),n.context)).join(e.length>this.minLength?bn(()=>this.shrink(_e(e,1),void 0).filter(n=>this.minLength<=n.value.length+1).map(n=>new O([e[0],...n.value],void 0))):D.nil())}};function NT(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new g0(e,!0,n,r)}function $T(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new g0(e,!1,n,r)}var _T={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"},LT={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 DT(e){return e<10?Ue(e):_T[e]}function xg(e,t){let n="";for(;e.length+n.length<t;)n+="0";return n+e}function vg(e){let t="";for(let n=e;n!==0;){let r=n>>5;t=DT(n-(r<<5))+t,n=r}return t}function BT(e,t){let n=~~(e/1073741824),r=e&1073741823;return xg(vg(n),t-6)+xg(vg(r),6)}function b0(e){return function(n){return BT(n,e)}}function Ku(e){if(typeof e!="string")throw new M("Unsupported type");let t=0,n=1;for(let r=e.length-1;r>=0;--r){let i=LT[e[r]];if(i===void 0)throw new M("Unsupported type");t+=i*n,n*=32}return t}var FT=b0(10),Rg=b0(8);function UT(e){return FT(e[0])+Rg(e[1])+Rg(e[2])}function jT(e){if(typeof e!="string"||e.length!==26)throw new Error("Unsupported type");return[Ku(e.slice(0,10)),Ku(e.slice(10,18)),Ku(e.slice(18))]}function VT(){return B(ne({min:0,max:0xffffffffffff}),ne({min:0,max:0xffffffffff}),ne({min:0,max:0xffffffffff})).map(UT,jT)}function S0(e){return k2(yi(e,16),8,"0")}function WT(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!==S0(t))throw new Error("Unsupported value: invalid content");return t}function qu(e,t){return ne({min:e,max:t}).map(S0,WT)}function zT(e){return`${e[0]}-${be(e[1],4)}-${be(e[1],0,4)}-${be(e[2],0,4)}-${be(e[2],4)}${e[3]}`}var GT=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function HT(e){if(typeof e!="string")throw new Error("Unsupported type");let t=GT.exec(e);if(t===null)throw new Error("Unsupported type");return[t[1],t[3]+t[2],t[4]+be(t[5],0,4),be(t[5],4)]}var Ag="0123456789abcdef";function KT(e){let t={},n={};for(let o=0;o!==e.length;++o){let s=Ag[o],a=Ag[e[o]];t[s]=a,n[a]=s}function r(o){return t[o[0]]+be(o,1)}function i(o){if(typeof o!="string")throw new M("Cannot produce non-string values");let s=n[o[0]];if(s===void 0)throw new M("Cannot produce strings not starting by the version in hexa code");return s+be(o,1)}return{versionsApplierMapper:r,versionsApplierUnmapper:i}}function qT(e){let t={};for(let n of e){if(t[n])throw new M(`Version ${n} has been requested at least twice for uuid`);if(t[n]=!0,n<1||n>15)throw new M(`Version must be a value in [1-15] for uuid, but received ${n}`);if(~~n!==n)throw new M(`Version must be an integer value for uuid, but received ${n}`)}if(e.length===0)throw new M("Must provide at least one version for uuid")}function YT(e={}){let t=qu(0,4294967295),n=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];qT(n);let{versionsApplierMapper:r,versionsApplierUnmapper:i}=KT(n);return B(t,qu(0,268435456*n.length-1).map(r,i),qu(2147483648,3221225471),t).map(zT,HT)}function ZT(e){return Ie({unit:jc("-._~!$&'()*+,;=:"),size:e})}function XT([e,t,n]){return(e===null?"":`${e}@`)+t+(n===null?"":`:${n}`)}function JT(e){if(typeof e!="string")throw new Error("Unsupported");let t=e.indexOf("@"),n=t!==-1?e.substring(0,t):null,r=/:(\d+)$/.exec(e),i=r!==null?Number(r[1]):null;return[n,r!==null?e.substring(t+1,e.length-r[1].length-1):e.substring(t+1),i]}function QT(e){return`[${e}]`}function e3(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function w0(e){let t=e||{},n=t.size,r=[Vc({size:n}),...t.withIPv4===!0?[Hc()]:[],...t.withIPv6===!0?[Qb().map(QT,e3)]:[],...t.withIPv4Extended===!0?[Jb()]:[]];return B(t.withUserInfo===!0?Xt(ZT(n)):Re(null),Te(...r),t.withPort===!0?Xt(gn(65535)):Re(null)).map(XT,JT)}function x0(e){return Ie({unit:jc("-._~!$&'()*+,;=:@/?"),size:e})}function v0(e={}){return x0(e.size)}function R0(e={}){return Ie({unit:jc("-._~!$&'()*+,;=:@"),size:e.size})}function t3(e){return fe(W(e,t=>`/${t}`),"")}function n3(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 Kg(je(e,"/"),1)}function r3(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 Yu(e,t){return ue(R0({size:e}),{size:t}).map(t3,n3)}function i3(e){let[t,n]=r3(e);return t===n?Yu(t,n):Te(Yu(t,n),Yu(n,t))}function A0(e){return i3(Dc((e||{}).size))}function C0(e={}){return x0(e.size)}function o3(e){let[t,n,r]=e;return`${t}://${n}${r}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var s3=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function a3(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=s3.exec(e);if(t===null)throw new Error("Incompatible value received");let n=t[1],r=t[2],i=t[3],o=t[4],s=t[5];return[n,r,i,o!==void 0?o.substring(1):null,s!==void 0?s.substring(1):null]}function l3(e){let t=e||{},n=Dc(t.size),r=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?wi(t.authoritySettings.size,n):n,i={...t.authoritySettings,size:r};return B(Nt(...t.validSchemes||["http","https"]),w0(i),A0({size:n}),t.withQueryParameters===!0?Xt(C0({size:n})):Re(null),t.withFragments===!0?Xt(v0({size:n})):Re(null)).map(o3,a3)}var u3=class E0{constructor(t,n){this.commands=t,this.metadataForReplay=n,this[Oe]=function(){return new E0(this.commands.map(r=>r.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let t=this.commands.filter(r=>r.hasRan).map(r=>r.toString()).join(","),n=this.metadataForReplay();return n.length!==0?`${t} /*${n}*/`:t}},c3=class xc{constructor(t){if(this.cmd=t,this.hasRan=!1,Ic(t)){let n=t[St];this[St]=function(){return n.call(t)}}if(Mc(t)){let n=t[Zt];this[Zt]=function(){return n.call(t)}}}check(t){return this.cmd.check(t)}run(t,n){return this.hasRan=!0,this.cmd.run(t,n)}clone(){return Dn(this.cmd)?new xc(this.cmd[Oe]()):new xc(this.cmd)}toString(){return this.cmd.toString()}},Cg=class{static parse(e){let[t,n]=e.split(":"),r=this.parseCounts(t),i=this.parseChanges(n);return this.parseOccurences(r,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,n)=>(t.length===0||t[t.length-1].count===64||t[t.length-1].value!==n?t.push({value:n,count:1}):t[t.length-1].count+=1,t),[])}static parseOccurences(e,t){let n=[];for(let r=0;r!==e.length;++r){let i=e[r],o=t[r];for(let s=0;s!==i;++s)n.push(o)}return n}static stringifyChanges(e){let t="";for(let n=0;n<e.length;n+=6){let r=e.slice(n,n+6).reduceRight((i,o)=>(i<<1)+(o.value?1:0),0);t+=this.intToB64(r)}return t}static parseChanges(e){let t=e.split("").map(r=>this.b64ToInt(r)),n=[];for(let r=0;r!==t.length;++r){let i=t[r];for(let o=0;o!==6;++o,i>>=1)n.push(i%2===1)}return n}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)}},d3=class extends he{constructor(e,t,n,r,i){super(),this.sourceReplayPath=r,this.disableReplayLog=i,this.oneCommandArb=Te(...e).map(o=>new c3(o)),this.lengthArb=Sc(0,t,n),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(Cg.stringify(this.replayPath))}`}buildValueFor(e,t){let n=e.map(i=>i.value_),r={shrunkOnce:t,items:e};return new O(new u3(n,()=>this.metadataForReplay()),r)}generate(e){let t=this.lengthArb.generate(e,void 0).value,n=Array(t);for(let r=0;r!==t;++r)n[r]=this.oneCommandArb.generate(e,void 0);return this.replayPathPosition=0,this.buildValueFor(n,!1)}canShrinkWithoutContext(e){return!1}filterOnExecution(e){let t=[];for(let n of e)n.value_.hasRan?(this.replayPath.push(!0),t.push(n)):this.replayPath.push(!1);return t}filterOnReplay(e){return e.filter((t,n)=>{let r=this.replayPath[this.replayPathPosition+n];if(r===void 0)throw new Error("Too short replayPath");if(!r&&t.value_.hasRan)throw new Error("Mismatch between replayPath and real execution");return r})}filterForShrinkImpl(e){this.replayPathPosition===0&&(this.replayPath=this.sourceReplayPath!==null?Cg.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 D.nil();let n=t,r=n.shrunkOnce,i=n.items,o=this.filterForShrinkImpl(i);if(o.length===0)return D.nil();let s=r?D.nil():new D([[]][Symbol.iterator]()),a=[];for(let l=0;l!==o.length;++l)a.push(bn(()=>{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(bn(()=>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 O(u.value_.clone(),u.context)),!0))}};function f3(e,t={}){let{size:n,maxCommands:r=Bn,disableReplayLog:i=!1,replayPath:o=null}=t;return new d3(e,bi(n,0,r,t.maxCommands!==void 0),r,o,i)}var h3=class{constructor(e,t){this.s=e,this.cmd=t}async check(e){let t=null,n=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{n=await Promise.resolve(this.cmd.check(e))}catch(r){throw t=r,r}}}]).task).faulty)throw t;return n}async run(e,t){let n=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(e,t)}catch(r){throw n=r,r}}}]).task).faulty)throw n}},p3=function*(e,t){for(let n of t)yield new h3(e,n)},k0=(e,t,n,r,i)=>e.then(o=>{let{model:s,real:a}=o,l=n;for(let u of t)l=i(l,()=>r(u,s,a));return l}),m3=(e,t)=>k0({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),y3=e=>typeof e.then=="function",P0=async(e,t,n=Promise.resolve())=>await k0({then:s=>{let a=e();return y3(a)?a.then(s):s(a)}},t,n,async(s,a,l)=>{await s.check(a)&&await s.run(a,l)},(s,a)=>s.then(a));function g3(e,t){m3(e,t)}async function b3(e,t){await P0(e,t)}async function S3(e,t,n){let r=P0(t,p3(e,n),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(r),await e.waitAll()}var ds=e=>e(),I0=class vc{constructor(t,n){this.act=t,this.taskSelector=n,this.lastTaskId=0,this.sourceTaskSelector=n.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Oe]=function(){return new vc(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 ${R6(t.outputValue)}`:""}`}log(t,n,r,i,o,s){this.triggeredTasks.push({status:o,schedulingType:t,taskId:n,label:r,metadata:i,outputValue:s!==void 0?Ae(s):void 0})}scheduleInternal(t,n,r,i,o,s){let a=++this.lastTaskId,l,u=new Promise((c,d)=>{l=()=>{let f=Promise.resolve(s!==void 0?r.then(()=>s()):r);return f.then(p=>{this.log(t,a,n,i,"resolved",p),c(p)},p=>{this.log(t,a,n,i,"rejected",p),d(p)}),f}});return this.scheduledTasks.push({original:r,trigger:l,schedulingType:t,taskId:a,label:n,metadata:i,customAct:o}),this.scheduledWatchers.length!==0&&this.scheduledWatchers[0](),u}schedule(t,n,r,i){return this.scheduleInternal("promise",n||"",t,r,i||ds)}scheduleFunction(t,n){return(...r)=>this.scheduleInternal("function",`${t.name}(${r.map(Ae).join(",")})`,t(...r),void 0,n||ds)}scheduleSequence(t,n){let r={done:!1,faulty:!1},i={then:c=>c()},o=()=>{},s=new Promise(c=>{o=()=>c({done:r.done,faulty:r.faulty})}),a=()=>{r.faulty=!0,o()},l=()=>{r.done=!0,o()},u=(c,d)=>{if(c>=t.length){d.then(l,a);return}d.then(()=>{let f=t[c],[p,h,m]=typeof f=="function"?[f,f.name,void 0]:[f.builder,f.label,f.metadata],y=this.scheduleInternal("sequence",h,i,m,n||ds,()=>p());u(c+1,y)},a)};return u(0,i),Object.assign(r,{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),[n]=this.scheduledTasks.splice(t,1);return n.customAct(()=>n.trigger().catch(r=>{}))}waitOne(t){let n=t||ds;return this.act(()=>n(()=>this.internalWaitOne()))}async waitAll(t){for(;this.scheduledTasks.length>0;)await this.waitOne(t)}async internalWaitFor(t,n){let r=!1,i=n.customAct,o=n.onWaitStart,s=n.onWaitIdle,a=n.launchAwaiterOnInit,l,u,c=0,d=null,f=null,p=async()=>{for(c=50,c=50;!r&&c>0;--c)await Promise.resolve();if(!r&&this.scheduledTasks.length>0)return o!==void 0&&o(),f=this.waitOne(i),f.then(()=>(f=null,p()),S=>{throw f=null,r=!0,u(S),S});!r&&s!==void 0&&s(),d=null},h=()=>{if(d!==null){c=51;return}d=p().catch(()=>{})},m=()=>{let S=this.scheduledWatchers.indexOf(h);S!==-1&&this.scheduledWatchers.splice(S,1),S===0&&this.scheduledWatchers.length!==0&&this.scheduledWatchers[0]()},y=new Promise((S,w)=>{l=g=>{m(),S(g)},u=g=>{m(),w(g)}});return t.then(S=>{r=!0,f===null?l(S):f.then(()=>l(S),w=>u(w))},S=>{r=!0,f===null?u(S):f.then(()=>u(S),()=>u(S))}),(this.scheduledTasks.length>0||a)&&this.scheduledWatchers.length===0&&h(),this.scheduledWatchers.push(h),y}waitNext(t,n){let r,i=t,o=i<=0?Promise.resolve():new Promise(s=>{r=()=>{--i<=0&&s()}});return this.internalWaitFor(o,{customAct:n,onWaitStart:r,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(t){let n,r=new Promise(i=>n=i);return this.internalWaitFor(r,{customAct:t,onWaitStart:void 0,onWaitIdle:n,launchAwaiterOnInit:!0})}waitFor(t,n){return this.internalWaitFor(t,{customAct:n,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(vc.buildLog).map(t=>`-> ${t}`).join(`
53
- `)+"`"}};function M0(e){let t=0;return{clone:()=>M0(e),nextTaskIndex:n=>{if(e.length<=t)throw new Error("Invalid schedulerFor defined: too many tasks have been scheduled");let r=n.findIndex(i=>i.taskId===e[t]);if(r===-1)throw new Error("Invalid schedulerFor defined: unable to find next task");return++t,r}}}function Eg(e,t){return new I0(e,M0(t))}function T0(e){let t=e.clone();return{clone:()=>T0(t),nextTaskIndex:n=>e.nextInt(0,n.length-1)}}var w3=class extends he{constructor(e){super(),this.act=e}generate(e,t){return new O(new I0(this.act,T0(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return D.nil()}};function x3(e){let{act:t=n=>n()}=e||{};return new w3(t)}function v3(e,t){let{act:n=r=>r()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?Eg(n,e):function(r,...i){return Eg(n,i)}}function R3(e={}){return Jt(e,k("-9223372036854775808"),k("9223372036854775807"),Ok,wn)}function A3(e={}){return Jt(e,k(0),k("18446744073709551615"),Nk,wn)}function C3(e,t){return t}var Zu=Math.floor,E3=Math.min;function at(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let n=at(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:n.astNode},minLength:0}}case"+":{let n=at(e.expression,t),r=n.minLength>1?n.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:Zu(t/r)},expression:n.astNode},minLength:n.minLength}}case"?":{let n=at(e.expression,t);return t<n.minLength?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:0},expression:n.astNode},minLength:0}:{astNode:{...e,expression:n.astNode},minLength:0}}case"Range":{let n=e.quantifier.from>1?Zu(t/e.quantifier.from):t,r=at(e.expression,n),i=r.minLength>1?r.minLength:1;return e.quantifier.to===void 0||e.quantifier.to*i>t?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",to:Zu(t/i)},expression:r.astNode},minLength:e.quantifier.from*r.minLength}:{astNode:{...e,expression:r.astNode},minLength:e.quantifier.from*r.minLength}}default:return C3(e.quantifier,{astNode:e,minLength:0})}case"Quantifier":return{astNode:e,minLength:0};case"Alternative":{let n=0,r=[];for(let o=0;o!==e.expressions.length;++o){let s=t-n,a=at(e.expressions[o],s);n+=a.minLength,T(r,{value:a,allowance:s})}let i=[];for(let o=0;o!==r.length;++o){let s=r[o].value,a=r[o].allowance,l=t-n+s.minLength;T(i,(l!==a?at(s.astNode,l):s).astNode)}return{astNode:{...e,expressions:i},minLength:n}}case"CharacterClass":return{astNode:e,minLength:1};case"ClassRange":return{astNode:e,minLength:1};case"Group":{let n=at(e.expression,t);return{astNode:{...e,expression:n.astNode},minLength:n.minLength}}case"Disjunction":{if(e.left===null){if(e.right===null)return{astNode:e,minLength:0};let i=at(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=at(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let n=at(e.left,t),r=at(e.right,t);return n.minLength>t?r:r.minLength>t?n:{astNode:{...e,left:n.astNode,right:r.astNode},minLength:E3(n.minLength,r.minLength)}}case"Assertion":return{astNode:e,minLength:0};case"Backreference":return{astNode:e,minLength:0};case"UnicodeProperty":return{astNode:e,minLength:1}}}function k3(e,t){return at(e,t).astNode}function P3(e){return new Error(`Unsupported AST node! Received: ${Ae(e)}`)}function bs(e,t,n){if(!t&&!n)return e;let r={hasStart:!1,hasEnd:!1},i=O0(e,t,n,r),o=t&&!r.hasStart,s=n&&!r.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 O0(e,t,n,r){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 r.hasStart=!0,r.hasEnd=!0,{...e,expressions:e.expressions.map((i,o)=>bs(i,t&&o===0,n&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:O0(e.expression,t,n,r)};case"Disjunction":return r.hasStart=!0,r.hasEnd=!0,{...e,left:e.left!==null?bs(e.left,t,n):null,right:e.right!==null?bs(e.right,t,n):null};case"Assertion":if(e.kind==="^"||e.kind==="Lookahead")return r.hasStart=!0,e;if(e.kind==="$"||e.kind==="Lookbehind")return r.hasEnd=!0,e;throw new Error(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":return e;case"UnicodeProperty":return e;default:throw P3(e)}}function I3(e){return bs(e,!0,!0)}function kg(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Pe(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Rc(e){return e>="0"&&e<="9"}function N0(e,t){for(let n=t;n!==e.length;++n){let r=e[n];if(r==="\\")n+=1;else if(r==="]")return n}throw new Error("Missing closing ']'")}function M3(e,t){let n=0;for(let r=t;r!==e.length;++r){let i=e[r];if(i==="\\")r+=1;else if(i===")"){if(n===0)return r;n-=1}else i==="["?r=N0(e,r):i==="("&&(n+=1)}throw new Error("Missing closing ')'")}function T3(e,t){let n=!1;for(let r=t;r!==e.length;++r){let i=e[r];if(!Rc(i)){if(t===r)return-1;if(i===","){if(n)return-1;n=!0}else return i==="}"?r:-1}}return-1}function O3(e,t,n,r){switch(e[t]){case"[":return r===1?t+1:N0(e,t+1)+1;case"{":{if(r===1)return t+1;let i=T3(e,t+1);return i===-1?t+1:i+1}case"(":return r===1?t+1:M3(e,t+1)+1;case"]":case"}":case")":return t+1;case"\\":{let i=e[t+1];switch(i){case"x":if(Pe(e[t+2])&&Pe(e[t+3]))return t+4;throw new Error(`Unexpected token '${e.substring(t,t+4)}' found`);case"u":if(e[t+2]==="{"){if(!n)return t+2;if(e[t+4]==="}"){if(Pe(e[t+3]))return t+5;throw new Error(`Unexpected token '${e.substring(t,t+5)}' found`)}if(e[t+5]==="}"){if(Pe(e[t+3])&&Pe(e[t+4]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`)}if(e[t+6]==="}"){if(Pe(e[t+3])&&Pe(e[t+4])&&Pe(e[t+5]))return t+7;throw new Error(`Unexpected token '${e.substring(t,t+7)}' found`)}if(e[t+7]==="}"){if(Pe(e[t+3])&&Pe(e[t+4])&&Pe(e[t+5])&&Pe(e[t+6]))return t+8;throw new Error(`Unexpected token '${e.substring(t,t+8)}' found`)}if(e[t+8]==="}"&&Pe(e[t+3])&&Pe(e[t+4])&&Pe(e[t+5])&&Pe(e[t+6])&&Pe(e[t+7]))return t+9;throw new Error(`Unexpected token '${e.substring(t,t+9)}' found`)}if(Pe(e[t+2])&&Pe(e[t+3])&&Pe(e[t+4])&&Pe(e[t+5]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`);case"p":case"P":{if(!n)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(!n)return t+2;throw new Error("Invalid \\k definition")}return o+1}default:if(Rc(i)){let o=n?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&Rc(e[s]);++s);return s}return t+(n?kg(e,t+1):1)+1}}default:return t+(n?kg(e,t):1)}}function fs(e,t,n,r){let i=O3(e,t,n,r);return e.substring(t,i)}var Pg={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},Ps={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"},Si=Zc(Ps),Yc={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"},Ac=Zc(Yc),$0={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"},Ig=Zc($0);function Zc(e){let t={};for(let n of Object.keys(e)){let r=e[n];if(Array.isArray(r))for(let i=0;i!==r.length;++i)t[r[i]]=n;else t[r]=n}return t}function N3(e){return e in Yc||e in Ac}function $3(e){return e in Ps||e in Si}function Mg(e){if(e in Pg)return Pg[e];if(e in Si)return Si[e];if(e in Ps||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function Tg(e){if(e in Ac)return Ac[e];if(e in Ig)return Ig[e];if(e in Si)return Si[e];if(e in Yc||e in $0||e in Ps)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function _3(e,t){let n=e.indexOf("=");if(n!==-1){let r=e.substring(0,n),i=e.substring(n+1);return{type:"UnicodeProperty",name:r,value:i,negative:t,shorthand:!1,binary:!1,canonicalName:Mg(r),canonicalValue:Tg(i)}}if(N3(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:Tg(e)};if($3(e)){let r=Mg(e);return{type:"UnicodeProperty",name:e,value:e,negative:t,shorthand:!1,binary:!0,canonicalName:r,canonicalValue:r}}throw new Error(`Invalid Unicode property: ${e}`)}var Xu=String.fromCodePoint;function Ju(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function _0(e){return e>="0"&&e<="9"}function Ss(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function lr(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function mn(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 Qu(e){if(e[0]==="\\"){let t=e[1];switch(t){case"x":{let n=e.substring(2),r=Number.parseInt(n,16);return{type:"Char",kind:"hex",symbol:Xu(r),value:e,codePoint:r}}case"u":{if(e==="\\u")return Ss("u",!0);let n=e[2]==="{"?e.substring(3,e.length-1):e.substring(2),r=Number.parseInt(n,16);return{type:"Char",kind:"unicode",symbol:Xu(r),value:e,codePoint:r}}case"0":return lr(e,"\0");case"n":return lr(e,`
54
- `);case"f":return lr(e,"\f");case"r":return lr(e,"\r");case"t":return lr(e," ");case"v":return lr(e,"\v");case"w":case"W":case"d":case"D":case"s":case"S":case"b":case"B":return{type:"Char",kind:"meta",symbol:void 0,value:e,codePoint:NaN};default:if(_0(t)){let n=e.substring(1),r=Number(n);return{type:"Char",kind:"decimal",symbol:Xu(r),value:e,codePoint:r}}if(e.length>2&&(t==="p"||t==="P")){let n=t==="P";return _3(e.substring(3,e.length-1),n)}return Ss(e.substring(1),!0)}}return Ss(e)}function ur(e,t,n,r){let i=null;for(let o=0,s=fs(t,o,n,0);o!==t.length;o+=s.length,s=fs(t,o,n,0)){let a=s[0];switch(a){case"|":i===null&&(i=[]),i.push(mn(e.splice(0),!0)||null);break;case".":e.push({type:"Char",kind:"meta",symbol:s,value:s,codePoint:NaN});break;case"*":case"+":{let l=Ju(e);e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"?":{let l=Ju(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(Ss(s));break}let l=Ju(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 f=0,p=fs(l,f,n,1);f!==l.length;f+=p.length,p=fs(l,f,n,1)){if(f===0&&p==="^"){c=!0;continue}let h=Qu(p);if(p==="-")u.push(h),d=!0;else{let m=u.length>=2?u[u.length-2]:void 0;d&&m!==void 0&&m.type==="Char"&&h.type==="Char"?(u.pop(),u.pop(),u.push({type:"ClassRange",from:m,to:h})):u.push(h),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]===":")ur(u,l.substring(2),n,r),e.push({type:"Group",capturing:!1,expression:mn(u)});else if(l[1]==="="||l[1]==="!")ur(u,l.substring(2),n,r),e.push({type:"Assertion",kind:"Lookahead",negative:l[1]==="!"?!0:void 0,assertion:mn(u)});else if(l[1]==="<"&&(l[2]==="="||l[2]==="!"))ur(u,l.substring(3),n,r),e.push({type:"Assertion",kind:"Lookbehind",negative:l[2]==="!"?!0:void 0,assertion:mn(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=++r.lastIndex,f=c[0].substring(2);r.named.set(f,d),ur(u,c.slice(1).join(">"),n,r),e.push({type:"Group",capturing:!0,nameRaw:f,name:f,number:d,expression:mn(u)})}else{let c=++r.lastIndex;ur(u,l,n,r),e.push({type:"Group",capturing:!0,number:c,expression:mn(u)})}break}default:if(s==="^")e.push({type:"Assertion",kind:s});else if(s==="$")e.push({type:"Assertion",kind:s});else if(s[0]==="\\"&&_0(s[1])){let l=Number(s.substring(1));n||l<=r.lastIndex?e.push({type:"Backreference",kind:"number",number:l,reference:l}):e.push(Qu(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:r.named.get(l)||0,referenceRaw:l,reference:l})}else e.push(Qu(s));break}}if(i!==null){i.push(mn(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 L3(e){let t=Kt([...e.flags],"u")!==-1,n=e.source,r=[];return ur(r,n,t,{lastIndex:0,named:new Map}),mn(r)}var D3=String.fromCodePoint;function B3(e){return e.binary||e.shorthand?e.canonicalValue:`${e.canonicalName}=${e.canonicalValue}`}function Og(e,t,n,r){let i=-1;for(let o=t;o<=n;++o)if(e.test(D3(o)))i===-1&&(i=o);else if(i!==-1){let s=o-1;r.push(i===s?[s]:[i,s]),i=-1}i!==-1&&r.push(i===n?[n]:[i,n])}function F3(e,t){let n=new RegExp(`^\\${t?"P":"p"}{${e}}$`,"u"),r=[];return Og(n,0,55295,r),Og(n,57344,1114111,r),r}var Ng=new Map;function U3(e,t){let n=`${t?"P":"p"}:${e}`,r=Ng.get(n);if(r!==void 0)return r;let i=F3(e,t);return Ng.set(n,i),i}function j3(e){return mr(...W(U3(B3(e),e.negative),t=>sc(t)))}var V3=String.fromCodePoint,$g=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],_g=[..."0123456789"],Lg=[...` \r
52
+ }`}return $6(o,{toString:{value:()=>s(Ae(t))},[St]:{value:()=>s(Ae(t))},[Zt]:{value:async()=>s(await Tc(t))},[Oe]:{value:r,configurable:!0}})};return r()})}var D6=Number.MIN_SAFE_INTEGER,B6=Number.MAX_SAFE_INTEGER;function t0(){return new pr(D6,B6)}var F6=Number.MAX_SAFE_INTEGER;function U6(){return new pr(0,F6)}var j6=Number.parseInt;function V6(e){let[t,n]=e;switch(t){case"oct":return`0${yi(n,8)}`;case"hex":return`0x${yi(n,16)}`;default:return`${n}`}}function ps(e,t){let n=j6(e,t);if(yi(n,t)!==e)throw new Error("Invalid value");return n}function W6(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",ps(be(e,2),16)]:["oct",ps(be(e,1),8)]:["dec",ps(e,10)]}function z6(e){return fe(e,".")}function G6(e){if(typeof e!="string")throw new Error("Invalid type");return W(je(e,"."),t=>ps(t,10))}function Hc(){return B(gn(255),gn(255),gn(255),gn(255)).map(z6,G6)}function Ot(e){return B(Nt("dec","oct","hex"),gn(e)).map(V6,W6)}function Fu(e){return fe(e,".")}function Uu(e){if(typeof e!="string")throw new Error("Invalid type");return je(e,".")}function n0(){return Te(B(Ot(255),Ot(255),Ot(255),Ot(255)).map(Fu,Uu),B(Ot(255),Ot(255),Ot(65535)).map(Fu,Uu),B(Ot(255),Ot(16777215)).map(Fu,Uu),Ot(4294967295))}function Kc(e){return e.length===0?[]:je(e,":")}function qc(e){let t=je(e,":");return t.length>=2&&t[t.length-1].length<=4?[_e(t,0,t.length-2),`${t[t.length-2]}:${t[t.length-1]}`]:[_e(t,0,t.length-1),t[t.length-1]]}function H6(e){return`${fe(e[0],":")}:${e[1]}`}function K6(e){if(typeof e!="string")throw new Error("Invalid type");return qc(e)}function q6(e){return`::${fe(e[0],":")}:${e[1]}`}function Y6(e){if(typeof e!="string")throw new Error("Invalid type");if(!P2(e,"::"))throw new Error("Invalid value");return qc(be(e,2))}function ms(e){return`${fe(e[0],":")}::${fe(e[1],":")}:${e[2]}`}function ys(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=je(e,"::",2),[r,i]=qc(n);return[Kc(t),r,i]}function Z6(e){return ms([e[0],[e[1]],e[2]])}function X6(e){let t=ys(e);return[t[0],fe(t[1],":"),t[2]]}function fg(e){return`${fe(e[0],":")}::${e[1]}`}function hg(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=je(e,"::",2);return[Kc(t),n]}function J6(e){return`${fe(e[0],":")}::`}function Q6(e){if(typeof e!="string")throw new Error("Invalid type");if(!I2(e,"::"))throw new Error("Invalid value");return[Kc(be(e,0,e.length-2))]}function e4([e,t]){return`${e}:${t}`}function t4(e){if(typeof e!="string")throw new M("Invalid type");if(!e.includes(":"))throw new M("Invalid value");return e.split(":",2)}var n4="0123456789abcdef",ju;function r4(){return ju===void 0&&(ju=ne({min:0,max:15}).map(e=>n4[e],e=>{if(typeof e!="string")throw new M("Not a string");if(e.length!==1)throw new M("Invalid length");let t=fr(e,0);if(t<=57)return t-48;if(t<97)throw new M("Invalid character");return t-87})),ju}function r0(){let e=Ie({unit:r4(),minLength:1,maxLength:4,size:"max"}),t=Te(B(e,e).map(e4,t4),Hc());return Te(B(ue(e,{minLength:6,maxLength:6,size:"max"}),t).map(H6,K6),B(ue(e,{minLength:5,maxLength:5,size:"max"}),t).map(q6,Y6),B(ue(e,{minLength:0,maxLength:1,size:"max"}),ue(e,{minLength:4,maxLength:4,size:"max"}),t).map(ms,ys),B(ue(e,{minLength:0,maxLength:2,size:"max"}),ue(e,{minLength:3,maxLength:3,size:"max"}),t).map(ms,ys),B(ue(e,{minLength:0,maxLength:3,size:"max"}),ue(e,{minLength:2,maxLength:2,size:"max"}),t).map(ms,ys),B(ue(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(Z6,X6),B(ue(e,{minLength:0,maxLength:5,size:"max"}),t).map(fg,hg),B(ue(e,{minLength:0,maxLength:6,size:"max"}),e).map(fg,hg),B(ue(e,{minLength:0,maxLength:7,size:"max"})).map(J6,Q6))}var i4=class extends he{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)}},o4=Object.getOwnPropertyNames;function s4(){let e=new Yt;return n=>{let r=it(e,n);return r!==void 0||(r=new i4(String(n)),gt(e,n,r)),r}}function i0(e){let t=s4(),n=e(t),r=o4(n);for(let i of r){let o=t(i);o.underlying=n[i]}return n}function a4(e,t){for(let n of e){let r=t[n]||{};if(r.maxLength===void 0||r.maxLength>0)return!0}return!1}function l4(e,t){if(e.length===0)return Re([]);if(!a4(e,t))throw new M("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return B(...e.map(n=>ue(Re(n),t[n]))).map(n=>r2(n)).filter(n=>n.length>0)}var pg=Object.assign,gs=Object.create,o0=Object.defineProperty,mg=Object.getPrototypeOf,u4=Object.prototype;function c4(e){return o0(gs(null),St,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function yg(e,t){return c4(`<${Ue(e)}#${t}>`)}function d4(e,t){let n=gs(u4);for(let r in e){let i=e[r],o=[];for(let s of i){let a=pg(gs(mg(s)),s);o.push(a)}n[r]=o}for(let r in t){let i=t[r];for(let o=0;o!==i.length;++o){let s=i[o],a=n[r][o];for(let l in s){let u=s[l];a[l]=u.index===void 0?void 0:typeof u.index=="number"?n[u.type][u.index]:W(u.index,c=>n[u.type][c])}o0(a,St,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[r][o],u=pg(gs(mg(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?yg(d.type,d.index):W(d.index,f=>yg(d.type,f))}return Ae(u)}})}}return n}function f4(e){let t=0,n=new Yt;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=it(n,a.type);if(l===void 0&&(l=new Yt,gt(n,a.type,l)),g2(l,a.forwardRelationship))throw new M(`Cannot declare multiple inverse relationships for the same forward relationship ${Ue(a.forwardRelationship)} on type ${Ue(a.type)}`);gt(l,a.forwardRelationship,{type:i,property:s}),t+=1}}let r=new Yt;if(t===0)return r;for(let i in e){let o=e[i],s=it(n,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=it(s,a);if(u!==void 0){if(u.type!==l.type)throw new M(`Inverse relationship ${Ue(u.property)} on type ${Ue(u.type)} references forward relationship ${Ue(a)} but types do not match`);gt(r,l,u)}}}if(r.size!==t)throw new M("Some inverse relationships could not be matched with their corresponding forward relationships");return r}var gg=Object.create;function h4(e,t,n){switch(e){case"exclusive":return Re(n);case"successor":return Rs(ne({min:t!==void 0?t+1:0,max:n}));case"any":return Rs(ne({min:0,max:n}))}}function p4(e,t,n,r,i,o,s){let a=h4(t,n,r);switch(e){case"0-1":return Xt(a,{nil:void 0,depthIdentifier:i}).generate(o,s).value;case"1":return a.generate(o,s).value;case"many":{let l=0,u=Xt(Fn(a,{depthIdentifier:i,selector:d=>d===r?d+ ++l:d,minLength:1}),{nil:[],depthIdentifier:i}).generate(o,s).value,c=0;return W(u,d=>d===r?d+c++:d)}}}var m4=class extends he{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let n=new dr,r=new dr;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(vs(n,a.type))throw new M(`Cannot mix exclusive with other strategies for type ${Ue(a.type)}`);mi(r,a.type)}else{if(vs(r,a.type))throw new M(`Cannot mix exclusive with other strategies for type ${Ue(a.type)}`);mi(n,a.type)}if(a.strategy==="successor"&&a.type!==i)throw new M("Cannot mix types for the strategy successor");if(a.strategy==="successor"&&a.arity==="1")throw new M("Cannot use an arity of 1 for the strategy successor")}}}this.inversedRelations=f4(e)}createEmptyLinksInstanceFor(e){let t=gg(null),n=this.relations[e];for(let r in n){let i=n[r];i.arity==="inverse"&&(t[r]={type:i.type,index:[]})}return t}generate(e,t){let n=gg(null);for(let o in this.relations)n[o]=[];let r=[];for(let o of this.defaultEntities)T(r,{type:o,indexInType:n[o].length,depth:0}),T(n[o],this.createEmptyLinksInstanceFor(o));let i=-1;for(;++i<r.length;){let o=r[i],s=this.relations[o.type],a=n[o.type][o.indexInType],l=_c();l.depth=o.depth;for(let u in s){let c=s[u];if(c.arity==="inverse")continue;let d=c.type,f=n[d],p=f.length,h=p4(c.arity,c.strategy||"any",d===o.type?o.indexInType:void 0,f.length,l,e,t);a[u]={type:d,index:h};let m=h===void 0?[]:typeof h=="number"?[h]:h;for(let y of m){y>=p&&(T(r,{type:d,indexInType:y,depth:o.depth+1}),T(f,this.createEmptyLinksInstanceFor(d)));let S=it(this.inversedRelations,c);if(S!==void 0){let w=f[y][S.property].index;T(w,o.indexInType)}}}}return r.length=0,new O(n,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return D.nil()}};function y4(e,t){return new m4(e,t)}var g4=Object.keys,b4=Object.getOwnPropertySymbols,S4=Object.getOwnPropertyDescriptor;function w4(e){let t=g4(e),n=b4(e);for(let r=0;r!==n.length;++r){let i=n[r],o=S4(e,i);o&&o.enumerable&&t.push(i)}return t}var x4=Object.create,v4=Object.defineProperty,R4=Object.getOwnPropertyDescriptor,A4=Object.getOwnPropertyNames,C4=Object.getOwnPropertySymbols;function E4(e,t){return function(r){let i=r[1]?x4(null):{};for(let o=0;o!==e.length;++o){let s=r[0][o];s!==t&&v4(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function k4(e,t){return function(r){if(typeof r!="object"||r===null)throw new Error("Incompatible instance received: should be a non-null object");let i=Object.getPrototypeOf(r)===null,o="constructor"in r&&r.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=R4(r,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,T(a,d.value)}else T(a,t)}let l=A4(r).length,u=C4(r).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var Vu=Symbol("no-key");function Wu(e,t,n){let r=w4(e),i=[];for(let o=0;o!==r.length;++o){let s=r[o],a=e[s];t===void 0||Kt(t,s)!==-1?T(i,a):T(i,Xt(a,{nil:Vu}))}return B(B(...i),n?Re(!1):xi()).map(E4(r,Vu),k4(r,Vu))}function gc(e,t){let n=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return Wu(e,void 0,n);let r=("requiredKeys"in t?t.requiredKeys:void 0)||[];for(let i=0;i!==r.length;++i){let o=Object.getOwnPropertyDescriptor(e,r[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 Wu(e,r,n)}var P4=Object.create;function I4(e,t,n,r){let i=P4(null);for(let o in e){let s=e[o],a=gc(s,r),l=t(o),u=n(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?Fn(a,{...c,selector:u}):ue(a,c)}return gc(i)}var bg=Object.create,M4=Object.keys;function T4(e,t,n={}){let r=M4(e),i=n.initialPoolConstraints||bg(null),o=n.unicityConstraints||bg(null),s={noNullPrototype:n.noNullPrototype};return l4(r,i).chain(a=>y4(t,a).chain(l=>I4(e,u=>l[u].length,u=>o[u],s).map(u=>d4(u,l))))}function O4(e){return fe(W(e,t=>t[t.length-1]===","?be(t,0,t.length-1):t)," ")}function N4(e){return function(n){if(typeof n!="string")throw new Error("Unsupported type");let r=[];for(let i of je(n," "))if(e.canShrinkWithoutContext(i))T(r,i);else if(e.canShrinkWithoutContext(i+","))T(r,i+",");else throw new Error("Unsupported word");return r}}function $4(e){let t=fe(e," ");return t[t.length-1]===","&&(t=be(t,0,t.length-1)),Ec(t[0])+be(t,1)+"."}function _4(e){return function(n){if(typeof n!="string")throw new Error("Unsupported type");if(n.length<2||n[n.length-1]!=="."||n[n.length-2]===","||Ec(ec(n[0]))!==n[0])throw new Error("Unsupported value");let r=ec(n[0])+be(n,1,n.length-1),i=[],o=je(r," ");for(let s=0;s!==o.length;++s){let a=o[s];if(e.canShrinkWithoutContext(a))T(i,a);else if(s===o.length-1&&e.canShrinkWithoutContext(a+","))T(i,a+",");else throw new Error("Unsupported word")}return i}}function L4(e){return fe(e," ")}function D4(e){if(typeof e!="string")throw new Error("Unsupported type");let t=je(e,". ");for(let n=0;n<t.length-1;++n)t[n]+=".";return t}var b=(e,t)=>({arbitrary:Re(e),weight:t});function B4(){return Te(b("non",6),b("adipiscing",5),b("ligula",5),b("enim",5),b("pellentesque",5),b("in",5),b("augue",5),b("et",5),b("nulla",5),b("lorem",4),b("sit",4),b("sed",4),b("diam",4),b("fermentum",4),b("ut",4),b("eu",4),b("aliquam",4),b("mauris",4),b("vitae",4),b("felis",4),b("ipsum",3),b("dolor",3),b("amet,",3),b("elit",3),b("euismod",3),b("mi",3),b("orci",3),b("erat",3),b("praesent",3),b("egestas",3),b("leo",3),b("vel",3),b("sapien",3),b("integer",3),b("curabitur",3),b("convallis",3),b("purus",3),b("risus",2),b("suspendisse",2),b("lectus",2),b("nec,",2),b("ultricies",2),b("sed,",2),b("cras",2),b("elementum",2),b("ultrices",2),b("maecenas",2),b("massa,",2),b("varius",2),b("a,",2),b("semper",2),b("proin",2),b("nec",2),b("nisl",2),b("amet",2),b("duis",2),b("congue",2),b("libero",2),b("vestibulum",2),b("pede",2),b("blandit",2),b("sodales",2),b("ante",2),b("nibh",2),b("ac",2),b("aenean",2),b("massa",2),b("suscipit",2),b("sollicitudin",2),b("fusce",2),b("tempus",2),b("aliquam,",2),b("nunc",2),b("ullamcorper",2),b("rhoncus",2),b("metus",2),b("faucibus,",2),b("justo",2),b("magna",2),b("at",2),b("tincidunt",2),b("consectetur",1),b("tortor,",1),b("dignissim",1),b("congue,",1),b("non,",1),b("porttitor,",1),b("nonummy",1),b("molestie,",1),b("est",1),b("eleifend",1),b("mi,",1),b("arcu",1),b("scelerisque",1),b("vitae,",1),b("consequat",1),b("in,",1),b("pretium",1),b("volutpat",1),b("pharetra",1),b("tempor",1),b("bibendum",1),b("odio",1),b("dui",1),b("primis",1),b("faucibus",1),b("luctus",1),b("posuere",1),b("cubilia",1),b("curae,",1),b("hendrerit",1),b("velit",1),b("mauris,",1),b("gravida",1),b("ornare",1),b("ut,",1),b("pulvinar",1),b("varius,",1),b("turpis",1),b("nibh,",1),b("eros",1),b("id",1),b("aliquet",1),b("quis",1),b("lobortis",1),b("consectetuer",1),b("morbi",1),b("vehicula",1),b("tortor",1),b("tellus,",1),b("id,",1),b("eu,",1),b("quam",1),b("feugiat,",1),b("posuere,",1),b("iaculis",1),b("lectus,",1),b("tristique",1),b("mollis,",1),b("nisl,",1),b("vulputate",1),b("sem",1),b("vivamus",1),b("placerat",1),b("imperdiet",1),b("cursus",1),b("rutrum",1),b("iaculis,",1),b("augue,",1),b("lacus",1))}function F4(e={}){let{maxCount:t,mode:n="words",size:r}=e;if(t!==void 0&&t<1)throw new Error("lorem has to produce at least one word/sentence");let i=B4();return n==="sentences"?ue(ue(i,{minLength:1,size:"small"}).map($4,_4(i)),{minLength:1,maxLength:t,size:r}).map(L4,D4):ue(i,{minLength:1,maxLength:t,size:r}).map(O4,N4(i))}function U4(e){return new Map(e)}function j4(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 V4(e){return e[0]}function bc(e,t,n={}){return Fn(B(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:V4,depthIdentifier:n.depthIdentifier,comparator:"SameValueZero"}).map(U4,j4)}var us=10;function W4(e){let t={};return(n=>{let r=n!==void 0?n:us;if(!eb(t,r)){let i=us;us=r-1,t[r]=e(r),us=i}return t[r]})}function z4(e){let t=0;for(;e>k(0);)e&k(1)&&++t,e>>=k(1);return t}function G4(e,t){let n=(k(1)<<k(t))-k(1),r=e&n,i=z4(e-r),o=r;for(let s=k(1);s<=n&&i!==0;s<<=k(1))o&s||(o|=s,--i);return o}function cs(e,t){let n=[];for(let r=e.length-1;r!==-1;--r)t(e[r])!==e[r]&&T(n,r);return n}function H4(e,t,n){let r=k(0);for(let i=0,o=k(1);i!==n.length;++i,o<<=k(1))e[n[i]]!==t[n[i]]&&(r|=o);return r}function zu(e,t,n,r){for(let i=0,o=k(1);i!==n.length;++i,o<<=k(1))t&o&&(e[n[i]]=r(e[n[i]]))}var K4=class extends he{constructor(e,t,n){super(),this.stringArb=e,this.toggleCase=t,this.untoggleAll=n}buildContextFor(e,t){return{rawString:e.value,rawStringContext:e.context,flags:t.value,flagsContext:t.context}}generate(e,t){let n=this.stringArb.generate(e,t),r=[...n.value],i=cs(r,this.toggleCase),o=wn(k(0),(k(1)<<k(i.length))-k(1)).generate(e,void 0);return zu(r,o.value,i,this.toggleCase),new O(fe(r,""),this.buildContextFor(n,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 n;if(t!==void 0)n=t;else if(this.untoggleAll!==void 0){let o=this.untoggleAll(e),s=[...e],a=[...o];n={rawString:o,rawStringContext:void 0,flags:H4(a,s,cs(a,this.toggleCase)),flagsContext:void 0}}else n={rawString:e,rawStringContext:void 0,flags:k(0),flagsContext:void 0};let r=n.rawString,i=n.flags;return this.stringArb.shrink(r,n.rawStringContext).map(o=>{let s=[...o.value],a=cs(s,this.toggleCase),l=G4(i,a.length);return zu(s,l,a,this.toggleCase),new O(fe(s,""),this.buildContextFor(o,new O(l,void 0)))}).join(bn(()=>{let o=[...r],s=cs(o,this.toggleCase);return wn(k(0),(k(1)<<k(s.length))-k(1)).shrink(i,n.flagsContext).map(a=>{let l=_e(o);return zu(l,a.value,s,this.toggleCase),new O(fe(l,""),this.buildContextFor(new O(r,n.rawStringContext),a))})}))}};function q4(e){let t=Ec(e);return t!==e?t:ec(e)}function Y4(e,t){return new K4(e,t&&t.toggleCase||q4,t&&t.untoggleAll)}function Z4(e){return Kg.from(e)}function X4(e){if(!(e instanceof Kg))throw new Error("Unexpected type");return[...e]}function s0(e={}){return ue(Jb(e),e).map(Z4,X4)}function J4(e){return qg.from(e)}function Q4(e){if(!(e instanceof qg))throw new Error("Unexpected type");return[...e]}function a0(e={}){return ue(ks(e),e).map(J4,Q4)}function Jt(e,t,n,r,i){let o=r.name,{min:s=t,max:a=n,...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>n)throw new Error(`Invalid max value passed to ${o}: max must be lower than or equal to ${n}`);return ue(i({min:s,max:a}),l).map(u=>r.from(u),u=>{if(!(u instanceof r))throw new Error("Invalid type");return[...u]})}function l0(e={}){return Jt(e,-32768,32767,Bk,ne)}function u0(e={}){return Jt(e,-2147483648,2147483647,Fk,ne)}function c0(e={}){return Jt(e,-128,127,Dk,ne)}function d0(e={}){return Jt(e,0,65535,Vk,ne)}function f0(e={}){return Jt(e,0,4294967295,Wk,ne)}function h0(e={}){return Jt(e,0,255,Uk,ne)}function p0(e={}){return Jt(e,0,255,jk,ne)}function eT(e){return e!==void 0}function Sg(e){return e.hasToBeCloned?new O(e.value_,{generatorContext:e.context},()=>e.value):new O(e.value_,{generatorContext:e.context})}function wg(e){return e.hasToBeCloned?new O(e.value_,{shrinkerContext:e.context},()=>e.value):new O(e.value_,{shrinkerContext:e.context})}var tT=class extends he{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return Sg(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return eT(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(Sg):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(wg):this.shrinkerArbitrary.shrink(e,void 0).map(wg)}};function Sc(e,t,n){let r=ne({min:e,max:t});return t===n?r:new tT(r,ne({min:e,max:n}))}var nT=Math.min,wc=Math.max,xg=Gg.isArray,rT=Object.entries;function iT(e){let t=-1;for(let n=0;n!==e.length;++n)t=wc(t,e[n][0]);return t}function oT(e,t){let n=Gg(e);for(let r=0;r!==t.length;++r){let i=t[r];i[0]<e&&(n[i[0]]=i[1])}return n}function m0(e,t={}){let{size:n,minNumElements:r=0,maxLength:i=Bn,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=bi(n,bi(n,r,o,t.maxNumElements!==void 0),i,t.maxLength!==void 0);if(r>i)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(r>o)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let u=nT(o,i),c=t.maxNumElements!==void 0||n!==void 0?n:"=",d=Fn(B(Sc(0,wc(l-1,0),wc(i-1,0)),e),{size:c,minLength:r,maxLength:u,selector:f=>f[0],depthIdentifier:a}).map(f=>oT(iT(f)+1,f),f=>{if(!xg(f))throw new Error("Not supported entry type");if(s&&f.length!==0&&!(f.length-1 in f))throw new Error("No trailing hole");return W(rT(f),p=>[Number(p[0]),p[1]])});return s||i===r?d:B(d,Sc(r,l,i)).map(f=>{let p=f[0],h=f[1];if(p.length>=h)return p;let m=_e(p);return m.length=h,m},f=>{if(!xg(f))throw new Error("Not supported entry type");return[f,f.length]})}function sT(e){return new Set(e)}function aT(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 y0(e,t={}){return Fn(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(sT,aT)}function lT(e,t,n,r,i,o){return Bc(e,t,{maxKeys:n,noNullPrototype:!o,size:r,depthIdentifier:i})}function uT(e){return Te(c0(e),h0(e),p0(e),l0(e),d0(e),u0(e),f0(e),s0(e),a0(e))}function g0(e){let t=e.values,n=e.depthSize,r=_c(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Te(...t,...e.withBigInt?[wn()]:[],...e.withDate?[Ob()]:[]);return i0(l=>({anything:Te({maxDepth:i,depthSize:n,depthIdentifier:r},a,l("array"),l("object"),...e.withMap?[l("map")]:[],...e.withSet?[l("set")]:[],...e.withObjectString?[l("anything").map(u=>Ae(u))]:[],...e.withTypedArray?[uT({maxLength:o,size:s})]:[],...e.withSparseArray?[m0(l("anything"),{maxNumElements:o,size:s,depthIdentifier:r})]:[]),keys:e.withObjectString?Te({arbitrary:e.key,weight:10},{arbitrary:l("anything").map(u=>Ae(u)),weight:1}):e.key,array:ue(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),set:y0(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),map:Te(bc(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r}),bc(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r})),object:lT(l("keys"),l("anything"),o,s,r,e.withNullPrototype)})).anything}function cT(e){switch(typeof e){case"boolean":return new Hg(e);case"number":return new qt(e);case"string":return new Ue(e);default:return e}}function dT(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===Hg||e.constructor===qt||e.constructor===Ue?e.valueOf():e}function fT(e){return e.map(cT,dT)}function hT(e,t){return[xi(),t0(),ks(),t(e),Te(t(e),Re(null),Re(void 0))]}function pT(e){return e.map(t=>fT(t))}function mT(e,t){return t?pT(e).concat(e):e}function b0(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:Ie(t),values:mT(e.values!==void 0?e.values:hT(t,Ie),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 yT(e){return Bc(e.key,g0(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function gT(e){return yT(b0(e))}function bT(e,t){let{depthSize:n,maxDepth:r}=t;return{key:e,values:[xi(),ks({noDefaultInfinity:!0,noNaN:!0}),e,Re(null)],depthSize:n,maxDepth:r}}function S0(e){return g0(b0(e))}function w0(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return S0(bT("stringUnit"in e?Ie({unit:e.stringUnit}):t?Ie():Ie({unit:"binary"}),e))}var ST=JSON.stringify,wT=JSON.parse;function xT(e){if(typeof e!="string")throw new M("Cannot unmap the passed value");return wT(e)}function vT(e={}){return w0(e).map(ST,xT)}var RT=Object.defineProperties;function Gu(e,t){return`Stream(${t!==void 0?`${fe(t,",")}\u2026`:`${e} emitted`})`}var AT=class extends he{constructor(e,t){super(),this.arb=e,this.history=t}generate(e,t){let n=t!==void 0&&e.nextInt(1,t)===1?t:void 0,r=()=>{let i=this.history?[]:null,o=0,s=function*(a,l){for(;;){let u=a.generate(l,n).value;o++,i!==null&&T(i,u),yield u}};return RT(new D(s(this.arb,e.clone())),{toString:{value:()=>Gu(o,i!==null?i.map(Ae):void 0)},[St]:{value:()=>Gu(o,i!==null?i.map(Ae):void 0)},[Zt]:{value:async()=>Gu(o,i!==null?await Promise.all(i.map(Tc)):void 0)},[Oe]:{value:r,enumerable:!0}})};return new O(r(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return D.nil()}};function CT(e,t){return new AT(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function ET(e){return fe(e,"")}function vg(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function kT(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return be(e,1)}}function PT(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 be(e,0,t)}var Hu=String.fromCharCode;function IT(e){return e<26?Hu(e+65):e<52?Hu(e+97-26):e<62?Hu(e+48-52):e===62?"+":"/"}function MT(e){if(typeof e!="string"||e.length!==1)throw new M("Invalid entry");let t=fr(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 TT(){return ne({min:0,max:63}).map(IT,MT)}function OT(e={}){let{minLength:t=0,maxLength:n=Bn,size:r}=e,i=t+3-(t+3)%4,o=n-n%4,s=e.maxLength===void 0&&r===void 0?"=":r;if(i>o)throw new M("Minimal length should be inferior or equal to maximal length");if(i%4!==0)throw new M("Minimal length of base64 strings must be a multiple of 4");if(o%4!==0)throw new M("Maximal length of base64 strings must be a multiple of 4");let a=TT();return ue(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:hM(a,vg)}).map(ET,vg).map(kT,PT)}var Rg=Object.is;function NT(e,t){let n=new Yt,r=0;for(let i of e)Rg(i,-0)?++r:gt(n,i,(it(n,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(Rg(o,-0)){if(r===0)return!1;--r}else{let s=it(n,o)||0;if(s===0)return!1;gt(n,o,s-1)}}return!0}var $T=Math.floor,Ag=Math.log,_T=Array.isArray,x0=class extends he{constructor(e,t,n,r){if(super(),this.originalArray=e,this.isOrdered=t,this.minLength=n,this.maxLength=r,n<0||n>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(r<0||r>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(n>r)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new pr(n,r),this.biasedLengthArb=n!==r?new pr(n,n+$T(Ag(r-n)/Ag(2))):this.lengthArb}generate(e,t){let n=(t!==void 0&&e.nextInt(1,t)===1?this.biasedLengthArb:this.lengthArb).generate(e,void 0),r=n.value,i=W(this.originalArray,(s,a)=>a),o=[];for(let s=0;s!==r;++s){let a=e.nextInt(0,i.length-1);T(o,i[a]),Xg(i,a,1)}return this.isOrdered&&Jg(o,(s,a)=>s-a),new O(W(o,s=>this.originalArray[s]),n.context)}canShrinkWithoutContext(e){return!_T(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:NT(this.originalArray,e)}shrink(e,t){return e.length===0?D.nil():this.lengthArb.shrink(e.length,t).map(n=>new O(_e(e,e.length-n.value),n.context)).join(e.length>this.minLength?bn(()=>this.shrink(_e(e,1),void 0).filter(n=>this.minLength<=n.value.length+1).map(n=>new O([e[0],...n.value],void 0))):D.nil())}};function LT(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new x0(e,!0,n,r)}function DT(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new x0(e,!1,n,r)}var BT={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"},FT={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 UT(e){return e<10?Ue(e):BT[e]}function Cg(e,t){let n="";for(;e.length+n.length<t;)n+="0";return n+e}function Eg(e){let t="";for(let n=e;n!==0;){let r=n>>5;t=UT(n-(r<<5))+t,n=r}return t}function jT(e,t){let n=~~(e/1073741824),r=e&1073741823;return Cg(Eg(n),t-6)+Cg(Eg(r),6)}function v0(e){return function(n){return jT(n,e)}}function Ku(e){if(typeof e!="string")throw new M("Unsupported type");let t=0,n=1;for(let r=e.length-1;r>=0;--r){let i=FT[e[r]];if(i===void 0)throw new M("Unsupported type");t+=i*n,n*=32}return t}var VT=v0(10),kg=v0(8);function WT(e){return VT(e[0])+kg(e[1])+kg(e[2])}function zT(e){if(typeof e!="string"||e.length!==26)throw new Error("Unsupported type");return[Ku(e.slice(0,10)),Ku(e.slice(10,18)),Ku(e.slice(18))]}function GT(){return B(ne({min:0,max:0xffffffffffff}),ne({min:0,max:0xffffffffff}),ne({min:0,max:0xffffffffff})).map(WT,zT)}function R0(e){return M2(yi(e,16),8,"0")}function HT(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!==R0(t))throw new Error("Unsupported value: invalid content");return t}function qu(e,t){return ne({min:e,max:t}).map(R0,HT)}function KT(e){return`${e[0]}-${be(e[1],4)}-${be(e[1],0,4)}-${be(e[2],0,4)}-${be(e[2],4)}${e[3]}`}var qT=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function YT(e){if(typeof e!="string")throw new Error("Unsupported type");let t=qT.exec(e);if(t===null)throw new Error("Unsupported type");return[t[1],t[3]+t[2],t[4]+be(t[5],0,4),be(t[5],4)]}var Pg="0123456789abcdef";function ZT(e){let t={},n={};for(let o=0;o!==e.length;++o){let s=Pg[o],a=Pg[e[o]];t[s]=a,n[a]=s}function r(o){return t[o[0]]+be(o,1)}function i(o){if(typeof o!="string")throw new M("Cannot produce non-string values");let s=n[o[0]];if(s===void 0)throw new M("Cannot produce strings not starting by the version in hexa code");return s+be(o,1)}return{versionsApplierMapper:r,versionsApplierUnmapper:i}}function XT(e){let t={};for(let n of e){if(t[n])throw new M(`Version ${n} has been requested at least twice for uuid`);if(t[n]=!0,n<1||n>15)throw new M(`Version must be a value in [1-15] for uuid, but received ${n}`);if(~~n!==n)throw new M(`Version must be an integer value for uuid, but received ${n}`)}if(e.length===0)throw new M("Must provide at least one version for uuid")}function JT(e={}){let t=qu(0,4294967295),n=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];XT(n);let{versionsApplierMapper:r,versionsApplierUnmapper:i}=ZT(n);return B(t,qu(0,268435456*n.length-1).map(r,i),qu(2147483648,3221225471),t).map(KT,YT)}function QT(e){return Ie({unit:jc("-._~!$&'()*+,;=:"),size:e})}function e3([e,t,n]){return(e===null?"":`${e}@`)+t+(n===null?"":`:${n}`)}function t3(e){if(typeof e!="string")throw new Error("Unsupported");let t=e.indexOf("@"),n=t!==-1?e.substring(0,t):null,r=/:(\d+)$/.exec(e),i=r!==null?Number(r[1]):null;return[n,r!==null?e.substring(t+1,e.length-r[1].length-1):e.substring(t+1),i]}function n3(e){return`[${e}]`}function r3(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function A0(e){let t=e||{},n=t.size,r=[Vc({size:n}),...t.withIPv4===!0?[Hc()]:[],...t.withIPv6===!0?[r0().map(n3,r3)]:[],...t.withIPv4Extended===!0?[n0()]:[]];return B(t.withUserInfo===!0?Xt(QT(n)):Re(null),Te(...r),t.withPort===!0?Xt(gn(65535)):Re(null)).map(e3,t3)}function C0(e){return Ie({unit:jc("-._~!$&'()*+,;=:@/?"),size:e})}function E0(e={}){return C0(e.size)}function k0(e={}){return Ie({unit:jc("-._~!$&'()*+,;=:@"),size:e.size})}function i3(e){return fe(W(e,t=>`/${t}`),"")}function o3(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 Xg(je(e,"/"),1)}function s3(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 Yu(e,t){return ue(k0({size:e}),{size:t}).map(i3,o3)}function a3(e){let[t,n]=s3(e);return t===n?Yu(t,n):Te(Yu(t,n),Yu(n,t))}function P0(e){return a3(Dc((e||{}).size))}function I0(e={}){return C0(e.size)}function l3(e){let[t,n,r]=e;return`${t}://${n}${r}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var u3=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function c3(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=u3.exec(e);if(t===null)throw new Error("Incompatible value received");let n=t[1],r=t[2],i=t[3],o=t[4],s=t[5];return[n,r,i,o!==void 0?o.substring(1):null,s!==void 0?s.substring(1):null]}function d3(e){let t=e||{},n=Dc(t.size),r=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?wi(t.authoritySettings.size,n):n,i={...t.authoritySettings,size:r};return B(Nt(...t.validSchemes||["http","https"]),A0(i),P0({size:n}),t.withQueryParameters===!0?Xt(I0({size:n})):Re(null),t.withFragments===!0?Xt(E0({size:n})):Re(null)).map(l3,c3)}var f3=class M0{constructor(t,n){this.commands=t,this.metadataForReplay=n,this[Oe]=function(){return new M0(this.commands.map(r=>r.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let t=this.commands.filter(r=>r.hasRan).map(r=>r.toString()).join(","),n=this.metadataForReplay();return n.length!==0?`${t} /*${n}*/`:t}},h3=class xc{constructor(t){if(this.cmd=t,this.hasRan=!1,Ic(t)){let n=t[St];this[St]=function(){return n.call(t)}}if(Mc(t)){let n=t[Zt];this[Zt]=function(){return n.call(t)}}}check(t){return this.cmd.check(t)}run(t,n){return this.hasRan=!0,this.cmd.run(t,n)}clone(){return Dn(this.cmd)?new xc(this.cmd[Oe]()):new xc(this.cmd)}toString(){return this.cmd.toString()}},Ig=class{static parse(e){let[t,n]=e.split(":"),r=this.parseCounts(t),i=this.parseChanges(n);return this.parseOccurences(r,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,n)=>(t.length===0||t[t.length-1].count===64||t[t.length-1].value!==n?t.push({value:n,count:1}):t[t.length-1].count+=1,t),[])}static parseOccurences(e,t){let n=[];for(let r=0;r!==e.length;++r){let i=e[r],o=t[r];for(let s=0;s!==i;++s)n.push(o)}return n}static stringifyChanges(e){let t="";for(let n=0;n<e.length;n+=6){let r=e.slice(n,n+6).reduceRight((i,o)=>(i<<1)+(o.value?1:0),0);t+=this.intToB64(r)}return t}static parseChanges(e){let t=e.split("").map(r=>this.b64ToInt(r)),n=[];for(let r=0;r!==t.length;++r){let i=t[r];for(let o=0;o!==6;++o,i>>=1)n.push(i%2===1)}return n}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)}},p3=class extends he{constructor(e,t,n,r,i){super(),this.sourceReplayPath=r,this.disableReplayLog=i,this.oneCommandArb=Te(...e).map(o=>new h3(o)),this.lengthArb=Sc(0,t,n),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(Ig.stringify(this.replayPath))}`}buildValueFor(e,t){let n=e.map(i=>i.value_),r={shrunkOnce:t,items:e};return new O(new f3(n,()=>this.metadataForReplay()),r)}generate(e){let t=this.lengthArb.generate(e,void 0).value,n=Array(t);for(let r=0;r!==t;++r)n[r]=this.oneCommandArb.generate(e,void 0);return this.replayPathPosition=0,this.buildValueFor(n,!1)}canShrinkWithoutContext(e){return!1}filterOnExecution(e){let t=[];for(let n of e)n.value_.hasRan?(this.replayPath.push(!0),t.push(n)):this.replayPath.push(!1);return t}filterOnReplay(e){return e.filter((t,n)=>{let r=this.replayPath[this.replayPathPosition+n];if(r===void 0)throw new Error("Too short replayPath");if(!r&&t.value_.hasRan)throw new Error("Mismatch between replayPath and real execution");return r})}filterForShrinkImpl(e){this.replayPathPosition===0&&(this.replayPath=this.sourceReplayPath!==null?Ig.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 D.nil();let n=t,r=n.shrunkOnce,i=n.items,o=this.filterForShrinkImpl(i);if(o.length===0)return D.nil();let s=r?D.nil():new D([[]][Symbol.iterator]()),a=[];for(let l=0;l!==o.length;++l)a.push(bn(()=>{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(bn(()=>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 O(u.value_.clone(),u.context)),!0))}};function m3(e,t={}){let{size:n,maxCommands:r=Bn,disableReplayLog:i=!1,replayPath:o=null}=t;return new p3(e,bi(n,0,r,t.maxCommands!==void 0),r,o,i)}var y3=class{constructor(e,t){this.s=e,this.cmd=t}async check(e){let t=null,n=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{n=await Promise.resolve(this.cmd.check(e))}catch(r){throw t=r,r}}}]).task).faulty)throw t;return n}async run(e,t){let n=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(e,t)}catch(r){throw n=r,r}}}]).task).faulty)throw n}},g3=function*(e,t){for(let n of t)yield new y3(e,n)},T0=(e,t,n,r,i)=>e.then(o=>{let{model:s,real:a}=o,l=n;for(let u of t)l=i(l,()=>r(u,s,a));return l}),b3=(e,t)=>T0({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),S3=e=>typeof e.then=="function",O0=async(e,t,n=Promise.resolve())=>await T0({then:s=>{let a=e();return S3(a)?a.then(s):s(a)}},t,n,async(s,a,l)=>{await s.check(a)&&await s.run(a,l)},(s,a)=>s.then(a));function w3(e,t){b3(e,t)}async function x3(e,t){await O0(e,t)}async function v3(e,t,n){let r=O0(t,g3(e,n),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(r),await e.waitAll()}var ds=e=>e(),N0=class vc{constructor(t,n){this.act=t,this.taskSelector=n,this.lastTaskId=0,this.sourceTaskSelector=n.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Oe]=function(){return new vc(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 ${E6(t.outputValue)}`:""}`}log(t,n,r,i,o,s){this.triggeredTasks.push({status:o,schedulingType:t,taskId:n,label:r,metadata:i,outputValue:s!==void 0?Ae(s):void 0})}scheduleInternal(t,n,r,i,o,s){let a=++this.lastTaskId,l,u=new Promise((c,d)=>{l=()=>{let f=Promise.resolve(s!==void 0?r.then(()=>s()):r);return f.then(p=>{this.log(t,a,n,i,"resolved",p),c(p)},p=>{this.log(t,a,n,i,"rejected",p),d(p)}),f}});return this.scheduledTasks.push({original:r,trigger:l,schedulingType:t,taskId:a,label:n,metadata:i,customAct:o}),this.scheduledWatchers.length!==0&&this.scheduledWatchers[0](),u}schedule(t,n,r,i){return this.scheduleInternal("promise",n||"",t,r,i||ds)}scheduleFunction(t,n){return(...r)=>this.scheduleInternal("function",`${t.name}(${r.map(Ae).join(",")})`,t(...r),void 0,n||ds)}scheduleSequence(t,n){let r={done:!1,faulty:!1},i={then:c=>c()},o=()=>{},s=new Promise(c=>{o=()=>c({done:r.done,faulty:r.faulty})}),a=()=>{r.faulty=!0,o()},l=()=>{r.done=!0,o()},u=(c,d)=>{if(c>=t.length){d.then(l,a);return}d.then(()=>{let f=t[c],[p,h,m]=typeof f=="function"?[f,f.name,void 0]:[f.builder,f.label,f.metadata],y=this.scheduleInternal("sequence",h,i,m,n||ds,()=>p());u(c+1,y)},a)};return u(0,i),Object.assign(r,{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),[n]=this.scheduledTasks.splice(t,1);return n.customAct(()=>n.trigger().catch(r=>{}))}waitOne(t){let n=t||ds;return this.act(()=>n(()=>this.internalWaitOne()))}async waitAll(t){for(;this.scheduledTasks.length>0;)await this.waitOne(t)}async internalWaitFor(t,n){let r=!1,i=n.customAct,o=n.onWaitStart,s=n.onWaitIdle,a=n.launchAwaiterOnInit,l,u,c=0,d=null,f=null,p=async()=>{for(c=50,c=50;!r&&c>0;--c)await Promise.resolve();if(!r&&this.scheduledTasks.length>0)return o!==void 0&&o(),f=this.waitOne(i),f.then(()=>(f=null,p()),S=>{throw f=null,r=!0,u(S),S});!r&&s!==void 0&&s(),d=null},h=()=>{if(d!==null){c=51;return}d=p().catch(()=>{})},m=()=>{let S=this.scheduledWatchers.indexOf(h);S!==-1&&this.scheduledWatchers.splice(S,1),S===0&&this.scheduledWatchers.length!==0&&this.scheduledWatchers[0]()},y=new Promise((S,w)=>{l=g=>{m(),S(g)},u=g=>{m(),w(g)}});return t.then(S=>{r=!0,f===null?l(S):f.then(()=>l(S),w=>u(w))},S=>{r=!0,f===null?u(S):f.then(()=>u(S),()=>u(S))}),(this.scheduledTasks.length>0||a)&&this.scheduledWatchers.length===0&&h(),this.scheduledWatchers.push(h),y}waitNext(t,n){let r,i=t,o=i<=0?Promise.resolve():new Promise(s=>{r=()=>{--i<=0&&s()}});return this.internalWaitFor(o,{customAct:n,onWaitStart:r,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(t){let n,r=new Promise(i=>n=i);return this.internalWaitFor(r,{customAct:t,onWaitStart:void 0,onWaitIdle:n,launchAwaiterOnInit:!0})}waitFor(t,n){return this.internalWaitFor(t,{customAct:n,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(vc.buildLog).map(t=>`-> ${t}`).join(`
53
+ `)+"`"}};function $0(e){let t=0;return{clone:()=>$0(e),nextTaskIndex:n=>{if(e.length<=t)throw new Error("Invalid schedulerFor defined: too many tasks have been scheduled");let r=n.findIndex(i=>i.taskId===e[t]);if(r===-1)throw new Error("Invalid schedulerFor defined: unable to find next task");return++t,r}}}function Mg(e,t){return new N0(e,$0(t))}function _0(e){let t=e.clone();return{clone:()=>_0(t),nextTaskIndex:n=>e.nextInt(0,n.length-1)}}var R3=class extends he{constructor(e){super(),this.act=e}generate(e,t){return new O(new N0(this.act,_0(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return D.nil()}};function A3(e){let{act:t=n=>n()}=e||{};return new R3(t)}function C3(e,t){let{act:n=r=>r()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?Mg(n,e):function(r,...i){return Mg(n,i)}}function E3(e={}){return Jt(e,k("-9223372036854775808"),k("9223372036854775807"),_k,wn)}function k3(e={}){return Jt(e,k(0),k("18446744073709551615"),Lk,wn)}function P3(e,t){return t}var Zu=Math.floor,I3=Math.min;function at(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let n=at(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:n.astNode},minLength:0}}case"+":{let n=at(e.expression,t),r=n.minLength>1?n.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:Zu(t/r)},expression:n.astNode},minLength:n.minLength}}case"?":{let n=at(e.expression,t);return t<n.minLength?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:0},expression:n.astNode},minLength:0}:{astNode:{...e,expression:n.astNode},minLength:0}}case"Range":{let n=e.quantifier.from>1?Zu(t/e.quantifier.from):t,r=at(e.expression,n),i=r.minLength>1?r.minLength:1;return e.quantifier.to===void 0||e.quantifier.to*i>t?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",to:Zu(t/i)},expression:r.astNode},minLength:e.quantifier.from*r.minLength}:{astNode:{...e,expression:r.astNode},minLength:e.quantifier.from*r.minLength}}default:return P3(e.quantifier,{astNode:e,minLength:0})}case"Quantifier":return{astNode:e,minLength:0};case"Alternative":{let n=0,r=[];for(let o=0;o!==e.expressions.length;++o){let s=t-n,a=at(e.expressions[o],s);n+=a.minLength,T(r,{value:a,allowance:s})}let i=[];for(let o=0;o!==r.length;++o){let s=r[o].value,a=r[o].allowance,l=t-n+s.minLength;T(i,(l!==a?at(s.astNode,l):s).astNode)}return{astNode:{...e,expressions:i},minLength:n}}case"CharacterClass":return{astNode:e,minLength:1};case"ClassRange":return{astNode:e,minLength:1};case"Group":{let n=at(e.expression,t);return{astNode:{...e,expression:n.astNode},minLength:n.minLength}}case"Disjunction":{if(e.left===null){if(e.right===null)return{astNode:e,minLength:0};let i=at(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=at(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let n=at(e.left,t),r=at(e.right,t);return n.minLength>t?r:r.minLength>t?n:{astNode:{...e,left:n.astNode,right:r.astNode},minLength:I3(n.minLength,r.minLength)}}case"Assertion":return{astNode:e,minLength:0};case"Backreference":return{astNode:e,minLength:0};case"UnicodeProperty":return{astNode:e,minLength:1}}}function M3(e,t){return at(e,t).astNode}function T3(e){return new Error(`Unsupported AST node! Received: ${Ae(e)}`)}function bs(e,t,n){if(!t&&!n)return e;let r={hasStart:!1,hasEnd:!1},i=L0(e,t,n,r),o=t&&!r.hasStart,s=n&&!r.hasEnd;if(!o&&!s)return i;let a=[];return o&&(a.push({type:"Assertion",kind:"^"}),a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}})),a.push(i),s&&(a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}}),a.push({type:"Assertion",kind:"$"})),{type:"Group",capturing:!1,expression:{type:"Alternative",expressions:a}}}function L0(e,t,n,r){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 r.hasStart=!0,r.hasEnd=!0,{...e,expressions:e.expressions.map((i,o)=>bs(i,t&&o===0,n&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:L0(e.expression,t,n,r)};case"Disjunction":return r.hasStart=!0,r.hasEnd=!0,{...e,left:e.left!==null?bs(e.left,t,n):null,right:e.right!==null?bs(e.right,t,n):null};case"Assertion":if(e.kind==="^"||e.kind==="Lookahead")return r.hasStart=!0,e;if(e.kind==="$"||e.kind==="Lookbehind")return r.hasEnd=!0,e;throw new Error(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":return e;case"UnicodeProperty":return e;default:throw T3(e)}}function O3(e){return bs(e,!0,!0)}function Tg(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Pe(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Rc(e){return e>="0"&&e<="9"}function D0(e,t){for(let n=t;n!==e.length;++n){let r=e[n];if(r==="\\")n+=1;else if(r==="]")return n}throw new Error("Missing closing ']'")}function N3(e,t){let n=0;for(let r=t;r!==e.length;++r){let i=e[r];if(i==="\\")r+=1;else if(i===")"){if(n===0)return r;n-=1}else i==="["?r=D0(e,r):i==="("&&(n+=1)}throw new Error("Missing closing ')'")}function $3(e,t){let n=!1;for(let r=t;r!==e.length;++r){let i=e[r];if(!Rc(i)){if(t===r)return-1;if(i===","){if(n)return-1;n=!0}else return i==="}"?r:-1}}return-1}function _3(e,t,n,r){switch(e[t]){case"[":return r===1?t+1:D0(e,t+1)+1;case"{":{if(r===1)return t+1;let i=$3(e,t+1);return i===-1?t+1:i+1}case"(":return r===1?t+1:N3(e,t+1)+1;case"]":case"}":case")":return t+1;case"\\":{let i=e[t+1];switch(i){case"x":if(Pe(e[t+2])&&Pe(e[t+3]))return t+4;throw new Error(`Unexpected token '${e.substring(t,t+4)}' found`);case"u":if(e[t+2]==="{"){if(!n)return t+2;if(e[t+4]==="}"){if(Pe(e[t+3]))return t+5;throw new Error(`Unexpected token '${e.substring(t,t+5)}' found`)}if(e[t+5]==="}"){if(Pe(e[t+3])&&Pe(e[t+4]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`)}if(e[t+6]==="}"){if(Pe(e[t+3])&&Pe(e[t+4])&&Pe(e[t+5]))return t+7;throw new Error(`Unexpected token '${e.substring(t,t+7)}' found`)}if(e[t+7]==="}"){if(Pe(e[t+3])&&Pe(e[t+4])&&Pe(e[t+5])&&Pe(e[t+6]))return t+8;throw new Error(`Unexpected token '${e.substring(t,t+8)}' found`)}if(e[t+8]==="}"&&Pe(e[t+3])&&Pe(e[t+4])&&Pe(e[t+5])&&Pe(e[t+6])&&Pe(e[t+7]))return t+9;throw new Error(`Unexpected token '${e.substring(t,t+9)}' found`)}if(Pe(e[t+2])&&Pe(e[t+3])&&Pe(e[t+4])&&Pe(e[t+5]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`);case"p":case"P":{if(!n)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(!n)return t+2;throw new Error("Invalid \\k definition")}return o+1}default:if(Rc(i)){let o=n?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&Rc(e[s]);++s);return s}return t+(n?Tg(e,t+1):1)+1}}default:return t+(n?Tg(e,t):1)}}function fs(e,t,n,r){let i=_3(e,t,n,r);return e.substring(t,i)}var Og={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},Ps={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"},Si=Zc(Ps),Yc={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"},Ac=Zc(Yc),B0={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"},Ng=Zc(B0);function Zc(e){let t={};for(let n of Object.keys(e)){let r=e[n];if(Array.isArray(r))for(let i=0;i!==r.length;++i)t[r[i]]=n;else t[r]=n}return t}function L3(e){return e in Yc||e in Ac}function D3(e){return e in Ps||e in Si}function $g(e){if(e in Og)return Og[e];if(e in Si)return Si[e];if(e in Ps||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function _g(e){if(e in Ac)return Ac[e];if(e in Ng)return Ng[e];if(e in Si)return Si[e];if(e in Yc||e in B0||e in Ps)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function B3(e,t){let n=e.indexOf("=");if(n!==-1){let r=e.substring(0,n),i=e.substring(n+1);return{type:"UnicodeProperty",name:r,value:i,negative:t,shorthand:!1,binary:!1,canonicalName:$g(r),canonicalValue:_g(i)}}if(L3(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:_g(e)};if(D3(e)){let r=$g(e);return{type:"UnicodeProperty",name:e,value:e,negative:t,shorthand:!1,binary:!0,canonicalName:r,canonicalValue:r}}throw new Error(`Invalid Unicode property: ${e}`)}var Xu=String.fromCodePoint;function Ju(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function F0(e){return e>="0"&&e<="9"}function Ss(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function lr(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function mn(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 Qu(e){if(e[0]==="\\"){let t=e[1];switch(t){case"x":{let n=e.substring(2),r=Number.parseInt(n,16);return{type:"Char",kind:"hex",symbol:Xu(r),value:e,codePoint:r}}case"u":{if(e==="\\u")return Ss("u",!0);let n=e[2]==="{"?e.substring(3,e.length-1):e.substring(2),r=Number.parseInt(n,16);return{type:"Char",kind:"unicode",symbol:Xu(r),value:e,codePoint:r}}case"0":return lr(e,"\0");case"n":return lr(e,`
54
+ `);case"f":return lr(e,"\f");case"r":return lr(e,"\r");case"t":return lr(e," ");case"v":return lr(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(F0(t)){let n=e.substring(1),r=Number(n);return{type:"Char",kind:"decimal",symbol:Xu(r),value:e,codePoint:r}}if(e.length>2&&(t==="p"||t==="P")){let n=t==="P";return B3(e.substring(3,e.length-1),n)}return Ss(e.substring(1),!0)}}return Ss(e)}function ur(e,t,n,r){let i=null;for(let o=0,s=fs(t,o,n,0);o!==t.length;o+=s.length,s=fs(t,o,n,0)){let a=s[0];switch(a){case"|":i===null&&(i=[]),i.push(mn(e.splice(0),!0)||null);break;case".":e.push({type:"Char",kind:"meta",symbol:s,value:s,codePoint:NaN});break;case"*":case"+":{let l=Ju(e);e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"?":{let l=Ju(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(Ss(s));break}let l=Ju(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 f=0,p=fs(l,f,n,1);f!==l.length;f+=p.length,p=fs(l,f,n,1)){if(f===0&&p==="^"){c=!0;continue}let h=Qu(p);if(p==="-")u.push(h),d=!0;else{let m=u.length>=2?u[u.length-2]:void 0;d&&m!==void 0&&m.type==="Char"&&h.type==="Char"?(u.pop(),u.pop(),u.push({type:"ClassRange",from:m,to:h})):u.push(h),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]===":")ur(u,l.substring(2),n,r),e.push({type:"Group",capturing:!1,expression:mn(u)});else if(l[1]==="="||l[1]==="!")ur(u,l.substring(2),n,r),e.push({type:"Assertion",kind:"Lookahead",negative:l[1]==="!"?!0:void 0,assertion:mn(u)});else if(l[1]==="<"&&(l[2]==="="||l[2]==="!"))ur(u,l.substring(3),n,r),e.push({type:"Assertion",kind:"Lookbehind",negative:l[2]==="!"?!0:void 0,assertion:mn(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=++r.lastIndex,f=c[0].substring(2);r.named.set(f,d),ur(u,c.slice(1).join(">"),n,r),e.push({type:"Group",capturing:!0,nameRaw:f,name:f,number:d,expression:mn(u)})}else{let c=++r.lastIndex;ur(u,l,n,r),e.push({type:"Group",capturing:!0,number:c,expression:mn(u)})}break}default:if(s==="^")e.push({type:"Assertion",kind:s});else if(s==="$")e.push({type:"Assertion",kind:s});else if(s[0]==="\\"&&F0(s[1])){let l=Number(s.substring(1));n||l<=r.lastIndex?e.push({type:"Backreference",kind:"number",number:l,reference:l}):e.push(Qu(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:r.named.get(l)||0,referenceRaw:l,reference:l})}else e.push(Qu(s));break}}if(i!==null){i.push(mn(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 F3(e){let t=Kt([...e.flags],"u")!==-1,n=e.source,r=[];return ur(r,n,t,{lastIndex:0,named:new Map}),mn(r)}var U3=String.fromCodePoint;function j3(e){return e.binary||e.shorthand?e.canonicalValue:`${e.canonicalName}=${e.canonicalValue}`}function Lg(e,t,n,r){let i=-1;for(let o=t;o<=n;++o)if(e.test(U3(o)))i===-1&&(i=o);else if(i!==-1){let s=o-1;r.push(i===s?[s]:[i,s]),i=-1}i!==-1&&r.push(i===n?[n]:[i,n])}function V3(e,t){let n=new RegExp(`^\\${t?"P":"p"}{${e}}$`,"u"),r=[];return Lg(n,0,55295,r),Lg(n,57344,1114111,r),r}var Dg=new Map;function W3(e,t){let n=`${t?"P":"p"}:${e}`,r=Dg.get(n);if(r!==void 0)return r;let i=V3(e,t);return Dg.set(n,i),i}function z3(e){return mr(...W(W3(j3(e),e.negative),t=>sc(t)))}var G3=String.fromCodePoint,Bg=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],Fg=[..."0123456789"],Ug=[...` \r
55
55
  \v\f`],Cc=[...`\r
56
- `],L0=[...""],W3=[...Cc,...L0],Ln=()=>Ie({unit:"grapheme-ascii",minLength:1,maxLength:1});function Dg(e){return new M(`Unsupported AST node! Received: ${Ae(e)}`)}function yn(e,t,n){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return Nt(...$g);case"\\W":return Ln().filter(r=>Kt($g,r)===-1);case"\\d":return Nt(..._g);case"\\D":return Ln().filter(r=>Kt(_g,r)===-1);case"\\s":return Nt(...Lg);case"\\S":return Ln().filter(r=>Kt(Lg,r)===-1);case"\\b":case"\\B":throw new M(`Meta character ${e.value} not implemented yet!`);case".":{let r=n.dotAll?L0:W3;return Ln().filter(i=>Kt(r,i)===-1)}}if(e.symbol===void 0)throw new M(`Unexpected undefined symbol received for non-meta Char! Received: ${Ae(e)}`);return Re(e.symbol);case"Repetition":{let r=yn(e.expression,t,n);switch(e.quantifier.kind){case"*":return Ie({...t,unit:r});case"+":return Ie({...t,minLength:1,unit:r});case"?":return Ie({...t,minLength:0,maxLength:1,unit:r});case"Range":return Ie({...t,minLength:e.quantifier.from,maxLength:e.quantifier.to,unit:r});default:throw Dg(e.quantifier)}}case"Quantifier":throw new M("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return B(...W(e.expressions,r=>yn(r,t,n))).map(r=>fe(r,""));case"CharacterClass":if(e.negative){let r=W(e.expressions,i=>yn(i,t,n));return Ln().filter(i=>Yg(r,o=>!o.canShrinkWithoutContext(i)))}return Te(...W(e.expressions,r=>yn(r,t,n)));case"ClassRange":{let r=e.from.codePoint,i=e.to.codePoint;return ne({min:r,max:i}).map(o=>V3(o),o=>{if(typeof o!="string")throw new M("Invalid type");if([...o].length!==1)throw new M("Invalid length");return fr(o,0)})}case"Group":return yn(e.expression,t,n);case"Disjunction":return Te(e.left!==null?yn(e.left,t,n):Re(""),e.right!==null?yn(e.right,t,n):Re(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return n.multiline?e.kind==="^"?Te(Re(""),B(Ie({unit:Ln()}),Nt(...Cc)).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new M("Invalid type");return[be(r,0,r.length-1),r[r.length-1]]})):Te(Re(""),B(Nt(...Cc),Ie({unit:Ln()})).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new M("Invalid type");return[r[0],be(r,1)]})):Re("");throw new M(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":throw new M("Backreference nodes not implemented yet!");case"UnicodeProperty":return j3(e);default:throw Dg(e)}}function z3(e,t={}){for(let a of e.flags)if(a!=="d"&&a!=="g"&&a!=="m"&&a!=="s"&&a!=="u")throw new M(`Unable to use "stringMatching" against a regex using the flag ${a}`);let n=t.maxLength,r={size:t.size,maxLength:n},i={multiline:e.multiline,dotAll:e.dotAll},o=I3(L3(e));n!==void 0&&(o=k3(o,n));let s=yn(o,r,i);return n!==void 0?s.filter(a=>[...a].length<=n):s}function G3(e){let t=[];for(let n=0;n!==e.length;++n)t.push(e[n].next());return t}function H3(e,t){for(let n=0;n!==e.length;++n)t[n]=e[n].next()}function K3(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*q3(...e){let t=G3(e);for(;!K3(t);)yield t.map(n=>n.value),H3(e,t)}function*Y3(e){let t=e;for(;;)yield t,++t}var Z3=class extends he{constructor(e,t){super(),this.arb=e,this.maxShrinks=t}generate(e,t){let n=this.arb.generate(e,t);return this.valueMapper(n,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,n){let r=this.maxShrinks-n;return r<=0?D.nil():new D(q3(this.arb.shrink(e,t),Y3(n+1))).take(r).map(i=>this.valueMapper(i[0],i[1]))}valueMapper(e,t){let n={originalContext:e.context,length:t};return new O(e.value,n)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalContext"in e&&"length"in e}};function X3(e,t){return new Z3(e,t)}var J3=Am({Arbitrary:()=>he,ExecutionStatus:()=>fP,PreconditionFailure:()=>xn,Random:()=>Oc,Stream:()=>D,Value:()=>O,VerbosityLevel:()=>z2,__commitHash:()=>tO,__type:()=>Q3,__version:()=>eO,anything:()=>m0,array:()=>ue,assert:()=>$P,asyncDefaultReportMessage:()=>pb,asyncModelRun:()=>b3,asyncProperty:()=>V2,asyncStringify:()=>Tc,asyncToStringMethod:()=>Zt,base64String:()=>IT,bigInt:()=>wn,bigInt64Array:()=>R3,bigUint64Array:()=>A3,boolean:()=>xi,chainUntil:()=>AI,check:()=>yb,clone:()=>II,cloneIfNeeded:()=>cr,cloneMethod:()=>Oe,commands:()=>f3,compareBooleanFunc:()=>P6,compareFunc:()=>M6,configureGlobal:()=>F2,constant:()=>Re,constantFrom:()=>Nt,context:()=>bI,createDepthIdentifier:()=>_c,date:()=>Pb,defaultReportMessage:()=>hb,dictionary:()=>Bc,domain:()=>Vc,double:()=>ks,emailAddress:()=>VM,entityGraph:()=>P4,falsy:()=>yI,float:()=>qb,float32Array:()=>n0,float64Array:()=>r0,func:()=>N6,gen:()=>WP,getDepthContextFor:()=>$c,hasAsyncToStringMethod:()=>Mc,hasCloneMethod:()=>Dn,hasToStringMethod:()=>Ic,hash:()=>As,infiniteStream:()=>vT,int16Array:()=>i0,int32Array:()=>o0,int8Array:()=>s0,integer:()=>ne,ipV4:()=>Hc,ipV4Extended:()=>Jb,ipV6:()=>Qb,json:()=>ST,jsonValue:()=>y0,letrec:()=>e0,limitShrink:()=>X3,lorem:()=>L4,map:()=>bc,mapToConstant:()=>mr,maxSafeInteger:()=>Xb,maxSafeNat:()=>D6,memo:()=>U4,mixedCase:()=>H4,modelRun:()=>g3,nat:()=>gn,noBias:()=>Rs,noShrink:()=>Cs,object:()=>pT,oneof:()=>Te,option:()=>Xt,pre:()=>mk,property:()=>W2,readConfigureGlobal:()=>bt,record:()=>gc,resetConfigureGlobal:()=>U2,sample:()=>LP,scheduledModelRun:()=>S3,scheduler:()=>x3,schedulerFor:()=>v3,set:()=>f0,shuffledSubarray:()=>$T,sparseArray:()=>d0,statistics:()=>BP,stream:()=>Sn,string:()=>Ie,stringMatching:()=>z3,stringify:()=>Ae,subarray:()=>NT,toStringMethod:()=>St,tuple:()=>B,uint16Array:()=>a0,uint32Array:()=>l0,uint8Array:()=>u0,uint8ClampedArray:()=>c0,ulid:()=>VT,uniqueArray:()=>Fn,uuid:()=>YT,webAuthority:()=>w0,webFragments:()=>v0,webPath:()=>A0,webQueryParameters:()=>C0,webSegment:()=>R0,webUrl:()=>l3}),Q3="module",eO="4.8.0",tO="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",De=J3;var nO=24301;function Is(e,t){return e.reduce((n,r)=>sO(n,t[r.idx]?.paramSpaces),new Map)}function gr(e,t){return Object.fromEntries(Object.entries(e.paramSpaces).map(([n,r])=>[n,rO(r,r?.name==null?0:t.get(r.name)??0)]))}var D0=new WeakMap;function rO(e,t){if(e==null)return B0(void 0,t);let n=D0.get(e)??new Map;D0.set(e,n);let r=n.get(t);if(r!=null)return r;let i=B0(e,t);return n.set(t,i),i}function iO(e){return e?.values!=null&&e.values.length>0?De.constantFrom(...e.values):oO(e)}function B0(e,t){let[n]=De.sample(iO(e),{numRuns:1,seed:nO+t});if(n==null)throw new Error("arbitrary produced no sample");return n}function oO(e){if(e?.type==="number")return De.integer();if(e?.type==="boolean")return De.boolean();let t=e?.generator==null?void 0:lO[e.generator];if(t!=null)return t;let n=e?.constraints?.kind==="string"?e.constraints:void 0;return De.string({maxLength:n?.maxLength,minLength:n?.minLength??1}).filter(r=>r.trim().length>0&&r===r.trim())}function sO(e,t){return t==null?e:Object.values(t).reduce((n,r)=>r==null?n:new Map([...n,[r.name,(n.get(r.name)??0)+1]]),e)}var aO="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],yr=e=>De.array(De.constantFrom(...aO),{maxLength:e,minLength:1}).map(t=>t.join("")),Xc=(e,t)=>De.array(yr(10),{maxLength:t,minLength:1}).map(n=>n.join(e)),lO={"company.name":Xc(" ",3),"date.iso":uO(),"internet.email":cO(),"internet.url":dO(),"lorem.slug":Xc("-",3),"lorem.word":yr(10),"person.fullName":Xc(" ",2)};function uO(){return De.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 cO(){return De.tuple(yr(12),yr(10),De.constantFrom("com","dev","io","org","ai")).map(([e,t,n])=>`${e}@${t}.${n}`)}function dO(){return De.tuple(De.constantFrom("http","https"),yr(12),De.constantFrom("app","com","dev","io","org"),De.array(yr(8),{maxLength:3})).map(([e,t,n,r])=>{let i=r.length===0?"":`/${r.join("/")}`;return`${e}://${t}.${n}${i}`})}var fO=new Map;function Ms(e){return gr(e,fO)}import{z as Q}from"zod";var br=Q.enum(["crash","data-rule","page-rule","frame"]),F0=Q.object({intent:Q.string().min(1),test:Q.string().min(1)}),hO=Q.union([Q.object({kind:Q.literal("singleton-mismatch"),singleton:Q.string().min(1)}),Q.object({browser:Q.string().min(1),kind:Q.literal("browser-mismatch")}),Q.object({entity:Q.string().min(1),kind:Q.string().min(1)})]),pO=Q.discriminatedUnion("kind",[Q.object({kind:Q.literal("consistency"),layer:br,mismatch:hO,step:F0.nullable()}),Q.object({kind:Q.literal("pending-check"),layer:br,source:Q.string().min(1),step:F0}),Q.object({intent:Q.string().min(1),kind:Q.literal("unrunnable"),layer:br,reason:Q.string().min(1),test:Q.string().min(1)}),Q.object({error:Q.string().min(1),kind:Q.literal("driver-error"),layer:br,step:Q.string().min(1)}),Q.object({kind:Q.literal("impossible-action"),layer:br,step:Q.string().min(1)})]);import{z as Ts}from"zod";var vi=Ts.number().min(0).max(10),U0=Ts.object({branching:vi,destructiveActions:vi,maxAttemptLength:Ts.number().int().positive(),mixWorkflows:vi,mutatingActions:vi,scopedBoost:Ts.number().min(1),sharedEntity:vi}),Jc={even:{branching:3,destructiveActions:2,maxAttemptLength:12,mixWorkflows:3,mutatingActions:2,scopedBoost:8,sharedEntity:5}};function j0(e){return Jc[e]}function Qc(e,t,n){let r=t.reduce((u,c)=>u+c,0),i=t.reduce((u,c)=>[...u,(u.at(-1)??0)+c],[]),o=n()*r,s=i.findIndex(u=>o<u),a=r<=0?Math.floor(n()*e.length):s,l=e[a<0?e.length-1:a];if(l==null)throw new Error("weighted sample drew an empty set");return l}var V0=4;function Os(e){return{startingPoint:e.startingPoint.name,steps:z0(e,e.startingPoint.snapshot,[])}}function z0(e,t,n){if(n.length>=e.strategy.maxAttemptLength)return n;let r=oi(e.corpus,{snapshot:t},G0(e.corpus,n));if(r.length===0)return n;let i=mO(e,r,n);return z0(e,i.stepRun.next.snapshot,[...n,{idx:i.idx,params:i.params}])}function G0(e,t){let n=Is(t,e);return r=>gr(r,n)}function mO(e,t,n){let r=t.map(i=>yO(e,i,n));return Qc(t,r,e.random)}function yO(e,t,n){let r=e.corpus[t.idx];if(r==null)return V0;let i=e.strategy,o=gp(r.effectStep)?i.mutatingActions:0,s=mp(r.effectStep)?i.destructiveActions:0,a=gO(e.corpus,r,n),l=a?i.mixWorkflows:0,u=a&&bO(e.corpus,r,n)?i.sharedEntity:0,c=SO(e,t,n),d=n.filter(p=>p.idx===t.idx).length,f=(V0+o+s+l+u+c)/(d+1);return e.scopedTests.has(r.test)?f*i.scopedBoost:f}function gO(e,t,n){let r=new Set(n.flatMap(i=>{let o=e[i.idx];return o==null?[]:[o.test]}));return r.size>0&&!r.has(t.test)}function bO(e,t,n){let r=W0(t),i=new Set(n.flatMap(o=>{let s=e[o.idx];return s==null?[]:[...W0(s)]}));return[...r].some(o=>i.has(o))}function W0(e){return new Set([...bp(e.effectStep),...e.requiredState.entities.map(t=>t.entity)])}function SO(e,t,n){let r=1-n.length/e.strategy.maxAttemptLength;if(r<=0)return 0;let i=oi(e.corpus,{snapshot:t.stepRun.next.snapshot},G0(e.corpus,n)).length;return e.strategy.branching*r*(i/(i+1))}import{z as H}from"zod";var H0=H.object({baseStateTest:co,lockfileHash:H.string().min(1),stepRuns:H.array(H.object({idx:H.number().int().nonnegative(),params:H.record(H.string(),H.union([Lt,H.null()]))}))}),K0=H.object({baseStateRef:H.string().min(1),steps:H.array(H.object({index:H.number().int().nonnegative(),params:H.record(H.string(),H.union([Lt,H.null()])),test:H.string().min(1)}))}),q0=H.object({actions:H.array(H.string()),label:H.string().min(1)}),ed=H.object({test:H.string().min(1),text:H.string()}),wO=H.object({baseLabel:H.string(),baseState:H.string().min(1),durationMs:H.number().int().nonnegative(),signature:H.string().optional(),steps:H.array(ed)}),Y0=H.object({kind:H.enum(["aborted","clean","error","flaky","finding"]),reason:H.string().optional(),runId:H.string().optional(),trail:wO.optional()});function Ns(e,{sweep:t}){let n=Wt(Mt(e),r=>F({s:r.test.singletons,w:r.test.world})).map(r=>({name:r.ref,test:r.test}));return t?[...n,...n.flatMap(r=>xO(r))]:n}function $s(e,t,n){return nr(e,t.test,n)}function xO(e){return vO(e.test).map(t=>{let n={...t,as:`${t.as}~2`},r=`${e.name} +${t.entity}`;return{name:r,test:{...e.test,name:r,world:[...e.test.world,n]}}})}function vO(e){return e.world.filter(t=>{let n=F({...e,world:e.world.filter(r=>r!==t)});return!n.includes(`"${t.as}.`)&&!n.includes(`"ref":"${t.as}"`)})}async function _s(e){let t=$n(e);if(t.length===0)return null;let n=Ns(e,{sweep:!1}),r=await RO(e,n);return r.length===0?null:{corpus:t,startingPoints:r,startingPointTests:new Map(n.map(i=>[i.name,i.test]))}}function Z0({lockfileHash:e,prepared:t,random:n,scopedTests:r,strategy:i}){let o=t.startingPoints[Math.floor(n()*t.startingPoints.length)];if(o==null)return null;let s=Os({corpus:t.corpus,random:n,scopedTests:r,startingPoint:o,strategy:i}),a=t.startingPointTests.get(s.startingPoint);return a==null||s.steps.length===0?null:{baseStateTest:a,lockfileHash:e,stepRuns:s.steps.map(l=>({idx:l.idx,params:l.params}))}}async function RO(e,t){let n={generate:li,materialize:Po(li,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await $s(e,i,n)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}import{ResultAsync as td}from"neverthrow";var vn=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}};function Ls(e){return{read:t=>_O(t,e),seedScript:t=>`globalThis[${JSON.stringify(bl)}] = ${JSON.stringify(t)};`}}async function _O(e,t){let n={...Ut(e.url()),title:await e.title(),viewport:BO(e.viewportSize())};if(t.length===0)return{browser:n,singletons:{}};let r=await e.evaluate(DO,{mountKey:Cn,names:t,timeoutMs:LO});if(r.kind==="unmounted")throw new vn(Cn);return{browser:n,singletons:r.values}}var LO=5e3;async function DO(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(r=>setTimeout(r,25));let n=Reflect.get(globalThis,e.mountKey);return n==null?{kind:"unmounted"}:{kind:"values",values:Object.fromEntries(e.names.map(r=>[r,n.readSingleton(r)??null]))}}function BO(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}var FO={backoffMs:[500,1e3,2e3,4e3,8e3],budgetMs:3e4,mountPollMs:2e3};function nd(e,t,n,r,i=FO){return{evaluate:o=>td.fromPromise(Q0(UO(e,n,o),`check ${o.kind}`),X0),locateIds:o=>XO(e,o),observe:()=>t.read().andThen(o=>td.fromPromise(Q0(eS(e,n,0),"observe"),X0).map(s=>({snapshot:{...o,browser:{...o.browser,...s.browser},singletons:{...o.singletons,...s.singletons}}}))),perform:o=>td.fromPromise(nS(e,o,0,r,i),s=>s instanceof vn?bo(s.mountKey):Hl(o.kind,s))}}async function UO(e,t,n){try{return await lS(e,t,n)}catch(r){if(tS(r))return!1;throw r}}function X0(e){return e instanceof vn?bo(e.mountKey):Kl(e)}var jO=[100,250,500];async function eS(e,t,n){try{return await t.read(e)}catch(r){let i=jO[n],o=tS(r)||r instanceof vn;if(i==null||!o)throw r;return await aS(i),eS(e,t,n+1)}}function tS(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 J0=35e3;function Q0(e,t){let n,r=new Promise((i,o)=>{n=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(J0)}ms`))},J0)});return Promise.race([e,r]).finally(()=>{clearTimeout(n)})}var VO=[250,750,2e3];async function nS(e,t,n,r,i){try{await qO(e,t,r,i)}catch(o){let s=VO[n];if(s==null||!sS(o))throw o;await aS(s),await nS(e,t,n+1,r,i)}}async function rS({page:e,readiness:t,signal:n,startMs:r,tries:i,url:o}){if(ot(n),await WO(e,o,n,t))return;if(Date.now()-r>=t.budgetMs)throw new vn(Cn);let s=t.backoffMs[Math.min(i,t.backoffMs.length-1)]??8e3;await er(s,n),await rS({page:e,readiness:t,signal:n,startMs:r,tries:i+1,url:o})}async function WO(e,t,n,r){let i=await zO(e,t);return i==="net-error"||i!=null&&i.status()>=400?!1:GO(e,n,r.mountPollMs)}async function zO(e,t){try{return await e.goto(t,{waitUntil:"domcontentloaded"})}catch(n){if(sS(n))return"net-error";throw n}}function GO(e,t,n){return Promise.race([e.evaluate(HO,{mountKey:Cn,timeoutMs:n}),KO(t)])}async function HO(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(n=>setTimeout(n,25));return Reflect.get(globalThis,e.mountKey)!=null}function KO(e){return new Promise((t,n)=>{ot(e),e.addEventListener("abort",()=>{n(new dn)},{once:!0})})}async function qO(e,t,n,r){if(t.kind==="goto"){await rS({page:e,readiness:r,signal:n,startMs:Date.now(),tries:0,url:Sr(t.url,t,"url")});return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(Sr(t.key,t,"key"));return}let i=t.kind!=="upload";await YO(e,iS(e,t.locator,{visibleOnly:i}),t)}function Sr(e,t,n){if(e==null)throw new Error(`action "${t.kind}" requires ${n}`);return e}function YO(e,t,n){switch(n.kind){case"goto":throw new Error("goto must not be located");case"fill":return t.fill(String(Sr(n.value,n,"value")));case"clear":return t.clear();case"click":return t.click();case"dblclick":return t.dblclick();case"check":return t.check();case"uncheck":return t.uncheck();case"hover":return t.hover();case"select":return ZO(e,t,String(Sr(n.value,n,"value")));case"upload":return t.setInputFiles(Sr(n.files,n,"files"));case"press":return t.press(Sr(n.key,n,"key"))}}async function ZO(e,t,n){if(await t.evaluate(i=>i.tagName==="SELECT")){await t.selectOption(n);return}await t.click(),await t.fill(n),await e.locator(oS("option",n)).filter({visible:!0}).click()}async function XO(e,t){if(t==null)return[];try{let n=Ds(e,t,{visibleOnly:!1});if(await n.count()===0)return[];let r=await n.first().evaluate(JO);return r>0?[r]:[]}catch{return[]}}function JO(e){return globalThis.__ripploRrwebMirror?.getId(e)??-1}function iS(e,t,n){if(t==null)throw new Error("action requires a locator");return Ds(e,t,n)}function Ds(e,t,n){if(t.by==="inside"){let i=Ds(e,t.scope,n);return Ds(i,t.target,n)}let r=t.by==="testId"?e.getByTestId(t.value):e.locator(oS(t.role,t.name));return n.visibleOnly?r.filter({visible:!0}):r}function oS(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function sS(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 aS(e){return new Promise(t=>{setTimeout(t,e)})}async function lS(e,t,n){if(n.kind==="browser")return e8(e,t,n.key,n.value);if(n.kind==="not")return!await lS(e,t,n.inner);let r=iS(e,n.locator,{visibleOnly:!0});return n.kind==="value"?await r.inputValue()===n.value:n.kind==="text"?(await r.textContent()??"").includes(n.value):QO(r,n.kind)}function QO(e,t){return t==="visible"?e.isVisible():t==="disabled"?e.isDisabled():t==="enabled"?e.isEnabled():t==="checked"?e.isChecked():e.evaluate(n=>n===n.ownerDocument.activeElement)}async function e8(e,t,n,r){let i=await t.read(e),o=Qn(i.browser,n);return r===null?o===void 0:o===r}import t8 from"path";var cS={height:720,width:1280};async function Bs({baseUrl:e,browser:t,capture:n,clientState:r,engine:i,extraHeaders:o,fixturesDir:s,reader:a,session:l,signal:u,viewport:c}){let d=await t.newContext({baseURL:e,reducedMotion:"reduce",storageState:l==null?void 0:{cookies:n8(l.cookies,e),origins:l.origins},viewport:c}),f=r8(o,l?.headers);f!=null&&await d.setExtraHTTPHeaders(f),await d.addInitScript(i.seedScript(r));let p=n==null?i8():await n.hub.attach(d,n.runId),h=await d.newPage();return p.onPage(h),{context:d,driver:a8(o8(nd(h,a,i,u),s),p),emitAssertion:p.emitAssertion,emitFinding:p.emitFinding,close:()=>l8({context:d,handle:p})}}async function rd(e,t){let n=await fS(e);try{return await t(n)}finally{await n.close()}}async function dS(e){let{chromium:t}=await import("playwright");return t.launchPersistentContext(e,{headless:!1,viewport:null})}function n8(e,t){let n=new URL(t).hostname;return e.map(r=>({...r,domain:n}))}function r8(e,t){return e==null?t:t==null?e:{...e,...t}}function i8(){return{emitAction:()=>{},emitAssertion:()=>{},emitFinding:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function fS(e){let{chromium:t}=await import("playwright");return t.launch({headless:!e})}function Fs({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??=fS(e),t},close:async()=>{let i=t;t=void 0,i!=null&&await i.then(o=>o.close()).catch(()=>{})}}}function o8(e,t){return{evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>e.perform(s8(n,t))}}function s8(e,t){return e.kind!=="upload"||e.files==null?e:{...e,files:e.files.map(n=>t8.join(t,n))}}function a8(e,t){return{evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>(t.emitAction(n),e.perform(n))}}async function l8({context:e,handle:t}){await uS(t.finish()),await uS(e.close())}var u8=15e3;async function uS(e){let t,n=new Promise(r=>{t=setTimeout(r,u8)});await Promise.race([e.catch(()=>{}),n]).finally(()=>{clearTimeout(t)})}import{err as c8,ok as d8,Result as id}from"neverthrow";function od(e,t,n){return{read:()=>n.read(e.map(r=>r.name),t).andThen(r=>f8(e,r))}}function f8(e,t){return id.combine(e.map(n=>h8(n,t.entities[n.name]??[]).map(r=>[n.name,r]))).map(n=>({browser:In,entities:new Map(n),singletons:t.singletons}))}function h8(e,t){let n=ei(e);return id.combine(t.map(r=>p8(r,e).map(i=>[i,m8(r,n)]))).map(r=>new Map(r))}function p8(e,t){return id.combine(t.identity.map(n=>{let r=e[n];return r==null?c8(zl(t.name,n)):d8(String(r))})).map(n=>n.join(":"))}function m8(e,t){let n=t.map(r=>[r,e[r]]).filter(r=>r[1]!=null);return Object.fromEntries(n)}var hS=tl(bv(),1);import y8 from"crypto";import{err as g8,errAsync as sd,ok as b8,ResultAsync as wr}from"neverthrow";var S8=3e4,w8=[250,750,2e3],x8=[500,1e3,2e3,3e3];function ad({baseUrl:e,extraHeaders:t,runId:n,secret:r},i){let o=new hS.Webhook(r),s=(a,l,u)=>v8({baseUrl:e,body:l,extraHeaders:t,path:a,retry:u.retry,schema:u.schema,signal:u.signal,webhook:o});return{query:{read:(a,l)=>s("/state",{entities:a,runId:n,singletons:l},{retry:"transient",schema:Dl,signal:i}).map(u=>({entities:u.entities,singletons:u.singletons}))},ready:()=>mS(e,t,i,0),setupWorld:a=>s("/setup",{entities:a,runId:n},{retry:"connection",schema:Ll,signal:i}).map(l=>l.rows),teardown:()=>s("/teardown",{runId:n},{retry:"connection",schema:Bl,signal:void 0}).map(()=>{})}}function v8(e){return pS(e.retry,()=>E8(e),0)}function pS(e,t,n){return t().orElse(r=>{let i=w8[n];return i==null||!A8(r,e)?sd(r):wr.fromSafePromise(yS(i)).andThen(()=>pS(e,t,n+1))})}function mS(e,t,n,r){return wr.fromPromise(fetch(e,{headers:t,method:"HEAD",signal:gS(n)}),i=>Xn("",i)).map(()=>{}).orElse(()=>{let i=x8[r];return i==null||n.aborted?sd(Gl(e)):wr.fromSafePromise(yS(i)).andThen(()=>mS(e,t,n,r+1))})}var R8=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function A8(e,t){return e.kind==="aborted"?!1:C8(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function C8(e){return e.kind==="engine-network"&&e.code!=null&&R8.has(e.code)}function yS(e){return new Promise(t=>{setTimeout(t,e)})}function E8({baseUrl:e,body:t,extraHeaders:n,path:r,schema:i,signal:o,webhook:s}){let a=JSON.stringify(t);return wr.fromPromise(fetch(`${e}${r}`,{body:a,headers:{...n,"Content-Type":"application/json",...k8(s,a)},method:"PUT",signal:gS(o)}),l=>Xn(r,l)).andThen(l=>P8(l,r)).andThen(l=>I8(i,l,r)).mapErr(l=>o?.aborted===!0?ql():l)}function k8(e,t){let n=`msg_${y8.randomUUID()}`,r=new Date;return{"webhook-id":n,"webhook-signature":e.sign(n,r,t),"webhook-timestamp":String(Math.floor(r.getTime()/1e3))}}function gS(e){let t=AbortSignal.timeout(S8);return e==null?t:AbortSignal.any([e,t])}function P8(e,t){return e.ok?wr.fromPromise(e.json(),n=>Xn(t,n)):wr.fromPromise(e.text().catch(()=>""),n=>Xn(t,n)).andThen(n=>sd(Vl(t,e.status,n)))}function I8(e,t,n){let r=e.safeParse(t);return r.success?b8(r.data):g8(Wl(n,r.error))}import Xf from"path";import{err as Lr,ok as to,ResultAsync as Jf}from"neverthrow";import{existsSync as xN}from"fs";import{writeFile as vN}from"fs/promises";import RN from"path";import{err as Ys,ok as AN}from"neverthrow";import{createRequire as M8}from"module";var T8=M8("/"),vr,O8,N8;try{vr=T8("worker_threads"),O8=vr.Worker,N8=vr.isMarkedAsUntransferable}catch{}var Ve=Uint8Array,xr=Uint16Array,$8=Int32Array,bS=new Ve([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),SS=new Ve([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),_8=new Ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wS=function(e,t){for(var n=new xr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new $8(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},vr=wS(bS,2),xS=vr.b,L8=vr.r;xS[28]=258,L8[258]=28;var vS=wS(SS,0),D8=vS.b,Sz=vS.r,dd=new xr(32768);for(te=0;te<32768;++te)Qt=(te&43690)>>1|(te&21845)<<1,Qt=(Qt&52428)>>2|(Qt&13107)<<2,Qt=(Qt&61680)>>4|(Qt&3855)<<4,dd[te]=((Qt&65280)>>8|(Qt&255)<<8)>>1;var Qt,te,Ri=(function(e,t,n){for(var r=e.length,i=0,o=new xr(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new xr(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new xr(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],d=s[e[i]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)a[dd[d]>>l]=u}else for(a=new xr(r),i=0;i<r;++i)e[i]&&(a[i]=dd[s[e[i]-1]++]>>15-e[i]);return a}),Ai=new Ve(288);for(te=0;te<144;++te)Ai[te]=8;var te;for(te=144;te<256;++te)Ai[te]=9;var te;for(te=256;te<280;++te)Ai[te]=7;var te;for(te=280;te<288;++te)Ai[te]=8;var te,RS=new Ve(32);for(te=0;te<32;++te)RS[te]=5;var te;var B8=Ri(Ai,9,1);var F8=Ri(RS,5,1),ld=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},wt=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},ud=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},U8=function(e){return(e+7)/8|0},Us=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new Ve(e.subarray(t,n))};var j8=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],qe=function(e,t,n){var r=new Error(t||j8[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,qe),!n)throw r;return r},AS=function(e,t,n,r){var i=e.length,o=r?r.length:0;if(!i||t.f&&!t.l)return n||new Ve(0);var s=!n,a=s||t.i!=2,l=t.i;s&&(n=new Ve(i*3));var u=function(X){var He=n.length;if(X>He){var me=new Ve(Math.max(He*2,X));me.set(n),n=me}},c=t.f||0,d=t.p||0,f=t.b||0,p=t.l,h=t.d,m=t.m,y=t.n,S=i*8;do{if(!p){c=wt(e,d,1);var w=wt(e,d+1,3);if(d+=3,w)if(w==1)p=B8,h=F8,m=9,y=5;else if(w==2){var N=wt(e,d,31)+257,$=wt(e,d+10,15)+4,_=N+wt(e,d+5,31)+1;d+=14;for(var I=new Ve(_),j=new Ve(19),V=0;V<$;++V)j[_8[V]]=wt(e,d+V*3,7);d+=$*3;for(var se=ld(j),L=(1<<se)-1,$e=Ri(j,se,1),V=0;V<_;){var Ze=$e[wt(e,d,L)];d+=Ze&15;var g=Ze>>4;if(g<16)I[V++]=g;else{var ce=0,Le=0;for(g==16?(Le=3+wt(e,d,3),d+=2,ce=I[V-1]):g==17?(Le=3+wt(e,d,7),d+=3):g==18&&(Le=11+wt(e,d,127),d+=7);Le--;)I[V++]=ce}}var Ct=I.subarray(0,N),Me=I.subarray(N);m=ld(Ct),y=ld(Me),p=Ri(Ct,m,1),h=Ri(Me,y,1)}else qe(1);else{var g=U8(d)+4,x=e[g-4]|e[g-3]<<8,P=g+x;if(P>i){l&&qe(0);break}a&&u(f+x),n.set(e.subarray(g,P),f),t.b=f+=x,t.p=d=P*8,t.f=c;continue}if(d>S){l&&qe(0);break}}a&&u(f+131072);for(var ro=(1<<m)-1,Br=(1<<y)-1,Hn=d;;Hn=d){var ce=p[ud(e,d)&ro],ut=ce>>4;if(d+=ce&15,d>S){l&&qe(0);break}if(ce||qe(2),ut<256)n[f++]=ut;else if(ut==256){Hn=d,p=null;break}else{var Fr=ut-254;if(ut>264){var V=ut-257,sn=bS[V];Fr=wt(e,d,(1<<sn)-1)+xS[V],d+=sn}var Ur=h[ud(e,d)&Br],ct=Ur>>4;Ur||qe(3),d+=Ur&15;var Me=D8[ct];if(ct>3){var sn=SS[ct];Me+=ud(e,d)&(1<<sn)-1,d+=sn}if(d>S){l&&qe(0);break}a&&u(f+131072);var Et=f+Fr;if(f<Me){var Kn=o-Me,qn=Math.min(Me,Et);for(Kn+f<0&&qe(3);f<qn;++f)n[f]=r[Kn+f]}for(;f<Et;++f)n[f]=n[f-Me]}}t.l=p,t.p=Hn,t.b=f,t.f=c,p&&(c=1,t.m=m,t.d=h,t.n=y)}while(!c);return f!=n.length&&s?Us(n,0,f):n.subarray(0,f)};var V8=new Ve(0);var CS=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&qe(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&qe(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};var cd=(function(){function e(t,n){typeof t=="function"&&(n=t,t={}),this.ondata=n;var r=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:r?r.length:0},this.o=new Ve(32768),this.p=new Ve(0),r&&this.o.set(r)}return e.prototype.e=function(t){if(this.ondata||qe(5),this.d&&qe(4),!this.p.length)this.p=t;else if(t.length){var n=new Ve(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length),this.p=n}},e.prototype.c=function(t){this.s.i=+(this.d=t||!1);var n=this.s.b,r=AS(this.p,this.s,this.o);this.ondata(Us(r,n,this.s.b),this.d),this.o=Us(r,this.s.b-32768),this.s.b=this.o.length,this.p=Us(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(t,n){this.e(t),this.c(n)},e})();var fd=(function(){function e(t,n){cd.call(this,t,n),this.v=t&&t.dictionary?2:1}return e.prototype.push=function(t,n){if(cd.prototype.e.call(this,t),this.v){if(this.p.length<6&&!n)return;this.p=this.p.subarray(CS(this.p,this.v-1)),this.v=0}n&&(this.p.length<4&&qe(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),cd.prototype.c.call(this,n)},e})();function ES(e,t){return AS(e.subarray(CS(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}var W8=typeof TextDecoder<"u"&&new TextDecoder,z8=0;try{W8.decode(V8,{stream:!0}),z8=1}catch{}function hd(e,t="utf8"){return new TextDecoder(t).decode(e)}var G8=new TextEncoder;function kS(e){return G8.encode(e)}var H8=1024*8,K8=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),pd={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},Ci=class e{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=H8,n={}){let r=!1;typeof t=="number"?t=new ArrayBuffer(t):(r=!0,this.lastWrittenByte=t.byteLength);let i=n.offset?n.offset>>>0:0,o=t.byteLength-i,s=i;(ArrayBuffer.isView(t)||t instanceof e)&&(t.byteLength!==t.buffer.byteLength&&(s=t.byteOffset+i),t=t.buffer),r?this.lastWrittenByte=o:this.lastWrittenByte=0,this.buffer=t,this.length=o,this.byteLength=o,this.byteOffset=s,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,s,o),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){let t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){let r=(this.offset+t)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,n){let r=pd[n].BYTES_PER_ELEMENT*t,i=this.byteOffset+this.offset,o=this.buffer.slice(i,i+r);if(this.littleEndian===K8&&n!=="uint8"&&n!=="int8"){let a=new Uint8Array(this.buffer.slice(i,i+r));a.reverse();let l=new pd[n](a.buffer);return this.offset+=r,l.reverse(),l}let s=new pd[n](o);return this.offset+=r,s}readInt16(){let t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){let t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){let t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){let t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){let t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){let t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){let t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){let t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let n="";for(let r=0;r<t;r++)n+=this.readChar();return n}readUtf8(t=1){return hd(this.readBytes(t))}decodeText(t=1,n="utf8"){return hd(this.readBytes(t),n)}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let n=0;n<t.length;n++)this._data.setUint8(this.offset++,t[n]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let n=0;n<t.length;n++)this.writeUint8(t.charCodeAt(n));return this}writeUtf8(t){return this.writeBytes(kS(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}};var IS=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;IS[e]=t}var PS=4294967295;function q8(e,t,n){let r=e;for(let i=0;i<n;i++)r=IS[(r^t[i])&255]^r>>>8;return r}function Y8(e,t){return(q8(PS,e,t)^PS)>>>0}function md(e,t,n){let r=e.readUint32(),i=Y8(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(i!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${i}`)}function js(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function Vs(e,t,n,r){let i=0;for(;i<r;i++)t[i]=e[i];for(;i<n;i++)t[i]=e[i]+t[i-r]&255}function Ws(e,t,n,r){let i=0;if(n.length===0)for(;i<r;i++)t[i]=e[i];else for(;i<r;i++)t[i]=e[i]+n[i]&255}function zs(e,t,n,r,i){let o=0;if(n.length===0){for(;o<i;o++)t[o]=e[o];for(;o<r;o++)t[o]=e[o]+(t[o-i]>>1)&255}else{for(;o<i;o++)t[o]=e[o]+(n[o]>>1)&255;for(;o<r;o++)t[o]=e[o]+(t[o-i]+n[o]>>1)&255}}function Gs(e,t,n,r,i){let o=0;if(n.length===0){for(;o<i;o++)t[o]=e[o];for(;o<r;o++)t[o]=e[o]+t[o-i]&255}else{for(;o<i;o++)t[o]=e[o]+n[o]&255;for(;o<r;o++)t[o]=e[o]+Z8(t[o-i],n[o],n[o-i])&255}}function Z8(e,t,n){let r=e+t-n,i=Math.abs(r-e),o=Math.abs(r-t),s=Math.abs(r-n);return i<=o&&i<=s?e:o<=s?t:n}function MS(e,t,n,r,i,o){switch(e){case 0:js(t,n,i);break;case 1:Vs(t,n,i,o);break;case 2:Ws(t,n,r,i);break;case 3:zs(t,n,r,i,o);break;case 4:Gs(t,n,r,i,o);break;default:throw new Error(`Unsupported filter: ${e}`)}}var X8=new Uint16Array([255]),J8=new Uint8Array(X8.buffer),Q8=J8[0]===255;function TS(e){let{data:t,width:n,height:r,channels:i,depth:o}=e,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],a=Math.ceil(o/8)*i,l=new Uint8Array(r*n*a),u=0;for(let c=0;c<7;c++){let d=s[c],f=Math.ceil((n-d.x)/d.xStep),p=Math.ceil((r-d.y)/d.yStep);if(f<=0||p<=0)continue;let h=f*a,m=new Uint8Array(h);for(let y=0;y<p;y++){let S=t[u++],w=t.subarray(u,u+h);u+=h;let g=new Uint8Array(h);MS(S,w,g,m,h,a),m.set(g);for(let x=0;x<f;x++){let P=d.x+x*d.xStep,N=d.y+y*d.yStep;if(!(P>=n||N>=r))for(let $=0;$<a;$++)l[(N*n+P)*a+$]=g[x*a+$]}}}if(o===16){let c=new Uint16Array(l.buffer);if(Q8)for(let d=0;d<c.length;d++)c[d]=eN(c[d]);return c}else return l}function eN(e){return(e&255)<<8|e>>8&255}var tN=new Uint16Array([255]),nN=new Uint8Array(tN.buffer),rN=nN[0]===255,iN=new Uint8Array(0);function yd(e){let{data:t,width:n,height:r,channels:i,depth:o}=e,s=Math.ceil(o/8)*i,a=Math.ceil(o/8*i*n),l=new Uint8Array(r*a),u=iN,c=0,d,f;for(let p=0;p<r;p++){switch(d=t.subarray(c+1,c+1+a),f=l.subarray(p*a,(p+1)*a),t[c]){case 0:js(d,f,a);break;case 1:Vs(d,f,a,s);break;case 2:Ws(d,f,u,a);break;case 3:zs(d,f,u,a,s);break;case 4:Gs(d,f,u,a,s);break;default:throw new Error(`Unsupported filter: ${t[c]}`)}u=f,c+=a+1}if(o===16){let p=new Uint16Array(l.buffer);if(rN)for(let h=0;h<p.length;h++)p[h]=oN(p[h]);return p}else return l}function oN(e){return(e&255)<<8|e>>8&255}var Hs=Uint8Array.of(137,80,78,71,13,10,26,10);function gd(e){if(!OS(e.readBytes(Hs.length)))throw new Error("wrong PNG signature")}function OS(e){if(e.length<Hs.length)return!1;for(let t=0;t<Hs.length;t++)if(e[t]!==Hs[t])return!1;return!0}var NS="tEXt",aN=0,$S=new TextDecoder("latin1");function lN(e){if(cN(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}var uN=/^[\u0000-\u00FF]*$/;function cN(e){if(!uN.test(e))throw new Error("invalid latin1 text")}function _S(e,t,n){let r=bd(t);e[r]=dN(t,n-r.length-1)}function bd(e){for(e.mark();e.readByte()!==aN;);let t=e.offset;e.reset();let n=$S.decode(e.readBytes(t-e.offset-1));return e.skip(1),lN(n),n}function dN(e,t){return $S.decode(e.readBytes(t))}var We={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Ei={UNKNOWN:-1,DEFLATE:0},Ks={UNKNOWN:-1,ADAPTIVE:0},ki={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},Pi={NONE:0,BACKGROUND:1,PREVIOUS:2},qs={SOURCE:0,OVER:1};var Ii=class extends Ci{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;_chunks;_inflatorResult;constructor(t,n={}){super(t);let{checkCrc:r=!1}=n;this._checkCrc=r,this._inflator=new fd((i,o)=>{if(this._chunks.push(i),o){let s=this._chunks.reduce((l,u)=>l+u.length,0);this._inflatorResult=new Uint8Array(s);let a=0;for(let l of this._chunks)this._inflatorResult.set(l,a),a+=l.length;this._chunks=[]}}),this._chunks=[],this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=Ei.UNKNOWN,this._filterMethod=Ks.UNKNOWN,this._interlaceMethod=ki.UNKNOWN,this._colorType=We.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this._inflatorResult=new Uint8Array(0),this.setBigEndian()}decode(){for(gd(this);!this._end;){let t=this.readUint32(),n=this.readChars(4);this.decodeChunk(t,n)}return this._inflator.push(new Uint8Array(0),!0),this.decodeImage(),this._png}decodeApng(){for(gd(this);!this._end;){let t=this.readUint32(),n=this.readChars(4);this.decodeApngChunk(t,n)}return this.decodeApngImage(),this._apng}decodeChunk(t,n){let r=this.offset;switch(n){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case NS:_S(this._png.text,this,t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t);break}if(this.offset-r!==t)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?md(this,t+4,n):this.skip(4)}decodeApngChunk(t,n){let r=this.offset;switch(n!=="fdAT"&&n!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),n){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,n),this.offset=r+t;break}if(this.offset-r!==t)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?md(this,t+4,n):this.skip(4)}decodeIHDR(){let t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=fN(this.readUint8());let n=this.readUint8();this._colorType=n;let r;switch(n){case We.GREYSCALE:r=1;break;case We.TRUECOLOUR:r=3;break;case We.INDEXED_COLOUR:r=1;break;case We.GREYSCALE_ALPHA:r=2;break;case We.TRUECOLOUR_ALPHA:r=4;break;case We.UNKNOWN:default:throw new Error(`Unknown color type: ${n}`)}if(this._png.channels=r,this._compressionMethod=this.readUint8(),this._compressionMethod!==Ei.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){let t={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(t)}decodePLTE(t){if(t%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);let n=t/3;this._hasPalette=!0;let r=[];this._palette=r;for(let i=0;i<n;i++)r.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._writingDataChunks=!0;let n=t,r=this.offset+this.byteOffset;try{this._inflator.push(new Uint8Array(this.buffer,r,n),!1)}catch(i){throw new Error("Error while decompressing the data:",{cause:i})}this.skip(t)}decodeFDAT(t){this._writingDataChunks=!0;let n=t,r=this.offset+this.byteOffset;r+=4,n-=4;try{this._inflator.push(new Uint8Array(this.buffer,r,n),!1)}catch(i){throw new Error("Error while decompressing the data:",{cause:i})}this.skip(t)}decodetRNS(t){switch(this._colorType){case We.GREYSCALE:case We.TRUECOLOUR:{if(t%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);if(t/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let n=0;n<t/2;n++)this._transparency[n]=this.readUint16();break}case We.INDEXED_COLOUR:{if(t>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let n=0;for(;n<t;n++){let r=this.readByte();this._palette[n].push(r)}for(;n<this._palette.length;n++)this._palette[n].push(255);break}case We.UNKNOWN:case We.GREYSCALE_ALPHA:case We.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(t){let n=bd(this),r=this.readUint8();if(r!==Ei.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${r}`);let i=this.readBytes(t-n.length-2);this._png.iccEmbeddedProfile={name:n,profile:ES(i)}}decodepHYs(){let t=this.readUint32(),n=this.readUint32(),r=this.readByte();this._png.resolution={x:t,y:n,unit:r}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let t=0;t<this._numberOfFrames;t++){let n={sequenceNumber:this._frames[t].sequenceNumber,delayNumber:this._frames[t].delayNumber,delayDenominator:this._frames[t].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},r=this._frames.at(t);if(r){if(r.data=yd({data:r.data,width:r.width,height:r.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),t===0||r.xOffset===0&&r.yOffset===0&&r.width===this._png.width&&r.height===this._png.height)n.data=r.data;else{let i=this._apng.frames.at(t-1);this.disposeFrame(r,i,n),this.addFrameDataToCanvas(n,r)}this._apng.frames.push(n)}}return this._apng}disposeFrame(t,n,r){switch(t.disposeOp){case Pi.NONE:break;case Pi.BACKGROUND:for(let i=0;i<this._png.height;i++)for(let o=0;o<this._png.width;o++){let s=(i*t.width+o)*this._png.channels;for(let a=0;a<this._png.channels;a++)r.data[s+a]=0}break;case Pi.PREVIOUS:r.data.set(n.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(t,n){let r=1<<this._png.depth,i=(o,s)=>{let a=((o+n.yOffset)*this._png.width+n.xOffset+s)*this._png.channels,l=(o*n.width+s)*this._png.channels;return{index:a,frameIndex:l}};switch(n.blendOp){case qs.SOURCE:for(let o=0;o<n.height;o++)for(let s=0;s<n.width;s++){let{index:a,frameIndex:l}=i(o,s);for(let u=0;u<this._png.channels;u++)t.data[a+u]=n.data[l+u]}break;case qs.OVER:for(let o=0;o<n.height;o++)for(let s=0;s<n.width;s++){let{index:a,frameIndex:l}=i(o,s);for(let u=0;u<this._png.channels;u++){let c=n.data[l+this._png.channels-1]/r,d=u%(this._png.channels-1)===0?1:n.data[l+u],f=Math.floor(c*d+(1-c)*t.data[a+u]);t.data[a+u]+=f}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){let t=this._inflatorResult;if(this._filterMethod!==Ks.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===ki.NO_INTERLACE)this._png.data=yd({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===ki.ADAM7)this._png.data=TS({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){this._inflator.push(new Uint8Array(0),!0);let t=this._inflatorResult,n=this._frames.at(-1);n?n.data=t:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:Pi.NONE,blendOp:qs.SOURCE,data:t}),this._inflator=new fd((r,i)=>{if(this._chunks.push(r),i){let o=this._chunks.reduce((a,l)=>a+l.length,0);this._inflatorResult=new Uint8Array(o);let s=0;for(let a of this._chunks)this._inflatorResult.set(a,s),s+=a.length;this._chunks=[]}}),this._chunks=[],this._writingDataChunks=!1}};function fN(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}function LS(e,t){return new Ii(e,t).decode()}import{createRequire as hN}from"module";import{readFile as Sd}from"fs/promises";import{fileURLToPath as pN}from"url";import{z as Mi}from"zod";var mN={height:800,width:1280};async function BS(e){let t=await Sd(e,"utf8");return US(t).flatMap(n=>n.kind==="rrweb"?[n.event]:[])}async function FS(e){let t=await Sd(e,"utf8");return US(t).flatMap(n=>n.kind==="action"?[pl(n.timeNanos)]:[])}function US(e){return e.split(`
57
- `).filter(t=>t.length>0).flatMap(t=>{let n=hl(t);return n==null?[]:[n]})}var yN=Mi.object({data:Mi.looseObject({height:Mi.number(),width:Mi.number()}),type:Mi.literal(4)});function jS(e){let t=e.flatMap(n=>{let r=yN.safeParse(n);return r.success?[r.data]:[]})[0];return t==null?mN:{height:t.data.height,width:t.data.width}}var gN='<svg xmlns="http://www.w3.org/2000/svg" width="17" height="22" viewBox="0 0 17 22"><path d="M1 1 L1 17 L5.4 12.8 L8.5 20 L11 19 L8 11.8 L14 11.8 Z" fill="black" stroke="white" stroke-width="1.3"/></svg>',bN=`.replayer-mouse-tail { display: none; }
56
+ `],U0=[...""],H3=[...Cc,...U0],Ln=()=>Ie({unit:"grapheme-ascii",minLength:1,maxLength:1});function jg(e){return new M(`Unsupported AST node! Received: ${Ae(e)}`)}function yn(e,t,n){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return Nt(...Bg);case"\\W":return Ln().filter(r=>Kt(Bg,r)===-1);case"\\d":return Nt(...Fg);case"\\D":return Ln().filter(r=>Kt(Fg,r)===-1);case"\\s":return Nt(...Ug);case"\\S":return Ln().filter(r=>Kt(Ug,r)===-1);case"\\b":case"\\B":throw new M(`Meta character ${e.value} not implemented yet!`);case".":{let r=n.dotAll?U0:H3;return Ln().filter(i=>Kt(r,i)===-1)}}if(e.symbol===void 0)throw new M(`Unexpected undefined symbol received for non-meta Char! Received: ${Ae(e)}`);return Re(e.symbol);case"Repetition":{let r=yn(e.expression,t,n);switch(e.quantifier.kind){case"*":return Ie({...t,unit:r});case"+":return Ie({...t,minLength:1,unit:r});case"?":return Ie({...t,minLength:0,maxLength:1,unit:r});case"Range":return Ie({...t,minLength:e.quantifier.from,maxLength:e.quantifier.to,unit:r});default:throw jg(e.quantifier)}}case"Quantifier":throw new M("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return B(...W(e.expressions,r=>yn(r,t,n))).map(r=>fe(r,""));case"CharacterClass":if(e.negative){let r=W(e.expressions,i=>yn(i,t,n));return Ln().filter(i=>Qg(r,o=>!o.canShrinkWithoutContext(i)))}return Te(...W(e.expressions,r=>yn(r,t,n)));case"ClassRange":{let r=e.from.codePoint,i=e.to.codePoint;return ne({min:r,max:i}).map(o=>G3(o),o=>{if(typeof o!="string")throw new M("Invalid type");if([...o].length!==1)throw new M("Invalid length");return fr(o,0)})}case"Group":return yn(e.expression,t,n);case"Disjunction":return Te(e.left!==null?yn(e.left,t,n):Re(""),e.right!==null?yn(e.right,t,n):Re(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return n.multiline?e.kind==="^"?Te(Re(""),B(Ie({unit:Ln()}),Nt(...Cc)).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new M("Invalid type");return[be(r,0,r.length-1),r[r.length-1]]})):Te(Re(""),B(Nt(...Cc),Ie({unit:Ln()})).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new M("Invalid type");return[r[0],be(r,1)]})):Re("");throw new M(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":throw new M("Backreference nodes not implemented yet!");case"UnicodeProperty":return z3(e);default:throw jg(e)}}function K3(e,t={}){for(let a of e.flags)if(a!=="d"&&a!=="g"&&a!=="m"&&a!=="s"&&a!=="u")throw new M(`Unable to use "stringMatching" against a regex using the flag ${a}`);let n=t.maxLength,r={size:t.size,maxLength:n},i={multiline:e.multiline,dotAll:e.dotAll},o=O3(F3(e));n!==void 0&&(o=M3(o,n));let s=yn(o,r,i);return n!==void 0?s.filter(a=>[...a].length<=n):s}function q3(e){let t=[];for(let n=0;n!==e.length;++n)t.push(e[n].next());return t}function Y3(e,t){for(let n=0;n!==e.length;++n)t[n]=e[n].next()}function Z3(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*X3(...e){let t=q3(e);for(;!Z3(t);)yield t.map(n=>n.value),Y3(e,t)}function*J3(e){let t=e;for(;;)yield t,++t}var Q3=class extends he{constructor(e,t){super(),this.arb=e,this.maxShrinks=t}generate(e,t){let n=this.arb.generate(e,t);return this.valueMapper(n,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,n){let r=this.maxShrinks-n;return r<=0?D.nil():new D(X3(this.arb.shrink(e,t),J3(n+1))).take(r).map(i=>this.valueMapper(i[0],i[1]))}valueMapper(e,t){let n={originalContext:e.context,length:t};return new O(e.value,n)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalContext"in e&&"length"in e}};function eO(e,t){return new Q3(e,t)}var tO=Pm({Arbitrary:()=>he,ExecutionStatus:()=>mP,PreconditionFailure:()=>xn,Random:()=>Oc,Stream:()=>D,Value:()=>O,VerbosityLevel:()=>K2,__commitHash:()=>iO,__type:()=>nO,__version:()=>rO,anything:()=>S0,array:()=>ue,assert:()=>DP,asyncDefaultReportMessage:()=>bb,asyncModelRun:()=>x3,asyncProperty:()=>G2,asyncStringify:()=>Tc,asyncToStringMethod:()=>Zt,base64String:()=>OT,bigInt:()=>wn,bigInt64Array:()=>E3,bigUint64Array:()=>k3,boolean:()=>xi,chainUntil:()=>kI,check:()=>wb,clone:()=>OI,cloneIfNeeded:()=>cr,cloneMethod:()=>Oe,commands:()=>m3,compareBooleanFunc:()=>T6,compareFunc:()=>N6,configureGlobal:()=>V2,constant:()=>Re,constantFrom:()=>Nt,context:()=>xI,createDepthIdentifier:()=>_c,date:()=>Ob,defaultReportMessage:()=>gb,dictionary:()=>Bc,domain:()=>Vc,double:()=>ks,emailAddress:()=>GM,entityGraph:()=>T4,falsy:()=>SI,float:()=>Jb,float32Array:()=>s0,float64Array:()=>a0,func:()=>L6,gen:()=>HP,getDepthContextFor:()=>$c,hasAsyncToStringMethod:()=>Mc,hasCloneMethod:()=>Dn,hasToStringMethod:()=>Ic,hash:()=>As,infiniteStream:()=>CT,int16Array:()=>l0,int32Array:()=>u0,int8Array:()=>c0,integer:()=>ne,ipV4:()=>Hc,ipV4Extended:()=>n0,ipV6:()=>r0,json:()=>vT,jsonValue:()=>w0,letrec:()=>i0,limitShrink:()=>eO,lorem:()=>F4,map:()=>bc,mapToConstant:()=>mr,maxSafeInteger:()=>t0,maxSafeNat:()=>U6,memo:()=>W4,mixedCase:()=>Y4,modelRun:()=>w3,nat:()=>gn,noBias:()=>Rs,noShrink:()=>Cs,object:()=>gT,oneof:()=>Te,option:()=>Xt,pre:()=>bk,property:()=>H2,readConfigureGlobal:()=>bt,record:()=>gc,resetConfigureGlobal:()=>W2,sample:()=>FP,scheduledModelRun:()=>v3,scheduler:()=>A3,schedulerFor:()=>C3,set:()=>y0,shuffledSubarray:()=>DT,sparseArray:()=>m0,statistics:()=>jP,stream:()=>Sn,string:()=>Ie,stringMatching:()=>K3,stringify:()=>Ae,subarray:()=>LT,toStringMethod:()=>St,tuple:()=>B,uint16Array:()=>d0,uint32Array:()=>f0,uint8Array:()=>h0,uint8ClampedArray:()=>p0,ulid:()=>GT,uniqueArray:()=>Fn,uuid:()=>JT,webAuthority:()=>A0,webFragments:()=>E0,webPath:()=>P0,webQueryParameters:()=>I0,webSegment:()=>k0,webUrl:()=>d3}),nO="module",rO="4.8.0",iO="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",De=tO;var oO=24301;function Is(e,t){return e.reduce((n,r)=>uO(n,t[r.idx]?.paramSpaces),new Map)}function gr(e,t){return Object.fromEntries(Object.entries(e.paramSpaces).map(([n,r])=>[n,sO(r,r?.name==null?0:t.get(r.name)??0)]))}var j0=new WeakMap;function sO(e,t){if(e==null)return V0(void 0,t);let n=j0.get(e)??new Map;j0.set(e,n);let r=n.get(t);if(r!=null)return r;let i=V0(e,t);return n.set(t,i),i}function aO(e){return e?.values!=null&&e.values.length>0?De.constantFrom(...e.values):lO(e)}function V0(e,t){let[n]=De.sample(aO(e),{numRuns:1,seed:oO+t});if(n==null)throw new Error("arbitrary produced no sample");return n}function lO(e){if(e?.type==="number")return De.integer();if(e?.type==="boolean")return De.boolean();let t=e?.generator==null?void 0:dO[e.generator];if(t!=null)return t;let n=e?.constraints?.kind==="string"?e.constraints:void 0;return De.string({maxLength:n?.maxLength,minLength:n?.minLength??1}).filter(r=>r.trim().length>0&&r===r.trim())}function uO(e,t){return t==null?e:Object.values(t).reduce((n,r)=>r==null?n:new Map([...n,[r.name,(n.get(r.name)??0)+1]]),e)}var cO="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],yr=e=>De.array(De.constantFrom(...cO),{maxLength:e,minLength:1}).map(t=>t.join("")),Xc=(e,t)=>De.array(yr(10),{maxLength:t,minLength:1}).map(n=>n.join(e)),dO={"company.name":Xc(" ",3),"date.iso":fO(),"internet.email":hO(),"internet.url":pO(),"lorem.slug":Xc("-",3),"lorem.word":yr(10),"person.fullName":Xc(" ",2)};function fO(){return De.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 hO(){return De.tuple(yr(12),yr(10),De.constantFrom("com","dev","io","org","ai")).map(([e,t,n])=>`${e}@${t}.${n}`)}function pO(){return De.tuple(De.constantFrom("http","https"),yr(12),De.constantFrom("app","com","dev","io","org"),De.array(yr(8),{maxLength:3})).map(([e,t,n,r])=>{let i=r.length===0?"":`/${r.join("/")}`;return`${e}://${t}.${n}${i}`})}var mO=new Map;function Ms(e){return gr(e,mO)}import{z as Q}from"zod";var br=Q.enum(["crash","data-rule","page-rule","frame"]),W0=Q.object({intent:Q.string().min(1),test:Q.string().min(1)}),yO=Q.union([Q.object({kind:Q.literal("singleton-mismatch"),singleton:Q.string().min(1)}),Q.object({browser:Q.string().min(1),kind:Q.literal("browser-mismatch")}),Q.object({entity:Q.string().min(1),kind:Q.string().min(1)})]),gO=Q.discriminatedUnion("kind",[Q.object({kind:Q.literal("consistency"),layer:br,mismatch:yO,step:W0.nullable()}),Q.object({kind:Q.literal("pending-check"),layer:br,source:Q.string().min(1),step:W0}),Q.object({intent:Q.string().min(1),kind:Q.literal("unrunnable"),layer:br,reason:Q.string().min(1),test:Q.string().min(1)}),Q.object({error:Q.string().min(1),kind:Q.literal("driver-error"),layer:br,step:Q.string().min(1)}),Q.object({kind:Q.literal("impossible-action"),layer:br,step:Q.string().min(1)})]);import{z as Ts}from"zod";var vi=Ts.number().min(0).max(10),z0=Ts.object({branching:vi,destructiveActions:vi,maxAttemptLength:Ts.number().int().positive(),mixWorkflows:vi,mutatingActions:vi,scopedBoost:Ts.number().min(1),sharedEntity:vi}),Jc={even:{branching:3,destructiveActions:2,maxAttemptLength:12,mixWorkflows:3,mutatingActions:2,scopedBoost:8,sharedEntity:5}};function G0(e){return Jc[e]}function Qc(e,t,n){let r=t.reduce((u,c)=>u+c,0),i=t.reduce((u,c)=>[...u,(u.at(-1)??0)+c],[]),o=n()*r,s=i.findIndex(u=>o<u),a=r<=0?Math.floor(n()*e.length):s,l=e[a<0?e.length-1:a];if(l==null)throw new Error("weighted sample drew an empty set");return l}var H0=4;function Os(e){return{startingPoint:e.startingPoint.name,steps:q0(e,e.startingPoint.snapshot,[])}}function q0(e,t,n){if(n.length>=e.strategy.maxAttemptLength)return n;let r=oi(e.corpus,{snapshot:t},Y0(e.corpus,n));if(r.length===0)return n;let i=bO(e,r,n);return q0(e,i.stepRun.next.snapshot,[...n,{idx:i.idx,params:i.params}])}function Y0(e,t){let n=Is(t,e);return r=>gr(r,n)}function bO(e,t,n){let r=t.map(i=>SO(e,i,n));return Qc(t,r,e.random)}function SO(e,t,n){let r=e.corpus[t.idx];if(r==null)return H0;let i=e.strategy,o=xp(r.effectStep)?i.mutatingActions:0,s=Sp(r.effectStep)?i.destructiveActions:0,a=wO(e.corpus,r,n),l=a?i.mixWorkflows:0,u=a&&xO(e.corpus,r,n)?i.sharedEntity:0,c=vO(e,t,n),d=n.filter(p=>p.idx===t.idx).length,f=(H0+o+s+l+u+c)/(d+1);return e.scopedTests.has(r.test)?f*i.scopedBoost:f}function wO(e,t,n){let r=new Set(n.flatMap(i=>{let o=e[i.idx];return o==null?[]:[o.test]}));return r.size>0&&!r.has(t.test)}function xO(e,t,n){let r=K0(t),i=new Set(n.flatMap(o=>{let s=e[o.idx];return s==null?[]:[...K0(s)]}));return[...r].some(o=>i.has(o))}function K0(e){return new Set([...vp(e.effectStep),...e.requiredState.entities.map(t=>t.entity)])}function vO(e,t,n){let r=1-n.length/e.strategy.maxAttemptLength;if(r<=0)return 0;let i=oi(e.corpus,{snapshot:t.stepRun.next.snapshot},Y0(e.corpus,n)).length;return e.strategy.branching*r*(i/(i+1))}import{z as H}from"zod";var Z0=H.object({baseStateTest:co,lockfileHash:H.string().min(1),stepRuns:H.array(H.object({idx:H.number().int().nonnegative(),params:H.record(H.string(),H.union([Lt,H.null()]))}))}),X0=H.object({baseStateRef:H.string().min(1),steps:H.array(H.object({index:H.number().int().nonnegative(),params:H.record(H.string(),H.union([Lt,H.null()])),test:H.string().min(1)}))}),J0=H.object({actions:H.array(H.string()),label:H.string().min(1)}),ed=H.object({test:H.string().min(1),text:H.string()}),RO=H.object({baseLabel:H.string(),baseState:H.string().min(1),durationMs:H.number().int().nonnegative(),signature:H.string().optional(),steps:H.array(ed)}),Q0=H.object({kind:H.enum(["aborted","clean","error","flaky","finding"]),reason:H.string().optional(),runId:H.string().optional(),trail:RO.optional()});function Ns(e,{sweep:t}){let n=Wt(Mt(e),r=>F({s:r.test.singletons,w:r.test.world})).map(r=>({name:r.ref,test:r.test}));return t?[...n,...n.flatMap(r=>AO(r))]:n}function $s(e,t,n){return nr(e,t.test,n)}function AO(e){return CO(e.test).map(t=>{let n={...t,as:`${t.as}~2`},r=`${e.name} +${t.entity}`;return{name:r,test:{...e.test,name:r,world:[...e.test.world,n]}}})}function CO(e){return e.world.filter(t=>{let n=F({...e,world:e.world.filter(r=>r!==t)});return!n.includes(`"${t.as}.`)&&!n.includes(`"ref":"${t.as}"`)})}async function _s(e){let t=$n(e);if(t.length===0)return null;let n=Ns(e,{sweep:!1}),r=await EO(e,n);return r.length===0?null:{corpus:t,startingPoints:r,startingPointTests:new Map(n.map(i=>[i.name,i.test]))}}function eS({lockfileHash:e,prepared:t,random:n,scopedTests:r,strategy:i}){let o=t.startingPoints[Math.floor(n()*t.startingPoints.length)];if(o==null)return null;let s=Os({corpus:t.corpus,random:n,scopedTests:r,startingPoint:o,strategy:i}),a=t.startingPointTests.get(s.startingPoint);return a==null||s.steps.length===0?null:{baseStateTest:a,lockfileHash:e,stepRuns:s.steps.map(l=>({idx:l.idx,params:l.params}))}}async function EO(e,t){let n={generate:li,materialize:Po(li,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await $s(e,i,n)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}import{ResultAsync as td}from"neverthrow";var vn=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}};function Ls(e){return{read:t=>BO(t,e),seedScript:t=>`globalThis[${JSON.stringify(bl)}] = ${JSON.stringify(t)};`}}async function BO(e,t){let n={...Ut(e.url()),title:await e.title(),viewport:jO(e.viewportSize())};if(t.length===0)return{browser:n,singletons:{}};let r=await e.evaluate(UO,{mountKey:Cn,names:t,timeoutMs:FO});if(r.kind==="unmounted")throw new vn(Cn);return{browser:n,singletons:r.values}}var FO=5e3;async function UO(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(r=>setTimeout(r,25));let n=Reflect.get(globalThis,e.mountKey);return n==null?{kind:"unmounted"}:{kind:"values",values:Object.fromEntries(e.names.map(r=>[r,n.readSingleton(r)??null]))}}function jO(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}var VO={backoffMs:[500,1e3,2e3,4e3,8e3],budgetMs:3e4,mountPollMs:2e3};function nd(e,t,n,r,i=VO){return{evaluate:o=>td.fromPromise(rS(WO(e,n,o),`check ${o.kind}`),tS),locateIds:o=>e8(e,o),observe:()=>t.read().andThen(o=>td.fromPromise(rS(iS(e,n,0),"observe"),tS).map(s=>({snapshot:{...o,browser:{...o.browser,...s.browser},singletons:{...o.singletons,...s.singletons}}}))),perform:o=>td.fromPromise(sS(e,o,0,r,i),s=>s instanceof vn?bo(s.mountKey):Hl(o.kind,s))}}async function WO(e,t,n){try{return await fS(e,t,n)}catch(r){if(oS(r))return!1;throw r}}function tS(e){return e instanceof vn?bo(e.mountKey):Kl(e)}var zO=[100,250,500];async function iS(e,t,n){try{return await t.read(e)}catch(r){let i=zO[n],o=oS(r)||r instanceof vn;if(i==null||!o)throw r;return await dS(i),iS(e,t,n+1)}}function oS(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 nS=35e3;function rS(e,t){let n,r=new Promise((i,o)=>{n=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(nS)}ms`))},nS)});return Promise.race([e,r]).finally(()=>{clearTimeout(n)})}var GO=[250,750,2e3];async function sS(e,t,n,r,i){try{await XO(e,t,r,i)}catch(o){let s=GO[n];if(s==null||!cS(o))throw o;await dS(s),await sS(e,t,n+1,r,i)}}async function aS({page:e,readiness:t,signal:n,startMs:r,tries:i,url:o}){if(ot(n),await HO(e,o,n,t))return;if(Date.now()-r>=t.budgetMs)throw new vn(Cn);let s=t.backoffMs[Math.min(i,t.backoffMs.length-1)]??8e3;await Jn(s,n),await aS({page:e,readiness:t,signal:n,startMs:r,tries:i+1,url:o})}async function HO(e,t,n,r){let i=await KO(e,t);return i==="net-error"||i!=null&&i.status()>=400?!1:qO(e,n,r.mountPollMs)}async function KO(e,t){try{return await e.goto(t,{waitUntil:"domcontentloaded"})}catch(n){if(cS(n))return"net-error";throw n}}function qO(e,t,n){return Promise.race([e.evaluate(YO,{mountKey:Cn,timeoutMs:n}),ZO(t)])}async function YO(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(n=>setTimeout(n,25));return Reflect.get(globalThis,e.mountKey)!=null}function ZO(e){return new Promise((t,n)=>{ot(e),e.addEventListener("abort",()=>{n(new cn)},{once:!0})})}async function XO(e,t,n,r){if(t.kind==="goto"){await aS({page:e,readiness:r,signal:n,startMs:Date.now(),tries:0,url:Sr(t.url,t,"url")});return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(Sr(t.key,t,"key"));return}let i=t.kind!=="upload";await JO(e,lS(e,t.locator,{visibleOnly:i}),t)}function Sr(e,t,n){if(e==null)throw new Error(`action "${t.kind}" requires ${n}`);return e}function JO(e,t,n){switch(n.kind){case"goto":throw new Error("goto must not be located");case"fill":return t.fill(String(Sr(n.value,n,"value")));case"clear":return t.clear();case"click":return t.click();case"dblclick":return t.dblclick();case"check":return t.check();case"uncheck":return t.uncheck();case"hover":return t.hover();case"select":return QO(e,t,String(Sr(n.value,n,"value")));case"upload":return t.setInputFiles(Sr(n.files,n,"files"));case"press":return t.press(Sr(n.key,n,"key"))}}async function QO(e,t,n){if(await t.evaluate(i=>i.tagName==="SELECT")){await t.selectOption(n);return}await t.click(),await t.fill(n),await e.locator(uS("option",n)).filter({visible:!0}).click()}async function e8(e,t){if(t==null)return[];try{let n=Ds(e,t,{visibleOnly:!1});if(await n.count()===0)return[];let r=await n.first().evaluate(t8);return r>0?[r]:[]}catch{return[]}}function t8(e){return globalThis.__ripploRrwebMirror?.getId(e)??-1}function lS(e,t,n){if(t==null)throw new Error("action requires a locator");return Ds(e,t,n)}function Ds(e,t,n){if(t.by==="inside"){let i=Ds(e,t.scope,n);return Ds(i,t.target,n)}let r=t.by==="testId"?e.getByTestId(t.value):e.locator(uS(t.role,t.name));return n.visibleOnly?r.filter({visible:!0}):r}function uS(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function cS(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 dS(e){return new Promise(t=>{setTimeout(t,e)})}async function fS(e,t,n){if(n.kind==="browser")return r8(e,t,n.key,n.value);if(n.kind==="not")return!await fS(e,t,n.inner);let r=lS(e,n.locator,{visibleOnly:!0});return n.kind==="value"?await r.inputValue()===n.value:n.kind==="text"?(await r.textContent()??"").includes(n.value):n8(r,n.kind)}function n8(e,t){return t==="visible"?e.isVisible():t==="disabled"?e.isDisabled():t==="enabled"?e.isEnabled():t==="checked"?e.isChecked():e.evaluate(n=>n===n.ownerDocument.activeElement)}async function r8(e,t,n,r){let i=await t.read(e),o=er(i.browser,n);return r===null?o===void 0:o===r}import i8 from"path";var pS={height:720,width:1280};async function Bs({baseUrl:e,browser:t,capture:n,clientState:r,engine:i,extraHeaders:o,fixturesDir:s,reader:a,session:l,signal:u,viewport:c}){let d=await t.newContext({baseURL:e,reducedMotion:"reduce",storageState:l==null?void 0:{cookies:o8(l.cookies,e),origins:l.origins},viewport:c}),f=s8(o,l?.headers);f!=null&&await d.setExtraHTTPHeaders(f),await d.addInitScript(i.seedScript(r));let p=n==null?a8():await n.hub.attach(d,n.runId),h=await d.newPage();return p.onPage(h),{context:d,driver:c8(l8(nd(h,a,i,u),s),p),emitAssertion:p.emitAssertion,emitFinding:p.emitFinding,close:()=>d8({context:d,handle:p})}}async function rd(e,t){let n=await yS(e);try{return await t(n)}finally{await n.close()}}async function mS(e){let{chromium:t}=await import("playwright");return t.launchPersistentContext(e,{headless:!1,viewport:null})}function o8(e,t){let n=new URL(t).hostname;return e.map(r=>({...r,domain:n}))}function s8(e,t){return e==null?t:t==null?e:{...e,...t}}function a8(){return{emitAction:()=>{},emitAssertion:()=>{},emitFinding:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function yS(e){let{chromium:t}=await import("playwright");return t.launch({headless:!e})}function Fs({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??=yS(e),t},close:async()=>{let i=t;t=void 0,i!=null&&await i.then(o=>o.close()).catch(()=>{})}}}function l8(e,t){return{evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>e.perform(u8(n,t))}}function u8(e,t){return e.kind!=="upload"||e.files==null?e:{...e,files:e.files.map(n=>i8.join(t,n))}}function c8(e,t){return{evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>(t.emitAction(n),e.perform(n))}}async function d8({context:e,handle:t}){await hS(t.finish()),await hS(e.close())}var f8=15e3;async function hS(e){let t,n=new Promise(r=>{t=setTimeout(r,f8)});await Promise.race([e.catch(()=>{}),n]).finally(()=>{clearTimeout(t)})}import{err as h8,ok as p8,Result as id}from"neverthrow";function od(e,t,n){return{read:()=>n.read(e.map(r=>r.name),t).andThen(r=>m8(e,r))}}function m8(e,t){return id.combine(e.map(n=>y8(n,t.entities[n.name]??[]).map(r=>[n.name,r]))).map(n=>({browser:In,entities:new Map(n),singletons:t.singletons}))}function y8(e,t){let n=ei(e);return id.combine(t.map(r=>g8(r,e).map(i=>[i,b8(r,n)]))).map(r=>new Map(r))}function g8(e,t){return id.combine(t.identity.map(n=>{let r=e[n];return r==null?h8(zl(t.name,n)):p8(String(r))})).map(n=>n.join(":"))}function b8(e,t){let n=t.map(r=>[r,e[r]]).filter(r=>r[1]!=null);return Object.fromEntries(n)}var gS=tl(vv(),1);import S8 from"crypto";import{err as w8,errAsync as sd,ok as x8,ResultAsync as wr}from"neverthrow";var v8=3e4,R8=[250,750,2e3],A8=[500,1e3,2e3,3e3];function ad({baseUrl:e,extraHeaders:t,runId:n,secret:r},i){let o=new gS.Webhook(r),s=(a,l,u)=>C8({baseUrl:e,body:l,extraHeaders:t,path:a,retry:u.retry,schema:u.schema,signal:u.signal,webhook:o});return{query:{read:(a,l)=>s("/state",{entities:a,runId:n,singletons:l},{retry:"transient",schema:Dl,signal:i}).map(u=>({entities:u.entities,singletons:u.singletons}))},ready:()=>SS(e,t,i,0),setupWorld:a=>s("/setup",{entities:a,runId:n},{retry:"connection",schema:Ll,signal:i}).map(l=>l.rows),teardown:()=>s("/teardown",{runId:n},{retry:"connection",schema:Bl,signal:void 0}).map(()=>{})}}function C8(e){return bS(e.retry,()=>I8(e),0)}function bS(e,t,n){return t().orElse(r=>{let i=R8[n];return i==null||!k8(r,e)?sd(r):wr.fromSafePromise(wS(i)).andThen(()=>bS(e,t,n+1))})}function SS(e,t,n,r){return wr.fromPromise(fetch(e,{headers:t,method:"HEAD",signal:xS(n)}),i=>Xn("",i)).map(()=>{}).orElse(()=>{let i=A8[r];return i==null||n.aborted?sd(Gl(e)):wr.fromSafePromise(wS(i)).andThen(()=>SS(e,t,n,r+1))})}var E8=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function k8(e,t){return e.kind==="aborted"?!1:P8(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function P8(e){return e.kind==="engine-network"&&e.code!=null&&E8.has(e.code)}function wS(e){return new Promise(t=>{setTimeout(t,e)})}function I8({baseUrl:e,body:t,extraHeaders:n,path:r,schema:i,signal:o,webhook:s}){let a=JSON.stringify(t);return wr.fromPromise(fetch(`${e}${r}`,{body:a,headers:{...n,"Content-Type":"application/json",...M8(s,a)},method:"PUT",signal:xS(o)}),l=>Xn(r,l)).andThen(l=>T8(l,r)).andThen(l=>O8(i,l,r)).mapErr(l=>o?.aborted===!0?ql():l)}function M8(e,t){let n=`msg_${S8.randomUUID()}`,r=new Date;return{"webhook-id":n,"webhook-signature":e.sign(n,r,t),"webhook-timestamp":String(Math.floor(r.getTime()/1e3))}}function xS(e){let t=AbortSignal.timeout(v8);return e==null?t:AbortSignal.any([e,t])}function T8(e,t){return e.ok?wr.fromPromise(e.json(),n=>Xn(t,n)):wr.fromPromise(e.text().catch(()=>""),n=>Xn(t,n)).andThen(n=>sd(Vl(t,e.status,n)))}function O8(e,t,n){let r=e.safeParse(t);return r.success?x8(r.data):w8(Wl(n,r.error))}import Xf from"path";import{err as Lr,ok as to,ResultAsync as Jf}from"neverthrow";import{existsSync as AN}from"fs";import{writeFile as CN}from"fs/promises";import EN from"path";import{err as Ys,ok as kN}from"neverthrow";import{createRequire as N8}from"module";var $8=N8("/"),vr,_8,L8;try{vr=$8("worker_threads"),_8=vr.Worker,L8=vr.isMarkedAsUntransferable}catch{}var Ve=Uint8Array,xr=Uint16Array,D8=Int32Array,vS=new Ve([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),RS=new Ve([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),B8=new Ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),AS=function(e,t){for(var n=new xr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new D8(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},vr=AS(vS,2),CS=vr.b,F8=vr.r;CS[28]=258,F8[258]=28;var ES=AS(RS,0),U8=ES.b,Az=ES.r,dd=new xr(32768);for(te=0;te<32768;++te)Qt=(te&43690)>>1|(te&21845)<<1,Qt=(Qt&52428)>>2|(Qt&13107)<<2,Qt=(Qt&61680)>>4|(Qt&3855)<<4,dd[te]=((Qt&65280)>>8|(Qt&255)<<8)>>1;var Qt,te,Ri=(function(e,t,n){for(var r=e.length,i=0,o=new xr(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new xr(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new xr(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],d=s[e[i]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)a[dd[d]>>l]=u}else for(a=new xr(r),i=0;i<r;++i)e[i]&&(a[i]=dd[s[e[i]-1]++]>>15-e[i]);return a}),Ai=new Ve(288);for(te=0;te<144;++te)Ai[te]=8;var te;for(te=144;te<256;++te)Ai[te]=9;var te;for(te=256;te<280;++te)Ai[te]=7;var te;for(te=280;te<288;++te)Ai[te]=8;var te,kS=new Ve(32);for(te=0;te<32;++te)kS[te]=5;var te;var j8=Ri(Ai,9,1);var V8=Ri(kS,5,1),ld=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},wt=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},ud=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},W8=function(e){return(e+7)/8|0},Us=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new Ve(e.subarray(t,n))};var z8=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],qe=function(e,t,n){var r=new Error(t||z8[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,qe),!n)throw r;return r},PS=function(e,t,n,r){var i=e.length,o=r?r.length:0;if(!i||t.f&&!t.l)return n||new Ve(0);var s=!n,a=s||t.i!=2,l=t.i;s&&(n=new Ve(i*3));var u=function(X){var He=n.length;if(X>He){var me=new Ve(Math.max(He*2,X));me.set(n),n=me}},c=t.f||0,d=t.p||0,f=t.b||0,p=t.l,h=t.d,m=t.m,y=t.n,S=i*8;do{if(!p){c=wt(e,d,1);var w=wt(e,d+1,3);if(d+=3,w)if(w==1)p=j8,h=V8,m=9,y=5;else if(w==2){var N=wt(e,d,31)+257,$=wt(e,d+10,15)+4,_=N+wt(e,d+5,31)+1;d+=14;for(var I=new Ve(_),j=new Ve(19),V=0;V<$;++V)j[B8[V]]=wt(e,d+V*3,7);d+=$*3;for(var se=ld(j),L=(1<<se)-1,$e=Ri(j,se,1),V=0;V<_;){var Ze=$e[wt(e,d,L)];d+=Ze&15;var g=Ze>>4;if(g<16)I[V++]=g;else{var ce=0,Le=0;for(g==16?(Le=3+wt(e,d,3),d+=2,ce=I[V-1]):g==17?(Le=3+wt(e,d,7),d+=3):g==18&&(Le=11+wt(e,d,127),d+=7);Le--;)I[V++]=ce}}var Ct=I.subarray(0,N),Me=I.subarray(N);m=ld(Ct),y=ld(Me),p=Ri(Ct,m,1),h=Ri(Me,y,1)}else qe(1);else{var g=W8(d)+4,x=e[g-4]|e[g-3]<<8,P=g+x;if(P>i){l&&qe(0);break}a&&u(f+x),n.set(e.subarray(g,P),f),t.b=f+=x,t.p=d=P*8,t.f=c;continue}if(d>S){l&&qe(0);break}}a&&u(f+131072);for(var ro=(1<<m)-1,Br=(1<<y)-1,Hn=d;;Hn=d){var ce=p[ud(e,d)&ro],ut=ce>>4;if(d+=ce&15,d>S){l&&qe(0);break}if(ce||qe(2),ut<256)n[f++]=ut;else if(ut==256){Hn=d,p=null;break}else{var Fr=ut-254;if(ut>264){var V=ut-257,sn=vS[V];Fr=wt(e,d,(1<<sn)-1)+CS[V],d+=sn}var Ur=h[ud(e,d)&Br],ct=Ur>>4;Ur||qe(3),d+=Ur&15;var Me=U8[ct];if(ct>3){var sn=RS[ct];Me+=ud(e,d)&(1<<sn)-1,d+=sn}if(d>S){l&&qe(0);break}a&&u(f+131072);var Et=f+Fr;if(f<Me){var Kn=o-Me,qn=Math.min(Me,Et);for(Kn+f<0&&qe(3);f<qn;++f)n[f]=r[Kn+f]}for(;f<Et;++f)n[f]=n[f-Me]}}t.l=p,t.p=Hn,t.b=f,t.f=c,p&&(c=1,t.m=m,t.d=h,t.n=y)}while(!c);return f!=n.length&&s?Us(n,0,f):n.subarray(0,f)};var G8=new Ve(0);var IS=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&qe(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&qe(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};var cd=(function(){function e(t,n){typeof t=="function"&&(n=t,t={}),this.ondata=n;var r=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:r?r.length:0},this.o=new Ve(32768),this.p=new Ve(0),r&&this.o.set(r)}return e.prototype.e=function(t){if(this.ondata||qe(5),this.d&&qe(4),!this.p.length)this.p=t;else if(t.length){var n=new Ve(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length),this.p=n}},e.prototype.c=function(t){this.s.i=+(this.d=t||!1);var n=this.s.b,r=PS(this.p,this.s,this.o);this.ondata(Us(r,n,this.s.b),this.d),this.o=Us(r,this.s.b-32768),this.s.b=this.o.length,this.p=Us(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(t,n){this.e(t),this.c(n)},e})();var fd=(function(){function e(t,n){cd.call(this,t,n),this.v=t&&t.dictionary?2:1}return e.prototype.push=function(t,n){if(cd.prototype.e.call(this,t),this.v){if(this.p.length<6&&!n)return;this.p=this.p.subarray(IS(this.p,this.v-1)),this.v=0}n&&(this.p.length<4&&qe(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),cd.prototype.c.call(this,n)},e})();function MS(e,t){return PS(e.subarray(IS(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}var H8=typeof TextDecoder<"u"&&new TextDecoder,K8=0;try{H8.decode(G8,{stream:!0}),K8=1}catch{}function hd(e,t="utf8"){return new TextDecoder(t).decode(e)}var q8=new TextEncoder;function TS(e){return q8.encode(e)}var Y8=1024*8,Z8=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),pd={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},Ci=class e{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=Y8,n={}){let r=!1;typeof t=="number"?t=new ArrayBuffer(t):(r=!0,this.lastWrittenByte=t.byteLength);let i=n.offset?n.offset>>>0:0,o=t.byteLength-i,s=i;(ArrayBuffer.isView(t)||t instanceof e)&&(t.byteLength!==t.buffer.byteLength&&(s=t.byteOffset+i),t=t.buffer),r?this.lastWrittenByte=o:this.lastWrittenByte=0,this.buffer=t,this.length=o,this.byteLength=o,this.byteOffset=s,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,s,o),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){let t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){let r=(this.offset+t)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,n){let r=pd[n].BYTES_PER_ELEMENT*t,i=this.byteOffset+this.offset,o=this.buffer.slice(i,i+r);if(this.littleEndian===Z8&&n!=="uint8"&&n!=="int8"){let a=new Uint8Array(this.buffer.slice(i,i+r));a.reverse();let l=new pd[n](a.buffer);return this.offset+=r,l.reverse(),l}let s=new pd[n](o);return this.offset+=r,s}readInt16(){let t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){let t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){let t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){let t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){let t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){let t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){let t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){let t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let n="";for(let r=0;r<t;r++)n+=this.readChar();return n}readUtf8(t=1){return hd(this.readBytes(t))}decodeText(t=1,n="utf8"){return hd(this.readBytes(t),n)}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let n=0;n<t.length;n++)this._data.setUint8(this.offset++,t[n]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let n=0;n<t.length;n++)this.writeUint8(t.charCodeAt(n));return this}writeUtf8(t){return this.writeBytes(TS(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}};var NS=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;NS[e]=t}var OS=4294967295;function X8(e,t,n){let r=e;for(let i=0;i<n;i++)r=NS[(r^t[i])&255]^r>>>8;return r}function J8(e,t){return(X8(OS,e,t)^OS)>>>0}function md(e,t,n){let r=e.readUint32(),i=J8(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(i!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${i}`)}function js(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function Vs(e,t,n,r){let i=0;for(;i<r;i++)t[i]=e[i];for(;i<n;i++)t[i]=e[i]+t[i-r]&255}function Ws(e,t,n,r){let i=0;if(n.length===0)for(;i<r;i++)t[i]=e[i];else for(;i<r;i++)t[i]=e[i]+n[i]&255}function zs(e,t,n,r,i){let o=0;if(n.length===0){for(;o<i;o++)t[o]=e[o];for(;o<r;o++)t[o]=e[o]+(t[o-i]>>1)&255}else{for(;o<i;o++)t[o]=e[o]+(n[o]>>1)&255;for(;o<r;o++)t[o]=e[o]+(t[o-i]+n[o]>>1)&255}}function Gs(e,t,n,r,i){let o=0;if(n.length===0){for(;o<i;o++)t[o]=e[o];for(;o<r;o++)t[o]=e[o]+t[o-i]&255}else{for(;o<i;o++)t[o]=e[o]+n[o]&255;for(;o<r;o++)t[o]=e[o]+Q8(t[o-i],n[o],n[o-i])&255}}function Q8(e,t,n){let r=e+t-n,i=Math.abs(r-e),o=Math.abs(r-t),s=Math.abs(r-n);return i<=o&&i<=s?e:o<=s?t:n}function $S(e,t,n,r,i,o){switch(e){case 0:js(t,n,i);break;case 1:Vs(t,n,i,o);break;case 2:Ws(t,n,r,i);break;case 3:zs(t,n,r,i,o);break;case 4:Gs(t,n,r,i,o);break;default:throw new Error(`Unsupported filter: ${e}`)}}var eN=new Uint16Array([255]),tN=new Uint8Array(eN.buffer),nN=tN[0]===255;function _S(e){let{data:t,width:n,height:r,channels:i,depth:o}=e,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],a=Math.ceil(o/8)*i,l=new Uint8Array(r*n*a),u=0;for(let c=0;c<7;c++){let d=s[c],f=Math.ceil((n-d.x)/d.xStep),p=Math.ceil((r-d.y)/d.yStep);if(f<=0||p<=0)continue;let h=f*a,m=new Uint8Array(h);for(let y=0;y<p;y++){let S=t[u++],w=t.subarray(u,u+h);u+=h;let g=new Uint8Array(h);$S(S,w,g,m,h,a),m.set(g);for(let x=0;x<f;x++){let P=d.x+x*d.xStep,N=d.y+y*d.yStep;if(!(P>=n||N>=r))for(let $=0;$<a;$++)l[(N*n+P)*a+$]=g[x*a+$]}}}if(o===16){let c=new Uint16Array(l.buffer);if(nN)for(let d=0;d<c.length;d++)c[d]=rN(c[d]);return c}else return l}function rN(e){return(e&255)<<8|e>>8&255}var iN=new Uint16Array([255]),oN=new Uint8Array(iN.buffer),sN=oN[0]===255,aN=new Uint8Array(0);function yd(e){let{data:t,width:n,height:r,channels:i,depth:o}=e,s=Math.ceil(o/8)*i,a=Math.ceil(o/8*i*n),l=new Uint8Array(r*a),u=aN,c=0,d,f;for(let p=0;p<r;p++){switch(d=t.subarray(c+1,c+1+a),f=l.subarray(p*a,(p+1)*a),t[c]){case 0:js(d,f,a);break;case 1:Vs(d,f,a,s);break;case 2:Ws(d,f,u,a);break;case 3:zs(d,f,u,a,s);break;case 4:Gs(d,f,u,a,s);break;default:throw new Error(`Unsupported filter: ${t[c]}`)}u=f,c+=a+1}if(o===16){let p=new Uint16Array(l.buffer);if(sN)for(let h=0;h<p.length;h++)p[h]=lN(p[h]);return p}else return l}function lN(e){return(e&255)<<8|e>>8&255}var Hs=Uint8Array.of(137,80,78,71,13,10,26,10);function gd(e){if(!LS(e.readBytes(Hs.length)))throw new Error("wrong PNG signature")}function LS(e){if(e.length<Hs.length)return!1;for(let t=0;t<Hs.length;t++)if(e[t]!==Hs[t])return!1;return!0}var DS="tEXt",cN=0,BS=new TextDecoder("latin1");function dN(e){if(hN(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}var fN=/^[\u0000-\u00FF]*$/;function hN(e){if(!fN.test(e))throw new Error("invalid latin1 text")}function FS(e,t,n){let r=bd(t);e[r]=pN(t,n-r.length-1)}function bd(e){for(e.mark();e.readByte()!==cN;);let t=e.offset;e.reset();let n=BS.decode(e.readBytes(t-e.offset-1));return e.skip(1),dN(n),n}function pN(e,t){return BS.decode(e.readBytes(t))}var We={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Ei={UNKNOWN:-1,DEFLATE:0},Ks={UNKNOWN:-1,ADAPTIVE:0},ki={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},Pi={NONE:0,BACKGROUND:1,PREVIOUS:2},qs={SOURCE:0,OVER:1};var Ii=class extends Ci{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;_chunks;_inflatorResult;constructor(t,n={}){super(t);let{checkCrc:r=!1}=n;this._checkCrc=r,this._inflator=new fd((i,o)=>{if(this._chunks.push(i),o){let s=this._chunks.reduce((l,u)=>l+u.length,0);this._inflatorResult=new Uint8Array(s);let a=0;for(let l of this._chunks)this._inflatorResult.set(l,a),a+=l.length;this._chunks=[]}}),this._chunks=[],this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=Ei.UNKNOWN,this._filterMethod=Ks.UNKNOWN,this._interlaceMethod=ki.UNKNOWN,this._colorType=We.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this._inflatorResult=new Uint8Array(0),this.setBigEndian()}decode(){for(gd(this);!this._end;){let t=this.readUint32(),n=this.readChars(4);this.decodeChunk(t,n)}return this._inflator.push(new Uint8Array(0),!0),this.decodeImage(),this._png}decodeApng(){for(gd(this);!this._end;){let t=this.readUint32(),n=this.readChars(4);this.decodeApngChunk(t,n)}return this.decodeApngImage(),this._apng}decodeChunk(t,n){let r=this.offset;switch(n){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case DS:FS(this._png.text,this,t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t);break}if(this.offset-r!==t)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?md(this,t+4,n):this.skip(4)}decodeApngChunk(t,n){let r=this.offset;switch(n!=="fdAT"&&n!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),n){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,n),this.offset=r+t;break}if(this.offset-r!==t)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?md(this,t+4,n):this.skip(4)}decodeIHDR(){let t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=mN(this.readUint8());let n=this.readUint8();this._colorType=n;let r;switch(n){case We.GREYSCALE:r=1;break;case We.TRUECOLOUR:r=3;break;case We.INDEXED_COLOUR:r=1;break;case We.GREYSCALE_ALPHA:r=2;break;case We.TRUECOLOUR_ALPHA:r=4;break;case We.UNKNOWN:default:throw new Error(`Unknown color type: ${n}`)}if(this._png.channels=r,this._compressionMethod=this.readUint8(),this._compressionMethod!==Ei.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){let t={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(t)}decodePLTE(t){if(t%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);let n=t/3;this._hasPalette=!0;let r=[];this._palette=r;for(let i=0;i<n;i++)r.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._writingDataChunks=!0;let n=t,r=this.offset+this.byteOffset;try{this._inflator.push(new Uint8Array(this.buffer,r,n),!1)}catch(i){throw new Error("Error while decompressing the data:",{cause:i})}this.skip(t)}decodeFDAT(t){this._writingDataChunks=!0;let n=t,r=this.offset+this.byteOffset;r+=4,n-=4;try{this._inflator.push(new Uint8Array(this.buffer,r,n),!1)}catch(i){throw new Error("Error while decompressing the data:",{cause:i})}this.skip(t)}decodetRNS(t){switch(this._colorType){case We.GREYSCALE:case We.TRUECOLOUR:{if(t%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);if(t/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let n=0;n<t/2;n++)this._transparency[n]=this.readUint16();break}case We.INDEXED_COLOUR:{if(t>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let n=0;for(;n<t;n++){let r=this.readByte();this._palette[n].push(r)}for(;n<this._palette.length;n++)this._palette[n].push(255);break}case We.UNKNOWN:case We.GREYSCALE_ALPHA:case We.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(t){let n=bd(this),r=this.readUint8();if(r!==Ei.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${r}`);let i=this.readBytes(t-n.length-2);this._png.iccEmbeddedProfile={name:n,profile:MS(i)}}decodepHYs(){let t=this.readUint32(),n=this.readUint32(),r=this.readByte();this._png.resolution={x:t,y:n,unit:r}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let t=0;t<this._numberOfFrames;t++){let n={sequenceNumber:this._frames[t].sequenceNumber,delayNumber:this._frames[t].delayNumber,delayDenominator:this._frames[t].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},r=this._frames.at(t);if(r){if(r.data=yd({data:r.data,width:r.width,height:r.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),t===0||r.xOffset===0&&r.yOffset===0&&r.width===this._png.width&&r.height===this._png.height)n.data=r.data;else{let i=this._apng.frames.at(t-1);this.disposeFrame(r,i,n),this.addFrameDataToCanvas(n,r)}this._apng.frames.push(n)}}return this._apng}disposeFrame(t,n,r){switch(t.disposeOp){case Pi.NONE:break;case Pi.BACKGROUND:for(let i=0;i<this._png.height;i++)for(let o=0;o<this._png.width;o++){let s=(i*t.width+o)*this._png.channels;for(let a=0;a<this._png.channels;a++)r.data[s+a]=0}break;case Pi.PREVIOUS:r.data.set(n.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(t,n){let r=1<<this._png.depth,i=(o,s)=>{let a=((o+n.yOffset)*this._png.width+n.xOffset+s)*this._png.channels,l=(o*n.width+s)*this._png.channels;return{index:a,frameIndex:l}};switch(n.blendOp){case qs.SOURCE:for(let o=0;o<n.height;o++)for(let s=0;s<n.width;s++){let{index:a,frameIndex:l}=i(o,s);for(let u=0;u<this._png.channels;u++)t.data[a+u]=n.data[l+u]}break;case qs.OVER:for(let o=0;o<n.height;o++)for(let s=0;s<n.width;s++){let{index:a,frameIndex:l}=i(o,s);for(let u=0;u<this._png.channels;u++){let c=n.data[l+this._png.channels-1]/r,d=u%(this._png.channels-1)===0?1:n.data[l+u],f=Math.floor(c*d+(1-c)*t.data[a+u]);t.data[a+u]+=f}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){let t=this._inflatorResult;if(this._filterMethod!==Ks.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===ki.NO_INTERLACE)this._png.data=yd({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===ki.ADAM7)this._png.data=_S({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){this._inflator.push(new Uint8Array(0),!0);let t=this._inflatorResult,n=this._frames.at(-1);n?n.data=t:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:Pi.NONE,blendOp:qs.SOURCE,data:t}),this._inflator=new fd((r,i)=>{if(this._chunks.push(r),i){let o=this._chunks.reduce((a,l)=>a+l.length,0);this._inflatorResult=new Uint8Array(o);let s=0;for(let a of this._chunks)this._inflatorResult.set(a,s),s+=a.length;this._chunks=[]}}),this._chunks=[],this._writingDataChunks=!1}};function mN(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}function US(e,t){return new Ii(e,t).decode()}import{createRequire as yN}from"module";import{readFile as Sd}from"fs/promises";import{fileURLToPath as gN}from"url";import{z as Mi}from"zod";var bN={height:800,width:1280};async function VS(e){let t=await Sd(e,"utf8");return zS(t).flatMap(n=>n.kind==="rrweb"?[n.event]:[])}async function WS(e){let t=await Sd(e,"utf8");return zS(t).flatMap(n=>n.kind==="action"?[pl(n.timeNanos)]:[])}function zS(e){return e.split(`
57
+ `).filter(t=>t.length>0).flatMap(t=>{let n=hl(t);return n==null?[]:[n]})}var SN=Mi.object({data:Mi.looseObject({height:Mi.number(),width:Mi.number()}),type:Mi.literal(4)});function GS(e){let t=e.flatMap(n=>{let r=SN.safeParse(n);return r.success?[r.data]:[]})[0];return t==null?bN:{height:t.data.height,width:t.data.width}}var wN='<svg xmlns="http://www.w3.org/2000/svg" width="17" height="22" viewBox="0 0 17 22"><path d="M1 1 L1 17 L5.4 12.8 L8.5 20 L11 19 L8 11.8 L14 11.8 Z" fill="black" stroke="white" stroke-width="1.3"/></svg>',xN=`.replayer-mouse-tail { display: none; }
58
58
  .replayer-mouse {
59
59
  position: absolute;
60
60
  width: 17px;
@@ -62,88 +62,88 @@ ${vP(i)}`),o}function hb(e){return rc(e,Ae)}async function pb(e){let t=[];functi
62
62
  z-index: 9999;
63
63
  background-repeat: no-repeat;
64
64
  background-size: contain;
65
- background-image: url('data:image/svg+xml;utf8,${gN}');
66
- }`,SN=".replayer-mouse, .replayer-mouse-tail { display: none; }";function VS(e){return`<!doctype html><html><head><style>
65
+ background-image: url('data:image/svg+xml;utf8,${wN}');
66
+ }`,vN=".replayer-mouse, .replayer-mouse-tail { display: none; }";function HS(e){return`<!doctype html><html><head><style>
67
67
  html, body { margin: 0; padding: 0; }
68
68
  .replayer-wrapper { position: relative; }
69
- ${e?bN:SN}
69
+ ${e?xN:vN}
70
70
  iframe { border: none; }
71
- </style></head><body></body></html>`}var WS="*, *::before, *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition-duration: 0s !important; transition-delay: 0s !important; }";function zS(){return`(async () => {
71
+ </style></head><body></body></html>`}var KS="*, *::before, *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition-duration: 0s !important; transition-delay: 0s !important; }";function qS(){return`(async () => {
72
72
  const doc = document.querySelector(".replayer-wrapper iframe")?.contentDocument;
73
73
  if (doc?.fonts != null) {
74
74
  await doc.fonts.ready;
75
75
  }
76
76
  await new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
77
- })()`}function GS(){return import("playwright").then(({chromium:e})=>e.launch({args:["--no-sandbox"],headless:!0})).catch(()=>null)}var DS;function HS(){return DS??=Sd(wN(),"utf8"),DS}function wN(){let e=hN(import.meta.url);try{return e.resolve("@ripplo/rrweb-bundle/replay")}catch{return pN(new URL("assets/rrweb-replay.js",import.meta.url))}}var CN=1,EN=1500,wd=8,kN=997;async function KS({jsonlPath:e,outDir:t,runId:n,scale:r}){if(!xN(e))return Ys({kind:"run-not-found",runId:n});let i=await BS(e),o=i[0],s=i.at(-1);if(o==null||s==null)return Ys({kind:"no-rrweb-events",runId:n});let a=s.timestamp-o.timestamp,u=(await FS(e)).map(h=>h-o.timestamp).filter(h=>h>=0&&h<=a),{delayMs:c,offsets:d}=Ol({actionOffsets:u,durationMs:a}),f=RN.join(t,"clip.gif");return(await PN({delayMs:c,events:i,gifPath:f,offsets:d,scale:r??CN})).map(()=>({durationMs:a,frameCount:d.length,gifPath:f}))}async function PN({delayMs:e,events:t,gifPath:n,offsets:r,scale:i}){let o=await GS();if(o==null)return Ys({detail:"chromium launch",kind:"browser-failed"});try{let s=await IN({browser:o,delayMs:e,events:t,offsets:r,scale:i});return await vN(n,s),AN(void 0)}catch(s){return Ys({detail:s instanceof Error?s.message:String(s),kind:"browser-failed"})}finally{await o.close()}}async function IN({browser:e,delayMs:t,events:n,offsets:r,scale:i}){let o=jS(n),s=await e.newPage({deviceScaleFactor:i,viewport:o});await s.setContent(VS(!0)),await s.addScriptTag({content:await HS()}),await s.evaluate(MN(n));let{applyPalette:a,GIFEncoder:l,quantize:u}=await import("./gifenc.esm-GMV2LJ5K.js"),c=l(),d=r.length-1;return await r.reduce(async(f,p,h)=>{let m=await f,y=await TN({offsetMs:p,page:s});return NN({applyPalette:a,delayMs:t,gif:c,hold:h===d,png:y,quantize:u,started:m})},Promise.resolve(!1)),c.finish(),c.bytes()}function MN(e){return`(() => {
77
+ })()`}function YS(){return import("playwright").then(({chromium:e})=>e.launch({args:["--no-sandbox"],headless:!0})).catch(()=>null)}var jS;function ZS(){return jS??=Sd(RN(),"utf8"),jS}function RN(){let e=yN(import.meta.url);try{return e.resolve("@ripplo/rrweb-bundle/replay")}catch{return gN(new URL("assets/rrweb-replay.js",import.meta.url))}}var PN=1,IN=1500,wd=8,MN=997;async function XS({jsonlPath:e,outDir:t,runId:n,scale:r}){if(!AN(e))return Ys({kind:"run-not-found",runId:n});let i=await VS(e),o=i[0],s=i.at(-1);if(o==null||s==null)return Ys({kind:"no-rrweb-events",runId:n});let a=s.timestamp-o.timestamp,u=(await WS(e)).map(h=>h-o.timestamp).filter(h=>h>=0&&h<=a),{delayMs:c,offsets:d}=Ol({actionOffsets:u,durationMs:a}),f=EN.join(t,"clip.gif");return(await TN({delayMs:c,events:i,gifPath:f,offsets:d,scale:r??PN})).map(()=>({durationMs:a,frameCount:d.length,gifPath:f}))}async function TN({delayMs:e,events:t,gifPath:n,offsets:r,scale:i}){let o=await YS();if(o==null)return Ys({detail:"chromium launch",kind:"browser-failed"});try{let s=await ON({browser:o,delayMs:e,events:t,offsets:r,scale:i});return await CN(n,s),kN(void 0)}catch(s){return Ys({detail:s instanceof Error?s.message:String(s),kind:"browser-failed"})}finally{await o.close()}}async function ON({browser:e,delayMs:t,events:n,offsets:r,scale:i}){let o=GS(n),s=await e.newPage({deviceScaleFactor:i,viewport:o});await s.setContent(HS(!0)),await s.addScriptTag({content:await ZS()}),await s.evaluate(NN(n));let{applyPalette:a,GIFEncoder:l,quantize:u}=await import("./gifenc.esm-GMV2LJ5K.js"),c=l(),d=r.length-1;return await r.reduce(async(f,p,h)=>{let m=await f,y=await $N({offsetMs:p,page:s});return LN({applyPalette:a,delayMs:t,gif:c,hold:h===d,png:y,quantize:u,started:m})},Promise.resolve(!1)),c.finish(),c.bytes()}function NN(e){return`(() => {
78
78
  const replayer = new globalThis.__RipploReplayer(${JSON.stringify(e)}, {
79
- insertStyleRules: [${JSON.stringify(WS)}],
79
+ insertStyleRules: [${JSON.stringify(KS)}],
80
80
  mouseTail: false,
81
81
  root: document.body,
82
82
  showWarning: false,
83
83
  });
84
84
  globalThis.__ripploClipReplayer = replayer;
85
- })()`}async function TN({offsetMs:e,page:t}){await t.evaluate(ON(e)),await t.evaluate(zS());let n=t.locator(".replayer-wrapper").first();return(await n.count()>0?n:t).screenshot({type:"png"})}function ON(e){return`globalThis.__ripploClipReplayer?.pause(${String(e+.5)})`}function NN({applyPalette:e,delayMs:t,gif:n,hold:r,png:i,quantize:o,started:s}){let{channels:a,data:l,height:u,width:c}=LS(i);if(!(l instanceof Uint8Array))throw new TypeError("clip frame is not 8-bit");let d=_N({channels:a,data:l,height:u,width:c});if(!s&&!r&&$N(d))return!1;let f=o(d,256),p=e(d,f);return n.writeFrame(p,c,u,{delay:r?t+EN:t,palette:f}),!0}function $N(e){let t=e[0]??0,n=e[1]??0,r=e[2]??0,i=4*kN,o=Math.floor(e.length/i);return Array.from({length:o}).every((s,a)=>{let l=a*i;return Math.abs((e[l]??0)-t)<=wd&&Math.abs((e[l+1]??0)-n)<=wd&&Math.abs((e[l+2]??0)-r)<=wd})}function _N({channels:e,data:t,height:n,width:r}){if(e===4)return t;if(e!==3)throw new TypeError(`unsupported clip frame channel count: ${String(e)}`);let i=r*n,o=new Uint8Array(i*4);return Array.from({length:i}).forEach((s,a)=>{o.set(t.subarray(a*3,a*3+3),a*4),o[a*4+3]=255}),o}import nv from"path";import{z as At}from"zod";import LN from"path";function qS({debugDir:e,runId:t,worker:n}){let r=LN.join(e,t,"behavior.jsonl");return n.open({file:r,runId:t}),{close:i=>n.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(DN(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:BN(i.timeNanos)};n.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{n.rrwebBatch({data:i,runId:t})}}}function Rn(e){return String(BigInt(Math.round(e))*1000000n)}function DN(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function BN(e){return Number(BigInt(e)/1000000n)}import{existsSync as FN}from"fs";import{createRequire as UN}from"module";import{fileURLToPath as jN}from"url";import{Worker as VN}from"worker_threads";var WN=UN(import.meta.url);function YS(e){let t=new VN(zN(),{workerData:e});t.unref();let n=new Map,r={next:0};t.on("message",o=>{let s=n.get(o.seq);s!=null&&(n.delete(o.seq),s())});let i=o=>{t.postMessage(o)};return{close:({noticeLineIfNoRrweb:o,runId:s})=>{let a=r.next;return r.next+=1,new Promise(l=>{n.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 zN(){try{return WN.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(n=>jN(new URL(n,import.meta.url))),t=e.find(n=>FN(n));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}function XS(e){if(e.kind==="pending-check")return null;let t={kind:"finding",source:"verifier",timeNanos:Rn(Date.now())};return e.kind==="consistency"?{...t,...GN(e.mismatch),findingKind:"consistency",pending:e.pending,step:e.step==null?"":Gt(e.step),wait:e.budget,waitMs:Vt[e.budget]}:e.kind==="impossible-action"?{...t,findingKind:e.kind,step:Gt(e.step),subject:"action could not run"}:e.kind==="unrunnable"?{...t,findingKind:e.kind,step:e.intent,subject:`step could not run (${e.reason})`}:{...t,findingKind:e.kind,step:Gt(e.step),subject:"driver error"}}function GN(e){if(e.kind==="singleton-mismatch"){let{snapshot:t,sut:n}=e;return{actual:ee(n),expected:ee(t),mismatchKind:e.kind,subject:e.singleton}}return e.kind==="wrong-value"?{actual:ee(e.sut),expected:ee(e.snapshot),mismatchKind:e.kind,subject:ZS(e.entity,e.field,e.key)}:e.kind==="expected-change"?{expected:`change from ${ee(e.value)}`,mismatchKind:e.kind,subject:ZS(e.entity,e.field,e.key)}:e.kind==="browser-mismatch"?{actual:ee(e.sut),expected:ee(e.snapshot),mismatchKind:e.kind,subject:Ke(e.key)}:{mismatchKind:e.kind,subject:`${e.entity} [${e.key}]`}}function ZS(e,t,n){return`${e}.${t} [${n}]`}import{readFile as HN}from"fs/promises";import{createRequire as KN}from"module";import{fileURLToPath as qN}from"url";var YN=KN(import.meta.url);function xd(e,t){try{return YN.resolve(e)}catch{return qN(new URL(`assets/${t}`,import.meta.url))}}var ZN=xd("@ripplo/browser-trace/bundle","browser-trace.js");async function QS(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await XN())}var JS;function XN(){return JS??=HN(ZN,{encoding:"utf8"}),JS}import{createServer as JN}from"http";import{mkdir as QN,rm as e7,writeFile as t7}from"fs/promises";import n7 from"path";import{z as re}from"zod";var r7="otlp-port",tw=re.object({key:re.string(),value:re.object({boolValue:re.boolean().optional(),doubleValue:re.number().optional(),intValue:re.union([re.string(),re.number()]).optional(),stringValue:re.string().optional()})}),i7=re.object({attributes:re.array(tw).default([]),endTimeUnixNano:re.string(),kind:re.number().default(0),name:re.string(),parentSpanId:re.string().optional(),spanId:re.string(),startTimeUnixNano:re.string(),status:re.object({code:re.number(),message:re.string().optional()}).optional(),traceId:re.string()}),o7=re.object({resourceSpans:re.array(re.object({resource:re.object({attributes:re.array(tw).default([])}).optional(),scopeSpans:re.array(re.object({spans:re.array(i7).default([])})).default([])})).default([])});async function vd({localDir:e,onRrwebBatch:t,onSpan:n,writePortFile:r}){let{port:i,server:o}=await s7({onRrwebBatch:t,onSpan:n}),s=n7.join(e,r7);return r&&(await QN(e,{recursive:!0}),await t7(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{r&&await e7(s,{force:!0}),await d7(o)}}}function s7(e){return new Promise((t,n)=>{let r=JN((i,o)=>{a7(i,o,e)});r.on("error",n),r.listen(0,()=>{let i=r.address();if(i==null||typeof i=="string"){n(new Error("otlp_receiver_no_port"));return}t({port:i.port,server:r})})})}function a7(e,t,n){let r=l7(e.url);if(r!=null){ew(e).then(i=>{n.onRrwebBatch(r,i),Zs(t)}).catch(()=>{Zs(t)});return}ew(e).then(i=>{u7(o7.parse(JSON.parse(i.toString("utf8"))),n.onSpan),Zs(t)}).catch(()=>{Zs(t)})}function l7(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function ew(e){return new Promise((t,n)=>{let r=[];e.on("data",i=>{r.push(i)}),e.on("end",()=>{t(Buffer.concat(r))}),e.on("error",n)})}function Zs(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function u7(e,t){e.resourceSpans.flatMap(n=>n.scopeSpans).flatMap(n=>n.spans).forEach(n=>{t({attributes:c7(n.attributes),durationMs:Number((BigInt(n.endTimeUnixNano)-BigInt(n.startTimeUnixNano))/1000000n),kind:"span",name:n.name,parentSpanId:n.parentSpanId,source:"server",spanId:n.spanId,spanKind:ml(n.kind),status:{code:yl(n.status?.code??0),message:n.status?.message},timeNanos:n.startTimeUnixNano,traceId:n.traceId})})}function c7(e){return Object.fromEntries(e.map(({key:t,value:n})=>[t,String(n.stringValue??n.intValue??n.doubleValue??n.boolValue??"")]))}function d7(e){return new Promise((t,n)=>{e.close(r=>{if(r==null){t();return}n(r)}),e.closeAllConnections()})}import{readFile as $L}from"fs/promises";var f7=Object.defineProperty,h7=(e,t,n)=>t in e?f7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t,n)=>h7(e,typeof t!="symbol"?t+"":t,n),nw,p7=Object.defineProperty,m7=(e,t,n)=>t in e?p7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rw=(e,t,n)=>m7(e,typeof t!="symbol"?t+"":t,n),Ne=(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))(Ne||{}),iw={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ow={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xs={},y7=()=>!!globalThis.Zone;function kf(e){if(Xs[e])return Xs[e];let t=globalThis[e],n=t.prototype,r=e in iw?iw[e]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(n,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in ow?ow[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof n[a]=="function"&&((l=n[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!y7())return Xs[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?Xs[e]=u:n}catch{return n}}var Rd={};function rn(e,t,n){var r;let i=`${e}.${String(n)}`;if(Rd[i])return Rd[i].call(t);let o=kf(e),s=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return s?(Rd[i]=s,s.call(t)):t[n]}var Ad={};function n1(e,t,n){let r=`${e}.${String(n)}`;if(Ad[r])return Ad[r].bind(t);let o=kf(e)[n];return typeof o!="function"?t[n]:(Ad[r]=o,o.bind(t))}function g7(e){return rn("Node",e,"ownerDocument")}function b7(e){return rn("Node",e,"childNodes")}function S7(e){return rn("Node",e,"parentNode")}function w7(e){return rn("Node",e,"parentElement")}function x7(e){return rn("Node",e,"textContent")}function v7(e,t){return n1("Node",e,"contains")(t)}function R7(e){return n1("Node",e,"getRootNode")()}function A7(e){return!e||!("host"in e)?null:rn("ShadowRoot",e,"host")}function C7(e){return e.styleSheets}function E7(e){return!e||!("shadowRoot"in e)?null:rn("Element",e,"shadowRoot")}function k7(e,t){return rn("Element",e,"querySelector")(t)}function P7(e,t){return rn("Element",e,"querySelectorAll")(t)}function I7(){return kf("MutationObserver").constructor}function M7(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var Be={ownerDocument:g7,childNodes:b7,parentNode:S7,parentElement:w7,textContent:x7,contains:v7,getRootNode:R7,host:A7,styleSheets:C7,shadowRoot:E7,querySelector:k7,querySelectorAll:P7,mutationObserver:I7,patch:M7};function r1(e){return e.nodeType===e.ELEMENT_NODE}function Li(e){let t=e&&"host"in e&&"mode"in e&&Be.host(e)||null;return!!(t&&"shadowRoot"in t&&Be.shadowRoot(t)===e)}function Di(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function T7(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 O7(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function Dd(e){try{let t=e.rules||e.cssRules;if(!t)return null;let n=e.href;!n&&e.ownerNode&&(n=e.ownerNode.baseURI);let r=Array.from(t,i=>i1(i,n)).join("");return T7(r)}catch{return null}}function i1(e,t){if($7(e)){let n;try{n=Dd(e.styleSheet)||O7(e)}catch{n=e.cssText}return e.styleSheet.href?Ia(n,e.styleSheet.href):n}else{let n=e.cssText;return _7(e)&&e.selectorText.includes(":")&&(n=N7(n)),t?Ia(n,t):n}}function N7(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function $7(e){return"styleSheet"in e}function _7(e){return"selectorText"in e}var Ea=class{constructor(){rw(this,"idNodeMap",new Map),rw(this,"nodeMetaMap",new WeakMap)}getId(t){var n;return t?((n=this.getMeta(t))==null?void 0:n.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 n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function L7(){return new Ea}function ka({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"",a=r&&jn(r);return(t[n.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function jn(e){return e.toLowerCase()}var sw="__rrweb_original__";function D7(e){let t=e.getContext("2d");if(!t)return!0;let n=50;for(let r=0;r<e.width;r+=n)for(let i=0;i<e.height;i+=n){let o=t.getImageData,s=sw in o?o[sw]:o;if(new Uint32Array(s.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function Pa(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?jn(t):null}function o1(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i,i=n.pathname.match(r);return i?.[1]??null}function B7(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var F7=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,U7=/^(?:[a-z+]+:)?\/\//i,j7=/^www\..*/i,V7=/^(data:)([^,]*),(.*)/i;function Ia(e,t){return(e||"").replace(F7,(n,r,i,o,s,a)=>{let l=i||s||a,u=r||o||"";if(!l)return n;if(U7.test(l)||j7.test(l))return`url(${u}${l}${u})`;if(V7.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${B7(t)+l}${u})`;let c=t.split("/"),d=l.split("/");c.pop();for(let f of d)f!=="."&&(f===".."?c.pop():c.push(f));return`url(${u}${c.join("/")}${u})`})}function Js(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function W7(e,t,n=!1){let r=Array.from(t.childNodes),i=[],o=0;if(r.length>1&&e&&typeof e=="string"){let s=Js(e,n),a=s.length/e.length;for(let l=1;l<r.length;l++)if(r[l].textContent&&typeof r[l].textContent=="string"){let u=Js(r[l].textContent,n),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 f=u.substring(0,d),p=s.split(f),h=-1;if(p.length===2)h=p[0].length;else if(p.length>2&&p[0]===""&&r[l-1].textContent!=="")h=s.indexOf(f,1);else if(p.length===1){if(f=f.substring(0,f.length-1),p=s.split(f),p.length<=1)return i.push(e),i;d=c+1}else d===u.length-1&&(h=s.indexOf(f));if(p.length>=2&&d>c){let m=r[l-1].textContent;if(m&&typeof m=="string"){let y=Js(m).length;h=s.indexOf(f,y)}h===-1&&(h=p[0].length)}if(h!==-1){let m=Math.floor(h/a);for(;m>0&&m<e.length;){if(o+=1,o>50*r.length)return i.push(e),i;let y=Js(e.substring(0,m),n);if(y.length===h){i.push(e.substring(0,m)),e=e.substring(m),s=s.substring(h);break}else y.length<h?m+=Math.max(1,Math.floor((h-y.length)/a)):m-=Math.max(1,Math.floor((y.length-h)*a))}break}}}}return i.push(e),i}function z7(e,t){return W7(e,t).join("/* rr_split */")}var G7=1,H7=new RegExp("[^a-z0-9-_:]"),Fi=-2;function s1(){return G7++}function K7(e){if(e instanceof HTMLFormElement)return"form";let t=jn(e.tagName);return H7.test(t)?"div":t}var Rr,aw,q7=/^[^ \t\n\r\u000c]+/,Y7=/^[, \t\n\r\u000c]+/;function Z7(e,t){if(t.trim()==="")return t;let n=0;function r(o){let s,a=o.exec(t.substring(n));return a?(s=a[0],n+=s.length,s):""}let i=[];for(;r(Y7),!(n>=t.length);){let o=r(q7);if(o.slice(-1)===",")o=Er(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=Er(e,o);let a=!1;for(;;){let l=t.charAt(n);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){n+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,n+=1}}}return i.join(", ")}var lw=new WeakMap;function Er(e,t){return!t||t.trim()===""?t:Pf(e,t)}function X7(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Pf(e,t){let n=lw.get(e);if(n||(n=e.createElement("a"),lw.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function a1(e,t,n,r){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&["table","td","th"].includes(t)?Er(e,r):n==="srcset"?Z7(e,r):n==="style"?Ia(r,Pf(e)):t==="object"&&n==="data"?Er(e,r):r)}function l1(e,t,n){return["video","audio"].includes(e)&&t==="autoplay"}function J7(e,t,n){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){let i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function Ma(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ma(Be.parentNode(e),t,n):!1;for(let r=e.classList.length;r--;){let i=e.classList[r];if(t.test(i))return!0}return n?Ma(Be.parentNode(e),t,n):!1}function u1(e,t,n,r){let i;if(r1(e)){if(i=e,!Be.childNodes(i).length)return!1}else{if(Be.parentElement(e)===null)return!1;i=Be.parentElement(e)}try{if(typeof t=="string"){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Ma(i,t,r))return!0;if(n){if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}}catch{}return!1}function Q7(e,t,n){let r=e.contentWindow;if(!r)return;let i=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){let a=setTimeout(()=>{i||(t(),i=!0)},n);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function e5(e,t,n){let r=!1,i;try{i=e.sheet}catch{return}if(i)return;let o=setTimeout(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{clearTimeout(o),r=!0,t()})}function t5(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:f,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:m=!1,cssCaptured:y=!1}=t,S=n5(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Ne.Document,childNodes:[],compatMode:e.compatMode}:{type:Ne.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ne.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return i5(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:f,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:m,rootId:S});case e.TEXT_NODE:return r5(e,{doc:n,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:Ne.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Ne.Comment,textContent:Be.textContent(e)||"",rootId:S};default:return!1}}function n5(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function r5(e,t){let{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:o}=t,s=Be.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=Be.textContent(e),u&&l&&(l=Ia(l,Pf(t.doc)))),!u&&!c&&l&&n&&(l=r?r(l,Be.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Ne.Text,textContent:l||"",rootId:i}}function i5(e,t){let{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:d,newlyAddedElement:f=!1,rootId:p}=t,h=J7(e,r,i),m=K7(e),y={},S=e.attributes.length;for(let g=0;g<S;g++){let x=e.attributes[g];l1(m,x.name,x.value)||(y[x.name]=a1(n,m,jn(x.name),x.value))}if(m==="link"&&o){let g=Array.from(n.styleSheets).find(P=>P.href===e.href),x=null;g&&(x=Dd(g)),x&&(delete y.rel,delete y.href,y._cssText=x)}if(m==="style"&&e.sheet){let g=Dd(e.sheet);g&&(e.childNodes.length>1&&(g=z7(g,e)),y._cssText=g)}if(["input","textarea","select"].includes(m)){let g=e.value,x=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=ka({element:e,type:Pa(e),tagName:m,value:g,maskInputOptions:s,maskInputFn:a}):x&&(y.checked=x)}if(m==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),m==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(e.__context==="2d")D7(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let g=e.toDataURL(l.type,l.quality),x=n.createElement("canvas");x.width=e.width,x.height=e.height;let P=x.toDataURL(l.type,l.quality);g!==P&&(y.rr_dataURL=g)}}if(m==="img"&&u){Rr||(Rr=n.createElement("canvas"),aw=Rr.getContext("2d"));let g=e,x=g.currentSrc||g.getAttribute("src")||"<unknown-src>",P=g.crossOrigin,N=()=>{g.removeEventListener("load",N);try{Rr.width=g.naturalWidth,Rr.height=g.naturalHeight,aw.drawImage(g,0,0),y.rr_dataURL=Rr.toDataURL(l.type,l.quality)}catch($){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?N():g.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${x}! Error: ${$}`)}g.crossOrigin==="anonymous"&&(P?y.crossOrigin=P:g.removeAttribute("crossorigin"))};g.complete&&g.naturalWidth!==0?N():g.addEventListener("load",N)}if(["audio","video"].includes(m)){let g=y;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume}if(f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),h){let{width:g,height:x}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${x}px`}}m==="iframe"&&!d(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(m)&&(w=!0)}catch{}return{type:Ne.Element,tagName:m,attributes:y,childNodes:[],isSVG:X7(e)||void 0,needBlock:h,rootId:p,isCustom:w}}function pe(e){return e==null?"":e.toLowerCase()}function c1(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 o5(e,t){if(t.comment&&e.type===Ne.Comment)return!0;if(e.type===Ne.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"&&o1(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(pe(e.attributes.name).match(/^msapplication-tile(image|color)$/)||pe(e.attributes.name)==="application-name"||pe(e.attributes.rel)==="icon"||pe(e.attributes.rel)==="apple-touch-icon"||pe(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&pe(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(pe(e.attributes.property).match(/^(og|twitter|fb):/)||pe(e.attributes.name).match(/^(og|twitter):/)||pe(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(pe(e.attributes.name)==="robots"||pe(e.attributes.name)==="googlebot"||pe(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(pe(e.attributes.name)==="author"||pe(e.attributes.name)==="generator"||pe(e.attributes.name)==="framework"||pe(e.attributes.name)==="publisher"||pe(e.attributes.name)==="progid"||pe(e.attributes.property).match(/^article:/)||pe(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(pe(e.attributes.name)==="google-site-verification"||pe(e.attributes.name)==="yandex-verification"||pe(e.attributes.name)==="csrf-token"||pe(e.attributes.name)==="p:domain_verify"||pe(e.attributes.name)==="verify-v1"||pe(e.attributes.name)==="verification"||pe(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function kr(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h={},inlineImages:m=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:P=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:$=!1,cssCaptured:_=!1}=t,{needsMask:I}=t,{preserveWhiteSpace:j=!0}=t;I||(I=u1(e,s,a,I===void 0));let V=t5(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,dataURLOptions:h,inlineImages:m,recordCanvas:y,keepIframeSrcFn:N,newlyAddedElement:$,cssCaptured:_});if(!V)return console.warn(e,"not serialized"),null;let se;r.hasNode(e)?se=r.getId(e):o5(V,p)||!j&&V.type===Ne.Text&&!V.textContent.replace(/^\s+|\s+$/gm,"").length?se=Fi:se=s1();let L=Object.assign(V,{id:se});if(r.add(e,L),se===Fi)return null;S&&S(e);let $e=!l;if(L.type===Ne.Element){$e=$e&&!L.needBlock,delete L.needBlock;let ce=Be.shadowRoot(e);ce&&Di(ce)&&(L.isShadowHost=!0)}if((L.type===Ne.Document||L.type===Ne.Element)&&$e){p.headWhitespace&&L.type===Ne.Element&&L.tagName==="head"&&(j=!1);let ce={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h,inlineImages:m,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:x,stylesheetLoadTimeout:P,keepIframeSrcFn:N,cssCaptured:!1};if(!(L.type===Ne.Element&&L.tagName==="textarea"&&L.attributes.value!==void 0)){L.type===Ne.Element&&L.attributes._cssText!==void 0&&typeof L.attributes._cssText=="string"&&(ce.cssCaptured=!0);for(let Ct of Array.from(Be.childNodes(e))){let Me=kr(Ct,ce);Me&&L.childNodes.push(Me)}}let Le=null;if(r1(e)&&(Le=Be.shadowRoot(e)))for(let Ct of Array.from(Be.childNodes(Le))){let Me=kr(Ct,ce);Me&&(Di(Le)&&(Me.isShadow=!0),L.childNodes.push(Me))}}let Ze=Be.parentNode(e);return Ze&&Li(Ze)&&Di(Ze)&&(L.isShadow=!0),L.type===Ne.Element&&L.tagName==="iframe"&&Q7(e,()=>{let ce=e.contentDocument;if(ce&&w){let Le=kr(ce,{doc:ce,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h,inlineImages:m,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:x,stylesheetLoadTimeout:P,keepIframeSrcFn:N});Le&&w(e,Le)}},g),L.type===Ne.Element&&L.tagName==="link"&&typeof L.attributes.rel=="string"&&(L.attributes.rel==="stylesheet"||L.attributes.rel==="preload"&&typeof L.attributes.href=="string"&&o1(L.attributes.href)==="css")&&e5(e,()=>{if(x){let ce=kr(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h,inlineImages:m,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:x,stylesheetLoadTimeout:P,keepIframeSrcFn:N});ce&&x(e,ce)}},P),L}function s5(e,t){let{mirror:n=new Ea,blockClass:r="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:f,slimDOM:p=!1,dataURLOptions:h,preserveWhiteSpace:m,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:x,keepIframeSrcFn:P=()=>!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,$=c1(p);return kr(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:N,maskTextFn:d,maskInputFn:f,slimDOMOptions:$,dataURLOptions:h,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:x,keepIframeSrcFn:P,newlyAddedElement:!1})}var a5=/(max|min)-device-(width|height)/,WG=new RegExp(a5.source,"g");function l5(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function u5(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var If={exports:{}},ye=String,d1=function(){return{isColorSupported:!1,reset:ye,bold:ye,dim:ye,italic:ye,underline:ye,inverse:ye,hidden:ye,strikethrough:ye,black:ye,red:ye,green:ye,yellow:ye,blue:ye,magenta:ye,cyan:ye,white:ye,gray:ye,bgBlack:ye,bgRed:ye,bgGreen:ye,bgYellow:ye,bgBlue:ye,bgMagenta:ye,bgCyan:ye,bgWhite:ye}};If.exports=d1();If.exports.createColors=d1;var c5=If.exports,d5={},f5=Object.freeze(Object.defineProperty({__proto__:null,default:d5},Symbol.toStringTag,{value:"Module"})),vt=u5(f5),uw=c5,cw=vt,Bd=class f1 extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,f1)}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 n=this.source;t==null&&(t=uw.isColorSupported),cw&&t&&(n=cw(n));let r=n.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=uw.createColors(!0);a=f=>u(d(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let d=i+1+c,f=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let p=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
85
+ })()`}async function $N({offsetMs:e,page:t}){await t.evaluate(_N(e)),await t.evaluate(qS());let n=t.locator(".replayer-wrapper").first();return(await n.count()>0?n:t).screenshot({type:"png"})}function _N(e){return`globalThis.__ripploClipReplayer?.pause(${String(e+.5)})`}function LN({applyPalette:e,delayMs:t,gif:n,hold:r,png:i,quantize:o,started:s}){let{channels:a,data:l,height:u,width:c}=US(i);if(!(l instanceof Uint8Array))throw new TypeError("clip frame is not 8-bit");let d=BN({channels:a,data:l,height:u,width:c});if(!s&&!r&&DN(d))return!1;let f=o(d,256),p=e(d,f);return n.writeFrame(p,c,u,{delay:r?t+IN:t,palette:f}),!0}function DN(e){let t=e[0]??0,n=e[1]??0,r=e[2]??0,i=4*MN,o=Math.floor(e.length/i);return Array.from({length:o}).every((s,a)=>{let l=a*i;return Math.abs((e[l]??0)-t)<=wd&&Math.abs((e[l+1]??0)-n)<=wd&&Math.abs((e[l+2]??0)-r)<=wd})}function BN({channels:e,data:t,height:n,width:r}){if(e===4)return t;if(e!==3)throw new TypeError(`unsupported clip frame channel count: ${String(e)}`);let i=r*n,o=new Uint8Array(i*4);return Array.from({length:i}).forEach((s,a)=>{o.set(t.subarray(a*3,a*3+3),a*4),o[a*4+3]=255}),o}import sv from"path";import{z as At}from"zod";import FN from"path";function JS({debugDir:e,runId:t,worker:n}){let r=FN.join(e,t,"behavior.jsonl");return n.open({file:r,runId:t}),{close:i=>n.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(UN(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:jN(i.timeNanos)};n.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{n.rrwebBatch({data:i,runId:t})}}}function Rn(e){return String(BigInt(Math.round(e))*1000000n)}function UN(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function jN(e){return Number(BigInt(e)/1000000n)}import{existsSync as VN}from"fs";import{createRequire as WN}from"module";import{fileURLToPath as zN}from"url";import{Worker as GN}from"worker_threads";var HN=WN(import.meta.url);function QS(e){let t=new GN(KN(),{workerData:e});t.unref();let n=new Map,r={next:0};t.on("message",o=>{let s=n.get(o.seq);s!=null&&(n.delete(o.seq),s())});let i=o=>{t.postMessage(o)};return{close:({noticeLineIfNoRrweb:o,runId:s})=>{let a=r.next;return r.next+=1,new Promise(l=>{n.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 KN(){try{return HN.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(n=>zN(new URL(n,import.meta.url))),t=e.find(n=>VN(n));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}function tw(e){if(e.kind==="pending-check")return null;let t={kind:"finding",source:"verifier",timeNanos:Rn(Date.now())};return e.kind==="consistency"?{...t,...qN(e.mismatch),findingKind:"consistency",pending:e.pending,step:e.step==null?"":Gt(e.step),wait:e.budget,waitMs:Vt[e.budget]}:e.kind==="impossible-action"?{...t,findingKind:e.kind,step:Gt(e.step),subject:"action could not run"}:e.kind==="unrunnable"?{...t,findingKind:e.kind,step:e.intent,subject:`step could not run (${e.reason})`}:{...t,findingKind:e.kind,step:Gt(e.step),subject:"driver error"}}function qN(e){if(e.kind==="singleton-mismatch"){let{snapshot:t,sut:n}=e;return{actual:ee(n),expected:ee(t),mismatchKind:e.kind,subject:e.singleton}}return e.kind==="wrong-value"?{actual:ee(e.sut),expected:ee(e.snapshot),mismatchKind:e.kind,subject:ew(e.entity,e.field,e.key)}:e.kind==="expected-change"?{expected:`change from ${ee(e.value)}`,mismatchKind:e.kind,subject:ew(e.entity,e.field,e.key)}:e.kind==="browser-mismatch"?{actual:ee(e.sut),expected:ee(e.snapshot),mismatchKind:e.kind,subject:Ke(e.key)}:{mismatchKind:e.kind,subject:`${e.entity} [${e.key}]`}}function ew(e,t,n){return`${e}.${t} [${n}]`}import{readFile as YN}from"fs/promises";import{createRequire as ZN}from"module";import{fileURLToPath as XN}from"url";var JN=ZN(import.meta.url);function xd(e,t){try{return JN.resolve(e)}catch{return XN(new URL(`assets/${t}`,import.meta.url))}}var QN=xd("@ripplo/browser-trace/bundle","browser-trace.js");async function rw(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await e7())}var nw;function e7(){return nw??=YN(QN,{encoding:"utf8"}),nw}import{createServer as t7}from"http";import{mkdir as n7,rm as r7,writeFile as i7}from"fs/promises";import o7 from"path";import{z as re}from"zod";var s7="otlp-port",ow=re.object({key:re.string(),value:re.object({boolValue:re.boolean().optional(),doubleValue:re.number().optional(),intValue:re.union([re.string(),re.number()]).optional(),stringValue:re.string().optional()})}),a7=re.object({attributes:re.array(ow).default([]),endTimeUnixNano:re.string(),kind:re.number().default(0),name:re.string(),parentSpanId:re.string().optional(),spanId:re.string(),startTimeUnixNano:re.string(),status:re.object({code:re.number(),message:re.string().optional()}).optional(),traceId:re.string()}),l7=re.object({resourceSpans:re.array(re.object({resource:re.object({attributes:re.array(ow).default([])}).optional(),scopeSpans:re.array(re.object({spans:re.array(a7).default([])})).default([])})).default([])});async function vd({localDir:e,onRrwebBatch:t,onSpan:n,writePortFile:r}){let{port:i,server:o}=await u7({onRrwebBatch:t,onSpan:n}),s=o7.join(e,s7);return r&&(await n7(e,{recursive:!0}),await i7(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{r&&await r7(s,{force:!0}),await p7(o)}}}function u7(e){return new Promise((t,n)=>{let r=t7((i,o)=>{c7(i,o,e)});r.on("error",n),r.listen(0,()=>{let i=r.address();if(i==null||typeof i=="string"){n(new Error("otlp_receiver_no_port"));return}t({port:i.port,server:r})})})}function c7(e,t,n){let r=d7(e.url);if(r!=null){iw(e).then(i=>{n.onRrwebBatch(r,i),Zs(t)}).catch(()=>{Zs(t)});return}iw(e).then(i=>{f7(l7.parse(JSON.parse(i.toString("utf8"))),n.onSpan),Zs(t)}).catch(()=>{Zs(t)})}function d7(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function iw(e){return new Promise((t,n)=>{let r=[];e.on("data",i=>{r.push(i)}),e.on("end",()=>{t(Buffer.concat(r))}),e.on("error",n)})}function Zs(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function f7(e,t){e.resourceSpans.flatMap(n=>n.scopeSpans).flatMap(n=>n.spans).forEach(n=>{t({attributes:h7(n.attributes),durationMs:Number((BigInt(n.endTimeUnixNano)-BigInt(n.startTimeUnixNano))/1000000n),kind:"span",name:n.name,parentSpanId:n.parentSpanId,source:"server",spanId:n.spanId,spanKind:ml(n.kind),status:{code:yl(n.status?.code??0),message:n.status?.message},timeNanos:n.startTimeUnixNano,traceId:n.traceId})})}function h7(e){return Object.fromEntries(e.map(({key:t,value:n})=>[t,String(n.stringValue??n.intValue??n.doubleValue??n.boolValue??"")]))}function p7(e){return new Promise((t,n)=>{e.close(r=>{if(r==null){t();return}n(r)}),e.closeAllConnections()})}import{readFile as DL}from"fs/promises";var m7=Object.defineProperty,y7=(e,t,n)=>t in e?m7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t,n)=>y7(e,typeof t!="symbol"?t+"":t,n),sw,g7=Object.defineProperty,b7=(e,t,n)=>t in e?g7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aw=(e,t,n)=>b7(e,typeof t!="symbol"?t+"":t,n),Ne=(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))(Ne||{}),lw={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},uw={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xs={},S7=()=>!!globalThis.Zone;function kf(e){if(Xs[e])return Xs[e];let t=globalThis[e],n=t.prototype,r=e in lw?lw[e]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(n,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in uw?uw[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof n[a]=="function"&&((l=n[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!S7())return Xs[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?Xs[e]=u:n}catch{return n}}var Rd={};function rn(e,t,n){var r;let i=`${e}.${String(n)}`;if(Rd[i])return Rd[i].call(t);let o=kf(e),s=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return s?(Rd[i]=s,s.call(t)):t[n]}var Ad={};function s1(e,t,n){let r=`${e}.${String(n)}`;if(Ad[r])return Ad[r].bind(t);let o=kf(e)[n];return typeof o!="function"?t[n]:(Ad[r]=o,o.bind(t))}function w7(e){return rn("Node",e,"ownerDocument")}function x7(e){return rn("Node",e,"childNodes")}function v7(e){return rn("Node",e,"parentNode")}function R7(e){return rn("Node",e,"parentElement")}function A7(e){return rn("Node",e,"textContent")}function C7(e,t){return s1("Node",e,"contains")(t)}function E7(e){return s1("Node",e,"getRootNode")()}function k7(e){return!e||!("host"in e)?null:rn("ShadowRoot",e,"host")}function P7(e){return e.styleSheets}function I7(e){return!e||!("shadowRoot"in e)?null:rn("Element",e,"shadowRoot")}function M7(e,t){return rn("Element",e,"querySelector")(t)}function T7(e,t){return rn("Element",e,"querySelectorAll")(t)}function O7(){return kf("MutationObserver").constructor}function N7(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var Be={ownerDocument:w7,childNodes:x7,parentNode:v7,parentElement:R7,textContent:A7,contains:C7,getRootNode:E7,host:k7,styleSheets:P7,shadowRoot:I7,querySelector:M7,querySelectorAll:T7,mutationObserver:O7,patch:N7};function a1(e){return e.nodeType===e.ELEMENT_NODE}function Li(e){let t=e&&"host"in e&&"mode"in e&&Be.host(e)||null;return!!(t&&"shadowRoot"in t&&Be.shadowRoot(t)===e)}function Di(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function $7(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 _7(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function Dd(e){try{let t=e.rules||e.cssRules;if(!t)return null;let n=e.href;!n&&e.ownerNode&&(n=e.ownerNode.baseURI);let r=Array.from(t,i=>l1(i,n)).join("");return $7(r)}catch{return null}}function l1(e,t){if(D7(e)){let n;try{n=Dd(e.styleSheet)||_7(e)}catch{n=e.cssText}return e.styleSheet.href?Ia(n,e.styleSheet.href):n}else{let n=e.cssText;return B7(e)&&e.selectorText.includes(":")&&(n=L7(n)),t?Ia(n,t):n}}function L7(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function D7(e){return"styleSheet"in e}function B7(e){return"selectorText"in e}var Ea=class{constructor(){aw(this,"idNodeMap",new Map),aw(this,"nodeMetaMap",new WeakMap)}getId(t){var n;return t?((n=this.getMeta(t))==null?void 0:n.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 n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function F7(){return new Ea}function ka({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"",a=r&&jn(r);return(t[n.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function jn(e){return e.toLowerCase()}var cw="__rrweb_original__";function U7(e){let t=e.getContext("2d");if(!t)return!0;let n=50;for(let r=0;r<e.width;r+=n)for(let i=0;i<e.height;i+=n){let o=t.getImageData,s=cw in o?o[cw]:o;if(new Uint32Array(s.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function Pa(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?jn(t):null}function u1(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i,i=n.pathname.match(r);return i?.[1]??null}function j7(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var V7=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,W7=/^(?:[a-z+]+:)?\/\//i,z7=/^www\..*/i,G7=/^(data:)([^,]*),(.*)/i;function Ia(e,t){return(e||"").replace(V7,(n,r,i,o,s,a)=>{let l=i||s||a,u=r||o||"";if(!l)return n;if(W7.test(l)||z7.test(l))return`url(${u}${l}${u})`;if(G7.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${j7(t)+l}${u})`;let c=t.split("/"),d=l.split("/");c.pop();for(let f of d)f!=="."&&(f===".."?c.pop():c.push(f));return`url(${u}${c.join("/")}${u})`})}function Js(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function H7(e,t,n=!1){let r=Array.from(t.childNodes),i=[],o=0;if(r.length>1&&e&&typeof e=="string"){let s=Js(e,n),a=s.length/e.length;for(let l=1;l<r.length;l++)if(r[l].textContent&&typeof r[l].textContent=="string"){let u=Js(r[l].textContent,n),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 f=u.substring(0,d),p=s.split(f),h=-1;if(p.length===2)h=p[0].length;else if(p.length>2&&p[0]===""&&r[l-1].textContent!=="")h=s.indexOf(f,1);else if(p.length===1){if(f=f.substring(0,f.length-1),p=s.split(f),p.length<=1)return i.push(e),i;d=c+1}else d===u.length-1&&(h=s.indexOf(f));if(p.length>=2&&d>c){let m=r[l-1].textContent;if(m&&typeof m=="string"){let y=Js(m).length;h=s.indexOf(f,y)}h===-1&&(h=p[0].length)}if(h!==-1){let m=Math.floor(h/a);for(;m>0&&m<e.length;){if(o+=1,o>50*r.length)return i.push(e),i;let y=Js(e.substring(0,m),n);if(y.length===h){i.push(e.substring(0,m)),e=e.substring(m),s=s.substring(h);break}else y.length<h?m+=Math.max(1,Math.floor((h-y.length)/a)):m-=Math.max(1,Math.floor((y.length-h)*a))}break}}}}return i.push(e),i}function K7(e,t){return H7(e,t).join("/* rr_split */")}var q7=1,Y7=new RegExp("[^a-z0-9-_:]"),Fi=-2;function c1(){return q7++}function Z7(e){if(e instanceof HTMLFormElement)return"form";let t=jn(e.tagName);return Y7.test(t)?"div":t}var Rr,dw,X7=/^[^ \t\n\r\u000c]+/,J7=/^[, \t\n\r\u000c]+/;function Q7(e,t){if(t.trim()==="")return t;let n=0;function r(o){let s,a=o.exec(t.substring(n));return a?(s=a[0],n+=s.length,s):""}let i=[];for(;r(J7),!(n>=t.length);){let o=r(X7);if(o.slice(-1)===",")o=Er(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=Er(e,o);let a=!1;for(;;){let l=t.charAt(n);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){n+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,n+=1}}}return i.join(", ")}var fw=new WeakMap;function Er(e,t){return!t||t.trim()===""?t:Pf(e,t)}function e5(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Pf(e,t){let n=fw.get(e);if(n||(n=e.createElement("a"),fw.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function d1(e,t,n,r){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&["table","td","th"].includes(t)?Er(e,r):n==="srcset"?Q7(e,r):n==="style"?Ia(r,Pf(e)):t==="object"&&n==="data"?Er(e,r):r)}function f1(e,t,n){return["video","audio"].includes(e)&&t==="autoplay"}function t5(e,t,n){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){let i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function Ma(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ma(Be.parentNode(e),t,n):!1;for(let r=e.classList.length;r--;){let i=e.classList[r];if(t.test(i))return!0}return n?Ma(Be.parentNode(e),t,n):!1}function h1(e,t,n,r){let i;if(a1(e)){if(i=e,!Be.childNodes(i).length)return!1}else{if(Be.parentElement(e)===null)return!1;i=Be.parentElement(e)}try{if(typeof t=="string"){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Ma(i,t,r))return!0;if(n){if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}}catch{}return!1}function n5(e,t,n){let r=e.contentWindow;if(!r)return;let i=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){let a=setTimeout(()=>{i||(t(),i=!0)},n);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function r5(e,t,n){let r=!1,i;try{i=e.sheet}catch{return}if(i)return;let o=setTimeout(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{clearTimeout(o),r=!0,t()})}function i5(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:f,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:m=!1,cssCaptured:y=!1}=t,S=o5(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Ne.Document,childNodes:[],compatMode:e.compatMode}:{type:Ne.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ne.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return a5(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:f,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:m,rootId:S});case e.TEXT_NODE:return s5(e,{doc:n,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:Ne.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Ne.Comment,textContent:Be.textContent(e)||"",rootId:S};default:return!1}}function o5(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function s5(e,t){let{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:o}=t,s=Be.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=Be.textContent(e),u&&l&&(l=Ia(l,Pf(t.doc)))),!u&&!c&&l&&n&&(l=r?r(l,Be.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Ne.Text,textContent:l||"",rootId:i}}function a5(e,t){let{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:d,newlyAddedElement:f=!1,rootId:p}=t,h=t5(e,r,i),m=Z7(e),y={},S=e.attributes.length;for(let g=0;g<S;g++){let x=e.attributes[g];f1(m,x.name,x.value)||(y[x.name]=d1(n,m,jn(x.name),x.value))}if(m==="link"&&o){let g=Array.from(n.styleSheets).find(P=>P.href===e.href),x=null;g&&(x=Dd(g)),x&&(delete y.rel,delete y.href,y._cssText=x)}if(m==="style"&&e.sheet){let g=Dd(e.sheet);g&&(e.childNodes.length>1&&(g=K7(g,e)),y._cssText=g)}if(["input","textarea","select"].includes(m)){let g=e.value,x=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=ka({element:e,type:Pa(e),tagName:m,value:g,maskInputOptions:s,maskInputFn:a}):x&&(y.checked=x)}if(m==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),m==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(e.__context==="2d")U7(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let g=e.toDataURL(l.type,l.quality),x=n.createElement("canvas");x.width=e.width,x.height=e.height;let P=x.toDataURL(l.type,l.quality);g!==P&&(y.rr_dataURL=g)}}if(m==="img"&&u){Rr||(Rr=n.createElement("canvas"),dw=Rr.getContext("2d"));let g=e,x=g.currentSrc||g.getAttribute("src")||"<unknown-src>",P=g.crossOrigin,N=()=>{g.removeEventListener("load",N);try{Rr.width=g.naturalWidth,Rr.height=g.naturalHeight,dw.drawImage(g,0,0),y.rr_dataURL=Rr.toDataURL(l.type,l.quality)}catch($){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?N():g.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${x}! Error: ${$}`)}g.crossOrigin==="anonymous"&&(P?y.crossOrigin=P:g.removeAttribute("crossorigin"))};g.complete&&g.naturalWidth!==0?N():g.addEventListener("load",N)}if(["audio","video"].includes(m)){let g=y;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume}if(f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),h){let{width:g,height:x}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${x}px`}}m==="iframe"&&!d(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(m)&&(w=!0)}catch{}return{type:Ne.Element,tagName:m,attributes:y,childNodes:[],isSVG:e5(e)||void 0,needBlock:h,rootId:p,isCustom:w}}function pe(e){return e==null?"":e.toLowerCase()}function p1(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 l5(e,t){if(t.comment&&e.type===Ne.Comment)return!0;if(e.type===Ne.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"&&u1(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(pe(e.attributes.name).match(/^msapplication-tile(image|color)$/)||pe(e.attributes.name)==="application-name"||pe(e.attributes.rel)==="icon"||pe(e.attributes.rel)==="apple-touch-icon"||pe(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&pe(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(pe(e.attributes.property).match(/^(og|twitter|fb):/)||pe(e.attributes.name).match(/^(og|twitter):/)||pe(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(pe(e.attributes.name)==="robots"||pe(e.attributes.name)==="googlebot"||pe(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(pe(e.attributes.name)==="author"||pe(e.attributes.name)==="generator"||pe(e.attributes.name)==="framework"||pe(e.attributes.name)==="publisher"||pe(e.attributes.name)==="progid"||pe(e.attributes.property).match(/^article:/)||pe(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(pe(e.attributes.name)==="google-site-verification"||pe(e.attributes.name)==="yandex-verification"||pe(e.attributes.name)==="csrf-token"||pe(e.attributes.name)==="p:domain_verify"||pe(e.attributes.name)==="verify-v1"||pe(e.attributes.name)==="verification"||pe(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function kr(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h={},inlineImages:m=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:P=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:$=!1,cssCaptured:_=!1}=t,{needsMask:I}=t,{preserveWhiteSpace:j=!0}=t;I||(I=h1(e,s,a,I===void 0));let V=i5(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,dataURLOptions:h,inlineImages:m,recordCanvas:y,keepIframeSrcFn:N,newlyAddedElement:$,cssCaptured:_});if(!V)return console.warn(e,"not serialized"),null;let se;r.hasNode(e)?se=r.getId(e):l5(V,p)||!j&&V.type===Ne.Text&&!V.textContent.replace(/^\s+|\s+$/gm,"").length?se=Fi:se=c1();let L=Object.assign(V,{id:se});if(r.add(e,L),se===Fi)return null;S&&S(e);let $e=!l;if(L.type===Ne.Element){$e=$e&&!L.needBlock,delete L.needBlock;let ce=Be.shadowRoot(e);ce&&Di(ce)&&(L.isShadowHost=!0)}if((L.type===Ne.Document||L.type===Ne.Element)&&$e){p.headWhitespace&&L.type===Ne.Element&&L.tagName==="head"&&(j=!1);let ce={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h,inlineImages:m,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:x,stylesheetLoadTimeout:P,keepIframeSrcFn:N,cssCaptured:!1};if(!(L.type===Ne.Element&&L.tagName==="textarea"&&L.attributes.value!==void 0)){L.type===Ne.Element&&L.attributes._cssText!==void 0&&typeof L.attributes._cssText=="string"&&(ce.cssCaptured=!0);for(let Ct of Array.from(Be.childNodes(e))){let Me=kr(Ct,ce);Me&&L.childNodes.push(Me)}}let Le=null;if(a1(e)&&(Le=Be.shadowRoot(e)))for(let Ct of Array.from(Be.childNodes(Le))){let Me=kr(Ct,ce);Me&&(Di(Le)&&(Me.isShadow=!0),L.childNodes.push(Me))}}let Ze=Be.parentNode(e);return Ze&&Li(Ze)&&Di(Ze)&&(L.isShadow=!0),L.type===Ne.Element&&L.tagName==="iframe"&&n5(e,()=>{let ce=e.contentDocument;if(ce&&w){let Le=kr(ce,{doc:ce,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h,inlineImages:m,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:x,stylesheetLoadTimeout:P,keepIframeSrcFn:N});Le&&w(e,Le)}},g),L.type===Ne.Element&&L.tagName==="link"&&typeof L.attributes.rel=="string"&&(L.attributes.rel==="stylesheet"||L.attributes.rel==="preload"&&typeof L.attributes.href=="string"&&u1(L.attributes.href)==="css")&&r5(e,()=>{if(x){let ce=kr(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h,inlineImages:m,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:x,stylesheetLoadTimeout:P,keepIframeSrcFn:N});ce&&x(e,ce)}},P),L}function u5(e,t){let{mirror:n=new Ea,blockClass:r="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:f,slimDOM:p=!1,dataURLOptions:h,preserveWhiteSpace:m,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:x,keepIframeSrcFn:P=()=>!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,$=p1(p);return kr(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:N,maskTextFn:d,maskInputFn:f,slimDOMOptions:$,dataURLOptions:h,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:x,keepIframeSrcFn:P,newlyAddedElement:!1})}var c5=/(max|min)-device-(width|height)/,qG=new RegExp(c5.source,"g");function d5(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function f5(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var If={exports:{}},ye=String,m1=function(){return{isColorSupported:!1,reset:ye,bold:ye,dim:ye,italic:ye,underline:ye,inverse:ye,hidden:ye,strikethrough:ye,black:ye,red:ye,green:ye,yellow:ye,blue:ye,magenta:ye,cyan:ye,white:ye,gray:ye,bgBlack:ye,bgRed:ye,bgGreen:ye,bgYellow:ye,bgBlue:ye,bgMagenta:ye,bgCyan:ye,bgWhite:ye}};If.exports=m1();If.exports.createColors=m1;var h5=If.exports,p5={},m5=Object.freeze(Object.defineProperty({__proto__:null,default:p5},Symbol.toStringTag,{value:"Module"})),vt=f5(m5),hw=h5,pw=vt,Bd=class y1 extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,y1)}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 n=this.source;t==null&&(t=hw.isColorSupported),pw&&t&&(n=pw(n));let r=n.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=hw.createColors(!0);a=f=>u(d(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let d=i+1+c,f=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let p=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
86
86
  `+p+a("^")}return" "+l(f)+u}).join(`
87
87
  `)}toString(){let t=this.showSourceCode();return t&&(t=`
88
88
 
89
89
  `+t+`
90
- `),this.name+": "+this.message+t}},Mf=Bd;Bd.default=Bd;var Yi={};Yi.isClean=Symbol("isClean");Yi.my=Symbol("my");var dw={after:`
90
+ `),this.name+": "+this.message+t}},Mf=Bd;Bd.default=Bd;var Yi={};Yi.isClean=Symbol("isClean");Yi.my=Symbol("my");var mw={after:`
91
91
  `,beforeClose:`
92
92
  `,beforeComment:`
93
93
  `,beforeDecl:`
94
94
  `,beforeOpen:" ",beforeRule:`
95
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function h5(e){return e[0].toUpperCase()+e.slice(1)}var Fd=class{constructor(t){this.builder=t}atrule(t,n){let r="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?r+=t.raws.afterName:i&&(r+=" "),t.nodes)this.block(t,r+i);else{let o=(t.raws.between||"")+(n?";":"");this.builder(r+i+o,t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
96
- `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)r+=s}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(n+r+"{",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 n=t.nodes.length-1;for(;n>0&&t.nodes[n].type==="comment";)n-=1;let r=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,n!==i||r)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder("/*"+n+t.text+r+"*/",t)}decl(t,n){let r=this.raw(t,"between","colon"),i=t.prop+r+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),n&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return dw[r];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[r]<"u")return s.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let a="raw"+h5(r);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=dw[r]),s.rawCache[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`
95
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function y5(e){return e[0].toUpperCase()+e.slice(1)}var Fd=class{constructor(t){this.builder=t}atrule(t,n){let r="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?r+=t.raws.afterName:i&&(r+=" "),t.nodes)this.block(t,r+i);else{let o=(t.raws.between||"")+(n?";":"");this.builder(r+i+o,t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
96
+ `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)r+=s}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(n+r+"{",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 n=t.nodes.length-1;for(;n>0&&t.nodes[n].type==="comment";)n-=1;let r=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,n!==i||r)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder("/*"+n+t.text+r+"*/",t)}decl(t,n){let r=this.raw(t,"between","colon"),i=t.prop+r+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),n&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return mw[r];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[r]<"u")return s.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let a="raw"+y5(r);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=mw[r]),s.rawCache[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`
97
97
  `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
98
98
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
99
99
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`
100
100
  `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
101
- `);return n=o[o.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}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,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}},h1=Fd;Fd.default=Fd;var p5=h1;function Ud(e,t){new p5(t).stringify(e)}var Wa=Ud;Ud.default=Ud;var{isClean:Qs,my:m5}=Yi,y5=Mf,g5=h1,b5=Wa;function jd(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(s=>jd(s,n)):(o==="object"&&i!==null&&(i=jd(i)),n[r]=i)}return n}var Vd=class{constructor(t={}){this.raws={},this[Qs]=!1,this[m5]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];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 n=jd(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new y5(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markDirty(){if(this[Qs]){this[Qs]=!1;let t=this;for(;t=t.parent;)t[Qs]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,n){let r=this.source.start;if(t.index)r=this.positionInside(t.index,n);else if(t.word){n=this.toString();let i=n.indexOf(t.word);i!==-1&&(r=this.positionInside(i,n))}return r}positionInside(t,n){let r=n||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)r[s]===`
102
- `?(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 n={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:n.column+1,line:n.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(n=this.positionInside(o,i),r=this.positionInside(o+t.word.length,i))}else t.start?n={column:t.start.column,line:t.start.line}:t.index&&(n=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<n.line||r.line===n.line&&r.column<=n.column)&&(r={column:n.column+1,line:n.line}),{end:r,start:n}}raw(t,n){return new g5().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r={},i=n==null;n=n||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))r[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,n):l);else if(typeof a=="object"&&a.toJSON)r[s]=a.toJSON(null,n);else if(s==="source"){let l=n.get(a.input);l==null&&(l=o,n.set(a.input,o),o++),r[s]={end:a.end,inputId:l,start:a.start}}else r[s]=a}return i&&(r.inputs=[...n.keys()].map(s=>s.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=b5){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}get proxyOf(){return this}},za=Vd;Vd.default=Vd;var S5=za,Wd=class extends S5{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]==="$"}},Ga=Wd;Wd.default=Wd;var w5="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",x5=(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r},v5=(e=21)=>{let t="",n=e;for(;n--;)t+=w5[Math.random()*64|0];return t},R5={nanoid:v5,customAlphabet:x5},{SourceMapConsumer:fw,SourceMapGenerator:hw}=vt,{existsSync:A5,readFileSync:C5}=vt,{dirname:Cd,join:E5}=vt;function k5(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var zd=class{constructor(t,n){if(n.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Cd(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new fw(this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^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(n.test(t)||r.test(t))return k5(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 n=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t){if(this.root=Cd(t),A5(t))return this.mapFile=t,C5(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof fw)return hw.fromSourceMap(n).toString();if(n instanceof hw)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return t&&(r=E5(Cd(t),r)),this.loadFile(r)}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},p1=zd;zd.default=zd;var{SourceMapConsumer:P5,SourceMapGenerator:I5}=vt,{fileURLToPath:pw,pathToFileURL:ea}=vt,{isAbsolute:Gd,resolve:Hd}=vt,{nanoid:M5}=R5,Ed=vt,mw=Mf,T5=p1,kd=Symbol("fromOffsetCache"),O5=!!(P5&&I5),yw=!!(Hd&&Gd),Ta=class{constructor(t,n={}){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,n.from&&(!yw||/^\w+:\/\//.test(n.from)||Gd(n.from)?this.file=n.from:this.file=Hd(n.from)),yw&&O5){let r=new T5(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+M5(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,s,a;if(n&&typeof n=="object"){let u=n,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);n=d.line,r=d.col}else n=u.line,r=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(!r){let u=this.fromOffset(n);n=u.line,r=u.col}let l=this.origin(n,r,s,a);return l?o=new mw(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 mw(t,s===void 0?n:{column:r,line:n},s===void 0?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:n,source:this.css},this.file&&(ea&&(o.input.url=ea(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let n,r;if(this[kd])r=this[kd];else{let o=this.css.split(`
103
- `);r=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)r[a]=s,s+=o[a].length+1;this[kd]=r}n=r[r.length-1];let i=0;if(t>=n)i=r.length-1;else{let o=r.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<r[s])o=s-1;else if(t>=r[s+1])i=s+1;else{i=s;break}}return{col:t-r[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Hd(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:t});if(!s.source)return!1;let a;typeof r=="number"&&(a=o.originalPositionFor({column:i,line:r}));let l;Gd(s.source)?l=ea(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||ea(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(pw)u.file=pw(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 n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},Ha=Ta;Ta.default=Ta;Ed&&Ed.registerInput&&Ed.registerInput(Ta);var{SourceMapConsumer:m1,SourceMapGenerator:wa}=vt,{dirname:xa,relative:y1,resolve:g1,sep:b1}=vt,{pathToFileURL:gw}=vt,N5=Ha,$5=!!(m1&&wa),_5=!!(xa&&g1&&y1&&b1),L5=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,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 n=`
101
+ `);return n=o[o.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}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,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}},g1=Fd;Fd.default=Fd;var g5=g1;function Ud(e,t){new g5(t).stringify(e)}var Wa=Ud;Ud.default=Ud;var{isClean:Qs,my:b5}=Yi,S5=Mf,w5=g1,x5=Wa;function jd(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(s=>jd(s,n)):(o==="object"&&i!==null&&(i=jd(i)),n[r]=i)}return n}var Vd=class{constructor(t={}){this.raws={},this[Qs]=!1,this[b5]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];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 n=jd(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new S5(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markDirty(){if(this[Qs]){this[Qs]=!1;let t=this;for(;t=t.parent;)t[Qs]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,n){let r=this.source.start;if(t.index)r=this.positionInside(t.index,n);else if(t.word){n=this.toString();let i=n.indexOf(t.word);i!==-1&&(r=this.positionInside(i,n))}return r}positionInside(t,n){let r=n||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)r[s]===`
102
+ `?(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 n={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:n.column+1,line:n.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(n=this.positionInside(o,i),r=this.positionInside(o+t.word.length,i))}else t.start?n={column:t.start.column,line:t.start.line}:t.index&&(n=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<n.line||r.line===n.line&&r.column<=n.column)&&(r={column:n.column+1,line:n.line}),{end:r,start:n}}raw(t,n){return new w5().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r={},i=n==null;n=n||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))r[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,n):l);else if(typeof a=="object"&&a.toJSON)r[s]=a.toJSON(null,n);else if(s==="source"){let l=n.get(a.input);l==null&&(l=o,n.set(a.input,o),o++),r[s]={end:a.end,inputId:l,start:a.start}}else r[s]=a}return i&&(r.inputs=[...n.keys()].map(s=>s.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=x5){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}get proxyOf(){return this}},za=Vd;Vd.default=Vd;var v5=za,Wd=class extends v5{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]==="$"}},Ga=Wd;Wd.default=Wd;var R5="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",A5=(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r},C5=(e=21)=>{let t="",n=e;for(;n--;)t+=R5[Math.random()*64|0];return t},E5={nanoid:C5,customAlphabet:A5},{SourceMapConsumer:yw,SourceMapGenerator:gw}=vt,{existsSync:k5,readFileSync:P5}=vt,{dirname:Cd,join:I5}=vt;function M5(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var zd=class{constructor(t,n){if(n.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Cd(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new yw(this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^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(n.test(t)||r.test(t))return M5(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 n=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t){if(this.root=Cd(t),k5(t))return this.mapFile=t,P5(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof yw)return gw.fromSourceMap(n).toString();if(n instanceof gw)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return t&&(r=I5(Cd(t),r)),this.loadFile(r)}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},b1=zd;zd.default=zd;var{SourceMapConsumer:T5,SourceMapGenerator:O5}=vt,{fileURLToPath:bw,pathToFileURL:ea}=vt,{isAbsolute:Gd,resolve:Hd}=vt,{nanoid:N5}=E5,Ed=vt,Sw=Mf,$5=b1,kd=Symbol("fromOffsetCache"),_5=!!(T5&&O5),ww=!!(Hd&&Gd),Ta=class{constructor(t,n={}){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,n.from&&(!ww||/^\w+:\/\//.test(n.from)||Gd(n.from)?this.file=n.from:this.file=Hd(n.from)),ww&&_5){let r=new $5(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+N5(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,s,a;if(n&&typeof n=="object"){let u=n,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);n=d.line,r=d.col}else n=u.line,r=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(!r){let u=this.fromOffset(n);n=u.line,r=u.col}let l=this.origin(n,r,s,a);return l?o=new Sw(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 Sw(t,s===void 0?n:{column:r,line:n},s===void 0?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:n,source:this.css},this.file&&(ea&&(o.input.url=ea(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let n,r;if(this[kd])r=this[kd];else{let o=this.css.split(`
103
+ `);r=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)r[a]=s,s+=o[a].length+1;this[kd]=r}n=r[r.length-1];let i=0;if(t>=n)i=r.length-1;else{let o=r.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<r[s])o=s-1;else if(t>=r[s+1])i=s+1;else{i=s;break}}return{col:t-r[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Hd(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:t});if(!s.source)return!1;let a;typeof r=="number"&&(a=o.originalPositionFor({column:i,line:r}));let l;Gd(s.source)?l=ea(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||ea(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(bw)u.file=bw(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 n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},Ha=Ta;Ta.default=Ta;Ed&&Ed.registerInput&&Ed.registerInput(Ta);var{SourceMapConsumer:S1,SourceMapGenerator:wa}=vt,{dirname:xa,relative:w1,resolve:x1,sep:v1}=vt,{pathToFileURL:xw}=vt,L5=Ha,D5=!!(S1&&wa),B5=!!(xa&&x1&&w1&&v1),F5=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,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 n=`
104
104
  `;this.css.includes(`\r
105
105
  `)&&(n=`\r
106
- `),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||xa(t.file),i;this.mapOpts.sourcesContent===!1?(i=new m1(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),_5&&$5&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[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=wa.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new wa({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 wa({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<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=n-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=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
107
- `),n=a.length-s):n+=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=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-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(n=>n.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 n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?xa(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=xa(g1(r,this.mapOpts.annotation)));let i=y1(r,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 n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new N5(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,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 n=this.memoizedFileURLs.get(t);if(n)return n;if(gw){let r=gw(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;b1==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},S1=L5,D5=za,Kd=class extends D5{constructor(t){super(t),this.type="comment"}},Ka=Kd;Kd.default=Kd;var{isClean:w1,my:x1}=Yi,v1=Ga,R1=Ka,B5=za,A1,Tf,Of,C1;function E1(e){return e.map(t=>(t.nodes&&(t.nodes=E1(t.nodes)),delete t.source,t))}function k1(e){if(e[w1]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)k1(t)}var tn=class P1 extends B5{append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],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,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let s of i)this.proxyOf.nodes.splice(r+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],r<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let s;for(let a in this.indexes)s=this.indexes[a],r<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=E1(A1(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 v1(t)]}else if(t.selector)t=[new Tf(t)];else if(t.name)t=[new Of(t)];else if(t.text)t=[new R1(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[x1]||P1.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[w1]&&k1(i),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.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 n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,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]}};tn.registerParse=e=>{A1=e};tn.registerRule=e=>{Tf=e};tn.registerAtRule=e=>{Of=e};tn.registerRoot=e=>{C1=e};var Vn=tn;tn.default=tn;tn.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Of.prototype):e.type==="rule"?Object.setPrototypeOf(e,Tf.prototype):e.type==="decl"?Object.setPrototypeOf(e,v1.prototype):e.type==="comment"?Object.setPrototypeOf(e,R1.prototype):e.type==="root"&&Object.setPrototypeOf(e,C1.prototype),e[x1]=!0,e.nodes&&e.nodes.forEach(t=>{tn.rebuild(t)})};var F5=Vn,I1,M1,Ui=class extends F5{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new I1(new M1,this,t).stringify()}};Ui.registerLazyResult=e=>{I1=e};Ui.registerProcessor=e=>{M1=e};var Nf=Ui;Ui.default=Ui;var bw={},T1=function(t){bw[t]||(bw[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},qd=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}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}},O1=qd;qd.default=qd;var U5=O1,Yd=class{constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new U5(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},$f=Yd;Yd.default=Yd;var Pd=39,Sw=34,ta=92,ww=47,na=10,Ti=32,ra=12,ia=9,oa=13,j5=91,V5=93,W5=40,z5=41,G5=123,H5=125,K5=59,q5=42,Y5=58,Z5=64,sa=/[\t\n\f\r "#'()/;[\\\]{}]/g,aa=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,X5=/.[\r\n"'(/\\]/,xw=/[\da-f]/i,J5=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,f,p,h,m=r.length,y=0,S=[],w=[];function g(){return y}function x(_){throw t.error("Unclosed "+_,y)}function P(){return w.length===0&&y>=m}function N(_){if(w.length)return w.pop();if(y>=m)return;let I=_?_.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case na:case Ti:case ia:case oa:case ra:{s=y;do s+=1,o=r.charCodeAt(s);while(o===Ti||o===na||o===ia||o===oa||o===ra);h=["space",r.slice(y,s)],y=s-1;break}case j5:case V5:case G5:case H5:case Y5:case K5:case z5:{let j=String.fromCharCode(o);h=[j,j,y];break}case W5:{if(f=S.length?S.pop()[1]:"",p=r.charCodeAt(y+1),f==="url"&&p!==Pd&&p!==Sw&&p!==Ti&&p!==na&&p!==ia&&p!==ra&&p!==oa){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||I){s=y;break}else x("bracket");for(d=s;r.charCodeAt(d-1)===ta;)d-=1,c=!c}while(c);h=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||X5.test(l)?h=["(","(",y]:(h=["brackets",l,y,s],y=s);break}case Pd:case Sw:{a=o===Pd?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||I){s=y+1;break}else x("string");for(d=s;r.charCodeAt(d-1)===ta;)d-=1,c=!c}while(c);h=["string",r.slice(y,s+1),y,s],y=s;break}case Z5:{sa.lastIndex=y+1,sa.test(r),sa.lastIndex===0?s=r.length-1:s=sa.lastIndex-2,h=["at-word",r.slice(y,s+1),y,s],y=s;break}case ta:{for(s=y,u=!0;r.charCodeAt(s+1)===ta;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==ww&&o!==Ti&&o!==na&&o!==ia&&o!==oa&&o!==ra&&(s+=1,xw.test(r.charAt(s)))){for(;xw.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===Ti&&(s+=1)}h=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===ww&&r.charCodeAt(y+1)===q5?(s=r.indexOf("*/",y+2)+1,s===0&&(i||I?s=r.length:x("comment")),h=["comment",r.slice(y,s+1),y,s],y=s):(aa.lastIndex=y+1,aa.test(r),aa.lastIndex===0?s=r.length-1:s=aa.lastIndex-2,h=["word",r.slice(y,s+1),y,s],S.push(h),y=s);break}}return y++,h}function $(_){w.push(_)}return{back:$,endOfFile:P,nextToken:N,position:g}},N1=Vn,Oa=class extends N1{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)}},_f=Oa;Oa.default=Oa;N1.registerAtRule(Oa);var $1=Vn,_1,L1,Ir=class extends $1{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let o of i)o.raws.before=n.raws.before}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new _1(new L1,this,t).stringify()}};Ir.registerLazyResult=e=>{_1=e};Ir.registerProcessor=e=>{L1=e};var Zi=Ir;Ir.default=Ir;$1.registerRoot(Ir);var ji={comma(e){return ji.split(e,[","],!0)},space(e){let t=[" ",`
108
- `," "];return ji.split(e,t)},split(e,t,n){let r=[],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!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}},D1=ji;ji.default=ji;var B1=Vn,Q5=D1,Na=class extends B1{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Q5.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}},Lf=Na;Na.default=Na;B1.registerRule(Na);var e$=Ga,t$=J5,n$=Ka,r$=_f,i$=Zi,vw=Lf,Rw={empty:!0,space:!0};function o$(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var s$=class{constructor(t){this.input=t,this.root=new i$,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 n=new r$;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(n.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(n,"params",l),s&&(t=l[l.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),a&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[s,a]of t.entries()){if(r=a,i=r[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=r}return!1}comment(t){let n=new n$;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(/^\s*$/.test(r))n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=t$(this.input)}decl(t,n){let r=new e$;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||o$(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.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"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let f=u;f>0;f--){let p=c[f][0];if(d.trim().indexOf("!")===0&&p!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(r,"value",s.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new vw;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}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 n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),s.push(r==="("?")":"]");else if(a&&i&&r==="{")o||(o=u),s.push("}");else if(s.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),n=!0;break}else r===":"&&(i=!0);else r===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&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,n,r,i){let o,s,a=r.length,l="",u=!0,c,d;for(let f=0;f<a;f+=1)o=r[f],s=o[0],s==="space"&&f===a-1&&!i?u=!1:s==="comment"?(d=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!Rw[d]&&!Rw[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let f=r.reduce((p,h)=>p+h[1],"");t.raws[n]={raw:f,value:l}}t[n]=l}rule(t){t.pop();let n=new vw;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}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,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}},a$=s$,l$=Vn,u$=a$,c$=Ha;function $a(e,t){let n=new c$(e,t),r=new u$(n);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
106
+ `),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||xa(t.file),i;this.mapOpts.sourcesContent===!1?(i=new S1(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),B5&&D5&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[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=wa.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new wa({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 wa({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<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=n-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=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
107
+ `),n=a.length-s):n+=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=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-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(n=>n.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 n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?xa(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=xa(x1(r,this.mapOpts.annotation)));let i=w1(r,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 n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new L5(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,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 n=this.memoizedFileURLs.get(t);if(n)return n;if(xw){let r=xw(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;v1==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},R1=F5,U5=za,Kd=class extends U5{constructor(t){super(t),this.type="comment"}},Ka=Kd;Kd.default=Kd;var{isClean:A1,my:C1}=Yi,E1=Ga,k1=Ka,j5=za,P1,Tf,Of,I1;function M1(e){return e.map(t=>(t.nodes&&(t.nodes=M1(t.nodes)),delete t.source,t))}function T1(e){if(e[A1]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)T1(t)}var tn=class O1 extends j5{append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],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,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let s of i)this.proxyOf.nodes.splice(r+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],r<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let s;for(let a in this.indexes)s=this.indexes[a],r<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=M1(P1(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 E1(t)]}else if(t.selector)t=[new Tf(t)];else if(t.name)t=[new Of(t)];else if(t.text)t=[new k1(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[C1]||O1.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[A1]&&T1(i),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.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 n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,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]}};tn.registerParse=e=>{P1=e};tn.registerRule=e=>{Tf=e};tn.registerAtRule=e=>{Of=e};tn.registerRoot=e=>{I1=e};var Vn=tn;tn.default=tn;tn.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Of.prototype):e.type==="rule"?Object.setPrototypeOf(e,Tf.prototype):e.type==="decl"?Object.setPrototypeOf(e,E1.prototype):e.type==="comment"?Object.setPrototypeOf(e,k1.prototype):e.type==="root"&&Object.setPrototypeOf(e,I1.prototype),e[C1]=!0,e.nodes&&e.nodes.forEach(t=>{tn.rebuild(t)})};var V5=Vn,N1,$1,Ui=class extends V5{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new N1(new $1,this,t).stringify()}};Ui.registerLazyResult=e=>{N1=e};Ui.registerProcessor=e=>{$1=e};var Nf=Ui;Ui.default=Ui;var vw={},_1=function(t){vw[t]||(vw[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},qd=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}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}},L1=qd;qd.default=qd;var W5=L1,Yd=class{constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new W5(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},$f=Yd;Yd.default=Yd;var Pd=39,Rw=34,ta=92,Aw=47,na=10,Ti=32,ra=12,ia=9,oa=13,z5=91,G5=93,H5=40,K5=41,q5=123,Y5=125,Z5=59,X5=42,J5=58,Q5=64,sa=/[\t\n\f\r "#'()/;[\\\]{}]/g,aa=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,e$=/.[\r\n"'(/\\]/,Cw=/[\da-f]/i,t$=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,f,p,h,m=r.length,y=0,S=[],w=[];function g(){return y}function x(_){throw t.error("Unclosed "+_,y)}function P(){return w.length===0&&y>=m}function N(_){if(w.length)return w.pop();if(y>=m)return;let I=_?_.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case na:case Ti:case ia:case oa:case ra:{s=y;do s+=1,o=r.charCodeAt(s);while(o===Ti||o===na||o===ia||o===oa||o===ra);h=["space",r.slice(y,s)],y=s-1;break}case z5:case G5:case q5:case Y5:case J5:case Z5:case K5:{let j=String.fromCharCode(o);h=[j,j,y];break}case H5:{if(f=S.length?S.pop()[1]:"",p=r.charCodeAt(y+1),f==="url"&&p!==Pd&&p!==Rw&&p!==Ti&&p!==na&&p!==ia&&p!==ra&&p!==oa){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||I){s=y;break}else x("bracket");for(d=s;r.charCodeAt(d-1)===ta;)d-=1,c=!c}while(c);h=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||e$.test(l)?h=["(","(",y]:(h=["brackets",l,y,s],y=s);break}case Pd:case Rw:{a=o===Pd?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||I){s=y+1;break}else x("string");for(d=s;r.charCodeAt(d-1)===ta;)d-=1,c=!c}while(c);h=["string",r.slice(y,s+1),y,s],y=s;break}case Q5:{sa.lastIndex=y+1,sa.test(r),sa.lastIndex===0?s=r.length-1:s=sa.lastIndex-2,h=["at-word",r.slice(y,s+1),y,s],y=s;break}case ta:{for(s=y,u=!0;r.charCodeAt(s+1)===ta;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==Aw&&o!==Ti&&o!==na&&o!==ia&&o!==oa&&o!==ra&&(s+=1,Cw.test(r.charAt(s)))){for(;Cw.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===Ti&&(s+=1)}h=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===Aw&&r.charCodeAt(y+1)===X5?(s=r.indexOf("*/",y+2)+1,s===0&&(i||I?s=r.length:x("comment")),h=["comment",r.slice(y,s+1),y,s],y=s):(aa.lastIndex=y+1,aa.test(r),aa.lastIndex===0?s=r.length-1:s=aa.lastIndex-2,h=["word",r.slice(y,s+1),y,s],S.push(h),y=s);break}}return y++,h}function $(_){w.push(_)}return{back:$,endOfFile:P,nextToken:N,position:g}},D1=Vn,Oa=class extends D1{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)}},_f=Oa;Oa.default=Oa;D1.registerAtRule(Oa);var B1=Vn,F1,U1,Ir=class extends B1{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let o of i)o.raws.before=n.raws.before}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new F1(new U1,this,t).stringify()}};Ir.registerLazyResult=e=>{F1=e};Ir.registerProcessor=e=>{U1=e};var Zi=Ir;Ir.default=Ir;B1.registerRoot(Ir);var ji={comma(e){return ji.split(e,[","],!0)},space(e){let t=[" ",`
108
+ `," "];return ji.split(e,t)},split(e,t,n){let r=[],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!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}},j1=ji;ji.default=ji;var V1=Vn,n$=j1,Na=class extends V1{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return n$.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}},Lf=Na;Na.default=Na;V1.registerRule(Na);var r$=Ga,i$=t$,o$=Ka,s$=_f,a$=Zi,Ew=Lf,kw={empty:!0,space:!0};function l$(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var u$=class{constructor(t){this.input=t,this.root=new a$,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 n=new s$;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(n.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(n,"params",l),s&&(t=l[l.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),a&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[s,a]of t.entries()){if(r=a,i=r[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=r}return!1}comment(t){let n=new o$;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(/^\s*$/.test(r))n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=i$(this.input)}decl(t,n){let r=new r$;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||l$(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.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"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let f=u;f>0;f--){let p=c[f][0];if(d.trim().indexOf("!")===0&&p!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(r,"value",s.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new Ew;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}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 n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),s.push(r==="("?")":"]");else if(a&&i&&r==="{")o||(o=u),s.push("}");else if(s.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),n=!0;break}else r===":"&&(i=!0);else r===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&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,n,r,i){let o,s,a=r.length,l="",u=!0,c,d;for(let f=0;f<a;f+=1)o=r[f],s=o[0],s==="space"&&f===a-1&&!i?u=!1:s==="comment"?(d=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!kw[d]&&!kw[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let f=r.reduce((p,h)=>p+h[1],"");t.raws[n]={raw:f,value:l}}t[n]=l}rule(t){t.pop();let n=new Ew;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}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,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}},c$=u$,d$=Vn,f$=c$,h$=Ha;function $a(e,t){let n=new h$(e,t),r=new f$(n);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
109
109
  You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
110
110
  You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
111
- You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Df=$a;$a.default=$a;l$.registerParse($a);var{isClean:$t,my:d$}=Yi,f$=S1,h$=Wa,p$=Vn,m$=Nf,y$=T1,Aw=$f,g$=Df,b$=Zi,S$={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},w$={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},x$={Once:!0,postcssPlugin:!0,prepare:!0},Mr=0;function Oi(e){return typeof e=="object"&&typeof e.then=="function"}function F1(e){let t=!1,n=S$[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Mr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Mr,n+"Exit"]:[n,n+"Exit"]}function Cw(e){let t;return e.type==="document"?t=["Document",Mr,"DocumentExit"]:e.type==="root"?t=["Root",Mr,"RootExit"]:t=F1(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Zd(e){return e[$t]=!1,e.nodes&&e.nodes.forEach(t=>Zd(t)),e}var Xd={},Tr=class U1{constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=Zd(n);else if(n instanceof U1||n instanceof Aw)i=Zd(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=g$;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(s){this.processed=!0,this.error=s}i&&!i[d$]&&p$.rebuild(i)}this.result=new Aw(t,i,r),this.helpers={...Xd,postcss:Xd,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,n){let r=this.result.lastPlugin;try{if(n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=r.postcssPlugin,t.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.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=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!w$[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!x$[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(Oi(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[$t];){t[$t]=!0;let n=[Cw(t)];for(;n.length>0;){let r=this.visitTick(n);if(Oi(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(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 n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return Oi(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=h$;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new f$(n,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 n=this.runOnRoot(t);if(Oi(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[$t];)t[$t]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this.opts||y$("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,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Oi(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[s,a]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(n.iterator!==0){let s=n.iterator,a;for(;a=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!a[$t]){a[$t]=!0,t.push(Cw(a));return}n.iterator=0,delete r.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===Mr){r.nodes&&r.nodes.length&&(r[$t]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[$t]=!0;let n=F1(t);for(let r of n)if(r===Mr)t.nodes&&t.each(i=>{i[$t]||this.walkSync(i)});else{let i=this.listeners[r];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"}};Tr.registerPostcss=e=>{Xd=e};var j1=Tr;Tr.default=Tr;b$.registerLazyResult(Tr);m$.registerLazyResult(Tr);var v$=S1,R$=Wa,A$=T1,C$=Df,E$=$f,Jd=class{constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i,o=R$;this.result=new E$(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new v$(o,i,this._opts,n);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,n){return process.env.NODE_ENV!=="production"&&("from"in this._opts||A$("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,n)}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,n=C$;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},k$=Jd;Jd.default=Jd;var P$=k$,I$=j1,M$=Nf,T$=Zi,Vi=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(typeof r=="object"&&(r.parse||r.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(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new P$(this,t,n):new I$(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},O$=Vi;Vi.default=Vi;T$.registerProcessor(Vi);M$.registerProcessor(Vi);var N$=Ga,$$=p1,_$=Ka,L$=_f,D$=Ha,B$=Zi,F$=Lf;function Wi(e,t){if(Array.isArray(e))return e.map(i=>Wi(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:D$.prototype};o.map&&(o.map={...o.map,__proto__:$$.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Wi(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new B$(r);if(r.type==="decl")return new N$(r);if(r.type==="rule")return new F$(r);if(r.type==="comment")return new _$(r);if(r.type==="atrule")return new L$(r);throw new Error("Unknown node type: "+e.type)}var U$=Wi;Wi.default=Wi;var j$=Mf,V1=Ga,V$=j1,W$=Vn,Bf=O$,z$=Wa,G$=U$,W1=Nf,H$=O1,z1=Ka,G1=_f,K$=$f,q$=Ha,Y$=Df,Z$=D1,H1=Lf,K1=Zi,X$=za;function ie(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Bf(e)}ie.plugin=function(t,n){let r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
111
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Df=$a;$a.default=$a;d$.registerParse($a);var{isClean:$t,my:p$}=Yi,m$=R1,y$=Wa,g$=Vn,b$=Nf,S$=_1,Pw=$f,w$=Df,x$=Zi,v$={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},R$={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},A$={Once:!0,postcssPlugin:!0,prepare:!0},Mr=0;function Oi(e){return typeof e=="object"&&typeof e.then=="function"}function W1(e){let t=!1,n=v$[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Mr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Mr,n+"Exit"]:[n,n+"Exit"]}function Iw(e){let t;return e.type==="document"?t=["Document",Mr,"DocumentExit"]:e.type==="root"?t=["Root",Mr,"RootExit"]:t=W1(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Zd(e){return e[$t]=!1,e.nodes&&e.nodes.forEach(t=>Zd(t)),e}var Xd={},Tr=class z1{constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=Zd(n);else if(n instanceof z1||n instanceof Pw)i=Zd(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=w$;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(s){this.processed=!0,this.error=s}i&&!i[p$]&&g$.rebuild(i)}this.result=new Pw(t,i,r),this.helpers={...Xd,postcss:Xd,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,n){let r=this.result.lastPlugin;try{if(n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=r.postcssPlugin,t.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.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=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!R$[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!A$[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(Oi(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[$t];){t[$t]=!0;let n=[Iw(t)];for(;n.length>0;){let r=this.visitTick(n);if(Oi(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(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 n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return Oi(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=y$;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new m$(n,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 n=this.runOnRoot(t);if(Oi(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[$t];)t[$t]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this.opts||S$("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,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Oi(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[s,a]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(n.iterator!==0){let s=n.iterator,a;for(;a=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!a[$t]){a[$t]=!0,t.push(Iw(a));return}n.iterator=0,delete r.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===Mr){r.nodes&&r.nodes.length&&(r[$t]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[$t]=!0;let n=W1(t);for(let r of n)if(r===Mr)t.nodes&&t.each(i=>{i[$t]||this.walkSync(i)});else{let i=this.listeners[r];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"}};Tr.registerPostcss=e=>{Xd=e};var G1=Tr;Tr.default=Tr;x$.registerLazyResult(Tr);b$.registerLazyResult(Tr);var C$=R1,E$=Wa,k$=_1,P$=Df,I$=$f,Jd=class{constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i,o=E$;this.result=new I$(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new C$(o,i,this._opts,n);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,n){return process.env.NODE_ENV!=="production"&&("from"in this._opts||k$("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,n)}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,n=P$;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},M$=Jd;Jd.default=Jd;var T$=M$,O$=G1,N$=Nf,$$=Zi,Vi=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(typeof r=="object"&&(r.parse||r.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(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new T$(this,t,n):new O$(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},_$=Vi;Vi.default=Vi;$$.registerProcessor(Vi);N$.registerProcessor(Vi);var L$=Ga,D$=b1,B$=Ka,F$=_f,U$=Ha,j$=Zi,V$=Lf;function Wi(e,t){if(Array.isArray(e))return e.map(i=>Wi(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:U$.prototype};o.map&&(o.map={...o.map,__proto__:D$.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Wi(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new j$(r);if(r.type==="decl")return new L$(r);if(r.type==="rule")return new V$(r);if(r.type==="comment")return new B$(r);if(r.type==="atrule")return new F$(r);throw new Error("Unknown node type: "+e.type)}var W$=Wi;Wi.default=Wi;var z$=Mf,H1=Ga,G$=G1,H$=Vn,Bf=_$,K$=Wa,q$=W$,K1=Nf,Y$=L1,q1=Ka,Y1=_f,Z$=$f,X$=Ha,J$=Df,Q$=j1,Z1=Lf,X1=Zi,e_=za;function ie(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Bf(e)}ie.plugin=function(t,n){let r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
112
112
  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:
113
- https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new Bf().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=z$;ie.parse=Y$;ie.fromJSON=G$;ie.list=Z$;ie.comment=e=>new z1(e);ie.atRule=e=>new G1(e);ie.decl=e=>new V1(e);ie.rule=e=>new H1(e);ie.root=e=>new K1(e);ie.document=e=>new W1(e);ie.CssSyntaxError=j$;ie.Declaration=V1;ie.Container=W$;ie.Processor=Bf;ie.Document=W1;ie.Comment=z1;ie.Warning=H$;ie.AtRule=G1;ie.Result=K$;ie.Input=q$;ie.Rule=H1;ie.Root=K1;ie.Node=X$;V$.registerPostcss(ie);var J$=ie;ie.default=ie;var Se=l5(J$);Se.stringify;Se.fromJSON;Se.plugin;Se.parse;Se.list;Se.document;Se.comment;Se.atRule;Se.rule;Se.decl;Se.root;Se.CssSyntaxError;Se.Declaration;Se.Container;Se.Processor;Se.Document;Se.Comment;Se.Warning;Se.AtRule;Se.Result;Se.Input;Se.Rule;Se.Root;Se.Node;var Q$=Object.defineProperty,e_=(e,t,n)=>t in e?Q$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t,n)=>e_(e,typeof t!="symbol"?t+"":t,n);function t_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n_(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ff={exports:{}},ge=String,q1=function(){return{isColorSupported:!1,reset:ge,bold:ge,dim:ge,italic:ge,underline:ge,inverse:ge,hidden:ge,strikethrough:ge,black:ge,red:ge,green:ge,yellow:ge,blue:ge,magenta:ge,cyan:ge,white:ge,gray:ge,bgBlack:ge,bgRed:ge,bgGreen:ge,bgYellow:ge,bgBlue:ge,bgMagenta:ge,bgCyan:ge,bgWhite:ge}};Ff.exports=q1();Ff.exports.createColors=q1;var r_=Ff.exports,i_={},o_=Object.freeze(Object.defineProperty({__proto__:null,default:i_},Symbol.toStringTag,{value:"Module"})),Rt=n_(o_),Ew=r_,kw=Rt,Qd=class Y1 extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Y1)}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 n=this.source;t==null&&(t=Ew.isColorSupported),kw&&t&&(n=kw(n));let r=n.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=Ew.createColors(!0);a=f=>u(d(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let d=i+1+c,f=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let p=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
113
+ https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new Bf().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=K$;ie.parse=J$;ie.fromJSON=q$;ie.list=Q$;ie.comment=e=>new q1(e);ie.atRule=e=>new Y1(e);ie.decl=e=>new H1(e);ie.rule=e=>new Z1(e);ie.root=e=>new X1(e);ie.document=e=>new K1(e);ie.CssSyntaxError=z$;ie.Declaration=H1;ie.Container=H$;ie.Processor=Bf;ie.Document=K1;ie.Comment=q1;ie.Warning=Y$;ie.AtRule=Y1;ie.Result=Z$;ie.Input=X$;ie.Rule=Z1;ie.Root=X1;ie.Node=e_;G$.registerPostcss(ie);var t_=ie;ie.default=ie;var Se=d5(t_);Se.stringify;Se.fromJSON;Se.plugin;Se.parse;Se.list;Se.document;Se.comment;Se.atRule;Se.rule;Se.decl;Se.root;Se.CssSyntaxError;Se.Declaration;Se.Container;Se.Processor;Se.Document;Se.Comment;Se.Warning;Se.AtRule;Se.Result;Se.Input;Se.Rule;Se.Root;Se.Node;var n_=Object.defineProperty,r_=(e,t,n)=>t in e?n_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t,n)=>r_(e,typeof t!="symbol"?t+"":t,n);function i_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o_(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ff={exports:{}},ge=String,J1=function(){return{isColorSupported:!1,reset:ge,bold:ge,dim:ge,italic:ge,underline:ge,inverse:ge,hidden:ge,strikethrough:ge,black:ge,red:ge,green:ge,yellow:ge,blue:ge,magenta:ge,cyan:ge,white:ge,gray:ge,bgBlack:ge,bgRed:ge,bgGreen:ge,bgYellow:ge,bgBlue:ge,bgMagenta:ge,bgCyan:ge,bgWhite:ge}};Ff.exports=J1();Ff.exports.createColors=J1;var s_=Ff.exports,a_={},l_=Object.freeze(Object.defineProperty({__proto__:null,default:a_},Symbol.toStringTag,{value:"Module"})),Rt=o_(l_),Mw=s_,Tw=Rt,Qd=class Q1 extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Q1)}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 n=this.source;t==null&&(t=Mw.isColorSupported),Tw&&t&&(n=Tw(n));let r=n.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=Mw.createColors(!0);a=f=>u(d(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let d=i+1+c,f=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let p=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
114
114
  `+p+a("^")}return" "+l(f)+u}).join(`
115
115
  `)}toString(){let t=this.showSourceCode();return t&&(t=`
116
116
 
117
117
  `+t+`
118
- `),this.name+": "+this.message+t}},Uf=Qd;Qd.default=Qd;var Xi={};Xi.isClean=Symbol("isClean");Xi.my=Symbol("my");var Pw={after:`
118
+ `),this.name+": "+this.message+t}},Uf=Qd;Qd.default=Qd;var Xi={};Xi.isClean=Symbol("isClean");Xi.my=Symbol("my");var Ow={after:`
119
119
  `,beforeClose:`
120
120
  `,beforeComment:`
121
121
  `,beforeDecl:`
122
122
  `,beforeOpen:" ",beforeRule:`
123
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function s_(e){return e[0].toUpperCase()+e.slice(1)}var ef=class{constructor(t){this.builder=t}atrule(t,n){let r="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?r+=t.raws.afterName:i&&(r+=" "),t.nodes)this.block(t,r+i);else{let o=(t.raws.between||"")+(n?";":"");this.builder(r+i+o,t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
124
- `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)r+=s}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(n+r+"{",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 n=t.nodes.length-1;for(;n>0&&t.nodes[n].type==="comment";)n-=1;let r=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,n!==i||r)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder("/*"+n+t.text+r+"*/",t)}decl(t,n){let r=this.raw(t,"between","colon"),i=t.prop+r+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),n&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Pw[r];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[r]<"u")return s.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let a="raw"+s_(r);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=Pw[r]),s.rawCache[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`
123
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function u_(e){return e[0].toUpperCase()+e.slice(1)}var ef=class{constructor(t){this.builder=t}atrule(t,n){let r="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?r+=t.raws.afterName:i&&(r+=" "),t.nodes)this.block(t,r+i);else{let o=(t.raws.between||"")+(n?";":"");this.builder(r+i+o,t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
124
+ `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)r+=s}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(n+r+"{",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 n=t.nodes.length-1;for(;n>0&&t.nodes[n].type==="comment";)n-=1;let r=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,n!==i||r)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder("/*"+n+t.text+r+"*/",t)}decl(t,n){let r=this.raw(t,"between","colon"),i=t.prop+r+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),n&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Ow[r];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[r]<"u")return s.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let a="raw"+u_(r);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=Ow[r]),s.rawCache[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`
125
125
  `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
126
126
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
127
127
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`
128
128
  `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
129
- `);return n=o[o.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}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,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}},Z1=ef;ef.default=ef;var a_=Z1;function tf(e,t){new a_(t).stringify(e)}var qa=tf;tf.default=tf;var{isClean:la,my:l_}=Xi,u_=Uf,c_=Z1,d_=qa;function nf(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(s=>nf(s,n)):(o==="object"&&i!==null&&(i=nf(i)),n[r]=i)}return n}var rf=class{constructor(t={}){this.raws={},this[la]=!1,this[l_]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];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 n=nf(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new u_(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markDirty(){if(this[la]){this[la]=!1;let t=this;for(;t=t.parent;)t[la]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,n){let r=this.source.start;if(t.index)r=this.positionInside(t.index,n);else if(t.word){n=this.toString();let i=n.indexOf(t.word);i!==-1&&(r=this.positionInside(i,n))}return r}positionInside(t,n){let r=n||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)r[s]===`
130
- `?(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 n={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:n.column+1,line:n.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(n=this.positionInside(o,i),r=this.positionInside(o+t.word.length,i))}else t.start?n={column:t.start.column,line:t.start.line}:t.index&&(n=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<n.line||r.line===n.line&&r.column<=n.column)&&(r={column:n.column+1,line:n.line}),{end:r,start:n}}raw(t,n){return new c_().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r={},i=n==null;n=n||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))r[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,n):l);else if(typeof a=="object"&&a.toJSON)r[s]=a.toJSON(null,n);else if(s==="source"){let l=n.get(a.input);l==null&&(l=o,n.set(a.input,o),o++),r[s]={end:a.end,inputId:l,start:a.start}}else r[s]=a}return i&&(r.inputs=[...n.keys()].map(s=>s.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=d_){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}get proxyOf(){return this}},Ya=rf;rf.default=rf;var f_=Ya,of=class extends f_{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]==="$"}},Za=of;of.default=of;var h_="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",p_=(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r},m_=(e=21)=>{let t="",n=e;for(;n--;)t+=h_[Math.random()*64|0];return t},y_={nanoid:m_,customAlphabet:p_},{SourceMapConsumer:Iw,SourceMapGenerator:Mw}=Rt,{existsSync:g_,readFileSync:b_}=Rt,{dirname:Id,join:S_}=Rt;function w_(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var sf=class{constructor(t,n){if(n.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Id(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Iw(this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^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(n.test(t)||r.test(t))return w_(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 n=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t){if(this.root=Id(t),g_(t))return this.mapFile=t,b_(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof Iw)return Mw.fromSourceMap(n).toString();if(n instanceof Mw)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return t&&(r=S_(Id(t),r)),this.loadFile(r)}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},X1=sf;sf.default=sf;var{SourceMapConsumer:x_,SourceMapGenerator:v_}=Rt,{fileURLToPath:Tw,pathToFileURL:ua}=Rt,{isAbsolute:af,resolve:lf}=Rt,{nanoid:R_}=y_,Md=Rt,Ow=Uf,A_=X1,Td=Symbol("fromOffsetCache"),C_=!!(x_&&v_),Nw=!!(lf&&af),_a=class{constructor(t,n={}){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,n.from&&(!Nw||/^\w+:\/\//.test(n.from)||af(n.from)?this.file=n.from:this.file=lf(n.from)),Nw&&C_){let r=new A_(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+R_(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,s,a;if(n&&typeof n=="object"){let u=n,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);n=d.line,r=d.col}else n=u.line,r=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(!r){let u=this.fromOffset(n);n=u.line,r=u.col}let l=this.origin(n,r,s,a);return l?o=new Ow(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 Ow(t,s===void 0?n:{column:r,line:n},s===void 0?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:n,source:this.css},this.file&&(ua&&(o.input.url=ua(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let n,r;if(this[Td])r=this[Td];else{let o=this.css.split(`
131
- `);r=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)r[a]=s,s+=o[a].length+1;this[Td]=r}n=r[r.length-1];let i=0;if(t>=n)i=r.length-1;else{let o=r.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<r[s])o=s-1;else if(t>=r[s+1])i=s+1;else{i=s;break}}return{col:t-r[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:lf(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:t});if(!s.source)return!1;let a;typeof r=="number"&&(a=o.originalPositionFor({column:i,line:r}));let l;af(s.source)?l=ua(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||ua(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(Tw)u.file=Tw(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 n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},Xa=_a;_a.default=_a;Md&&Md.registerInput&&Md.registerInput(_a);var{SourceMapConsumer:J1,SourceMapGenerator:va}=Rt,{dirname:Ra,relative:Q1,resolve:ex,sep:tx}=Rt,{pathToFileURL:$w}=Rt,E_=Xa,k_=!!(J1&&va),P_=!!(Ra&&ex&&Q1&&tx),I_=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,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 n=`
129
+ `);return n=o[o.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}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,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}},ex=ef;ef.default=ef;var c_=ex;function tf(e,t){new c_(t).stringify(e)}var qa=tf;tf.default=tf;var{isClean:la,my:d_}=Xi,f_=Uf,h_=ex,p_=qa;function nf(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(s=>nf(s,n)):(o==="object"&&i!==null&&(i=nf(i)),n[r]=i)}return n}var rf=class{constructor(t={}){this.raws={},this[la]=!1,this[d_]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];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 n=nf(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new f_(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markDirty(){if(this[la]){this[la]=!1;let t=this;for(;t=t.parent;)t[la]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,n){let r=this.source.start;if(t.index)r=this.positionInside(t.index,n);else if(t.word){n=this.toString();let i=n.indexOf(t.word);i!==-1&&(r=this.positionInside(i,n))}return r}positionInside(t,n){let r=n||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)r[s]===`
130
+ `?(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 n={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:n.column+1,line:n.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(n=this.positionInside(o,i),r=this.positionInside(o+t.word.length,i))}else t.start?n={column:t.start.column,line:t.start.line}:t.index&&(n=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<n.line||r.line===n.line&&r.column<=n.column)&&(r={column:n.column+1,line:n.line}),{end:r,start:n}}raw(t,n){return new h_().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r={},i=n==null;n=n||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))r[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,n):l);else if(typeof a=="object"&&a.toJSON)r[s]=a.toJSON(null,n);else if(s==="source"){let l=n.get(a.input);l==null&&(l=o,n.set(a.input,o),o++),r[s]={end:a.end,inputId:l,start:a.start}}else r[s]=a}return i&&(r.inputs=[...n.keys()].map(s=>s.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=p_){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}get proxyOf(){return this}},Ya=rf;rf.default=rf;var m_=Ya,of=class extends m_{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]==="$"}},Za=of;of.default=of;var y_="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",g_=(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r},b_=(e=21)=>{let t="",n=e;for(;n--;)t+=y_[Math.random()*64|0];return t},S_={nanoid:b_,customAlphabet:g_},{SourceMapConsumer:Nw,SourceMapGenerator:$w}=Rt,{existsSync:w_,readFileSync:x_}=Rt,{dirname:Id,join:v_}=Rt;function R_(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var sf=class{constructor(t,n){if(n.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Id(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Nw(this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^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(n.test(t)||r.test(t))return R_(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 n=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t){if(this.root=Id(t),w_(t))return this.mapFile=t,x_(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof Nw)return $w.fromSourceMap(n).toString();if(n instanceof $w)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return t&&(r=v_(Id(t),r)),this.loadFile(r)}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},tx=sf;sf.default=sf;var{SourceMapConsumer:A_,SourceMapGenerator:C_}=Rt,{fileURLToPath:_w,pathToFileURL:ua}=Rt,{isAbsolute:af,resolve:lf}=Rt,{nanoid:E_}=S_,Md=Rt,Lw=Uf,k_=tx,Td=Symbol("fromOffsetCache"),P_=!!(A_&&C_),Dw=!!(lf&&af),_a=class{constructor(t,n={}){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,n.from&&(!Dw||/^\w+:\/\//.test(n.from)||af(n.from)?this.file=n.from:this.file=lf(n.from)),Dw&&P_){let r=new k_(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+E_(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,s,a;if(n&&typeof n=="object"){let u=n,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);n=d.line,r=d.col}else n=u.line,r=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(!r){let u=this.fromOffset(n);n=u.line,r=u.col}let l=this.origin(n,r,s,a);return l?o=new Lw(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 Lw(t,s===void 0?n:{column:r,line:n},s===void 0?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:n,source:this.css},this.file&&(ua&&(o.input.url=ua(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let n,r;if(this[Td])r=this[Td];else{let o=this.css.split(`
131
+ `);r=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)r[a]=s,s+=o[a].length+1;this[Td]=r}n=r[r.length-1];let i=0;if(t>=n)i=r.length-1;else{let o=r.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<r[s])o=s-1;else if(t>=r[s+1])i=s+1;else{i=s;break}}return{col:t-r[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:lf(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:t});if(!s.source)return!1;let a;typeof r=="number"&&(a=o.originalPositionFor({column:i,line:r}));let l;af(s.source)?l=ua(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||ua(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(_w)u.file=_w(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 n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},Xa=_a;_a.default=_a;Md&&Md.registerInput&&Md.registerInput(_a);var{SourceMapConsumer:nx,SourceMapGenerator:va}=Rt,{dirname:Ra,relative:rx,resolve:ix,sep:ox}=Rt,{pathToFileURL:Bw}=Rt,I_=Xa,M_=!!(nx&&va),T_=!!(Ra&&ix&&rx&&ox),O_=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,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 n=`
132
132
  `;this.css.includes(`\r
133
133
  `)&&(n=`\r
134
- `),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||Ra(t.file),i;this.mapOpts.sourcesContent===!1?(i=new J1(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),P_&&k_&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[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=va.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new va({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 va({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<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=n-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=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
135
- `),n=a.length-s):n+=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=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-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(n=>n.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 n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?Ra(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Ra(ex(r,this.mapOpts.annotation)));let i=Q1(r,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 n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new E_(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,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 n=this.memoizedFileURLs.get(t);if(n)return n;if($w){let r=$w(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;tx==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},nx=I_,M_=Ya,uf=class extends M_{constructor(t){super(t),this.type="comment"}},Ja=uf;uf.default=uf;var{isClean:rx,my:ix}=Xi,ox=Za,sx=Ja,T_=Ya,ax,jf,Vf,lx;function ux(e){return e.map(t=>(t.nodes&&(t.nodes=ux(t.nodes)),delete t.source,t))}function cx(e){if(e[rx]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)cx(t)}var nn=class dx extends T_{append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],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,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let s of i)this.proxyOf.nodes.splice(r+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],r<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let s;for(let a in this.indexes)s=this.indexes[a],r<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=ux(ax(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 ox(t)]}else if(t.selector)t=[new jf(t)];else if(t.name)t=[new Vf(t)];else if(t.text)t=[new sx(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[ix]||dx.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[rx]&&cx(i),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.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 n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,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]}};nn.registerParse=e=>{ax=e};nn.registerRule=e=>{jf=e};nn.registerAtRule=e=>{Vf=e};nn.registerRoot=e=>{lx=e};var Wn=nn;nn.default=nn;nn.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Vf.prototype):e.type==="rule"?Object.setPrototypeOf(e,jf.prototype):e.type==="decl"?Object.setPrototypeOf(e,ox.prototype):e.type==="comment"?Object.setPrototypeOf(e,sx.prototype):e.type==="root"&&Object.setPrototypeOf(e,lx.prototype),e[ix]=!0,e.nodes&&e.nodes.forEach(t=>{nn.rebuild(t)})};var O_=Wn,fx,hx,zi=class extends O_{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new fx(new hx,this,t).stringify()}};zi.registerLazyResult=e=>{fx=e};zi.registerProcessor=e=>{hx=e};var Wf=zi;zi.default=zi;var _w={},px=function(t){_w[t]||(_w[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},cf=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}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}},mx=cf;cf.default=cf;var N_=mx,df=class{constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new N_(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},zf=df;df.default=df;var Od=39,Lw=34,ca=92,Dw=47,da=10,Ni=32,fa=12,ha=9,pa=13,$_=91,__=93,L_=40,D_=41,B_=123,F_=125,U_=59,j_=42,V_=58,W_=64,ma=/[\t\n\f\r "#'()/;[\\\]{}]/g,ya=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,z_=/.[\r\n"'(/\\]/,Bw=/[\da-f]/i,G_=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,f,p,h,m=r.length,y=0,S=[],w=[];function g(){return y}function x(_){throw t.error("Unclosed "+_,y)}function P(){return w.length===0&&y>=m}function N(_){if(w.length)return w.pop();if(y>=m)return;let I=_?_.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case da:case Ni:case ha:case pa:case fa:{s=y;do s+=1,o=r.charCodeAt(s);while(o===Ni||o===da||o===ha||o===pa||o===fa);h=["space",r.slice(y,s)],y=s-1;break}case $_:case __:case B_:case F_:case V_:case U_:case D_:{let j=String.fromCharCode(o);h=[j,j,y];break}case L_:{if(f=S.length?S.pop()[1]:"",p=r.charCodeAt(y+1),f==="url"&&p!==Od&&p!==Lw&&p!==Ni&&p!==da&&p!==ha&&p!==fa&&p!==pa){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||I){s=y;break}else x("bracket");for(d=s;r.charCodeAt(d-1)===ca;)d-=1,c=!c}while(c);h=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||z_.test(l)?h=["(","(",y]:(h=["brackets",l,y,s],y=s);break}case Od:case Lw:{a=o===Od?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||I){s=y+1;break}else x("string");for(d=s;r.charCodeAt(d-1)===ca;)d-=1,c=!c}while(c);h=["string",r.slice(y,s+1),y,s],y=s;break}case W_:{ma.lastIndex=y+1,ma.test(r),ma.lastIndex===0?s=r.length-1:s=ma.lastIndex-2,h=["at-word",r.slice(y,s+1),y,s],y=s;break}case ca:{for(s=y,u=!0;r.charCodeAt(s+1)===ca;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==Dw&&o!==Ni&&o!==da&&o!==ha&&o!==pa&&o!==fa&&(s+=1,Bw.test(r.charAt(s)))){for(;Bw.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===Ni&&(s+=1)}h=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===Dw&&r.charCodeAt(y+1)===j_?(s=r.indexOf("*/",y+2)+1,s===0&&(i||I?s=r.length:x("comment")),h=["comment",r.slice(y,s+1),y,s],y=s):(ya.lastIndex=y+1,ya.test(r),ya.lastIndex===0?s=r.length-1:s=ya.lastIndex-2,h=["word",r.slice(y,s+1),y,s],S.push(h),y=s);break}}return y++,h}function $(_){w.push(_)}return{back:$,endOfFile:P,nextToken:N,position:g}},yx=Wn,La=class extends yx{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)}},Gf=La;La.default=La;yx.registerAtRule(La);var gx=Wn,bx,Sx,Or=class extends gx{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let o of i)o.raws.before=n.raws.before}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new bx(new Sx,this,t).stringify()}};Or.registerLazyResult=e=>{bx=e};Or.registerProcessor=e=>{Sx=e};var Ji=Or;Or.default=Or;gx.registerRoot(Or);var Gi={comma(e){return Gi.split(e,[","],!0)},space(e){let t=[" ",`
136
- `," "];return Gi.split(e,t)},split(e,t,n){let r=[],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!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}},wx=Gi;Gi.default=Gi;var xx=Wn,H_=wx,Da=class extends xx{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return H_.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}},Hf=Da;Da.default=Da;xx.registerRule(Da);var K_=Za,q_=G_,Y_=Ja,Z_=Gf,X_=Ji,Fw=Hf,Uw={empty:!0,space:!0};function J_(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var Q_=class{constructor(t){this.input=t,this.root=new X_,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 n=new Z_;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(n.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(n,"params",l),s&&(t=l[l.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),a&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[s,a]of t.entries()){if(r=a,i=r[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=r}return!1}comment(t){let n=new Y_;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(/^\s*$/.test(r))n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=q_(this.input)}decl(t,n){let r=new K_;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||J_(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.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"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let f=u;f>0;f--){let p=c[f][0];if(d.trim().indexOf("!")===0&&p!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(r,"value",s.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new Fw;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}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 n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),s.push(r==="("?")":"]");else if(a&&i&&r==="{")o||(o=u),s.push("}");else if(s.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),n=!0;break}else r===":"&&(i=!0);else r===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&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,n,r,i){let o,s,a=r.length,l="",u=!0,c,d;for(let f=0;f<a;f+=1)o=r[f],s=o[0],s==="space"&&f===a-1&&!i?u=!1:s==="comment"?(d=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!Uw[d]&&!Uw[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let f=r.reduce((p,h)=>p+h[1],"");t.raws[n]={raw:f,value:l}}t[n]=l}rule(t){t.pop();let n=new Fw;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}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,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}},e9=Q_,t9=Wn,n9=e9,r9=Xa;function Ba(e,t){let n=new r9(e,t),r=new n9(n);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
134
+ `),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||Ra(t.file),i;this.mapOpts.sourcesContent===!1?(i=new nx(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),T_&&M_&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[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=va.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new va({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 va({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<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=n-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=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
135
+ `),n=a.length-s):n+=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=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-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(n=>n.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 n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?Ra(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Ra(ix(r,this.mapOpts.annotation)));let i=rx(r,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 n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new I_(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,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 n=this.memoizedFileURLs.get(t);if(n)return n;if(Bw){let r=Bw(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;ox==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},sx=O_,N_=Ya,uf=class extends N_{constructor(t){super(t),this.type="comment"}},Ja=uf;uf.default=uf;var{isClean:ax,my:lx}=Xi,ux=Za,cx=Ja,$_=Ya,dx,jf,Vf,fx;function hx(e){return e.map(t=>(t.nodes&&(t.nodes=hx(t.nodes)),delete t.source,t))}function px(e){if(e[ax]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)px(t)}var nn=class mx extends $_{append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],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,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let s of i)this.proxyOf.nodes.splice(r+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],r<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let s;for(let a in this.indexes)s=this.indexes[a],r<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=hx(dx(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 ux(t)]}else if(t.selector)t=[new jf(t)];else if(t.name)t=[new Vf(t)];else if(t.text)t=[new cx(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[lx]||mx.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[ax]&&px(i),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.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 n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,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]}};nn.registerParse=e=>{dx=e};nn.registerRule=e=>{jf=e};nn.registerAtRule=e=>{Vf=e};nn.registerRoot=e=>{fx=e};var Wn=nn;nn.default=nn;nn.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Vf.prototype):e.type==="rule"?Object.setPrototypeOf(e,jf.prototype):e.type==="decl"?Object.setPrototypeOf(e,ux.prototype):e.type==="comment"?Object.setPrototypeOf(e,cx.prototype):e.type==="root"&&Object.setPrototypeOf(e,fx.prototype),e[lx]=!0,e.nodes&&e.nodes.forEach(t=>{nn.rebuild(t)})};var __=Wn,yx,gx,zi=class extends __{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new yx(new gx,this,t).stringify()}};zi.registerLazyResult=e=>{yx=e};zi.registerProcessor=e=>{gx=e};var Wf=zi;zi.default=zi;var Fw={},bx=function(t){Fw[t]||(Fw[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},cf=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}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}},Sx=cf;cf.default=cf;var L_=Sx,df=class{constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new L_(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},zf=df;df.default=df;var Od=39,Uw=34,ca=92,jw=47,da=10,Ni=32,fa=12,ha=9,pa=13,D_=91,B_=93,F_=40,U_=41,j_=123,V_=125,W_=59,z_=42,G_=58,H_=64,ma=/[\t\n\f\r "#'()/;[\\\]{}]/g,ya=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,K_=/.[\r\n"'(/\\]/,Vw=/[\da-f]/i,q_=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,f,p,h,m=r.length,y=0,S=[],w=[];function g(){return y}function x(_){throw t.error("Unclosed "+_,y)}function P(){return w.length===0&&y>=m}function N(_){if(w.length)return w.pop();if(y>=m)return;let I=_?_.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case da:case Ni:case ha:case pa:case fa:{s=y;do s+=1,o=r.charCodeAt(s);while(o===Ni||o===da||o===ha||o===pa||o===fa);h=["space",r.slice(y,s)],y=s-1;break}case D_:case B_:case j_:case V_:case G_:case W_:case U_:{let j=String.fromCharCode(o);h=[j,j,y];break}case F_:{if(f=S.length?S.pop()[1]:"",p=r.charCodeAt(y+1),f==="url"&&p!==Od&&p!==Uw&&p!==Ni&&p!==da&&p!==ha&&p!==fa&&p!==pa){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||I){s=y;break}else x("bracket");for(d=s;r.charCodeAt(d-1)===ca;)d-=1,c=!c}while(c);h=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||K_.test(l)?h=["(","(",y]:(h=["brackets",l,y,s],y=s);break}case Od:case Uw:{a=o===Od?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||I){s=y+1;break}else x("string");for(d=s;r.charCodeAt(d-1)===ca;)d-=1,c=!c}while(c);h=["string",r.slice(y,s+1),y,s],y=s;break}case H_:{ma.lastIndex=y+1,ma.test(r),ma.lastIndex===0?s=r.length-1:s=ma.lastIndex-2,h=["at-word",r.slice(y,s+1),y,s],y=s;break}case ca:{for(s=y,u=!0;r.charCodeAt(s+1)===ca;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==jw&&o!==Ni&&o!==da&&o!==ha&&o!==pa&&o!==fa&&(s+=1,Vw.test(r.charAt(s)))){for(;Vw.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===Ni&&(s+=1)}h=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===jw&&r.charCodeAt(y+1)===z_?(s=r.indexOf("*/",y+2)+1,s===0&&(i||I?s=r.length:x("comment")),h=["comment",r.slice(y,s+1),y,s],y=s):(ya.lastIndex=y+1,ya.test(r),ya.lastIndex===0?s=r.length-1:s=ya.lastIndex-2,h=["word",r.slice(y,s+1),y,s],S.push(h),y=s);break}}return y++,h}function $(_){w.push(_)}return{back:$,endOfFile:P,nextToken:N,position:g}},wx=Wn,La=class extends wx{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)}},Gf=La;La.default=La;wx.registerAtRule(La);var xx=Wn,vx,Rx,Or=class extends xx{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let o of i)o.raws.before=n.raws.before}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new vx(new Rx,this,t).stringify()}};Or.registerLazyResult=e=>{vx=e};Or.registerProcessor=e=>{Rx=e};var Ji=Or;Or.default=Or;xx.registerRoot(Or);var Gi={comma(e){return Gi.split(e,[","],!0)},space(e){let t=[" ",`
136
+ `," "];return Gi.split(e,t)},split(e,t,n){let r=[],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!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}},Ax=Gi;Gi.default=Gi;var Cx=Wn,Y_=Ax,Da=class extends Cx{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Y_.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}},Hf=Da;Da.default=Da;Cx.registerRule(Da);var Z_=Za,X_=q_,J_=Ja,Q_=Gf,e9=Ji,Ww=Hf,zw={empty:!0,space:!0};function t9(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var n9=class{constructor(t){this.input=t,this.root=new e9,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 n=new Q_;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(n.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(n,"params",l),s&&(t=l[l.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),a&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[s,a]of t.entries()){if(r=a,i=r[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=r}return!1}comment(t){let n=new J_;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(/^\s*$/.test(r))n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=X_(this.input)}decl(t,n){let r=new Z_;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||t9(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.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"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let f=u;f>0;f--){let p=c[f][0];if(d.trim().indexOf("!")===0&&p!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(r,"value",s.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new Ww;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}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 n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),s.push(r==="("?")":"]");else if(a&&i&&r==="{")o||(o=u),s.push("}");else if(s.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),n=!0;break}else r===":"&&(i=!0);else r===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&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,n,r,i){let o,s,a=r.length,l="",u=!0,c,d;for(let f=0;f<a;f+=1)o=r[f],s=o[0],s==="space"&&f===a-1&&!i?u=!1:s==="comment"?(d=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!zw[d]&&!zw[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let f=r.reduce((p,h)=>p+h[1],"");t.raws[n]={raw:f,value:l}}t[n]=l}rule(t){t.pop();let n=new Ww;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}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,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}},r9=n9,i9=Wn,o9=r9,s9=Xa;function Ba(e,t){let n=new s9(e,t),r=new o9(n);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
137
137
  You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
138
138
  You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
139
- You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Kf=Ba;Ba.default=Ba;t9.registerParse(Ba);var{isClean:_t,my:i9}=Xi,o9=nx,s9=qa,a9=Wn,l9=Wf,u9=px,jw=zf,c9=Kf,d9=Ji,f9={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h9={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},p9={Once:!0,postcssPlugin:!0,prepare:!0},Nr=0;function $i(e){return typeof e=="object"&&typeof e.then=="function"}function vx(e){let t=!1,n=f9[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Nr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Nr,n+"Exit"]:[n,n+"Exit"]}function Vw(e){let t;return e.type==="document"?t=["Document",Nr,"DocumentExit"]:e.type==="root"?t=["Root",Nr,"RootExit"]:t=vx(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ff(e){return e[_t]=!1,e.nodes&&e.nodes.forEach(t=>ff(t)),e}var hf={},$r=class Rx{constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=ff(n);else if(n instanceof Rx||n instanceof jw)i=ff(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=c9;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(s){this.processed=!0,this.error=s}i&&!i[i9]&&a9.rebuild(i)}this.result=new jw(t,i,r),this.helpers={...hf,postcss:hf,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,n){let r=this.result.lastPlugin;try{if(n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=r.postcssPlugin,t.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.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=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!h9[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p9[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if($i(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[_t];){t[_t]=!0;let n=[Vw(t)];for(;n.length>0;){let r=this.visitTick(n);if($i(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(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 n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return $i(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=s9;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new o9(n,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 n=this.runOnRoot(t);if($i(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[_t];)t[_t]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this.opts||u9("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,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if($i(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[s,a]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(n.iterator!==0){let s=n.iterator,a;for(;a=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!a[_t]){a[_t]=!0,t.push(Vw(a));return}n.iterator=0,delete r.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===Nr){r.nodes&&r.nodes.length&&(r[_t]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[_t]=!0;let n=vx(t);for(let r of n)if(r===Nr)t.nodes&&t.each(i=>{i[_t]||this.walkSync(i)});else{let i=this.listeners[r];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"}};$r.registerPostcss=e=>{hf=e};var Ax=$r;$r.default=$r;d9.registerLazyResult($r);l9.registerLazyResult($r);var m9=nx,y9=qa,g9=px,b9=Kf,S9=zf,pf=class{constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i,o=y9;this.result=new S9(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new m9(o,i,this._opts,n);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,n){return process.env.NODE_ENV!=="production"&&("from"in this._opts||g9("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,n)}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,n=b9;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},w9=pf;pf.default=pf;var x9=w9,v9=Ax,R9=Wf,A9=Ji,Hi=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(typeof r=="object"&&(r.parse||r.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(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new x9(this,t,n):new v9(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},C9=Hi;Hi.default=Hi;A9.registerProcessor(Hi);R9.registerProcessor(Hi);var E9=Za,k9=X1,P9=Ja,I9=Gf,M9=Xa,T9=Ji,O9=Hf;function Ki(e,t){if(Array.isArray(e))return e.map(i=>Ki(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:M9.prototype};o.map&&(o.map={...o.map,__proto__:k9.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Ki(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new T9(r);if(r.type==="decl")return new E9(r);if(r.type==="rule")return new O9(r);if(r.type==="comment")return new P9(r);if(r.type==="atrule")return new I9(r);throw new Error("Unknown node type: "+e.type)}var N9=Ki;Ki.default=Ki;var $9=Uf,Cx=Za,_9=Ax,L9=Wn,qf=C9,D9=qa,B9=N9,Ex=Wf,F9=mx,kx=Ja,Px=Gf,U9=zf,j9=Xa,V9=Kf,W9=wx,Ix=Hf,Mx=Ji,z9=Ya;function oe(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new qf(e)}oe.plugin=function(t,n){let r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
139
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Kf=Ba;Ba.default=Ba;i9.registerParse(Ba);var{isClean:_t,my:a9}=Xi,l9=sx,u9=qa,c9=Wn,d9=Wf,f9=bx,Gw=zf,h9=Kf,p9=Ji,m9={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},y9={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},g9={Once:!0,postcssPlugin:!0,prepare:!0},Nr=0;function $i(e){return typeof e=="object"&&typeof e.then=="function"}function Ex(e){let t=!1,n=m9[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Nr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Nr,n+"Exit"]:[n,n+"Exit"]}function Hw(e){let t;return e.type==="document"?t=["Document",Nr,"DocumentExit"]:e.type==="root"?t=["Root",Nr,"RootExit"]:t=Ex(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ff(e){return e[_t]=!1,e.nodes&&e.nodes.forEach(t=>ff(t)),e}var hf={},$r=class kx{constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=ff(n);else if(n instanceof kx||n instanceof Gw)i=ff(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=h9;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(s){this.processed=!0,this.error=s}i&&!i[a9]&&c9.rebuild(i)}this.result=new Gw(t,i,r),this.helpers={...hf,postcss:hf,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,n){let r=this.result.lastPlugin;try{if(n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=r.postcssPlugin,t.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.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=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!y9[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!g9[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if($i(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[_t];){t[_t]=!0;let n=[Hw(t)];for(;n.length>0;){let r=this.visitTick(n);if($i(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(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 n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return $i(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=u9;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new l9(n,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 n=this.runOnRoot(t);if($i(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[_t];)t[_t]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this.opts||f9("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,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if($i(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[s,a]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(n.iterator!==0){let s=n.iterator,a;for(;a=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!a[_t]){a[_t]=!0,t.push(Hw(a));return}n.iterator=0,delete r.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===Nr){r.nodes&&r.nodes.length&&(r[_t]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[_t]=!0;let n=Ex(t);for(let r of n)if(r===Nr)t.nodes&&t.each(i=>{i[_t]||this.walkSync(i)});else{let i=this.listeners[r];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"}};$r.registerPostcss=e=>{hf=e};var Px=$r;$r.default=$r;p9.registerLazyResult($r);d9.registerLazyResult($r);var b9=sx,S9=qa,w9=bx,x9=Kf,v9=zf,pf=class{constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i,o=S9;this.result=new v9(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new b9(o,i,this._opts,n);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,n){return process.env.NODE_ENV!=="production"&&("from"in this._opts||w9("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,n)}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,n=x9;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},R9=pf;pf.default=pf;var A9=R9,C9=Px,E9=Wf,k9=Ji,Hi=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(typeof r=="object"&&(r.parse||r.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(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new A9(this,t,n):new C9(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},P9=Hi;Hi.default=Hi;k9.registerProcessor(Hi);E9.registerProcessor(Hi);var I9=Za,M9=tx,T9=Ja,O9=Gf,N9=Xa,$9=Ji,_9=Hf;function Ki(e,t){if(Array.isArray(e))return e.map(i=>Ki(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:N9.prototype};o.map&&(o.map={...o.map,__proto__:M9.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Ki(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new $9(r);if(r.type==="decl")return new I9(r);if(r.type==="rule")return new _9(r);if(r.type==="comment")return new T9(r);if(r.type==="atrule")return new O9(r);throw new Error("Unknown node type: "+e.type)}var L9=Ki;Ki.default=Ki;var D9=Uf,Ix=Za,B9=Px,F9=Wn,qf=P9,U9=qa,j9=L9,Mx=Wf,V9=Sx,Tx=Ja,Ox=Gf,W9=zf,z9=Xa,G9=Kf,H9=Ax,Nx=Hf,$x=Ji,K9=Ya;function oe(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new qf(e)}oe.plugin=function(t,n){let r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
140
140
  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:
141
- https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new qf().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return oe([i(l)]).process(s,a)},i};oe.stringify=D9;oe.parse=V9;oe.fromJSON=B9;oe.list=W9;oe.comment=e=>new kx(e);oe.atRule=e=>new Px(e);oe.decl=e=>new Cx(e);oe.rule=e=>new Ix(e);oe.root=e=>new Mx(e);oe.document=e=>new Ex(e);oe.CssSyntaxError=$9;oe.Declaration=Cx;oe.Container=L9;oe.Processor=qf;oe.Document=Ex;oe.Comment=kx;oe.Warning=F9;oe.AtRule=Px;oe.Result=U9;oe.Input=j9;oe.Rule=Ix;oe.Root=Mx;oe.Node=z9;_9.registerPostcss(oe);var G9=oe;oe.default=oe;var we=t_(G9);we.stringify;we.fromJSON;we.plugin;we.parse;we.list;we.document;we.comment;we.atRule;we.rule;we.decl;we.root;we.CssSyntaxError;we.Declaration;we.Container;we.Processor;we.Document;we.Comment;we.Warning;we.AtRule;we.Result;we.Input;we.Rule;we.Root;we.Node;var mf=class e{constructor(...t){lt(this,"parentElement",null),lt(this,"parentNode",null),lt(this,"ownerDocument"),lt(this,"firstChild",null),lt(this,"lastChild",null),lt(this,"previousSibling",null),lt(this,"nextSibling",null),lt(this,"ELEMENT_NODE",1),lt(this,"TEXT_NODE",3),lt(this,"nodeType"),lt(this,"nodeName"),lt(this,"RRNodeType")}get childNodes(){let t=[],n=this.firstChild;for(;n;)t.push(n),n=n.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,n){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 Ww={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zw={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ga={},H9=()=>!!globalThis.Zone;function Yf(e){if(ga[e])return ga[e];let t=globalThis[e],n=t.prototype,r=e in Ww?Ww[e]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(n,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in zw?zw[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof n[a]=="function"&&((l=n[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!H9())return ga[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?ga[e]=u:n}catch{return n}}var Nd={};function on(e,t,n){var r;let i=`${e}.${String(n)}`;if(Nd[i])return Nd[i].call(t);let o=Yf(e),s=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return s?(Nd[i]=s,s.call(t)):t[n]}var $d={};function Tx(e,t,n){let r=`${e}.${String(n)}`;if($d[r])return $d[r].bind(t);let o=Yf(e)[n];return typeof o!="function"?t[n]:($d[r]=o,o.bind(t))}function K9(e){return on("Node",e,"ownerDocument")}function q9(e){return on("Node",e,"childNodes")}function Y9(e){return on("Node",e,"parentNode")}function Z9(e){return on("Node",e,"parentElement")}function X9(e){return on("Node",e,"textContent")}function J9(e,t){return Tx("Node",e,"contains")(t)}function Q9(e){return Tx("Node",e,"getRootNode")()}function eL(e){return!e||!("host"in e)?null:on("ShadowRoot",e,"host")}function tL(e){return e.styleSheets}function nL(e){return!e||!("shadowRoot"in e)?null:on("Element",e,"shadowRoot")}function rL(e,t){return on("Element",e,"querySelector")(t)}function iL(e,t){return on("Element",e,"querySelectorAll")(t)}function Ox(){return Yf("MutationObserver").constructor}function zn(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var U={ownerDocument:K9,childNodes:q9,parentNode:Y9,parentElement:Z9,textContent:X9,contains:J9,getRootNode:Q9,host:eL,styleSheets:tL,shadowRoot:nL,querySelector:rL,querySelectorAll:iL,mutationObserver:Ox,patch:zn};function ze(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Ar=`Please stop import mirror directly. Instead of that,\r
141
+ https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new qf().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return oe([i(l)]).process(s,a)},i};oe.stringify=U9;oe.parse=G9;oe.fromJSON=j9;oe.list=H9;oe.comment=e=>new Tx(e);oe.atRule=e=>new Ox(e);oe.decl=e=>new Ix(e);oe.rule=e=>new Nx(e);oe.root=e=>new $x(e);oe.document=e=>new Mx(e);oe.CssSyntaxError=D9;oe.Declaration=Ix;oe.Container=F9;oe.Processor=qf;oe.Document=Mx;oe.Comment=Tx;oe.Warning=V9;oe.AtRule=Ox;oe.Result=W9;oe.Input=z9;oe.Rule=Nx;oe.Root=$x;oe.Node=K9;B9.registerPostcss(oe);var q9=oe;oe.default=oe;var we=i_(q9);we.stringify;we.fromJSON;we.plugin;we.parse;we.list;we.document;we.comment;we.atRule;we.rule;we.decl;we.root;we.CssSyntaxError;we.Declaration;we.Container;we.Processor;we.Document;we.Comment;we.Warning;we.AtRule;we.Result;we.Input;we.Rule;we.Root;we.Node;var mf=class e{constructor(...t){lt(this,"parentElement",null),lt(this,"parentNode",null),lt(this,"ownerDocument"),lt(this,"firstChild",null),lt(this,"lastChild",null),lt(this,"previousSibling",null),lt(this,"nextSibling",null),lt(this,"ELEMENT_NODE",1),lt(this,"TEXT_NODE",3),lt(this,"nodeType"),lt(this,"nodeName"),lt(this,"RRNodeType")}get childNodes(){let t=[],n=this.firstChild;for(;n;)t.push(n),n=n.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,n){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 Kw={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},qw={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ga={},Y9=()=>!!globalThis.Zone;function Yf(e){if(ga[e])return ga[e];let t=globalThis[e],n=t.prototype,r=e in Kw?Kw[e]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(n,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in qw?qw[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof n[a]=="function"&&((l=n[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!Y9())return ga[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?ga[e]=u:n}catch{return n}}var Nd={};function on(e,t,n){var r;let i=`${e}.${String(n)}`;if(Nd[i])return Nd[i].call(t);let o=Yf(e),s=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return s?(Nd[i]=s,s.call(t)):t[n]}var $d={};function _x(e,t,n){let r=`${e}.${String(n)}`;if($d[r])return $d[r].bind(t);let o=Yf(e)[n];return typeof o!="function"?t[n]:($d[r]=o,o.bind(t))}function Z9(e){return on("Node",e,"ownerDocument")}function X9(e){return on("Node",e,"childNodes")}function J9(e){return on("Node",e,"parentNode")}function Q9(e){return on("Node",e,"parentElement")}function eL(e){return on("Node",e,"textContent")}function tL(e,t){return _x("Node",e,"contains")(t)}function nL(e){return _x("Node",e,"getRootNode")()}function rL(e){return!e||!("host"in e)?null:on("ShadowRoot",e,"host")}function iL(e){return e.styleSheets}function oL(e){return!e||!("shadowRoot"in e)?null:on("Element",e,"shadowRoot")}function sL(e,t){return on("Element",e,"querySelector")(t)}function aL(e,t){return on("Element",e,"querySelectorAll")(t)}function Lx(){return Yf("MutationObserver").constructor}function zn(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var U={ownerDocument:Z9,childNodes:X9,parentNode:J9,parentElement:Q9,textContent:eL,contains:tL,getRootNode:nL,host:rL,styleSheets:iL,shadowRoot:oL,querySelector:sL,querySelectorAll:aL,mutationObserver:Lx,patch:zn};function ze(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Ar=`Please stop import mirror directly. Instead of that,\r
142
142
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
143
- or you can use record.mirror to access the mirror instance during recording.`,Gw={map:{},getId(){return console.error(Ar),-1},getNode(){return console.error(Ar),null},removeNodeFromMap(){console.error(Ar)},has(){return console.error(Ar),!1},reset(){console.error(Ar)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Gw=new Proxy(Gw,{get(e,t,n){return t==="map"&&console.error(Ar),Reflect.get(e,t,n)}}));function qi(e,t,n={}){let r=null,i=0;return function(...o){let s=Date.now();!i&&n.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(l,o)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(l,o)},a))}}function Qa(e,t,n,r,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(s){setTimeout(()=>{n.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>Qa(e,t,o||{},!0)}var Fa=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Fa=()=>new Date().getTime());function Nx(e){var t,n,r,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)||((n=o?.body)==null?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=U.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}function $x(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _x(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Lx(e){return e?e.nodeType===e.ELEMENT_NODE?e:U.parentElement(e):null}function Ge(e,t,n,r){if(!e)return!1;let i=Lx(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||r&&i.closest("."+t)!==null)return!0}else if(Ma(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function oL(e,t){return t.getId(e)!==-1}function _d(e,t,n){return e.tagName==="TITLE"&&n.headTitleMutations?!0:t.getId(e)===Fi}function Dx(e,t){if(Li(e))return!1;let n=t.getId(e);if(!t.has(n))return!0;let r=U.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:r?Dx(r,t):!0}function yf(e){return!!e.changedTouches}function sL(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 Bx(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Fx(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function gf(e){return e?e instanceof mf&&"shadowRoot"in e?!!e.shadowRoot:!!U.shadowRoot(e):!1}var bf=class{constructor(){C(this,"id",1),C(this,"styleIDMap",new WeakMap),C(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}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 Ux(e){var t;let n=null;return"getRootNode"in e&&((t=U.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&U.host(U.getRootNode(e))&&(n=U.host(U.getRootNode(e))),n}function aL(e){let t=e,n;for(;n=Ux(t);)t=n;return t}function lL(e){let t=U.ownerDocument(e);if(!t)return!1;let n=aL(e);return U.contains(t,n)}function jx(e){let t=U.ownerDocument(e);return t?U.contains(t,e)||lL(e):!1}var q=(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))(q||{}),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||{}),Ye=(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))(Ye||{}),en=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(en||{}),_r=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(_r||{}),Cr=(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))(Cr||{});var Vx=(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))(Vx||{});function Hw(e){return"__ln"in e}var Sf=class{constructor(){C(this,"length",0),C(this,"head",null),C(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Hw(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&Hw(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},Kw=(e,t)=>`${e}@${t}`,wf=class{constructor(){C(this,"frozen",!1),C(this,"locked",!1),C(this,"texts",[]),C(this,"attributes",[]),C(this,"attributeMap",new WeakMap),C(this,"removes",[]),C(this,"mapRemoves",[]),C(this,"movedMap",{}),C(this,"addedSet",new Set),C(this,"movedSet",new Set),C(this,"droppedSet",new Set),C(this,"removesSubTreeCache",new Set),C(this,"mutationCb"),C(this,"blockClass"),C(this,"blockSelector"),C(this,"maskTextClass"),C(this,"maskTextSelector"),C(this,"inlineStylesheet"),C(this,"maskInputOptions"),C(this,"maskTextFn"),C(this,"maskInputFn"),C(this,"keepIframeSrcFn"),C(this,"recordCanvas"),C(this,"inlineImages"),C(this,"slimDOMOptions"),C(this,"dataURLOptions"),C(this,"doc"),C(this,"mirror"),C(this,"iframeManager"),C(this,"stylesheetManager"),C(this,"shadowDomManager"),C(this,"canvasManager"),C(this,"processedNodeManager"),C(this,"unattachedDoc"),C(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),C(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],n=new Set,r=new Sf,i=l=>{let u=l,c=Fi;for(;c===Fi;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=U.parentNode(l);if(!u||!jx(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let h=u.tagName;if(h==="TEXTAREA")return;h==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=Li(u)?this.mirror.getId(Ux(l)):this.mirror.getId(u),f=i(l);if(d===-1||f===-1)return r.addNode(l);let p=kr(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:h=>{Bx(h,this.mirror)&&this.iframeManager.addIframe(h),Fx(h,this.mirror)&&this.stylesheetManager.trackLinkElement(h),gf(l)&&this.shadowDomManager.addShadowRoot(U.shadowRoot(l),this.doc)},onIframeLoad:(h,m)=>{this.iframeManager.attachIframe(h,m),this.shadowDomManager.observeAttachShadow(h)},onStylesheetLoad:(h,m)=>{this.stylesheetManager.attachLinkElement(h,m)},cssCaptured:c});p&&(t.push({parentId:d,nextId:f,node:p}),n.add(p.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)qw(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(U.parentNode(l))||o(l);for(let l of this.addedSet)!Yw(this.droppedSet,l)&&!qw(this.removesSubTreeCache,l,this.mirror)||Yw(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;r.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=r.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 p=c.value,h=U.parentNode(p);if(h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=U.host(h);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}s=l.previous,r.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=>!n.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=>!n.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))}),C(this,"genTextAreaValueMutation",t=>{let n=this.attributeMap.get(t);n||(n={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(t,n));let r=Array.from(U.childNodes(t),i=>U.textContent(i)||"").join("");n.attributes.value=ka({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Pa(t),value:r,maskInputFn:this.maskInputFn})}),C(this,"processMutation",t=>{if(!_d(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let n=U.textContent(t.target);!Ge(t.target,this.blockClass,this.blockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:u1(t.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,Lx(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.attributeName,i=t.target.getAttribute(r);if(r==="value"){let s=Pa(n);i=ka({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(Ge(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!n.contentDocument)r="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!l1(n.tagName,r))if(o.attributes[r]=a1(this.doc,jn(n.tagName),jn(r),i),r==="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(n.style)){let l=n.style.getPropertyValue(a),u=n.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))n.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else r==="open"&&n.tagName==="DIALOG"&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(Ge(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),i=Li(t.target)?this.mirror.getId(U.host(t.target)):this.mirror.getId(t.target);Ge(t.target,this.blockClass,this.blockSelector,!1)||_d(n,this.mirror,this.slimDOMOptions)||!oL(n,this.mirror)||(this.addedSet.has(n)?(xf(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||Dx(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Kw(r,i)]?xf(this.movedSet,n):(this.removes.push({parentId:i,id:r,isShadow:Li(t.target)&&Di(t.target)?!0:void 0}),uL(n,this.removesSubTreeCache))),this.mapRemoves.push(n))});break}}}),C(this,"genAdds",(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(_d(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Kw(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ge(t,this.blockClass,this.blockSelector,!1)||(U.childNodes(t).forEach(r=>this.genAdds(r)),gf(t)&&U.childNodes(U.shadowRoot(t)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,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(n=>{this[n]=t[n]})}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 xf(e,t){e.delete(t),U.childNodes(t).forEach(n=>xf(e,n))}function uL(e,t){let n=[e];for(;n.length;){let r=n.pop();t.has(r)||(t.add(r),U.childNodes(r).forEach(i=>n.push(i)))}}function qw(e,t,n){return e.size===0?!1:cL(e,t)}function cL(e,t,n){let r=U.parentNode(t);return r?e.has(r):!1}function Yw(e,t){return e.size===0?!1:Wx(e,t)}function Wx(e,t){let n=U.parentNode(t);return n?e.has(n)?!0:Wx(e,n):!1}var Bi;function dL(e){Bi=e}function fL(){Bi=void 0}var Z=e=>Bi?(...n)=>{try{return e(...n)}catch(r){if(Bi&&Bi(r)===!0)return;throw r}}:e,Un=[];function Qi(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 zx(e,t){let n=new wf;Un.push(n),n.init(e);let r=new(Ox())(Z(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function hL({mousemoveCb:e,sampling:t,doc:n,mirror:r}){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=qi(Z(d=>{let f=Date.now()-a;e(s.map(p=>(p.timeOffset-=f,p)),d),s=[],a=null}),o),u=Z(qi(Z(d=>{let f=Qi(d),{clientX:p,clientY:h}=yf(d)?d.changedTouches[0]:d;a||(a=Fa()),s.push({x:p,y:h,id:r.getId(f),timeOffset:Fa()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?z.Drag:d instanceof MouseEvent?z.MouseMove:z.TouchMove)}),i,{trailing:!1})),c=[ze("mousemove",u,n),ze("touchmove",u,n),ze("drag",u,n)];return Z(()=>{c.forEach(d=>d())})}function pL({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,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 f=Qi(d);if(Ge(f,r,i,!0))return;let p=null,h=c;if("pointerType"in d){switch(d.pointerType){case"mouse":p=en.Mouse;break;case"touch":p=en.Touch;break;case"pen":p=en.Pen;break}p===en.Touch?Ye[c]===Ye.MouseDown?h="TouchStart":Ye[c]===Ye.MouseUp&&(h="TouchEnd"):en.Pen}else yf(d)&&(p=en.Touch);p!==null?(l=p,(h.startsWith("Touch")&&p===en.Touch||h.startsWith("Mouse")&&p===en.Mouse)&&(p=null)):Ye[c]===Ye.Click&&(p=l,l=null);let m=yf(d)?d.changedTouches[0]:d;if(!m)return;let y=n.getId(f),{clientX:S,clientY:w}=m;Z(e)({type:Ye[h],id:y,x:S,y:w,...p!==null&&{pointerType:p}})};return Object.keys(Ye).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=jn(c),f=u(c);if(window.PointerEvent)switch(Ye[c]){case Ye.MouseDown:case Ye.MouseUp:d=d.replace("mouse","pointer");break;case Ye.TouchStart:case Ye.TouchEnd:return}a.push(ze(d,f,t))}),Z(()=>{a.forEach(c=>c())})}function Gx({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){let s=Z(qi(Z(a=>{let l=Qi(a);if(!l||Ge(l,r,i,!0))return;let u=n.getId(l);if(l===t&&t.defaultView){let c=Nx(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 ze("scroll",s,t)}function mL({viewportResizeCb:e},{win:t}){let n=-1,r=-1,i=Z(qi(Z(()=>{let o=$x(),s=_x();(n!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),n=o,r=s)}),200));return ze("resize",i,t)}var yL=["INPUT","TEXTAREA","SELECT"],Zw=new WeakMap;function gL({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(w){let g=Qi(w),x=w.isTrusted,P=g&&g.tagName;if(g&&P==="OPTION"&&(g=U.parentElement(g)),!g||!P||yL.indexOf(P)<0||Ge(g,r,i,!0)||g.classList.contains(o)||s&&g.matches(s))return;let N=g.value,$=!1,_=Pa(g)||"";_==="radio"||_==="checkbox"?$=g.checked:(a[P.toLowerCase()]||a[_])&&(N=ka({element:g,maskInputOptions:a,tagName:P,type:_,value:N,maskInputFn:l})),f(g,c?{text:N,isChecked:$,userTriggered:x}:{text:N,isChecked:$});let I=g.name;_==="radio"&&I&&$&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(j=>{if(j!==g){let V=j.value;f(j,c?{text:V,isChecked:!$,userTriggered:!1}:{text:V,isChecked:!$})}})}function f(w,g){let x=Zw.get(w);if(!x||x.text!==g.text||x.isChecked!==g.isChecked){Zw.set(w,g);let P=n.getId(w);Z(e)({...g,id:P})}}let h=(u.input==="last"?["change"]:["input","change"]).map(w=>ze(w,Z(d),t)),m=t.defaultView;if(!m)return()=>{h.forEach(w=>w())};let y=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 y&&y.set&&h.push(...S.map(w=>Qa(w[0],w[1],{set(){Z(d)({target:this,isTrusted:!1})}},!1,m))),Z(()=>{h.forEach(w=>w())})}function Ua(e){let t=[];function n(r,i){if(ba("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||ba("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||ba("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||ba("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let s=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(s)}else if(r.parentStyleSheet){let s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(s)}return i}return n(e,t)}function An(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function bL({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Z((c,d,f)=>{let[p,h]=f,{id:m,styleId:y}=An(d,t,n.styleMirror);return(m&&m!==-1||y&&y!==-1)&&e({id:m,styleId:y,adds:[{rule:p,index:h}]}),c.apply(d,f)})}),r.CSSStyleSheet.prototype.addRule=function(c,d,f=this.cssRules.length){let p=`${c} { ${d} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[p,f])};let o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Z((c,d,f)=>{let[p]=f,{id:h,styleId:m}=An(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:p}]}),c.apply(d,f)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Z((c,d,f)=>{let[p]=f,{id:h,styleId:m}=An(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:p}),c.apply(d,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Z((c,d,f)=>{let[p]=f,{id:h,styleId:m}=An(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:p}),c.apply(d,f)})}));let l={};Sa("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Sa("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Sa("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Sa("CSSSupportsRule")&&(l.CSSSupportsRule=r.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:Z((f,p,h)=>{let[m,y]=h,{id:S,styleId:w}=An(p.parentStyleSheet,t,n.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:m,index:[...Ua(p),y||0]}]}),f.apply(p,h)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:Z((f,p,h)=>{let[m]=h,{id:y,styleId:S}=An(p.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...Ua(p),m]}]}),f.apply(p,h)})})}),Z(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function Hx({mirror:e,stylesheetManager:t},n){var r,i,o;let s=null;n.nodeName==="#document"?s=e.getId(n):s=e.getId(U.host(n));let a=n.nodeName==="#document"?(r=n.defaultView)==null?void 0:r.Document:(o=(i=n.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(n,"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}}),Z(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function SL({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Z((a,l,u)=>{var c;let[d,f,p]=u;if(n.has(d))return o.apply(l,[d,f,p]);let{id:h,styleId:m}=An((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,set:{property:d,value:f,priority:p},index:Ua(l.parentRule)}),a.apply(l,u)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Z((a,l,u)=>{var c;let[d]=u;if(n.has(d))return s.apply(l,[d]);let{id:f,styleId:p}=An((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(f&&f!==-1||p&&p!==-1)&&e({id:f,styleId:p,remove:{property:d},index:Ua(l.parentRule)}),a.apply(l,u)})}),Z(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function wL({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){let s=Z(l=>qi(Z(u=>{let c=Qi(u);if(!c||Ge(c,t,n,!0))return;let{currentTime:d,volume:f,muted:p,playbackRate:h,loop:m}=c;e({type:l,id:r.getId(c),currentTime:d,volume:f,muted:p,playbackRate:h,loop:m})}),i.media||500)),a=[ze("play",s(Cr.Play),o),ze("pause",s(Cr.Pause),o),ze("seeked",s(Cr.Seeked),o),ze("volumechange",s(Cr.VolumeChange),o),ze("ratechange",s(Cr.RateChange),o)];return Z(()=>{a.forEach(l=>l())})}function xL({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,o=n.FontFace;n.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=zn(t.fonts,"add",function(a){return function(l){return setTimeout(Z(()=>{let u=i.get(l);u&&(e(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{n.FontFace=o}),r.push(s),Z(()=>{r.forEach(a=>a())})}function vL(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e,s=!0,a=Z(()=>{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 f=l.getRangeAt(d),{startContainer:p,startOffset:h,endContainer:m,endOffset:y}=f;Ge(p,r,i,!0)||Ge(m,r,i,!0)||u.push({start:n.getId(p),startOffset:h,end:n.getId(m),endOffset:y})}o({ranges:u})});return a(),ze("selectionchange",a)}function RL({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:zn(n.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 AL(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:f,selectionCb:p,customElementCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),n(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),r(...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),f(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),p(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),h(...m)}}function CL(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};AL(e,t);let r;e.recordDOM&&(r=zx(e,e.doc));let i=hL(e),o=pL(e),s=Gx(e),a=mL(e,{win:n}),l=gL(e),u=wL(e),c=()=>{},d=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(c=bL(e,{win:n}),d=Hx(e,e.doc),f=SL(e,{win:n}),e.collectFonts&&(p=xL(e)));let h=vL(e),m=RL(e),y=[];for(let S of e.plugins)y.push(S.observer(S.callback,n,S.options));return Z(()=>{Un.forEach(S=>S.reset()),r?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),f(),p(),h(),m(),y.forEach(S=>S())})}function ba(e){return typeof window[e]<"u"}function Sa(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ja=class{constructor(t){C(this,"iframeIdToRemoteIdMap",new WeakMap),C(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,n,r,i){let o=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(n);return a||(a=this.generateIdFn(),o.set(n,a),s.set(a,n)),a}getIds(t,n){let r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return n.map(o=>this.getId(t,o,r,i))}getRemoteId(t,n,r){let i=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let o=i.get(n);return o||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(i=>this.getRemoteId(t,i,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}},vf=class{constructor(t){C(this,"iframes",new WeakMap),C(this,"crossOriginIframeMap",new WeakMap),C(this,"crossOriginIframeMirror",new ja(s1)),C(this,"crossOriginIframeStyleMirror"),C(this,"crossOriginIframeRootIdMap",new WeakMap),C(this,"mirror"),C(this,"mutationCb"),C(this,"wrappedEmit"),C(this,"loadListener"),C(this,"stylesheetManager"),C(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ja(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,n){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=t.contentWindow)==null||r.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 n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;let i=this.crossOriginIframeMap.get(t.source);if(!i)return;let o=this.transformCrossOriginEvent(i,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case q.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);let i=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(n.data.node,i),{timestamp:n.timestamp,type:q.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case q.Meta:case q.Load:case q.DomContentLoaded:return!1;case q.Plugin:return n;case q.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case q.IncrementalSnapshot:switch(n.data.source){case z.Mutation:return n.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)}),n.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),n.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),n.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case z.Drag:case z.TouchMove:case z.MouseMove:return n.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(n.data,t,["id"]),n;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case z.Font:return n;case z.Selection:return n.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),n;case z.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),n}}return!1}replace(t,n,r,i){for(let o of i)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=t.getIds(r,n[o]):n[o]=t.getId(r,n[o]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==Vx.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},Rf=class{constructor(t){C(this,"shadowDoms",new WeakSet),C(this,"mutationCb"),C(this,"scrollCb"),C(this,"bypassOptions"),C(this,"mirror"),C(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,n){if(!Di(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let r=zx({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Gx({...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(Hx({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(zn(t.prototype,"attachShadow",function(i){return function(o){let s=i.call(this,o),a=U.shadowRoot(this);return a&&jx(this)&&r.addShadowRoot(a,n),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Pr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",EL=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(_i=0;_i<Pr.length;_i++)EL[Pr.charCodeAt(_i)]=_i;var _i,kL=function(e){var t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Pr[t[n]>>2],i+=Pr[(t[n]&3)<<4|t[n+1]>>4],i+=Pr[(t[n+1]&15)<<2|t[n+2]>>6],i+=Pr[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Xw=new Map;function PL(e,t){let n=Xw.get(e);return n||(n=new Map,Xw.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Kx=(e,t,n)=>{if(!e||!(Yx(e,t)||typeof e=="object"))return;let r=e.constructor.name,i=PL(n,r),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Aa(e,t,n){if(e instanceof Array)return e.map(r=>Aa(r,t,n));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 r=e.constructor.name,i=kL(e);return{rr_type:r,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Aa(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:i}=e;return{rr_type:r,src:i}}else if(e instanceof HTMLCanvasElement){let r="HTMLImageElement",i=e.toDataURL();return{rr_type:r,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Aa(e.data,t,n),e.width,e.height]};if(Yx(e,t)||typeof e=="object"){let r=e.constructor.name,i=Kx(e,t,n);return{rr_type:r,index:i}}}}return e}var qx=(e,t,n)=>e.map(r=>Aa(r,t,n)),Yx=(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 IL(e,t,n,r){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=zn(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...u){return Ge(this.canvas,n,r,!0)||setTimeout(()=>{let c=qx(u,t,this);e(this.canvas,{type:_r["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=Qa(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:_r["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function ML(e){return e==="experimental-webgl"?"webgl":e}function Jw(e,t,n,r){let i=[];try{let o=zn(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!Ge(this,t,n,!0)){let u=ML(a);if("__context"in this||(this.__context=u),r&&["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 Qw(e,t,n,r,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=zn(e,l,function(c){return function(...d){let f=c.apply(this,d);if(Kx(f,o,this),"tagName"in this.canvas&&!Ge(this.canvas,r,i,!0)){let p=qx(d,o,this),h={type:t,property:l,args:p};n(this.canvas,h)}return f}});s.push(u)}catch{let u=Qa(e,l,{set(c){n(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function TL(e,t,n,r){let i=[];return i.push(...Qw(t.WebGLRenderingContext.prototype,_r.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Qw(t.WebGL2RenderingContext.prototype,_r.WebGL2,e,n,r,t)),()=>{i.forEach(o=>o())}}var Zx="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",OL=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),e1=typeof window<"u"&&window.Blob&&new Blob([OL(Zx)],{type:"text/javascript;charset=utf-8"});function NL(e){let t;try{if(t=e1&&(window.URL||window.webkitURL).createObjectURL(e1),!t)throw"";let n=new Worker(t,{name:e?.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker("data:text/javascript;base64,"+Zx,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var Af=class{constructor(t){C(this,"pendingCanvasMutations",new Map),C(this,"rafStamps",{latestId:0,invokeId:null}),C(this,"mirror"),C(this,"mutationCb"),C(this,"resetObservers"),C(this,"frozen",!1),C(this,"locked",!1),C(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:n="all",win:r,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&n==="all"&&this.initCanvasMutationObserver(r,i,o),s&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,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,n,r,i,o){let s=Jw(n,r,i,!0),a=new Map,l=new NL;l.onmessage=h=>{let{id:m}=h.data;if(a.set(m,!1),!("base64"in h.data))return;let{base64:y,type:S,width:w,height:g}=h.data;this.mutationCb({id:m,type:_r["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};let u=1e3/t,c=0,d,f=()=>{let h=[];return n.document.querySelectorAll("canvas").forEach(m=>{Ge(m,r,i,!0)||h.push(m)}),h},p=h=>{if(c&&h-c<u){d=requestAnimationFrame(p);return}c=h,f().forEach(async m=>{var y;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 g=m.getContext(m.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.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(p)};d=requestAnimationFrame(p),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Jw(t,n,r,!1),o=IL(this.processMutation.bind(this),t,n,r),s=TL(this.processMutation.bind(this),t,n,r);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;let i=r.map(s=>{let{type:a,...l}=s;return l}),{type:o}=r[0];this.mutationCb({id:n,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}},Cf=class{constructor(t){C(this,"trackedLinkElements",new WeakSet),C(this,"mutationCb"),C(this,"adoptedStyleSheetCb"),C(this,"styleMirror",new bf),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,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:i1(a,o.href),index:l}))})),r.styleIds.push(s)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Ef=class{constructor(){C(this,"nodeMap",new WeakMap),C(this,"active",!1)}inOtherBuffer(t,n){let r=this.nodeMap.get(t);return r&&Array.from(r).some(i=>i!==n)}add(t,n){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},Ce,Ca,Ld,Va=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((nw=e.contentWindow)==null?void 0:nw.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var xt=L7();function Gn(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,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:f,slimDOMOptions:p,maskInputFn:h,maskTextFn:m,hooks:y,packFn:S,sampling:w={},dataURLOptions:g={},mousemoveWait:x,recordDOM:P=!0,recordCanvas:N=!1,recordCrossOriginIframes:$=!1,recordAfter:_=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:I=!1,collectFonts:j=!1,inlineImages:V=!1,plugins:se,keepIframeSrcFn:L=()=>!1,ignoreCSSAttributes:$e=new Set([]),errorHandler:Ze}=e;dL(Ze);let ce=$?window.parent===window:!0,Le=!1;if(!ce)try{window.parent.document&&(Le=!1)}catch{Le=!0}if(ce&&!t)throw new Error("emit function is required");if(!ce&&!Le)return()=>{};x!==void 0&&w.mousemove===void 0&&(w.mousemove=x),xt.reset();let Ct=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}:f!==void 0?f:{password:!0},Me=c1(p);sL();let ro,Br=0,Hn=X=>{for(let He of se||[])He.eventProcessor&&(X=He.eventProcessor(X));return S&&!Le&&(X=S(X)),X};Ce=(X,He)=>{var me;let xe=X;if(xe.timestamp=Fa(),(me=Un[0])!=null&&me.isFrozen()&&xe.type!==q.FullSnapshot&&!(xe.type===q.IncrementalSnapshot&&xe.data.source===z.Mutation)&&Un.forEach(Xe=>Xe.unfreeze()),ce)t?.(Hn(xe),He);else if(Le){let Xe={type:"rrweb",event:Hn(xe),origin:window.location.origin,isCheckout:He};window.parent.postMessage(Xe,"*")}if(xe.type===q.FullSnapshot)ro=xe,Br=0;else if(xe.type===q.IncrementalSnapshot){if(xe.data.source===z.Mutation&&xe.data.isAttachIframe)return;Br++;let Xe=r&&Br>=r,ae=n&&xe.timestamp-ro.timestamp>n;(Xe||ae)&&Ca(!0)}};let ut=X=>{Ce({type:q.IncrementalSnapshot,data:{source:z.Mutation,...X}})},Fr=X=>Ce({type:q.IncrementalSnapshot,data:{source:z.Scroll,...X}}),sn=X=>Ce({type:q.IncrementalSnapshot,data:{source:z.CanvasMutation,...X}}),Ur=X=>Ce({type:q.IncrementalSnapshot,data:{source:z.AdoptedStyleSheet,...X}}),ct=new Cf({mutationCb:ut,adoptedStyleSheetCb:Ur}),Et=new vf({mirror:xt,mutationCb:ut,stylesheetManager:ct,recordCrossOriginIframes:$,wrappedEmit:Ce});for(let X of se||[])X.getMirror&&X.getMirror({nodeMirror:xt,crossOriginIframeMirror:Et.crossOriginIframeMirror,crossOriginIframeStyleMirror:Et.crossOriginIframeStyleMirror});let Kn=new Ef;Ld=new Af({recordCanvas:N,mutationCb:sn,win:window,blockClass:i,blockSelector:o,mirror:xt,sampling:w.canvas,dataURLOptions:g});let qn=new Rf({mutationCb:ut,scrollCb:Fr,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:Ct,dataURLOptions:g,maskTextFn:m,maskInputFn:h,recordCanvas:N,inlineImages:V,sampling:w,slimDOMOptions:Me,iframeManager:Et,stylesheetManager:ct,canvasManager:Ld,keepIframeSrcFn:L,processedNodeManager:Kn},mirror:xt});Ca=(X=!1)=>{if(!P)return;Ce({type:q.Meta,data:{href:window.location.href,width:_x(),height:$x()}},X),ct.reset(),qn.init(),Un.forEach(me=>me.lock());let He=s5(document,{mirror:xt,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:Ct,maskTextFn:m,maskInputFn:h,slimDOM:Me,dataURLOptions:g,recordCanvas:N,inlineImages:V,onSerialize:me=>{Bx(me,xt)&&Et.addIframe(me),Fx(me,xt)&&ct.trackLinkElement(me),gf(me)&&qn.addShadowRoot(U.shadowRoot(me),document)},onIframeLoad:(me,xe)=>{Et.attachIframe(me,xe),qn.observeAttachShadow(me)},onStylesheetLoad:(me,xe)=>{ct.attachLinkElement(me,xe)},keepIframeSrcFn:L});if(!He)return console.warn("Failed to snapshot the document");Ce({type:q.FullSnapshot,data:{node:He,initialOffset:Nx(window)}},X),Un.forEach(me=>me.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ct.adoptStyleSheets(document.adoptedStyleSheets,xt.getId(document))};try{let X=[],He=xe=>{var Xe;return Z(CL)({mutationCb:ut,mousemoveCb:(ae,el)=>Ce({type:q.IncrementalSnapshot,data:{source:el,positions:ae}}),mouseInteractionCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.MouseInteraction,...ae}}),scrollCb:Fr,viewportResizeCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.ViewportResize,...ae}}),inputCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.Input,...ae}}),mediaInteractionCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.MediaInteraction,...ae}}),styleSheetRuleCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.StyleSheetRule,...ae}}),styleDeclarationCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.StyleDeclaration,...ae}}),canvasMutationCb:sn,fontCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.Font,...ae}}),selectionCb:ae=>{Ce({type:q.IncrementalSnapshot,data:{source:z.Selection,...ae}})},customElementCb:ae=>{Ce({type:q.IncrementalSnapshot,data:{source:z.CustomElement,...ae}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:Ct,inlineStylesheet:c,sampling:w,recordDOM:P,recordCanvas:N,inlineImages:V,userTriggeredOnInput:I,collectFonts:j,doc:xe,maskInputFn:h,maskTextFn:m,keepIframeSrcFn:L,blockSelector:o,slimDOMOptions:Me,dataURLOptions:g,mirror:xt,iframeManager:Et,stylesheetManager:ct,shadowDomManager:qn,processedNodeManager:Kn,canvasManager:Ld,ignoreCSSAttributes:$e,plugins:((Xe=se?.filter(ae=>ae.observer))==null?void 0:Xe.map(ae=>({observer:ae.observer,options:ae.options,callback:el=>Ce({type:q.Plugin,data:{plugin:ae.name,payload:el}})})))||[]},y)};Et.addLoadListener(xe=>{try{X.push(He(xe.contentDocument))}catch(Xe){console.warn(Xe)}});let me=()=>{Ca(),X.push(He(document)),Va=!0};return["interactive","complete"].includes(document.readyState)?me():(X.push(ze("DOMContentLoaded",()=>{Ce({type:q.DomContentLoaded,data:{}}),_==="DOMContentLoaded"&&me()})),X.push(ze("load",()=>{Ce({type:q.Load,data:{}}),_==="load"&&me()},window))),()=>{X.forEach(xe=>{try{xe()}catch(Xe){String(Xe).toLowerCase().includes("cross-origin")||console.warn(Xe)}}),Kn.destroy(),Va=!1,fL()}}catch(X){console.warn(X)}}Gn.addCustomEvent=(e,t)=>{if(!Va)throw new Error("please add custom event after start recording");Ce({type:q.Custom,data:{tag:e,payload:t}})};Gn.freezePage=()=>{Un.forEach(e=>e.freeze())};Gn.takeFullSnapshot=e=>{if(!Va)throw new Error("please take full snapshot after start recording");Ca(e)};Gn.mirror=xt;var t1;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(t1||(t1={}));var vH=5*1e3;var{addCustomEvent:RH}=Gn,{freezePage:AH}=Gn,{takeFullSnapshot:CH}=Gn;var Qx="__ripploEmitRrwebEvent";function ev(){return{eventTypes:Xx(q),incrementalSources:Xx(z)}}function Xx(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,n])=>[n,t]))}var _L=xd("@ripplo/rrweb-bundle/bundle","rrweb.js"),Jx;function tv(){return Jx??=$L(_L,{encoding:"utf8"}),Jx}async function eo({clientVersion:e,debugDir:t,writeOtlpPortFile:n}){let r=new Map,i=YS(ev()),o=await vd({localDir:nv.join(nv.dirname(t),".local"),writePortFile:n,onRrwebBatch:(l,u)=>{r.get(l)?.emitRrwebBatch(u)},onSpan:l=>{let u=l.attributes["ripplo.run"];u!=null&&r.get(u)?.emit(l)}}),s=await tv();return{attach:async(l,u)=>{let c=qS({debugDir:t,runId:u,worker:i});c.emit({clientVersion:e,kind:"meta",source:"capture",timeNanos:"0"}),r.set(u,c),await QS(l,u),await l.addInitScript(`globalThis.__ripploCapturePort = ${String(o.port)};`),await DL(l,c),await UL(l,c);let d=[];return{emitAction:f=>{WL(c,f)},emitAssertion:f=>{zL(c,f)},emitFinding:f=>{let p=XS(f);p!=null&&c.emit(p)},finish:()=>jL(c,{pages:d,registry:r,runId:u}),onPage:f=>{d.push(f),VL(c,s,f)}}},debugDir:t,close:async()=>{await o.stop(),await i.terminate()},injectSpan:(l,u)=>{r.get(l)?.emit(u)}}}async function LL(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function DL(e,t){await e.exposeBinding(Qx,(n,r)=>{let i=typeof r=="string"?r:JSON.stringify(r);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}var BL="__ripploEventPush",FL=At.discriminatedUnion("kind",[At.object({kind:At.literal("console"),level:At.string(),text:At.string(),timestamp:At.number()}),At.object({kind:At.literal("error"),message:At.string(),stack:At.string().optional(),timestamp:At.number()})]);async function UL(e,t){await e.exposeBinding(BL,(n,r)=>{let i=FL.safeParse(r);if(!i.success)return;let o=i.data;if(o.kind==="console"){t.emit({kind:"console",level:o.level,source:"browser",text:o.text,timeNanos:Rn(o.timestamp)});return}t.emit({kind:"error",message:o.message,source:"browser",stack:o.stack,timeNanos:Rn(o.timestamp)})})}async function jL(e,t){await LL(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 VL(e,t,n){n.on("load",()=>{n.addScriptTag({content:t}).catch(()=>{})}),n.on("response",r=>{qL(e,r)}),n.url()!=="about:blank"&&n.addScriptTag({content:t}).catch(()=>{})}function WL(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:GL(t),timeNanos:Rn(Date.now()),value:HL(t)})}function zL(e,t){let n=ns(t);e.emit({kind:"assertion",label:n.label,outcome:t.outcome,source:"test",step:n.step,timeNanos:Rn(Date.now()),wait:t.waitBudget,waitMs:t.waitMs})}function GL(e){if(e.url!=null)return e.url;if(e.locator!=null)return Zf(e.locator)}function Zf(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${Zf(e.scope)} \u25B8 ${Zf(e.target)}`:`${e.role} ${e.name??""}`.trim()}function HL(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var KL=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;async function qL(e,t){let n=t.request(),r=n.resourceType();if(r!=="fetch"&&r!=="xhr"||KL.test(n.url()))return;let i=n.headers().traceparent?.split("-"),o=n.timing().startTime;e.emit({kind:"network",method:n.method(),requestBody:n.postData()??void 0,resourceType:r,responseBody:await YL(t),source:"browser",spanId:i?.[2],status:t.status(),timeNanos:Rn(o>0?o:Date.now()),traceId:i?.[1],url:t.url()})}async function YL(e){try{return await e.text()}catch{return}}function no(e){return{aborted:!0,findings:[],ran:[],teardown:e}}function Qf(e,t){return new Jf(oD(e,t))}function ZL(e,t){return new Jf(XL(e,t))}async function XL(e,t){let n=await dS(e.profileDir).catch(()=>{});if(n==null)return Lr(Ft(new Error("launch")));try{return to(await JL({context:n,params:e,signal:t}))}catch(r){return Lr(Ft(r))}finally{await n.close().catch(ft)}}async function JL({context:e,params:t,signal:n}){let r=e.pages()[0]??await e.newPage(),i=await eo({clientVersion:t.clientVersion,debugDir:t.debugDir,writeOtlpPortFile:!0}),o=await i.attach(e,t.runId);return o.onPage(r),e.on("page",s=>{o.onPage(s)}),await r.goto(t.startUrl).catch(ft),t.onReady(),await QL(e,n),await o.finish(),await i.close(),{behaviorPath:Xf.join(t.debugDir,t.runId,"behavior.jsonl")}}function QL(e,t){return new Promise(n=>{let r=()=>{n()};t.addEventListener("abort",r,{once:!0}),e.on("close",r),e.browser()?.on("disconnected",r),e.on("page",i=>i.on("close",r)),e.pages().forEach(i=>i.on("close",r))})}function eD(e,t){return new Jf(tD(e,t))}async function tD(e,t){let n=nD(e),r=ov({lockfile:e.lockfile,options:e.options,runId:e.runId,signal:t}),i=async o=>{try{return to(await rD({established:o,params:e,signal:t}))}catch(s){return await o.teardown().match(ft,ft),Lr(Ft(s))}};return iv(r,n).match(i,async o=>(await eh(r.teardown),Lr(o)))}function nD(e){return{capture:!1,lockfile:e.lockfile,onEvent:void 0,onPhase:void 0,options:e.options,params:void 0,runId:e.runId,sequence:e.sequence,test:e.test}}async function rD({established:e,params:t,signal:n}){let r=Fs({headed:!0}),i=await r.acquire(),o=await Bs({baseUrl:t.options.baseUrl,browser:i,capture:null,clientState:e.clientState,engine:Ls(sv(t.lockfile)),extraHeaders:th(t.options.tunnelAuth),fixturesDir:t.options.fixturesDir,reader:e.reader,session:e.auth,signal:n,viewport:null}),s=ui(t.lockfile),a=await ai({canon:Kr(t.lockfile),classify:Hr(t.lockfile),dataRules:s.dataRules,driver:o.driver,initialState:{snapshot:e.snapshot},onAssertion:o.emitAssertion,onEvent:ft,pageRules:Bo(s.pageRules,st(t.test)),sequence:t.sequence,stopAfterStep:t.stopAfterStep},n);return t.onReady(),await iD(i,o.context),await e.teardown().match(ft,ft),await r.close(),{kind:"handed-over",ran:a.ran.length}}function iD(e,t){return new Promise(n=>{let r=()=>{n()};e.on("disconnected",r),t.on("close",r),t.on("page",i=>i.on("close",r)),t.pages().forEach(i=>i.on("close",r))})}async function oD({browser:e,hub:t,request:n},r){if(r.aborted)return to(no("skipped"));let i=ov({lockfile:n.lockfile,options:n.options,runId:n.runId,signal:r}),o=async s=>{try{return to(await aD({browser:e,established:s,hub:t,request:n,signal:r}))}catch(a){return Lr(Ft(a))}};return iv(i,n).match(o,s=>sD(s,i.teardown))}async function sD(e,t){return e.kind!=="aborted"?Lr(e):to(no(await eh(t)))}function eh(e){return e().match(()=>"done",()=>"failed")}async function aD(e){let t=await uD(e);if(t.kind==="completed"){let r=Date.now();return await e.established.teardown().match(ft,Yl),e.request.onPhase?.("teardown",Date.now()-r),e.request.capture&&await lD(e.hub,e.request.runId),{aborted:!1,...t.result}}let n=await eh(e.established.teardown);if(t.kind==="aborted")return no(n);throw t.error}async function lD(e,t){let n=Xf.join(e.debugDir,t);await KS({jsonlPath:Xf.join(n,"behavior.jsonl"),outDir:n,runId:t,scale:void 0})}function rv(e,t,n){return ti(e,t).map(r=>({params:{...Ms(r),...n},transition:r}))}async function uD({browser:e,established:t,hub:n,request:r,signal:i}){try{ot(i);let o=Date.now(),{close:s,driver:a,emitAssertion:l,emitFinding:u}=await Bs({baseUrl:r.options.baseUrl,browser:e,capture:r.capture?{hub:n,runId:r.runId}:null,clientState:t.clientState,engine:Ls(sv(r.lockfile)),extraHeaders:th(r.options.tunnelAuth),fixturesDir:r.options.fixturesDir,reader:t.reader,session:t.auth,signal:i,viewport:cS});r.onPhase?.("browser",Date.now()-o);try{r.onEvent?.({aliases:t.aliases,generated:t.generated,generatedSingletons:t.generatedSingletons,kind:"world"});let c=ui(r.lockfile),d=Date.now(),f=await ai({canon:Kr(r.lockfile),classify:Hr(r.lockfile),dataRules:c.dataRules,driver:a,initialState:{snapshot:t.snapshot},onAssertion:l,pageRules:Bo(c.pageRules,st(r.test)),sequence:r.sequence??rv(r.lockfile,r.test,r.params),stopAfterStep:void 0,onEvent:p=>{p.kind==="finding"&&u(p.finding),r.onEvent?.(p)}},i);return r.onPhase?.("drive",Date.now()-d),{kind:"completed",result:f}}finally{await s()}}catch(o){return Ql(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function iv(e,t){let n=Date.now();return e.ready().andThen(()=>{t.onPhase?.("engine",Date.now()-n);let r=Date.now();return nr(t.lockfile,t.test,{generate:Yo(qo(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(i=>(t.onPhase?.("world",Date.now()-r),{aliases:i.aliases,auth:i.auth,clientState:i.clientState,generated:i.generated,generatedSingletons:i.generatedSingletons,reader:e.reader,snapshot:i.snapshot,teardown:e.teardown}))})}function ov({lockfile:e,options:t,runId:n,signal:r}){let i=ad({baseUrl:t.engineUrl,extraHeaders:th(t.tunnelAuth),runId:n,secret:t.secret},r);return{materialize:Io(i.setupWorld),reader:od(e.entities,cD(e),i.query),ready:i.ready,teardown:i.teardown}}function th(e){if(e!=null)return{"CF-Access-Client-Id":e.clientId,"CF-Access-Client-Secret":e.clientSecret}}function cD(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function sv(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}import{err as dD,ok as fD,ResultAsync as hD}from"neverthrow";function pD({clientVersion:e,debugDir:t,headed:n,writeOtlpPortFile:r}){let i=Fs({headed:n}),o,s,a=async()=>(o??=eo({clientVersion:e,debugDir:t,writeOtlpPortFile:r}),s=await o,s),l=async(d,f)=>{if(f.aborted)return fD(no("skipped"));try{let p=await a();return d.options.headed&&!n?await rd(!0,async h=>Qf({browser:h,hub:p,request:d},f)):await Qf({browser:await i.acquire(),hub:p,request:d},f)}catch(p){return dD(Ft(p))}};return{close:async()=>{await i.close();let d=o;o=void 0,s=void 0,d!=null&&await d.then(f=>f.close()).catch(()=>{})},prewarm:async()=>{await a(),await i.acquire()},injectSpan:(d,f)=>{s?.injectSpan(d,f)},runOnce:(d,f)=>new hD(l(d,f))}}import{z as G}from"zod";function mD(e){let t=e.split(`
144
- `).map(i=>TD(i)).filter(i=>i!=null),n=CD(t),r=t.map(i=>SD(i,n)).filter(i=>i!=null).filter(i=>i.kind==="input"||i.element!=null);return yD(r)}function yD(e){return e.filter((t,n)=>{let r=e[n+1];return!(t.kind==="input"&&r?.kind==="input"&&gD(t.element,r.element))})}function gD(e,t){return e?.testId===t?.testId&&e?.ariaLabel===t?.ariaLabel&&e?.placeholder===t?.placeholder}var bD={2:"click",3:"contextmenu",4:"dblclick"};function SD(e,t){return e.rrwebType==="IncrementalSnapshot:MouseInteraction"?wD(e,t):e.rrwebType==="IncrementalSnapshot:Input"?xD(e,t):null}function wD(e,t){let n=DD.safeParse(e.event.data);if(!n.success)return null;let r=bD[n.data.type];if(r==null)return null;let i=av(n.data.id,t.nodes);return{element:lv(i,t),kind:r,timeNanos:e.timeNanos,value:void 0}}function xD(e,t){let n=BD.safeParse(e.event.data);return n.success?{element:lv(n.data.id,t),kind:"input",timeNanos:e.timeNanos,value:n.data.text??vD(n.data.isChecked)}:null}function vD(e){return e==null?void 0:String(e)}var RD=new Set(["button","a","input","select","textarea","summary"]);function av(e,t){let n=t.get(e);if(n!=null)return AD(n)?e:n.parentId==null?void 0:av(n.parentId,t)}function AD(e){return e.attrs["data-testid"]!=null||e.attrs["aria-label"]!=null||e.attrs.role!=null||RD.has(e.tag??"")}function lv(e,t){let n=e==null?void 0:t.nodes.get(e);if(!(n==null||e==null))return{ariaLabel:Dr(n,"aria-label"),href:Dr(n,"href"),name:Dr(n,"name"),placeholder:Dr(n,"placeholder"),role:Dr(n,"role"),tag:n.tag,testId:Dr(n,"data-testid"),text:uv(e,t)}}function Dr(e,t){let n=e.attrs[t];return typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):void 0}function uv(e,t){let n=t.nodes.get(e);if(n==null)return;let r=n.text?.trim()??"",o=(t.children.get(e)??[]).map(a=>uv(a,t)??""),s=[r,...o].filter(a=>a.length>0).join(" ");return s.length===0?void 0:s.slice(0,100)}function CD(e){let t=e.flatMap(i=>ED(i).flatMap(o=>nh(o,void 0))),n=e.flatMap(i=>kD(i).flatMap(o=>nh(o.node,o.parentId??void 0))),r=ID(new Map([...t,...n]),e);return{children:PD(r),nodes:r}}function ED(e){if(e.rrwebType!=="FullSnapshot")return[];let t=$D.safeParse(e.event.data);return t.success?[t.data.node]:[]}function kD(e){if(e.rrwebType!=="IncrementalSnapshot:Mutation")return[];let t=cv.safeParse(e.event.data);return t.success?t.data.adds.flatMap(n=>{let r=_D.safeParse(n);return r.success?[r.data]:[]}):[]}function PD(e){let t=new Map;return e.forEach((n,r)=>{n.parentId!=null&&t.set(n.parentId,[...t.get(n.parentId)??[],r])}),t}function nh(e,t){let n=ND.safeParse(e);if(!n.success)return[];let r=n.data,i=r.childNodes??[];return[[r.id,{attrs:{...r.attributes},parentId:t,tag:r.tagName,text:r.textContent}],...i.flatMap(s=>nh(s,r.id))]}function ID(e,t){return t.flatMap(r=>MD(r)).reduce((r,i)=>{let o=r.get(i.id);return o==null?r:new Map(r).set(i.id,{...o,attrs:{...o.attrs,...i.attributes}})},e)}function MD(e){if(e.rrwebType!=="IncrementalSnapshot:Mutation")return[];let t=cv.safeParse(e.event.data);return t.success?t.data.attributes.flatMap(n=>{let r=LD.safeParse(n);return r.success?[r.data]:[]}):[]}function TD(e){if(e.trim().length===0)return null;let t=FD.safeParse(OD(e));return t.success?t.data:null}function OD(e){try{return JSON.parse(e)}catch{return null}}var ND=G.object({attributes:G.record(G.string(),G.unknown()).optional(),childNodes:G.array(G.unknown()).optional(),id:G.number(),tagName:G.string().optional(),textContent:G.string().optional()}),$D=G.object({node:G.unknown()}),_D=G.object({node:G.unknown(),parentId:G.number().nullable().default(null)}),LD=G.object({attributes:G.record(G.string(),G.unknown()),id:G.number()}),cv=G.object({adds:G.array(G.unknown()).default([]),attributes:G.array(G.unknown()).default([])}),DD=G.object({id:G.number(),type:G.number()}),BD=G.object({id:G.number(),isChecked:G.boolean().optional(),text:G.string().optional()}),FD=G.object({event:G.object({data:G.unknown()}),kind:G.literal("rrweb"),rrwebType:G.string(),timeNanos:G.string()});function UD(e){let t=n=>e.find(r=>r.phase===n)?.ms??0;return{browserMs:t("browser"),driveMs:t("drive"),engineMs:t("engine"),teardownMs:t("teardown"),worldMs:t("world")}}async function jD(e,t){let n=await mv({attemptIndex:0,capture:!1,params:e,stepRuns:e.stepRuns},t);if(n.kind!=="completed")return fv(n);let r=hv(n.findings);if(r!=null)return{error:r,kind:"error"};if(n.findings.length===0)return{kind:"clean",timing:{confirm:void 0,detect:n.timing}};let i=rh(e.baseState.name,n.findings);return e.seenSignature!=null&&await e.seenSignature(i.signature)?{baseState:e.baseState.name,captureEvents:[],kind:"finding",runId:n.runId,signature:i.signature,timing:{confirm:void 0,detect:n.timing},verifierLayer:i.layer}:VD(e,i,n.timing,t)}function fv(e){return e.kind==="error"?{error:e.error,kind:"error"}:{kind:e.kind}}function hv(e){let t=e.find(n=>n.kind==="driver-error"&&So(n.error));return t!=null&&t.kind==="driver-error"?t.error:void 0}async function VD(e,t,n,r){let i=await mv({attemptIndex:1,capture:!0,params:e,stepRuns:e.stepRuns},r);if(i.kind!=="completed")return fv(i);let o=hv(i.findings);if(o!=null)return{error:o,kind:"error"};let s={confirm:i.timing,detect:n};return rh(e.baseState.name,i.findings).signature!==t.signature?{kind:"flaky",timing:s}:{baseState:e.baseState.name,captureEvents:i.events,kind:"finding",runId:i.runId,signature:t.signature,timing:s,verifierLayer:t.layer}}function pv(e){return e.kind==="driver-error"||e.kind==="unrunnable"?"crash":e.kind==="pending-check"?e.source.kind==="data-rule"?"data-rule":e.source.kind==="page-rule"?"page-rule":"frame":"frame"}async function mv({attemptIndex:e,capture:t,params:n,stepRuns:r},i){let o=n.runIdFor(e),s=[],a=[];return(await n.session.runOnce({capture:t,lockfile:n.lockfile,onEvent:t?u=>{s.push(u)}:void 0,options:n.options,params:void 0,runId:o,sequence:WD(n,r),test:n.baseState.test,onPhase:(u,c)=>{a.push({ms:c,phase:u})}},i)).match(u=>u.aborted?{kind:"aborted"}:{events:s,findings:u.findings,kind:"completed",runId:o,timing:UD(a)},u=>({error:u,kind:"error"}))}function WD(e,t){return t.map(n=>{let r=e.corpus[n.idx];if(r==null)throw new Error("transition index out of corpus range");return{params:n.params,transition:r}})}function rh(e,t){let r=t.map(i=>({line:Ru(i),part:GD(i)})).toSorted((i,o)=>F(i.part).localeCompare(F(o.part))).map(i=>i.part);return{layer:zD(r),signature:F({baseState:e,parts:r.map(i=>F(i))})}}var dv={crash:0,"data-rule":1,frame:3,"page-rule":2};function zD(e){return e.map(n=>n.layer).toSorted((n,r)=>dv[n]-dv[r]).at(0)??"frame"}function GD(e){let t=pv(e);switch(e.kind){case"consistency":return{kind:"consistency",layer:t,mismatch:HD(e.mismatch),step:e.step==null?null:{intent:e.step.intent,test:e.step.test}};case"pending-check":return{kind:"pending-check",layer:t,source:e.source.kind,step:{intent:e.step.intent,test:e.step.test}};case"unrunnable":return{intent:e.intent,kind:"unrunnable",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"impossible-action":return{kind:"impossible-action",layer:t,step:e.step.intent}}}function HD(e){return e.kind==="singleton-mismatch"?{kind:e.kind,singleton:e.singleton}:e.kind==="browser-mismatch"?{browser:Ke(e.key),kind:e.kind}:{entity:e.entity,kind:e.kind}}async function yv(e,t){let n=await _s(e);if(n==null)return{kind:"unplannable"};let r=[...n.startingPointTests.values()].find(o=>st(o)===t.baseStateRef);if(r==null)return{kind:"unplannable"};let i=t.steps.map(o=>{let s=n.corpus.find(a=>a.test===o.test&&a.index===o.index);return s==null?null:{params:o.params,transition:s}});return i.some(o=>o==null)?{kind:"unplannable"}:{baseTest:r,kind:"ok",sequence:i.filter(o=>o!=null)}}async function KD({capture:e,lockfile:t,options:n,repro:r,runId:i,session:o,signal:s}){let a=await yv(t,r);return a.kind==="unplannable"?{kind:"unplannable"}:(await o.runOnce({capture:e,lockfile:t,onEvent:void 0,onPhase:void 0,options:n,params:void 0,runId:i,sequence:a.sequence,test:a.baseTest},s)).match(u=>u.aborted?{kind:"aborted"}:u.findings.length>0?{findings:u.findings,kind:"still-fails"}:{kind:"resolved"},u=>({kind:"state-unavailable",reason:u.kind}))}function AK(e){switch(e.kind){case"empty-response":return"ripplo daemon: cloud tunnel provisioning returned no result. Check server logs and retry.";case"server-error":return`ripplo daemon: cloud tunnel provisioning failed (${e.typename}). Run \`npx ripplo doctor\` to check your setup.`}}function CK(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 EK({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(`
145
- `)}function kK(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function PK({devSessionId:e,executor:t,tunnelHostname:n,version:r}){let i=t==="cloud"?`cloud executor via ${n??"?"}`:"local executor";return`ripplo daemon: v${r} ready as ${i} for session ${e} (syncs on every \`npx ripplo run\` \u2014 Ctrl-C to stop)`}function IK({cwd:e,pid:t}){return`ripplo daemon: another daemon is already running for this project${t==null?"":` (pid ${String(t)})`} (cwd ${e}).`}function MK(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function TK(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,n=t.version==null?"version unknown (pre-0.7.8)":`v${t.version}`,r=`${String(t.active)} active, ${String(t.queued)} queued`,i=`explorer: ${t.explorer}, ${String(t.exploring)} exploring`,o=`daemon: running (${n} | ${r} | ${i} | ${qD(t.progress)})`;if(t.sseHealth!=null&&!t.sseHealth.ok){let s=t.sseHealth.detail==null?"":`: ${t.sseHealth.detail}`;return`${o}
146
- daemon: cannot subscribe to run dispatch${s} \u2014 server-side, restarting the daemon will not help`}return o}function qD(e){return e.attempts===0?"explore: idle":`explore: ${String(e.attempts)} attempts, ${String(e.findings)} findings`}function OK(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 NK(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:YD(e.findings).map(t=>rs({evidencePath:`.ripplo/debug/${e.runId}/behavior.jsonl`,finding:t})),kind:"findings"};case"error":return{detail:un(e.error),kind:"error"};case"dispatch-failed":return{kind:"dispatch-error",reason:{detail:e.reason,type:"generic"}}}}function YD(e){let t=new Set(e.flatMap(n=>ZD(n)?[gv(n)]:[]));return e.filter(n=>!(XD(n)&&t.has(gv(n))))}function ZD(e){return e.kind==="pending-check"&&e.source.kind==="step"}function gv(e){return e.kind!=="pending-check"||e.source.kind==="data-rule"?"":`${zt(e.source.check)}|${Gt(e.step)}`}function XD(e){return e.kind==="pending-check"&&e.source.kind==="page-rule"}export{cl as a,ch as b,hl as c,pl as d,Vv as e,Wv as f,gh as g,Gv as h,Tl as i,oR as j,Th as k,Oh as l,So as m,zh as n,un as o,Ke as p,st as q,Mt as r,$n as s,Jp as t,nm as u,Do as v,li as w,ke as x,rs as y,ym as z,gm as A,bm as B,Jo as C,Sm as D,wm as E,ui as F,j0 as G,H0 as H,K0 as I,Y0 as J,_s as K,Z0 as L,BS as M,jS as N,VS as O,WS as P,zS as Q,GS as R,HS as S,vd as T,ZL as U,eD as V,rv as W,pD as X,mD as Y,jD as Z,yv as _,KD as $,AK as aa,CK as ba,EK as ca,kK as da,PK as ea,IK as fa,MK as ga,TK as ha,qD as ia,OK as ja,NK as ka};
143
+ or you can use record.mirror to access the mirror instance during recording.`,Yw={map:{},getId(){return console.error(Ar),-1},getNode(){return console.error(Ar),null},removeNodeFromMap(){console.error(Ar)},has(){return console.error(Ar),!1},reset(){console.error(Ar)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Yw=new Proxy(Yw,{get(e,t,n){return t==="map"&&console.error(Ar),Reflect.get(e,t,n)}}));function qi(e,t,n={}){let r=null,i=0;return function(...o){let s=Date.now();!i&&n.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(l,o)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(l,o)},a))}}function Qa(e,t,n,r,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(s){setTimeout(()=>{n.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>Qa(e,t,o||{},!0)}var Fa=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Fa=()=>new Date().getTime());function Dx(e){var t,n,r,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)||((n=o?.body)==null?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=U.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}function Bx(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Fx(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ux(e){return e?e.nodeType===e.ELEMENT_NODE?e:U.parentElement(e):null}function Ge(e,t,n,r){if(!e)return!1;let i=Ux(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||r&&i.closest("."+t)!==null)return!0}else if(Ma(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function lL(e,t){return t.getId(e)!==-1}function _d(e,t,n){return e.tagName==="TITLE"&&n.headTitleMutations?!0:t.getId(e)===Fi}function jx(e,t){if(Li(e))return!1;let n=t.getId(e);if(!t.has(n))return!0;let r=U.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:r?jx(r,t):!0}function yf(e){return!!e.changedTouches}function uL(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 Vx(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Wx(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function gf(e){return e?e instanceof mf&&"shadowRoot"in e?!!e.shadowRoot:!!U.shadowRoot(e):!1}var bf=class{constructor(){C(this,"id",1),C(this,"styleIDMap",new WeakMap),C(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}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 zx(e){var t;let n=null;return"getRootNode"in e&&((t=U.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&U.host(U.getRootNode(e))&&(n=U.host(U.getRootNode(e))),n}function cL(e){let t=e,n;for(;n=zx(t);)t=n;return t}function dL(e){let t=U.ownerDocument(e);if(!t)return!1;let n=cL(e);return U.contains(t,n)}function Gx(e){let t=U.ownerDocument(e);return t?U.contains(t,e)||dL(e):!1}var q=(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))(q||{}),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||{}),Ye=(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))(Ye||{}),en=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(en||{}),_r=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(_r||{}),Cr=(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))(Cr||{});var Hx=(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))(Hx||{});function Zw(e){return"__ln"in e}var Sf=class{constructor(){C(this,"length",0),C(this,"head",null),C(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Zw(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&Zw(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},Xw=(e,t)=>`${e}@${t}`,wf=class{constructor(){C(this,"frozen",!1),C(this,"locked",!1),C(this,"texts",[]),C(this,"attributes",[]),C(this,"attributeMap",new WeakMap),C(this,"removes",[]),C(this,"mapRemoves",[]),C(this,"movedMap",{}),C(this,"addedSet",new Set),C(this,"movedSet",new Set),C(this,"droppedSet",new Set),C(this,"removesSubTreeCache",new Set),C(this,"mutationCb"),C(this,"blockClass"),C(this,"blockSelector"),C(this,"maskTextClass"),C(this,"maskTextSelector"),C(this,"inlineStylesheet"),C(this,"maskInputOptions"),C(this,"maskTextFn"),C(this,"maskInputFn"),C(this,"keepIframeSrcFn"),C(this,"recordCanvas"),C(this,"inlineImages"),C(this,"slimDOMOptions"),C(this,"dataURLOptions"),C(this,"doc"),C(this,"mirror"),C(this,"iframeManager"),C(this,"stylesheetManager"),C(this,"shadowDomManager"),C(this,"canvasManager"),C(this,"processedNodeManager"),C(this,"unattachedDoc"),C(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),C(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],n=new Set,r=new Sf,i=l=>{let u=l,c=Fi;for(;c===Fi;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=U.parentNode(l);if(!u||!Gx(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let h=u.tagName;if(h==="TEXTAREA")return;h==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=Li(u)?this.mirror.getId(zx(l)):this.mirror.getId(u),f=i(l);if(d===-1||f===-1)return r.addNode(l);let p=kr(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:h=>{Vx(h,this.mirror)&&this.iframeManager.addIframe(h),Wx(h,this.mirror)&&this.stylesheetManager.trackLinkElement(h),gf(l)&&this.shadowDomManager.addShadowRoot(U.shadowRoot(l),this.doc)},onIframeLoad:(h,m)=>{this.iframeManager.attachIframe(h,m),this.shadowDomManager.observeAttachShadow(h)},onStylesheetLoad:(h,m)=>{this.stylesheetManager.attachLinkElement(h,m)},cssCaptured:c});p&&(t.push({parentId:d,nextId:f,node:p}),n.add(p.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)Jw(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(U.parentNode(l))||o(l);for(let l of this.addedSet)!Qw(this.droppedSet,l)&&!Jw(this.removesSubTreeCache,l,this.mirror)||Qw(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;r.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=r.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 p=c.value,h=U.parentNode(p);if(h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=U.host(h);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}s=l.previous,r.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=>!n.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=>!n.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))}),C(this,"genTextAreaValueMutation",t=>{let n=this.attributeMap.get(t);n||(n={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(t,n));let r=Array.from(U.childNodes(t),i=>U.textContent(i)||"").join("");n.attributes.value=ka({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Pa(t),value:r,maskInputFn:this.maskInputFn})}),C(this,"processMutation",t=>{if(!_d(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let n=U.textContent(t.target);!Ge(t.target,this.blockClass,this.blockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:h1(t.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,Ux(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.attributeName,i=t.target.getAttribute(r);if(r==="value"){let s=Pa(n);i=ka({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(Ge(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!n.contentDocument)r="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!f1(n.tagName,r))if(o.attributes[r]=d1(this.doc,jn(n.tagName),jn(r),i),r==="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(n.style)){let l=n.style.getPropertyValue(a),u=n.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))n.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else r==="open"&&n.tagName==="DIALOG"&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(Ge(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),i=Li(t.target)?this.mirror.getId(U.host(t.target)):this.mirror.getId(t.target);Ge(t.target,this.blockClass,this.blockSelector,!1)||_d(n,this.mirror,this.slimDOMOptions)||!lL(n,this.mirror)||(this.addedSet.has(n)?(xf(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||jx(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Xw(r,i)]?xf(this.movedSet,n):(this.removes.push({parentId:i,id:r,isShadow:Li(t.target)&&Di(t.target)?!0:void 0}),fL(n,this.removesSubTreeCache))),this.mapRemoves.push(n))});break}}}),C(this,"genAdds",(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(_d(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Xw(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ge(t,this.blockClass,this.blockSelector,!1)||(U.childNodes(t).forEach(r=>this.genAdds(r)),gf(t)&&U.childNodes(U.shadowRoot(t)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,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(n=>{this[n]=t[n]})}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 xf(e,t){e.delete(t),U.childNodes(t).forEach(n=>xf(e,n))}function fL(e,t){let n=[e];for(;n.length;){let r=n.pop();t.has(r)||(t.add(r),U.childNodes(r).forEach(i=>n.push(i)))}}function Jw(e,t,n){return e.size===0?!1:hL(e,t)}function hL(e,t,n){let r=U.parentNode(t);return r?e.has(r):!1}function Qw(e,t){return e.size===0?!1:Kx(e,t)}function Kx(e,t){let n=U.parentNode(t);return n?e.has(n)?!0:Kx(e,n):!1}var Bi;function pL(e){Bi=e}function mL(){Bi=void 0}var Z=e=>Bi?(...n)=>{try{return e(...n)}catch(r){if(Bi&&Bi(r)===!0)return;throw r}}:e,Un=[];function Qi(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 qx(e,t){let n=new wf;Un.push(n),n.init(e);let r=new(Lx())(Z(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function yL({mousemoveCb:e,sampling:t,doc:n,mirror:r}){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=qi(Z(d=>{let f=Date.now()-a;e(s.map(p=>(p.timeOffset-=f,p)),d),s=[],a=null}),o),u=Z(qi(Z(d=>{let f=Qi(d),{clientX:p,clientY:h}=yf(d)?d.changedTouches[0]:d;a||(a=Fa()),s.push({x:p,y:h,id:r.getId(f),timeOffset:Fa()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?z.Drag:d instanceof MouseEvent?z.MouseMove:z.TouchMove)}),i,{trailing:!1})),c=[ze("mousemove",u,n),ze("touchmove",u,n),ze("drag",u,n)];return Z(()=>{c.forEach(d=>d())})}function gL({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,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 f=Qi(d);if(Ge(f,r,i,!0))return;let p=null,h=c;if("pointerType"in d){switch(d.pointerType){case"mouse":p=en.Mouse;break;case"touch":p=en.Touch;break;case"pen":p=en.Pen;break}p===en.Touch?Ye[c]===Ye.MouseDown?h="TouchStart":Ye[c]===Ye.MouseUp&&(h="TouchEnd"):en.Pen}else yf(d)&&(p=en.Touch);p!==null?(l=p,(h.startsWith("Touch")&&p===en.Touch||h.startsWith("Mouse")&&p===en.Mouse)&&(p=null)):Ye[c]===Ye.Click&&(p=l,l=null);let m=yf(d)?d.changedTouches[0]:d;if(!m)return;let y=n.getId(f),{clientX:S,clientY:w}=m;Z(e)({type:Ye[h],id:y,x:S,y:w,...p!==null&&{pointerType:p}})};return Object.keys(Ye).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=jn(c),f=u(c);if(window.PointerEvent)switch(Ye[c]){case Ye.MouseDown:case Ye.MouseUp:d=d.replace("mouse","pointer");break;case Ye.TouchStart:case Ye.TouchEnd:return}a.push(ze(d,f,t))}),Z(()=>{a.forEach(c=>c())})}function Yx({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){let s=Z(qi(Z(a=>{let l=Qi(a);if(!l||Ge(l,r,i,!0))return;let u=n.getId(l);if(l===t&&t.defaultView){let c=Dx(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 ze("scroll",s,t)}function bL({viewportResizeCb:e},{win:t}){let n=-1,r=-1,i=Z(qi(Z(()=>{let o=Bx(),s=Fx();(n!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),n=o,r=s)}),200));return ze("resize",i,t)}var SL=["INPUT","TEXTAREA","SELECT"],e1=new WeakMap;function wL({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(w){let g=Qi(w),x=w.isTrusted,P=g&&g.tagName;if(g&&P==="OPTION"&&(g=U.parentElement(g)),!g||!P||SL.indexOf(P)<0||Ge(g,r,i,!0)||g.classList.contains(o)||s&&g.matches(s))return;let N=g.value,$=!1,_=Pa(g)||"";_==="radio"||_==="checkbox"?$=g.checked:(a[P.toLowerCase()]||a[_])&&(N=ka({element:g,maskInputOptions:a,tagName:P,type:_,value:N,maskInputFn:l})),f(g,c?{text:N,isChecked:$,userTriggered:x}:{text:N,isChecked:$});let I=g.name;_==="radio"&&I&&$&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(j=>{if(j!==g){let V=j.value;f(j,c?{text:V,isChecked:!$,userTriggered:!1}:{text:V,isChecked:!$})}})}function f(w,g){let x=e1.get(w);if(!x||x.text!==g.text||x.isChecked!==g.isChecked){e1.set(w,g);let P=n.getId(w);Z(e)({...g,id:P})}}let h=(u.input==="last"?["change"]:["input","change"]).map(w=>ze(w,Z(d),t)),m=t.defaultView;if(!m)return()=>{h.forEach(w=>w())};let y=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 y&&y.set&&h.push(...S.map(w=>Qa(w[0],w[1],{set(){Z(d)({target:this,isTrusted:!1})}},!1,m))),Z(()=>{h.forEach(w=>w())})}function Ua(e){let t=[];function n(r,i){if(ba("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||ba("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||ba("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||ba("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let s=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(s)}else if(r.parentStyleSheet){let s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(s)}return i}return n(e,t)}function An(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function xL({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Z((c,d,f)=>{let[p,h]=f,{id:m,styleId:y}=An(d,t,n.styleMirror);return(m&&m!==-1||y&&y!==-1)&&e({id:m,styleId:y,adds:[{rule:p,index:h}]}),c.apply(d,f)})}),r.CSSStyleSheet.prototype.addRule=function(c,d,f=this.cssRules.length){let p=`${c} { ${d} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[p,f])};let o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Z((c,d,f)=>{let[p]=f,{id:h,styleId:m}=An(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:p}]}),c.apply(d,f)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Z((c,d,f)=>{let[p]=f,{id:h,styleId:m}=An(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:p}),c.apply(d,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Z((c,d,f)=>{let[p]=f,{id:h,styleId:m}=An(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:p}),c.apply(d,f)})}));let l={};Sa("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Sa("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Sa("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Sa("CSSSupportsRule")&&(l.CSSSupportsRule=r.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:Z((f,p,h)=>{let[m,y]=h,{id:S,styleId:w}=An(p.parentStyleSheet,t,n.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:m,index:[...Ua(p),y||0]}]}),f.apply(p,h)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:Z((f,p,h)=>{let[m]=h,{id:y,styleId:S}=An(p.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...Ua(p),m]}]}),f.apply(p,h)})})}),Z(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function Zx({mirror:e,stylesheetManager:t},n){var r,i,o;let s=null;n.nodeName==="#document"?s=e.getId(n):s=e.getId(U.host(n));let a=n.nodeName==="#document"?(r=n.defaultView)==null?void 0:r.Document:(o=(i=n.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(n,"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}}),Z(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function vL({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Z((a,l,u)=>{var c;let[d,f,p]=u;if(n.has(d))return o.apply(l,[d,f,p]);let{id:h,styleId:m}=An((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,set:{property:d,value:f,priority:p},index:Ua(l.parentRule)}),a.apply(l,u)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Z((a,l,u)=>{var c;let[d]=u;if(n.has(d))return s.apply(l,[d]);let{id:f,styleId:p}=An((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(f&&f!==-1||p&&p!==-1)&&e({id:f,styleId:p,remove:{property:d},index:Ua(l.parentRule)}),a.apply(l,u)})}),Z(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function RL({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){let s=Z(l=>qi(Z(u=>{let c=Qi(u);if(!c||Ge(c,t,n,!0))return;let{currentTime:d,volume:f,muted:p,playbackRate:h,loop:m}=c;e({type:l,id:r.getId(c),currentTime:d,volume:f,muted:p,playbackRate:h,loop:m})}),i.media||500)),a=[ze("play",s(Cr.Play),o),ze("pause",s(Cr.Pause),o),ze("seeked",s(Cr.Seeked),o),ze("volumechange",s(Cr.VolumeChange),o),ze("ratechange",s(Cr.RateChange),o)];return Z(()=>{a.forEach(l=>l())})}function AL({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,o=n.FontFace;n.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=zn(t.fonts,"add",function(a){return function(l){return setTimeout(Z(()=>{let u=i.get(l);u&&(e(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{n.FontFace=o}),r.push(s),Z(()=>{r.forEach(a=>a())})}function CL(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e,s=!0,a=Z(()=>{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 f=l.getRangeAt(d),{startContainer:p,startOffset:h,endContainer:m,endOffset:y}=f;Ge(p,r,i,!0)||Ge(m,r,i,!0)||u.push({start:n.getId(p),startOffset:h,end:n.getId(m),endOffset:y})}o({ranges:u})});return a(),ze("selectionchange",a)}function EL({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:zn(n.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 kL(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:f,selectionCb:p,customElementCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),n(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),r(...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),f(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),p(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),h(...m)}}function PL(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};kL(e,t);let r;e.recordDOM&&(r=qx(e,e.doc));let i=yL(e),o=gL(e),s=Yx(e),a=bL(e,{win:n}),l=wL(e),u=RL(e),c=()=>{},d=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(c=xL(e,{win:n}),d=Zx(e,e.doc),f=vL(e,{win:n}),e.collectFonts&&(p=AL(e)));let h=CL(e),m=EL(e),y=[];for(let S of e.plugins)y.push(S.observer(S.callback,n,S.options));return Z(()=>{Un.forEach(S=>S.reset()),r?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),f(),p(),h(),m(),y.forEach(S=>S())})}function ba(e){return typeof window[e]<"u"}function Sa(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ja=class{constructor(t){C(this,"iframeIdToRemoteIdMap",new WeakMap),C(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,n,r,i){let o=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(n);return a||(a=this.generateIdFn(),o.set(n,a),s.set(a,n)),a}getIds(t,n){let r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return n.map(o=>this.getId(t,o,r,i))}getRemoteId(t,n,r){let i=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let o=i.get(n);return o||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(i=>this.getRemoteId(t,i,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}},vf=class{constructor(t){C(this,"iframes",new WeakMap),C(this,"crossOriginIframeMap",new WeakMap),C(this,"crossOriginIframeMirror",new ja(c1)),C(this,"crossOriginIframeStyleMirror"),C(this,"crossOriginIframeRootIdMap",new WeakMap),C(this,"mirror"),C(this,"mutationCb"),C(this,"wrappedEmit"),C(this,"loadListener"),C(this,"stylesheetManager"),C(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ja(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,n){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=t.contentWindow)==null||r.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 n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;let i=this.crossOriginIframeMap.get(t.source);if(!i)return;let o=this.transformCrossOriginEvent(i,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case q.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);let i=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(n.data.node,i),{timestamp:n.timestamp,type:q.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case q.Meta:case q.Load:case q.DomContentLoaded:return!1;case q.Plugin:return n;case q.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case q.IncrementalSnapshot:switch(n.data.source){case z.Mutation:return n.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)}),n.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),n.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),n.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case z.Drag:case z.TouchMove:case z.MouseMove:return n.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(n.data,t,["id"]),n;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case z.Font:return n;case z.Selection:return n.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),n;case z.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),n}}return!1}replace(t,n,r,i){for(let o of i)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=t.getIds(r,n[o]):n[o]=t.getId(r,n[o]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==Hx.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},Rf=class{constructor(t){C(this,"shadowDoms",new WeakSet),C(this,"mutationCb"),C(this,"scrollCb"),C(this,"bypassOptions"),C(this,"mirror"),C(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,n){if(!Di(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let r=qx({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Yx({...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(Zx({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(zn(t.prototype,"attachShadow",function(i){return function(o){let s=i.call(this,o),a=U.shadowRoot(this);return a&&Gx(this)&&r.addShadowRoot(a,n),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Pr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",IL=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(_i=0;_i<Pr.length;_i++)IL[Pr.charCodeAt(_i)]=_i;var _i,ML=function(e){var t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Pr[t[n]>>2],i+=Pr[(t[n]&3)<<4|t[n+1]>>4],i+=Pr[(t[n+1]&15)<<2|t[n+2]>>6],i+=Pr[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var t1=new Map;function TL(e,t){let n=t1.get(e);return n||(n=new Map,t1.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Xx=(e,t,n)=>{if(!e||!(Qx(e,t)||typeof e=="object"))return;let r=e.constructor.name,i=TL(n,r),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Aa(e,t,n){if(e instanceof Array)return e.map(r=>Aa(r,t,n));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 r=e.constructor.name,i=ML(e);return{rr_type:r,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Aa(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:i}=e;return{rr_type:r,src:i}}else if(e instanceof HTMLCanvasElement){let r="HTMLImageElement",i=e.toDataURL();return{rr_type:r,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Aa(e.data,t,n),e.width,e.height]};if(Qx(e,t)||typeof e=="object"){let r=e.constructor.name,i=Xx(e,t,n);return{rr_type:r,index:i}}}}return e}var Jx=(e,t,n)=>e.map(r=>Aa(r,t,n)),Qx=(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 OL(e,t,n,r){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=zn(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...u){return Ge(this.canvas,n,r,!0)||setTimeout(()=>{let c=Jx(u,t,this);e(this.canvas,{type:_r["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=Qa(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:_r["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function NL(e){return e==="experimental-webgl"?"webgl":e}function n1(e,t,n,r){let i=[];try{let o=zn(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!Ge(this,t,n,!0)){let u=NL(a);if("__context"in this||(this.__context=u),r&&["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 r1(e,t,n,r,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=zn(e,l,function(c){return function(...d){let f=c.apply(this,d);if(Xx(f,o,this),"tagName"in this.canvas&&!Ge(this.canvas,r,i,!0)){let p=Jx(d,o,this),h={type:t,property:l,args:p};n(this.canvas,h)}return f}});s.push(u)}catch{let u=Qa(e,l,{set(c){n(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function $L(e,t,n,r){let i=[];return i.push(...r1(t.WebGLRenderingContext.prototype,_r.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...r1(t.WebGL2RenderingContext.prototype,_r.WebGL2,e,n,r,t)),()=>{i.forEach(o=>o())}}var ev="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",_L=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),i1=typeof window<"u"&&window.Blob&&new Blob([_L(ev)],{type:"text/javascript;charset=utf-8"});function LL(e){let t;try{if(t=i1&&(window.URL||window.webkitURL).createObjectURL(i1),!t)throw"";let n=new Worker(t,{name:e?.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker("data:text/javascript;base64,"+ev,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var Af=class{constructor(t){C(this,"pendingCanvasMutations",new Map),C(this,"rafStamps",{latestId:0,invokeId:null}),C(this,"mirror"),C(this,"mutationCb"),C(this,"resetObservers"),C(this,"frozen",!1),C(this,"locked",!1),C(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:n="all",win:r,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&n==="all"&&this.initCanvasMutationObserver(r,i,o),s&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,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,n,r,i,o){let s=n1(n,r,i,!0),a=new Map,l=new LL;l.onmessage=h=>{let{id:m}=h.data;if(a.set(m,!1),!("base64"in h.data))return;let{base64:y,type:S,width:w,height:g}=h.data;this.mutationCb({id:m,type:_r["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};let u=1e3/t,c=0,d,f=()=>{let h=[];return n.document.querySelectorAll("canvas").forEach(m=>{Ge(m,r,i,!0)||h.push(m)}),h},p=h=>{if(c&&h-c<u){d=requestAnimationFrame(p);return}c=h,f().forEach(async m=>{var y;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 g=m.getContext(m.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.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(p)};d=requestAnimationFrame(p),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=n1(t,n,r,!1),o=OL(this.processMutation.bind(this),t,n,r),s=$L(this.processMutation.bind(this),t,n,r);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;let i=r.map(s=>{let{type:a,...l}=s;return l}),{type:o}=r[0];this.mutationCb({id:n,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}},Cf=class{constructor(t){C(this,"trackedLinkElements",new WeakSet),C(this,"mutationCb"),C(this,"adoptedStyleSheetCb"),C(this,"styleMirror",new bf),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,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:l1(a,o.href),index:l}))})),r.styleIds.push(s)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Ef=class{constructor(){C(this,"nodeMap",new WeakMap),C(this,"active",!1)}inOtherBuffer(t,n){let r=this.nodeMap.get(t);return r&&Array.from(r).some(i=>i!==n)}add(t,n){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},Ce,Ca,Ld,Va=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((sw=e.contentWindow)==null?void 0:sw.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var xt=F7();function Gn(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,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:f,slimDOMOptions:p,maskInputFn:h,maskTextFn:m,hooks:y,packFn:S,sampling:w={},dataURLOptions:g={},mousemoveWait:x,recordDOM:P=!0,recordCanvas:N=!1,recordCrossOriginIframes:$=!1,recordAfter:_=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:I=!1,collectFonts:j=!1,inlineImages:V=!1,plugins:se,keepIframeSrcFn:L=()=>!1,ignoreCSSAttributes:$e=new Set([]),errorHandler:Ze}=e;pL(Ze);let ce=$?window.parent===window:!0,Le=!1;if(!ce)try{window.parent.document&&(Le=!1)}catch{Le=!0}if(ce&&!t)throw new Error("emit function is required");if(!ce&&!Le)return()=>{};x!==void 0&&w.mousemove===void 0&&(w.mousemove=x),xt.reset();let Ct=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}:f!==void 0?f:{password:!0},Me=p1(p);uL();let ro,Br=0,Hn=X=>{for(let He of se||[])He.eventProcessor&&(X=He.eventProcessor(X));return S&&!Le&&(X=S(X)),X};Ce=(X,He)=>{var me;let xe=X;if(xe.timestamp=Fa(),(me=Un[0])!=null&&me.isFrozen()&&xe.type!==q.FullSnapshot&&!(xe.type===q.IncrementalSnapshot&&xe.data.source===z.Mutation)&&Un.forEach(Xe=>Xe.unfreeze()),ce)t?.(Hn(xe),He);else if(Le){let Xe={type:"rrweb",event:Hn(xe),origin:window.location.origin,isCheckout:He};window.parent.postMessage(Xe,"*")}if(xe.type===q.FullSnapshot)ro=xe,Br=0;else if(xe.type===q.IncrementalSnapshot){if(xe.data.source===z.Mutation&&xe.data.isAttachIframe)return;Br++;let Xe=r&&Br>=r,ae=n&&xe.timestamp-ro.timestamp>n;(Xe||ae)&&Ca(!0)}};let ut=X=>{Ce({type:q.IncrementalSnapshot,data:{source:z.Mutation,...X}})},Fr=X=>Ce({type:q.IncrementalSnapshot,data:{source:z.Scroll,...X}}),sn=X=>Ce({type:q.IncrementalSnapshot,data:{source:z.CanvasMutation,...X}}),Ur=X=>Ce({type:q.IncrementalSnapshot,data:{source:z.AdoptedStyleSheet,...X}}),ct=new Cf({mutationCb:ut,adoptedStyleSheetCb:Ur}),Et=new vf({mirror:xt,mutationCb:ut,stylesheetManager:ct,recordCrossOriginIframes:$,wrappedEmit:Ce});for(let X of se||[])X.getMirror&&X.getMirror({nodeMirror:xt,crossOriginIframeMirror:Et.crossOriginIframeMirror,crossOriginIframeStyleMirror:Et.crossOriginIframeStyleMirror});let Kn=new Ef;Ld=new Af({recordCanvas:N,mutationCb:sn,win:window,blockClass:i,blockSelector:o,mirror:xt,sampling:w.canvas,dataURLOptions:g});let qn=new Rf({mutationCb:ut,scrollCb:Fr,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:Ct,dataURLOptions:g,maskTextFn:m,maskInputFn:h,recordCanvas:N,inlineImages:V,sampling:w,slimDOMOptions:Me,iframeManager:Et,stylesheetManager:ct,canvasManager:Ld,keepIframeSrcFn:L,processedNodeManager:Kn},mirror:xt});Ca=(X=!1)=>{if(!P)return;Ce({type:q.Meta,data:{href:window.location.href,width:Fx(),height:Bx()}},X),ct.reset(),qn.init(),Un.forEach(me=>me.lock());let He=u5(document,{mirror:xt,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:Ct,maskTextFn:m,maskInputFn:h,slimDOM:Me,dataURLOptions:g,recordCanvas:N,inlineImages:V,onSerialize:me=>{Vx(me,xt)&&Et.addIframe(me),Wx(me,xt)&&ct.trackLinkElement(me),gf(me)&&qn.addShadowRoot(U.shadowRoot(me),document)},onIframeLoad:(me,xe)=>{Et.attachIframe(me,xe),qn.observeAttachShadow(me)},onStylesheetLoad:(me,xe)=>{ct.attachLinkElement(me,xe)},keepIframeSrcFn:L});if(!He)return console.warn("Failed to snapshot the document");Ce({type:q.FullSnapshot,data:{node:He,initialOffset:Dx(window)}},X),Un.forEach(me=>me.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ct.adoptStyleSheets(document.adoptedStyleSheets,xt.getId(document))};try{let X=[],He=xe=>{var Xe;return Z(PL)({mutationCb:ut,mousemoveCb:(ae,el)=>Ce({type:q.IncrementalSnapshot,data:{source:el,positions:ae}}),mouseInteractionCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.MouseInteraction,...ae}}),scrollCb:Fr,viewportResizeCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.ViewportResize,...ae}}),inputCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.Input,...ae}}),mediaInteractionCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.MediaInteraction,...ae}}),styleSheetRuleCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.StyleSheetRule,...ae}}),styleDeclarationCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.StyleDeclaration,...ae}}),canvasMutationCb:sn,fontCb:ae=>Ce({type:q.IncrementalSnapshot,data:{source:z.Font,...ae}}),selectionCb:ae=>{Ce({type:q.IncrementalSnapshot,data:{source:z.Selection,...ae}})},customElementCb:ae=>{Ce({type:q.IncrementalSnapshot,data:{source:z.CustomElement,...ae}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:Ct,inlineStylesheet:c,sampling:w,recordDOM:P,recordCanvas:N,inlineImages:V,userTriggeredOnInput:I,collectFonts:j,doc:xe,maskInputFn:h,maskTextFn:m,keepIframeSrcFn:L,blockSelector:o,slimDOMOptions:Me,dataURLOptions:g,mirror:xt,iframeManager:Et,stylesheetManager:ct,shadowDomManager:qn,processedNodeManager:Kn,canvasManager:Ld,ignoreCSSAttributes:$e,plugins:((Xe=se?.filter(ae=>ae.observer))==null?void 0:Xe.map(ae=>({observer:ae.observer,options:ae.options,callback:el=>Ce({type:q.Plugin,data:{plugin:ae.name,payload:el}})})))||[]},y)};Et.addLoadListener(xe=>{try{X.push(He(xe.contentDocument))}catch(Xe){console.warn(Xe)}});let me=()=>{Ca(),X.push(He(document)),Va=!0};return["interactive","complete"].includes(document.readyState)?me():(X.push(ze("DOMContentLoaded",()=>{Ce({type:q.DomContentLoaded,data:{}}),_==="DOMContentLoaded"&&me()})),X.push(ze("load",()=>{Ce({type:q.Load,data:{}}),_==="load"&&me()},window))),()=>{X.forEach(xe=>{try{xe()}catch(Xe){String(Xe).toLowerCase().includes("cross-origin")||console.warn(Xe)}}),Kn.destroy(),Va=!1,mL()}}catch(X){console.warn(X)}}Gn.addCustomEvent=(e,t)=>{if(!Va)throw new Error("please add custom event after start recording");Ce({type:q.Custom,data:{tag:e,payload:t}})};Gn.freezePage=()=>{Un.forEach(e=>e.freeze())};Gn.takeFullSnapshot=e=>{if(!Va)throw new Error("please take full snapshot after start recording");Ca(e)};Gn.mirror=xt;var o1;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(o1||(o1={}));var kH=5*1e3;var{addCustomEvent:PH}=Gn,{freezePage:IH}=Gn,{takeFullSnapshot:MH}=Gn;var rv="__ripploEmitRrwebEvent";function iv(){return{eventTypes:tv(q),incrementalSources:tv(z)}}function tv(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,n])=>[n,t]))}var BL=xd("@ripplo/rrweb-bundle/bundle","rrweb.js"),nv;function ov(){return nv??=DL(BL,{encoding:"utf8"}),nv}async function eo({clientVersion:e,debugDir:t,writeOtlpPortFile:n}){let r=new Map,i=QS(iv()),o=await vd({localDir:sv.join(sv.dirname(t),".local"),writePortFile:n,onRrwebBatch:(l,u)=>{r.get(l)?.emitRrwebBatch(u)},onSpan:l=>{let u=l.attributes["ripplo.run"];u!=null&&r.get(u)?.emit(l)}}),s=await ov();return{attach:async(l,u)=>{let c=JS({debugDir:t,runId:u,worker:i});c.emit({clientVersion:e,kind:"meta",source:"capture",timeNanos:"0"}),r.set(u,c),await rw(l,u),await l.addInitScript(`globalThis.__ripploCapturePort = ${String(o.port)};`),await UL(l,c),await WL(l,c);let d=[];return{emitAction:f=>{HL(c,f)},emitAssertion:f=>{KL(c,f)},emitFinding:f=>{let p=tw(f);p!=null&&c.emit(p)},finish:()=>zL(c,{pages:d,registry:r,runId:u}),onPage:f=>{d.push(f),GL(c,s,f)}}},debugDir:t,close:async()=>{await o.stop(),await i.terminate()},injectSpan:(l,u)=>{r.get(l)?.emit(u)}}}async function FL(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function UL(e,t){await e.exposeBinding(rv,(n,r)=>{let i=typeof r=="string"?r:JSON.stringify(r);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}var jL="__ripploEventPush",VL=At.discriminatedUnion("kind",[At.object({kind:At.literal("console"),level:At.string(),text:At.string(),timestamp:At.number()}),At.object({kind:At.literal("error"),message:At.string(),stack:At.string().optional(),timestamp:At.number()})]);async function WL(e,t){await e.exposeBinding(jL,(n,r)=>{let i=VL.safeParse(r);if(!i.success)return;let o=i.data;if(o.kind==="console"){t.emit({kind:"console",level:o.level,source:"browser",text:o.text,timeNanos:Rn(o.timestamp)});return}t.emit({kind:"error",message:o.message,source:"browser",stack:o.stack,timeNanos:Rn(o.timestamp)})})}async function zL(e,t){await FL(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 GL(e,t,n){n.on("load",()=>{n.addScriptTag({content:t}).catch(()=>{})}),n.on("response",r=>{XL(e,r)}),n.url()!=="about:blank"&&n.addScriptTag({content:t}).catch(()=>{})}function HL(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:qL(t),timeNanos:Rn(Date.now()),value:YL(t)})}function KL(e,t){let n=ns(t);e.emit({kind:"assertion",label:n.label,outcome:t.outcome,source:"test",step:n.step,timeNanos:Rn(Date.now()),wait:t.waitBudget,waitMs:t.waitMs})}function qL(e){if(e.url!=null)return e.url;if(e.locator!=null)return Zf(e.locator)}function Zf(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${Zf(e.scope)} \u25B8 ${Zf(e.target)}`:`${e.role} ${e.name??""}`.trim()}function YL(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var ZL=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;async function XL(e,t){let n=t.request(),r=n.resourceType();if(r!=="fetch"&&r!=="xhr"||ZL.test(n.url()))return;let i=n.headers().traceparent?.split("-"),o=n.timing().startTime;e.emit({kind:"network",method:n.method(),requestBody:n.postData()??void 0,resourceType:r,responseBody:await JL(t),source:"browser",spanId:i?.[2],status:t.status(),timeNanos:Rn(o>0?o:Date.now()),traceId:i?.[1],url:t.url()})}async function JL(e){try{return await e.text()}catch{return}}function no(e){return{aborted:!0,findings:[],ran:[],teardown:e}}function Qf(e,t){return new Jf(lD(e,t))}function QL(e,t){return new Jf(eD(e,t))}async function eD(e,t){let n=await mS(e.profileDir).catch(()=>{});if(n==null)return Lr(Ft(new Error("launch")));try{return to(await tD({context:n,params:e,signal:t}))}catch(r){return Lr(Ft(r))}finally{await n.close().catch(ft)}}async function tD({context:e,params:t,signal:n}){let r=e.pages()[0]??await e.newPage(),i=await eo({clientVersion:t.clientVersion,debugDir:t.debugDir,writeOtlpPortFile:!0}),o=await i.attach(e,t.runId);return o.onPage(r),e.on("page",s=>{o.onPage(s)}),await r.goto(t.startUrl).catch(ft),t.onReady(),await nD(e,n),await o.finish(),await i.close(),{behaviorPath:Xf.join(t.debugDir,t.runId,"behavior.jsonl")}}function nD(e,t){return new Promise(n=>{let r=()=>{n()};t.addEventListener("abort",r,{once:!0}),e.on("close",r),e.browser()?.on("disconnected",r),e.on("page",i=>i.on("close",r)),e.pages().forEach(i=>i.on("close",r))})}function rD(e,t){return new Jf(iD(e,t))}async function iD(e,t){let n=oD(e),r=uv({lockfile:e.lockfile,options:e.options,runId:e.runId,signal:t}),i=async o=>{try{return to(await sD({established:o,params:e,signal:t}))}catch(s){return await o.teardown().match(ft,ft),Lr(Ft(s))}};return lv(r,n).match(i,async o=>(await eh(r.teardown),Lr(o)))}function oD(e){return{capture:!1,lockfile:e.lockfile,onEvent:void 0,onPhase:void 0,options:e.options,params:void 0,runId:e.runId,sequence:e.sequence,test:e.test}}async function sD({established:e,params:t,signal:n}){let r=Fs({headed:!0}),i=await r.acquire(),o=await Bs({baseUrl:t.options.baseUrl,browser:i,capture:null,clientState:e.clientState,engine:Ls(cv(t.lockfile)),extraHeaders:th(t.options.tunnelAuth),fixturesDir:t.options.fixturesDir,reader:e.reader,session:e.auth,signal:n,viewport:null}),s=ui(t.lockfile),a=await ai({canon:Kr(t.lockfile),classify:Hr(t.lockfile),dataRules:s.dataRules,driver:o.driver,initialState:{snapshot:e.snapshot},onAssertion:o.emitAssertion,onEvent:ft,pageRules:Bo(s.pageRules,st(t.test)),sequence:t.sequence,stopAfterStep:t.stopAfterStep},n);return t.onReady(),await aD(i,o.context),await e.teardown().match(ft,ft),await r.close(),{kind:"handed-over",ran:a.ran.length}}function aD(e,t){return new Promise(n=>{let r=()=>{n()};e.on("disconnected",r),t.on("close",r),t.on("page",i=>i.on("close",r)),t.pages().forEach(i=>i.on("close",r))})}async function lD({browser:e,hub:t,request:n},r){if(r.aborted)return to(no("skipped"));let i=uv({lockfile:n.lockfile,options:n.options,runId:n.runId,signal:r}),o=async s=>{try{return to(await cD({browser:e,established:s,hub:t,request:n,signal:r}))}catch(a){return Lr(Ft(a))}};return lv(i,n).match(o,s=>uD(s,i.teardown))}async function uD(e,t){return e.kind!=="aborted"?Lr(e):to(no(await eh(t)))}function eh(e){return e().match(()=>"done",()=>"failed")}async function cD(e){let t=await fD(e);if(t.kind==="completed"){let r=Date.now();return await e.established.teardown().match(ft,Yl),e.request.onPhase?.("teardown",Date.now()-r),e.request.capture&&await dD(e.hub,e.request.runId),{aborted:!1,...t.result}}let n=await eh(e.established.teardown);if(t.kind==="aborted")return no(n);throw t.error}async function dD(e,t){let n=Xf.join(e.debugDir,t);await XS({jsonlPath:Xf.join(n,"behavior.jsonl"),outDir:n,runId:t,scale:void 0})}function av(e,t,n){return ti(e,t).map(r=>({params:{...Ms(r),...n},transition:r}))}async function fD({browser:e,established:t,hub:n,request:r,signal:i}){try{ot(i);let o=Date.now(),{close:s,driver:a,emitAssertion:l,emitFinding:u}=await Bs({baseUrl:r.options.baseUrl,browser:e,capture:r.capture?{hub:n,runId:r.runId}:null,clientState:t.clientState,engine:Ls(cv(r.lockfile)),extraHeaders:th(r.options.tunnelAuth),fixturesDir:r.options.fixturesDir,reader:t.reader,session:t.auth,signal:i,viewport:pS});r.onPhase?.("browser",Date.now()-o);try{r.onEvent?.({aliases:t.aliases,generated:t.generated,generatedSingletons:t.generatedSingletons,kind:"world"});let c=ui(r.lockfile),d=Date.now(),f=await ai({canon:Kr(r.lockfile),classify:Hr(r.lockfile),dataRules:c.dataRules,driver:a,initialState:{snapshot:t.snapshot},onAssertion:l,pageRules:Bo(c.pageRules,st(r.test)),sequence:r.sequence??av(r.lockfile,r.test,r.params),stopAfterStep:void 0,onEvent:p=>{p.kind==="finding"&&u(p.finding),r.onEvent?.(p)}},i);return r.onPhase?.("drive",Date.now()-d),{kind:"completed",result:f}}finally{await s()}}catch(o){return Zl(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function lv(e,t){let n=Date.now();return e.ready().andThen(()=>{t.onPhase?.("engine",Date.now()-n);let r=Date.now();return nr(t.lockfile,t.test,{generate:Yo(qo(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(i=>(t.onPhase?.("world",Date.now()-r),{aliases:i.aliases,auth:i.auth,clientState:i.clientState,generated:i.generated,generatedSingletons:i.generatedSingletons,reader:e.reader,snapshot:i.snapshot,teardown:e.teardown}))})}function uv({lockfile:e,options:t,runId:n,signal:r}){let i=ad({baseUrl:t.engineUrl,extraHeaders:th(t.tunnelAuth),runId:n,secret:t.secret},r);return{materialize:Io(i.setupWorld),reader:od(e.entities,hD(e),i.query),ready:i.ready,teardown:i.teardown}}function th(e){if(e!=null)return{"CF-Access-Client-Id":e.clientId,"CF-Access-Client-Secret":e.clientSecret}}function hD(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function cv(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}import{err as pD,ok as mD,ResultAsync as yD}from"neverthrow";function gD({clientVersion:e,debugDir:t,headed:n,writeOtlpPortFile:r}){let i=Fs({headed:n}),o,s,a=async()=>(o??=eo({clientVersion:e,debugDir:t,writeOtlpPortFile:r}),s=await o,s),l=async(d,f)=>{if(f.aborted)return mD(no("skipped"));try{let p=await a();return d.options.headed&&!n?await rd(!0,async h=>Qf({browser:h,hub:p,request:d},f)):await Qf({browser:await i.acquire(),hub:p,request:d},f)}catch(p){return pD(Ft(p))}};return{close:async()=>{await i.close();let d=o;o=void 0,s=void 0,d!=null&&await d.then(f=>f.close()).catch(()=>{})},prewarm:async()=>{await a(),await i.acquire()},injectSpan:(d,f)=>{s?.injectSpan(d,f)},runOnce:(d,f)=>new yD(l(d,f))}}import{z as G}from"zod";function bD(e){let t=e.split(`
144
+ `).map(i=>$D(i)).filter(i=>i!=null),n=PD(t),r=t.map(i=>vD(i,n)).filter(i=>i!=null).filter(i=>i.kind==="input"||i.element!=null);return SD(r)}function SD(e){return e.filter((t,n)=>{let r=e[n+1];return!(t.kind==="input"&&r?.kind==="input"&&wD(t.element,r.element))})}function wD(e,t){return e?.testId===t?.testId&&e?.ariaLabel===t?.ariaLabel&&e?.placeholder===t?.placeholder}var xD={2:"click",3:"contextmenu",4:"dblclick"};function vD(e,t){return e.rrwebType==="IncrementalSnapshot:MouseInteraction"?RD(e,t):e.rrwebType==="IncrementalSnapshot:Input"?AD(e,t):null}function RD(e,t){let n=UD.safeParse(e.event.data);if(!n.success)return null;let r=xD[n.data.type];if(r==null)return null;let i=dv(n.data.id,t.nodes);return{element:fv(i,t),kind:r,timeNanos:e.timeNanos,value:void 0}}function AD(e,t){let n=jD.safeParse(e.event.data);return n.success?{element:fv(n.data.id,t),kind:"input",timeNanos:e.timeNanos,value:n.data.text??CD(n.data.isChecked)}:null}function CD(e){return e==null?void 0:String(e)}var ED=new Set(["button","a","input","select","textarea","summary"]);function dv(e,t){let n=t.get(e);if(n!=null)return kD(n)?e:n.parentId==null?void 0:dv(n.parentId,t)}function kD(e){return e.attrs["data-testid"]!=null||e.attrs["aria-label"]!=null||e.attrs.role!=null||ED.has(e.tag??"")}function fv(e,t){let n=e==null?void 0:t.nodes.get(e);if(!(n==null||e==null))return{ariaLabel:Dr(n,"aria-label"),href:Dr(n,"href"),name:Dr(n,"name"),placeholder:Dr(n,"placeholder"),role:Dr(n,"role"),tag:n.tag,testId:Dr(n,"data-testid"),text:hv(e,t)}}function Dr(e,t){let n=e.attrs[t];return typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):void 0}function hv(e,t){let n=t.nodes.get(e);if(n==null)return;let r=n.text?.trim()??"",o=(t.children.get(e)??[]).map(a=>hv(a,t)??""),s=[r,...o].filter(a=>a.length>0).join(" ");return s.length===0?void 0:s.slice(0,100)}function PD(e){let t=e.flatMap(i=>ID(i).flatMap(o=>nh(o,void 0))),n=e.flatMap(i=>MD(i).flatMap(o=>nh(o.node,o.parentId??void 0))),r=OD(new Map([...t,...n]),e);return{children:TD(r),nodes:r}}function ID(e){if(e.rrwebType!=="FullSnapshot")return[];let t=DD.safeParse(e.event.data);return t.success?[t.data.node]:[]}function MD(e){if(e.rrwebType!=="IncrementalSnapshot:Mutation")return[];let t=pv.safeParse(e.event.data);return t.success?t.data.adds.flatMap(n=>{let r=BD.safeParse(n);return r.success?[r.data]:[]}):[]}function TD(e){let t=new Map;return e.forEach((n,r)=>{n.parentId!=null&&t.set(n.parentId,[...t.get(n.parentId)??[],r])}),t}function nh(e,t){let n=LD.safeParse(e);if(!n.success)return[];let r=n.data,i=r.childNodes??[];return[[r.id,{attrs:{...r.attributes},parentId:t,tag:r.tagName,text:r.textContent}],...i.flatMap(s=>nh(s,r.id))]}function OD(e,t){return t.flatMap(r=>ND(r)).reduce((r,i)=>{let o=r.get(i.id);return o==null?r:new Map(r).set(i.id,{...o,attrs:{...o.attrs,...i.attributes}})},e)}function ND(e){if(e.rrwebType!=="IncrementalSnapshot:Mutation")return[];let t=pv.safeParse(e.event.data);return t.success?t.data.attributes.flatMap(n=>{let r=FD.safeParse(n);return r.success?[r.data]:[]}):[]}function $D(e){if(e.trim().length===0)return null;let t=VD.safeParse(_D(e));return t.success?t.data:null}function _D(e){try{return JSON.parse(e)}catch{return null}}var LD=G.object({attributes:G.record(G.string(),G.unknown()).optional(),childNodes:G.array(G.unknown()).optional(),id:G.number(),tagName:G.string().optional(),textContent:G.string().optional()}),DD=G.object({node:G.unknown()}),BD=G.object({node:G.unknown(),parentId:G.number().nullable().default(null)}),FD=G.object({attributes:G.record(G.string(),G.unknown()),id:G.number()}),pv=G.object({adds:G.array(G.unknown()).default([]),attributes:G.array(G.unknown()).default([])}),UD=G.object({id:G.number(),type:G.number()}),jD=G.object({id:G.number(),isChecked:G.boolean().optional(),text:G.string().optional()}),VD=G.object({event:G.object({data:G.unknown()}),kind:G.literal("rrweb"),rrwebType:G.string(),timeNanos:G.string()});function WD(e){let t=n=>e.find(r=>r.phase===n)?.ms??0;return{browserMs:t("browser"),driveMs:t("drive"),engineMs:t("engine"),teardownMs:t("teardown"),worldMs:t("world")}}async function zD(e,t){let n=await Sv({attemptIndex:0,capture:!1,params:e,stepRuns:e.stepRuns},t);if(n.kind!=="completed")return yv(n);let r=gv(n.findings);if(r!=null)return{error:r,kind:"error"};if(n.findings.length===0)return{kind:"clean",timing:{confirm:void 0,detect:n.timing}};let i=rh(e.baseState.name,n.findings);return e.seenSignature!=null&&await e.seenSignature(i.signature)?{baseState:e.baseState.name,captureEvents:[],kind:"finding",runId:n.runId,signature:i.signature,timing:{confirm:void 0,detect:n.timing},verifierLayer:i.layer}:GD(e,i,n.timing,t)}function yv(e){return e.kind==="error"?{error:e.error,kind:"error"}:{kind:e.kind}}function gv(e){let t=e.find(n=>n.kind==="driver-error"&&So(n.error));return t!=null&&t.kind==="driver-error"?t.error:void 0}async function GD(e,t,n,r){let i=await Sv({attemptIndex:1,capture:!0,params:e,stepRuns:e.stepRuns},r);if(i.kind!=="completed")return yv(i);let o=gv(i.findings);if(o!=null)return{error:o,kind:"error"};let s={confirm:i.timing,detect:n};return rh(e.baseState.name,i.findings).signature!==t.signature?{kind:"flaky",timing:s}:{baseState:e.baseState.name,captureEvents:i.events,kind:"finding",runId:i.runId,signature:t.signature,timing:s,verifierLayer:t.layer}}function bv(e){return e.kind==="driver-error"||e.kind==="unrunnable"?"crash":e.kind==="pending-check"?e.source.kind==="data-rule"?"data-rule":e.source.kind==="page-rule"?"page-rule":"frame":"frame"}async function Sv({attemptIndex:e,capture:t,params:n,stepRuns:r},i){let o=n.runIdFor(e),s=[],a=[];return(await n.session.runOnce({capture:t,lockfile:n.lockfile,onEvent:t?u=>{s.push(u)}:void 0,options:n.options,params:void 0,runId:o,sequence:HD(n,r),test:n.baseState.test,onPhase:(u,c)=>{a.push({ms:c,phase:u})}},i)).match(u=>u.aborted?{kind:"aborted"}:{events:s,findings:u.findings,kind:"completed",runId:o,timing:WD(a)},u=>({error:u,kind:"error"}))}function HD(e,t){return t.map(n=>{let r=e.corpus[n.idx];if(r==null)throw new Error("transition index out of corpus range");return{params:n.params,transition:r}})}function rh(e,t){let r=t.map(i=>({line:Ru(i),part:qD(i)})).toSorted((i,o)=>F(i.part).localeCompare(F(o.part))).map(i=>i.part);return{layer:KD(r),signature:F({baseState:e,parts:r.map(i=>F(i))})}}var mv={crash:0,"data-rule":1,frame:3,"page-rule":2};function KD(e){return e.map(n=>n.layer).toSorted((n,r)=>mv[n]-mv[r]).at(0)??"frame"}function qD(e){let t=bv(e);switch(e.kind){case"consistency":return{kind:"consistency",layer:t,mismatch:YD(e.mismatch),step:e.step==null?null:{intent:e.step.intent,test:e.step.test}};case"pending-check":return{kind:"pending-check",layer:t,source:e.source.kind,step:{intent:e.step.intent,test:e.step.test}};case"unrunnable":return{intent:e.intent,kind:"unrunnable",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"impossible-action":return{kind:"impossible-action",layer:t,step:e.step.intent}}}function YD(e){return e.kind==="singleton-mismatch"?{kind:e.kind,singleton:e.singleton}:e.kind==="browser-mismatch"?{browser:Ke(e.key),kind:e.kind}:{entity:e.entity,kind:e.kind}}async function wv(e,t){let n=await _s(e);if(n==null)return{kind:"unplannable"};let r=[...n.startingPointTests.values()].find(o=>st(o)===t.baseStateRef);if(r==null)return{kind:"unplannable"};let i=t.steps.map(o=>{let s=n.corpus.find(a=>a.test===o.test&&a.index===o.index);return s==null?null:{params:o.params,transition:s}});return i.some(o=>o==null)?{kind:"unplannable"}:{baseTest:r,kind:"ok",sequence:i.filter(o=>o!=null)}}async function ZD({capture:e,lockfile:t,options:n,repro:r,runId:i,session:o,signal:s}){let a=await wv(t,r);return a.kind==="unplannable"?{kind:"unplannable"}:(await o.runOnce({capture:e,lockfile:t,onEvent:void 0,onPhase:void 0,options:n,params:void 0,runId:i,sequence:a.sequence,test:a.baseTest},s)).match(u=>u.aborted?{kind:"aborted"}:u.findings.length>0?{findings:u.findings,kind:"still-fails"}:{kind:"resolved"},u=>({kind:"state-unavailable",reason:u.kind}))}function IK(e){switch(e.kind){case"empty-response":return"ripplo daemon: cloud tunnel provisioning returned no result. Check server logs and retry.";case"server-error":return`ripplo daemon: cloud tunnel provisioning failed (${e.typename}). Run \`npx ripplo doctor\` to check your setup.`}}function MK(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 TK({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(`
145
+ `)}function OK(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function NK({devSessionId:e,executor:t,tunnelHostname:n,version:r}){let i=t==="cloud"?`cloud executor via ${n??"?"}`:"local executor";return`ripplo daemon: v${r} ready as ${i} for session ${e} (syncs on every \`npx ripplo run\` \u2014 Ctrl-C to stop)`}function $K({cwd:e,pid:t}){return`ripplo daemon: another daemon is already running for this project${t==null?"":` (pid ${String(t)})`} (cwd ${e}).`}function _K(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function LK(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,n=t.version==null?"version unknown (pre-0.7.8)":`v${t.version}`,r=`${String(t.active)} active, ${String(t.queued)} queued`,i=`explorer: ${t.explorer}, ${String(t.exploring)} exploring`,o=`daemon: running (${n} | ${r} | ${i} | ${XD(t.progress)})`;if(t.sseHealth!=null&&!t.sseHealth.ok){let s=t.sseHealth.detail==null?"":`: ${t.sseHealth.detail}`;return`${o}
146
+ daemon: cannot subscribe to run dispatch${s} \u2014 server-side, restarting the daemon will not help`}return o}function XD(e){return e.attempts===0?"explore: idle":`explore: ${String(e.attempts)} attempts, ${String(e.findings)} findings`}function DK(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 BK(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:JD(e.findings).map(t=>rs({evidencePath:`.ripplo/debug/${e.runId}/behavior.jsonl`,finding:t})),kind:"findings"};case"error":return{detail:un(e.error),kind:"error"};case"dispatch-failed":return{kind:"dispatch-error",reason:{detail:e.reason,type:"generic"}}}}function JD(e){let t=new Set(e.flatMap(n=>QD(n)?[xv(n)]:[]));return e.filter(n=>!(eB(n)&&t.has(xv(n))))}function QD(e){return e.kind==="pending-check"&&e.source.kind==="step"}function xv(e){return e.kind!=="pending-check"||e.source.kind==="data-rule"?"":`${zt(e.source.check)}|${Gt(e.step)}`}function eB(e){return e.kind==="pending-check"&&e.source.kind==="page-rule"}export{cl as a,ch as b,hl as c,pl as d,Hv as e,Kv as f,gh as g,Yv as h,Tl as i,uR as j,Th as k,Oh as l,So as m,zh as n,un as o,Ke as p,st as q,Mt as r,$n as s,nm as t,sm as u,Do as v,li as w,ke as x,rs as y,wm as z,xm as A,vm as B,Jo as C,Rm as D,Am as E,ui as F,G0 as G,Z0 as H,X0 as I,Q0 as J,_s as K,eS as L,VS as M,GS as N,HS as O,KS as P,qS as Q,YS as R,ZS as S,vd as T,QL as U,rD as V,av as W,gD as X,bD as Y,zD as Z,wv as _,ZD as $,IK as aa,MK as ba,TK as ca,OK as da,NK as ea,$K as fa,_K as ga,LK as ha,XD as ia,DK as ja,BK as ka};
147
147
  /*! Bundled license information:
148
148
 
149
149
  rrweb/dist/rrweb.js: