ripplo 0.7.52 → 0.7.54

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.
@@ -51,4 +51,4 @@ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LAN
51
51
  https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new Gs().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return A([i(a)]).process(o,l)},i};A.stringify=dh;A.parse=wh;A.fromJSON=ph;A.list=bh;A.comment=s=>new So(s);A.atRule=s=>new vo(s);A.decl=s=>new wo(s);A.rule=s=>new Co(s);A.root=s=>new Io(s);A.document=s=>new bo(s);A.CssSyntaxError=ch;A.Declaration=wo;A.Container=fh;A.Processor=Gs;A.Document=bo;A.Comment=So;A.Warning=mh;A.AtRule=vo;A.Result=gh;A.Input=yh;A.Rule=Co;A.Root=Io;A.Node=Sh;hh.registerPostcss(A);var vh=A;A.default=A;var F=_u(vh);F.stringify;F.fromJSON;F.plugin;F.parse;F.list;F.document;F.comment;F.atRule;F.rule;F.decl;F.root;F.CssSyntaxError;F.Declaration;F.Container;F.Processor;F.Document;F.Comment;F.Warning;F.AtRule;F.Result;F.Input;F.Rule;F.Root;F.Node;var hs=class s{constructor(...e){ee(this,"parentElement",null),ee(this,"parentNode",null),ee(this,"ownerDocument"),ee(this,"firstChild",null),ee(this,"lastChild",null),ee(this,"previousSibling",null),ee(this,"nextSibling",null),ee(this,"ELEMENT_NODE",1),ee(this,"TEXT_NODE",3),ee(this,"nodeType"),ee(this,"nodeName"),ee(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof s){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var Pi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Li={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Dt={},Ch=()=>!!globalThis.Zone;function js(s){if(Dt[s])return Dt[s];let e=globalThis[s],t=e.prototype,r=s in Pi?Pi[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in Li?Li[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!Ch())return Dt[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let u=a[s].prototype;return document.body.removeChild(l),u?Dt[s]=u:t}catch{return t}}var Or={};function pe(s,e,t){var r;let i=`${s}.${String(t)}`;if(Or[i])return Or[i].call(e);let n=js(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Or[i]=o,o.call(e)):e[t]}var Dr={};function Eo(s,e,t){let r=`${s}.${String(t)}`;if(Dr[r])return Dr[r].bind(e);let n=js(s)[t];return typeof n!="function"?e[t]:(Dr[r]=n,n.bind(e))}function Ih(s){return pe("Node",s,"ownerDocument")}function Eh(s){return pe("Node",s,"childNodes")}function xh(s){return pe("Node",s,"parentNode")}function Mh(s){return pe("Node",s,"parentElement")}function Nh(s){return pe("Node",s,"textContent")}function Rh(s,e){return Eo("Node",s,"contains")(e)}function Ah(s){return Eo("Node",s,"getRootNode")()}function Oh(s){return!s||!("host"in s)?null:pe("ShadowRoot",s,"host")}function Dh(s){return s.styleSheets}function Th(s){return!s||!("shadowRoot"in s)?null:pe("Element",s,"shadowRoot")}function _h(s,e){return pe("Element",s,"querySelector")(e)}function kh(s,e){return pe("Element",s,"querySelectorAll")(e)}function xo(){return js("MutationObserver").constructor}function Ie(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch{return()=>{}}}var C={ownerDocument:Ih,childNodes:Eh,parentNode:xh,parentElement:Mh,textContent:Nh,contains:Rh,getRootNode:Ah,host:Oh,styleSheets:Dh,shadowRoot:Th,querySelector:_h,querySelectorAll:kh,mutationObserver:xo,patch:Ie};function Z(s,e,t=document){let r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}var xe=`Please stop import mirror directly. Instead of that,\r
52
52
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
53
53
  or you can use record.mirror to access the mirror instance during recording.`,Fi={map:{},getId(){return console.error(xe),-1},getNode(){return console.error(xe),null},removeNodeFromMap(){console.error(xe)},has(){return console.error(xe),!1},reset(){console.error(xe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Fi=new Proxy(Fi,{get(s,e,t){return e==="map"&&console.error(xe),Reflect.get(s,e,t)}}));function rt(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===!1&&(i=o);let l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function dr(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>dr(s,e,n||{},!0)}var qt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(qt=()=>new Date().getTime());function Mo(s){var e,t,r,i;let n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||n?.body&&((e=C.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n?.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:n?.documentElement.scrollTop||n?.body&&((r=C.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n?.body)==null?void 0:i.scrollTop)||0}}function No(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ro(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ao(s){return s?s.nodeType===s.ELEMENT_NODE?s:C.parentElement(s):null}function X(s,e,t,r){if(!s)return!1;let i=Ao(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Gt(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function $h(s,e){return e.getId(s)!==-1}function Tr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===Ye}function Oo(s,e){if(Ge(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=C.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Oo(r,e):!0}function fs(s){return!!s.changedTouches}function Ph(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Do(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function To(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function ds(s){return s?s instanceof hs&&"shadowRoot"in s?!!s.shadowRoot:!!C.shadowRoot(s):!1}var ps=class{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function _o(s){var e;let t=null;return"getRootNode"in s&&((e=C.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(s))&&(t=C.host(C.getRootNode(s))),t}function Lh(s){let e=s,t;for(;t=_o(e);)e=t;return e}function Fh(s){let e=C.ownerDocument(s);if(!e)return!1;let t=Lh(s);return C.contains(e,t)}function ko(s){let e=C.ownerDocument(s);return e?C.contains(e,s)||Fh(s):!1}var x=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(x||{}),I=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(I||{}),J=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(J||{}),ce=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(ce||{}),Pe=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Pe||{}),Me=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Me||{});var $o=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))($o||{});function Ui(s){return"__ln"in s}var ms=class{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ui(e.previousSibling)){let r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Ui(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Bi=(s,e)=>`${s}@${e}`,gs=class{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new ms,i=a=>{let u=a,c=Ye;for(;c===Ye;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=a=>{let u=C.parentNode(a);if(!u||!ko(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){let m=u.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let h=Ge(u)?this.mirror.getId(_o(a)):this.mirror.getId(u),p=i(a);if(h===-1||p===-1)return r.addNode(a);let g=Re(a,{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:m=>{Do(m,this.mirror)&&this.iframeManager.addIframe(m),To(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),ds(a)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(a),this.doc)},onIframeLoad:(m,d)=>{this.iframeManager.attachIframe(m,d),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,d)=>{this.stylesheetManager.attachLinkElement(m,d)},cssCaptured:c});g&&(e.push({parentId:h,nextId:p,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)Wi(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(C.parentNode(a))||n(a);for(let a of this.addedSet)!zi(this.droppedSet,a)&&!Wi(this.removesSubTreeCache,a,this.mirror)||zi(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){let u=this.mirror.getId(C.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let h=this.mirror.getId(C.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){a=c;break}else{let g=c.value,m=C.parentNode(g);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=C.host(m);if(this.mirror.getId(d)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value)}let l={texts:this.texts.map(a=>{let u=a.node,c=C.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:u}=a;if(typeof u.style=="string"){let c=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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(l))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(C.childNodes(e),i=>C.textContent(i)||"").join("");t.attributes.value=Wt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:zt(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!Tr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=C.textContent(e.target);!X(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:rn(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ao(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=zt(t);i=Wt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(X(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!tn(t.tagName,r))if(n.attributes[r]=en(this.doc,Se(t.tagName),Se(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let l of Array.from(t.style)){let a=t.style.getPropertyValue(l),u=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||u!==o.style.getPropertyPriority(l)?u===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,u]:n._unchangedStyles[l]=[a,u]}for(let l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(X(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=Ge(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);X(e.target,this.blockClass,this.blockSelector,!1)||Tr(t,this.mirror,this.slimDOMOptions)||!$h(t,this.mirror)||(this.addedSet.has(t)?(ys(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Oo(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Bi(r,i)]?ys(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Ge(e.target)&&je(e.target)?!0:void 0}),Uh(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Tr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[Bi(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);X(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach(r=>this.genAdds(r)),ds(e)&&C.childNodes(C.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}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 ys(s,e){s.delete(e),C.childNodes(e).forEach(t=>ys(s,t))}function Uh(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),C.childNodes(r).forEach(i=>t.push(i)))}}function Wi(s,e,t){return s.size===0?!1:Bh(s,e)}function Bh(s,e,t){let r=C.parentNode(e);return r?s.has(r):!1}function zi(s,e){return s.size===0?!1:Po(s,e)}function Po(s,e){let t=C.parentNode(e);return t?s.has(t)?!0:Po(s,t):!1}var He;function Wh(s){He=s}function zh(){He=void 0}var E=s=>He?(...t)=>{try{return s(...t)}catch(r){if(He&&He(r)===!0)return;throw r}}:s,be=[];function at(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function Lo(s,e){let t=new gs;be.push(t),t.init(s);let r=new(xo())(E(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Vh({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],l,a=rt(E(h=>{let p=Date.now()-l;s(o.map(g=>(g.timeOffset-=p,g)),h),o=[],l=null}),n),u=E(rt(E(h=>{let p=at(h),{clientX:g,clientY:m}=fs(h)?h.changedTouches[0]:h;l||(l=qt()),o.push({x:g,y:m,id:r.getId(p),timeOffset:qt()-l}),a(typeof DragEvent<"u"&&h instanceof DragEvent?I.Drag:h instanceof MouseEvent?I.MouseMove:I.TouchMove)}),i,{trailing:!1})),c=[Z("mousemove",u,t),Z("touchmove",u,t),Z("drag",u,t)];return E(()=>{c.forEach(h=>h())})}function Gh({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};let o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[],a=null,u=c=>h=>{let p=at(h);if(X(p,r,i,!0))return;let g=null,m=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=ce.Mouse;break;case"touch":g=ce.Touch;break;case"pen":g=ce.Pen;break}g===ce.Touch?J[c]===J.MouseDown?m="TouchStart":J[c]===J.MouseUp&&(m="TouchEnd"):ce.Pen}else fs(h)&&(g=ce.Touch);g!==null?(a=g,(m.startsWith("Touch")&&g===ce.Touch||m.startsWith("Mouse")&&g===ce.Mouse)&&(g=null)):J[c]===J.Click&&(g=a,a=null);let d=fs(h)?h.changedTouches[0]:h;if(!d)return;let f=t.getId(p),{clientX:b,clientY:S}=d;E(s)({type:J[m],id:f,x:b,y:S,...g!==null&&{pointerType:g}})};return Object.keys(J).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=Se(c),p=u(c);if(window.PointerEvent)switch(J[c]){case J.MouseDown:case J.MouseUp:h=h.replace("mouse","pointer");break;case J.TouchStart:case J.TouchEnd:return}l.push(Z(h,p,e))}),E(()=>{l.forEach(c=>c())})}function Fo({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=E(rt(E(l=>{let a=at(l);if(!a||X(a,r,i,!0))return;let u=t.getId(a);if(a===e&&e.defaultView){let c=Mo(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return Z("scroll",o,e)}function jh({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=E(rt(E(()=>{let n=No(),o=Ro();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return Z("resize",i,e)}var Hh=["INPUT","TEXTAREA","SELECT"],Vi=new WeakMap;function Yh({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function h(S){let y=at(S),v=S.isTrusted,O=y&&y.tagName;if(y&&O==="OPTION"&&(y=C.parentElement(y)),!y||!O||Hh.indexOf(O)<0||X(y,r,i,!0)||y.classList.contains(n)||o&&y.matches(o))return;let T=y.value,V=!1,P=zt(y)||"";P==="radio"||P==="checkbox"?V=y.checked:(l[O.toLowerCase()]||l[P])&&(T=Wt({element:y,maskInputOptions:l,tagName:O,type:P,value:T,maskInputFn:a})),p(y,c?{text:T,isChecked:V,userTriggered:v}:{text:T,isChecked:V});let z=y.name;P==="radio"&&z&&V&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(H=>{if(H!==y){let Q=H.value;p(H,c?{text:Q,isChecked:!V,userTriggered:!1}:{text:Q,isChecked:!V})}})}function p(S,y){let v=Vi.get(S);if(!v||v.text!==y.text||v.isChecked!==y.isChecked){Vi.set(S,y);let O=t.getId(S);E(s)({...y,id:O})}}let m=(u.input==="last"?["change"]:["input","change"]).map(S=>Z(S,E(h),e)),d=e.defaultView;if(!d)return()=>{m.forEach(S=>S())};let f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),b=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&m.push(...b.map(S=>dr(S[0],S[1],{set(){E(h)({target:this,isTrusted:!1})}},!1,d))),E(()=>{m.forEach(S=>S())})}function er(s){let e=[];function t(r,i){if(Tt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Tt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Tt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Tt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function me(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Zh({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:E((c,h,p)=>{let[g,m]=p,{id:d,styleId:f}=me(h,e,t.styleMirror);return(d&&d!==-1||f&&f!==-1)&&s({id:d,styleId:f,adds:[{rule:g,index:m}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,p=this.cssRules.length){let g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,p])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:E((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,removes:[{index:g}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:E((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replace:g}),c.apply(h,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:E((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replaceSync:g}),c.apply(h,p)})}));let a={};_t("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(_t("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),_t("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),_t("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(a).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:E((p,g,m)=>{let[d,f]=m,{id:b,styleId:S}=me(g.parentStyleSheet,e,t.styleMirror);return(b&&b!==-1||S&&S!==-1)&&s({id:b,styleId:S,adds:[{rule:d,index:[...er(g),f||0]}]}),p.apply(g,m)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:E((p,g,m)=>{let[d]=m,{id:f,styleId:b}=me(g.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||b&&b!==-1)&&s({id:f,styleId:b,removes:[{index:[...er(g),d]}]}),p.apply(g,m)})})}),E(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Uo({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(C.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;let h=(c=a.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch{}return h}}),E(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Xh({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:E((l,a,u)=>{var c;let[h,p,g]=u;if(t.has(h))return n.apply(a,[h,p,g]);let{id:m,styleId:d}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,set:{property:h,value:p,priority:g},index:er(a.parentRule)}),l.apply(a,u)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:E((l,a,u)=>{var c;let[h]=u;if(t.has(h))return o.apply(a,[h]);let{id:p,styleId:g}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,remove:{property:h},index:er(a.parentRule)}),l.apply(a,u)})}),E(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Jh({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=E(a=>rt(E(u=>{let c=at(u);if(!c||X(c,e,t,!0))return;let{currentTime:h,volume:p,muted:g,playbackRate:m,loop:d}=c;s({type:a,id:r.getId(c),currentTime:h,volume:p,muted:g,playbackRate:m,loop:d})}),i.media||500)),l=[Z("play",o(Me.Play),n),Z("pause",o(Me.Pause),n),Z("seeked",o(Me.Seeked),n),Z("volumechange",o(Me.VolumeChange),n),Z("ratechange",o(Me.RateChange),n)];return E(()=>{l.forEach(a=>a())})}function Kh({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,u,c){let h=new n(a,u,c);return i.set(h,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};let o=Ie(e.fonts,"add",function(l){return function(a){return setTimeout(E(()=>{let u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),E(()=>{r.forEach(l=>l())})}function Qh(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=!0,l=E(()=>{let a=e.getSelection();if(!a||o&&a?.isCollapsed)return;o=a.isCollapsed||!1;let u=[],c=a.rangeCount||0;for(let h=0;h<c;h++){let p=a.getRangeAt(h),{startContainer:g,startOffset:m,endContainer:d,endOffset:f}=p;X(g,r,i,!0)||X(d,r,i,!0)||u.push({start:t.getId(g),startOffset:m,end:t.getId(d),endOffset:f})}n({ranges:u})});return l(),Z("selectionchange",l)}function qh({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:Ie(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function ef(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:p,selectionCb:g,customElementCb:m}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d)},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d)},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d)},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),n(...d)},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),o(...d)},s.inputCb=(...d)=>{e.input&&e.input(...d),l(...d)},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),a(...d)},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),u(...d)},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),c(...d)},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d)},s.fontCb=(...d)=>{e.font&&e.font(...d),p(...d)},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),g(...d)},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),m(...d)}}function tf(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};ef(s,e);let r;s.recordDOM&&(r=Lo(s,s.doc));let i=Vh(s),n=Gh(s),o=Fo(s),l=jh(s,{win:t}),a=Yh(s),u=Jh(s),c=()=>{},h=()=>{},p=()=>{},g=()=>{};s.recordDOM&&(c=Zh(s,{win:t}),h=Uo(s,s.doc),p=Xh(s,{win:t}),s.collectFonts&&(g=Kh(s)));let m=Qh(s),d=qh(s),f=[];for(let b of s.plugins)f.push(b.observer(b.callback,t,b.options));return E(()=>{be.forEach(b=>b.reset()),r?.disconnect(),i(),n(),o(),l(),a(),u(),c(),h(),p(),g(),m(),d(),f.forEach(b=>b())})}function Tt(s){return typeof window[s]<"u"}function _t(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var tr=class{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},ws=class{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new tr(qi)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case x.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:x.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case x.Meta:case x.Load:case x.DomContentLoaded:return!1;case x.Plugin:return t;case x.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case x.IncrementalSnapshot:switch(t.data.source){case I.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.Drag:case I.TouchMove:case I.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(t.data,e,["id"]),t;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case I.Font:return t;case I.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case I.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==$o.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},bs=class{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!je(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=Lo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Fo({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(Uo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(Ie(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),l=C.shadowRoot(this);return l&&ko(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rf=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Ve=0;Ve<Ae.length;Ve++)rf[Ae.charCodeAt(Ve)]=Ve;var Ve,sf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Ae[e[t]>>2],i+=Ae[(e[t]&3)<<4|e[t+1]>>4],i+=Ae[(e[t+1]&15)<<2|e[t+2]>>6],i+=Ae[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Gi=new Map;function nf(s,e){let t=Gi.get(s);return t||(t=new Map,Gi.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var Bo=(s,e,t)=>{if(!s||!(zo(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=nf(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function Ft(s,e,t){if(s instanceof Array)return s.map(r=>Ft(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=sf(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Ft(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Ft(s.data,e,t),s.width,s.height]};if(zo(s,e)||typeof s=="object"){let r=s.constructor.name,i=Bo(s,e,t);return{rr_type:r,index:i}}}}return s}var Wo=(s,e,t)=>s.map(r=>Ft(r,e,t)),zo=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function of(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let l=Ie(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...u){return X(this.canvas,t,r,!0)||setTimeout(()=>{let c=Wo(u,e,this);s(this.canvas,{type:Pe["2D"],property:o,args:c})},0),a.apply(this,u)}});i.push(l)}catch{let l=dr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:Pe["2D"],property:o,args:[a],setter:!0})}});i.push(l)}return()=>{i.forEach(o=>o())}}function af(s){return s==="experimental-webgl"?"webgl":s}function ji(s,e,t,r){let i=[];try{let n=Ie(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!X(this,e,t,!0)){let u=af(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){let c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function Hi(s,e,t,r,i,n){let o=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let u=Ie(s,a,function(c){return function(...h){let p=c.apply(this,h);if(Bo(p,n,this),"tagName"in this.canvas&&!X(this.canvas,r,i,!0)){let g=Wo(h,n,this),m={type:e,property:a,args:g};t(this.canvas,m)}return p}});o.push(u)}catch{let u=dr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});o.push(u)}return o}function lf(s,e,t,r){let i=[];return i.push(...Hi(e.WebGLRenderingContext.prototype,Pe.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...Hi(e.WebGL2RenderingContext.prototype,Pe.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}var Vo="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",uf=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),Yi=typeof window<"u"&&window.Blob&&new Blob([uf(Vo)],{type:"text/javascript;charset=utf-8"});function cf(s){let e;try{if(e=Yi&&(window.URL||window.webkitURL).createObjectURL(Yi),!e)throw"";let t=new Worker(e,{name:s?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+Vo,{name:s?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var Ss=class{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}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(e,t,r,i,n){let o=ji(t,r,i,!0),l=new Map,a=new cf;a.onmessage=m=>{let{id:d}=m.data;if(l.set(d,!1),!("base64"in m.data))return;let{base64:f,type:b,width:S,height:y}=m.data;this.mutationCb({id:d,type:Pe["2D"],commands:[{property:"clearRect",args:[0,0,S,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:b}]},0,0]}]})};let u=1e3/e,c=0,h,p=()=>{let m=[];return t.document.querySelectorAll("canvas").forEach(d=>{X(d,r,i,!0)||m.push(d)}),m},g=m=>{if(c&&m-c<u){h=requestAnimationFrame(g);return}c=m,p().forEach(async d=>{var f;let b=this.mirror.getId(d);if(l.get(b)||d.width===0||d.height===0)return;if(l.set(b,!0),["webgl","webgl2"].includes(d.__context)){let y=d.getContext(d.__context);((f=y?.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let S=await createImageBitmap(d);a.postMessage({id:b,bitmap:S,width:d.width,height:d.height,dataURLOptions:n.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=ji(e,t,r,!1),n=of(this.processMutation.bind(this),e,t,r),o=lf(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(o=>{let{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}},vs=class{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new ps),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:Ki(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Cs=class{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},W,Ut,_r,rr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Ks=s.contentWindow)==null?void 0:Ks.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var re=ga();function ue(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:d,hooks:f,packFn:b,sampling:S={},dataURLOptions:y={},mousemoveWait:v,recordDOM:O=!0,recordCanvas:T=!1,recordCrossOriginIframes:V=!1,recordAfter:P=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:z=!1,collectFonts:H=!1,inlineImages:Q=!1,plugins:ne,keepIframeSrcFn:M=()=>!1,ignoreCSSAttributes:Le=new Set([]),errorHandler:Fe}=s;Wh(Fe);let G=V?window.parent===window:!0,q=!1;if(!G)try{window.parent.document&&(q=!1)}catch{q=!0}if(G&&!e)throw new Error("emit function is required");if(!G&&!q)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),re.reset();let ge=h===!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},oe=sn(g);Ph();let Ys,yr=0,Zs=N=>{for(let te of ne||[])te.eventProcessor&&(N=te.eventProcessor(N));return b&&!q&&(N=b(N)),N};W=(N,te)=>{var U;let B=N;if(B.timestamp=qt(),(U=be[0])!=null&&U.isFrozen()&&B.type!==x.FullSnapshot&&!(B.type===x.IncrementalSnapshot&&B.data.source===I.Mutation)&&be.forEach(K=>K.unfreeze()),G)e?.(Zs(B),te);else if(q){let K={type:"rrweb",event:Zs(B),origin:window.location.origin,isCheckout:te};window.parent.postMessage(K,"*")}if(B.type===x.FullSnapshot)Ys=B,yr=0;else if(B.type===x.IncrementalSnapshot){if(B.data.source===I.Mutation&&B.data.isAttachIframe)return;yr++;let K=r&&yr>=r,D=t&&B.timestamp-Ys.timestamp>t;(K||D)&&Ut(!0)}};let ut=N=>{W({type:x.IncrementalSnapshot,data:{source:I.Mutation,...N}})},Xs=N=>W({type:x.IncrementalSnapshot,data:{source:I.Scroll,...N}}),Js=N=>W({type:x.IncrementalSnapshot,data:{source:I.CanvasMutation,...N}}),jo=N=>W({type:x.IncrementalSnapshot,data:{source:I.AdoptedStyleSheet,...N}}),ye=new vs({mutationCb:ut,adoptedStyleSheetCb:jo}),we=new ws({mirror:re,mutationCb:ut,stylesheetManager:ye,recordCrossOriginIframes:V,wrappedEmit:W});for(let N of ne||[])N.getMirror&&N.getMirror({nodeMirror:re,crossOriginIframeMirror:we.crossOriginIframeMirror,crossOriginIframeStyleMirror:we.crossOriginIframeStyleMirror});let wr=new Cs;_r=new Ss({recordCanvas:T,mutationCb:Js,win:window,blockClass:i,blockSelector:n,mirror:re,sampling:S.canvas,dataURLOptions:y});let ct=new bs({mutationCb:ut,scrollCb:Xs,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ge,dataURLOptions:y,maskTextFn:d,maskInputFn:m,recordCanvas:T,inlineImages:Q,sampling:S,slimDOMOptions:oe,iframeManager:we,stylesheetManager:ye,canvasManager:_r,keepIframeSrcFn:M,processedNodeManager:wr},mirror:re});Ut=(N=!1)=>{if(!O)return;W({type:x.Meta,data:{href:window.location.href,width:Ro(),height:No()}},N),ye.reset(),ct.init(),be.forEach(U=>U.lock());let te=Ba(document,{mirror:re,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ge,maskTextFn:d,maskInputFn:m,slimDOM:oe,dataURLOptions:y,recordCanvas:T,inlineImages:Q,onSerialize:U=>{Do(U,re)&&we.addIframe(U),To(U,re)&&ye.trackLinkElement(U),ds(U)&&ct.addShadowRoot(C.shadowRoot(U),document)},onIframeLoad:(U,B)=>{we.attachIframe(U,B),ct.observeAttachShadow(U)},onStylesheetLoad:(U,B)=>{ye.attachLinkElement(U,B)},keepIframeSrcFn:M});if(!te)return console.warn("Failed to snapshot the document");W({type:x.FullSnapshot,data:{node:te,initialOffset:Mo(window)}},N),be.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ye.adoptStyleSheets(document.adoptedStyleSheets,re.getId(document))};try{let N=[],te=B=>{var K;return E(tf)({mutationCb:ut,mousemoveCb:(D,br)=>W({type:x.IncrementalSnapshot,data:{source:br,positions:D}}),mouseInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.MouseInteraction,...D}}),scrollCb:Xs,viewportResizeCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.ViewportResize,...D}}),inputCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.Input,...D}}),mediaInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.MediaInteraction,...D}}),styleSheetRuleCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.StyleSheetRule,...D}}),styleDeclarationCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.StyleDeclaration,...D}}),canvasMutationCb:Js,fontCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.Font,...D}}),selectionCb:D=>{W({type:x.IncrementalSnapshot,data:{source:I.Selection,...D}})},customElementCb:D=>{W({type:x.IncrementalSnapshot,data:{source:I.CustomElement,...D}})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:ge,inlineStylesheet:c,sampling:S,recordDOM:O,recordCanvas:T,inlineImages:Q,userTriggeredOnInput:z,collectFonts:H,doc:B,maskInputFn:m,maskTextFn:d,keepIframeSrcFn:M,blockSelector:n,slimDOMOptions:oe,dataURLOptions:y,mirror:re,iframeManager:we,stylesheetManager:ye,shadowDomManager:ct,processedNodeManager:wr,canvasManager:_r,ignoreCSSAttributes:Le,plugins:((K=ne?.filter(D=>D.observer))==null?void 0:K.map(D=>({observer:D.observer,options:D.options,callback:br=>W({type:x.Plugin,data:{plugin:D.name,payload:br}})})))||[]},f)};we.addLoadListener(B=>{try{N.push(te(B.contentDocument))}catch(K){console.warn(K)}});let U=()=>{Ut(),N.push(te(document)),rr=!0};return["interactive","complete"].includes(document.readyState)?U():(N.push(Z("DOMContentLoaded",()=>{W({type:x.DomContentLoaded,data:{}}),P==="DOMContentLoaded"&&U()})),N.push(Z("load",()=>{W({type:x.Load,data:{}}),P==="load"&&U()},window))),()=>{N.forEach(B=>{try{B()}catch(K){String(K).toLowerCase().includes("cross-origin")||console.warn(K)}}),wr.destroy(),rr=!1,zh()}}catch(N){console.warn(N)}}ue.addCustomEvent=(s,e)=>{if(!rr)throw new Error("please add custom event after start recording");W({type:x.Custom,data:{tag:s,payload:e}})};ue.freezePage=()=>{be.forEach(s=>s.freeze())};ue.takeFullSnapshot=s=>{if(!rr)throw new Error("please take full snapshot after start recording");Ut(s)};ue.mirror=re;var Zi;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Zi||(Zi={}));var qf=5*1e3;var{addCustomEvent:ed}=ue,{freezePage:td}=ue,{takeFullSnapshot:rd}=ue;var hf=150,ff=1e6,pr=[],Hs=0,lt;function df(){let s=globalThis.__ripploCapturePort,e=globalThis.__ripploRunId;if(!(typeof s!="number"||typeof e!="string"))return`http://127.0.0.1:${String(s)}/rrweb/${encodeURIComponent(e)}`}function Go(s){let e=globalThis.__ripploEmitRrwebEvent;e?.(s)}function pf(s){let e=df();return e==null?(Go(s),Promise.resolve()):fetch(e,{body:s,method:"POST",mode:"no-cors"}).then(()=>{},()=>{Go(s)})}function gr(){if(lt!=null&&(clearTimeout(lt),lt=void 0),pr.length===0)return Promise.resolve();let s=pr.join(`
54
- `);return pr.length=0,Hs=0,pf(s)}async function mf(){await new Promise(s=>setTimeout(s,0)),await gr()}globalThis.__ripploFlushRrweb=mf;function gf(s){if(pr.push(s),Hs+=s.length,Hs>=ff){gr();return}lt??=setTimeout(()=>{lt=void 0,gr()},hf)}var yf=100,mr=new WeakSet;function wf(){document.getAnimations().forEach(s=>{if(!(s instanceof CSSAnimation||s instanceof CSSTransition)&&!mr.has(s)&&(mr.add(s),bf(s),s.playState==="finished"))try{s.commitStyles(),s.cancel()}catch{mr.add(s)}})}function bf(s){try{s.finish()}catch{mr.add(s)}}globalThis.__ripploRrwebRecording!==!0&&(globalThis.__ripploRrwebRecording=!0,globalThis.__ripploRrwebMirror=ue.mirror,addEventListener("pagehide",()=>{gr()}),setInterval(wf,yf),ue({recordCanvas:!1,recordCrossOriginIframes:!1,sampling:{mousemove:!1,scroll:150},slimDOMOptions:!0,emit:s=>{gf(JSON.stringify(s))}}));})();
54
+ `);return pr.length=0,Hs=0,pf(s)}async function mf(){await new Promise(s=>setTimeout(s,0)),await gr()}globalThis.__ripploFlushRrweb=mf;function gf(s){if(pr.push(s),Hs+=s.length,Hs>=ff){gr();return}lt??=setTimeout(()=>{lt=void 0,gr()},hf)}var yf=100,mr=new WeakSet;function wf(){document.getAnimations().forEach(s=>{if(!(s instanceof CSSAnimation||s instanceof CSSTransition)&&!mr.has(s)&&(mr.add(s),bf(s),s.playState==="finished"))try{s.commitStyles(),s.cancel()}catch{mr.add(s)}})}function bf(s){try{s.finish()}catch{mr.add(s)}}globalThis.__ripploRrwebRecording!==!0&&(globalThis.__ripploRrwebRecording=!0,globalThis.__ripploRrwebMirror=ue.mirror,addEventListener("pagehide",()=>{gr()}),setInterval(wf,yf),ue({inlineImages:!0,recordCanvas:!1,recordCrossOriginIframes:!1,sampling:{mousemove:!1,scroll:150},slimDOMOptions:!0,emit:s=>{gf(JSON.stringify(s))}}));})();
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{B as R,C as h,D as v,E as x,F as q,G as p,H as N,I as O,a as w,f as S,i as P,t as g,u,v as y,w as C,y as E,z as b}from"./chunk-BJ4KWIQU.js";import{h as D}from"./chunk-PXYDLKAG.js";import{sa as I}from"./chunk-IBYVXKWZ.js";import{spawn as J}from"child_process";import A from"fs";import F from"net";import{setTimeout as k}from"timers/promises";import{err as d,ok as f}from"neverthrow";import{ResponseError as G}from"vscode-jsonrpc/node";var T=12e4,_=300,M=5e3;async function sn({cliEntry:o,cwd:n}){let e=u(n),r=await i(e);return r!=null?j({cliEntry:o,connection:l(r,!1),cwd:n}):V({cliEntry:o,cwd:n,versionNote:void 0})}async function cn({cliEntry:o,cwd:n}){let e=await i(u(n));return e==null?d({kind:"not-running"}):j({cliEntry:o,connection:l(e,!1),cwd:n})}async function V({cliEntry:o,cwd:n,versionNote:e}){let r=H({cliEntry:o,cwd:n});if(r!=null)return d(r);let t=await Q(u(n));return t==null?d({deadlineMs:T,kind:"connect-timeout",logPath:y(n)}):f({...l(t,!0),versionNote:e})}async function j({cliEntry:o,connection:n,cwd:e}){let r=await $(n);if(r==null||r.version===w())return f(n);let t={daemonVersion:r.version};return await U(n)?(n.socket.destroy(),await W(u(e))?V({cliEntry:o,cwd:e,versionNote:{...t,kind:"restarted"}}):d({kind:"connection-lost"})):f({...n,versionNote:{...t,kind:"stale-busy"}})}async function U(o){try{return await o.rpc.sendRequest(p)}catch{return!1}}var K=1e4;async function W(o){let n=Date.now()+K,e=await i(o);for(;e!=null&&Date.now()<n;)e.destroy(),await k(_),e=await i(o);return e?.destroy(),e==null}async function un({connection:o,onEvent:n,request:e,token:r}){let t=await z({connection:o,onEvent:n,request:e,token:r});return t.kind==="transport"?d(t.error):f(t)}async function dn(o){let n=await i(u(o));if(n==null)return!1;let e=l(n,!1);try{return await e.rpc.sendRequest(p)}catch{return!1}finally{n.destroy()}}async function ln(o){try{await o.rpc.sendRequest(p)}catch{}}async function L(o){let n=await i(u(o));if(n==null)return{kind:"not-running"};let e=l(n,!1),r=await Promise.race([$(e),k(M).then(()=>null)]);return n.destroy(),r==null?{kind:"unresponsive",timeoutMs:M}:{kind:"running",status:r}}async function $(o){try{let n=await o.rpc.sendRequest(q),e=b.safeParse(n);return e.success?e.data:null}catch{return null}}function z({connection:o,onEvent:n,request:e,token:r}){let{rpc:t}=o;return new Promise(m=>{let a=s=>{m(s)};t.onNotification(N,s=>{let c=R.safeParse(s);if(!c.success){a({error:{kind:"bad-frame"},kind:"transport"});return}n(c.data.event)}),t.onNotification(O,s=>{let c=h.safeParse(s);if(!c.success){a({error:{kind:"bad-frame"},kind:"transport"});return}a({failed:c.data.failed,kind:"done",notRun:c.data.notRun,passed:c.data.passed})}),t.onClose(()=>{a({error:{kind:"connection-lost"},kind:"transport"})}),t.sendRequest(x,e,r).then(s=>{E.safeParse(s).success||a({error:{kind:"bad-frame"},kind:"transport"})}).catch(s=>{a(B(s))})})}function B(o){if(o instanceof G){let n=v.safeParse(o.data);return n.success?{error:n.data,kind:"daemon-error"}:{error:{kind:"bad-frame"},kind:"transport"}}return{error:{kind:"connection-lost"},kind:"transport"}}function l(o,n){let e=C(o);return e.listen(),{rpc:e,socket:o,spawned:n,versionNote:void 0}}function i(o){return new Promise(n=>{let e=F.connect(o);e.once("connect",()=>{n(e)}),e.once("error",()=>{n(null)})})}function H({cliEntry:o,cwd:n}){try{D(n);let e=A.openSync(y(n),"a");return J(process.execPath,[o,"daemon"],{cwd:n,detached:!0,stdio:["ignore",e,e]}).unref(),A.closeSync(e),null}catch(e){return{kind:"spawn-failed",message:e instanceof Error?e.message:String(e)}}}async function Q(o){let n=Date.now()+T,e=await i(o);for(;e==null&&Date.now()<n;)await k(_),e=await i(o);return e}async function wn(o){let n=process.cwd(),e=await S(n);e.isErr()&&(process.stderr.write(`${P(e.error)}
5
+ `),process.exit(1));let r=g(e.value),t=await L(n);if(o.format==="summary"){r.length>0&&process.stdout.write(`stub workflows: ${r.join(", ")}
6
+ `),process.stdout.write(`${I(t)}
7
+ `);return}let m={daemon:t.kind==="running"?{active:t.status.active,explorer:t.status.explorer,exploring:t.status.exploring,progress:t.status.progress,queued:t.status.queued,running:!0}:{running:t.kind==="unresponsive",state:t.kind},tests:r.map(a=>({id:a,implemented:!1}))};process.stdout.write(`${JSON.stringify(m,null,2)}
8
+ `)}export{sn as a,cn as b,un as c,dn as d,ln as e,L as f,wn as g};
@@ -1,2 +1,4 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
2
4
  var G=Object.create;var N=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty;var P=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var te=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of X(e))!ee.call(i,s)&&s!==t&&N(i,s,{get:()=>e[s],enumerable:!(n=Q(e,s))||n.enumerable});return i};var ue=(i,e,t)=>(t=i!=null?G(Z(i)):{},te(e||!i||!i.__esModule?N(t,"default",{value:i,enumerable:!0}):t,i));var I=P(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.timingSafeEqual=void 0;function T(i,e=""){if(!i)throw new Error(e)}function re(i,e){if(i.byteLength!==e.byteLength)return!1;i instanceof DataView||(i=new DataView(ArrayBuffer.isView(i)?i.buffer:i)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),T(i instanceof DataView),T(e instanceof DataView);let t=i.byteLength,n=0,s=-1;for(;++s<t;)n|=i.getUint8(s)^e.getUint8(s);return n===0}V.timingSafeEqual=re});var $=P(S=>{"use strict";var ie=S&&S.__extends||(function(){var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var g in s)s.hasOwnProperty(g)&&(n[g]=s[g])},i(e,t)};return function(e,t){i(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})();Object.defineProperty(S,"__esModule",{value:!0});var l=256,z=(function(){function i(e){e===void 0&&(e="="),this._paddingCharacter=e}return i.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},i.prototype.encode=function(e){for(var t="",n=0;n<e.length-2;n+=3){var s=e[n]<<16|e[n+1]<<8|e[n+2];t+=this._encodeByte(s>>>18&63),t+=this._encodeByte(s>>>12&63),t+=this._encodeByte(s>>>6&63),t+=this._encodeByte(s>>>0&63)}var g=e.length-n;if(g>0){var s=e[n]<<16|(g===2?e[n+1]<<8:0);t+=this._encodeByte(s>>>18&63),t+=this._encodeByte(s>>>12&63),g===2?t+=this._encodeByte(s>>>6&63):t+=this._paddingCharacter||"",t+=this._paddingCharacter||""}return t},i.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},i.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},i.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var t=this._getPaddingLength(e),n=e.length-t,s=new Uint8Array(this.maxDecodedLength(n)),g=0,p=0,m=0,E=0,C=0,A=0,a=0;p<n-4;p+=4)E=this._decodeChar(e.charCodeAt(p+0)),C=this._decodeChar(e.charCodeAt(p+1)),A=this._decodeChar(e.charCodeAt(p+2)),a=this._decodeChar(e.charCodeAt(p+3)),s[g++]=E<<2|C>>>4,s[g++]=C<<4|A>>>2,s[g++]=A<<6|a,m|=E&l,m|=C&l,m|=A&l,m|=a&l;if(p<n-1&&(E=this._decodeChar(e.charCodeAt(p)),C=this._decodeChar(e.charCodeAt(p+1)),s[g++]=E<<2|C>>>4,m|=E&l,m|=C&l),p<n-2&&(A=this._decodeChar(e.charCodeAt(p+2)),s[g++]=C<<4|A>>>2,m|=A&l),p<n-3&&(a=this._decodeChar(e.charCodeAt(p+3)),s[g++]=A<<6|a,m|=a&l),m!==0)throw new Error("Base64Coder: incorrect characters for decoding");return s},i.prototype._encodeByte=function(e){var t=e;return t+=65,t+=25-e>>>8&6,t+=51-e>>>8&-75,t+=61-e>>>8&-15,t+=62-e>>>8&3,String.fromCharCode(t)},i.prototype._decodeChar=function(e){var t=l;return t+=(42-e&e-44)>>>8&-l+e-43+62,t+=(46-e&e-48)>>>8&-l+e-47+63,t+=(47-e&e-58)>>>8&-l+e-48+52,t+=(64-e&e-91)>>>8&-l+e-65+0,t+=(96-e&e-123)>>>8&-l+e-97+26,t},i.prototype._getPaddingLength=function(e){var t=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)t++;if(e.length<4||t>2)throw new Error("Base64Coder: incorrect padding")}return t},i})();S.Coder=z;var D=new z;function ne(i){return D.encode(i)}S.encode=ne;function oe(i){return D.decode(i)}S.decode=oe;var R=(function(i){ie(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype._encodeByte=function(t){var n=t;return n+=65,n+=25-t>>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-13,n+=62-t>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(t){var n=l;return n+=(44-t&t-46)>>>8&-l+t-45+62,n+=(94-t&t-96)>>>8&-l+t-95+63,n+=(47-t&t-58)>>>8&-l+t-48+52,n+=(64-t&t-91)>>>8&-l+t-65+0,n+=(96-t&t-123)>>>8&-l+t-97+26,n},e})(z);S.URLSafeCoder=R;var W=new R;function fe(i){return W.encode(i)}S.encodeURLSafe=fe;function se(i){return W.decode(i)}S.decodeURLSafe=se;S.encodedLength=function(i){return D.encodedLength(i)};S.maxDecodedLength=function(i){return D.maxDecodedLength(i)};S.decodedLength=function(i){return D.decodedLength(i)}});var J=P((K,j)=>{"use strict";(function(i,e){var t={};e(t);var n=t.default;for(var s in t)n[s]=t[s];typeof j=="object"&&typeof j.exports=="object"?j.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):i.sha256=n})(K,function(i){"use strict";i.__esModule=!0,i.digestLength=32,i.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function t(a,r,o,f,x){for(var c,u,h,_,v,d,U,b,w,y,B,O,M;x>=64;){for(c=r[0],u=r[1],h=r[2],_=r[3],v=r[4],d=r[5],U=r[6],b=r[7],y=0;y<16;y++)B=f+y*4,a[y]=(o[B]&255)<<24|(o[B+1]&255)<<16|(o[B+2]&255)<<8|o[B+3]&255;for(y=16;y<64;y++)w=a[y-2],O=(w>>>17|w<<15)^(w>>>19|w<<13)^w>>>10,w=a[y-15],M=(w>>>7|w<<25)^(w>>>18|w<<14)^w>>>3,a[y]=(O+a[y-7]|0)+(M+a[y-16]|0);for(y=0;y<64;y++)O=(((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&d^~v&U)|0)+(b+(e[y]+a[y]|0)|0)|0,M=((c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10))+(c&u^c&h^u&h)|0,b=U,U=d,d=v,v=_+O|0,_=h,h=u,u=c,c=O+M|0;r[0]+=c,r[1]+=u,r[2]+=h,r[3]+=_,r[4]+=v,r[5]+=d,r[6]+=U,r[7]+=b,f+=64,x-=64}return f}var n=(function(){function a(){this.digestLength=i.digestLength,this.blockSize=i.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return a.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},a.prototype.clean=function(){for(var r=0;r<this.buffer.length;r++)this.buffer[r]=0;for(var r=0;r<this.temp.length;r++)this.temp[r]=0;this.reset()},a.prototype.update=function(r,o){if(o===void 0&&(o=r.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this.bytesHashed+=o,this.bufferLength>0){for(;this.bufferLength<64&&o>0;)this.buffer[this.bufferLength++]=r[f++],o--;this.bufferLength===64&&(t(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(o>=64&&(f=t(this.temp,this.state,r,f,o),o%=64);o>0;)this.buffer[this.bufferLength++]=r[f++],o--;return this},a.prototype.finish=function(r){if(!this.finished){var o=this.bytesHashed,f=this.bufferLength,x=o/536870912|0,c=o<<3,u=o%64<56?64:128;this.buffer[f]=128;for(var h=f+1;h<u-8;h++)this.buffer[h]=0;this.buffer[u-8]=x>>>24&255,this.buffer[u-7]=x>>>16&255,this.buffer[u-6]=x>>>8&255,this.buffer[u-5]=x>>>0&255,this.buffer[u-4]=c>>>24&255,this.buffer[u-3]=c>>>16&255,this.buffer[u-2]=c>>>8&255,this.buffer[u-1]=c>>>0&255,t(this.temp,this.state,this.buffer,0,u),this.finished=!0}for(var h=0;h<8;h++)r[h*4+0]=this.state[h]>>>24&255,r[h*4+1]=this.state[h]>>>16&255,r[h*4+2]=this.state[h]>>>8&255,r[h*4+3]=this.state[h]>>>0&255;return this},a.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},a.prototype._saveState=function(r){for(var o=0;o<this.state.length;o++)r[o]=this.state[o]},a.prototype._restoreState=function(r,o){for(var f=0;f<this.state.length;f++)this.state[f]=r[f];this.bytesHashed=o,this.finished=!1,this.bufferLength=0},a})();i.Hash=n;var s=(function(){function a(r){this.inner=new n,this.outer=new n,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var o=new Uint8Array(this.blockSize);if(r.length>this.blockSize)new n().update(r).finish(o).clean();else for(var f=0;f<r.length;f++)o[f]=r[f];for(var f=0;f<o.length;f++)o[f]^=54;this.inner.update(o);for(var f=0;f<o.length;f++)o[f]^=106;this.outer.update(o),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var f=0;f<o.length;f++)o[f]=0}return a.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},a.prototype.clean=function(){for(var r=0;r<this.istate.length;r++)this.ostate[r]=this.istate[r]=0;this.inner.clean(),this.outer.clean()},a.prototype.update=function(r){return this.inner.update(r),this},a.prototype.finish=function(r){return this.outer.finished?this.outer.finish(r):(this.inner.finish(r),this.outer.update(r,this.digestLength).finish(r)),this},a.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},a})();i.HMAC=s;function g(a){var r=new n().update(a),o=r.digest();return r.clean(),o}i.hash=g,i.default=g;function p(a,r){var o=new s(a).update(r),f=o.digest();return o.clean(),f}i.hmac=p;function m(a,r,o,f){var x=f[0];if(x===0)throw new Error("hkdf: cannot expand more");r.reset(),x>1&&r.update(a),o&&r.update(o),r.update(f),r.finish(a),f[0]++}var E=new Uint8Array(i.digestLength);function C(a,r,o,f){r===void 0&&(r=E),f===void 0&&(f=32);for(var x=new Uint8Array([1]),c=p(r,a),u=new s(c),h=new Uint8Array(u.digestLength),_=h.length,v=new Uint8Array(f),d=0;d<f;d++)_===h.length&&(m(h,u,o,x),_=0),v[d]=h[_++];return u.clean(),h.fill(0),x.fill(0),v}i.hkdf=C;function A(a,r,o,f){for(var x=new s(a),c=x.digestLength,u=new Uint8Array(4),h=new Uint8Array(c),_=new Uint8Array(c),v=new Uint8Array(f),d=0;d*c<f;d++){var U=d+1;u[0]=U>>>24&255,u[1]=U>>>16&255,u[2]=U>>>8&255,u[3]=U>>>0&255,x.reset(),x.update(r),x.update(u),x.finish(_);for(var b=0;b<c;b++)h[b]=_[b];for(var b=2;b<=o;b++){x.reset(),x.update(_).finish(_);for(var w=0;w<c;w++)h[w]^=_[w]}for(var b=0;b<c&&d*c+b<f;b++)v[d*c+b]=h[b]}for(var d=0;d<c;d++)h[d]=_[d]=0;for(var d=0;d<4;d++)u[d]=0;return x.clean(),v}i.pbkdf2=A})});var ce=P(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.Webhook=L.WebhookVerificationError=void 0;var ae=I(),Y=$(),he=J(),F=300,H=class i extends Error{constructor(e){super(e),Object.setPrototypeOf(this,i.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},k=class i extends H{constructor(e){super(e),Object.setPrototypeOf(this,i.prototype),this.name="WebhookVerificationError"}};L.WebhookVerificationError=k;var q=class i{constructor(e,t){if(!e)throw new Error("Secret can't be empty.");if(t?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(i.prefix)&&(e=e.substring(i.prefix.length)),this.key=Y.decode(e)}}verify(e,t){let n={};for(let r of Object.keys(t))n[r.toLowerCase()]=t[r];let s=n["webhook-id"],g=n["webhook-signature"],p=n["webhook-timestamp"];if(!g||!s||!p)throw new k("Missing required headers");let m=this.verifyTimestamp(p),C=this.sign(s,m,e).split(",")[1],A=g.split(" "),a=new globalThis.TextEncoder;for(let r of A){let[o,f]=r.split(",");if(o==="v1"&&(0,ae.timingSafeEqual)(a.encode(f),a.encode(C)))return JSON.parse(e.toString())}throw new k("No matching signature found")}sign(e,t,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let s=new TextEncoder,g=Math.floor(t.getTime()/1e3),p=s.encode(`${e}.${g}.${n}`);return`v1,${Y.encode(he.hmac(this.key,p))}`}verifyTimestamp(e){let t=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new k("Invalid Signature Headers");if(t-n>F)throw new k("Message timestamp too old");if(n>t+F)throw new k("Message timestamp too new");return new Date(n*1e3)}};L.Webhook=q;q.prefix="whsec_"});export{P as a,ue as b,ce as c};
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{i as T}from"./chunk-PXYDLKAG.js";import{B as Y,D as Q,E as Z,f as R,g as p,h as q,i as l,m as X,n as V,o as B,p as K,z as G}from"./chunk-IBYVXKWZ.js";import{readFileSync as Se}from"fs";import{z as ee}from"zod";var Le=ee.object({version:ee.string()});function xt(){let e=Se(new URL("../package.json",import.meta.url),"utf8");return Le.parse(JSON.parse(e)).version}import w from"fs";import h from"path";import{createJiti as Ne}from"jiti";import{err as E,ok as H,ResultAsync as He}from"neverthrow";import be from"fs";import S from"path";import f from"typescript";function te(e){let t=S.join(e,"index.ts"),n=ve(e);be.mkdirSync(S.dirname(n.tsBuildInfoFile??""),{recursive:!0});let o=f.createIncrementalCompilerHost(n),i=f.createIncrementalProgram({host:o,options:n,rootNames:[t]}),a=[...i.getSyntacticDiagnostics(),...i.getSemanticDiagnostics()];i.emit();let u=a.filter(s=>we(s,e));if(u.length===0)return{diagnostics:[],ok:!0};let v={getCanonicalFileName:s=>s,getCurrentDirectory:()=>S.dirname(e),getNewLine:()=>`
5
+ `};return{diagnostics:f.formatDiagnosticsWithColorAndContext(u,v).split(`
6
+ `).filter(s=>s.length>0),ok:!1}}function we(e,t){let n=e.file?.fileName;return n==null?!0:n.startsWith(t)}var Ee=S.join(".local","tsbuildinfo");function ve(e){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:f.ModuleKind.Preserve,moduleResolution:f.ModuleResolutionKind.Bundler,noEmit:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!1,target:f.ScriptTarget.ES2022,tsBuildInfoFile:S.join(e,Ee)}}import L from"fs";import A from"safe-stable-stringify";import{err as Re,ok as I}from"neverthrow";async function ne(e,t){let n={entities:e.entities,singletonSchemas:e.singletons,valueSpaces:e.valueSpaces},o=m(t)?void 0:Ce(t),i=Pe(e,o);return(await e.workflows.reduce(async(u,v)=>{let d=await u;return d.isErr()?d:(await je({context:n,reusable:i,workflow:v})).map(D=>[...d.value,D])},Promise.resolve(I([])))).map(u=>({...e,workflows:[...u]}))}function m(e){let t=process.argv[1];if(t==null||!L.existsSync(e))return!1;try{return L.statSync(t).mtimeMs>L.statSync(e).mtimeMs}catch{return!1}}async function je({context:e,reusable:t,workflow:n}){let o=t.get(oe(n));if(o!=null)return I({...n,tests:o.tests});try{return I(await X({context:e,workflow:n}))}catch(i){let a=i instanceof Error?i.message:String(i);return Re({kind:"expand-failed",message:a,workflow:n.name})}}function oe(e){let t=A({...e,tests:[]});if(t==null)throw new Error("solver: workflow is not serializable");return t}function Pe(e,t){return t==null||A(re(t))!==A(re(e))?new Map:new Map(t.workflows.map(n=>[oe(n),n]))}function re(e){return{entities:e.entities,singletons:e.singletons,valueSpaces:e.valueSpaces}}function Ce(e){if(L.existsSync(e))try{return p(l,L.readFileSync(e,"utf8"))}catch{return}}import{createHash as Fe}from"crypto";import ie from"fs/promises";import M from"path";import{err as g,ok as O,Result as Te}from"neverthrow";var Ae=".ripplo/fixtures",$=10*1024*1024,_=50*1024*1024;async function ae(e,t){let n=Ie(t);if(n.length===0)return O({});let o=M.join(e,Ae),i=await Promise.all(n.map(a=>Me({fixturesRoot:o,name:a})));return Te.combine(i).andThen(Oe)}function Ie(e){let n=e.workflows.flatMap(o=>[...o.steps,...o.tests.flatMap(i=>i.steps)]).flatMap(o=>o.action.kind==="upload"?o.action.files:[]);return[...new Set(n)].toSorted((o,i)=>o.localeCompare(i))}async function Me({fixturesRoot:e,name:t}){if(t.includes("..")||M.isAbsolute(t))return g({kind:"fixture-invalid-name",name:t});let n=M.join(e,t),o=await ie.lstat(n).catch(()=>null);if(o==null)return g({kind:"fixture-missing",name:t,path:n});if(o.isSymbolicLink())return g({kind:"fixture-symlink",name:t});if(!o.isFile())return g({kind:"fixture-not-file",name:t});let i=await ie.readFile(n);if(i.byteLength>$)return g({kind:"fixture-too-large",name:t,size:i.byteLength});let a=Fe("sha256").update(i).digest("hex");return O([t,{sha256:a,size:i.byteLength}])}function Oe(e){let t=e.reduce((n,[,o])=>n+o.size,0);return t>_?g({kind:"fixtures-total-too-large",total:t}):O(Object.fromEntries(e))}import{createHash as $e}from"crypto";import y from"fs";import N from"path";import{z}from"zod";function se({cwd:e,fingerprint:t}){let n=ze(e);if(n==null||n.fingerprint!==j(t))return;let o=N.join(e,".ripplo","ripplo.lock");if(!y.existsSync(o))return;let i=y.readFileSync(o,"utf8");if(j(i)===n.lockfileHash)try{return p(l,i)}catch{return}}function le({cwd:e,fingerprint:t,lockfile:n}){let o={fingerprint:j(t),lockfileHash:j(R(l,n))},i=ce(e);y.mkdirSync(N.dirname(i),{recursive:!0}),y.writeFileSync(i,JSON.stringify(o))}var _e=z.object({fingerprint:z.string(),lockfileHash:z.string()});function ze(e){let t=ce(e);if(!(!y.existsSync(t)||m(t)))try{let n=_e.safeParse(JSON.parse(y.readFileSync(t,"utf8")));return n.success?n.data:void 0}catch{return}}function ce(e){return N.join(e,".ripplo",".local","load-cache.json")}function j(e){return $e("sha256").update(e).digest("base64")}var c=".ripplo/ripplo.lock",b;async function Qt(e){let{result:t}=await Je(e);return t}async function Je(e){let t=de(h.join(e,".ripplo"));if(b!=null&&b.fingerprint===t&&b.result.isOk())return{fingerprint:t,result:b.result};let n=await J(e);return b={fingerprint:t,result:n},{fingerprint:t,result:n}}async function J(e){let t=h.join(e,".ripplo"),n=h.join(t,"index.ts"),o=de(t),i=se({cwd:e,fingerprint:o});if(i!=null)return H(i);let a=te(t);if(!a.ok)return E({diagnostics:a.diagnostics,kind:"typecheck-failed"});let d=await(await De(n)).andThen(s=>Xe({entryPath:n,exported:s})).match(async s=>(await ae(e,s)).map(x=>({...s,fixtures:x})).mapErr(x=>({error:x,kind:"fixture-failed"})).asyncAndThen(x=>new He(ne(x,h.join(e,c))).mapErr(xe=>xe)),s=>Promise.resolve(E(s)));return d.isOk()&&le({cwd:e,fingerprint:o,lockfile:d.value}),d}var Ue=new Set([".local","debug","node_modules","ripplo.lock"]);function de(e){let t=h.join(e,"..","node_modules","@ripplo","testing","package.json");return[...ue(e),...We(t)].toSorted((n,o)=>n.localeCompare(o)).join("|")}function ue(e){return(w.existsSync(e)?w.readdirSync(e,{withFileTypes:!0}):[]).flatMap(n=>{if(Ue.has(n.name))return[];let o=h.join(e,n.name);if(n.isDirectory())return ue(o);let i=w.statSync(o);return[`${o}:${String(i.mtimeMs)}:${String(i.size)}`]})}function We(e){if(!w.existsSync(e))return[];let t=w.statSync(e);return[`${e}:${String(t.mtimeMs)}:${String(t.size)}`]}async function De(e){try{let n=await Ne(import.meta.url,{fsCache:!1,moduleCache:!1,sourceMaps:!0}).import(e),o=n!=null&&typeof n=="object"&&"default"in n?Reflect.get(n,"default"):n;return H(o)}catch(t){return E({kind:"load-threw",message:qe(t)})}}function qe(e){return e instanceof Error?e.message:String(e)}function Xe({entryPath:e,exported:t}){if(t==null||typeof t!="object"||!("lockfile"in t))return E({entryPath:e,kind:"not-ripplo"});let n=q.safeParse(Reflect.get(t,"lockfile"));return n.success?H(n.data):E({issues:n.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`),kind:"invalid-lockfile"})}function P(e,t){return t==null?`Load \`/ripplo:${e}\` skill for instructions.`:`Load \`/ripplo:${e}\` skill for instructions on ${t}.`}function er(e){return e.length===1?P(e[0]):`Before proceeding, load the ${e.map(n=>`\`/ripplo:${n}\``).join(" and ")} skills \u2014 every one, each carries rules the others don't.`}function ir(e){return[`Compilation failed: ${Ve(e)}`,P("create","DSL authoring rules")].join(`
7
+ `)}function ar(){return`${c} is up to date`}function sr(e){return[`${c} is ${e==="missing"?"missing":"out of date"} \u2014 run \`npx ripplo compile\` and commit the result`,P("setup")].join(`
8
+ `)}function lr(){return`Wrote ${c}`}function Ve(e){switch(e.kind){case"typecheck-failed":return["TypeScript errors in .ripplo/:",...pe(e.diagnostics)].join(`
9
+ `);case"not-ripplo":return`${e.entryPath} must default-export a Ripplo (createRipplo({ entities, singletons, workflows })). Check that the default export is the value returned by createRipplo, not a function or a re-export.`;case"invalid-lockfile":return["Lockfile failed schema validation (stale or hand-edited .ripplo/ripplo.lock?):",...pe(e.issues),"Regenerate with `npx ripplo compile` \u2014 never hand-edit the lockfile."].join(`
10
+ `);case"load-threw":return[`.ripplo/index.ts threw while loading: ${e.message}`,"Usually a bad import or a top-level throw in .ripplo/ \u2014 run `npx ripplo compile` for the stack."].join(`
11
+ `);case"fixture-failed":return Be(e.error);case"expand-failed":return[`Could not resolve tests for workflow "${e.workflow}": ${e.message}`,"Check the branch conditions and the seeded state in given \u2014 a branch may need state no seed can produce."].join(`
12
+ `)}}function pe(e,t=8){return e.length<=t?e:[...e.slice(0,t),`\u2026 and ${String(e.length-t)} more`]}function Be(e){switch(e.kind){case"fixture-missing":return`Fixture "${e.name}" not found at ${e.path} \u2014 add the file under .ripplo/fixtures/ or fix the upload() name.`;case"fixture-invalid-name":return`Invalid fixture name "${e.name}" \u2014 upload() takes a bare name under .ripplo/fixtures/, no .. or absolute paths.`;case"fixture-symlink":return`Fixture "${e.name}" is a symlink \u2014 only regular files are allowed.`;case"fixture-not-file":return`Fixture "${e.name}" is not a regular file.`;case"fixture-too-large":return`Fixture "${e.name}" is ${C(e.size)} \u2014 over the ${C($)} per-file limit.`;case"fixtures-total-too-large":return`Fixtures total ${C(e.total)} \u2014 over the ${C(_)} limit.`}}function C(e){return`${String(Math.round(e/(1024*1024)*10)/10)} MB`}import{writeFile as et}from"fs/promises";import tt from"path";import{createHash as fe}from"crypto";import k from"fs";import W from"path";import Ke from"safe-stable-stringify";import{z as U}from"zod";function me({context:e,cwd:t}){V(e);let n=Ye(t,F(e));n!=null&&B(e,n)}function xr({context:e,cwd:t}){let n=Ze(t);if(!(n==null||n.model!==F(e)))return n.cleanLockfile??void 0}function Sr({cleanLockfileHash:e,context:t,cwd:n}){let o=ge(n);k.mkdirSync(W.dirname(o),{recursive:!0}),k.writeFileSync(o,JSON.stringify({cleanLockfile:e,model:F(t)}))}function Lr(e){return fe("sha256").update(e).digest("base64")}var Ge=U.object({cleanLockfile:U.string().nullable(),model:U.string()});function Ye(e,t){let n=W.join(e,c);if(!k.existsSync(n)||m(n))return null;let o=Qe(n);return o==null?null:F({entities:o.entities,singletonSchemas:o.singletons,valueSpaces:o.valueSpaces})===t?o.solved:null}function Qe(e){try{return p(l,k.readFileSync(e,"utf8"))}catch{return null}}function F(e){let t=Ke({entities:e.entities,singletons:e.singletonSchemas,valueSpaces:e.valueSpaces});if(t==null)throw new Error("solve-cache: context is not serializable");return fe("sha256").update(t).digest("base64")}function Ze(e){let t=ge(e);if(!(!k.existsSync(t)||m(t)))try{let n=Ge.safeParse(JSON.parse(k.readFileSync(t,"utf8")));return n.success?n.data:void 0}catch{return}}function ge(e){return W.join(e,".ripplo",".local","solve-cache.json")}async function Fr(e){let t=await J(e);return t.isOk()&&await rt(e,t.value),t}async function rt(e,t){let n=await nt(e,t);return await et(tt.join(e,c),R(l,n)),n}var ye=new WeakMap;function nt(e,t){let n=ye.get(t);if(n!=null)return n;let o=ot(e,t);return ye.set(t,o),o}function Tr(e){return e.workflows.filter(t=>t.stub).map(t=>t.name)}async function ot(e,t){let n=Y(t);me({context:n,cwd:e});let o=await Z(t),i=await Q(t);await G({context:n,facts:i.facts});let a=await K(n);return{...t,checks:o,solved:a}}import{createMessageConnection as it,NotificationType as he,RequestType as at,RequestType0 as ke,SocketMessageReader as st,SocketMessageWriter as lt}from"vscode-jsonrpc/node";import{z as r}from"zod";var ct="daemon.sock",dt="daemon.log";function $r(e){return T(e,ct)}function _r(e){return T(e,dt)}function zr(e){return it(new st(e),new lt(e))}var Nr=r.object({all:r.boolean(),headed:r.boolean(),tests:r.array(r.string())}),Hr=r.object({jobId:r.string(),total:r.number()}),ut=r.enum(["on","off"]),pt=r.object({attempts:r.number(),findings:r.number()}),Jr=r.object({active:r.number(),explorer:ut,exploring:r.number(),progress:pt,queued:r.number(),sseHealth:r.object({detail:r.string().optional(),ok:r.boolean()}).optional(),version:r.string().optional()}),ft=r.enum(["MAX_RUNS","OVERAGE_CAP","MAX_AGENTS","MAX_CONCURRENT_RUNS","MAX_PROJECTS"]),mt=r.discriminatedUnion("type",[r.object({code:ft,type:r.literal("limit")}),r.object({detail:r.string(),type:r.literal("generic")})]),gt=r.discriminatedUnion("kind",[r.object({kind:r.literal("pass")}),r.object({findingLines:r.array(r.string()),kind:r.literal("findings")}),r.object({detail:r.string(),kind:r.literal("error")}),r.object({kind:r.literal("dispatch-error"),reason:mt}),r.object({detail:r.string(),kind:r.literal("dispatch-timeout")}),r.object({detail:r.string(),kind:r.literal("infra-error")})]),yt=r.discriminatedUnion("kind",[r.object({kind:r.literal("test-started"),runId:r.string(),testName:r.string(),workflowName:r.string()}),r.object({kind:r.literal("test-outcome"),outcome:gt,runId:r.string(),testName:r.string(),workflowName:r.string()})]),Ur=r.object({event:yt,jobId:r.string()}),Wr=r.object({failed:r.number(),jobId:r.string(),notRun:r.number(),passed:r.number()}),Dr=r.discriminatedUnion("code",[r.object({code:r.literal("compile-failed"),detail:r.string(),diagnostics:r.array(r.string()).default([])}),r.object({code:r.literal("selection-conflicting-flags")}),r.object({code:r.literal("selection-nothing-selected")}),r.object({code:r.literal("selection-unknown-ids"),known:r.array(r.string()),unknown:r.array(r.string())}),r.object({code:r.literal("scope-failed"),detail:r.string()}),r.object({code:r.literal("app-unreachable"),detail:r.string(),url:r.string()}),r.object({code:r.literal("sync-failed"),detail:r.string()}),r.object({code:r.literal("bad-message")})]),qr=new at("ripplo/enqueue"),Xr=new ke("ripplo/status"),Vr=new ke("ripplo/shutdownIfIdle"),Br=new he("ripplo/jobEvent"),Kr=new he("ripplo/jobDone");export{xt as a,Ae as b,c,Qt as d,Je as e,J as f,P as g,er as h,ir as i,ar as j,sr as k,lr as l,me as m,xr as n,Sr as o,Lr as p,Fr as q,rt as r,nt as s,Tr as t,$r as u,_r as v,zr as w,Nr as x,Hr as y,Jr as z,gt as A,Ur as B,Wr as C,Dr as D,qr as E,Xr as F,Vr as G,Br as H,Kr as I};