ripplo 0.10.0 → 0.11.1

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.
Files changed (99) hide show
  1. package/README.md +105 -47
  2. package/dist/assets/rrweb-replay.js +1 -1
  3. package/dist/assets/rrweb.js +1 -1
  4. package/dist/capture-worker.js +20 -14
  5. package/dist/chunk-2TA4WDEE.js +4 -0
  6. package/dist/{chunk-5E62BCS7.js → chunk-47LLHHJH.js} +2 -2
  7. package/dist/chunk-4LXIRKM7.js +4 -0
  8. package/dist/chunk-5HFJIZLI.js +4 -0
  9. package/dist/chunk-5HZ2LDFS.js +83 -0
  10. package/dist/chunk-5VXXRMJU.js +354 -0
  11. package/dist/chunk-6U2LNGSV.js +51 -0
  12. package/dist/{chunk-LL4HUOJP.js → chunk-6WFJZ5L6.js} +1 -1
  13. package/dist/chunk-7JKCHASU.js +4 -0
  14. package/dist/{chunk-WNAVYV4P.js → chunk-AXROBTLA.js} +1 -1
  15. package/dist/chunk-BGY5F3IU.js +5 -0
  16. package/dist/{chunk-IPSXNIXC.js → chunk-C7SV6AR2.js} +4 -4
  17. package/dist/chunk-CI6273ZU.js +107 -0
  18. package/dist/chunk-D6TS77JP.js +8 -0
  19. package/dist/{chunk-QAR7FZO3.js → chunk-EEOTA6M4.js} +1 -1
  20. package/dist/{chunk-UDPKOYZT.js → chunk-EQORLKHG.js} +1 -1
  21. package/dist/chunk-F4P36OMG.js +9 -0
  22. package/dist/chunk-G6J2WIHJ.js +4 -0
  23. package/dist/{chunk-LOEAZGYO.js → chunk-HEOMRXZE.js} +1 -1
  24. package/dist/{chunk-7W237JFM.js → chunk-JS3DLVVI.js} +1 -1
  25. package/dist/{chunk-TPHOSZAK.js → chunk-KH4QH23U.js} +1 -1
  26. package/dist/{chunk-43C7VPGA.js → chunk-LWMXGWS2.js} +1 -1
  27. package/dist/{chunk-YQ2RBEOJ.js → chunk-PXXURBGC.js} +2 -2
  28. package/dist/{chunk-OAU4HUD2.js → chunk-PYDYI3AA.js} +2 -2
  29. package/dist/{chunk-R3DZ6JPY.js → chunk-RIASQHPG.js} +1 -1
  30. package/dist/chunk-ROO3KF74.js +6 -0
  31. package/dist/chunk-SXVWB7TZ.js +6 -0
  32. package/dist/{chunk-4OSYMIH6.js → chunk-UC54UNEX.js} +1 -1
  33. package/dist/{chunk-5X4M4MTG.js → chunk-UFXH75WD.js} +3 -3
  34. package/dist/chunk-WAGXAEB4.js +13 -0
  35. package/dist/{chunk-CEVQ5RNC.js → chunk-WCMWNWNM.js} +2 -2
  36. package/dist/{chunk-AGK6XOX2.js → chunk-XAMVRZJH.js} +2 -2
  37. package/dist/chunk-ZHDR7LXB.js +56 -0
  38. package/dist/chunk-ZM2UPFCR.js +7 -0
  39. package/dist/{cli-error-AHNJULLG.js → cli-error-6PUIWNIT.js} +1 -1
  40. package/dist/{compile-write-OLQOR3OK.js → compile-write-N3PWYUKE.js} +1 -1
  41. package/dist/daemon-SAV2CLXD.js +4 -0
  42. package/dist/daemon-X77GWCFM.js +152 -0
  43. package/dist/{daemon-lock-OAARBZ4O.js → daemon-lock-RPKO5SNE.js} +1 -1
  44. package/dist/dsl-loader-WPAKMON7.js +4 -0
  45. package/dist/dsl-typecheck-worker.js +6 -0
  46. package/dist/{exit-plan-gate-CJ3IXWTN.js → exit-plan-gate-44YWEKYS.js} +1 -1
  47. package/dist/hook.js +1 -1
  48. package/dist/index.js +211 -260
  49. package/dist/{plan-reminder-EPCNBFY3.js → plan-reminder-YX375SPX.js} +1 -1
  50. package/dist/post-edit-7W6AHXE6.js +4 -0
  51. package/dist/post-edit-analyze-PO54GIZ3.js +4 -0
  52. package/dist/post-edit-flag-stubs-G3G2FO6Z.js +4 -0
  53. package/dist/pre-bash-run-gate-MIEM2DBB.js +4 -0
  54. package/dist/pre-edit-C4MGURNO.js +4 -0
  55. package/dist/pre-edit-ripplo-skill-gate-A6ETC3QN.js +4 -0
  56. package/dist/pre-edit-scope-gate-M5IQSVGF.js +4 -0
  57. package/dist/{pre-edit-watch-gate-BUFWLXR3.js → pre-edit-watch-gate-ORQP7MSW.js} +1 -1
  58. package/dist/prompt-submit-YOKR2RQN.js +4 -0
  59. package/dist/scope-reminder-A6GVTTVE.js +4 -0
  60. package/dist/session-preamble-IZQPIWST.js +4 -0
  61. package/dist/status-HOJW4C3O.js +4 -0
  62. package/dist/{stop-enforce-4XV6LK7Z.js → stop-enforce-JT3SWBU4.js} +9 -9
  63. package/dist/tasks-reminder-TDWPD3KV.js +4 -0
  64. package/dist/{track-skill-load-CJ74GD3Q.js → track-skill-load-SXSDMHFO.js} +1 -1
  65. package/dist/{track-skill-prompt-YSB6OOQN.js → track-skill-prompt-7N4TQAD2.js} +1 -1
  66. package/package.json +3 -5
  67. package/dist/chunk-26A42N75.js +0 -55
  68. package/dist/chunk-44GHUVW6.js +0 -8
  69. package/dist/chunk-67YR3QHA.js +0 -6
  70. package/dist/chunk-6NKSEWP6.js +0 -224
  71. package/dist/chunk-6TCK75ER.js +0 -83
  72. package/dist/chunk-73TKORK6.js +0 -8
  73. package/dist/chunk-CB74TAUC.js +0 -5
  74. package/dist/chunk-FXCBWBN5.js +0 -4
  75. package/dist/chunk-GOZWOCTE.js +0 -7
  76. package/dist/chunk-IONMYZ3K.js +0 -4
  77. package/dist/chunk-LB65USNP.js +0 -73
  78. package/dist/chunk-M3CXHDFV.js +0 -9
  79. package/dist/chunk-MOI4L3EX.js +0 -4
  80. package/dist/chunk-N2OBRCPQ.js +0 -6
  81. package/dist/chunk-OWN4P2K7.js +0 -4
  82. package/dist/chunk-SNU66GSR.js +0 -4
  83. package/dist/chunk-VDAFHS7J.js +0 -7
  84. package/dist/chunk-VOZOP7MQ.js +0 -55
  85. package/dist/daemon-BJAGK2Q3.js +0 -152
  86. package/dist/daemon-H4P5PCVH.js +0 -4
  87. package/dist/dsl-loader-LXH6PUY5.js +0 -4
  88. package/dist/post-edit-ZVCYZ62V.js +0 -4
  89. package/dist/post-edit-analyze-J2H3I3IO.js +0 -4
  90. package/dist/post-edit-flag-stubs-E22KT2LD.js +0 -4
  91. package/dist/pre-bash-run-gate-B42YNDQF.js +0 -4
  92. package/dist/pre-edit-TEN3AFRK.js +0 -4
  93. package/dist/pre-edit-ripplo-skill-gate-QHUD7QGU.js +0 -4
  94. package/dist/pre-edit-scope-gate-2YIFSEDY.js +0 -4
  95. package/dist/prompt-submit-DJFWNGYC.js +0 -4
  96. package/dist/scope-reminder-DIDCHDAA.js +0 -4
  97. package/dist/session-preamble-ZYVRDSGA.js +0 -4
  98. package/dist/status-FDM2RK37.js +0 -4
  99. package/dist/tasks-reminder-SDS6RNLP.js +0 -4
