@mindstudio-ai/browser-agent 0.1.77 → 0.1.78

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 (2) hide show
  1. package/dist/index.js +54 -54
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- "use strict";var __MindStudioBrowserAgent=(()=>{var Bn=Object.defineProperty;var Zs=Object.getOwnPropertyDescriptor;var Ks=Object.getOwnPropertyNames;var Xs=Object.prototype.hasOwnProperty;var Hn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Js=(e,t)=>{for(var n in t)Bn(e,n,{get:t[n],enumerable:!0})},Qs=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ks(t))!Xs.call(e,o)&&o!==n&&Bn(e,o,{get:()=>t[o],enumerable:!(r=Zs(t,o))||r.enumerable});return e};var el=e=>Qs(Bn({},"__esModule",{value:!0}),e);var Om={};Js(Om,{executeSteps:()=>Et,getRefMap:()=>He,resolveElement:()=>xe,takeSnapshot:()=>Ue,takeSnapshotSync:()=>Bt});var Un="__ms";function tl(){return{ws:{ws:null,clientId:null,reconnectDelay:1e3,closing:!1,busy:!1},cursor:{el:null,rippleEl:null,x:-100,y:-100,hasPosition:!1,hideTimer:null,executing:!1,targetElement:null,trackingFrame:null,settledResolve:null,visibilityState:"hidden",preSnapshotState:null},snapshot:{refCounter:0,refMap:new Map},networkIdle:{activeRequests:0},transport:{buffer:[],flushTimer:null,capturing:!1,captured:[],wsGetter:null},noteLayer:{host:null,overlay:null,cursorEl:null,notes:[],currentNote:null,pointerDown:!1,startX:0,startY:0,didDrag:!1,consumedByDeactivation:!1,dragPreview:null,movingNote:null,moveOffsetX:0,moveOffsetY:0},noteElement:{counter:0},notesMode:{active:!1,wasTouchActive:!1},messages:{handler:null},nav:{lastUrl:null},screenshot:{cameraEl:null,flashEl:null,capturing:!1},fonts:{initialized:!1,observer:null},zoom:{pipMode:!1,mobilePreview:!1},touch:{circleEl:null,active:!1,pressed:!1,dragging:!1,startX:0,startY:0,lastX:0,lastY:0,onMouseMove:null,onMouseDown:null,onMouseUp:null,onMouseLeave:null,onDragStart:null,momentumFrame:null,overscrollY:0,bouncing:!1,bounceTimer:null,scrollContainer:null,velocityX:0,velocityY:0,lastMoveTime:0},mirror:{recording:!1,stopFn:null},sessionRecording:{active:!1,runId:null,stopFn:null,buffer:[]},authCredsWidget:{initialized:!1,host:null,observer:null,debounceTimer:null,awaitingCode:!1,awaitingCodeTimer:null,codePollTimer:null,codeAttempts:0,codeSubmitted:!1,codeSeenCount:0,blankPolls:0}}}function x(){let e=window;return e[Un]||(e[Un]=tl()),e[Un]}var mo="/__mindstudio_dev__/logs",nl=2e3;function po(e){x().transport.wsGetter=e}function ho(){let e=x().transport;if(e.buffer.length===0)return;let t=e.buffer;e.buffer=[];let n=e.wsGetter?.();if(n&&n.readyState===WebSocket.OPEN)try{n.send(JSON.stringify({type:"log",entries:t}));return}catch{}try{let r=new XMLHttpRequest;r.open("POST",mo,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify(t))}catch{}}function rl(){let e=x().transport;e.flushTimer||(e.flushTimer=setTimeout(()=>{e.flushTimer=null,ho()},nl))}function ol(){let e=x().transport;e.flushTimer&&(clearTimeout(e.flushTimer),e.flushTimer=null),ho()}function pe(e){let t=x().transport;t.buffer.push(e),t.capturing&&t.captured.push(e),rl()}function Vn(e){let t=x().transport;t.buffer.push(e),t.capturing&&t.captured.push(e),ol()}function Gn(){let e=x().transport;e.capturing=!0,e.captured=[]}function zn(){let e=x().transport;e.capturing=!1;let t=e.captured;return e.captured=[],t}function go(){window.addEventListener("beforeunload",()=>{let e=x().transport;e.buffer.length>0&&navigator.sendBeacon&&navigator.sendBeacon(mo,JSON.stringify(e.buffer))})}var il={a:"link",button:"button",input:"textbox",textarea:"textbox",select:"combobox",option:"option",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",nav:"navigation",main:"main",header:"banner",footer:"contentinfo",aside:"complementary",dialog:"dialog",details:"group",summary:"button",img:"img",ul:"list",ol:"list",li:"listitem",table:"table",tr:"row",th:"columnheader",td:"cell",form:"form",article:"article",section:"region",label:"label",fieldset:"group",legend:"legend",p:"paragraph",blockquote:"blockquote",pre:"code",code:"code",hr:"separator",progress:"progressbar"};function ye(e){let t=e.getAttribute("role");if(t)return t==="presentation"||t==="none"?null:t;let n=e.tagName.toLowerCase();if(n==="a")return e.hasAttribute("href")?"link":null;if(n==="section")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"region":null;if(n==="form")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"form":null;if(n==="img")return e.alt===""?null:"img";if(n==="input")switch(e.type){case"checkbox":return"checkbox";case"radio":return"radio";case"range":return"slider";case"submit":case"button":case"reset":return"button";case"hidden":return null;default:return"textbox"}return il[n]??null}function yo(e){if(e.hasAttribute("onclick")||e.hasAttribute("tabindex")&&e.getAttribute("tabindex")!=="-1")return!0;try{if(getComputedStyle(e).cursor==="pointer")return!0}catch{}return!1}function Se(e){let t=e.getAttribute("aria-label");if(t)return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let a=n.split(/\s+/).map(s=>{let c=document.getElementById(s);return c?Be(c):""}).filter(Boolean).join(" ");if(a)return a}let r=e.tagName.toLowerCase();if(r==="input"||r==="textarea"||r==="select"){let a=al(e);if(a)return a}if(r==="img"){let a=e.alt;if(a)return a.trim()}if(r==="fieldset"){let a=e.querySelector("legend");if(a)return Be(a)}let o=Be(e);if(o)return o;let i=e.getAttribute("title");return i?i.trim():""}function Be(e){if(!e.children.length)return(e.textContent||"").trim();let t=[];for(let n of Array.from(e.childNodes))if(n.nodeType===Node.TEXT_NODE){let r=(n.textContent||"").trim();r&&t.push(r)}else if(n.nodeType===Node.ELEMENT_NODE){let r=n;if(ll(r))continue;let o=sl(r),i=Be(r);i&&(o&&t.length>0&&t.push(" "),t.push(i),o&&t.push(" "))}return t.join("").replace(/\s+/g," ").trim()}function al(e){if(e.id){let n=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(n)return Be(n)}let t=e.closest("label");if(t){let n=t.cloneNode(!0),r=n.querySelector("input, textarea, select");r&&r.remove();let o=n.textContent?.trim();if(o)return o}return null}function sl(e){try{return!getComputedStyle(e).display.includes("inline")}catch{let t=e.tagName.toLowerCase();return["div","p","h1","h2","h3","h4","h5","h6","li","section","article","header","footer","nav","main","aside","blockquote","pre","form","fieldset","table","tr","br"].includes(t)}}function ll(e){let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||e.getAttribute("aria-hidden")==="true")return!0;try{let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden")return!0}catch{}return!1}function qn(e,t){try{let n=getComputedStyle(e,t).content;if(!n||n==="none"||n==="normal")return"";let r=n.match(/^["'](.*)["']$/);return r?r[1]:""}catch{return""}}function Wt(){x().networkIdle.activeRequests++}function gt(){let e=x().networkIdle;e.activeRequests=Math.max(0,e.activeRequests-1)}function bo(e=5e3,t=200){return new Promise((n,r)=>{let o=Date.now()+e,i=null;function a(){if(Date.now()>o){i&&clearTimeout(i),n();return}x().networkIdle.activeRequests===0?i||(i=setTimeout(()=>{x().networkIdle.activeRequests===0?n():(i=null,a())},t)):(i&&(clearTimeout(i),i=null),setTimeout(a,50))}a()})}function He(){return x().snapshot.refMap}async function Ue(){return await bo(),Bt()}function Bt(){let e=x().snapshot;e.refCounter=0,e.refMap=new Map;let t=document.body;if(!t)return"(empty page)";let n=wo(t);return Yn(n,0).trimEnd()}function he(e){let t=ye(e),n=Se(e),r=n.length>60?n.slice(0,57)+"...":n;if(t&&r)return`${t} "${r}"`;if(t)return t;if(r)return`"${r}"`;let o=e.tagName.toLowerCase();return e.id?`${o}#${e.id}`:o}function wo(e){if(ul(e))return[];let t=ye(e),n=!t&&yo(e),r=t||(n?"clickable":null),o="";if(r){o=Se(e);let u=qn(e,"::before"),d=qn(e,"::after");(u||d)&&(o=[u,o,d].filter(Boolean).join(" ")),o.length>80&&(o=o.slice(0,77)+"...")}let i=dl(e),a=t==="button"||t==="link"||t==="textbox"||t==="combobox"||t==="checkbox"||t==="radio"||t==="slider"||t==="tab"||t==="menuitem"||n,s=r&&o&&!a,c=null;if(a||s){let u=x().snapshot;u.refCounter++,c=`e${u.refCounter}`,u.refMap.set(c,e)}let l=cl(e);if(r){let u=l.length===0?"":Yn(l,0).trim();return[{tag:r,name:o,attrs:i,ref:c,children:u&&u===o?[]:l,element:e}]}if(l.length===0){let u=Be(e);if(u)return[{tag:null,name:u.length>80?u.slice(0,77)+"...":u,attrs:[],ref:null,children:[],element:e}]}return l}function cl(e){let t=[];for(let n of Array.from(e.childNodes))n.nodeType===Node.ELEMENT_NODE&&t.push(...wo(n));return t}function ul(e){let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||t==="head"||e.getAttribute("aria-hidden")==="true"||e.id==="__mindstudio-browser-agent"||e.id==="__mindstudio-cursor"||e.id==="__mindstudio-cursor-ripple"||e.id==="__mindstudio-notes-host")return!0;try{let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden"&&n.position!=="static")return!0}catch{}return!1}function dl(e){let t=[],n=e.tagName.toLowerCase();if((n==="dialog"&&e.open||n==="details"&&e.open)&&t.push("open"),e.disabled&&t.push("disabled"),n==="input"){let i=e;(i.type==="checkbox"||i.type==="radio")&&i.checked&&t.push("checked")}if(n==="input"){let i=e;i.type!=="checkbox"&&i.type!=="radio"&&i.type!=="hidden"&&i.type!=="submit"&&i.type!=="button"&&i.type!=="reset"&&(t.push(`value="${i.value}"`),i.placeholder&&t.push(`placeholder="${i.placeholder}"`))}if(n==="textarea"){let i=e;t.push(`value="${i.value}"`),i.placeholder&&t.push(`placeholder="${i.placeholder}"`)}if(n==="select"){let i=e,a=i.options[i.selectedIndex];a&&t.push(`value="${a.text}"`)}let r=n.match(/^h([1-6])$/);r&&t.push(`level=${r[1]}`);let o=e.getAttribute("aria-expanded");return o==="true"&&t.push("expanded"),o==="false"&&t.push("collapsed"),e.getAttribute("aria-selected")==="true"&&t.push("selected"),e.getAttribute("aria-pressed")==="true"&&t.push("pressed"),t}function Yn(e,t){let n="";for(let r of e)n+=fl(r,t);return n}function fl(e,t){let n=" ".repeat(t),r=[];e.tag&&r.push(e.tag),e.name&&r.push(`"${e.name}"`);for(let a of e.attrs)r.push(`[${a}]`);e.ref&&r.push(`[ref=${e.ref}]`);let o="";r.length>0&&(o+=`${n}${r.join(" ")}
2
- `);let i=r.length>0?t+1:t;return o+=Yn(e.children,i),o}function vo(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e instanceof Error)return e.stack||e.message||String(e);if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function le(e){return new Promise(t=>setTimeout(t,e))}function et(){let e=null,t=0;for(let n of document.querySelectorAll("*")){let r=n,o=getComputedStyle(r).overflowY;if(o!=="auto"&&o!=="scroll")continue;let i=r.scrollHeight-r.clientHeight;i<=20||i>t&&(t=i,e=r)}return e??document.documentElement}var ml=["log","info","warn","error","debug"];function Co(){if(!console.__ms_patched){console.__ms_patched=!0;for(let e of ml){let t=console[e];console[e]=(...n)=>{t&&t.apply(console,n),pe({type:"console",level:e,args:n.map(vo),url:location.href})}}}}function So(){window.__ms_error_patched||(window.__ms_error_patched=!0,window.addEventListener("error",e=>{Vn({type:"error",message:e.message,stack:e.error&&e.error.stack||"",source:e.filename,line:e.lineno,column:e.colno,url:location.href})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason||{};Vn({type:"error",message:t.message||String(t),stack:t.stack||"",url:location.href})}))}function xo(){if(!window.fetch||window.fetch.__ms_patched)return;let e=window.fetch;window.fetch=function(t,n){let r=(n?.method||"GET").toUpperCase(),o=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if(o.includes("/__mindstudio_dev__/"))return e.apply(this,[t,n]);let i=Date.now();return Wt(),e.apply(this,[t,n]).then(a=>{gt();let s={type:"network",method:r,url:o,status:a.status,statusText:a.statusText,duration:Date.now()-i,ok:a.ok};if(a.ok)pe(s);else try{a.clone().text().then(c=>{s.body=c.slice(0,1e3),pe(s)}).catch(()=>pe(s))}catch{pe(s)}return a},a=>{throw gt(),pe({type:"network",method:r,url:o,error:a.message||String(a),duration:Date.now()-i,ok:!1}),a})},window.fetch.__ms_patched=!0}function Io(){document.__ms_click_patched||(document.__ms_click_patched=!0,document.addEventListener("click",e=>{let t=e.target;if(!t)return;let n=(t.textContent||"").trim().slice(0,100);pe({type:"interaction",event:"click",target:he(t),text:n,url:location.href})},!0))}function Eo(){if(XMLHttpRequest.prototype.open.__ms_patched)return;let e=window.XMLHttpRequest,t=e.prototype.open,n=e.prototype.send;e.prototype.open=function(r,o,...i){return this.__ms_method=r.toUpperCase(),this.__ms_url=String(o),t.apply(this,[r,o,...i])},e.prototype.send=function(r){let o=this.__ms_method||"GET",i=this.__ms_url||"";if(i.includes("/__mindstudio_dev__/"))return n.apply(this,[r]);let a=Date.now();return Wt(),this.addEventListener("loadend",function(){gt(),pe({type:"network",method:o,url:i,status:this.status,statusText:this.statusText,duration:Date.now()-a,ok:this.status>=200&&this.status<300,...this.status>=400?{body:(this.responseText||"").slice(0,1e3)}:{},via:"xhr"})},{once:!0}),n.apply(this,[r])},XMLHttpRequest.prototype.open.__ms_patched=!0}function xe(e){let t=null;if(e.ref){let n=He(),r=n.get(e.ref);if(r&&r.isConnected)if(Le(r))t={element:r,matched:`${he(r)} [ref=${e.ref}]`};else throw new Error(`Element [ref=${e.ref}] exists but is hidden (${jn(r)}). It may be inside a closed dialog or collapsed section.`);else{let o=[...n.entries()].filter(([,i])=>i.isConnected&&Le(i)).slice(0,10).map(([i,a])=>`${he(a)} [ref=${i}]`).join(", ");throw new Error(`Element [ref=${e.ref}] not found. `+(o?`Available refs: ${o}`:"No refs available \u2014 take a snapshot first."))}}if(!t&&(e.text||e.role&&e.text)){let n=e.text,r=e.role,o=Ao(n,r);if(o.length===0){let i=Ao(n,r,!0);if(i.length>0)throw new Error(`Found ${r?r+" ":""}"${n}" but it is hidden (${jn(i[0])}). Wait for it to become visible or check if a dialog/modal needs to be opened first.`);let a=r?`${r} "${n}"`:`"${n}"`,s=Mo(r);throw new Error(`No element found matching ${a}. `+(s?`Visible ${r||"element"}s: ${s}`:"The page may still be loading \u2014 try a wait command first."))}if(o.length>1){let i=o.filter(ko),a=i.length===1?i[0]:o[0];t={element:a,matched:he(a)}}else t={element:o[0],matched:he(o[0])}}if(!t&&e.role&&!e.text){let n=e.role,r=pl(n);if(r.length===0){let o=Mo(n);throw new Error(`No visible element with role "${n}" found. `+(o?`Visible ${n}s: ${o}`:"The page may still be loading \u2014 try a wait command first."))}t={element:r[0],matched:he(r[0])}}if(!t&&e.label){let n=e.label,r=hl(n);if(!r){let o=[...document.querySelectorAll("label")].filter(Le).map(i=>`"${(i.textContent||"").trim().slice(0,40)}"`).slice(0,8).join(", ");throw new Error(`No input found with label "${n}". `+(o?`Visible labels: ${o}`:"No labels found on the page."))}t={element:r,matched:`${he(r)} via label "${n}"`}}if(!t&&e.selector){let n=e.selector,r=document.querySelector(n);if(!r)throw new Error(`No element found for selector "${n}".`);if(!Le(r))throw new Error(`Found element for selector "${n}" but it is hidden (${jn(r)}).`);t={element:r,matched:`${he(r)} via selector "${n}"`}}if(!t)throw new Error("No targeting field provided (need ref, text, role, label, or selector)");return t}function Ao(e,t,n=!1){let r=[],o=e.toLowerCase();for(let i of document.querySelectorAll("*")){if(!n&&!Le(i)||n&&!i.isConnected||t&&ye(i)!==t)continue;if(Se(i).toLowerCase().includes(o)){r.push(i);continue}i.children.length||(i.textContent||"").trim().toLowerCase().includes(o)&&r.push(i)}return r}function pl(e){let t=[];for(let n of document.querySelectorAll("*"))Le(n)&&ye(n)===e&&t.push(n);return t}function hl(e){let t=e.toLowerCase();for(let n of document.querySelectorAll("label")){if(!(n.textContent||"").trim().toLowerCase().includes(t))continue;let o=n.getAttribute("for");if(o){let a=document.getElementById(o);if(a&&Le(a))return a}let i=n.querySelector("input, textarea, select");if(i&&Le(i))return i}return null}function Le(e){if(!e.isConnected)return!1;try{let t=getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1}catch{return!1}return!0}function ko(e){if(e.matches('a, button, input, textarea, select, [role="button"], [role="link"], [tabindex]'))return!0;try{return getComputedStyle(e).cursor==="pointer"}catch{return!1}}function jn(e){try{let t=getComputedStyle(e);if(t.display==="none")return"display: none";if(t.visibility==="hidden")return"visibility: hidden"}catch{}return e.getAttribute("aria-hidden")==="true"?'aria-hidden="true"':"hidden"}function Mo(e){let t=[];for(let n of document.querySelectorAll("*"))if(Le(n)&&(e?ye(n)===e&&t.push(n):ko(n)&&t.push(n),t.length>=10))break;return t.length===0?"":t.map(n=>`"${Se(n).slice(0,40)||he(n)}"`).join(", ")}function Zn(e){let t=e.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,o={bubbles:!0,cancelable:!0,clientX:n,clientY:r,button:0};e.dispatchEvent(new PointerEvent("pointerdown",{...o,pointerId:1})),e.dispatchEvent(new MouseEvent("mousedown",o)),e instanceof HTMLElement&&e.focus(),e.dispatchEvent(new PointerEvent("pointerup",{...o,pointerId:1})),e.dispatchEvent(new MouseEvent("mouseup",o)),e.dispatchEvent(new MouseEvent("click",o))}var gl=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set,yl=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value")?.set;async function No(e,t,n={}){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("type command requires an input or textarea element");e.focus(),Zn(e),n.clear&&(To(e,""),e.dispatchEvent(new Event("input",{bubbles:!0})));for(let r=0;r<t.length;r++){let o=t[r];e.dispatchEvent(new KeyboardEvent("keydown",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keypress",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),To(e,e.value+o),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keyup",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),await le(bl(o,t.length))}e.dispatchEvent(new Event("change",{bubbles:!0}))}function bl(e,t){let n=Math.random()*50-25,r;if(e===" "?r=120+n:/[.,!?;:\-]/.test(e)?r=140+n:/[A-Z]/.test(e)?r=115+n:r=85+n,t<=20)return r;let o=Math.max(.1,20/t);return r*o}function To(e,t){let n=e instanceof HTMLTextAreaElement?yl:gl;n?n.call(e,t):e.value=t}async function Ro(e){let t=e.timeout||5e3,n=Date.now(),r=n+t;for(;Date.now()<r;)try{return{...xe(e),elapsed:Date.now()-n}}catch{await le(100)}let o=e.text?`"${e.text}"`:e.role?`role "${e.role}"`:e.selector?`selector "${e.selector}"`:"element";throw new Error(`Timed out waiting for ${o} after ${t}ms`)}var Lo=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set;function _o(e,t){if(!(e instanceof HTMLSelectElement))throw new Error("select command requires a <select> element");let n=t.toLowerCase(),r=null;for(let o of e.options)if(o.text.toLowerCase().includes(n)||o.value.toLowerCase()===n||o.label.toLowerCase().includes(n)){r=o;break}if(!r){let o=[...e.options].map(i=>`"${i.text}"`).join(", ");throw new Error(`No option matching "${t}" in select. Available options: ${o}`)}return Lo?Lo.call(e,r.value):e.value=r.value,e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new Event("input",{bubbles:!0})),r.text}async function Fo(e){try{let t=e.trim(),r=/\breturn\b/.test(t)||/[;{]/.test(t)?e:`return (${e})`,i=new Function(r)();return i instanceof Promise?await i:i}catch(t){throw new Error(`evaluate failed: ${t instanceof Error?t.message:String(t)}`)}}var Oo="__mindstudio-touch-circle",Kn="__mindstudio-touch-style",$o=44,Do=5,Po=.95,Ht=.5,Xn=.45,Wo=600;function vl(){document.getElementById(Oo)?.remove();let e=document.createElement("div");return e.id=Oo,e.style.cssText=["position: fixed","z-index: 2147483647","pointer-events: none",`width: ${$o}px`,`height: ${$o}px`,"border-radius: 50%","background: rgba(255, 255, 255, 0.08)","border: 2px solid rgba(255, 255, 255, 0.85)","box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 0.5px rgba(0, 0, 0, 0.1)","backdrop-filter: blur(1px)","-webkit-backdrop-filter: blur(1.5px)","transform: translate(-50%, -50%) scale(1)","transition: transform 100ms ease, opacity 100ms ease, background 100ms ease","opacity: 0","will-change: left, top, transform, opacity"].join("; "),document.documentElement.appendChild(e),e}function Cl(e){e.style.transform="translate(-50%, -50%) scale(0.88)",e.style.background="rgba(255, 255, 255, 0.18)"}function Bo(e){e.style.transform="translate(-50%, -50%) scale(1)",e.style.background="rgba(255, 255, 255, 0.08)"}function Ho(){window.parent!==window&&x().zoom.mobilePreview&&yt()}function yt(){let e=x().touch;if(e.active)return;e.active=!0,e.scrollContainer=et(),El();let t=vl();e.circleEl=t,e.onMouseMove=n=>{let r=x();if(r.cursor.executing||r.screenshot.capturing){t.style.opacity="0";return}if(t.style.left=`${n.clientX}px`,t.style.top=`${n.clientY}px`,t.style.opacity="1",e.pressed){let o=Math.abs(n.clientX-e.startX),i=Math.abs(n.clientY-e.startY);if(!e.dragging&&(o>Do||i>Do)&&(e.dragging=!0),e.dragging){let a=e.scrollContainer||document.documentElement,s=performance.now(),c=s-e.lastMoveTime||16,l=e.lastX-n.clientX,u=e.lastY-n.clientY;e.bouncing&&Il();let d=a.scrollTop;a.scrollTop+=u,a.scrollLeft+=l;let m=a.scrollTop-d,p=u-m;if(Math.abs(p)>.5){let g=Xn/(1+Math.abs(e.overscrollY)/200);e.overscrollY+=p*g,Jn()}else if(e.overscrollY!==0){let g=Xn/(1+Math.abs(e.overscrollY)/200);e.overscrollY+=p*g,(e.overscrollY>0&&u<0||e.overscrollY<0&&u>0)&&(e.overscrollY*=.7),Jn()}e.velocityX=.8*(l/c)+.2*e.velocityX,e.velocityY=.8*(u/c)+.2*e.velocityY,e.lastMoveTime=s,n.preventDefault()}e.lastX=n.clientX,e.lastY=n.clientY}},e.onMouseDown=n=>{x().cursor.executing||(Ut(),e.pressed=!0,e.dragging=!1,e.startX=n.clientX,e.startY=n.clientY,e.lastX=n.clientX,e.lastY=n.clientY,e.velocityX=0,e.velocityY=0,e.lastMoveTime=performance.now(),Cl(t))},e.onMouseUp=()=>{let n=e.dragging;n&&document.addEventListener("click",Sl,{capture:!0,once:!0}),e.pressed=!1,e.dragging=!1,Bo(t),n&&(e.overscrollY!==0&&Go(),(Math.abs(e.velocityX)>Ht/16||Math.abs(e.velocityY)>Ht/16)&&xl())},e.onMouseLeave=()=>{e.pressed=!1,e.dragging=!1,Ut(),t.style.opacity="0",Bo(t)},e.onDragStart=n=>n.preventDefault(),document.addEventListener("mousemove",e.onMouseMove),document.addEventListener("mousedown",e.onMouseDown),document.addEventListener("mouseup",e.onMouseUp),document.addEventListener("mouseleave",e.onMouseLeave),document.addEventListener("dragstart",e.onDragStart)}function Vt(){let e=x().touch;e.active&&(e.active=!1,e.pressed=!1,e.dragging=!1,Ut(),e.overscrollY!==0&&(e.overscrollY=0,document.body.style.transition="",document.body.style.transform=""),Al(),e.circleEl&&(e.circleEl.remove(),e.circleEl=null),e.onMouseMove&&document.removeEventListener("mousemove",e.onMouseMove),e.onMouseDown&&document.removeEventListener("mousedown",e.onMouseDown),e.onMouseUp&&document.removeEventListener("mouseup",e.onMouseUp),e.onMouseLeave&&document.removeEventListener("mouseleave",e.onMouseLeave),e.onDragStart&&document.removeEventListener("dragstart",e.onDragStart),e.onMouseMove=null,e.onMouseDown=null,e.onMouseUp=null,e.onMouseLeave=null,e.onDragStart=null)}function Uo(){let{circleEl:e}=x().touch;e&&(e.style.opacity="0")}function Vo(){let e=x().touch;e.active&&e.circleEl&&(e.circleEl.style.opacity="1")}function Sl(e){e.preventDefault(),e.stopPropagation()}function xl(){Ut();let e=x().touch,t=e.scrollContainer||document.documentElement,n=e.velocityX*16,r=e.velocityY*16;function o(){let i=x().touch;if(n*=Po,r*=Po,Math.abs(n)<Ht&&Math.abs(r)<Ht){i.momentumFrame=null,i.overscrollY!==0&&Go();return}let a=t.scrollTop;t.scrollTop+=r,t.scrollLeft+=n;let s=t.scrollTop-a,c=r-s;if(Math.abs(c)>.5){let l=Xn*.5/(1+Math.abs(i.overscrollY)/200);i.overscrollY+=c*l,Jn(),r*=.7}i.momentumFrame=requestAnimationFrame(o)}e.momentumFrame=requestAnimationFrame(o)}function Ut(){let e=x().touch;e.momentumFrame!==null&&(cancelAnimationFrame(e.momentumFrame),e.momentumFrame=null)}function Jn(){let e=x().touch;document.body.style.transition="none",document.body.style.transform=`translateY(${-e.overscrollY}px)`}function Go(){let e=x().touch;e.bouncing=!0,e.overscrollY=0,document.body.style.transition=`transform ${Wo}ms cubic-bezier(0.2, 0.9, 0.3, 1)`,document.body.style.transform="",e.bounceTimer&&clearTimeout(e.bounceTimer),e.bounceTimer=setTimeout(()=>{let t=x().touch;t.bouncing=!1,t.bounceTimer=null,document.body.style.transition="",document.body.style.transform=""},Wo)}function Il(){let e=x().touch;e.bouncing&&(e.bouncing=!1,e.bounceTimer&&(clearTimeout(e.bounceTimer),e.bounceTimer=null),document.body.style.transition="")}function El(){document.getElementById(Kn)?.remove();let e=document.createElement("style");e.id=Kn,e.textContent=`
1
+ "use strict";var __MindStudioBrowserAgent=(()=>{var Vn=Object.defineProperty;var el=Object.getOwnPropertyDescriptor;var tl=Object.getOwnPropertyNames;var nl=Object.prototype.hasOwnProperty;var Gn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var rl=(e,t)=>{for(var n in t)Vn(e,n,{get:t[n],enumerable:!0})},ol=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of tl(t))!nl.call(e,o)&&o!==n&&Vn(e,o,{get:()=>t[o],enumerable:!(r=el(t,o))||r.enumerable});return e};var il=e=>ol(Vn({},"__esModule",{value:!0}),e);var Hm={};rl(Hm,{executeSteps:()=>At,getRefMap:()=>He,resolveElement:()=>xe,takeSnapshot:()=>Ue,takeSnapshotSync:()=>Ht});var zn="__ms";function al(){return{ws:{ws:null,clientId:null,reconnectDelay:1e3,closing:!1,busy:!1},cursor:{el:null,rippleEl:null,x:-100,y:-100,hasPosition:!1,hideTimer:null,executing:!1,targetElement:null,trackingFrame:null,settledResolve:null,visibilityState:"hidden",preSnapshotState:null},snapshot:{refCounter:0,refMap:new Map},networkIdle:{activeRequests:0},transport:{buffer:[],flushTimer:null,capturing:!1,captured:[],wsGetter:null},noteLayer:{host:null,overlay:null,cursorEl:null,notes:[],currentNote:null,pointerDown:!1,startX:0,startY:0,didDrag:!1,consumedByDeactivation:!1,dragPreview:null,movingNote:null,moveOffsetX:0,moveOffsetY:0},noteElement:{counter:0},notesMode:{active:!1,wasTouchActive:!1},messages:{handler:null},nav:{lastUrl:null},screenshot:{cameraEl:null,flashEl:null,capturing:!1},fonts:{initialized:!1,observer:null},zoom:{pipMode:!1,mobilePreview:!1},touch:{circleEl:null,active:!1,pressed:!1,dragging:!1,startX:0,startY:0,lastX:0,lastY:0,onMouseMove:null,onMouseDown:null,onMouseUp:null,onMouseLeave:null,onDragStart:null,momentumFrame:null,overscrollY:0,bouncing:!1,bounceTimer:null,scrollContainer:null,velocityX:0,velocityY:0,lastMoveTime:0},mirror:{recording:!1,stopFn:null},sessionRecording:{active:!1,runId:null,stopFn:null,buffer:[]},authCredsWidget:{initialized:!1,host:null,observer:null,debounceTimer:null,awaitingCode:!1,awaitingCodeTimer:null,codePollTimer:null,codeAttempts:0,codeSubmitted:!1,codeSeenCount:0,blankPolls:0}}}function x(){let e=window;return e[zn]||(e[zn]=al()),e[zn]}var yo="/__mindstudio_dev__/logs",sl=2e3;function bo(e){x().transport.wsGetter=e}function wo(){let e=x().transport;if(e.buffer.length===0)return;let t=e.buffer;e.buffer=[];let n=e.wsGetter?.();if(n&&n.readyState===WebSocket.OPEN)try{n.send(JSON.stringify({type:"log",entries:t}));return}catch{}try{let r=new XMLHttpRequest;r.open("POST",yo,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify(t))}catch{}}function ll(){let e=x().transport;e.flushTimer||(e.flushTimer=setTimeout(()=>{e.flushTimer=null,wo()},sl))}function cl(){let e=x().transport;e.flushTimer&&(clearTimeout(e.flushTimer),e.flushTimer=null),wo()}function pe(e){let t=x().transport;t.buffer.push(e),t.capturing&&t.captured.push(e),ll()}function Yn(e){let t=x().transport;t.buffer.push(e),t.capturing&&t.captured.push(e),cl()}function qn(){let e=x().transport;e.capturing=!0,e.captured=[]}function jn(){let e=x().transport;e.capturing=!1;let t=e.captured;return e.captured=[],t}function vo(){window.addEventListener("beforeunload",()=>{let e=x().transport;e.buffer.length>0&&navigator.sendBeacon&&navigator.sendBeacon(yo,JSON.stringify(e.buffer))})}var ul={a:"link",button:"button",input:"textbox",textarea:"textbox",select:"combobox",option:"option",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",nav:"navigation",main:"main",header:"banner",footer:"contentinfo",aside:"complementary",dialog:"dialog",details:"group",summary:"button",img:"img",ul:"list",ol:"list",li:"listitem",table:"table",tr:"row",th:"columnheader",td:"cell",form:"form",article:"article",section:"region",label:"label",fieldset:"group",legend:"legend",p:"paragraph",blockquote:"blockquote",pre:"code",code:"code",hr:"separator",progress:"progressbar"};function ye(e){let t=e.getAttribute("role");if(t)return t==="presentation"||t==="none"?null:t;let n=e.tagName.toLowerCase();if(n==="a")return e.hasAttribute("href")?"link":null;if(n==="section")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"region":null;if(n==="form")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"form":null;if(n==="img")return e.alt===""?null:"img";if(n==="input")switch(e.type){case"checkbox":return"checkbox";case"radio":return"radio";case"range":return"slider";case"submit":case"button":case"reset":return"button";case"hidden":return null;default:return"textbox"}return ul[n]??null}function Co(e){if(e.hasAttribute("onclick")||e.hasAttribute("tabindex")&&e.getAttribute("tabindex")!=="-1")return!0;try{if(getComputedStyle(e).cursor==="pointer")return!0}catch{}return!1}function Se(e){let t=e.getAttribute("aria-label");if(t)return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let a=n.split(/\s+/).map(s=>{let c=document.getElementById(s);return c?Be(c):""}).filter(Boolean).join(" ");if(a)return a}let r=e.tagName.toLowerCase();if(r==="input"||r==="textarea"||r==="select"){let a=dl(e);if(a)return a}if(r==="img"){let a=e.alt;if(a)return a.trim()}if(r==="fieldset"){let a=e.querySelector("legend");if(a)return Be(a)}let o=Be(e);if(o)return o;let i=e.getAttribute("title");return i?i.trim():""}function Be(e){if(!e.children.length)return(e.textContent||"").trim();let t=[];for(let n of Array.from(e.childNodes))if(n.nodeType===Node.TEXT_NODE){let r=(n.textContent||"").trim();r&&t.push(r)}else if(n.nodeType===Node.ELEMENT_NODE){let r=n;if(ml(r))continue;let o=fl(r),i=Be(r);i&&(o&&t.length>0&&t.push(" "),t.push(i),o&&t.push(" "))}return t.join("").replace(/\s+/g," ").trim()}function dl(e){if(e.id){let n=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(n)return Be(n)}let t=e.closest("label");if(t){let n=t.cloneNode(!0),r=n.querySelector("input, textarea, select");r&&r.remove();let o=n.textContent?.trim();if(o)return o}return null}function fl(e){try{return!getComputedStyle(e).display.includes("inline")}catch{let t=e.tagName.toLowerCase();return["div","p","h1","h2","h3","h4","h5","h6","li","section","article","header","footer","nav","main","aside","blockquote","pre","form","fieldset","table","tr","br"].includes(t)}}function ml(e){let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||e.getAttribute("aria-hidden")==="true")return!0;try{let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden")return!0}catch{}return!1}function Zn(e,t){try{let n=getComputedStyle(e,t).content;if(!n||n==="none"||n==="normal")return"";let r=n.match(/^["'](.*)["']$/);return r?r[1]:""}catch{return""}}function Bt(){x().networkIdle.activeRequests++}function et(){let e=x().networkIdle;e.activeRequests=Math.max(0,e.activeRequests-1)}function So(e=5e3,t=200){return new Promise((n,r)=>{let o=Date.now()+e,i=null;function a(){if(Date.now()>o){i&&clearTimeout(i),n();return}x().networkIdle.activeRequests===0?i||(i=setTimeout(()=>{x().networkIdle.activeRequests===0?n():(i=null,a())},t)):(i&&(clearTimeout(i),i=null),setTimeout(a,50))}a()})}function He(){return x().snapshot.refMap}async function Ue(){return await So(),Ht()}function Ht(){let e=x().snapshot;e.refCounter=0,e.refMap=new Map;let t=document.body;if(!t)return"(empty page)";let n=xo(t);return Xn(n,0).trimEnd()}function he(e){let t=ye(e),n=Se(e),r=n.length>60?n.slice(0,57)+"...":n;if(t&&r)return`${t} "${r}"`;if(t)return t;if(r)return`"${r}"`;let o=e.tagName.toLowerCase();return e.id?`${o}#${e.id}`:o}function xo(e){if(hl(e))return[];let t=ye(e),n=!t&&Co(e),r=t||(n?"clickable":null),o="";if(r){o=Se(e);let u=Zn(e,"::before"),d=Zn(e,"::after");(u||d)&&(o=[u,o,d].filter(Boolean).join(" ")),o.length>80&&(o=o.slice(0,77)+"...")}let i=gl(e),a=t==="button"||t==="link"||t==="textbox"||t==="combobox"||t==="checkbox"||t==="radio"||t==="slider"||t==="tab"||t==="menuitem"||n,s=r&&o&&!a,c=null;if(a||s){let u=x().snapshot;u.refCounter++,c=`e${u.refCounter}`,u.refMap.set(c,e)}let l=pl(e);if(r){let u=l.length===0?"":Xn(l,0).trim();return[{tag:r,name:o,attrs:i,ref:c,children:u&&u===o?[]:l,element:e}]}if(l.length===0){let u=Be(e);if(u)return[{tag:null,name:u.length>80?u.slice(0,77)+"...":u,attrs:[],ref:null,children:[],element:e}]}return l}function pl(e){let t=[];for(let n of Array.from(e.childNodes))n.nodeType===Node.ELEMENT_NODE&&t.push(...xo(n));return t}function hl(e){let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||t==="head"||e.getAttribute("aria-hidden")==="true"||e.id==="__mindstudio-browser-agent"||e.id==="__mindstudio-cursor"||e.id==="__mindstudio-cursor-ripple"||e.id==="__mindstudio-notes-host")return!0;try{let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden"&&n.position!=="static")return!0}catch{}return!1}function gl(e){let t=[],n=e.tagName.toLowerCase();if((n==="dialog"&&e.open||n==="details"&&e.open)&&t.push("open"),e.disabled&&t.push("disabled"),n==="input"){let i=e;(i.type==="checkbox"||i.type==="radio")&&i.checked&&t.push("checked")}if(n==="input"){let i=e;i.type!=="checkbox"&&i.type!=="radio"&&i.type!=="hidden"&&i.type!=="submit"&&i.type!=="button"&&i.type!=="reset"&&(t.push(`value="${i.value}"`),i.placeholder&&t.push(`placeholder="${i.placeholder}"`))}if(n==="textarea"){let i=e;t.push(`value="${i.value}"`),i.placeholder&&t.push(`placeholder="${i.placeholder}"`)}if(n==="select"){let i=e,a=i.options[i.selectedIndex];a&&t.push(`value="${a.text}"`)}let r=n.match(/^h([1-6])$/);r&&t.push(`level=${r[1]}`);let o=e.getAttribute("aria-expanded");return o==="true"&&t.push("expanded"),o==="false"&&t.push("collapsed"),e.getAttribute("aria-selected")==="true"&&t.push("selected"),e.getAttribute("aria-pressed")==="true"&&t.push("pressed"),t}function Xn(e,t){let n="";for(let r of e)n+=yl(r,t);return n}function yl(e,t){let n=" ".repeat(t),r=[];e.tag&&r.push(e.tag),e.name&&r.push(`"${e.name}"`);for(let a of e.attrs)r.push(`[${a}]`);e.ref&&r.push(`[ref=${e.ref}]`);let o="";r.length>0&&(o+=`${n}${r.join(" ")}
2
+ `);let i=r.length>0?t+1:t;return o+=Xn(e.children,i),o}function Io(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e instanceof Error)return e.stack||e.message||String(e);if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function le(e){return new Promise(t=>setTimeout(t,e))}function tt(){let e=null,t=0;for(let n of document.querySelectorAll("*")){let r=n,o=getComputedStyle(r).overflowY;if(o!=="auto"&&o!=="scroll")continue;let i=r.scrollHeight-r.clientHeight;i<=20||i>t&&(t=i,e=r)}return e??document.documentElement}var bl=["log","info","warn","error","debug"];function Eo(){if(!console.__ms_patched){console.__ms_patched=!0;for(let e of bl){let t=console[e];console[e]=(...n)=>{t&&t.apply(console,n),pe({type:"console",level:e,args:n.map(Io),url:location.href})}}}}function Ao(){window.__ms_error_patched||(window.__ms_error_patched=!0,window.addEventListener("error",e=>{Yn({type:"error",message:e.message,stack:e.error&&e.error.stack||"",source:e.filename,line:e.lineno,column:e.colno,url:location.href})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason||{};Yn({type:"error",message:t.message||String(t),stack:t.stack||"",url:location.href})}))}function ko(){if(!window.fetch||window.fetch.__ms_patched)return;let e=window.fetch;window.fetch=function(t,n){let r=(n?.method||"GET").toUpperCase(),o=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if(o.includes("/__mindstudio_dev__/"))return e.apply(this,[t,n]);let i=Date.now();Bt();let a;try{a=e.apply(this,[t,n])}catch(s){throw et(),s}return a.then(s=>{et();let c={type:"network",method:r,url:o,status:s.status,statusText:s.statusText,duration:Date.now()-i,ok:s.ok};if(s.ok)pe(c);else try{s.clone().text().then(l=>{c.body=l.slice(0,1e3),pe(c)}).catch(()=>pe(c))}catch{pe(c)}return s},s=>{throw et(),pe({type:"network",method:r,url:o,error:s.message||String(s),duration:Date.now()-i,ok:!1}),s})},window.fetch.__ms_patched=!0}function Mo(){document.__ms_click_patched||(document.__ms_click_patched=!0,document.addEventListener("click",e=>{let t=e.target;if(!t)return;let n=(t.textContent||"").trim().slice(0,100);pe({type:"interaction",event:"click",target:he(t),text:n,url:location.href})},!0))}function To(){if(XMLHttpRequest.prototype.open.__ms_patched)return;let e=window.XMLHttpRequest,t=e.prototype.open,n=e.prototype.send;e.prototype.open=function(r,o,...i){return this.__ms_method=r.toUpperCase(),this.__ms_url=String(o),t.apply(this,[r,o,...i])},e.prototype.send=function(r){let o=this.__ms_method||"GET",i=this.__ms_url||"";if(i.includes("/__mindstudio_dev__/"))return n.apply(this,[r]);let a=Date.now();return Bt(),this.addEventListener("loadend",function(){et(),pe({type:"network",method:o,url:i,status:this.status,statusText:this.statusText,duration:Date.now()-a,ok:this.status>=200&&this.status<300,...this.status>=400?{body:(this.responseText||"").slice(0,1e3)}:{},via:"xhr"})},{once:!0}),n.apply(this,[r])},XMLHttpRequest.prototype.open.__ms_patched=!0}function xe(e){let t=null;if(e.ref){let n=He(),r=n.get(e.ref);if(r&&r.isConnected)if(Le(r))t={element:r,matched:`${he(r)} [ref=${e.ref}]`};else throw new Error(`Element [ref=${e.ref}] exists but is hidden (${Kn(r)}). It may be inside a closed dialog or collapsed section.`);else{let o=[...n.entries()].filter(([,i])=>i.isConnected&&Le(i)).slice(0,10).map(([i,a])=>`${he(a)} [ref=${i}]`).join(", ");throw new Error(`Element [ref=${e.ref}] not found. `+(o?`Available refs: ${o}`:"No refs available \u2014 take a snapshot first."))}}if(!t&&(e.text||e.role&&e.text)){let n=e.text,r=e.role,o=Lo(n,r);if(o.length===0){let i=Lo(n,r,!0);if(i.length>0)throw new Error(`Found ${r?r+" ":""}"${n}" but it is hidden (${Kn(i[0])}). Wait for it to become visible or check if a dialog/modal needs to be opened first.`);let a=r?`${r} "${n}"`:`"${n}"`,s=No(r);throw new Error(`No element found matching ${a}. `+(s?`Visible ${r||"element"}s: ${s}`:"The page may still be loading \u2014 try a wait command first."))}if(o.length>1){let i=o.filter(Ro),a=i.length===1?i[0]:o[0];t={element:a,matched:he(a)}}else t={element:o[0],matched:he(o[0])}}if(!t&&e.role&&!e.text){let n=e.role,r=wl(n);if(r.length===0){let o=No(n);throw new Error(`No visible element with role "${n}" found. `+(o?`Visible ${n}s: ${o}`:"The page may still be loading \u2014 try a wait command first."))}t={element:r[0],matched:he(r[0])}}if(!t&&e.label){let n=e.label,r=vl(n);if(!r){let o=[...document.querySelectorAll("label")].filter(Le).map(i=>`"${(i.textContent||"").trim().slice(0,40)}"`).slice(0,8).join(", ");throw new Error(`No input found with label "${n}". `+(o?`Visible labels: ${o}`:"No labels found on the page."))}t={element:r,matched:`${he(r)} via label "${n}"`}}if(!t&&e.selector){let n=e.selector,r=document.querySelector(n);if(!r)throw new Error(`No element found for selector "${n}".`);if(!Le(r))throw new Error(`Found element for selector "${n}" but it is hidden (${Kn(r)}).`);t={element:r,matched:`${he(r)} via selector "${n}"`}}if(!t)throw new Error("No targeting field provided (need ref, text, role, label, or selector)");return t}function Lo(e,t,n=!1){let r=[],o=e.toLowerCase();for(let i of document.querySelectorAll("*")){if(!n&&!Le(i)||n&&!i.isConnected||t&&ye(i)!==t)continue;if(Se(i).toLowerCase().includes(o)){r.push(i);continue}i.children.length||(i.textContent||"").trim().toLowerCase().includes(o)&&r.push(i)}return r}function wl(e){let t=[];for(let n of document.querySelectorAll("*"))Le(n)&&ye(n)===e&&t.push(n);return t}function vl(e){let t=e.toLowerCase();for(let n of document.querySelectorAll("label")){if(!(n.textContent||"").trim().toLowerCase().includes(t))continue;let o=n.getAttribute("for");if(o){let a=document.getElementById(o);if(a&&Le(a))return a}let i=n.querySelector("input, textarea, select");if(i&&Le(i))return i}return null}function Le(e){if(!e.isConnected)return!1;try{let t=getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1}catch{return!1}return!0}function Ro(e){if(e.matches('a, button, input, textarea, select, [role="button"], [role="link"], [tabindex]'))return!0;try{return getComputedStyle(e).cursor==="pointer"}catch{return!1}}function Kn(e){try{let t=getComputedStyle(e);if(t.display==="none")return"display: none";if(t.visibility==="hidden")return"visibility: hidden"}catch{}return e.getAttribute("aria-hidden")==="true"?'aria-hidden="true"':"hidden"}function No(e){let t=[];for(let n of document.querySelectorAll("*"))if(Le(n)&&(e?ye(n)===e&&t.push(n):Ro(n)&&t.push(n),t.length>=10))break;return t.length===0?"":t.map(n=>`"${Se(n).slice(0,40)||he(n)}"`).join(", ")}function Qn(e){let t=e.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,o={bubbles:!0,cancelable:!0,clientX:n,clientY:r,button:0};e.dispatchEvent(new PointerEvent("pointerdown",{...o,pointerId:1})),e.dispatchEvent(new MouseEvent("mousedown",o)),e instanceof HTMLElement&&e.focus(),e.dispatchEvent(new PointerEvent("pointerup",{...o,pointerId:1})),e.dispatchEvent(new MouseEvent("mouseup",o)),e.dispatchEvent(new MouseEvent("click",o))}var Cl=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set,Sl=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value")?.set;async function $o(e,t,n={}){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("type command requires an input or textarea element");e.focus(),Qn(e),n.clear&&(_o(e,""),e.dispatchEvent(new Event("input",{bubbles:!0})));for(let r=0;r<t.length;r++){let o=t[r];e.dispatchEvent(new KeyboardEvent("keydown",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keypress",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),_o(e,e.value+o),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keyup",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),await le(xl(o,t.length))}e.dispatchEvent(new Event("change",{bubbles:!0}))}function xl(e,t){let n=Math.random()*50-25,r;if(e===" "?r=120+n:/[.,!?;:\-]/.test(e)?r=140+n:/[A-Z]/.test(e)?r=115+n:r=85+n,t<=20)return r;let o=Math.max(.1,20/t);return r*o}function _o(e,t){let n=e instanceof HTMLTextAreaElement?Sl:Cl;n?n.call(e,t):e.value=t}async function Do(e){let t=e.timeout||5e3,n=Date.now(),r=n+t;for(;Date.now()<r;)try{return{...xe(e),elapsed:Date.now()-n}}catch{await le(100)}let o=e.text?`"${e.text}"`:e.role?`role "${e.role}"`:e.selector?`selector "${e.selector}"`:"element";throw new Error(`Timed out waiting for ${o} after ${t}ms`)}var Fo=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set;function Po(e,t){if(!(e instanceof HTMLSelectElement))throw new Error("select command requires a <select> element");let n=t.toLowerCase(),r=null;for(let o of e.options)if(o.text.toLowerCase().includes(n)||o.value.toLowerCase()===n||o.label.toLowerCase().includes(n)){r=o;break}if(!r){let o=[...e.options].map(i=>`"${i.text}"`).join(", ");throw new Error(`No option matching "${t}" in select. Available options: ${o}`)}return Fo?Fo.call(e,r.value):e.value=r.value,e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new Event("input",{bubbles:!0})),r.text}async function Wo(e){try{let t=e.trim(),r=/\breturn\b/.test(t)||/[;{]/.test(t)?e:`return (${e})`,o=(async()=>{}).constructor,i=new o(r);return yt(await i())}catch(t){throw new Error(`evaluate failed: ${t instanceof Error?t.message:String(t)}`)}}var Il=10,Ut=500,Vt=500,Jn=2e4,Oo=1e3;function yt(e,t=0,n=new WeakSet){if(e===null)return null;let r=typeof e;if(r==="string"){let i=e;return i.length>Jn?`${i.slice(0,Jn)}\u2026(+${i.length-Jn} chars)`:i}if(r==="number"||r==="boolean")return e;if(r==="undefined")return"[undefined]";if(r==="bigint")return`${e.toString()}n`;if(r==="symbol")return e.toString();if(r==="function"){let i=e.name;return i?`[Function: ${i}]`:"[Function]"}let o=e;if(typeof Element<"u"&&o instanceof Element){let i=o.outerHTML??"";return{__type:"Element",tag:o.tagName.toLowerCase(),id:o.id||void 0,class:o.getAttribute("class")||void 0,text:(o.textContent||"").trim().slice(0,200)||void 0,html:i.length>Oo?`${i.slice(0,Oo)}\u2026`:i}}if(typeof Node<"u"&&o instanceof Node)return{__type:"Node",nodeName:o.nodeName,text:(o.textContent||"").trim().slice(0,200)||void 0};if(o instanceof Error)return{__type:"Error",name:o.name,message:o.message,stack:o.stack};if(o instanceof Date)return o.toISOString();if(o instanceof RegExp)return o.toString();if(n.has(o))return"[Circular]";if(t>=Il)return"[Max depth]";n.add(o);try{if(Array.isArray(o)){let c=o.slice(0,Ut).map(l=>yt(l,t+1,n));return o.length>Ut&&c.push(`\u2026(+${o.length-Ut} more)`),c}if(o instanceof Map){let c={__type:"Map"},l=0;for(let[u,d]of o){if(l++>=Vt){c["\u2026"]=`(+${o.size-Vt} more)`;break}c[String(u)]=yt(d,t+1,n)}return c}if(o instanceof Set)return{__type:"Set",values:[...o].slice(0,Ut).map(c=>yt(c,t+1,n))};let i=Object.keys(o),a={},s=0;for(let c of i){if(s++>=Vt){a["\u2026"]=`(+${i.length-Vt} more)`;break}a[c]=yt(o[c],t+1,n)}return a}catch{return`[Unserializable: ${Object.prototype.toString.call(o)}]`}finally{n.delete(o)}}var Bo="__mindstudio-touch-circle",er="__mindstudio-touch-style",Ho=44,Uo=5,Vo=.95,Gt=.5,tr=.45,Go=600;function Al(){document.getElementById(Bo)?.remove();let e=document.createElement("div");return e.id=Bo,e.style.cssText=["position: fixed","z-index: 2147483647","pointer-events: none",`width: ${Ho}px`,`height: ${Ho}px`,"border-radius: 50%","background: rgba(255, 255, 255, 0.08)","border: 2px solid rgba(255, 255, 255, 0.85)","box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 0.5px rgba(0, 0, 0, 0.1)","backdrop-filter: blur(1px)","-webkit-backdrop-filter: blur(1.5px)","transform: translate(-50%, -50%) scale(1)","transition: transform 100ms ease, opacity 100ms ease, background 100ms ease","opacity: 0","will-change: left, top, transform, opacity"].join("; "),document.documentElement.appendChild(e),e}function kl(e){e.style.transform="translate(-50%, -50%) scale(0.88)",e.style.background="rgba(255, 255, 255, 0.18)"}function zo(e){e.style.transform="translate(-50%, -50%) scale(1)",e.style.background="rgba(255, 255, 255, 0.08)"}function Yo(){window.parent!==window&&x().zoom.mobilePreview&&bt()}function bt(){let e=x().touch;if(e.active)return;e.active=!0,e.scrollContainer=tt(),Nl();let t=Al();e.circleEl=t,e.onMouseMove=n=>{let r=x();if(r.cursor.executing||r.screenshot.capturing){t.style.opacity="0";return}if(t.style.left=`${n.clientX}px`,t.style.top=`${n.clientY}px`,t.style.opacity="1",e.pressed){let o=Math.abs(n.clientX-e.startX),i=Math.abs(n.clientY-e.startY);if(!e.dragging&&(o>Uo||i>Uo)&&(e.dragging=!0),e.dragging){let a=e.scrollContainer||document.documentElement,s=performance.now(),c=s-e.lastMoveTime||16,l=e.lastX-n.clientX,u=e.lastY-n.clientY;e.bouncing&&Ll();let d=a.scrollTop;a.scrollTop+=u,a.scrollLeft+=l;let m=a.scrollTop-d,p=u-m;if(Math.abs(p)>.5){let g=tr/(1+Math.abs(e.overscrollY)/200);e.overscrollY+=p*g,nr()}else if(e.overscrollY!==0){let g=tr/(1+Math.abs(e.overscrollY)/200);e.overscrollY+=p*g,(e.overscrollY>0&&u<0||e.overscrollY<0&&u>0)&&(e.overscrollY*=.7),nr()}e.velocityX=.8*(l/c)+.2*e.velocityX,e.velocityY=.8*(u/c)+.2*e.velocityY,e.lastMoveTime=s,n.preventDefault()}e.lastX=n.clientX,e.lastY=n.clientY}},e.onMouseDown=n=>{x().cursor.executing||(zt(),e.pressed=!0,e.dragging=!1,e.startX=n.clientX,e.startY=n.clientY,e.lastX=n.clientX,e.lastY=n.clientY,e.velocityX=0,e.velocityY=0,e.lastMoveTime=performance.now(),kl(t))},e.onMouseUp=()=>{let n=e.dragging;n&&document.addEventListener("click",Ml,{capture:!0,once:!0}),e.pressed=!1,e.dragging=!1,zo(t),n&&(e.overscrollY!==0&&Zo(),(Math.abs(e.velocityX)>Gt/16||Math.abs(e.velocityY)>Gt/16)&&Tl())},e.onMouseLeave=()=>{e.pressed=!1,e.dragging=!1,zt(),t.style.opacity="0",zo(t)},e.onDragStart=n=>n.preventDefault(),document.addEventListener("mousemove",e.onMouseMove),document.addEventListener("mousedown",e.onMouseDown),document.addEventListener("mouseup",e.onMouseUp),document.addEventListener("mouseleave",e.onMouseLeave),document.addEventListener("dragstart",e.onDragStart)}function Yt(){let e=x().touch;e.active&&(e.active=!1,e.pressed=!1,e.dragging=!1,zt(),e.overscrollY!==0&&(e.overscrollY=0,document.body.style.transition="",document.body.style.transform=""),Rl(),e.circleEl&&(e.circleEl.remove(),e.circleEl=null),e.onMouseMove&&document.removeEventListener("mousemove",e.onMouseMove),e.onMouseDown&&document.removeEventListener("mousedown",e.onMouseDown),e.onMouseUp&&document.removeEventListener("mouseup",e.onMouseUp),e.onMouseLeave&&document.removeEventListener("mouseleave",e.onMouseLeave),e.onDragStart&&document.removeEventListener("dragstart",e.onDragStart),e.onMouseMove=null,e.onMouseDown=null,e.onMouseUp=null,e.onMouseLeave=null,e.onDragStart=null)}function qo(){let{circleEl:e}=x().touch;e&&(e.style.opacity="0")}function jo(){let e=x().touch;e.active&&e.circleEl&&(e.circleEl.style.opacity="1")}function Ml(e){e.preventDefault(),e.stopPropagation()}function Tl(){zt();let e=x().touch,t=e.scrollContainer||document.documentElement,n=e.velocityX*16,r=e.velocityY*16;function o(){let i=x().touch;if(n*=Vo,r*=Vo,Math.abs(n)<Gt&&Math.abs(r)<Gt){i.momentumFrame=null,i.overscrollY!==0&&Zo();return}let a=t.scrollTop;t.scrollTop+=r,t.scrollLeft+=n;let s=t.scrollTop-a,c=r-s;if(Math.abs(c)>.5){let l=tr*.5/(1+Math.abs(i.overscrollY)/200);i.overscrollY+=c*l,nr(),r*=.7}i.momentumFrame=requestAnimationFrame(o)}e.momentumFrame=requestAnimationFrame(o)}function zt(){let e=x().touch;e.momentumFrame!==null&&(cancelAnimationFrame(e.momentumFrame),e.momentumFrame=null)}function nr(){let e=x().touch;document.body.style.transition="none",document.body.style.transform=`translateY(${-e.overscrollY}px)`}function Zo(){let e=x().touch;e.bouncing=!0,e.overscrollY=0,document.body.style.transition=`transform ${Go}ms cubic-bezier(0.2, 0.9, 0.3, 1)`,document.body.style.transform="",e.bounceTimer&&clearTimeout(e.bounceTimer),e.bounceTimer=setTimeout(()=>{let t=x().touch;t.bouncing=!1,t.bounceTimer=null,document.body.style.transition="",document.body.style.transform=""},Go)}function Ll(){let e=x().touch;e.bouncing&&(e.bouncing=!1,e.bounceTimer&&(clearTimeout(e.bounceTimer),e.bounceTimer=null),document.body.style.transition="")}function Nl(){document.getElementById(er)?.remove();let e=document.createElement("style");e.id=er,e.textContent=`
3
3
  *, *::before, *::after {
4
4
  cursor: none !important;
5
5
  user-select: none !important;
6
6
  -webkit-user-select: none !important;
7
7
  -webkit-user-drag: none !important;
8
8
  }
9
- `,document.head.appendChild(e)}function Al(){document.getElementById(Kn)?.remove()}var zo="__mindstudio-cursor",Ml="__mindstudio-cursor-ripple",qo=.07,kl=250,er=300,Tl=2e3,Gt=10,Yo=1,Zo="Remy",tt="#DD2590",Qn=44,Ll=`<svg width="40" height="41" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
9
+ `,document.head.appendChild(e)}function Rl(){document.getElementById(er)?.remove()}var Xo="__mindstudio-cursor",_l="__mindstudio-cursor-ripple",Ko=.07,Fl=250,or=300,Ol=2e3,qt=10,Jo=1,ei="Remy",nt="#DD2590",rr=44,$l=`<svg width="40" height="41" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
10
10
  <g filter="url(#filter0_d_4_78)">
11
- <path d="M12.5448 26L6.72762 5.59339L26 14.8132L17.1816 17.9377L12.5448 26Z" fill="${tt}"/>
12
- <path d="M6.9457 5.14539L26.2178 14.3651L27.2985 14.8826L26.1697 15.2813L17.5259 18.3444L12.9812 26.2464L12.3881 27.2792L12.0614 26.1349L6.24434 5.72851L5.94119 4.66488L6.9457 5.14539Z" stroke="${tt}"/>
11
+ <path d="M12.5448 26L6.72762 5.59339L26 14.8132L17.1816 17.9377L12.5448 26Z" fill="${nt}"/>
12
+ <path d="M6.9457 5.14539L26.2178 14.3651L27.2985 14.8826L26.1697 15.2813L17.5259 18.3444L12.9812 26.2464L12.3881 27.2792L12.0614 26.1349L6.24434 5.72851L5.94119 4.66488L6.9457 5.14539Z" stroke="${nt}"/>
13
13
  </g>
14
14
  <defs>
15
15
  <filter id="filter0_d_4_78" x="3.15491" y="2.73625" width="27.442" height="28.8217" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
@@ -23,13 +23,13 @@
23
23
  <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4_78" result="shape"/>
24
24
  </filter>
25
25
  </defs>
26
- </svg>`,Ko=`
27
- ${Ll}
26
+ </svg>`,ti=`
27
+ ${$l}
28
28
  <div style="
29
29
  position: absolute;
30
30
  left: 33px;
31
31
  top: 23px;
32
- background: ${tt};
32
+ background: ${nt};
33
33
  color: white;
34
34
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
35
35
  font-size: 12px;
@@ -40,13 +40,13 @@
40
40
  white-space: nowrap;
41
41
  letter-spacing: 0.3px;
42
42
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
43
- ">${Zo}</div>
44
- `,Xo=`
43
+ ">${ei}</div>
44
+ `,ni=`
45
45
  <div style="
46
- width: ${Qn}px;
47
- height: ${Qn}px;
46
+ width: ${rr}px;
47
+ height: ${rr}px;
48
48
  border-radius: 50%;
49
- border: 2px solid ${tt};
49
+ border: 2px solid ${nt};
50
50
  background: rgba(221, 37, 144, 0.08);
51
51
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
52
52
  transform: translate(-50%, -50%);
@@ -54,9 +54,9 @@
54
54
  <div style="
55
55
  position: absolute;
56
56
  left: 50%;
57
- top: ${Qn/2+6}px;
57
+ top: ${rr/2+6}px;
58
58
  transform: translateX(-50%);
59
- background: ${tt};
59
+ background: ${nt};
60
60
  color: white;
61
61
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
62
62
  font-size: 11px;
@@ -66,20 +66,20 @@
66
66
  border-radius: 4px;
67
67
  white-space: nowrap;
68
68
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
69
- ">${Zo}</div>
70
- `;function jo(e,t,n){return e+(t-e)*n}function Jo(){window.parent!==window&&tr()}function tr(){if(document.getElementById(zo))return;let e=x().cursor,t=x().zoom.mobilePreview,n=document.createElement("div");n.id=zo,n.innerHTML=t?Xo:Ko,n.style.cssText=["position: fixed","top: -100px","left: -100px","z-index: 2147483647","pointer-events: none","will-change: left, top, transform, opacity","opacity: 0"].join("; ");let r=document.createElement("div");r.id=Ml,r.style.cssText=["position: fixed","z-index: 2147483646","pointer-events: none","width: 0","height: 0","border-radius: 50%",`background: ${tt}`,"opacity: 0","transform: translate(-50%, -50%)","transition: width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out"].join("; "),document.documentElement.appendChild(r),document.documentElement.appendChild(n),e.el=n,e.rippleEl=r}function Nl(){x().cursor.trackingFrame===null&&Qo()}function nr(){let e=x().cursor;e.trackingFrame!==null&&(cancelAnimationFrame(e.trackingFrame),e.trackingFrame=null),e.targetElement=null}function Qo(){let e=x().cursor;if(e.el){if(e.targetElement&&e.targetElement.isConnected){let t=e.targetElement.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,o=window.innerWidth,i=window.innerHeight,a=Math.max(Gt,Math.min(n,o-Gt)),s=Math.max(Gt,Math.min(r,i-Gt));if(e.x=jo(e.x,a,qo),e.y=jo(e.y,s,qo),e.el.style.transition="none",e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,Math.abs(e.x-a)<Yo&&Math.abs(e.y-s)<Yo&&(e.x=a,e.y=s,e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,e.settledResolve)){let c=e.settledResolve;e.settledResolve=null,c()}}else if(e.targetElement&&!e.targetElement.isConnected){if(e.settledResolve){let t=e.settledResolve;e.settledResolve=null,t()}e.targetElement=null,e.trackingFrame=null;return}else if(!e.targetElement){e.trackingFrame=null;return}e.trackingFrame=requestAnimationFrame(Qo)}}async function zt(e){let t=x().cursor;if((!t.el||!t.el.isConnected)&&(t.el=null,t.rippleEl=null,t.hasPosition=!1,tr()),!!t.el){if(Ge(),t.settledResolve){let n=t.settledResolve;t.settledResolve=null,n()}if(t.targetElement=e,!t.hasPosition){let n=e.getBoundingClientRect(),r=n.left+n.width/2,o=n.top+n.height/2,i=Math.max(window.innerWidth,100),a=Math.max(window.innerHeight,100);Math.random()<.5?(t.x=i+20,t.y=o+(Math.random()-.5)*100):(t.x=r+(Math.random()-.5)*100,t.y=a+20),t.el.style.transition="none",t.el.style.left=`${t.x}px`,t.el.style.top=`${t.y}px`,t.el.style.opacity="0",t.el.offsetWidth,t.hasPosition=!0}return t.el.style.opacity="1",t.visibilityState="visible",Nl(),new Promise(n=>{t.settledResolve=n})}}async function ei(){let e=x().cursor;e.el&&(e.el.style.transform="scale(0.85) translateY(1px)",e.rippleEl&&(e.rippleEl.style.transition="none",e.rippleEl.style.left=`${e.x}px`,e.rippleEl.style.top=`${e.y}px`,e.rippleEl.style.width="0",e.rippleEl.style.height="0",e.rippleEl.style.opacity="0.35",e.rippleEl.offsetWidth,e.rippleEl.style.transition="width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out",e.rippleEl.style.width="40px",e.rippleEl.style.height="40px",e.rippleEl.style.opacity="0"),await le(kl),e.el&&(e.el.style.transform="scale(1) translateY(0)"),await le(100))}function Rl(e){return e==="visible"||e==="fading-in"||e==="fading-out"||e==="force-visible"}function Ve(e){let t=x().cursor;if(t.visibilityState=e,!(!t.el||!t.el.isConnected))switch(e){case"hidden":case"force-hidden":case"snapshot-hidden":t.el.style.transition="none",t.el.style.opacity="0",t.rippleEl&&(t.rippleEl.style.opacity="0");break;case"fading-in":t.el.style.transition=`opacity ${er}ms ease`,t.el.offsetWidth,t.el.style.opacity="1";break;case"visible":case"force-visible":t.el.style.opacity="1";break;case"fading-out":t.el.style.transition=`opacity ${er}ms ease`,t.el.style.opacity="0";break}}function Ge(){let e=x().cursor;e.hideTimer&&(clearTimeout(e.hideTimer),e.hideTimer=null)}function bt(e){x().cursor.executing=e,e?Uo():Vo()}function rr(){Ge()}function qt(){let e=x().cursor;e.el&&e.visibilityState!=="force-visible"&&(e.targetElement=null,Ge(),e.hideTimer=setTimeout(()=>{e.visibilityState!=="force-visible"&&(Ve("fading-out"),e.hideTimer=setTimeout(()=>{e.visibilityState==="fading-out"&&(Ve("hidden"),nr()),e.hideTimer=null},er))},Tl))}function or(){let e=x().cursor;e.el&&(Ge(),nr(),e.visibilityState!=="force-hidden"&&e.visibilityState!=="snapshot-hidden"&&(e.el.isConnected&&(e.el.style.transition="none"),Ve("visible")))}function ti(){let e=x().cursor;e.visibilityState!=="snapshot-hidden"&&(Ge(),e.preSnapshotState=e.visibilityState,Ve("snapshot-hidden"))}function ni(){let e=x().cursor,t=e.preSnapshotState;e.preSnapshotState=null,!(!e.el||!t||!Rl(t))&&Ve(t==="fading-in"?"fading-in":"visible")}function ir(e){let t=x().cursor;t.el&&(t.el.innerHTML=e?Xo:Ko)}function Yt(e){let t=x().cursor;t.executing||(e==="visible"&&!t.el&&tr(),t.el&&(e==="visible"?(Ge(),t.hasPosition?Ve("force-visible"):t.visibilityState="force-visible"):e==="hidden"?(Ge(),Ve("force-hidden"),nr()):qt()))}var ae;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(ae||(ae={}));function _l(e){return e.nodeType===e.ELEMENT_NODE}function je(e){var t=e?.host;return t?.shadowRoot===e}function qe(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Fl(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function ar(e){try{var t=e.rules||e.cssRules;return t?Fl(Array.from(t).map(sr).join("")):null}catch{return null}}function sr(e){var t=e.cssText;if(Ol(e))try{t=ar(e.styleSheet)||t}catch{}return t}function Ol(e){return"styleSheet"in e}var ai=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){var r=this.getNode(t);if(r){var o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();function si(){return new ai}function vt(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(i?a=i(a):a="*".repeat(a.length)),a}var oi="__rrweb_original__";function $l(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,a=oi in i?i[oi]:i,s=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(s.some(function(c){return c!==0}))return!1}return!0}var Dl=1,Pl=new RegExp("[^a-z0-9-_:]"),Ye=-2;function lr(){return Dl++}function Wl(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Pl.test(t)?"div":t}function Bl(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function Hl(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var nt,ii,Ul=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Vl=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Gl=/^(data:)([^,]*),(.*)/i;function jt(e,t){return(e||"").replace(Ul,function(n,r,o,i,a,s){var c=o||a||s,l=r||i||"";if(!c)return n;if(!Vl.test(c)||Gl.test(c))return"url(".concat(l).concat(c).concat(l,")");if(c[0]==="/")return"url(".concat(l).concat(Hl(t)+c).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var f=0,m=d;f<m.length;f++){var p=m[f];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(l).concat(u.join("/")).concat(l,")")})}var zl=/^[^ \t\n\r\u000c]+/,ql=/^[, \t\n\r\u000c]+/;function Yl(e,t){if(t.trim()==="")return t;var n=0;function r(l){var u,d=l.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(ql),!(n>=t.length);){var i=r(zl);if(i.slice(-1)===",")i=rt(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=rt(e,i);for(var s=!1;;){var c=t.charAt(n);if(c===""){o.push((i+a).trim());break}else if(s)c===")"&&(s=!1);else if(c===","){n+=1,o.push((i+a).trim());break}else c==="("&&(s=!0);a+=c,n+=1}}}return o.join(", ")}function rt(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function jl(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function cr(){var e=document.createElement("a");return e.href="",e.href}function ur(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?rt(e,r):n==="srcset"&&r?Yl(e,r):n==="style"&&r?jt(r,cr()):t==="object"&&n==="data"&&r?rt(e,r):r}function Zl(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function wt(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?wt(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?wt(e.parentNode,t,n):!1}function dr(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(wt(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function Kl(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Xl(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function Jl(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=l===void 0?{}:l,d=t.maskTextFn,f=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,g=t.inlineImages,h=t.recordCanvas,y=t.keepIframeSrcFn,v=t.newlyAddedElement,b=v===void 0?!1:v,w=Ql(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ae.Document,childNodes:[],compatMode:e.compatMode}:{type:ae.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ae.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return tc(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:f,dataURLOptions:p,inlineImages:g,recordCanvas:h,keepIframeSrcFn:y,newlyAddedElement:b,rootId:w});case e.TEXT_NODE:return ec(e,{maskTextClass:a,maskTextSelector:s,maskTextFn:d,rootId:w});case e.CDATA_SECTION_NODE:return{type:ae.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:ae.Comment,textContent:e.textContent||"",rootId:w};default:return!1}}function Ql(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function ec(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.rootId,s=e.parentNode&&e.parentNode.tagName,c=e.textContent,l=s==="STYLE"?!0:void 0,u=s==="SCRIPT"?!0:void 0;if(l&&c){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(c=Bl(e.parentNode.sheet))}catch(d){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d),e)}c=jt(c,cr())}return u&&(c="SCRIPT_PLACEHOLDER"),!l&&!u&&c&&dr(e,r,o)&&(c=i?i(c):c.replace(/[\S]/g,"*")),{type:ae.Text,textContent:c||"",isStyle:l,rootId:a}}function tc(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,s=a===void 0?{}:a,c=t.maskInputFn,l=t.dataURLOptions,u=l===void 0?{}:l,d=t.inlineImages,f=t.recordCanvas,m=t.keepIframeSrcFn,p=t.newlyAddedElement,g=p===void 0?!1:p,h=t.rootId,y=Zl(e,r,o),v=Wl(e),b={},w=e.attributes.length,S=0;S<w;S++){var I=e.attributes[S];b[I.name]=ur(n,v,I.name,I.value)}if(v==="link"&&i){var C=Array.from(n.styleSheets).find(function(F){return F.href===e.href}),E=null;C&&(E=ar(C)),E&&(delete b.rel,delete b.href,b._cssText=jt(E,C.href))}if(v==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var E=ar(e.sheet);E&&(b._cssText=jt(E,cr()))}if(v==="input"||v==="textarea"||v==="select"){var k=e.value,O=e.checked;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&k?b.value=vt({type:b.type,tagName:v,value:k,maskInputOptions:s,maskInputFn:c}):O&&(b.checked=O)}if(v==="option"&&(e.selected&&!s.select?b.selected=!0:delete b.selected),v==="canvas"&&f){if(e.__context==="2d")$l(e)||(b.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var D=e.toDataURL(u.type,u.quality),T=document.createElement("canvas");T.width=e.width,T.height=e.height;var M=T.toDataURL(u.type,u.quality);D!==M&&(b.rr_dataURL=D)}}if(v==="img"&&d){nt||(nt=n.createElement("canvas"),ii=nt.getContext("2d"));var W=e,G=W.crossOrigin;W.crossOrigin="anonymous";var re=function(){try{nt.width=W.naturalWidth,nt.height=W.naturalHeight,ii.drawImage(W,0,0),b.rr_dataURL=nt.toDataURL(u.type,u.quality)}catch(F){console.warn("Cannot inline img src=".concat(W.currentSrc,"! Error: ").concat(F))}G?b.crossOrigin=G:W.removeAttribute("crossorigin")};W.complete&&W.naturalWidth!==0?re():W.onload=re}if((v==="audio"||v==="video")&&(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime),g||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),y){var L=e.getBoundingClientRect(),$=L.width,_=L.height;b={class:b.class,rr_width:"".concat($,"px"),rr_height:"".concat(_,"px")}}return v==="iframe"&&!m(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src),{type:ae.Element,tagName:v,attributes:b,childNodes:[],isSVG:jl(e)||void 0,needBlock:y,rootId:h}}function K(e){return e===void 0?"":e.toLowerCase()}function nc(e,t){if(t.comment&&e.type===ae.Comment)return!0;if(e.type===ae.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(K(e.attributes.name).match(/^msapplication-tile(image|color)$/)||K(e.attributes.name)==="application-name"||K(e.attributes.rel)==="icon"||K(e.attributes.rel)==="apple-touch-icon"||K(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&K(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(K(e.attributes.property).match(/^(og|twitter|fb):/)||K(e.attributes.name).match(/^(og|twitter):/)||K(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(K(e.attributes.name)==="robots"||K(e.attributes.name)==="googlebot"||K(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(K(e.attributes.name)==="author"||K(e.attributes.name)==="generator"||K(e.attributes.name)==="framework"||K(e.attributes.name)==="publisher"||K(e.attributes.name)==="progid"||K(e.attributes.property).match(/^article:/)||K(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(K(e.attributes.name)==="google-site-verification"||K(e.attributes.name)==="yandex-verification"||K(e.attributes.name)==="csrf-token"||K(e.attributes.name)==="p:domain_verify"||K(e.attributes.name)==="verify-v1"||K(e.attributes.name)==="verification"||K(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function ze(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,c=t.skipChild,l=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,f=t.maskInputOptions,m=f===void 0?{}:f,p=t.maskTextFn,g=t.maskInputFn,h=t.slimDOMOptions,y=t.dataURLOptions,v=y===void 0?{}:y,b=t.inlineImages,w=b===void 0?!1:b,S=t.recordCanvas,I=S===void 0?!1:S,C=t.onSerialize,E=t.onIframeLoad,k=t.iframeLoadTimeout,O=k===void 0?5e3:k,D=t.onStylesheetLoad,T=t.stylesheetLoadTimeout,M=T===void 0?5e3:T,W=t.keepIframeSrcFn,G=W===void 0?function(){return!1}:W,re=t.newlyAddedElement,L=re===void 0?!1:re,$=t.preserveWhiteSpace,_=$===void 0?!0:$,F=Jl(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,dataURLOptions:v,inlineImages:w,recordCanvas:I,keepIframeSrcFn:G,newlyAddedElement:L});if(!F)return console.warn(e,"not serialized"),null;var z;r.hasNode(e)?z=r.getId(e):nc(F,h)||!_&&F.type===ae.Text&&!F.isStyle&&!F.textContent.replace(/^\s+|\s+$/gm,"").length?z=Ye:z=lr();var B=Object.assign(F,{id:z});if(r.add(e,B),z===Ye)return null;C&&C(e);var Y=!l;if(B.type===ae.Element){Y=Y&&!B.needBlock,delete B.needBlock;var j=e.shadowRoot;j&&qe(j)&&(B.isShadowHost=!0)}if((B.type===ae.Document||B.type===ae.Element)&&Y){h.headWhitespace&&B.type===ae.Element&&B.tagName==="head"&&(_=!1);for(var ee={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:w,recordCanvas:I,preserveWhiteSpace:_,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:O,onStylesheetLoad:D,stylesheetLoadTimeout:M,keepIframeSrcFn:G},N=0,J=Array.from(e.childNodes);N<J.length;N++){var Z=J[N],U=ze(Z,ee);U&&B.childNodes.push(U)}if(_l(e)&&e.shadowRoot)for(var ie=0,V=Array.from(e.shadowRoot.childNodes);ie<V.length;ie++){var Z=V[ie],U=ze(Z,ee);U&&(qe(e.shadowRoot)&&(U.isShadow=!0),B.childNodes.push(U))}}return e.parentNode&&je(e.parentNode)&&qe(e.parentNode)&&(B.isShadow=!0),B.type===ae.Element&&B.tagName==="iframe"&&Kl(e,function(){var se=e.contentDocument;if(se&&E){var We=ze(se,{doc:se,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:w,recordCanvas:I,preserveWhiteSpace:_,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:O,onStylesheetLoad:D,stylesheetLoadTimeout:M,keepIframeSrcFn:G});We&&E(e,We)}},O),B.type===ae.Element&&B.tagName==="link"&&B.attributes.rel==="stylesheet"&&Xl(e,function(){if(D){var se=ze(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:w,recordCanvas:I,preserveWhiteSpace:_,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:O,onStylesheetLoad:D,stylesheetLoadTimeout:M,keepIframeSrcFn:G});se&&D(e,se)}},M),B}function li(e,t){var n=t||{},r=n.mirror,o=r===void 0?new ai:r,i=n.blockClass,a=i===void 0?"rr-block":i,s=n.blockSelector,c=s===void 0?null:s,l=n.maskTextClass,u=l===void 0?"rr-mask":l,d=n.maskTextSelector,f=d===void 0?null:d,m=n.inlineStylesheet,p=m===void 0?!0:m,g=n.inlineImages,h=g===void 0?!1:g,y=n.recordCanvas,v=y===void 0?!1:y,b=n.maskAllInputs,w=b===void 0?!1:b,S=n.maskTextFn,I=n.maskInputFn,C=n.slimDOM,E=C===void 0?!1:C,k=n.dataURLOptions,O=n.preserveWhiteSpace,D=n.onSerialize,T=n.onIframeLoad,M=n.iframeLoadTimeout,W=n.onStylesheetLoad,G=n.stylesheetLoadTimeout,re=n.keepIframeSrcFn,L=re===void 0?function(){return!1}:re,$=w===!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}:w===!1?{password:!0}:w,_=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:E==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:E===!1?{}:E;return ze(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:f,skipChild:!1,inlineStylesheet:p,maskInputOptions:$,maskTextFn:S,maskInputFn:I,slimDOMOptions:_,dataURLOptions:k,inlineImages:h,recordCanvas:v,preserveWhiteSpace:O,onSerialize:D,onIframeLoad:T,iframeLoadTimeout:M,onStylesheetLoad:W,stylesheetLoadTimeout:G,keepIframeSrcFn:L,newlyAddedElement:!1})}var rc=/([^\\]):hover/,xp=new RegExp(rc.source,"g");function ce(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var ot=`Please stop import mirror directly. Instead of that,\r
69
+ ">${ei}</div>
70
+ `;function Qo(e,t,n){return e+(t-e)*n}function ri(){window.parent!==window&&ir()}function ir(){if(document.getElementById(Xo))return;let e=x().cursor,t=x().zoom.mobilePreview,n=document.createElement("div");n.id=Xo,n.innerHTML=t?ni:ti,n.style.cssText=["position: fixed","top: -100px","left: -100px","z-index: 2147483647","pointer-events: none","will-change: left, top, transform, opacity","opacity: 0"].join("; ");let r=document.createElement("div");r.id=_l,r.style.cssText=["position: fixed","z-index: 2147483646","pointer-events: none","width: 0","height: 0","border-radius: 50%",`background: ${nt}`,"opacity: 0","transform: translate(-50%, -50%)","transition: width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out"].join("; "),document.documentElement.appendChild(r),document.documentElement.appendChild(n),e.el=n,e.rippleEl=r}function Dl(){x().cursor.trackingFrame===null&&oi()}function ar(){let e=x().cursor;e.trackingFrame!==null&&(cancelAnimationFrame(e.trackingFrame),e.trackingFrame=null),e.targetElement=null}function oi(){let e=x().cursor;if(e.el){if(e.targetElement&&e.targetElement.isConnected){let t=e.targetElement.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,o=window.innerWidth,i=window.innerHeight,a=Math.max(qt,Math.min(n,o-qt)),s=Math.max(qt,Math.min(r,i-qt));if(e.x=Qo(e.x,a,Ko),e.y=Qo(e.y,s,Ko),e.el.style.transition="none",e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,Math.abs(e.x-a)<Jo&&Math.abs(e.y-s)<Jo&&(e.x=a,e.y=s,e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,e.settledResolve)){let c=e.settledResolve;e.settledResolve=null,c()}}else if(e.targetElement&&!e.targetElement.isConnected){if(e.settledResolve){let t=e.settledResolve;e.settledResolve=null,t()}e.targetElement=null,e.trackingFrame=null;return}else if(!e.targetElement){e.trackingFrame=null;return}e.trackingFrame=requestAnimationFrame(oi)}}async function jt(e){let t=x().cursor;if((!t.el||!t.el.isConnected)&&(t.el=null,t.rippleEl=null,t.hasPosition=!1,ir()),!!t.el){if(Ge(),t.settledResolve){let n=t.settledResolve;t.settledResolve=null,n()}if(t.targetElement=e,!t.hasPosition){let n=e.getBoundingClientRect(),r=n.left+n.width/2,o=n.top+n.height/2,i=Math.max(window.innerWidth,100),a=Math.max(window.innerHeight,100);Math.random()<.5?(t.x=i+20,t.y=o+(Math.random()-.5)*100):(t.x=r+(Math.random()-.5)*100,t.y=a+20),t.el.style.transition="none",t.el.style.left=`${t.x}px`,t.el.style.top=`${t.y}px`,t.el.style.opacity="0",t.el.offsetWidth,t.hasPosition=!0}return t.el.style.opacity="1",t.visibilityState="visible",Dl(),new Promise(n=>{t.settledResolve=n})}}async function ii(){let e=x().cursor;e.el&&(e.el.style.transform="scale(0.85) translateY(1px)",e.rippleEl&&(e.rippleEl.style.transition="none",e.rippleEl.style.left=`${e.x}px`,e.rippleEl.style.top=`${e.y}px`,e.rippleEl.style.width="0",e.rippleEl.style.height="0",e.rippleEl.style.opacity="0.35",e.rippleEl.offsetWidth,e.rippleEl.style.transition="width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out",e.rippleEl.style.width="40px",e.rippleEl.style.height="40px",e.rippleEl.style.opacity="0"),await le(Fl),e.el&&(e.el.style.transform="scale(1) translateY(0)"),await le(100))}function Pl(e){return e==="visible"||e==="fading-in"||e==="fading-out"||e==="force-visible"}function Ve(e){let t=x().cursor;if(t.visibilityState=e,!(!t.el||!t.el.isConnected))switch(e){case"hidden":case"force-hidden":case"snapshot-hidden":t.el.style.transition="none",t.el.style.opacity="0",t.rippleEl&&(t.rippleEl.style.opacity="0");break;case"fading-in":t.el.style.transition=`opacity ${or}ms ease`,t.el.offsetWidth,t.el.style.opacity="1";break;case"visible":case"force-visible":t.el.style.opacity="1";break;case"fading-out":t.el.style.transition=`opacity ${or}ms ease`,t.el.style.opacity="0";break}}function Ge(){let e=x().cursor;e.hideTimer&&(clearTimeout(e.hideTimer),e.hideTimer=null)}function wt(e){x().cursor.executing=e,e?qo():jo()}function sr(){Ge()}function Zt(){let e=x().cursor;e.el&&e.visibilityState!=="force-visible"&&(e.targetElement=null,Ge(),e.hideTimer=setTimeout(()=>{e.visibilityState!=="force-visible"&&(Ve("fading-out"),e.hideTimer=setTimeout(()=>{e.visibilityState==="fading-out"&&(Ve("hidden"),ar()),e.hideTimer=null},or))},Ol))}function lr(){let e=x().cursor;e.el&&(Ge(),ar(),e.visibilityState!=="force-hidden"&&e.visibilityState!=="snapshot-hidden"&&(e.el.isConnected&&(e.el.style.transition="none"),Ve("visible")))}function ai(){let e=x().cursor;e.visibilityState!=="snapshot-hidden"&&(Ge(),e.preSnapshotState=e.visibilityState,Ve("snapshot-hidden"))}function si(){let e=x().cursor,t=e.preSnapshotState;e.preSnapshotState=null,!(!e.el||!t||!Pl(t))&&Ve(t==="fading-in"?"fading-in":"visible")}function cr(e){let t=x().cursor;t.el&&(t.el.innerHTML=e?ni:ti)}function Xt(e){let t=x().cursor;t.executing||(e==="visible"&&!t.el&&ir(),t.el&&(e==="visible"?(Ge(),t.hasPosition?Ve("force-visible"):t.visibilityState="force-visible"):e==="hidden"?(Ge(),Ve("force-hidden"),ar()):Zt()))}var ae;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(ae||(ae={}));function Wl(e){return e.nodeType===e.ELEMENT_NODE}function je(e){var t=e?.host;return t?.shadowRoot===e}function Ye(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Bl(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function ur(e){try{var t=e.rules||e.cssRules;return t?Bl(Array.from(t).map(dr).join("")):null}catch{return null}}function dr(e){var t=e.cssText;if(Hl(e))try{t=ur(e.styleSheet)||t}catch{}return t}function Hl(e){return"styleSheet"in e}var di=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){var r=this.getNode(t);if(r){var o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();function fi(){return new di}function Ct(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(i?a=i(a):a="*".repeat(a.length)),a}var ci="__rrweb_original__";function Ul(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,a=ci in i?i[ci]:i,s=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(s.some(function(c){return c!==0}))return!1}return!0}var Vl=1,Gl=new RegExp("[^a-z0-9-_:]"),qe=-2;function fr(){return Vl++}function zl(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Gl.test(t)?"div":t}function Yl(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ql(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var rt,ui,jl=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Zl=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Xl=/^(data:)([^,]*),(.*)/i;function Kt(e,t){return(e||"").replace(jl,function(n,r,o,i,a,s){var c=o||a||s,l=r||i||"";if(!c)return n;if(!Zl.test(c)||Xl.test(c))return"url(".concat(l).concat(c).concat(l,")");if(c[0]==="/")return"url(".concat(l).concat(ql(t)+c).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var f=0,m=d;f<m.length;f++){var p=m[f];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(l).concat(u.join("/")).concat(l,")")})}var Kl=/^[^ \t\n\r\u000c]+/,Jl=/^[, \t\n\r\u000c]+/;function Ql(e,t){if(t.trim()==="")return t;var n=0;function r(l){var u,d=l.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(Jl),!(n>=t.length);){var i=r(Kl);if(i.slice(-1)===",")i=ot(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=ot(e,i);for(var s=!1;;){var c=t.charAt(n);if(c===""){o.push((i+a).trim());break}else if(s)c===")"&&(s=!1);else if(c===","){n+=1,o.push((i+a).trim());break}else c==="("&&(s=!0);a+=c,n+=1}}}return o.join(", ")}function ot(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function ec(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function mr(){var e=document.createElement("a");return e.href="",e.href}function pr(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?ot(e,r):n==="srcset"&&r?Ql(e,r):n==="style"&&r?Kt(r,mr()):t==="object"&&n==="data"&&r?ot(e,r):r}function tc(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function vt(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?vt(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?vt(e.parentNode,t,n):!1}function hr(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(vt(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function nc(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function rc(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function oc(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=l===void 0?{}:l,d=t.maskTextFn,f=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,g=t.inlineImages,h=t.recordCanvas,y=t.keepIframeSrcFn,v=t.newlyAddedElement,b=v===void 0?!1:v,w=ic(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ae.Document,childNodes:[],compatMode:e.compatMode}:{type:ae.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ae.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return sc(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:f,dataURLOptions:p,inlineImages:g,recordCanvas:h,keepIframeSrcFn:y,newlyAddedElement:b,rootId:w});case e.TEXT_NODE:return ac(e,{maskTextClass:a,maskTextSelector:s,maskTextFn:d,rootId:w});case e.CDATA_SECTION_NODE:return{type:ae.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:ae.Comment,textContent:e.textContent||"",rootId:w};default:return!1}}function ic(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function ac(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.rootId,s=e.parentNode&&e.parentNode.tagName,c=e.textContent,l=s==="STYLE"?!0:void 0,u=s==="SCRIPT"?!0:void 0;if(l&&c){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(c=Yl(e.parentNode.sheet))}catch(d){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d),e)}c=Kt(c,mr())}return u&&(c="SCRIPT_PLACEHOLDER"),!l&&!u&&c&&hr(e,r,o)&&(c=i?i(c):c.replace(/[\S]/g,"*")),{type:ae.Text,textContent:c||"",isStyle:l,rootId:a}}function sc(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,s=a===void 0?{}:a,c=t.maskInputFn,l=t.dataURLOptions,u=l===void 0?{}:l,d=t.inlineImages,f=t.recordCanvas,m=t.keepIframeSrcFn,p=t.newlyAddedElement,g=p===void 0?!1:p,h=t.rootId,y=tc(e,r,o),v=zl(e),b={},w=e.attributes.length,S=0;S<w;S++){var I=e.attributes[S];b[I.name]=pr(n,v,I.name,I.value)}if(v==="link"&&i){var C=Array.from(n.styleSheets).find(function(F){return F.href===e.href}),E=null;C&&(E=ur(C)),E&&(delete b.rel,delete b.href,b._cssText=Kt(E,C.href))}if(v==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var E=ur(e.sheet);E&&(b._cssText=Kt(E,mr()))}if(v==="input"||v==="textarea"||v==="select"){var M=e.value,O=e.checked;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&M?b.value=Ct({type:b.type,tagName:v,value:M,maskInputOptions:s,maskInputFn:c}):O&&(b.checked=O)}if(v==="option"&&(e.selected&&!s.select?b.selected=!0:delete b.selected),v==="canvas"&&f){if(e.__context==="2d")Ul(e)||(b.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var D=e.toDataURL(u.type,u.quality),T=document.createElement("canvas");T.width=e.width,T.height=e.height;var k=T.toDataURL(u.type,u.quality);D!==k&&(b.rr_dataURL=D)}}if(v==="img"&&d){rt||(rt=n.createElement("canvas"),ui=rt.getContext("2d"));var W=e,G=W.crossOrigin;W.crossOrigin="anonymous";var re=function(){try{rt.width=W.naturalWidth,rt.height=W.naturalHeight,ui.drawImage(W,0,0),b.rr_dataURL=rt.toDataURL(u.type,u.quality)}catch(F){console.warn("Cannot inline img src=".concat(W.currentSrc,"! Error: ").concat(F))}G?b.crossOrigin=G:W.removeAttribute("crossorigin")};W.complete&&W.naturalWidth!==0?re():W.onload=re}if((v==="audio"||v==="video")&&(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime),g||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),y){var L=e.getBoundingClientRect(),$=L.width,_=L.height;b={class:b.class,rr_width:"".concat($,"px"),rr_height:"".concat(_,"px")}}return v==="iframe"&&!m(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src),{type:ae.Element,tagName:v,attributes:b,childNodes:[],isSVG:ec(e)||void 0,needBlock:y,rootId:h}}function X(e){return e===void 0?"":e.toLowerCase()}function lc(e,t){if(t.comment&&e.type===ae.Comment)return!0;if(e.type===ae.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(X(e.attributes.name).match(/^msapplication-tile(image|color)$/)||X(e.attributes.name)==="application-name"||X(e.attributes.rel)==="icon"||X(e.attributes.rel)==="apple-touch-icon"||X(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&X(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(X(e.attributes.property).match(/^(og|twitter|fb):/)||X(e.attributes.name).match(/^(og|twitter):/)||X(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(X(e.attributes.name)==="robots"||X(e.attributes.name)==="googlebot"||X(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(X(e.attributes.name)==="author"||X(e.attributes.name)==="generator"||X(e.attributes.name)==="framework"||X(e.attributes.name)==="publisher"||X(e.attributes.name)==="progid"||X(e.attributes.property).match(/^article:/)||X(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(X(e.attributes.name)==="google-site-verification"||X(e.attributes.name)==="yandex-verification"||X(e.attributes.name)==="csrf-token"||X(e.attributes.name)==="p:domain_verify"||X(e.attributes.name)==="verify-v1"||X(e.attributes.name)==="verification"||X(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function ze(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,c=t.skipChild,l=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,f=t.maskInputOptions,m=f===void 0?{}:f,p=t.maskTextFn,g=t.maskInputFn,h=t.slimDOMOptions,y=t.dataURLOptions,v=y===void 0?{}:y,b=t.inlineImages,w=b===void 0?!1:b,S=t.recordCanvas,I=S===void 0?!1:S,C=t.onSerialize,E=t.onIframeLoad,M=t.iframeLoadTimeout,O=M===void 0?5e3:M,D=t.onStylesheetLoad,T=t.stylesheetLoadTimeout,k=T===void 0?5e3:T,W=t.keepIframeSrcFn,G=W===void 0?function(){return!1}:W,re=t.newlyAddedElement,L=re===void 0?!1:re,$=t.preserveWhiteSpace,_=$===void 0?!0:$,F=oc(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,dataURLOptions:v,inlineImages:w,recordCanvas:I,keepIframeSrcFn:G,newlyAddedElement:L});if(!F)return console.warn(e,"not serialized"),null;var z;r.hasNode(e)?z=r.getId(e):lc(F,h)||!_&&F.type===ae.Text&&!F.isStyle&&!F.textContent.replace(/^\s+|\s+$/gm,"").length?z=qe:z=fr();var B=Object.assign(F,{id:z});if(r.add(e,B),z===qe)return null;C&&C(e);var q=!l;if(B.type===ae.Element){q=q&&!B.needBlock,delete B.needBlock;var j=e.shadowRoot;j&&Ye(j)&&(B.isShadowHost=!0)}if((B.type===ae.Document||B.type===ae.Element)&&q){h.headWhitespace&&B.type===ae.Element&&B.tagName==="head"&&(_=!1);for(var ee={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:w,recordCanvas:I,preserveWhiteSpace:_,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:O,onStylesheetLoad:D,stylesheetLoadTimeout:k,keepIframeSrcFn:G},N=0,J=Array.from(e.childNodes);N<J.length;N++){var Z=J[N],U=ze(Z,ee);U&&B.childNodes.push(U)}if(Wl(e)&&e.shadowRoot)for(var ie=0,V=Array.from(e.shadowRoot.childNodes);ie<V.length;ie++){var Z=V[ie],U=ze(Z,ee);U&&(Ye(e.shadowRoot)&&(U.isShadow=!0),B.childNodes.push(U))}}return e.parentNode&&je(e.parentNode)&&Ye(e.parentNode)&&(B.isShadow=!0),B.type===ae.Element&&B.tagName==="iframe"&&nc(e,function(){var se=e.contentDocument;if(se&&E){var We=ze(se,{doc:se,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:w,recordCanvas:I,preserveWhiteSpace:_,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:O,onStylesheetLoad:D,stylesheetLoadTimeout:k,keepIframeSrcFn:G});We&&E(e,We)}},O),B.type===ae.Element&&B.tagName==="link"&&B.attributes.rel==="stylesheet"&&rc(e,function(){if(D){var se=ze(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:w,recordCanvas:I,preserveWhiteSpace:_,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:O,onStylesheetLoad:D,stylesheetLoadTimeout:k,keepIframeSrcFn:G});se&&D(e,se)}},k),B}function mi(e,t){var n=t||{},r=n.mirror,o=r===void 0?new di:r,i=n.blockClass,a=i===void 0?"rr-block":i,s=n.blockSelector,c=s===void 0?null:s,l=n.maskTextClass,u=l===void 0?"rr-mask":l,d=n.maskTextSelector,f=d===void 0?null:d,m=n.inlineStylesheet,p=m===void 0?!0:m,g=n.inlineImages,h=g===void 0?!1:g,y=n.recordCanvas,v=y===void 0?!1:y,b=n.maskAllInputs,w=b===void 0?!1:b,S=n.maskTextFn,I=n.maskInputFn,C=n.slimDOM,E=C===void 0?!1:C,M=n.dataURLOptions,O=n.preserveWhiteSpace,D=n.onSerialize,T=n.onIframeLoad,k=n.iframeLoadTimeout,W=n.onStylesheetLoad,G=n.stylesheetLoadTimeout,re=n.keepIframeSrcFn,L=re===void 0?function(){return!1}:re,$=w===!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}:w===!1?{password:!0}:w,_=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:E==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:E===!1?{}:E;return ze(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:f,skipChild:!1,inlineStylesheet:p,maskInputOptions:$,maskTextFn:S,maskInputFn:I,slimDOMOptions:_,dataURLOptions:M,inlineImages:h,recordCanvas:v,preserveWhiteSpace:O,onSerialize:D,onIframeLoad:T,iframeLoadTimeout:k,onStylesheetLoad:W,stylesheetLoadTimeout:G,keepIframeSrcFn:L,newlyAddedElement:!1})}var cc=/([^\\]):hover/,Tp=new RegExp(cc.source,"g");function ce(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var it=`Please stop import mirror directly. Instead of that,\r
71
71
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
72
- or you can use record.mirror to access the mirror instance during recording.`,ci={map:{},getId(){return console.error(ot),-1},getNode(){return console.error(ot),null},removeNodeFromMap(){console.error(ot)},has(){return console.error(ot),!1},reset(){console.error(ot)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ci=new Proxy(ci,{get(e,t,n){return t==="map"&&console.error(ot),Reflect.get(e,t,n)}}));function it(e,t,n={}){let r=null,o=0;return function(...i){let a=Date.now();!o&&n.leading===!1&&(o=a);let s=t-(a-o),c=this;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},s))}}function Ze(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Ze(e,t,i||{},!0)}function be(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function Kt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Xt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function te(e,t,n,r){if(!e)return!1;let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if(typeof t=="string"){if(o.classList.contains(t)||r&&o.closest("."+t)!==null)return!0}else if(wt(o,t,r))return!0;return!!(n&&(e.matches(n)||r&&o.closest(n)!==null))}function ui(e,t){return t.getId(e)!==-1}function Jt(e,t){return t.getId(e)===Ye}function fr(e,t){if(je(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?fr(e.parentNode,t):!0:!0}function mr(e){return!!e.changedTouches}function di(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Qt(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function en(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function tn(e){return!!e?.shadowRoot}var Zt=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var n;return(n=this.styleIDMap.get(t))!==null&&n!==void 0?n:-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};var H=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(H||{}),P=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(P||{}),nn=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(nn||{}),Ne=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ne||{});function fi(e){return"__ln"in e}var pr=class{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&fi(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&fi(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}},mi=(e,t)=>`${e}@${t}`,rn=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],n=new pr,r=s=>{let c=s,l=Ye;for(;l===Ye;)c=c&&c.nextSibling,l=c&&this.mirror.getId(c);return l},o=s=>{var c,l,u,d;let f=null;((l=(c=s.getRootNode)===null||c===void 0?void 0:c.call(s))===null||l===void 0?void 0:l.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&s.getRootNode().host&&(f=s.getRootNode().host);let m=f;for(;((d=(u=m?.getRootNode)===null||u===void 0?void 0:u.call(m))===null||d===void 0?void 0:d.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&m.getRootNode().host;)m=m.getRootNode().host;let p=!this.doc.contains(s)&&(!m||!this.doc.contains(m));if(!s.parentNode||p)return;let g=je(s.parentNode)?this.mirror.getId(f):this.mirror.getId(s.parentNode),h=r(s);if(g===-1||h===-1)return n.addNode(s);let y=ze(s,{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:v=>{Qt(v,this.mirror)&&this.iframeManager.addIframe(v),en(v,this.mirror)&&this.stylesheetManager.trackLinkElement(v),tn(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(v,b)=>{this.iframeManager.attachIframe(v,b),this.shadowDomManager.observeAttachShadow(v)},onStylesheetLoad:(v,b)=>{this.stylesheetManager.attachLinkElement(v,b)}});y&&t.push({parentId:g,nextId:h,node:y})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let s of Array.from(this.movedSet.values()))pi(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||o(s);for(let s of Array.from(this.addedSet.values()))!hi(this.droppedSet,s)&&!pi(this.removes,s,this.mirror)||hi(this.movedSet,s)?o(s):this.droppedSet.add(s);let i=null;for(;n.length;){let s=null;if(i){let c=this.mirror.getId(i.value.parentNode),l=r(i.value);c!==-1&&l!==-1&&(s=i)}if(!s)for(let c=n.length-1;c>=0;c--){let l=n.get(c);if(l){let u=this.mirror.getId(l.value.parentNode);if(r(l.value)===-1)continue;if(u!==-1){s=l;break}else{let f=l.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=f.parentNode.host;if(this.mirror.getId(m)!==-1){s=l;break}}}}}if(!s){for(;n.head;)n.removeNode(n.head.value);break}i=s.previous,n.removeNode(s.value),o(s.value)}let a={texts:this.texts.map(s=>({id:this.mirror.getId(s.node),value:s.value})).filter(s=>this.mirror.has(s.id)),attributes:this.attributes.map(s=>({id:this.mirror.getId(s.node),attributes:s.attributes})).filter(s=>this.mirror.has(s.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Jt(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!te(t.target,this.blockClass,this.blockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:dr(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=vt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),te(t.target,this.blockClass,this.blockSelector,!1)||r===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){let i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});let a=o.attributes.style;for(let s of Array.from(n.style)){let c=n.style.getPropertyValue(s),l=n.style.getPropertyPriority(s);(c!==i.style.getPropertyValue(s)||l!==i.style.getPropertyPriority(s))&&(l===""?a[s]=c:a[s]=[c,l])}for(let s of Array.from(i.style))n.style.getPropertyValue(s)===""&&(a[s]=!1)}else o.attributes[t.attributeName]=ur(this.doc,n.tagName,t.attributeName,r);break}case"childList":{if(te(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=je(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);te(t.target,this.blockClass,this.blockSelector,!1)||Jt(n,this.mirror)||!ui(n,this.mirror)||(this.addedSet.has(n)?(hr(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||fr(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[mi(r,o)]?hr(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:je(t.target)&&qe(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(Jt(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[mi(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);te(t,this.blockClass,this.blockSelector,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function hr(e,t){e.delete(t),t.childNodes.forEach(n=>hr(e,n))}function pi(e,t,n){return e.length===0?!1:gi(e,t,n)}function gi(e,t,n){let{parentNode:r}=t;if(!r)return!1;let o=n.getId(r);return e.some(i=>i.id===o)?!0:gi(e,r,n)}function hi(e,t){return e.size===0?!1:yi(e,t)}function yi(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:yi(e,n):!1}var De=[],vi=typeof CSSGroupingRule<"u",Ci=typeof CSSMediaRule<"u",Si=typeof CSSSupportsRule<"u",xi=typeof CSSConditionRule<"u";function Ct(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function gr(e,t){var n,r;let o=new rn;De.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver,a=(r=(n=window?.Zone)===null||n===void 0?void 0:n.__symbol__)===null||r===void 0?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);let s=new i(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function oc({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,a=[],s,c=it(d=>{let f=Date.now()-s;e(a.map(m=>(m.timeOffset-=f,m)),d),a=[],s=null},i),l=it(d=>{let f=Ct(d),{clientX:m,clientY:p}=mr(d)?d.changedTouches[0]:d;s||(s=Date.now()),a.push({x:m,y:p,id:r.getId(f),timeOffset:Date.now()-s}),c(typeof DragEvent<"u"&&d instanceof DragEvent?P.Drag:d instanceof MouseEvent?P.MouseMove:P.TouchMove)},o,{trailing:!1}),u=[ce("mousemove",l,n),ce("touchmove",l,n),ce("drag",l,n)];return()=>{u.forEach(d=>d())}}function ic({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};let a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,s=[],c=l=>u=>{let d=Ct(u);if(te(d,r,o,!0))return;let f=mr(u)?u.changedTouches[0]:u;if(!f)return;let m=n.getId(d),{clientX:p,clientY:g}=f;e({type:nn[l],id:m,x:p,y:g})};return Object.keys(nn).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let u=l.toLowerCase(),d=c(l);s.push(ce(u,d,t))}),()=>{s.forEach(l=>l())}}function yr({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){let a=it(s=>{let c=Ct(s);if(!c||te(c,r,o,!0))return;let l=n.getId(c);if(c===t){let u=t.scrollingElement||t.documentElement;e({id:l,x:u.scrollLeft,y:u.scrollTop})}else e({id:l,x:c.scrollLeft,y:c.scrollTop})},i.scroll||100);return ce("scroll",a,t)}function ac({viewportResizeCb:e}){let t=-1,n=-1,r=it(()=>{let o=Kt(),i=Xt();(t!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),t=o,n=i)},200);return ce("resize",r,window)}function bi(e,t){let n=Object.assign({},e);return t||delete n.userTriggered,n}var sc=["INPUT","TEXTAREA","SELECT"],wi=new WeakMap;function lc({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,maskInputOptions:a,maskInputFn:s,sampling:c,userTriggeredOnInput:l}){function u(y){let v=Ct(y),b=y.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||sc.indexOf(v.tagName)<0||te(v,r,o,!0))return;let w=v.type;if(v.classList.contains(i))return;let S=v.value,I=!1;w==="radio"||w==="checkbox"?I=v.checked:(a[v.tagName.toLowerCase()]||a[w])&&(S=vt({maskInputOptions:a,tagName:v.tagName,type:w,value:S,maskInputFn:s})),d(v,bi({text:S,isChecked:I,userTriggered:b},l));let C=v.name;w==="radio"&&C&&I&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(E=>{E!==v&&d(E,bi({text:E.value,isChecked:!I,userTriggered:!1},l))})}function d(y,v){let b=wi.get(y);if(!b||b.text!==v.text||b.isChecked!==v.isChecked){wi.set(y,v);let w=n.getId(y);e(Object.assign(Object.assign({},v),{id:w}))}}let m=(c.input==="last"?["change"]:["input","change"]).map(y=>ce(y,u,t)),p=t.defaultView;if(!p)return()=>{m.forEach(y=>y())};let g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),h=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...h.map(y=>Ze(y[0],y[1],{set(){u({target:this})}},!1,p))),()=>{m.forEach(y=>y())}}function on(e){let t=[];function n(r,o){if(vi&&r.parentRule instanceof CSSGroupingRule||Ci&&r.parentRule instanceof CSSMediaRule||Si&&r.parentRule instanceof CSSSupportsRule||xi&&r.parentRule instanceof CSSConditionRule){let a=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(a)}else if(r.parentStyleSheet){let a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(a)}return o}return n(e,t)}function $e(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function cc({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){let o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(u,d){let{id:f,styleId:m}=$e(this,t,n.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,adds:[{rule:u,index:d}]}),o.apply(this,[u,d])};let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(u){let{id:d,styleId:f}=$e(this,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,removes:[{index:u}]}),i.apply(this,[u])};let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(u){let{id:d,styleId:f}=$e(this,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replace:u}),a.apply(this,[u])});let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(u){let{id:d,styleId:f}=$e(this,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replaceSync:u}),s.apply(this,[u])});let c={};vi?c.CSSGroupingRule=r.CSSGroupingRule:(Ci&&(c.CSSMediaRule=r.CSSMediaRule),xi&&(c.CSSConditionRule=r.CSSConditionRule),Si&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([u,d])=>{l[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=function(f,m){let{id:p,styleId:g}=$e(this.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,adds:[{rule:f,index:[...on(this),m||0]}]}),l[u].insertRule.apply(this,[f,m])},d.prototype.deleteRule=function(f){let{id:m,styleId:p}=$e(this.parentStyleSheet,t,n.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,removes:[{index:[...on(this),f]}]}),l[u].deleteRule.apply(this,[f])}}),()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([u,d])=>{d.prototype.insertRule=l[u].insertRule,d.prototype.deleteRule=l[u].deleteRule})}}function br({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;n.nodeName==="#document"?a=e.getId(n):a=e.getId(n.host);let s=n.nodeName==="#document"?(r=n.defaultView)===null||r===void 0?void 0:r.Document:(i=(o=n.ownerDocument)===null||o===void 0?void 0:o.defaultView)===null||i===void 0?void 0:i.ShadowRoot,c=Object.getOwnPropertyDescriptor(s?.prototype,"adoptedStyleSheets");return a===null||a===-1||!s||!c?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var l;return(l=c.get)===null||l===void 0?void 0:l.call(this)},set(l){var u;let d=(u=c.set)===null||u===void 0?void 0:u.call(this,l);if(a!==null&&a!==-1)try{t.adoptStyleSheets(l,a)}catch{}return d}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})}function uc({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(s,c,l){var u;if(n.has(s))return i.apply(this,[s,c,l]);let{id:d,styleId:f}=$e((u=this.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:s,value:c,priority:l},index:on(this.parentRule)}),i.apply(this,[s,c,l])};let a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(s){var c;if(n.has(s))return a.apply(this,[s]);let{id:l,styleId:u}=$e((c=this.parentRule)===null||c===void 0?void 0:c.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:s},index:on(this.parentRule)}),a.apply(this,[s])},()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}function dc({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o}){let i=s=>it(c=>{let l=Ct(c);if(!l||te(l,t,n,!0))return;let{currentTime:u,volume:d,muted:f,playbackRate:m}=l;e({type:s,id:r.getId(l),currentTime:u,volume:d,muted:f,playbackRate:m})},o.media||500),a=[ce("play",i(0)),ce("pause",i(1)),ce("seeked",i(2)),ce("volumechange",i(3)),ce("ratechange",i(4))];return()=>{a.forEach(s=>s())}}function fc({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(c,l,u){let d=new i(c,l,u);return o.set(d,{family:c,buffer:typeof l!="string",descriptors:u,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),d};let a=be(t.fonts,"add",function(s){return function(c){return setTimeout(()=>{let l=o.get(c);l&&(e(l),o.delete(c))},0),s.apply(this,[c])}});return r.push(()=>{n.FontFace=i}),r.push(a),()=>{r.forEach(s=>s())}}function mc(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e,a=!0,s=()=>{let c=t.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;let l=[],u=c.rangeCount||0;for(let d=0;d<u;d++){let f=c.getRangeAt(d),{startContainer:m,startOffset:p,endContainer:g,endOffset:h}=f;te(m,r,o,!0)||te(g,r,o,!0)||l.push({start:n.getId(m),startOffset:p,end:n.getId(g),endOffset:h})}i({ranges:l})};return s(),ce("selectionchange",s)}function pc(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:m}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),n(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),r(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),o(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),i(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),a(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),s(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),c(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),l(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),u(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),d(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),f(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),m(...p)}}function Ii(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};pc(e,t);let r=gr(e,e.doc),o=oc(e),i=ic(e),a=yr(e),s=ac(e),c=lc(e),l=dc(e),u=cc(e,{win:n}),d=br(e,e.doc),f=uc(e,{win:n}),m=e.collectFonts?fc(e):()=>{},p=mc(e),g=[];for(let h of e.plugins)g.push(h.observer(h.callback,n,h.options));return()=>{De.forEach(h=>h.reset()),r.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),f(),m(),p(),g.forEach(h=>h())}}var St=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){let i=r||this.getIdToRemoteIdMap(t),a=o||this.getRemoteIdToIdMap(t),s=i.get(n);return s||(s=this.generateIdFn(),i.set(n,s),a.set(s,n)),s}getIds(t,n){let r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,o))}getRemoteId(t,n,r){let o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}};var an=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new St(lr),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new St(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(r=this.loadListener)===null||r===void 0||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){if(t.data.type==="rrweb"){if(!t.source)return;let r=this.crossOriginIframeMap.get(t.source);if(!r)return;let o=this.transformCrossOriginEvent(r,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}}transformCrossOriginEvent(t,n){var r;switch(n.type){case H.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t),{timestamp:n.timestamp,type:H.IncrementalSnapshot,data:{source:P.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case H.Meta:case H.Load:case H.DomContentLoaded:return!1;case H.Plugin:return n;case H.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case H.IncrementalSnapshot:switch(n.data.source){case P.Mutation:return n.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t)}),n.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),n.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),n.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case P.Drag:case P.TouchMove:case P.MouseMove:return n.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case P.ViewportResize:return!1;case P.MediaInteraction:case P.MouseInteraction:case P.Scroll:case P.CanvasMutation:case P.Input:return this.replaceIds(n.data,t,["id"]),n;case P.StyleSheetRule:case P.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case P.Font:return n;case P.Selection:return n.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),n;case P.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)===null||r===void 0||r.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),n}}}replace(t,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}};var sn=class{constructor(t){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;let n=this;this.restorePatches.push(be(Element.prototype,"attachShadow",function(r){return function(o){let i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,n){qe(t)&&(this.shadowDoms.has(t)||(this.shadowDoms.add(t),gr(Object.assign(Object.assign({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),yr(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),br({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)},0)))}observeAttachShadow(t){if(t.contentWindow){let n=this;this.restorePatches.push(be(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){let i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t()),this.shadowDoms=new WeakSet}};function Ei(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Ai(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(u){try{l(r.next(u))}catch(d){a(d)}}function c(u){try{l(r.throw(u))}catch(d){a(d)}}function l(u){u.done?i(u.value):o(u.value).then(s,c)}l((r=r.apply(e,t||[])).next())})}var at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hc=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(xt=0;xt<at.length;xt++)hc[at.charCodeAt(xt)]=xt;var xt,Mi=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=at[t[n]>>2],o+=at[(t[n]&3)<<4|t[n+1]>>4],o+=at[(t[n+1]&15)<<2|t[n+2]>>6],o+=at[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o};var ki=new Map;function gc(e,t){let n=ki.get(e);return n||(n=new Map,ki.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var wr=(e,t,n)=>{if(!e||!(Ti(e,t)||typeof e=="object"))return;let r=e.constructor.name,o=gc(n,r),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function ln(e,t,n){if(e instanceof Array)return e.map(r=>ln(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let r=e.constructor.name,o=Mi(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ln(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){let r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[ln(e.data,t,n),e.width,e.height]};if(Ti(e,t)||typeof e=="object"){let r=e.constructor.name,o=wr(e,t,n);return{rr_type:r,index:o}}}}return e}var cn=(e,t,n)=>[...e].map(r=>ln(r,t,n)),Ti=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function Li(e,t,n,r){let o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let s=be(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...l){return te(this.canvas,n,r,!0)||setTimeout(()=>{let u=cn([...l],t,this);e(this.canvas,{type:Ne["2D"],property:a,args:u})},0),c.apply(this,l)}});o.push(s)}catch{let c=Ze(t.CanvasRenderingContext2D.prototype,a,{set(l){e(this.canvas,{type:Ne["2D"],property:a,args:[l],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function vr(e,t,n){let r=[];try{let o=be(e.HTMLCanvasElement.prototype,"getContext",function(i){return function(a,...s){return te(this,t,n,!0)||"__context"in this||(this.__context=a),i.apply(this,[a,...s])}});r.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(o=>o())}}function Ni(e,t,n,r,o,i,a){let s=[],c=Object.getOwnPropertyNames(e);for(let l of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let u=be(e,l,function(d){return function(...f){let m=d.apply(this,f);if(wr(m,a,this),!te(this.canvas,r,o,!0)){let p=cn([...f],a,this),g={type:t,property:l,args:p};n(this.canvas,g)}return m}});s.push(u)}catch{let d=Ze(e,l,{set(f){n(this.canvas,{type:t,property:l,args:[f],setter:!0})}});s.push(d)}return s}function Ri(e,t,n,r,o){let i=[];return i.push(...Ni(t.WebGLRenderingContext.prototype,Ne.WebGL,e,n,r,o,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Ni(t.WebGL2RenderingContext.prototype,Ne.WebGL2,e,n,r,o,t)),()=>{i.forEach(a=>a())}}var Cr=null;try{_i=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof Hn=="function"&&Hn("worker_threads"),Cr=_i.Worker}catch{}var _i;function yc(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}function Fi(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=yc(e,o),a=i.indexOf(`
73
- `,10)+1,s=i.substring(a)+(r?"//# sourceMappingURL="+r:"");return function(l){return new Cr(s,Object.assign({},l,{eval:!0}))}}function bc(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function wc(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=bc(e,o),a=i.indexOf(`
74
- `,10)+1,s=i.substring(a)+(r?"//# sourceMappingURL="+r:""),c=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(c)}function Oi(e,t,n){var r;return function(i){return r=r||wc(e,t,n),new Worker(r,i)}}var vc=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";function $i(){return vc}function Di(e,t,n){return $i()?Fi(e,t,n):Oi(e,t,n)}var Pi=Di("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1);var un=class{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(c,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(l)};let{sampling:n="all",win:r,blockClass:o,blockSelector:i,recordCanvas:a,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&n==="all"&&this.initCanvasMutationObserver(r,o,i),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,n,r,o,i){let a=vr(n,r,o),s=new Map,c=new Pi;c.onmessage=p=>{let{id:g}=p.data;if(s.set(g,!1),!("base64"in p.data))return;let{base64:h,type:y,width:v,height:b}=p.data;this.mutationCb({id:g,type:Ne["2D"],commands:[{property:"clearRect",args:[0,0,v,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:y}]},0,0]}]})};let l=1e3/t,u=0,d,f=()=>{let p=[];return n.document.querySelectorAll("canvas").forEach(g=>{te(g,r,o,!0)||p.push(g)}),p},m=p=>{if(u&&p-u<l){d=requestAnimationFrame(m);return}u=p,f().forEach(g=>Ai(this,void 0,void 0,function*(){var h;let y=this.mirror.getId(g);if(s.get(y))return;if(s.set(y,!0),["webgl","webgl2"].includes(g.__context)){let b=g.getContext(g.__context);((h=b?.getContextAttributes())===null||h===void 0?void 0:h.preserveDrawingBuffer)===!1&&b?.clear(b.COLOR_BUFFER_BIT)}let v=yield createImageBitmap(g);c.postMessage({id:y,bitmap:v,width:g.width,height:g.height,dataURLOptions:i.dataURLOptions},[v])})),d=requestAnimationFrame(m)};d=requestAnimationFrame(m),this.resetObservers=()=>{a(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=vr(t,n,r),i=Li(this.processMutation.bind(this),t,n,r),a=Ri(this.processMutation.bind(this),t,n,r,this.mirror);this.resetObservers=()=>{o(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;let o=r.map(a=>Ei(a,["type"])),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}};var dn=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Zt,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,styleIds:[]},o=[];for(let i of t){let a;if(this.styleMirror.has(i))a=this.styleMirror.getId(i);else{a=this.styleMirror.add(i);let s=Array.from(i.rules||CSSRule);o.push({styleId:a,rules:s.map((c,l)=>({rule:sr(c),index:l}))})}r.styleIds.push(a)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}};function oe(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}var ne,fn,Sr,mn=!1,we=si();function Re(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:h,sampling:y={},dataURLOptions:v={},mousemoveWait:b,recordCanvas:w=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:I=!1,collectFonts:C=!1,inlineImages:E=!1,plugins:k,keepIframeSrcFn:O=()=>!1,ignoreCSSAttributes:D=new Set([])}=e,T=S?window.parent===window:!0,M=!1;if(!T)try{window.parent.document,M=!1}catch{M=!0}if(T&&!t)throw new Error("emit function is required");b!==void 0&&y.mousemove===void 0&&(y.mousemove=b),we.reset();let W=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},G=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};di();let re,L=0,$=N=>{for(let J of k||[])J.eventProcessor&&(N=J.eventProcessor(N));return h&&(N=h(N)),N};ne=(N,J)=>{var Z;if(!((Z=De[0])===null||Z===void 0)&&Z.isFrozen()&&N.type!==H.FullSnapshot&&!(N.type===H.IncrementalSnapshot&&N.data.source===P.Mutation)&&De.forEach(U=>U.unfreeze()),T)t?.($(N),J);else if(M){let U={type:"rrweb",event:$(N),isCheckout:J};window.parent.postMessage(U,"*")}if(N.type===H.FullSnapshot)re=N,L=0;else if(N.type===H.IncrementalSnapshot){if(N.data.source===P.Mutation&&N.data.isAttachIframe)return;L++;let U=r&&L>=r,ie=n&&N.timestamp-re.timestamp>n;(U||ie)&&fn(!0)}};let _=N=>{ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.Mutation},N)}))},F=N=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.Scroll},N)})),z=N=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.CanvasMutation},N)})),B=N=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.AdoptedStyleSheet},N)})),Y=new dn({mutationCb:_,adoptedStyleSheetCb:B}),j=new an({mirror:we,mutationCb:_,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:ne});for(let N of k||[])N.getMirror&&N.getMirror({nodeMirror:we,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});Sr=new un({recordCanvas:w,mutationCb:z,win:window,blockClass:o,blockSelector:i,mirror:we,sampling:y.canvas,dataURLOptions:v});let ee=new sn({mutationCb:_,scrollCb:F,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:W,dataURLOptions:v,maskTextFn:p,maskInputFn:m,recordCanvas:w,inlineImages:E,sampling:y,slimDOMOptions:G,iframeManager:j,stylesheetManager:Y,canvasManager:Sr,keepIframeSrcFn:O},mirror:we});fn=(N=!1)=>{var J,Z,U,ie,V,se;ne(oe({type:H.Meta,data:{href:window.location.href,width:Xt(),height:Kt()}}),N),Y.reset(),De.forEach(Q=>Q.lock());let We=li(document,{mirror:we,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:W,maskTextFn:p,slimDOM:G,dataURLOptions:v,recordCanvas:w,inlineImages:E,onSerialize:Q=>{Qt(Q,we)&&j.addIframe(Q),en(Q,we)&&Y.trackLinkElement(Q),tn(Q)&&ee.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,me)=>{j.attachIframe(Q,me),ee.observeAttachShadow(Q)},onStylesheetLoad:(Q,me)=>{Y.attachLinkElement(Q,me)},keepIframeSrcFn:O});if(!We)return console.warn("Failed to snapshot the document");ne(oe({type:H.FullSnapshot,data:{node:We,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((Z=(J=document?.body)===null||J===void 0?void 0:J.parentElement)===null||Z===void 0?void 0:Z.scrollLeft)||((U=document?.body)===null||U===void 0?void 0:U.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((V=(ie=document?.body)===null||ie===void 0?void 0:ie.parentElement)===null||V===void 0?void 0:V.scrollTop)||((se=document?.body)===null||se===void 0?void 0:se.scrollTop)||0}}})),De.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,we.getId(document))};try{let N=[];N.push(ce("DOMContentLoaded",()=>{ne(oe({type:H.DomContentLoaded,data:{}}))}));let J=U=>{var ie;return Ii({mutationCb:_,mousemoveCb:(V,se)=>ne(oe({type:H.IncrementalSnapshot,data:{source:se,positions:V}})),mouseInteractionCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.MouseInteraction},V)})),scrollCb:F,viewportResizeCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.ViewportResize},V)})),inputCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.Input},V)})),mediaInteractionCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.MediaInteraction},V)})),styleSheetRuleCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.StyleSheetRule},V)})),styleDeclarationCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.StyleDeclaration},V)})),canvasMutationCb:z,fontCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.Font},V)})),selectionCb:V=>{ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.Selection},V)}))},blockClass:o,ignoreClass:a,maskTextClass:s,maskTextSelector:c,maskInputOptions:W,inlineStylesheet:l,sampling:y,recordCanvas:w,inlineImages:E,userTriggeredOnInput:I,collectFonts:C,doc:U,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:O,blockSelector:i,slimDOMOptions:G,dataURLOptions:v,mirror:we,iframeManager:j,stylesheetManager:Y,shadowDomManager:ee,canvasManager:Sr,ignoreCSSAttributes:D,plugins:((ie=k?.filter(V=>V.observer))===null||ie===void 0?void 0:ie.map(V=>({observer:V.observer,options:V.options,callback:se=>ne(oe({type:H.Plugin,data:{plugin:V.name,payload:se}}))})))||[]},g)};j.addLoadListener(U=>{N.push(J(U.contentDocument))});let Z=()=>{fn(),N.push(J(document)),mn=!0};return document.readyState==="interactive"||document.readyState==="complete"?Z():N.push(ce("load",()=>{ne(oe({type:H.Load,data:{}})),Z()},window)),()=>{N.forEach(U=>U()),mn=!1}}catch(N){console.warn(N)}}Re.addCustomEvent=(e,t)=>{if(!mn)throw new Error("please add custom event after start recording");ne(oe({type:H.Custom,data:{tag:e,payload:t}}))};Re.freezePage=()=>{De.forEach(e=>e.freeze())};Re.takeFullSnapshot=e=>{if(!mn)throw new Error("please take full snapshot after start recording");fn(e)};Re.mirror=we;function Cc(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`run-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function xr(){let e=x().sessionRecording;if(!e.active)try{let t=Re({emit:n=>e.buffer.push(n),collectFonts:!0,sampling:{mousemove:!1,mouseInteraction:!1}});t&&(e.active=!0,e.runId=Cc(),e.stopFn=t)}catch{}}function Ir(){let e=x().sessionRecording;return!e.active||!e.runId||e.buffer.length===0?null:{events:e.buffer.splice(0),runId:e.runId}}function Er(){return x().sessionRecording.active}var Sc=["backgroundColor","color","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","textDecoration","textTransform","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","borderRadius","borderColor","borderWidth","borderStyle","boxShadow","opacity","width","height","display","flexDirection","justifyContent","alignItems","gap"];function xc(e,t){let n=t??Sc;if(e.ref||e.text||e.role||e.label||e.selector){let{element:i,matched:a}=xe(e);return{...Wi(i,e.ref,n),matched:a}}let r=He(),o=[];for(let[i,a]of r)a.isConnected&&o.push(Wi(a,i,n));return o}function Wi(e,t,n){let r=window.getComputedStyle(e),o={};t&&(o.ref=t),o.tag=e.tagName.toLowerCase();let i=e.textContent?.trim();i&&(o.text=i.length>60?i.slice(0,60)+"\u2026":i);for(let a of n){let s=r.getPropertyValue(a.replace(/([A-Z])/g,"-$1").toLowerCase());s&&(o[a]=s)}return o}var Bi=25,pn=25,It="__mindstudio_pending_nav",Hi=300,kr=1e4;function Ic(e){try{let t=new URL(e,window.location.origin);return t.origin!==window.location.origin?!1:t.pathname===window.location.pathname&&t.search===window.location.search&&t.hash===window.location.hash}catch{return!1}}function Ui(e){try{let t=new URL(e,window.location.origin);return t.origin!==window.location.origin?!1:(Ic(e)||(window.history.pushState(null,"",t.pathname+t.search+t.hash),window.dispatchEvent(new PopStateEvent("popstate"))),!0)}catch{return!1}}async function Ar(e=300,t=2e3){return new Promise(n=>{let r=Date.now()+t,o=Date.now(),i=et(),a=window.scrollY,s=window.scrollX,c=document.body.scrollTop,l=document.documentElement.scrollTop,u=document.body.scrollHeight,d=document.body.scrollWidth,f=i.scrollTop,m=i.scrollLeft;function p(){if(Date.now()>r){n();return}let g=window.scrollY,h=window.scrollX,y=document.body.scrollTop,v=document.documentElement.scrollTop,b=document.body.scrollHeight,w=document.body.scrollWidth,S=i.scrollTop,I=i.scrollLeft;(g!==a||h!==s||y!==c||v!==l||b!==u||w!==d||S!==f||I!==m)&&(a=g,s=h,c=y,l=v,u=b,d=w,f=S,m=I,o=Date.now()),Date.now()-o>=e?n():requestAnimationFrame(p)}requestAnimationFrame(p)})}var Ec=150;async function Mr(e){let t=Ac(e),n=t.map(a=>({el:a,top:a.scrollTop,left:a.scrollLeft})),r=document.documentElement.style.scrollBehavior;document.documentElement.style.scrollBehavior="auto",e.scrollIntoView({block:"center",inline:"nearest",behavior:"instant"}),document.documentElement.style.scrollBehavior=r;let o=t.map(a=>({top:a.scrollTop,left:a.scrollLeft})),i=[];for(let a=0;a<t.length;a++)(n[a].top!==o[a].top||n[a].left!==o[a].left)&&i.push({el:t[a],fromTop:n[a].top,fromLeft:n[a].left,toTop:o[a].top,toLeft:o[a].left});if(i.length===0){await new Promise(a=>requestAnimationFrame(()=>a()));return}for(let a of i)a.el.scrollTop=a.fromTop,a.el.scrollLeft=a.fromLeft;await new Promise(a=>{let s=performance.now();function c(l){let u=l-s,d=Math.min(u/Ec,1),f=1-Math.pow(1-d,3);for(let m of i)m.el.scrollTop=m.fromTop+(m.toTop-m.fromTop)*f,m.el.scrollLeft=m.fromLeft+(m.toLeft-m.fromLeft)*f;d<1?requestAnimationFrame(c):a()}requestAnimationFrame(c)})}function Ac(e){let t=[],n=e.parentElement;for(;n;){let r=getComputedStyle(n),o=r.overflowY,i=r.overflowX;(o==="auto"||o==="scroll"||i==="auto"||i==="scroll")&&t.push(n),n=n.parentElement}return t.push(document.scrollingElement||document.documentElement),t}var Mc=new Set(["click","type","select"]);function kc(e){return e.some(t=>Mc.has(t.command))}async function Et(e,t){let n=Date.now(),r=[],o=[],i="",a=!1,s=new Set(["click","type","select"]),c=t.some(u=>s.has(u.command));c&&(bt(!0),rr()),Gn(),kc(t)&&xr();try{for(let u=0;u<t.length;u++){let d=t[u],f=d.command;try{if(u>0&&await le(Bi+Math.random()*pn-pn/2),f==="navigate"){let p=d.url;if(!p)throw new Error('navigate command requires a "url" field');if(Ui(p)){r.push({index:u,command:f,result:"ok"}),await le(Hi);continue}let g=t.slice(u+1);if(g.length>0)try{sessionStorage.setItem(It,JSON.stringify({id:e,startTime:n,completedSteps:r,remainingSteps:g,stepOffset:u+1}))}catch{}r.push({index:u,command:f,result:"ok"}),a=!0,window.location.href=p,await new Promise((h,y)=>{setTimeout(()=>y(new Error("Navigation did not complete within timeout")),kr)})}if(f==="reload"){let p=t.slice(u+1);if(p.length>0)try{sessionStorage.setItem(It,JSON.stringify({id:e,startTime:n,completedSteps:r,remainingSteps:p,stepOffset:u+1}))}catch{}r.push({index:u,command:f,result:"ok"}),a=!0,window.location.reload(),await new Promise((g,h)=>{setTimeout(()=>h(new Error("Reload did not complete within timeout")),kr)})}let m=await Gi(d);r.push({index:u,command:f,...m})}catch(m){r.push({index:u,command:f,error:m instanceof Error?m.message:String(m)});break}}try{i=await Ue()}catch{}}finally{o=zn(),c&&(bt(!1),Er()?or():qt())}let l=Ir();return{id:e,steps:r,snapshot:i,logs:o,duration:Date.now()-n,...l?{events:l.events,runId:l.runId}:{}}}async function Vi(){let e=null;try{let a=sessionStorage.getItem(It);if(!a)return null;sessionStorage.removeItem(It),e=JSON.parse(a)}catch{return null}if(!e)return null;let t=[...e.completedSteps],n=[],r="",o=e.remainingSteps.some(a=>a.command==="click"||a.command==="type"||a.command==="select");o&&(bt(!0),rr(),xr()),Gn();try{for(let a=0;a<e.remainingSteps.length;a++){let s=e.remainingSteps[a],c=s.command,l=e.stepOffset+a;try{if(a>0&&await le(Bi+Math.random()*pn-pn/2),c==="navigate"){let d=s.url;if(!d)throw new Error('navigate command requires a "url" field');if(Ui(d)){t.push({index:l,command:c,result:"ok"}),await le(Hi);continue}let f=e.remainingSteps.slice(a+1);if(f.length>0)try{sessionStorage.setItem(It,JSON.stringify({id:e.id,startTime:e.startTime,completedSteps:t,remainingSteps:f,stepOffset:l+1}))}catch{}t.push({index:l,command:c,result:"ok"}),window.location.href=d,await new Promise((m,p)=>{setTimeout(()=>p(new Error("Navigation did not complete within timeout")),kr)})}let u=await Gi(s);t.push({index:l,command:c,...u})}catch(u){t.push({index:l,command:c,error:u instanceof Error?u.message:String(u)});break}}try{r=await Ue()}catch{}}finally{n=zn(),o&&(bt(!1),Er()?or():qt())}let i=Ir();return{id:e.id,steps:t,snapshot:r,logs:n,duration:Date.now()-e.startTime,...i?{events:i.events,runId:i.runId}:{}}}async function Gi(e){switch(e.command){case"snapshot":return{result:await Ue()};case"click":{let{element:t,matched:n}=xe(e);return await Mr(t),await zt(t),await ei(),Zn(t),await Ar(),await le(250),{result:"ok",matched:n}}case"type":{let{element:t,matched:n}=xe(e),r=e.text;if(!r&&r!=="")throw new Error('type command requires a "text" field');return await Mr(t),await zt(t),await No(t,r,{clear:!!e.clear}),await Ar(),{result:"ok",matched:n}}case"select":{let{element:t,matched:n}=xe(e),r=e.option;if(!r)throw new Error('select command requires an "option" field');await Mr(t),await zt(t);let o=_o(t,r);return await Ar(),{result:`selected "${o}"`,matched:n}}case"wait":{let{matched:t,elapsed:n}=await Ro(e);return{result:"ok",matched:t,elapsed:n}}case"styles":{let t=e.properties;return{result:xc(e,t)}}case"evaluate":{let t=e.script;if(!t)throw new Error('evaluate command requires a "script" field');return{result:await Fo(t)}}default:throw new Error(`Unknown command: ${e.command}`)}}var Tc="/__mindstudio_dev__/ws",Lc=1e3,Nc=1e4;function qi(){let e=x().ws;e.ws||(po(gn),window.addEventListener("beforeunload",()=>{e.closing=!0,e.ws&&e.ws.close()}),Yi())}function gn(){let{ws:e}=x().ws;return e&&e.readyState===WebSocket.OPEN?e:null}function Rc(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${Tc}`}function Lr(){return window.parent!==window?"iframe":"standalone"}function Nr(){try{return location.search.includes("ms_sandbox=1")?(sessionStorage.setItem("__ms_sandbox","1"),!0):sessionStorage.getItem("__ms_sandbox")==="1"}catch{return location.search.includes("ms_sandbox=1")}}function Yi(){let e=x().ws;if(!e.closing){try{e.ws=new WebSocket(Rc())}catch{zi();return}e.ws.onopen=()=>{try{let t=(()=>{try{return sessionStorage.getItem("__ms_mirror")==="1"}catch{return!1}})();e.ws.send(JSON.stringify({type:"hello",mode:Lr(),url:location.href,viewport:{w:window.innerWidth,h:window.innerHeight},mirror:t,sandbox:Nr()}))}catch{e.ws?.close()}},e.ws.onmessage=t=>{let n;try{n=JSON.parse(t.data)}catch{return}switch(n.type){case"ack":e.clientId=n.clientId,e.reconnectDelay=Lc,Fc();break;case"command":_c(n.id,n.steps);break;case"broadcast":Oc(n.action,n.payload);break}},e.ws.onclose=()=>{e.ws=null,e.clientId=null,e.closing||zi()},e.ws.onerror=()=>{}}}function zi(){let e=x().ws;e.closing||(setTimeout(()=>Yi(),e.reconnectDelay),e.reconnectDelay=Math.min(e.reconnectDelay*2,Nc))}async function _c(e,t){let n=x().ws;if(n.busy){hn({id:e,steps:[],snapshot:"",logs:[],duration:0,error:"Browser agent is busy"});return}n.busy=!0,Tr("command-started",{id:e,steps:t.map(r=>r.command)});try{let r=await Et(e,t);hn(r),Tr("command-completed",{id:e,success:!0})}catch{hn({id:e,steps:[],snapshot:"",logs:[],duration:0}),Tr("command-completed",{id:e,success:!1})}finally{x().ws.busy=!1}}function hn(e){try{let t=gn();t&&t.send(JSON.stringify({type:"result",...e}))}catch{}}async function Fc(){let e=await Vi();e&&hn(e)}function Tr(e,t){window.parent!==window&&window.parent.postMessage({channel:"mindstudio-browser-agent",command:e,...t},"*")}function Oc(e,t){e==="reload"&&(document.cookie="__ms_auth=; Max-Age=0; Path=/; Secure; SameSite=None",location.href="/")}var st="#DD2590",ji="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",$c=200,Zi=`
72
+ or you can use record.mirror to access the mirror instance during recording.`,pi={map:{},getId(){return console.error(it),-1},getNode(){return console.error(it),null},removeNodeFromMap(){console.error(it)},has(){return console.error(it),!1},reset(){console.error(it)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(pi=new Proxy(pi,{get(e,t,n){return t==="map"&&console.error(it),Reflect.get(e,t,n)}}));function at(e,t,n={}){let r=null,o=0;return function(...i){let a=Date.now();!o&&n.leading===!1&&(o=a);let s=t-(a-o),c=this;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},s))}}function Ze(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Ze(e,t,i||{},!0)}function be(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function Qt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function en(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function te(e,t,n,r){if(!e)return!1;let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if(typeof t=="string"){if(o.classList.contains(t)||r&&o.closest("."+t)!==null)return!0}else if(vt(o,t,r))return!0;return!!(n&&(e.matches(n)||r&&o.closest(n)!==null))}function hi(e,t){return t.getId(e)!==-1}function tn(e,t){return t.getId(e)===qe}function gr(e,t){if(je(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?gr(e.parentNode,t):!0:!0}function yr(e){return!!e.changedTouches}function gi(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function nn(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function rn(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function on(e){return!!e?.shadowRoot}var Jt=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var n;return(n=this.styleIDMap.get(t))!==null&&n!==void 0?n:-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};var H=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(H||{}),P=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(P||{}),an=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(an||{}),Ne=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ne||{});function yi(e){return"__ln"in e}var br=class{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&yi(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&yi(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}},bi=(e,t)=>`${e}@${t}`,sn=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],n=new br,r=s=>{let c=s,l=qe;for(;l===qe;)c=c&&c.nextSibling,l=c&&this.mirror.getId(c);return l},o=s=>{var c,l,u,d;let f=null;((l=(c=s.getRootNode)===null||c===void 0?void 0:c.call(s))===null||l===void 0?void 0:l.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&s.getRootNode().host&&(f=s.getRootNode().host);let m=f;for(;((d=(u=m?.getRootNode)===null||u===void 0?void 0:u.call(m))===null||d===void 0?void 0:d.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&m.getRootNode().host;)m=m.getRootNode().host;let p=!this.doc.contains(s)&&(!m||!this.doc.contains(m));if(!s.parentNode||p)return;let g=je(s.parentNode)?this.mirror.getId(f):this.mirror.getId(s.parentNode),h=r(s);if(g===-1||h===-1)return n.addNode(s);let y=ze(s,{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:v=>{nn(v,this.mirror)&&this.iframeManager.addIframe(v),rn(v,this.mirror)&&this.stylesheetManager.trackLinkElement(v),on(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(v,b)=>{this.iframeManager.attachIframe(v,b),this.shadowDomManager.observeAttachShadow(v)},onStylesheetLoad:(v,b)=>{this.stylesheetManager.attachLinkElement(v,b)}});y&&t.push({parentId:g,nextId:h,node:y})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let s of Array.from(this.movedSet.values()))wi(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||o(s);for(let s of Array.from(this.addedSet.values()))!vi(this.droppedSet,s)&&!wi(this.removes,s,this.mirror)||vi(this.movedSet,s)?o(s):this.droppedSet.add(s);let i=null;for(;n.length;){let s=null;if(i){let c=this.mirror.getId(i.value.parentNode),l=r(i.value);c!==-1&&l!==-1&&(s=i)}if(!s)for(let c=n.length-1;c>=0;c--){let l=n.get(c);if(l){let u=this.mirror.getId(l.value.parentNode);if(r(l.value)===-1)continue;if(u!==-1){s=l;break}else{let f=l.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=f.parentNode.host;if(this.mirror.getId(m)!==-1){s=l;break}}}}}if(!s){for(;n.head;)n.removeNode(n.head.value);break}i=s.previous,n.removeNode(s.value),o(s.value)}let a={texts:this.texts.map(s=>({id:this.mirror.getId(s.node),value:s.value})).filter(s=>this.mirror.has(s.id)),attributes:this.attributes.map(s=>({id:this.mirror.getId(s.node),attributes:s.attributes})).filter(s=>this.mirror.has(s.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!tn(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!te(t.target,this.blockClass,this.blockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:hr(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=Ct({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),te(t.target,this.blockClass,this.blockSelector,!1)||r===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){let i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});let a=o.attributes.style;for(let s of Array.from(n.style)){let c=n.style.getPropertyValue(s),l=n.style.getPropertyPriority(s);(c!==i.style.getPropertyValue(s)||l!==i.style.getPropertyPriority(s))&&(l===""?a[s]=c:a[s]=[c,l])}for(let s of Array.from(i.style))n.style.getPropertyValue(s)===""&&(a[s]=!1)}else o.attributes[t.attributeName]=pr(this.doc,n.tagName,t.attributeName,r);break}case"childList":{if(te(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=je(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);te(t.target,this.blockClass,this.blockSelector,!1)||tn(n,this.mirror)||!hi(n,this.mirror)||(this.addedSet.has(n)?(wr(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||gr(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[bi(r,o)]?wr(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:je(t.target)&&Ye(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(tn(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[bi(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);te(t,this.blockClass,this.blockSelector,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function wr(e,t){e.delete(t),t.childNodes.forEach(n=>wr(e,n))}function wi(e,t,n){return e.length===0?!1:Ci(e,t,n)}function Ci(e,t,n){let{parentNode:r}=t;if(!r)return!1;let o=n.getId(r);return e.some(i=>i.id===o)?!0:Ci(e,r,n)}function vi(e,t){return e.size===0?!1:Si(e,t)}function Si(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:Si(e,n):!1}var De=[],Ei=typeof CSSGroupingRule<"u",Ai=typeof CSSMediaRule<"u",ki=typeof CSSSupportsRule<"u",Mi=typeof CSSConditionRule<"u";function St(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function vr(e,t){var n,r;let o=new sn;De.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver,a=(r=(n=window?.Zone)===null||n===void 0?void 0:n.__symbol__)===null||r===void 0?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);let s=new i(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function uc({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,a=[],s,c=at(d=>{let f=Date.now()-s;e(a.map(m=>(m.timeOffset-=f,m)),d),a=[],s=null},i),l=at(d=>{let f=St(d),{clientX:m,clientY:p}=yr(d)?d.changedTouches[0]:d;s||(s=Date.now()),a.push({x:m,y:p,id:r.getId(f),timeOffset:Date.now()-s}),c(typeof DragEvent<"u"&&d instanceof DragEvent?P.Drag:d instanceof MouseEvent?P.MouseMove:P.TouchMove)},o,{trailing:!1}),u=[ce("mousemove",l,n),ce("touchmove",l,n),ce("drag",l,n)];return()=>{u.forEach(d=>d())}}function dc({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};let a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,s=[],c=l=>u=>{let d=St(u);if(te(d,r,o,!0))return;let f=yr(u)?u.changedTouches[0]:u;if(!f)return;let m=n.getId(d),{clientX:p,clientY:g}=f;e({type:an[l],id:m,x:p,y:g})};return Object.keys(an).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let u=l.toLowerCase(),d=c(l);s.push(ce(u,d,t))}),()=>{s.forEach(l=>l())}}function Cr({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){let a=at(s=>{let c=St(s);if(!c||te(c,r,o,!0))return;let l=n.getId(c);if(c===t){let u=t.scrollingElement||t.documentElement;e({id:l,x:u.scrollLeft,y:u.scrollTop})}else e({id:l,x:c.scrollLeft,y:c.scrollTop})},i.scroll||100);return ce("scroll",a,t)}function fc({viewportResizeCb:e}){let t=-1,n=-1,r=at(()=>{let o=Qt(),i=en();(t!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),t=o,n=i)},200);return ce("resize",r,window)}function xi(e,t){let n=Object.assign({},e);return t||delete n.userTriggered,n}var mc=["INPUT","TEXTAREA","SELECT"],Ii=new WeakMap;function pc({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,maskInputOptions:a,maskInputFn:s,sampling:c,userTriggeredOnInput:l}){function u(y){let v=St(y),b=y.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||mc.indexOf(v.tagName)<0||te(v,r,o,!0))return;let w=v.type;if(v.classList.contains(i))return;let S=v.value,I=!1;w==="radio"||w==="checkbox"?I=v.checked:(a[v.tagName.toLowerCase()]||a[w])&&(S=Ct({maskInputOptions:a,tagName:v.tagName,type:w,value:S,maskInputFn:s})),d(v,xi({text:S,isChecked:I,userTriggered:b},l));let C=v.name;w==="radio"&&C&&I&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(E=>{E!==v&&d(E,xi({text:E.value,isChecked:!I,userTriggered:!1},l))})}function d(y,v){let b=Ii.get(y);if(!b||b.text!==v.text||b.isChecked!==v.isChecked){Ii.set(y,v);let w=n.getId(y);e(Object.assign(Object.assign({},v),{id:w}))}}let m=(c.input==="last"?["change"]:["input","change"]).map(y=>ce(y,u,t)),p=t.defaultView;if(!p)return()=>{m.forEach(y=>y())};let g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),h=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...h.map(y=>Ze(y[0],y[1],{set(){u({target:this})}},!1,p))),()=>{m.forEach(y=>y())}}function ln(e){let t=[];function n(r,o){if(Ei&&r.parentRule instanceof CSSGroupingRule||Ai&&r.parentRule instanceof CSSMediaRule||ki&&r.parentRule instanceof CSSSupportsRule||Mi&&r.parentRule instanceof CSSConditionRule){let a=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(a)}else if(r.parentStyleSheet){let a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(a)}return o}return n(e,t)}function $e(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function hc({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){let o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(u,d){let{id:f,styleId:m}=$e(this,t,n.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,adds:[{rule:u,index:d}]}),o.apply(this,[u,d])};let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(u){let{id:d,styleId:f}=$e(this,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,removes:[{index:u}]}),i.apply(this,[u])};let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(u){let{id:d,styleId:f}=$e(this,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replace:u}),a.apply(this,[u])});let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(u){let{id:d,styleId:f}=$e(this,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replaceSync:u}),s.apply(this,[u])});let c={};Ei?c.CSSGroupingRule=r.CSSGroupingRule:(Ai&&(c.CSSMediaRule=r.CSSMediaRule),Mi&&(c.CSSConditionRule=r.CSSConditionRule),ki&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([u,d])=>{l[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=function(f,m){let{id:p,styleId:g}=$e(this.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,adds:[{rule:f,index:[...ln(this),m||0]}]}),l[u].insertRule.apply(this,[f,m])},d.prototype.deleteRule=function(f){let{id:m,styleId:p}=$e(this.parentStyleSheet,t,n.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,removes:[{index:[...ln(this),f]}]}),l[u].deleteRule.apply(this,[f])}}),()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([u,d])=>{d.prototype.insertRule=l[u].insertRule,d.prototype.deleteRule=l[u].deleteRule})}}function Sr({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;n.nodeName==="#document"?a=e.getId(n):a=e.getId(n.host);let s=n.nodeName==="#document"?(r=n.defaultView)===null||r===void 0?void 0:r.Document:(i=(o=n.ownerDocument)===null||o===void 0?void 0:o.defaultView)===null||i===void 0?void 0:i.ShadowRoot,c=Object.getOwnPropertyDescriptor(s?.prototype,"adoptedStyleSheets");return a===null||a===-1||!s||!c?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var l;return(l=c.get)===null||l===void 0?void 0:l.call(this)},set(l){var u;let d=(u=c.set)===null||u===void 0?void 0:u.call(this,l);if(a!==null&&a!==-1)try{t.adoptStyleSheets(l,a)}catch{}return d}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})}function gc({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(s,c,l){var u;if(n.has(s))return i.apply(this,[s,c,l]);let{id:d,styleId:f}=$e((u=this.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:s,value:c,priority:l},index:ln(this.parentRule)}),i.apply(this,[s,c,l])};let a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(s){var c;if(n.has(s))return a.apply(this,[s]);let{id:l,styleId:u}=$e((c=this.parentRule)===null||c===void 0?void 0:c.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:s},index:ln(this.parentRule)}),a.apply(this,[s])},()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}function yc({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o}){let i=s=>at(c=>{let l=St(c);if(!l||te(l,t,n,!0))return;let{currentTime:u,volume:d,muted:f,playbackRate:m}=l;e({type:s,id:r.getId(l),currentTime:u,volume:d,muted:f,playbackRate:m})},o.media||500),a=[ce("play",i(0)),ce("pause",i(1)),ce("seeked",i(2)),ce("volumechange",i(3)),ce("ratechange",i(4))];return()=>{a.forEach(s=>s())}}function bc({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(c,l,u){let d=new i(c,l,u);return o.set(d,{family:c,buffer:typeof l!="string",descriptors:u,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),d};let a=be(t.fonts,"add",function(s){return function(c){return setTimeout(()=>{let l=o.get(c);l&&(e(l),o.delete(c))},0),s.apply(this,[c])}});return r.push(()=>{n.FontFace=i}),r.push(a),()=>{r.forEach(s=>s())}}function wc(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e,a=!0,s=()=>{let c=t.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;let l=[],u=c.rangeCount||0;for(let d=0;d<u;d++){let f=c.getRangeAt(d),{startContainer:m,startOffset:p,endContainer:g,endOffset:h}=f;te(m,r,o,!0)||te(g,r,o,!0)||l.push({start:n.getId(m),startOffset:p,end:n.getId(g),endOffset:h})}i({ranges:l})};return s(),ce("selectionchange",s)}function vc(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:m}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),n(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),r(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),o(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),i(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),a(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),s(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),c(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),l(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),u(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),d(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),f(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),m(...p)}}function Ti(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};vc(e,t);let r=vr(e,e.doc),o=uc(e),i=dc(e),a=Cr(e),s=fc(e),c=pc(e),l=yc(e),u=hc(e,{win:n}),d=Sr(e,e.doc),f=gc(e,{win:n}),m=e.collectFonts?bc(e):()=>{},p=wc(e),g=[];for(let h of e.plugins)g.push(h.observer(h.callback,n,h.options));return()=>{De.forEach(h=>h.reset()),r.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),f(),m(),p(),g.forEach(h=>h())}}var xt=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){let i=r||this.getIdToRemoteIdMap(t),a=o||this.getRemoteIdToIdMap(t),s=i.get(n);return s||(s=this.generateIdFn(),i.set(n,s),a.set(s,n)),s}getIds(t,n){let r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,o))}getRemoteId(t,n,r){let o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}};var cn=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new xt(fr),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new xt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(r=this.loadListener)===null||r===void 0||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){if(t.data.type==="rrweb"){if(!t.source)return;let r=this.crossOriginIframeMap.get(t.source);if(!r)return;let o=this.transformCrossOriginEvent(r,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}}transformCrossOriginEvent(t,n){var r;switch(n.type){case H.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t),{timestamp:n.timestamp,type:H.IncrementalSnapshot,data:{source:P.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case H.Meta:case H.Load:case H.DomContentLoaded:return!1;case H.Plugin:return n;case H.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case H.IncrementalSnapshot:switch(n.data.source){case P.Mutation:return n.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t)}),n.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),n.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),n.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case P.Drag:case P.TouchMove:case P.MouseMove:return n.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case P.ViewportResize:return!1;case P.MediaInteraction:case P.MouseInteraction:case P.Scroll:case P.CanvasMutation:case P.Input:return this.replaceIds(n.data,t,["id"]),n;case P.StyleSheetRule:case P.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case P.Font:return n;case P.Selection:return n.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),n;case P.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)===null||r===void 0||r.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),n}}}replace(t,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}};var un=class{constructor(t){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;let n=this;this.restorePatches.push(be(Element.prototype,"attachShadow",function(r){return function(o){let i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,n){Ye(t)&&(this.shadowDoms.has(t)||(this.shadowDoms.add(t),vr(Object.assign(Object.assign({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Cr(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),Sr({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)},0)))}observeAttachShadow(t){if(t.contentWindow){let n=this;this.restorePatches.push(be(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){let i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t()),this.shadowDoms=new WeakSet}};function Li(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Ni(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(u){try{l(r.next(u))}catch(d){a(d)}}function c(u){try{l(r.throw(u))}catch(d){a(d)}}function l(u){u.done?i(u.value):o(u.value).then(s,c)}l((r=r.apply(e,t||[])).next())})}var st="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cc=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(It=0;It<st.length;It++)Cc[st.charCodeAt(It)]=It;var It,Ri=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=st[t[n]>>2],o+=st[(t[n]&3)<<4|t[n+1]>>4],o+=st[(t[n+1]&15)<<2|t[n+2]>>6],o+=st[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o};var _i=new Map;function Sc(e,t){let n=_i.get(e);return n||(n=new Map,_i.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var xr=(e,t,n)=>{if(!e||!(Fi(e,t)||typeof e=="object"))return;let r=e.constructor.name,o=Sc(n,r),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function dn(e,t,n){if(e instanceof Array)return e.map(r=>dn(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let r=e.constructor.name,o=Ri(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[dn(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){let r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[dn(e.data,t,n),e.width,e.height]};if(Fi(e,t)||typeof e=="object"){let r=e.constructor.name,o=xr(e,t,n);return{rr_type:r,index:o}}}}return e}var fn=(e,t,n)=>[...e].map(r=>dn(r,t,n)),Fi=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function Oi(e,t,n,r){let o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let s=be(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...l){return te(this.canvas,n,r,!0)||setTimeout(()=>{let u=fn([...l],t,this);e(this.canvas,{type:Ne["2D"],property:a,args:u})},0),c.apply(this,l)}});o.push(s)}catch{let c=Ze(t.CanvasRenderingContext2D.prototype,a,{set(l){e(this.canvas,{type:Ne["2D"],property:a,args:[l],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function Ir(e,t,n){let r=[];try{let o=be(e.HTMLCanvasElement.prototype,"getContext",function(i){return function(a,...s){return te(this,t,n,!0)||"__context"in this||(this.__context=a),i.apply(this,[a,...s])}});r.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(o=>o())}}function $i(e,t,n,r,o,i,a){let s=[],c=Object.getOwnPropertyNames(e);for(let l of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let u=be(e,l,function(d){return function(...f){let m=d.apply(this,f);if(xr(m,a,this),!te(this.canvas,r,o,!0)){let p=fn([...f],a,this),g={type:t,property:l,args:p};n(this.canvas,g)}return m}});s.push(u)}catch{let d=Ze(e,l,{set(f){n(this.canvas,{type:t,property:l,args:[f],setter:!0})}});s.push(d)}return s}function Di(e,t,n,r,o){let i=[];return i.push(...$i(t.WebGLRenderingContext.prototype,Ne.WebGL,e,n,r,o,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...$i(t.WebGL2RenderingContext.prototype,Ne.WebGL2,e,n,r,o,t)),()=>{i.forEach(a=>a())}}var Er=null;try{Pi=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof Gn=="function"&&Gn("worker_threads"),Er=Pi.Worker}catch{}var Pi;function xc(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}function Wi(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=xc(e,o),a=i.indexOf(`
73
+ `,10)+1,s=i.substring(a)+(r?"//# sourceMappingURL="+r:"");return function(l){return new Er(s,Object.assign({},l,{eval:!0}))}}function Ic(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function Ec(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=Ic(e,o),a=i.indexOf(`
74
+ `,10)+1,s=i.substring(a)+(r?"//# sourceMappingURL="+r:""),c=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(c)}function Bi(e,t,n){var r;return function(i){return r=r||Ec(e,t,n),new Worker(r,i)}}var Ac=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";function Hi(){return Ac}function Ui(e,t,n){return Hi()?Wi(e,t,n):Bi(e,t,n)}var Vi=Ui("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1);var mn=class{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(c,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(l)};let{sampling:n="all",win:r,blockClass:o,blockSelector:i,recordCanvas:a,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&n==="all"&&this.initCanvasMutationObserver(r,o,i),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,n,r,o,i){let a=Ir(n,r,o),s=new Map,c=new Vi;c.onmessage=p=>{let{id:g}=p.data;if(s.set(g,!1),!("base64"in p.data))return;let{base64:h,type:y,width:v,height:b}=p.data;this.mutationCb({id:g,type:Ne["2D"],commands:[{property:"clearRect",args:[0,0,v,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:y}]},0,0]}]})};let l=1e3/t,u=0,d,f=()=>{let p=[];return n.document.querySelectorAll("canvas").forEach(g=>{te(g,r,o,!0)||p.push(g)}),p},m=p=>{if(u&&p-u<l){d=requestAnimationFrame(m);return}u=p,f().forEach(g=>Ni(this,void 0,void 0,function*(){var h;let y=this.mirror.getId(g);if(s.get(y))return;if(s.set(y,!0),["webgl","webgl2"].includes(g.__context)){let b=g.getContext(g.__context);((h=b?.getContextAttributes())===null||h===void 0?void 0:h.preserveDrawingBuffer)===!1&&b?.clear(b.COLOR_BUFFER_BIT)}let v=yield createImageBitmap(g);c.postMessage({id:y,bitmap:v,width:g.width,height:g.height,dataURLOptions:i.dataURLOptions},[v])})),d=requestAnimationFrame(m)};d=requestAnimationFrame(m),this.resetObservers=()=>{a(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=Ir(t,n,r),i=Oi(this.processMutation.bind(this),t,n,r),a=Di(this.processMutation.bind(this),t,n,r,this.mirror);this.resetObservers=()=>{o(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;let o=r.map(a=>Li(a,["type"])),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}};var pn=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Jt,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,styleIds:[]},o=[];for(let i of t){let a;if(this.styleMirror.has(i))a=this.styleMirror.getId(i);else{a=this.styleMirror.add(i);let s=Array.from(i.rules||CSSRule);o.push({styleId:a,rules:s.map((c,l)=>({rule:dr(c),index:l}))})}r.styleIds.push(a)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}};function oe(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}var ne,hn,Ar,gn=!1,we=fi();function Re(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:h,sampling:y={},dataURLOptions:v={},mousemoveWait:b,recordCanvas:w=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:I=!1,collectFonts:C=!1,inlineImages:E=!1,plugins:M,keepIframeSrcFn:O=()=>!1,ignoreCSSAttributes:D=new Set([])}=e,T=S?window.parent===window:!0,k=!1;if(!T)try{window.parent.document,k=!1}catch{k=!0}if(T&&!t)throw new Error("emit function is required");b!==void 0&&y.mousemove===void 0&&(y.mousemove=b),we.reset();let W=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},G=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};gi();let re,L=0,$=N=>{for(let J of M||[])J.eventProcessor&&(N=J.eventProcessor(N));return h&&(N=h(N)),N};ne=(N,J)=>{var Z;if(!((Z=De[0])===null||Z===void 0)&&Z.isFrozen()&&N.type!==H.FullSnapshot&&!(N.type===H.IncrementalSnapshot&&N.data.source===P.Mutation)&&De.forEach(U=>U.unfreeze()),T)t?.($(N),J);else if(k){let U={type:"rrweb",event:$(N),isCheckout:J};window.parent.postMessage(U,"*")}if(N.type===H.FullSnapshot)re=N,L=0;else if(N.type===H.IncrementalSnapshot){if(N.data.source===P.Mutation&&N.data.isAttachIframe)return;L++;let U=r&&L>=r,ie=n&&N.timestamp-re.timestamp>n;(U||ie)&&hn(!0)}};let _=N=>{ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.Mutation},N)}))},F=N=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.Scroll},N)})),z=N=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.CanvasMutation},N)})),B=N=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.AdoptedStyleSheet},N)})),q=new pn({mutationCb:_,adoptedStyleSheetCb:B}),j=new cn({mirror:we,mutationCb:_,stylesheetManager:q,recordCrossOriginIframes:S,wrappedEmit:ne});for(let N of M||[])N.getMirror&&N.getMirror({nodeMirror:we,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});Ar=new mn({recordCanvas:w,mutationCb:z,win:window,blockClass:o,blockSelector:i,mirror:we,sampling:y.canvas,dataURLOptions:v});let ee=new un({mutationCb:_,scrollCb:F,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:W,dataURLOptions:v,maskTextFn:p,maskInputFn:m,recordCanvas:w,inlineImages:E,sampling:y,slimDOMOptions:G,iframeManager:j,stylesheetManager:q,canvasManager:Ar,keepIframeSrcFn:O},mirror:we});hn=(N=!1)=>{var J,Z,U,ie,V,se;ne(oe({type:H.Meta,data:{href:window.location.href,width:en(),height:Qt()}}),N),q.reset(),De.forEach(Q=>Q.lock());let We=mi(document,{mirror:we,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:W,maskTextFn:p,slimDOM:G,dataURLOptions:v,recordCanvas:w,inlineImages:E,onSerialize:Q=>{nn(Q,we)&&j.addIframe(Q),rn(Q,we)&&q.trackLinkElement(Q),on(Q)&&ee.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,me)=>{j.attachIframe(Q,me),ee.observeAttachShadow(Q)},onStylesheetLoad:(Q,me)=>{q.attachLinkElement(Q,me)},keepIframeSrcFn:O});if(!We)return console.warn("Failed to snapshot the document");ne(oe({type:H.FullSnapshot,data:{node:We,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((Z=(J=document?.body)===null||J===void 0?void 0:J.parentElement)===null||Z===void 0?void 0:Z.scrollLeft)||((U=document?.body)===null||U===void 0?void 0:U.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((V=(ie=document?.body)===null||ie===void 0?void 0:ie.parentElement)===null||V===void 0?void 0:V.scrollTop)||((se=document?.body)===null||se===void 0?void 0:se.scrollTop)||0}}})),De.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,we.getId(document))};try{let N=[];N.push(ce("DOMContentLoaded",()=>{ne(oe({type:H.DomContentLoaded,data:{}}))}));let J=U=>{var ie;return Ti({mutationCb:_,mousemoveCb:(V,se)=>ne(oe({type:H.IncrementalSnapshot,data:{source:se,positions:V}})),mouseInteractionCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.MouseInteraction},V)})),scrollCb:F,viewportResizeCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.ViewportResize},V)})),inputCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.Input},V)})),mediaInteractionCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.MediaInteraction},V)})),styleSheetRuleCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.StyleSheetRule},V)})),styleDeclarationCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.StyleDeclaration},V)})),canvasMutationCb:z,fontCb:V=>ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.Font},V)})),selectionCb:V=>{ne(oe({type:H.IncrementalSnapshot,data:Object.assign({source:P.Selection},V)}))},blockClass:o,ignoreClass:a,maskTextClass:s,maskTextSelector:c,maskInputOptions:W,inlineStylesheet:l,sampling:y,recordCanvas:w,inlineImages:E,userTriggeredOnInput:I,collectFonts:C,doc:U,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:O,blockSelector:i,slimDOMOptions:G,dataURLOptions:v,mirror:we,iframeManager:j,stylesheetManager:q,shadowDomManager:ee,canvasManager:Ar,ignoreCSSAttributes:D,plugins:((ie=M?.filter(V=>V.observer))===null||ie===void 0?void 0:ie.map(V=>({observer:V.observer,options:V.options,callback:se=>ne(oe({type:H.Plugin,data:{plugin:V.name,payload:se}}))})))||[]},g)};j.addLoadListener(U=>{N.push(J(U.contentDocument))});let Z=()=>{hn(),N.push(J(document)),gn=!0};return document.readyState==="interactive"||document.readyState==="complete"?Z():N.push(ce("load",()=>{ne(oe({type:H.Load,data:{}})),Z()},window)),()=>{N.forEach(U=>U()),gn=!1}}catch(N){console.warn(N)}}Re.addCustomEvent=(e,t)=>{if(!gn)throw new Error("please add custom event after start recording");ne(oe({type:H.Custom,data:{tag:e,payload:t}}))};Re.freezePage=()=>{De.forEach(e=>e.freeze())};Re.takeFullSnapshot=e=>{if(!gn)throw new Error("please take full snapshot after start recording");hn(e)};Re.mirror=we;function kc(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`run-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function kr(){let e=x().sessionRecording;if(!e.active)try{let t=Re({emit:n=>e.buffer.push(n),collectFonts:!0,sampling:{mousemove:!1,mouseInteraction:!1}});t&&(e.active=!0,e.runId=kc(),e.stopFn=t)}catch{}}function Mr(){let e=x().sessionRecording;return!e.active||!e.runId||e.buffer.length===0?null:{events:e.buffer.splice(0),runId:e.runId}}function Tr(){return x().sessionRecording.active}var Mc=["backgroundColor","color","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","textDecoration","textTransform","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","borderRadius","borderColor","borderWidth","borderStyle","boxShadow","opacity","width","height","display","flexDirection","justifyContent","alignItems","gap"];function Tc(e,t){let n=t??Mc;if(e.ref||e.text||e.role||e.label||e.selector){let{element:i,matched:a}=xe(e);return{...Gi(i,e.ref,n),matched:a}}let r=He(),o=[];for(let[i,a]of r)a.isConnected&&o.push(Gi(a,i,n));return o}function Gi(e,t,n){let r=window.getComputedStyle(e),o={};t&&(o.ref=t),o.tag=e.tagName.toLowerCase();let i=e.textContent?.trim();i&&(o.text=i.length>60?i.slice(0,60)+"\u2026":i);for(let a of n){let s=r.getPropertyValue(a.replace(/([A-Z])/g,"-$1").toLowerCase());s&&(o[a]=s)}return o}var zi=25,yn=25,Et="__mindstudio_pending_nav",Yi=300,Rr=1e4;function Lc(e){try{let t=new URL(e,window.location.origin);return t.origin!==window.location.origin?!1:t.pathname===window.location.pathname&&t.search===window.location.search&&t.hash===window.location.hash}catch{return!1}}function qi(e){try{let t=new URL(e,window.location.origin);return t.origin!==window.location.origin?!1:(Lc(e)||(window.history.pushState(null,"",t.pathname+t.search+t.hash),window.dispatchEvent(new PopStateEvent("popstate"))),!0)}catch{return!1}}async function Lr(e=300,t=2e3){return new Promise(n=>{let r=Date.now()+t,o=Date.now(),i=tt(),a=window.scrollY,s=window.scrollX,c=document.body.scrollTop,l=document.documentElement.scrollTop,u=document.body.scrollHeight,d=document.body.scrollWidth,f=i.scrollTop,m=i.scrollLeft;function p(){if(Date.now()>r){n();return}let g=window.scrollY,h=window.scrollX,y=document.body.scrollTop,v=document.documentElement.scrollTop,b=document.body.scrollHeight,w=document.body.scrollWidth,S=i.scrollTop,I=i.scrollLeft;(g!==a||h!==s||y!==c||v!==l||b!==u||w!==d||S!==f||I!==m)&&(a=g,s=h,c=y,l=v,u=b,d=w,f=S,m=I,o=Date.now()),Date.now()-o>=e?n():requestAnimationFrame(p)}requestAnimationFrame(p)})}var Nc=150;async function Nr(e){let t=Rc(e),n=t.map(a=>({el:a,top:a.scrollTop,left:a.scrollLeft})),r=document.documentElement.style.scrollBehavior;document.documentElement.style.scrollBehavior="auto",e.scrollIntoView({block:"center",inline:"nearest",behavior:"instant"}),document.documentElement.style.scrollBehavior=r;let o=t.map(a=>({top:a.scrollTop,left:a.scrollLeft})),i=[];for(let a=0;a<t.length;a++)(n[a].top!==o[a].top||n[a].left!==o[a].left)&&i.push({el:t[a],fromTop:n[a].top,fromLeft:n[a].left,toTop:o[a].top,toLeft:o[a].left});if(i.length===0){await new Promise(a=>requestAnimationFrame(()=>a()));return}for(let a of i)a.el.scrollTop=a.fromTop,a.el.scrollLeft=a.fromLeft;await new Promise(a=>{let s=performance.now();function c(l){let u=l-s,d=Math.min(u/Nc,1),f=1-Math.pow(1-d,3);for(let m of i)m.el.scrollTop=m.fromTop+(m.toTop-m.fromTop)*f,m.el.scrollLeft=m.fromLeft+(m.toLeft-m.fromLeft)*f;d<1?requestAnimationFrame(c):a()}requestAnimationFrame(c)})}function Rc(e){let t=[],n=e.parentElement;for(;n;){let r=getComputedStyle(n),o=r.overflowY,i=r.overflowX;(o==="auto"||o==="scroll"||i==="auto"||i==="scroll")&&t.push(n),n=n.parentElement}return t.push(document.scrollingElement||document.documentElement),t}var _c=new Set(["click","type","select"]);function Fc(e){return e.some(t=>_c.has(t.command))}async function At(e,t){let n=Date.now(),r=[],o=[],i="",a=!1,s=new Set(["click","type","select"]),c=t.some(u=>s.has(u.command));c&&(wt(!0),sr()),qn(),Fc(t)&&kr();try{for(let u=0;u<t.length;u++){let d=t[u],f=d.command;try{if(u>0&&await le(zi+Math.random()*yn-yn/2),f==="navigate"){let p=d.url;if(!p)throw new Error('navigate command requires a "url" field');if(qi(p)){r.push({index:u,command:f,result:"ok"}),await le(Yi);continue}let g=t.slice(u+1);if(g.length>0)try{sessionStorage.setItem(Et,JSON.stringify({id:e,startTime:n,completedSteps:r,remainingSteps:g,stepOffset:u+1}))}catch{}r.push({index:u,command:f,result:"ok"}),a=!0,window.location.href=p,await new Promise((h,y)=>{setTimeout(()=>y(new Error("Navigation did not complete within timeout")),Rr)})}if(f==="reload"){let p=t.slice(u+1);if(p.length>0)try{sessionStorage.setItem(Et,JSON.stringify({id:e,startTime:n,completedSteps:r,remainingSteps:p,stepOffset:u+1}))}catch{}r.push({index:u,command:f,result:"ok"}),a=!0,window.location.reload(),await new Promise((g,h)=>{setTimeout(()=>h(new Error("Reload did not complete within timeout")),Rr)})}let m=await Zi(d);r.push({index:u,command:f,...m})}catch(m){r.push({index:u,command:f,error:m instanceof Error?m.message:String(m)});break}}try{i=await Ue()}catch{}}finally{o=jn(),c&&(wt(!1),Tr()?lr():Zt())}let l=Mr();return{id:e,steps:r,snapshot:i,logs:o,duration:Date.now()-n,...l?{events:l.events,runId:l.runId}:{}}}async function ji(){let e=null;try{let a=sessionStorage.getItem(Et);if(!a)return null;sessionStorage.removeItem(Et),e=JSON.parse(a)}catch{return null}if(!e)return null;let t=[...e.completedSteps],n=[],r="",o=e.remainingSteps.some(a=>a.command==="click"||a.command==="type"||a.command==="select");o&&(wt(!0),sr(),kr()),qn();try{for(let a=0;a<e.remainingSteps.length;a++){let s=e.remainingSteps[a],c=s.command,l=e.stepOffset+a;try{if(a>0&&await le(zi+Math.random()*yn-yn/2),c==="navigate"){let d=s.url;if(!d)throw new Error('navigate command requires a "url" field');if(qi(d)){t.push({index:l,command:c,result:"ok"}),await le(Yi);continue}let f=e.remainingSteps.slice(a+1);if(f.length>0)try{sessionStorage.setItem(Et,JSON.stringify({id:e.id,startTime:e.startTime,completedSteps:t,remainingSteps:f,stepOffset:l+1}))}catch{}t.push({index:l,command:c,result:"ok"}),window.location.href=d,await new Promise((m,p)=>{setTimeout(()=>p(new Error("Navigation did not complete within timeout")),Rr)})}let u=await Zi(s);t.push({index:l,command:c,...u})}catch(u){t.push({index:l,command:c,error:u instanceof Error?u.message:String(u)});break}}try{r=await Ue()}catch{}}finally{n=jn(),o&&(wt(!1),Tr()?lr():Zt())}let i=Mr();return{id:e.id,steps:t,snapshot:r,logs:n,duration:Date.now()-e.startTime,...i?{events:i.events,runId:i.runId}:{}}}async function Zi(e){switch(e.command){case"snapshot":return{result:await Ue()};case"click":{let{element:t,matched:n}=xe(e);return await Nr(t),await jt(t),await ii(),Qn(t),await Lr(),await le(250),{result:"ok",matched:n}}case"type":{let{element:t,matched:n}=xe(e),r=e.text;if(!r&&r!=="")throw new Error('type command requires a "text" field');return await Nr(t),await jt(t),await $o(t,r,{clear:!!e.clear}),await Lr(),{result:"ok",matched:n}}case"select":{let{element:t,matched:n}=xe(e),r=e.option;if(!r)throw new Error('select command requires an "option" field');await Nr(t),await jt(t);let o=Po(t,r);return await Lr(),{result:`selected "${o}"`,matched:n}}case"wait":{let{matched:t,elapsed:n}=await Do(e);return{result:"ok",matched:t,elapsed:n}}case"styles":{let t=e.properties;return{result:Tc(e,t)}}case"evaluate":{let t=e.script;if(!t)throw new Error('evaluate command requires a "script" field');return{result:await Wo(t)}}default:throw new Error(`Unknown command: ${e.command}`)}}var Oc="/__mindstudio_dev__/ws",$c=1e3,Dc=1e4;function Ki(){let e=x().ws;e.ws||(bo(wn),window.addEventListener("beforeunload",()=>{e.closing=!0,e.ws&&e.ws.close()}),Ji())}function wn(){let{ws:e}=x().ws;return e&&e.readyState===WebSocket.OPEN?e:null}function Pc(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${Oc}`}function Fr(){return window.parent!==window?"iframe":"standalone"}function Or(){try{return location.search.includes("ms_sandbox=1")?(sessionStorage.setItem("__ms_sandbox","1"),!0):sessionStorage.getItem("__ms_sandbox")==="1"}catch{return location.search.includes("ms_sandbox=1")}}function Ji(){let e=x().ws;if(!e.closing){try{e.ws=new WebSocket(Pc())}catch{Xi();return}e.ws.onopen=()=>{try{let t=(()=>{try{return sessionStorage.getItem("__ms_mirror")==="1"}catch{return!1}})();e.ws.send(JSON.stringify({type:"hello",mode:Fr(),url:location.href,viewport:{w:window.innerWidth,h:window.innerHeight},mirror:t,sandbox:Or()}))}catch{e.ws?.close()}},e.ws.onmessage=t=>{let n;try{n=JSON.parse(t.data)}catch{return}switch(n.type){case"ack":e.clientId=n.clientId,e.reconnectDelay=$c,Bc();break;case"command":Wc(n.id,n.steps);break;case"broadcast":Hc(n.action,n.payload);break}},e.ws.onclose=()=>{e.ws=null,e.clientId=null,e.closing||Xi()},e.ws.onerror=()=>{}}}function Xi(){let e=x().ws;e.closing||(setTimeout(()=>Ji(),e.reconnectDelay),e.reconnectDelay=Math.min(e.reconnectDelay*2,Dc))}async function Wc(e,t){let n=x().ws;if(n.busy){bn({id:e,steps:[],snapshot:"",logs:[],duration:0,error:"Browser agent is busy"});return}n.busy=!0,_r("command-started",{id:e,steps:t.map(r=>r.command)});try{let r=await At(e,t);bn(r),_r("command-completed",{id:e,success:!0})}catch{bn({id:e,steps:[],snapshot:"",logs:[],duration:0}),_r("command-completed",{id:e,success:!1})}finally{x().ws.busy=!1}}function bn(e){try{let t=wn();t&&t.send(JSON.stringify({type:"result",...e}))}catch{}}async function Bc(){let e=await ji();e&&bn(e)}function _r(e,t){window.parent!==window&&window.parent.postMessage({channel:"mindstudio-browser-agent",command:e,...t},"*")}function Hc(e,t){e==="reload"&&(document.cookie="__ms_auth=; Max-Age=0; Path=/; Secure; SameSite=None",location.href="/")}var lt="#DD2590",Qi="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",Uc=200,ea=`
75
75
  display: block;
76
76
  box-sizing: border-box;
77
- width: ${$c}px;
78
- background-color: ${st};
77
+ width: ${Uc}px;
78
+ background-color: ${lt};
79
79
  border-radius: 19px 120px 120px;
80
80
  font-weight: bold;
81
81
  padding: 8px 18px 10px 18px;
82
- font-family: ${ji};
82
+ font-family: ${Qi};
83
83
  font-size: 14px;
84
84
  line-height: 1.4;
85
85
  color: white;
@@ -88,16 +88,16 @@ or you can use record.mirror to access the mirror instance during recording.`,ci
88
88
  white-space: pre-wrap;
89
89
  transition: box-shadow 0.15s;
90
90
  -webkit-text-fill-color: white;
91
- `.trim(),At={inactive:"0 2px 6px rgba(0, 0, 0, 0.15)",selected:"rgba(221, 37, 144, 0.45) 0px 2px 12px, white 0px 0px 0px 3px",editing:"rgba(221, 37, 144, 0.45) 0px 2px 12px, white 0px 0px 0px 3px"},Dc=`
91
+ `.trim(),kt={inactive:"0 2px 6px rgba(0, 0, 0, 0.15)",selected:"rgba(221, 37, 144, 0.45) 0px 2px 12px, white 0px 0px 0px 3px",editing:"rgba(221, 37, 144, 0.45) 0px 2px 12px, white 0px 0px 0px 3px"},Vc=`
92
92
  position: absolute;
93
93
  top: -8px;
94
94
  right: -4px;
95
95
  width: 22px;
96
96
  height: 22px;
97
97
  background-color: white;
98
- color: ${st};
99
- -webkit-text-fill-color: ${st};
100
- border: 2px solid ${st};
98
+ color: ${lt};
99
+ -webkit-text-fill-color: ${lt};
100
+ border: 2px solid ${lt};
101
101
  border-radius: 50%;
102
102
  font-size: 12px;
103
103
  line-height: 16px;
@@ -106,9 +106,9 @@ or you can use record.mirror to access the mirror instance during recording.`,ci
106
106
  pointer-events: auto;
107
107
  display: none;
108
108
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
109
- font-family: ${ji};
109
+ font-family: ${Qi};
110
110
  font-weight: bold;
111
- `.trim();function Ki(){let e=document.createElement("div");return e.dataset.deleteBtn="true",e.innerHTML="\xD7",e.style.cssText=Dc,e}function Xi(e,t){let n=`note-${++x().noteElement.counter}`,r=document.createElement("div");r.id=n,r.dataset.noteId=n,r.style.cssText=`
111
+ `.trim();function ta(){let e=document.createElement("div");return e.dataset.deleteBtn="true",e.innerHTML="\xD7",e.style.cssText=Vc,e}function na(e,t){let n=`note-${++x().noteElement.counter}`,r=document.createElement("div");r.id=n,r.dataset.noteId=n,r.style.cssText=`
112
112
  position: absolute;
113
113
  left: ${e}px;
114
114
  top: ${t}px;
@@ -117,7 +117,7 @@ or you can use record.mirror to access the mirror instance during recording.`,ci
117
117
  `;let o=document.createElement("div");o.style.cssText=`
118
118
  width: 14px;
119
119
  height: 14px;
120
- background-color: ${st};
120
+ background-color: ${lt};
121
121
  border: 2px solid white;
122
122
  border-radius: 50%;
123
123
  box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px;
@@ -127,10 +127,10 @@ or you can use record.mirror to access the mirror instance during recording.`,ci
127
127
  pointer-events: none;
128
128
  z-index: 2;
129
129
  `;let i=document.createElement("div");i.style.cssText="position: relative;";let a=document.createElement("div");a.dataset.bubble="true",a.style.cssText=`
130
- ${Zi}
131
- box-shadow: ${At.inactive};
130
+ ${ea}
131
+ box-shadow: ${kt.inactive};
132
132
  cursor: grab;
133
- `;let s=Ki();return i.appendChild(a),i.appendChild(s),r.appendChild(o),r.appendChild(i),{id:n,type:"pin",x:e,y:t,element:r,bubble:a,deleteBtn:s,state:"inactive"}}function Ji(e,t,n,r){let o=`note-${++x().noteElement.counter}`,i=document.createElement("div");i.id=o,i.dataset.noteId=o,i.style.cssText=`
133
+ `;let s=ta();return i.appendChild(a),i.appendChild(s),r.appendChild(o),r.appendChild(i),{id:n,type:"pin",x:e,y:t,element:r,bubble:a,deleteBtn:s,state:"inactive"}}function ra(e,t,n,r){let o=`note-${++x().noteElement.counter}`,i=document.createElement("div");i.id=o,i.dataset.noteId=o,i.style.cssText=`
134
134
  position: absolute;
135
135
  left: ${e}px;
136
136
  top: ${t}px;
@@ -139,7 +139,7 @@ or you can use record.mirror to access the mirror instance during recording.`,ci
139
139
  `;let a=document.createElement("div");a.style.cssText=`
140
140
  width: ${n}px;
141
141
  height: ${r}px;
142
- border: 4px dashed ${st};
142
+ border: 4px dashed ${lt};
143
143
  border-radius: 12px;
144
144
  pointer-events: none;
145
145
  `;let l=t+r+8+60>window.innerHeight,u=document.createElement("div");u.style.cssText=`
@@ -147,13 +147,13 @@ or you can use record.mirror to access the mirror instance during recording.`,ci
147
147
  left: 0;
148
148
  ${l?`bottom: ${r+8}px`:`top: ${r+8}px`};
149
149
  `;let d=document.createElement("div");d.dataset.bubble="true",d.style.cssText=`
150
- ${Zi}
151
- box-shadow: ${At.inactive};
150
+ ${ea}
151
+ box-shadow: ${kt.inactive};
152
152
  cursor: grab;
153
- `;let f=Ki();return u.appendChild(d),u.appendChild(f),i.appendChild(a),i.appendChild(u),{id:o,type:"area",x:e,y:t,width:n,height:r,element:i,bubble:d,deleteBtn:f,state:"inactive"}}function Qi(e){e.state="selected",e.bubble.contentEditable="false",e.bubble.style.boxShadow=At.selected,e.bubble.style.cursor="grab",e.deleteBtn.style.display="block"}function yn(e){e.state="editing",e.bubble.contentEditable="true",e.bubble.style.boxShadow=At.editing,e.bubble.style.cursor="text",e.deleteBtn.style.display="block",e.bubble.focus();let t=window.getSelection();t&&(t.selectAllChildren(e.bubble),t.collapseToEnd())}function lt(e){return e.bubble.textContent?.trim()||""?(e.state="inactive",e.bubble.contentEditable="false",e.bubble.style.boxShadow=At.inactive,e.bubble.style.cursor="grab",e.deleteBtn.style.display="none",!0):!1}var Rr="#DD2590",Pc="__mindstudio-notes-host",Wc=5,Bc=`<svg width="25" height="26" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
153
+ `;let f=ta();return u.appendChild(d),u.appendChild(f),i.appendChild(a),i.appendChild(u),{id:o,type:"area",x:e,y:t,width:n,height:r,element:i,bubble:d,deleteBtn:f,state:"inactive"}}function oa(e){e.state="selected",e.bubble.contentEditable="false",e.bubble.style.boxShadow=kt.selected,e.bubble.style.cursor="grab",e.deleteBtn.style.display="block"}function vn(e){e.state="editing",e.bubble.contentEditable="true",e.bubble.style.boxShadow=kt.editing,e.bubble.style.cursor="text",e.deleteBtn.style.display="block",e.bubble.focus();let t=window.getSelection();t&&(t.selectAllChildren(e.bubble),t.collapseToEnd())}function ct(e){return e.bubble.textContent?.trim()||""?(e.state="inactive",e.bubble.contentEditable="false",e.bubble.style.boxShadow=kt.inactive,e.bubble.style.cursor="grab",e.deleteBtn.style.display="none",!0):!1}var $r="#DD2590",Gc="__mindstudio-notes-host",zc=5,Yc=`<svg width="25" height="26" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
154
154
  <g filter="url(#filter0_d_notes)">
155
- <path d="M12.5448 26L6.72762 5.59339L26 14.8132L17.1816 17.9377L12.5448 26Z" fill="${Rr}"/>
156
- <path d="M6.9457 5.14539L26.2178 14.3651L27.2985 14.8826L26.1697 15.2813L17.5259 18.3444L12.9812 26.2464L12.3881 27.2792L12.0614 26.1349L6.24434 5.72851L5.94119 4.66488L6.9457 5.14539Z" stroke="${Rr}"/>
155
+ <path d="M12.5448 26L6.72762 5.59339L26 14.8132L17.1816 17.9377L12.5448 26Z" fill="${$r}"/>
156
+ <path d="M6.9457 5.14539L26.2178 14.3651L27.2985 14.8826L26.1697 15.2813L17.5259 18.3444L12.9812 26.2464L12.3881 27.2792L12.0614 26.1349L6.24434 5.72851L5.94119 4.66488L6.9457 5.14539Z" stroke="${$r}"/>
157
157
  </g>
158
158
  <defs>
159
159
  <filter id="filter0_d_notes" x="3.15491" y="2.73625" width="27.442" height="28.8217" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
@@ -167,7 +167,7 @@ or you can use record.mirror to access the mirror instance during recording.`,ci
167
167
  <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
168
168
  </filter>
169
169
  </defs>
170
- </svg>`,bn=null;function ta(){let e=x().noteLayer;if(e.overlay)return;bn=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden";let t=document.createElement("div");t.id=Pc,t.style.cssText="position: fixed; inset: 0; z-index: 2147483646; pointer-events: none;";let n=t.attachShadow({mode:"open"}),r=document.createElement("style");r.textContent=`
170
+ </svg>`,Cn=null;function aa(){let e=x().noteLayer;if(e.overlay)return;Cn=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden";let t=document.createElement("div");t.id=Gc,t.style.cssText="position: fixed; inset: 0; z-index: 2147483646; pointer-events: none;";let n=t.attachShadow({mode:"open"}),r=document.createElement("style");r.textContent=`
171
171
  .overlay {
172
172
  position: fixed;
173
173
  inset: 0;
@@ -186,19 +186,19 @@ or you can use record.mirror to access the mirror instance during recording.`,ci
186
186
  }
187
187
  .drag-preview {
188
188
  position: fixed;
189
- border: 4px dashed ${Rr};
189
+ border: 4px dashed ${$r};
190
190
  border-radius: 12px;
191
191
  pointer-events: none;
192
192
  z-index: 2;
193
193
  }
194
- `,n.appendChild(r);let o=document.createElement("div");o.className="overlay";let i=document.createElement("div");i.className="cursor",i.innerHTML=Bc,n.appendChild(o),n.appendChild(i),e.host=t,e.overlay=o,e.cursorEl=i,o.addEventListener("pointerdown",ia),o.addEventListener("pointermove",oa),document.addEventListener("pointermove",aa,{capture:!0}),document.addEventListener("pointerup",sa,{capture:!0}),document.addEventListener("pointercancel",la,{capture:!0}),document.addEventListener("keydown",_r),document.addEventListener("keydown",ct,{capture:!0}),document.addEventListener("keypress",ct,{capture:!0}),document.addEventListener("keyup",ct,{capture:!0}),document.body.appendChild(t)}function na(){let e=x().noteLayer;document.removeEventListener("pointermove",aa,{capture:!0}),document.removeEventListener("pointerup",sa,{capture:!0}),document.removeEventListener("pointercancel",la,{capture:!0}),document.removeEventListener("keydown",_r),document.removeEventListener("keydown",ct,{capture:!0}),document.removeEventListener("keypress",ct,{capture:!0}),document.removeEventListener("keyup",ct,{capture:!0}),e.overlay&&(e.overlay.removeEventListener("pointerdown",ia),e.overlay.removeEventListener("pointermove",oa),e.overlay=null),e.cursorEl&&(e.cursorEl=null),e.host&&(e.host.remove(),e.host=null),bn!==null&&(document.documentElement.style.overflow=bn,bn=null),e.notes=[],e.currentNote=null,ut()}function ra(){let e=x().noteLayer;e.cursorEl&&(e.cursorEl.style.display="none"),e.movingNote=null,e.consumedByDeactivation=!1,ut()}function oa(e){let t=x().noteLayer;if(!t.cursorEl||!t.overlay)return;t.cursorEl.style.left=`${e.clientX}px`,t.cursorEl.style.top=`${e.clientY}px`,ca(e.target)?(t.cursorEl.style.display="none",t.overlay.style.cursor=""):(t.cursorEl.style.display="",t.overlay.style.cursor="none")}function ia(e){let t=x().noteLayer;if(!t.overlay)return;let n=e.target;if(n.dataset?.deleteBtn==="true"||n.closest("[data-delete-btn]")){let o=n.closest("[data-note-id]");if(o){let i=t.notes.find(a=>a.id===o.id);if(i){Ke(i),e.preventDefault(),e.stopPropagation();return}}}t.overlay.setPointerCapture(e.pointerId);let r=ca(e.target);if(r){if(r.state==="editing")return;if(r.state==="selected"){let o=e.target;if(o.dataset?.bubble==="true"||o.closest("[data-bubble]")){yn(r),t.currentNote=r,e.preventDefault();return}ea(r,e),e.preventDefault();return}t.currentNote&&t.currentNote!==r&&(lt(t.currentNote)||Ke(t.currentNote)),Qi(r),t.currentNote=r,ea(r,e),e.preventDefault();return}if(t.currentNote&&(t.currentNote.state==="editing"||t.currentNote.state==="selected")){lt(t.currentNote)||Ke(t.currentNote),t.currentNote=null,t.consumedByDeactivation=!0,e.preventDefault();return}t.pointerDown=!0,t.startX=e.clientX,t.startY=e.clientY,t.didDrag=!1,t.consumedByDeactivation=!1,e.preventDefault()}function aa(e){let t=x().noteLayer;if(t.movingNote){let o=e.clientX-t.moveOffsetX,i=e.clientY-t.moveOffsetY;t.movingNote.x=o,t.movingNote.y=i,t.movingNote.element.style.left=`${o}px`,t.movingNote.element.style.top=`${i}px`;return}if(!t.pointerDown||!t.overlay)return;let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.sqrt(n*n+r*r)>Wc&&(t.didDrag=!0,t.dragPreview||(t.dragPreview=document.createElement("div"),t.dragPreview.className="drag-preview",t.overlay.appendChild(t.dragPreview)),t.dragPreview.style.left=`${Math.min(t.startX,e.clientX)}px`,t.dragPreview.style.top=`${Math.min(t.startY,e.clientY)}px`,t.dragPreview.style.width=`${Math.abs(n)}px`,t.dragPreview.style.height=`${Math.abs(r)}px`)}function sa(e){let t=x().noteLayer;if(t.overlay)try{t.overlay.releasePointerCapture(e.pointerId)}catch{}if(t.movingNote){t.movingNote=null;return}if(t.consumedByDeactivation){t.consumedByDeactivation=!1,ut();return}if(!t.pointerDown||!t.overlay){ut();return}if(t.didDrag){t.dragPreview&&(t.dragPreview.remove(),t.dragPreview=null);let n=Math.min(t.startX,e.clientX),r=Math.min(t.startY,e.clientY),o=Math.abs(e.clientX-t.startX),i=Math.abs(e.clientY-t.startY);if(o>10&&i>10){let a=Ji(n,r,o,i);t.overlay.appendChild(a.element),t.notes.push(a),yn(a),t.currentNote=a}}else{let n=Xi(e.clientX,e.clientY);t.overlay.appendChild(n.element),t.notes.push(n),yn(n),t.currentNote=n}ut()}function la(){let e=x().noteLayer;e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null),e.movingNote=null,ut()}function _r(e){let t=x().noteLayer;if(t.currentNote){if(e.key==="Enter"&&!e.shiftKey&&t.currentNote.state==="editing"){lt(t.currentNote)||Ke(t.currentNote),t.currentNote=null,e.preventDefault();return}if(e.key==="Escape"){t.currentNote.state==="editing"?(lt(t.currentNote)||Ke(t.currentNote),t.currentNote=null):t.currentNote.state==="selected"&&(lt(t.currentNote),t.currentNote=null),e.preventDefault();return}if(t.currentNote.state==="selected"&&(e.key==="Delete"||e.key==="Backspace")){Ke(t.currentNote),t.currentNote=null,e.preventDefault();return}t.currentNote.state==="editing"&&(e.key==="Backspace"||e.key==="Delete")&&t.currentNote.bubble.textContent?.trim()===""&&(Ke(t.currentNote),t.currentNote=null,e.preventDefault())}}function ct(e){!x().notesMode.active||!e.composedPath().some(n=>n instanceof HTMLElement&&n.dataset?.bubble==="true"&&n.isContentEditable)||(e.type==="keydown"&&_r(e),e.stopImmediatePropagation())}function ea(e,t){let n=x().noteLayer;n.movingNote=e,n.moveOffsetX=t.clientX-e.x,n.moveOffsetY=t.clientY-e.y}function ca(e){let t=x().noteLayer;for(let n of t.notes)if(n.element.contains(e))return n;return null}function Ke(e){let t=x().noteLayer;e.element.remove(),t.notes=t.notes.filter(n=>n.id!==e.id),t.currentNote===e&&(t.currentNote=null)}function ut(){let e=x().noteLayer;e.pointerDown=!1,e.startX=0,e.startY=0,e.didDrag=!1,e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null)}var Hc=Object.defineProperty,fe=(e,t)=>()=>(e&&(t=e(e=0)),t),_t=(e,t)=>{for(var n in t)Hc(e,n,{get:t[n],enumerable:!0})};function Uc(e){if(e===!0)return"soft";if(e===!1)return"disabled";if(typeof e=="string"){let t=e.toLowerCase().trim();if(t==="auto")return"auto";if(t==="full")return"full";if(t==="soft"||t==="disabled")return t}return"soft"}function Vc(e="soft"){switch(A.session.__counterEpoch=(A.session.__counterEpoch||0)+1,e){case"auto":{A.session.styleMap=new Map,A.session.nodeMap=new Map;return}case"soft":{A.session.styleMap=new Map,A.session.nodeMap=new Map,A.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{A.session.styleMap=new Map,A.session.nodeMap=new Map,A.session.styleCache=new WeakMap,A.computedStyle=new WeakMap,A.baseStyle=new ge(50),A.defaultStyle=new ge(30),A.image=new ge(100),A.background=new ge(100),A.resource=new ge(150),A.font=new Set;return}default:{A.session.styleMap=new Map,A.session.nodeMap=new Map,A.session.styleCache=new WeakMap;return}}}var ge,A,Ce=fe(()=>{ge=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let n=this.keys().next().value;n!==void 0&&this.delete(n)}return super.set(e,t)}},A={image:new ge(100),background:new ge(100),resource:new ge(150),defaultStyle:new ge(30),baseStyle:new ge(50),computedStyle:new WeakMap,measureHints:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function jr(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith("#")?null:n}function Gc(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let o=r.split(",").map(i=>i.trim());return o.length!==6?`matrix(${r})`:(o[4]="0",o[5]="0",`matrix(${o.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let o=r.split(",").map(i=>i.trim());return o.length!==16?`matrix3d(${r})`:(o[12]="0",o[13]="0",`matrix3d(${o.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function An(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function zc(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let n=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,n).href}catch{return e}}var kn=fe(()=>{});function qc(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:n=12}={}){let r=new Map,o=0;function i(a,s,c){if(o>=n)return;let l=Date.now();(r.get(s)||0)>l||(r.set(s,l+t),o++,a==="warn"&&console&&console.warn?console.warn(`${e} ${c}`):console&&console.error&&console.error(`${e} ${c}`))}return{warnOnce(a,s){i("warn",a,s)},errorOnce(a,s){i("error",a,s)},reset(){r.clear(),o=0}}}function Yc(e){return/^data:|^blob:|^about:blank$/i.test(e)}function jc(e,t){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=t.includes("{url}")?t.split("{url}")[0]:t,o=new URL(r||".",n),i=new URL(e,n);if(i.origin===o.origin)return!0;let a=i.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function Zc(e,t){if(!t||Yc(e)||jc(e,t))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(e,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!t}}function Kc(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",An(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${An(e)}`;let n=t.includes("?")?"&":"?";return`${t}${n}url=${encodeURIComponent(e)}`}function ua(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(e)})}function Xc(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function ve(e,t={}){let n=t.as??"blob",r=t.timeout??3e3,o=t.useProxy||"",i=t.errorTTL??8e3,a=t.headers||{},s=!!t.silent;if(/^data:/i.test(e))try{if(n==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,h="",y=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],v=/;base64/i.test(h)?atob(y):decodeURIComponent(y),b=new Uint8Array([...v].map(S=>S.charCodeAt(0))),w=new Blob([b],{type:(h||"").split(";")[0]||""});return{ok:!0,data:w,status:200,url:e,fromCache:!1,mime:w.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let h=await fetch(e);if(!h.ok)return{ok:!1,data:null,status:h.status,url:e,fromCache:!1,reason:"http_error"};let y=await h.blob(),v=y.type||h.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await ua(y),status:h.status,url:e,fromCache:!1,mime:v}:n==="text"?{ok:!0,data:await y.text(),status:h.status,url:e,fromCache:!1,mime:v}:{ok:!0,data:y,status:h.status,url:e,fromCache:!1,mime:v}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let c=Xc(e,{as:n,timeout:r,useProxy:o,errorTTL:i}),l=kt.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&kt.delete(c);let u=vn.get(c);if(u)return u;let d=Zc(e,o)?Kc(e,o):e,f=t.credentials;if(!f)try{let h=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(e,h);f=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{f="omit"}let m=new AbortController,p=setTimeout(()=>m.abort("timeout"),r),g=(async()=>{try{let h=await fetch(d,{signal:m.signal,credentials:f,headers:a});if(!h.ok){let b={ok:!1,data:null,status:h.status,url:d,fromCache:!1,reason:"http_error"};if(i>0&&kt.set(c,{until:Date.now()+i,result:b}),!s){let w=`${h.status} ${h.statusText||""}`.trim();$r.warnOnce(`http:${h.status}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${w} while fetching ${n} ${e}`)}return t.onError&&t.onError(b),b}if(n==="text")return{ok:!0,data:await h.text(),status:h.status,url:d,fromCache:!1};let y=await h.blob(),v=y.type||h.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await ua(y),status:h.status,url:d,fromCache:!1,mime:v}:{ok:!0,data:y,status:h.status,url:d,fromCache:!1,mime:v}}catch(h){let y=h&&typeof h=="object"&&"name"in h&&h.name==="AbortError"?String(h.message||"").includes("timeout")?"timeout":"abort":"network",v={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&i>0&&kt.set(c,{until:Date.now()+i,result:v}),!s){let b=`${y}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,w=y==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${e}`:y==="abort"?`Request aborted while fetching ${n} ${e}`:`Network/CORS issue while fetching ${n} ${e}. A proxy may be required`;$r.errorOnce(b,w)}return t.onError&&t.onError(v),v}finally{clearTimeout(p),vn.delete(c)}})();return vn.set(c,g),g}var $r,vn,kt,ht=fe(()=>{kn(),$r=qc("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),vn=new Map,kt=new Map});async function Fa(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let n=jr(e);if(!n)return e;let r=zc(n),o=An(r);if(A.background.has(o)){let i=A.background.get(o);return i?`url("${i}")`:"none"}try{let i=await ve(o,{as:"dataURL",useProxy:t.useProxy});return i.ok?(A.background.set(o,i.data),`url("${i.data}")`):(A.background.set(o,null),"none")}catch{return A.background.set(o,null),"none"}}var Jc=fe(()=>{Ce(),kn(),ht()});function Qc(e){if(e=String(e).toLowerCase(),Kr.has(e)){let i={};return A.defaultStyle.set(e,i),i}if(A.defaultStyle.has(e))return A.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let n=document.createElement(e);n.style.all="initial",t.appendChild(n);let r=getComputedStyle(n),o={};for(let i of r){if(Zr(i))continue;let a=r.getPropertyValue(i);o[i]=a}return t.removeChild(n),A.defaultStyle.set(e,o),o}function Zr(e){let t=String(e).toLowerCase();return!!(Pa.has(t)||Da.test(t)||$a.test(t))}function Dr(e,t){if(t=String(t||"").toLowerCase(),Kr.has(t))return"";let n=[],r=Qc(t),o=(e.display||"").toLowerCase()==="inline"||new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]).has(t);for(let[i,a]of Object.entries(e)){if(Zr(i)||o&&(i==="width"||i==="min-width"||i==="max-width"))continue;let s=r[i];a&&a!==s&&n.push(`${i}:${a}`)}return n.sort(),n.join(";")}function eu(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(n=>t.add(n.tagName.toLowerCase())),Array.from(t))}function tu(e){let t=new Map;for(let r of e){let o=A.defaultStyle.get(r);if(!o)continue;let i=Object.entries(o).map(([a,s])=>`${a}:${s};`).sort().join("");i&&(t.has(i)||t.set(i,[]),t.get(i).push(r))}let n="";for(let[r,o]of t.entries())n+=`${o.join(",")} { ${r} }
195
- `;return n}function nu(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let o of t)n.set(o,`c${r++}`);return n}function ru(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let n=t.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let r=0;r<window.frames.length;r++)try{if(window.frames[r]?.document===t)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function Fe(e,t=null){let n=()=>{let i={length:0,getPropertyValue:()=>"",item:()=>""};return i[Symbol.iterator]=function*(){},i};if(!(e instanceof Element)){let i=typeof window<"u"?window:null;if(i&&typeof i.getComputedStyle=="function")try{return i.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=A.computedStyle.get(e);r||(r=new Map,A.computedStyle.set(e,r));let o=r.get(t);if(!o){let i=ru(e),a=null;try{a=i&&typeof i.getComputedStyle=="function"?i.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}o=a||n(),r.set(t,o)}return o}function da(e){let t={};for(let n of e)t[n]=e.getPropertyValue(n);return t}function Pr(e){let t=[],n=0,r=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&n++,i===")"&&n--,i===","&&n===0&&(t.push(e.slice(r,o).trim()),r=o+1)}return t.push(e.slice(r).trim()),t}var Oa,Kr,ou,$a,Da,Pa,Wa=fe(()=>{Ce(),Oa=new Set(["meta","script","noscript","title","link","template"]),Kr=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),ou=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"],$a=/(?:^|-)(animation|transition)(?:-|$)/i,Da=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Pa=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom"])});function mt(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function iu(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),n=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||n}function Je(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),n=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),r=/applewebkit/i.test(e),o=/mobile/i.test(e),i=!/safari/i.test(e),a=r&&o&&i,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),l=/ipad|iphone|ipod/.test(t)&&r;return n||a||s||c||l}function au(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var Ft=fe(()=>{});function X(e,t,n){let r=e&&typeof e=="object"&&(e.options||e);r&&r.debug&&(n!==void 0?console.warn("[snapdom]",t,n):console.warn("[snapdom]",t))}var Ba=fe(()=>{}),Ee=fe(()=>{Jc(),Wa(),Ft(),kn(),Ba()}),Ha={};_t(Ha,{toCanvas:()=>Tn});function su(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function lu(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function cu(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function uu(e){let t=[],n="",r=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&r++,i===")"&&(r=Math.max(0,r-1)),i===";"&&r===0?(t.push(n),n=""):n+=i}return n.trim()&&t.push(n),t.map(o=>o.trim()).filter(Boolean)}function du(e){let t=[],n="",r=0;for(let i=0;i<e.length;i++){let a=e[i];a==="("&&r++,a===")"&&(r=Math.max(0,r-1)),a===","&&r===0?(t.push(n.trim()),n=""):n+=a}n.trim()&&t.push(n.trim());let o=[];for(let i of t){if(/\binset\b/i.test(i))continue;let a=i.match(/-?\d+(?:\.\d+)?px/gi)||[],[s="0px",c="0px",l="0px"]=a,u=i.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!u&&u!==",";o.push(`drop-shadow(${s} ${c} ${l}${d?` ${u}`:""})`)}return o.join(" ")}function Ua(e){let t=uu(e),n=null,r=null,o=null,i=[];for(let s of t){let c=s.indexOf(":");if(c<0)continue;let l=s.slice(0,c).trim().toLowerCase(),u=s.slice(c+1).trim();l==="box-shadow"?o=u:l==="filter"?n=u:l==="-webkit-filter"?r=u:i.push([l,u])}if(o){let s=du(o);s&&(n=n?`${n} ${s}`:s,r=r?`${r} ${s}`:s)}let a=[...i];return n&&a.push(["filter",n]),r&&a.push(["-webkit-filter",r]),a.map(([s,c])=>`${s}:${c}`).join(";")}function fu(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,n,r)=>`${n}{${Ua(r)}}`)}function mu(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,n)=>t.replace(n,fu(n))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,n,r)=>`style=${n}${Ua(r)}${n}`),e}function pu(e){if(!Je()||!su(e))return e;try{let t=lu(e),n=mu(t);return cu(n)}catch{return e}}async function Tn(e,t){let{width:n,height:r,scale:o=1,dpr:i=1,meta:a={},backgroundColor:s}=t;e=pu(e);let c=new Image;c.loading="eager",c.decoding="sync",c.crossOrigin="anonymous",c.src=e,await c.decode();let l=c.naturalWidth,u=c.naturalHeight,d=Number.isFinite(a.w0)?a.w0:l,f=Number.isFinite(a.h0)?a.h0:u,m,p,g=Number.isFinite(n),h=Number.isFinite(r);if(g&&h)m=Math.max(1,n),p=Math.max(1,r);else if(g){let b=n/Math.max(1,d);m=n,p=f*b}else if(h){let b=r/Math.max(1,f);p=r,m=d*b}else m=l,p=u;m=m*o,p=p*o;let y=document.createElement("canvas");y.width=m*i,y.height=p*i,y.style.width=`${m}px`,y.style.height=`${p}px`;let v=y.getContext("2d");return i!==1&&v.scale(i,i),s&&(v.save(),v.fillStyle=s,v.fillRect(0,0,m,p),v.restore()),v.drawImage(c,0,0,m,p),y}var Ln=fe(()=>{Ft()}),Cn={};_t(Cn,{rasterize:()=>Va});async function Va(e,t){let n=await Tn(e,t),r=new Image;return r.src=n.toDataURL(`image/${t.format}`,t.quality),await r.decode(),r.style.width=`${n.width/t.dpr}px`,r.style.height=`${n.height/t.dpr}px`,r}var Sn=fe(()=>{Ln()}),Wr={};_t(Wr,{toImg:()=>fa,toSvg:()=>fa});async function fa(e,t){let{scale:n=1,width:r,height:o,meta:i={}}=t,a=Number.isFinite(r),s=Number.isFinite(o),c=Number.isFinite(n)&&n!==1||a||s;if(Je()&&c)return await Va(e,{...t,format:"png",quality:1,meta:i});let l=new Image;if(l.decoding="sync",l.loading="eager",l.src=e,await l.decode(),a&&s)l.style.width=`${r}px`,l.style.height=`${o}px`;else if(a){let u=Number.isFinite(i.w0)?i.w0:l.naturalWidth,d=Number.isFinite(i.h0)?i.h0:l.naturalHeight,f=r/Math.max(1,u);l.style.width=`${r}px`,l.style.height=`${Math.round(d*f)}px`}else if(s){let u=Number.isFinite(i.w0)?i.w0:l.naturalWidth,d=Number.isFinite(i.h0)?i.h0:l.naturalHeight,f=o/Math.max(1,d);l.style.height=`${o}px`,l.style.width=`${Math.round(u*f)}px`}else{let u=Math.round(l.naturalWidth*n),d=Math.round(l.naturalHeight*n);if(l.style.width=`${u}px`,l.style.height=`${d}px`,typeof e=="string"&&e.startsWith("data:image/svg+xml"))try{let f=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${u}"`).replace(/height="[^"]*"/,`height="${d}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,l.src=e}catch(f){X(t,"SVG width/height patch in toImg failed",f)}}return l}var ma=fe(()=>{Ee(),Sn()}),Ga={};_t(Ga,{toBlob:()=>za});async function za(e,t){let n=t.type;if(n==="svg"){let o=decodeURIComponent(e.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let r=await Tn(e,t);return new Promise(o=>r.toBlob(i=>o(i),`image/${n}`,t.quality))}var qa=fe(()=>{Ln()}),Ya={};_t(Ya,{download:()=>hu});async function pa(e,t){let n=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:t})}catch(r){if(r.name!=="AbortError")return!1}return!0}async function hu(e,t){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(t?.type||"").toLowerCase(),o=n.has(r)?r:"",i=(t?.format||o||"").toLowerCase(),a=i==="jpg"?"jpeg":i||"png",s=t?.filename||`snapdom.${a}`,c={...t||{},format:a,type:a};c.dpr=1;let l=iu();if(a==="svg"){let f=await za(e,{...c,type:"svg"});if(l&&await pa(f,s))return;let m=URL.createObjectURL(f),p=document.createElement("a");p.href=m,p.download=s,document.body.appendChild(p),p.click(),URL.revokeObjectURL(m),p.remove();return}let u=await Tn(e,c);if(l){let f=`image/${a}`,m=await new Promise(p=>u.toBlob(p,f,t?.quality));if(m&&await pa(m,s))return}let d=document.createElement("a");d.href=u.toDataURL(`image/${a}`,t?.quality),d.download=s,document.body.appendChild(d),d.click(),d.remove()}var gu=fe(()=>{qa(),Ln(),Ft()});Ee();Ee();Ce();var ha=new WeakMap,Nt=new Map,yu=2e3,Br=0;function Tt(){Br++,Nt.size>yu&&Nt.clear()}var ga=!1;function bu(e=document.documentElement){if(!ga){ga=!0;try{new MutationObserver(()=>Tt()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>Tt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",Tt),t.ready?.then(()=>Tt()).catch(()=>{}))}catch{}}}function wu(e,t={}){let n={},r=e.getPropertyValue("visibility"),o=t.excludeStyleProps;for(let d=0;d<e.length;d++){let f=e[d];if(Zr(f)||o&&(o instanceof RegExp&&o.test(f)||typeof o=="function"&&o(f)))continue;let m=e.getPropertyValue(f);(f==="background-image"||f==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),n[f]=m}let i=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let d of i)if(!n[d])try{let f=e.getPropertyValue(d);f&&(n[d]=f)}catch{}let a=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let d of a)if(!n[d])try{let f=e.getPropertyValue(d);f&&(n[d]=f)}catch{}if(t.embedFonts){let d=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let f of d)if(!n[f])try{let m=e.getPropertyValue(f);m&&(n[f]=m)}catch{}}r==="hidden"&&(n.opacity="0");try{(n["content-visibility"]||e.getPropertyValue("content-visibility"))==="hidden"&&(n.visibility="hidden")}catch{}let s=parseFloat(e.getPropertyValue("border-top-width")||0)||0,c=parseFloat(e.getPropertyValue("border-right-width")||0)||0,l=parseFloat(e.getPropertyValue("border-bottom-width")||0)||0,u=parseFloat(e.getPropertyValue("border-left-width")||0)||0;if(s===0&&c===0&&l===0&&u===0){let d=(e.getPropertyValue("border-image-source")||"").trim(),f=d&&d!=="none",m=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let p of m)delete n[p];f||(n.border="none")}return n}var ya=new WeakMap;function vu(e){let t=ya.get(e);return t||(t=Object.entries(e).sort((n,r)=>n[0]<r[0]?-1:n[0]>r[0]?1:0).map(([n,r])=>`${n}:${r}`).join(";"),ya.set(e,t),t)}function Cu(e,t=null,n={}){let r=ha.get(e);if(r&&r.epoch===Br)return r.snapshot;let o=t||getComputedStyle(e),i=wu(o,n);return ku(e,o,i),ha.set(e,{epoch:Br,snapshot:i}),i}function Su(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Nt,defaultStyle:A.defaultStyle,baseStyle:A.baseStyle,image:A.image,resource:A.resource,background:A.background,font:A.font},options:t||{}}:{session:A.session,persist:{snapshotKeyCache:Nt,defaultStyle:A.defaultStyle,baseStyle:A.baseStyle,image:A.image,resource:A.resource,background:A.background,font:A.font},options:e||t||{}}}function xu(e,t,n){if(!(!e.style||e.style.length===0))for(let r=0;r<e.style.length;r++){let o=e.style[r],i=n.getPropertyValue(o);i&&t.style.setProperty(o,i)}}async function Xe(e,t,n,r){if(e.tagName==="STYLE")return;let o=Su(n,r),i=o.options&&o.options.cache||"auto";i!=="disabled"&&bu(document.documentElement),i==="disabled"&&!o.session.__bumpedForDisabled&&(Tt(),Nt.clear(),o.session.__bumpedForDisabled=!0);let{session:a,persist:s}=o;if(!a.styleCache.has(e)){let f=null;try{f=getComputedStyle(e)}catch{}a.styleCache.set(e,f||getComputedStyle(document.documentElement))}let c=a.styleCache.get(e);e.getAttribute?.("style")&&xu(e,t,c);let l=Cu(e,c,o.options),u=vu(l),d=s.snapshotKeyCache.get(u);if(!d){let f=e.tagName?.toLowerCase()||"div";d=Dr(l,f),s.snapshotKeyCache.set(u,d)}a.styleMap.set(t,d)}function Iu(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function Eu(e){return e.backgroundImage&&e.backgroundImage!=="none"||e.backgroundColor&&e.backgroundColor!=="rgba(0, 0, 0, 0)"&&e.backgroundColor!=="transparent"||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||"visible")!=="visible"}function Au(e){let t=e.parentElement;if(!t)return!1;let n=getComputedStyle(t).display||"";return n.includes("flex")||n.includes("grid")}function Mu(e,t){if(e.textContent&&/\S/.test(e.textContent))return!0;let n=e.firstElementChild,r=e.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let o=e.scrollHeight;if(o===0)return!1;let i=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingBottom)||0;return o>i+a}function ku(e,t,n){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let r=e.tagName&&e.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r))return;let o=parseFloat(t.height);if(Number.isFinite(o)&&e.scrollHeight>0&&Math.abs(o-e.scrollHeight)>2||t.aspectRatio&&t.aspectRatio!=="none"&&t.aspectRatio!=="auto")return;let i=t.display||"";if(i.includes("flex")||i.includes("grid")||Iu(e))return;let a=t.position;if(a==="absolute"||a==="fixed"||a==="sticky"||t.transform!=="none"||Eu(t)||Au(e))return;let s=t.overflowX||t.overflow||"visible",c=t.overflowY||t.overflow||"visible";if(s!=="visible"||c!=="visible")return;let l=t.clip;l&&l!=="auto"&&l!=="rect(auto, auto, auto, auto)"||t.visibility==="hidden"||t.opacity==="0"||Mu(e,t)&&(delete n.height,delete n["block-size"])}Wa();var ja=["fill","stroke","color","background-color","stop-color"],ba=new Map;function Tu(e,t){let n=t+"::"+e.toLowerCase(),r=ba.get(n);if(r)return r;let o=document,i=t==="http://www.w3.org/2000/svg"?o.createElementNS(t,e):o.createElement(e),a=o.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(i),o.documentElement.appendChild(a);let s=getComputedStyle(i),c={};for(let l of ja)c[l]=s.getPropertyValue(l)||"";return a.remove(),ba.set(n,c),c}function Lu(e,t){if(!(e instanceof Element)||!(t instanceof Element))return;let n=e.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(s&&typeof s.value=="string"&&s.value.includes("var(")){r=!0;break}}}let o=null;if(r)try{o=getComputedStyle(e)}catch{}if(r){let i=e.style;if(i&&i.length){let a=new Set;for(let s=0;s<i.length;s++){let c=i[s];if(a.has(c))continue;a.add(c);let l=i.getPropertyValue(c);if(!l||!l.includes("var("))continue;let u=o&&o.getPropertyValue(c);if(u)try{t.style.setProperty(c,u.trim(),i.getPropertyPriority(c))}catch{}}}}if(r&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(!s||typeof s.value!="string"||!s.value.includes("var("))continue;let c=s.name,l=o&&o.getPropertyValue(c);if(l)try{t.style.setProperty(c,l.trim())}catch{}}}if(!r){if(!o)try{o=getComputedStyle(e)}catch{o=null}if(!o)return;let i=e.namespaceURI||"html",a=Tu(e.tagName,i);for(let s of ja){let c=o.getPropertyValue(s)||"",l=a[s]||"";if(c&&c!==l)try{t.style.setProperty(s,c.trim())}catch{}}}}Ee();Ee();Ce();ht();function Fr(e,t,n){return Promise.all(e.map(r=>new Promise(o=>{function i(){mt(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(r,o):i()},{fast:n})}i()})))}function Nu(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function Ru(e,t,n=!0){return e.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let o=n?Nu(r):r;return`:where(${t} ${o})`}).join(", ")}function _u(e,t){return e?(e=e.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${t}:is(${r.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${t} ${r.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,o,i)=>{let a=Ru(i,t,!0);return`${r}${o}${a}{`}),e):""}function Fu(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function Ou(e){let t="";try{e.querySelectorAll("style").forEach(r=>{t+=(r.textContent||"")+`
194
+ `,n.appendChild(r);let o=document.createElement("div");o.className="overlay";let i=document.createElement("div");i.className="cursor",i.innerHTML=Yc,n.appendChild(o),n.appendChild(i),e.host=t,e.overlay=o,e.cursorEl=i,o.addEventListener("pointerdown",ua),o.addEventListener("pointermove",ca),document.addEventListener("pointermove",da,{capture:!0}),document.addEventListener("pointerup",fa,{capture:!0}),document.addEventListener("pointercancel",ma,{capture:!0}),document.addEventListener("keydown",Dr),document.addEventListener("keydown",ut,{capture:!0}),document.addEventListener("keypress",ut,{capture:!0}),document.addEventListener("keyup",ut,{capture:!0}),document.body.appendChild(t)}function sa(){let e=x().noteLayer;document.removeEventListener("pointermove",da,{capture:!0}),document.removeEventListener("pointerup",fa,{capture:!0}),document.removeEventListener("pointercancel",ma,{capture:!0}),document.removeEventListener("keydown",Dr),document.removeEventListener("keydown",ut,{capture:!0}),document.removeEventListener("keypress",ut,{capture:!0}),document.removeEventListener("keyup",ut,{capture:!0}),e.overlay&&(e.overlay.removeEventListener("pointerdown",ua),e.overlay.removeEventListener("pointermove",ca),e.overlay=null),e.cursorEl&&(e.cursorEl=null),e.host&&(e.host.remove(),e.host=null),Cn!==null&&(document.documentElement.style.overflow=Cn,Cn=null),e.notes=[],e.currentNote=null,dt()}function la(){let e=x().noteLayer;e.cursorEl&&(e.cursorEl.style.display="none"),e.movingNote=null,e.consumedByDeactivation=!1,dt()}function ca(e){let t=x().noteLayer;if(!t.cursorEl||!t.overlay)return;t.cursorEl.style.left=`${e.clientX}px`,t.cursorEl.style.top=`${e.clientY}px`,pa(e.target)?(t.cursorEl.style.display="none",t.overlay.style.cursor=""):(t.cursorEl.style.display="",t.overlay.style.cursor="none")}function ua(e){let t=x().noteLayer;if(!t.overlay)return;let n=e.target;if(n.dataset?.deleteBtn==="true"||n.closest("[data-delete-btn]")){let o=n.closest("[data-note-id]");if(o){let i=t.notes.find(a=>a.id===o.id);if(i){Xe(i),e.preventDefault(),e.stopPropagation();return}}}t.overlay.setPointerCapture(e.pointerId);let r=pa(e.target);if(r){if(r.state==="editing")return;if(r.state==="selected"){let o=e.target;if(o.dataset?.bubble==="true"||o.closest("[data-bubble]")){vn(r),t.currentNote=r,e.preventDefault();return}ia(r,e),e.preventDefault();return}t.currentNote&&t.currentNote!==r&&(ct(t.currentNote)||Xe(t.currentNote)),oa(r),t.currentNote=r,ia(r,e),e.preventDefault();return}if(t.currentNote&&(t.currentNote.state==="editing"||t.currentNote.state==="selected")){ct(t.currentNote)||Xe(t.currentNote),t.currentNote=null,t.consumedByDeactivation=!0,e.preventDefault();return}t.pointerDown=!0,t.startX=e.clientX,t.startY=e.clientY,t.didDrag=!1,t.consumedByDeactivation=!1,e.preventDefault()}function da(e){let t=x().noteLayer;if(t.movingNote){let o=e.clientX-t.moveOffsetX,i=e.clientY-t.moveOffsetY;t.movingNote.x=o,t.movingNote.y=i,t.movingNote.element.style.left=`${o}px`,t.movingNote.element.style.top=`${i}px`;return}if(!t.pointerDown||!t.overlay)return;let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.sqrt(n*n+r*r)>zc&&(t.didDrag=!0,t.dragPreview||(t.dragPreview=document.createElement("div"),t.dragPreview.className="drag-preview",t.overlay.appendChild(t.dragPreview)),t.dragPreview.style.left=`${Math.min(t.startX,e.clientX)}px`,t.dragPreview.style.top=`${Math.min(t.startY,e.clientY)}px`,t.dragPreview.style.width=`${Math.abs(n)}px`,t.dragPreview.style.height=`${Math.abs(r)}px`)}function fa(e){let t=x().noteLayer;if(t.overlay)try{t.overlay.releasePointerCapture(e.pointerId)}catch{}if(t.movingNote){t.movingNote=null;return}if(t.consumedByDeactivation){t.consumedByDeactivation=!1,dt();return}if(!t.pointerDown||!t.overlay){dt();return}if(t.didDrag){t.dragPreview&&(t.dragPreview.remove(),t.dragPreview=null);let n=Math.min(t.startX,e.clientX),r=Math.min(t.startY,e.clientY),o=Math.abs(e.clientX-t.startX),i=Math.abs(e.clientY-t.startY);if(o>10&&i>10){let a=ra(n,r,o,i);t.overlay.appendChild(a.element),t.notes.push(a),vn(a),t.currentNote=a}}else{let n=na(e.clientX,e.clientY);t.overlay.appendChild(n.element),t.notes.push(n),vn(n),t.currentNote=n}dt()}function ma(){let e=x().noteLayer;e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null),e.movingNote=null,dt()}function Dr(e){let t=x().noteLayer;if(t.currentNote){if(e.key==="Enter"&&!e.shiftKey&&t.currentNote.state==="editing"){ct(t.currentNote)||Xe(t.currentNote),t.currentNote=null,e.preventDefault();return}if(e.key==="Escape"){t.currentNote.state==="editing"?(ct(t.currentNote)||Xe(t.currentNote),t.currentNote=null):t.currentNote.state==="selected"&&(ct(t.currentNote),t.currentNote=null),e.preventDefault();return}if(t.currentNote.state==="selected"&&(e.key==="Delete"||e.key==="Backspace")){Xe(t.currentNote),t.currentNote=null,e.preventDefault();return}t.currentNote.state==="editing"&&(e.key==="Backspace"||e.key==="Delete")&&t.currentNote.bubble.textContent?.trim()===""&&(Xe(t.currentNote),t.currentNote=null,e.preventDefault())}}function ut(e){!x().notesMode.active||!e.composedPath().some(n=>n instanceof HTMLElement&&n.dataset?.bubble==="true"&&n.isContentEditable)||(e.type==="keydown"&&Dr(e),e.stopImmediatePropagation())}function ia(e,t){let n=x().noteLayer;n.movingNote=e,n.moveOffsetX=t.clientX-e.x,n.moveOffsetY=t.clientY-e.y}function pa(e){let t=x().noteLayer;for(let n of t.notes)if(n.element.contains(e))return n;return null}function Xe(e){let t=x().noteLayer;e.element.remove(),t.notes=t.notes.filter(n=>n.id!==e.id),t.currentNote===e&&(t.currentNote=null)}function dt(){let e=x().noteLayer;e.pointerDown=!1,e.startX=0,e.startY=0,e.didDrag=!1,e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null)}var qc=Object.defineProperty,fe=(e,t)=>()=>(e&&(t=e(e=0)),t),Ft=(e,t)=>{for(var n in t)qc(e,n,{get:t[n],enumerable:!0})};function jc(e){if(e===!0)return"soft";if(e===!1)return"disabled";if(typeof e=="string"){let t=e.toLowerCase().trim();if(t==="auto")return"auto";if(t==="full")return"full";if(t==="soft"||t==="disabled")return t}return"soft"}function Zc(e="soft"){switch(A.session.__counterEpoch=(A.session.__counterEpoch||0)+1,e){case"auto":{A.session.styleMap=new Map,A.session.nodeMap=new Map;return}case"soft":{A.session.styleMap=new Map,A.session.nodeMap=new Map,A.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{A.session.styleMap=new Map,A.session.nodeMap=new Map,A.session.styleCache=new WeakMap,A.computedStyle=new WeakMap,A.baseStyle=new ge(50),A.defaultStyle=new ge(30),A.image=new ge(100),A.background=new ge(100),A.resource=new ge(150),A.font=new Set;return}default:{A.session.styleMap=new Map,A.session.nodeMap=new Map,A.session.styleCache=new WeakMap;return}}}var ge,A,Ce=fe(()=>{ge=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let n=this.keys().next().value;n!==void 0&&this.delete(n)}return super.set(e,t)}},A={image:new ge(100),background:new ge(100),resource:new ge(150),defaultStyle:new ge(30),baseStyle:new ge(50),computedStyle:new WeakMap,measureHints:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function Jr(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith("#")?null:n}function Xc(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let o=r.split(",").map(i=>i.trim());return o.length!==6?`matrix(${r})`:(o[4]="0",o[5]="0",`matrix(${o.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let o=r.split(",").map(i=>i.trim());return o.length!==16?`matrix3d(${r})`:(o[12]="0",o[13]="0",`matrix3d(${o.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function Tn(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function Kc(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let n=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,n).href}catch{return e}}var Nn=fe(()=>{});function Jc(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:n=12}={}){let r=new Map,o=0;function i(a,s,c){if(o>=n)return;let l=Date.now();(r.get(s)||0)>l||(r.set(s,l+t),o++,a==="warn"&&console&&console.warn?console.warn(`${e} ${c}`):console&&console.error&&console.error(`${e} ${c}`))}return{warnOnce(a,s){i("warn",a,s)},errorOnce(a,s){i("error",a,s)},reset(){r.clear(),o=0}}}function Qc(e){return/^data:|^blob:|^about:blank$/i.test(e)}function eu(e,t){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=t.includes("{url}")?t.split("{url}")[0]:t,o=new URL(r||".",n),i=new URL(e,n);if(i.origin===o.origin)return!0;let a=i.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function tu(e,t){if(!t||Qc(e)||eu(e,t))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(e,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!t}}function nu(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",Tn(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${Tn(e)}`;let n=t.includes("?")?"&":"?";return`${t}${n}url=${encodeURIComponent(e)}`}function ha(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(e)})}function ru(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function ve(e,t={}){let n=t.as??"blob",r=t.timeout??3e3,o=t.useProxy||"",i=t.errorTTL??8e3,a=t.headers||{},s=!!t.silent;if(/^data:/i.test(e))try{if(n==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,h="",y=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],v=/;base64/i.test(h)?atob(y):decodeURIComponent(y),b=new Uint8Array([...v].map(S=>S.charCodeAt(0))),w=new Blob([b],{type:(h||"").split(";")[0]||""});return{ok:!0,data:w,status:200,url:e,fromCache:!1,mime:w.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let h=await fetch(e);if(!h.ok)return{ok:!1,data:null,status:h.status,url:e,fromCache:!1,reason:"http_error"};let y=await h.blob(),v=y.type||h.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await ha(y),status:h.status,url:e,fromCache:!1,mime:v}:n==="text"?{ok:!0,data:await y.text(),status:h.status,url:e,fromCache:!1,mime:v}:{ok:!0,data:y,status:h.status,url:e,fromCache:!1,mime:v}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let c=ru(e,{as:n,timeout:r,useProxy:o,errorTTL:i}),l=Tt.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&Tt.delete(c);let u=xn.get(c);if(u)return u;let d=tu(e,o)?nu(e,o):e,f=t.credentials;if(!f)try{let h=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(e,h);f=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{f="omit"}let m=new AbortController,p=setTimeout(()=>m.abort("timeout"),r),g=(async()=>{try{let h=await fetch(d,{signal:m.signal,credentials:f,headers:a});if(!h.ok){let b={ok:!1,data:null,status:h.status,url:d,fromCache:!1,reason:"http_error"};if(i>0&&Tt.set(c,{until:Date.now()+i,result:b}),!s){let w=`${h.status} ${h.statusText||""}`.trim();Br.warnOnce(`http:${h.status}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${w} while fetching ${n} ${e}`)}return t.onError&&t.onError(b),b}if(n==="text")return{ok:!0,data:await h.text(),status:h.status,url:d,fromCache:!1};let y=await h.blob(),v=y.type||h.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await ha(y),status:h.status,url:d,fromCache:!1,mime:v}:{ok:!0,data:y,status:h.status,url:d,fromCache:!1,mime:v}}catch(h){let y=h&&typeof h=="object"&&"name"in h&&h.name==="AbortError"?String(h.message||"").includes("timeout")?"timeout":"abort":"network",v={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&i>0&&Tt.set(c,{until:Date.now()+i,result:v}),!s){let b=`${y}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,w=y==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${e}`:y==="abort"?`Request aborted while fetching ${n} ${e}`:`Network/CORS issue while fetching ${n} ${e}. A proxy may be required`;Br.errorOnce(b,w)}return t.onError&&t.onError(v),v}finally{clearTimeout(p),xn.delete(c)}})();return xn.set(c,g),g}var Br,xn,Tt,gt=fe(()=>{Nn(),Br=Jc("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),xn=new Map,Tt=new Map});async function Wa(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let n=Jr(e);if(!n)return e;let r=Kc(n),o=Tn(r);if(A.background.has(o)){let i=A.background.get(o);return i?`url("${i}")`:"none"}try{let i=await ve(o,{as:"dataURL",useProxy:t.useProxy});return i.ok?(A.background.set(o,i.data),`url("${i.data}")`):(A.background.set(o,null),"none")}catch{return A.background.set(o,null),"none"}}var ou=fe(()=>{Ce(),Nn(),gt()});function iu(e){if(e=String(e).toLowerCase(),eo.has(e)){let i={};return A.defaultStyle.set(e,i),i}if(A.defaultStyle.has(e))return A.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let n=document.createElement(e);n.style.all="initial",t.appendChild(n);let r=getComputedStyle(n),o={};for(let i of r){if(Qr(i))continue;let a=r.getPropertyValue(i);o[i]=a}return t.removeChild(n),A.defaultStyle.set(e,o),o}function Qr(e){let t=String(e).toLowerCase();return!!(Va.has(t)||Ua.test(t)||Ha.test(t))}function Hr(e,t){if(t=String(t||"").toLowerCase(),eo.has(t))return"";let n=[],r=iu(t),o=(e.display||"").toLowerCase()==="inline"||new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]).has(t);for(let[i,a]of Object.entries(e)){if(Qr(i)||o&&(i==="width"||i==="min-width"||i==="max-width"))continue;let s=r[i];a&&a!==s&&n.push(`${i}:${a}`)}return n.sort(),n.join(";")}function au(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(n=>t.add(n.tagName.toLowerCase())),Array.from(t))}function su(e){let t=new Map;for(let r of e){let o=A.defaultStyle.get(r);if(!o)continue;let i=Object.entries(o).map(([a,s])=>`${a}:${s};`).sort().join("");i&&(t.has(i)||t.set(i,[]),t.get(i).push(r))}let n="";for(let[r,o]of t.entries())n+=`${o.join(",")} { ${r} }
195
+ `;return n}function lu(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let o of t)n.set(o,`c${r++}`);return n}function cu(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let n=t.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let r=0;r<window.frames.length;r++)try{if(window.frames[r]?.document===t)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function Fe(e,t=null){let n=()=>{let i={length:0,getPropertyValue:()=>"",item:()=>""};return i[Symbol.iterator]=function*(){},i};if(!(e instanceof Element)){let i=typeof window<"u"?window:null;if(i&&typeof i.getComputedStyle=="function")try{return i.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=A.computedStyle.get(e);r||(r=new Map,A.computedStyle.set(e,r));let o=r.get(t);if(!o){let i=cu(e),a=null;try{a=i&&typeof i.getComputedStyle=="function"?i.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}o=a||n(),r.set(t,o)}return o}function ga(e){let t={};for(let n of e)t[n]=e.getPropertyValue(n);return t}function Ur(e){let t=[],n=0,r=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&n++,i===")"&&n--,i===","&&n===0&&(t.push(e.slice(r,o).trim()),r=o+1)}return t.push(e.slice(r).trim()),t}var Ba,eo,uu,Ha,Ua,Va,Ga=fe(()=>{Ce(),Ba=new Set(["meta","script","noscript","title","link","template"]),eo=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),uu=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"],Ha=/(?:^|-)(animation|transition)(?:-|$)/i,Ua=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Va=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom"])});function pt(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function du(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),n=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||n}function Je(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),n=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),r=/applewebkit/i.test(e),o=/mobile/i.test(e),i=!/safari/i.test(e),a=r&&o&&i,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),l=/ipad|iphone|ipod/.test(t)&&r;return n||a||s||c||l}function fu(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var Ot=fe(()=>{});function K(e,t,n){let r=e&&typeof e=="object"&&(e.options||e);r&&r.debug&&(n!==void 0?console.warn("[snapdom]",t,n):console.warn("[snapdom]",t))}var za=fe(()=>{}),Ee=fe(()=>{ou(),Ga(),Ot(),Nn(),za()}),Ya={};Ft(Ya,{toCanvas:()=>Rn});function mu(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function pu(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function hu(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function gu(e){let t=[],n="",r=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&r++,i===")"&&(r=Math.max(0,r-1)),i===";"&&r===0?(t.push(n),n=""):n+=i}return n.trim()&&t.push(n),t.map(o=>o.trim()).filter(Boolean)}function yu(e){let t=[],n="",r=0;for(let i=0;i<e.length;i++){let a=e[i];a==="("&&r++,a===")"&&(r=Math.max(0,r-1)),a===","&&r===0?(t.push(n.trim()),n=""):n+=a}n.trim()&&t.push(n.trim());let o=[];for(let i of t){if(/\binset\b/i.test(i))continue;let a=i.match(/-?\d+(?:\.\d+)?px/gi)||[],[s="0px",c="0px",l="0px"]=a,u=i.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!u&&u!==",";o.push(`drop-shadow(${s} ${c} ${l}${d?` ${u}`:""})`)}return o.join(" ")}function qa(e){let t=gu(e),n=null,r=null,o=null,i=[];for(let s of t){let c=s.indexOf(":");if(c<0)continue;let l=s.slice(0,c).trim().toLowerCase(),u=s.slice(c+1).trim();l==="box-shadow"?o=u:l==="filter"?n=u:l==="-webkit-filter"?r=u:i.push([l,u])}if(o){let s=yu(o);s&&(n=n?`${n} ${s}`:s,r=r?`${r} ${s}`:s)}let a=[...i];return n&&a.push(["filter",n]),r&&a.push(["-webkit-filter",r]),a.map(([s,c])=>`${s}:${c}`).join(";")}function bu(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,n,r)=>`${n}{${qa(r)}}`)}function wu(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,n)=>t.replace(n,bu(n))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,n,r)=>`style=${n}${qa(r)}${n}`),e}function vu(e){if(!Je()||!mu(e))return e;try{let t=pu(e),n=wu(t);return hu(n)}catch{return e}}async function Rn(e,t){let{width:n,height:r,scale:o=1,dpr:i=1,meta:a={},backgroundColor:s}=t;e=vu(e);let c=new Image;c.loading="eager",c.decoding="sync",c.crossOrigin="anonymous",c.src=e,await c.decode();let l=c.naturalWidth,u=c.naturalHeight,d=Number.isFinite(a.w0)?a.w0:l,f=Number.isFinite(a.h0)?a.h0:u,m,p,g=Number.isFinite(n),h=Number.isFinite(r);if(g&&h)m=Math.max(1,n),p=Math.max(1,r);else if(g){let b=n/Math.max(1,d);m=n,p=f*b}else if(h){let b=r/Math.max(1,f);p=r,m=d*b}else m=l,p=u;m=m*o,p=p*o;let y=document.createElement("canvas");y.width=m*i,y.height=p*i,y.style.width=`${m}px`,y.style.height=`${p}px`;let v=y.getContext("2d");return i!==1&&v.scale(i,i),s&&(v.save(),v.fillStyle=s,v.fillRect(0,0,m,p),v.restore()),v.drawImage(c,0,0,m,p),y}var _n=fe(()=>{Ot()}),In={};Ft(In,{rasterize:()=>ja});async function ja(e,t){let n=await Rn(e,t),r=new Image;return r.src=n.toDataURL(`image/${t.format}`,t.quality),await r.decode(),r.style.width=`${n.width/t.dpr}px`,r.style.height=`${n.height/t.dpr}px`,r}var En=fe(()=>{_n()}),Vr={};Ft(Vr,{toImg:()=>ya,toSvg:()=>ya});async function ya(e,t){let{scale:n=1,width:r,height:o,meta:i={}}=t,a=Number.isFinite(r),s=Number.isFinite(o),c=Number.isFinite(n)&&n!==1||a||s;if(Je()&&c)return await ja(e,{...t,format:"png",quality:1,meta:i});let l=new Image;if(l.decoding="sync",l.loading="eager",l.src=e,await l.decode(),a&&s)l.style.width=`${r}px`,l.style.height=`${o}px`;else if(a){let u=Number.isFinite(i.w0)?i.w0:l.naturalWidth,d=Number.isFinite(i.h0)?i.h0:l.naturalHeight,f=r/Math.max(1,u);l.style.width=`${r}px`,l.style.height=`${Math.round(d*f)}px`}else if(s){let u=Number.isFinite(i.w0)?i.w0:l.naturalWidth,d=Number.isFinite(i.h0)?i.h0:l.naturalHeight,f=o/Math.max(1,d);l.style.height=`${o}px`,l.style.width=`${Math.round(u*f)}px`}else{let u=Math.round(l.naturalWidth*n),d=Math.round(l.naturalHeight*n);if(l.style.width=`${u}px`,l.style.height=`${d}px`,typeof e=="string"&&e.startsWith("data:image/svg+xml"))try{let f=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${u}"`).replace(/height="[^"]*"/,`height="${d}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,l.src=e}catch(f){K(t,"SVG width/height patch in toImg failed",f)}}return l}var ba=fe(()=>{Ee(),En()}),Za={};Ft(Za,{toBlob:()=>Xa});async function Xa(e,t){let n=t.type;if(n==="svg"){let o=decodeURIComponent(e.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let r=await Rn(e,t);return new Promise(o=>r.toBlob(i=>o(i),`image/${n}`,t.quality))}var Ka=fe(()=>{_n()}),Ja={};Ft(Ja,{download:()=>Cu});async function wa(e,t){let n=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:t})}catch(r){if(r.name!=="AbortError")return!1}return!0}async function Cu(e,t){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(t?.type||"").toLowerCase(),o=n.has(r)?r:"",i=(t?.format||o||"").toLowerCase(),a=i==="jpg"?"jpeg":i||"png",s=t?.filename||`snapdom.${a}`,c={...t||{},format:a,type:a};c.dpr=1;let l=du();if(a==="svg"){let f=await Xa(e,{...c,type:"svg"});if(l&&await wa(f,s))return;let m=URL.createObjectURL(f),p=document.createElement("a");p.href=m,p.download=s,document.body.appendChild(p),p.click(),URL.revokeObjectURL(m),p.remove();return}let u=await Rn(e,c);if(l){let f=`image/${a}`,m=await new Promise(p=>u.toBlob(p,f,t?.quality));if(m&&await wa(m,s))return}let d=document.createElement("a");d.href=u.toDataURL(`image/${a}`,t?.quality),d.download=s,document.body.appendChild(d),d.click(),d.remove()}var Su=fe(()=>{Ka(),_n(),Ot()});Ee();Ee();Ce();var va=new WeakMap,Rt=new Map,xu=2e3,Gr=0;function Lt(){Gr++,Rt.size>xu&&Rt.clear()}var Ca=!1;function Iu(e=document.documentElement){if(!Ca){Ca=!0;try{new MutationObserver(()=>Lt()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>Lt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",Lt),t.ready?.then(()=>Lt()).catch(()=>{}))}catch{}}}function Eu(e,t={}){let n={},r=e.getPropertyValue("visibility"),o=t.excludeStyleProps;for(let d=0;d<e.length;d++){let f=e[d];if(Qr(f)||o&&(o instanceof RegExp&&o.test(f)||typeof o=="function"&&o(f)))continue;let m=e.getPropertyValue(f);(f==="background-image"||f==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),n[f]=m}let i=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let d of i)if(!n[d])try{let f=e.getPropertyValue(d);f&&(n[d]=f)}catch{}let a=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let d of a)if(!n[d])try{let f=e.getPropertyValue(d);f&&(n[d]=f)}catch{}if(t.embedFonts){let d=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let f of d)if(!n[f])try{let m=e.getPropertyValue(f);m&&(n[f]=m)}catch{}}r==="hidden"&&(n.opacity="0");try{(n["content-visibility"]||e.getPropertyValue("content-visibility"))==="hidden"&&(n.visibility="hidden")}catch{}let s=parseFloat(e.getPropertyValue("border-top-width")||0)||0,c=parseFloat(e.getPropertyValue("border-right-width")||0)||0,l=parseFloat(e.getPropertyValue("border-bottom-width")||0)||0,u=parseFloat(e.getPropertyValue("border-left-width")||0)||0;if(s===0&&c===0&&l===0&&u===0){let d=(e.getPropertyValue("border-image-source")||"").trim(),f=d&&d!=="none",m=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let p of m)delete n[p];f||(n.border="none")}return n}var Sa=new WeakMap;function Au(e){let t=Sa.get(e);return t||(t=Object.entries(e).sort((n,r)=>n[0]<r[0]?-1:n[0]>r[0]?1:0).map(([n,r])=>`${n}:${r}`).join(";"),Sa.set(e,t),t)}function ku(e,t=null,n={}){let r=va.get(e);if(r&&r.epoch===Gr)return r.snapshot;let o=t||getComputedStyle(e),i=Eu(o,n);return Fu(e,o,i),va.set(e,{epoch:Gr,snapshot:i}),i}function Mu(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Rt,defaultStyle:A.defaultStyle,baseStyle:A.baseStyle,image:A.image,resource:A.resource,background:A.background,font:A.font},options:t||{}}:{session:A.session,persist:{snapshotKeyCache:Rt,defaultStyle:A.defaultStyle,baseStyle:A.baseStyle,image:A.image,resource:A.resource,background:A.background,font:A.font},options:e||t||{}}}function Tu(e,t,n){if(!(!e.style||e.style.length===0))for(let r=0;r<e.style.length;r++){let o=e.style[r],i=n.getPropertyValue(o);i&&t.style.setProperty(o,i)}}async function Ke(e,t,n,r){if(e.tagName==="STYLE")return;let o=Mu(n,r),i=o.options&&o.options.cache||"auto";i!=="disabled"&&Iu(document.documentElement),i==="disabled"&&!o.session.__bumpedForDisabled&&(Lt(),Rt.clear(),o.session.__bumpedForDisabled=!0);let{session:a,persist:s}=o;if(!a.styleCache.has(e)){let f=null;try{f=getComputedStyle(e)}catch{}a.styleCache.set(e,f||getComputedStyle(document.documentElement))}let c=a.styleCache.get(e);e.getAttribute?.("style")&&Tu(e,t,c);let l=ku(e,c,o.options),u=Au(l),d=s.snapshotKeyCache.get(u);if(!d){let f=e.tagName?.toLowerCase()||"div";d=Hr(l,f),s.snapshotKeyCache.set(u,d)}a.styleMap.set(t,d)}function Lu(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function Nu(e){return e.backgroundImage&&e.backgroundImage!=="none"||e.backgroundColor&&e.backgroundColor!=="rgba(0, 0, 0, 0)"&&e.backgroundColor!=="transparent"||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||"visible")!=="visible"}function Ru(e){let t=e.parentElement;if(!t)return!1;let n=getComputedStyle(t).display||"";return n.includes("flex")||n.includes("grid")}function _u(e,t){if(e.textContent&&/\S/.test(e.textContent))return!0;let n=e.firstElementChild,r=e.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let o=e.scrollHeight;if(o===0)return!1;let i=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingBottom)||0;return o>i+a}function Fu(e,t,n){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let r=e.tagName&&e.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r))return;let o=parseFloat(t.height);if(Number.isFinite(o)&&e.scrollHeight>0&&Math.abs(o-e.scrollHeight)>2||t.aspectRatio&&t.aspectRatio!=="none"&&t.aspectRatio!=="auto")return;let i=t.display||"";if(i.includes("flex")||i.includes("grid")||Lu(e))return;let a=t.position;if(a==="absolute"||a==="fixed"||a==="sticky"||t.transform!=="none"||Nu(t)||Ru(e))return;let s=t.overflowX||t.overflow||"visible",c=t.overflowY||t.overflow||"visible";if(s!=="visible"||c!=="visible")return;let l=t.clip;l&&l!=="auto"&&l!=="rect(auto, auto, auto, auto)"||t.visibility==="hidden"||t.opacity==="0"||_u(e,t)&&(delete n.height,delete n["block-size"])}Ga();var Qa=["fill","stroke","color","background-color","stop-color"],xa=new Map;function Ou(e,t){let n=t+"::"+e.toLowerCase(),r=xa.get(n);if(r)return r;let o=document,i=t==="http://www.w3.org/2000/svg"?o.createElementNS(t,e):o.createElement(e),a=o.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(i),o.documentElement.appendChild(a);let s=getComputedStyle(i),c={};for(let l of Qa)c[l]=s.getPropertyValue(l)||"";return a.remove(),xa.set(n,c),c}function $u(e,t){if(!(e instanceof Element)||!(t instanceof Element))return;let n=e.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(s&&typeof s.value=="string"&&s.value.includes("var(")){r=!0;break}}}let o=null;if(r)try{o=getComputedStyle(e)}catch{}if(r){let i=e.style;if(i&&i.length){let a=new Set;for(let s=0;s<i.length;s++){let c=i[s];if(a.has(c))continue;a.add(c);let l=i.getPropertyValue(c);if(!l||!l.includes("var("))continue;let u=o&&o.getPropertyValue(c);if(u)try{t.style.setProperty(c,u.trim(),i.getPropertyPriority(c))}catch{}}}}if(r&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(!s||typeof s.value!="string"||!s.value.includes("var("))continue;let c=s.name,l=o&&o.getPropertyValue(c);if(l)try{t.style.setProperty(c,l.trim())}catch{}}}if(!r){if(!o)try{o=getComputedStyle(e)}catch{o=null}if(!o)return;let i=e.namespaceURI||"html",a=Ou(e.tagName,i);for(let s of Qa){let c=o.getPropertyValue(s)||"",l=a[s]||"";if(c&&c!==l)try{t.style.setProperty(s,c.trim())}catch{}}}}Ee();Ee();Ce();gt();function Pr(e,t,n){return Promise.all(e.map(r=>new Promise(o=>{function i(){pt(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(r,o):i()},{fast:n})}i()})))}function Du(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function Pu(e,t,n=!0){return e.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let o=n?Du(r):r;return`:where(${t} ${o})`}).join(", ")}function Wu(e,t){return e?(e=e.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${t}:is(${r.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${t} ${r.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,o,i)=>{let a=Pu(i,t,!0);return`${r}${o}${a}{`}),e):""}function Bu(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function Hu(e){let t="";try{e.querySelectorAll("style").forEach(r=>{t+=(r.textContent||"")+`
196
196
  `});let n=e.adoptedStyleSheets||[];for(let r of n)try{if(r&&r.cssRules)for(let o of r.cssRules)t+=o.cssText+`
197
- `}catch{}}catch{}return t}function $u(e,t,n){if(!t)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=t,e.insertBefore(r,e.firstChild||null)}function Du(e,t){try{let n=e.currentSrc||e.src||"";if(!n)return;t.setAttribute("src",n),t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.loading="eager",t.decoding="sync"}catch{}}function Pu(e){let t=new Set;if(!e)return t;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(e);)t.add(r[1]);return t}function Wu(e,t){try{let n=getComputedStyle(e).getPropertyValue(t).trim();if(n)return n}catch{}try{let n=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(n)return n}catch{}return""}function Bu(e,t,n){let r=[];for(let o of t){let i=Wu(e,o);i&&r.push(`${o}: ${i};`)}return r.length?`${n}{${r.join("")}}
198
- `:""}function Hu(e){e&&(e.nodeType===Node.ELEMENT_NODE&&e.setAttribute("data-sd-slotted",""),e.querySelectorAll&&e.querySelectorAll("*").forEach(t=>t.setAttribute("data-sd-slotted","")))}async function Uu(e,t=3){let n=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},r=n(),o=0;for(;o<t&&(!r||!r.body&&!r.documentElement);)await new Promise(i=>setTimeout(i,0)),r=n(),o++;return r&&(r.body||r.documentElement)?r:null}function Vu(e){let t=e.getBoundingClientRect(),n=0,r=0,o=0,i=0;try{let c=getComputedStyle(e);n=parseFloat(c.borderLeftWidth)||0,r=parseFloat(c.borderRightWidth)||0,o=parseFloat(c.borderTopWidth)||0,i=parseFloat(c.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(n+r))),s=Math.max(0,Math.round(t.height-(o+i)));return{contentWidth:a,contentHeight:s,rect:t}}function Ie(e){let t=0,n=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(n=e.offsetHeight),t===0||n===0)try{let r=getComputedStyle(e);if(t===0){let o=parseFloat(r.width);!isNaN(o)&&o>0&&(t=o)}if(n===0){let o=parseFloat(r.height);!isNaN(o)&&o>0&&(n=o)}}catch{}if(t===0||n===0)try{if(t===0){let r=parseFloat(e.getAttribute("width"));!isNaN(r)&&r>0&&(t=r)}if(n===0){let r=parseFloat(e.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((t===0||n===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),n===0&&e.naturalHeight>0&&(n=e.naturalHeight)}catch{}return{width:t,height:n}}function Gu(e,t,n){let r=e.createElement("style");return r.setAttribute("data-sd-iframe-pin",""),r.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(r),()=>{try{r.remove()}catch{}}}async function zu(e,t,n){let r=await Uu(e,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:o,contentHeight:i,rect:a}=Vu(e),s=n?.snap;if(!s&&typeof window<"u"&&window.snapdom&&(s=window.snapdom),!s||typeof s.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let c={...n,scale:1},l=Gu(r,o,i),u;try{u=await s.toPng(r.documentElement,c)}finally{l()}u.style.display="block",u.style.width=`${o}px`,u.style.height=`${i}px`;let d=document.createElement("div");return t.nodeMap.set(d,e),Xe(e,d,t,n),d.style.overflow="hidden",d.style.display="block",d.style.width||(d.style.width=`${Math.round(a.width)}px`),d.style.height||(d.style.height=`${Math.round(a.height)}px`),d.appendChild(u),d}function qu(e){let{width:t,height:n}=Ie(e),r=e.getBoundingClientRect(),o;try{o=window.getComputedStyle(e)}catch{}let i=o?parseFloat(o.width):NaN,a=o?parseFloat(o.height):NaN,s=Math.round(t||r.width||0),c=Math.round(n||r.height||0),l=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,s||16),u=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,c||16),d=(e.type||"text").toLowerCase()==="checkbox",f=!!e.checked,m=!!e.indeterminate,p=Math.max(Math.min(l,u),12),g="middle";try{o&&o.verticalAlign&&(g=o.verticalAlign)}catch{}let h=document.createElement("div");h.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),h.style.cssText=`display:inline-block;width:${p}px;height:${p}px;vertical-align:${g};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");y.setAttribute("width",String(p)),y.setAttribute("height",String(p)),y.setAttribute("viewBox",`0 0 ${p} ${p}`),h.appendChild(y);function v(){let b="#0a6ed1";try{o&&(b=o.accentColor||o.color||b)}catch{}let w=2,S=w/2,I=p-w;if(y.innerHTML="",d){let C=document.createElementNS("http://www.w3.org/2000/svg","rect");if(C.setAttribute("x",String(S)),C.setAttribute("y",String(S)),C.setAttribute("width",String(I)),C.setAttribute("height",String(I)),C.setAttribute("rx","2"),C.setAttribute("ry","2"),C.setAttribute("fill",f?b:"none"),C.setAttribute("stroke",b),C.setAttribute("stroke-width",String(w)),y.appendChild(C),f){let E=document.createElementNS("http://www.w3.org/2000/svg","path");E.setAttribute("d",`M ${S+2} ${p/2} L ${p/2-1} ${p-S-2} L ${p-S-2} ${S+2}`),E.setAttribute("stroke","white"),E.setAttribute("stroke-width",String(Math.max(1.5,w))),E.setAttribute("fill","none"),E.setAttribute("stroke-linecap","round"),E.setAttribute("stroke-linejoin","round"),y.appendChild(E)}else if(m){let E=document.createElementNS("http://www.w3.org/2000/svg","rect"),k=Math.max(6,I-4);E.setAttribute("x",String((p-k)/2)),E.setAttribute("y",String((p-w)/2)),E.setAttribute("width",String(k)),E.setAttribute("height",String(w)),E.setAttribute("fill",b),E.setAttribute("rx","1"),y.appendChild(E)}}else{let C=document.createElementNS("http://www.w3.org/2000/svg","circle");if(C.setAttribute("cx",String(p/2)),C.setAttribute("cy",String(p/2)),C.setAttribute("r",String((p-w)/2)),C.setAttribute("fill",f?b:"none"),C.setAttribute("stroke",b),C.setAttribute("stroke-width",String(w)),y.appendChild(C),f){let E=document.createElementNS("http://www.w3.org/2000/svg","circle"),k=Math.max(2,(p-w*2)*.35);E.setAttribute("cx",String(p/2)),E.setAttribute("cy",String(p/2)),E.setAttribute("r",String(k)),E.setAttribute("fill","white"),y.appendChild(E)}}h.style.setProperty("width",`${p}px`,"important"),h.style.setProperty("height",`${p}px`,"important"),h.style.setProperty("min-width",`${p}px`,"important"),h.style.setProperty("min-height",`${p}px`,"important")}return v(),{el:h,applyVisual:v}}var Mt=new ge(80);async function Lt(e){if(A.resource?.has(e))return A.resource.get(e);if(Mt.has(e))return Mt.get(e);let t=(async()=>{let n=await ve(e,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return A.resource?.set(e,n.data),n.data})();Mt.set(e,t);try{let n=await t;return Mt.set(e,n),n}catch(n){throw Mt.delete(e),n}}var Yu=/\bblob:[^)"'\s]+/g;async function wa(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(Yu)||[]));if(t.length===0)return e;let n=e;for(let r of t)try{let o=await Lt(r);n=n.split(r).join(o)}catch{}return n}function wn(e){return typeof e=="string"&&e.startsWith("blob:")}function ju(e){return(e||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{let n=t.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function Zu(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}async function Ku(e,t=null){if(!e)return;let n=t,r=e.querySelectorAll?e.querySelectorAll("img"):[];for(let c of r)try{let l=c.getAttribute("src")||c.currentSrc||"";if(wn(l)){let d=await Lt(l);c.setAttribute("src",d)}let u=c.getAttribute("srcset");if(u&&u.includes("blob:")){let d=ju(u),f=!1;for(let m of d)if(wn(m.url))try{m.url=await Lt(m.url),f=!0}catch(p){X(n,"blobUrlToDataUrl for srcset item failed",p)}f&&c.setAttribute("srcset",Zu(d))}}catch(l){X(n,"resolveBlobUrls for img failed",l)}let o=e.querySelectorAll?e.querySelectorAll("image"):[];for(let c of o)try{let l="http://www.w3.org/1999/xlink",u=c.getAttribute("href")||c.getAttributeNS?.(l,"href");if(wn(u)){let d=await Lt(u);c.setAttribute("href",d),c.removeAttributeNS?.(l,"href")}}catch(l){X(n,"resolveBlobUrls for SVG image href failed",l)}let i=e.querySelectorAll?e.querySelectorAll("[style*='blob:']"):[];for(let c of i)try{let l=c.getAttribute("style");if(l&&l.includes("blob:")){let u=await wa(l);c.setAttribute("style",u)}}catch(l){X(n,"replaceBlobUrls in inline style failed",l)}let a=e.querySelectorAll?e.querySelectorAll("style"):[];for(let c of a)try{let l=c.textContent||"";l.includes("blob:")&&(c.textContent=await wa(l))}catch(l){X(n,"replaceBlobUrls in style tag failed",l)}let s=["poster"];for(let c of s){let l=e.querySelectorAll?e.querySelectorAll(`[${c}^='blob:']`):[];for(let u of l)try{let d=u.getAttribute(c);wn(d)&&u.setAttribute(c,await Lt(d))}catch(d){X(n,`resolveBlobUrls for ${c} failed`,d)}}}Ft();async function xn(e,t,n){if(!e)throw new Error("Invalid node");let r=new Set,o=null,i=null;if(e.nodeType===Node.ELEMENT_NODE){let u=(e.localName||e.tagName||"").toLowerCase();if(e.id==="snapdom-sandbox"||e.hasAttribute("data-snapdom-sandbox")||Oa.has(u))return null;if(u==="foreignobject"&&e.parentElement?.closest?.("foreignObject"))return X(t,"Nested <foreignObject> skipped (SVG spec limitation \u2014 not rendered by browsers)"),null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let u=document.createElement("div"),{width:d,height:f}=Ie(e),m=d||e.getBoundingClientRect().width||0,p=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${p}px;visibility:hidden;`,u}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let u of n.exclude)try{if(e.matches?.(u)){if(n.excludeMode==="hide"){let d=document.createElement("div"),{width:f,height:m}=Ie(e),p=f||e.getBoundingClientRect().width||0,g=m||e.getBoundingClientRect().height||0;return d.style.cssText=`display:inline-block;width:${p}px;height:${g}px;visibility:hidden;`,d}else if(n.excludeMode==="remove")return null}}catch(d){console.warn(`Invalid selector in exclude option: ${u}`,d)}if(typeof n.filter=="function")try{if(!n.filter(e)){if(n.filterMode==="hide"){let u=document.createElement("div"),{width:d,height:f}=Ie(e),m=d||e.getBoundingClientRect().width||0,p=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${p}px;visibility:hidden;`,u}else if(n.filterMode==="remove")return null}}catch(u){console.warn("Error in filter function:",u)}if(e.tagName==="IFRAME"){let u=!1;try{u=!!(e.contentDocument||e.contentWindow?.document)}catch(d){X(t,"iframe same-origin probe failed",d)}if(u)try{return await zu(e,t,n)}catch(d){console.warn("[SnapDOM] iframe rasterization failed, fallback:",d)}if(u||console.warn("[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.",e),n.placeholders){let{width:d,height:f}=Ie(e),m=document.createElement("div");return m.style.cssText=`width:${d}px;height:${f}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,Xe(e,m,t,n),m}else{let{width:d,height:f}=Ie(e),m=document.createElement("div");return m.style.cssText=`display:inline-block;width:${d}px;height:${f}px;visibility:hidden;`,Xe(e,m,t,n),m}}if(e.getAttribute("data-capture")==="placeholder"){let u=e.cloneNode(!1);t.nodeMap.set(u,e),Xe(e,u,t,n);let d=document.createElement("div");return d.textContent=e.getAttribute("data-placeholder-text")||"",d.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",u.appendChild(d),u}if(e.tagName==="CANVAS"){let u="";try{let p=e.getContext("2d",{willReadFrequently:!0});try{p&&p.getImageData(0,0,1,1)}catch{}if(await new Promise(g=>requestAnimationFrame(g)),u=e.toDataURL("image/png"),!u||u==="data:,"){try{p&&p.getImageData(0,0,1,1)}catch{}if(await new Promise(g=>requestAnimationFrame(g)),u=e.toDataURL("image/png"),!u||u==="data:,"){let g=document.createElement("canvas");g.width=e.width,g.height=e.height;let h=g.getContext("2d");h&&(h.drawImage(e,0,0),u=g.toDataURL("image/png"))}}}catch(p){X(t,"Canvas toDataURL failed, using empty/fallback",p)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch(p){X(t,"img decoding/loading hints failed",p)}u&&(d.src=u),d.width=e.width,d.height=e.height;let{width:f,height:m}=Ie(e);return f>0&&(d.style.width=`${f}px`),m>0&&(d.style.height=`${m}px`),t.nodeMap.set(d,e),Xe(e,d,t,n),d}if(e.tagName==="VIDEO"){let u="";try{let p=document.createElement("canvas");p.width=e.videoWidth||e.offsetWidth||320,p.height=e.videoHeight||e.offsetHeight||240;let g=p.getContext("2d");g&&(g.drawImage(e,0,0,p.width,p.height),u=p.toDataURL("image/png"),(!u||u==="data:,")&&(u=""))}catch(p){X(t,"Video frame capture failed, using poster fallback",p)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch{}u?d.src=u:e.poster&&(d.src=e.poster),d.width=e.videoWidth||e.offsetWidth||0,d.height=e.videoHeight||e.offsetHeight||0;let{width:f,height:m}=Ie(e);return f>0&&(d.style.width=`${f}px`),m>0&&(d.style.height=`${m}px`),d.style.objectFit="contain",t.nodeMap.set(d,e),Xe(e,d,t,n),d}let a;try{if(a=e.cloneNode(!1),a.attributes?.length)try{for(let u of a.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(u.value)&&a.setAttribute(u.name,u.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(Lu(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){Du(e,a);try{let{width:u,height:d}=Ie(e),f=Math.round(u||0),m=Math.round(d||0);f&&(a.dataset.snapdomWidth=String(f)),m&&(a.dataset.snapdomHeight=String(m))}catch(u){X(t,"getUnscaledDimensions for IMG failed",u)}try{let u=e.getAttribute("style")||"",d=window.getComputedStyle(e),f=b=>{let w=u.match(new RegExp(`${b}\\s*:\\s*([^;]+)`,"i")),S=w?w[1].trim():d.getPropertyValue(b);return/%|auto/i.test(String(S||""))},m=parseInt(a.dataset.snapdomWidth||"0",10),p=parseInt(a.dataset.snapdomHeight||"0",10),g=f("width")||!m,h=f("height")||!p;g&&m&&(a.style.width=`${m}px`),h&&p&&(a.style.height=`${p}px`);let y=d.getPropertyValue("object-fit"),v=d.getPropertyValue("object-position");y&&y!=="fill"?(a.style.objectFit=y,v&&(a.style.objectPosition=v)):(m&&(a.style.minWidth=`${m}px`),p&&(a.style.minHeight=`${p}px`))}catch(u){X(t,"IMG dimension freeze failed",u)}}}catch(u){throw console.error("[Snapdom] Failed to clone node:",e,u),u}let s=null;if(e instanceof HTMLTextAreaElement){let{width:u,height:d}=Ie(e),f=u||e.getBoundingClientRect().width||0,m=d||e.getBoundingClientRect().height||0;f&&(a.style.width=`${f}px`),m&&(a.style.height=`${m}px`)}if(e instanceof HTMLInputElement){let u=(e.type||"text").toLowerCase();if((u==="checkbox"||u==="radio")&&au()){let{el:d,applyVisual:f}=qu(e);t.nodeMap.set(d,e),s=f,a=d}else a.value=e.value,a.setAttribute("value",e.value),e.checked!==void 0&&(a.checked=e.checked,e.checked&&a.setAttribute("checked",""),e.indeterminate&&(a.indeterminate=e.indeterminate))}if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&!e.value&&e.placeholder)try{let u=window.getComputedStyle(e,"::placeholder"),d=u&&u.color;if(d&&d!=="rgba(0, 0, 0, 0)"){let f="snapdom-ph-"+(Math.random()*1e6|0);a.classList.add(f);let m=document.createElement("style");m.textContent=`.${f}::placeholder{color:${d}!important;opacity:${u.opacity||"1"}!important;}`,a.prepend(m)}}catch{}if(e instanceof HTMLSelectElement&&(o=e.value),e instanceof HTMLTextAreaElement&&(i=e.value),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){e.disabled&&a.setAttribute("disabled",""),e.required&&a.setAttribute("required",""),e.readOnly&&a.setAttribute("readonly","");let u=e;u.min!==void 0&&u.min!==""&&a.setAttribute("min",u.min),u.max!==void 0&&u.max!==""&&a.setAttribute("max",u.max),u.pattern!==void 0&&u.pattern!==""&&a.setAttribute("pattern",u.pattern);let d=e.getAttribute("aria-invalid");d!==null&&a.setAttribute("aria-invalid",d)}if(Xe(e,a,t,n),s&&s(),e instanceof SVGElement){let u=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let d=window.getComputedStyle(e);for(let f of u){let m=d.getPropertyValue(f);m&&a.style.setProperty(f,m)}}catch{}}if(e.shadowRoot){let u=function(b,w){if(b.nodeType===Node.ELEMENT_NODE&&b.tagName==="STYLE")return w(null);xn(b,t,n).then(S=>{w(S||null)}).catch(()=>{w(null)})};try{let b=e.shadowRoot.querySelectorAll("slot");for(let w of b){let S=[];try{S=w.assignedNodes?.({flatten:!0})||w.assignedNodes?.()||[]}catch{S=w.assignedNodes?.()||[]}for(let I of S)r.add(I)}}catch{}let d=Fu(t),f=`[data-sd="${d}"]`;try{a.setAttribute("data-sd",d)}catch{}let m=Ou(e.shadowRoot),p=_u(m,f),g=Pu(m),h=Bu(e,g,f);$u(a,h+p,d);let y=document.createDocumentFragment(),v=await Fr(Array.from(e.shadowRoot.childNodes),u,n.fast);y.append(...v.filter(b=>!!b)),a.appendChild(y)}if(e.tagName==="SLOT"){let u=function(g,h){xn(g,t,n).then(y=>{y&&Hu(y),h(y||null)}).catch(()=>{h(null)})},d=e.assignedNodes?.({flatten:!0})||[],f=d.length>0?d:Array.from(e.childNodes),m=document.createDocumentFragment(),p=await Fr(Array.from(f),u,n.fast);return m.append(...p.filter(g=>!!g)),m}function c(u,d){if(r.has(u))return d(null);xn(u,t,n).then(f=>{d(f||null)}).catch(()=>{d(null)})}let l=await Fr(Array.from(e.childNodes),c,n.fast);if(a.append(...l.filter(u=>!!u)),o!==null&&a instanceof HTMLSelectElement){a.value=o;for(let u of a.options)u.value===o?u.setAttribute("selected",""):u.removeAttribute("selected")}return i!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=i),a}Ee();kn();Ce();var Xu=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],dt=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),Hr=[];function Ju(e){let t=Array.isArray(e)?e:[e];for(let n of t)n instanceof RegExp?Hr.push(n):typeof n=="string"?Hr.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function _e(e){let t=typeof e=="string"?e:"",n=[...Xu,...Hr];for(let r of n)if(r instanceof RegExp&&r.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function Qu(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var va=new Map;function ed(e=""){let t=Object.create(null),n=String(e||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,o;for(;o=r.exec(n);)t[o[1].toUpperCase()]=Number(o[2]);return t}async function td(e,t,n){let r=String(e||""),o=r.toLowerCase(),i=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(o)&&!/\bsymbols\b/.test(o))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(o))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),s="outlined";/\brounded\b/.test(i)||/\bround\b/.test(i)?s="rounded":/\bsharp\b/.test(i)?s="sharp":/\boutlined\b/.test(i)&&(s="outlined");let c=a===1,l=null;if(c&&(s==="outlined"&&dt.materialIconsFilled?l={url:dt.materialIconsFilled,alias:"snapdom-mi-filled"}:s==="rounded"&&dt.materialIconsRound?l={url:dt.materialIconsRound,alias:"snapdom-mi-round"}:s==="sharp"&&dt.materialIconsSharp&&(l={url:dt.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!va.has(l.alias))try{let d=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),va.set(l.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function nd(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function rd(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!n&&t.toLowerCase()!=="currentcolor")return t;let r=e.color?.trim();return r&&r!=="inherit"?r:"#000"}async function od(e,{family:t="Material Icons",weight:n="normal",fontSize:r=32,color:o="#000",variation:i="",className:a=""}={}){let s=String(t||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,l=ed(i),{familyForMeasure:u,familyForCanvas:d}=await td(s,a,l);await nd(d.replace(/^["']+|["']+$/g,""),r);let f=document.createElement("span");f.textContent=e,f.style.position="absolute",f.style.visibility="hidden",f.style.left="-99999px",f.style.whiteSpace="nowrap",f.style.fontFamily=u,f.style.fontWeight=String(n||"normal"),f.style.fontSize=`${r}px`,f.style.lineHeight="1",f.style.margin="0",f.style.padding="0",f.style.fontFeatureSettings="'liga' 1",f.style.fontVariantLigatures="normal",f.style.color=o,document.body.appendChild(f);let m=f.getBoundingClientRect(),p=Math.max(1,Math.ceil(m.width)),g=Math.max(1,Math.ceil(m.height));document.body.removeChild(f);let h=document.createElement("canvas");h.width=p*c,h.height=g*c;let y=h.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${r}px ${d}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=o;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:h.toDataURL(),width:p,height:g}}async function id(e,t){if(!(e instanceof Element))return 0;let n='.material-icons, [class*="material-symbols"]',r=Array.from(e.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim());if(r.length===0)return 0;let o=t instanceof Element?Array.from(t.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],i=0;for(let a=0;a<r.length;a++){let s=r[a],c=o[a]||null;try{let l=getComputedStyle(c||s),u=l.fontFamily||"Material Icons";if(!Qu(u))continue;let d=(c||s).textContent.trim();if(!d)continue;let f=parseInt(l.fontSize,10)||24,m=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",p=rd(l),g=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",h=(c||s).className||"",{dataUrl:y,width:v,height:b}=await od(d,{family:u,weight:m,fontSize:f,color:p,variation:g,className:h});s.textContent="";let w=s.ownerDocument.createElement("img");w.src=y,w.alt=d,w.style.height=`${f}px`,w.style.width=`${Math.max(1,Math.round(v/b*f))}px`,w.style.objectFit="contain",w.style.verticalAlign=getComputedStyle(s).verticalAlign||"baseline",s.appendChild(w),i++}catch{}}return i}ht();async function ad(e,t,n,r=32,o="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let i=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");a.textContent=e,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${t}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let s=a.getBoundingClientRect(),c=Math.ceil(s.width),l=Math.ceil(s.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,c*i),u.height=Math.max(1,l*i);let d=u.getContext("2d");return d.scale(i,i),d.font=n?`${n} ${r}px "${t}"`:`${r}px "${t}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=o,d.fillText(e,0,0),{dataUrl:u.toDataURL(),width:c,height:l}}var Za=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),sd=["katex","mathjax","mathml"];function Xr(e){if(!e)return"";for(let t of e.split(",")){let n=t.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Za.has(n.toLowerCase()))return n}return""}function ld(e){if(!e)return[];let t=[];for(let n of e.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(Za.has(r.toLowerCase())||t.push(r))}return t}function In(e){let t=String(e??"400").trim().toLowerCase();if(t==="normal")return 400;if(t==="bold")return 700;let n=parseInt(t,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function En(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function cd(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function ud(e){let t=String(e||"400").trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let o=In(n[1]),i=In(n[2]);return{min:Math.min(o,i),max:Math.max(o,i)}}let r=In(t);return{min:r,max:r}}function dd(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function fd(e){let t=String(e||"100%").trim(),n=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let i=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(i,a),max:Math.max(i,a)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),o=r?parseFloat(r[1]):100;return{min:o,max:o}}function md(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function pd(e,t,n=[]){if(!e)return!1;try{let r=new URL(e,location.href);if(r.origin===location.origin)return!0;let o=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(a=>o.endsWith(a))||n.some(a=>o===a.toLowerCase()||o.endsWith("."+a.toLowerCase())))return!0;let i=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(i)||/\.woff2?(\b|$)/.test(i)||sd.some(a=>i.includes(a)))return!0;for(let a of t){let s=a.toLowerCase().replace(/\s+/g,"+"),c=a.toLowerCase().replace(/\s+/g,"-"),l=md(a);if(i.includes(s)||i.includes(c)||l&&i.includes(l))return!0}return!1}catch{return!1}}function hd(e){let t=new Set;for(let n of e||[]){let r=String(n).split("__")[0]?.trim();r&&t.add(r)}return t}function Ca(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,o)=>{let i=(o||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return n;let a=i;try{a=new URL(i,t||location.href).href}catch{}return`url("${a}")`})}var Ur=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Mn=4;async function gd(e,t,n){if(!e)return e;let r=new Set;function o(s,c){try{return new URL(s,c||location.href).href}catch{return s}}async function i(s,c,l=0){if(l>Mn)return console.warn(`[snapDOM] @import depth exceeded (${Mn}) at ${c}`),s;let u="",d=0,f;for(;f=Ur.exec(s);){u+=s.slice(d,f.index),d=Ur.lastIndex;let m=(f[2]||f[4]||"").trim(),p=o(m,c);if(r.has(p)){console.warn(`[snapDOM] Skipping circular @import: ${p}`);continue}r.add(p);let g="";try{let h=await ve(p,{as:"text",useProxy:n,silent:!0});h.ok&&typeof h.data=="string"&&(g=h.data)}catch{}g?(g=Ca(g,p),g=await i(g,p,l+1),u+=`
197
+ `}catch{}}catch{}return t}function Uu(e,t,n){if(!t)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=t,e.insertBefore(r,e.firstChild||null)}function Vu(e,t){try{let n=e.currentSrc||e.src||"";if(!n)return;t.setAttribute("src",n),t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.loading="eager",t.decoding="sync"}catch{}}function Gu(e){let t=new Set;if(!e)return t;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(e);)t.add(r[1]);return t}function zu(e,t){try{let n=getComputedStyle(e).getPropertyValue(t).trim();if(n)return n}catch{}try{let n=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(n)return n}catch{}return""}function Yu(e,t,n){let r=[];for(let o of t){let i=zu(e,o);i&&r.push(`${o}: ${i};`)}return r.length?`${n}{${r.join("")}}
198
+ `:""}function qu(e){e&&(e.nodeType===Node.ELEMENT_NODE&&e.setAttribute("data-sd-slotted",""),e.querySelectorAll&&e.querySelectorAll("*").forEach(t=>t.setAttribute("data-sd-slotted","")))}async function ju(e,t=3){let n=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},r=n(),o=0;for(;o<t&&(!r||!r.body&&!r.documentElement);)await new Promise(i=>setTimeout(i,0)),r=n(),o++;return r&&(r.body||r.documentElement)?r:null}function Zu(e){let t=e.getBoundingClientRect(),n=0,r=0,o=0,i=0;try{let c=getComputedStyle(e);n=parseFloat(c.borderLeftWidth)||0,r=parseFloat(c.borderRightWidth)||0,o=parseFloat(c.borderTopWidth)||0,i=parseFloat(c.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(n+r))),s=Math.max(0,Math.round(t.height-(o+i)));return{contentWidth:a,contentHeight:s,rect:t}}function Ie(e){let t=0,n=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(n=e.offsetHeight),t===0||n===0)try{let r=getComputedStyle(e);if(t===0){let o=parseFloat(r.width);!isNaN(o)&&o>0&&(t=o)}if(n===0){let o=parseFloat(r.height);!isNaN(o)&&o>0&&(n=o)}}catch{}if(t===0||n===0)try{if(t===0){let r=parseFloat(e.getAttribute("width"));!isNaN(r)&&r>0&&(t=r)}if(n===0){let r=parseFloat(e.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((t===0||n===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),n===0&&e.naturalHeight>0&&(n=e.naturalHeight)}catch{}return{width:t,height:n}}function Xu(e,t,n){let r=e.createElement("style");return r.setAttribute("data-sd-iframe-pin",""),r.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(r),()=>{try{r.remove()}catch{}}}async function Ku(e,t,n){let r=await ju(e,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:o,contentHeight:i,rect:a}=Zu(e),s=n?.snap;if(!s&&typeof window<"u"&&window.snapdom&&(s=window.snapdom),!s||typeof s.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let c={...n,scale:1},l=Xu(r,o,i),u;try{u=await s.toPng(r.documentElement,c)}finally{l()}u.style.display="block",u.style.width=`${o}px`,u.style.height=`${i}px`;let d=document.createElement("div");return t.nodeMap.set(d,e),Ke(e,d,t,n),d.style.overflow="hidden",d.style.display="block",d.style.width||(d.style.width=`${Math.round(a.width)}px`),d.style.height||(d.style.height=`${Math.round(a.height)}px`),d.appendChild(u),d}function Ju(e){let{width:t,height:n}=Ie(e),r=e.getBoundingClientRect(),o;try{o=window.getComputedStyle(e)}catch{}let i=o?parseFloat(o.width):NaN,a=o?parseFloat(o.height):NaN,s=Math.round(t||r.width||0),c=Math.round(n||r.height||0),l=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,s||16),u=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,c||16),d=(e.type||"text").toLowerCase()==="checkbox",f=!!e.checked,m=!!e.indeterminate,p=Math.max(Math.min(l,u),12),g="middle";try{o&&o.verticalAlign&&(g=o.verticalAlign)}catch{}let h=document.createElement("div");h.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),h.style.cssText=`display:inline-block;width:${p}px;height:${p}px;vertical-align:${g};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");y.setAttribute("width",String(p)),y.setAttribute("height",String(p)),y.setAttribute("viewBox",`0 0 ${p} ${p}`),h.appendChild(y);function v(){let b="#0a6ed1";try{o&&(b=o.accentColor||o.color||b)}catch{}let w=2,S=w/2,I=p-w;if(y.innerHTML="",d){let C=document.createElementNS("http://www.w3.org/2000/svg","rect");if(C.setAttribute("x",String(S)),C.setAttribute("y",String(S)),C.setAttribute("width",String(I)),C.setAttribute("height",String(I)),C.setAttribute("rx","2"),C.setAttribute("ry","2"),C.setAttribute("fill",f?b:"none"),C.setAttribute("stroke",b),C.setAttribute("stroke-width",String(w)),y.appendChild(C),f){let E=document.createElementNS("http://www.w3.org/2000/svg","path");E.setAttribute("d",`M ${S+2} ${p/2} L ${p/2-1} ${p-S-2} L ${p-S-2} ${S+2}`),E.setAttribute("stroke","white"),E.setAttribute("stroke-width",String(Math.max(1.5,w))),E.setAttribute("fill","none"),E.setAttribute("stroke-linecap","round"),E.setAttribute("stroke-linejoin","round"),y.appendChild(E)}else if(m){let E=document.createElementNS("http://www.w3.org/2000/svg","rect"),M=Math.max(6,I-4);E.setAttribute("x",String((p-M)/2)),E.setAttribute("y",String((p-w)/2)),E.setAttribute("width",String(M)),E.setAttribute("height",String(w)),E.setAttribute("fill",b),E.setAttribute("rx","1"),y.appendChild(E)}}else{let C=document.createElementNS("http://www.w3.org/2000/svg","circle");if(C.setAttribute("cx",String(p/2)),C.setAttribute("cy",String(p/2)),C.setAttribute("r",String((p-w)/2)),C.setAttribute("fill",f?b:"none"),C.setAttribute("stroke",b),C.setAttribute("stroke-width",String(w)),y.appendChild(C),f){let E=document.createElementNS("http://www.w3.org/2000/svg","circle"),M=Math.max(2,(p-w*2)*.35);E.setAttribute("cx",String(p/2)),E.setAttribute("cy",String(p/2)),E.setAttribute("r",String(M)),E.setAttribute("fill","white"),y.appendChild(E)}}h.style.setProperty("width",`${p}px`,"important"),h.style.setProperty("height",`${p}px`,"important"),h.style.setProperty("min-width",`${p}px`,"important"),h.style.setProperty("min-height",`${p}px`,"important")}return v(),{el:h,applyVisual:v}}var Mt=new ge(80);async function Nt(e){if(A.resource?.has(e))return A.resource.get(e);if(Mt.has(e))return Mt.get(e);let t=(async()=>{let n=await ve(e,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return A.resource?.set(e,n.data),n.data})();Mt.set(e,t);try{let n=await t;return Mt.set(e,n),n}catch(n){throw Mt.delete(e),n}}var Qu=/\bblob:[^)"'\s]+/g;async function Ia(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(Qu)||[]));if(t.length===0)return e;let n=e;for(let r of t)try{let o=await Nt(r);n=n.split(r).join(o)}catch{}return n}function Sn(e){return typeof e=="string"&&e.startsWith("blob:")}function ed(e){return(e||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{let n=t.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function td(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}async function nd(e,t=null){if(!e)return;let n=t,r=e.querySelectorAll?e.querySelectorAll("img"):[];for(let c of r)try{let l=c.getAttribute("src")||c.currentSrc||"";if(Sn(l)){let d=await Nt(l);c.setAttribute("src",d)}let u=c.getAttribute("srcset");if(u&&u.includes("blob:")){let d=ed(u),f=!1;for(let m of d)if(Sn(m.url))try{m.url=await Nt(m.url),f=!0}catch(p){K(n,"blobUrlToDataUrl for srcset item failed",p)}f&&c.setAttribute("srcset",td(d))}}catch(l){K(n,"resolveBlobUrls for img failed",l)}let o=e.querySelectorAll?e.querySelectorAll("image"):[];for(let c of o)try{let l="http://www.w3.org/1999/xlink",u=c.getAttribute("href")||c.getAttributeNS?.(l,"href");if(Sn(u)){let d=await Nt(u);c.setAttribute("href",d),c.removeAttributeNS?.(l,"href")}}catch(l){K(n,"resolveBlobUrls for SVG image href failed",l)}let i=e.querySelectorAll?e.querySelectorAll("[style*='blob:']"):[];for(let c of i)try{let l=c.getAttribute("style");if(l&&l.includes("blob:")){let u=await Ia(l);c.setAttribute("style",u)}}catch(l){K(n,"replaceBlobUrls in inline style failed",l)}let a=e.querySelectorAll?e.querySelectorAll("style"):[];for(let c of a)try{let l=c.textContent||"";l.includes("blob:")&&(c.textContent=await Ia(l))}catch(l){K(n,"replaceBlobUrls in style tag failed",l)}let s=["poster"];for(let c of s){let l=e.querySelectorAll?e.querySelectorAll(`[${c}^='blob:']`):[];for(let u of l)try{let d=u.getAttribute(c);Sn(d)&&u.setAttribute(c,await Nt(d))}catch(d){K(n,`resolveBlobUrls for ${c} failed`,d)}}}Ot();async function An(e,t,n){if(!e)throw new Error("Invalid node");let r=new Set,o=null,i=null;if(e.nodeType===Node.ELEMENT_NODE){let u=(e.localName||e.tagName||"").toLowerCase();if(e.id==="snapdom-sandbox"||e.hasAttribute("data-snapdom-sandbox")||Ba.has(u))return null;if(u==="foreignobject"&&e.parentElement?.closest?.("foreignObject"))return K(t,"Nested <foreignObject> skipped (SVG spec limitation \u2014 not rendered by browsers)"),null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let u=document.createElement("div"),{width:d,height:f}=Ie(e),m=d||e.getBoundingClientRect().width||0,p=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${p}px;visibility:hidden;`,u}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let u of n.exclude)try{if(e.matches?.(u)){if(n.excludeMode==="hide"){let d=document.createElement("div"),{width:f,height:m}=Ie(e),p=f||e.getBoundingClientRect().width||0,g=m||e.getBoundingClientRect().height||0;return d.style.cssText=`display:inline-block;width:${p}px;height:${g}px;visibility:hidden;`,d}else if(n.excludeMode==="remove")return null}}catch(d){console.warn(`Invalid selector in exclude option: ${u}`,d)}if(typeof n.filter=="function")try{if(!n.filter(e)){if(n.filterMode==="hide"){let u=document.createElement("div"),{width:d,height:f}=Ie(e),m=d||e.getBoundingClientRect().width||0,p=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${p}px;visibility:hidden;`,u}else if(n.filterMode==="remove")return null}}catch(u){console.warn("Error in filter function:",u)}if(e.tagName==="IFRAME"){let u=!1;try{u=!!(e.contentDocument||e.contentWindow?.document)}catch(d){K(t,"iframe same-origin probe failed",d)}if(u)try{return await Ku(e,t,n)}catch(d){console.warn("[SnapDOM] iframe rasterization failed, fallback:",d)}if(u||console.warn("[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.",e),n.placeholders){let{width:d,height:f}=Ie(e),m=document.createElement("div");return m.style.cssText=`width:${d}px;height:${f}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,Ke(e,m,t,n),m}else{let{width:d,height:f}=Ie(e),m=document.createElement("div");return m.style.cssText=`display:inline-block;width:${d}px;height:${f}px;visibility:hidden;`,Ke(e,m,t,n),m}}if(e.getAttribute("data-capture")==="placeholder"){let u=e.cloneNode(!1);t.nodeMap.set(u,e),Ke(e,u,t,n);let d=document.createElement("div");return d.textContent=e.getAttribute("data-placeholder-text")||"",d.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",u.appendChild(d),u}if(e.tagName==="CANVAS"){let u="";try{let p=e.getContext("2d",{willReadFrequently:!0});try{p&&p.getImageData(0,0,1,1)}catch{}if(await new Promise(g=>requestAnimationFrame(g)),u=e.toDataURL("image/png"),!u||u==="data:,"){try{p&&p.getImageData(0,0,1,1)}catch{}if(await new Promise(g=>requestAnimationFrame(g)),u=e.toDataURL("image/png"),!u||u==="data:,"){let g=document.createElement("canvas");g.width=e.width,g.height=e.height;let h=g.getContext("2d");h&&(h.drawImage(e,0,0),u=g.toDataURL("image/png"))}}}catch(p){K(t,"Canvas toDataURL failed, using empty/fallback",p)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch(p){K(t,"img decoding/loading hints failed",p)}u&&(d.src=u),d.width=e.width,d.height=e.height;let{width:f,height:m}=Ie(e);return f>0&&(d.style.width=`${f}px`),m>0&&(d.style.height=`${m}px`),t.nodeMap.set(d,e),Ke(e,d,t,n),d}if(e.tagName==="VIDEO"){let u="";try{let p=document.createElement("canvas");p.width=e.videoWidth||e.offsetWidth||320,p.height=e.videoHeight||e.offsetHeight||240;let g=p.getContext("2d");g&&(g.drawImage(e,0,0,p.width,p.height),u=p.toDataURL("image/png"),(!u||u==="data:,")&&(u=""))}catch(p){K(t,"Video frame capture failed, using poster fallback",p)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch{}u?d.src=u:e.poster&&(d.src=e.poster),d.width=e.videoWidth||e.offsetWidth||0,d.height=e.videoHeight||e.offsetHeight||0;let{width:f,height:m}=Ie(e);return f>0&&(d.style.width=`${f}px`),m>0&&(d.style.height=`${m}px`),d.style.objectFit="contain",t.nodeMap.set(d,e),Ke(e,d,t,n),d}let a;try{if(a=e.cloneNode(!1),a.attributes?.length)try{for(let u of a.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(u.value)&&a.setAttribute(u.name,u.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if($u(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){Vu(e,a);try{let{width:u,height:d}=Ie(e),f=Math.round(u||0),m=Math.round(d||0);f&&(a.dataset.snapdomWidth=String(f)),m&&(a.dataset.snapdomHeight=String(m))}catch(u){K(t,"getUnscaledDimensions for IMG failed",u)}try{let u=e.getAttribute("style")||"",d=window.getComputedStyle(e),f=b=>{let w=u.match(new RegExp(`${b}\\s*:\\s*([^;]+)`,"i")),S=w?w[1].trim():d.getPropertyValue(b);return/%|auto/i.test(String(S||""))},m=parseInt(a.dataset.snapdomWidth||"0",10),p=parseInt(a.dataset.snapdomHeight||"0",10),g=f("width")||!m,h=f("height")||!p;g&&m&&(a.style.width=`${m}px`),h&&p&&(a.style.height=`${p}px`);let y=d.getPropertyValue("object-fit"),v=d.getPropertyValue("object-position");y&&y!=="fill"?(a.style.objectFit=y,v&&(a.style.objectPosition=v)):(m&&(a.style.minWidth=`${m}px`),p&&(a.style.minHeight=`${p}px`))}catch(u){K(t,"IMG dimension freeze failed",u)}}}catch(u){throw console.error("[Snapdom] Failed to clone node:",e,u),u}let s=null;if(e instanceof HTMLTextAreaElement){let{width:u,height:d}=Ie(e),f=u||e.getBoundingClientRect().width||0,m=d||e.getBoundingClientRect().height||0;f&&(a.style.width=`${f}px`),m&&(a.style.height=`${m}px`)}if(e instanceof HTMLInputElement){let u=(e.type||"text").toLowerCase();if((u==="checkbox"||u==="radio")&&fu()){let{el:d,applyVisual:f}=Ju(e);t.nodeMap.set(d,e),s=f,a=d}else a.value=e.value,a.setAttribute("value",e.value),e.checked!==void 0&&(a.checked=e.checked,e.checked&&a.setAttribute("checked",""),e.indeterminate&&(a.indeterminate=e.indeterminate))}if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&!e.value&&e.placeholder)try{let u=window.getComputedStyle(e,"::placeholder"),d=u&&u.color;if(d&&d!=="rgba(0, 0, 0, 0)"){let f="snapdom-ph-"+(Math.random()*1e6|0);a.classList.add(f);let m=document.createElement("style");m.textContent=`.${f}::placeholder{color:${d}!important;opacity:${u.opacity||"1"}!important;}`,a.prepend(m)}}catch{}if(e instanceof HTMLSelectElement&&(o=e.value),e instanceof HTMLTextAreaElement&&(i=e.value),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){e.disabled&&a.setAttribute("disabled",""),e.required&&a.setAttribute("required",""),e.readOnly&&a.setAttribute("readonly","");let u=e;u.min!==void 0&&u.min!==""&&a.setAttribute("min",u.min),u.max!==void 0&&u.max!==""&&a.setAttribute("max",u.max),u.pattern!==void 0&&u.pattern!==""&&a.setAttribute("pattern",u.pattern);let d=e.getAttribute("aria-invalid");d!==null&&a.setAttribute("aria-invalid",d)}if(Ke(e,a,t,n),s&&s(),e instanceof SVGElement){let u=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let d=window.getComputedStyle(e);for(let f of u){let m=d.getPropertyValue(f);m&&a.style.setProperty(f,m)}}catch{}}if(e.shadowRoot){let u=function(b,w){if(b.nodeType===Node.ELEMENT_NODE&&b.tagName==="STYLE")return w(null);An(b,t,n).then(S=>{w(S||null)}).catch(()=>{w(null)})};try{let b=e.shadowRoot.querySelectorAll("slot");for(let w of b){let S=[];try{S=w.assignedNodes?.({flatten:!0})||w.assignedNodes?.()||[]}catch{S=w.assignedNodes?.()||[]}for(let I of S)r.add(I)}}catch{}let d=Bu(t),f=`[data-sd="${d}"]`;try{a.setAttribute("data-sd",d)}catch{}let m=Hu(e.shadowRoot),p=Wu(m,f),g=Gu(m),h=Yu(e,g,f);Uu(a,h+p,d);let y=document.createDocumentFragment(),v=await Pr(Array.from(e.shadowRoot.childNodes),u,n.fast);y.append(...v.filter(b=>!!b)),a.appendChild(y)}if(e.tagName==="SLOT"){let u=function(g,h){An(g,t,n).then(y=>{y&&qu(y),h(y||null)}).catch(()=>{h(null)})},d=e.assignedNodes?.({flatten:!0})||[],f=d.length>0?d:Array.from(e.childNodes),m=document.createDocumentFragment(),p=await Pr(Array.from(f),u,n.fast);return m.append(...p.filter(g=>!!g)),m}function c(u,d){if(r.has(u))return d(null);An(u,t,n).then(f=>{d(f||null)}).catch(()=>{d(null)})}let l=await Pr(Array.from(e.childNodes),c,n.fast);if(a.append(...l.filter(u=>!!u)),o!==null&&a instanceof HTMLSelectElement){a.value=o;for(let u of a.options)u.value===o?u.setAttribute("selected",""):u.removeAttribute("selected")}return i!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=i),a}Ee();Nn();Ce();var rd=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],ft=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),zr=[];function od(e){let t=Array.isArray(e)?e:[e];for(let n of t)n instanceof RegExp?zr.push(n):typeof n=="string"?zr.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function _e(e){let t=typeof e=="string"?e:"",n=[...rd,...zr];for(let r of n)if(r instanceof RegExp&&r.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function id(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var Ea=new Map;function ad(e=""){let t=Object.create(null),n=String(e||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,o;for(;o=r.exec(n);)t[o[1].toUpperCase()]=Number(o[2]);return t}async function sd(e,t,n){let r=String(e||""),o=r.toLowerCase(),i=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(o)&&!/\bsymbols\b/.test(o))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(o))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),s="outlined";/\brounded\b/.test(i)||/\bround\b/.test(i)?s="rounded":/\bsharp\b/.test(i)?s="sharp":/\boutlined\b/.test(i)&&(s="outlined");let c=a===1,l=null;if(c&&(s==="outlined"&&ft.materialIconsFilled?l={url:ft.materialIconsFilled,alias:"snapdom-mi-filled"}:s==="rounded"&&ft.materialIconsRound?l={url:ft.materialIconsRound,alias:"snapdom-mi-round"}:s==="sharp"&&ft.materialIconsSharp&&(l={url:ft.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!Ea.has(l.alias))try{let d=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),Ea.set(l.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function ld(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function cd(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!n&&t.toLowerCase()!=="currentcolor")return t;let r=e.color?.trim();return r&&r!=="inherit"?r:"#000"}async function ud(e,{family:t="Material Icons",weight:n="normal",fontSize:r=32,color:o="#000",variation:i="",className:a=""}={}){let s=String(t||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,l=ad(i),{familyForMeasure:u,familyForCanvas:d}=await sd(s,a,l);await ld(d.replace(/^["']+|["']+$/g,""),r);let f=document.createElement("span");f.textContent=e,f.style.position="absolute",f.style.visibility="hidden",f.style.left="-99999px",f.style.whiteSpace="nowrap",f.style.fontFamily=u,f.style.fontWeight=String(n||"normal"),f.style.fontSize=`${r}px`,f.style.lineHeight="1",f.style.margin="0",f.style.padding="0",f.style.fontFeatureSettings="'liga' 1",f.style.fontVariantLigatures="normal",f.style.color=o,document.body.appendChild(f);let m=f.getBoundingClientRect(),p=Math.max(1,Math.ceil(m.width)),g=Math.max(1,Math.ceil(m.height));document.body.removeChild(f);let h=document.createElement("canvas");h.width=p*c,h.height=g*c;let y=h.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${r}px ${d}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=o;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:h.toDataURL(),width:p,height:g}}async function dd(e,t){if(!(e instanceof Element))return 0;let n='.material-icons, [class*="material-symbols"]',r=Array.from(e.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim());if(r.length===0)return 0;let o=t instanceof Element?Array.from(t.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],i=0;for(let a=0;a<r.length;a++){let s=r[a],c=o[a]||null;try{let l=getComputedStyle(c||s),u=l.fontFamily||"Material Icons";if(!id(u))continue;let d=(c||s).textContent.trim();if(!d)continue;let f=parseInt(l.fontSize,10)||24,m=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",p=cd(l),g=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",h=(c||s).className||"",{dataUrl:y,width:v,height:b}=await ud(d,{family:u,weight:m,fontSize:f,color:p,variation:g,className:h});s.textContent="";let w=s.ownerDocument.createElement("img");w.src=y,w.alt=d,w.style.height=`${f}px`,w.style.width=`${Math.max(1,Math.round(v/b*f))}px`,w.style.objectFit="contain",w.style.verticalAlign=getComputedStyle(s).verticalAlign||"baseline",s.appendChild(w),i++}catch{}}return i}gt();async function fd(e,t,n,r=32,o="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let i=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");a.textContent=e,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${t}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let s=a.getBoundingClientRect(),c=Math.ceil(s.width),l=Math.ceil(s.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,c*i),u.height=Math.max(1,l*i);let d=u.getContext("2d");return d.scale(i,i),d.font=n?`${n} ${r}px "${t}"`:`${r}px "${t}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=o,d.fillText(e,0,0),{dataUrl:u.toDataURL(),width:c,height:l}}var es=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),md=["katex","mathjax","mathml"];function to(e){if(!e)return"";for(let t of e.split(",")){let n=t.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!es.has(n.toLowerCase()))return n}return""}function pd(e){if(!e)return[];let t=[];for(let n of e.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(es.has(r.toLowerCase())||t.push(r))}return t}function kn(e){let t=String(e??"400").trim().toLowerCase();if(t==="normal")return 400;if(t==="bold")return 700;let n=parseInt(t,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function Mn(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function hd(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function gd(e){let t=String(e||"400").trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let o=kn(n[1]),i=kn(n[2]);return{min:Math.min(o,i),max:Math.max(o,i)}}let r=kn(t);return{min:r,max:r}}function yd(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function bd(e){let t=String(e||"100%").trim(),n=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let i=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(i,a),max:Math.max(i,a)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),o=r?parseFloat(r[1]):100;return{min:o,max:o}}function wd(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function vd(e,t,n=[]){if(!e)return!1;try{let r=new URL(e,location.href);if(r.origin===location.origin)return!0;let o=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(a=>o.endsWith(a))||n.some(a=>o===a.toLowerCase()||o.endsWith("."+a.toLowerCase())))return!0;let i=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(i)||/\.woff2?(\b|$)/.test(i)||md.some(a=>i.includes(a)))return!0;for(let a of t){let s=a.toLowerCase().replace(/\s+/g,"+"),c=a.toLowerCase().replace(/\s+/g,"-"),l=wd(a);if(i.includes(s)||i.includes(c)||l&&i.includes(l))return!0}return!1}catch{return!1}}function Cd(e){let t=new Set;for(let n of e||[]){let r=String(n).split("__")[0]?.trim();r&&t.add(r)}return t}function Aa(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,o)=>{let i=(o||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return n;let a=i;try{a=new URL(i,t||location.href).href}catch{}return`url("${a}")`})}var Yr=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Ln=4;async function Sd(e,t,n){if(!e)return e;let r=new Set;function o(s,c){try{return new URL(s,c||location.href).href}catch{return s}}async function i(s,c,l=0){if(l>Ln)return console.warn(`[snapDOM] @import depth exceeded (${Ln}) at ${c}`),s;let u="",d=0,f;for(;f=Yr.exec(s);){u+=s.slice(d,f.index),d=Yr.lastIndex;let m=(f[2]||f[4]||"").trim(),p=o(m,c);if(r.has(p)){console.warn(`[snapDOM] Skipping circular @import: ${p}`);continue}r.add(p);let g="";try{let h=await ve(p,{as:"text",useProxy:n,silent:!0});h.ok&&typeof h.data=="string"&&(g=h.data)}catch{}g?(g=Aa(g,p),g=await i(g,p,l+1),u+=`
199
199
  /* inlined: ${p} */
200
200
  ${g}
201
- `):u+=f[0]}return u+=s.slice(d),u}let a=Ca(e,t||location.href);return a=await i(a,t||location.href,0),a}var Ka=/url\((["']?)([^"')]+)\1\)/g,yd=/@font-face[^{}]*\{[^}]*\}/g;function Xa(e){if(!e)return[];let t=[],n=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let o=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!o)continue;let i=o[1],a=o[2],s=c=>{if(!c.includes("?"))return parseInt(c,16);let l=parseInt(c.replace(/\?/g,"0"),16),u=parseInt(c.replace(/\?/g,"F"),16);return[l,u]};if(a){let c=s(i),l=s(a),u=Array.isArray(c)?c[0]:c,d=Array.isArray(l)?l[1]:l;t.push([Math.min(u,d),Math.max(u,d)])}else{let c=s(i);Array.isArray(c)?t.push([c[0],c[1]]):t.push([c,c])}}return t}function Ja(e,t){if(!t.length||!e||e.size===0)return!0;for(let n of e)for(let[r,o]of t)if(n>=r&&n<=o)return!0;return!1}function Jr(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(Ka)){let o=(r[2]||"").trim();if(!(!o||o.startsWith("data:"))){if(!/^https?:/i.test(o))try{o=new URL(o,t||location.href).href}catch{}n.push(o)}}return n}async function Qa(e,t,n=""){let r=e;for(let o of e.matchAll(Ka)){let i=jr(o[0]);if(!i)continue;let a=i;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,t||location.href).href}catch{}if(!_e(a)){if(A.resource?.has(a)){A.font?.add(a),r=r.replace(o[0],`url(${A.resource.get(a)})`);continue}if(!A.font?.has(a))try{let s=await ve(a,{as:"dataURL",useProxy:n,silent:!0});if(s.ok&&typeof s.data=="string"){let c=s.data;A.resource?.set(a,c),A.font?.add(a),r=r.replace(o[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return r}function bd(e){if(!e.length)return null;let t=(a,s)=>e.some(([c,l])=>!(l<a||c>s)),n=t(0,255)||t(305,305),r=t(256,591)||t(7680,7935),o=t(880,1023),i=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":i?"cyrillic":o?"greek":r?"latin-ext":n?"latin":null}function Sa(e={}){let t=new Set((e.families||[]).map(o=>String(o).toLowerCase())),n=new Set((e.domains||[]).map(o=>String(o).toLowerCase())),r=new Set((e.subsets||[]).map(o=>String(o).toLowerCase()));return(o,i)=>{if(t.size&&t.has(o.family.toLowerCase()))return!0;if(n.size)for(let a of o.srcUrls)try{if(n.has(new URL(a).host.toLowerCase()))return!0}catch{}if(r.size){let a=bd(i);if(a&&r.has(a))return!0}return!1}}function wd(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let i of e.match(t)||[]){let a=i.match(/font-family:\s*([^;]+);/i)?.[1]||"",s=Xr(a),c=(i.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),l=(i.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),u=(i.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),d=(i.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),f=(i.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),m=Jr(f,location.href),p=m.length?m.map(h=>String(h).toLowerCase()).sort().join("|"):f.toLowerCase(),g=[String(s||"").toLowerCase(),c,l,u,d.toLowerCase(),p].join("|");n.has(g)||(n.add(g),r.push(i))}if(r.length===0)return e;let o=0;return e.replace(t,()=>r[o++]||"")}function vd(e,t,n,r,o){let i=Array.from(e||[]).sort().join("|"),a=t?JSON.stringify({families:(t.families||[]).map(u=>String(u).toLowerCase()).sort(),domains:(t.domains||[]).map(u=>String(u).toLowerCase()).sort(),subsets:(t.subsets||[]).map(u=>String(u).toLowerCase()).sort()}):"",s=(n||[]).map(u=>`${(u.family||"").toLowerCase()}::${u.weight||"normal"}::${u.style||"normal"}::${u.src||""}`).sort().join("|"),c=r||"",l=(o||[]).map(u=>String(u).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${i}::ex=${a}::lf=${s}::px=${c}::fd=${l}`}async function es(e,t,n,r){let o;try{o=e.cssRules||[]}catch{return}let i=(a,s)=>{try{return new URL(a,s||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let s=a.href?i(a.href,t):t;if(r.depth>=Mn){console.warn(`[snapDOM] CSSOM import depth exceeded (${Mn}) at ${s}`);continue}if(s&&r.visitedSheets.has(s)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${s}`);continue}s&&r.visitedSheets.add(s);let c={...r,depth:(r.depth||0)+1};await es(a.styleSheet,s,n,c);continue}if(a.type===CSSRule.FONT_FACE_RULE){let s=(a.style.getPropertyValue("font-family")||"").trim(),c=Xr(s);if(!c||_e(c))continue;let l=(a.style.getPropertyValue("font-weight")||"400").trim(),u=(a.style.getPropertyValue("font-style")||"normal").trim(),d=(a.style.getPropertyValue("font-stretch")||"100%").trim(),f=(a.style.getPropertyValue("src")||"").trim(),m=(a.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(c,u,l,d))continue;let p=Xa(m);if(!Ja(r.usedCodepoints,p))continue;let g={family:c,weightSpec:l,styleSpec:u,stretchSpec:d,unicodeRange:m,srcRaw:f,srcUrls:Jr(f,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(g,p))continue;if(/url\(/i.test(f)){let h=await Qa(f,t||location.href,r.useProxy);await n(`@font-face{font-family:${c};src:${h};font-style:${u};font-weight:${l};font-stretch:${d};${m?`unicode-range:${m};`:""}}`)}else await n(`@font-face{font-family:${c};src:${f};font-style:${u};font-weight:${l};font-stretch:${d};${m?`unicode-range:${m};`:""}}`)}}}async function Cd({required:e,usedCodepoints:t,exclude:n=void 0,localFonts:r=[],useProxy:o="",fontStylesheetDomains:i=[]}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let a=new Map;for(let h of e){let[y,v,b,w]=String(h).split("__");if(!y)continue;let S=a.get(y)||[];S.push({w:parseInt(v,10),s:b,st:parseInt(w,10)}),a.set(y,S)}function s(h,y,v,b){if(!a.has(h))return!1;let w=a.get(h),S=ud(v),I=dd(y),C=fd(b),E=S.min!==S.max,k=S.min,O=T=>I.kind==="normal"&&T==="normal"||I.kind!=="normal"&&(T==="italic"||T==="oblique"),D=!1;for(let T of w){let M=E?T.w>=S.min&&T.w<=S.max:T.w===k,W=O(En(T.s)),G=T.st>=C.min&&T.st<=C.max;if(M&&W&&G){D=!0;break}}if(D)return!0;if(!E)for(let T of w){let M=O(En(T.s)),W=T.st>=C.min&&T.st<=C.max;if(Math.abs(k-T.w)<=300&&M&&W)return!0}if(!E&&I.kind==="normal"&&w.some(T=>En(T.s)!=="normal"))for(let T of w){let M=Math.abs(k-T.w)<=300,W=T.st>=C.min&&T.st<=C.max;if(M&&W)return!0}return!1}let c=Sa(n),l=vd(e,n,r,o,i);if(A.resource?.has(l))return A.resource.get(l);let u=hd(e),d=[],f=Ur;for(let h of document.querySelectorAll("style")){let y=h.textContent||"";for(let v of y.matchAll(f)){let b=(v[2]||v[4]||"").trim();!b||_e(b)||document.querySelector(`link[rel="stylesheet"][href="${b}"]`)||d.push(b)}}d.length&&await Promise.all(d.map(h=>new Promise(y=>{if(document.querySelector(`link[rel="stylesheet"][href="${h}"]`))return y(null);let v=document.createElement("link");v.rel="stylesheet",v.href=h,v.setAttribute("data-snapdom","injected-import"),v.onload=()=>y(v),v.onerror=()=>y(null),document.head.appendChild(v)})));let m="",p=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(h=>!!h.href);for(let h of p)try{if(_e(h.href))continue;let y="",v=!1;try{v=new URL(h.href,location.href).origin===location.origin}catch{}if(!v){let w=Array.isArray(i)?i:[];if(!pd(h.href,u,w))continue}if(v){let w=Array.from(document.styleSheets).find(S=>S.href===h.href);if(w)try{let S=w.cssRules||[];y=Array.from(S).map(I=>I.cssText).join("")}catch{}}if(!y){let w=await ve(h.href,{as:"text",useProxy:o});if(w?.ok&&typeof w.data=="string"&&(y=w.data),_e(h.href))continue}y=await gd(y,h.href,o);let b="";for(let w of y.match(yd)||[]){let S=(w.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),I=Xr(S);if(!I||_e(I))continue;let C=(w.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),E=(w.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),k=(w.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),O=(w.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),D=(w.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),T=Jr(D,h.href);if(!s(I,E,C,k))continue;let M=Xa(O);if(!Ja(t,M))continue;let W={family:I,weightSpec:C,styleSpec:E,stretchSpec:k,unicodeRange:O,srcRaw:D,srcUrls:T,href:h.href};if(n&&c(W,M))continue;let G=/url\(/i.test(D)?await Qa(w,h.href,o):w;b+=G}b.trim()&&(m+=b)}catch{console.warn("[snapDOM] Failed to process stylesheet:",h.href)}let g={requiredIndex:a,usedCodepoints:t,faceMatchesRequired:s,simpleExcluder:n?Sa(n):null,useProxy:o,visitedSheets:new Set,depth:0};for(let h of document.styleSheets)if(!(h.href&&p.some(y=>y.href===h.href)))try{let y=h.href||location.origin+"/";y&&g.visitedSheets.add(y),await es(h,y,async v=>{m+=v},g)}catch{}try{for(let h of document.fonts||[]){if(!h||!h.family||h.status!=="loaded"||!h._snapdomSrc)continue;let y=String(h.family).replace(/^['"]+|['"]+$/g,"");if(_e(y)||!a.has(y)||n?.families&&n.families.some(b=>String(b).toLowerCase()===y.toLowerCase()))continue;let v=h._snapdomSrc;if(!String(v).startsWith("data:")){if(A.resource?.has(h._snapdomSrc))v=A.resource.get(h._snapdomSrc),A.font?.add(h._snapdomSrc);else if(!A.font?.has(h._snapdomSrc))try{let b=await ve(h._snapdomSrc,{as:"dataURL",useProxy:o,silent:!0});if(b.ok&&typeof b.data=="string")v=b.data,A.resource?.set(h._snapdomSrc,v),A.font?.add(h._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",h._snapdomSrc);continue}}m+=`@font-face{font-family:'${y}';src:url(${v});font-style:${h.style||"normal"};font-weight:${h.weight||"normal"};}`}}catch{}for(let h of r){if(!h||typeof h!="object")continue;let y=String(h.family||"").replace(/^['"]+|['"]+$/g,"");if(!y||_e(y)||!a.has(y)||n?.families&&n.families.some(C=>String(C).toLowerCase()===y.toLowerCase()))continue;let v=h.weight!=null?String(h.weight):"normal",b=h.style!=null?String(h.style):"normal",w=h.stretchPct!=null?`${h.stretchPct}%`:"100%",S=String(h.src||""),I=S;if(!I.startsWith("data:")){if(A.resource?.has(S))I=A.resource.get(S),A.font?.add(S);else if(!A.font?.has(S))try{let C=await ve(S,{as:"dataURL",useProxy:o,silent:!0});if(C.ok&&typeof C.data=="string")I=C.data,A.resource?.set(S,I),A.font?.add(S);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",S);continue}}m+=`@font-face{font-family:'${y}';src:url(${I});font-style:${b};font-weight:${v};font-stretch:${w};}`}return m&&(m=wd(m),A.resource?.set(l,m)),m}function ts(e){let t=new Set;if(!e)return t;let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),r=a=>{let s=ld(a.fontFamily);if(s.length)for(let c of s){let l=(u,d,f)=>`${c}__${In(u)}__${En(d)}__${cd(f)}`;t.add(l(a.fontWeight,a.fontStyle,a.fontStretch))}};r(getComputedStyle(e));let o=getComputedStyle(e,"::before");o&&o.content&&o.content!=="none"&&r(o);let i=getComputedStyle(e,"::after");for(i&&i.content&&i.content!=="none"&&r(i);n.nextNode();){let a=n.currentNode,s=getComputedStyle(a);r(s);let c=getComputedStyle(a,"::before");c&&c.content&&c.content!=="none"&&r(c);let l=getComputedStyle(a,"::after");l&&l.content&&l.content!=="none"&&r(l)}return t}function Sd(e){let t=new Set,n=o=>{if(o)for(let i of o)t.add(i.codePointAt(0))},r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let o=r.currentNode;if(o.nodeType===Node.TEXT_NODE)n(o.nodeValue||"");else if(o.nodeType===Node.ELEMENT_NODE){let i=o;for(let a of["::before","::after"]){let s=getComputedStyle(i,a)?.getPropertyValue("content");if(!(!s||s==="none"))if(/^"/.test(s)||/^'/.test(s))n(s.slice(1,-1));else{let c=s.match(/\\[0-9A-Fa-f]{1,6}/g);if(c)for(let l of c)try{t.add(parseInt(l.slice(1),16))}catch{}}}}}return t}async function ns(e,t=2){try{await document.fonts.ready}catch{}let n=Array.from(e||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let o=document.createElement("div");o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let i of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${i}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}document.body.appendChild(o),o.offsetWidth,document.body.removeChild(o)};for(let o=0;o<Math.max(1,t);o++)r(),await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i)))}Ce();function xd(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function Id(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function xa(e,t=!1){let n="",r=Math.max(1,e);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return t?n.toUpperCase():n}function Ia(e,t=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,e)),o="";for(let[i,a]of n)for(;r>=i;)o+=a,r-=i;return t?o:o.toLowerCase()}function Ea(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(e);case"decimal-leading-zero":{let n=Math.abs(e);return(e<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":return xa(e,!1);case"upper-alpha":return xa(e,!0);case"lower-roman":return Ia(e,!1);case"upper-roman":return Ia(e,!0);default:return String(e)}}function Ed(e){let t=()=>A?.session?.__counterEpoch??0,n=t(),r=new WeakMap,o=e instanceof Document?e.documentElement:e,i=f=>f&&f.tagName==="LI",a=f=>{let m=0,p=f?.parentElement;if(!p)return 0;for(let g of p.children){if(g===f)break;g.tagName==="LI"&&m++}return m},s=f=>{let m=new Map;for(let[p,g]of f)m.set(p,g.slice());return m},c=(f,m,p)=>{let g=s(f),h;try{h=p.style?.counterReset||getComputedStyle(p).counterReset}catch{}if(h&&h!=="none")for(let b of h.split(",")){let w=b.trim().split(/\s+/),S=w[0],I=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!S)continue;let C=m.get(S);if(C&&C.length){let E=C.slice();E.push(I),g.set(S,E)}else g.set(S,[I])}let y;try{y=p.style?.counterSet||getComputedStyle(p).counterSet}catch{}if(y&&y!=="none")for(let b of y.split(",")){let w=b.trim().split(/\s+/),S=w[0],I=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!S)continue;let C=g.get(S)||[];C.length===0&&C.push(0),C[C.length-1]=I,g.set(S,C)}let v;try{v=p.style?.counterIncrement||getComputedStyle(p).counterIncrement}catch{}if(v&&v!=="none")for(let b of v.split(",")){let w=b.trim().split(/\s+/),S=w[0],I=Number.isFinite(Number(w[1]))?Number(w[1]):1;if(!S)continue;let C=g.get(S)||[];C.length===0&&C.push(0),C[C.length-1]+=I,g.set(S,C)}try{if(getComputedStyle(p).display==="list-item"&&i(p)){let b=p.parentElement,w=1;if(b&&b.tagName==="OL"){let I=b.getAttribute("start"),C=Number.isFinite(Number(I))?Number(I):1,E=a(p),k=p.getAttribute("value");w=Number.isFinite(Number(k))?Number(k):C+E}else w=1+a(p);let S=g.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=w,g.set("list-item",S)}}catch{}return g},l=(f,m,p)=>{let g=c(p,m,f);r.set(f,g);let h=g;for(let v of f.children)h=l(v,g,h);let y=new Map;for(let[v,b]of p){let w=b.length,S=h.get(v);y.set(v,S&&S.length?S.slice(0,w):b.slice())}for(let[v,b]of h)!y.has(v)&&b.length&&!m.has(v)&&y.set(v,b.slice(0,1));return y},u=new Map;l(o,u,u);function d(){let f=t();if(f!==n){n=f;let m=new Map;l(o,m,m)}}return{get(f,m){d();let p=r.get(f)?.get(m);return p&&p.length?p[p.length-1]:0},getStack(f,m){d();let p=r.get(f)?.get(m);return p?p.slice():[]}}}function Ad(e,t,n){if(!e||e==="none")return e;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,o=e.replace(r,(i,a,s)=>{let c=String(s).split(",").map(l=>l.trim());if(a==="counter"){let l=c[0]?.replace(/^["']|["']$/g,""),u=(c[1]||"decimal").toLowerCase(),d=n.get(t,l);return Ea(d,u)}else{let l=c[0]?.replace(/^["']|["']$/g,""),u=c[1]?.replace(/^["']|["']$/g,"")??"",d=(c[2]||"decimal").toLowerCase(),f=n.getStack(t,l);return f.length?f.map(m=>Ea(m,d)).join(u):""}});return Id(o)}catch{return"- "}}ht();Ce();var ft=new WeakMap,Aa=1e3;function Md(e,t){let n=rs(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=ka(e),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):ka(e)}function Vr(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function rs(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${t.length}|`,r=0;for(let i=0;i<t.length;i++){let a=t[i];if(a.tagName==="STYLE"){let s=a.textContent?a.textContent.length:0;n+=`S${s}|`;let c=a.sheet,l=c?Vr(c):null;l&&(r+=l.length)}else{let s=a.getAttribute("href")||"",c=a.getAttribute("media")||"all";n+=`L${s}|m:${c}|`;let l=a.sheet,u=l?Vr(l):null;u&&(r+=u.length)}}let o=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(o)?o.length:0}|tr:${r}`,n}function Ma(e,t,n){let r=Vr(e);if(!r)return!1;for(let o=0;o<r.length;o++){if(n.budget<=0)return!1;let i=r[o],a=i&&i.cssText?i.cssText:"";n.budget--;for(let s of t)if(a.includes(s))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let s=0;s<i.cssRules.length&&n.budget>0;s++){let c=i.cssRules[s],l=c&&c.cssText?c.cssText:"";n.budget--;for(let u of t)if(l.includes(u))return!0}if(n.budget<=0)return!1}return!1}function ka(e=document){let t=rs(e),n=ft.get(e);if(n&&n.fingerprint===t)return n.result;let r=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],o=e.querySelectorAll("style");for(let a=0;a<o.length;a++){let s=o[a].textContent||"";for(let c of r)if(s.includes(c))return ft.set(e,{fingerprint:t,result:!0}),!0}let i=e.adoptedStyleSheets;if(Array.isArray(i)&&i.length){let a={budget:Aa};try{for(let s of i)if(Ma(s,r,a))return ft.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),s={budget:Aa};for(let c=0;c<a.length&&s.budget>0;c++){let l=a[c],u=null;if(l.tagName,u=l.sheet||null,u&&Ma(u,r,s))return ft.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(ft.set(e,{fingerprint:t,result:!0}),!0):(ft.set(e,{fingerprint:t,result:!1}),!1)}var pt=new WeakMap,Ta=-1;function kd(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Td(e){if(!e)return"";let t=[],n=/"([^"]*)"/g,r;for(;r=n.exec(e);)t.push(r[1]);return t.length?t.join(""):kd(e)}function Gr(e,t){let n=e.parentElement,r=n?pt.get(n):null;return r?{get(o,i){let a=t.get(o,i),s=r.get(i);return typeof s=="number"?Math.max(a,s):a},getStack(o,i){let a=t.getStack(o,i);if(!a.length)return a;let s=r.get(i);if(typeof s=="number"){let c=a.slice();return c[c.length-1]=Math.max(c[c.length-1],s),c}return a}}:t}function zr(e,t,n){let r=new Map;function o(c){let l=[];if(!c||c==="none")return l;for(let u of String(c).split(",")){let d=u.trim().split(/\s+/),f=d[0],m=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;f&&l.push({name:f,num:m})}return l}let i=o(t?.counterReset),a=o(t?.counterIncrement);function s(c){if(r.has(c))return r.get(c).slice();let l=n.getStack(e,c);l=l.length?l.slice():[];let u=i.find(f=>f.name===c);if(u){let f=Number.isFinite(u.num)?u.num:0;l=l.length?[...l,f]:[f]}let d=a.find(f=>f.name===c);if(d){let f=Number.isFinite(d.num)?d.num:1;l.length===0&&(l=[0]),l[l.length-1]+=f}return r.set(c,l.slice()),l}return{get(c,l){let u=s(l);return u.length?u[u.length-1]:0},getStack(c,l){return s(l)},__incs:a}}function Ld(e,t,n){let r;try{r=Fe(e,t)}catch{}let o=r?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};let i=Gr(e,n),a=zr(e,r,i),s=xd(o)?Ad(o,e,a):o;return{text:Td(s),incs:a.__incs||[]}}async function qr(e,t,n,r){if(!(e instanceof Element)||!(t instanceof Element))return;let o=e.ownerDocument||document;if(!Md(o,n))return;let i=A?.session?.__counterEpoch??0;if(Ta!==i&&(pt=new WeakMap,n&&(n.__counterCtx=null),Ta=i),!n.__counterCtx)try{n.__counterCtx=Ed(e.ownerDocument||document)}catch(c){X(n,"buildCounterContext failed",c)}let a=n.__counterCtx;for(let c of["::before","::after","::first-letter"])try{let l=Fe(e,c);if(!l||l.content==="none"&&l.backgroundImage==="none"&&l.backgroundColor==="transparent"&&(l.borderStyle==="none"||parseFloat(l.borderWidth)===0)&&(!l.transform||l.transform==="none")&&l.display==="inline")continue;if(c==="::first-letter"){let L=Fe(e);if(!(l.color!==L.color||l.fontSize!==L.fontSize||l.fontWeight!==L.fontWeight||l.fontFamily!==L.fontFamily||l.fontStyle!==L.fontStyle||l.textTransform!==L.textTransform||l.float!==L.float||l.paddingTop!==L.paddingTop||l.paddingRight!==L.paddingRight||l.paddingBottom!==L.paddingBottom||l.paddingLeft!==L.paddingLeft||l.marginTop!==L.marginTop||l.marginRight!==L.marginRight||l.marginBottom!==L.marginBottom||l.marginLeft!==L.marginLeft))continue;let $=Array.from(t.childNodes).find(N=>N.nodeType===Node.TEXT_NODE&&N.textContent?.trim().length>0);if(!$)continue;let _=$.textContent,F=_.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],z=_.slice(F?.length||0);if(!F||/[\uD800-\uDFFF]/.test(F))continue;let B=document.createElement("span");B.textContent=F,B.dataset.snapdomPseudo="::first-letter";let Y=da(l),j=Dr(Y,"span");n.styleMap.set(B,j);let ee=document.createTextNode(z);t.replaceChild(ee,$),t.insertBefore(B,ee);continue}let u=l.content??"",d=u===""||u==="none"||u==="normal",{text:f,incs:m}=Ld(e,c,a),p=l.backgroundImage,g=l.backgroundColor,h=l.fontFamily,y=parseInt(l.fontSize)||32,v=parseInt(l.fontWeight)||!1,b=l.color||"#000",w=l.borderStyle,S=parseFloat(l.borderWidth),I=l.transform,C=_e(h),E=!d&&f!=="",k=p&&p!=="none",O=g&&g!=="transparent"&&g!=="rgba(0, 0, 0, 0)",D=w&&w!=="none"&&S>0,T=I&&I!=="none";if(!(E||k||O||D||T)){if(m&&m.length&&e.parentElement){let L=pt.get(e.parentElement)||new Map;for(let{name:$}of m){if(!$)continue;let _=Gr(e,a),F=zr(e,Fe(e,c),_).get(e,$);L.set($,F)}pt.set(e.parentElement,L)}continue}let M=document.createElement("span");M.dataset.snapdomPseudo=c,M.style.pointerEvents="none";let W=da(l),G=Dr(W,"span");if(n.styleMap.set(M,G),C&&f&&f.length===1){let{dataUrl:L,width:$,height:_}=await ad(f,h,v,y,b),F=document.createElement("img");F.src=L,F.style=`height:${y}px;width:${$/_*y}px;object-fit:contain;`,M.appendChild(F),t.dataset.snapdomHasIcon="true"}else if(f&&f.startsWith("url(")){let L=jr(f);if(L?.trim())try{let $=await ve(An(L),{as:"dataURL",useProxy:r.useProxy});if($?.ok&&typeof $.data=="string"){let _=document.createElement("img");_.src=$.data,_.style=`width:${y}px;height:auto;object-fit:contain;`,M.appendChild(_)}}catch($){console.error(`[snapdom] Error in pseudo ${c} for`,e,$)}}else!C&&E&&(M.textContent=f);M.style.backgroundImage="none","maskImage"in M.style&&(M.style.maskImage="none"),"webkitMaskImage"in M.style&&(M.style.webkitMaskImage="none");try{M.style.backgroundRepeat=l.backgroundRepeat,M.style.backgroundSize=l.backgroundSize,l.backgroundPositionX&&l.backgroundPositionY?(M.style.backgroundPositionX=l.backgroundPositionX,M.style.backgroundPositionY=l.backgroundPositionY):M.style.backgroundPosition=l.backgroundPosition,M.style.backgroundOrigin=l.backgroundOrigin,M.style.backgroundClip=l.backgroundClip,M.style.backgroundAttachment=l.backgroundAttachment,M.style.backgroundBlendMode=l.backgroundBlendMode}catch{}if(k)try{let L=Pr(p),$=await Promise.all(L.map(Fa));M.style.backgroundImage=$.join(", ")}catch(L){console.warn(`[snapdom] Failed to inline background-image for ${c}`,L)}O&&(M.style.backgroundColor=g);let re=M.childNodes.length>0||M.textContent?.trim()!==""||k||O||D||T;if(m&&m.length&&e.parentElement){let L=pt.get(e.parentElement)||new Map,$=Gr(e,a),_=zr(e,Fe(e,c),$);for(let{name:F}of m){if(!F)continue;let z=_.get(e,F);L.set(F,z)}pt.set(e.parentElement,L)}if(!re)continue;c==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(M,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(M))}catch(l){console.warn(`[snapdom] Failed to capture ${c} for`,e,l)}let s=Array.from(t.children).filter(c=>!c.dataset.snapdomPseudo);if(n.nodeMap)for(let c of s){let l=n.nodeMap.get(c);l instanceof Element&&await qr(l,c,n,r)}else{let c=Array.from(e.children);for(let l=0;l<Math.min(c.length,s.length);l++)await qr(c[l],s[l],n,r)}}function Nd(e,t){if(!e||!(e instanceof Element))return;let n=e.ownerDocument||document,r=t||n,o=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(o.length===0)return;let i=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],s=w=>window.CSS&&CSS.escape?CSS.escape(w):w.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c="http://www.w3.org/1999/xlink",l=w=>{if(!w||!w.getAttribute)return null;let S=w.getAttribute("href")||w.getAttribute("xlink:href")||(typeof w.getAttributeNS=="function"?w.getAttributeNS(c,"href"):null);if(S)return S;let I=w.attributes;if(!I)return null;for(let C=0;C<I.length;C++){let E=I[C];if(!E||!E.name)continue;if(E.name==="href")return E.value;let k=E.name.indexOf(":");if(k!==-1&&E.name.slice(k+1)==="href")return E.value}return null},u=new Set(Array.from(e.querySelectorAll("[id]")).map(w=>w.id)),d=new Set,f=!1,m=(w,S=null)=>{if(!w)return;i.lastIndex=0;let I;for(;I=i.exec(w);){f=!0;let C=(I[1]||"").trim();C&&(u.has(C)||(d.add(C),S&&!S.has(C)&&S.add(C)))}},p=w=>{let S=w.querySelectorAll("use");for(let C of S){let E=l(C);if(!E||!E.startsWith("#"))continue;f=!0;let k=E.slice(1).trim();k&&!u.has(k)&&d.add(k)}let I=w.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let C of I){m(C.getAttribute("style")||"");for(let E of a)m(C.getAttribute(E))}};for(let w of o)p(w);if(!f)return;let g=e.querySelector("svg.inline-defs-container");g||(g=n.createElementNS("http://www.w3.org/2000/svg","svg"),g.classList.add("inline-defs-container"),g.setAttribute("aria-hidden","true"),g.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(g,e.firstChild||null));let h=g.querySelector("defs")||null,y=w=>{if(!w||u.has(w))return null;let S=s(w),I=C=>{let E=r.querySelector(C);return E&&!e.contains(E)?E:null};return I(`svg defs > *#${S}`)||I(`svg > symbol#${S}`)||I(`*#${S}`)};if(!d.size)return;let v=new Set(d),b=new Set;for(;v.size;){let w=v.values().next().value;if(v.delete(w),!w||u.has(w)||b.has(w))continue;let S=y(w);if(!S){b.add(w);continue}h||(h=n.createElementNS("http://www.w3.org/2000/svg","defs"),g.appendChild(h));let I=S.cloneNode(!0);I.id||I.setAttribute("id",w),h.appendChild(I),b.add(w),u.add(w);let C=[I,...I.querySelectorAll("*")];for(let E of C){let k=l(E);if(k&&k.startsWith("#")){let D=k.slice(1).trim();D&&!u.has(D)&&!b.has(D)&&v.add(D)}let O=E.getAttribute?.("style")||"";O&&m(O,v);for(let D of a){let T=E.getAttribute?.(D);T&&m(T,v)}}}}Ce();function Rd(e,t){if(!e||!t)return;let n=e.scrollTop||0;if(!n)return;getComputedStyle(t).position==="static"&&(t.style.position="relative");let r=e.getBoundingClientRect(),o=e.clientHeight,i="data-snap-ph",a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let s=a.currentNode,c=getComputedStyle(s),l=c.position;if(l!=="sticky"&&l!=="-webkit-sticky")continue;let u=La(c.top),d=La(c.bottom);if(u==null&&d==null)continue;let f=_d(s,e),m=Fd(t,f,i);if(!m)continue;let p=s.getBoundingClientRect(),g=p.width,h=p.height,y=p.left-r.left;if(!(g>0&&h>0)||!Number.isFinite(y))continue;let v=u!=null?u+n:n+(o-h-d);if(!Number.isFinite(v))continue;let b=Number.parseInt(c.zIndex,10),w=Number.isFinite(b),S=w?Math.max(b,1)+1:2,I=w?b-1:0,C=m.cloneNode(!1);C.setAttribute(i,"1"),C.style.position="sticky",C.style.left=`${y}px`,C.style.top=`${v}px`,C.style.width=`${g}px`,C.style.height=`${h}px`,C.style.visibility="hidden",C.style.zIndex=String(I),C.style.overflow="hidden",C.style.background="transparent",C.style.boxShadow="none",C.style.filter="none",m.parentElement?.insertBefore(C,m),m.style.position="absolute",m.style.left=`${y}px`,m.style.top=`${v}px`,m.style.bottom="auto",m.style.zIndex=String(S),m.style.pointerEvents="none"}}function La(e){if(!e||e==="auto")return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function _d(e,t){let n=[];for(let r=e;r&&r!==t;){let o=r.parentElement;if(!o)break;n.push(Array.prototype.indexOf.call(o.children,r)),r=o}return n.reverse()}function Fd(e,t,n){let r=e;for(let o=0;o<t.length;o++)if(r=Od(r,n)[t[o]],!r)return null;return r instanceof HTMLElement?r:null}function Od(e,t){let n=[],r=e.children;for(let o=0;o<r.length;o++){let i=r[o];i.hasAttribute(t)||n.push(i)}return n}function $d(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,o=t.borderStyle,i=t.borderWidth,a=n!=="none"&&parseFloat(r)>0,s=o==="none"||parseFloat(i)===0;a&&s&&(e.style.border=`${r} solid transparent`)}function Dd(e){let t=[];try{let n=e.querySelectorAll("*");for(let r of n){if(!(r instanceof HTMLElement))continue;let o=r.style.contentVisibility||"",i=getComputedStyle(r),a=i.contentVisibility||i.getPropertyValue("content-visibility")||"";(a==="auto"||a==="hidden")&&(t.push({el:r,original:o}),r.style.contentVisibility="visible")}if(e instanceof HTMLElement){let r=getComputedStyle(e),o=r.contentVisibility||r.getPropertyValue("content-visibility")||"";(o==="auto"||o==="hidden")&&(t.push({el:e,original:e.style.contentVisibility||""}),e.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:n,original:r}of t)try{n.style.contentVisibility=r}catch{}}}async function Pd(e,t={}){let n={styleMap:A.session.styleMap,styleCache:A.session.styleCache,nodeMap:A.session.nodeMap,options:t},r,o="",i="";$d(e);let a=Dd(e);try{Nd(e)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{r=await xn(e,n,t)}catch(l){throw console.warn("deepClone failed:",l),l}finally{a()}try{await qr(e,r,n,t)}catch(l){console.warn("inlinePseudoElements failed:",l)}await Ku(r,n);try{let l=r.querySelectorAll("style[data-sd]");for(let u of l)i+=u.textContent||"",u.remove()}catch(l){X(n,"Failed to extract shadow CSS from style[data-sd]",l)}let s=nu(n.styleMap);o=Array.from(s.entries()).map(([l,u])=>`.${u}{${l}}`).join(""),o=i+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+o;for(let[l,u]of n.styleMap.entries()){if(l.tagName==="STYLE")continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",u.replace(/;/g,"; "));continue}let d=s.get(u);d&&l.classList.add(d);let f=l.style?.backgroundImage,m=l.dataset?.snapdomHasIcon;f&&f!=="none"&&(l.style.backgroundImage=f),m&&(l.style.verticalAlign="middle",l.style.display="inline")}for(let[l,u]of n.nodeMap.entries()){let d=u.scrollLeft,f=u.scrollTop;if((d||f)&&l instanceof HTMLElement){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";try{let p=l.querySelectorAll("*");for(let g of p){if(!(g instanceof HTMLElement))continue;let h=g.style.position;if(h==="fixed"||h==="absolute"){let y=parseFloat(g.style.top)||0,v=parseFloat(g.style.left)||0;g.style.top=`${y+f}px`,g.style.left=`${v+d}px`,h==="fixed"&&(g.style.position="absolute")}}}catch{}let m=document.createElement("div");for(m.style.transform=`translate(${-d}px, ${-f}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m)}}let c=r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r;if(Rd(e,c),e===n.nodeMap.get(r)){let l=n.styleCache.get(e)||Fe(e);n.styleCache.set(e,l);let u=Gc(l.transform);r.style.margin="0",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.animation="none",r.style.transition="none",r.style.willChange="auto",r.style.float="none",r.style.clear="none",r.style.transform=u||""}for(let[l,u]of n.nodeMap.entries())u.tagName==="PRE"&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:r,classCSS:o,styleCache:n.styleCache}}ht();var os="http://www.w3.org/1999/xlink";function Wd(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(os,"href"):null)}function Bd(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,n=parseInt(e.dataset?.snapdomHeight||"",10)||0,r=parseInt(e.getAttribute("width")||"",10)||0,o=parseInt(e.getAttribute("height")||"",10)||0,i=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0,s=t||i||r||e.width||e.naturalWidth||100,c=n||a||o||e.height||e.naturalHeight||100;return{width:s,height:c}}async function Hd(e,t={}){let n=Array.from(e.querySelectorAll("img")),r=async a=>{if(!a.getAttribute("src")){let f=a.currentSrc||a.src||"";f&&a.setAttribute("src",f)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let s=a.src||"";if(!s)return;let c=await ve(s,{as:"dataURL",useProxy:t.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){a.src=c.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:l,height:u}=Bd(a),{fallbackURL:d}=t||{};if(d)try{let f=typeof d=="function"?await d({width:l,height:u,src:s,element:a}):d;if(f){let m=await ve(f,{as:"dataURL",useProxy:t.useProxy});if(m?.ok&&typeof m.data=="string"){a.src=m.data,a.width||(a.width=l),a.height||(a.height=u);return}}}catch{}if(t.placeholders!==!1){let f=document.createElement("div");f.style.cssText=[`width:${l}px`,`height:${u}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${u}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),f.textContent="img",a.replaceWith(f)}else{let f=document.createElement("div");f.style.cssText=`display:inline-block;width:${l}px;height:${u}px;visibility:hidden;`,a.replaceWith(f)}};for(let a=0;a<n.length;a+=4){let s=n.slice(a,a+4).map(r);await Promise.allSettled(s)}let o=Array.from(e.querySelectorAll("image")),i=async a=>{let s=Wd(a);if(!s||s.startsWith("data:")||s.startsWith("blob:"))return;let c=await ve(s,{as:"dataURL",useProxy:t.useProxy});c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")&&(a.setAttribute("href",c.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(os,"href"))};for(let a=0;a<o.length;a+=4){let s=o.slice(a,a+4).map(i);await Promise.allSettled(s)}}Ee();async function Ud(e,t,n,r={}){let o=[[e,t]],i=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],a=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],s=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],c=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;o.length;){let[l,u]=o.shift();if(!u)continue;let d=n.get(l)||Fe(l);n.has(l)||n.set(l,d);let f=(()=>{let g=d.getPropertyValue("border-image"),h=d.getPropertyValue("border-image-source");return g&&g!=="none"||h&&h!=="none"})();for(let g of s){let h=d.getPropertyValue(g);h&&u.style.setProperty(g,h)}for(let g of i){let h=d.getPropertyValue(g);if(g==="background-image"&&(!h||h==="none")){let b=d.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(h=Pr(b).filter(w=>/url\s*\(/.test(w)).join(", ")||h)}if(!h||h==="none")continue;let y=Pr(h),v=await Promise.all(y.map(b=>Fa(b,r)));v.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&u.style.setProperty(g,v.join(", "))}for(let g of a){let h=d.getPropertyValue(g);!h||h==="initial"||u.style.setProperty(g,h)}if(f)for(let g of c){let h=d.getPropertyValue(g);!h||h==="initial"||u.style.setProperty(g,h)}let m=l.shadowRoot?Array.from(l.shadowRoot.children).filter(g=>g.tagName!=="STYLE"):Array.from(l.children),p=Array.from(u.children).filter(g=>!(g.dataset?.snapdomPseudo||g.tagName==="STYLE"&&g.dataset?.sd));for(let g=0;g<Math.min(m.length,p.length);g++)o.push([m[g],p[g]])}}Ee();Ce();function Vd(e){if(!e)return()=>{};let t=[];function n(r){let o=Gd(r);o&&t.push(o);for(let i of r.children||[])n(i)}return n(e),()=>t.forEach(r=>r())}function Gd(e){if(!e)return()=>{};let t=zd(e);if(t<=0)return()=>{};if(!jd(e))return()=>{};let n=getComputedStyle(e),r=Math.round(qd(n)*t+Yd(n)),o=e.textContent??"",i=o;if(e.scrollHeight<=r+.5)return()=>{};let a=0,s=o.length,c=-1;for(;a<=s;){let l=a+s>>1;e.textContent=o.slice(0,l)+"\u2026",e.scrollHeight<=r+.5?(c=l,a=l+1):s=l-1}return e.textContent=(c>=0?o.slice(0,c):"")+"\u2026",()=>{e.textContent=i}}function zd(e){let t=getComputedStyle(e),n=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function qd(e){let t=(e.lineHeight||"").trim(),n=parseFloat(e.fontSize)||16;return!t||t==="normal"?Math.round(n*1.2):t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*n):t.endsWith("%")?Math.round(parseFloat(t)/100*n):Math.round(n*1.2)}function Yd(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function jd(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var Rt=[];function is(e){if(!e)return null;if(Array.isArray(e)){let[t,n]=e;return typeof t=="function"?t(n):t}if(typeof e=="object"&&"plugin"in e){let{plugin:t,options:n}=e;return typeof t=="function"?t(n):t}return typeof e=="function"?e():e}function Zd(...e){let t=e.flat();for(let n of t){let r=is(n);r&&(Rt.some(o=>o&&o.name&&r.name&&o.name===r.name)||Rt.push(r))}}function as(e){return(e&&Array.isArray(e.plugins)?e.plugins:Rt)||Rt}async function Pe(e,t,n){let r=n,o=as(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,r);typeof s<"u"&&(r=s)}return r}async function Kd(e,t,n){let r=[],o=as(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,n);typeof s<"u"&&r.push(s)}return r}function Xd(e){let t=[];if(Array.isArray(e))for(let n of e){let r=is(n);if(!r||!r.name)continue;let o=t.findIndex(i=>i&&i.name===r.name);o>=0&&t.splice(o,1),t.push(r)}for(let n of Rt)n&&n.name&&!t.some(r=>r.name===n.name)&&t.push(n);return Object.freeze(t)}function Jd(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=Xd(t)),e}Ee();function Qd(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow="none"}catch(i){X(n,"stripRootShadows boxShadow",i)}try{t.style.textShadow="none"}catch(i){X(n,"stripRootShadows textShadow",i)}try{t.style.outline="none"}catch(i){X(n,"stripRootShadows outline",i)}let o=(r.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=o.length?o:"none"}catch(i){X(n,"stripRootShadows filter",i)}}function ef(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)n.push(t.currentNode);for(let r of n)r.remove()}function tf(e,t={}){let{stripFrameworkDirectives:n=!0}=t,r=new Set(["xml","xlink"]),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;o.nextNode();){let i=o.currentNode;for(let a of Array.from(i.attributes)){let s=a.name;if(s.includes("@")){i.removeAttribute(s);continue}if(s.includes(":")){let c=s.split(":",1)[0];if(!r.has(c)){i.removeAttribute(s);continue}}if(n&&(s.startsWith("x-")||s.startsWith("v-")||s.startsWith(":")||s.startsWith("on:")||s.startsWith("bind:")||s.startsWith("let:")||s.startsWith("class:"))){i.removeAttribute(s);continue}}}}function nf(e,t={}){e&&(tf(e,t),ef(e))}function rf(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function of(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function af(e,t){if(!(e instanceof Element)||rf(e)||of(e))return!1;let n=t.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=t.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||t.transform&&t.transform!=="none")}function sf(e,t,n=new Map){function r(o,i){if(!(o instanceof Element)||!(i instanceof Element))return;let a=o.childElementCount>i.childElementCount,s=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,s),a&&af(o,s)){i.style.height||(i.style.height="auto"),i.style.width||(i.style.width="auto"),i.style.removeProperty("block-size"),i.style.removeProperty("inline-size"),i.style.minHeight||(i.style.minHeight="0"),i.style.minWidth||(i.style.minWidth="0"),i.style.maxHeight||(i.style.maxHeight="none"),i.style.maxWidth||(i.style.maxWidth="none");let u=s.overflowY||s.overflowBlock||"visible",d=s.overflowX||s.overflowInline||"visible";(u!=="visible"||d!=="visible")&&(i.style.overflow="visible")}let c=Array.from(o.children),l=Array.from(i.children);for(let u=0;u<Math.min(c.length,l.length);u++)r(c[u],l[u])}r(e,t)}function lf(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function cf(e,t){if(!(e instanceof Element))return!1;if(e.getAttribute("data-capture")==="exclude"&&t?.excludeMode==="remove")return!0;if(Array.isArray(t?.exclude))for(let n of t.exclude)try{if(e.matches(n))return t.excludeMode==="remove"}catch(r){X(t,"exclude selector match failed",r)}return!1}function uf(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),o=1/0,i=-1/0,a=!1,s=Array.from(e.children);for(let m of s){if(cf(m,t)||!lf(m))continue;let p=m.getBoundingClientRect(),g=p.top-r.top,h=p.bottom-r.top;h<=g||(g<o&&(o=g),h>i&&(i=h),a=!0)}let c=a?Math.max(0,i-o):0,l=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,f=parseFloat(n.paddingBottom)||0;return l+u+d+f+c}var R=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,df=/::-webkit-scrollbar(-[a-z]+)?\b/i;function Yr(e,t=new Set){let n="";if(!e)return n;for(let r=0;r<e.length;r++){let o=e[r];try{if(o.type===CSSRule.IMPORT_RULE&&o.styleSheet){n+=Yr(o.styleSheet.cssRules,t);continue}if(o.type===CSSRule.MEDIA_RULE&&o.cssRules){let i=Yr(o.cssRules,t);i&&(n+=`@media ${o.conditionText}{${i}}`);continue}if(o.type===CSSRule.STYLE_RULE){let i=o.selectorText||"";if(df.test(i)){let a=o.cssText;a&&!t.has(a)&&(t.add(a),n+=a)}}}catch{}}return n}function ff(e){if(!e||!e.styleSheets)return"";let t=new Set,n="";for(let r of Array.from(e.styleSheets))try{let o=r.cssRules;o&&(n+=Yr(o,t))}catch{}return n}function mf(e){let t=e.boxShadow||"";if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let n=t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(s=>s.trim()),r=0,o=0,i=0,a=0;for(let s of n){let c=s.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(c.length<2)continue;let[l,u,d=0,f=0]=c,m=Math.abs(l)+d+f,p=Math.abs(u)+d+f;o=Math.max(o,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),i=Math.max(i,p+Math.max(u,0)),r=Math.max(r,p+Math.max(-u,0))}return{top:Math.ceil(r),right:Math.ceil(o),bottom:Math.ceil(i),left:Math.ceil(a)}}function pf(e){let t=(e.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=t?Math.ceil(parseFloat(t[1])||0):0;return{top:n,right:n,bottom:n,left:n}}function hf(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0),n=parseFloat(e.outlineOffset||"0")||0,r=t+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function gf(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||t==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,o=0,i=0,a=0,s=!1;for(let c of n){s=!0;let l=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(g=>parseFloat(g))||[],[u=0,d=0,f=0]=l,m=Math.abs(u)+f,p=Math.abs(d)+f;o=Math.max(o,m+Math.max(u,0)),a=Math.max(a,m+Math.max(-u,0)),i=Math.max(i,p+Math.max(d,0)),r=Math.max(r,p+Math.max(-d,0))}return{bleed:{top:R(r),right:R(o),bottom:R(i),left:R(a)},has:s}}function yf(e,t){if(!e||!t||!t.style)return null;let n=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none")try{let s=ss(e);if(s.a===1&&s.b===0&&s.c===0&&s.d===1)return t.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}function o(s,c,l,u){let d=Math.sqrt(s*s+c*c)||0,f=0,m=0;if(d>0){let p=s/d,g=c/d;f=p*l+g*u;let h=l-p*f,y=u-g*f;m=Math.sqrt(h*h+y*y)||0,m>0?f=f/m:f=0}return{a:d,b:0,c:f*m,d:m}}let i=r.match(/^matrix\(\s*([^)]+)\)$/i);if(i){let s=i[1].split(",").map(c=>parseFloat(c.trim()));if(s.length===6&&s.every(Number.isFinite)){let[c,l,u,d]=s,f=o(c,l,u,d);try{t.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let s=a[1].split(",").map(c=>parseFloat(c.trim()));if(s.length===16&&s.every(Number.isFinite)){let c=s[0],l=s[1],u=s[4],d=s[5],f=o(c,l,u,d);try{t.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}try{let s=new DOMMatrix(r),c=o(s.a,s.b,s.c,s.d);try{t.style.transform=`matrix(${c.a}, ${c.b}, ${c.c}, ${c.d}, 0, 0)`}catch{}return c}catch{return null}}function Na(e,t,n,r,o){let i=n.a,a=n.b,s=n.c,c=n.d,l=n.e||0,u=n.f||0;function d(y,v){let b=y-r,w=v-o,S=i*b+s*w,I=a*b+c*w;return S+=r+l,I+=o+u,[S,I]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],m=1/0,p=1/0,g=-1/0,h=-1/0;for(let[y,v]of f)y<m&&(m=y),v<p&&(p=v),y>g&&(g=y),v>h&&(h=v);return{minX:m,minY:p,maxX:g,maxY:h,width:g-m,height:h-p}}function bf(e,t,n){let r=(e.transformOrigin||"0 0").trim().split(/\s+/),[o,i]=[r[0]||"0",r[1]||"0"],a=(s,c)=>{let l=s.toLowerCase();return l==="left"||l==="top"?0:l==="center"?c/2:l==="right"||l==="bottom"?c:l.endsWith("px")?parseFloat(l)||0:l.endsWith("%")?(parseFloat(l)||0)*c/100:/^-?\d+(\.\d+)?$/.test(l)&&parseFloat(l)||0};return{ox:a(o,t),oy:a(i,n)}}function wf(e){let t={rotate:"0deg",scale:null,translate:null},n=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(n){let o=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},i=o("rotate");if(i)if(i.angle){let c=i.angle;t.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else i.unit?t.rotate=i.unit==="rad"?i.value*180/Math.PI+"deg":i.value+i.unit:t.rotate=String(i);else{let c=getComputedStyle(e);t.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let a=o("scale");if(a){let c="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,l="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:c;t.scale=`${c} ${l}`}else{let c=getComputedStyle(e);t.scale=c.scale&&c.scale!=="none"?c.scale:null}let s=o("translate");if(s){let c="x"in s&&"value"in s.x?s.x.value:Array.isArray(s)?s[0]?.value:0,l="y"in s&&"value"in s.y?s.y.value:Array.isArray(s)?s[1]?.value:0,u="x"in s&&s.x?.unit?s.x.unit:"px",d="y"in s&&s.y?.unit?s.y.unit:"px";t.translate=`${c}${u} ${l}${d}`}else{let c=getComputedStyle(e);t.translate=c.translate&&c.translate!=="none"?c.translate:null}return t}let r=getComputedStyle(e);return t.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",t.scale=r.scale&&r.scale!=="none"?r.scale:null,t.translate=r.translate&&r.translate!=="none"?r.translate:null,t}var Or=null;function vf(){if(Or)return Or;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),Or=e,e}function Cf(e){let t=vf(),n=document.createElement("div");n.style.transformOrigin="0 0",e.baseTransform&&(n.style.transform=e.baseTransform),e.rotate&&(n.style.rotate=e.rotate),e.scale&&(n.style.scale=e.scale),e.translate&&(n.style.translate=e.translate),t.appendChild(n);let r=ss(n);return t.removeChild(n),r}function Sf(e){let t=getComputedStyle(e),n=t.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=t.rotate&&t.rotate!=="none"&&t.rotate!=="0deg",o=t.scale&&t.scale!=="none"&&t.scale!=="1",i=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(r||o||i)}function ss(e){let t=getComputedStyle(e).transform;if(!t||t==="none")return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}async function ls(e,t){if(!e)throw new Error("Element cannot be null or undefined");Vc(t.cache);let n=t.fast,r=t.outerTransforms!==!1,o=!!t.outerShadows,i={element:e,options:t,plugins:t.plugins},a,s,c,l="",u="",d,f,m=null;await Pe("beforeSnap",i),await Pe("beforeClone",i);let p=Vd(i.element);try{({clone:a,classCSS:s,styleCache:c}=await Pd(i.element,i.options)),!r&&a&&(m=yf(i.element,a)),!o&&a&&Qd(i.element,a,i.options)}finally{p()}if(i={clone:a,classCSS:s,styleCache:c,...i},await Pe("afterClone",i),nf(i.clone),i.options?.excludeMode==="remove")try{sf(i.element,i.clone,i.styleCache)}catch(b){console.warn("[snapdom] shrink pass failed:",b)}try{await id(i.clone,i.element)}catch{}await new Promise(b=>{mt(async()=>{await Hd(i.clone,i.options),b()},{fast:n})}),await new Promise(b=>{mt(async()=>{await Ud(i.element,i.clone,i.styleCache,i.options),b()},{fast:n})}),t.embedFonts&&await new Promise(b=>{mt(async()=>{let w=ts(i.element),S=Sd(i.element);if(Je()){let I=new Set(Array.from(w).map(C=>String(C).split("__")[0]).filter(Boolean));await ns(I,1)}l=await Cd({required:w,usedCodepoints:S,preCached:!1,exclude:i.options.excludeFonts,useProxy:i.options.useProxy,fontStylesheetDomains:i.options.fontStylesheetDomains}),b()},{fast:n})});let g=eu(i.clone).sort(),h=g.join(",");A.baseStyle.has(h)?u=A.baseStyle.get(h):await new Promise(b=>{mt(()=>{u=tu(g),A.baseStyle.set(h,u),b()},{fast:n})});let y=ff(i.element?.ownerDocument||document);i={fontsCSS:l,baseCSS:u,scrollbarCSS:y,...i},await Pe("beforeRender",i),await new Promise(b=>{mt(()=>{let w=Fe(i.element),S=i.element.getBoundingClientRect(),I=Math.max(1,R(i.element.offsetWidth||parseFloat(w.width)||S.width||1)),C=Math.max(1,R(i.element.offsetHeight||parseFloat(w.height)||S.height||1)),E=i.element.ownerDocument||document;if(i.element===E.body||i.element===E.documentElement){let ue=Math.max(i.element.scrollHeight||0,E.documentElement?.scrollHeight||0,E.body?.scrollHeight||0),de=Math.max(i.element.scrollWidth||0,E.documentElement?.scrollWidth||0,E.body?.scrollWidth||0);ue>0&&(C=Math.max(C,R(ue))),de>0&&(I=Math.max(I,R(de)));try{let Me=(i.scrollbarCSS||"").length+(i.baseCSS||"").length+(i.fontsCSS||"").length+(i.classCSS||"").length,ke=A.measureHints.get(i.element);if(ke&&ke.cssLen===Me&&ke.w0===I)ke.csh>0&&(C=Math.max(C,R(ke.csh))),ke.csw>0&&(I=Math.max(I,R(ke.csw)));else{let Te=E.createElement("div");Te.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+I+"px!important;overflow:visible!important;visibility:hidden!important;";let Pt=E.createElement("style");Pt.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS,Te.appendChild(Pt),Te.appendChild(i.clone.cloneNode(!0)),E.body.appendChild(Te);let Oe=Te.scrollHeight,Wn=Te.scrollWidth;E.body.removeChild(Te),A.measureHints.set(i.element,{cssLen:Me,w0:I,csh:Oe,csw:Wn}),Oe>0&&(C=Math.max(C,R(Oe))),Wn>0&&(I=Math.max(I,R(Wn)))}}catch{}}if(i.options?.excludeMode==="remove"){let ue=uf(i.element,i.options);Number.isFinite(ue)&&ue>0&&(C=Math.max(1,Math.min(C,R(ue+1))))}let k=(ue,de=NaN)=>{let Me=typeof ue=="string"?parseFloat(ue):ue;return Number.isFinite(Me)?Me:de},O=k(i.options.width),D=k(i.options.height),T=I,M=C,W=Number.isFinite(O),G=Number.isFinite(D),re=C>0?I/C:1;W&&G?(T=Math.max(1,R(O)),M=Math.max(1,R(D))):W?(T=Math.max(1,R(O)),M=Math.max(1,R(T/(re||1)))):G?(M=Math.max(1,R(D)),T=Math.max(1,R(M*(re||1)))):(T=I,M=C);let L=0,$=0,_=I,F=C;if(!r&&m&&Number.isFinite(m.a)){let ue={a:m.a,b:m.b||0,c:m.c||0,d:m.d||1,e:0,f:0},de=Na(I,C,ue,0,0);L=R(de.minX),$=R(de.minY),_=R(de.maxX),F=R(de.maxY)}else if(r&&Ra(i.element)){let ue=w.transform&&w.transform!=="none"?w.transform:"",de=wf(i.element),Me=Cf({baseTransform:ue,rotate:de.rotate||"0deg",scale:de.scale,translate:de.translate}),{ox:ke,oy:Te}=bf(w,I,C),Pt=Me.is2D?Me:new DOMMatrix(Me.toString()),Oe=Na(I,C,Pt,ke,Te);L=R(Oe.minX),$=R(Oe.minY),_=R(Oe.maxX),F=R(Oe.maxY)}let z=mf(w),B=pf(w),Y=hf(w),j=gf(w),ee=o?{top:R(z.top+B.top+Y.top+j.bleed.top),right:R(z.right+B.right+Y.right+j.bleed.right),bottom:R(z.bottom+B.bottom+Y.bottom+j.bleed.bottom),left:R(z.left+B.left+Y.left+j.bleed.left)}:{top:0,right:0,bottom:0,left:0};L=R(L-ee.left),$=R($-ee.top),_=R(_+ee.right),F=R(F+ee.bottom);let N=Math.max(1,R(_-L)),J=Math.max(1,R(F-$)),Z=W||G?R(T/I):1,U=G||W?R(M/C):1,ie=Math.max(1,R(N*Z)),V=Math.max(1,R(J*U)),se="http://www.w3.org/2000/svg",We=Je()&&Ra(i.element)?1:0,Q=R(We+(r?0:1)),me=document.createElementNS(se,"foreignObject"),Us=R(L),Vs=R($);me.setAttribute("x",String(R(-(Us-Q)))),me.setAttribute("y",String(R(-(Vs-Q)))),me.setAttribute("width",String(R(I+Q*2))),me.setAttribute("height",String(R(C+Q*2))),me.style.overflow="visible";let uo=document.createElement("style"),Gs='svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject *{min-width:0;} foreignObject pre,foreignObject [style*="white-space"]{white-space:inherit;}';uo.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+Gs+i.classCSS,me.appendChild(uo);let Dt=document.createElement("div");Dt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Dt.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${R(I)}px;height:${R(C)}px`,Dt.appendChild(i.clone),me.appendChild(Dt);let zs=new XMLSerializer().serializeToString(me),Dn=R(N+Q*2),Pn=R(J+Q*2),fo=W||G;t.meta={w0:I,h0:C,vbW:Dn,vbH:Pn,targetW:T,targetH:M};let qs=Je()&&fo?Dn:R(ie+Q*2),Ys=Je()&&fo?Pn:R(V+Q*2),js=parseFloat(Fe(E.documentElement)?.fontSize)||16;f=`<svg xmlns="${se}" width="${qs}" height="${Ys}" viewBox="0 0 ${Dn} ${Pn}" font-size="${js}px">`+zs+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,i={svgString:f,dataURL:d,...i},b()},{fast:n})}),await Pe("afterRender",i);let v=document.getElementById("snapdom-sandbox");return v&&v.style.position==="absolute"&&v.remove(),i.dataURL}function Ra(e){return Sf(e)}Ce();function xf(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let n=Uc(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:e.placeholders!==!1,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:n,useProxy:typeof e.useProxy=="string"?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,safariWarmupAttempts:Math.min(3,Math.max(1,(e.safariWarmupAttempts??3)|0)),excludeStyleProps:e.excludeStyleProps??null}}Ft();Ba();Ee();ht();Ce();function If(...e){return Zd(...e),q}var q=Object.assign(Af,{plugins:If}),cs=Symbol("snapdom.internal"),Ef=Symbol("snapdom.internal.silent"),_a=!1;async function Af(e,t){if(!e)throw new Error("Element cannot be null or undefined");let n=xf(t);if(Jd(n,t&&t.plugins),Je()&&(n.embedFonts===!0||kf(e))){if(n.embedFonts)try{let o=ts(e),i=new Set([...o].map(a=>String(a).split("__")[0]).filter(Boolean));await ns(i,1)}catch{}let r=n.safariWarmupAttempts??3;for(let o=0;o<r;o++)try{await Mf(e,t)}catch{}}return n.iconFonts&&n.iconFonts.length>0&&Ju(n.iconFonts),n.snap||(n.snap={toPng:(r,o)=>q.toPng(r,o),toSvg:(r,o)=>q.toSvg(r,o)}),q.capture(e,n,cs)}q.capture=async(e,t,n)=>{if(n!==cs)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await ls(e,t),o={img:async(g,h)=>{let{toImg:y}=await Promise.resolve().then(()=>(ma(),Wr));return y(r,{...g,...h||{}})},svg:async(g,h)=>{let{toSvg:y}=await Promise.resolve().then(()=>(ma(),Wr));return y(r,{...g,...h||{}})},canvas:async(g,h)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(Ln(),Ha));return y(r,{...g,...h||{}})},blob:async(g,h)=>{let{toBlob:y}=await Promise.resolve().then(()=>(qa(),Ga));return y(r,{...g,...h||{}})},png:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Sn(),Cn));return y(r,{...g,...h||{},format:"png"})},jpeg:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Sn(),Cn));return y(r,{...g,...h||{},format:"jpeg"})},webp:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Sn(),Cn));return y(r,{...g,...h||{},format:"webp"})},download:async(g,h)=>{let{download:y}=await Promise.resolve().then(()=>(gu(),Ya));return y(r,{...g,...h||{}})}},i={};for(let g of["img","svg","canvas","blob","png","jpeg","webp"])i[g]=async h=>o[g](t,{...h||{},[Ef]:!0});i.jpg=i.jpeg;let a={...t,export:{url:r},exports:i},s=await Kd("defineExports",a),c=Object.assign({},...s.filter(g=>g&&typeof g=="object")),l={...o,...c};l.jpeg&&!l.jpg&&(l.jpg=(g,h)=>l.jpeg(g,h));function u(g,h){let y={...t,...h||{}};return(g==="jpeg"||g==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,f=Promise.resolve();async function m(g,h){let y=async()=>{let v=l[g];if(!v)throw new Error(`[snapdom] Unknown export type: ${g}`);let b=u(g,h),w={...t,export:{type:g,options:b,url:r}};await Pe("beforeExport",w);let S=await v(w,b);return await Pe("afterExport",w,S),d||(d=!0,await Pe("afterSnap",t)),S};return f=f.then(y)}let p={url:r,toRaw:()=>r,to:(g,h)=>m(g,h),toImg:g=>m("img",g),toSvg:g=>m("svg",g),toCanvas:g=>m("canvas",g),toBlob:g=>m("blob",g),toPng:g=>m("png",g),toJpg:g=>m("jpg",g),toWebp:g=>m("webp",g),download:g=>m("download",g)};for(let g of Object.keys(l)){let h="to"+g.charAt(0).toUpperCase()+g.slice(1);p[h]||(p[h]=y=>m(g,y))}return p};q.toRaw=(e,t)=>q(e,t).then(n=>n.toRaw());q.toImg=(e,t)=>q(e,t).then(n=>n.toImg());q.toSvg=(e,t)=>q(e,t).then(n=>n.toSvg());q.toCanvas=(e,t)=>q(e,t).then(n=>n.toCanvas());q.toBlob=(e,t)=>q(e,t).then(n=>n.toBlob());q.toPng=(e,t)=>q(e,{...t,format:"png"}).then(n=>n.toPng());q.toJpg=(e,t)=>q(e,{...t,format:"jpeg"}).then(n=>n.toJpg());q.toWebp=(e,t)=>q(e,{...t,format:"webp"}).then(n=>n.toWebp());q.download=(e,t)=>q(e,t).then(n=>n.download());async function Mf(e,t){if(_a)return;let n={...t,fast:!0,embedFonts:!0,scale:.2},r;try{r=await ls(e,n)}catch(o){X(t,"safariWarmup pre-capture failed",o)}await new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o))),r&&await new Promise(o=>{let i=new Image;try{i.decoding="sync",i.loading="eager"}catch(a){X(t,"safariWarmup img hints failed",a)}i.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",i.src=r,document.body.appendChild(i),(async()=>{try{typeof i.decode=="function"&&await i.decode()}catch(s){X(t,"safariWarmup img.decode failed",s)}let a=performance.now();for(;!(i.complete&&i.naturalWidth>0)&&performance.now()-a<900;)await new Promise(s=>setTimeout(s,200));await new Promise(s=>requestAnimationFrame(s));try{let s=document.createElement("canvas");s.width=Math.max(1,i.naturalWidth||10),s.height=Math.max(1,i.naturalHeight||10);let c=s.getContext("2d");c&&c.drawImage(i,0,0)}catch{}await new Promise(s=>requestAnimationFrame(s));try{i.remove()}catch(s){X(t,"safariWarmup img.remove failed",s)}o()})()}),e.querySelectorAll("canvas").forEach(o=>{try{let i=o.getContext("2d",{willReadFrequently:!0});i&&i.getImageData(0,0,1,1)}catch(i){X(t,"safariWarmup canvas poke failed",i)}}),_a=!0}function kf(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();){let n=t.currentNode,r=getComputedStyle(n),o=r.backgroundImage&&r.backgroundImage!=="none",i=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(o||i||n.tagName==="CANVAS")return!0}return!1}function us(e){if(e.dataset.fontProxied||!e.rel||!e.rel.includes("stylesheet"))return!1;let t=e.href||"";try{return new URL(t).origin!==window.location.origin}catch{return!1}}function ds(e){let t=`/__mindstudio_dev__/font-proxy?url=${encodeURIComponent(e.href)}`,n=document.createElement("link");n.rel="stylesheet",n.href=t,n.dataset.fontProxied="true",e.media&&(n.media=e.media),n.onload=()=>{e.remove()},n.onerror=()=>{n.remove()},e.parentNode?.insertBefore(n,e.nextSibling)}function fs(){let e=document.querySelectorAll('link[rel~="stylesheet"]');for(let t of e)us(t)&&ds(t)}function Tf(){let e=x().fonts;e.observer||(e.observer=new MutationObserver(t=>{for(let n of t)for(let r of n.addedNodes)r instanceof HTMLLinkElement&&us(r)&&ds(r)}),e.observer.observe(document.documentElement,{childList:!0,subtree:!0}))}function Lf(e){try{let t=new URL(e,window.location.origin);return t.origin===window.location.origin?!1:!!(/\.(css|woff2?|ttf|otf|eot)(\?|$)/i.test(t.pathname)||t.pathname.includes("/css"))}catch{return!1}}function Nf(){if(window.fetch.__ms_font_proxied)return;let e=window.fetch;window.fetch=function(t,n){let r=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if(Lf(r)){let o=`/__mindstudio_dev__/font-proxy?url=${encodeURIComponent(r)}`;return e.apply(this,[o,n])}return e.apply(this,[t,n])},window.fetch.__ms_font_proxied=!0}function ms(){let e=x().fonts;e.initialized||(e.initialized=!0,Nf(),fs(),Tf())}async function ps(){fs();try{await document.fonts.ready}catch{}}var Rf=750,_f=400,Ae=2,gs={name:"text-fit",afterClone(e){if(!e.clone)return;let t=e.clone.ownerDocument;if(!t)return;let n=t.createElement("style");n.textContent="* { letter-spacing: -0.03px !important; }",e.clone.prepend(n)}},ys=["#__mindstudio-cursor","#__mindstudio-cursor-ripple","#__mindstudio-notes-host","#__mindstudio-camera","#__mindstudio-flash","#__mindstudio-touch-circle"],Ff="#DD2590",Of=`<svg width="44" height="44" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
201
+ `):u+=f[0]}return u+=s.slice(d),u}let a=Aa(e,t||location.href);return a=await i(a,t||location.href,0),a}var ts=/url\((["']?)([^"')]+)\1\)/g,xd=/@font-face[^{}]*\{[^}]*\}/g;function ns(e){if(!e)return[];let t=[],n=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let o=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!o)continue;let i=o[1],a=o[2],s=c=>{if(!c.includes("?"))return parseInt(c,16);let l=parseInt(c.replace(/\?/g,"0"),16),u=parseInt(c.replace(/\?/g,"F"),16);return[l,u]};if(a){let c=s(i),l=s(a),u=Array.isArray(c)?c[0]:c,d=Array.isArray(l)?l[1]:l;t.push([Math.min(u,d),Math.max(u,d)])}else{let c=s(i);Array.isArray(c)?t.push([c[0],c[1]]):t.push([c,c])}}return t}function rs(e,t){if(!t.length||!e||e.size===0)return!0;for(let n of e)for(let[r,o]of t)if(n>=r&&n<=o)return!0;return!1}function no(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(ts)){let o=(r[2]||"").trim();if(!(!o||o.startsWith("data:"))){if(!/^https?:/i.test(o))try{o=new URL(o,t||location.href).href}catch{}n.push(o)}}return n}async function os(e,t,n=""){let r=e;for(let o of e.matchAll(ts)){let i=Jr(o[0]);if(!i)continue;let a=i;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,t||location.href).href}catch{}if(!_e(a)){if(A.resource?.has(a)){A.font?.add(a),r=r.replace(o[0],`url(${A.resource.get(a)})`);continue}if(!A.font?.has(a))try{let s=await ve(a,{as:"dataURL",useProxy:n,silent:!0});if(s.ok&&typeof s.data=="string"){let c=s.data;A.resource?.set(a,c),A.font?.add(a),r=r.replace(o[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return r}function Id(e){if(!e.length)return null;let t=(a,s)=>e.some(([c,l])=>!(l<a||c>s)),n=t(0,255)||t(305,305),r=t(256,591)||t(7680,7935),o=t(880,1023),i=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":i?"cyrillic":o?"greek":r?"latin-ext":n?"latin":null}function ka(e={}){let t=new Set((e.families||[]).map(o=>String(o).toLowerCase())),n=new Set((e.domains||[]).map(o=>String(o).toLowerCase())),r=new Set((e.subsets||[]).map(o=>String(o).toLowerCase()));return(o,i)=>{if(t.size&&t.has(o.family.toLowerCase()))return!0;if(n.size)for(let a of o.srcUrls)try{if(n.has(new URL(a).host.toLowerCase()))return!0}catch{}if(r.size){let a=Id(i);if(a&&r.has(a))return!0}return!1}}function Ed(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let i of e.match(t)||[]){let a=i.match(/font-family:\s*([^;]+);/i)?.[1]||"",s=to(a),c=(i.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),l=(i.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),u=(i.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),d=(i.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),f=(i.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),m=no(f,location.href),p=m.length?m.map(h=>String(h).toLowerCase()).sort().join("|"):f.toLowerCase(),g=[String(s||"").toLowerCase(),c,l,u,d.toLowerCase(),p].join("|");n.has(g)||(n.add(g),r.push(i))}if(r.length===0)return e;let o=0;return e.replace(t,()=>r[o++]||"")}function Ad(e,t,n,r,o){let i=Array.from(e||[]).sort().join("|"),a=t?JSON.stringify({families:(t.families||[]).map(u=>String(u).toLowerCase()).sort(),domains:(t.domains||[]).map(u=>String(u).toLowerCase()).sort(),subsets:(t.subsets||[]).map(u=>String(u).toLowerCase()).sort()}):"",s=(n||[]).map(u=>`${(u.family||"").toLowerCase()}::${u.weight||"normal"}::${u.style||"normal"}::${u.src||""}`).sort().join("|"),c=r||"",l=(o||[]).map(u=>String(u).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${i}::ex=${a}::lf=${s}::px=${c}::fd=${l}`}async function is(e,t,n,r){let o;try{o=e.cssRules||[]}catch{return}let i=(a,s)=>{try{return new URL(a,s||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let s=a.href?i(a.href,t):t;if(r.depth>=Ln){console.warn(`[snapDOM] CSSOM import depth exceeded (${Ln}) at ${s}`);continue}if(s&&r.visitedSheets.has(s)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${s}`);continue}s&&r.visitedSheets.add(s);let c={...r,depth:(r.depth||0)+1};await is(a.styleSheet,s,n,c);continue}if(a.type===CSSRule.FONT_FACE_RULE){let s=(a.style.getPropertyValue("font-family")||"").trim(),c=to(s);if(!c||_e(c))continue;let l=(a.style.getPropertyValue("font-weight")||"400").trim(),u=(a.style.getPropertyValue("font-style")||"normal").trim(),d=(a.style.getPropertyValue("font-stretch")||"100%").trim(),f=(a.style.getPropertyValue("src")||"").trim(),m=(a.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(c,u,l,d))continue;let p=ns(m);if(!rs(r.usedCodepoints,p))continue;let g={family:c,weightSpec:l,styleSpec:u,stretchSpec:d,unicodeRange:m,srcRaw:f,srcUrls:no(f,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(g,p))continue;if(/url\(/i.test(f)){let h=await os(f,t||location.href,r.useProxy);await n(`@font-face{font-family:${c};src:${h};font-style:${u};font-weight:${l};font-stretch:${d};${m?`unicode-range:${m};`:""}}`)}else await n(`@font-face{font-family:${c};src:${f};font-style:${u};font-weight:${l};font-stretch:${d};${m?`unicode-range:${m};`:""}}`)}}}async function kd({required:e,usedCodepoints:t,exclude:n=void 0,localFonts:r=[],useProxy:o="",fontStylesheetDomains:i=[]}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let a=new Map;for(let h of e){let[y,v,b,w]=String(h).split("__");if(!y)continue;let S=a.get(y)||[];S.push({w:parseInt(v,10),s:b,st:parseInt(w,10)}),a.set(y,S)}function s(h,y,v,b){if(!a.has(h))return!1;let w=a.get(h),S=gd(v),I=yd(y),C=bd(b),E=S.min!==S.max,M=S.min,O=T=>I.kind==="normal"&&T==="normal"||I.kind!=="normal"&&(T==="italic"||T==="oblique"),D=!1;for(let T of w){let k=E?T.w>=S.min&&T.w<=S.max:T.w===M,W=O(Mn(T.s)),G=T.st>=C.min&&T.st<=C.max;if(k&&W&&G){D=!0;break}}if(D)return!0;if(!E)for(let T of w){let k=O(Mn(T.s)),W=T.st>=C.min&&T.st<=C.max;if(Math.abs(M-T.w)<=300&&k&&W)return!0}if(!E&&I.kind==="normal"&&w.some(T=>Mn(T.s)!=="normal"))for(let T of w){let k=Math.abs(M-T.w)<=300,W=T.st>=C.min&&T.st<=C.max;if(k&&W)return!0}return!1}let c=ka(n),l=Ad(e,n,r,o,i);if(A.resource?.has(l))return A.resource.get(l);let u=Cd(e),d=[],f=Yr;for(let h of document.querySelectorAll("style")){let y=h.textContent||"";for(let v of y.matchAll(f)){let b=(v[2]||v[4]||"").trim();!b||_e(b)||document.querySelector(`link[rel="stylesheet"][href="${b}"]`)||d.push(b)}}d.length&&await Promise.all(d.map(h=>new Promise(y=>{if(document.querySelector(`link[rel="stylesheet"][href="${h}"]`))return y(null);let v=document.createElement("link");v.rel="stylesheet",v.href=h,v.setAttribute("data-snapdom","injected-import"),v.onload=()=>y(v),v.onerror=()=>y(null),document.head.appendChild(v)})));let m="",p=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(h=>!!h.href);for(let h of p)try{if(_e(h.href))continue;let y="",v=!1;try{v=new URL(h.href,location.href).origin===location.origin}catch{}if(!v){let w=Array.isArray(i)?i:[];if(!vd(h.href,u,w))continue}if(v){let w=Array.from(document.styleSheets).find(S=>S.href===h.href);if(w)try{let S=w.cssRules||[];y=Array.from(S).map(I=>I.cssText).join("")}catch{}}if(!y){let w=await ve(h.href,{as:"text",useProxy:o});if(w?.ok&&typeof w.data=="string"&&(y=w.data),_e(h.href))continue}y=await Sd(y,h.href,o);let b="";for(let w of y.match(xd)||[]){let S=(w.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),I=to(S);if(!I||_e(I))continue;let C=(w.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),E=(w.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),M=(w.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),O=(w.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),D=(w.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),T=no(D,h.href);if(!s(I,E,C,M))continue;let k=ns(O);if(!rs(t,k))continue;let W={family:I,weightSpec:C,styleSpec:E,stretchSpec:M,unicodeRange:O,srcRaw:D,srcUrls:T,href:h.href};if(n&&c(W,k))continue;let G=/url\(/i.test(D)?await os(w,h.href,o):w;b+=G}b.trim()&&(m+=b)}catch{console.warn("[snapDOM] Failed to process stylesheet:",h.href)}let g={requiredIndex:a,usedCodepoints:t,faceMatchesRequired:s,simpleExcluder:n?ka(n):null,useProxy:o,visitedSheets:new Set,depth:0};for(let h of document.styleSheets)if(!(h.href&&p.some(y=>y.href===h.href)))try{let y=h.href||location.origin+"/";y&&g.visitedSheets.add(y),await is(h,y,async v=>{m+=v},g)}catch{}try{for(let h of document.fonts||[]){if(!h||!h.family||h.status!=="loaded"||!h._snapdomSrc)continue;let y=String(h.family).replace(/^['"]+|['"]+$/g,"");if(_e(y)||!a.has(y)||n?.families&&n.families.some(b=>String(b).toLowerCase()===y.toLowerCase()))continue;let v=h._snapdomSrc;if(!String(v).startsWith("data:")){if(A.resource?.has(h._snapdomSrc))v=A.resource.get(h._snapdomSrc),A.font?.add(h._snapdomSrc);else if(!A.font?.has(h._snapdomSrc))try{let b=await ve(h._snapdomSrc,{as:"dataURL",useProxy:o,silent:!0});if(b.ok&&typeof b.data=="string")v=b.data,A.resource?.set(h._snapdomSrc,v),A.font?.add(h._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",h._snapdomSrc);continue}}m+=`@font-face{font-family:'${y}';src:url(${v});font-style:${h.style||"normal"};font-weight:${h.weight||"normal"};}`}}catch{}for(let h of r){if(!h||typeof h!="object")continue;let y=String(h.family||"").replace(/^['"]+|['"]+$/g,"");if(!y||_e(y)||!a.has(y)||n?.families&&n.families.some(C=>String(C).toLowerCase()===y.toLowerCase()))continue;let v=h.weight!=null?String(h.weight):"normal",b=h.style!=null?String(h.style):"normal",w=h.stretchPct!=null?`${h.stretchPct}%`:"100%",S=String(h.src||""),I=S;if(!I.startsWith("data:")){if(A.resource?.has(S))I=A.resource.get(S),A.font?.add(S);else if(!A.font?.has(S))try{let C=await ve(S,{as:"dataURL",useProxy:o,silent:!0});if(C.ok&&typeof C.data=="string")I=C.data,A.resource?.set(S,I),A.font?.add(S);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",S);continue}}m+=`@font-face{font-family:'${y}';src:url(${I});font-style:${b};font-weight:${v};font-stretch:${w};}`}return m&&(m=Ed(m),A.resource?.set(l,m)),m}function as(e){let t=new Set;if(!e)return t;let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),r=a=>{let s=pd(a.fontFamily);if(s.length)for(let c of s){let l=(u,d,f)=>`${c}__${kn(u)}__${Mn(d)}__${hd(f)}`;t.add(l(a.fontWeight,a.fontStyle,a.fontStretch))}};r(getComputedStyle(e));let o=getComputedStyle(e,"::before");o&&o.content&&o.content!=="none"&&r(o);let i=getComputedStyle(e,"::after");for(i&&i.content&&i.content!=="none"&&r(i);n.nextNode();){let a=n.currentNode,s=getComputedStyle(a);r(s);let c=getComputedStyle(a,"::before");c&&c.content&&c.content!=="none"&&r(c);let l=getComputedStyle(a,"::after");l&&l.content&&l.content!=="none"&&r(l)}return t}function Md(e){let t=new Set,n=o=>{if(o)for(let i of o)t.add(i.codePointAt(0))},r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let o=r.currentNode;if(o.nodeType===Node.TEXT_NODE)n(o.nodeValue||"");else if(o.nodeType===Node.ELEMENT_NODE){let i=o;for(let a of["::before","::after"]){let s=getComputedStyle(i,a)?.getPropertyValue("content");if(!(!s||s==="none"))if(/^"/.test(s)||/^'/.test(s))n(s.slice(1,-1));else{let c=s.match(/\\[0-9A-Fa-f]{1,6}/g);if(c)for(let l of c)try{t.add(parseInt(l.slice(1),16))}catch{}}}}}return t}async function ss(e,t=2){try{await document.fonts.ready}catch{}let n=Array.from(e||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let o=document.createElement("div");o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let i of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${i}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}document.body.appendChild(o),o.offsetWidth,document.body.removeChild(o)};for(let o=0;o<Math.max(1,t);o++)r(),await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i)))}Ce();function Td(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function Ld(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Ma(e,t=!1){let n="",r=Math.max(1,e);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return t?n.toUpperCase():n}function Ta(e,t=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,e)),o="";for(let[i,a]of n)for(;r>=i;)o+=a,r-=i;return t?o:o.toLowerCase()}function La(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(e);case"decimal-leading-zero":{let n=Math.abs(e);return(e<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":return Ma(e,!1);case"upper-alpha":return Ma(e,!0);case"lower-roman":return Ta(e,!1);case"upper-roman":return Ta(e,!0);default:return String(e)}}function Nd(e){let t=()=>A?.session?.__counterEpoch??0,n=t(),r=new WeakMap,o=e instanceof Document?e.documentElement:e,i=f=>f&&f.tagName==="LI",a=f=>{let m=0,p=f?.parentElement;if(!p)return 0;for(let g of p.children){if(g===f)break;g.tagName==="LI"&&m++}return m},s=f=>{let m=new Map;for(let[p,g]of f)m.set(p,g.slice());return m},c=(f,m,p)=>{let g=s(f),h;try{h=p.style?.counterReset||getComputedStyle(p).counterReset}catch{}if(h&&h!=="none")for(let b of h.split(",")){let w=b.trim().split(/\s+/),S=w[0],I=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!S)continue;let C=m.get(S);if(C&&C.length){let E=C.slice();E.push(I),g.set(S,E)}else g.set(S,[I])}let y;try{y=p.style?.counterSet||getComputedStyle(p).counterSet}catch{}if(y&&y!=="none")for(let b of y.split(",")){let w=b.trim().split(/\s+/),S=w[0],I=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!S)continue;let C=g.get(S)||[];C.length===0&&C.push(0),C[C.length-1]=I,g.set(S,C)}let v;try{v=p.style?.counterIncrement||getComputedStyle(p).counterIncrement}catch{}if(v&&v!=="none")for(let b of v.split(",")){let w=b.trim().split(/\s+/),S=w[0],I=Number.isFinite(Number(w[1]))?Number(w[1]):1;if(!S)continue;let C=g.get(S)||[];C.length===0&&C.push(0),C[C.length-1]+=I,g.set(S,C)}try{if(getComputedStyle(p).display==="list-item"&&i(p)){let b=p.parentElement,w=1;if(b&&b.tagName==="OL"){let I=b.getAttribute("start"),C=Number.isFinite(Number(I))?Number(I):1,E=a(p),M=p.getAttribute("value");w=Number.isFinite(Number(M))?Number(M):C+E}else w=1+a(p);let S=g.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=w,g.set("list-item",S)}}catch{}return g},l=(f,m,p)=>{let g=c(p,m,f);r.set(f,g);let h=g;for(let v of f.children)h=l(v,g,h);let y=new Map;for(let[v,b]of p){let w=b.length,S=h.get(v);y.set(v,S&&S.length?S.slice(0,w):b.slice())}for(let[v,b]of h)!y.has(v)&&b.length&&!m.has(v)&&y.set(v,b.slice(0,1));return y},u=new Map;l(o,u,u);function d(){let f=t();if(f!==n){n=f;let m=new Map;l(o,m,m)}}return{get(f,m){d();let p=r.get(f)?.get(m);return p&&p.length?p[p.length-1]:0},getStack(f,m){d();let p=r.get(f)?.get(m);return p?p.slice():[]}}}function Rd(e,t,n){if(!e||e==="none")return e;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,o=e.replace(r,(i,a,s)=>{let c=String(s).split(",").map(l=>l.trim());if(a==="counter"){let l=c[0]?.replace(/^["']|["']$/g,""),u=(c[1]||"decimal").toLowerCase(),d=n.get(t,l);return La(d,u)}else{let l=c[0]?.replace(/^["']|["']$/g,""),u=c[1]?.replace(/^["']|["']$/g,"")??"",d=(c[2]||"decimal").toLowerCase(),f=n.getStack(t,l);return f.length?f.map(m=>La(m,d)).join(u):""}});return Ld(o)}catch{return"- "}}gt();Ce();var mt=new WeakMap,Na=1e3;function _d(e,t){let n=ls(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=_a(e),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):_a(e)}function qr(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function ls(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${t.length}|`,r=0;for(let i=0;i<t.length;i++){let a=t[i];if(a.tagName==="STYLE"){let s=a.textContent?a.textContent.length:0;n+=`S${s}|`;let c=a.sheet,l=c?qr(c):null;l&&(r+=l.length)}else{let s=a.getAttribute("href")||"",c=a.getAttribute("media")||"all";n+=`L${s}|m:${c}|`;let l=a.sheet,u=l?qr(l):null;u&&(r+=u.length)}}let o=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(o)?o.length:0}|tr:${r}`,n}function Ra(e,t,n){let r=qr(e);if(!r)return!1;for(let o=0;o<r.length;o++){if(n.budget<=0)return!1;let i=r[o],a=i&&i.cssText?i.cssText:"";n.budget--;for(let s of t)if(a.includes(s))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let s=0;s<i.cssRules.length&&n.budget>0;s++){let c=i.cssRules[s],l=c&&c.cssText?c.cssText:"";n.budget--;for(let u of t)if(l.includes(u))return!0}if(n.budget<=0)return!1}return!1}function _a(e=document){let t=ls(e),n=mt.get(e);if(n&&n.fingerprint===t)return n.result;let r=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],o=e.querySelectorAll("style");for(let a=0;a<o.length;a++){let s=o[a].textContent||"";for(let c of r)if(s.includes(c))return mt.set(e,{fingerprint:t,result:!0}),!0}let i=e.adoptedStyleSheets;if(Array.isArray(i)&&i.length){let a={budget:Na};try{for(let s of i)if(Ra(s,r,a))return mt.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),s={budget:Na};for(let c=0;c<a.length&&s.budget>0;c++){let l=a[c],u=null;if(l.tagName,u=l.sheet||null,u&&Ra(u,r,s))return mt.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(mt.set(e,{fingerprint:t,result:!0}),!0):(mt.set(e,{fingerprint:t,result:!1}),!1)}var ht=new WeakMap,Fa=-1;function Fd(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Od(e){if(!e)return"";let t=[],n=/"([^"]*)"/g,r;for(;r=n.exec(e);)t.push(r[1]);return t.length?t.join(""):Fd(e)}function jr(e,t){let n=e.parentElement,r=n?ht.get(n):null;return r?{get(o,i){let a=t.get(o,i),s=r.get(i);return typeof s=="number"?Math.max(a,s):a},getStack(o,i){let a=t.getStack(o,i);if(!a.length)return a;let s=r.get(i);if(typeof s=="number"){let c=a.slice();return c[c.length-1]=Math.max(c[c.length-1],s),c}return a}}:t}function Zr(e,t,n){let r=new Map;function o(c){let l=[];if(!c||c==="none")return l;for(let u of String(c).split(",")){let d=u.trim().split(/\s+/),f=d[0],m=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;f&&l.push({name:f,num:m})}return l}let i=o(t?.counterReset),a=o(t?.counterIncrement);function s(c){if(r.has(c))return r.get(c).slice();let l=n.getStack(e,c);l=l.length?l.slice():[];let u=i.find(f=>f.name===c);if(u){let f=Number.isFinite(u.num)?u.num:0;l=l.length?[...l,f]:[f]}let d=a.find(f=>f.name===c);if(d){let f=Number.isFinite(d.num)?d.num:1;l.length===0&&(l=[0]),l[l.length-1]+=f}return r.set(c,l.slice()),l}return{get(c,l){let u=s(l);return u.length?u[u.length-1]:0},getStack(c,l){return s(l)},__incs:a}}function $d(e,t,n){let r;try{r=Fe(e,t)}catch{}let o=r?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};let i=jr(e,n),a=Zr(e,r,i),s=Td(o)?Rd(o,e,a):o;return{text:Od(s),incs:a.__incs||[]}}async function Xr(e,t,n,r){if(!(e instanceof Element)||!(t instanceof Element))return;let o=e.ownerDocument||document;if(!_d(o,n))return;let i=A?.session?.__counterEpoch??0;if(Fa!==i&&(ht=new WeakMap,n&&(n.__counterCtx=null),Fa=i),!n.__counterCtx)try{n.__counterCtx=Nd(e.ownerDocument||document)}catch(c){K(n,"buildCounterContext failed",c)}let a=n.__counterCtx;for(let c of["::before","::after","::first-letter"])try{let l=Fe(e,c);if(!l||l.content==="none"&&l.backgroundImage==="none"&&l.backgroundColor==="transparent"&&(l.borderStyle==="none"||parseFloat(l.borderWidth)===0)&&(!l.transform||l.transform==="none")&&l.display==="inline")continue;if(c==="::first-letter"){let L=Fe(e);if(!(l.color!==L.color||l.fontSize!==L.fontSize||l.fontWeight!==L.fontWeight||l.fontFamily!==L.fontFamily||l.fontStyle!==L.fontStyle||l.textTransform!==L.textTransform||l.float!==L.float||l.paddingTop!==L.paddingTop||l.paddingRight!==L.paddingRight||l.paddingBottom!==L.paddingBottom||l.paddingLeft!==L.paddingLeft||l.marginTop!==L.marginTop||l.marginRight!==L.marginRight||l.marginBottom!==L.marginBottom||l.marginLeft!==L.marginLeft))continue;let $=Array.from(t.childNodes).find(N=>N.nodeType===Node.TEXT_NODE&&N.textContent?.trim().length>0);if(!$)continue;let _=$.textContent,F=_.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],z=_.slice(F?.length||0);if(!F||/[\uD800-\uDFFF]/.test(F))continue;let B=document.createElement("span");B.textContent=F,B.dataset.snapdomPseudo="::first-letter";let q=ga(l),j=Hr(q,"span");n.styleMap.set(B,j);let ee=document.createTextNode(z);t.replaceChild(ee,$),t.insertBefore(B,ee);continue}let u=l.content??"",d=u===""||u==="none"||u==="normal",{text:f,incs:m}=$d(e,c,a),p=l.backgroundImage,g=l.backgroundColor,h=l.fontFamily,y=parseInt(l.fontSize)||32,v=parseInt(l.fontWeight)||!1,b=l.color||"#000",w=l.borderStyle,S=parseFloat(l.borderWidth),I=l.transform,C=_e(h),E=!d&&f!=="",M=p&&p!=="none",O=g&&g!=="transparent"&&g!=="rgba(0, 0, 0, 0)",D=w&&w!=="none"&&S>0,T=I&&I!=="none";if(!(E||M||O||D||T)){if(m&&m.length&&e.parentElement){let L=ht.get(e.parentElement)||new Map;for(let{name:$}of m){if(!$)continue;let _=jr(e,a),F=Zr(e,Fe(e,c),_).get(e,$);L.set($,F)}ht.set(e.parentElement,L)}continue}let k=document.createElement("span");k.dataset.snapdomPseudo=c,k.style.pointerEvents="none";let W=ga(l),G=Hr(W,"span");if(n.styleMap.set(k,G),C&&f&&f.length===1){let{dataUrl:L,width:$,height:_}=await fd(f,h,v,y,b),F=document.createElement("img");F.src=L,F.style=`height:${y}px;width:${$/_*y}px;object-fit:contain;`,k.appendChild(F),t.dataset.snapdomHasIcon="true"}else if(f&&f.startsWith("url(")){let L=Jr(f);if(L?.trim())try{let $=await ve(Tn(L),{as:"dataURL",useProxy:r.useProxy});if($?.ok&&typeof $.data=="string"){let _=document.createElement("img");_.src=$.data,_.style=`width:${y}px;height:auto;object-fit:contain;`,k.appendChild(_)}}catch($){console.error(`[snapdom] Error in pseudo ${c} for`,e,$)}}else!C&&E&&(k.textContent=f);k.style.backgroundImage="none","maskImage"in k.style&&(k.style.maskImage="none"),"webkitMaskImage"in k.style&&(k.style.webkitMaskImage="none");try{k.style.backgroundRepeat=l.backgroundRepeat,k.style.backgroundSize=l.backgroundSize,l.backgroundPositionX&&l.backgroundPositionY?(k.style.backgroundPositionX=l.backgroundPositionX,k.style.backgroundPositionY=l.backgroundPositionY):k.style.backgroundPosition=l.backgroundPosition,k.style.backgroundOrigin=l.backgroundOrigin,k.style.backgroundClip=l.backgroundClip,k.style.backgroundAttachment=l.backgroundAttachment,k.style.backgroundBlendMode=l.backgroundBlendMode}catch{}if(M)try{let L=Ur(p),$=await Promise.all(L.map(Wa));k.style.backgroundImage=$.join(", ")}catch(L){console.warn(`[snapdom] Failed to inline background-image for ${c}`,L)}O&&(k.style.backgroundColor=g);let re=k.childNodes.length>0||k.textContent?.trim()!==""||M||O||D||T;if(m&&m.length&&e.parentElement){let L=ht.get(e.parentElement)||new Map,$=jr(e,a),_=Zr(e,Fe(e,c),$);for(let{name:F}of m){if(!F)continue;let z=_.get(e,F);L.set(F,z)}ht.set(e.parentElement,L)}if(!re)continue;c==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(k,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(k))}catch(l){console.warn(`[snapdom] Failed to capture ${c} for`,e,l)}let s=Array.from(t.children).filter(c=>!c.dataset.snapdomPseudo);if(n.nodeMap)for(let c of s){let l=n.nodeMap.get(c);l instanceof Element&&await Xr(l,c,n,r)}else{let c=Array.from(e.children);for(let l=0;l<Math.min(c.length,s.length);l++)await Xr(c[l],s[l],n,r)}}function Dd(e,t){if(!e||!(e instanceof Element))return;let n=e.ownerDocument||document,r=t||n,o=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(o.length===0)return;let i=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],s=w=>window.CSS&&CSS.escape?CSS.escape(w):w.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c="http://www.w3.org/1999/xlink",l=w=>{if(!w||!w.getAttribute)return null;let S=w.getAttribute("href")||w.getAttribute("xlink:href")||(typeof w.getAttributeNS=="function"?w.getAttributeNS(c,"href"):null);if(S)return S;let I=w.attributes;if(!I)return null;for(let C=0;C<I.length;C++){let E=I[C];if(!E||!E.name)continue;if(E.name==="href")return E.value;let M=E.name.indexOf(":");if(M!==-1&&E.name.slice(M+1)==="href")return E.value}return null},u=new Set(Array.from(e.querySelectorAll("[id]")).map(w=>w.id)),d=new Set,f=!1,m=(w,S=null)=>{if(!w)return;i.lastIndex=0;let I;for(;I=i.exec(w);){f=!0;let C=(I[1]||"").trim();C&&(u.has(C)||(d.add(C),S&&!S.has(C)&&S.add(C)))}},p=w=>{let S=w.querySelectorAll("use");for(let C of S){let E=l(C);if(!E||!E.startsWith("#"))continue;f=!0;let M=E.slice(1).trim();M&&!u.has(M)&&d.add(M)}let I=w.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let C of I){m(C.getAttribute("style")||"");for(let E of a)m(C.getAttribute(E))}};for(let w of o)p(w);if(!f)return;let g=e.querySelector("svg.inline-defs-container");g||(g=n.createElementNS("http://www.w3.org/2000/svg","svg"),g.classList.add("inline-defs-container"),g.setAttribute("aria-hidden","true"),g.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(g,e.firstChild||null));let h=g.querySelector("defs")||null,y=w=>{if(!w||u.has(w))return null;let S=s(w),I=C=>{let E=r.querySelector(C);return E&&!e.contains(E)?E:null};return I(`svg defs > *#${S}`)||I(`svg > symbol#${S}`)||I(`*#${S}`)};if(!d.size)return;let v=new Set(d),b=new Set;for(;v.size;){let w=v.values().next().value;if(v.delete(w),!w||u.has(w)||b.has(w))continue;let S=y(w);if(!S){b.add(w);continue}h||(h=n.createElementNS("http://www.w3.org/2000/svg","defs"),g.appendChild(h));let I=S.cloneNode(!0);I.id||I.setAttribute("id",w),h.appendChild(I),b.add(w),u.add(w);let C=[I,...I.querySelectorAll("*")];for(let E of C){let M=l(E);if(M&&M.startsWith("#")){let D=M.slice(1).trim();D&&!u.has(D)&&!b.has(D)&&v.add(D)}let O=E.getAttribute?.("style")||"";O&&m(O,v);for(let D of a){let T=E.getAttribute?.(D);T&&m(T,v)}}}}Ce();function Pd(e,t){if(!e||!t)return;let n=e.scrollTop||0;if(!n)return;getComputedStyle(t).position==="static"&&(t.style.position="relative");let r=e.getBoundingClientRect(),o=e.clientHeight,i="data-snap-ph",a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let s=a.currentNode,c=getComputedStyle(s),l=c.position;if(l!=="sticky"&&l!=="-webkit-sticky")continue;let u=Oa(c.top),d=Oa(c.bottom);if(u==null&&d==null)continue;let f=Wd(s,e),m=Bd(t,f,i);if(!m)continue;let p=s.getBoundingClientRect(),g=p.width,h=p.height,y=p.left-r.left;if(!(g>0&&h>0)||!Number.isFinite(y))continue;let v=u!=null?u+n:n+(o-h-d);if(!Number.isFinite(v))continue;let b=Number.parseInt(c.zIndex,10),w=Number.isFinite(b),S=w?Math.max(b,1)+1:2,I=w?b-1:0,C=m.cloneNode(!1);C.setAttribute(i,"1"),C.style.position="sticky",C.style.left=`${y}px`,C.style.top=`${v}px`,C.style.width=`${g}px`,C.style.height=`${h}px`,C.style.visibility="hidden",C.style.zIndex=String(I),C.style.overflow="hidden",C.style.background="transparent",C.style.boxShadow="none",C.style.filter="none",m.parentElement?.insertBefore(C,m),m.style.position="absolute",m.style.left=`${y}px`,m.style.top=`${v}px`,m.style.bottom="auto",m.style.zIndex=String(S),m.style.pointerEvents="none"}}function Oa(e){if(!e||e==="auto")return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function Wd(e,t){let n=[];for(let r=e;r&&r!==t;){let o=r.parentElement;if(!o)break;n.push(Array.prototype.indexOf.call(o.children,r)),r=o}return n.reverse()}function Bd(e,t,n){let r=e;for(let o=0;o<t.length;o++)if(r=Hd(r,n)[t[o]],!r)return null;return r instanceof HTMLElement?r:null}function Hd(e,t){let n=[],r=e.children;for(let o=0;o<r.length;o++){let i=r[o];i.hasAttribute(t)||n.push(i)}return n}function Ud(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,o=t.borderStyle,i=t.borderWidth,a=n!=="none"&&parseFloat(r)>0,s=o==="none"||parseFloat(i)===0;a&&s&&(e.style.border=`${r} solid transparent`)}function Vd(e){let t=[];try{let n=e.querySelectorAll("*");for(let r of n){if(!(r instanceof HTMLElement))continue;let o=r.style.contentVisibility||"",i=getComputedStyle(r),a=i.contentVisibility||i.getPropertyValue("content-visibility")||"";(a==="auto"||a==="hidden")&&(t.push({el:r,original:o}),r.style.contentVisibility="visible")}if(e instanceof HTMLElement){let r=getComputedStyle(e),o=r.contentVisibility||r.getPropertyValue("content-visibility")||"";(o==="auto"||o==="hidden")&&(t.push({el:e,original:e.style.contentVisibility||""}),e.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:n,original:r}of t)try{n.style.contentVisibility=r}catch{}}}async function Gd(e,t={}){let n={styleMap:A.session.styleMap,styleCache:A.session.styleCache,nodeMap:A.session.nodeMap,options:t},r,o="",i="";Ud(e);let a=Vd(e);try{Dd(e)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{r=await An(e,n,t)}catch(l){throw console.warn("deepClone failed:",l),l}finally{a()}try{await Xr(e,r,n,t)}catch(l){console.warn("inlinePseudoElements failed:",l)}await nd(r,n);try{let l=r.querySelectorAll("style[data-sd]");for(let u of l)i+=u.textContent||"",u.remove()}catch(l){K(n,"Failed to extract shadow CSS from style[data-sd]",l)}let s=lu(n.styleMap);o=Array.from(s.entries()).map(([l,u])=>`.${u}{${l}}`).join(""),o=i+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+o;for(let[l,u]of n.styleMap.entries()){if(l.tagName==="STYLE")continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",u.replace(/;/g,"; "));continue}let d=s.get(u);d&&l.classList.add(d);let f=l.style?.backgroundImage,m=l.dataset?.snapdomHasIcon;f&&f!=="none"&&(l.style.backgroundImage=f),m&&(l.style.verticalAlign="middle",l.style.display="inline")}for(let[l,u]of n.nodeMap.entries()){let d=u.scrollLeft,f=u.scrollTop;if((d||f)&&l instanceof HTMLElement){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";try{let p=l.querySelectorAll("*");for(let g of p){if(!(g instanceof HTMLElement))continue;let h=g.style.position;if(h==="fixed"||h==="absolute"){let y=parseFloat(g.style.top)||0,v=parseFloat(g.style.left)||0;g.style.top=`${y+f}px`,g.style.left=`${v+d}px`,h==="fixed"&&(g.style.position="absolute")}}}catch{}let m=document.createElement("div");for(m.style.transform=`translate(${-d}px, ${-f}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m)}}let c=r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r;if(Pd(e,c),e===n.nodeMap.get(r)){let l=n.styleCache.get(e)||Fe(e);n.styleCache.set(e,l);let u=Xc(l.transform);r.style.margin="0",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.animation="none",r.style.transition="none",r.style.willChange="auto",r.style.float="none",r.style.clear="none",r.style.transform=u||""}for(let[l,u]of n.nodeMap.entries())u.tagName==="PRE"&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:r,classCSS:o,styleCache:n.styleCache}}gt();var cs="http://www.w3.org/1999/xlink";function zd(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(cs,"href"):null)}function Yd(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,n=parseInt(e.dataset?.snapdomHeight||"",10)||0,r=parseInt(e.getAttribute("width")||"",10)||0,o=parseInt(e.getAttribute("height")||"",10)||0,i=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0,s=t||i||r||e.width||e.naturalWidth||100,c=n||a||o||e.height||e.naturalHeight||100;return{width:s,height:c}}async function qd(e,t={}){let n=Array.from(e.querySelectorAll("img")),r=async a=>{if(!a.getAttribute("src")){let f=a.currentSrc||a.src||"";f&&a.setAttribute("src",f)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let s=a.src||"";if(!s)return;let c=await ve(s,{as:"dataURL",useProxy:t.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){a.src=c.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:l,height:u}=Yd(a),{fallbackURL:d}=t||{};if(d)try{let f=typeof d=="function"?await d({width:l,height:u,src:s,element:a}):d;if(f){let m=await ve(f,{as:"dataURL",useProxy:t.useProxy});if(m?.ok&&typeof m.data=="string"){a.src=m.data,a.width||(a.width=l),a.height||(a.height=u);return}}}catch{}if(t.placeholders!==!1){let f=document.createElement("div");f.style.cssText=[`width:${l}px`,`height:${u}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${u}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),f.textContent="img",a.replaceWith(f)}else{let f=document.createElement("div");f.style.cssText=`display:inline-block;width:${l}px;height:${u}px;visibility:hidden;`,a.replaceWith(f)}};for(let a=0;a<n.length;a+=4){let s=n.slice(a,a+4).map(r);await Promise.allSettled(s)}let o=Array.from(e.querySelectorAll("image")),i=async a=>{let s=zd(a);if(!s||s.startsWith("data:")||s.startsWith("blob:"))return;let c=await ve(s,{as:"dataURL",useProxy:t.useProxy});c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")&&(a.setAttribute("href",c.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(cs,"href"))};for(let a=0;a<o.length;a+=4){let s=o.slice(a,a+4).map(i);await Promise.allSettled(s)}}Ee();async function jd(e,t,n,r={}){let o=[[e,t]],i=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],a=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],s=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],c=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;o.length;){let[l,u]=o.shift();if(!u)continue;let d=n.get(l)||Fe(l);n.has(l)||n.set(l,d);let f=(()=>{let g=d.getPropertyValue("border-image"),h=d.getPropertyValue("border-image-source");return g&&g!=="none"||h&&h!=="none"})();for(let g of s){let h=d.getPropertyValue(g);h&&u.style.setProperty(g,h)}for(let g of i){let h=d.getPropertyValue(g);if(g==="background-image"&&(!h||h==="none")){let b=d.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(h=Ur(b).filter(w=>/url\s*\(/.test(w)).join(", ")||h)}if(!h||h==="none")continue;let y=Ur(h),v=await Promise.all(y.map(b=>Wa(b,r)));v.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&u.style.setProperty(g,v.join(", "))}for(let g of a){let h=d.getPropertyValue(g);!h||h==="initial"||u.style.setProperty(g,h)}if(f)for(let g of c){let h=d.getPropertyValue(g);!h||h==="initial"||u.style.setProperty(g,h)}let m=l.shadowRoot?Array.from(l.shadowRoot.children).filter(g=>g.tagName!=="STYLE"):Array.from(l.children),p=Array.from(u.children).filter(g=>!(g.dataset?.snapdomPseudo||g.tagName==="STYLE"&&g.dataset?.sd));for(let g=0;g<Math.min(m.length,p.length);g++)o.push([m[g],p[g]])}}Ee();Ce();function Zd(e){if(!e)return()=>{};let t=[];function n(r){let o=Xd(r);o&&t.push(o);for(let i of r.children||[])n(i)}return n(e),()=>t.forEach(r=>r())}function Xd(e){if(!e)return()=>{};let t=Kd(e);if(t<=0)return()=>{};if(!ef(e))return()=>{};let n=getComputedStyle(e),r=Math.round(Jd(n)*t+Qd(n)),o=e.textContent??"",i=o;if(e.scrollHeight<=r+.5)return()=>{};let a=0,s=o.length,c=-1;for(;a<=s;){let l=a+s>>1;e.textContent=o.slice(0,l)+"\u2026",e.scrollHeight<=r+.5?(c=l,a=l+1):s=l-1}return e.textContent=(c>=0?o.slice(0,c):"")+"\u2026",()=>{e.textContent=i}}function Kd(e){let t=getComputedStyle(e),n=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function Jd(e){let t=(e.lineHeight||"").trim(),n=parseFloat(e.fontSize)||16;return!t||t==="normal"?Math.round(n*1.2):t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*n):t.endsWith("%")?Math.round(parseFloat(t)/100*n):Math.round(n*1.2)}function Qd(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function ef(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var _t=[];function us(e){if(!e)return null;if(Array.isArray(e)){let[t,n]=e;return typeof t=="function"?t(n):t}if(typeof e=="object"&&"plugin"in e){let{plugin:t,options:n}=e;return typeof t=="function"?t(n):t}return typeof e=="function"?e():e}function tf(...e){let t=e.flat();for(let n of t){let r=us(n);r&&(_t.some(o=>o&&o.name&&r.name&&o.name===r.name)||_t.push(r))}}function ds(e){return(e&&Array.isArray(e.plugins)?e.plugins:_t)||_t}async function Pe(e,t,n){let r=n,o=ds(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,r);typeof s<"u"&&(r=s)}return r}async function nf(e,t,n){let r=[],o=ds(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,n);typeof s<"u"&&r.push(s)}return r}function rf(e){let t=[];if(Array.isArray(e))for(let n of e){let r=us(n);if(!r||!r.name)continue;let o=t.findIndex(i=>i&&i.name===r.name);o>=0&&t.splice(o,1),t.push(r)}for(let n of _t)n&&n.name&&!t.some(r=>r.name===n.name)&&t.push(n);return Object.freeze(t)}function of(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=rf(t)),e}Ee();function af(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow="none"}catch(i){K(n,"stripRootShadows boxShadow",i)}try{t.style.textShadow="none"}catch(i){K(n,"stripRootShadows textShadow",i)}try{t.style.outline="none"}catch(i){K(n,"stripRootShadows outline",i)}let o=(r.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=o.length?o:"none"}catch(i){K(n,"stripRootShadows filter",i)}}function sf(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)n.push(t.currentNode);for(let r of n)r.remove()}function lf(e,t={}){let{stripFrameworkDirectives:n=!0}=t,r=new Set(["xml","xlink"]),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;o.nextNode();){let i=o.currentNode;for(let a of Array.from(i.attributes)){let s=a.name;if(s.includes("@")){i.removeAttribute(s);continue}if(s.includes(":")){let c=s.split(":",1)[0];if(!r.has(c)){i.removeAttribute(s);continue}}if(n&&(s.startsWith("x-")||s.startsWith("v-")||s.startsWith(":")||s.startsWith("on:")||s.startsWith("bind:")||s.startsWith("let:")||s.startsWith("class:"))){i.removeAttribute(s);continue}}}}function cf(e,t={}){e&&(lf(e,t),sf(e))}function uf(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function df(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function ff(e,t){if(!(e instanceof Element)||uf(e)||df(e))return!1;let n=t.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=t.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||t.transform&&t.transform!=="none")}function mf(e,t,n=new Map){function r(o,i){if(!(o instanceof Element)||!(i instanceof Element))return;let a=o.childElementCount>i.childElementCount,s=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,s),a&&ff(o,s)){i.style.height||(i.style.height="auto"),i.style.width||(i.style.width="auto"),i.style.removeProperty("block-size"),i.style.removeProperty("inline-size"),i.style.minHeight||(i.style.minHeight="0"),i.style.minWidth||(i.style.minWidth="0"),i.style.maxHeight||(i.style.maxHeight="none"),i.style.maxWidth||(i.style.maxWidth="none");let u=s.overflowY||s.overflowBlock||"visible",d=s.overflowX||s.overflowInline||"visible";(u!=="visible"||d!=="visible")&&(i.style.overflow="visible")}let c=Array.from(o.children),l=Array.from(i.children);for(let u=0;u<Math.min(c.length,l.length);u++)r(c[u],l[u])}r(e,t)}function pf(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function hf(e,t){if(!(e instanceof Element))return!1;if(e.getAttribute("data-capture")==="exclude"&&t?.excludeMode==="remove")return!0;if(Array.isArray(t?.exclude))for(let n of t.exclude)try{if(e.matches(n))return t.excludeMode==="remove"}catch(r){K(t,"exclude selector match failed",r)}return!1}function gf(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),o=1/0,i=-1/0,a=!1,s=Array.from(e.children);for(let m of s){if(hf(m,t)||!pf(m))continue;let p=m.getBoundingClientRect(),g=p.top-r.top,h=p.bottom-r.top;h<=g||(g<o&&(o=g),h>i&&(i=h),a=!0)}let c=a?Math.max(0,i-o):0,l=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,f=parseFloat(n.paddingBottom)||0;return l+u+d+f+c}var R=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,yf=/::-webkit-scrollbar(-[a-z]+)?\b/i;function Kr(e,t=new Set){let n="";if(!e)return n;for(let r=0;r<e.length;r++){let o=e[r];try{if(o.type===CSSRule.IMPORT_RULE&&o.styleSheet){n+=Kr(o.styleSheet.cssRules,t);continue}if(o.type===CSSRule.MEDIA_RULE&&o.cssRules){let i=Kr(o.cssRules,t);i&&(n+=`@media ${o.conditionText}{${i}}`);continue}if(o.type===CSSRule.STYLE_RULE){let i=o.selectorText||"";if(yf.test(i)){let a=o.cssText;a&&!t.has(a)&&(t.add(a),n+=a)}}}catch{}}return n}function bf(e){if(!e||!e.styleSheets)return"";let t=new Set,n="";for(let r of Array.from(e.styleSheets))try{let o=r.cssRules;o&&(n+=Kr(o,t))}catch{}return n}function wf(e){let t=e.boxShadow||"";if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let n=t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(s=>s.trim()),r=0,o=0,i=0,a=0;for(let s of n){let c=s.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(c.length<2)continue;let[l,u,d=0,f=0]=c,m=Math.abs(l)+d+f,p=Math.abs(u)+d+f;o=Math.max(o,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),i=Math.max(i,p+Math.max(u,0)),r=Math.max(r,p+Math.max(-u,0))}return{top:Math.ceil(r),right:Math.ceil(o),bottom:Math.ceil(i),left:Math.ceil(a)}}function vf(e){let t=(e.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=t?Math.ceil(parseFloat(t[1])||0):0;return{top:n,right:n,bottom:n,left:n}}function Cf(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0),n=parseFloat(e.outlineOffset||"0")||0,r=t+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function Sf(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||t==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,o=0,i=0,a=0,s=!1;for(let c of n){s=!0;let l=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(g=>parseFloat(g))||[],[u=0,d=0,f=0]=l,m=Math.abs(u)+f,p=Math.abs(d)+f;o=Math.max(o,m+Math.max(u,0)),a=Math.max(a,m+Math.max(-u,0)),i=Math.max(i,p+Math.max(d,0)),r=Math.max(r,p+Math.max(-d,0))}return{bleed:{top:R(r),right:R(o),bottom:R(i),left:R(a)},has:s}}function xf(e,t){if(!e||!t||!t.style)return null;let n=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none")try{let s=fs(e);if(s.a===1&&s.b===0&&s.c===0&&s.d===1)return t.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}function o(s,c,l,u){let d=Math.sqrt(s*s+c*c)||0,f=0,m=0;if(d>0){let p=s/d,g=c/d;f=p*l+g*u;let h=l-p*f,y=u-g*f;m=Math.sqrt(h*h+y*y)||0,m>0?f=f/m:f=0}return{a:d,b:0,c:f*m,d:m}}let i=r.match(/^matrix\(\s*([^)]+)\)$/i);if(i){let s=i[1].split(",").map(c=>parseFloat(c.trim()));if(s.length===6&&s.every(Number.isFinite)){let[c,l,u,d]=s,f=o(c,l,u,d);try{t.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let s=a[1].split(",").map(c=>parseFloat(c.trim()));if(s.length===16&&s.every(Number.isFinite)){let c=s[0],l=s[1],u=s[4],d=s[5],f=o(c,l,u,d);try{t.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}try{let s=new DOMMatrix(r),c=o(s.a,s.b,s.c,s.d);try{t.style.transform=`matrix(${c.a}, ${c.b}, ${c.c}, ${c.d}, 0, 0)`}catch{}return c}catch{return null}}function $a(e,t,n,r,o){let i=n.a,a=n.b,s=n.c,c=n.d,l=n.e||0,u=n.f||0;function d(y,v){let b=y-r,w=v-o,S=i*b+s*w,I=a*b+c*w;return S+=r+l,I+=o+u,[S,I]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],m=1/0,p=1/0,g=-1/0,h=-1/0;for(let[y,v]of f)y<m&&(m=y),v<p&&(p=v),y>g&&(g=y),v>h&&(h=v);return{minX:m,minY:p,maxX:g,maxY:h,width:g-m,height:h-p}}function If(e,t,n){let r=(e.transformOrigin||"0 0").trim().split(/\s+/),[o,i]=[r[0]||"0",r[1]||"0"],a=(s,c)=>{let l=s.toLowerCase();return l==="left"||l==="top"?0:l==="center"?c/2:l==="right"||l==="bottom"?c:l.endsWith("px")?parseFloat(l)||0:l.endsWith("%")?(parseFloat(l)||0)*c/100:/^-?\d+(\.\d+)?$/.test(l)&&parseFloat(l)||0};return{ox:a(o,t),oy:a(i,n)}}function Ef(e){let t={rotate:"0deg",scale:null,translate:null},n=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(n){let o=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},i=o("rotate");if(i)if(i.angle){let c=i.angle;t.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else i.unit?t.rotate=i.unit==="rad"?i.value*180/Math.PI+"deg":i.value+i.unit:t.rotate=String(i);else{let c=getComputedStyle(e);t.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let a=o("scale");if(a){let c="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,l="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:c;t.scale=`${c} ${l}`}else{let c=getComputedStyle(e);t.scale=c.scale&&c.scale!=="none"?c.scale:null}let s=o("translate");if(s){let c="x"in s&&"value"in s.x?s.x.value:Array.isArray(s)?s[0]?.value:0,l="y"in s&&"value"in s.y?s.y.value:Array.isArray(s)?s[1]?.value:0,u="x"in s&&s.x?.unit?s.x.unit:"px",d="y"in s&&s.y?.unit?s.y.unit:"px";t.translate=`${c}${u} ${l}${d}`}else{let c=getComputedStyle(e);t.translate=c.translate&&c.translate!=="none"?c.translate:null}return t}let r=getComputedStyle(e);return t.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",t.scale=r.scale&&r.scale!=="none"?r.scale:null,t.translate=r.translate&&r.translate!=="none"?r.translate:null,t}var Wr=null;function Af(){if(Wr)return Wr;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),Wr=e,e}function kf(e){let t=Af(),n=document.createElement("div");n.style.transformOrigin="0 0",e.baseTransform&&(n.style.transform=e.baseTransform),e.rotate&&(n.style.rotate=e.rotate),e.scale&&(n.style.scale=e.scale),e.translate&&(n.style.translate=e.translate),t.appendChild(n);let r=fs(n);return t.removeChild(n),r}function Mf(e){let t=getComputedStyle(e),n=t.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=t.rotate&&t.rotate!=="none"&&t.rotate!=="0deg",o=t.scale&&t.scale!=="none"&&t.scale!=="1",i=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(r||o||i)}function fs(e){let t=getComputedStyle(e).transform;if(!t||t==="none")return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}async function ms(e,t){if(!e)throw new Error("Element cannot be null or undefined");Zc(t.cache);let n=t.fast,r=t.outerTransforms!==!1,o=!!t.outerShadows,i={element:e,options:t,plugins:t.plugins},a,s,c,l="",u="",d,f,m=null;await Pe("beforeSnap",i),await Pe("beforeClone",i);let p=Zd(i.element);try{({clone:a,classCSS:s,styleCache:c}=await Gd(i.element,i.options)),!r&&a&&(m=xf(i.element,a)),!o&&a&&af(i.element,a,i.options)}finally{p()}if(i={clone:a,classCSS:s,styleCache:c,...i},await Pe("afterClone",i),cf(i.clone),i.options?.excludeMode==="remove")try{mf(i.element,i.clone,i.styleCache)}catch(b){console.warn("[snapdom] shrink pass failed:",b)}try{await dd(i.clone,i.element)}catch{}await new Promise(b=>{pt(async()=>{await qd(i.clone,i.options),b()},{fast:n})}),await new Promise(b=>{pt(async()=>{await jd(i.element,i.clone,i.styleCache,i.options),b()},{fast:n})}),t.embedFonts&&await new Promise(b=>{pt(async()=>{let w=as(i.element),S=Md(i.element);if(Je()){let I=new Set(Array.from(w).map(C=>String(C).split("__")[0]).filter(Boolean));await ss(I,1)}l=await kd({required:w,usedCodepoints:S,preCached:!1,exclude:i.options.excludeFonts,useProxy:i.options.useProxy,fontStylesheetDomains:i.options.fontStylesheetDomains}),b()},{fast:n})});let g=au(i.clone).sort(),h=g.join(",");A.baseStyle.has(h)?u=A.baseStyle.get(h):await new Promise(b=>{pt(()=>{u=su(g),A.baseStyle.set(h,u),b()},{fast:n})});let y=bf(i.element?.ownerDocument||document);i={fontsCSS:l,baseCSS:u,scrollbarCSS:y,...i},await Pe("beforeRender",i),await new Promise(b=>{pt(()=>{let w=Fe(i.element),S=i.element.getBoundingClientRect(),I=Math.max(1,R(i.element.offsetWidth||parseFloat(w.width)||S.width||1)),C=Math.max(1,R(i.element.offsetHeight||parseFloat(w.height)||S.height||1)),E=i.element.ownerDocument||document;if(i.element===E.body||i.element===E.documentElement){let ue=Math.max(i.element.scrollHeight||0,E.documentElement?.scrollHeight||0,E.body?.scrollHeight||0),de=Math.max(i.element.scrollWidth||0,E.documentElement?.scrollWidth||0,E.body?.scrollWidth||0);ue>0&&(C=Math.max(C,R(ue))),de>0&&(I=Math.max(I,R(de)));try{let ke=(i.scrollbarCSS||"").length+(i.baseCSS||"").length+(i.fontsCSS||"").length+(i.classCSS||"").length,Me=A.measureHints.get(i.element);if(Me&&Me.cssLen===ke&&Me.w0===I)Me.csh>0&&(C=Math.max(C,R(Me.csh))),Me.csw>0&&(I=Math.max(I,R(Me.csw)));else{let Te=E.createElement("div");Te.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+I+"px!important;overflow:visible!important;visibility:hidden!important;";let Wt=E.createElement("style");Wt.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS,Te.appendChild(Wt),Te.appendChild(i.clone.cloneNode(!0)),E.body.appendChild(Te);let Oe=Te.scrollHeight,Un=Te.scrollWidth;E.body.removeChild(Te),A.measureHints.set(i.element,{cssLen:ke,w0:I,csh:Oe,csw:Un}),Oe>0&&(C=Math.max(C,R(Oe))),Un>0&&(I=Math.max(I,R(Un)))}}catch{}}if(i.options?.excludeMode==="remove"){let ue=gf(i.element,i.options);Number.isFinite(ue)&&ue>0&&(C=Math.max(1,Math.min(C,R(ue+1))))}let M=(ue,de=NaN)=>{let ke=typeof ue=="string"?parseFloat(ue):ue;return Number.isFinite(ke)?ke:de},O=M(i.options.width),D=M(i.options.height),T=I,k=C,W=Number.isFinite(O),G=Number.isFinite(D),re=C>0?I/C:1;W&&G?(T=Math.max(1,R(O)),k=Math.max(1,R(D))):W?(T=Math.max(1,R(O)),k=Math.max(1,R(T/(re||1)))):G?(k=Math.max(1,R(D)),T=Math.max(1,R(k*(re||1)))):(T=I,k=C);let L=0,$=0,_=I,F=C;if(!r&&m&&Number.isFinite(m.a)){let ue={a:m.a,b:m.b||0,c:m.c||0,d:m.d||1,e:0,f:0},de=$a(I,C,ue,0,0);L=R(de.minX),$=R(de.minY),_=R(de.maxX),F=R(de.maxY)}else if(r&&Da(i.element)){let ue=w.transform&&w.transform!=="none"?w.transform:"",de=Ef(i.element),ke=kf({baseTransform:ue,rotate:de.rotate||"0deg",scale:de.scale,translate:de.translate}),{ox:Me,oy:Te}=If(w,I,C),Wt=ke.is2D?ke:new DOMMatrix(ke.toString()),Oe=$a(I,C,Wt,Me,Te);L=R(Oe.minX),$=R(Oe.minY),_=R(Oe.maxX),F=R(Oe.maxY)}let z=wf(w),B=vf(w),q=Cf(w),j=Sf(w),ee=o?{top:R(z.top+B.top+q.top+j.bleed.top),right:R(z.right+B.right+q.right+j.bleed.right),bottom:R(z.bottom+B.bottom+q.bottom+j.bleed.bottom),left:R(z.left+B.left+q.left+j.bleed.left)}:{top:0,right:0,bottom:0,left:0};L=R(L-ee.left),$=R($-ee.top),_=R(_+ee.right),F=R(F+ee.bottom);let N=Math.max(1,R(_-L)),J=Math.max(1,R(F-$)),Z=W||G?R(T/I):1,U=G||W?R(k/C):1,ie=Math.max(1,R(N*Z)),V=Math.max(1,R(J*U)),se="http://www.w3.org/2000/svg",We=Je()&&Da(i.element)?1:0,Q=R(We+(r?0:1)),me=document.createElementNS(se,"foreignObject"),qs=R(L),js=R($);me.setAttribute("x",String(R(-(qs-Q)))),me.setAttribute("y",String(R(-(js-Q)))),me.setAttribute("width",String(R(I+Q*2))),me.setAttribute("height",String(R(C+Q*2))),me.style.overflow="visible";let ho=document.createElement("style"),Zs='svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject *{min-width:0;} foreignObject pre,foreignObject [style*="white-space"]{white-space:inherit;}';ho.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+Zs+i.classCSS,me.appendChild(ho);let Pt=document.createElement("div");Pt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Pt.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${R(I)}px;height:${R(C)}px`,Pt.appendChild(i.clone),me.appendChild(Pt);let Xs=new XMLSerializer().serializeToString(me),Bn=R(N+Q*2),Hn=R(J+Q*2),go=W||G;t.meta={w0:I,h0:C,vbW:Bn,vbH:Hn,targetW:T,targetH:k};let Ks=Je()&&go?Bn:R(ie+Q*2),Js=Je()&&go?Hn:R(V+Q*2),Qs=parseFloat(Fe(E.documentElement)?.fontSize)||16;f=`<svg xmlns="${se}" width="${Ks}" height="${Js}" viewBox="0 0 ${Bn} ${Hn}" font-size="${Qs}px">`+Xs+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,i={svgString:f,dataURL:d,...i},b()},{fast:n})}),await Pe("afterRender",i);let v=document.getElementById("snapdom-sandbox");return v&&v.style.position==="absolute"&&v.remove(),i.dataURL}function Da(e){return Mf(e)}Ce();function Tf(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let n=jc(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:e.placeholders!==!1,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:n,useProxy:typeof e.useProxy=="string"?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,safariWarmupAttempts:Math.min(3,Math.max(1,(e.safariWarmupAttempts??3)|0)),excludeStyleProps:e.excludeStyleProps??null}}Ot();za();Ee();gt();Ce();function Lf(...e){return tf(...e),Y}var Y=Object.assign(Rf,{plugins:Lf}),ps=Symbol("snapdom.internal"),Nf=Symbol("snapdom.internal.silent"),Pa=!1;async function Rf(e,t){if(!e)throw new Error("Element cannot be null or undefined");let n=Tf(t);if(of(n,t&&t.plugins),Je()&&(n.embedFonts===!0||Ff(e))){if(n.embedFonts)try{let o=as(e),i=new Set([...o].map(a=>String(a).split("__")[0]).filter(Boolean));await ss(i,1)}catch{}let r=n.safariWarmupAttempts??3;for(let o=0;o<r;o++)try{await _f(e,t)}catch{}}return n.iconFonts&&n.iconFonts.length>0&&od(n.iconFonts),n.snap||(n.snap={toPng:(r,o)=>Y.toPng(r,o),toSvg:(r,o)=>Y.toSvg(r,o)}),Y.capture(e,n,ps)}Y.capture=async(e,t,n)=>{if(n!==ps)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await ms(e,t),o={img:async(g,h)=>{let{toImg:y}=await Promise.resolve().then(()=>(ba(),Vr));return y(r,{...g,...h||{}})},svg:async(g,h)=>{let{toSvg:y}=await Promise.resolve().then(()=>(ba(),Vr));return y(r,{...g,...h||{}})},canvas:async(g,h)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(_n(),Ya));return y(r,{...g,...h||{}})},blob:async(g,h)=>{let{toBlob:y}=await Promise.resolve().then(()=>(Ka(),Za));return y(r,{...g,...h||{}})},png:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(En(),In));return y(r,{...g,...h||{},format:"png"})},jpeg:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(En(),In));return y(r,{...g,...h||{},format:"jpeg"})},webp:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(En(),In));return y(r,{...g,...h||{},format:"webp"})},download:async(g,h)=>{let{download:y}=await Promise.resolve().then(()=>(Su(),Ja));return y(r,{...g,...h||{}})}},i={};for(let g of["img","svg","canvas","blob","png","jpeg","webp"])i[g]=async h=>o[g](t,{...h||{},[Nf]:!0});i.jpg=i.jpeg;let a={...t,export:{url:r},exports:i},s=await nf("defineExports",a),c=Object.assign({},...s.filter(g=>g&&typeof g=="object")),l={...o,...c};l.jpeg&&!l.jpg&&(l.jpg=(g,h)=>l.jpeg(g,h));function u(g,h){let y={...t,...h||{}};return(g==="jpeg"||g==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,f=Promise.resolve();async function m(g,h){let y=async()=>{let v=l[g];if(!v)throw new Error(`[snapdom] Unknown export type: ${g}`);let b=u(g,h),w={...t,export:{type:g,options:b,url:r}};await Pe("beforeExport",w);let S=await v(w,b);return await Pe("afterExport",w,S),d||(d=!0,await Pe("afterSnap",t)),S};return f=f.then(y)}let p={url:r,toRaw:()=>r,to:(g,h)=>m(g,h),toImg:g=>m("img",g),toSvg:g=>m("svg",g),toCanvas:g=>m("canvas",g),toBlob:g=>m("blob",g),toPng:g=>m("png",g),toJpg:g=>m("jpg",g),toWebp:g=>m("webp",g),download:g=>m("download",g)};for(let g of Object.keys(l)){let h="to"+g.charAt(0).toUpperCase()+g.slice(1);p[h]||(p[h]=y=>m(g,y))}return p};Y.toRaw=(e,t)=>Y(e,t).then(n=>n.toRaw());Y.toImg=(e,t)=>Y(e,t).then(n=>n.toImg());Y.toSvg=(e,t)=>Y(e,t).then(n=>n.toSvg());Y.toCanvas=(e,t)=>Y(e,t).then(n=>n.toCanvas());Y.toBlob=(e,t)=>Y(e,t).then(n=>n.toBlob());Y.toPng=(e,t)=>Y(e,{...t,format:"png"}).then(n=>n.toPng());Y.toJpg=(e,t)=>Y(e,{...t,format:"jpeg"}).then(n=>n.toJpg());Y.toWebp=(e,t)=>Y(e,{...t,format:"webp"}).then(n=>n.toWebp());Y.download=(e,t)=>Y(e,t).then(n=>n.download());async function _f(e,t){if(Pa)return;let n={...t,fast:!0,embedFonts:!0,scale:.2},r;try{r=await ms(e,n)}catch(o){K(t,"safariWarmup pre-capture failed",o)}await new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o))),r&&await new Promise(o=>{let i=new Image;try{i.decoding="sync",i.loading="eager"}catch(a){K(t,"safariWarmup img hints failed",a)}i.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",i.src=r,document.body.appendChild(i),(async()=>{try{typeof i.decode=="function"&&await i.decode()}catch(s){K(t,"safariWarmup img.decode failed",s)}let a=performance.now();for(;!(i.complete&&i.naturalWidth>0)&&performance.now()-a<900;)await new Promise(s=>setTimeout(s,200));await new Promise(s=>requestAnimationFrame(s));try{let s=document.createElement("canvas");s.width=Math.max(1,i.naturalWidth||10),s.height=Math.max(1,i.naturalHeight||10);let c=s.getContext("2d");c&&c.drawImage(i,0,0)}catch{}await new Promise(s=>requestAnimationFrame(s));try{i.remove()}catch(s){K(t,"safariWarmup img.remove failed",s)}o()})()}),e.querySelectorAll("canvas").forEach(o=>{try{let i=o.getContext("2d",{willReadFrequently:!0});i&&i.getImageData(0,0,1,1)}catch(i){K(t,"safariWarmup canvas poke failed",i)}}),Pa=!0}function Ff(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();){let n=t.currentNode,r=getComputedStyle(n),o=r.backgroundImage&&r.backgroundImage!=="none",i=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(o||i||n.tagName==="CANVAS")return!0}return!1}function hs(e){if(e.dataset.fontProxied||!e.rel||!e.rel.includes("stylesheet"))return!1;let t=e.href||"";try{return new URL(t).origin!==window.location.origin}catch{return!1}}function gs(e){let t=`/__mindstudio_dev__/font-proxy?url=${encodeURIComponent(e.href)}`,n=document.createElement("link");n.rel="stylesheet",n.href=t,n.dataset.fontProxied="true",e.media&&(n.media=e.media),n.onload=()=>{e.remove()},n.onerror=()=>{n.remove()},e.parentNode?.insertBefore(n,e.nextSibling)}function ys(){let e=document.querySelectorAll('link[rel~="stylesheet"]');for(let t of e)hs(t)&&gs(t)}function Of(){let e=x().fonts;e.observer||(e.observer=new MutationObserver(t=>{for(let n of t)for(let r of n.addedNodes)r instanceof HTMLLinkElement&&hs(r)&&gs(r)}),e.observer.observe(document.documentElement,{childList:!0,subtree:!0}))}function $f(e){try{let t=new URL(e,window.location.origin);return t.origin===window.location.origin?!1:!!(/\.(css|woff2?|ttf|otf|eot)(\?|$)/i.test(t.pathname)||t.pathname.includes("/css"))}catch{return!1}}function Df(){if(window.fetch.__ms_font_proxied)return;let e=window.fetch;window.fetch=function(t,n){let r=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if($f(r)){let o=`/__mindstudio_dev__/font-proxy?url=${encodeURIComponent(r)}`;return e.apply(this,[o,n])}return e.apply(this,[t,n])},window.fetch.__ms_font_proxied=!0}function bs(){let e=x().fonts;e.initialized||(e.initialized=!0,Df(),ys(),Of())}async function ws(){ys();try{await document.fonts.ready}catch{}}var Pf=750,Wf=400,Ae=2,Cs={name:"text-fit",afterClone(e){if(!e.clone)return;let t=e.clone.ownerDocument;if(!t)return;let n=t.createElement("style");n.textContent="* { letter-spacing: -0.03px !important; }",e.clone.prepend(n)}},Ss=["#__mindstudio-cursor","#__mindstudio-cursor-ripple","#__mindstudio-notes-host","#__mindstudio-camera","#__mindstudio-flash","#__mindstudio-touch-circle"],Bf="#DD2590",Hf=`<svg width="44" height="44" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
202
202
  <g filter="url(#filter0_d_2_302)">
203
203
  <path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 21C4.57 21 3 19.43 3 17.5V10.5C3 8.57 4.57 7 6.5 7H7.5C7.966 7 8.387 6.49 8.605 6.053C9.239 4.786 10.028 4 12 4H16C17.972 4 18.761 4.786 19.395 6.053C19.613 6.49 20.034 7 20.5 7H21.5C23.43 7 25 8.57 25 10.5V17.5C25 19.43 23.43 21 21.5 21H6.5Z" fill="white"/>
204
204
  <path fill-rule="evenodd" clip-rule="evenodd" d="M14 18C11.238 18 9 15.762 9 13C9 10.238 11.238 8 14 8C16.762 8 19 10.238 19 13C19 15.762 16.762 18 14 18ZM21.5 8H20.5C19.5 8 18.816 7.132 18.5 6.5C18 5.5 17.5 5 16 5H14H12C10.5 5 10 5.5 9.5 6.5C9.184 7.132 8.5 8 7.5 8H6.5C5.119 8 4 9.119 4 10.5V17.5C4 18.881 5.119 20 6.5 20H21.5C22.881 20 24 18.881 24 17.5V10.5C24 9.119 22.881 8 21.5 8Z" fill="black"/>
@@ -215,13 +215,13 @@ ${g}
215
215
  <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2_302" result="shape"/>
216
216
  </filter>
217
217
  </defs>
218
- </svg>`,Qr="__mindstudio-camera",eo="__mindstudio-flash";function $f(){document.getElementById(Qr)?.remove(),document.getElementById(eo)?.remove();let e=x().screenshot,t=document.createElement("div");t.id=Qr,t.innerHTML=`
219
- ${Of}
218
+ </svg>`,ro="__mindstudio-camera",oo="__mindstudio-flash";function Uf(){document.getElementById(ro)?.remove(),document.getElementById(oo)?.remove();let e=x().screenshot,t=document.createElement("div");t.id=ro,t.innerHTML=`
219
+ ${Hf}
220
220
  <div style="
221
221
  position: absolute;
222
222
  left: 48px;
223
223
  top: 12px;
224
- background: ${Ff};
224
+ background: ${Bf};
225
225
  color: white;
226
226
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
227
227
  font-size: 11px;
@@ -232,13 +232,13 @@ ${g}
232
232
  white-space: nowrap;
233
233
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
234
234
  ">Remy</div>
235
- `,t.style.cssText=["position: fixed","z-index: 2147483647","pointer-events: none","opacity: 0","transition: opacity 300ms ease, left 600ms cubic-bezier(0.4, 0, 0, 1), top 600ms cubic-bezier(0.4, 0, 0, 1)","will-change: left, top, opacity"].join("; ");let n=document.createElement("div");n.id=eo,n.style.cssText=["position: fixed","top: 0","left: 0","width: 100vw","height: 100vh","background: white","opacity: 0","z-index: 2147483646","pointer-events: none","transition: opacity 600ms ease-out"].join("; "),document.documentElement.appendChild(n),document.documentElement.appendChild(t),e.cameraEl=t,e.flashEl=n}function Df(e,t){let{cameraEl:n}=x().screenshot;n&&(n.style.left=`${e}px`,n.style.top=`${t}px`,n.style.opacity="1")}function hs(e,t){let{cameraEl:n}=x().screenshot;n&&(n.style.left=`${e}px`,n.style.top=`${t}px`)}async function Pf(){let{flashEl:e}=x().screenshot;e&&(e.style.transition="none",e.style.opacity="0.7",e.offsetWidth,e.style.transition="opacity 600ms ease-out",e.style.opacity="0",await le(600))}function Wf(){let{cameraEl:e}=x().screenshot;e&&(e.style.opacity="0")}function Bf(){let e=x().screenshot;document.getElementById(Qr)?.remove(),document.getElementById(eo)?.remove(),e.cameraEl=null,e.flashEl=null}function Hf(e,t,n){return new Promise(r=>{let o=e.scrollTop,i=t-o;if(Math.abs(i)<1){r();return}let a=Math.abs(i),c=Math.max(n,a/2),l=performance.now();function u(d){let f=d-l,m=Math.min(f/c,1),p=m<.5?4*m*m*m:1-Math.pow(-2*m+2,3)/2;e.scrollTop=o+i*p,m<1?requestAnimationFrame(u):r()}requestAnimationFrame(u)})}async function bs(e){let t=x().screenshot;if(t.capturing)throw new Error("Screenshot already in progress");t.capturing=!0,ti();try{return await Uf(e)}finally{t.capturing=!1,ni()}}async function Uf(e){await ps();let t=window.innerWidth,n=window.innerHeight;if(e?.viewportOnly)return await Vf(t,n);let r=document.getElementById("__mindstudio-notes-host");r&&r.remove();let o=et(),i=o!==document.documentElement,a=o.scrollTop,s=o.style.scrollBehavior;o.style.scrollBehavior="auto",$f();try{let c=Math.random()<.5?t+30:-60,l=n*.3+Math.random()*n*.4;Df(c,l),await le(200);let u=t*.4+Math.random()*t*.15,d=n*.35+Math.random()*n*.15;hs(u,d),await le(700);let f=[],m=0,p=i?o.clientHeight:n,g=()=>i?o.scrollHeight:Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),h=50,y=g();for(;m<y&&f.length<h;){let k=f.length,O=g();if(O<=0){console.warn("[screenshot] skipping chunk \u2014 page height is 0");break}if(O-m<p*.05&&f.length>0)break;let T=O-p,M=Math.min(m,T);Math.abs(M-o.scrollTop)>1&&(await Hf(o,M,_f),hs(u,d),await le(Rf)),Pf();let G=o.scrollTop,re=Math.min(p,O-G);if(re<=0){console.warn("[screenshot] skipping chunk \u2014 captureHeight is 0 (page may have shrunk)"),m+=p;continue}let L=i?o.getBoundingClientRect():null;try{let _=await(await q(document.body,{embedFonts:!0,exclude:ys,plugins:[gs]})).toCanvas({width:t+1});if(_&&L){let F=_.width/t,z=_.width;if(k===0&&L.top>0){let J=Math.round(L.top*F),Z=document.createElement("canvas");Z.width=z,Z.height=J;let U=Z.getContext("2d");U&&(U.drawImage(_,0,0,z,J,0,0,z,J),f.push({y:0,canvas:Z}))}let B=Math.round(L.top*F),Y=Math.round(re*F),j=document.createElement("canvas");j.width=z,j.height=Y;let ee=j.getContext("2d");ee&&(ee.drawImage(_,0,B,z,Y,0,0,z,Y),f.push({y:L.top+G,canvas:j}));let N=L.bottom;if(m+p>=y&&N<n){let J=Math.round(N*F),Z=_.height-J;if(Z>0){let U=document.createElement("canvas");U.width=z,U.height=Z;let ie=U.getContext("2d");ie&&(ie.drawImage(_,0,J,z,Z,0,0,z,Z),f.push({y:L.top+O,canvas:U}))}}}else if(_){let F=_.width/t,z=Math.round(G*F),B=Math.min(G+re,O),Y=Math.round(B*F)-z,j=_.width,ee=document.createElement("canvas");ee.width=j,ee.height=Y;let N=ee.getContext("2d");N&&(N.drawImage(_,0,z,j,Y,0,0,j,Y),f.push({y:G,canvas:ee}))}}catch($){console.error("[screenshot] snapdom capture failed for chunk",k,$)}m+=p}if(m<y&&console.warn(`[screenshot] page truncated \u2014 captured ${f.length} chunks but page is ${y}px tall`),f.length===0)throw new Error("Screenshot capture produced no image data");let v=f[0].canvas.width,b=0;for(let k of f){if(k.canvas.width!==v){let O=v/k.canvas.width,D=Math.round(k.canvas.height*O),T=document.createElement("canvas");T.width=v,T.height=D;let M=T.getContext("2d");M&&(M.drawImage(k.canvas,0,0,v,D),k.canvas=T)}b+=k.canvas.height}let w=document.createElement("canvas");w.width=v,w.height=b;let S=w.getContext("2d");if(!S)throw new Error("Failed to create output canvas");let I=0;for(let k of f)S.drawImage(k.canvas,0,I),I+=k.canvas.height;let E=w.toDataURL("image/jpeg",1).replace(/^data:image\/jpeg;base64,/,"");if(!E)throw new Error("Canvas export produced no image data");return{image:E,width:w.width,height:w.height}}finally{Wf(),Bf(),r&&document.body.appendChild(r),o.style.scrollBehavior="auto",o.scrollTop=a,o.style.scrollBehavior=s}}async function Vf(e,t){let n=document.getElementById("__mindstudio-notes-host");n&&n.remove();let o=await(await q(document.body,{embedFonts:!0,exclude:ys,plugins:[gs]})).toCanvas({width:(e+1)*Ae});if(!o)throw new Error("SnapDOM viewport capture returned empty result");let i=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),a=document.createElement("canvas");a.width=e*Ae,a.height=t*Ae;let s=a.getContext("2d");if(!s)throw new Error("Failed to create canvas context");let c=window.scrollY/i*o.height,l=t/i*o.height;s.drawImage(o,0,c,o.width,l,0,0,e*Ae,t*Ae),n&&(document.body.appendChild(n),await Gf(n,s,e,t));let d=a.toDataURL("image/jpeg",1).replace(/^data:image\/jpeg;base64,/,"");if(!d)throw new Error("Canvas export produced no image data");return{image:d,width:(e+1)*Ae,height:t*Ae}}async function Gf(e,t,n,r){let o=e.shadowRoot?.querySelector(".overlay");if(!o)return;let i=e.shadowRoot?.querySelector(".cursor");i&&(i.style.display="none");let a=o.style.cssText;try{o.style.cssText=`
235
+ `,t.style.cssText=["position: fixed","z-index: 2147483647","pointer-events: none","opacity: 0","transition: opacity 300ms ease, left 600ms cubic-bezier(0.4, 0, 0, 1), top 600ms cubic-bezier(0.4, 0, 0, 1)","will-change: left, top, opacity"].join("; ");let n=document.createElement("div");n.id=oo,n.style.cssText=["position: fixed","top: 0","left: 0","width: 100vw","height: 100vh","background: white","opacity: 0","z-index: 2147483646","pointer-events: none","transition: opacity 600ms ease-out"].join("; "),document.documentElement.appendChild(n),document.documentElement.appendChild(t),e.cameraEl=t,e.flashEl=n}function Vf(e,t){let{cameraEl:n}=x().screenshot;n&&(n.style.left=`${e}px`,n.style.top=`${t}px`,n.style.opacity="1")}function vs(e,t){let{cameraEl:n}=x().screenshot;n&&(n.style.left=`${e}px`,n.style.top=`${t}px`)}async function Gf(){let{flashEl:e}=x().screenshot;e&&(e.style.transition="none",e.style.opacity="0.7",e.offsetWidth,e.style.transition="opacity 600ms ease-out",e.style.opacity="0",await le(600))}function zf(){let{cameraEl:e}=x().screenshot;e&&(e.style.opacity="0")}function Yf(){let e=x().screenshot;document.getElementById(ro)?.remove(),document.getElementById(oo)?.remove(),e.cameraEl=null,e.flashEl=null}function qf(e,t,n){return new Promise(r=>{let o=e.scrollTop,i=t-o;if(Math.abs(i)<1){r();return}let a=Math.abs(i),c=Math.max(n,a/2),l=performance.now();function u(d){let f=d-l,m=Math.min(f/c,1),p=m<.5?4*m*m*m:1-Math.pow(-2*m+2,3)/2;e.scrollTop=o+i*p,m<1?requestAnimationFrame(u):r()}requestAnimationFrame(u)})}async function xs(e){let t=x().screenshot;if(t.capturing)throw new Error("Screenshot already in progress");t.capturing=!0,ai();try{return await jf(e)}finally{t.capturing=!1,si()}}async function jf(e){await ws();let t=window.innerWidth,n=window.innerHeight;if(e?.viewportOnly)return await Zf(t,n);let r=document.getElementById("__mindstudio-notes-host");r&&r.remove();let o=tt(),i=o!==document.documentElement,a=o.scrollTop,s=o.style.scrollBehavior;o.style.scrollBehavior="auto",Uf();try{let c=Math.random()<.5?t+30:-60,l=n*.3+Math.random()*n*.4;Vf(c,l),await le(200);let u=t*.4+Math.random()*t*.15,d=n*.35+Math.random()*n*.15;vs(u,d),await le(700);let f=[],m=0,p=i?o.clientHeight:n,g=()=>i?o.scrollHeight:Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),h=50,y=g();for(;m<y&&f.length<h;){let M=f.length,O=g();if(O<=0){console.warn("[screenshot] skipping chunk \u2014 page height is 0");break}if(O-m<p*.05&&f.length>0)break;let T=O-p,k=Math.min(m,T);Math.abs(k-o.scrollTop)>1&&(await qf(o,k,Wf),vs(u,d),await le(Pf)),Gf();let G=o.scrollTop,re=Math.min(p,O-G);if(re<=0){console.warn("[screenshot] skipping chunk \u2014 captureHeight is 0 (page may have shrunk)"),m+=p;continue}let L=i?o.getBoundingClientRect():null;try{let _=await(await Y(document.body,{embedFonts:!0,exclude:Ss,plugins:[Cs]})).toCanvas({width:t+1});if(_&&L){let F=_.width/t,z=_.width;if(M===0&&L.top>0){let J=Math.round(L.top*F),Z=document.createElement("canvas");Z.width=z,Z.height=J;let U=Z.getContext("2d");U&&(U.drawImage(_,0,0,z,J,0,0,z,J),f.push({y:0,canvas:Z}))}let B=Math.round(L.top*F),q=Math.round(re*F),j=document.createElement("canvas");j.width=z,j.height=q;let ee=j.getContext("2d");ee&&(ee.drawImage(_,0,B,z,q,0,0,z,q),f.push({y:L.top+G,canvas:j}));let N=L.bottom;if(m+p>=y&&N<n){let J=Math.round(N*F),Z=_.height-J;if(Z>0){let U=document.createElement("canvas");U.width=z,U.height=Z;let ie=U.getContext("2d");ie&&(ie.drawImage(_,0,J,z,Z,0,0,z,Z),f.push({y:L.top+O,canvas:U}))}}}else if(_){let F=_.width/t,z=Math.round(G*F),B=Math.min(G+re,O),q=Math.round(B*F)-z,j=_.width,ee=document.createElement("canvas");ee.width=j,ee.height=q;let N=ee.getContext("2d");N&&(N.drawImage(_,0,z,j,q,0,0,j,q),f.push({y:G,canvas:ee}))}}catch($){console.error("[screenshot] snapdom capture failed for chunk",M,$)}m+=p}if(m<y&&console.warn(`[screenshot] page truncated \u2014 captured ${f.length} chunks but page is ${y}px tall`),f.length===0)throw new Error("Screenshot capture produced no image data");let v=f[0].canvas.width,b=0;for(let M of f){if(M.canvas.width!==v){let O=v/M.canvas.width,D=Math.round(M.canvas.height*O),T=document.createElement("canvas");T.width=v,T.height=D;let k=T.getContext("2d");k&&(k.drawImage(M.canvas,0,0,v,D),M.canvas=T)}b+=M.canvas.height}let w=document.createElement("canvas");w.width=v,w.height=b;let S=w.getContext("2d");if(!S)throw new Error("Failed to create output canvas");let I=0;for(let M of f)S.drawImage(M.canvas,0,I),I+=M.canvas.height;let E=w.toDataURL("image/jpeg",1).replace(/^data:image\/jpeg;base64,/,"");if(!E)throw new Error("Canvas export produced no image data");return{image:E,width:w.width,height:w.height}}finally{zf(),Yf(),r&&document.body.appendChild(r),o.style.scrollBehavior="auto",o.scrollTop=a,o.style.scrollBehavior=s}}async function Zf(e,t){let n=document.getElementById("__mindstudio-notes-host");n&&n.remove();let o=await(await Y(document.body,{embedFonts:!0,exclude:Ss,plugins:[Cs]})).toCanvas({width:(e+1)*Ae});if(!o)throw new Error("SnapDOM viewport capture returned empty result");let i=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),a=document.createElement("canvas");a.width=e*Ae,a.height=t*Ae;let s=a.getContext("2d");if(!s)throw new Error("Failed to create canvas context");let c=window.scrollY/i*o.height,l=t/i*o.height;s.drawImage(o,0,c,o.width,l,0,0,e*Ae,t*Ae),n&&(document.body.appendChild(n),await Xf(n,s,e,t));let d=a.toDataURL("image/jpeg",1).replace(/^data:image\/jpeg;base64,/,"");if(!d)throw new Error("Canvas export produced no image data");return{image:d,width:(e+1)*Ae,height:t*Ae}}async function Xf(e,t,n,r){let o=e.shadowRoot?.querySelector(".overlay");if(!o)return;let i=e.shadowRoot?.querySelector(".cursor");i&&(i.style.display="none");let a=o.style.cssText;try{o.style.cssText=`
236
236
  position: absolute;
237
237
  inset: 0;
238
238
  width: ${n}px;
239
239
  height: ${r}px;
240
240
  overflow: visible;
241
- `,document.body.appendChild(o);let c=await(await q(o,{embedFonts:!0})).toCanvas({width:n*Ae});c&&t.drawImage(c,0,0,n*Ae,r*Ae)}finally{o.style.cssText=a,e.shadowRoot?.insertBefore(o,i),i&&(i.style.display="")}}function Nn(){let e=x().notesMode;e.active||(e.active=!0,x().touch.active&&(Vt(),e.wasTouchActive=!0),ta())}function Ot(){let e=x().notesMode;e.active&&(e.active=!1,na(),e.wasTouchActive&&(e.wasTouchActive=!1,yt()))}async function Rn(){let{image:e}=await bs({viewportOnly:!0});return e}var $t="mindstudio-browser-agent";function ws(){let e=x(),t=new URLSearchParams(window.location.search);e.zoom.pipMode=t.get("display-mode")==="pip",e.zoom.mobilePreview=t.get("preview")==="mobile"||window.innerWidth<768;try{let n=sessionStorage.getItem("__ms_pip");n==="1"?e.zoom.pipMode=!0:n==="0"&&(e.zoom.pipMode=!1);let r=sessionStorage.getItem("__ms_mobile");r==="1"?e.zoom.mobilePreview=!0:r==="0"&&(e.zoom.mobilePreview=!1)}catch{}e.messages.handler||(e.messages.handler=async n=>{if(n.source===window)return;let r=n.data;if(!(!r||typeof r.command!="string")&&r.channel===$t)switch(r.command){case"notes-enter":Nn();break;case"notes-exit":Ot();break;case"notes-cursor-hide":ra();break;case"notes-screenshot":{try{let o=await Rn();Ot(),window.parent.postMessage({channel:$t,command:"screenshot-result",image:o},"*")}catch(o){window.parent.postMessage({channel:$t,command:"screenshot-result",error:o instanceof Error?o.message:"Screenshot failed"},"*")}break}case"cursor-show":Yt("visible");break;case"cursor-hide":Yt("hidden");break;case"cursor-auto":Yt(null);break;case"navigate":typeof r.url=="string"&&(window.history.pushState(null,"",r.url),window.dispatchEvent(new PopStateEvent("popstate")));break;case"back":window.history.back();break;case"forward":window.history.forward();break;case"healthcheck":{let o=x().ws;window.parent.postMessage({channel:$t,command:"healthcheck-reply",wsConnected:!!(o.ws&&o.ws.readyState===WebSocket.OPEN),url:location.href},"*");break}case"display-mode-pip":e.zoom.pipMode=!0;try{sessionStorage.setItem("__ms_pip","1")}catch{}break;case"display-mode-full":e.zoom.pipMode=!1;try{sessionStorage.setItem("__ms_pip","0")}catch{}break;case"preview-mode-mobile":e.zoom.mobilePreview=!0;try{sessionStorage.setItem("__ms_mobile","1")}catch{}yt(),ir(!0);break;case"preview-mode-desktop":e.zoom.mobilePreview=!1;try{sessionStorage.setItem("__ms_mobile","0")}catch{}Vt(),ir(!1);break}},window.addEventListener("keyup",n=>{n.code==="Backquote"&&window.parent!==window&&window.parent.postMessage({channel:$t,command:"ptt-keyup"},"*")}),window.addEventListener("message",e.messages.handler))}var zf="mindstudio-browser-agent";function vs(){if(window.__ms_nav_patched)return;window.__ms_nav_patched=!0;let e=()=>{let r=location.pathname+location.search+location.hash,o=x();if(r!==o.nav.lastUrl&&(o.nav.lastUrl=r,window.parent!==window)){let i=window.navigation;window.parent.postMessage({channel:zf,command:"location",url:r,canGoBack:i?!!i.canGoBack:void 0,canGoForward:i?!!i.canGoForward:void 0},"*")}},t=history.pushState.bind(history);history.pushState=function(...r){t(...r),e()};let n=history.replaceState.bind(history);history.replaceState=function(...r){n(...r),e()},window.addEventListener("popstate",e),window.addEventListener("hashchange",e),e()}var Cs=16,qf=3e4,Ss="__ms_mirror";function Yf(){let e=new URLSearchParams(window.location.search);if(e.get("mirror")==="true"){e.delete("mirror");let t=e.toString(),n=window.location.pathname+(t?"?"+t:"")+window.location.hash;window.history.replaceState(null,"",n);try{sessionStorage.setItem(Ss,"1")}catch{}return!0}try{return sessionStorage.getItem(Ss)==="1"}catch{return!1}}async function xs(){if(window.parent!==window||!Yf())return;let e=x().mirror;if(e.recording)return;let t=[],n=null;function r(){if(n=null,t.length===0)return;let a=gn();if(!a){n=setTimeout(r,Cs);return}let s=t;t=[],a.send(JSON.stringify({type:"mirror",events:s}))}function o(a){t.push(a),n||(n=setTimeout(r,Cs))}document.readyState!=="complete"&&await new Promise(a=>window.addEventListener("load",()=>a(),{once:!0})),await new Promise(a=>setTimeout(a,500));let i=Re({emit:o,collectFonts:!0,checkoutEveryNms:qf});i&&(e.recording=!0,e.stopFn=()=>{i(),n&&(clearTimeout(n),n=null),r(),e.recording=!1,e.stopFn=null})}var jf='input[type="email"], input[autocomplete="email"]',Zf='input[type="tel"], input[autocomplete="tel"]',Kf='input[autocomplete="one-time-code"]',Xf=/e[-_ ]?mail/i,Jf=/phone|mobile|\btel\b/i,Qf=/\b(otp|code|verification|verify|2fa|one[-_ ]?time)\b/i;function _n(e){let t=e.getBoundingClientRect();if(t.width===0||t.height===0)return!1;let n=getComputedStyle(e);return!(n.display==="none"||n.visibility==="hidden")}function to(e){let t=document.querySelectorAll(e);for(let n of t)if(_n(n))return n;return null}function em(e){let t=e.getAttribute("aria-labelledby"),n=t?document.getElementById(t):null;return[e.name,e.id,e.placeholder,e.getAttribute("aria-label"),n?.textContent].filter(Boolean).join(" ")}function no(e,t){let n=document.querySelectorAll('input[type="text"], input:not([type])');for(let r of n)if(t(r)&&e.test(em(r))&&_n(r))return r;return null}function tm(e){if(e.inputMode==="numeric"){let n=e.maxLength;if(n>=4&&n<=8)return!0}let t=e.getAttribute("pattern")??"";return!!(/0-9/.test(t)&&e.maxLength>=4&&e.maxLength<=8)}function nm(e){if(e.maxLength!==1)return!1;let t=(e.getAttribute("type")||"text").toLowerCase();return t==="text"||t==="tel"||t==="number"}function rm(){let e=Array.from(document.querySelectorAll("input")).filter(t=>nm(t)&&_n(t));return e.length<4||e.length>8?null:(e.sort((t,n)=>{let r=t.getBoundingClientRect(),o=n.getBoundingClientRect();return Math.abs(r.top-o.top)>8?r.top-o.top:r.left-o.left}),e)}function om(){let e=to(Kf),t=e&&e.maxLength!==1?e:null;if(!t){let n=document.querySelectorAll('input[inputmode="numeric"], input[type="text"]');for(let r of n)if(tm(r)&&_n(r)){t=r;break}}return t||(t=no(Qf,n=>n.maxLength<=8&&n.maxLength!==1)),t}function Is(){let e=to(jf),t=e?"email":null;e||(e=to(Zf),t=e?"phone":null),e||(e=no(Xf,()=>!0),e&&(t="email")),e||(e=no(Jf,()=>!0),e&&(t="phone"));let n=rm(),r=n?{cells:n,segmented:!0}:null;if(!r){let o=om();o&&(r={cells:[o],segmented:!1})}return{identifier:e,identifierKind:t,code:r}}var Es=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set;function As(e,t){Es?Es.call(e,t):e.value=t}function Fn(e,t,n){let r;try{r=new InputEvent(t,{bubbles:!0,cancelable:t==="beforeinput",inputType:"insertText",data:n})}catch{r=new Event(t,{bubbles:!0})}e.dispatchEvent(r)}function im(e,t){let n={key:t,code:/^[0-9]$/.test(t)?`Digit${t}`:t,bubbles:!0,cancelable:!0};e.dispatchEvent(new KeyboardEvent("keydown",n)),e.dispatchEvent(new KeyboardEvent("keyup",n))}function Ms(e,t){e.focus(),As(e,t),Fn(e,"beforeinput",t),Fn(e,"input",t),e.dispatchEvent(new Event("change",{bubbles:!0}))}function ks(e){let t=e.closest("form");if(t&&typeof t.requestSubmit=="function")try{t.requestSubmit();return}catch{}let n={key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0,cancelable:!0};e.dispatchEvent(new KeyboardEvent("keydown",n)),e.dispatchEvent(new KeyboardEvent("keypress",n)),e.dispatchEvent(new KeyboardEvent("keyup",n))}function Ts(e,t){Ms(e,t),ks(e)}function On(e,t){return e.segmented?e.cells.forEach((n,r)=>{let o=t[r]??"";n.focus(),As(n,o),Fn(n,"beforeinput",o),Fn(n,"input",o),n.dispatchEvent(new Event("change",{bubbles:!0})),o&&im(n,o)}):Ms(e.cells[0],t),oo(e),ro(e)}function ro(e){return e.cells.map(t=>t.value).join("")}function oo(e){let t=e.cells[e.cells.length-1]??e.cells[0];t&&ks(t)}var am="__mindstudio-auth-creds-host",sm="remy@mindstudio.ai",lm="+15555555555",Qe="123456";function io(e){x().authCredsWidget.host||cm(),um(e)}function Ls(){let e=x().authCredsWidget;e.host&&(e.host.remove(),e.host=null)}function cm(){let e=x().authCredsWidget,t=document.createElement("div");t.id=am,t.style.cssText="position: fixed; right: 16px; bottom: 16px; z-index: 2147483640; pointer-events: none;";let n=t.attachShadow({mode:"open"}),r=document.createElement("style");r.textContent=`
241
+ `,document.body.appendChild(o);let c=await(await Y(o,{embedFonts:!0})).toCanvas({width:n*Ae});c&&t.drawImage(c,0,0,n*Ae,r*Ae)}finally{o.style.cssText=a,e.shadowRoot?.insertBefore(o,i),i&&(i.style.display="")}}function Fn(){let e=x().notesMode;e.active||(e.active=!0,x().touch.active&&(Yt(),e.wasTouchActive=!0),aa())}function $t(){let e=x().notesMode;e.active&&(e.active=!1,sa(),e.wasTouchActive&&(e.wasTouchActive=!1,bt()))}async function On(){let{image:e}=await xs({viewportOnly:!0});return e}var Dt="mindstudio-browser-agent";function Is(){let e=x(),t=new URLSearchParams(window.location.search);e.zoom.pipMode=t.get("display-mode")==="pip",e.zoom.mobilePreview=t.get("preview")==="mobile"||window.innerWidth<768;try{let n=sessionStorage.getItem("__ms_pip");n==="1"?e.zoom.pipMode=!0:n==="0"&&(e.zoom.pipMode=!1);let r=sessionStorage.getItem("__ms_mobile");r==="1"?e.zoom.mobilePreview=!0:r==="0"&&(e.zoom.mobilePreview=!1)}catch{}e.messages.handler||(e.messages.handler=async n=>{if(n.source===window)return;let r=n.data;if(!(!r||typeof r.command!="string")&&r.channel===Dt)switch(r.command){case"notes-enter":Fn();break;case"notes-exit":$t();break;case"notes-cursor-hide":la();break;case"notes-screenshot":{try{let o=await On();$t(),window.parent.postMessage({channel:Dt,command:"screenshot-result",image:o},"*")}catch(o){window.parent.postMessage({channel:Dt,command:"screenshot-result",error:o instanceof Error?o.message:"Screenshot failed"},"*")}break}case"cursor-show":Xt("visible");break;case"cursor-hide":Xt("hidden");break;case"cursor-auto":Xt(null);break;case"navigate":typeof r.url=="string"&&(window.history.pushState(null,"",r.url),window.dispatchEvent(new PopStateEvent("popstate")));break;case"back":window.history.back();break;case"forward":window.history.forward();break;case"healthcheck":{let o=x().ws;window.parent.postMessage({channel:Dt,command:"healthcheck-reply",wsConnected:!!(o.ws&&o.ws.readyState===WebSocket.OPEN),url:location.href},"*");break}case"display-mode-pip":e.zoom.pipMode=!0;try{sessionStorage.setItem("__ms_pip","1")}catch{}break;case"display-mode-full":e.zoom.pipMode=!1;try{sessionStorage.setItem("__ms_pip","0")}catch{}break;case"preview-mode-mobile":e.zoom.mobilePreview=!0;try{sessionStorage.setItem("__ms_mobile","1")}catch{}bt(),cr(!0);break;case"preview-mode-desktop":e.zoom.mobilePreview=!1;try{sessionStorage.setItem("__ms_mobile","0")}catch{}Yt(),cr(!1);break}},window.addEventListener("keyup",n=>{n.code==="Backquote"&&window.parent!==window&&window.parent.postMessage({channel:Dt,command:"ptt-keyup"},"*")}),window.addEventListener("message",e.messages.handler))}var Kf="mindstudio-browser-agent";function Es(){if(window.__ms_nav_patched)return;window.__ms_nav_patched=!0;let e=()=>{let r=location.pathname+location.search+location.hash,o=x();if(r!==o.nav.lastUrl&&(o.nav.lastUrl=r,window.parent!==window)){let i=window.navigation;window.parent.postMessage({channel:Kf,command:"location",url:r,canGoBack:i?!!i.canGoBack:void 0,canGoForward:i?!!i.canGoForward:void 0},"*")}},t=history.pushState.bind(history);history.pushState=function(...r){t(...r),e()};let n=history.replaceState.bind(history);history.replaceState=function(...r){n(...r),e()},window.addEventListener("popstate",e),window.addEventListener("hashchange",e),e()}var As=16,Jf=3e4,ks="__ms_mirror";function Qf(){let e=new URLSearchParams(window.location.search);if(e.get("mirror")==="true"){e.delete("mirror");let t=e.toString(),n=window.location.pathname+(t?"?"+t:"")+window.location.hash;window.history.replaceState(null,"",n);try{sessionStorage.setItem(ks,"1")}catch{}return!0}try{return sessionStorage.getItem(ks)==="1"}catch{return!1}}async function Ms(){if(window.parent!==window||!Qf())return;let e=x().mirror;if(e.recording)return;let t=[],n=null;function r(){if(n=null,t.length===0)return;let a=wn();if(!a){n=setTimeout(r,As);return}let s=t;t=[],a.send(JSON.stringify({type:"mirror",events:s}))}function o(a){t.push(a),n||(n=setTimeout(r,As))}document.readyState!=="complete"&&await new Promise(a=>window.addEventListener("load",()=>a(),{once:!0})),await new Promise(a=>setTimeout(a,500));let i=Re({emit:o,collectFonts:!0,checkoutEveryNms:Jf});i&&(e.recording=!0,e.stopFn=()=>{i(),n&&(clearTimeout(n),n=null),r(),e.recording=!1,e.stopFn=null})}var em='input[type="email"], input[autocomplete="email"]',tm='input[type="tel"], input[autocomplete="tel"]',nm='input[autocomplete="one-time-code"]',rm=/e[-_ ]?mail/i,om=/phone|mobile|\btel\b/i,im=/\b(otp|code|verification|verify|2fa|one[-_ ]?time)\b/i;function $n(e){let t=e.getBoundingClientRect();if(t.width===0||t.height===0)return!1;let n=getComputedStyle(e);return!(n.display==="none"||n.visibility==="hidden")}function io(e){let t=document.querySelectorAll(e);for(let n of t)if($n(n))return n;return null}function am(e){let t=e.getAttribute("aria-labelledby"),n=t?document.getElementById(t):null;return[e.name,e.id,e.placeholder,e.getAttribute("aria-label"),n?.textContent].filter(Boolean).join(" ")}function ao(e,t){let n=document.querySelectorAll('input[type="text"], input:not([type])');for(let r of n)if(t(r)&&e.test(am(r))&&$n(r))return r;return null}function sm(e){if(e.inputMode==="numeric"){let n=e.maxLength;if(n>=4&&n<=8)return!0}let t=e.getAttribute("pattern")??"";return!!(/0-9/.test(t)&&e.maxLength>=4&&e.maxLength<=8)}function lm(e){if(e.maxLength!==1)return!1;let t=(e.getAttribute("type")||"text").toLowerCase();return t==="text"||t==="tel"||t==="number"}function cm(){let e=Array.from(document.querySelectorAll("input")).filter(t=>lm(t)&&$n(t));return e.length<4||e.length>8?null:(e.sort((t,n)=>{let r=t.getBoundingClientRect(),o=n.getBoundingClientRect();return Math.abs(r.top-o.top)>8?r.top-o.top:r.left-o.left}),e)}function um(){let e=io(nm),t=e&&e.maxLength!==1?e:null;if(!t){let n=document.querySelectorAll('input[inputmode="numeric"], input[type="text"]');for(let r of n)if(sm(r)&&$n(r)){t=r;break}}return t||(t=ao(im,n=>n.maxLength<=8&&n.maxLength!==1)),t}function Ts(){let e=io(em),t=e?"email":null;e||(e=io(tm),t=e?"phone":null),e||(e=ao(rm,()=>!0),e&&(t="email")),e||(e=ao(om,()=>!0),e&&(t="phone"));let n=cm(),r=n?{cells:n,segmented:!0}:null;if(!r){let o=um();o&&(r={cells:[o],segmented:!1})}return{identifier:e,identifierKind:t,code:r}}var Ls=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set;function Ns(e,t){Ls?Ls.call(e,t):e.value=t}function Dn(e,t,n){let r;try{r=new InputEvent(t,{bubbles:!0,cancelable:t==="beforeinput",inputType:"insertText",data:n})}catch{r=new Event(t,{bubbles:!0})}e.dispatchEvent(r)}function dm(e,t){let n={key:t,code:/^[0-9]$/.test(t)?`Digit${t}`:t,bubbles:!0,cancelable:!0};e.dispatchEvent(new KeyboardEvent("keydown",n)),e.dispatchEvent(new KeyboardEvent("keyup",n))}function Rs(e,t){e.focus(),Ns(e,t),Dn(e,"beforeinput",t),Dn(e,"input",t),e.dispatchEvent(new Event("change",{bubbles:!0}))}function _s(e){let t=e.closest("form");if(t&&typeof t.requestSubmit=="function")try{t.requestSubmit();return}catch{}let n={key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0,cancelable:!0};e.dispatchEvent(new KeyboardEvent("keydown",n)),e.dispatchEvent(new KeyboardEvent("keypress",n)),e.dispatchEvent(new KeyboardEvent("keyup",n))}function Fs(e,t){Rs(e,t),_s(e)}function Pn(e,t){return e.segmented?e.cells.forEach((n,r)=>{let o=t[r]??"";n.focus(),Ns(n,o),Dn(n,"beforeinput",o),Dn(n,"input",o),n.dispatchEvent(new Event("change",{bubbles:!0})),o&&dm(n,o)}):Rs(e.cells[0],t),lo(e),so(e)}function so(e){return e.cells.map(t=>t.value).join("")}function lo(e){let t=e.cells[e.cells.length-1]??e.cells[0];t&&_s(t)}var fm="__mindstudio-auth-creds-host",mm="remy@mindstudio.ai",pm="+15555555555",Qe="123456";function co(e){x().authCredsWidget.host||hm(),gm(e)}function Os(){let e=x().authCredsWidget;e.host&&(e.host.remove(),e.host=null)}function hm(){let e=x().authCredsWidget,t=document.createElement("div");t.id=fm,t.style.cssText="position: fixed; right: 16px; bottom: 16px; z-index: 2147483640; pointer-events: none;";let n=t.attachShadow({mode:"open"}),r=document.createElement("style");r.textContent=`
242
242
  .card {
243
243
  pointer-events: auto;
244
244
  width: 280px;
@@ -326,9 +326,9 @@ ${g}
326
326
  @keyframes __ms_auth_spin {
327
327
  to { transform: rotate(360deg); }
328
328
  }
329
- `,n.appendChild(r);let o=document.createElement("div");o.className="card",n.appendChild(o),document.body.appendChild(t),e.host=t}function um(e){let t=x().authCredsWidget;if(!t.host)return;let n=t.host.shadowRoot;if(!n)return;let r=n.querySelector(".card");if(!r||e.loading&&r.querySelector(".loading"))return;r.innerHTML="";let o=document.createElement("div");o.className="header";let i=document.createElement("span");i.className="title",i.textContent="Dev mode";let a=document.createElement("button");if(a.className="dismiss",a.setAttribute("aria-label","Dismiss"),a.title="Dismiss",a.textContent="\xD7",a.addEventListener("click",e.onDismiss),o.appendChild(i),o.appendChild(a),r.appendChild(o),e.loading){let l=document.createElement("div");l.className="loading";let u=document.createElement("span");u.className="spinner";let d=document.createElement("span");d.textContent="Signing in\u2026",l.appendChild(u),l.appendChild(d),r.appendChild(l);return}let s=document.createElement("p");s.className="body",s.textContent="Use your own credentials, or use these test credentials to bypass verification.",r.appendChild(s);let c=document.createElement("div");if(c.className="actions",r.appendChild(c),e.identifier&&e.identifierKind){let l=e.identifierKind==="email"?sm:lm,u=document.createElement("button");u.className="primary",u.textContent=`Continue with ${l}`,u.title=`Continue with ${l}`,u.addEventListener("click",()=>{e.identifier&&(Ts(e.identifier,l),e.onIdentifierFilled())}),c.appendChild(u)}if(e.code){let l=document.createElement("button");l.className="primary",l.textContent=`Continue with ${Qe}`,l.title=`Continue with ${Qe}`,l.addEventListener("click",()=>{e.code&&On(e.code,Qe)}),c.appendChild(l)}}var Ns="__ms_dev_creds_dismissed",dm=150,fm=8e3,mm=250,pm=8,hm=6,gm=200,ym=1e4;function Rs(){let e=x();e.authCredsWidget||(e.authCredsWidget={initialized:!1,host:null,observer:null,debounceTimer:null,awaitingCode:!1,awaitingCodeTimer:null,codePollTimer:null,codeAttempts:0,codeSubmitted:!1,codeSeenCount:0,blankPolls:0});let t=e.authCredsWidget;if(t.initialized||(t.initialized=!0,Nr()))return;let n=Lr();n!=="iframe"&&n!=="standalone"||_s(Date.now()+ym)}function _s(e){if(typeof window.__MINDSTUDIO__?.releaseId!="string"){Date.now()<e&&setTimeout(()=>_s(e),gm);return}let n=x().authCredsWidget;if(n.observer)return;let r=new MutationObserver(ao);r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["type","autocomplete","inputmode","maxlength","style","hidden","class"]}),n.observer=r,ao()}function ao(){let e=x().authCredsWidget;e.debounceTimer&&clearTimeout(e.debounceTimer),e.debounceTimer=setTimeout(()=>{e.debounceTimer=null,Fs()},dm)}function Fs(){let e=x().authCredsWidget;if(wm()){$n(),lo();return}let t=Is();if(!t.identifier&&!t.code){if(e.awaitingCode&&!e.codeSubmitted&&e.blankPolls<hm){e.blankPolls++,so();return}$n(),lo();return}if(e.blankPolls=0,e.awaitingCode){if(t.code&&!e.codeSubmitted)if(ro(t.code)===Qe)oo(t.code),e.codeSubmitted=!0;else{let r=t.code.cells.length,o=!t.code.segmented||r===e.codeSeenCount;e.codeSeenCount=r,o&&e.codeAttempts<pm&&(e.codeAttempts++,On(t.code,Qe)===Qe&&(e.codeSubmitted=!0))}else t.code||(e.codeSeenCount=0);so();return}io({identifier:t.identifier,identifierKind:t.identifierKind,code:bm(t.code),loading:!1,onDismiss:$s,onIdentifierFilled:Os})}function bm(e){return e&&e.cells.some(t=>!t.disabled)?e:null}function so(){io({identifier:null,identifierKind:null,code:null,loading:!0,onDismiss:$s,onIdentifierFilled:Os})}function Os(){let e=x().authCredsWidget;e.awaitingCode=!0,e.codeAttempts=0,e.codeSubmitted=!1,e.codeSeenCount=0,e.blankPolls=0,e.awaitingCodeTimer&&clearTimeout(e.awaitingCodeTimer),e.awaitingCodeTimer=setTimeout(()=>{$n(),ao()},fm),e.codePollTimer&&clearInterval(e.codePollTimer),e.codePollTimer=setInterval(Fs,mm),so()}function $n(){let e=x().authCredsWidget;e.awaitingCode=!1,e.codeAttempts=0,e.codeSubmitted=!1,e.codeSeenCount=0,e.blankPolls=0,e.awaitingCodeTimer&&(clearTimeout(e.awaitingCodeTimer),e.awaitingCodeTimer=null),e.codePollTimer&&(clearInterval(e.codePollTimer),e.codePollTimer=null)}function lo(){Ls()}function $s(){$n();try{sessionStorage.setItem(Ns,"1")}catch{}lo()}function wm(){try{return sessionStorage.getItem(Ns)==="1"}catch{return!1}}var vm=new Set(["__mindstudio-browser-agent","__mindstudio-cursor","__mindstudio-cursor-ripple","__mindstudio-notes-overlay","__mindstudio-notes-cursor"]),Cm=["backgroundColor","backgroundImage","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","boxShadow"],Ds=60,Sm=80;function Ps(){let e=window.innerWidth,t=window.innerHeight,n=window.scrollY,r=document.documentElement.scrollHeight,o=[];o.push(`viewport: ${e} \xD7 ${t}`),o.push(`scroll: ${Math.round(n)} / ${r} (${n<10?"top":n+t>=r-10?"bottom":Math.round(n/(r-t)*100)+"%"})`),o.push("");let i=[],a=document.body;if(!a)return o.join(`
330
- `)+"(empty page)";Ws(a,i,e,t,n);let s=Nm(i);for(let u of s)if("count"in u){let d=u;o.push(`[${d.count} ${d.role}, each ~${d.avgWidth} \xD7 ${d.avgHeight}, first: "${d.firstName}", last: "${d.lastName}"]`),o.push("")}else Mm(u,o,e,t,n);let c=Lm(i);if(c.length>0){for(let u of c)o.push(`\xD7 ${u.a} overlaps ${u.b} by ${u.overlapPx}px ${u.axis}ly`);o.push("")}let l=i.filter(u=>{let d=u.rect;return d.right<0||d.left>e||d.bottom<-n||d.top>t+n});for(let u of l){let d=u.rect,f="";d.right<0?f=`left: ${Math.round(d.left)}px`:d.left>e?f=`left: ${Math.round(d.left)}px`:d.bottom<0?f=`top: ${Math.round(d.top)}px`:f=`top: ${Math.round(d.top)}px`,o.push(`\xD7 ${u.label} \u2014 off-viewport (${f})`)}return o.join(`
331
- `).trimEnd()}function Ws(e,t,n,r,o){if(xm(e)||t.length>=Sm)return;let i=e.tagName.toLowerCase(),a=ye(e),s=Bs(e),c=a!==null,l=i==="img"||i==="svg"||i==="canvas"||i==="video",u=i==="input"||i==="textarea"||i==="select",d=c||l||u;if(!d&&Im(e)&&(d=!0),d&&!s&&!l&&!u&&Em(a)&&(d=!1),d){let f=e.getBoundingClientRect();if(f.width>0&&f.height>0)try{let m=getComputedStyle(e),p=Am(e,a,i);t.push({label:p,rect:f,style:m,el:e,tag:i})}catch{}}for(let f of Array.from(e.children))Ws(f,t,n,r,o)}function xm(e){if(vm.has(e.id))return!0;let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||t==="head"||e.getAttribute("aria-hidden")==="true")return!0;try{let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden")return!0}catch{}return!1}function Bs(e){for(let t of Array.from(e.childNodes))if(t.nodeType===Node.TEXT_NODE&&(t.textContent||"").trim())return!0;return!1}function Im(e){try{let t=getComputedStyle(e);for(let n of Cm){let r=t[n];if(!(!r||r==="none"||r==="0px"||r==="rgba(0, 0, 0, 0)"||r==="transparent"))return!0}}catch{}return!1}function Em(e){return e==="navigation"||e==="main"||e==="banner"||e==="contentinfo"||e==="complementary"||e==="region"||e==="form"||e==="list"||e==="table"||e==="article"||e==="group"}function Am(e,t,n){let r=Se(e),o=r.length>Ds?r.slice(0,Ds-1)+"\u2026":r;if(t&&o)return`${t} "${o}"`;if(t)return t;if(o)return`${n} "${o}"`;if(e.id)return`${n}#${e.id}`;let i=e.className&&typeof e.className=="string"?e.className.split(/\s+/).find(a=>!a.startsWith("sc-")&&!a.startsWith("css-")&&a.length<30):null;return i?`${n}.${i}`:n}function Mm(e,t,n,r,o){let{label:i,rect:a,style:s,el:c,tag:l}=e,u=Math.round(a.width),d=Math.round(a.height),f=Math.round(a.left),m=Math.round(a.top+o),p=[],g=Bs(c)||l==="input"||l==="textarea";if(g){p.push(s.fontSize);let b=Rm(s.fontFamily);b&&p.push(`"${b}"`);let w=s.fontWeight;w!=="400"&&w!=="normal"&&p.push(w),p.push(co(s.color));let S=co(s.backgroundColor);S&&S!=="transparent"&&p.push(`on ${S}`)}else if(!(l==="img"||l==="svg"||l==="canvas"||l==="video")){let b=co(s.backgroundColor);b&&b!=="transparent"&&p.push(`bg: ${b}`)}let h=p.length>0?` \u2014 ${p.join(" ")}`:"";t.push(`${i}${h}`);let y=[];if(y.push(`${u} \xD7 ${d}`),y.push(`at (${f}, ${m})`),y.push(`${(u/n*100).toFixed(1)}% vw`),(l==="img"||l==="svg"||l==="canvas"||l==="video")&&u>0&&d>0){let b=_m(u,d);y.push(`aspect: ${b}`)}if(g){let b=km(c,s);b&&(y.push(`${b.lines} line${b.lines!==1?"s":""}`),b.capacity!==null&&y.push(`(line-height: ${b.lineHeight}, capacity: ${b.capacity.toFixed(1)})`))}t.push(` ${y.join(", ")}`);let v=Tm(c);v&&t.push(` ${v}`),t.push("")}function km(e,t){let n=Hs(e);if(!n||!n.textContent?.trim())return null;try{let r=document.createRange();r.selectNodeContents(n.parentElement||e);let o=r.getClientRects();if(o.length===0)return null;let i=o.length,a=t.lineHeight,s=parseFloat(a),c=null;return!isNaN(s)&&s>0&&(c=e.clientHeight/s),{lines:i,lineHeight:isNaN(s)?a:`${Math.round(s)}px`,capacity:c}}catch{return null}}function Hs(e){for(let t of Array.from(e.childNodes)){if(t.nodeType===Node.TEXT_NODE&&(t.textContent||"").trim())return t;if(t.nodeType===Node.ELEMENT_NODE){let n=Hs(t);if(n)return n}}return null}function Tm(e){let t=e,n=t.scrollWidth,r=t.scrollHeight,o=t.clientWidth,i=t.clientHeight;if(n<=o&&r<=i)return null;let a=getComputedStyle(e),s=a.overflowX,c=a.overflowY,l=a.textOverflow,u=[];if(n>o){let d=Math.round((n-o)/n*100),f=l==="ellipsis"?"ellipsis":s==="hidden"?"hidden":"scroll";u.push(`container: ${o}px, content: ${n}px wide, overflow: ${f} (${d}% hidden)`)}if(r>i&&c!=="visible"){let d=Math.round((r-i)/r*100),f=c==="hidden"?"hidden":"scroll";u.push(`container: ${i}px, content: ${r}px tall, overflow: ${f} (${d}% hidden)`)}return u.length>0?u.join("; "):null}function Lm(e){let t=[],n=new Map;for(let r of e){let o=r.el.parentElement,i=n.get(o)||[];i.push(r),n.set(o,i)}for(let r of n.values())if(!(r.length<2))for(let o=0;o<r.length;o++)for(let i=o+1;i<r.length;i++){let a=r[o].rect,s=r[i].rect,c=Math.min(a.bottom,s.bottom)-Math.max(a.top,s.top),l=Math.min(a.right,s.right)-Math.max(a.left,s.left);if(c>2&&l>2){let u=c<l?"vertical":"horizontal",d=Math.round(Math.min(c,l));t.push({a:r[o].label,b:r[i].label,overlapPx:d,axis:u})}}return t.slice(0,5)}function Nm(e){if(e.length===0)return[];let t=[],n=0;for(;n<e.length;){let r=e[n],o=r.el.parentElement,i=ye(r.el);if(i&&o){let a=n+1;for(;a<e.length&&e[a].el.parentElement===o&&ye(e[a].el)===i;)a++;let s=a-n;if(s>=4){let c=e.slice(n,a),l=Math.round(c.reduce((m,p)=>m+p.rect.width,0)/s),u=Math.round(c.reduce((m,p)=>m+p.rect.height,0)/s),d=Se(c[0].el),f=Se(c[s-1].el);t.push({count:s,role:i,avgWidth:l,avgHeight:u,firstName:d.length>40?d.slice(0,39)+"\u2026":d,lastName:f.length>40?f.slice(0,39)+"\u2026":f}),n=a;continue}}t.push(r),n++}return t}function co(e){if(!e||e==="transparent"||e==="rgba(0, 0, 0, 0)")return"transparent";let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(!t)return e;let n=parseInt(t[1]),r=parseInt(t[2]),o=parseInt(t[3]),i=t[4]!==void 0?parseFloat(t[4]):1;return i<1?`rgba(${n},${r},${o},${i})`:"#"+[n,r,o].map(a=>a.toString(16).padStart(2,"0")).join("")}function Rm(e){let t=e.split(",").map(o=>o.trim().replace(/^["']|["']$/g,"")),n=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","-apple-system","BlinkMacSystemFont"]);return t.find(o=>!n.has(o))||""}function _m(e,t){let n=Fm(e,t),r=e/n,o=t/n;return r>20||o>20?`${(e/t).toFixed(2)}:1`:`${r}:${o}`}function Fm(e,t){for(;t;)[e,t]=[t,e%t];return e}window.__MINDSTUDIO_BROWSER_AGENT__||(window.__MINDSTUDIO_BROWSER_AGENT__={takeSnapshot:Ue,takeSnapshotSync:Bt,getRefMap:He,executeSteps:Et,resolveElement:xe,computeStyleMap:Ps,captureWithNotes:Rn,enterNotesMode:Nn,exitNotesMode:Ot},go(),Co(),So(),xo(),Eo(),Io(),qi(),ws(),vs(),Jo(),Ho(),xs(),ms(),Rs(),window.parent!==window&&window.parent.postMessage({channel:"mindstudio-browser-agent",command:"ready"},"*"));return el(Om);})();
329
+ `,n.appendChild(r);let o=document.createElement("div");o.className="card",n.appendChild(o),document.body.appendChild(t),e.host=t}function gm(e){let t=x().authCredsWidget;if(!t.host)return;let n=t.host.shadowRoot;if(!n)return;let r=n.querySelector(".card");if(!r||e.loading&&r.querySelector(".loading"))return;r.innerHTML="";let o=document.createElement("div");o.className="header";let i=document.createElement("span");i.className="title",i.textContent="Dev mode";let a=document.createElement("button");if(a.className="dismiss",a.setAttribute("aria-label","Dismiss"),a.title="Dismiss",a.textContent="\xD7",a.addEventListener("click",e.onDismiss),o.appendChild(i),o.appendChild(a),r.appendChild(o),e.loading){let l=document.createElement("div");l.className="loading";let u=document.createElement("span");u.className="spinner";let d=document.createElement("span");d.textContent="Signing in\u2026",l.appendChild(u),l.appendChild(d),r.appendChild(l);return}let s=document.createElement("p");s.className="body",s.textContent="Use your own credentials, or use these test credentials to bypass verification.",r.appendChild(s);let c=document.createElement("div");if(c.className="actions",r.appendChild(c),e.identifier&&e.identifierKind){let l=e.identifierKind==="email"?mm:pm,u=document.createElement("button");u.className="primary",u.textContent=`Continue with ${l}`,u.title=`Continue with ${l}`,u.addEventListener("click",()=>{e.identifier&&(Fs(e.identifier,l),e.onIdentifierFilled())}),c.appendChild(u)}if(e.code){let l=document.createElement("button");l.className="primary",l.textContent=`Continue with ${Qe}`,l.title=`Continue with ${Qe}`,l.addEventListener("click",()=>{e.code&&Pn(e.code,Qe)}),c.appendChild(l)}}var $s="__ms_dev_creds_dismissed",ym=150,bm=8e3,wm=250,vm=8,Cm=6,Sm=200,xm=1e4;function Ds(){let e=x();e.authCredsWidget||(e.authCredsWidget={initialized:!1,host:null,observer:null,debounceTimer:null,awaitingCode:!1,awaitingCodeTimer:null,codePollTimer:null,codeAttempts:0,codeSubmitted:!1,codeSeenCount:0,blankPolls:0});let t=e.authCredsWidget;if(t.initialized||(t.initialized=!0,Or()))return;let n=Fr();n!=="iframe"&&n!=="standalone"||Ps(Date.now()+xm)}function Ps(e){if(typeof window.__MINDSTUDIO__?.releaseId!="string"){Date.now()<e&&setTimeout(()=>Ps(e),Sm);return}let n=x().authCredsWidget;if(n.observer)return;let r=new MutationObserver(uo);r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["type","autocomplete","inputmode","maxlength","style","hidden","class"]}),n.observer=r,uo()}function uo(){let e=x().authCredsWidget;e.debounceTimer&&clearTimeout(e.debounceTimer),e.debounceTimer=setTimeout(()=>{e.debounceTimer=null,Ws()},ym)}function Ws(){let e=x().authCredsWidget;if(Em()){Wn(),mo();return}let t=Ts();if(!t.identifier&&!t.code){if(e.awaitingCode&&!e.codeSubmitted&&e.blankPolls<Cm){e.blankPolls++,fo();return}Wn(),mo();return}if(e.blankPolls=0,e.awaitingCode){if(t.code&&!e.codeSubmitted)if(so(t.code)===Qe)lo(t.code),e.codeSubmitted=!0;else{let r=t.code.cells.length,o=!t.code.segmented||r===e.codeSeenCount;e.codeSeenCount=r,o&&e.codeAttempts<vm&&(e.codeAttempts++,Pn(t.code,Qe)===Qe&&(e.codeSubmitted=!0))}else t.code||(e.codeSeenCount=0);fo();return}co({identifier:t.identifier,identifierKind:t.identifierKind,code:Im(t.code),loading:!1,onDismiss:Hs,onIdentifierFilled:Bs})}function Im(e){return e&&e.cells.some(t=>!t.disabled)?e:null}function fo(){co({identifier:null,identifierKind:null,code:null,loading:!0,onDismiss:Hs,onIdentifierFilled:Bs})}function Bs(){let e=x().authCredsWidget;e.awaitingCode=!0,e.codeAttempts=0,e.codeSubmitted=!1,e.codeSeenCount=0,e.blankPolls=0,e.awaitingCodeTimer&&clearTimeout(e.awaitingCodeTimer),e.awaitingCodeTimer=setTimeout(()=>{Wn(),uo()},bm),e.codePollTimer&&clearInterval(e.codePollTimer),e.codePollTimer=setInterval(Ws,wm),fo()}function Wn(){let e=x().authCredsWidget;e.awaitingCode=!1,e.codeAttempts=0,e.codeSubmitted=!1,e.codeSeenCount=0,e.blankPolls=0,e.awaitingCodeTimer&&(clearTimeout(e.awaitingCodeTimer),e.awaitingCodeTimer=null),e.codePollTimer&&(clearInterval(e.codePollTimer),e.codePollTimer=null)}function mo(){Os()}function Hs(){Wn();try{sessionStorage.setItem($s,"1")}catch{}mo()}function Em(){try{return sessionStorage.getItem($s)==="1"}catch{return!1}}var Am=new Set(["__mindstudio-browser-agent","__mindstudio-cursor","__mindstudio-cursor-ripple","__mindstudio-notes-overlay","__mindstudio-notes-cursor"]),km=["backgroundColor","backgroundImage","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","boxShadow"],Us=60,Mm=80;function Vs(){let e=window.innerWidth,t=window.innerHeight,n=window.scrollY,r=document.documentElement.scrollHeight,o=[];o.push(`viewport: ${e} \xD7 ${t}`),o.push(`scroll: ${Math.round(n)} / ${r} (${n<10?"top":n+t>=r-10?"bottom":Math.round(n/(r-t)*100)+"%"})`),o.push("");let i=[],a=document.body;if(!a)return o.join(`
330
+ `)+"(empty page)";Gs(a,i,e,t,n);let s=Dm(i);for(let u of s)if("count"in u){let d=u;o.push(`[${d.count} ${d.role}, each ~${d.avgWidth} \xD7 ${d.avgHeight}, first: "${d.firstName}", last: "${d.lastName}"]`),o.push("")}else _m(u,o,e,t,n);let c=$m(i);if(c.length>0){for(let u of c)o.push(`\xD7 ${u.a} overlaps ${u.b} by ${u.overlapPx}px ${u.axis}ly`);o.push("")}let l=i.filter(u=>{let d=u.rect;return d.right<0||d.left>e||d.bottom<-n||d.top>t+n});for(let u of l){let d=u.rect,f="";d.right<0?f=`left: ${Math.round(d.left)}px`:d.left>e?f=`left: ${Math.round(d.left)}px`:d.bottom<0?f=`top: ${Math.round(d.top)}px`:f=`top: ${Math.round(d.top)}px`,o.push(`\xD7 ${u.label} \u2014 off-viewport (${f})`)}return o.join(`
331
+ `).trimEnd()}function Gs(e,t,n,r,o){if(Tm(e)||t.length>=Mm)return;let i=e.tagName.toLowerCase(),a=ye(e),s=zs(e),c=a!==null,l=i==="img"||i==="svg"||i==="canvas"||i==="video",u=i==="input"||i==="textarea"||i==="select",d=c||l||u;if(!d&&Lm(e)&&(d=!0),d&&!s&&!l&&!u&&Nm(a)&&(d=!1),d){let f=e.getBoundingClientRect();if(f.width>0&&f.height>0)try{let m=getComputedStyle(e),p=Rm(e,a,i);t.push({label:p,rect:f,style:m,el:e,tag:i})}catch{}}for(let f of Array.from(e.children))Gs(f,t,n,r,o)}function Tm(e){if(Am.has(e.id))return!0;let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||t==="head"||e.getAttribute("aria-hidden")==="true")return!0;try{let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden")return!0}catch{}return!1}function zs(e){for(let t of Array.from(e.childNodes))if(t.nodeType===Node.TEXT_NODE&&(t.textContent||"").trim())return!0;return!1}function Lm(e){try{let t=getComputedStyle(e);for(let n of km){let r=t[n];if(!(!r||r==="none"||r==="0px"||r==="rgba(0, 0, 0, 0)"||r==="transparent"))return!0}}catch{}return!1}function Nm(e){return e==="navigation"||e==="main"||e==="banner"||e==="contentinfo"||e==="complementary"||e==="region"||e==="form"||e==="list"||e==="table"||e==="article"||e==="group"}function Rm(e,t,n){let r=Se(e),o=r.length>Us?r.slice(0,Us-1)+"\u2026":r;if(t&&o)return`${t} "${o}"`;if(t)return t;if(o)return`${n} "${o}"`;if(e.id)return`${n}#${e.id}`;let i=e.className&&typeof e.className=="string"?e.className.split(/\s+/).find(a=>!a.startsWith("sc-")&&!a.startsWith("css-")&&a.length<30):null;return i?`${n}.${i}`:n}function _m(e,t,n,r,o){let{label:i,rect:a,style:s,el:c,tag:l}=e,u=Math.round(a.width),d=Math.round(a.height),f=Math.round(a.left),m=Math.round(a.top+o),p=[],g=zs(c)||l==="input"||l==="textarea";if(g){p.push(s.fontSize);let b=Pm(s.fontFamily);b&&p.push(`"${b}"`);let w=s.fontWeight;w!=="400"&&w!=="normal"&&p.push(w),p.push(po(s.color));let S=po(s.backgroundColor);S&&S!=="transparent"&&p.push(`on ${S}`)}else if(!(l==="img"||l==="svg"||l==="canvas"||l==="video")){let b=po(s.backgroundColor);b&&b!=="transparent"&&p.push(`bg: ${b}`)}let h=p.length>0?` \u2014 ${p.join(" ")}`:"";t.push(`${i}${h}`);let y=[];if(y.push(`${u} \xD7 ${d}`),y.push(`at (${f}, ${m})`),y.push(`${(u/n*100).toFixed(1)}% vw`),(l==="img"||l==="svg"||l==="canvas"||l==="video")&&u>0&&d>0){let b=Wm(u,d);y.push(`aspect: ${b}`)}if(g){let b=Fm(c,s);b&&(y.push(`${b.lines} line${b.lines!==1?"s":""}`),b.capacity!==null&&y.push(`(line-height: ${b.lineHeight}, capacity: ${b.capacity.toFixed(1)})`))}t.push(` ${y.join(", ")}`);let v=Om(c);v&&t.push(` ${v}`),t.push("")}function Fm(e,t){let n=Ys(e);if(!n||!n.textContent?.trim())return null;try{let r=document.createRange();r.selectNodeContents(n.parentElement||e);let o=r.getClientRects();if(o.length===0)return null;let i=o.length,a=t.lineHeight,s=parseFloat(a),c=null;return!isNaN(s)&&s>0&&(c=e.clientHeight/s),{lines:i,lineHeight:isNaN(s)?a:`${Math.round(s)}px`,capacity:c}}catch{return null}}function Ys(e){for(let t of Array.from(e.childNodes)){if(t.nodeType===Node.TEXT_NODE&&(t.textContent||"").trim())return t;if(t.nodeType===Node.ELEMENT_NODE){let n=Ys(t);if(n)return n}}return null}function Om(e){let t=e,n=t.scrollWidth,r=t.scrollHeight,o=t.clientWidth,i=t.clientHeight;if(n<=o&&r<=i)return null;let a=getComputedStyle(e),s=a.overflowX,c=a.overflowY,l=a.textOverflow,u=[];if(n>o){let d=Math.round((n-o)/n*100),f=l==="ellipsis"?"ellipsis":s==="hidden"?"hidden":"scroll";u.push(`container: ${o}px, content: ${n}px wide, overflow: ${f} (${d}% hidden)`)}if(r>i&&c!=="visible"){let d=Math.round((r-i)/r*100),f=c==="hidden"?"hidden":"scroll";u.push(`container: ${i}px, content: ${r}px tall, overflow: ${f} (${d}% hidden)`)}return u.length>0?u.join("; "):null}function $m(e){let t=[],n=new Map;for(let r of e){let o=r.el.parentElement,i=n.get(o)||[];i.push(r),n.set(o,i)}for(let r of n.values())if(!(r.length<2))for(let o=0;o<r.length;o++)for(let i=o+1;i<r.length;i++){let a=r[o].rect,s=r[i].rect,c=Math.min(a.bottom,s.bottom)-Math.max(a.top,s.top),l=Math.min(a.right,s.right)-Math.max(a.left,s.left);if(c>2&&l>2){let u=c<l?"vertical":"horizontal",d=Math.round(Math.min(c,l));t.push({a:r[o].label,b:r[i].label,overlapPx:d,axis:u})}}return t.slice(0,5)}function Dm(e){if(e.length===0)return[];let t=[],n=0;for(;n<e.length;){let r=e[n],o=r.el.parentElement,i=ye(r.el);if(i&&o){let a=n+1;for(;a<e.length&&e[a].el.parentElement===o&&ye(e[a].el)===i;)a++;let s=a-n;if(s>=4){let c=e.slice(n,a),l=Math.round(c.reduce((m,p)=>m+p.rect.width,0)/s),u=Math.round(c.reduce((m,p)=>m+p.rect.height,0)/s),d=Se(c[0].el),f=Se(c[s-1].el);t.push({count:s,role:i,avgWidth:l,avgHeight:u,firstName:d.length>40?d.slice(0,39)+"\u2026":d,lastName:f.length>40?f.slice(0,39)+"\u2026":f}),n=a;continue}}t.push(r),n++}return t}function po(e){if(!e||e==="transparent"||e==="rgba(0, 0, 0, 0)")return"transparent";let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(!t)return e;let n=parseInt(t[1]),r=parseInt(t[2]),o=parseInt(t[3]),i=t[4]!==void 0?parseFloat(t[4]):1;return i<1?`rgba(${n},${r},${o},${i})`:"#"+[n,r,o].map(a=>a.toString(16).padStart(2,"0")).join("")}function Pm(e){let t=e.split(",").map(o=>o.trim().replace(/^["']|["']$/g,"")),n=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","-apple-system","BlinkMacSystemFont"]);return t.find(o=>!n.has(o))||""}function Wm(e,t){let n=Bm(e,t),r=e/n,o=t/n;return r>20||o>20?`${(e/t).toFixed(2)}:1`:`${r}:${o}`}function Bm(e,t){for(;t;)[e,t]=[t,e%t];return e}window.__MINDSTUDIO_BROWSER_AGENT__||(window.__MINDSTUDIO_BROWSER_AGENT__={takeSnapshot:Ue,takeSnapshotSync:Ht,getRefMap:He,executeSteps:At,resolveElement:xe,computeStyleMap:Vs,captureWithNotes:On,enterNotesMode:Fn,exitNotesMode:$t},vo(),Eo(),Ao(),ko(),To(),Mo(),Ki(),Is(),Es(),ri(),Yo(),Ms(),bs(),Ds(),window.parent!==window&&window.parent.postMessage({channel:"mindstudio-browser-agent",command:"ready"},"*"));return il(Hm);})();
332
332
  /*! Bundled license information:
333
333
 
334
334
  rrweb/es/rrweb/ext/tslib/tslib.es6.js: