ripplo 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-UMSBDSRS.js → chunk-2TO6W5BR.js} +2 -2
- package/dist/{chunk-MMCOPC4L.js → chunk-2ZOIED3H.js} +1 -1
- package/dist/{chunk-CDPYJKK7.js → chunk-5E62BCS7.js} +2 -2
- package/dist/{chunk-SFWAAS5H.js → chunk-66LUQG5T.js} +1 -1
- package/dist/chunk-727NNPVM.js +229 -0
- package/dist/{chunk-4XC5TAOG.js → chunk-BLH6XVEC.js} +1 -1
- package/dist/{chunk-IRTBARRY.js → chunk-ELECJABM.js} +1 -1
- package/dist/{chunk-Q6IYTHMP.js → chunk-G3UFH3WS.js} +1 -1
- package/dist/{chunk-EVVF662P.js → chunk-ML7WCYPY.js} +1 -1
- package/dist/{chunk-ZUPS6XVH.js → chunk-OIJBIBIN.js} +1 -1
- package/dist/{chunk-NEPJCCQS.js → chunk-ONNK7JT4.js} +1 -1
- package/dist/{chunk-XZ2TPZLD.js → chunk-PLQGRHHV.js} +1 -1
- package/dist/chunk-PPMW4GUY.js +83 -0
- package/dist/{chunk-YODZBLYM.js → chunk-RAN55ZC6.js} +5 -5
- package/dist/{chunk-4F67XQYS.js → chunk-SBDRIIVW.js} +20 -20
- package/dist/chunk-T4GHICK4.js +6 -0
- package/dist/{chunk-TY5K3P4F.js → chunk-TBCRT6EC.js} +1 -1
- package/dist/{chunk-A7SHHSB3.js → chunk-ZNUC2RLT.js} +1 -1
- package/dist/chunk-ZQHKESUR.js +4 -0
- package/dist/{cli-error-J33JDZET.js → cli-error-TM2YODR3.js} +1 -1
- package/dist/compile-write-TTEHFTNY.js +4 -0
- package/dist/{daemon-MZWLJO75.js → daemon-6B4OSRBS.js} +1 -1
- package/dist/{daemon-YPXZGJAB.js → daemon-M52H2YF7.js} +1 -1
- package/dist/{dsl-loader-5Z2JRKY3.js → dsl-loader-Z54ZM7C6.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/index.js +208 -184
- package/dist/{plan-reminder-45PSVOVW.js → plan-reminder-2ABA3SFH.js} +1 -1
- package/dist/post-edit-XBVQBSKV.js +4 -0
- package/dist/post-edit-analyze-KDA7T37Z.js +4 -0
- package/dist/post-edit-flag-stubs-SX2Y7OHG.js +4 -0
- package/dist/{pre-edit-EJO3TUNQ.js → pre-edit-FTNMDZZO.js} +1 -1
- package/dist/{pre-edit-watch-gate-DZHQCMEI.js → pre-edit-watch-gate-MR7YQGEV.js} +1 -1
- package/dist/{prompt-submit-ZCDG6T4Y.js → prompt-submit-AMSKMHWO.js} +1 -1
- package/dist/solve-worker.js +1 -1
- package/dist/status-2IFILDIA.js +4 -0
- package/dist/{stop-enforce-Q4JNBYQU.js → stop-enforce-P6YWEHWE.js} +1 -1
- package/dist/{tasks-reminder-LKSUZUFD.js → tasks-reminder-VKRJRDNC.js} +1 -1
- package/package.json +5 -5
- package/dist/chunk-6BQADUAX.js +0 -229
- package/dist/chunk-INO3L4WS.js +0 -4
- package/dist/chunk-MG43RZXH.js +0 -83
- package/dist/chunk-RWFS5SCW.js +0 -6
- package/dist/compile-write-4ZAIPQMG.js +0 -4
- package/dist/post-edit-JHJT2QTK.js +0 -4
- package/dist/post-edit-analyze-PPFHKIYQ.js +0 -4
- package/dist/post-edit-flag-stubs-Q3UKDZ2W.js +0 -4
- package/dist/status-66XIDYSP.js +0 -4
package/dist/chunk-MG43RZXH.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
-
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{$ as _c,A as Mc,B as Oc,C as V,D as we,G as us,H as Ic,I as Wn,J as Tc,N as Un,O as Nc,S as $c,T as Lc,U as Dc,V as Fc,_ as ot,a as S,b as Rc,ba as jc,c as cs,d as rt,e as jn,f as de,g as vc,h as nt,i as _r,j as Bn,k as Vn,l as xc,p as kc,q as Ec,r as pe,s as ye,t as Qt,u as Cc,v as Lt,w as it,x as ke,y as Ac,z as Pc}from"./chunk-4F67XQYS.js";import{a as Ny}from"./chunk-NNH3YVVO.js";import{a as Ty,b as wc}from"./chunk-KMZ3L5YA.js";var Md=Ty((CN,Qs)=>{"use strict";var Si=process||{},Ad=Si.argv||[],gi=Si.env||{},Kb=!(gi.NO_COLOR||Ad.includes("--no-color"))&&(!!gi.FORCE_COLOR||Ad.includes("--color")||Si.platform==="win32"||(Si.stdout||{}).isTTY&&gi.TERM!=="dumb"||!!gi.CI),Hb=(e,t,r=e)=>n=>{let i=""+n,o=i.indexOf(t,e.length);return~o?e+Yb(i,t,r,o)+t:e+i+t},Yb=(e,t,r,n)=>{let i="",o=0;do i+=e.substring(o,n)+r,o=n+t.length,n=e.indexOf(t,o);while(~n);return i+e.substring(o)},Pd=(e=Kb)=>{let t=e?Hb:()=>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")}};Qs.exports=Pd();Qs.exports.createColors=Pd});function ne(e){return`${e.workflow}/${e.slug}`}var Bc=new WeakMap;function J(e){let t=Bc.get(e);if(t!=null)return t;let r=e.workflows.flatMap(n=>n.tests.map(i=>({ref:ne(i),test:i,workflow:n})));return Bc.set(e,r),r}function ds({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 $y=ds();function ps(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace($y,"")}function fs(e,t,r){return{detail:r.slice(0,500),kind:"engine-http",path:e,status:t}}function er(e,t){return{code:Gc(t),kind:"engine-network",message:Br(t),path:e}}function zn(e){return{kind:"client-mount-missing",mountKey:e}}function hs(e,t){return{kind:"app-not-ready",readyKey:e,timeoutMs:t}}function ms(e,t){return{kind:"engine-decode",message:Br(t),path:e}}function ys(e,t){return{entity:e,field:t,kind:"state-identity"}}function gs(e){return{as:e,kind:"setup-missing-row"}}function Ue(e){return{kind:"driver-launch",message:Br(e)}}function Ss(e){return{kind:"engine-unreachable",url:e}}function bs(e,t){return{action:e,kind:"action-failed",message:Br(t)}}function ws(e){return{kind:"check-failed",message:Br(e)}}function Rs(){return{kind:"aborted"}}var Ly=["aborted","action-failed","app-not-ready","check-failed","client-mount-missing","conflicting-sessions","driver-launch","engine-decode","engine-http","engine-network","engine-unreachable","setup-missing-row","state-identity"],Dy=new Set(Ly);function Gn(e){if(typeof e!="object"||e==null||!("kind"in e))return!1;let{kind:t}=e;return typeof t=="string"&&Dy.has(t)}var Fy=["app-not-ready","client-mount-missing","driver-launch","engine-decode","engine-http","engine-network","engine-unreachable"],Wc=new Set(Fy);function qn(e){return Wc.has(e.kind)}function Uc(e){return Wc.has(e)}var Vc=300;function jr(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${zc(e.detail)}${Vy(e.status)}`;case"engine-network":return`engine ${e.path} request failed: ${e.message}${_y(e.code)}${By(e.code,e.message)}`;case"client-mount-missing":return`this test reads client-side state, but the app never mounted the client engine ("${e.mountKey}"). Call mountClientEngine() where your app boots.`;case"app-not-ready":return`the app never called ready() within ${String(e.timeoutMs)}ms of loading the page. Call ready() from @ripplo/testing once your app is interactive \u2014 see setup.`;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 ze(){}function zc(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=Vc?t:`${t.slice(0,Vc)}\u2026 [truncated]`}function _y(e){return e==null?"":` (${e})`}var jy=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function By(e,t){return e!=null&&jy.has(e)?" \u2014 nothing accepted the connection at the engine URL. Check that the app's dev server is running and RIPPLO_ENGINE_URL points at it.":t.toLowerCase().includes("timeout")?" \u2014 the app took too long to respond. On a dev server the first hit to a route compiles it on demand and can blow the timeout \u2014 warm the route or raise the setup budget. A hung seed/read impl does the same, so check the app logs if it persists.":" \u2014 the app dropped the connection mid-request. A thrown error in the engine route or a seed/read impl can cause this \u2014 check the app logs."}function Vy(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 Gc(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?Gc(e.cause):void 0}function Br(e){let t=e instanceof Error?e.message:String(e);return zc(ps(t))}var qc=new WeakMap;function tr(e){let t=qc.get(e);if(t!=null)return t;let r={entities:e.entities,singletonSchemas:e.singletons,valueSpaces:e.valueSpaces};return jc(r,e.solved),qc.set(e,r),r}import{createHash as CS}from"crypto";import{z as Wy}from"zod";import{stringify as Uy}from"safe-stable-stringify";var vs=Wy.string().brand(),M=vs.parse("");function $e(e){return vs.parse(e)}function Ee(e,t){return vs.parse(e.length===0?t:`${e}.${t}`)}function U(e){return Rc.safeParse(e).success}function Kc(e){let t=e.lastIndexOf(".");return t===-1?void 0:{alias:e.slice(0,t),field:e.slice(t+1)}}function Ge(e){return typeof e=="object"&&e!==null&&"template"in e}function Hc(e){return typeof e!="string"&&"count"in e}var st=class extends Error{subject;constructor(t){super(t),this.subject=t}};function Re(e){return{counts:void 0,env:e}}function xs(e,t,r){let n=Ee(t,e.ref);if(!r.has(n))throw new st(n);return r.get(n)??null}function Vr(e,t,r){return Kn(e).every(n=>r.has(Ee(t,n)))}function qe(e,t,r){return typeof e=="string"?e:U(e)?String(xs(e,t,r.env)):e.template.map(n=>Gy(n,t,r)).join("")}function Ce(e,t,r){return e===null||typeof e=="number"||typeof e=="boolean"?e:U(e)?xs(e,t,r.env):qe(e,t,r)}function Yc(e,t){return Ce(e,M,t)}function Wr(e){return Uy(e)}function rr(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,Ce(i,t,r)]))}function Kn(e){return e==null||typeof e!="object"?[]:Ge(e)?e.template.flatMap(t=>typeof t=="string"?[]:Hc(t)?zy(t):[t.ref]):[e.ref]}function zy(e){return Object.values(e.count.where).flatMap(t=>Xc(t))}function Xc(e){return e==null||typeof e!="object"?[]:"kind"in e?e.kind==="within"?Object.values(e.selection.where).flatMap(t=>Xc(t)):e.kind==="anyOf"?e.values.flatMap(t=>Kn(t)):Kn(e.value):Kn(e)}function Gy(e,t,r){if(typeof e=="string")return e;if(!Hc(e))return String(xs(e,t,r.env));if(r.counts==null)throw new st(e.count.entity);return String(r.counts(e,r.env))}function ae(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:qe(e.name,M,t),role:e.role}:e.by==="inside"?{by:"inside",scope:ae(e.scope,t),target:ae(e.target,t)}:e.by==="surface"?{by:"surface",container:ae(e.container,t),overlay:e.overlay}:e.by==="frame"?{by:"frame",element:ae(e.element,t)}:{by:"testId",value:qe(e.value,M,t)}}var qy="https://ripplo.invalid";var Zc={hash:void 0,path:void 0,query:{},title:void 0,viewport:void 0};function Qc(e){return e.kind!=="title"&&e.kind!=="viewport"}function nr(e){return e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:`url ${e.kind}`}function Hn(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 Ur(e){let t=new URL(e,qy),r=Object.fromEntries(t.searchParams.entries());return{hash:t.hash.length>0?t.hash.slice(1):void 0,path:t.pathname,query:r,title:void 0,viewport:void 0}}function eu(e){if(typeof e=="string")return Jc(Ur(e));let t=U(e)?[e]:e.template,r=t.findIndex(c=>typeof c=="string"&&/[?#]/.test(c)),n=t[r];if(r===-1||typeof n!="string")return{...Zc,path:e};let i=[...t.slice(0,r),n.slice(0,n.search(/[?#]/))].filter(c=>typeof c!="string"||c.length>0),o=t.slice(r),s={template:i};if(o.some(c=>typeof c!="string"))return{...Zc,path:s};let a=o.filter(c=>typeof c=="string").join(""),l=Ur(`/p${a.slice(a.search(/[?#]/))}`);return{...Jc(l),path:s}}function tu(e){let r=[[{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}]),n=Object.entries(e.query).map(([i,o])=>({clause:o,key:{key:i,kind:"query"}}));return[...r,...n]}function Jc(e){return{hash:e.hash,path:e.path,query:e.query,title:e.title,viewport:e.viewport}}var Le=new Map;function v(e){return e.kind!=="element"?S(e):jn(e.locator,e.state)}function at(e,t){return new Map([...ru(e,t),[v(t.subject),t]])}function ks(e,t){return new Map([...ru(e,t),[v(t.subject),t]])}function Ae(e,t){return new Map([...e,...t])}function Es(e){return e.kind==="element"}function wt(e){return e.kind==="path"||e.kind==="query"||e.kind==="hash"}function le(e,t){let r=e.get(v(t));return r==null||r.expect.expect!=="is"?void 0:r.expect.value}function or(e){let t=Ur(e),r=[[{kind:"path"},t.path],[{kind:"hash"},t.hash],...Object.entries(t.query).map(n=>[{key:n[0],kind:"query"},n[1]])];return new Map(r.flatMap(([n,i])=>i===void 0?[]:[[v(n),{declared:!0,expect:{expect:"is",value:i},subject:n}]]))}function Cs(e){return[...e].toSorted(([t],[r])=>t.localeCompare(r))}function ru(e,t){return Ky(t)?Hy(e,t.subject):Xy(t)?Zy(e,t.subject):e}function Ky(e){return e.subject.kind==="element"&&e.subject.state==="visible"&&e.expect.expect==="is"&&e.expect.value===!1}function Hy(e,t){if(t.kind!=="element")return e;let r=S(de(t.locator)),n=[...e].filter(([,i])=>Yy(i,r));return n.length===e.size?e:new Map(n)}function Yy(e,t){if(e.subject.kind!=="element")return!0;let r=de(e.subject.locator);return zr(r,t)?!1:S(r)!==t?!0:e.subject.state!=="text"&&e.subject.state!=="value"}function zr(e,t){return e.by==="frame"?S(e.element)===t||zr(e.element,t):e.by!=="inside"?!1:S(e.scope)===t||S(e.target)===t||zr(e.scope,t)||zr(e.target,t)}function Xy(e){return e.subject.kind==="element"&&e.subject.state==="visible"&&e.expect.expect==="is"&&e.expect.value===!0&&nu(e.subject.locator)}function nu(e){return e.by==="surface"&&e.overlay}function Zy(e,t){if(t.kind!=="element")return e;let r=S(de(t.locator)),n=[...e].filter(([,i])=>Jy(i,r));return n.length===e.size?e:new Map(n)}function Jy(e,t){if(e.subject.kind!=="element"||nu(e.subject.locator))return!0;let r=de(e.subject.locator);return S(r)===t||zr(r,t)}function lt({declared:e,entry:t,scope:r}){let n=t.subject.kind==="element"?{...t.subject,locator:ae(t.subject.locator,r)}:t.subject;if(t.expect.expect==="absent")return{declared:e,expect:{expect:"absent"},subject:n};let i=Ce(t.expect.value,M,r),o=tg(n)&&typeof i=="number"?String(i):i;return{declared:e,expect:{expect:t.expect.expect,value:o},subject:n}}function Dt({got:e,subject:t,want:r}){if(r.expect==="absent")return e===void 0;if(Qy(t)){let n=eg(e,r.value);return r.expect==="is"?n:!n}return r.expect==="is"?e===r.value:e!==r.value}function Qy(e){return e.kind==="element"&&e.state==="text"}function ir(e){return e.replaceAll(/\s+/gu," ").trim()}function eg(e,t){return typeof e=="string"&&typeof t=="string"&&ir(e)===ir(t)}function tg(e){return e.kind==="element"&&(e.state==="value"||e.state==="text")}import rg from"better-sqlite3";var iu={current:null};function Yn(){let e=iu.current;if(e!=null)return e;let t={columns:new Map,db:new rg(":memory:"),loaded:null,statements:new Map};return iu.current=t,t}function Ft(e,t){let r=e.statements.get(t);if(r!=null)return r;let n=e.db.prepare(t);return e.statements.set(t,n),n}function Ke(e,t,r){e.columns.get(t)==null&&(e.db.exec(`CREATE TABLE "${t}" (__as TEXT PRIMARY KEY)`),e.columns.set(t,new Set));let i=e.columns.get(t);r.filter(s=>i?.has(s)!==!0).forEach(s=>{e.db.exec(`ALTER TABLE "${t}" ADD COLUMN "${s}"`),i?.add(s),e.loaded=null})}function Xn(e,t){t.entities.forEach((r,n)=>{let i=[...new Set([...r.values()].flatMap(o=>Object.keys(o)))];Ke(e,n,i)})}function Gr(e,t,r){Ke(e,t,Object.keys(r)),Object.values(r).forEach(n=>{pe(n)&&(Ke(e,n.selection.entity,[n.field]),Gr(e,n.selection.entity,n.selection.where))})}function Zn(e,t){e.loaded!==t&&(e.columns.forEach((r,n)=>{Ft(e,`DELETE FROM "${n}"`).run();let i=t.entities.get(n);if(i==null||i.size===0)return;let o=[...r],s=o.map(d=>`"${d}"`).join(", "),a=o.map(()=>"?").join(", "),l=o.length===0?"(__as)":`(__as, ${s})`,c=o.length===0?"(?)":`(?, ${a})`,u=Ft(e,`INSERT INTO "${n}" ${l} VALUES ${c}`);i.forEach((d,p)=>{u.run(p,...o.map(m=>ng(d[m])))})}),e.loaded=t)}function ng(e){return typeof e=="boolean"?e?1:0:typeof e=="string"||typeof e=="number"?e:e instanceof Date?e.toISOString():null}function As({entity:e,snapshot:t,where:r}){let n=Yn();Gr(n,e,r),Xn(n,t),Zn(n,t);let o=`SELECT r.__as AS __as FROM "${e}" r WHERE ${vt(r,{depth:0,refExpr:ig,row:"r"})} ORDER BY r.rowid`;return Ft(n,o).all().flatMap(s=>{let a=s!=null&&typeof s=="object"?Reflect.get(s,"__as"):null;return typeof a=="string"?[a]:[]})}function ou(e){let t=e.snapshot.entities.get(e.entity);return t==null||t.size===0?[]:As(e).flatMap(r=>{let n=t.get(r);return n==null?[]:[n]})}function ig(e){throw new Error(`sql-where: unresolved ref "${e}" \u2014 resolve refs before matching`)}function vt(e,t){let r=Object.entries(e).map(([n,i])=>og({column:`${t.row}."${n}"`,scope:t,want:i}));return r.length===0?"1":r.join(" AND ")}function og({column:e,scope:t,want:r}){if(pe(r)){let n=`w${String(t.depth)}`,i=vt(r.selection.where,{...t,depth:t.depth+1,row:n});return`${e} IN (SELECT ${n}."${r.field}" FROM "${r.selection.entity}" ${n} WHERE ${i})`}return ye(r)?ag({column:e,scope:t,want:r}):`${e} IS ${_t(r,t.refExpr)}`}function _t(e,t){let r=sg(e);if(r!=null)return t(r);if(e instanceof Date)return Rt(e.toISOString());if(e!=null&&typeof e=="object")throw new Error("sql-where: template values must be resolved before compiling");return Rt(e)}function Rt(e){if(e==null)return"NULL";if(typeof e=="boolean")return e?"1":"0";if(typeof e=="number")return String(e);if(typeof e=="string")return`'${e.replaceAll("'","''")}'`;throw new Error("sql-where: only primitive literals can be compiled")}function sg(e){if(e!=null&&typeof e=="object"&&"ref"in e)return typeof e.ref=="string"?e.ref:void 0}function ag({column:e,scope:t,want:r}){let{refExpr:n}=t;if(r.kind==="not")return`${e} IS NOT ${_t(r.value,n)}`;if(r.kind==="anyOf")return`(${r.values.map(o=>`${e} IS ${_t(o,n)}`).join(" OR ")})`;if(r.kind==="compare"){let i={gt:">",gte:">=",lt:"<",lte:"<="}[r.op];return`${e} ${i} ${_t(r.value,n)}`}return r.kind==="contains"?`instr(${e}, ${_t(r.value,n)}) > 0`:`substr(${e}, 1, length(${_t(r.value,n)})) IS ${_t(r.value,n)}`}function xt(e){return typeof e=="object"&&e!==null&&"kind"in e}function kt(e){return Object.fromEntries(Object.entries(e).filter(t=>!xt(t[1])))}function Ms(e){return new Map(e.entities.filter(t=>t.identityKind==="surrogate").map(t=>[t.name,t.identity]))}function ge(e){return(t,r)=>ct(e,t.count.entity,t.count.where,r).length}function sr(e,t,r){return t.reduce((n,i)=>ug(n,i,r,e),e)}function su(e,{clears:t,forget:r,sets:n}){let i=new Set(t),o=lg(e,r,n),s=[...e.scalars].filter(([l,c])=>!i.has(l)&&!(o&&(Es(c.subject)||cg(c.subject)))),a=[...n.values()].reduce((l,c)=>at(l,c),new Map(s));return{...e,scalars:a}}function lg(e,t,r){if(t==="hard")return!0;if(t==="none")return!1;let n=le(e.scalars,{kind:"path"}),i=le(r,{kind:"path"});return i!==void 0&&i!==n}function cg(e){return e.kind==="query"||e.kind==="hash"}function ug(e,t,r,n){let{env:i,identities:o}=r;if(!fg(t,i))return e;if(t.assertion.kind==="created"){let l=rr(t.assertion.props,M,{counts:ge(e),env:i}),c=dg({entity:t.entity,identities:o,props:l},e);return mg(e,t.entity,Wr(c),c)}let s=cu({entity:t.entity,env:i,key:t.key,snapshot:n});if(t.assertion.kind==="deleted")return Ps(e,t.entity,l=>new Map([...l].filter(([c])=>!s.has(c))));let a=rr(kt(t.assertion.props),M,{counts:ge(e),env:i});return Ps(e,t.entity,l=>new Map([...l].map(([c,u])=>s.has(c)?[c,{...u,...a}]:[c,u])))}var Os="#surrogate#";function au(e){return typeof e=="string"&&e.includes(Os)}function dg({entity:e,identities:t,props:r},n){let i=(t.get(e)??[]).filter(a=>!(a in r));if(i.length===0)return r;let o=pg(n.entities.get(e),e),s=Object.fromEntries(i.map(a=>[a,`${e}${Os}${String(o)}`]));return{...r,...s}}function pg(e,t){let r=`${t}${Os}`;return[...(e??new Map).values()].flatMap(i=>Object.values(i)).filter(i=>typeof i=="string"&&i.startsWith(r)).map(i=>Number(i.slice(r.length))).filter(i=>Number.isFinite(i)).reduce((i,o)=>Math.max(i,o),0)+1}function fg(e,t){return("props"in e.assertion?[e.key,kt(e.assertion.props)]:[e.key]).every(n=>Object.values(n).every(i=>pe(i)||hg(i).every(o=>!U(o)||t.has($e(o.ref)))))}function hg(e){return ye(e)?e.kind==="anyOf"?e.values:[e.value]:[e]}function mg(e,t,r,n){let i=new Map([...e.entities.get(t)??[],[r,n]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function Ps(e,t,r){let n=r(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,n]])}}function ct(e,t,r,n){return ou({entity:t,snapshot:e,where:Is(r,{env:n,snapshot:e})})}function lu(e,t,r,n,i){let o=cu({entity:t,env:n,key:r,snapshot:e});return Ps(e,t,s=>new Map([...s].map(([a,l])=>[a,o.has(a)?i(l):l])))}function cu({entity:e,env:t,key:r,snapshot:n}){return new Set(As({entity:e,snapshot:n,where:Is(r,{env:t,snapshot:n})}))}function Is(e,t){return Object.fromEntries(Object.entries(e).map(([r,n])=>[r,yg(n,t)]))}function yg(e,t){return pe(e)?{...e,selection:{...e.selection,where:Is(e.selection.where,t)}}:ye(e)?e.kind==="anyOf"?{...e,values:e.values.map(r=>Jn(r,t))}:e.kind==="contains"||e.kind==="startsWith"?{...e,value:String(Jn(e.value,t))}:{...e,value:Jn(e.value,t)}:Jn(e,t)}function Jn(e,t){return Ce(e,M,{counts:ge(t.snapshot),env:t.env})}function du(e,t,r){return e.reduce((n,i)=>{let o=sr(n.snapshot,gg(i),r);return{resolved:[...n.resolved,Sg(i,o,r.env)],snapshot:o}},{resolved:[],snapshot:t}).resolved}function jt(e,t){if(e.kind==="count")return ct(t.snapshot,e.entity,e.where,t.env).length===e.value;if(e.kind==="exists")return ct(t.snapshot,e.entity,e.where,t.env).length>0;if(e.kind==="singleton"){let r=Ce(e.assertion.value,M,{counts:ge(t.snapshot),env:t.env});return uu(le(t.snapshot.scalars,{kind:"variable",name:e.singleton}))===uu(r)}return e.kind==="not"?!jt(e.predicate,t):e.kind==="or"?e.predicates.some(r=>jt(r,t)):e.predicates.every(r=>jt(r,t))}function gg(e){return e.expect.filter(t=>t.kind==="state")}function Sg(e,t,r){return e.expect.some(n=>n.kind==="when")?{...e,expect:e.expect.flatMap(n=>pu(n,{env:r,snapshot:t}))}:e}function pu(e,t){if(e.kind!=="when")return[e];let r=bg(e,t);return r==null?[]:r.flatMap(n=>pu(n,t))}function bg(e,t){return e.branches.find(r=>r.condition==null||jt(r.condition,t))?.consequence}function uu(e){return e==null?"\u2205":JSON.stringify(e)}var fu=2e4;function yu(e,t){let r=["__stage_a","__stage_b"],n=t.entities.reduce((a,l,c)=>{let u=r[c%2]??"__stage_a";e.db.exec(`DROP TABLE IF EXISTS ${u}`);let d=a==null?"":"prev.*, ",p=a==null?"":`${a} prev, `,m=Rg({index:c,pattern:t,prev:a});return e.db.exec(`CREATE TEMP TABLE ${u} AS SELECT ${d}t.__as AS "a${String(c)}" FROM ${p}"${l.entity}" t WHERE ${m}`),wg(e,u),u},null);if(n==null)return{};let i=vg(t),o=i.length===0?"":` WHERE ${i.join(" AND ")}`,s=e.db.prepare(`SELECT * FROM ${n} s${o} LIMIT 1`).get();return s==null||typeof s!="object"?null:{...s}}function wg(e,t){let r=e.db.prepare(`SELECT COUNT(*) AS n FROM ${t}`).get(),n=r!=null&&typeof r=="object"?Reflect.get(r,"n"):0;if(typeof n=="number"&&n>fu)throw new Error(`sql-staged: pattern too weakly constrained \u2014 ${String(n)} partial assignments exceed the ${String(fu)} cap`)}function Rg({index:e,pattern:t,prev:r}){let n=t.entities[e];if(n==null)return"1";let i=Object.entries(n.literals).map(([u,d])=>`t."${u}" IS ${Rt(d)}`),o=new Map(t.entities.slice(0,e).map((u,d)=>[u.alias,d])),s=n.relations.flatMap(u=>{let d=o.get(u.targetAlias);return d==null?[]:[`t."${u.field}" = ${hu(t,d,u.targetField)}`]}),a=t.entities.slice(0,e).flatMap((u,d)=>u.relations.flatMap(p=>p.targetAlias===n.alias?[`${hu(t,d,p.field)} = t."${p.targetField}"`]:[])),l=t.entities.slice(0,e).flatMap((u,d)=>u.entity===n.entity&&r!=null?[`t.__as <> prev."a${String(d)}"`]:[]),c=[...i,...s,...a,...l];return c.length===0?"1":c.join(" AND ")}function hu(e,t,r){let n=e.entities[t]?.entity??"";return`(SELECT b."${r}" FROM "${n}" b WHERE b.__as = prev."a${String(t)}")`}function mu(e,t,r){let n=e.entities[t]?.entity??"";return`(SELECT r."${r}" FROM "${n}" r WHERE r.__as = s."a${String(t)}")`}function vg(e){let t=new Map(e.entities.map((a,l)=>[a.alias,l])),r=a=>{let l=a.indexOf("."),c=l===-1?void 0:t.get(a.slice(0,l));if(c==null)throw new Error(`sql-staged: unresolved ref "${a}"`);return mu(e,c,a.slice(l+1))},n=e.absences.map(a=>{let l=[...Object.entries(a.literals).map(([u,d])=>`x."${u}" IS ${Rt(d)}`),...a.relations.map(u=>{let d=t.get(u.targetAlias);return d==null?"0":`x."${u.field}" = ${mu(e,d,u.targetField)}`})],c=l.length===0?"":` WHERE ${l.join(" AND ")}`;return`NOT EXISTS (SELECT 1 FROM "${a.entity}" x${c})`}),i=e.exclusives.map(a=>{let l=e.entities.flatMap((u,d)=>u.entity===a?[`s."a${String(d)}"`]:[]),c=l.length===0?"":` WHERE x.__as NOT IN (${l.join(", ")})`;return`NOT EXISTS (SELECT 1 FROM "${a}" x${c})`}),o={depth:0,refExpr:r,row:"c"},s=e.conditions.flatMap(a=>Ts(a,o));return[...n,...i,...s]}function Ts(e,t){if(e.kind==="singleton")return[];if(e.kind==="not"){let r=Ts(e.predicate,t);return r.length===0?[]:[`NOT (${r.join(" AND ")})`]}return e.kind==="and"||e.kind==="or"?xg(e,t):[kg(e,t)]}function xg(e,t){let r=e.predicates.flatMap(i=>Ts(i,t)),n=e.kind==="and"?" AND ":" OR ";return r.length===0?[]:[`(${r.join(n)})`]}function kg(e,t){return e.kind==="count"?`(SELECT COUNT(*) FROM "${e.entity}" c WHERE ${vt(e.where,t)}) = ${String(e.value)}`:`EXISTS (SELECT 1 FROM "${e.entity}" c WHERE ${vt(e.where,t)})`}var gu=new WeakMap,Eg=60;function wu(e,t){let r=Yn(),n=vu(t);if(xu(e.actor,n))return null;if(Cg(r,e),Xn(r,t),Zn(r,t),e.entities.length>Eg){let s=yu(r,e);return s==null?null:bu({pattern:e,picked:s,snapshot:t})}let i=gu.get(e)??Pg(e);gu.set(e,i);let o=i.includes(":actor")?Ft(r,i).get({actor:n}):Ft(r,i).get();return o==null||typeof o!="object"?null:bu({pattern:e,picked:o,snapshot:t})}function Ru(e,t){let r=vu(t);return xu(e.actor,r)?{got:r}:null}function vu(e){let t=e.scalars.get(v({kind:"actor"})),r=t!=null&&t.expect.expect==="is"?t.expect.value:null;return typeof r=="string"?r:null}function xu(e,t){return e.kind==="user"?t==null:e.kind==="anonymous"?t!=null:!1}function Cg(e,t){t.entities.forEach(r=>{Ke(e,r.entity,[...Object.keys(r.literals),...r.relations.map(n=>n.field)]),r.relations.forEach(n=>{let i=t.entities.find(o=>o.alias===n.targetAlias);i!=null&&Ke(e,i.entity,[n.targetField])})}),t.absences.forEach(r=>{Ke(e,r.entity,[...Object.keys(r.literals),...r.relations.map(n=>n.field)]),r.relations.forEach(n=>{let i=t.entities.find(o=>o.alias===n.targetAlias);i!=null&&Ke(e,i.entity,[n.targetField])})}),t.conditions.forEach(r=>{$s(e,r),Ns({condition:r,pattern:t,store:e})}),t.exclusives.forEach(r=>{Ke(e,r,[])})}function Ns({condition:e,pattern:t,store:r}){if(e.kind!=="singleton"){if(e.kind==="not"){Ns({condition:e.predicate,pattern:t,store:r});return}if(e.kind==="and"||e.kind==="or"){e.predicates.forEach(n=>{Ns({condition:n,pattern:t,store:r})});return}ku(e.where).forEach(n=>{let i=n.indexOf(".");if(i===-1)return;let o=n.slice(0,i),s=t.entities.find(a=>a.alias===o);s!=null&&Ke(r,s.entity,[n.slice(i+1)])})}}function ku(e){return Object.values(e).flatMap(t=>Ag(t))}function Ag(e){return pe(e)?ku(e.selection.where):ye(e)?(e.kind==="anyOf"?e.values:[e.value]).flatMap(r=>Su(r)):Su(e)}function Su(e){return e!=null&&typeof e=="object"&&"ref"in e?typeof e.ref=="string"?[e.ref]:[]:[]}function $s(e,t){if(t.kind!=="singleton"){if(t.kind==="not"){$s(e,t.predicate);return}if(t.kind==="and"||t.kind==="or"){t.predicates.forEach(r=>{$s(e,r)});return}Gr(e,t.entity,t.where)}}function bu({pattern:e,picked:t,snapshot:r}){let n=e.entities.map((i,o)=>{let s=Reflect.get(t,`a${String(o)}`),a=typeof s=="string"?r.entities.get(i.entity)?.get(s):null;return a==null?null:[i.alias,a]});return n.some(i=>i==null)?null:new Map(n.filter(i=>i!=null))}function Pg(e){let t=new Map(e.entities.map((s,a)=>[s.alias,`t${String(a)}`])),r=e.entities.length===0?"1":e.entities.map((s,a)=>`t${String(a)}.__as AS a${String(a)}`).join(", "),n=e.entities.length===0?"":` FROM ${e.entities.map((s,a)=>`"${s.entity}" t${String(a)}`).join(", ")}`,i=[...Mg(e,t),...e.entities.flatMap((s,a)=>Og({alias:`t${String(a)}`,aliases:t,constraint:s})),...Ig(e,t),...e.absences.map(s=>Tg(s,t)),...e.conditions.flatMap(s=>Ls(s)?[]:[Ds(s,t)]),...Ng(e,t)],o=i.length===0?"":` WHERE ${i.join(" AND ")}`;return`SELECT ${r}${n}${o} LIMIT 1`}function Mg(e,t){if(e.actor.kind!=="user")return[];let r=t.get(e.actor.alias);return r==null?[]:[`${r}.__as = :actor`]}function Ls(e){return e.kind==="singleton"?!0:e.kind==="not"?Ls(e.predicate):e.kind==="and"||e.kind==="or"?e.predicates.some(t=>Ls(t)):!1}function Og({alias:e,aliases:t,constraint:r}){let n=Object.entries(r.literals).map(([o,s])=>`${e}."${o}" IS ${Rt(s)}`),i=r.relations.map(o=>{let s=t.get(o.targetAlias);return s==null?"1":`${e}."${o.field}" = ${s}."${o.targetField}"`});return[...n,...i]}function Ig(e,t){return e.entities.flatMap((r,n)=>e.entities.slice(n+1).flatMap((i,o)=>{if(r.entity!==i.entity)return[];let s=t.get(r.alias),a=t.get(e.entities[n+1+o]?.alias??i.alias);return s==null||a==null?[]:[`${s}.__as <> ${a}.__as`]}))}function Tg(e,t){let r=[...Object.entries(e.literals).map(([i,o])=>`x."${i}" IS ${Rt(o)}`),...e.relations.map(i=>{let o=t.get(i.targetAlias);return o==null?"0":`x."${i.field}" = ${o}."${i.targetField}"`})],n=r.length===0?"":` WHERE ${r.join(" AND ")}`;return`NOT EXISTS (SELECT 1 FROM "${e.entity}" x${n})`}function Ng(e,t){return e.exclusives.map(r=>{let n=e.entities.map(s=>s.entity===r?t.get(s.alias):null).filter(s=>s!=null),i=n.map(s=>`${s}.__as`).join(", "),o=n.length===0?"":` WHERE x.__as NOT IN (${i})`;return`NOT EXISTS (SELECT 1 FROM "${r}" x${o})`})}function Ds(e,t){let r={depth:0,refExpr:$g(t),row:"c"};if(e.kind==="count")return`(SELECT COUNT(*) FROM "${e.entity}" c WHERE ${vt(e.where,r)}) = ${String(e.value)}`;if(e.kind==="exists")return`EXISTS (SELECT 1 FROM "${e.entity}" c WHERE ${vt(e.where,r)})`;if(e.kind==="singleton")throw new Error("sql-match: singleton conditions are evaluated by the scalar stage");if(e.kind==="not")return`NOT (${Ds(e.predicate,t)})`;let n=e.predicates.map(o=>Ds(o,t)),i=e.kind==="and"?" AND ":" OR ";return`(${n.join(i)})`}function $g(e){return t=>{let r=t.indexOf("."),n=r===-1?void 0:e.get(t.slice(0,r));if(n==null)throw new Error(`sql-match: unresolved ref "${t}"`);return`${n}."${t.slice(r+1)}"`}}function Pe(e,t){let r=qr(e,t);if(r==null)return null;let n=Fg(e.scalars,t,Pu(r));return n==null?null:e.conditions.every(o=>jt(o,{env:n,snapshot:t}))?n:null}function qr(e,t){return wu(e,t)}function Qn(e,t){let r=qr(e,t);if(r==null)return Lg(e,t);let n=Dg(e.scalars,t,Pu(r));if(n.unmet!=null)return n.unmet;let i=e.conditions.find(o=>!jt(o,{env:n.env,snapshot:t}));return i==null?null:{condition:i,kind:"condition"}}function Lg(e,t){let r=Ru(e,t);if(r!=null)return{got:r.got??void 0,kind:"scalar",subject:{kind:"actor"},want:e.actor.kind==="anonymous"?"signed out":"a signed-in user"};let n=e.entities.find((o,s)=>{let a={...e,absences:[],conditions:[],entities:e.entities.slice(0,s+1),scalars:new Map};return qr(a,t)==null});if(n!=null)return{alias:n.alias,entity:n.entity,kind:"entities",mustBeAbsent:!1};let i=e.absences.find(o=>{let s={...e,absences:[o],conditions:[],scalars:new Map};return qr(s,t)==null});return{alias:null,entity:i?.entity??null,kind:"entities",mustBeAbsent:i!=null}}function Eu(e,t,r){let n=Cu(e.subject,r);if(n==null)return null;let i=Au(t,n);return e.expect.expect==="absent"?i===void 0?r:null:e.expect.expect==="not"?Bg({clause:e.expect.value,env:r,got:i,snapshot:t,subject:n}):_g({clause:e.expect.value,env:r,got:i,snapshot:t,subject:n})}function Dg(e,t,r){return[...e.values()].reduce((n,i)=>{if(n.unmet!=null)return n;let o=Eu(i,t,n.env);if(o!=null)return{env:o,unmet:null};let s=Cu(i.subject,n.env),a=s==null?void 0:Au(t,s),l=i.expect.expect==="absent"?null:i.expect.value;return{env:n.env,unmet:{got:a,kind:"scalar",subject:i.subject,want:l}}},{env:r,unmet:null})}function Fg(e,t,r){return[...e.values()].reduce((n,i)=>n==null?null:Eu(i,t,n),r)}function _g({clause:e,env:t,got:r,snapshot:n,subject:i}){if(jg(i,e,t))return r===void 0?null:new Map([...t,[$e(Vg(e)),r]]);if(!Vr(e,M,t))return null;let o=Ce(e,M,{counts:ge(n),env:t});return Dt({got:r,subject:i,want:{expect:"is",value:o}})?t:null}function jg(e,t,r){return e.kind==="element"&&(e.state==="value"||e.state==="text")&&U(t)&&!Vr(t,M,r)}function Bg({clause:e,env:t,got:r,snapshot:n,subject:i}){if(!Vr(e,M,t))return null;let o=Ce(e,M,{counts:ge(n),env:t});return Dt({got:r,subject:i,want:{expect:"not",value:o}})?t:null}function Vg(e){if(!U(e))throw new Error("expected a ref clause");return e.ref}function Cu(e,t){return e.kind!=="element"?e:Wg(e.locator,t)?{...e,locator:ae(e.locator,Re(t))}:null}function Wg(e,t){return Pc(e).every(r=>Vr(r,M,t))}function Au(e,t){let r=e.scalars.get(v(t));return r==null||r.expect.expect!=="is"?void 0:r.expect.value}function Pu(e){return new Map([...e].flatMap(([t,r])=>Object.entries(r).flatMap(n=>{let i=n[1];return typeof i=="string"||typeof i=="number"||typeof i=="boolean"?[[$e(`${t}.${n[0]}`),i]]:[]})))}function Me(e,t){return[...new Map(e.map(r=>[t(r),r])).values()]}function Mu(e){return[...e.world.flatMap(t=>Ug(t)),...e.steps.flatMap(t=>_s(t)),...Object.values(e.singletons).flatMap(t=>V(t)),...e.absent.flatMap(t=>Object.values(t.where).flatMap(r=>V(r))),...e.actor.kind==="user"?[e.actor.alias]:[]]}function Ug(e){return Object.values(e.set).flatMap(t=>V(t))}function _s(e){return[...zg(e.action),...e.expect.flatMap(t=>ut(t))]}function ut(e){switch(e.kind){case"visible":case"unobstructed":case"disabled":case"enabled":case"focused":case"checked":case"expanded":case"pressed":return we(e.locator);case"value":case"text":{let t=rt(e.value)?e.value.value:e.value;return[...we(e.locator),...V(t)]}case"singleton":return V(e.assertion.value);case"browser":return V(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(kt(e.assertion.props)).flatMap(t=>V(t)),...Object.values(e.key).flatMap(t=>Fs(t))];case"not":return ut(e.predicate);case"when":return e.branches.flatMap(t=>[...t.condition==null?[]:ut(t.condition),...t.consequence.flatMap(r=>ut(r))]);case"and":case"or":return e.predicates.flatMap(t=>ut(t));case"count":case"exists":return Object.values(e.where).flatMap(t=>Fs(t));case"actor":return e.target.kind==="anonymous"?[]:[e.target.ref.ref]}}function Ou(e){return!e.includes(".")}function ar(e){let t=e.indexOf(".");return t===-1?e:e.slice(0,t)}function zg(e){return e.kind==="goto"?V(e.url):e.kind==="actor"?[e.ref.ref]:e.kind==="fill"||e.kind==="select"?[...we(e.locator),...V(e.value)]:e.kind==="press"?e.locator==null?[]:we(e.locator):e.kind==="drag"?[...we(e.source),...we(e.target)]:we(e.locator)}function Fs(e){return pe(e)?Object.values(e.selection.where).flatMap(t=>Fs(t)):ye(e)?(e.kind==="anyOf"?e.values:[e.value]).flatMap(r=>V(r)):V(e)}function ei(e){return e.flatMap(t=>t.kind==="and"?ei(t.predicates):[t])}function Et(e){return ei(e).filter(t=>!Qt(t))}function ti(e){return e.action.kind==="goto"?!0:js(e.expect).some(t=>t.kind==="browser"&&t.name==="url"&&t.value!==null)}function Bt(e){return e.action.kind==="goto"?!0:js(e.expect).some(t=>t.kind==="browser"&&t.name==="url"&&t.value!==null&&(t.part===void 0||t.part.kind==="path"))}function js(e){return e.flatMap(t=>t.kind==="and"?js(t.predicates):[t])}function He(e,t){return t.reduce((r,n)=>{let i=[...Zg(n),...Hr(n),...Jg(n)],o=Gg(n,r,i)?Xg(r):r;return i.reduce((s,a)=>ks(s,a),o)},e)}function he(e){return e.kind==="not"?qg(e.predicate):e.kind==="singleton"?{expect:{expect:"is",value:e.assertion.value},subject:{kind:"variable",name:e.singleton}}:Kg(e)}function Kr(e){return tu(eu(e)).map(({clause:t,key:r})=>({expect:t===null?{expect:"absent"}:{expect:"is",value:t},subject:r}))}function Gg(e,t,r){if(e.action.kind==="goto")return!0;if(!Bt(e))return!1;let n=t.get(v({kind:"path"})),i=r.find(o=>o.subject.kind==="path");return i==null?!1:n==null||S(n.expect)!==S(i.expect)}function qg(e){return e.kind==="value"||e.kind==="text"?rt(e.value)?null:{expect:{expect:"not",value:e.value},subject:{kind:"element",locator:e.locator,state:e.kind}}:Iu(e,!0)}function Iu(e,t){if(e.kind==="value"||e.kind==="text")return rt(e.value)?null:{expect:{expect:"is",value:e.value},subject:{kind:"element",locator:e.locator,state:e.kind}};let r=Hg(e);return r==null?null:{expect:{expect:"is",value:r.value!==t},subject:{kind:"element",locator:r.locator,state:r.state}}}function Kg(e){return e.kind==="browser"?{expect:e.value===null?{expect:"absent"}:{expect:"is",value:e.value},subject:Hn(e.name,e.part)}:e.kind==="actor"?e.target.kind==="anonymous"?{expect:{expect:"absent"},subject:{kind:"actor"}}:{expect:{expect:"is",value:{ref:`${e.target.ref.ref}.id`}},subject:{kind:"actor"}}:Iu(e,!1)}function Hr(e){let t=e.action;return!("locator"in t)||t.locator==null?[]:t.kind==="check"||t.kind==="uncheck"?[{expect:{expect:"is",value:t.kind==="check"},subject:{kind:"element",locator:t.locator,state:"checked"}}]:t.kind==="clear"?[{expect:{expect:"is",value:""},subject:{kind:"element",locator:t.locator,state:"value"}}]:t.kind==="fill"||t.kind==="select"?[{expect:{expect:"is",value:t.value},subject:{kind:"element",locator:t.locator,state:"value"}}]:[]}function Hg(e){return Yg(e)?e.kind==="disabled"?{locator:e.locator,state:"enabled",value:!1}:{locator:e.locator,state:e.kind,value:!0}:null}function Yg(e){return e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="expanded"||e.kind==="pressed"}function Xg(e){return new Map([...e].filter(([,t])=>t.subject.kind==="variable"||t.subject.kind==="viewport"))}function Zg(e){return e.action.kind==="goto"?Kr(e.action.url):[]}function Jg(e){return Et(e.expect).flatMap(t=>{let r=he(t);return r==null?[]:[r]})}function Bs(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var dt={async:12e4,fast:5e3,slow:3e4},Vs={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:dt.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:dt.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:dt.slow}};function Tu(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function Ye(e){return`${e.test}#${String(e.index)}`}function Yr(e){let t=J(e).flatMap(r=>Xr(e,r.test));return Me(t,r=>`${r.test}:${S(r.steps)}`)}function Xr(e,t){let r=Lu(t),n=$u(r,t.singletons,t.actor,t.viewport),i=vS(t,RS(e)),o=tS(e,t),s=Ms(e);return nS(n,xS(t.steps),r).reduce((l,{chunk:c,requiredState:u},d)=>({offset:l.offset+c.length,transitions:[...l.transitions,SS({chunk:c,identities:s,index:d,intent:t.intent,namespace:r.namespace,paramSpaceOf:i,requiredState:u,testRef:ne(t),whenChunk:o.slice(l.offset,l.offset+c.length)})]}),{offset:0,transitions:[]}).transitions}function Qg(e){return[v({kind:"viewport"}),{expect:{expect:"is",value:e},subject:{kind:"viewport"}}]}var eS=v({kind:"viewport"});function Nu(e){let t=e.scalars.get(eS);return t==null||t.expect.expect!=="is"||typeof t.expect.value!="string"?null:t.expect.value}function $u(e,t,r,n){return{absences:hS(e),actor:r,conditions:[],entities:gS(e),exclusives:e.exclusives,scalars:new Map([...Object.entries(t).filter(([,i])=>!U(i)&&!Ge(i)).map(i=>{let[o,s]=i;return[v({kind:"variable",name:o}),{expect:{expect:"is",value:s},subject:{kind:"variable",name:o}}]}),Qg(n)])}}function tS(e,t){let r=e.workflows.find(n=>n.name===t.workflow);return r==null||r.steps.length!==t.steps.length?t.steps:r.steps}function ri(e,t,r){return Object.values(e).flatMap(n=>U(n)?lr(n.ref,r):[]).find(n=>n.entity===t)?.aliasPath}function Zr(e,t){return t.reduce((r,n)=>rS(n)??r,e)}function rS(e){if(e.action.kind==="actor")return{alias:e.action.ref.ref,kind:"user"};let t=e.expect.find(r=>r.kind==="actor");return t==null?null:t.target.kind==="anonymous"?Cc:{alias:t.target.ref.ref,kind:"user"}}function nS(e,t,r){return t.reduce((n,i)=>({requiredState:iS(n.requiredState,i,r),withRequiredState:[...n.withRequiredState,{chunk:i,requiredState:fS(n.requiredState,i)}]}),{requiredState:e,withRequiredState:[]}).withRequiredState}function iS(e,t,r){let n=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>oS(i,o,r),e);return{...n,actor:Zr(n.actor,t),scalars:He(n.scalars,t)}}function oS(e,t,r){return t.assertion.kind==="deleted"?sS(e,t,r):t.assertion.kind==="created"?cS(e,t.entity,t.assertion.as,t.assertion.props,r):dS(e,t,r)}function sS(e,t,r){let n=ri(t.key,t.entity,r.namespace),i=e.entities.find(a=>a.alias===n),o=Jr(aS(t.key),r),s=i==null?{entity:t.entity,params:{},...o}:{entity:i.entity,params:{},...lS(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==n)}}function aS(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let r=t[1];return pe(r)||ye(r)?[]:[[t[0],r]]}))}function lS(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(r=>!t.relations.some(n=>n.field===r.field)),...t.relations]}}function cS(e,t,r,n,i){let o=Jr(n,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!uS(o,s)),entities:[...e.entities,{alias:r,entity:t,...o}]}}function uS(e,t){return Object.entries(t.literals).every(([n,i])=>e.literals[n]===i)&&t.relations.every(n=>e.relations.some(i=>i.field===n.field&&i.targetAlias===n.targetAlias&&i.targetField===n.targetField))}function dS(e,t,r){if(t.assertion.kind!=="updated")return e;let n=ri(t.key,t.entity,r.namespace);if(n==null)return e;let i=Jr(kt(t.assertion.props),r),o=Object.entries(t.assertion.props).filter(([,a])=>xt(a)).map(([a])=>a),s=a=>a.alias===n?pS(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a))}}function pS(e,t,r){let n=Object.entries(e.literals).filter(([i])=>!r.includes(i)&&!(i in t.literals));return{...e,literals:{...Object.fromEntries(n),...t.literals},relations:[...e.relations.filter(i=>!t.relations.some(o=>o.field===i.field)),...t.relations]}}function fS(e,t){return t[0]?.action.kind!=="goto"?e:{...e,scalars:new Map([...e.scalars].filter(([,r])=>r.subject.kind==="variable"||r.subject.kind==="viewport"))}}function ni(e,t){let r=Lu(t);return{namespace:r.namespace,requiredState:$u(r,t.singletons,t.actor,t.viewport)}}function Ws(e,t){return[...new Set(e)].flatMap(r=>lr(r,t))}function Lu(e){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map(e.world.map(t=>[t.as,t.entity])),setups:e.world}}function hS(e){return e.absences.map(t=>({entity:t.entity,...Jr(t.where,e),params:mS(t.where,e)}))}function Jr(e,t){let r=Object.entries(e),n=Object.fromEntries(r.flatMap(([o,s])=>U(s)||Ge(s)?[]:[[o,s]])),i=r.flatMap(o=>{let s=o[1];if(!U(s))return[];let a=lr(s.ref,t.namespace).at(0);return a==null?[]:[{entity:a.entity,field:o[0],targetAlias:a.aliasPath,targetField:a.field}]});return{literals:n,relations:i}}function mS(e,t){return Object.fromEntries(Object.entries(e).flatMap(r=>{let n=r[1];return!U(n)||lr(n.ref,t.namespace).at(0)!=null?[]:[[r[0],n.ref]]}))}function yS(e,t){return e.map(r=>({alias:r.as,entity:r.entity,...Jr(r.set,t)}))}function gS(e){return yS(e.setups,e)}function lr(e,t){let r=Kc(e);if(r==null)return[];let n=t.get(r.alias);return n==null?[]:[{aliasPath:r.alias,entity:n,field:r.field,ref:e}]}function SS(e){let t=e.chunk.findIndex(s=>s.action.kind!=="goto"),r=t===-1?e.chunk:e.chunk.slice(0,t),n=e.chunk.slice(r.length),i=n.at(-1)??e.chunk.at(-1);if(i==null)throw new Error("empty transition chunk");let o=[...new Set(e.chunk.flatMap(s=>_s(s)))];return{effectStep:i,identities:e.identities,index:e.index,intent:e.intent,namespace:e.namespace,nav:r,paramSpaces:Object.fromEntries(o.filter(s=>e.paramSpaceOf.has(s)).map(s=>[s,e.paramSpaceOf.get(s)])),requiredState:e.requiredState,steps:n,test:e.testRef,wait:Bs(e.chunk.flatMap(s=>[...bS(s),...wS(s)])),whenSteps:e.whenChunk}}function bS(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function wS(e){return ti(e)?["slow"]:[]}function RS(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function vS(e,t){return new Map(Object.entries(e.params).map(([r,n])=>[r,t.get(n.valueSpace)]))}function xS(e){return e.map(t=>[t])}function Du(e,t){let r=it({conditions:e.when,...kS(e,t)});return e.expect.map(n=>({consequence:n,localConsequence:!1,origin:{kind:"declared",name:e.name},refs:new Set,when:r}))}var Us="@actor";function kS(e,t){if(!e.when.some(o=>zs(o).some(s=>s.startsWith(`${Us}.`))))return{};let n=t.entities.filter(o=>o.principal),i=n[0];if(i==null||n.length>1)throw new Error(`the declared fact "${e.name}" uses actor.id, which needs exactly one principal entity`);return{actor:{alias:Us,kind:"user"},entities:[{alias:Us,entity:i.name,literals:{},relations:[]}]}}function zs(e){return e.kind==="not"?zs(e.predicate):e.kind==="and"||e.kind==="or"?e.predicates.flatMap(t=>zs(t)):e.kind==="singleton"?V(e.assertion.value):Object.values(e.where).flatMap(t=>Fu(t))}function Fu(e){return pe(e)?Object.values(e.selection.where).flatMap(t=>Fu(t)):ye(e)?ES(e):V(e)}function ES(e){switch(e.kind){case"not":case"compare":return V(e.value);case"anyOf":return e.values.flatMap(t=>V(t));case"contains":case"startsWith":return V(e.value)}}function Xe(e){return e.surfaces.filter(t=>t.by==="surface"&&t.overlay)}function ii(e,t){return{...e,scalars:oi(e.scalars,t)}}function oi(e,t){return Bu(e,t,r=>({expect:{expect:"is",value:!1},subject:{kind:"element",locator:r,state:"visible"}}))}function ju(e,t){let r=Bu(e.scalars,t,n=>({declared:!1,expect:{expect:"is",value:!1},subject:{kind:"element",locator:ae(n,Re(new Map)),state:"visible"}}));return{...e,scalars:r}}function Bu(e,t,r){let n=t.filter(i=>!e.has(_u(i))).map(i=>[_u(i),r(i)]);return n.length===0?e:new Map([...e,...n])}function _u(e){return v({kind:"element",locator:e,state:"visible"})}var Vu=new WeakMap;function pt(e){let t=Vu.get(e);if(t!=null)return t;let r=CS("sha256").update(S({consequence:e.consequence,when:ke(e.when)})).digest("base64");return Vu.set(e,r),r}function ai(e){let t=e.facts.flatMap(o=>Du(o,e)),r=new Set(Xe(e).map(o=>S(de(o)))),n=J(e).map(o=>qs(e,o)),i=Me(n.flatMap(o=>o.steps.flatMap(s=>s.facts)),pt).filter(o=>!AS(o.consequence,r));return Promise.resolve([...t,...i])}function Gs(e,t){return e.filter(r=>!IS(r)||TS(r)===t)}function li(e){return e.kind==="not"?li(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="expanded"||e.kind==="pressed"||e.kind==="value"||e.kind==="text"}function AS(e,t){if(e.kind!=="visible")return!1;let r=de(e.locator);return t.has(S(r))?!0:r.by==="inside"&&t.has(S(de(r.scope)))}function ci(e,t){if(e.facts.length===0)return t;let r=Qr(e,t);return r.size===0?t:{...t,scalars:Ae(r,t.scalars)}}function Qr(e,t){let r=ju(t,e.overlays),n=e.facts.flatMap(s=>{let a=Pe(s.when,r);if(a==null)return[];let l=PS(s.consequence,a,r);return l==null?[]:[{entry:l,factKey:pt(s),key:v(l.subject)}]}),i=n.filter(s=>!OS({m:s,matched:n,overrides:e.overrides})),o=MS(i);return i.reduce((s,a)=>o.has(a.key)?s:at(s,a.entry),Le)}function PS(e,t,r){let n=he(e);if(n==null)return null;try{return lt({declared:!0,entry:n,scope:{counts:ge(r),env:t}})}catch{return null}}function MS(e){let t=e.reduce((r,n)=>new Map([...r,[n.key,[...r.get(n.key)??[],S(n.entry.expect)]]]),new Map);return new Set([...t].flatMap(([r,n])=>new Set(n).size>1?[r]:[]))}function OS({m:e,matched:t,overrides:r}){let n=r.get(e.factKey);return n==null?!1:t.some(i=>i.key===e.key&&n.has(i.factKey))}function IS(e){return e.origin?.kind==="test"&&e.localConsequence}function TS(e){let{origin:t}=e;if(!(t==null||t.kind!=="test"))return t.test}var Wu=new WeakMap;function qs(e,t){let r=Wu.get(t);if(r!=null)return r;let n=NS(e,t);return Wu.set(t,n),n}function NS(e,{test:t,workflow:r}){let n=ni(e,t),i=Xe(e),o=$S(r.steps),s=t.steps.reduce((a,l)=>{let c=DS(a.requiredState,l,n,i),u=GS({branchConditions:o,namespace:n.namespace,origin:{kind:"test",test:ne(t)},paramNames:new Set(Object.keys(t.params)),post:c,pre:a.requiredState,step:l});return{requiredState:c,steps:[...a.steps,{facts:u,post:c}]}},{requiredState:ii(n.requiredState,i),steps:[]});return{initial:ii(n.requiredState,i),steps:s.steps}}function $S(e){return e.flatMap(r=>r.expect).flatMap(r=>si(r)).reduce((r,n)=>{let i=S(n.consequence),o=r.get(i),s=o==null?n.condition:{kind:"or",predicates:[o,n.condition]};return new Map([...r,[i,s]])},new Map)}function si(e){return e.kind==="not"?si(e.predicate):e.kind==="and"||e.kind==="or"?e.predicates.flatMap(t=>si(t)):e.kind!=="when"?[]:e.branches.flatMap((t,r)=>{let n=LS(e.branches,r);return t.consequence.flatMap(i=>[{condition:n,consequence:i},...si(i)])})}function LS(e,t){let r=e.slice(0,t).flatMap(o=>o.condition==null?[]:[o.condition]).map(o=>({kind:"not",predicate:o})),n=e[t]?.condition,i=n==null?r:[...r,n];return i.length===1&&i[0]!=null?i[0]:{kind:"and",predicates:i}}function DS(e,t,r,n){let{entities:i}=FS(e,t,r),o=He(e.scalars,[t]),s=Zr(e.actor,[t]);return ii({...e,actor:s,entities:i,scalars:o},n)}function FS(e,t,r){return t.expect.reduce((n,i)=>i.kind==="state"?_S(n,i,r):n,e)}function _S(e,t,r){if(t.assertion.kind==="created"){let o=jS(t.assertion.as,t.entity,t.assertion.props,r);return{...e,entities:[...e.entities,o]}}let n=ri(t.key,t.entity,r.namespace);if(n==null)return e;if(t.assertion.kind==="deleted")return WS(e,n);let i=kt(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===n?Gu(o,i,r):o)}}function jS(e,t,r,n){return Gu({alias:e,entity:t,literals:{},relations:[]},r,n)}function Gu(e,t,r){return Object.entries(t).reduce((n,[i,o])=>{if(Ge(o))return n;if(U(o)){let s=BS(o.ref,i,r.namespace);return{...n,literals:VS(n.literals,i),relations:s==null?n.relations:[...Uu(n.relations,i),s]}}return{...n,literals:{...n.literals,[i]:o},relations:Uu(n.relations,i)}},e)}function BS(e,t,r){let[n]=lr(e,r);return n==null?void 0:{entity:n.entity,field:t,targetAlias:n.aliasPath,targetField:n.field}}function VS(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>r!==t))}function Uu(e,t){return e.filter(r=>r.field!==t)}function WS(e,t){let r=e.entities.find(i=>i.alias===t),n=US(e,t);return r==null?n:{...n,absences:[...n.absences,{entity:r.entity,literals:r.literals,params:{},relations:r.relations}]}}function US(e,t){return{...e,entities:e.entities.filter(r=>r.alias!==t)}}var zS=16;function GS(e){return Et(e.step.expect).filter(t=>li(t)).flatMap(t=>qS(t,e))}function qS(e,t){let r=he(e);if(r==null)return[];if(ut(e).some(a=>t.paramNames.has(a)))return[];let n=v(r.subject),i=t.branchConditions.get(S(e)),o={...t.post,conditions:i==null?t.post.conditions:[...t.post.conditions,i],scalars:new Map([...t.post.scalars].filter(([a])=>a!==n))},s=KS(o,t.pre,t.paramNames);return s==null||s.entities.length>zS?[]:ke(s)===ke(t.pre)?[]:[{consequence:e,localConsequence:Ws(ut(e),t.namespace).length>0,origin:t.origin,refs:new Set(Ws([...YS(s),...ut(e)],t.namespace).map(a=>a.aliasPath)),when:s}]}function KS(e,t,r){let n=[...e.scalars.values()].map(i=>HS(i,t,r));return n.some(i=>i==null)?null:{...e,scalars:new Map(n.flatMap(i=>i==null?[]:[[v(i.subject),i]]))}}function HS(e,t,r){if(!zu(e,r))return e;if(e.subject.kind!=="element"||e.expect.expect==="absent"||we(e.subject.locator).some(i=>r.has(i)))return null;let n=t.scalars.get(v(e.subject));return n==null||n.expect.expect!=="is"||zu(n,r)?null:{expect:{expect:"not",value:n.expect.value},subject:e.subject}}function zu(e,t){let r=e.expect.expect==="absent"?[]:V(e.expect.value);return[...e.subject.kind==="element"?we(e.subject.locator):[],...r].some(i=>t.has(i))}function YS(e){return[...e.scalars.values()].flatMap(t=>wt(t.subject)&&t.expect.expect!=="absent"?V(t.expect.value):[])}import*as nd from"remeda";function qu(e){return`\xA4param:${e}`}function Ku(e,t){return`\xA4${e}.${t}`}var Hu=new WeakMap;function Ks(e){let t=Hu.get(e);if(t!==void 0)return t;let r=XS(e);return Hu.set(e,r),r}function XS(e){let t=ob(e);return t==null?null:{absenceKeys:new Set(e.absences.map(r=>S(r))),conditionKeys:new Set(e.conditions.map(r=>S(r))),pinned:eb(e),snapshot:t,specific:e}}var Yu=new WeakMap,Xu=new WeakMap;function Hs(e,t){if(t==null)return null;let r=Xu.get(e)??new Map;Xu.set(e,r);let n=ke(t.specific),i=r.get(n);if(i!==void 0)return i;let o=ZS(e,t);return r.set(n,o),o}function ui(e,t){return Hs(e,Ks(t))}function ZS(e,t){let{absenceKeys:r,conditionKeys:n,pinned:i,snapshot:o,specific:s}=t,a=JS(e);if(!a.conditionKeys.every(p=>n.has(p))||!a.scalarEntries.every(([p])=>s.scalars.has(p)))return!1;let l=a.absenceEntries.filter(p=>!r.has(p.key)).map(p=>p.absence);if(l.some(p=>!s.exclusives.includes(p.entity))||!e.exclusives.every(p=>s.exclusives.includes(p)))return!1;let c=a.scalarEntries.map(([p,m])=>QS({entry:m,generalEntityOf:a.entityOf,host:s.scalars.get(p),key:p,pinned:i}));if(c.includes("false"))return!1;if(c.includes("defer"))return null;let u=new Map(c.flatMap(p=>typeof p=="string"?[]:[p])),d=it({absences:l,actor:e.actor,entities:e.entities,exclusives:e.exclusives,scalars:u});return Pe(d,o)!=null}function JS(e){let t=Yu.get(e);if(t!=null)return t;let r={absenceEntries:e.absences.map(n=>({absence:n,key:S(n)})),conditionKeys:e.conditions.map(n=>S(n)),entityOf:new Map(e.entities.map(n=>[n.alias,n.entity])),scalarEntries:[...e.scalars]};return Yu.set(e,r),r}function QS({entry:e,generalEntityOf:t,host:r,key:n,pinned:i}){if(r==null)return"false";let o=S(r.expect)===S(e.expect);return o&&rb(e.expect)?"skip":r.expect.expect!=="is"?tb({entry:e,host:r,identical:o}):e.expect.expect==="absent"?"false":nb({entry:e,generalEntityOf:t,key:n,pinned:i,want:e.expect,wantOfHost:r.expect})}function eb(e){let t=new Map(e.entities.map(o=>[o.alias,o.entity])),n=[...[...e.scalars.values()].flatMap(o=>[...o.expect.expect==="absent"?[]:V(o.expect.value),...o.subject.kind==="element"?we(o.subject.locator):[]]).filter(o=>o.includes(".")),...e.entities.flatMap(o=>[...Object.keys(o.literals).map(s=>`${o.alias}.${s}`),...o.relations.flatMap(s=>[`${o.alias}.${s.field}`,`${s.targetAlias}.${s.targetField}`])])],i=n.flatMap(o=>{let s=o.indexOf("."),a=t.get(o.slice(0,s));return a==null?[]:[`${a}.${o.slice(s+1)}`]});return{byAlias:new Set(n),byEntity:new Set(i)}}function tb({entry:e,host:t,identical:r}){return r||t.expect.expect==="absent"&&e.expect.expect==="not"?"defer":"false"}function rb(e){return e.expect==="absent"?!0:V(e.value).every(t=>!t.includes("."))}function nb({entry:e,generalEntityOf:t,key:r,pinned:n,want:i,wantOfHost:o}){if(Zu(i.value)||Zu(o.value))return"defer";if(i.expect==="not")return V(i.value).length===0&&V(o.value).length===0?[r,e]:"defer";let s=new Set(V(i.value).filter(a=>a.includes(".")).map(a=>ib({generalEntityOf:t,pinned:n,ref:a})));return s.has("false")?"false":s.has("defer")?"defer":[r,{expect:ed(i),subject:rd(e.subject)}]}function ib({generalEntityOf:e,pinned:t,ref:r}){if(t.byAlias.has(r))return"ok";let n=r.indexOf("."),i=e.get(r.slice(0,n));return i==null||t.byEntity.has(`${i}.${r.slice(n+1)}`)?"defer":"false"}function Zu(e){return e!==null&&typeof e=="object"&&"template"in e&&e.template.some(t=>typeof t!="string"&&"count"in t)}var Ju=new WeakMap;function ob(e){let t=Ju.get(e);if(t!==void 0)return t;let r=sb(e);return Ju.set(e,r),r}function sb(e){let t=ab(e),r=Pe(it({absences:e.absences,conditions:e.conditions,entities:e.entities,exclusives:e.exclusives}),t);if(r==null)return null;let n=cb(e,r,t);return n==null?null:{...t,scalars:lb(n,e)}}function ab(e){let t=new Map(e.entities.map(s=>[s.alias,s])),r=[...e.scalars.values()].flatMap(s=>[...s.expect.expect==="absent"?[]:V(s.expect.value),...s.subject.kind==="element"?we(s.subject.locator):[]]),n=[...e.entities.flatMap(s=>s.relations.map(a=>[a.targetAlias,a.targetField])),...r.flatMap(s=>{let a=s.indexOf(".");return a===-1?[]:[[s.slice(0,a),s.slice(a+1)]]})];return{entities:e.entities.map(s=>[s.entity,s.alias,{...Object.fromEntries(n.filter(([a])=>a===s.alias).map(([a,l])=>[l,Qu(t,a,l)])),...s.literals,...Object.fromEntries(s.relations.map(a=>[a.field,Qu(t,a.targetAlias,a.targetField)]))}]).reduce((s,[a,l,c])=>{let u=new Map([...s.get(a)??[],[l,c]]);return new Map([...s,[a,u]])},new Map),scalars:Le}}function Qu(e,t,r){let i=e.get(t)?.literals[r];return i!==void 0?i:Ku(t,r)}function lb(e,t){return t.actor.kind!=="user"?e:new Map([...e,[v({kind:"actor"}),{declared:!1,expect:{expect:"is",value:t.actor.alias},subject:{kind:"actor"}}]])}function cb(e,t,r){let n=[...e.scalars.values()].filter(i=>i.expect.expect==="is").map(i=>{try{return lt({declared:!0,entry:{expect:ed(i.expect),subject:rd(i.subject)},scope:{counts:ge(r),env:t}})}catch{return null}});return n.some(i=>i==null)?null:new Map(n.flatMap(i=>i==null?[]:[[v(i.subject),i]]))}function ed(e){return e.expect==="absent"?e:{...e,value:ub(e.value)}}function ub(e){return Mc(e,td)}function td(e){return Ou(e.ref)?qu(e.ref):e}function rd(e){return e.kind!=="element"?e:{...e,locator:db(e.locator)}}function db(e){return Ac(e,pb)}function pb(e){return Oc(e,td)}var id=new Map;async function di({context:e,facts:t}){let r=nd.groupBy(t.filter(o=>he(o.consequence)!=null),o=>fb(o)),i=Object.values(r).flatMap(o=>o.flatMap(s=>o.filter(a=>a!==s).map(a=>({general:s,specific:a}))));return i.filter(({general:o,specific:s})=>ui(o.when,s.when)!==!1).forEach(({general:o,specific:s})=>{ot({context:e,general:o.when,specific:s.when}).catch(()=>{})}),i.reduce(async(o,{general:s,specific:a})=>{let l=await o;if(!(ui(s.when,a.when)!==!1&&await ot({context:e,general:s.when,specific:a.when}))||ui(a.when,s.when)!==!1&&await ot({context:e,general:a.when,specific:s.when}))return l;let d=pt(s),p=l.get(d)??new Set;return new Map([...l,[d,new Set([...p,pt(a)])]])},Promise.resolve(id))}function od(e){let t=he(e.consequence);if(t==null)return null;try{let r=lt({declared:!0,entry:t,scope:Re(new Map)});return v(r.subject)}catch{return null}}function fb(e){let t=he(e.consequence);if(t==null)throw new Error("fact consequence has no pattern entry");return v(t.subject)}function pi(e){return Me(J(e).flatMap(t=>hb(e,t.test)),Ys)}function Ys(e){return S({holds:ke(e.holds),reference:e.reference,when:ke(e.when)})}function fi(e,t){return Pe(e.when,t)==null?!1:Pe(e.holds,t)==null}function hb(e,t){let r=ni(e,t);return r.requiredState.entities.flatMap(n=>n.relations.flatMap(i=>mb(e,n,i,r.namespace)?Sb(n,i,r.namespace):[]))}function mb(e,t,r,n){let i=n.get(r.targetAlias);return i!=null&&!yb(e,t.entity,r.field)&&gb(e,i,r.targetField)}function yb(e,t,r){return e.entities.find(n=>n.name===t)?.props[r]?.optional===!0}function gb(e,t,r){return e.entities.find(n=>n.name===t)?.identity.includes(r)===!0}function Sb(e,t,r){let n=r.get(t.targetAlias);if(n==null)return[];let i=sd(e.alias,e.entity),o=sd(t.targetAlias,n);return[{holds:it({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:n,targetField:t.targetField},when:it({entities:[i]})}]}function sd(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function ad(e){let t;return r=>{if(t!==void 0&&t.input===r)return t.output;let n=e(r);return t={input:r,output:n},n}}var hi=ad(async e=>{let t=tr(e),r=await ai(e);return{dataRules:pi(e),facts:r,overrides:await di({context:t,facts:r})}});import*as Xs from"remeda";function Ct(e){return[...new Set(e.producers.map(t=>t.test))]}function en(e){return e.origin==null||e.origin.kind==="declared"?[]:e.origin.kind==="generalized"?e.origin.producers:[{test:e.origin.test,when:e.when}]}async function ld(e,t){let{context:r,pool:n,timelines:i}=wb(e,t),o=bb(r),s=n.map(l=>Nu(l.fact.when)),a=await Promise.all([...i.values()].map(l=>{let c=l.locked.test.viewport,u=n.filter((d,p)=>s[p]==null||s[p]===c);return Rb({entry:l,pool:u,resolve:o})}));return{pool:n,reports:a}}function cd(e,t){return{...pd(e.consequence),declared:e.origin?.kind==="test",key:pt(e),label:Un(e.consequence),labelTokens:Nc(e.consequence),origins:t}}function bb(e){return(t,r)=>ot({context:e,general:t,specific:r})}function wb(e,t){let r=J(e),n=new Map(r.map(a=>[a.ref,{locked:a,timeline:qs(e,a)}])),i=Eb(n),o=kb(n),s=Cb({facts:t,originSites:i,witnessSites:o});return{context:tr(e),pool:s,timelines:n}}async function Rb(e){let{entry:t,pool:r,resolve:n}=e,{locked:i}=t,o=new Set(t.timeline.steps.flatMap(c=>c.facts.map(u=>S(u.consequence)))),s=r.filter(c=>!c.originWorkflows.has(i.test.workflow)).filter(c=>!o.has(c.consequenceKey)),a=await xb({candidates:s,resolve:n,timeline:t.timeline});return{steps:t.timeline.steps.map((c,u)=>({borrowed:a.filter(d=>d.stepIndex===u).map(d=>d.borrowed),stepIndex:u})),testRef:i.ref,testSlug:i.test.slug,workflowSlug:i.test.workflow}}function vb(e,t){return e.map(r=>({candidate:r,holds:Hs(r.fact.when,t)}))}async function xb({candidates:e,resolve:t,timeline:r}){let i=await[r.initial,...r.steps.map(o=>o.post)].reduce(async(o,s,a)=>{let l=await o,c=e.filter(f=>!l.has(f)),u=vb(c,Ks(s)),d=await Promise.all(u.filter(f=>f.holds==null).map(async f=>({candidate:f.candidate,holds:await t(f.candidate.fact.when,s)}))),p=new Set(d.filter(f=>f.holds).map(f=>f.candidate)),m=u.filter(f=>f.holds===!0||p.has(f.candidate)).map(f=>f.candidate),y=a===0?0:a-1;return new Map([...l,...m.map(f=>[f,y])])},Promise.resolve(new Map));return r.steps.length===0?[]:[...i].map(([o,s])=>({borrowed:o.borrowed,stepIndex:s}))}function ud(e,t){return`${e}#${S(t)}`}function kb(e){let t=[...e.values()].flatMap(r=>r.timeline.steps.flatMap((n,i)=>n.facts.map(o=>[ud(r.locked.ref,o.consequence),dd(r.locked,i)])));return new Map(Object.entries(Xs.groupBy(t,([r])=>r)).map(([r,n])=>{let[,i]=n[0];return[r,i]}))}function dd(e,t){return{stepIndex:t,testRef:e.ref,testSlug:e.test.slug,workflowIntent:e.workflow.intent,workflowSlug:e.test.workflow}}function Eb(e){let t=[...e.values()].flatMap(r=>r.timeline.steps.flatMap((n,i)=>n.facts.map(o=>[pt(o),dd(r.locked,i)])));return new Map(Object.entries(Xs.groupBy(t,([r])=>r)).map(([r,n])=>[r,n.map(([,i])=>i)]))}function Cb({facts:e,originSites:t,witnessSites:r}){return e.filter(n=>!(n.origin?.kind==="test"&&n.localConsequence)).map(n=>{let i=pt(n),s=n.origin?.kind==="test"?t.get(i)??[]:Ab(n,r);return{borrowed:cd(n,s),consequenceKey:S(n.consequence),fact:n,originWorkflows:new Set(s.map(a=>a.workflowSlug))}}).filter(n=>n.borrowed.origins.length>0)}function pd(e){if(e.kind==="not"){let t=pd(e.predicate);return{...t,negated:!t.negated}}return"locator"in e?{checkKind:e.kind,negated:!1,subject:xc(ae(e.locator,Re(new Map)))}:{checkKind:void 0,negated:!1,subject:void 0}}function Ab(e,t){return e.origin?.kind!=="generalized"?[]:Ct(e.origin).map(r=>{let n=t.get(ud(r,e.consequence));if(n==null)throw new Error(`missing witness site for ${r} in generalized fact origin`);return n})}function fd(e){let t=Me(e,ke),r=Me(t.flatMap(c=>[...c.scalars.values()]),S),n=Me(t.flatMap(c=>c.entities),S),i=Me(t.flatMap(c=>c.absences),S),o=mi(r,S),s=mi(n,S),a=mi(i,S),l=mi(t,ke);return{absenceTable:i.map(c=>({...c,relations:[...c.relations]})),constraintTable:n.map(c=>({...c,relations:[...c.relations]})),patternTable:t.map(c=>({absences:c.absences.map(u=>yi(a,S(u))),actor:c.actor,conditions:[...c.conditions],entities:c.entities.map(u=>yi(s,S(u))),exclusives:[...c.exclusives],scalars:[...c.scalars.values()].map(u=>yi(o,S(u)))})),scalarTable:r.map(c=>({expect:c.expect,subject:c.subject})),indexOf:c=>yi(l,ke(c))}}function hd(e){return e.patternTable.map(t=>({absences:t.absences.map(r=>At(e.absenceTable,r)),actor:t.actor,conditions:t.conditions,entities:t.entities.map(r=>At(e.constraintTable,r)),exclusives:t.exclusives,scalars:new Map(t.scalars.map(r=>{let n=At(e.scalarTable,r);return[v(n.subject),n]}))}))}function At(e,t){let r=e[t];if(r==null)throw new Error("compiled checks table index out of range \u2014 recompile");return r}function mi(e,t){return new Map(e.map((r,n)=>[t(r),n]))}function yi(e,t){let r=e.get(t);if(r==null)throw new Error("compiled checks pattern missing from table");return r}async function yd(e){let t=await hi(e),{pool:r,reports:n}=await ld(e,t.facts),i=fd([...t.facts.flatMap(a=>Tb(a)),...t.dataRules.flatMap(a=>[a.when,a.holds])]),o=new Map(t.facts.map((a,l)=>[a,l])),s=new Map(r.map((a,l)=>[a.borrowed,l]));return{absenceTable:i.absenceTable,constraintTable:i.constraintTable,dataRules:t.dataRules.map(a=>({holds:i.indexOf(a.holds),reference:a.reference,when:i.indexOf(a.when)})),factPool:r.map(a=>({fact:gd(o,a.fact),origins:a.borrowed.origins.map(l=>({...l}))})),factReports:n.map(a=>Db(a,s)),facts:t.facts.map(a=>Nb(a,i)),overrides:Lb(t.overrides),patternTable:i.patternTable,scalarTable:i.scalarTable}}var md=new WeakMap;function cr(e){let t=md.get(e);if(t!=null)return t;let r=Pb(e),n=hd(r),i={dataRules:r.dataRules.map(o=>({holds:At(n,o.holds),reference:o.reference,when:At(n,o.when)})),facts:r.facts.map(o=>Mb(o,n)),overrides:Ib(r.overrides)};return md.set(e,i),i}function Pb(e){return e.checks}function gd(e,t){let r=e.get(t);if(r==null)throw new Error("compiled checks item missing from index");return r}function Mb(e,t){return{consequence:e.consequence,localConsequence:e.localConsequence,origin:Ob(e.origin,t),refs:new Set(e.refs),when:At(t,e.when)}}function Ob(e,t){return e==null||e.kind!=="generalized"?e:{kind:"generalized",producers:e.producers.map(r=>({test:r.test,when:At(t,r.when)}))}}function Ib(e){return new Map(Object.entries(e).map(([t,r])=>[t,new Set(r)]))}function Tb(e){let t=e.origin?.kind==="generalized"?e.origin.producers.map(r=>r.when):[];return[e.when,...t]}function Nb(e,t){return{consequence:e.consequence,localConsequence:e.localConsequence,origin:$b(e.origin,t),refs:[...e.refs],when:t.indexOf(e.when)}}function $b(e,t){return e==null||e.kind!=="generalized"?e:{kind:"generalized",producers:e.producers.map(r=>({test:r.test,when:t.indexOf(r.when)}))}}function Lb(e){return Object.fromEntries([...e].map(([t,r])=>[t,[...r].toSorted((n,i)=>n.localeCompare(i))]).toSorted(([t],[r])=>t.localeCompare(r)))}function Db(e,t){return{steps:e.steps.map(r=>({borrowed:r.borrowed.map(n=>gd(t,n)),stepIndex:r.stepIndex})),testRef:e.testRef,testSlug:e.testSlug,workflowSlug:e.workflowSlug}}function bd(e){let t=new Map;return e.forEach(r=>{Fb(r).forEach(n=>{tn(n,t)})}),t}function Js(e,t){let r=_b(e.consequence,t);if(r.length===0)return e.when;let n=new Map(e.when.scalars);return r.forEach(i=>n.set(v(i.subject),i)),{...e.when,scalars:n}}function Fb(e){let t=[...e.when.scalars.values()].flatMap(n=>n.subject.kind==="element"?[n.subject.locator]:[]),r=wd(e.consequence);return r==null?t:[...t,r]}function wd(e){return e.kind==="not"?wd(e.predicate):"locator"in e?e.locator:void 0}function tn(e,t){if(e.by==="inside"){let r=Rd(Zs(e.scope));t.set(r,[...t.get(r)??[],e]),tn(e.scope,t),tn(e.target,t);return}if(e.by==="surface"){tn(e.container,t);return}e.by==="frame"&&tn(e.element,t)}function Rd(e){return jn(e,"visible")}function Zs(e){return e.by==="frame"?e.element:e}function _b(e,t){let r=jb(e);if(r!=null)return(t.get(Rd(Zs(r)))??[]).map(i=>Sd(i,!1));let n=Bb(e);return n==null?[]:[Sd(Zs(n),!0)]}function jb(e){return e.kind!=="not"||e.predicate.kind!=="visible"?null:e.predicate.locator}function Sd(e,t){return{expect:{expect:"is",value:t},subject:{kind:"element",locator:e,state:"visible"}}}function Bb(e){return e.kind!=="visible"||e.locator.by!=="inside"?null:e.locator.scope}async function kd({context:e,facts:t}){let n=[...t.reduce((s,a)=>{let l=he(a.consequence);if(l==null)return s;let c=v(l.subject);return new Map([...s,[c,[...s.get(c)??[],a]]])},new Map).values()].flatMap(s=>s.flatMap((a,l)=>s.slice(l+1).filter(c=>Ed(a.consequence,c.consequence)).map(c=>[a,c]))),i=bd(t),o=await Promise.all(n.map(async([s,a])=>{let l=await ot({context:e,general:s.when,specific:a.when}),c=await ot({context:e,general:a.when,specific:s.when});return l!==c?null:l||await _c({aligned:!0,context:e,patterns:[Js(s,i),Js(a,i)]})?Ub(s,a):null}));return zb(o.filter(s=>s!=null))}function Ed(e,t){let r=he(e),n=he(t);return r==null||n==null||v(r.subject)!==v(n.subject)?!1:Vb(r,n)}function Vb(e,t){return Wb(e)?xd(e,t):e.expect.expect==="is"&&t.expect.expect==="is"?S(e.expect.value)!==S(t.expect.value):xd(e,t)}function Wb(e){return e.subject.kind==="element"&&e.subject.state==="text"}function Ub(e,t){let r=en(e),n=en(t);return{a:e.consequence,aProducers:r,b:t.consequence,bProducers:n,tests:[...new Set([...vd(e),...vd(t)])],when:e.when}}function vd(e){return e.origin==null?[]:e.origin.kind==="declared"?[]:e.origin.kind==="test"?[e.origin.test]:Ct(e.origin)}function zb(e){return[...e.reduce((r,n)=>{let i=[S(n.a),S(n.b)].toSorted((a,l)=>a.localeCompare(l)).join("|"),o=r.get(i),s=o==null?n:{...o,tests:[...new Set([...o.tests,...n.tests])]};return new Map([...r,[i,s]])},new Map).values()]}function xd(e,t){let r=[e.expect,t.expect],n=r.find(o=>o.expect==="is"),i=r.find(o=>o.expect==="not");return n==null||i==null?!1:S(n.value)===S(i.value)}function Cd(e,t){return e.flatMap(r=>{let n=Gb(r),i=new Set(r.requiredState.absences.map(o=>o.entity));return t.flatMap(o=>qb(r,o,n,i))})}function Gb(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(r=>r.kind==="state"&&r.assertion.kind==="deleted"?[r.entity]:[])))}function qb(e,t,r,n){let{source:i,target:o}=t.reference;return!r.has(o)||r.has(i)||n.has(i)?[]:[{dataRule:t,source:i,target:o,transition:Ye(e)}]}var I=wc(Md(),1),ce={actual:e=>I.default.red(e),bad:e=>I.default.red(I.default.bold(e)),bold:e=>I.default.bold(e),dim:e=>I.default.dim(e),expected:e=>I.default.green(e),good:e=>I.default.green(I.default.bold(e)),heading:e=>I.default.bold(I.default.cyan(e)),path:e=>I.default.cyan(I.default.underline(e)),warn:e=>I.default.yellow(I.default.bold(e))},Xb={assertion:I.default.yellow,consistency:I.default.magenta,"data rule":I.default.yellow,driver:I.default.red,fact:I.default.yellow,"impossible action":I.default.cyan,"model drift":I.default.red,precondition:I.default.yellow,reachability:I.default.yellow,redundancy:I.default.yellow,skipped:I.default.red,surface:I.default.yellow};function oe(e){return`${I.default.red(I.default.bold("\u2717"))} ${Xb[e](I.default.bold(e))}`}var Zb=I.default.red("\u2717"),AN=I.default.green("\u2713"),Jb=I.default.dim("\u203A"),Qb=8;function Od(e,t,r){let n=r==null?"":` ${ce.dim(r)}`;return` ${ce.dim(e.padStart(Qb))} ${t}${n}`}function Id(e){let t=[...e.scalars.values()].find(r=>r.subject.kind==="path"&&r.expect.expect==="is")?.expect;return t==null||t.expect==="absent"?"(any view)":ew(t.value)}function ew(e){return typeof e!="object"||e==null?String(e):"template"in e?e.template.map(t=>typeof t=="string"?t:"ref"in t?`{${t.ref}}`:`{count:${t.count.entity}}`).join(""):`{${e.ref}}`}function wi(e){let t=[...e.entities.map(r=>bi(r)),...e.absences.map(r=>`no ${bi(r)}`),...[...e.scalars.values()].filter(r=>r.subject.kind!=="path").filter(r=>!Nd(r)).map(r=>Ri(r))];return t.length===0?"always":t.join(" \u2227 ")}function Ri(e){let t=tw(e.subject);return e.expect.expect==="absent"?`${t} absent`:e.subject.kind==="element"&&rw(e.expect.value)?e.expect.value?t:`not ${t}`:`${t} ${e.expect.expect==="not"?"\u2260":"="} ${Ze(e.expect.value)}`}function ue(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${Ze(e.name)}`:e.by==="inside"?`${ue(e.scope)} \u25B8 ${ue(e.target)}`:e.by==="surface"?ue(e.container):e.by==="frame"?`frame ${ue(e.element)}`:Ze(e.value)}function Ze(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:ea(e)}function ea(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function Td(e,t){let r=new Set(t.entities.map(o=>bi(o))),n=new Set(t.scalars.keys()),i=[...e.entities.map(o=>bi(o)).filter(o=>!r.has(o)),...[...e.scalars].filter(([o])=>!n.has(o)).map(([,o])=>o).filter(o=>o.subject.kind!=="path"&&!Nd(o)).map(o=>Ri(o))];return i.length===0?"nothing beyond the shared state":i.join(" \u2227 ")}function Nd(e){return e.subject.kind==="element"&&e.subject.locator.by==="surface"&&e.subject.locator.overlay&&e.subject.state==="visible"&&e.expect.expect==="is"&&e.expect.value===!1}function tw(e){return e.kind==="variable"?e.name:e.kind==="element"?`${e.state} ${ue(e.locator)}`:e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:`url ${e.kind}`}function rw(e){return typeof e=="boolean"}function bi(e){let t=Object.entries(e.literals).map(([r,n])=>`${r}=${Ze(n)}`);return t.length===0?e.entity:`${e.entity}(${t.join(", ")})`}function Je(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${Je(e.scope)} \u25B8 ${Je(e.target)}`:e.by==="surface"?Je(e.container):e.by==="frame"?`frame ${Je(e.element)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function Vt(e){return e.kind==="variable"?`global variable "${e.name}"`:e.kind==="element"?`${e.state} ${Je(e.locator)}`:e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:e.kind==="actor"?"signed-in actor":`url ${e.kind}`}function xi(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${Je(e.locator)}`:e.kind}function Wt(e){if(e.kind==="not")return`not ${Wt(e.inner)}`;if(e.kind==="browser"){let t=nr(e.key);return e.value===null?`${t} absent`:`${t}="${e.value}"`}return e.kind==="value"||e.kind==="text"?`${e.kind} ${Je(e.locator)}="${e.value}"`:`${e.kind} ${Je(e.locator)}`}function Ut(e){let{field:t,source:r,target:n,targetField:i}=e.reference;return`${r}.${t} \u2192 ${n}.${i}`}function ta(e){return`${e.intent} \u203A ${xi(e.action)}`}function ra(e){return e.kind==="data-rule"?`data rule ${Ut(e.dataRule)}`:`${e.kind} ${Wt(e.check)}`}function Q(e){return e==null?"\u2205":JSON.stringify(e)}function na(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=${Q(e.snapshot)} actual=${Q(e.sut)}`:e.kind==="expected-change"?e.direction!=null?`${e.entity}.${e.field} [${e.key}] expected to have ${e.direction} from ${Q(e.from)} but showed ${Q(e.value)}`:`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${Q(e.value)}`:`${Vt(e.subject)} expected=${ia(e.want)} actual=${Q(e.sut)}`}function ki(e){return{label:ra(e.source),step:ta(e.step)}}function $d(e){return e.expect==="absent"?"absent":e.expect==="not"?`not ${Q(e.value)}`:Q(e.value)}function ia(e){return e.expect==="absent"?"absent":e.expect==="not"?`anything but ${Q(e.value)}`:Q(e.value)}function nw(e){return e==null?"{ \u2026 }":`{ ${Object.entries(e).map(([r,n])=>`${r}: ${JSON.stringify(n)}`).join(", ")} }`}function Ld({evidencePath:e,finding:t}){let r=iw(t);return e==null?r:`${r} Evidence: ${ce.path(e)}`}function Ei(e){return lw(cw(e))}function iw(e){return e.kind==="consistency"?Sw(e):e.kind==="pending-check"?xw(e.source,e.step,e.budget):e.kind==="impossible-action"?`${oe("impossible action")} "${e.step.intent}" ran ${xi(e.step.action)} from a state the test calls impossible.`:e.kind==="unrunnable"?`${oe("model drift")} "${e.intent}" couldn't run \u2014 ${Dd(e)}.`:e.kind==="lift-visibility"?`${oe("reachability")} ${ue(e.locator)} is visible by step ${String(e.visibleIndex+1)} but declared at step ${String(e.declaredIndex+1)}.`:`${oe("driver")} Browser failed at "${e.step.intent}" \u2014 ${jr(e.error)}. Environment, not app or test.`}var ow=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function oa(e){if(e.kind==="entities")return sw(e);if(e.kind==="condition")return"a required condition did not hold";let t=e.want==null?"absent":Ze(e.want),r=e.got===void 0?"absent":Ze(e.got);return`${aw(e.subject)} needed ${t} but was ${r}`}function sw(e){if(e.entity==null)return"the required rows exist individually but could not be matched together";if(e.mustBeAbsent)return`a ${e.entity} row that must be absent was present`;let t=e.alias==null?"":` "${e.alias}"`;return`a required ${e.entity} row${t} was not present`}function aw(e){return e.kind==="element"?`${e.state} ${ue(e.locator)}`:e.kind==="variable"?`"${e.name}"`:e.kind==="query"?`url query "${e.key}"`:e.kind==="actor"?"signed-in actor":`url ${e.kind}`}function Dd(e){return e.unmet==null?dw(e.reason):oa(e.unmet)}function lw(e){return e.replaceAll(ow,"").replaceAll(/\s+/g," ").trim()}function cw(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${na(e.mismatch)}${t}`}return e.kind==="pending-check"?`${Ew(e.source)} failed at "${e.step.intent}": ${Cw(e.source)}`:e.kind==="impossible-action"?`"${e.step.intent}" ran from a state the test says can't happen`:e.kind==="unrunnable"?`model drift: planned step "${e.intent}" could not run \u2014 ${Dd(e)}. Fix the model and recompile \u2014 do not dismiss`:e.kind==="lift-visibility"?`visible(${ue(e.locator)}) declared at step ${String(e.declaredIndex+1)} but already visible at step ${String(e.visibleIndex+1)}`:`driver failed at "${e.step.intent}": ${jr(e.error)}`}var uw={"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 dw(e){return uw[e]}function Fd({debugDir:e,runId:t}){let r=`${e}/${t}`;return Od("behavior",ce.path(`${r}/behavior.jsonl`),void 0)}function rn(e){return e.kind==="drag"?`drag ${ue(e.source)} to ${ue(e.target)}`:"locator"in e&&e.locator!=null?`${e.kind} ${ue(e.locator)}`:"url"in e?`${e.kind} ${pw(e.url)}`:e.kind}function pw(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:ea(e)}function ft(e){return e.kind==="not"?`not ${ft(e.predicate)}`:e.kind==="and"?e.predicates.map(t=>ft(t)).join(" \u2227 "):e.kind==="when"?e.branches.map(t=>t.name).join(" | "):fw(e)}function fw(e){return"locator"in e?hw(e):e.kind==="browser"?`${e.name}=${Ze(e.value)}`:e.kind==="singleton"?`${e.singleton}=${Ze(e.assertion.value)}`:e.kind==="count"?Un(e):e.kind==="actor"?e.target.kind==="anonymous"?"actor is signed out":`actor is ${e.target.ref.ref}`:""}function hw(e){let t=ue(e.locator);if(e.kind==="value"||e.kind==="text"){let r=rt(e.value)?e.value.value:e.value;return`${e.kind} ${t}=${Ze(r)}`}return`${e.kind} ${t}`}function vi(e){return e==null?"At the end of the run":`After ${yw(e.action)} in ${e.intent}`}var mw={click:"clicking",fill:"filling",goto:"opening",hover:"hovering over",press:"pressing",select:"selecting",upload:"uploading to"};function yw(e){return e.url!=null?`opening ${e.url}`:e.locator!=null?`${mw[e.kind]??e.kind} ${Pt(e.locator)}`:e.kind}function Pt(e){return e.by==="testId"?`the element with testId "${e.value}"`:e.by==="inside"?`${Pt(e.target)} inside ${Pt(e.scope)}`:e.by==="surface"?Pt(e.container):e.by==="frame"?`the frame of ${Pt(e.element)}`:e.name==null?`the ${e.role}`:`the "${e.name}" ${e.role}`}function gw(e){return e.kind==="not"&&e.inner.kind==="visible"?`${Pt(e.inner.locator)} never disappeared`:e.kind==="visible"?`${Pt(e.locator)} never appeared`:e.kind==="value"||e.kind==="text"?`${Pt(e.locator)} never showed "${e.value}"`:`the check ${Wt(e)} never held`}function Sw(e){let t=e.pending?bw(e):Rw(e.mismatch,e.step);return`${oe("consistency")} ${t}`}function bw(e){let t=`${jd(e.budget)} wait window`,{mismatch:r}=e,n=vi(e.step);return r.kind==="wrong-value"?`${n}, ${r.entity}.${r.field} [${r.key}] never became ${ce.expected(Q(r.snapshot))} (still ${ce.actual(Q(r.sut))}) in the ${t}.`:r.kind==="unexpected-row"?`${n}, ${r.entity} row "${r.key}" still present after the ${t}.`:r.kind==="missing-row"?`${n}, ${r.entity} row "${r.key}" never appeared in the ${t}.`:r.kind==="expected-change"?r.direction!=null?`${n}, ${r.entity}.${r.field} [${r.key}] didn't ${r.direction} from ${Q(r.from)} (showed ${ce.actual(Q(r.value))}) in the ${t}.`:`${n}, ${r.entity}.${r.field} [${r.key}] never changed from ${ce.actual(Q(r.value))} in the ${t}.`:ww({at:n,mismatch:r,window:t})}function ww({at:e,mismatch:t,window:r}){let n=Vt(t.subject),i=`showed ${ce.actual(Q(t.sut))}, not ${ce.expected(ia(t.want))}`;return`${e}, ${n} ${i} through the ${r}.${_d(t.subject)}`}function _d(e){return e.kind!=="element"?"":" Likely a stale fact \u2014 if this value changes across revisits, use ephemeral() or Entity.updated({...})."}function jd(e){return`${String(dt[e]/1e3)}s`}function Rw(e,t){let r=vi(t);return e.kind==="wrong-value"?`${r}, ${e.entity}.${e.field} [${e.key}] showed ${ce.actual(Q(e.sut))}, expected ${ce.expected(Q(e.snapshot))}.`:e.kind==="scalar-mismatch"?`${r}, ${Vt(e.subject)} showed ${ce.actual(Q(e.sut))}, expected ${ce.expected(ia(e.want))}.${vw(e)}`:e.kind==="unexpected-row"?`${r}, unexpected ${e.entity} row "${e.key}" ${nw(e.row)}.`:e.kind==="missing-row"?`${r}, expected ${e.entity} row "${e.key}" but found none.`:`${r}, ${e.entity}.${e.field} [${e.key}] stayed ${ce.actual(Q(e.value))}, expected a change.`}function vw(e){return e.subject.kind==="actor"&&e.sut==null?" No signed-in actor observed. If auth lives outside cookies, currentActor must read a `ripplo-actor` cookie set on sign-in. See /ripplo:setup.":_d(e.subject)}function xw(e,t,r){let n=`${jd(r)} wait window`;return e.kind==="data-rule"?`${oe("data rule")} ${vi(t)}, ${Ut(e.dataRule)} broke \u2014 a referenced row went missing.`:e.kind==="fact"?`${oe("fact")} A fact from ${kw(e.origin)} predicts ${Wt(e.check)} here but it didn't hold. Usually a stale prediction \u2014 an earlier step changed the record without declaring it. Fix with Entity.updated({...}) or ephemeral().`:`${oe("assertion")} ${vi(t)}, ${gw(e.check)} within the ${n}.`}function kw(e){return e==null?"another workflow":e.kind==="test"?`an assertion in test "${e.test}"`:e.kind==="declared"?`the declared fact "${e.name}"`:`tests ${Ct(e).map(r=>JSON.stringify(r)).join(", ")}`}function Ew(e){return e.kind==="data-rule"?"data rule":e.kind==="fact"?"fact":"assertion"}function Cw(e){return e.kind==="data-rule"?Ut(e.dataRule):Wt(e.check)}function ur(e){let t=le(e.scalars,{kind:"path"});return typeof t=="string"?t:null}function Bd(e){return e.kind==="data-rule"?S({kind:e.kind,rule:Ys(e.dataRule)}):S(e)}function dr(e){return e.filter(t=>t.kind!=="unrunnable")}function Ci({actual:e,canon:t,pre:r,predicted:n}){return[...[...new Set([...n.entities.keys(),...e.entities.keys()])].flatMap(s=>Ow({actual:e.entities.get(s),canon:t,entity:s,pre:r.entities.get(s),predicted:n.entities.get(s)})),...Aw(r.scalars,n.scalars,e.scalars)]}function Aw(e,t,r){let n=Qe(r,v({kind:"path"}))!==void 0;return[...[...t.entries()].flatMap(([o,s])=>{if(s.subject.kind==="actor")return[];let a=Qe(r,o),l=n&&wt(s.subject)&&s.expect.expect!=="absent",c=a===void 0&&l?null:a;if(!s.declared||c===void 0||Dt({got:c,subject:s.subject,want:s.expect}))return[];let u=Qe(e,o);return[{mismatch:{kind:"scalar-mismatch",subject:s.subject,sut:c,want:s.expect},pending:u!==void 0&&nn(u,c)}]}),...Pw(e,t,r),...Mw(e,t,r)]}function Qe(e,t){let r=e.get(t);return r==null||r.expect.expect!=="is"?void 0:r.expect.value}function Pw(e,t,r){let n=v({kind:"path"});if(Qe(r,n)===void 0)return[];let i=!nn(Qe(e,n),Qe(r,n));return[...new Set([...e.keys(),...r.keys()])].flatMap(s=>{let a=(e.get(s)??r.get(s))?.subject;if(a==null||!wt(a)||t.has(s))return[];let c=i&&a.kind!=="path"?null:Qe(e,s)??null,u=Qe(r,s)??null;return nn(c,u)?[]:[{mismatch:{kind:"scalar-mismatch",subject:a,sut:u,want:{expect:"is",value:c}},pending:!1}]})}function Mw(e,t,r){let n=v({kind:"actor"}),i=t.get(n);if(i==null)return[];let o=Qe(r,n);if(Dt({got:o,subject:{kind:"actor"},want:i.expect}))return[];let s=Qe(e,n);return[{mismatch:{kind:"scalar-mismatch",subject:{kind:"actor"},sut:o??null,want:i.expect},pending:s!==void 0&&nn(s,o)}]}function Ow({actual:e,canon:t,entity:r,pre:n,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>Iw({actual:e?.get(s),canon:t,entity:r,key:s,predicted:i?.get(s),preHadKey:n?.has(s)??!1,preRow:n?.get(s)}))}function Iw({actual:e,canon:t,entity:r,key:n,predicted:i,preHadKey:o,preRow:s}){if(i==null)return[{mismatch:{entity:r,key:n,kind:"unexpected-row",row:e},pending:o}];if(e==null)return[{mismatch:{entity:r,key:n,kind:"missing-row"},pending:!o}];let a=(c,u,d)=>nn(t(r,c,u),t(r,c,d));return[...new Set([...Object.keys(i),...Object.keys(e)])].filter(c=>!a(c,i[c],e[c])).map(c=>({mismatch:{entity:r,field:c,key:n,kind:"wrong-value",snapshot:i[c],sut:e[c]},pending:s==null?e[c]===void 0:a(c,s[c],e[c])}))}function nn(e,t){return Vd(e)===Vd(t)}function Vd(e){return e==null?"\u2205":JSON.stringify(e)}function Ai(e){let t=Tw(e.entities),r=Nw(e.singletons);return n=>$w(n,t,r)}function Tw(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([r,n])=>[Wd(t.name,r),n.consistency])))}function Wd(e,t){return`${e}.${t}`}function Nw(e){return new Map(e.map(t=>[t.name,t.consistency]))}function $w(e,t,r){return e.kind==="scalar-mismatch"?Lw(e.subject,r):e.kind==="unexpected-row"||e.kind==="missing-row"?"strict":t.get(Wd(e.entity,e.field))??"strict"}function Lw(e,t){return e.kind==="variable"?t.get(e.name)??"strict":"eventual"}function Pi(e){let t=new Set(e.valueSpaces.filter(r=>r.kind==="datetime").map(r=>r.name));return(r,n,i)=>{if(!t.has(`${r}.${n}`)||typeof i!="string")return i;let o=Date.parse(i);return Number.isNaN(o)?i:new Date(o).toISOString()}}var De=class extends Error{name="AbortError";constructor(){super("aborted")}};function on(e){return e instanceof Error&&e.name==="AbortError"}function Oe(e){if(e.aborted)throw new De}function Mt(e,t){return t.aborted?Promise.reject(new De):new Promise((r,n)=>{let i=()=>{clearTimeout(o),n(new De)},o=setTimeout(()=>{t.removeEventListener("abort",i),r()},e);t.addEventListener("abort",i,{once:!0})})}var Dw={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 Ud(e){let t=Dw[e.kind]??e.kind;return e.kind==="press"&&e.key!=null?`${t}: ${e.key}`:t}function Oi(e){return e.kind==="data-rule"?"data rule":zd(e.check)}function zd(e){return e.kind==="not"?`not ${zd(e.inner)}`:e.kind==="browser"?nr(e.key):`${Mi(e.locator)} ${e.kind}`}function Mi(e){return e.by==="testId"?"element":e.by==="inside"?Mi(e.target):e.by==="surface"?Mi(e.container):e.by==="frame"?Mi(e.element):e.role}function Gd(e){return e.kind==="goto"?e.url:e.kind==="press"?e.key:e.value==null?void 0:String(e.value)}function Ii(e){return e.kind==="data-rule"?void 0:Kd(e.check)}function qd(e){return e.kind==="data-rule"?!1:Ti(e.check)}function Ti(e){return e.kind==="not"?Ti(e.inner):e.kind==="browser"&&Qc(e.key)}function Kd(e){if(e.kind==="not")return Kd(e.inner);if(e.kind==="value"||e.kind==="text"||e.kind==="browser")return e.value??void 0}function Hd({atMs:e,findings:t,step:r}){return r.urlChecks.map(n=>({atMs:e,ephemeral:!1,kind:"assertion",label:Oi({check:n,kind:"step"}),outcome:t.length>0?"failed":"passed",rrwebIds:[],url:!0,value:Ii({check:n,kind:"step"})}))}function Ni({action:e,actionLabel:t,outcome:r,rrwebIds:n,startMs:i}){return{atMs:i,ephemeral:!1,kind:"action",label:t,outcome:r,rrwebIds:n,url:!1,value:Gd(e)}}var Fw=()=>[],_w=()=>Le;async function Li({canon:e,classify:t,dataRuleChecks:r,derive:n,initialSnapshot:i,observe:o,onAssertion:s,onStep:a,steps:l,stopAfterStep:c},u){return Qd({acc:[],canon:e,classify:t,dataRuleChecks:r??Fw,derive:n??_w,index:0,observe:o,onAssertion:s,onStep:a,signal:u,snapshot:i,steps:l,stopAfterStep:c})}async function Qd({acc:e,canon:t,classify:r,dataRuleChecks:n,derive:i,index:o,observe:s,onAssertion:a,onStep:l,signal:c,snapshot:u,steps:d,stopAfterStep:p}){Oe(c);let m=d[o];if(m==null)return{finalModel:u,findings:e};let y=Date.now(),f=await m.targetIds(),h=Ud(m.step.action);if(!m.requiredState(u)){let w={kind:"impossible-action",step:m.step};return sa(l,{annotations:[Ni({action:m.step.action,actionLabel:h,outcome:"failed",rrwebIds:f,startMs:y})],endMs:Date.now(),findings:[w],index:o,post:u,pre:u,source:m.source,startMs:y,url:ur(u)}),{finalModel:u,findings:[...e,w]}}return m.perform().match(()=>jw({acc:e,actionLabel:h,canon:t,classify:r,dataRuleChecks:n,derive:i,index:o,observe:s,onAssertion:a,onStep:l,rrwebIds:f,signal:c,snapshot:u,startMs:y,step:m,steps:d,stopAfterStep:p}),w=>{let x=$i(w,m);return sa(l,{annotations:[Ni({action:m.step.action,actionLabel:h,outcome:"failed",rrwebIds:f,startMs:y})],endMs:Date.now(),findings:[x],index:o,post:u,pre:u,source:m.source,startMs:y,url:ur(u)}),Promise.resolve({finalModel:u,findings:[...e,x]})})}async function jw({acc:e,actionLabel:t,canon:r,classify:n,dataRuleChecks:i,derive:o,index:s,observe:a,onAssertion:l,onStep:c,rrwebIds:u,signal:d,snapshot:p,startMs:m,step:y,steps:f,stopAfterStep:h}){let w=y.effect(p),x=o(w),g={...w,scalars:Ae(x,w.scalars)},k=await qw({canon:r,claimed:new Set([...y.assertedScalars,...x.keys()]),classify:n,observe:a,pre:p,predicted:g,signal:d,step:y}),T={...k.snapshot,scalars:new Map([...[...k.snapshot.scalars].filter(([,fe])=>fe.subject.kind!=="element"),...[...w.scalars].filter(([,fe])=>fe.subject.kind==="element")])},j=Date.now(),te=[...y.pendingChecks,...i(p,k.snapshot)],W=await Bw({onAssertion:l,pendingChecks:te,signal:d,step:y,windowStartMs:m}),G=[...W.findings,...k.findings];sa(c,{annotations:[Ni({action:y.step.action,actionLabel:t,outcome:G.length>0?"failed":"passed",rrwebIds:u,startMs:m}),...Hd({atMs:j,findings:k.findings,step:y}),...W.annotations],endMs:Date.now(),findings:G,index:s,post:k.snapshot,pre:p,source:y.source,startMs:m,url:ur(k.snapshot)});let re=[...e,...G];return G.length>0?{finalModel:T,findings:re}:h!=null&&s+1>=h?{finalModel:T,findings:re}:Qd({acc:re,canon:r,classify:n,dataRuleChecks:i,derive:o,index:s+1,observe:a,onAssertion:l,onStep:c,signal:d,snapshot:T,steps:f,stopAfterStep:h})}async function Bw({onAssertion:e,pendingChecks:t,signal:r,step:n,windowStartMs:i}){let o=[...new Map(t.map(a=>[Bd(a.source),a])).values()],s=await Promise.all(o.map(async a=>{let l=await Ww({pendingCheck:a,signal:r,windowStartMs:i}),c=Date.now(),u=await a.targetIds();return{atMs:c,outcome:l,pendingCheck:a,rrwebIds:u}}));return s.forEach(a=>{Uw(e,a.pendingCheck,a.outcome,n)}),{annotations:s.filter(a=>a.pendingCheck.source.kind==="step").map(a=>({atMs:a.atMs,ephemeral:a.pendingCheck.ephemeral,kind:"assertion",label:Oi(a.pendingCheck.source),outcome:ep(a.outcome),rrwebIds:a.rrwebIds,url:qd(a.pendingCheck.source),value:Ii(a.pendingCheck.source)})),findings:s.flatMap(a=>zw(a.pendingCheck,a.outcome,n))}}var Vw=250;function Ww({pendingCheck:e,windowStartMs:t}){if(e.check.kind==="decided"){let i=e.check.passed?"passed":"failed";return Promise.resolve({kind:i})}let r=Date.now()-t,n=Math.max(Vw,Vs[e.budget].timeoutMs-r);return e.check.wait(n).match(i=>i?{kind:"passed"}:{kind:"failed"},i=>{if(i.kind==="aborted")throw new De;return{error:i,kind:"error"}})}function Uw(e,t,r,n){e?.({outcome:ep(r),source:t.source,step:n.step,waitBudget:t.budget,waitMs:dt[t.budget]})}function ep(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function zw(e,t,r){return t.kind==="error"?[$i(t.error,r)]:t.kind==="failed"?[{budget:e.budget,kind:"pending-check",source:e.source,step:r.step}]:[]}function $i(e,t){return{error:e,kind:"driver-error",step:t.step}}function sa(e,t){e?.(t)}function Yd(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function Gw(e,t,r){return r.reconcile==null?e:r.reconcile(e,t)}function Xd(e,t,r){let n=e.probed.filter(i=>!i.pending&&r(i.mismatch)==="strict");return n.length>0?{findings:n.map(i=>tp(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function tp(e,t){return{budget:t.sync,kind:"consistency",mismatch:e.mismatch,pending:e.pending,step:t.step}}function Zd({canon:e,pre:t,predicted:r,step:n},i){let o=n.verifyChanges==null?[]:n.verifyChanges(r,i),s=Gw(r,i,n),a=o.map(l=>({mismatch:l,pending:!0}));return{adopted:s,probed:[...a,...Ci({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function Jd(e,t,r){return{findings:[...e.probed.map(n=>tp(n,t)),...r],snapshot:e.adopted}}async function qw({canon:e,claimed:t,classify:r,observe:n,pre:i,predicted:o,signal:s,step:a}){let l=Vs[a.sync],c=Date.now()+l.timeoutMs,u=Ae(i.scalars,o.scalars),d=new Map([...u].filter(([h,w])=>w.declared&&(w.subject.kind!=="element"||t.has(h)))),p=()=>n(d),m=await Yd(p);if(!m.ok)return{findings:[$i(m.error,a)],snapshot:o};let y=Zd({canon:e,pre:i,predicted:o,step:a},m.observed),f=0;for(;Date.now()<c;){Oe(s);let h=Xd(y,a,r);if(h!=null)return h;await Mt(Tu(l,f),s),f+=1;let w=await Yd(p);if(!w.ok)return Jd(y,a,[$i(w.error,a)]);y=Zd({canon:e,pre:i,predicted:o,step:a},w.observed)}return Xd(y,a,r)??Jd(y,a,[])}function aa(e){let t=e.predicates.filter(o=>lp(o)),r=t.filter(o=>o.assertion.kind==="created"),n=op(t);if(r.length===0&&n.length===0&&e.deferred.length===0)return;let i=t.filter(o=>o.assertion.kind==="updated");return(o,s)=>{let a=r.reduce((u,d)=>Jw(u,s,d,e),{env:e.env,snapshot:o}),l=n.reduce((u,d)=>Zw(u,s,d,e.env),a.snapshot),c=i.reduce((u,d)=>Kw(u,s,d),a.env);return rR(l,e.deferred,c)}}function ip(e,t,r){return new Map([...e,...Object.entries(r).map(([n,i])=>[Ee(M,`${t}.${n}`),i])])}function Kw(e,t,r){let n=ct(t.snapshot,r.entity,r.key,e).at(0);return n==null?e:ip(e,r.assertion.as,n)}function la(e){let t=op(e.predicates.filter(r=>lp(r)));if(t.length!==0)return(r,n)=>t.flatMap(i=>Hw(i,r,n,e.env))}function op(e){return e.filter(t=>t.assertion.kind==="updated"&&sp(t.assertion.props).length>0)}function sp(e){return ap(e).map(([t])=>t)}function ap(e){return Object.entries(e).flatMap(([t,r])=>xt(r)?[[t,r.direction]]:[])}function lp(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function Hw(e,t,r,n){let i=ct(t,e.entity,e.key,n).at(0),o=ct(r.snapshot,e.entity,e.key,n).at(0);if(i==null||o==null)return[];let s=Wr(Yw(e.key,n));return ap(e.assertion.props).flatMap(([a,l])=>Xw(i[a],o[a],l)?[]:[{direction:l,entity:e.entity,field:a,from:i[a],key:s,kind:"expected-change",value:o[a]}])}function Yw(e,t){let r=Object.fromEntries(Object.entries(e).filter(n=>!pe(n[1])&&!ye(n[1])));return rr(r,M,Re(t))}function Xw(e,t,r){return r==null?rp(e)!==rp(t):r==="increased"?np(e,t):np(t,e)}function rp(e){return e==null?"\u2205":JSON.stringify(e)}function np(e,t){return(typeof e=="number"&&typeof t=="number"||typeof e=="string"&&typeof t=="string")&&e<t}function Zw(e,t,r,n){let i=sp(r.assertion.props),o=ct(t.snapshot,r.entity,r.key,n).at(0);return o==null?e:lu(e,r.entity,r.key,n,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function Jw(e,t,r,n){if(r.assertion.kind!=="created")return e;let i=rr(r.assertion.props,M,Re(n.env)),o=e.snapshot.entities.get(r.entity);if(o==null)return e;let s=Qw({identityFields:n.identities.get(r.entity)??[],props:i,set:o});if(s==null)return e;let a=eR(t.snapshot.entities.get(r.entity),o,i);if(a==null)return e;let[l,c]=a,u=new Map(o);return u.delete(s),u.set(l,{...c,...i}),{env:ip(e.env,r.assertion.as,c),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(r.entity,u)}}}function Qw({identityFields:e,props:t,set:r}){let n=Wr(t);if(r.has(n))return n;if(e.length===0)return null;let i=Object.entries(t),o=[...r].find(([,s])=>e.every(a=>au(s[a]))&&i.every(([a,l])=>Di(s[a])===Di(l)));return o==null?null:o[0]}function eR(e,t,r){if(e==null)return;let n=Object.entries(r),i=[...e].filter(([o])=>!t.has(o)).map(([o,s])=>({entry:[o,s],score:n.filter(([a,l])=>Di(s[a])===Di(l)).length}));return tR(i,n.length)}function Di(e){return e==null?"\u2205":JSON.stringify(e)}function tR(e,t){let r=e.reduce((i,o)=>Math.max(i,o.score),0);if(r===0)return;let n=e.filter(i=>i.score===r);if(!(r<t&&n.length!==1))return n[0]?.entry}function rR(e,t,r){let n=t.reduce((i,o)=>{let s=nR(o.value,r);return s==null||typeof s!="string"?i:at(i,{declared:!0,expect:{expect:"is",value:s},subject:o.key})},e.scalars);return{...e,scalars:n}}function nR(e,t){try{return qe(e,M,Re(t))}catch{return}}function ca(e,t){if(e.kind==="visible"||e.kind==="unobstructed"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="expanded"||e.kind==="pressed")return{kind:e.kind,locator:ae(e.locator,t)};if(e.kind==="not"){let r=ca(e.predicate,t);return r==null?null:{inner:r,kind:"not"}}return e.kind==="value"||e.kind==="text"?iR(e,t):e.kind!=="browser"?null:{key:Hn(e.name,e.part),kind:"browser",value:e.value===null?null:qe(e.value,M,t)}}function pr(e,t){let{env:r,identities:n}=t,i=e.expect.filter(f=>f.kind==="state"),o=hR(i),s=t.snapshot==null?void 0:sr(t.snapshot,i,t),a={counts:s==null?void 0:ge(s),env:r},l={counts:t.snapshot==null?void 0:ge(t.snapshot),env:r},{clears:c,deferred:u,sets:d}=lR(e,a,o),p=ti(e),m=mR(e.action,l),y=oR(e);return{action:m,assertedScalars:[...d.keys()],label:e.action.kind,pendingChecks:e.expect.flatMap(f=>SR(f,a,p)),reconcile:aa({deferred:u,env:r,identities:n,predicates:i}),urlChecks:e.expect.flatMap(f=>gR(f,a)),verifyChanges:la({deferred:u,env:r,identities:n,predicates:i}),effect:f=>su(sr(f,i,t),{clears:c,forget:y,sets:d})}}function iR(e,t){let r=rt(e.value);return{kind:e.kind,locator:ae(e.locator,t),match:r?e.value.kind:"exact",value:qe(r?e.value.value:e.value,M,t)}}function oR(e){return e.action.kind==="goto"||e.action.kind==="actor"||sR(e)?"hard":Bt(e)?"soft-path":"none"}function sR(e){return e.expect.some(t=>t.kind==="actor")}function aR(e){return e.action.kind!=="actor"?null:{expect:{expect:"is",value:{ref:`${e.action.ref.ref}.id`}},subject:{kind:"actor"}}}function lR(e,t,r){let n=e.action.kind==="goto"?Kr(e.action.url):[],i=aR(e),o=Et(e.expect).flatMap(l=>{let c=he(l);return c==null?[]:[c]}),s=[...n,...o,...i==null?[]:[i]].map(l=>({declared:!0,entry:l}));return[...Hr(e).map(l=>({declared:!1,entry:l})),...s].reduce((l,{declared:c,entry:u})=>cR({acc:l,captures:r,declared:c,entry:u,scope:t}),{clears:[],deferred:[],sets:Le})}function cR({acc:e,captures:t,declared:r,entry:n,scope:i}){if(uR(n,t))return n.expect.expect==="is"&&cp(n.expect.value)?{...e,deferred:[...e.deferred,{key:fR(n.subject),value:n.expect.value}]}:e;let o=lt({declared:r,entry:n,scope:i});return o.expect.expect==="absent"&&!wt(o.subject)?{...e,clears:[...e.clears,v(o.subject)]}:{...e,sets:at(e.sets,o)}}function uR(e,t){return e.subject.kind==="element"||e.subject.kind==="variable"?!1:e.expect.expect==="is"&&cp(e.expect.value)&&dR(e.expect.value,t)}function cp(e){return typeof e=="string"||typeof e=="object"}function dR(e,t){return pR(e).some(r=>t.has(ar(r)))}function pR(e){return typeof e=="string"?[]:U(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function fR(e){if(e.kind==="element"||e.kind==="variable"||e.kind==="actor")throw new Error("expected a browser subject");return e}function hR(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function mR(e,t){return{actorRef:e.kind==="actor"?e.ref.ref:void 0,files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:yR(e,t),target:e.kind==="drag"?ae(e.target,t):void 0,url:e.kind==="goto"?qe(e.url,M,t):void 0,value:"value"in e?Yc(e.value,t):void 0}}function yR(e,t){if(e.kind==="drag")return ae(e.source,t);if(!(!("locator"in e)||e.locator==null))return ae(e.locator,t)}function gR(e,t){if(e.kind!=="browser"&&e.kind!=="not")return[];try{let r=ca(e,t);return r!=null&&Ti(r)?[r]:[]}catch(r){if(r instanceof st)return[];throw r}}function SR(e,t,r){if(e.kind==="browser"||e.kind==="singleton")return[];let n=ca(e,t),i=r?"slow":"fast",o="wait"in e?e.wait??i:i;return n==null?[]:[{budget:o,check:n,ephemeral:Qt(e)}]}import{err as bR,errAsync as wR,ok as up,okAsync as dp,Result as RR}from"neverthrow";function fr(e,t,r){let n=IR(e),i={env:new Map,generate:r.generate,generatedParams:new Set,indexed:n,overrides:new Map(Object.entries(r.params??{}).map(([s,a])=>[$e(s),a]))};TR(t.params,M,i);let o=t.world.map(s=>NR(s,M,i));return r.materialize(o).andThen(s=>FR(s,i.env,n).asyncAndThen(a=>vR({base:a,rows:s,signIn:r.signIn,test:t}).map(l=>xR({base:l,generatedParams:i.generatedParams,lockfile:e,test:t}))))}function Fi(e,t){let r=new Map(t.map(n=>[n.name,n]));return n=>dp(PR(n,e,r).rows)}function _i(e){return t=>{let r=t.map(n=>({as:n.as,entity:n.entity,fields:n.fields}));return e(r).andThen(n=>AR(t,n))}}function da(e,t){let r=sn(t);return Object.fromEntries(Object.entries(e).filter(([n,i])=>r.includes(n)&&i!=null))}function sn(e){return Object.keys(e.props)}function vR({base:e,rows:t,signIn:r,test:n}){if(n.actor.kind!=="user"||r==null)return dp(e);let i=n.actor.alias,o=t.find(s=>s.as===i);return o==null?wR(gs(i)):r({entity:o.entity,row:o.row}).map(s=>({...e,auth:s}))}function xR({base:e,generatedParams:t,lockfile:r,test:n}){let i=Object.fromEntries(r.singletons.map(d=>[d.name,d.default])),o=Object.fromEntries(Object.entries(n.singletons).map(([d,p])=>[d,Ce(p,M,Re(e.env))])),s=Object.entries(n.singletons).filter(([,d])=>kR(d,t)).map(([d])=>d),a={...i,...o},l=new Set(r.singletons.filter(d=>d.source==="client").map(d=>d.name)),c=Object.fromEntries(Object.entries(a).filter(([d])=>l.has(d))),u=ER(e.aliases,n);return{...e,clientState:c,generatedSingletons:s,snapshot:{...e.snapshot,scalars:Ae(e.snapshot.scalars,new Map([...Object.entries(a).map(([d,p])=>[v({kind:"variable",name:d}),{declared:!0,expect:{expect:"is",value:p},subject:{kind:"variable",name:d}}]),...u,...CR(n)]))}}}function kR(e,t){return U(e)?t.has(Ee(M,e.ref)):Ge(e)?e.template.some(r=>typeof r!="string"&&"ref"in r&&t.has(Ee(M,r.ref))):!1}function ER(e,t){if(t.actor.kind!=="user")return[];let r=t.actor.alias,n=e.find(i=>i.alias===r);return n==null?[]:[[v({kind:"actor"}),{declared:!1,expect:{expect:"is",value:n.key},subject:{kind:"actor"}}]]}function CR(e){return[[v({kind:"viewport"}),{declared:!1,expect:{expect:"is",value:e.viewport},subject:{kind:"viewport"}}]]}function AR(e,t){let r=new Map(t.map(n=>[n.as,n]));return RR.combine(e.map(n=>{let i=r.get(n.as);return i==null?bR(gs(n.as)):up({as:n.as,entity:n.entity,generatedFields:n.generatedFields,row:i.row})}))}function PR(e,t,r){return e.reduce((n,i)=>{let o=MR(i.fields,n.env),s=_R({generate:t,model:i.model,seedPrefix:i.seedPrefix,set:o,valueSpaces:r}),a=Object.entries(s).map(([c,u])=>[`${i.as}.${c}`,u]),l=Object.keys(s).filter(c=>!(c in o));return{env:new Map([...n.env,...a]),rows:[...n.rows,{as:i.as,entity:i.entity,generatedFields:[...new Set([...i.generatedFields,...l])],row:s}]}},{env:new Map,rows:[]})}function MR(e,t){return Object.fromEntries(Object.entries(e).map(([r,n])=>{if(U(n))return[r,OR(t,n.ref)];if(Ge(n))throw new Error(`template value not allowed in entity field "${r}"`);return[r,n]}))}function OR(e,t){let r=e.get(t);if(r==null)throw new Error(`setup ref "${t}" was not produced by an earlier entity`);return r}function IR(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function TR(e,t,r){Object.entries(e).forEach(([n,i])=>{let o=Ee(t,n),s=r.indexed.valueSpaces.get(i.valueSpace);if(s==null)throw new Error(`unknown valueSpace "${i.valueSpace}" for param "${o}"`);let a=r.overrides.get(o);a==null&&r.generatedParams.add(o);let l=a??r.generate.value({anchor:void 0,nullable:!1,seed:o,space:s,type:vc(s),valueSpace:i.valueSpace});r.env.set(o,l)})}function NR(e,t,r){let n=r.indexed.models.get(e.entity);if(n==null)throw new Error(`model "${e.entity}" not found for setup "${e.as}"`);let i=Ee(t,e.as),o=$R(e.set,t,r.env),s=DR(n,o,i,r),a=Object.entries(e.set).filter(([,l])=>U(l)&&r.generatedParams.has(Ee(t,l.ref))).map(([l])=>l);return{as:i,entity:e.entity,fields:{...s,...o},generatedFields:[...Object.keys(s),...a],model:n,seedPrefix:i}}function $R(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,LR(i,t,r)]))}function LR(e,t,r){if(!U(e))return e;let n=Ee(t,e.ref);return r.get(n)??{ref:n}}function DR(e,t,r,n){return Object.fromEntries(Object.entries(e.props).filter(([i,o])=>!o.optional&&!e.identity.includes(i)&&!(i in t)).map(([i,o])=>[i,pp({field:i,generate:n.generate,model:e,seedPrefix:r,spec:o,valueSpaces:n.indexed.valueSpaces})]))}function FR(e,t,r){let n=new Map;e.forEach(a=>{let l=r.models.get(a.entity);if(l==null)throw new Error(`model "${a.entity}" not found for setup "${a.as}"`);Object.entries(a.row).forEach(([u,d])=>t.set(Ee($e(a.as),u),d));let c=n.get(a.entity)??new Map;c.set(ua(a.row,l),da(a.row,l)),n.set(a.entity,c)});let i=e.flatMap(a=>{let l=r.models.get(a.entity);return l==null?[]:[{alias:a.as,entity:a.entity,key:ua(a.row,l)}]}),o=e.flatMap(a=>{let l=r.models.get(a.entity);if(l==null)return[];let c=ua(a.row,l);return a.generatedFields.map(u=>({entity:a.entity,field:u,key:c}))}),s=new Map(e.map(a=>[a.as,{entity:a.entity,row:a.row}]));return up({aliases:i,auth:void 0,env:t,generated:o,principals:s,snapshot:{entities:jR(n),scalars:Le}})}function _R({generate:e,model:t,seedPrefix:r,set:n,valueSpaces:i}){return{...Object.fromEntries(Object.entries(t.props).filter(([s])=>!(s in n)).map(([s,a])=>[s,pp({field:s,generate:e,model:t,seedPrefix:r,spec:a,valueSpaces:i})])),...n}}function pp({field:e,generate:t,model:r,seedPrefix:n,spec:i,valueSpaces:o}){let s=`${r.name}.${e}`;return t.value({anchor:void 0,nullable:i.optional,seed:Ee(n,e),space:o.get(s),type:i.type,valueSpace:s})}function ua(e,t){return t.identity.map(r=>String(e[r])).join(":")}function jR(e){return new Map([...e].map(([t,r])=>[t,new Map(r)]))}function an(e,t,r){let n=Pe(e.requiredState,t);return n==null?null:new Map([...Object.entries(r).map(([i,o])=>[$e(i),o]),...n])}function ln(e,t,r){let n={env:t,identities:e.identities,snapshot:r},i=du(e.whenSteps,r,n),o=i.at(-1)??e.effectStep,s=pr(o,n),a=VR(e,n),l=i.reduce((c,u)=>{let d=pr(u,{...n,snapshot:c.current});return{current:d.effect(c.current),steps:[...c.steps,{action:d.action,assertedScalars:d.assertedScalars,effect:d.effect,pendingChecks:d.pendingChecks,reconcile:d.reconcile,source:u,urlChecks:d.urlChecks,verifyChanges:d.verifyChanges}]}},{current:r,steps:[]});return{effect:WR(s.effect,a),steps:l.steps}}function Bi(e,t,r){return Pe(e.requiredState,r)==null?!1:ji(t(r))!==ji(r)||UR(e)||BR(e)}function BR(e){return[...e.nav,...e.steps].every(t=>t.expect.every(r=>r.kind!=="state"))}var fp=new WeakMap;function ji(e){let t=fp.get(e);if(t!=null)return t;let r=S({entities:[...e.entities].toSorted(([n],[i])=>n.localeCompare(i)).map(([n,i])=>[n,[...i].toSorted(([o],[s])=>o.localeCompare(s))]),scalars:Cs(e.scalars).map(([n,i])=>[n,i.expect])});return fp.set(e,r),r}function VR(e,t){let r=e.nav.at(-1);if(r!=null)return pr(r,t).action.url}function WR(e,t){if(t==null)return e;let r=or(t);return n=>{let i=e(n);return{...i,scalars:Ae(i.scalars,r)}}}function UR(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(r=>xt(r)))}function hr(e,t,r){let n=an(e,t.snapshot,r);if(n==null)return null;let i=zR(e,n,t.snapshot);return i==null||!Bi(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function hp(e,t,r){let n=an(e,t.snapshot,r);if(n==null)return"required-state-unsatisfied";try{return ln(e,n,t.snapshot),"no-effect"}catch(i){if(i instanceof st)return"unresolvable";throw i}}function zR(e,t,r){try{return ln(e,t,r)}catch(n){if(n instanceof st)return null;throw n}}function Vi(e,t,r){return e.flatMap((n,i)=>{let o=r(n),s=hr(n,t,o);return s==null?[]:[{idx:i,label:Ye(n),params:o,stepRun:s}]})}function pa(e,t){let r=[...t.entities].flatMap(([o,s])=>[...s].map(([a,l])=>GR({entity:o,key:a,pre:e,row:l}))),n=[...e.entities].flatMap(([o,s])=>[...s].flatMap(([a,l])=>qR({entity:o,key:a,post:t,row:l}))),i=[...t.scalars.values()].flatMap(o=>{if(o.subject.kind!=="variable"||o.expect.expect!=="is")return[];let s=o.subject.name;return[{changed:le(e.scalars,o.subject)!==o.expect.value,name:s,value:o.expect.value}]});return{rows:[...r,...n],singletons:i}}function GR({entity:e,key:t,pre:r,row:n}){let i=KR(r.entities.get(e),t),o=Object.entries(n).map(([s,a])=>({changed:i==null||i[s]!==a,field:s,value:a}));return{changed:i==null||o.some(s=>s.changed),entity:e,fields:o,key:t,status:i==null?"created":"present"}}function qR({entity:e,key:t,post:r,row:n}){if(r.entities.get(e)?.has(t)===!0)return[];let i=Object.entries(n).map(([o,s])=>({changed:!1,field:o,value:s}));return[{changed:!0,entity:e,fields:i,key:t,status:"deleted"}]}function KR(e,t){return e?.get(t)}function mr(e,t,r){return t.steps.map(n=>({assertedScalars:n.assertedScalars,effect:n.effect,pendingChecks:n.pendingChecks.map(i=>({budget:i.budget,check:{kind:"poll",wait:o=>r.awaitCheck(i.check,o)},ephemeral:i.ephemeral,source:{check:i.check,kind:"step"},targetIds:()=>r.locateIds(mp(i.check))})),reconcile:n.reconcile,source:n.source,step:{action:n.action,intent:e.intent,test:e.test},sync:e.wait,urlChecks:n.urlChecks,verifyChanges:n.verifyChanges,perform:()=>r.perform(n.action),requiredState:()=>!0,targetIds:()=>r.locateIds(n.action.locator)}))}function mp(e){if(e.kind==="not")return mp(e.inner);if(e.kind!=="browser")return e.locator}async function yp({current:e,driver:t,index:r,next:n,state:i}){if(n==null||HR(n))return[];if(Bt(e.transition.effectStep))return[];let o=hr(n.transition,i,n.params);if(o==null)return[];let s=mr(n.transition,o.resolved,t).flatMap(c=>c.pendingChecks.flatMap(u=>{let d=YR(u.source);return d==null?[]:[d]}));if(s.length===0)return[];let a=new Map(s.map(c=>{let u={kind:"element",locator:c,state:"visible"};return[v(u),{declared:!0,expect:{expect:"is",value:!0},subject:u}]})),l=await t.observe(a).match(c=>c,()=>null);return l==null?[]:s.filter(c=>{let u={kind:"element",locator:c,state:"visible"},d=le(l.snapshot.scalars,u)===!0,p=le(i.snapshot.scalars,u)===!1;return d&&p}).map(c=>({declaredIndex:r+1,kind:"lift-visibility",locator:c,visibleIndex:r}))}function HR(e){return e.transition.nav.length>0||e.transition.steps.some(t=>t.action.kind==="goto"||Bt(t))}function YR(e){if(e.kind!=="data-rule")return e.check.kind==="visible"?e.check.locator:void 0}async function ha(e,t){let{params:r,transition:n}=e.stepRun,i={snapshot:ci(e.facts,e.state.snapshot)},o=hr(n,i,r);if(o==null){let a=hp(n,i,r),l={intent:n.intent,kind:"unrunnable",reason:a,test:n.test,unmet:a==="required-state-unsatisfied"?Qn(n.requiredState,i.snapshot)??void 0:void 0};return{label:Ye(n),next:e.state,result:{finalModel:e.state.snapshot,findings:[l]}}}let s=await Li({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,steps:mr(e.stepRun.transition,o.resolved,e.driver),stopAfterStep:e.stopAfterStep==null?void 0:e.stopAfterStep-e.stepBase,dataRuleChecks:(a,l)=>e.dataRules.flatMap(c=>Sp(c,l)),derive:a=>Qr(e.facts,a)},t);return{label:Ye(e.stepRun.transition),next:{snapshot:s.finalModel},result:s}}function Sp(e,t){return fi(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},ephemeral:!1,source:{dataRule:e,kind:"data-rule"},targetIds:()=>Promise.resolve([])}]:[]}function Wi(e,t){return fa({acc:{findings:[],ran:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function fa({acc:e,index:t,params:r,signal:n,state:i,stepBase:o}){Oe(n);let s=r.sequence[t];if(s==null)return e;let a=Date.now(),l=[],c=await ha({canon:r.canon,classify:r.classify,dataRules:r.dataRules,driver:r.driver,facts:r.facts,onAssertion:r.onAssertion,state:i,stepBase:o,stepRun:s,stopAfterStep:r.stopAfterStep,onStep:p=>{l.push(p.index),r.onEvent({annotations:p.annotations,endMs:p.endMs,findings:p.findings,index:o+p.index,kind:"step",source:p.source,startMs:p.startMs,state:pa(p.pre,p.post),url:p.url})}},n);if(c==null)return fa({acc:e,index:t+1,params:r,signal:n,state:i,stepBase:o});r.onEvent({endMs:Date.now(),intent:s.transition.intent,kind:"ran",startMs:a});let u=await XR({index:t,outcome:c,params:r,signal:n,state:i,stepBase:o,stepRun:s},l),d={findings:[...e.findings,...c.result.findings,...u],ran:[...e.ran,c.label]};return c.result.findings.length>0||u.length>0||r.stopAfterStep!=null&&o+l.length>=r.stopAfterStep?d:fa({acc:d,index:t+1,params:r,signal:n,state:c.next,stepBase:o+l.length})}async function XR(e,t){let{index:r,outcome:n,params:i,stepBase:o,stepRun:s}=e,a=t.length>0;!a&&n.result.findings.length>0&&gp(i,s,e.state,o,n.result.findings);let l=i.sequence[r+1],c=a?await yp({current:s,driver:i.driver,index:r,next:l,state:n.next}):[];return n.result.findings.forEach(u=>{i.onEvent({finding:u,kind:"finding"})}),c.length>0&&l!=null&&gp(i,l,n.next,o+t.length,c),c}function gp(e,t,r,n,i){let o=Date.now(),s=le(r.snapshot.scalars,{kind:"path"});e.onEvent({annotations:[],endMs:o,findings:i,index:n,kind:"step",source:t.transition.steps[0]??t.transition.effectStep,startMs:o,state:pa(r.snapshot,r.snapshot),url:typeof s=="string"?s:null})}function bp(e){return J(e).flatMap(t=>ZR(t.test))}function ZR(e){let t=new Map(e.world.map(n=>[n.as,n])),r=ev(e.steps);return e.steps.flatMap((n,i)=>n.expect.filter(o=>tv(o)).flatMap(o=>JR({createdAliases:r,predicate:o,setByAlias:t,stepIndex:i,test:e})))}function JR(e){let{createdAliases:t,predicate:r,setByAlias:n,stepIndex:i,test:o}=e,s=QR(r);if(s==null||t.has(s))return[];let a=n.get(s);return a==null?[]:Object.keys(r.assertion.props).filter(l=>!(l in a.set)).map(l=>({entity:r.entity,field:l,stepIndex:i,test:`${o.workflow}/${o.slug}`}))}function QR(e){return Object.values(e.key).flatMap(t=>U(t)?[ar(t.ref)]:[]).at(0)}function ev(e){return new Set(e.flatMap(t=>t.expect.flatMap(r=>r.kind==="state"&&r.assertion.kind==="created"?[r.assertion.as]:[])))}function tv(e){return e.kind==="state"&&e.assertion.kind==="updated"}function wp(e){return J(e).flatMap(({test:t})=>rv(t.steps,ne(t)))}function rv(e,t){return e.reduce((r,n)=>{let i=nv(n.action).filter(o=>!iv(o,r.pre)).map(o=>({action:n.action,ephemeralOnly:r.ephemeralKeys.has(S(de(o))),target:o,test:t}));return{ephemeralKeys:new Set([...r.ephemeralKeys,...ov(n)]),pre:He(r.pre,[n]),violations:[...r.violations,...i]}},{ephemeralKeys:new Set,pre:Lt,violations:[]}).violations}function nv(e){return e.kind==="goto"||e.kind==="upload"?[]:e.kind==="drag"?[e.source,e.target]:"locator"in e&&e.locator!=null?[e.locator]:[]}function iv(e,t){let r=S(de(e)),n=[...t.values()].filter(o=>o.subject.kind==="element"&&S(de(o.subject.locator))===r);if(n.length===0)return!1;let i=o=>n.some(s=>s.subject.kind==="element"&&s.subject.state===o&&s.expect.expect==="is"&&s.expect.value===!1);return!i("visible")&&!i("enabled")}function ov(e){return ei(e.expect).filter(t=>Qt(t)).flatMap(t=>Rp(t)).map(t=>S(de(t)))}function Rp(e){return e.kind==="not"?Rp(e.predicate):"locator"in e?[e.locator]:[]}function vp(e){let t=Xe(e);return J(e).flatMap(({test:r})=>[...cv(r.steps,ne(r),t),...sv(r.steps,r.actor,ne(r))])}function sv(e,t,r){return e.reduce((n,i,o)=>{let s=i.action.kind==="actor"?{alias:i.action.ref.ref,kind:"user"}:n.actor,a=av(i).filter(l=>lv(l.target,s)).map(l=>({predicate:l,stepIndex:o,test:r}));return{actor:Zr(n.actor,[i]),flagged:[...n.flagged,...a]}},{actor:t,flagged:[]}).flagged}function av(e){return e.expect.filter(t=>t.kind==="actor")}function lv(e,t){return e.kind==="anonymous"?t.kind==="anonymous":t.kind==="user"&&t.alias===e.ref.ref}function cv(e,t,r){let n=oi(Lt,r),i=new Set(n.keys());return e.reduce((o,s,a)=>{let l=fv(s),c=uv({acc:o,assertions:l,stepIndex:a,test:t}),u=oi(He(o.pattern,[s]),r);return{assertedKeys:new Set([...dv({acc:o,assertions:l,pattern:u,step:s}),...i]),pattern:u,redundant:[...o.redundant,...c]}},{assertedKeys:i,pattern:n,redundant:[]}).redundant}function uv({acc:e,assertions:t,stepIndex:r,test:n}){return t.reduce((i,{entry:o,predicate:s})=>{let a=v(o.subject),l=S(o.expect),c=e.pattern.get(a),u=c!=null&&e.assertedKeys.has(a)&&S(c.expect)===l,d=i.seen.get(a)===l;return{flagged:u||d?[...i.flagged,{predicate:s,stepIndex:r,test:n}]:i.flagged,seen:new Map([...i.seen,[a,l]])}},{flagged:[],seen:new Map}).flagged}function dv({acc:e,assertions:t,pattern:r,step:n}){let i=new Set([...pv(n),...Hr(n)].map(a=>v(a.subject))),o=[...e.assertedKeys].filter(a=>r.has(a)&&!i.has(a)),s=t.map(({entry:a})=>v(a.subject)).filter(a=>r.has(a));return new Set([...o,...s])}function pv(e){return e.action.kind==="goto"?Kr(e.action.url):[]}function fv(e){return Et(e.expect).flatMap(t=>{if(t.kind==="actor")return[];let r=he(t);return r==null?[]:[{entry:r,predicate:t}]})}var hv=2;function xp(e){return J(e).flatMap(({test:t})=>t.steps.reduce((n,i,o)=>{let s=mv(i,n.pre),a=s.length>=hv?[...n.violations,{hidden:s,stepIndex:o,test:ne(t)}]:n.violations;return{pre:He(n.pre,[i]),violations:a}},{pre:Lt,violations:[]}).violations)}function mv(e,t){return e.expect.flatMap(r=>{let n=yv(r);return n!=null&&!ma(n)&&gv(n,t)?[n]:[]})}function yv(e){return e.kind!=="not"||e.predicate.kind!=="visible"?null:e.predicate.locator}function ma(e){return e.by==="surface"?!0:e.by==="inside"?ma(e.scope)||ma(e.target):!1}function gv(e,t){let r=t.get(v({kind:"element",locator:e,state:"visible"}));return r!=null&&r.expect.expect==="is"&&r.expect.value===!0}function Ep(e){return J(e).flatMap(({test:t})=>{let r=ne(t);return t.steps.reduce((n,i,o)=>Sv(n,i,o,r),{found:[],open:new Set}).found})}function Sv(e,t,r,n){let i=t.action.kind==="goto"?new Set:e.open,o=kp(t,bv),s=kp(t,wv),a=new Set([...i,...o].filter(c=>!s.has(c))),l=Rv(t).flatMap(c=>a.has(S(de(c.surface)))?[]:[{...c,stepIndex:r,test:n}]);return{found:[...e.found,...l],open:a}}function kp(e,t){return new Set(e.expect.flatMap(r=>{let n=t(r);return n==null?[]:[S(de(n))]}))}function bv(e){return e.kind!=="visible"?null:e.locator.by==="surface"?e.locator:null}function wv(e){return e.kind!=="not"||e.predicate.kind!=="visible"?null:e.predicate.locator.by==="surface"?e.predicate.locator:null}function Rv(e){return e.expect.flatMap(t=>{if(t.kind!=="visible"||t.locator.by!=="inside")return[];let r=Cp(t.locator);return r==null?[]:[{content:t.locator,surface:r}]})}function Cp(e){return e.by!=="inside"?null:e.scope.by==="surface"?e.scope:Cp(e.scope)}function Pp(e){switch(e.kind){case"cascade-gap":{let{gap:t}=e;return`${oe("data rule")} ${t.transition} deletes ${t.target} but leaves ${t.source} rows pointing at it, breaking ${Ut(t.dataRule)}. Cascade the delete or declare the cleanup.`}case"create-gap":return vv(e.gap);case"unreachable-interaction":{let{violation:t}=e,r=ue(t.target);return t.ephemeralOnly?`${oe("reachability")} ${t.test}: ${rn(t.action)}, but ${r} was only declared inside ephemeral(...), which grants no reachability. Assert a durable visible(...) first.`:`${oe("reachability")} ${t.test}: ${rn(t.action)}, but no prior step declared ${r} reachable. Assert visible(...) on it first.`}case"redundant-assertion":{let{redundancy:t}=e;return`${oe("redundancy")} ${t.test}: step ${String(t.stepIndex+1)} restates "${ft(t.predicate)}" \u2014 already asserted and unchanged since. Delete it.`}case"missing-precondition":{let{missing:t}=e;return`${oe("precondition")} ${t.test}: step ${String(t.stepIndex+1)} updates ${t.entity}.${t.field} but no earlier step or seed establishes its prior value. Set it on the step that creates the row, or seed it (a value, arbitrary(...), or null) \u2014 don't split the journey into a separate workflow.`}case"fact-conflict":return xv(e.conflict);case"unmodeled-surface":{let{surface:t}=e,r=t.hidden.map(n=>ue(n)).join(", ");return`${oe("surface")} ${t.test}: step ${String(t.stepIndex+1)} hides ${String(t.hidden.length)} elements at once (${r}). Elements hidden together are one surface \u2014 declare surface(...) and scope them to it.`}case"unpinned-surface-content":{let{content:t}=e,r=ue(t.surface);return`${oe("surface")} ${t.test}: step ${String(t.stepIndex+1)} asserts ${ue(t.content)} but never opens ${r}. A content fact holds only while its surface is active \u2014 assert visible(${r}) here or on a prior open step.`}}}function vv(e){let t=e.missing.length===1?"field":"fields",r=e.missing.length===1?"it":"them";return`${oe("data rule")} ${e.transition} creates ${e.entity} without required ${t} ${e.missing.join(", ")}. Set ${r} or drop the requirement.`}function xv(e){return[`${oe("fact")} Two facts contradict on overlapping states \u2014 "${ft(e.a)}" vs "${ft(e.b)}".`,` Shared state: ${wi(e.when)}.`,Ap(e.a,e.aProducers,e.when),Ap(e.b,e.bProducers,e.when),"The learned fact keeps only conditions all producers share \u2014 add the missing pin to the broad producer, or split with a when branch."].join(`
|
|
5
|
-
`)}function Ap(e,t,r){let n=t.map(i=>` - ${i.test} adds ${Td(i.when,r)}`);return[` "${ft(e)}" declared by:`,...n].join(`
|
|
6
|
-
`)}var kv=24301;function Ui(e,t){return e.reduce((r,n)=>Pv(r,t[n.idx]?.paramSpaces),new Map)}function yr(e,t){return Object.fromEntries(Object.entries(e.paramSpaces).map(([r,n])=>[r,Ev(n,n?.name==null?0:t.get(n.name)??0)]))}var Mp=new WeakMap;function Ev(e,t){if(e==null)return Op(void 0,t);let r=Mp.get(e)??new Map;Mp.set(e,r);let n=r.get(t);if(n!=null)return n;let i=Op(e,t);return r.set(t,i),i}function Cv(e){return e==null?Ov(10):e.kind==="enum"?nt.constantFrom(...e.values):e.kind==="number"?nt.integer({max:e.max,min:e.min}):e.kind==="boolean"?nt.boolean():e.kind==="datetime"?Iv():Av(e)}function Op(e,t){let[r]=nt.sample(Cv(e),{numRuns:1,seed:kv+t});if(r==null)throw new Error("arbitrary produced no sample");return r}function Av(e){let t=e.refine??e.pattern;return nt.stringMatching(new RegExp(`^(?:${t})$`,"u")).filter(r=>(e.minLength==null||r.length>=e.minLength)&&(e.maxLength==null||r.length<=e.maxLength))}function Pv(e,t){return t==null?e:Object.values(t).reduce((r,n)=>n==null?r:new Map([...r,[n.name,(r.get(n.name)??0)+1]]),e)}var Mv="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],Ov=e=>nt.array(nt.constantFrom(...Mv),{maxLength:e,minLength:1}).map(t=>t.join(""));function Iv(){return nt.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())}var Tv=new Map;function zi(e){return yr(e,Tv)}import{z as L}from"zod";var gr=L.enum(["crash","data-rule","fact","frame","model-drift"]),Ip=L.object({intent:L.string().min(1),test:L.string().min(1)}),Nv=L.union([L.object({kind:L.literal("scalar-mismatch"),subject:L.string().min(1)}),L.object({entity:L.string().min(1),kind:L.string().min(1)})]),$v=L.discriminatedUnion("kind",[L.object({kind:L.literal("consistency"),layer:gr,mismatch:Nv,step:Ip.nullable()}),L.object({kind:L.literal("pending-check"),layer:gr,source:L.string().min(1),step:Ip}),L.object({intent:L.string().min(1),kind:L.literal("unrunnable"),layer:gr,reason:L.string().min(1),test:L.string().min(1)}),L.object({error:L.string().min(1),kind:L.literal("driver-error"),layer:gr,step:L.string().min(1)}),L.object({kind:L.literal("impossible-action"),layer:gr,step:L.string().min(1)})]);function ya(e){return e.kind==="driver-error"?"crash":e.kind==="unrunnable"?"model-drift":e.kind==="pending-check"?e.source.kind==="data-rule"?"data-rule":e.source.kind==="fact"?"fact":"frame":"frame"}function cn(e,t){let r=t.map(o=>({finding:o,line:Ei(o),part:Np(o)})).toSorted((o,s)=>S(o.part).localeCompare(S(s.part))),n=r.map(o=>o.part),i=r.at(0)?.finding;return{layer:Fv(n),signature:S({baseState:e,parts:n.map(o=>S(o))}),sourceTest:i==null?void 0:Lv(i),title:r.at(0)?.line}}function Lv(e){switch(e.kind){case"pending-check":case"impossible-action":case"driver-error":return e.step.test;case"consistency":return e.step?.test;case"unrunnable":return e.test;case"lift-visibility":return}}var Tp={crash:0,"data-rule":1,fact:2,frame:3,"model-drift":4};function Np(e){let t=ya(e);switch(e.kind){case"consistency":return{kind:"consistency",layer:t,mismatch:Dv(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};case"lift-visibility":return{kind:"impossible-action",layer:t,step:`lift:${String(e.visibleIndex)}`}}}function Dv(e){return e.kind==="scalar-mismatch"?{kind:e.kind,subject:Vt(e.subject)}:{entity:e.entity,kind:e.kind}}function Fv(e){return e.map(r=>r.layer).toSorted((r,n)=>Tp[r]-Tp[n]).at(0)??"frame"}function Sa(e){let t=new Map(e.entities.flatMap(i=>Object.entries(i.props).flatMap(([o,s])=>s.valueSpace==null?[]:[[`${i.name}.${o}`,s.valueSpace]]))),r=new Map(e.singletons.flatMap(i=>i.valueSpace==null?[]:[[i.name,i.valueSpace]]));return e.workflows.flatMap(i=>i.steps.flatMap(o=>o.expect.flatMap(s=>Gi(s)))).reduce((i,o)=>{let s=o.kind==="field"?t.get(o.key):r.get(o.key);if(s==null)return i;let a=i.get(s)??[];return a.includes(o.value)?i:new Map([...i,[s,[...a,o.value]]])},new Map)}function Gi(e){return e.kind==="not"?Gi(e.predicate):e.kind==="and"?e.predicates.flatMap(t=>Gi(t)):e.kind!=="when"?[]:e.branches.flatMap(t=>[...t.condition==null?[]:ga(t.condition),...t.consequence.flatMap(r=>Gi(r))])}function ga(e){if(e.kind==="singleton"){let{value:t}=e.assertion;return t!==null&&typeof t!="object"?[{key:e.singleton,kind:"singleton",value:t}]:[]}return e.kind==="not"?ga(e.predicate):e.kind==="and"||e.kind==="or"?e.predicates.flatMap(t=>ga(t)):Object.entries(e.where).flatMap(([t,r])=>r===null||typeof r=="object"?[]:[{key:`${e.entity}.${t}`,kind:"field",value:r}])}import{z as $p}from"zod";var Lp=$p.object({maxAttemptLength:$p.number().int().positive()}),ba={even:{maxAttemptLength:12}};function Dp(e){return ba[e]}function qi(e){return{startingPoint:e.startingPoint.name,steps:Fp(e,e.startingPoint.snapshot,[])}}function Fp(e,t,r){if(r.length>=e.strategy.maxAttemptLength)return r;let n=ci(e.facts,t),i=Vi(e.corpus,{snapshot:n},Vv(e,r)),o=jv(i,e.corpus,e.random());return o==null?r:Fp(e,o.stepRun.next.snapshot,[...r,{idx:o.idx,params:o.params}])}var _v=.02;function jv(e,t,r){let n=e.map(a=>Bv(a.idx,t)),i=n.reduce((a,l)=>a+l,0);if(i<=0)return null;let o=r*i,s=n.reduce((a,l,c)=>{if(a.hit!=null)return a;let u=a.acc+l;return{acc:u,hit:u>o?c:null}},{acc:0,hit:null});return e[s.hit??e.length-1]??null}function Bv(e,t){return t[e]?.effectStep.action.kind==="goto"?_v:1}function Vv(e,t){let r=Ui(t,e.corpus);return n=>Uv({drawn:yr(n,r),params:e,prior:r,rule:n})}var Wv=3;function Uv({drawn:e,params:t,prior:r,rule:n}){return Object.fromEntries(Object.entries(e).map(([i,o])=>{let s=n.paramSpaces[i],a=s==null?void 0:t.literals.get(s.name);if(s==null||a==null||a.length===0)return[i,o];let l=r.get(s.name)??0;return l%Wv!==1?[i,o]:[i,a[l%a.length]??o]}))}function _p(e){return Math.max(9e4,e*1e4)}import{z as R}from"zod";var jp=R.object({baseStateTest:Tc,lockfileHash:R.string().min(1),stepRuns:R.array(R.object({idx:R.number().int().nonnegative(),params:R.record(R.string(),R.union([cs,R.null()]))}))}),Bp=R.object({baseStateRef:R.string().min(1),steps:R.array(R.object({index:R.number().int().nonnegative(),params:R.record(R.string(),R.union([cs,R.null()])),test:R.string().min(1)}))}),Vp=R.object({actions:R.array(R.string()),label:R.string().min(1)}),wa=R.object({test:R.string().min(1),text:R.string()}),Ki=R.object({baseLabel:R.string(),baseState:R.string().min(1),durationMs:R.number().int().nonnegative(),signature:R.string().optional(),steps:R.array(wa)}),Ra=R.enum(["driver","infra","trail"]),va=R.discriminatedUnion("source",[R.object({source:R.literal("empty-trail")}),R.object({source:R.literal("bad-assign")}),R.object({detail:R.string(),source:R.literal("config")}),R.object({source:R.literal("lockfile-stale")}),R.object({detail:R.string(),source:R.literal("transport")}),R.object({category:Ra,kind:R.string(),source:R.literal("runtime")})]);function Wp(e){switch(e.source){case"empty-trail":case"bad-assign":return"trail";case"config":case"lockfile-stale":case"transport":return"infra";case"runtime":return e.category}}var Up=R.discriminatedUnion("kind",[R.object({kind:R.literal("aborted")}),R.object({error:va,kind:R.literal("error")}),R.object({kind:R.literal("clean"),trail:Ki}),R.object({kind:R.literal("flaky"),trail:Ki}),R.object({kind:R.literal("seen"),trail:Ki}),R.object({kind:R.literal("finding"),runId:R.string().optional(),trail:Ki})]);function Hi(e,{sweep:t}){let r=Me(J(e),n=>S({a:n.test.actor,s:n.test.singletons,v:n.test.viewport,w:n.test.world})).map(n=>({name:n.ref,test:n.test}));return t?[...r,...r.flatMap(n=>Gv(n))]:r}function zv(e){return e.world.filter(t=>{let r={...e,world:e.world.filter(n=>n!==t)};return Mu(r).every(n=>ar(n)!==t.as)})}function Yi(e,t,r){return fr(e,t.test,r)}function Gv(e){return zv(e.test).map(t=>{let r={...t,as:`${t.as}~2`},n=`${e.name} +${t.entity}`;return{name:n,test:{...e.test,name:n,world:[...e.test.world,r]}}})}async function Xi(e){let t=Yr(e);if(t.length===0)return null;let r=Hi(e,{sweep:!1}),n=await qv(e,r);if(n.length===0)return null;let i=cr(e);return{corpus:t,facts:{facts:i.facts.filter(o=>!o.localConsequence),overlays:Xe(e),overrides:i.overrides},literals:Sa(e),startingPoints:n,startingPointTests:new Map(r.map(o=>[o.name,o.test]))}}function zp({lockfileHash:e,prepared:t,random:r,strategy:n}){let i=t.startingPoints[Math.floor(r()*t.startingPoints.length)];if(i==null)return null;let o=qi({corpus:t.corpus,facts:t.facts,literals:t.literals,random:r,startingPoint:i,strategy:n}),s=t.startingPointTests.get(o.startingPoint);return s==null||o.steps.length===0?null:{baseStateTest:s,lockfileHash:e,stepRuns:o.steps.map(a=>({idx:a.idx,params:a.params}))}}async function qv(e,t){let r={generate:_r,materialize:Fi(_r,e.valueSpaces),params:void 0,signIn:void 0};return(await Promise.all(t.map(async i=>(await Yi(e,i,r)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}import{createServer as sx}from"http";import{mkdir as ax,rm as lx,writeFile as cx}from"fs/promises";import ux from"path";import{z as D}from"zod";var dx="otlp-port",qp=D.object({key:D.string(),value:D.object({boolValue:D.boolean().optional(),doubleValue:D.number().optional(),intValue:D.union([D.string(),D.number()]).optional(),stringValue:D.string().optional()})}),px=D.object({attributes:D.array(qp).default([]),endTimeUnixNano:D.string(),kind:D.number().default(0),name:D.string(),parentSpanId:D.string().optional(),spanId:D.string(),startTimeUnixNano:D.string(),status:D.object({code:D.number(),message:D.string().optional()}).optional(),traceId:D.string()}),fx=D.object({resourceSpans:D.array(D.object({resource:D.object({attributes:D.array(qp).default([])}).optional(),scopeSpans:D.array(D.object({spans:D.array(px).default([])})).default([])})).default([])});async function xa({localDir:e,onRrwebBatch:t,onSpan:r,writePortFile:n}){let{port:i,server:o}=await hx({onRrwebBatch:t,onSpan:r}),s=ux.join(e,dx);return n&&(await ax(e,{recursive:!0}),await cx(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{n&&await lx(s,{force:!0}),await bx(o)}}}function hx(e){return new Promise((t,r)=>{let n=sx((i,o)=>{mx(i,o,e)});n.on("error",r),n.listen(0,()=>{let i=n.address();if(i==null||typeof i=="string"){r(new Error("otlp_receiver_no_port"));return}t({port:i.port,server:n})})})}function mx(e,t,r){let n=yx(e.url);if(n!=null){Gp(e).then(i=>{r.onRrwebBatch(n,i),Zi(t)}).catch(()=>{Zi(t)});return}Gp(e).then(i=>{gx(fx.parse(JSON.parse(i.toString("utf8"))),r.onSpan),Zi(t)}).catch(()=>{Zi(t)})}function yx(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function Gp(e){return new Promise((t,r)=>{let n=[];e.on("data",i=>{n.push(i)}),e.on("end",()=>{t(Buffer.concat(n))}),e.on("error",r)})}function Zi(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function gx(e,t){e.resourceSpans.flatMap(r=>r.scopeSpans).flatMap(r=>r.spans).forEach(r=>{t({attributes:Sx(r.attributes),durationMs:Number((BigInt(r.endTimeUnixNano)-BigInt(r.startTimeUnixNano))/1000000n),kind:"span",name:r.name,parentSpanId:r.parentSpanId,source:"server",spanId:r.spanId,spanKind:kc(r.kind),status:{code:Ec(r.status?.code??0),message:r.status?.message},timeNanos:r.startTimeUnixNano,traceId:r.traceId})})}function Sx(e){return Object.fromEntries(e.map(({key:t,value:r})=>[t,String(r.stringValue??r.intValue??r.doubleValue??r.boolValue??"")]))}function bx(e){return new Promise((t,r)=>{e.close(n=>{if(n==null){t();return}r(n)}),e.closeAllConnections()})}import{ResultAsync as un}from"neverthrow";function zt(e,t,r){if(t==null)throw new Error("action requires a locator");return ht(e,t,r)}function ht(e,t,r){if(t.by==="inside"){if(t.scope.by==="frame"){let o=ht(e,t.scope.element,{visibleOnly:!1});return ht(o.contentFrame(),t.target,r)}let i=ht(e,t.scope,r);return ht(i,t.target,r)}if(t.by==="surface")return ht(e,t.container,r);if(t.by==="frame")return ht(e,t.element,r);let n=t.by==="testId"?e.getByTestId(t.value):e.locator(ka(t.role,t.name));return r.visibleOnly?n.filter({visible:!0}):n}function ka(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}var Ea=3e4,Sr=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}},Gt=class extends Error{readyKey;timeoutMs;constructor(t,r){super("app-not-ready"),this.readyKey=t,this.timeoutMs=r}};function Ca(e){return{read:t=>wx(t,e),seedScript:t=>`globalThis[${JSON.stringify(Ic)}] = ${JSON.stringify(t)};`}}async function wx(e,t){let r=Ae(or(e.url()),Kp([[{kind:"title"},await e.title()],[{kind:"viewport"},kx(e.viewportSize())]]));if(t.length===0)return{scalars:r};let n=await e.evaluate(vx,{mountKey:us,names:t,timeoutMs:Rx});if(n.kind==="unmounted")throw new Sr(us);let i=Kp(Object.entries(n.values).map(([o,s])=>[{kind:"variable",name:o},s]));return{scalars:Ae(r,i)}}function Kp(e){return new Map(e.flatMap(([t,r])=>r===void 0?[]:[[v(t),{declared:!0,expect:{expect:"is",value:r},subject:t}]]))}var Rx=Ea;async function vx(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(n=>setTimeout(n,25));let r=Reflect.get(globalThis,e.mountKey);return r==null?{kind:"unmounted"}:{kind:"values",values:Object.fromEntries(e.names.map(n=>[n,r.readSingleton(n)??null]))}}var xx=768;function kx(e){return e==null?"":e.width<xx?"mobile":"desktop"}async function Ji({page:e,readiness:t,signal:r,startMs:n,tries:i,url:o}){if(Oe(r),!await Ex(e,o)){if(Date.now()-n>=t.budgetMs)throw new Gt(Wn,t.budgetMs);let a=t.backoffMs[Math.min(i,t.backoffMs.length-1)]??8e3;await Mt(a,r),await Ji({page:e,readiness:t,signal:r,startMs:n,tries:i+1,url:o});return}let s=Math.max(0,t.budgetMs-(Date.now()-n));if(!await Mx(e,r,Math.min(s,Ax(t,i)))){if(Date.now()-n>=t.budgetMs)throw new Gt(Wn,t.budgetMs);await Ji({page:e,readiness:t,signal:r,startMs:n,tries:i+1,url:o})}}function Aa(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 Qi(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)}async function Ex(e,t){let r=await Cx(e,t);return r==="net-error"?!1:r==null||r.status()<400}async function Cx(e,t){try{return await e.goto(t,{waitUntil:"domcontentloaded"})}catch(r){if(Aa(r))return"net-error";throw r}}function Ax(e,t){return t===0?e.budgetMs/2:e.budgetMs}var Px=50;async function Mx(e,t,r){let n=Date.now()+r;for(;Date.now()<n;){if(Oe(t),await Hp(e))return!0;await Mt(Px,t)}return Hp(e)}async function Hp(e){try{return await e.evaluate(Ox,Wn)}catch(t){if(Qi(t))return!1;throw t}}function Ox(e){return Reflect.get(globalThis,e)===!0}async function Pa(e,t,r){if(r.kind==="browser")return Nx(e,t,r.key,r.value);if(r.kind==="not")return!await Pa(e,t,r.inner);let n=zt(e,r.locator,{visibleOnly:!0});return r.kind==="value"?Yp(await n.inputValue(),r.value,r.match):r.kind==="text"?Yp(await n.textContent()??"",r.value,r.match):r.kind==="unobstructed"?Ix(n):Tx(n,r.kind)}function Yp(e,t,r){let n=ir(e),i=ir(t);return r==="contains"?n.includes(i):r==="startsWith"?n.startsWith(i):n===i}function Ix(e){return e.evaluate(t=>{let r=t.getBoundingClientRect(),n=t.ownerDocument.defaultView;if(n==null||r.width<=0||r.height<=0)return!1;let i=2,o=Math.min(9,Math.max(3,Math.round(r.width/12))),s=Math.min(5,Math.max(2,Math.round(r.height/12))),a=(u,d,p)=>Array.from({length:p},(m,y)=>u+i+(d-i*2)*y/(p-1)),c=a(r.left,r.width,o).flatMap(u=>a(r.top,r.height,s).map(d=>({x:u,y:d}))).filter(u=>u.x>=0&&u.y>=0&&u.x<=n.innerWidth&&u.y<=n.innerHeight);return c.length===0?!1:c.every(u=>{let d=t.ownerDocument.elementFromPoint(u.x,u.y);return d!=null&&(d===t||t.contains(d)||d.contains(t))})})}function Tx(e,t){return t==="visible"?e.isVisible():t==="disabled"?e.isDisabled():t==="enabled"?e.isEnabled():t==="checked"?e.isChecked():t==="expanded"?Xp(e,r=>r.getAttribute("aria-expanded")==="true"):t==="pressed"?Xp(e,r=>r.getAttribute("aria-pressed")==="true"):e.evaluate(r=>r===r.ownerDocument.activeElement)}async function Xp(e,t){return await e.count()===0?!1:e.evaluate(t)}async function Nx(e,t,r,n){let i=await t.read(e),o=le(i.scalars,r);return n===null?o===void 0:o===n}var Ma={backoffMs:[500,1e3,2e3,4e3,8e3],budgetMs:Ea},$x={readiness:Ma,readSession:void 0,switchActor:void 0};function Oa(e,t,r,n,{readiness:i,readSession:o,switchActor:s}=$x){return{awaitCheck:(a,l)=>un.fromPromise(Fx({check:a,engine:r,page:e,signal:n,timeoutMs:l}),c=>on(c)?{kind:"aborted"}:eo(c)),evaluate:a=>un.fromPromise(Jp(Ia(e,r,a),`check ${a.kind}`),eo),locateIds:a=>Xx(e,a),observe:a=>un.fromPromise(o==null?Promise.resolve(void 0):o(),eo).andThen(l=>t.read(l)).andThen(l=>un.fromPromise(Jp(Vx({backend:l,engine:r,page:e,tracked:a}),"observe"),eo)),perform:a=>un.fromPromise(tf(e,a,0,n,{readiness:i,switchActor:s}),l=>Lx(a,l))}}function eo(e){return e instanceof Sr?zn(e.mountKey):ws(e)}async function Ia(e,t,r){try{return await Pa(e,t,r)}catch(n){if(Qi(n))return!1;throw n}}function Lx(e,t){return t instanceof Gt?hs(t.readyKey,t.timeoutMs):t instanceof Sr?zn(t.mountKey):bs(e.kind,t)}var Dx=75;function Fx(e){return e.check.kind==="visible"?_x({locator:e.check.locator,page:e.page,signal:e.signal,timeoutMs:e.timeoutMs}):Qp(e,Date.now()+e.timeoutMs)}async function Qp(e,t){return Oe(e.signal),await Ia(e.page,e.engine,e.check)?!0:Date.now()>=t?!1:(await Mt(Dx,e.signal),Qp(e,t))}async function _x({locator:e,page:t,signal:r,timeoutMs:n}){try{return await Promise.race([zt(t,e,{visibleOnly:!0}).waitFor({state:"visible",timeout:n}),jx(r)]),!0}catch(i){if(Bx(i))return!1;throw i}}function jx(e){return new Promise((t,r)=>{if(e.aborted){r(new De);return}e.addEventListener("abort",()=>{r(new De)},{once:!0})})}function Bx(e){return e instanceof Error&&e.name==="TimeoutError"}async function Vx({backend:e,engine:t,page:r,tracked:n}){let i=await ef(r,t,0),o=await Wx(r,t,n);return{snapshot:{...e,scalars:new Map([...e.scalars,...i.scalars,...o])}}}async function Wx(e,t,r){let n=await Promise.all([...r.values()].filter(i=>i.subject.kind==="element").map(async i=>{let o=await Ux(e,t,i.subject);return[v(i.subject),{declared:!0,expect:{expect:"is",value:o},subject:i.subject}]}));return new Map(n)}async function Ux(e,t,r){return r.state==="value"||r.state==="text"?zx(e,r.locator,r.state):Ia(e,t,{kind:r.state,locator:r.locator})}async function zx(e,t,r){try{let n=zt(e,t,{visibleOnly:!0});return r==="value"?await n.inputValue():await n.textContent()??""}catch{return""}}var Gx=[100,250,500];async function ef(e,t,r){try{return await t.read(e)}catch(n){let i=Gx[r];if(i==null||!Qi(n))throw n;return await rf(i),ef(e,t,r+1)}}var Zp=35e3;function Jp(e,t){let r,n=new Promise((i,o)=>{r=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(Zp)}ms`))},Zp)});return Promise.race([e,n]).finally(()=>{clearTimeout(r)})}var qx=[250,750,2e3];async function tf(e,t,r,n,i){try{await Kx(e,t,n,i.readiness,i.switchActor)}catch(o){let s=qx[r];if(s==null||!Aa(o))throw o;await rf(s),await tf(e,t,r+1,n,i)}}async function Kx(e,t,r,n,i){if(t.kind==="actor"){if(i==null)throw new Error("this driver cannot switch actors");await i(Ot(t.actorRef,t,"actorRef"));return}if(t.kind==="goto"){await Ji({page:e,readiness:n,signal:r,startMs:Date.now(),tries:0,url:Ot(t.url,t,"url")});return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(Ot(t.key,t,"key"));return}let o=t.kind!=="upload";await Hx(e,zt(e,t.locator,{visibleOnly:o}),t)}function Ot(e,t,r){if(e==null)throw new Error(`action "${t.kind}" requires ${r}`);return e}function Hx(e,t,r){switch(r.kind){case"goto":throw new Error("goto must not be located");case"fill":return t.fill(String(Ot(r.value,r,"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 Yx(e,t,String(Ot(r.value,r,"value")));case"upload":return t.setInputFiles(Ot(r.files,r,"files"));case"press":return t.press(Ot(r.key,r,"key"));case"drag":return t.dragTo(zt(e,Ot(r.target,r,"target"),{visibleOnly:!0}));case"actor":throw new Error("actor switch must not be located")}}async function Yx(e,t,r){if(await t.evaluate(i=>i.tagName==="SELECT")){await t.selectOption(r);return}await t.click(),await t.fill(r),await e.locator(ka("option",r)).filter({visible:!0}).click()}function rf(e){return new Promise(t=>{setTimeout(t,e)})}async function Xx(e,t){if(t==null)return[];try{let r=ht(e,t,{visibleOnly:!1});if(await r.count()===0)return[];let n=await r.first().evaluate(Zx);return n>0?[n]:[]}catch{return[]}}function Zx(e){let t=globalThis.__ripploRrwebMirror;if(t!=null)return t.getId(e);let r=globalThis.top;if(r==null||typeof r!="object"||!("__ripploRrwebMirror"in r))return-1;let n=r.__ripploRrwebMirror;if(n==null||typeof n!="object"||!("getId"in n))return-1;let i=n.getId;if(typeof i!="function")return-1;let o=i.call(n,e);return typeof o=="number"?o:-1}import Jx from"path";var of={desktop:{height:720,width:1280},mobile:{height:844,width:390}};function sf(e){return of[e]}var nF=of.desktop;async function Ta({baseUrl:e,browser:t,capture:r,clientState:n,engine:i,fixturesDir:o,networkHeaders:s,observeActor:a,reader:l,session:c,signal:u,signInActor:d,viewport:p}){let m=await t.newContext({baseURL:e,ignoreHTTPSErrors:!0,reducedMotion:"reduce",storageState:c==null?void 0:{cookies:$a(c.cookies,e),origins:c.origins},viewport:p});s!=null&&await tk(m,e,s),c?.headers!=null&&await m.setExtraHTTPHeaders(c.headers),await m.addInitScript("globalThis.__name = globalThis.__name ?? ((target) => target);"),await m.addInitScript(i.seedScript(n));let y=r==null?rk():await r.hub.attach(m,r.runId),f=await m.newPage();y.onPage(f);let h=f,w=Qx({baseUrl:e,context:m,page:f,signInActor:d}),x=a?ek(e,m):void 0;return{context:m,driver:ok(nk(Oa(h,l,i,u,{readiness:Ma,readSession:x,switchActor:w}),o),y),emitAssertion:y.emitAssertion,close:()=>sk({context:m,handle:y})}}async function Na(e,t){let r=await lf(e,void 0);try{return await t(r)}finally{await r.close()}}async function af(e){let{chromium:t}=await import("playwright");return t.launchPersistentContext(e,{headless:!1,viewport:null})}function Qx({baseUrl:e,context:t,page:r,signInActor:n}){if(n!=null)return async i=>{let o=await n(i).match(s=>s,s=>{throw new Error(`actor switch failed: ${s.kind}`)});await t.clearCookies(),await t.addCookies($a(o.cookies,e)),o.headers!=null&&await t.setExtraHTTPHeaders(o.headers),await r.reload()}}function $a(e,t){let r=new URL(t).hostname;return e.map(n=>({...n,domain:r}))}function ek(e,t){return async()=>{let r=await t.cookies();return{cookies:$a(r,e),headers:void 0,origins:[]}}}async function tk(e,t,r){let n=new URL(t).host;await e.route(i=>i.host===n,i=>i.continue({headers:{...i.request().headers(),...r}}))}function rk(){return{emitAction:()=>{},emitAssertion:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function lf(e,t){let{chromium:r}=await import("playwright"),n=t==null?[]:[`--disk-cache-dir=${t}`,"--disk-cache-size=268435456"];return r.launch({args:n,headless:!e})}function to({cacheDir:e,headed:t}){let r;return{acquire:async()=>{let o=r;if(o!=null){let s=await o.catch(()=>{});if(s?.isConnected()===!0)return s;r===o&&(r=void 0)}return r??=lf(t,e),r},close:async()=>{let o=r;r=void 0,o!=null&&await o.then(s=>s.close()).catch(()=>{})}}}function nk(e,t){return{awaitCheck:e.awaitCheck,evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:r=>e.perform(ik(r,t))}}function ik(e,t){return e.kind!=="upload"||e.files==null?e:{...e,files:e.files.map(r=>Jx.join(t,r))}}function ok(e,t){return{awaitCheck:e.awaitCheck,evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:r=>(t.emitAction(r),e.perform(r))}}async function sk({context:e,handle:t}){await nf(t.finish()),await nf(e.close())}var ak=15e3;async function nf(e){let t,r=new Promise(n=>{t=setTimeout(n,ak)});await Promise.race([e.catch(()=>{}),r]).finally(()=>{clearTimeout(t)})}import{err as lk,ok as ck,Result as La}from"neverthrow";function Da(e,t,r){return{read:n=>r.read(e.map(i=>i.name),t,n).andThen(i=>uk(e,i))}}function uk(e,t){return La.combine(e.map(r=>dk(r,t.entities[r.name]??[]).map(n=>[r.name,n]))).map(r=>({entities:new Map(r),scalars:new Map([...hk(t.singletons),...mk(t.actor)])}))}function dk(e,t){let r=sn(e);return La.combine(t.map(n=>pk(n,e).map(i=>[i,fk(n,r)]))).map(n=>new Map(n))}function pk(e,t){return La.combine(t.identity.map(r=>{let n=e[r];return n==null?lk(ys(t.name,r)):ck(String(n))})).map(r=>r.join(":"))}function fk(e,t){let r=t.map(n=>[n,e[n]]).filter(n=>n[1]!=null);return Object.fromEntries(r)}function hk(e){return Object.entries(e).map(([t,r])=>[v({kind:"variable",name:t}),{declared:!0,expect:{expect:"is",value:r},subject:{kind:"variable",name:t}}])}function mk(e){return e==null?[]:[[v({kind:"actor"}),{declared:!1,expect:{expect:"is",value:e},subject:{kind:"actor"}}]]}var cf=wc(Ny(),1);import yk from"crypto";import{err as gk,errAsync as Fa,ok as Sk,ResultAsync as br}from"neverthrow";var bk=1e4,wk=[250,750,2e3],Rk=[500,1e3,2e3,3e3];function _a({baseUrl:e,extraHeaders:t,runId:r,secret:n},i){let o=new cf.Webhook(n),s=(a,l,c)=>vk({baseUrl:e,body:l,extraHeaders:t,path:a,retry:c.retry,schema:c.schema,signal:c.signal,webhook:o});return{query:{read:(a,l,c)=>s("/state",{entities:a,runId:r,session:c,singletons:l},{retry:"transient",schema:Dc,signal:i}).map(u=>({actor:u.actor,entities:u.entities,singletons:u.singletons}))},ready:()=>df(e,t,i,0),setupWorld:a=>s("/setup",{entities:a,runId:r},{retry:"connection",schema:$c,signal:i}).map(l=>l.rows),signIn:({entity:a,row:l})=>s("/sign-in",{entity:a,row:l,runId:r},{retry:"connection",schema:Lc,signal:i}).map(c=>c.session),teardown:()=>s("/teardown",{runId:r},{retry:"connection",schema:Fc,signal:void 0}).map(()=>{})}}function vk(e){return uf(e.retry,()=>Ck(e),0)}function uf(e,t,r){return t().orElse(n=>{let i=wk[r];return i==null||!kk(n,e)?Fa(n):br.fromSafePromise(pf(i)).andThen(()=>uf(e,t,r+1))})}function df(e,t,r,n){return br.fromPromise(fetch(e,{headers:t,method:"HEAD",signal:ff(r)}),i=>er("",i)).map(()=>{}).orElse(()=>{let i=Rk[n];return i==null||r.aborted?Fa(Ss(e)):br.fromSafePromise(pf(i)).andThen(()=>df(e,t,r,n+1))})}var xk=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function kk(e,t){return e.kind==="aborted"?!1:Ek(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function Ek(e){return e.kind==="engine-network"&&e.code!=null&&xk.has(e.code)}function pf(e){return new Promise(t=>{setTimeout(t,e)})}function Ck({baseUrl:e,body:t,extraHeaders:r,path:n,schema:i,signal:o,webhook:s}){let a=JSON.stringify(t);return br.fromPromise(fetch(`${e}${n}`,{body:a,headers:{...r,"Content-Type":"application/json",...Ak(s,a)},method:"PUT",signal:ff(o)}),l=>er(n,l)).andThen(l=>Pk(l,n)).andThen(l=>Mk(i,l,n)).mapErr(l=>o?.aborted===!0?Rs():l)}function Ak(e,t){let r=`msg_${yk.randomUUID()}`,n=new Date;return{"webhook-id":r,"webhook-signature":e.sign(r,n,t),"webhook-timestamp":String(Math.floor(n.getTime()/1e3))}}function ff(e){let t=AbortSignal.timeout(bk);return e==null?t:AbortSignal.any([e,t])}function Pk(e,t){return e.ok?br.fromPromise(e.json(),r=>er(t,r)):br.fromPromise(e.text().catch(()=>""),r=>er(t,r)).andThen(r=>Fa(fs(t,e.status,r)))}function Mk(e,t,r){let n=e.safeParse(t);return n.success?Sk(n.data):gk(ms(r,n.error))}import MO from"path";import{err as Jt,errAsync as OO,ok as $r,ResultAsync as pc}from"neverthrow";import Sy from"path";import{z as Be}from"zod";import Ok from"path";function hf({debugDir:e,runId:t,worker:r}){let n=Ok.join(e,t,"behavior.jsonl");return r.open({file:n,runId:t}),{close:i=>r.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(Ik(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:Tk(i.timeNanos)};r.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{r.rrwebBatch({data:i,runId:t})}}}function wr(e){return String(BigInt(Math.round(e))*1000000n)}function Ik(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function Tk(e){return Number(BigInt(e)/1000000n)}import{existsSync as Nk}from"fs";import{createRequire as $k}from"module";import{fileURLToPath as Lk}from"url";import{Worker as Dk}from"worker_threads";var Fk=$k(import.meta.url);function mf(e){let t=new Dk(_k(),{workerData:e});t.unref();let r=new Map,n={next:0};t.on("message",o=>{let s=r.get(o.seq);s!=null&&(r.delete(o.seq),s())});let i=o=>{t.postMessage(o)};return{close:({noticeLineIfNoRrweb:o,runId:s})=>{let a=n.next;return n.next+=1,new Promise(l=>{r.set(a,l),i({noticeLineIfNoRrweb:o,runId:s,seq:a,t:"close"})})},line:({line:o,runId:s,timeNanos:a})=>{i({line:o,runId:s,t:"line",timeNanos:a})},open:({file:o,runId:s})=>{i({file:o,runId:s,t:"open"})},rrwebBatch:({data:o,runId:s})=>{i({data:o,runId:s,t:"rrweb-batch"})},terminate:async()=>{await t.terminate()}}}function _k(){try{return Fk.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(r=>Lk(new URL(r,import.meta.url))),t=e.find(r=>Nk(r));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}import{readFile as jk}from"fs/promises";import{createRequire as Bk}from"module";import{fileURLToPath as Vk}from"url";var Wk=Bk(import.meta.url);function ja(e,t){try{return Wk.resolve(e)}catch{return Vk(new URL(`assets/${t}`,import.meta.url))}}var Uk=ja("@ripplo/browser-trace/bundle","browser-trace.js");async function gf(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await zk())}var yf;function zk(){return yf??=jk(Uk,{encoding:"utf8"}),yf}import{readFile as fO}from"fs/promises";var Gk=Object.defineProperty,qk=(e,t,r)=>t in e?Gk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t,r)=>qk(e,typeof t!="symbol"?t+"":t,r),Sf,Kk=Object.defineProperty,Hk=(e,t,r)=>t in e?Kk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bf=(e,t,r)=>Hk(e,typeof t!="symbol"?t+"":t,r),se=(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))(se||{}),wf={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Rf={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ro={},Yk=()=>!!globalThis.Zone;function Ul(e){if(ro[e])return ro[e];let t=globalThis[e],r=t.prototype,n=e in wf?wf[e]:void 0,i=!!(n&&n.every(a=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),o=e in Rf?Rf[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!Yk())return ro[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 c=l[e].prototype;return document.body.removeChild(a),c?ro[e]=c:r}catch{return r}}var Ba={};function St(e,t,r){var n;let i=`${e}.${String(r)}`;if(Ba[i])return Ba[i].call(t);let o=Ul(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(Ba[i]=s,s.call(t)):t[r]}var Va={};function Sh(e,t,r){let n=`${e}.${String(r)}`;if(Va[n])return Va[n].bind(t);let o=Ul(e)[r];return typeof o!="function"?t[r]:(Va[n]=o,o.bind(t))}function Xk(e){return St("Node",e,"ownerDocument")}function Zk(e){return St("Node",e,"childNodes")}function Jk(e){return St("Node",e,"parentNode")}function Qk(e){return St("Node",e,"parentElement")}function eE(e){return St("Node",e,"textContent")}function tE(e,t){return Sh("Node",e,"contains")(t)}function rE(e){return Sh("Node",e,"getRootNode")()}function nE(e){return!e||!("host"in e)?null:St("ShadowRoot",e,"host")}function iE(e){return e.styleSheets}function oE(e){return!e||!("shadowRoot"in e)?null:St("Element",e,"shadowRoot")}function sE(e,t){return St("Element",e,"querySelector")(t)}function aE(e,t){return St("Element",e,"querySelectorAll")(t)}function lE(){return Ul("MutationObserver").constructor}function cE(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var me={ownerDocument:Xk,childNodes:Zk,parentNode:Jk,parentElement:Qk,textContent:eE,contains:tE,getRootNode:rE,host:nE,styleSheets:iE,shadowRoot:oE,querySelector:sE,querySelectorAll:aE,mutationObserver:lE,patch:cE};function bh(e){return e.nodeType===e.ELEMENT_NODE}function yn(e){let t=e&&"host"in e&&"mode"in e&&me.host(e)||null;return!!(t&&"shadowRoot"in t&&me.shadowRoot(t)===e)}function gn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function uE(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 dE(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function el(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,i=>wh(i,r)).join("");return uE(n)}catch{return null}}function wh(e,t){if(fE(e)){let r;try{r=el(e.styleSheet)||dE(e)}catch{r=e.cssText}return e.styleSheet.href?Lo(r,e.styleSheet.href):r}else{let r=e.cssText;return hE(e)&&e.selectorText.includes(":")&&(r=pE(r)),t?Lo(r,t):r}}function pE(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function fE(e){return"styleSheet"in e}function hE(e){return"selectorText"in e}var To=class{constructor(){bf(this,"idNodeMap",new Map),bf(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function mE(){return new To}function No({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"",a=n&&Kt(n);return(t[r.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function Kt(e){return e.toLowerCase()}var vf="__rrweb_original__";function yE(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let i=0;i<e.height;i+=r){let o=t.getImageData,s=vf in o?o[vf]:o;if(new Uint32Array(s.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function $o(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Kt(t):null}function Rh(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(n);return i?.[1]??null}function gE(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var SE=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,bE=/^(?:[a-z+]+:)?\/\//i,wE=/^www\..*/i,RE=/^(data:)([^,]*),(.*)/i;function Lo(e,t){return(e||"").replace(SE,(r,n,i,o,s,a)=>{let l=i||s||a,c=n||o||"";if(!l)return r;if(bE.test(l)||wE.test(l))return`url(${c}${l}${c})`;if(RE.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${gE(t)+l}${c})`;let u=t.split("/"),d=l.split("/");u.pop();for(let p of d)p!=="."&&(p===".."?u.pop():u.push(p));return`url(${c}${u.join("/")}${c})`})}function no(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function vE(e,t,r=!1){let n=Array.from(t.childNodes),i=[],o=0;if(n.length>1&&e&&typeof e=="string"){let s=no(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let c=no(n[l].textContent,r),u=100,d=3;for(;d<c.length&&(c[d].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,d),1)!==-1);d++);for(;d<c.length;d++){let p=c.substring(0,d),m=s.split(p),y=-1;if(m.length===2)y=m[0].length;else if(m.length>2&&m[0]===""&&n[l-1].textContent!=="")y=s.indexOf(p,1);else if(m.length===1){if(p=p.substring(0,p.length-1),m=s.split(p),m.length<=1)return i.push(e),i;d=u+1}else d===c.length-1&&(y=s.indexOf(p));if(m.length>=2&&d>u){let f=n[l-1].textContent;if(f&&typeof f=="string"){let h=no(f).length;y=s.indexOf(p,h)}y===-1&&(y=m[0].length)}if(y!==-1){let f=Math.floor(y/a);for(;f>0&&f<e.length;){if(o+=1,o>50*n.length)return i.push(e),i;let h=no(e.substring(0,f),r);if(h.length===y){i.push(e.substring(0,f)),e=e.substring(f),s=s.substring(y);break}else h.length<y?f+=Math.max(1,Math.floor((y-h.length)/a)):f-=Math.max(1,Math.floor((h.length-y)*a))}break}}}}return i.push(e),i}function xE(e,t){return vE(e,t).join("/* rr_split */")}var kE=1,EE=new RegExp("[^a-z0-9-_:]"),bn=-2;function vh(){return kE++}function CE(e){if(e instanceof HTMLFormElement)return"form";let t=Kt(e.tagName);return EE.test(t)?"div":t}var Rr,xf,AE=/^[^ \t\n\r\u000c]+/,PE=/^[, \t\n\r\u000c]+/;function ME(e,t){if(t.trim()==="")return t;let r=0;function n(o){let s,a=o.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let i=[];for(;n(PE),!(r>=t.length);){let o=n(AE);if(o.slice(-1)===",")o=kr(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=kr(e,o);let a=!1;for(;;){let l=t.charAt(r);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return i.join(", ")}var kf=new WeakMap;function kr(e,t){return!t||t.trim()===""?t:zl(e,t)}function OE(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function zl(e,t){let r=kf.get(e);if(r||(r=e.createElement("a"),kf.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function xh(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?kr(e,n):r==="srcset"?ME(e,n):r==="style"?Lo(n,zl(e)):t==="object"&&r==="data"?kr(e,n):n)}function kh(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function IE(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function Do(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Do(me.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}return r?Do(me.parentNode(e),t,r):!1}function Eh(e,t,r,n){let i;if(bh(e)){if(i=e,!me.childNodes(i).length)return!1}else{if(me.parentElement(e)===null)return!1;i=me.parentElement(e)}try{if(typeof t=="string"){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Do(i,t,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function TE(e,t,r){let n=e.contentWindow;if(!n)return;let i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){let a=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function NE(e,t,r){let n=!1,i;try{i=e.sheet}catch{return}if(i)return;let o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}function $E(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:y,newlyAddedElement:f=!1,cssCaptured:h=!1}=t,w=LE(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:se.Document,childNodes:[],compatMode:e.compatMode}:{type:se.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:se.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return FE(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:m,keepIframeSrcFn:y,newlyAddedElement:f,rootId:w});case e.TEXT_NODE:return DE(e,{doc:r,needsMask:s,maskTextFn:c,rootId:w,cssCaptured:h});case e.CDATA_SECTION_NODE:return{type:se.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:se.Comment,textContent:me.textContent(e)||"",rootId:w};default:return!1}}function LE(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function DE(e,t){let{needsMask:r,maskTextFn:n,rootId:i,cssCaptured:o}=t,s=me.parentNode(e),a=s&&s.tagName,l="",c=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;return u?l="SCRIPT_PLACEHOLDER":o||(l=me.textContent(e),c&&l&&(l=Lo(l,zl(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,me.parentElement(e)):l.replace(/[\S]/g,"*")),{type:se.Text,textContent:l||"",rootId:i}}function FE(e,t){let{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:m}=t,y=IE(e,n,i),f=CE(e),h={},w=e.attributes.length;for(let g=0;g<w;g++){let k=e.attributes[g];kh(f,k.name,k.value)||(h[k.name]=xh(r,f,Kt(k.name),k.value))}if(f==="link"&&o){let g=Array.from(r.styleSheets).find(T=>T.href===e.href),k=null;g&&(k=el(g)),k&&(delete h.rel,delete h.href,h._cssText=k)}if(f==="style"&&e.sheet){let g=el(e.sheet);g&&(e.childNodes.length>1&&(g=xE(g,e)),h._cssText=g)}if(["input","textarea","select"].includes(f)){let g=e.value,k=e.checked;h.type!=="radio"&&h.type!=="checkbox"&&h.type!=="submit"&&h.type!=="button"&&g?h.value=No({element:e,type:$o(e),tagName:f,value:g,maskInputOptions:s,maskInputFn:a}):k&&(h.checked=k)}if(f==="option"&&(e.selected&&!s.select?h.selected=!0:delete h.selected),f==="dialog"&&e.open&&(h.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),f==="canvas"&&u){if(e.__context==="2d")yE(e)||(h.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let g=e.toDataURL(l.type,l.quality),k=r.createElement("canvas");k.width=e.width,k.height=e.height;let T=k.toDataURL(l.type,l.quality);g!==T&&(h.rr_dataURL=g)}}if(f==="img"&&c){Rr||(Rr=r.createElement("canvas"),xf=Rr.getContext("2d"));let g=e,k=g.currentSrc||g.getAttribute("src")||"<unknown-src>",T=g.crossOrigin,j=()=>{g.removeEventListener("load",j);try{Rr.width=g.naturalWidth,Rr.height=g.naturalHeight,xf.drawImage(g,0,0),h.rr_dataURL=Rr.toDataURL(l.type,l.quality)}catch(te){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?j():g.addEventListener("load",j);return}else console.warn(`Cannot inline img src=${k}! Error: ${te}`)}g.crossOrigin==="anonymous"&&(T?h.crossOrigin=T:g.removeAttribute("crossorigin"))};g.complete&&g.naturalWidth!==0?j():g.addEventListener("load",j)}if(["audio","video"].includes(f)){let g=h;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(p||(e.scrollLeft&&(h.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(h.rr_scrollTop=e.scrollTop)),y){let{width:g,height:k}=e.getBoundingClientRect();h={class:h.class,rr_width:`${g}px`,rr_height:`${k}px`}}f==="iframe"&&!d(h.src)&&(e.contentDocument||(h.rr_src=h.src),delete h.src);let x;try{customElements.get(f)&&(x=!0)}catch{}return{type:se.Element,tagName:f,attributes:h,childNodes:[],isSVG:OE(e)||void 0,needBlock:y,rootId:m,isCustom:x}}function z(e){return e==null?"":e.toLowerCase()}function Ch(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 _E(e,t){if(t.comment&&e.type===se.Comment)return!0;if(e.type===se.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"&&Rh(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||z(e.attributes.name)==="application-name"||z(e.attributes.rel)==="icon"||z(e.attributes.rel)==="apple-touch-icon"||z(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&z(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(z(e.attributes.property).match(/^(og|twitter|fb):/)||z(e.attributes.name).match(/^(og|twitter):/)||z(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(z(e.attributes.name)==="robots"||z(e.attributes.name)==="googlebot"||z(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(z(e.attributes.name)==="author"||z(e.attributes.name)==="generator"||z(e.attributes.name)==="framework"||z(e.attributes.name)==="publisher"||z(e.attributes.name)==="progid"||z(e.attributes.property).match(/^article:/)||z(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(z(e.attributes.name)==="google-site-verification"||z(e.attributes.name)==="yandex-verification"||z(e.attributes.name)==="csrf-token"||z(e.attributes.name)==="p:domain_verify"||z(e.attributes.name)==="verify-v1"||z(e.attributes.name)==="verification"||z(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Er(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:y={},inlineImages:f=!1,recordCanvas:h=!1,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:g=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:j=()=>!1,newlyAddedElement:te=!1,cssCaptured:W=!1}=t,{needsMask:G}=t,{preserveWhiteSpace:re=!0}=t;G||(G=Eh(e,s,a,G===void 0));let fe=$E(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:G,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:y,inlineImages:f,recordCanvas:h,keepIframeSrcFn:j,newlyAddedElement:te,cssCaptured:W});if(!fe)return console.warn(e,"not serialized"),null;let Ve;n.hasNode(e)?Ve=n.getId(e):_E(fe,m)||!re&&fe.type===se.Text&&!fe.textContent.replace(/^\s+|\s+$/gm,"").length?Ve=bn:Ve=vh();let N=Object.assign(fe,{id:Ve});if(n.add(e,N),Ve===bn)return null;w&&w(e);let Dr=!l;if(N.type===se.Element){Dr=Dr&&!N.needBlock,delete N.needBlock;let ie=me.shadowRoot(e);ie&&gn(ie)&&(N.isShadowHost=!0)}if((N.type===se.Document||N.type===se.Element)&&Dr){m.headWhitespace&&N.type===se.Element&&N.tagName==="head"&&(re=!1);let ie={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:G,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:y,inlineImages:f,recordCanvas:h,preserveWhiteSpace:re,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:g,onStylesheetLoad:k,stylesheetLoadTimeout:T,keepIframeSrcFn:j,cssCaptured:!1};if(!(N.type===se.Element&&N.tagName==="textarea"&&N.attributes.value!==void 0)){N.type===se.Element&&N.attributes._cssText!==void 0&&typeof N.attributes._cssText=="string"&&(ie.cssCaptured=!0);for(let Tt of Array.from(me.childNodes(e))){let We=Er(Tt,ie);We&&N.childNodes.push(We)}}let Ie=null;if(bh(e)&&(Ie=me.shadowRoot(e)))for(let Tt of Array.from(me.childNodes(Ie))){let We=Er(Tt,ie);We&&(gn(Ie)&&(We.isShadow=!0),N.childNodes.push(We))}}let Fr=me.parentNode(e);return Fr&&yn(Fr)&&gn(Fr)&&(N.isShadow=!0),N.type===se.Element&&N.tagName==="iframe"&&TE(e,()=>{let ie=e.contentDocument;if(ie&&x){let Ie=Er(ie,{doc:ie,mirror:n,blockClass:i,blockSelector:o,needsMask:G,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:y,inlineImages:f,recordCanvas:h,preserveWhiteSpace:re,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:g,onStylesheetLoad:k,stylesheetLoadTimeout:T,keepIframeSrcFn:j});Ie&&x(e,Ie)}},g),N.type===se.Element&&N.tagName==="link"&&typeof N.attributes.rel=="string"&&(N.attributes.rel==="stylesheet"||N.attributes.rel==="preload"&&typeof N.attributes.href=="string"&&Rh(N.attributes.href)==="css")&&NE(e,()=>{if(k){let ie=Er(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:G,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:y,inlineImages:f,recordCanvas:h,preserveWhiteSpace:re,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:g,onStylesheetLoad:k,stylesheetLoadTimeout:T,keepIframeSrcFn:j});ie&&k(e,ie)}},T),N}function jE(e,t){let{mirror:r=new To,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:p,slimDOM:m=!1,dataURLOptions:y,preserveWhiteSpace:f,onSerialize:h,onIframeLoad:w,iframeLoadTimeout:x,onStylesheetLoad:g,stylesheetLoadTimeout:k,keepIframeSrcFn:T=()=>!1}=t||{},j=u===!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}:u===!1?{password:!0}:u,te=Ch(m);return Er(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:j,maskTextFn:d,maskInputFn:p,slimDOMOptions:te,dataURLOptions:y,inlineImages:l,recordCanvas:c,preserveWhiteSpace:f,onSerialize:h,onIframeLoad:w,iframeLoadTimeout:x,onStylesheetLoad:g,stylesheetLoadTimeout:k,keepIframeSrcFn:T,newlyAddedElement:!1})}var BE=/(max|min)-device-(width|height)/,kF=new RegExp(BE.source,"g");function VE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function WE(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Gl={exports:{}},q=String,Ah=function(){return{isColorSupported:!1,reset:q,bold:q,dim:q,italic:q,underline:q,inverse:q,hidden:q,strikethrough:q,black:q,red:q,green:q,yellow:q,blue:q,magenta:q,cyan:q,white:q,gray:q,bgBlack:q,bgRed:q,bgGreen:q,bgYellow:q,bgBlue:q,bgMagenta:q,bgCyan:q,bgWhite:q}};Gl.exports=Ah();Gl.exports.createColors=Ah;var UE=Gl.exports,zE={},GE=Object.freeze(Object.defineProperty({__proto__:null,default:zE},Symbol.toStringTag,{value:"Module"})),_e=WE(GE),Ef=UE,Cf=_e,tl=class Ph extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof r<"u"&&typeof n<"u"&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ph)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=Ef.isColorSupported),Cf&&t&&(r=Cf(r));let n=r.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),s=String(o).length,a,l;if(t){let{bold:c,gray:u,red:d}=Ef.createColors(!0);a=p=>c(d(p)),l=p=>u(p)}else a=l=c=>c;return n.slice(i,o).map((c,u)=>{let d=i+1+u,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let m=l(p.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+c+`
|
|
7
|
-
`+m+a("^")}return" "+l(p)+c}).join(`
|
|
8
|
-
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
9
|
-
|
|
10
|
-
`+t+`
|
|
11
|
-
`),this.name+": "+this.message+t}},ql=tl;tl.default=tl;var Mn={};Mn.isClean=Symbol("isClean");Mn.my=Symbol("my");var Af={after:`
|
|
12
|
-
`,beforeClose:`
|
|
13
|
-
`,beforeComment:`
|
|
14
|
-
`,beforeDecl:`
|
|
15
|
-
`,beforeOpen:" ",beforeRule:`
|
|
16
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function qE(e){return e[0].toUpperCase()+e.slice(1)}var rl=class{constructor(t){this.builder=t}atrule(t,r){let n="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?n+=t.raws.afterName:i&&(n+=" "),t.nodes)this.block(t,n+i);else{let o=(t.raws.between||"")+(r?";":"");this.builder(n+i+o,t)}}beforeAfter(t,r){let n;t.type==="decl"?n=this.raw(t,null,"beforeDecl"):t.type==="comment"?n=this.raw(t,null,"beforeComment"):r==="before"?n=this.raw(t,null,"beforeRule"):n=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(n.includes(`
|
|
17
|
-
`)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Af[n];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[n]<"u")return s.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(t,n);{let a="raw"+qE(n);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[r],typeof i<"u")return!1})}return typeof i>"u"&&(i=Af[n]),s.rawCache[n]=i,i}rawBeforeClose(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return r=n.raws.after,r.includes(`
|
|
18
|
-
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawBeforeComment(t,r){let n;return t.walkComments(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
|
|
19
|
-
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(t,r){let n;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
|
|
20
|
-
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(t){let r;return t.walk(n=>{if(n.type!=="decl"&&(r=n.raws.between,typeof r<"u"))return!1}),r}rawBeforeRule(t){let r;return t.walk(n=>{if(n.nodes&&(n.parent!==t||t.first!==n)&&typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
21
|
-
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawColon(t){let r;return t.walkDecls(n=>{if(typeof n.raws.between<"u")return r=n.raws.between.replace(/[^\s:]/g,""),!1}),r}rawEmptyBody(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length===0&&(r=n.raws.after,typeof r<"u"))return!1}),r}rawIndent(t){if(t.raws.indent)return t.raws.indent;let r;return t.walk(n=>{let i=n.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof n.raws.before<"u"){let o=n.raws.before.split(`
|
|
22
|
-
`);return r=o[o.length-1],r=r.replace(/\S/g,""),!1}}),r}rawSemicolon(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(r=n.raws.semicolon,typeof r<"u"))return!1}),r}rawValue(t,r){let n=t[r],i=t.raws[r];return i&&i.value===n?i.raw:n}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)}},Mh=rl;rl.default=rl;var KE=Mh;function nl(e,t){new KE(t).stringify(e)}var Yo=nl;nl.default=nl;var{isClean:io,my:HE}=Mn,YE=ql,XE=Mh,ZE=Yo;function il(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let i=e[n],o=typeof i;n==="parent"&&o==="object"?t&&(r[n]=t):n==="source"?r[n]=i:Array.isArray(i)?r[n]=i.map(s=>il(s,r)):(o==="object"&&i!==null&&(i=il(i)),r[n]=i)}return r}var ol=class{constructor(t={}){this.raws={},this[io]=!1,this[HE]=!0;for(let r in t)if(r==="nodes"){this.nodes=[];for(let n of t[r])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[r]=t[r]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${r.input.from}:${r.start.line}:${r.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let r in t)this[r]=t[r];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let r=il(this);for(let n in t)r[n]=t[n];return r}cloneAfter(t={}){let r=this.clone(t);return this.parent.insertAfter(this,r),r}cloneBefore(t={}){let r=this.clone(t);return this.parent.insertBefore(this,r),r}error(t,r={}){if(this.source){let{end:n,start:i}=this.rangeBy(r);return this.source.input.error(t,{column:i.column,line:i.line},{column:n.column,line:n.line},r)}return new YE(t)}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:r==="root"?()=>t.root().toProxy():t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}}markDirty(){if(this[io]){this[io]=!1;let t=this;for(;t=t.parent;)t[io]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,r){let n=this.source.start;if(t.index)n=this.positionInside(t.index,r);else if(t.word){r=this.toString();let i=r.indexOf(t.word);i!==-1&&(n=this.positionInside(i,r))}return n}positionInside(t,r){let n=r||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)n[s]===`
|
|
23
|
-
`?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new XE().raw(this,t,r)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let r=this,n=!1;for(let i of t)i===this?n=!0:n?(this.parent.insertAfter(r,i),r=i):this.parent.insertBefore(r,i);n||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,r){let n={},i=r==null;r=r||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))n[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,r):l);else if(typeof a=="object"&&a.toJSON)n[s]=a.toJSON(null,r);else if(s==="source"){let l=r.get(a.input);l==null&&(l=o,r.set(a.input,o),o++),n[s]={end:a.end,inputId:l,start:a.start}}else n[s]=a}return i&&(n.inputs=[...r.keys()].map(s=>s.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=ZE){t.stringify&&(t=t.stringify);let r="";return t(this,n=>{r+=n}),r}warn(t,r,n){let i={node:this};for(let o in n)i[o]=n[o];return t.warn(r,i)}get proxyOf(){return this}},Xo=ol;ol.default=ol;var JE=Xo,sl=class extends JE{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]==="$"}},Zo=sl;sl.default=sl;var QE="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",eC=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},tC=(e=21)=>{let t="",r=e;for(;r--;)t+=QE[Math.random()*64|0];return t},rC={nanoid:tC,customAlphabet:eC},{SourceMapConsumer:Pf,SourceMapGenerator:Mf}=_e,{existsSync:nC,readFileSync:iC}=_e,{dirname:Wa,join:oC}=_e;function sC(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var al=class{constructor(t,r){if(r.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let n=r.map?r.map.prev:void 0,i=this.loadMap(r.from,n);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=Wa(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Pf(this.text)),this.consumerCache}decodeInline(t){let r=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(r.test(t)||n.test(t))return sC(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!r)return;let n=t.lastIndexOf(r.pop()),i=t.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(n,i)))}loadFile(t){if(this.root=Wa(t),nC(t))return this.mapFile=t,iC(t,"utf-8").toString().trim()}loadMap(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){let n=r(t);if(n){let i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(r instanceof Pf)return Mf.fromSourceMap(r).toString();if(r instanceof Mf)return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let n=this.annotation;return t&&(n=oC(Wa(t),n)),this.loadFile(n)}}}startWith(t,r){return t?t.substr(0,r.length)===r:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Oh=al;al.default=al;var{SourceMapConsumer:aC,SourceMapGenerator:lC}=_e,{fileURLToPath:Of,pathToFileURL:oo}=_e,{isAbsolute:ll,resolve:cl}=_e,{nanoid:cC}=rC,Ua=_e,If=ql,uC=Oh,za=Symbol("fromOffsetCache"),dC=!!(aC&&lC),Tf=!!(cl&&ll),Fo=class{constructor(t,r={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,r.from&&(!Tf||/^\w+:\/\//.test(r.from)||ll(r.from)?this.file=r.from:this.file=cl(r.from)),Tf&&dC){let n=new uC(this.css,r);if(n.text){this.map=n;let i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+cC(6)+">"),this.map&&(this.map.file=this.from)}error(t,r,n,i={}){let o,s,a;if(r&&typeof r=="object"){let c=r,u=n;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);r=d.line,n=d.col}else r=c.line,n=c.column;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);s=d.line,a=d.col}else s=u.line,a=u.column}else if(!n){let c=this.fromOffset(r);r=c.line,n=c.col}let l=this.origin(r,n,s,a);return l?o=new If(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 If(t,s===void 0?r:{column:n,line:r},s===void 0?n:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:n,endColumn:a,endLine:s,line:r,source:this.css},this.file&&(oo&&(o.input.url=oo(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let r,n;if(this[za])n=this[za];else{let o=this.css.split(`
|
|
24
|
-
`);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[za]=n}r=n[n.length-1];let i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<n[s])o=s-1;else if(t>=n[s+1])i=s+1;else{i=s;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:cl(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,n,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:r,line:t});if(!s.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:i,line:n}));let l;ll(s.source)?l=oo(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||oo(this.map.mapFile));let c={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(Of)c.file=Of(l);else throw new Error("file: protocol is not available in this PostCSS build");let u=o.sourceContentFor(s.source);return u&&(c.source=u),c}toJSON(){let t={};for(let r of["hasBOM","css","file","id"])this[r]!=null&&(t[r]=this[r]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},Jo=Fo;Fo.default=Fo;Ua&&Ua.registerInput&&Ua.registerInput(Fo);var{SourceMapConsumer:Ih,SourceMapGenerator:Co}=_e,{dirname:Ao,relative:Th,resolve:Nh,sep:$h}=_e,{pathToFileURL:Nf}=_e,pC=Jo,fC=!!(Ih&&Co),hC=!!(Ao&&Nh&&Th&&$h),mC=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let r=`
|
|
25
|
-
`;this.css.includes(`\r
|
|
26
|
-
`)&&(r=`\r
|
|
27
|
-
`),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||Ao(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Ih(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),hC&&fC&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,r=>{t+=r}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Co.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Co({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 Co({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,r=1,n="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,c)=>{if(this.css+=a,l&&c!=="end"&&(i.generated.line=t,i.generated.column=r-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
|
|
28
|
-
`),r=a.length-s):r+=a.length,l&&c!=="start"){let u=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==u.last||u.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(r=>r.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?Ao(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=Ao(Nh(n,this.mapOpts.annotation)));let i=Th(n,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new pC(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let r=this.memoizedFileURLs.get(t);if(r)return r;if(Nf){let n=Nf(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;$h==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Lh=mC,yC=Xo,ul=class extends yC{constructor(t){super(t),this.type="comment"}},Qo=ul;ul.default=ul;var{isClean:Dh,my:Fh}=Mn,_h=Zo,jh=Qo,gC=Xo,Bh,Kl,Hl,Vh;function Wh(e){return e.map(t=>(t.nodes&&(t.nodes=Wh(t.nodes)),delete t.source,t))}function Uh(e){if(e[Dh]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Uh(t)}var yt=class zh extends gC{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=Wh(Bh(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 _h(t)]}else if(t.selector)t=[new Kl(t)];else if(t.name)t=[new Hl(t)];else if(t.text)t=[new jh(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Fh]||zh.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Dh]&&Uh(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};yt.registerParse=e=>{Bh=e};yt.registerRule=e=>{Kl=e};yt.registerAtRule=e=>{Hl=e};yt.registerRoot=e=>{Vh=e};var Ht=yt;yt.default=yt;yt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Hl.prototype):e.type==="rule"?Object.setPrototypeOf(e,Kl.prototype):e.type==="decl"?Object.setPrototypeOf(e,_h.prototype):e.type==="comment"?Object.setPrototypeOf(e,jh.prototype):e.type==="root"&&Object.setPrototypeOf(e,Vh.prototype),e[Fh]=!0,e.nodes&&e.nodes.forEach(t=>{yt.rebuild(t)})};var SC=Ht,Gh,qh,wn=class extends SC{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Gh(new qh,this,t).stringify()}};wn.registerLazyResult=e=>{Gh=e};wn.registerProcessor=e=>{qh=e};var Yl=wn;wn.default=wn;var $f={},Kh=function(t){$f[t]||($f[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},dl=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},Hh=dl;dl.default=dl;var bC=Hh,pl=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new bC(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},Xl=pl;pl.default=pl;var Ga=39,Lf=34,so=92,Df=47,ao=10,dn=32,lo=12,co=9,uo=13,wC=91,RC=93,vC=40,xC=41,kC=123,EC=125,CC=59,AC=42,PC=58,MC=64,po=/[\t\n\f\r "#'()/;[\\\]{}]/g,fo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,OC=/.[\r\n"'(/\\]/,Ff=/[\da-f]/i,IC=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,c,u,d,p,m,y,f=n.length,h=0,w=[],x=[];function g(){return h}function k(W){throw t.error("Unclosed "+W,h)}function T(){return x.length===0&&h>=f}function j(W){if(x.length)return x.pop();if(h>=f)return;let G=W?W.ignoreUnclosed:!1;switch(o=n.charCodeAt(h),o){case ao:case dn:case co:case uo:case lo:{s=h;do s+=1,o=n.charCodeAt(s);while(o===dn||o===ao||o===co||o===uo||o===lo);y=["space",n.slice(h,s)],h=s-1;break}case wC:case RC:case kC:case EC:case PC:case CC:case xC:{let re=String.fromCharCode(o);y=[re,re,h];break}case vC:{if(p=w.length?w.pop()[1]:"",m=n.charCodeAt(h+1),p==="url"&&m!==Ga&&m!==Lf&&m!==dn&&m!==ao&&m!==co&&m!==lo&&m!==uo){s=h;do{if(u=!1,s=n.indexOf(")",s+1),s===-1)if(i||G){s=h;break}else k("bracket");for(d=s;n.charCodeAt(d-1)===so;)d-=1,u=!u}while(u);y=["brackets",n.slice(h,s+1),h,s],h=s}else s=n.indexOf(")",h+1),l=n.slice(h,s+1),s===-1||OC.test(l)?y=["(","(",h]:(y=["brackets",l,h,s],h=s);break}case Ga:case Lf:{a=o===Ga?"'":'"',s=h;do{if(u=!1,s=n.indexOf(a,s+1),s===-1)if(i||G){s=h+1;break}else k("string");for(d=s;n.charCodeAt(d-1)===so;)d-=1,u=!u}while(u);y=["string",n.slice(h,s+1),h,s],h=s;break}case MC:{po.lastIndex=h+1,po.test(n),po.lastIndex===0?s=n.length-1:s=po.lastIndex-2,y=["at-word",n.slice(h,s+1),h,s],h=s;break}case so:{for(s=h,c=!0;n.charCodeAt(s+1)===so;)s+=1,c=!c;if(o=n.charCodeAt(s+1),c&&o!==Df&&o!==dn&&o!==ao&&o!==co&&o!==uo&&o!==lo&&(s+=1,Ff.test(n.charAt(s)))){for(;Ff.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===dn&&(s+=1)}y=["word",n.slice(h,s+1),h,s],h=s;break}default:{o===Df&&n.charCodeAt(h+1)===AC?(s=n.indexOf("*/",h+2)+1,s===0&&(i||G?s=n.length:k("comment")),y=["comment",n.slice(h,s+1),h,s],h=s):(fo.lastIndex=h+1,fo.test(n),fo.lastIndex===0?s=n.length-1:s=fo.lastIndex-2,y=["word",n.slice(h,s+1),h,s],w.push(y),h=s);break}}return h++,y}function te(W){x.push(W)}return{back:te,endOfFile:T,nextToken:j,position:g}},Yh=Ht,_o=class extends Yh{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)}},Zl=_o;_o.default=_o;Yh.registerAtRule(_o);var Xh=Ht,Zh,Jh,Ar=class extends Xh{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new Zh(new Jh,this,t).stringify()}};Ar.registerLazyResult=e=>{Zh=e};Ar.registerProcessor=e=>{Jh=e};var On=Ar;Ar.default=Ar;Xh.registerRoot(Ar);var Rn={comma(e){return Rn.split(e,[","],!0)},space(e){let t=[" ",`
|
|
29
|
-
`," "];return Rn.split(e,t)},split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",c=!1;for(let u of e)c?c=!1:u==="\\"?c=!0:a?u===l&&(a=!1):u==='"'||u==="'"?(a=!0,l=u):u==="("?s+=1:u===")"?s>0&&(s-=1):s===0&&t.includes(u)&&(o=!0),o?(i!==""&&n.push(i.trim()),i="",o=!1):i+=u;return(r||i!=="")&&n.push(i.trim()),n}},Qh=Rn;Rn.default=Rn;var em=Ht,TC=Qh,jo=class extends em{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return TC.comma(this.selector)}set selectors(t){let r=this.selector?this.selector.match(/,\s*/):null,n=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(n)}},Jl=jo;jo.default=jo;em.registerRule(jo);var NC=Zo,$C=IC,LC=Qo,DC=Zl,FC=On,_f=Jl,jf={empty:!0,space:!0};function _C(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var jC=class{constructor(t){this.input=t,this.root=new FC,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let r=new DC;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n,i,o,s=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),n=t[0],n==="("||n==="["?c.push(n==="("?")":"]"):n==="{"&&c.length>0?c.push("}"):n===c[c.length-1]&&c.pop(),c.length===0)if(n===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){a=!0;break}else if(n==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(r.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(r,"params",l),s&&(t=l[l.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let r=this.colon(t);if(r===!1)return;let n=0,i;for(let o=r-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(n+=1,n===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let r=0,n,i,o;for(let[s,a]of t.entries()){if(n=a,i=n[0],i==="("&&(r+=1),i===")"&&(r-=1),r===0&&i===":")if(!o)this.doubleColon(n);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=n}return!1}comment(t){let r=new LC;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;let n=t[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=i[2],r.raws.left=i[1],r.raws.right=i[3]}}createTokenizer(){this.tokenizer=$C(this.input)}decl(t,r){let n=new NC;this.init(n,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(i[3]||i[2]||_C(t)),n.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let c=t[0][0];if(c===":"||c==="space"||c==="comment")break;n.prop+=t.shift()[1]}n.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){n.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let c=t.length-1;c>=0;c--){if(o=t[c],o[1].toLowerCase()==="!important"){n.important=!0;let u=this.stringFrom(t,c);u=this.spacesFromEnd(t)+u,u!==" !important"&&(n.raws.important=u);break}else if(o[1].toLowerCase()==="important"){let u=t.slice(0),d="";for(let p=c;p>0;p--){let m=u[p][0];if(d.trim().indexOf("!")===0&&m!=="space")break;d=u.pop()[1]+d}d.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=d,t=u)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(n.raws.between+=s.map(c=>c[1]).join(""),s=[]),this.raw(n,"value",s.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let r=new _f;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}}init(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let r=!1,n=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],c=t;for(;c;){if(n=c[0],l.push(c),n==="("||n==="[")o||(o=c),s.push(n==="("?")":"]");else if(a&&i&&n==="{")o||(o=c),s.push("}");else if(s.length===0)if(n===";")if(i){this.decl(l,a);return}else break;else if(n==="{"){this.rule(l);return}else if(n==="}"){this.tokenizer.back(l.pop()),r=!0;break}else n===":"&&(i=!0);else n===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),s.length>0&&this.unclosedBracket(o),r&&i){if(!a)for(;l.length&&(c=l[l.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,r,n,i){let o,s,a=n.length,l="",c=!0,u,d;for(let p=0;p<a;p+=1)o=n[p],s=o[0],s==="space"&&p===a-1&&!i?c=!1:s==="comment"?(d=n[p-1]?n[p-1][0]:"empty",u=n[p+1]?n[p+1][0]:"empty",!jf[d]&&!jf[u]?l.slice(-1)===","?c=!1:l+=o[1]:c=!1):l+=o[1];if(!c){let p=n.reduce((m,y)=>m+y[1],"");t.raws[r]={raw:p,value:l}}t[r]=l}rule(t){t.pop();let r=new _f;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r}spacesAndCommentsFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)n=t.pop()[1]+n;return n}spacesAndCommentsFromStart(t){let r,n="";for(;t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)n+=t.shift()[1];return n}spacesFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],r==="space");)n=t.pop()[1]+n;return n}stringFrom(t,r){let n="";for(let i=r;i<t.length;i++)n+=t[i][1];return t.splice(r,t.length-r),n}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})}},BC=jC,VC=Ht,WC=BC,UC=Jo;function Bo(e,t){let r=new UC(e,t),n=new WC(r);try{n.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
|
|
30
|
-
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
|
|
31
|
-
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
|
|
32
|
-
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var Ql=Bo;Bo.default=Bo;VC.registerParse(Bo);var{isClean:et,my:zC}=Mn,GC=Lh,qC=Yo,KC=Ht,HC=Yl,YC=Kh,Bf=Xl,XC=Ql,ZC=On,JC={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},QC={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},eA={Once:!0,postcssPlugin:!0,prepare:!0},Pr=0;function pn(e){return typeof e=="object"&&typeof e.then=="function"}function tm(e){let t=!1,r=JC[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Pr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Pr,r+"Exit"]:[r,r+"Exit"]}function Vf(e){let t;return e.type==="document"?t=["Document",Pr,"DocumentExit"]:e.type==="root"?t=["Root",Pr,"RootExit"]:t=tm(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function fl(e){return e[et]=!1,e.nodes&&e.nodes.forEach(t=>fl(t)),e}var hl={},Mr=class rm{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=fl(r);else if(r instanceof rm||r instanceof Bf)i=fl(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=XC;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[zC]&&KC.rebuild(i)}this.result=new Bf(t,i,n),this.helpers={...hl,postcss:hl,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!QC[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!eA[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(pn(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[et];){t[et]=!0;let r=[Vf(t)];for(;r.length>0;){let n=this.visitTick(r);if(pn(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return pn(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=qC;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new GC(r,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let r=this.runOnRoot(t);if(pn(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[et];)t[et]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||YC("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(pn(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[et]){a[et]=!0,t.push(Vf(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Pr){n.nodes&&n.nodes.length&&(n[et]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[et]=!0;let r=tm(t);for(let n of r)if(n===Pr)t.nodes&&t.each(i=>{i[et]||this.walkSync(i)});else{let i=this.listeners[n];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Mr.registerPostcss=e=>{hl=e};var nm=Mr;Mr.default=Mr;ZC.registerLazyResult(Mr);HC.registerLazyResult(Mr);var tA=Lh,rA=Yo,nA=Kh,iA=Ql,oA=Xl,ml=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=rA;this.result=new oA(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new tA(o,i,this._opts,r);if(a.isMap()){let[l,c]=a.generate();l&&(this.result.css=l),c&&(this.result.map=c)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||nA("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,r=iA;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},sA=ml;ml.default=ml;var aA=sA,lA=nm,cA=Yl,uA=On,vn=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new aA(this,t,r):new lA(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},dA=vn;vn.default=vn;uA.registerProcessor(vn);cA.registerProcessor(vn);var pA=Zo,fA=Oh,hA=Qo,mA=Zl,yA=Jo,gA=On,SA=Jl;function xn(e,t){if(Array.isArray(e))return e.map(i=>xn(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:yA.prototype};o.map&&(o.map={...o.map,__proto__:fA.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>xn(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new gA(n);if(n.type==="decl")return new pA(n);if(n.type==="rule")return new SA(n);if(n.type==="comment")return new hA(n);if(n.type==="atrule")return new mA(n);throw new Error("Unknown node type: "+e.type)}var bA=xn;xn.default=xn;var wA=ql,im=Zo,RA=nm,vA=Ht,ec=dA,xA=Yo,kA=bA,om=Yl,EA=Hh,sm=Qo,am=Zl,CA=Xl,AA=Jo,PA=Ql,MA=Qh,lm=Jl,cm=On,OA=Xo;function F(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new ec(e)}F.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
33
|
-
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:
|
|
34
|
-
https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new ec().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return F([i(l)]).process(s,a)},i};F.stringify=xA;F.parse=PA;F.fromJSON=kA;F.list=MA;F.comment=e=>new sm(e);F.atRule=e=>new am(e);F.decl=e=>new im(e);F.rule=e=>new lm(e);F.root=e=>new cm(e);F.document=e=>new om(e);F.CssSyntaxError=wA;F.Declaration=im;F.Container=vA;F.Processor=ec;F.Document=om;F.Comment=sm;F.Warning=EA;F.AtRule=am;F.Result=CA;F.Input=AA;F.Rule=lm;F.Root=cm;F.Node=OA;RA.registerPostcss(F);var IA=F;F.default=F;var H=VE(IA);H.stringify;H.fromJSON;H.plugin;H.parse;H.list;H.document;H.comment;H.atRule;H.rule;H.decl;H.root;H.CssSyntaxError;H.Declaration;H.Container;H.Processor;H.Document;H.Comment;H.Warning;H.AtRule;H.Result;H.Input;H.Rule;H.Root;H.Node;var TA=Object.defineProperty,NA=(e,t,r)=>t in e?TA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Te=(e,t,r)=>NA(e,typeof t!="symbol"?t+"":t,r);function $A(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function LA(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var tc={exports:{}},K=String,um=function(){return{isColorSupported:!1,reset:K,bold:K,dim:K,italic:K,underline:K,inverse:K,hidden:K,strikethrough:K,black:K,red:K,green:K,yellow:K,blue:K,magenta:K,cyan:K,white:K,gray:K,bgBlack:K,bgRed:K,bgGreen:K,bgYellow:K,bgBlue:K,bgMagenta:K,bgCyan:K,bgWhite:K}};tc.exports=um();tc.exports.createColors=um;var DA=tc.exports,FA={},_A=Object.freeze(Object.defineProperty({__proto__:null,default:FA},Symbol.toStringTag,{value:"Module"})),je=LA(_A),Wf=DA,Uf=je,yl=class dm extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof r<"u"&&typeof n<"u"&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,dm)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=Wf.isColorSupported),Uf&&t&&(r=Uf(r));let n=r.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),s=String(o).length,a,l;if(t){let{bold:c,gray:u,red:d}=Wf.createColors(!0);a=p=>c(d(p)),l=p=>u(p)}else a=l=c=>c;return n.slice(i,o).map((c,u)=>{let d=i+1+u,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let m=l(p.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+c+`
|
|
35
|
-
`+m+a("^")}return" "+l(p)+c}).join(`
|
|
36
|
-
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
37
|
-
|
|
38
|
-
`+t+`
|
|
39
|
-
`),this.name+": "+this.message+t}},rc=yl;yl.default=yl;var In={};In.isClean=Symbol("isClean");In.my=Symbol("my");var zf={after:`
|
|
40
|
-
`,beforeClose:`
|
|
41
|
-
`,beforeComment:`
|
|
42
|
-
`,beforeDecl:`
|
|
43
|
-
`,beforeOpen:" ",beforeRule:`
|
|
44
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function jA(e){return e[0].toUpperCase()+e.slice(1)}var gl=class{constructor(t){this.builder=t}atrule(t,r){let n="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?n+=t.raws.afterName:i&&(n+=" "),t.nodes)this.block(t,n+i);else{let o=(t.raws.between||"")+(r?";":"");this.builder(n+i+o,t)}}beforeAfter(t,r){let n;t.type==="decl"?n=this.raw(t,null,"beforeDecl"):t.type==="comment"?n=this.raw(t,null,"beforeComment"):r==="before"?n=this.raw(t,null,"beforeRule"):n=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(n.includes(`
|
|
45
|
-
`)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return zf[n];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[n]<"u")return s.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(t,n);{let a="raw"+jA(n);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[r],typeof i<"u")return!1})}return typeof i>"u"&&(i=zf[n]),s.rawCache[n]=i,i}rawBeforeClose(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return r=n.raws.after,r.includes(`
|
|
46
|
-
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawBeforeComment(t,r){let n;return t.walkComments(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
|
|
47
|
-
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(t,r){let n;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
|
|
48
|
-
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(t){let r;return t.walk(n=>{if(n.type!=="decl"&&(r=n.raws.between,typeof r<"u"))return!1}),r}rawBeforeRule(t){let r;return t.walk(n=>{if(n.nodes&&(n.parent!==t||t.first!==n)&&typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
49
|
-
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawColon(t){let r;return t.walkDecls(n=>{if(typeof n.raws.between<"u")return r=n.raws.between.replace(/[^\s:]/g,""),!1}),r}rawEmptyBody(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length===0&&(r=n.raws.after,typeof r<"u"))return!1}),r}rawIndent(t){if(t.raws.indent)return t.raws.indent;let r;return t.walk(n=>{let i=n.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof n.raws.before<"u"){let o=n.raws.before.split(`
|
|
50
|
-
`);return r=o[o.length-1],r=r.replace(/\S/g,""),!1}}),r}rawSemicolon(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(r=n.raws.semicolon,typeof r<"u"))return!1}),r}rawValue(t,r){let n=t[r],i=t.raws[r];return i&&i.value===n?i.raw:n}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)}},pm=gl;gl.default=gl;var BA=pm;function Sl(e,t){new BA(t).stringify(e)}var es=Sl;Sl.default=Sl;var{isClean:ho,my:VA}=In,WA=rc,UA=pm,zA=es;function bl(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let i=e[n],o=typeof i;n==="parent"&&o==="object"?t&&(r[n]=t):n==="source"?r[n]=i:Array.isArray(i)?r[n]=i.map(s=>bl(s,r)):(o==="object"&&i!==null&&(i=bl(i)),r[n]=i)}return r}var wl=class{constructor(t={}){this.raws={},this[ho]=!1,this[VA]=!0;for(let r in t)if(r==="nodes"){this.nodes=[];for(let n of t[r])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[r]=t[r]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${r.input.from}:${r.start.line}:${r.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let r in t)this[r]=t[r];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let r=bl(this);for(let n in t)r[n]=t[n];return r}cloneAfter(t={}){let r=this.clone(t);return this.parent.insertAfter(this,r),r}cloneBefore(t={}){let r=this.clone(t);return this.parent.insertBefore(this,r),r}error(t,r={}){if(this.source){let{end:n,start:i}=this.rangeBy(r);return this.source.input.error(t,{column:i.column,line:i.line},{column:n.column,line:n.line},r)}return new WA(t)}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:r==="root"?()=>t.root().toProxy():t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}}markDirty(){if(this[ho]){this[ho]=!1;let t=this;for(;t=t.parent;)t[ho]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,r){let n=this.source.start;if(t.index)n=this.positionInside(t.index,r);else if(t.word){r=this.toString();let i=r.indexOf(t.word);i!==-1&&(n=this.positionInside(i,r))}return n}positionInside(t,r){let n=r||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)n[s]===`
|
|
51
|
-
`?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new UA().raw(this,t,r)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let r=this,n=!1;for(let i of t)i===this?n=!0:n?(this.parent.insertAfter(r,i),r=i):this.parent.insertBefore(r,i);n||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,r){let n={},i=r==null;r=r||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))n[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,r):l);else if(typeof a=="object"&&a.toJSON)n[s]=a.toJSON(null,r);else if(s==="source"){let l=r.get(a.input);l==null&&(l=o,r.set(a.input,o),o++),n[s]={end:a.end,inputId:l,start:a.start}}else n[s]=a}return i&&(n.inputs=[...r.keys()].map(s=>s.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=zA){t.stringify&&(t=t.stringify);let r="";return t(this,n=>{r+=n}),r}warn(t,r,n){let i={node:this};for(let o in n)i[o]=n[o];return t.warn(r,i)}get proxyOf(){return this}},ts=wl;wl.default=wl;var GA=ts,Rl=class extends GA{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]==="$"}},rs=Rl;Rl.default=Rl;var qA="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",KA=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},HA=(e=21)=>{let t="",r=e;for(;r--;)t+=qA[Math.random()*64|0];return t},YA={nanoid:HA,customAlphabet:KA},{SourceMapConsumer:Gf,SourceMapGenerator:qf}=je,{existsSync:XA,readFileSync:ZA}=je,{dirname:qa,join:JA}=je;function QA(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var vl=class{constructor(t,r){if(r.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let n=r.map?r.map.prev:void 0,i=this.loadMap(r.from,n);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=qa(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Gf(this.text)),this.consumerCache}decodeInline(t){let r=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(r.test(t)||n.test(t))return QA(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!r)return;let n=t.lastIndexOf(r.pop()),i=t.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(n,i)))}loadFile(t){if(this.root=qa(t),XA(t))return this.mapFile=t,ZA(t,"utf-8").toString().trim()}loadMap(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){let n=r(t);if(n){let i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(r instanceof Gf)return qf.fromSourceMap(r).toString();if(r instanceof qf)return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let n=this.annotation;return t&&(n=JA(qa(t),n)),this.loadFile(n)}}}startWith(t,r){return t?t.substr(0,r.length)===r:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},fm=vl;vl.default=vl;var{SourceMapConsumer:eP,SourceMapGenerator:tP}=je,{fileURLToPath:Kf,pathToFileURL:mo}=je,{isAbsolute:xl,resolve:kl}=je,{nanoid:rP}=YA,Ka=je,Hf=rc,nP=fm,Ha=Symbol("fromOffsetCache"),iP=!!(eP&&tP),Yf=!!(kl&&xl),Vo=class{constructor(t,r={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,r.from&&(!Yf||/^\w+:\/\//.test(r.from)||xl(r.from)?this.file=r.from:this.file=kl(r.from)),Yf&&iP){let n=new nP(this.css,r);if(n.text){this.map=n;let i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+rP(6)+">"),this.map&&(this.map.file=this.from)}error(t,r,n,i={}){let o,s,a;if(r&&typeof r=="object"){let c=r,u=n;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);r=d.line,n=d.col}else r=c.line,n=c.column;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);s=d.line,a=d.col}else s=u.line,a=u.column}else if(!n){let c=this.fromOffset(r);r=c.line,n=c.col}let l=this.origin(r,n,s,a);return l?o=new Hf(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 Hf(t,s===void 0?r:{column:n,line:r},s===void 0?n:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:n,endColumn:a,endLine:s,line:r,source:this.css},this.file&&(mo&&(o.input.url=mo(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let r,n;if(this[Ha])n=this[Ha];else{let o=this.css.split(`
|
|
52
|
-
`);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[Ha]=n}r=n[n.length-1];let i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<n[s])o=s-1;else if(t>=n[s+1])i=s+1;else{i=s;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:kl(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,n,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:r,line:t});if(!s.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:i,line:n}));let l;xl(s.source)?l=mo(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||mo(this.map.mapFile));let c={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(Kf)c.file=Kf(l);else throw new Error("file: protocol is not available in this PostCSS build");let u=o.sourceContentFor(s.source);return u&&(c.source=u),c}toJSON(){let t={};for(let r of["hasBOM","css","file","id"])this[r]!=null&&(t[r]=this[r]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},ns=Vo;Vo.default=Vo;Ka&&Ka.registerInput&&Ka.registerInput(Vo);var{SourceMapConsumer:hm,SourceMapGenerator:Po}=je,{dirname:Mo,relative:mm,resolve:ym,sep:gm}=je,{pathToFileURL:Xf}=je,oP=ns,sP=!!(hm&&Po),aP=!!(Mo&&ym&&mm&&gm),lP=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let r=`
|
|
53
|
-
`;this.css.includes(`\r
|
|
54
|
-
`)&&(r=`\r
|
|
55
|
-
`),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||Mo(t.file),i;this.mapOpts.sourcesContent===!1?(i=new hm(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),aP&&sP&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,r=>{t+=r}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Po.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Po({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 Po({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,r=1,n="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,c)=>{if(this.css+=a,l&&c!=="end"&&(i.generated.line=t,i.generated.column=r-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
|
|
56
|
-
`),r=a.length-s):r+=a.length,l&&c!=="start"){let u=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==u.last||u.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(r=>r.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?Mo(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=Mo(ym(n,this.mapOpts.annotation)));let i=mm(n,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new oP(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let r=this.memoizedFileURLs.get(t);if(r)return r;if(Xf){let n=Xf(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;gm==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Sm=lP,cP=ts,El=class extends cP{constructor(t){super(t),this.type="comment"}},is=El;El.default=El;var{isClean:bm,my:wm}=In,Rm=rs,vm=is,uP=ts,xm,nc,ic,km;function Em(e){return e.map(t=>(t.nodes&&(t.nodes=Em(t.nodes)),delete t.source,t))}function Cm(e){if(e[bm]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Cm(t)}var gt=class Am extends uP{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=Em(xm(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 Rm(t)]}else if(t.selector)t=[new nc(t)];else if(t.name)t=[new ic(t)];else if(t.text)t=[new vm(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[wm]||Am.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[bm]&&Cm(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};gt.registerParse=e=>{xm=e};gt.registerRule=e=>{nc=e};gt.registerAtRule=e=>{ic=e};gt.registerRoot=e=>{km=e};var Yt=gt;gt.default=gt;gt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,ic.prototype):e.type==="rule"?Object.setPrototypeOf(e,nc.prototype):e.type==="decl"?Object.setPrototypeOf(e,Rm.prototype):e.type==="comment"?Object.setPrototypeOf(e,vm.prototype):e.type==="root"&&Object.setPrototypeOf(e,km.prototype),e[wm]=!0,e.nodes&&e.nodes.forEach(t=>{gt.rebuild(t)})};var dP=Yt,Pm,Mm,kn=class extends dP{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Pm(new Mm,this,t).stringify()}};kn.registerLazyResult=e=>{Pm=e};kn.registerProcessor=e=>{Mm=e};var oc=kn;kn.default=kn;var Zf={},Om=function(t){Zf[t]||(Zf[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Cl=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},Im=Cl;Cl.default=Cl;var pP=Im,Al=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new pP(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},sc=Al;Al.default=Al;var Ya=39,Jf=34,yo=92,Qf=47,go=10,fn=32,So=12,bo=9,wo=13,fP=91,hP=93,mP=40,yP=41,gP=123,SP=125,bP=59,wP=42,RP=58,vP=64,Ro=/[\t\n\f\r "#'()/;[\\\]{}]/g,vo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,xP=/.[\r\n"'(/\\]/,eh=/[\da-f]/i,kP=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,c,u,d,p,m,y,f=n.length,h=0,w=[],x=[];function g(){return h}function k(W){throw t.error("Unclosed "+W,h)}function T(){return x.length===0&&h>=f}function j(W){if(x.length)return x.pop();if(h>=f)return;let G=W?W.ignoreUnclosed:!1;switch(o=n.charCodeAt(h),o){case go:case fn:case bo:case wo:case So:{s=h;do s+=1,o=n.charCodeAt(s);while(o===fn||o===go||o===bo||o===wo||o===So);y=["space",n.slice(h,s)],h=s-1;break}case fP:case hP:case gP:case SP:case RP:case bP:case yP:{let re=String.fromCharCode(o);y=[re,re,h];break}case mP:{if(p=w.length?w.pop()[1]:"",m=n.charCodeAt(h+1),p==="url"&&m!==Ya&&m!==Jf&&m!==fn&&m!==go&&m!==bo&&m!==So&&m!==wo){s=h;do{if(u=!1,s=n.indexOf(")",s+1),s===-1)if(i||G){s=h;break}else k("bracket");for(d=s;n.charCodeAt(d-1)===yo;)d-=1,u=!u}while(u);y=["brackets",n.slice(h,s+1),h,s],h=s}else s=n.indexOf(")",h+1),l=n.slice(h,s+1),s===-1||xP.test(l)?y=["(","(",h]:(y=["brackets",l,h,s],h=s);break}case Ya:case Jf:{a=o===Ya?"'":'"',s=h;do{if(u=!1,s=n.indexOf(a,s+1),s===-1)if(i||G){s=h+1;break}else k("string");for(d=s;n.charCodeAt(d-1)===yo;)d-=1,u=!u}while(u);y=["string",n.slice(h,s+1),h,s],h=s;break}case vP:{Ro.lastIndex=h+1,Ro.test(n),Ro.lastIndex===0?s=n.length-1:s=Ro.lastIndex-2,y=["at-word",n.slice(h,s+1),h,s],h=s;break}case yo:{for(s=h,c=!0;n.charCodeAt(s+1)===yo;)s+=1,c=!c;if(o=n.charCodeAt(s+1),c&&o!==Qf&&o!==fn&&o!==go&&o!==bo&&o!==wo&&o!==So&&(s+=1,eh.test(n.charAt(s)))){for(;eh.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===fn&&(s+=1)}y=["word",n.slice(h,s+1),h,s],h=s;break}default:{o===Qf&&n.charCodeAt(h+1)===wP?(s=n.indexOf("*/",h+2)+1,s===0&&(i||G?s=n.length:k("comment")),y=["comment",n.slice(h,s+1),h,s],h=s):(vo.lastIndex=h+1,vo.test(n),vo.lastIndex===0?s=n.length-1:s=vo.lastIndex-2,y=["word",n.slice(h,s+1),h,s],w.push(y),h=s);break}}return h++,y}function te(W){x.push(W)}return{back:te,endOfFile:T,nextToken:j,position:g}},Tm=Yt,Wo=class extends Tm{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)}},ac=Wo;Wo.default=Wo;Tm.registerAtRule(Wo);var Nm=Yt,$m,Lm,Or=class extends Nm{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new $m(new Lm,this,t).stringify()}};Or.registerLazyResult=e=>{$m=e};Or.registerProcessor=e=>{Lm=e};var Tn=Or;Or.default=Or;Nm.registerRoot(Or);var En={comma(e){return En.split(e,[","],!0)},space(e){let t=[" ",`
|
|
57
|
-
`," "];return En.split(e,t)},split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",c=!1;for(let u of e)c?c=!1:u==="\\"?c=!0:a?u===l&&(a=!1):u==='"'||u==="'"?(a=!0,l=u):u==="("?s+=1:u===")"?s>0&&(s-=1):s===0&&t.includes(u)&&(o=!0),o?(i!==""&&n.push(i.trim()),i="",o=!1):i+=u;return(r||i!=="")&&n.push(i.trim()),n}},Dm=En;En.default=En;var Fm=Yt,EP=Dm,Uo=class extends Fm{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return EP.comma(this.selector)}set selectors(t){let r=this.selector?this.selector.match(/,\s*/):null,n=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(n)}},lc=Uo;Uo.default=Uo;Fm.registerRule(Uo);var CP=rs,AP=kP,PP=is,MP=ac,OP=Tn,th=lc,rh={empty:!0,space:!0};function IP(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var TP=class{constructor(t){this.input=t,this.root=new OP,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let r=new MP;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n,i,o,s=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),n=t[0],n==="("||n==="["?c.push(n==="("?")":"]"):n==="{"&&c.length>0?c.push("}"):n===c[c.length-1]&&c.pop(),c.length===0)if(n===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){a=!0;break}else if(n==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(r.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(r,"params",l),s&&(t=l[l.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let r=this.colon(t);if(r===!1)return;let n=0,i;for(let o=r-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(n+=1,n===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let r=0,n,i,o;for(let[s,a]of t.entries()){if(n=a,i=n[0],i==="("&&(r+=1),i===")"&&(r-=1),r===0&&i===":")if(!o)this.doubleColon(n);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=n}return!1}comment(t){let r=new PP;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;let n=t[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=i[2],r.raws.left=i[1],r.raws.right=i[3]}}createTokenizer(){this.tokenizer=AP(this.input)}decl(t,r){let n=new CP;this.init(n,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(i[3]||i[2]||IP(t)),n.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let c=t[0][0];if(c===":"||c==="space"||c==="comment")break;n.prop+=t.shift()[1]}n.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){n.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let c=t.length-1;c>=0;c--){if(o=t[c],o[1].toLowerCase()==="!important"){n.important=!0;let u=this.stringFrom(t,c);u=this.spacesFromEnd(t)+u,u!==" !important"&&(n.raws.important=u);break}else if(o[1].toLowerCase()==="important"){let u=t.slice(0),d="";for(let p=c;p>0;p--){let m=u[p][0];if(d.trim().indexOf("!")===0&&m!=="space")break;d=u.pop()[1]+d}d.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=d,t=u)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(n.raws.between+=s.map(c=>c[1]).join(""),s=[]),this.raw(n,"value",s.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let r=new th;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}}init(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let r=!1,n=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],c=t;for(;c;){if(n=c[0],l.push(c),n==="("||n==="[")o||(o=c),s.push(n==="("?")":"]");else if(a&&i&&n==="{")o||(o=c),s.push("}");else if(s.length===0)if(n===";")if(i){this.decl(l,a);return}else break;else if(n==="{"){this.rule(l);return}else if(n==="}"){this.tokenizer.back(l.pop()),r=!0;break}else n===":"&&(i=!0);else n===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),s.length>0&&this.unclosedBracket(o),r&&i){if(!a)for(;l.length&&(c=l[l.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,r,n,i){let o,s,a=n.length,l="",c=!0,u,d;for(let p=0;p<a;p+=1)o=n[p],s=o[0],s==="space"&&p===a-1&&!i?c=!1:s==="comment"?(d=n[p-1]?n[p-1][0]:"empty",u=n[p+1]?n[p+1][0]:"empty",!rh[d]&&!rh[u]?l.slice(-1)===","?c=!1:l+=o[1]:c=!1):l+=o[1];if(!c){let p=n.reduce((m,y)=>m+y[1],"");t.raws[r]={raw:p,value:l}}t[r]=l}rule(t){t.pop();let r=new th;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r}spacesAndCommentsFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)n=t.pop()[1]+n;return n}spacesAndCommentsFromStart(t){let r,n="";for(;t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)n+=t.shift()[1];return n}spacesFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],r==="space");)n=t.pop()[1]+n;return n}stringFrom(t,r){let n="";for(let i=r;i<t.length;i++)n+=t[i][1];return t.splice(r,t.length-r),n}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})}},NP=TP,$P=Yt,LP=NP,DP=ns;function zo(e,t){let r=new DP(e,t),n=new LP(r);try{n.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
|
|
58
|
-
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
|
|
59
|
-
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
|
|
60
|
-
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var cc=zo;zo.default=zo;$P.registerParse(zo);var{isClean:tt,my:FP}=In,_P=Sm,jP=es,BP=Yt,VP=oc,WP=Om,nh=sc,UP=cc,zP=Tn,GP={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},qP={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},KP={Once:!0,postcssPlugin:!0,prepare:!0},Ir=0;function hn(e){return typeof e=="object"&&typeof e.then=="function"}function _m(e){let t=!1,r=GP[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Ir,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Ir,r+"Exit"]:[r,r+"Exit"]}function ih(e){let t;return e.type==="document"?t=["Document",Ir,"DocumentExit"]:e.type==="root"?t=["Root",Ir,"RootExit"]:t=_m(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Pl(e){return e[tt]=!1,e.nodes&&e.nodes.forEach(t=>Pl(t)),e}var Ml={},Tr=class jm{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=Pl(r);else if(r instanceof jm||r instanceof nh)i=Pl(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=UP;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[FP]&&BP.rebuild(i)}this.result=new nh(t,i,n),this.helpers={...Ml,postcss:Ml,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!qP[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!KP[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(hn(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[tt];){t[tt]=!0;let r=[ih(t)];for(;r.length>0;){let n=this.visitTick(r);if(hn(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return hn(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=jP;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new _P(r,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let r=this.runOnRoot(t);if(hn(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[tt];)t[tt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||WP("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(hn(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[tt]){a[tt]=!0,t.push(ih(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Ir){n.nodes&&n.nodes.length&&(n[tt]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[tt]=!0;let r=_m(t);for(let n of r)if(n===Ir)t.nodes&&t.each(i=>{i[tt]||this.walkSync(i)});else{let i=this.listeners[n];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Tr.registerPostcss=e=>{Ml=e};var Bm=Tr;Tr.default=Tr;zP.registerLazyResult(Tr);VP.registerLazyResult(Tr);var HP=Sm,YP=es,XP=Om,ZP=cc,JP=sc,Ol=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=YP;this.result=new JP(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new HP(o,i,this._opts,r);if(a.isMap()){let[l,c]=a.generate();l&&(this.result.css=l),c&&(this.result.map=c)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||XP("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,r=ZP;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},QP=Ol;Ol.default=Ol;var eM=QP,tM=Bm,rM=oc,nM=Tn,Cn=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new eM(this,t,r):new tM(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},iM=Cn;Cn.default=Cn;nM.registerProcessor(Cn);rM.registerProcessor(Cn);var oM=rs,sM=fm,aM=is,lM=ac,cM=ns,uM=Tn,dM=lc;function An(e,t){if(Array.isArray(e))return e.map(i=>An(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:cM.prototype};o.map&&(o.map={...o.map,__proto__:sM.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>An(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new uM(n);if(n.type==="decl")return new oM(n);if(n.type==="rule")return new dM(n);if(n.type==="comment")return new aM(n);if(n.type==="atrule")return new lM(n);throw new Error("Unknown node type: "+e.type)}var pM=An;An.default=An;var fM=rc,Vm=rs,hM=Bm,mM=Yt,uc=iM,yM=es,gM=pM,Wm=oc,SM=Im,Um=is,zm=ac,bM=sc,wM=ns,RM=cc,vM=Dm,Gm=lc,qm=Tn,xM=ts;function _(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new uc(e)}_.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
61
|
-
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:
|
|
62
|
-
https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new uc().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return _([i(l)]).process(s,a)},i};_.stringify=yM;_.parse=RM;_.fromJSON=gM;_.list=vM;_.comment=e=>new Um(e);_.atRule=e=>new zm(e);_.decl=e=>new Vm(e);_.rule=e=>new Gm(e);_.root=e=>new qm(e);_.document=e=>new Wm(e);_.CssSyntaxError=fM;_.Declaration=Vm;_.Container=mM;_.Processor=uc;_.Document=Wm;_.Comment=Um;_.Warning=SM;_.AtRule=zm;_.Result=bM;_.Input=wM;_.Rule=Gm;_.Root=qm;_.Node=xM;hM.registerPostcss(_);var kM=_;_.default=_;var Y=$A(kM);Y.stringify;Y.fromJSON;Y.plugin;Y.parse;Y.list;Y.document;Y.comment;Y.atRule;Y.rule;Y.decl;Y.root;Y.CssSyntaxError;Y.Declaration;Y.Container;Y.Processor;Y.Document;Y.Comment;Y.Warning;Y.AtRule;Y.Result;Y.Input;Y.Rule;Y.Root;Y.Node;var Il=class e{constructor(...t){Te(this,"parentElement",null),Te(this,"parentNode",null),Te(this,"ownerDocument"),Te(this,"firstChild",null),Te(this,"lastChild",null),Te(this,"previousSibling",null),Te(this,"nextSibling",null),Te(this,"ELEMENT_NODE",1),Te(this,"TEXT_NODE",3),Te(this,"nodeType"),Te(this,"nodeName"),Te(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var oh={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xo={},EM=()=>!!globalThis.Zone;function dc(e){if(xo[e])return xo[e];let t=globalThis[e],r=t.prototype,n=e in oh?oh[e]:void 0,i=!!(n&&n.every(a=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),o=e in sh?sh[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!EM())return xo[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let c=l[e].prototype;return document.body.removeChild(a),c?xo[e]=c:r}catch{return r}}var Xa={};function bt(e,t,r){var n;let i=`${e}.${String(r)}`;if(Xa[i])return Xa[i].call(t);let o=dc(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(Xa[i]=s,s.call(t)):t[r]}var Za={};function Km(e,t,r){let n=`${e}.${String(r)}`;if(Za[n])return Za[n].bind(t);let o=dc(e)[r];return typeof o!="function"?t[r]:(Za[n]=o,o.bind(t))}function CM(e){return bt("Node",e,"ownerDocument")}function AM(e){return bt("Node",e,"childNodes")}function PM(e){return bt("Node",e,"parentNode")}function MM(e){return bt("Node",e,"parentElement")}function OM(e){return bt("Node",e,"textContent")}function IM(e,t){return Km("Node",e,"contains")(t)}function TM(e){return Km("Node",e,"getRootNode")()}function NM(e){return!e||!("host"in e)?null:bt("ShadowRoot",e,"host")}function $M(e){return e.styleSheets}function LM(e){return!e||!("shadowRoot"in e)?null:bt("Element",e,"shadowRoot")}function DM(e,t){return bt("Element",e,"querySelector")(t)}function FM(e,t){return bt("Element",e,"querySelectorAll")(t)}function Hm(){return dc("MutationObserver").constructor}function Xt(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var E={ownerDocument:CM,childNodes:AM,parentNode:PM,parentElement:MM,textContent:OM,contains:IM,getRootNode:TM,host:NM,styleSheets:$M,shadowRoot:LM,querySelector:DM,querySelectorAll:FM,mutationObserver:Hm,patch:Xt};function Se(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var vr=`Please stop import mirror directly. Instead of that,\r
|
|
63
|
-
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
64
|
-
or you can use record.mirror to access the mirror instance during recording.`,ah={map:{},getId(){return console.error(vr),-1},getNode(){return console.error(vr),null},removeNodeFromMap(){console.error(vr)},has(){return console.error(vr),!1},reset(){console.error(vr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ah=new Proxy(ah,{get(e,t,r){return t==="map"&&console.error(vr),Reflect.get(e,t,r)}}));function Pn(e,t,r={}){let n=null,i=0;return function(...o){let s=Date.now();!i&&r.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(l,o)},a))}}function os(e,t,r,n,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>os(e,t,o||{},!0)}var Go=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Go=()=>new Date().getTime());function Ym(e){var t,r,n,i;let o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||o?.body&&((t=E.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o?.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:o?.documentElement.scrollTop||o?.body&&((n=E.parentElement(o.body))==null?void 0:n.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}function Xm(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Zm(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Jm(e){return e?e.nodeType===e.ELEMENT_NODE?e:E.parentElement(e):null}function be(e,t,r,n){if(!e)return!1;let i=Jm(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(Do(i,t,n))return!0}catch{}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function _M(e,t){return t.getId(e)!==-1}function Ja(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===bn}function Qm(e,t){if(yn(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=E.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?Qm(n,t):!0}function Tl(e){return!!e.changedTouches}function jM(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 ey(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ty(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Nl(e){return e?e instanceof Il&&"shadowRoot"in e?!!e.shadowRoot:!!E.shadowRoot(e):!1}var $l=class{constructor(){b(this,"id",1),b(this,"styleIDMap",new WeakMap),b(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function ry(e){var t;let r=null;return"getRootNode"in e&&((t=E.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&E.host(E.getRootNode(e))&&(r=E.host(E.getRootNode(e))),r}function BM(e){let t=e,r;for(;r=ry(t);)t=r;return t}function VM(e){let t=E.ownerDocument(e);if(!t)return!1;let r=BM(e);return E.contains(t,r)}function ny(e){let t=E.ownerDocument(e);return t?E.contains(t,e)||VM(e):!1}var P=(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))(P||{}),C=(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))(C||{}),ve=(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))(ve||{}),mt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(mt||{}),Nr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Nr||{}),xr=(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))(xr||{});var iy=(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))(iy||{});function lh(e){return"__ln"in e}var Ll=class{constructor(){b(this,"length",0),b(this,"head",null),b(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){let r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&lh(t.previousSibling)){let n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&lh(t.nextSibling)&&t.nextSibling.__ln.previous){let n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){let r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},ch=(e,t)=>`${e}@${t}`,Dl=class{constructor(){b(this,"frozen",!1),b(this,"locked",!1),b(this,"texts",[]),b(this,"attributes",[]),b(this,"attributeMap",new WeakMap),b(this,"removes",[]),b(this,"mapRemoves",[]),b(this,"movedMap",{}),b(this,"addedSet",new Set),b(this,"movedSet",new Set),b(this,"droppedSet",new Set),b(this,"removesSubTreeCache",new Set),b(this,"mutationCb"),b(this,"blockClass"),b(this,"blockSelector"),b(this,"maskTextClass"),b(this,"maskTextSelector"),b(this,"inlineStylesheet"),b(this,"maskInputOptions"),b(this,"maskTextFn"),b(this,"maskInputFn"),b(this,"keepIframeSrcFn"),b(this,"recordCanvas"),b(this,"inlineImages"),b(this,"slimDOMOptions"),b(this,"dataURLOptions"),b(this,"doc"),b(this,"mirror"),b(this,"iframeManager"),b(this,"stylesheetManager"),b(this,"shadowDomManager"),b(this,"canvasManager"),b(this,"processedNodeManager"),b(this,"unattachedDoc"),b(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),b(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set,n=new Ll,i=l=>{let c=l,u=bn;for(;u===bn;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},o=l=>{let c=E.parentNode(l);if(!c||!ny(l))return;let u=!1;if(l.nodeType===Node.TEXT_NODE){let y=c.tagName;if(y==="TEXTAREA")return;y==="STYLE"&&this.addedSet.has(c)&&(u=!0)}let d=yn(c)?this.mirror.getId(ry(l)):this.mirror.getId(c),p=i(l);if(d===-1||p===-1)return n.addNode(l);let m=Er(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:y=>{ey(y,this.mirror)&&this.iframeManager.addIframe(y),ty(y,this.mirror)&&this.stylesheetManager.trackLinkElement(y),Nl(l)&&this.shadowDomManager.addShadowRoot(E.shadowRoot(l),this.doc)},onIframeLoad:(y,f)=>{this.iframeManager.attachIframe(y,f),this.shadowDomManager.observeAttachShadow(y)},onStylesheetLoad:(y,f)=>{this.stylesheetManager.attachLinkElement(y,f)},cssCaptured:u});m&&(t.push({parentId:d,nextId:p,node:m}),r.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)uh(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(E.parentNode(l))||o(l);for(let l of this.addedSet)!dh(this.droppedSet,l)&&!uh(this.removesSubTreeCache,l,this.mirror)||dh(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;n.length;){let l=null;if(s){let c=this.mirror.getId(E.parentNode(s.value)),u=i(s.value);c!==-1&&u!==-1&&(l=s)}if(!l){let c=n.tail;for(;c;){let u=c;if(c=c.previous,u){let d=this.mirror.getId(E.parentNode(u.value));if(i(u.value)===-1)continue;if(d!==-1){l=u;break}else{let m=u.value,y=E.parentNode(m);if(y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=E.host(y);if(this.mirror.getId(f)!==-1){l=u;break}}}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}s=l.previous,n.removeNode(l.value),o(l.value)}let a={texts:this.texts.map(l=>{let c=l.node,u=E.parentNode(c);return u&&u.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(u),{id:this.mirror.getId(c),value:l.value}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:c}=l;if(typeof c.style=="string"){let u=JSON.stringify(l.styleDiff),d=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+d).split("var(").length===c.style.split("var(").length&&(c.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:c}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),b(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(E.childNodes(t),i=>E.textContent(i)||"").join("");r.attributes.value=No({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:$o(t),value:n,maskInputFn:this.maskInputFn})}),b(this,"processMutation",t=>{if(!Ja(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=E.textContent(t.target);!be(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Eh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Jm(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){let s=$o(r);i=No({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(be(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!kh(r.tagName,n))if(o.attributes[n]=xh(this.doc,Kt(r.tagName),Kt(n),i),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let s=this.unattachedDoc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue);for(let a of Array.from(r.style)){let l=r.style.getPropertyValue(a),c=r.style.getPropertyPriority(a);l!==s.style.getPropertyValue(a)||c!==s.style.getPropertyPriority(a)?c===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,c]:o._unchangedStyles[a]=[l,c]}for(let a of Array.from(s.style))r.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(be(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),i=yn(t.target)?this.mirror.getId(E.host(t.target)):this.mirror.getId(t.target);be(t.target,this.blockClass,this.blockSelector,!1)||Ja(r,this.mirror,this.slimDOMOptions)||!_M(r,this.mirror)||(this.addedSet.has(r)?(Fl(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Qm(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[ch(n,i)]?Fl(this.movedSet,r):(this.removes.push({parentId:i,id:n,isShadow:yn(t.target)&&gn(t.target)?!0:void 0}),WM(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),b(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Ja(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[ch(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);be(t,this.blockClass,this.blockSelector,!1)||(E.childNodes(t).forEach(n=>this.genAdds(n)),Nl(t)&&E.childNodes(E.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Fl(e,t){e.delete(t),E.childNodes(t).forEach(r=>Fl(e,r))}function WM(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),E.childNodes(n).forEach(i=>r.push(i)))}}function uh(e,t,r){return e.size===0?!1:UM(e,t)}function UM(e,t,r){let n=E.parentNode(t);return n?e.has(n):!1}function dh(e,t){return e.size===0?!1:oy(e,t)}function oy(e,t){let r=E.parentNode(t);return r?e.has(r)?!0:oy(e,r):!1}var Sn;function zM(e){Sn=e}function GM(){Sn=void 0}var O=e=>Sn?(...r)=>{try{return e(...r)}catch(n){if(Sn&&Sn(n)===!0)return;throw n}}:e,qt=[];function Nn(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 sy(e,t){let r=new Dl;qt.push(r),r.init(e);let n=new(Hm())(O(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function qM({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=Pn(O(d=>{let p=Date.now()-a;e(s.map(m=>(m.timeOffset-=p,m)),d),s=[],a=null}),o),c=O(Pn(O(d=>{let p=Nn(d),{clientX:m,clientY:y}=Tl(d)?d.changedTouches[0]:d;a||(a=Go()),s.push({x:m,y,id:n.getId(p),timeOffset:Go()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?C.Drag:d instanceof MouseEvent?C.MouseMove:C.TouchMove)}),i,{trailing:!1})),u=[Se("mousemove",c,r),Se("touchmove",c,r),Se("drag",c,r)];return O(()=>{u.forEach(d=>d())})}function KM({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=null,c=u=>d=>{let p=Nn(d);if(be(p,n,i,!0))return;let m=null,y=u;if("pointerType"in d){switch(d.pointerType){case"mouse":m=mt.Mouse;break;case"touch":m=mt.Touch;break;case"pen":m=mt.Pen;break}m===mt.Touch?ve[u]===ve.MouseDown?y="TouchStart":ve[u]===ve.MouseUp&&(y="TouchEnd"):mt.Pen}else Tl(d)&&(m=mt.Touch);m!==null?(l=m,(y.startsWith("Touch")&&m===mt.Touch||y.startsWith("Mouse")&&m===mt.Mouse)&&(m=null)):ve[u]===ve.Click&&(m=l,l=null);let f=Tl(d)?d.changedTouches[0]:d;if(!f)return;let h=r.getId(p),{clientX:w,clientY:x}=f;O(e)({type:ve[y],id:h,x:w,y:x,...m!==null&&{pointerType:m}})};return Object.keys(ve).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&s[u]!==!1).forEach(u=>{let d=Kt(u),p=c(u);if(window.PointerEvent)switch(ve[u]){case ve.MouseDown:case ve.MouseUp:d=d.replace("mouse","pointer");break;case ve.TouchStart:case ve.TouchEnd:return}a.push(Se(d,p,t))}),O(()=>{a.forEach(u=>u())})}function ay({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){let s=O(Pn(O(a=>{let l=Nn(a);if(!l||be(l,n,i,!0))return;let c=r.getId(l);if(l===t&&t.defaultView){let u=Ym(t.defaultView);e({id:c,x:u.left,y:u.top})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return Se("scroll",s,t)}function HM({viewportResizeCb:e},{win:t}){let r=-1,n=-1,i=O(Pn(O(()=>{let o=Xm(),s=Zm();(r!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),r=o,n=s)}),200));return Se("resize",i,t)}var YM=["INPUT","TEXTAREA","SELECT"],ph=new WeakMap;function XM({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function d(x){let g=Nn(x),k=x.isTrusted,T=g&&g.tagName;if(g&&T==="OPTION"&&(g=E.parentElement(g)),!g||!T||YM.indexOf(T)<0||be(g,n,i,!0)||g.classList.contains(o)||s&&g.matches(s))return;let j=g.value,te=!1,W=$o(g)||"";W==="radio"||W==="checkbox"?te=g.checked:(a[T.toLowerCase()]||a[W])&&(j=No({element:g,maskInputOptions:a,tagName:T,type:W,value:j,maskInputFn:l})),p(g,u?{text:j,isChecked:te,userTriggered:k}:{text:j,isChecked:te});let G=g.name;W==="radio"&&G&&te&&t.querySelectorAll(`input[type="radio"][name="${G}"]`).forEach(re=>{if(re!==g){let fe=re.value;p(re,u?{text:fe,isChecked:!te,userTriggered:!1}:{text:fe,isChecked:!te})}})}function p(x,g){let k=ph.get(x);if(!k||k.text!==g.text||k.isChecked!==g.isChecked){ph.set(x,g);let T=r.getId(x);O(e)({...g,id:T})}}let y=(c.input==="last"?["change"]:["input","change"]).map(x=>Se(x,O(d),t)),f=t.defaultView;if(!f)return()=>{y.forEach(x=>x())};let h=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),w=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return h&&h.set&&y.push(...w.map(x=>os(x[0],x[1],{set(){O(d)({target:this,isTrusted:!1})}},!1,f))),O(()=>{y.forEach(x=>x())})}function qo(e){let t=[];function r(n,i){if(ko("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||ko("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||ko("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||ko("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(s)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(s)}return i}return r(e,t)}function It(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function ZM({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:O((u,d,p)=>{let[m,y]=p,{id:f,styleId:h}=It(d,t,r.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,adds:[{rule:m,index:y}]}),u.apply(d,p)})}),n.CSSStyleSheet.prototype.addRule=function(u,d,p=this.cssRules.length){let m=`${u} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[m,p])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:O((u,d,p)=>{let[m]=p,{id:y,styleId:f}=It(d,t,r.styleMirror);return(y&&y!==-1||f&&f!==-1)&&e({id:y,styleId:f,removes:[{index:m}]}),u.apply(d,p)})}),n.CSSStyleSheet.prototype.removeRule=function(u){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:O((u,d,p)=>{let[m]=p,{id:y,styleId:f}=It(d,t,r.styleMirror);return(y&&y!==-1||f&&f!==-1)&&e({id:y,styleId:f,replace:m}),u.apply(d,p)})}));let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:O((u,d,p)=>{let[m]=p,{id:y,styleId:f}=It(d,t,r.styleMirror);return(y&&y!==-1||f&&f!==-1)&&e({id:y,styleId:f,replaceSync:m}),u.apply(d,p)})}));let l={};Eo("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Eo("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Eo("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Eo("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,d])=>{c[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(c[u].insertRule,{apply:O((p,m,y)=>{let[f,h]=y,{id:w,styleId:x}=It(m.parentStyleSheet,t,r.styleMirror);return(w&&w!==-1||x&&x!==-1)&&e({id:w,styleId:x,adds:[{rule:f,index:[...qo(m),h||0]}]}),p.apply(m,y)})}),d.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:O((p,m,y)=>{let[f]=y,{id:h,styleId:w}=It(m.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||w&&w!==-1)&&e({id:h,styleId:w,removes:[{index:[...qo(m),f]}]}),p.apply(m,y)})})}),O(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,d])=>{d.prototype.insertRule=c[u].insertRule,d.prototype.deleteRule=c[u].deleteRule})})}function ly({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(E.host(r));let a=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(i=r.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var u;let d=(u=l.set)==null?void 0:u.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return d}}),O(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function JM({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:O((a,l,c)=>{var u;let[d,p,m]=c;if(r.has(d))return o.apply(l,[d,p,m]);let{id:y,styleId:f}=It((u=l.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||f&&f!==-1)&&e({id:y,styleId:f,set:{property:d,value:p,priority:m},index:qo(l.parentRule)}),a.apply(l,c)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:O((a,l,c)=>{var u;let[d]=c;if(r.has(d))return s.apply(l,[d]);let{id:p,styleId:m}=It((u=l.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&e({id:p,styleId:m,remove:{property:d},index:qo(l.parentRule)}),a.apply(l,c)})}),O(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function QM({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){let s=O(l=>Pn(O(c=>{let u=Nn(c);if(!u||be(u,t,r,!0))return;let{currentTime:d,volume:p,muted:m,playbackRate:y,loop:f}=u;e({type:l,id:n.getId(u),currentTime:d,volume:p,muted:m,playbackRate:y,loop:f})}),i.media||500)),a=[Se("play",s(xr.Play),o),Se("pause",s(xr.Pause),o),Se("seeked",s(xr.Seeked),o),Se("volumechange",s(xr.VolumeChange),o),Se("ratechange",s(xr.RateChange),o)];return O(()=>{a.forEach(l=>l())})}function eO({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(l,c,u){let d=new o(l,c,u);return i.set(d,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};let s=Xt(t.fonts,"add",function(a){return function(l){return setTimeout(O(()=>{let c=i.get(l);c&&(e(c),i.delete(l))}),0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=o}),n.push(s),O(()=>{n.forEach(a=>a())})}function tO(e){let{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,s=!0,a=O(()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let c=[],u=l.rangeCount||0;for(let d=0;d<u;d++){let p=l.getRangeAt(d),{startContainer:m,startOffset:y,endContainer:f,endOffset:h}=p;be(m,n,i,!0)||be(f,n,i,!0)||c.push({start:r.getId(m),startOffset:y,end:r.getId(f),endOffset:h})}o({ranges:c})});return a(),Se("selectionchange",a)}function rO({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:Xt(r.customElements,"define",function(i){return function(o,s,a){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,s,a])}})}function nO(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:m,customElementCb:y}=e;e.mutationCb=(...f)=>{t.mutation&&t.mutation(...f),r(...f)},e.mousemoveCb=(...f)=>{t.mousemove&&t.mousemove(...f),n(...f)},e.mouseInteractionCb=(...f)=>{t.mouseInteraction&&t.mouseInteraction(...f),i(...f)},e.scrollCb=(...f)=>{t.scroll&&t.scroll(...f),o(...f)},e.viewportResizeCb=(...f)=>{t.viewportResize&&t.viewportResize(...f),s(...f)},e.inputCb=(...f)=>{t.input&&t.input(...f),a(...f)},e.mediaInteractionCb=(...f)=>{t.mediaInteaction&&t.mediaInteaction(...f),l(...f)},e.styleSheetRuleCb=(...f)=>{t.styleSheetRule&&t.styleSheetRule(...f),c(...f)},e.styleDeclarationCb=(...f)=>{t.styleDeclaration&&t.styleDeclaration(...f),u(...f)},e.canvasMutationCb=(...f)=>{t.canvasMutation&&t.canvasMutation(...f),d(...f)},e.fontCb=(...f)=>{t.font&&t.font(...f),p(...f)},e.selectionCb=(...f)=>{t.selection&&t.selection(...f),m(...f)},e.customElementCb=(...f)=>{t.customElement&&t.customElement(...f),y(...f)}}function iO(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};nO(e,t);let n;e.recordDOM&&(n=sy(e,e.doc));let i=qM(e),o=KM(e),s=ay(e),a=HM(e,{win:r}),l=XM(e),c=QM(e),u=()=>{},d=()=>{},p=()=>{},m=()=>{};e.recordDOM&&(u=ZM(e,{win:r}),d=ly(e,e.doc),p=JM(e,{win:r}),e.collectFonts&&(m=eO(e)));let y=tO(e),f=rO(e),h=[];for(let w of e.plugins)h.push(w.observer(w.callback,r,w.options));return O(()=>{qt.forEach(w=>w.reset()),n?.disconnect(),i(),o(),s(),a(),l(),c(),u(),d(),p(),m(),y(),f(),h.forEach(w=>w())})}function ko(e){return typeof window[e]<"u"}function Eo(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var Ko=class{constructor(t){b(this,"iframeIdToRemoteIdMap",new WeakMap),b(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,i){let o=n||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(r);return a||(a=this.generateIdFn(),o.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){let i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=i.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},_l=class{constructor(t){b(this,"iframes",new WeakMap),b(this,"crossOriginIframeMap",new WeakMap),b(this,"crossOriginIframeMirror",new Ko(vh)),b(this,"crossOriginIframeStyleMirror"),b(this,"crossOriginIframeRootIdMap",new WeakMap),b(this,"mirror"),b(this,"mutationCb"),b(this,"wrappedEmit"),b(this,"loadListener"),b(this,"stylesheetManager"),b(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ko(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let i=this.crossOriginIframeMap.get(t.source);if(!i)return;let o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case P.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:P.IncrementalSnapshot,data:{source:C.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case P.Meta:case P.Load:case P.DomContentLoaded:return!1;case P.Plugin:return r;case P.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case P.IncrementalSnapshot:switch(r.data.source){case C.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case C.Drag:case C.TouchMove:case C.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case C.ViewportResize:return!1;case C.MediaInteraction:case C.MouseInteraction:case C.Scroll:case C.CanvasMutation:case C.Input:return this.replaceIds(r.data,t,["id"]),r;case C.StyleSheetRule:case C.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case C.Font:return r;case C.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case C.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,n,i){for(let o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==iy.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},jl=class{constructor(t){b(this,"shadowDoms",new WeakSet),b(this,"mutationCb"),b(this,"scrollCb"),b(this,"bypassOptions"),b(this,"mirror"),b(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!gn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let n=sy({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(ay({...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(E.host(t))),this.restoreHandlers.push(ly({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(Xt(t.prototype,"attachShadow",function(i){return function(o){let s=i.call(this,o),a=E.shadowRoot(this);return a&&ny(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",oO=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(mn=0;mn<Cr.length;mn++)oO[Cr.charCodeAt(mn)]=mn;var mn,sO=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=Cr[t[r]>>2],i+=Cr[(t[r]&3)<<4|t[r+1]>>4],i+=Cr[(t[r+1]&15)<<2|t[r+2]>>6],i+=Cr[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var fh=new Map;function aO(e,t){let r=fh.get(e);return r||(r=new Map,fh.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var cy=(e,t,r)=>{if(!e||!(dy(e,t)||typeof e=="object"))return;let n=e.constructor.name,i=aO(r,n),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Oo(e,t,r){if(e instanceof Array)return e.map(n=>Oo(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,i=sO(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Oo(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Oo(e.data,t,r),e.width,e.height]};if(dy(e,t)||typeof e=="object"){let n=e.constructor.name,i=cy(e,t,r);return{rr_type:n,index:i}}}}return e}var uy=(e,t,r)=>e.map(n=>Oo(n,t,r)),dy=(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 lO(e,t,r,n){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=Xt(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...c){return be(this.canvas,r,n,!0)||setTimeout(()=>{let u=uy(c,t,this);e(this.canvas,{type:Nr["2D"],property:s,args:u})},0),l.apply(this,c)}});i.push(a)}catch{let a=os(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:Nr["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function cO(e){return e==="experimental-webgl"?"webgl":e}function hh(e,t,r,n){let i=[];try{let o=Xt(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!be(this,t,r,!0)){let c=cO(a);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){let u=l[0];u.preserveDrawingBuffer||(u.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 mh(e,t,r,n,i,o){let s=[],a=Object.getOwnPropertyNames(e);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let c=Xt(e,l,function(u){return function(...d){let p=u.apply(this,d);if(cy(p,o,this),"tagName"in this.canvas&&!be(this.canvas,n,i,!0)){let m=uy(d,o,this),y={type:t,property:l,args:m};r(this.canvas,y)}return p}});s.push(c)}catch{let c=os(e,l,{set(u){r(this.canvas,{type:t,property:l,args:[u],setter:!0})}});s.push(c)}return s}function uO(e,t,r,n){let i=[];return i.push(...mh(t.WebGLRenderingContext.prototype,Nr.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...mh(t.WebGL2RenderingContext.prototype,Nr.WebGL2,e,r,n,t)),()=>{i.forEach(o=>o())}}var py="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",dO=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),yh=typeof window<"u"&&window.Blob&&new Blob([dO(py)],{type:"text/javascript;charset=utf-8"});function pO(e){let t;try{if(t=yh&&(window.URL||window.webkitURL).createObjectURL(yh),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;base64,"+py,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var Bl=class{constructor(t){b(this,"pendingCanvasMutations",new Map),b(this,"rafStamps",{latestId:0,invokeId:null}),b(this,"mirror"),b(this,"mutationCb"),b(this,"resetObservers"),b(this,"frozen",!1),b(this,"locked",!1),b(this,"processMutation",(l,c)=>{(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(c)});let{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,i,o){let s=hh(r,n,i,!0),a=new Map,l=new pO;l.onmessage=y=>{let{id:f}=y.data;if(a.set(f,!1),!("base64"in y.data))return;let{base64:h,type:w,width:x,height:g}=y.data;this.mutationCb({id:f,type:Nr["2D"],commands:[{property:"clearRect",args:[0,0,x,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:w}]},0,0]}]})};let c=1e3/t,u=0,d,p=()=>{let y=[];return r.document.querySelectorAll("canvas").forEach(f=>{be(f,n,i,!0)||y.push(f)}),y},m=y=>{if(u&&y-u<c){d=requestAnimationFrame(m);return}u=y,p().forEach(async f=>{var h;let w=this.mirror.getId(f);if(a.get(w)||f.width===0||f.height===0)return;if(a.set(w,!0),["webgl","webgl2"].includes(f.__context)){let g=f.getContext(f.__context);((h=g?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}let x=await createImageBitmap(f);l.postMessage({id:w,bitmap:x,width:f.width,height:f.height,dataURLOptions:o.dataURLOptions},[x])}),d=requestAnimationFrame(m)};d=requestAnimationFrame(m),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=hh(t,r,n,!1),o=lO(this.processMutation.bind(this),t,r,n),s=uO(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let i=n.map(s=>{let{type:a,...l}=s;return l}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}},Vl=class{constructor(t){b(this,"trackedLinkElements",new WeakSet),b(this,"mutationCb"),b(this,"adoptedStyleSheetCb"),b(this,"styleMirror",new $l),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},i=[];for(let o of t){let s;this.styleMirror.has(o)?s=this.styleMirror.getId(o):(s=this.styleMirror.add(o),i.push({styleId:s,rules:Array.from(o.rules||CSSRule,(a,l)=>({rule:wh(a,o.href),index:l}))})),n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Wl=class{constructor(){b(this,"nodeMap",new WeakMap),b(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},ee,Io,Qa,Ho=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Sf=e.contentWindow)==null?void 0:Sf.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Fe=mE();function Zt(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:m,maskInputFn:y,maskTextFn:f,hooks:h,packFn:w,sampling:x={},dataURLOptions:g={},mousemoveWait:k,recordDOM:T=!0,recordCanvas:j=!1,recordCrossOriginIframes:te=!1,recordAfter:W=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:G=!1,collectFonts:re=!1,inlineImages:fe=!1,plugins:Ve,keepIframeSrcFn:N=()=>!1,ignoreCSSAttributes:Dr=new Set([]),errorHandler:Fr}=e;zM(Fr);let ie=te?window.parent===window:!0,Ie=!1;if(!ie)try{window.parent.document&&(Ie=!1)}catch{Ie=!0}if(ie&&!t)throw new Error("emit function is required");if(!ie&&!Ie)return()=>{};k!==void 0&&x.mousemove===void 0&&(x.mousemove=k),Fe.reset();let Tt=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},We=Ch(m);jM();let yc,ss=0,gc=$=>{for(let Ne of Ve||[])Ne.eventProcessor&&($=Ne.eventProcessor($));return w&&!Ie&&($=w($)),$};ee=($,Ne)=>{var X;let Z=$;if(Z.timestamp=Go(),(X=qt[0])!=null&&X.isFrozen()&&Z.type!==P.FullSnapshot&&!(Z.type===P.IncrementalSnapshot&&Z.data.source===C.Mutation)&&qt.forEach(xe=>xe.unfreeze()),ie)t?.(gc(Z),Ne);else if(Ie){let xe={type:"rrweb",event:gc(Z),origin:window.location.origin,isCheckout:Ne};window.parent.postMessage(xe,"*")}if(Z.type===P.FullSnapshot)yc=Z,ss=0;else if(Z.type===P.IncrementalSnapshot){if(Z.data.source===C.Mutation&&Z.data.isAttachIframe)return;ss++;let xe=n&&ss>=n,B=r&&Z.timestamp-yc.timestamp>r;(xe||B)&&Io(!0)}};let Fn=$=>{ee({type:P.IncrementalSnapshot,data:{source:C.Mutation,...$}})},Sc=$=>ee({type:P.IncrementalSnapshot,data:{source:C.Scroll,...$}}),bc=$=>ee({type:P.IncrementalSnapshot,data:{source:C.CanvasMutation,...$}}),Iy=$=>ee({type:P.IncrementalSnapshot,data:{source:C.AdoptedStyleSheet,...$}}),Nt=new Vl({mutationCb:Fn,adoptedStyleSheetCb:Iy}),$t=new _l({mirror:Fe,mutationCb:Fn,stylesheetManager:Nt,recordCrossOriginIframes:te,wrappedEmit:ee});for(let $ of Ve||[])$.getMirror&&$.getMirror({nodeMirror:Fe,crossOriginIframeMirror:$t.crossOriginIframeMirror,crossOriginIframeStyleMirror:$t.crossOriginIframeStyleMirror});let as=new Wl;Qa=new Bl({recordCanvas:j,mutationCb:bc,win:window,blockClass:i,blockSelector:o,mirror:Fe,sampling:x.canvas,dataURLOptions:g});let _n=new jl({mutationCb:Fn,scrollCb:Sc,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:Tt,dataURLOptions:g,maskTextFn:f,maskInputFn:y,recordCanvas:j,inlineImages:fe,sampling:x,slimDOMOptions:We,iframeManager:$t,stylesheetManager:Nt,canvasManager:Qa,keepIframeSrcFn:N,processedNodeManager:as},mirror:Fe});Io=($=!1)=>{if(!T)return;ee({type:P.Meta,data:{href:window.location.href,width:Zm(),height:Xm()}},$),Nt.reset(),_n.init(),qt.forEach(X=>X.lock());let Ne=jE(document,{mirror:Fe,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:Tt,maskTextFn:f,maskInputFn:y,slimDOM:We,dataURLOptions:g,recordCanvas:j,inlineImages:fe,onSerialize:X=>{ey(X,Fe)&&$t.addIframe(X),ty(X,Fe)&&Nt.trackLinkElement(X),Nl(X)&&_n.addShadowRoot(E.shadowRoot(X),document)},onIframeLoad:(X,Z)=>{$t.attachIframe(X,Z),_n.observeAttachShadow(X)},onStylesheetLoad:(X,Z)=>{Nt.attachLinkElement(X,Z)},keepIframeSrcFn:N});if(!Ne)return console.warn("Failed to snapshot the document");ee({type:P.FullSnapshot,data:{node:Ne,initialOffset:Ym(window)}},$),qt.forEach(X=>X.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Nt.adoptStyleSheets(document.adoptedStyleSheets,Fe.getId(document))};try{let $=[],Ne=Z=>{var xe;return O(iO)({mutationCb:Fn,mousemoveCb:(B,ls)=>ee({type:P.IncrementalSnapshot,data:{source:ls,positions:B}}),mouseInteractionCb:B=>ee({type:P.IncrementalSnapshot,data:{source:C.MouseInteraction,...B}}),scrollCb:Sc,viewportResizeCb:B=>ee({type:P.IncrementalSnapshot,data:{source:C.ViewportResize,...B}}),inputCb:B=>ee({type:P.IncrementalSnapshot,data:{source:C.Input,...B}}),mediaInteractionCb:B=>ee({type:P.IncrementalSnapshot,data:{source:C.MediaInteraction,...B}}),styleSheetRuleCb:B=>ee({type:P.IncrementalSnapshot,data:{source:C.StyleSheetRule,...B}}),styleDeclarationCb:B=>ee({type:P.IncrementalSnapshot,data:{source:C.StyleDeclaration,...B}}),canvasMutationCb:bc,fontCb:B=>ee({type:P.IncrementalSnapshot,data:{source:C.Font,...B}}),selectionCb:B=>{ee({type:P.IncrementalSnapshot,data:{source:C.Selection,...B}})},customElementCb:B=>{ee({type:P.IncrementalSnapshot,data:{source:C.CustomElement,...B}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:Tt,inlineStylesheet:u,sampling:x,recordDOM:T,recordCanvas:j,inlineImages:fe,userTriggeredOnInput:G,collectFonts:re,doc:Z,maskInputFn:y,maskTextFn:f,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:We,dataURLOptions:g,mirror:Fe,iframeManager:$t,stylesheetManager:Nt,shadowDomManager:_n,processedNodeManager:as,canvasManager:Qa,ignoreCSSAttributes:Dr,plugins:((xe=Ve?.filter(B=>B.observer))==null?void 0:xe.map(B=>({observer:B.observer,options:B.options,callback:ls=>ee({type:P.Plugin,data:{plugin:B.name,payload:ls}})})))||[]},h)};$t.addLoadListener(Z=>{try{$.push(Ne(Z.contentDocument))}catch(xe){console.warn(xe)}});let X=()=>{Io(),$.push(Ne(document)),Ho=!0};return["interactive","complete"].includes(document.readyState)?X():($.push(Se("DOMContentLoaded",()=>{ee({type:P.DomContentLoaded,data:{}}),W==="DOMContentLoaded"&&X()})),$.push(Se("load",()=>{ee({type:P.Load,data:{}}),W==="load"&&X()},window))),()=>{$.forEach(Z=>{try{Z()}catch(xe){String(xe).toLowerCase().includes("cross-origin")||console.warn(xe)}}),as.destroy(),Ho=!1,GM()}}catch($){console.warn($)}}Zt.addCustomEvent=(e,t)=>{if(!Ho)throw new Error("please add custom event after start recording");ee({type:P.Custom,data:{tag:e,payload:t}})};Zt.freezePage=()=>{qt.forEach(e=>e.freeze())};Zt.takeFullSnapshot=e=>{if(!Ho)throw new Error("please take full snapshot after start recording");Io(e)};Zt.mirror=Fe;var gh;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(gh||(gh={}));var n_=5*1e3;var{addCustomEvent:i_}=Zt,{freezePage:o_}=Zt,{takeFullSnapshot:s_}=Zt;var my="__ripploEmitRrwebEvent";function yy(){return{eventTypes:fy(P),incrementalSources:fy(C)}}function fy(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,r])=>[r,t]))}var hO=ja("@ripplo/rrweb-bundle/bundle","rrweb.js"),hy;function gy(){return hy??=fO(hO,{encoding:"utf8"}),hy}async function Ln({clientVersion:e,debugDir:t,writeOtlpPortFile:r}){let n=new Map,i=mf(yy()),o=await xa({localDir:Sy.join(Sy.dirname(t),".local"),writePortFile:r,onRrwebBatch:(l,c)=>{n.get(l)?.emitRrwebBatch(c)},onSpan:l=>{let c=l.attributes["ripplo.run"];c!=null&&n.get(c)?.emit(l)}}),s=await gy();return{attach:async(l,c)=>{let u=hf({debugDir:t,runId:c,worker:i});u.emit({clientVersion:e,kind:"meta",source:"capture",timeNanos:"0"}),n.set(c,u),await gf(l,c),await l.addInitScript(`globalThis.__ripploCapturePort = ${String(o.port)};`),await yO(l,u),await bO(l,u);let d=[];return{emitAction:p=>{vO(u,p)},emitAssertion:p=>{xO(u,p)},finish:()=>wO(u,{pages:d,registry:n,runId:c}),onPage:p=>{d.push(p),RO(u,s,p)}}},debugDir:t,close:async()=>{await o.stop(),await i.terminate()},injectSpan:(l,c)=>{n.get(l)?.emit(c)}}}async function mO(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function yO(e,t){await e.exposeBinding(my,(r,n)=>{let i=typeof n=="string"?n:JSON.stringify(n);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}var gO="__ripploEventPush",SO=Be.discriminatedUnion("kind",[Be.object({kind:Be.literal("console"),level:Be.string(),text:Be.string(),timestamp:Be.number()}),Be.object({kind:Be.literal("error"),message:Be.string(),stack:Be.string().optional(),timestamp:Be.number()})]);async function bO(e,t){await e.exposeBinding(gO,(r,n)=>{let i=SO.safeParse(n);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:wr(o.timestamp)});return}t.emit({kind:"error",message:o.message,source:"browser",stack:o.stack,timeNanos:wr(o.timestamp)})})}async function wO(e,t){await mO(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 RO(e,t,r){r.on("load",()=>{r.addScriptTag({content:t}).catch(()=>{})}),r.on("requestfinished",n=>{AO(e,n).catch(()=>{})}),r.url()!=="about:blank"&&r.addScriptTag({content:t}).catch(()=>{})}function vO(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:kO(t),timeNanos:wr(Date.now()),value:EO(t)})}function xO(e,t){let r=ki(t);e.emit({kind:"assertion",label:r.label,outcome:t.outcome,source:"test",step:r.step,timeNanos:wr(Date.now()),wait:t.waitBudget,waitMs:t.waitMs})}function kO(e){if(e.url!=null)return e.url;if(e.locator!=null)return $n(e.locator)}function $n(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${$n(e.scope)} \u25B8 ${$n(e.target)}`:e.by==="surface"?$n(e.container):e.by==="frame"?`frame ${$n(e.element)}`:`${e.role} ${e.name??""}`.trim()}function EO(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var CO=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;async function AO(e,t){if(CO.test(t.url()))return;let r=await t.response();if(r==null)return;let n=t.resourceType(),i=n==="fetch"||n==="xhr",o=t.timing(),s=t.headers().traceparent?.split("-"),a=o.startTime;e.emit({durationMs:Math.max(0,o.responseEnd),kind:"network",method:t.method(),requestBody:i?t.postData()??void 0:void 0,resourceType:n,responseBody:i?await PO(r):void 0,source:"browser",spanId:s?.[2],status:r.status(),timeNanos:wr(a>0?a:Date.now()),traceId:s?.[1],url:r.url()})}async function PO(e){try{return await e.text()}catch{return}}function Dn(e){return{aborted:!0,findings:[],ran:[],teardown:e}}function fc(e,t){return new pc(BO(e,t))}function IO(e,t){return new pc(TO(e,t))}async function TO(e,t){let r=await af(e.profileDir).catch(()=>{});if(r==null)return Jt(Ue(new Error("launch")));try{return $r(await NO({context:r,params:e,signal:t}))}catch(n){return Jt(Ue(n))}finally{await r.close().catch(ze)}}async function NO({context:e,params:t,signal:r}){let n=e.pages()[0]??await e.newPage(),i=await Ln({clientVersion:t.clientVersion,debugDir:t.debugDir,writeOtlpPortFile:!0}),o=await i.attach(e,t.runId);return o.onPage(n),e.on("page",s=>{o.onPage(s)}),await n.goto(t.startUrl).catch(ze),t.onReady(),await $O(e,r),await o.finish(),await i.close(),{behaviorPath:MO.join(t.debugDir,t.runId,"behavior.jsonl")}}function $O(e,t){return new Promise(r=>{let n=()=>{r()};t.addEventListener("abort",n,{once:!0}),e.on("close",n),e.browser()?.on("disconnected",n),e.on("page",i=>i.on("close",n)),e.pages().forEach(i=>i.on("close",n))})}function LO(e,t){return new pc(DO(e,t))}async function DO(e,t){let r=FO(e),n=vy({lockfile:e.lockfile,options:e.options,runId:e.runId,signal:t}),i=async o=>{try{return $r(await _O({established:o,params:e,signal:t}))}catch(s){return await o.teardown().match(ze,ze),Jt(Gn(s)?s:Ue(s))}};return Ry(n,r).match(i,async o=>(await hc(n.teardown),Jt(o)))}function FO(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 _O({established:e,params:t,signal:r}){let n=to({cacheDir:void 0,headed:!0}),i=await n.acquire(),{result:o,session:s}=await wy({browser:i,capture:null,established:e,lockfile:t.lockfile,onEvent:void 0,onPhase:void 0,options:t.options,sequence:t.sequence,signal:r,stopAfterStep:t.stopAfterStep,test:t.test,viewport:null});return t.onReady(),await jO(i,s.context),await e.teardown().match(ze,ze),await n.close(),{kind:"handed-over",ran:o.ran.length}}function jO(e,t){return new Promise(r=>{let n=()=>{r()};e.on("disconnected",n),t.on("close",n),t.on("page",i=>i.on("close",n)),t.pages().forEach(i=>i.on("close",n))})}async function BO({browser:e,hub:t,request:r},n){if(n.aborted)return $r(Dn("skipped"));let i=vy({lockfile:r.lockfile,options:r.options,runId:r.runId,signal:n}),o=async s=>{try{return await WO({browser:e,established:s,hub:t,request:r,signal:n})}catch(a){return Jt(Gn(a)?a:Ue(a))}};return Ry(i,r).match(o,s=>VO(s,i.teardown))}async function VO(e,t){return e.kind!=="aborted"?Jt(e):$r(Dn(await hc(t)))}function hc(e){return e().match(()=>"done",()=>"failed")}async function WO(e){let t=await UO(e);if(t.kind==="completed"){let n=Date.now();return e.established.teardown().match(()=>(e.request.onPhase?.("teardown",Date.now()-n),$r({aborted:!1,...t.result})),i=>Jt(i))}let r=await hc(e.established.teardown);if(t.kind==="aborted")return $r(Dn(r));throw t.error}function by(e,t,r){return Xr(e,t).map(n=>({params:{...zi(n),...r},transition:n}))}async function wy(e){let{established:t,lockfile:r,signal:n}=e,i=Date.now(),o=await Ta({baseUrl:e.options.baseUrl,browser:e.browser,capture:e.capture,clientState:t.clientState,engine:Ca(qO(r)),fixturesDir:e.options.fixturesDir,networkHeaders:void 0,observeActor:t.observeActor,reader:t.reader,session:t.auth,signal:n,signInActor:t.signInActor,viewport:e.viewport});e.onPhase?.("browser",Date.now()-i);try{let s=cr(r),a=Date.now(),l=await Wi({canon:Pi(r),classify:Ai(r),dataRules:s.dataRules,driver:o.driver,facts:{facts:Gs(s.facts,ne(e.test)),overlays:Xe(r),overrides:s.overrides},initialState:{snapshot:t.snapshot},onAssertion:o.emitAssertion,sequence:e.sequence,stopAfterStep:e.stopAfterStep,onEvent:c=>{e.onEvent?.(c)}},n);return e.onPhase?.("drive",Date.now()-a),{result:l,session:o}}catch(s){throw await o.close().catch(ze),s}}async function UO({browser:e,established:t,hub:r,request:n,signal:i}){try{Oe(i),n.onEvent?.({aliases:t.aliases,generated:t.generated,generatedSingletons:t.generatedSingletons,kind:"world"});let{result:o,session:s}=await wy({browser:e,capture:n.capture?{hub:r,runId:n.runId}:null,established:t,lockfile:n.lockfile,onEvent:n.onEvent,onPhase:n.onPhase,options:n.options,sequence:n.sequence??by(n.lockfile,n.test,n.params),signal:i,stopAfterStep:void 0,test:n.test,viewport:sf(n.test.viewport)});return await s.close(),{kind:"completed",result:o}}catch(o){return on(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function Ry(e,t){let r=Date.now();return e.ready().andThen(()=>{t.onPhase?.("engine",Date.now()-r);let n=Date.now();return fr(t.lockfile,t.test,{generate:Vn(Bn(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params,signIn:e.signIn}).map(i=>(t.onPhase?.("world",Date.now()-n),{aliases:i.aliases,auth:i.auth,clientState:i.clientState,generated:i.generated,generatedSingletons:i.generatedSingletons,observeActor:i.principals.size>0,reader:e.reader,signInActor:zO(e.signIn,i.principals),snapshot:i.snapshot,teardown:e.teardown}))})}function zO(e,t){return r=>{let n=t.get(r);return n==null?OO(Ue(new Error(`no seeded principal for actor "${r}"`))):e({entity:n.entity,row:n.row})}}function vy({lockfile:e,options:t,runId:r,signal:n}){let i=_a({baseUrl:t.engineUrl,extraHeaders:void 0,runId:r,secret:t.secret},n);return{materialize:_i(i.setupWorld),reader:Da(e.entities,GO(e),i.query),ready:i.ready,signIn:i.signIn,teardown:i.teardown}}function GO(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function qO(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}import{err as KO,ok as HO,ResultAsync as YO}from"neverthrow";function XO({cacheDir:e,clientVersion:t,debugDir:r,headed:n,writeOtlpPortFile:i}){let o=to({cacheDir:e,headed:n}),s,a,l=async()=>(s??=Ln({clientVersion:t,debugDir:r,writeOtlpPortFile:i}),a=await s,a),c=async(p,m)=>{if(m.aborted)return HO(Dn("skipped"));try{let y=await l();if(p.options.headed&&!n)return await Na(!0,async h=>fc({browser:h,hub:y,request:p},m));let f=await o.acquire();return await fc({browser:f,hub:y,request:p},m)}catch(y){return KO(Ue(y))}};return{close:async()=>{await o.close();let p=s;s=void 0,a=void 0,p!=null&&await p.then(m=>m.close()).catch(()=>{})},prewarm:async()=>{await l(),await o.acquire()},injectSpan:(p,m)=>{a?.injectSpan(p,m)},runOnce:(p,m)=>new YO(c(p,m))}}import{z as A}from"zod";function ZO(e){let t=e.split(`
|
|
65
|
-
`).map(i=>fI(i)).filter(i=>i!=null),r=aI(t),n=t.map(i=>tI(i,r)).filter(i=>i!=null).filter(i=>i.kind==="input"||i.element!=null);return JO(n)}function JO(e){return e.filter((t,r)=>{let n=e[r+1];return!(t.kind==="input"&&n?.kind==="input"&&QO(t.element,n.element))})}function QO(e,t){return e?.testId===t?.testId&&e?.ariaLabel===t?.ariaLabel&&e?.placeholder===t?.placeholder}var eI={2:"click",3:"contextmenu",4:"dblclick"};function tI(e,t){return e.rrwebType==="IncrementalSnapshot:MouseInteraction"?rI(e,t):e.rrwebType==="IncrementalSnapshot:Input"?nI(e,t):null}function rI(e,t){let r=bI.safeParse(e.event.data);if(!r.success)return null;let n=eI[r.data.type];if(n==null)return null;let i=xy(r.data.id,t.nodes);return{element:ky(i,t),kind:n,timeNanos:e.timeNanos,value:void 0}}function nI(e,t){let r=wI.safeParse(e.event.data);return r.success?{element:ky(r.data.id,t),kind:"input",timeNanos:e.timeNanos,value:r.data.text??iI(r.data.isChecked)}:null}function iI(e){return e==null?void 0:String(e)}var oI=new Set(["button","a","input","select","textarea","summary"]);function xy(e,t){let r=t.get(e);if(r!=null)return sI(r)?e:r.parentId==null?void 0:xy(r.parentId,t)}function sI(e){return e.attrs["data-testid"]!=null||e.attrs["aria-label"]!=null||e.attrs.role!=null||oI.has(e.tag??"")}function ky(e,t){let r=e==null?void 0:t.nodes.get(e);if(!(r==null||e==null))return{ariaLabel:Lr(r,"aria-label"),href:Lr(r,"href"),name:Lr(r,"name"),placeholder:Lr(r,"placeholder"),role:Lr(r,"role"),tag:r.tag,testId:Lr(r,"data-testid"),text:Ey(e,t)}}function Lr(e,t){let r=e.attrs[t];return typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):void 0}function Ey(e,t){let r=t.nodes.get(e);if(r==null)return;let n=r.text?.trim()??"",o=(t.children.get(e)??[]).map(a=>Ey(a,t)??""),s=[n,...o].filter(a=>a.length>0).join(" ");return s.length===0?void 0:s.slice(0,100)}function aI(e){let t=e.flatMap(i=>lI(i).flatMap(o=>mc(o,void 0))),r=e.flatMap(i=>cI(i).flatMap(o=>mc(o.node,o.parentId??void 0))),n=dI(new Map([...t,...r]),e);return{children:uI(n),nodes:n}}function lI(e){if(e.rrwebType!=="FullSnapshot")return[];let t=yI.safeParse(e.event.data);return t.success?[t.data.node]:[]}function cI(e){if(e.rrwebType!=="IncrementalSnapshot:Mutation")return[];let t=Cy.safeParse(e.event.data);return t.success?t.data.adds.flatMap(r=>{let n=gI.safeParse(r);return n.success?[n.data]:[]}):[]}function uI(e){let t=new Map;return e.forEach((r,n)=>{r.parentId!=null&&t.set(r.parentId,[...t.get(r.parentId)??[],n])}),t}function mc(e,t){let r=mI.safeParse(e);if(!r.success)return[];let n=r.data,i=n.childNodes??[];return[[n.id,{attrs:{...n.attributes},parentId:t,tag:n.tagName,text:n.textContent}],...i.flatMap(s=>mc(s,n.id))]}function dI(e,t){return t.flatMap(n=>pI(n)).reduce((n,i)=>{let o=n.get(i.id);return o==null?n:new Map(n).set(i.id,{...o,attrs:{...o.attrs,...i.attributes}})},e)}function pI(e){if(e.rrwebType!=="IncrementalSnapshot:Mutation")return[];let t=Cy.safeParse(e.event.data);return t.success?t.data.attributes.flatMap(r=>{let n=SI.safeParse(r);return n.success?[n.data]:[]}):[]}function fI(e){if(e.trim().length===0)return null;let t=RI.safeParse(hI(e));return t.success?t.data:null}function hI(e){try{return JSON.parse(e)}catch{return null}}var mI=A.object({attributes:A.record(A.string(),A.unknown()).optional(),childNodes:A.array(A.unknown()).optional(),id:A.number(),tagName:A.string().optional(),textContent:A.string().optional()}),yI=A.object({node:A.unknown()}),gI=A.object({node:A.unknown(),parentId:A.number().nullable().default(null)}),SI=A.object({attributes:A.record(A.string(),A.unknown()),id:A.number()}),Cy=A.object({adds:A.array(A.unknown()).default([]),attributes:A.array(A.unknown()).default([])}),bI=A.object({id:A.number(),type:A.number()}),wI=A.object({id:A.number(),isChecked:A.boolean().optional(),text:A.string().optional()}),RI=A.object({event:A.object({data:A.unknown()}),kind:A.literal("rrweb"),rrwebType:A.string(),timeNanos:A.string()});function vI(e){let t=r=>e.find(n=>n.phase===r)?.ms??0;return{browserMs:t("browser"),driveMs:t("drive"),engineMs:t("engine"),teardownMs:t("teardown"),worldMs:t("world")}}async function xI(e,t){let r=await My({attemptIndex:0,capture:!1,params:e,stepRuns:e.stepRuns},t);if(r.kind!=="completed")return Ay(r);let n=Py(r.findings);if(n!=null)return{error:n,kind:"error"};let i=dr(r.findings);if(i.length===0)return{kind:"clean",ranCount:r.ranCount,timing:{confirm:void 0,detect:r.timing}};let o=cn(e.baseState.name,i);return e.seenSignature!=null&&await e.seenSignature(o.signature)?{kind:"seen",ranCount:r.ranCount,signature:o.signature,timing:{confirm:void 0,detect:r.timing},title:o.title,verifierLayer:o.layer}:kI(e,o,r.timing,t)}function Ay(e){return e.kind==="error"?{error:e.error,kind:"error"}:{kind:e.kind}}function Py(e){let t=e.find(r=>r.kind==="driver-error"&&qn(r.error));return t!=null&&t.kind==="driver-error"?t.error:void 0}async function kI(e,t,r,n){let i=await My({attemptIndex:1,capture:!0,params:e,stepRuns:e.stepRuns},n);if(i.kind!=="completed")return Ay(i);let o=Py(i.findings);if(o!=null)return{error:o,kind:"error"};let s={confirm:i.timing,detect:r},a=dr(i.findings);return a.length===0||cn(e.baseState.name,a).signature!==t.signature?{kind:"flaky",ranCount:i.ranCount,timing:s}:{baseState:e.baseState.name,captureEvents:i.events,kind:"finding",ranCount:i.ranCount,runId:i.runId,signature:t.signature,sourceTest:t.sourceTest,timing:s,title:t.title,verifierLayer:t.layer}}async function My({attemptIndex:e,capture:t,params:r,stepRuns:n},i){let o=r.runIdFor(e),s=[],a=[];return(await r.session.runOnce({capture:t,lockfile:r.lockfile,onEvent:t?c=>{s.push(c)}:void 0,options:r.options,params:void 0,runId:o,sequence:EI(r,n),test:r.baseState.test,onPhase:(c,u)=>{a.push({ms:u,phase:c})}},i)).match(c=>c.aborted?{kind:"aborted"}:{events:s,findings:c.findings,kind:"completed",ranCount:c.ran.length,runId:o,timing:vI(a)},c=>({error:c,kind:"error"}))}function EI(e,t){return t.map(r=>{let n=e.corpus[r.idx];if(n==null)throw new Error("transition index out of corpus range");return{params:r.params,transition:n}})}async function Oy(e,t){let r=await Xi(e);if(r==null)return{kind:"unplannable"};let n=[...r.startingPointTests.values()].find(o=>ne(o)===t.baseStateRef);if(n==null)return{kind:"unplannable"};let i=t.steps.map(o=>{let s=r.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:n,kind:"ok",sequence:i.filter(o=>o!=null)}}async function CI({capture:e,lockfile:t,onEvent:r,options:n,repro:i,runId:o,session:s,signal:a}){let l=await Oy(t,i);return l.kind==="unplannable"?{kind:"unplannable"}:(await s.runOnce({capture:e,lockfile:t,onEvent:r,onPhase:void 0,options:n,params:void 0,runId:o,sequence:l.sequence,test:l.baseTest},a)).match(u=>{if(u.aborted)return{kind:"aborted"};let d=dr(u.findings);return d.length>0?{findings:d,kind:"still-fails"}:{kind:"resolved"}},u=>({kind:"state-unavailable",reason:u.kind}))}export{nr as a,v as b,dt as c,ne as d,J as e,Yr as f,qn as g,Uc as h,jr as i,ai as j,tr as k,od as l,Ct as m,hi as n,yd as o,kd as p,Cd as q,bp as r,wp as s,vp as t,xp as u,Ep as v,ce as w,Id as x,wi as y,Vt as z,Wt as A,Ut as B,ta as C,Q as D,$d as E,Ld as F,Ei as G,oa as H,Fd as I,rn as J,ft as K,Pp as L,Dp as M,_p as N,jp as O,Bp as P,Wp as Q,Up as R,Xi as S,zp as T,xa as U,IO as V,LO as W,by as X,XO as Y,ZO as Z,xI as _,Oy as $,CI as aa};
|
|
66
|
-
/*! Bundled license information:
|
|
67
|
-
|
|
68
|
-
rrweb/dist/rrweb.js:
|
|
69
|
-
(*! *****************************************************************************
|
|
70
|
-
Copyright (c) Microsoft Corporation.
|
|
71
|
-
|
|
72
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
73
|
-
purpose with or without fee is hereby granted.
|
|
74
|
-
|
|
75
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
76
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
77
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
78
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
79
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
80
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
81
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
82
|
-
***************************************************************************** *)
|
|
83
|
-
*/
|