@@ -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({inlineImages:!0,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()}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.parent===globalThis.window&&globalThis.__ripploRrwebRecording!==!0&&(globalThis.__ripploFlushRrweb=mf,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))}}));})();
@@ -584,7 +584,7 @@ function $constructor(name, initializer3, params) {
584
584
  Object.defineProperty(_, "name", { value: name });
585
585
  return _;
586
586
  }
587
- var $brand = Symbol("zod_brand");
587
+ var $brand = /* @__PURE__ */ Symbol("zod_brand");
588
588
  var $ZodAsyncError = class extends Error {
589
589
  constructor() {
590
590
  super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
@@ -731,7 +731,7 @@ function floatSafeRemainder(val, step) {
731
731
  const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
732
732
  return valInt % stepInt / 10 ** decCount;
733
733
  }
734
- var EVALUATING = Symbol("evaluating");
734
+ var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
735
735
  function defineLazy(object2, key, getter) {
736
736
  let value = void 0;
737
737
  Object.defineProperty(object2, key, {
@@ -9804,8 +9804,8 @@ function yo_default() {
9804
9804
 
9805
9805
  // ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js
9806
9806
  var _a;
9807
- var $output = Symbol("ZodOutput");
9808
- var $input = Symbol("ZodInput");
9807
+ var $output = /* @__PURE__ */ Symbol("ZodOutput");
9808
+ var $input = /* @__PURE__ */ Symbol("ZodInput");
9809
9809
  var $ZodRegistry = class {
9810
9810
  constructor() {
9811
9811
  this._map = /* @__PURE__ */ new WeakMap();
@@ -10842,7 +10842,7 @@ function _stringbool(Classes, _params) {
10842
10842
  type: "pipe",
10843
10843
  in: stringSchema,
10844
10844
  out: booleanSchema,
10845
- transform: (input, payload) => {
10845
+ transform: ((input, payload) => {
10846
10846
  let data = input;
10847
10847
  if (params.case !== "sensitive")
10848
10848
  data = data.toLowerCase();
@@ -10861,14 +10861,14 @@ function _stringbool(Classes, _params) {
10861
10861
  });
10862
10862
  return {};
10863
10863
  }
10864
- },
10865
- reverseTransform: (input, _payload) => {
10864
+ }),
10865
+ reverseTransform: ((input, _payload) => {
10866
10866
  if (input === true) {
10867
10867
  return truthyArray[0] || "true";
10868
10868
  } else {
10869
10869
  return falsyArray[0] || "false";
10870
10870
  }
10871
- },
10871
+ }),
10872
10872
  error: params.error
10873
10873
  });
10874
10874
  return codec2;
@@ -12196,10 +12196,10 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
12196
12196
  inst.with = inst.check;
12197
12197
  inst.clone = (def2, params) => clone(inst, def2, params);
12198
12198
  inst.brand = () => inst;
12199
- inst.register = (reg, meta3) => {
12199
+ inst.register = ((reg, meta3) => {
12200
12200
  reg.add(inst, meta3);
12201
12201
  return inst;
12202
- };
12202
+ });
12203
12203
  inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
12204
12204
  inst.safeParse = (data, params) => safeParse2(inst, data, params);
12205
12205
  inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
@@ -13795,7 +13795,7 @@ var tables = nameTablesSchema.parse(workerData);
13795
13795
  var runs = /* @__PURE__ */ new Map();
13796
13796
  port.on("message", (msg) => {
13797
13797
  if (msg.t === "open") {
13798
- runs.set(msg.runId, openRun(msg.file));
13798
+ runs.set(msg.runId, openRun({ file: msg.file, headerLine: msg.headerLine }));
13799
13799
  return;
13800
13800
  }
13801
13801
  const run = runs.get(msg.runId);
@@ -13821,11 +13821,16 @@ port.on("message", (msg) => {
13821
13821
  function reply(message) {
13822
13822
  port?.postMessage(message);
13823
13823
  }
13824
- function openRun(file2) {
13824
+ function openRun({ file: file2, headerLine }) {
13825
13825
  return {
13826
13826
  entries: [],
13827
13827
  file: file2,
13828
- handlePromise: mkdir(path.dirname(file2), { recursive: true }).then(() => open(file2, "w")),
13828
+ handlePromise: mkdir(path.dirname(file2), { recursive: true }).then(() => open(file2, "w")).then(async (handle) => {
13829
+ await handle.write(`${headerLine}
13830
+ `);
13831
+ return handle;
13832
+ }),
13833
+ headerLine,
13829
13834
  pending: Promise.resolve(),
13830
13835
  rrwebCount: 0
13831
13836
  };
@@ -13875,7 +13880,8 @@ async function closeRun(run, noticeLineIfNoRrweb) {
13875
13880
  const handle = await run.handlePromise;
13876
13881
  await handle.close();
13877
13882
  const body = run.entries.toSorted((a, b) => byTime(a.t, b.t)).map((entry) => entry.line).join("\n");
13878
- await writeFile(run.file, `${body}
13883
+ await writeFile(run.file, `${run.headerLine}
13884
+ ${body}
13879
13885
  `);
13880
13886
  }
13881
13887
  function byTime(a, b) {
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{U as d}from"./chunk-ZHDR7LXB.js";import{j as p}from"./chunk-C7SV6AR2.js";import{spawnSync as k}from"child_process";import{existsSync as c,readdirSync as m,readFileSync as j,realpathSync as f,statSync as g}from"fs";import i from"path";var S=2e3;function x(t){if(t!=null)try{return g(f(t)).mtimeMs}catch{return}}function B(t){return k("pnpm",["turbo","run","build","--filter=ripplo..."],{cwd:t,stdio:"inherit"}).status===0}function X(){let t=process.argv[1];return t==null?{kind:"fresh"}:R({cwd:process.cwd(),scriptPath:f(t)})}function R({cwd:t,scriptPath:n}){let o=l(i.dirname(n));if(o!=null&&u(o))return n.includes(`${i.sep}src${i.sep}`)?{kind:"fresh"}:E({bundlePath:n,root:o});let r=l(t);return r!=null&&u(r)?{kind:"foreign-binary",workspaceRoot:r}:{kind:"fresh"}}function l(t){let n=i.dirname(t);return c(i.join(t,"pnpm-workspace.yaml"))?t:n===t?void 0:l(n)}function u(t){let n=i.join(t,"packages","cli","package.json"),o=w(n);return typeof o=="object"&&o!=null&&"name"in o&&o.name==="ripplo"}function w(t){try{return JSON.parse(j(t,"utf8"))}catch{return}}function E({bundlePath:t,root:n}){let o=x(t),r=i.join(n,"packages");if(o==null||!c(r))return{kind:"fresh"};let a=m(r).map(s=>({name:s,src:i.join(r,s,"src")})).filter(s=>c(s.src)).filter(s=>b(s.src)>o+S).map(s=>s.name);return a.length===0?{kind:"fresh"}:{kind:"stale",packages:a,workspaceRoot:n}}function b(t){let n=g(t);if(!n.isDirectory())return n.mtimeMs;let o=m(t).map(r=>b(i.join(t,r)));return Math.max(n.mtimeMs,...o)}import{createHash as P}from"crypto";import M from"os";import I from"path";import{createMessageConnection as q,NotificationType as y,RequestType as A,RequestType0 as h,SocketMessageReader as N,SocketMessageWriter as v}from"vscode-jsonrpc/node";import{z as e}from"zod";var C="daemon.log";function ee(t){let n=P("sha256").update(t).digest("hex").slice(0,16);return I.join(M.tmpdir(),`ripplo-${n}.sock`)}function te(t){return p(t,C)}function ne(t){return q(new N(t),new v(t))}var oe=e.object({all:e.boolean(),headed:e.boolean(),tests:e.array(e.string())}),re=e.object({jobId:e.string(),total:e.number()}),z=e.enum(["no-lockfile","unstamped","dsl-drift","load-failed","model-empty"]),F=e.discriminatedUnion("kind",[e.object({kind:e.literal("off")}),e.object({kind:e.literal("on")}),e.object({kind:e.literal("paused")}),e.object({kind:e.literal("waiting")}),e.object({kind:e.literal("blocked"),reason:z})]),O=e.object({attempts:e.number(),findings:e.number()}),ie=e.object({active:e.number(),bundleMtimeMs:e.number().optional(),explorer:F,exploring:e.number(),progress:O,queued:e.number(),sseHealth:e.object({detail:e.string().optional(),ok:e.boolean()}).optional(),version:e.string().optional()}),L=e.enum(["MAX_RUNS","OVERAGE_CAP","MAX_AGENTS","MAX_CONCURRENT_RUNS","MAX_PROJECTS","CLOUD_EXECUTOR","REVIEW_QUOTA","MEMBER_CEILING"]),U=e.discriminatedUnion("type",[e.object({code:L,type:e.literal("limit")}),e.object({detail:e.string(),type:e.literal("generic")})]),_=e.discriminatedUnion("kind",[e.object({kind:e.literal("pass")}),e.object({findingLines:e.array(e.string()),kind:e.literal("findings")}),e.object({detail:e.string(),kind:e.literal("error")}),e.object({kind:e.literal("dispatch-error"),reason:U}),e.object({detail:e.string(),kind:e.literal("dispatch-timeout")}),e.object({detail:e.string(),kind:e.literal("infra-error")})]),W=e.discriminatedUnion("kind",[e.object({kind:e.literal("run-progress"),runId:e.string(),signal:d,testName:e.string(),workflowName:e.string()}),e.object({kind:e.literal("test-started"),runId:e.string(),testName:e.string(),workflowName:e.string()}),e.object({kind:e.literal("test-outcome"),outcome:_,runId:e.string(),testName:e.string(),workflowName:e.string()})]),se=e.object({event:W,jobId:e.string()}),ae=e.object({failed:e.number(),jobId:e.string(),notRun:e.number(),passed:e.number()}),ce=e.discriminatedUnion("code",[e.object({code:e.literal("compile-failed"),detail:e.string(),diagnostics:e.array(e.string()).default([])}),e.object({code:e.literal("selection-conflicting-flags")}),e.object({code:e.literal("selection-nothing-selected")}),e.object({code:e.literal("selection-unknown-ids"),known:e.array(e.string()),unknown:e.array(e.string())}),e.object({code:e.literal("scope-failed"),detail:e.string()}),e.object({code:e.literal("app-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("engine-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("sync-failed"),detail:e.string()}),e.object({code:e.literal("bad-message")})]),le=new A("ripplo/enqueue"),pe=new h("ripplo/status"),de=new h("ripplo/shutdownIfIdle"),ue=new y("ripplo/jobEvent"),me=new y("ripplo/jobDone");export{x as a,B as b,X as c,ee as d,te as e,ne as f,oe as g,re as h,ie as i,_ as j,se as k,ae as l,ce as m,le as n,pe as o,de as p,ue as q,me as r};
@@ -4,6 +4,6 @@ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
4
  import{a as o}from"./chunk-OQ6KNYPG.js";import{a as i}from"./chunk-MHNGR6M7.js";function y(n){if(n.length===0)return"No open tasks.";let e=n.map(r=>` [${a(r.status)}] [${r.kind}] (${r.id}) ${l(r)}`);return[`${o(n.length,"open task")}:`,...e].join(`
5
5
  `)}function m(n){let e=`[${a(n.status)}] [${n.kind}] (${n.id}) ${n.title??""}`.trim(),r=n.messages.flatMap(t=>u(t));return[e,...r,"",$()].join(`
6
6
  `)}function x(n){let e=n.map(r=>` [${a(r.status)}] [${r.kind}] (${r.id}) ${l(r)}`);return[`New or updated Ripplo tasks (${o(n.length,"open task")}):`,...e,i("tasks","picking each up")].join(`
7
- `)}function T(n){let{task:e}=n,r=e.title??e.latestMessage??"(no description)",t=i("tasks");return n.type==="new"?`New task [${e.kind}] (${e.id}) ${r} \u2014 ${t}`:n.type==="reopened"?`Reopened task (${e.id}) ${r} \u2014 earlier resolution didn't hold. ${t}`:`User replied on task (${e.id}): ${e.latestMessage??r} \u2014 ${t}`}function b(n){return`No task with id ${n}. List them with \`npx ripplo tasks list\`.`}function w(n){return`Commented on task ${n}.`}function S(){return"Clarification needs a message \u2014 say what's ambiguous and what you need."}function N(n,e){let r=e==null?"an element node's id":`its parent element id ${String(e)}`;return`rrweb id ${String(n)} is a text node \u2014 no box to highlight. Anchor to ${r}.`}function M(n,e){return`rrweb id ${String(n)} is not in run ${e}. Pick an element id from .ripplo/debug/${e}/behavior.jsonl.`}function A(n){return`rrweb id ${String(n)} is not an element node. Anchor to an element so it can be highlighted.`}function R(n){return`Resolved task ${n}.`}function C(n){return`Started task ${n} \u2014 in progress until resolved, dismissed, or sent back for clarification.`}function I(n){return`Marked task ${n} as needing clarification \u2014 the user will follow up.`}function v(n){return`Dismissed task ${n}.`}function a(n){return n==="needsClarification"?"needs clarification":n}function l(n){return n.title??n.lastMessage??"(no description)"}function u(n){let e=n.authorName??n.author;return n.runId==null?[` ${e}: ${n.body}`]:[` ${e} @ ${n.runId}${p(n.frameMs)}: ${n.body}`,...c(n,n.runId)]}function p(n){return n==null?"":` (${String(n)}ms)`}function c(n,e){let r=f(n),t=n.frameMs==null?null:` see it: npx ripplo snapshot ${e} --offset ${String(n.frameMs)}`;return[r,t].filter(s=>s!=null)}function f(n){return n.element!=null?` element: ${g(n.element)}`:n.rrwebId==null?null:` element: rrweb id ${String(n.rrwebId)}`}function g(n){let e=n.role==null?"":`[role=${n.role}]`,r=n.testId==null?"":` testid=${n.testId}`,t=n.ariaName==null?"":` aria="${n.ariaName}"`,s=n.text==null?"":` "${n.text}"`,d=n.selector==null?"":`
8
- selector: ${n.selector}`;return`${n.tagName??"element"}${e}${r}${t}${s}${d}`}function $(){return["Snapshot the frame above and Read the PNG \u2014 the rendered frame is the evidence, not the thread text.","Read the whole run with `npx ripplo explain <runId>` \u2014 auto-pulls a cloud run's stream if not on disk.","Add `--full` for the world the model set up plus a step-by-step timeline of what happened.",i("tasks","picking this up")].join(`
7
+ `)}function T(n){let{task:e}=n,r=e.title??e.latestMessage??"(no description)",t=i("tasks");return n.type==="new"?`New task [${e.kind}] (${e.id}) ${r} \u2014 ${t}`:n.type==="reopened"?`Reopened task (${e.id}) ${r} \u2014 earlier resolution didn't hold. ${t}`:`User replied on task (${e.id}): ${e.latestMessage??r} \u2014 ${t}`}function b(n){return`No task with id ${n}. List them with \`npx ripplo tasks list\`.`}function w(n){return`Commented on task ${n}.`}function S(){return"Clarification needs a message \u2014 say what's ambiguous and what you need."}function N(n,e){let r=e==null?"an element node's id":`its parent element id ${String(e)}`;return`rrweb id ${String(n)} is a text node \u2014 no box to highlight. Anchor to ${r}.`}function M(n,e){return`rrweb id ${String(n)} is not in run ${e}. Pick an element id from .ripplo/debug/${e}/behavior.jsonl.`}function A(n){return`rrweb id ${String(n)} is not an element node. Anchor to an element so it can be highlighted.`}function R(n){return`Resolved task ${n}.`}function C(n){return`Started task ${n} \u2014 in progress until resolved, dismissed, or sent back for clarification.`}function I(n){return`Marked task ${n} as needing clarification \u2014 the user will follow up.`}function v(n){return`Dismissed task ${n}.`}function a(n){return n==="needsClarification"?"needs clarification":n}function l(n){return n.title??n.lastMessage??"(no description)"}function u(n){let e=n.authorName??n.author;return n.runId==null?[` ${e}: ${n.body}`]:[` ${e} @ ${n.runId}${c(n.frameMs)}: ${n.body}`,...p(n,n.runId)]}function c(n){return n==null?"":` (${String(n)}ms)`}function p(n,e){let r=f(n),t=n.frameMs==null?null:` see it: npx ripplo snapshot ${e} --offset ${String(n.frameMs)}`;return[r,t].filter(s=>s!=null)}function f(n){return n.element!=null?` element: ${g(n.element)}`:n.rrwebId==null?null:` element: rrweb id ${String(n.rrwebId)}`}function g(n){let e=n.role==null?"":`[role=${n.role}]`,r=n.testId==null?"":` testid=${n.testId}`,t=n.ariaName==null?"":` aria="${n.ariaName}"`,s=n.text==null?"":` "${n.text}"`,d=n.selector==null?"":`
8
+ selector: ${n.selector}`;return`${n.tagName??"element"}${e}${r}${t}${s}${d}`}function $(){return["Snapshot the frame above and Read the PNG \u2014 the rendered frame is the evidence, not the thread text.","Read the whole run with `npx ripplo explain <runId>` \u2014 auto-pulls a cloud run's stream if not on disk.","Add `--full` for the synthesized starting state and a step-by-step timeline.",i("tasks","picking this up")].join(`
9
9
  `)}export{y as a,m as b,x as c,T as d,b as e,w as f,S as g,N as h,M as i,A as j,R as k,C as l,I as m,v as n};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{t as O}from"./chunk-5HZ2LDFS.js";import{a as x,b as h,c as f,d as c,e as s,i as w,j as L,m as E}from"./chunk-7JKCHASU.js";import{Ea as v,Fa as S,Ha as P,Ia as b,S as d,T as u,ha as g,oa as n,pa as k}from"./chunk-ZHDR7LXB.js";import{readFile as D,writeFile as W}from"fs/promises";import H from"path";import{err as C,ok as q}from"neverthrow";import j from"safe-stable-stringify";function m(e){return{...e,checks:void 0}}function y(e,t){return j(m(e))===j(m(t))}import{z as i}from"zod";function R({cwd:e}){let t=K.safeParse(c({cwd:e,key:p(),kind:"verdicts"}));t.success&&(P(new Map(Object.entries(t.data.cosat))),v(new Map(Object.entries(t.data.subsume))))}function F({cwd:e}){let t=b(),o=S();s({cwd:e,keep:8,key:p(),kind:"verdicts",value:{cosat:Object.fromEntries(t),subsume:Object.fromEntries(o)}})}function Z({cwd:e}){let t=M.safeParse(c({cwd:e,key:p(),kind:"lint-clean"}));return t.success?t.data.cleanLockfile:void 0}function $({cleanLockfileHash:e,cwd:t}){e!=null&&s({cwd:t,keep:8,key:p(),kind:"lint-clean",value:{cleanLockfile:e}})}function ee(e){return x(e)}var K=i.object({cosat:i.record(i.string(),i.boolean()),subsume:i.record(i.string(),i.boolean())}),M=i.object({cleanLockfile:i.string()});function p(){return f(["patterns"])}import I from"safe-stable-stringify";async function de(e){let t=await E(e);return t.isOk()&&await J(e,t.value),t}async function J(e,t){let o=await T(e,t),r=d(n,o);return await W(H.join(e,L),r),w(e,r),o}var A=new WeakMap;function T(e,t){let o=A.get(t);if(o!=null)return o;let r=V(e,t).then(a=>a.match(l=>Promise.resolve(l),()=>_(e,t)));return A.set(t,r),r}function ue(e,t){return V(e,t)}function ke(e){return e.workflows.filter(t=>t.stub).map(t=>t.name)}async function he(e,t){let o=await B(e);return o==null?"missing":o.checks==null?"stale":y(o,t)?"match":"stale"}async function V(e,t){let o=await B(e);return o==null?C({kind:"no-lockfile"}):o.checks==null||o.checks.epoch!==h()?C({kind:"unstamped"}):y(o,t)?q(k(o)):C({kind:"dsl-drift"})}async function B(e){try{let t=await D(H.join(e,L),"utf8");return u(n,t)}catch{return null}}function _(e,t){R({cwd:e});let o={...z(e,t),epoch:h()};F({cwd:e});let r={...t,checks:o};return k(u(n,d(n,r)))}function z(e,t){let o=I(m(t)),r=f(["checks",o]),a=g.safeParse(c({cwd:e,key:r,kind:"checks"}));if(a.success)return a.data;let l=O(t);return s({cwd:e,keep:4,key:r,kind:"checks",value:l}),l}export{m as a,y as b,R as c,F as d,Z as e,$ as f,ee as g,de as h,J as i,T as j,ue as k,ke as l,he as m};
@@ -0,0 +1,4 @@
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 n}from"./chunk-G6J2WIHJ.js";import{a}from"./chunk-7WZ3VIUU.js";import{f as s}from"./chunk-KH4QH23U.js";import l from"path";import*as r from"zod/mini";var p=new Set(["Edit","Write","NotebookEdit"]),c=r.looseObject({file_path:r.string()}),d="create",k=o=>{if(!p.has(o.tool_name))return;let i=c.safeParse(o.tool_input);if(!i.success)return;let{cwd:e}=o;if(!a(e)||!s(e))return;let t=l.relative(e,i.data.file_path);if(!(t.startsWith("..")||t!==".ripplo"&&!t.startsWith(".ripplo/"))&&!n(e,o.session_id,d))return{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Editing \`.ripplo/\` files (${t}) requires the \`/ripplo:create\` skill loaded first. Load \`/ripplo:create\` and retry. It contains the current state model, workflow authoring model, and DSL rules.`}}};export{k as a};