@mindstudio-ai/browser-agent 0.1.29 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";var __MindStudioBrowserAgent=(()=>{var xt=Object.defineProperty;var Po=Object.getOwnPropertyDescriptor;var Fo=Object.getOwnPropertyNames;var Do=Object.prototype.hasOwnProperty;var Io=(e,t)=>{for(var n in t)xt(e,n,{get:t[n],enumerable:!0})},Oo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fo(t))!Do.call(e,i)&&i!==n&&xt(e,i,{get:()=>t[i],enumerable:!(r=Po(t,i))||r.enumerable});return e};var Ho=e=>Oo(xt({},"__esModule",{value:!0}),e);var Ls={};Io(Ls,{executeSteps:()=>pt,getRefMap:()=>Se,resolveElement:()=>oe,takeSnapshot:()=>Ee,takeSnapshotSync:()=>Mt});var vt="__ms";function Wo(){return{ws:{ws:null,clientId:null,reconnectDelay:1e3,closing:!1,busy:!1},cursor:{el:null,rippleEl:null,x:0,y:0,visible:!1,hasPosition:!1,hideTimer:null,forcedState:null,executing:!1,targetElement:null,trackingFrame:null,settledResolve:null},snapshot:{refCounter:0,refMap:new Map},networkIdle:{activeRequests:0},transport:{buffer:[],flushTimer:null,capturing:!1,captured:[],wsGetter:null},noteLayer:{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},messages:{handler:null},screenshot:{cameraEl:null,flashEl:null},fonts:{initialized:!1,observer:null},zoom:{pipMode:!1}}}function M(){let e=window;return e[vt]||(e[vt]=Wo()),e[vt]}var an="/__mindstudio_dev__/logs",Bo=2e3;function ln(e){M().transport.wsGetter=e}function sn(){let e=M().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",an,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify(t))}catch{}}function Uo(){let e=M().transport;e.flushTimer||(e.flushTimer=setTimeout(()=>{e.flushTimer=null,sn()},Bo))}function qo(){let e=M().transport;e.flushTimer&&(clearTimeout(e.flushTimer),e.flushTimer=null),sn()}function V(e){let t=M().transport;t.buffer.push(e),t.capturing&&t.captured.push(e),Uo()}function St(e){let t=M().transport;t.buffer.push(e),t.capturing&&t.captured.push(e),qo()}function Et(){let e=M().transport;e.capturing=!0,e.captured=[]}function Ct(){let e=M().transport;e.capturing=!1;let t=e.captured;return e.captured=[],t}function cn(){window.addEventListener("beforeunload",()=>{let e=M().transport;e.buffer.length>0&&navigator.sendBeacon&&navigator.sendBeacon(an,JSON.stringify(e.buffer))})}var jo={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 me(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 jo[n]??null}function un(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 ve(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?pe(c):""}).filter(Boolean).join(" ");if(a)return a}let r=e.tagName.toLowerCase();if(r==="input"||r==="textarea"||r==="select"){let a=Vo(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 pe(a)}let i=pe(e);if(i)return i;let o=e.getAttribute("title");return o?o.trim():""}function pe(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(Yo(r))continue;let i=zo(r),o=pe(r);o&&(i&&t.length>0&&t.push(" "),t.push(o),i&&t.push(" "))}return t.join("").replace(/\s+/g," ").trim()}function Vo(e){if(e.id){let n=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(n)return pe(n)}let t=e.closest("label");if(t){let n=t.cloneNode(!0),r=n.querySelector("input, textarea, select");r&&r.remove();let i=n.textContent?.trim();if(i)return i}return null}function zo(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 Yo(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 kt(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 Ye(){M().networkIdle.activeRequests++}function Re(){let e=M().networkIdle;e.activeRequests=Math.max(0,e.activeRequests-1)}function dn(e=5e3,t=200){return new Promise((n,r)=>{let i=Date.now()+e,o=null;function a(){if(Date.now()>i){o&&clearTimeout(o),n();return}M().networkIdle.activeRequests===0?o||(o=setTimeout(()=>{M().networkIdle.activeRequests===0?n():(o=null,a())},t)):(o&&(clearTimeout(o),o=null),setTimeout(a,50))}a()})}function Se(){return M().snapshot.refMap}async function Ee(){return await dn(),Mt()}function Mt(){let e=M().snapshot;e.refCounter=0,e.refMap=new Map;let t=document.body;if(!t)return"(empty page)";let n=fn(t);return At(n,0).trimEnd()}function z(e){let t=me(e),n=ve(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 i=e.tagName.toLowerCase();return e.id?`${i}#${e.id}`:i}function fn(e){if(Go(e))return[];let t=me(e),n=!t&&un(e),r=t||(n?"clickable":null),i="";if(r){i=ve(e);let u=kt(e,"::before"),d=kt(e,"::after");(u||d)&&(i=[u,i,d].filter(Boolean).join(" ")),i.length>80&&(i=i.slice(0,77)+"...")}let o=Ko(e),a=t==="button"||t==="link"||t==="textbox"||t==="combobox"||t==="checkbox"||t==="radio"||t==="slider"||t==="tab"||t==="menuitem"||n,s=r&&i&&!a,c=null;if(a||s){let u=M().snapshot;u.refCounter++,c=`e${u.refCounter}`,u.refMap.set(c,e)}let l=Xo(e);if(r){let u=l.length===0?"":At(l,0).trim();return[{tag:r,name:i,attrs:o,ref:c,children:u&&u===i?[]:l,element:e}]}if(l.length===0){let u=pe(e);if(u)return[{tag:null,name:u.length>80?u.slice(0,77)+"...":u,attrs:[],ref:null,children:[],element:e}]}return l}function Xo(e){let t=[];for(let n of Array.from(e.childNodes))n.nodeType===Node.ELEMENT_NODE&&t.push(...fn(n));return t}function Go(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-overlay"||e.id==="__mindstudio-notes-cursor")return!0;try{let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden"&&n.position!=="static")return!0}catch{}return!1}function Ko(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 o=e;(o.type==="checkbox"||o.type==="radio")&&o.checked&&t.push("checked")}if(n==="input"){let o=e;o.type!=="checkbox"&&o.type!=="radio"&&o.type!=="hidden"&&o.type!=="submit"&&o.type!=="button"&&o.type!=="reset"&&(t.push(`value="${o.value}"`),o.placeholder&&t.push(`placeholder="${o.placeholder}"`))}if(n==="textarea"){let o=e;t.push(`value="${o.value}"`),o.placeholder&&t.push(`placeholder="${o.placeholder}"`)}if(n==="select"){let o=e,a=o.options[o.selectedIndex];a&&t.push(`value="${a.text}"`)}let r=n.match(/^h([1-6])$/);r&&t.push(`level=${r[1]}`);let i=e.getAttribute("aria-expanded");return i==="true"&&t.push("expanded"),i==="false"&&t.push("collapsed"),e.getAttribute("aria-selected")==="true"&&t.push("selected"),e.getAttribute("aria-pressed")==="true"&&t.push("pressed"),t}function At(e,t){let n="";for(let r of e)n+=Jo(r,t);return n}function Jo(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 i="";r.length>0&&(i+=`${n}${r.join(" ")}
|
|
2
|
-
`);let o=r.length>0?t+1:t;return i+=At(e.children,o),i}function mn(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 W(e){return new Promise(t=>setTimeout(t,e))}var Zo=["log","info","warn","error","debug"];function pn(){if(!console.__ms_patched){console.__ms_patched=!0;for(let e of Zo){let t=console[e];console[e]=(...n)=>{t&&t.apply(console,n),V({type:"console",level:e,args:n.map(mn),url:location.href})}}}}function hn(){window.addEventListener("error",e=>{St({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||{};St({type:"error",message:t.message||String(t),stack:t.stack||"",url:location.href})})}function gn(){if(!window.fetch||window.fetch.__ms_patched)return;let e=window.fetch;window.fetch=function(t,n){let r=(n?.method||"GET").toUpperCase(),i=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if(i.includes("/__mindstudio_dev__/"))return e.apply(this,[t,n]);let o=Date.now();return Ye(),e.apply(this,[t,n]).then(a=>{Re();let s={type:"network",method:r,url:i,status:a.status,statusText:a.statusText,duration:Date.now()-o,ok:a.ok};if(a.ok)V(s);else try{a.clone().text().then(c=>{s.body=c.slice(0,1e3),V(s)}).catch(()=>V(s))}catch{V(s)}return a},a=>{throw Re(),V({type:"network",method:r,url:i,error:a.message||String(a),duration:Date.now()-o,ok:!1}),a})},window.fetch.__ms_patched=!0}function yn(){document.__ms_click_patched||(document.__ms_click_patched=!0,document.addEventListener("click",e=>{let t=e.target,n=(t?.textContent||"").trim().slice(0,100);V({type:"interaction",event:"click",target:z(t),text:n,url:location.href})},!0))}function wn(){if(XMLHttpRequest.prototype.open.__ms_patched)return;let e=window.XMLHttpRequest,t=e.prototype.open,n=e.prototype.send;e.prototype.open=function(r,i,...o){return this.__ms_method=r.toUpperCase(),this.__ms_url=String(i),t.apply(this,[r,i,...o])},e.prototype.send=function(r){let i=this.__ms_method||"GET",o=this.__ms_url||"";if(o.includes("/__mindstudio_dev__/"))return n.apply(this,[r]);let a=Date.now();return Ye(),this.addEventListener("loadend",function(){Re(),V({type:"network",method:i,url:o,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"})}),n.apply(this,[r])},XMLHttpRequest.prototype.open.__ms_patched=!0}function oe(e){let t=null;if(e.ref){let n=Se(),r=n.get(e.ref);if(r&&r.isConnected)if(re(r))t={element:r,matched:`${z(r)} [ref=${e.ref}]`};else throw new Error(`Element [ref=${e.ref}] exists but is hidden (${$t(r)}). It may be inside a closed dialog or collapsed section.`);else{let i=[...n.entries()].filter(([,o])=>o.isConnected&&re(o)).slice(0,10).map(([o,a])=>`${z(a)} [ref=${o}]`).join(", ");throw new Error(`Element [ref=${e.ref}] not found. `+(i?`Available refs: ${i}`:"No refs available \u2014 take a snapshot first."))}}if(!t&&(e.text||e.role&&e.text)){let n=e.text,r=e.role,i=bn(n,r);if(i.length===0){let o=bn(n,r,!0);if(o.length>0)throw new Error(`Found ${r?r+" ":""}"${n}" but it is hidden (${$t(o[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=xn(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(i.length>1){let o=i.filter(vn),a=o.length===1?o[0]:i[0];t={element:a,matched:z(a)}}else t={element:i[0],matched:z(i[0])}}if(!t&&e.role&&!e.text){let n=e.role,r=Qo(n);if(r.length===0){let i=xn(n);throw new Error(`No visible element with role "${n}" found. `+(i?`Visible ${n}s: ${i}`:"The page may still be loading \u2014 try a wait command first."))}t={element:r[0],matched:z(r[0])}}if(!t&&e.label){let n=e.label,r=ei(n);if(!r){let i=[...document.querySelectorAll("label")].filter(re).map(o=>`"${(o.textContent||"").trim().slice(0,40)}"`).slice(0,8).join(", ");throw new Error(`No input found with label "${n}". `+(i?`Visible labels: ${i}`:"No labels found on the page."))}t={element:r,matched:`${z(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(!re(r))throw new Error(`Found element for selector "${n}" but it is hidden (${$t(r)}).`);t={element:r,matched:`${z(r)} via selector "${n}"`}}if(!t)throw new Error("No targeting field provided (need ref, text, role, label, or selector)");return t}function bn(e,t,n=!1){let r=[],i=e.toLowerCase();for(let o of document.querySelectorAll("*")){if(!n&&!re(o)||n&&!o.isConnected||t&&me(o)!==t)continue;if(ve(o).toLowerCase().includes(i)){r.push(o);continue}o.children.length||(o.textContent||"").trim().toLowerCase().includes(i)&&r.push(o)}return r}function Qo(e){let t=[];for(let n of document.querySelectorAll("*"))re(n)&&me(n)===e&&t.push(n);return t}function ei(e){let t=e.toLowerCase();for(let n of document.querySelectorAll("label")){if(!(n.textContent||"").trim().toLowerCase().includes(t))continue;let i=n.getAttribute("for");if(i){let a=document.getElementById(i);if(a&&re(a))return a}let o=n.querySelector("input, textarea, select");if(o&&re(o))return o}return null}function re(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 vn(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 $t(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 xn(e){let t=[];for(let n of document.querySelectorAll("*"))if(re(n)&&(e?me(n)===e&&t.push(n):vn(n)&&t.push(n),t.length>=10))break;return t.length===0?"":t.map(n=>`"${ve(n).slice(0,40)||z(n)}"`).join(", ")}function Lt(e){let t=e.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,i={bubbles:!0,cancelable:!0,clientX:n,clientY:r,button:0};e.dispatchEvent(new PointerEvent("pointerdown",{...i,pointerId:1})),e.dispatchEvent(new MouseEvent("mousedown",i)),e instanceof HTMLElement&&e.focus(),e.dispatchEvent(new PointerEvent("pointerup",{...i,pointerId:1})),e.dispatchEvent(new MouseEvent("mouseup",i)),e.dispatchEvent(new MouseEvent("click",i))}var ti=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set,ni=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value")?.set;async function Cn(e,t,n={}){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("type command requires an input or textarea element");e.focus(),Lt(e),n.clear&&(Sn(e,""),e.dispatchEvent(new Event("input",{bubbles:!0})));for(let r=0;r<t.length;r++){let i=t[r];e.dispatchEvent(new KeyboardEvent("keydown",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keypress",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),Sn(e,e.value+i),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keyup",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),await W(ri(i,t.length))}e.dispatchEvent(new Event("change",{bubbles:!0}))}function ri(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 i=Math.max(.1,20/t);return r*i}function Sn(e,t){let n=e instanceof HTMLTextAreaElement?ni:ti;n?n.call(e,t):e.value=t}async function kn(e){let t=e.timeout||5e3,n=Date.now(),r=n+t;for(;Date.now()<r;)try{return{...oe(e),elapsed:Date.now()-n}}catch{await W(100)}let i=e.text?`"${e.text}"`:e.role?`role "${e.role}"`:e.selector?`selector "${e.selector}"`:"element";throw new Error(`Timed out waiting for ${i} after ${t}ms`)}var En=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set;function Mn(e,t){if(!(e instanceof HTMLSelectElement))throw new Error("select command requires a <select> element");let n=t.toLowerCase(),r=null;for(let i of e.options)if(i.text.toLowerCase().includes(n)||i.value.toLowerCase()===n||i.label.toLowerCase().includes(n)){r=i;break}if(!r){let i=[...e.options].map(o=>`"${o.text}"`).join(", ");throw new Error(`No option matching "${t}" in select. Available options: ${i}`)}return En?En.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 An(e){try{let n=!/\b(return|;|\{)\b/.test(e.trim())?`return (${e})`:e,i=new Function(n)();return i instanceof Promise?await i:i}catch(t){throw new Error(`evaluate failed: ${t instanceof Error?t.message:String(t)}`)}}var ii=Object.defineProperty,j=(e,t)=>()=>(e&&(t=e(e=0)),t),He=(e,t)=>{for(var n in t)ii(e,n,{get:t[n],enumerable:!0})};function ai(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 li(e="soft"){switch(C.session.__counterEpoch=(C.session.__counterEpoch||0)+1,e){case"auto":{C.session.styleMap=new Map,C.session.nodeMap=new Map;return}case"soft":{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap,C.computedStyle=new WeakMap,C.baseStyle=new Y(50),C.defaultStyle=new Y(30),C.image=new Y(100),C.background=new Y(100),C.resource=new Y(150),C.font=new Set;return}default:{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap;return}}}var Y,C,G=j(()=>{Y=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)}},C={image:new Y(100),background:new Y(100),resource:new Y(150),defaultStyle:new Y(30),baseStyle:new Y(50),computedStyle:new WeakMap,measureHints:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function jt(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith("#")?null:n}function si(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function tt(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function ci(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 rt=j(()=>{});function ui(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(a,s,c){if(i>=n)return;let l=Date.now();(r.get(s)||0)>l||(r.set(s,l+t),i++,a==="warn"&&console&&console.warn?console.warn(`${e} ${c}`):console&&console.error&&console.error(`${e} ${c}`))}return{warnOnce(a,s){o("warn",a,s)},errorOnce(a,s){o("error",a,s)},reset(){r.clear(),i=0}}}function di(e){return/^data:|^blob:|^about:blank$/i.test(e)}function fi(e,t){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=t.includes("{url}")?t.split("{url}")[0]:t,i=new URL(r||".",n),o=new URL(e,n);if(o.origin===i.origin)return!0;let a=o.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function mi(e,t){if(!t||di(e)||fi(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 pi(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",tt(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}${tt(e)}`;let n=t.includes("?")?"&":"?";return`${t}${n}url=${encodeURIComponent(e)}`}function $n(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 hi(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function X(e,t={}){let n=t.as??"blob",r=t.timeout??3e3,i=t.useProxy||"",o=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[,p="",y=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],v=/;base64/i.test(p)?atob(y):decodeURIComponent(y),b=new Uint8Array([...v].map(S=>S.charCodeAt(0))),w=new Blob([b],{type:(p||"").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 p=await fetch(e);if(!p.ok)return{ok:!1,data:null,status:p.status,url:e,fromCache:!1,reason:"http_error"};let y=await p.blob(),v=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await $n(y),status:p.status,url:e,fromCache:!1,mime:v}:n==="text"?{ok:!0,data:await y.text(),status:p.status,url:e,fromCache:!1,mime:v}:{ok:!0,data:y,status:p.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=hi(e,{as:n,timeout:r,useProxy:i,errorTTL:o}),l=Pe.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&Pe.delete(c);let u=Ge.get(c);if(u)return u;let d=mi(e,i)?pi(e,i):e,f=t.credentials;if(!f)try{let p=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(e,p);f=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{f="omit"}let m=new AbortController,g=setTimeout(()=>m.abort("timeout"),r),h=(async()=>{try{let p=await fetch(d,{signal:m.signal,credentials:f,headers:a});if(!p.ok){let b={ok:!1,data:null,status:p.status,url:d,fromCache:!1,reason:"http_error"};if(o>0&&Pe.set(c,{until:Date.now()+o,result:b}),!s){let w=`${p.status} ${p.statusText||""}`.trim();Rt.warnOnce(`http:${p.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 p.text(),status:p.status,url:d,fromCache:!1};let y=await p.blob(),v=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await $n(y),status:p.status,url:d,fromCache:!1,mime:v}:{ok:!0,data:y,status:p.status,url:d,fromCache:!1,mime:v}}catch(p){let y=p&&typeof p=="object"&&"name"in p&&p.name==="AbortError"?String(p.message||"").includes("timeout")?"timeout":"abort":"network",v={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&o>0&&Pe.set(c,{until:Date.now()+o,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`;Rt.errorOnce(b,w)}return t.onError&&t.onError(v),v}finally{clearTimeout(g),Ge.delete(c)}})();return Ge.set(c,h),h}var Rt,Ge,Pe,$e=j(()=>{rt(),Rt=ui("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Ge=new Map,Pe=new Map});async function Zn(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let n=jt(e);if(!n)return e;let r=ci(n),i=tt(r);if(C.background.has(i)){let o=C.background.get(i);return o?`url("${o}")`:"none"}try{let o=await X(i,{as:"dataURL",useProxy:t.useProxy});return o.ok?(C.background.set(i,o.data),`url("${o.data}")`):(C.background.set(i,null),"none")}catch{return C.background.set(i,null),"none"}}var gi=j(()=>{G(),rt(),$e()});function yi(e){if(e=String(e).toLowerCase(),zt.has(e)){let o={};return C.defaultStyle.set(e,o),o}if(C.defaultStyle.has(e))return C.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),i={};for(let o of r){if(Vt(o))continue;let a=r.getPropertyValue(o);i[o]=a}return t.removeChild(n),C.defaultStyle.set(e,i),i}function Vt(e){let t=String(e).toLowerCase();return!!(nr.has(t)||tr.test(t)||er.test(t))}function _t(e,t){if(t=String(t||"").toLowerCase(),zt.has(t))return"";let n=[],r=yi(t),i=(e.display||"").toLowerCase()==="inline"||new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]).has(t);for(let[o,a]of Object.entries(e)){if(Vt(o)||i&&(o==="width"||o==="min-width"||o==="max-width"))continue;let s=r[o];a&&a!==s&&n.push(`${o}:${a}`)}return n.sort(),n.join(";")}function wi(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 bi(e){let t=new Map;for(let r of e){let i=C.defaultStyle.get(r);if(!i)continue;let o=Object.entries(i).map(([a,s])=>`${a}:${s};`).sort().join("");o&&(t.has(o)||t.set(o,[]),t.get(o).push(r))}let n="";for(let[r,i]of t.entries())n+=`${i.join(",")} { ${r} }
|
|
3
|
-
`;return n}function xi(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let i of t)n.set(i,`c${r++}`);return n}function vi(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 ae(e,t=null){let n=()=>{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(!(e instanceof Element)){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=C.computedStyle.get(e);r||(r=new Map,C.computedStyle.set(e,r));let i=r.get(t);if(!i){let o=vi(e),a=null;try{a=o&&typeof o.getComputedStyle=="function"?o.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}i=a||n(),r.set(t,i)}return i}function Ln(e){let t={};for(let n of e)t[n]=e.getPropertyValue(n);return t}function Pt(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}var Qn,zt,Si,er,tr,nr,rr=j(()=>{G(),Qn=new Set(["meta","script","noscript","title","link","template"]),zt=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"]),Si=["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"],er=/(?:^|-)(animation|transition)(?:-|$)/i,tr=/^(--.+|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,nr=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 Me(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Ei(){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 ge(){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),i=/mobile/i.test(e),o=!/safari/i.test(e),a=r&&i&&o,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 Ci(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var We=j(()=>{});function _(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 or=j(()=>{}),J=j(()=>{gi(),rr(),We(),rt(),or()}),ir={};He(ir,{toCanvas:()=>ot});function ki(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function Mi(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function Ai(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function $i(e){let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(t.push(n),n=""):n+=o}return n.trim()&&t.push(n),t.map(i=>i.trim()).filter(Boolean)}function Li(e){let t=[],n="",r=0;for(let o=0;o<e.length;o++){let a=e[o];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 i=[];for(let o of t){if(/\binset\b/i.test(o))continue;let a=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[s="0px",c="0px",l="0px"]=a,u=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!u&&u!==",";i.push(`drop-shadow(${s} ${c} ${l}${d?` ${u}`:""})`)}return i.join(" ")}function ar(e){let t=$i(e),n=null,r=null,i=null,o=[];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"?i=u:l==="filter"?n=u:l==="-webkit-filter"?r=u:o.push([l,u])}if(i){let s=Li(i);s&&(n=n?`${n} ${s}`:s,r=r?`${r} ${s}`:s)}let a=[...o];return n&&a.push(["filter",n]),r&&a.push(["-webkit-filter",r]),a.map(([s,c])=>`${s}:${c}`).join(";")}function Ni(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,n,r)=>`${n}{${ar(r)}}`)}function Ti(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,n)=>t.replace(n,Ni(n))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,n,r)=>`style=${n}${ar(r)}${n}`),e}function Ri(e){if(!ge()||!ki(e))return e;try{let t=Mi(e),n=Ti(t);return Ai(n)}catch{return e}}async function ot(e,t){let{width:n,height:r,scale:i=1,dpr:o=1,meta:a={},backgroundColor:s}=t;e=Ri(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,g,h=Number.isFinite(n),p=Number.isFinite(r);if(h&&p)m=Math.max(1,n),g=Math.max(1,r);else if(h){let b=n/Math.max(1,d);m=n,g=f*b}else if(p){let b=r/Math.max(1,f);g=r,m=d*b}else m=l,g=u;m=m*i,g=g*i;let y=document.createElement("canvas");y.width=m*o,y.height=g*o,y.style.width=`${m}px`,y.style.height=`${g}px`;let v=y.getContext("2d");return o!==1&&v.scale(o,o),s&&(v.save(),v.fillStyle=s,v.fillRect(0,0,m,g),v.restore()),v.drawImage(c,0,0,m,g),y}var it=j(()=>{We()}),Ke={};He(Ke,{rasterize:()=>lr});async function lr(e,t){let n=await ot(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 Je=j(()=>{it()}),Ft={};He(Ft,{toImg:()=>Nn,toSvg:()=>Nn});async function Nn(e,t){let{scale:n=1,width:r,height:i,meta:o={}}=t,a=Number.isFinite(r),s=Number.isFinite(i),c=Number.isFinite(n)&&n!==1||a||s;if(ge()&&c)return await lr(e,{...t,format:"png",quality:1,meta:o});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=`${i}px`;else if(a){let u=Number.isFinite(o.w0)?o.w0:l.naturalWidth,d=Number.isFinite(o.h0)?o.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(o.w0)?o.w0:l.naturalWidth,d=Number.isFinite(o.h0)?o.h0:l.naturalHeight,f=i/Math.max(1,d);l.style.height=`${i}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){_(t,"SVG width/height patch in toImg failed",f)}}return l}var Tn=j(()=>{J(),Je()}),sr={};He(sr,{toBlob:()=>cr});async function cr(e,t){let n=t.type;if(n==="svg"){let i=decodeURIComponent(e.split(",")[1]);return new Blob([i],{type:"image/svg+xml"})}let r=await ot(e,t);return new Promise(i=>r.toBlob(o=>i(o),`image/${n}`,t.quality))}var ur=j(()=>{it()}),dr={};He(dr,{download:()=>_i});async function Rn(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 _i(e,t){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(t?.type||"").toLowerCase(),i=n.has(r)?r:"",o=(t?.format||i||"").toLowerCase(),a=o==="jpg"?"jpeg":o||"png",s=t?.filename||`snapdom.${a}`,c={...t||{},format:a,type:a};c.dpr=1;let l=Ei();if(a==="svg"){let f=await cr(e,{...c,type:"svg"});if(l&&await Rn(f,s))return;let m=URL.createObjectURL(f),g=document.createElement("a");g.href=m,g.download=s,document.body.appendChild(g),g.click(),URL.revokeObjectURL(m),g.remove();return}let u=await ot(e,c);if(l){let f=`image/${a}`,m=await new Promise(g=>u.toBlob(g,f,t?.quality));if(m&&await Rn(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 Pi=j(()=>{ur(),it(),We()});J();J();G();var _n=new WeakMap,Ie=new Map,Fi=2e3,Dt=0;function Fe(){Dt++,Ie.size>Fi&&Ie.clear()}var Pn=!1;function Di(e=document.documentElement){if(!Pn){Pn=!0;try{new MutationObserver(()=>Fe()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>Fe()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",Fe),t.ready?.then(()=>Fe()).catch(()=>{}))}catch{}}}function Ii(e,t={}){let n={},r=e.getPropertyValue("visibility"),i=t.excludeStyleProps;for(let d=0;d<e.length;d++){let f=e[d];if(Vt(f)||i&&(i instanceof RegExp&&i.test(f)||typeof i=="function"&&i(f)))continue;let m=e.getPropertyValue(f);(f==="background-image"||f==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),n[f]=m}let o=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let d of o)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 g of m)delete n[g];f||(n.border="none")}return n}var Fn=new WeakMap;function Oi(e){let t=Fn.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(";"),Fn.set(e,t),t)}function Hi(e,t=null,n={}){let r=_n.get(e);if(r&&r.epoch===Dt)return r.snapshot;let i=t||getComputedStyle(e),o=Ii(i,n);return zi(e,i,o),_n.set(e,{epoch:Dt,snapshot:o}),o}function Wi(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Ie,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:t||{}}:{session:C.session,persist:{snapshotKeyCache:Ie,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:e||t||{}}}function Bi(e,t,n){if(!(!e.style||e.style.length===0))for(let r=0;r<e.style.length;r++){let i=e.style[r],o=n.getPropertyValue(i);o&&t.style.setProperty(i,o)}}async function he(e,t,n,r){if(e.tagName==="STYLE")return;let i=Wi(n,r),o=i.options&&i.options.cache||"auto";o!=="disabled"&&Di(document.documentElement),o==="disabled"&&!i.session.__bumpedForDisabled&&(Fe(),Ie.clear(),i.session.__bumpedForDisabled=!0);let{session:a,persist:s}=i;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")&&Bi(e,t,c);let l=Hi(e,c,i.options),u=Oi(l),d=s.snapshotKeyCache.get(u);if(!d){let f=e.tagName?.toLowerCase()||"div";d=_t(l,f),s.snapshotKeyCache.set(u,d)}a.styleMap.set(t,d)}function Ui(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function qi(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 ji(e){let t=e.parentElement;if(!t)return!1;let n=getComputedStyle(t).display||"";return n.includes("flex")||n.includes("grid")}function Vi(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 i=e.scrollHeight;if(i===0)return!1;let o=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingBottom)||0;return i>o+a}function zi(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 i=parseFloat(t.height);if(Number.isFinite(i)&&e.scrollHeight>0&&Math.abs(i-e.scrollHeight)>2||t.aspectRatio&&t.aspectRatio!=="none"&&t.aspectRatio!=="auto")return;let o=t.display||"";if(o.includes("flex")||o.includes("grid")||Ui(e))return;let a=t.position;if(a==="absolute"||a==="fixed"||a==="sticky"||t.transform!=="none"||qi(t)||ji(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"||Vi(e,t)&&(delete n.height,delete n["block-size"])}rr();var fr=["fill","stroke","color","background-color","stop-color"],Dn=new Map;function Yi(e,t){let n=t+"::"+e.toLowerCase(),r=Dn.get(n);if(r)return r;let i=document,o=t==="http://www.w3.org/2000/svg"?i.createElementNS(t,e):i.createElement(e),a=i.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(o),i.documentElement.appendChild(a);let s=getComputedStyle(o),c={};for(let l of fr)c[l]=s.getPropertyValue(l)||"";return a.remove(),Dn.set(n,c),c}function Xi(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 o=e.attributes;for(let a=0;a<o.length;a++){let s=o[a];if(s&&typeof s.value=="string"&&s.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(e)}catch{}if(r){let o=e.style;if(o&&o.length){let a=new Set;for(let s=0;s<o.length;s++){let c=o[s];if(a.has(c))continue;a.add(c);let l=o.getPropertyValue(c);if(!l||!l.includes("var("))continue;let u=i&&i.getPropertyValue(c);if(u)try{t.style.setProperty(c,u.trim(),o.getPropertyPriority(c))}catch{}}}}if(r&&e.attributes?.length){let o=e.attributes;for(let a=0;a<o.length;a++){let s=o[a];if(!s||typeof s.value!="string"||!s.value.includes("var("))continue;let c=s.name,l=i&&i.getPropertyValue(c);if(l)try{t.style.setProperty(c,l.trim())}catch{}}}if(!r){if(!i)try{i=getComputedStyle(e)}catch{i=null}if(!i)return;let o=e.namespaceURI||"html",a=Yi(e.tagName,o);for(let s of fr){let c=i.getPropertyValue(s)||"",l=a[s]||"";if(c&&c!==l)try{t.style.setProperty(s,c.trim())}catch{}}}}J();J();G();$e();function Nt(e,t,n){return Promise.all(e.map(r=>new Promise(i=>{function o(){Me(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(r,i):o()},{fast:n})}o()})))}function Gi(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function Ki(e,t,n=!0){return e.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let i=n?Gi(r):r;return`:where(${t} ${i})`}).join(", ")}function Ji(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,i,o)=>{let a=Ki(o,t,!0);return`${r}${i}${a}{`}),e):""}function Zi(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function Qi(e){let t="";try{e.querySelectorAll("style").forEach(r=>{t+=(r.textContent||"")+`
|
|
2
|
+
`);let o=r.length>0?t+1:t;return i+=At(e.children,o),i}function mn(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 W(e){return new Promise(t=>setTimeout(t,e))}var Zo=["log","info","warn","error","debug"];function pn(){if(!console.__ms_patched){console.__ms_patched=!0;for(let e of Zo){let t=console[e];console[e]=(...n)=>{t&&t.apply(console,n),V({type:"console",level:e,args:n.map(mn),url:location.href})}}}}function hn(){window.addEventListener("error",e=>{St({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||{};St({type:"error",message:t.message||String(t),stack:t.stack||"",url:location.href})})}function gn(){if(!window.fetch||window.fetch.__ms_patched)return;let e=window.fetch;window.fetch=function(t,n){let r=(n?.method||"GET").toUpperCase(),i=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if(i.includes("/__mindstudio_dev__/"))return e.apply(this,[t,n]);let o=Date.now();return Ye(),e.apply(this,[t,n]).then(a=>{Re();let s={type:"network",method:r,url:i,status:a.status,statusText:a.statusText,duration:Date.now()-o,ok:a.ok};if(a.ok)V(s);else try{a.clone().text().then(c=>{s.body=c.slice(0,1e3),V(s)}).catch(()=>V(s))}catch{V(s)}return a},a=>{throw Re(),V({type:"network",method:r,url:i,error:a.message||String(a),duration:Date.now()-o,ok:!1}),a})},window.fetch.__ms_patched=!0}function yn(){document.__ms_click_patched||(document.__ms_click_patched=!0,document.addEventListener("click",e=>{let t=e.target,n=(t?.textContent||"").trim().slice(0,100);V({type:"interaction",event:"click",target:z(t),text:n,url:location.href})},!0))}function wn(){if(XMLHttpRequest.prototype.open.__ms_patched)return;let e=window.XMLHttpRequest,t=e.prototype.open,n=e.prototype.send;e.prototype.open=function(r,i,...o){return this.__ms_method=r.toUpperCase(),this.__ms_url=String(i),t.apply(this,[r,i,...o])},e.prototype.send=function(r){let i=this.__ms_method||"GET",o=this.__ms_url||"";if(o.includes("/__mindstudio_dev__/"))return n.apply(this,[r]);let a=Date.now();return Ye(),this.addEventListener("loadend",function(){Re(),V({type:"network",method:i,url:o,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"})}),n.apply(this,[r])},XMLHttpRequest.prototype.open.__ms_patched=!0}function oe(e){let t=null;if(e.ref){let n=Se(),r=n.get(e.ref);if(r&&r.isConnected)if(re(r))t={element:r,matched:`${z(r)} [ref=${e.ref}]`};else throw new Error(`Element [ref=${e.ref}] exists but is hidden (${$t(r)}). It may be inside a closed dialog or collapsed section.`);else{let i=[...n.entries()].filter(([,o])=>o.isConnected&&re(o)).slice(0,10).map(([o,a])=>`${z(a)} [ref=${o}]`).join(", ");throw new Error(`Element [ref=${e.ref}] not found. `+(i?`Available refs: ${i}`:"No refs available \u2014 take a snapshot first."))}}if(!t&&(e.text||e.role&&e.text)){let n=e.text,r=e.role,i=bn(n,r);if(i.length===0){let o=bn(n,r,!0);if(o.length>0)throw new Error(`Found ${r?r+" ":""}"${n}" but it is hidden (${$t(o[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=xn(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(i.length>1){let o=i.filter(vn),a=o.length===1?o[0]:i[0];t={element:a,matched:z(a)}}else t={element:i[0],matched:z(i[0])}}if(!t&&e.role&&!e.text){let n=e.role,r=Qo(n);if(r.length===0){let i=xn(n);throw new Error(`No visible element with role "${n}" found. `+(i?`Visible ${n}s: ${i}`:"The page may still be loading \u2014 try a wait command first."))}t={element:r[0],matched:z(r[0])}}if(!t&&e.label){let n=e.label,r=ei(n);if(!r){let i=[...document.querySelectorAll("label")].filter(re).map(o=>`"${(o.textContent||"").trim().slice(0,40)}"`).slice(0,8).join(", ");throw new Error(`No input found with label "${n}". `+(i?`Visible labels: ${i}`:"No labels found on the page."))}t={element:r,matched:`${z(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(!re(r))throw new Error(`Found element for selector "${n}" but it is hidden (${$t(r)}).`);t={element:r,matched:`${z(r)} via selector "${n}"`}}if(!t)throw new Error("No targeting field provided (need ref, text, role, label, or selector)");return t}function bn(e,t,n=!1){let r=[],i=e.toLowerCase();for(let o of document.querySelectorAll("*")){if(!n&&!re(o)||n&&!o.isConnected||t&&me(o)!==t)continue;if(ve(o).toLowerCase().includes(i)){r.push(o);continue}o.children.length||(o.textContent||"").trim().toLowerCase().includes(i)&&r.push(o)}return r}function Qo(e){let t=[];for(let n of document.querySelectorAll("*"))re(n)&&me(n)===e&&t.push(n);return t}function ei(e){let t=e.toLowerCase();for(let n of document.querySelectorAll("label")){if(!(n.textContent||"").trim().toLowerCase().includes(t))continue;let i=n.getAttribute("for");if(i){let a=document.getElementById(i);if(a&&re(a))return a}let o=n.querySelector("input, textarea, select");if(o&&re(o))return o}return null}function re(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 vn(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 $t(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 xn(e){let t=[];for(let n of document.querySelectorAll("*"))if(re(n)&&(e?me(n)===e&&t.push(n):vn(n)&&t.push(n),t.length>=10))break;return t.length===0?"":t.map(n=>`"${ve(n).slice(0,40)||z(n)}"`).join(", ")}function Lt(e){let t=e.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,i={bubbles:!0,cancelable:!0,clientX:n,clientY:r,button:0};e.dispatchEvent(new PointerEvent("pointerdown",{...i,pointerId:1})),e.dispatchEvent(new MouseEvent("mousedown",i)),e instanceof HTMLElement&&e.focus(),e.dispatchEvent(new PointerEvent("pointerup",{...i,pointerId:1})),e.dispatchEvent(new MouseEvent("mouseup",i)),e.dispatchEvent(new MouseEvent("click",i))}var ti=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set,ni=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value")?.set;async function Cn(e,t,n={}){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("type command requires an input or textarea element");e.focus(),Lt(e),n.clear&&(Sn(e,""),e.dispatchEvent(new Event("input",{bubbles:!0})));for(let r=0;r<t.length;r++){let i=t[r];e.dispatchEvent(new KeyboardEvent("keydown",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keypress",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),Sn(e,e.value+i),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keyup",{key:i,code:`Key${i.toUpperCase()}`,bubbles:!0})),await W(ri(i,t.length))}e.dispatchEvent(new Event("change",{bubbles:!0}))}function ri(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 i=Math.max(.1,20/t);return r*i}function Sn(e,t){let n=e instanceof HTMLTextAreaElement?ni:ti;n?n.call(e,t):e.value=t}async function kn(e){let t=e.timeout||5e3,n=Date.now(),r=n+t;for(;Date.now()<r;)try{return{...oe(e),elapsed:Date.now()-n}}catch{await W(100)}let i=e.text?`"${e.text}"`:e.role?`role "${e.role}"`:e.selector?`selector "${e.selector}"`:"element";throw new Error(`Timed out waiting for ${i} after ${t}ms`)}var En=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set;function Mn(e,t){if(!(e instanceof HTMLSelectElement))throw new Error("select command requires a <select> element");let n=t.toLowerCase(),r=null;for(let i of e.options)if(i.text.toLowerCase().includes(n)||i.value.toLowerCase()===n||i.label.toLowerCase().includes(n)){r=i;break}if(!r){let i=[...e.options].map(o=>`"${o.text}"`).join(", ");throw new Error(`No option matching "${t}" in select. Available options: ${i}`)}return En?En.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 An(e){try{let n=!/\b(return|;|\{)\b/.test(e.trim())?`return (${e})`:e,i=new Function(n)();return i instanceof Promise?await i:i}catch(t){throw new Error(`evaluate failed: ${t instanceof Error?t.message:String(t)}`)}}var ii=Object.defineProperty,j=(e,t)=>()=>(e&&(t=e(e=0)),t),He=(e,t)=>{for(var n in t)ii(e,n,{get:t[n],enumerable:!0})};function ai(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 li(e="soft"){switch(C.session.__counterEpoch=(C.session.__counterEpoch||0)+1,e){case"auto":{C.session.styleMap=new Map,C.session.nodeMap=new Map;return}case"soft":{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap,C.computedStyle=new WeakMap,C.baseStyle=new Y(50),C.defaultStyle=new Y(30),C.image=new Y(100),C.background=new Y(100),C.resource=new Y(150),C.font=new Set;return}default:{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap;return}}}var Y,C,G=j(()=>{Y=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)}},C={image:new Y(100),background:new Y(100),resource:new Y(150),defaultStyle:new Y(30),baseStyle:new Y(50),computedStyle:new WeakMap,measureHints:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function jt(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith("#")?null:n}function si(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function tt(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function ci(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 rt=j(()=>{});function ui(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(a,s,c){if(i>=n)return;let l=Date.now();(r.get(s)||0)>l||(r.set(s,l+t),i++,a==="warn"&&console&&console.warn?console.warn(`${e} ${c}`):console&&console.error&&console.error(`${e} ${c}`))}return{warnOnce(a,s){o("warn",a,s)},errorOnce(a,s){o("error",a,s)},reset(){r.clear(),i=0}}}function di(e){return/^data:|^blob:|^about:blank$/i.test(e)}function fi(e,t){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=t.includes("{url}")?t.split("{url}")[0]:t,i=new URL(r||".",n),o=new URL(e,n);if(o.origin===i.origin)return!0;let a=o.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function mi(e,t){if(!t||di(e)||fi(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 pi(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",tt(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}${tt(e)}`;let n=t.includes("?")?"&":"?";return`${t}${n}url=${encodeURIComponent(e)}`}function $n(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 hi(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function X(e,t={}){let n=t.as??"blob",r=t.timeout??3e3,i=t.useProxy||"",o=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[,p="",y=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],v=/;base64/i.test(p)?atob(y):decodeURIComponent(y),x=new Uint8Array([...v].map(S=>S.charCodeAt(0))),w=new Blob([x],{type:(p||"").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 p=await fetch(e);if(!p.ok)return{ok:!1,data:null,status:p.status,url:e,fromCache:!1,reason:"http_error"};let y=await p.blob(),v=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await $n(y),status:p.status,url:e,fromCache:!1,mime:v}:n==="text"?{ok:!0,data:await y.text(),status:p.status,url:e,fromCache:!1,mime:v}:{ok:!0,data:y,status:p.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=hi(e,{as:n,timeout:r,useProxy:i,errorTTL:o}),l=Pe.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&Pe.delete(c);let u=Ge.get(c);if(u)return u;let d=mi(e,i)?pi(e,i):e,f=t.credentials;if(!f)try{let p=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(e,p);f=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{f="omit"}let m=new AbortController,g=setTimeout(()=>m.abort("timeout"),r),h=(async()=>{try{let p=await fetch(d,{signal:m.signal,credentials:f,headers:a});if(!p.ok){let x={ok:!1,data:null,status:p.status,url:d,fromCache:!1,reason:"http_error"};if(o>0&&Pe.set(c,{until:Date.now()+o,result:x}),!s){let w=`${p.status} ${p.statusText||""}`.trim();Rt.warnOnce(`http:${p.status}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${w} while fetching ${n} ${e}`)}return t.onError&&t.onError(x),x}if(n==="text")return{ok:!0,data:await p.text(),status:p.status,url:d,fromCache:!1};let y=await p.blob(),v=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await $n(y),status:p.status,url:d,fromCache:!1,mime:v}:{ok:!0,data:y,status:p.status,url:d,fromCache:!1,mime:v}}catch(p){let y=p&&typeof p=="object"&&"name"in p&&p.name==="AbortError"?String(p.message||"").includes("timeout")?"timeout":"abort":"network",v={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&o>0&&Pe.set(c,{until:Date.now()+o,result:v}),!s){let x=`${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`;Rt.errorOnce(x,w)}return t.onError&&t.onError(v),v}finally{clearTimeout(g),Ge.delete(c)}})();return Ge.set(c,h),h}var Rt,Ge,Pe,$e=j(()=>{rt(),Rt=ui("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Ge=new Map,Pe=new Map});async function Zn(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let n=jt(e);if(!n)return e;let r=ci(n),i=tt(r);if(C.background.has(i)){let o=C.background.get(i);return o?`url("${o}")`:"none"}try{let o=await X(i,{as:"dataURL",useProxy:t.useProxy});return o.ok?(C.background.set(i,o.data),`url("${o.data}")`):(C.background.set(i,null),"none")}catch{return C.background.set(i,null),"none"}}var gi=j(()=>{G(),rt(),$e()});function yi(e){if(e=String(e).toLowerCase(),zt.has(e)){let o={};return C.defaultStyle.set(e,o),o}if(C.defaultStyle.has(e))return C.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),i={};for(let o of r){if(Vt(o))continue;let a=r.getPropertyValue(o);i[o]=a}return t.removeChild(n),C.defaultStyle.set(e,i),i}function Vt(e){let t=String(e).toLowerCase();return!!(nr.has(t)||tr.test(t)||er.test(t))}function _t(e,t){if(t=String(t||"").toLowerCase(),zt.has(t))return"";let n=[],r=yi(t),i=(e.display||"").toLowerCase()==="inline"||new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]).has(t);for(let[o,a]of Object.entries(e)){if(Vt(o)||i&&(o==="width"||o==="min-width"||o==="max-width"))continue;let s=r[o];a&&a!==s&&n.push(`${o}:${a}`)}return n.sort(),n.join(";")}function wi(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 bi(e){let t=new Map;for(let r of e){let i=C.defaultStyle.get(r);if(!i)continue;let o=Object.entries(i).map(([a,s])=>`${a}:${s};`).sort().join("");o&&(t.has(o)||t.set(o,[]),t.get(o).push(r))}let n="";for(let[r,i]of t.entries())n+=`${i.join(",")} { ${r} }
|
|
3
|
+
`;return n}function xi(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let i of t)n.set(i,`c${r++}`);return n}function vi(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 ae(e,t=null){let n=()=>{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(!(e instanceof Element)){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=C.computedStyle.get(e);r||(r=new Map,C.computedStyle.set(e,r));let i=r.get(t);if(!i){let o=vi(e),a=null;try{a=o&&typeof o.getComputedStyle=="function"?o.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}i=a||n(),r.set(t,i)}return i}function Ln(e){let t={};for(let n of e)t[n]=e.getPropertyValue(n);return t}function Pt(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}var Qn,zt,Si,er,tr,nr,rr=j(()=>{G(),Qn=new Set(["meta","script","noscript","title","link","template"]),zt=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"]),Si=["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"],er=/(?:^|-)(animation|transition)(?:-|$)/i,tr=/^(--.+|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,nr=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 Me(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Ei(){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 ge(){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),i=/mobile/i.test(e),o=!/safari/i.test(e),a=r&&i&&o,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 Ci(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var We=j(()=>{});function _(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 or=j(()=>{}),J=j(()=>{gi(),rr(),We(),rt(),or()}),ir={};He(ir,{toCanvas:()=>ot});function ki(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function Mi(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function Ai(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function $i(e){let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(t.push(n),n=""):n+=o}return n.trim()&&t.push(n),t.map(i=>i.trim()).filter(Boolean)}function Li(e){let t=[],n="",r=0;for(let o=0;o<e.length;o++){let a=e[o];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 i=[];for(let o of t){if(/\binset\b/i.test(o))continue;let a=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[s="0px",c="0px",l="0px"]=a,u=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!u&&u!==",";i.push(`drop-shadow(${s} ${c} ${l}${d?` ${u}`:""})`)}return i.join(" ")}function ar(e){let t=$i(e),n=null,r=null,i=null,o=[];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"?i=u:l==="filter"?n=u:l==="-webkit-filter"?r=u:o.push([l,u])}if(i){let s=Li(i);s&&(n=n?`${n} ${s}`:s,r=r?`${r} ${s}`:s)}let a=[...o];return n&&a.push(["filter",n]),r&&a.push(["-webkit-filter",r]),a.map(([s,c])=>`${s}:${c}`).join(";")}function Ni(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,n,r)=>`${n}{${ar(r)}}`)}function Ti(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,n)=>t.replace(n,Ni(n))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,n,r)=>`style=${n}${ar(r)}${n}`),e}function Ri(e){if(!ge()||!ki(e))return e;try{let t=Mi(e),n=Ti(t);return Ai(n)}catch{return e}}async function ot(e,t){let{width:n,height:r,scale:i=1,dpr:o=1,meta:a={},backgroundColor:s}=t;e=Ri(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,g,h=Number.isFinite(n),p=Number.isFinite(r);if(h&&p)m=Math.max(1,n),g=Math.max(1,r);else if(h){let x=n/Math.max(1,d);m=n,g=f*x}else if(p){let x=r/Math.max(1,f);g=r,m=d*x}else m=l,g=u;m=m*i,g=g*i;let y=document.createElement("canvas");y.width=m*o,y.height=g*o,y.style.width=`${m}px`,y.style.height=`${g}px`;let v=y.getContext("2d");return o!==1&&v.scale(o,o),s&&(v.save(),v.fillStyle=s,v.fillRect(0,0,m,g),v.restore()),v.drawImage(c,0,0,m,g),y}var it=j(()=>{We()}),Ke={};He(Ke,{rasterize:()=>lr});async function lr(e,t){let n=await ot(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 Je=j(()=>{it()}),Ft={};He(Ft,{toImg:()=>Nn,toSvg:()=>Nn});async function Nn(e,t){let{scale:n=1,width:r,height:i,meta:o={}}=t,a=Number.isFinite(r),s=Number.isFinite(i),c=Number.isFinite(n)&&n!==1||a||s;if(ge()&&c)return await lr(e,{...t,format:"png",quality:1,meta:o});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=`${i}px`;else if(a){let u=Number.isFinite(o.w0)?o.w0:l.naturalWidth,d=Number.isFinite(o.h0)?o.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(o.w0)?o.w0:l.naturalWidth,d=Number.isFinite(o.h0)?o.h0:l.naturalHeight,f=i/Math.max(1,d);l.style.height=`${i}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){_(t,"SVG width/height patch in toImg failed",f)}}return l}var Tn=j(()=>{J(),Je()}),sr={};He(sr,{toBlob:()=>cr});async function cr(e,t){let n=t.type;if(n==="svg"){let i=decodeURIComponent(e.split(",")[1]);return new Blob([i],{type:"image/svg+xml"})}let r=await ot(e,t);return new Promise(i=>r.toBlob(o=>i(o),`image/${n}`,t.quality))}var ur=j(()=>{it()}),dr={};He(dr,{download:()=>_i});async function Rn(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 _i(e,t){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(t?.type||"").toLowerCase(),i=n.has(r)?r:"",o=(t?.format||i||"").toLowerCase(),a=o==="jpg"?"jpeg":o||"png",s=t?.filename||`snapdom.${a}`,c={...t||{},format:a,type:a};c.dpr=1;let l=Ei();if(a==="svg"){let f=await cr(e,{...c,type:"svg"});if(l&&await Rn(f,s))return;let m=URL.createObjectURL(f),g=document.createElement("a");g.href=m,g.download=s,document.body.appendChild(g),g.click(),URL.revokeObjectURL(m),g.remove();return}let u=await ot(e,c);if(l){let f=`image/${a}`,m=await new Promise(g=>u.toBlob(g,f,t?.quality));if(m&&await Rn(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 Pi=j(()=>{ur(),it(),We()});J();J();G();var _n=new WeakMap,Ie=new Map,Fi=2e3,Dt=0;function Fe(){Dt++,Ie.size>Fi&&Ie.clear()}var Pn=!1;function Di(e=document.documentElement){if(!Pn){Pn=!0;try{new MutationObserver(()=>Fe()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>Fe()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",Fe),t.ready?.then(()=>Fe()).catch(()=>{}))}catch{}}}function Ii(e,t={}){let n={},r=e.getPropertyValue("visibility"),i=t.excludeStyleProps;for(let d=0;d<e.length;d++){let f=e[d];if(Vt(f)||i&&(i instanceof RegExp&&i.test(f)||typeof i=="function"&&i(f)))continue;let m=e.getPropertyValue(f);(f==="background-image"||f==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),n[f]=m}let o=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let d of o)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 g of m)delete n[g];f||(n.border="none")}return n}var Fn=new WeakMap;function Oi(e){let t=Fn.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(";"),Fn.set(e,t),t)}function Hi(e,t=null,n={}){let r=_n.get(e);if(r&&r.epoch===Dt)return r.snapshot;let i=t||getComputedStyle(e),o=Ii(i,n);return zi(e,i,o),_n.set(e,{epoch:Dt,snapshot:o}),o}function Wi(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Ie,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:t||{}}:{session:C.session,persist:{snapshotKeyCache:Ie,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:e||t||{}}}function Bi(e,t,n){if(!(!e.style||e.style.length===0))for(let r=0;r<e.style.length;r++){let i=e.style[r],o=n.getPropertyValue(i);o&&t.style.setProperty(i,o)}}async function he(e,t,n,r){if(e.tagName==="STYLE")return;let i=Wi(n,r),o=i.options&&i.options.cache||"auto";o!=="disabled"&&Di(document.documentElement),o==="disabled"&&!i.session.__bumpedForDisabled&&(Fe(),Ie.clear(),i.session.__bumpedForDisabled=!0);let{session:a,persist:s}=i;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")&&Bi(e,t,c);let l=Hi(e,c,i.options),u=Oi(l),d=s.snapshotKeyCache.get(u);if(!d){let f=e.tagName?.toLowerCase()||"div";d=_t(l,f),s.snapshotKeyCache.set(u,d)}a.styleMap.set(t,d)}function Ui(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function qi(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 ji(e){let t=e.parentElement;if(!t)return!1;let n=getComputedStyle(t).display||"";return n.includes("flex")||n.includes("grid")}function Vi(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 i=e.scrollHeight;if(i===0)return!1;let o=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingBottom)||0;return i>o+a}function zi(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 i=parseFloat(t.height);if(Number.isFinite(i)&&e.scrollHeight>0&&Math.abs(i-e.scrollHeight)>2||t.aspectRatio&&t.aspectRatio!=="none"&&t.aspectRatio!=="auto")return;let o=t.display||"";if(o.includes("flex")||o.includes("grid")||Ui(e))return;let a=t.position;if(a==="absolute"||a==="fixed"||a==="sticky"||t.transform!=="none"||qi(t)||ji(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"||Vi(e,t)&&(delete n.height,delete n["block-size"])}rr();var fr=["fill","stroke","color","background-color","stop-color"],Dn=new Map;function Yi(e,t){let n=t+"::"+e.toLowerCase(),r=Dn.get(n);if(r)return r;let i=document,o=t==="http://www.w3.org/2000/svg"?i.createElementNS(t,e):i.createElement(e),a=i.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(o),i.documentElement.appendChild(a);let s=getComputedStyle(o),c={};for(let l of fr)c[l]=s.getPropertyValue(l)||"";return a.remove(),Dn.set(n,c),c}function Xi(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 o=e.attributes;for(let a=0;a<o.length;a++){let s=o[a];if(s&&typeof s.value=="string"&&s.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(e)}catch{}if(r){let o=e.style;if(o&&o.length){let a=new Set;for(let s=0;s<o.length;s++){let c=o[s];if(a.has(c))continue;a.add(c);let l=o.getPropertyValue(c);if(!l||!l.includes("var("))continue;let u=i&&i.getPropertyValue(c);if(u)try{t.style.setProperty(c,u.trim(),o.getPropertyPriority(c))}catch{}}}}if(r&&e.attributes?.length){let o=e.attributes;for(let a=0;a<o.length;a++){let s=o[a];if(!s||typeof s.value!="string"||!s.value.includes("var("))continue;let c=s.name,l=i&&i.getPropertyValue(c);if(l)try{t.style.setProperty(c,l.trim())}catch{}}}if(!r){if(!i)try{i=getComputedStyle(e)}catch{i=null}if(!i)return;let o=e.namespaceURI||"html",a=Yi(e.tagName,o);for(let s of fr){let c=i.getPropertyValue(s)||"",l=a[s]||"";if(c&&c!==l)try{t.style.setProperty(s,c.trim())}catch{}}}}J();J();G();$e();function Nt(e,t,n){return Promise.all(e.map(r=>new Promise(i=>{function o(){Me(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(r,i):o()},{fast:n})}o()})))}function Gi(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function Ki(e,t,n=!0){return e.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let i=n?Gi(r):r;return`:where(${t} ${i})`}).join(", ")}function Ji(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,i,o)=>{let a=Ki(o,t,!0);return`${r}${i}${a}{`}),e):""}function Zi(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function Qi(e){let t="";try{e.querySelectorAll("style").forEach(r=>{t+=(r.textContent||"")+`
|
|
4
4
|
`});let n=e.adoptedStyleSheets||[];for(let r of n)try{if(r&&r.cssRules)for(let i of r.cssRules)t+=i.cssText+`
|
|
5
5
|
`}catch{}}catch{}return t}function ea(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 ta(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 na(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 ra(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 oa(e,t,n){let r=[];for(let i of t){let o=ra(e,i);o&&r.push(`${i}: ${o};`)}return r.length?`${n}{${r.join("")}}
|
|
6
|
-
`:""}function ia(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 aa(e,t=3){let n=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<t&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function la(e){let t=e.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let c=getComputedStyle(e);n=parseFloat(c.borderLeftWidth)||0,r=parseFloat(c.borderRightWidth)||0,i=parseFloat(c.borderTopWidth)||0,o=parseFloat(c.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(n+r))),s=Math.max(0,Math.round(t.height-(i+o)));return{contentWidth:a,contentHeight:s,rect:t}}function K(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 i=parseFloat(r.width);!isNaN(i)&&i>0&&(t=i)}if(n===0){let i=parseFloat(r.height);!isNaN(i)&&i>0&&(n=i)}}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 sa(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 ca(e,t,n){let r=await aa(e,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:a}=la(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=sa(r,i,o),u;try{u=await s.toPng(r.documentElement,c)}finally{l()}u.style.display="block",u.style.width=`${i}px`,u.style.height=`${o}px`;let d=document.createElement("div");return t.nodeMap.set(d,e),he(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 ua(e){let{width:t,height:n}=K(e),r=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let o=i?parseFloat(i.width):NaN,a=i?parseFloat(i.height):NaN,s=Math.round(t||r.width||0),c=Math.round(n||r.height||0),l=Number.isFinite(o)&&o>0?Math.round(o):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,g=Math.max(Math.min(l,u),12),h="middle";try{i&&i.verticalAlign&&(h=i.verticalAlign)}catch{}let p=document.createElement("div");p.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),p.style.cssText=`display:inline-block;width:${g}px;height:${g}px;vertical-align:${h};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");y.setAttribute("width",String(g)),y.setAttribute("height",String(g)),y.setAttribute("viewBox",`0 0 ${g} ${g}`),p.appendChild(y);function v(){let b="#0a6ed1";try{i&&(b=i.accentColor||i.color||b)}catch{}let w=2,S=w/2,E=g-w;if(y.innerHTML="",d){let x=document.createElementNS("http://www.w3.org/2000/svg","rect");if(x.setAttribute("x",String(S)),x.setAttribute("y",String(S)),x.setAttribute("width",String(E)),x.setAttribute("height",String(E)),x.setAttribute("rx","2"),x.setAttribute("ry","2"),x.setAttribute("fill",f?b:"none"),x.setAttribute("stroke",b),x.setAttribute("stroke-width",String(w)),y.appendChild(x),f){let k=document.createElementNS("http://www.w3.org/2000/svg","path");k.setAttribute("d",`M ${S+2} ${g/2} L ${g/2-1} ${g-S-2} L ${g-S-2} ${S+2}`),k.setAttribute("stroke","white"),k.setAttribute("stroke-width",String(Math.max(1.5,w))),k.setAttribute("fill","none"),k.setAttribute("stroke-linecap","round"),k.setAttribute("stroke-linejoin","round"),y.appendChild(k)}else if(m){let k=document.createElementNS("http://www.w3.org/2000/svg","rect"),N=Math.max(6,E-4);k.setAttribute("x",String((g-N)/2)),k.setAttribute("y",String((g-w)/2)),k.setAttribute("width",String(N)),k.setAttribute("height",String(w)),k.setAttribute("fill",b),k.setAttribute("rx","1"),y.appendChild(k)}}else{let x=document.createElementNS("http://www.w3.org/2000/svg","circle");if(x.setAttribute("cx",String(g/2)),x.setAttribute("cy",String(g/2)),x.setAttribute("r",String((g-w)/2)),x.setAttribute("fill",f?b:"none"),x.setAttribute("stroke",b),x.setAttribute("stroke-width",String(w)),y.appendChild(x),f){let k=document.createElementNS("http://www.w3.org/2000/svg","circle"),N=Math.max(2,(g-w*2)*.35);k.setAttribute("cx",String(g/2)),k.setAttribute("cy",String(g/2)),k.setAttribute("r",String(N)),k.setAttribute("fill","white"),y.appendChild(k)}}p.style.setProperty("width",`${g}px`,"important"),p.style.setProperty("height",`${g}px`,"important"),p.style.setProperty("min-width",`${g}px`,"important"),p.style.setProperty("min-height",`${g}px`,"important")}return v(),{el:p,applyVisual:v}}var _e=new Y(80);async function De(e){if(C.resource?.has(e))return C.resource.get(e);if(_e.has(e))return _e.get(e);let t=(async()=>{let n=await X(e,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return C.resource?.set(e,n.data),n.data})();_e.set(e,t);try{let n=await t;return _e.set(e,n),n}catch(n){throw _e.delete(e),n}}var da=/\bblob:[^)"'\s]+/g;async function In(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(da)||[]));if(t.length===0)return e;let n=e;for(let r of t)try{let i=await De(r);n=n.split(r).join(i)}catch{}return n}function Xe(e){return typeof e=="string"&&e.startsWith("blob:")}function fa(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 ma(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}async function pa(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(Xe(l)){let d=await De(l);c.setAttribute("src",d)}let u=c.getAttribute("srcset");if(u&&u.includes("blob:")){let d=fa(u),f=!1;for(let m of d)if(Xe(m.url))try{m.url=await De(m.url),f=!0}catch(g){_(n,"blobUrlToDataUrl for srcset item failed",g)}f&&c.setAttribute("srcset",ma(d))}}catch(l){_(n,"resolveBlobUrls for img failed",l)}let i=e.querySelectorAll?e.querySelectorAll("image"):[];for(let c of i)try{let l="http://www.w3.org/1999/xlink",u=c.getAttribute("href")||c.getAttributeNS?.(l,"href");if(Xe(u)){let d=await De(u);c.setAttribute("href",d),c.removeAttributeNS?.(l,"href")}}catch(l){_(n,"resolveBlobUrls for SVG image href failed",l)}let o=e.querySelectorAll?e.querySelectorAll("[style*='blob:']"):[];for(let c of o)try{let l=c.getAttribute("style");if(l&&l.includes("blob:")){let u=await In(l);c.setAttribute("style",u)}}catch(l){_(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 In(l))}catch(l){_(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);Xe(d)&&u.setAttribute(c,await De(d))}catch(d){_(n,`resolveBlobUrls for ${c} failed`,d)}}}We();async function Ze(e,t,n){if(!e)throw new Error("Invalid node");let r=new Set,i=null,o=null;if(e.nodeType===Node.ELEMENT_NODE){let u=(e.localName||e.tagName||"").toLowerCase();if(e.id==="snapdom-sandbox"||e.hasAttribute("data-snapdom-sandbox")||Qn.has(u))return null;if(u==="foreignobject"&&e.parentElement?.closest?.("foreignObject"))return _(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}=K(e),m=d||e.getBoundingClientRect().width||0,g=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${g}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}=K(e),g=f||e.getBoundingClientRect().width||0,h=m||e.getBoundingClientRect().height||0;return d.style.cssText=`display:inline-block;width:${g}px;height:${h}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}=K(e),m=d||e.getBoundingClientRect().width||0,g=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${g}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){_(t,"iframe same-origin probe failed",d)}if(u)try{return await ca(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}=K(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;`,he(e,m,t,n),m}else{let{width:d,height:f}=K(e),m=document.createElement("div");return m.style.cssText=`display:inline-block;width:${d}px;height:${f}px;visibility:hidden;`,he(e,m,t,n),m}}if(e.getAttribute("data-capture")==="placeholder"){let u=e.cloneNode(!1);t.nodeMap.set(u,e),he(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 g=e.getContext("2d",{willReadFrequently:!0});try{g&&g.getImageData(0,0,1,1)}catch{}if(await new Promise(h=>requestAnimationFrame(h)),u=e.toDataURL("image/png"),!u||u==="data:,"){try{g&&g.getImageData(0,0,1,1)}catch{}if(await new Promise(h=>requestAnimationFrame(h)),u=e.toDataURL("image/png"),!u||u==="data:,"){let h=document.createElement("canvas");h.width=e.width,h.height=e.height;let p=h.getContext("2d");p&&(p.drawImage(e,0,0),u=h.toDataURL("image/png"))}}}catch(g){_(t,"Canvas toDataURL failed, using empty/fallback",g)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch(g){_(t,"img decoding/loading hints failed",g)}u&&(d.src=u),d.width=e.width,d.height=e.height;let{width:f,height:m}=K(e);return f>0&&(d.style.width=`${f}px`),m>0&&(d.style.height=`${m}px`),t.nodeMap.set(d,e),he(e,d,t,n),d}if(e.tagName==="VIDEO"){let u="";try{let g=document.createElement("canvas");g.width=e.videoWidth||e.offsetWidth||320,g.height=e.videoHeight||e.offsetHeight||240;let h=g.getContext("2d");h&&(h.drawImage(e,0,0,g.width,g.height),u=g.toDataURL("image/png"),(!u||u==="data:,")&&(u=""))}catch(g){_(t,"Video frame capture failed, using poster fallback",g)}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}=K(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),he(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(Xi(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){ta(e,a);try{let{width:u,height:d}=K(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){_(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),g=parseInt(a.dataset.snapdomHeight||"0",10),h=f("width")||!m,p=f("height")||!g;h&&m&&(a.style.width=`${m}px`),p&&g&&(a.style.height=`${g}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`),g&&(a.style.minHeight=`${g}px`))}catch(u){_(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}=K(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")&&Ci()){let{el:d,applyVisual:f}=ua(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&&(i=e.value),e instanceof HTMLTextAreaElement&&(o=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(he(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);Ze(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 E of S)r.add(E)}}catch{}let d=Zi(t),f=`[data-sd="${d}"]`;try{a.setAttribute("data-sd",d)}catch{}let m=Qi(e.shadowRoot),g=Ji(m,f),h=na(m),p=oa(e,h,f);ea(a,p+g,d);let y=document.createDocumentFragment(),v=await Nt(Array.from(e.shadowRoot.childNodes),u,n.fast);y.append(...v.filter(b=>!!b)),a.appendChild(y)}if(e.tagName==="SLOT"){let u=function(h,p){Ze(h,t,n).then(y=>{y&&ia(y),p(y||null)}).catch(()=>{p(null)})},d=e.assignedNodes?.({flatten:!0})||[],f=d.length>0?d:Array.from(e.childNodes),m=document.createDocumentFragment(),g=await Nt(Array.from(f),u,n.fast);return m.append(...g.filter(h=>!!h)),m}function c(u,d){if(r.has(u))return d(null);Ze(u,t,n).then(f=>{d(f||null)}).catch(()=>{d(null)})}let l=await Nt(Array.from(e.childNodes),c,n.fast);if(a.append(...l.filter(u=>!!u)),i!==null&&a instanceof HTMLSelectElement){a.value=i;for(let u of a.options)u.value===i?u.setAttribute("selected",""):u.removeAttribute("selected")}return o!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=o),a}J();rt();G();var ha=[/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],Ce=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__||{}),It=[];function ga(e){let t=Array.isArray(e)?e:[e];for(let n of t)n instanceof RegExp?It.push(n):typeof n=="string"?It.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function ie(e){let t=typeof e=="string"?e:"",n=[...ha,...It];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 ya(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var On=new Map;function wa(e=""){let t=Object.create(null),n=String(e||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)t[i[1].toUpperCase()]=Number(i[2]);return t}async function ba(e,t,n){let r=String(e||""),i=r.toLowerCase(),o=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),s="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?s="rounded":/\bsharp\b/.test(o)?s="sharp":/\boutlined\b/.test(o)&&(s="outlined");let c=a===1,l=null;if(c&&(s==="outlined"&&Ce.materialIconsFilled?l={url:Ce.materialIconsFilled,alias:"snapdom-mi-filled"}:s==="rounded"&&Ce.materialIconsRound?l={url:Ce.materialIconsRound,alias:"snapdom-mi-round"}:s==="sharp"&&Ce.materialIconsSharp&&(l={url:Ce.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!On.has(l.alias))try{let d=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),On.set(l.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function xa(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function va(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 Sa(e,{family:t="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:a=""}={}){let s=String(t||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,l=wa(o),{familyForMeasure:u,familyForCanvas:d}=await ba(s,a,l);await xa(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=i,document.body.appendChild(f);let m=f.getBoundingClientRect(),g=Math.max(1,Math.ceil(m.width)),h=Math.max(1,Math.ceil(m.height));document.body.removeChild(f);let p=document.createElement("canvas");p.width=g*c,p.height=h*c;let y=p.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${r}px ${d}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:p.toDataURL(),width:g,height:h}}async function Ea(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 i=t instanceof Element?Array.from(t.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],o=0;for(let a=0;a<r.length;a++){let s=r[a],c=i[a]||null;try{let l=getComputedStyle(c||s),u=l.fontFamily||"Material Icons";if(!ya(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",g=va(l),h=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",p=(c||s).className||"",{dataUrl:y,width:v,height:b}=await Sa(d,{family:u,weight:m,fontSize:f,color:g,variation:h,className:p});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),o++}catch{}}return o}$e();async function Ca(e,t,n,r=32,i="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let o=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*o),u.height=Math.max(1,l*o);let d=u.getContext("2d");return d.scale(o,o),d.font=n?`${n} ${r}px "${t}"`:`${r}px "${t}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=i,d.fillText(e,0,0),{dataUrl:u.toDataURL(),width:c,height:l}}var mr=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),ka=["katex","mathjax","mathml"];function Yt(e){if(!e)return"";for(let t of e.split(",")){let n=t.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!mr.has(n.toLowerCase()))return n}return""}function Ma(e){if(!e)return[];let t=[];for(let n of e.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(mr.has(r.toLowerCase())||t.push(r))}return t}function Qe(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 et(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function Aa(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function $a(e){let t=String(e||"400").trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let i=Qe(n[1]),o=Qe(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=Qe(t);return{min:r,max:r}}function La(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Na(e){let t=String(e||"100%").trim(),n=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(o,a),max:Math.max(o,a)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function Ta(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function Ra(e,t,n=[]){if(!e)return!1;try{let r=new URL(e,location.href);if(r.origin===location.origin)return!0;let i=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=>i.endsWith(a))||n.some(a=>i===a.toLowerCase()||i.endsWith("."+a.toLowerCase())))return!0;let o=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(o)||/\.woff2?(\b|$)/.test(o)||ka.some(a=>o.includes(a)))return!0;for(let a of t){let s=a.toLowerCase().replace(/\s+/g,"+"),c=a.toLowerCase().replace(/\s+/g,"-"),l=Ta(a);if(o.includes(s)||o.includes(c)||l&&o.includes(l))return!0}return!1}catch{return!1}}function _a(e){let t=new Set;for(let n of e||[]){let r=String(n).split("__")[0]?.trim();r&&t.add(r)}return t}function Hn(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,i)=>{let o=(i||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let a=o;try{a=new URL(o,t||location.href).href}catch{}return`url("${a}")`})}var Ot=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,nt=4;async function Pa(e,t,n){if(!e)return e;let r=new Set;function i(s,c){try{return new URL(s,c||location.href).href}catch{return s}}async function o(s,c,l=0){if(l>nt)return console.warn(`[snapDOM] @import depth exceeded (${nt}) at ${c}`),s;let u="",d=0,f;for(;f=Ot.exec(s);){u+=s.slice(d,f.index),d=Ot.lastIndex;let m=(f[2]||f[4]||"").trim(),g=i(m,c);if(r.has(g)){console.warn(`[snapDOM] Skipping circular @import: ${g}`);continue}r.add(g);let h="";try{let p=await X(g,{as:"text",useProxy:n,silent:!0});p.ok&&typeof p.data=="string"&&(h=p.data)}catch{}h?(h=Hn(h,g),h=await o(h,g,l+1),u+=`
|
|
6
|
+
`:""}function ia(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 aa(e,t=3){let n=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<t&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function la(e){let t=e.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let c=getComputedStyle(e);n=parseFloat(c.borderLeftWidth)||0,r=parseFloat(c.borderRightWidth)||0,i=parseFloat(c.borderTopWidth)||0,o=parseFloat(c.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(n+r))),s=Math.max(0,Math.round(t.height-(i+o)));return{contentWidth:a,contentHeight:s,rect:t}}function K(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 i=parseFloat(r.width);!isNaN(i)&&i>0&&(t=i)}if(n===0){let i=parseFloat(r.height);!isNaN(i)&&i>0&&(n=i)}}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 sa(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 ca(e,t,n){let r=await aa(e,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:a}=la(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=sa(r,i,o),u;try{u=await s.toPng(r.documentElement,c)}finally{l()}u.style.display="block",u.style.width=`${i}px`,u.style.height=`${o}px`;let d=document.createElement("div");return t.nodeMap.set(d,e),he(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 ua(e){let{width:t,height:n}=K(e),r=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let o=i?parseFloat(i.width):NaN,a=i?parseFloat(i.height):NaN,s=Math.round(t||r.width||0),c=Math.round(n||r.height||0),l=Number.isFinite(o)&&o>0?Math.round(o):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,g=Math.max(Math.min(l,u),12),h="middle";try{i&&i.verticalAlign&&(h=i.verticalAlign)}catch{}let p=document.createElement("div");p.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),p.style.cssText=`display:inline-block;width:${g}px;height:${g}px;vertical-align:${h};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");y.setAttribute("width",String(g)),y.setAttribute("height",String(g)),y.setAttribute("viewBox",`0 0 ${g} ${g}`),p.appendChild(y);function v(){let x="#0a6ed1";try{i&&(x=i.accentColor||i.color||x)}catch{}let w=2,S=w/2,E=g-w;if(y.innerHTML="",d){let b=document.createElementNS("http://www.w3.org/2000/svg","rect");if(b.setAttribute("x",String(S)),b.setAttribute("y",String(S)),b.setAttribute("width",String(E)),b.setAttribute("height",String(E)),b.setAttribute("rx","2"),b.setAttribute("ry","2"),b.setAttribute("fill",f?x:"none"),b.setAttribute("stroke",x),b.setAttribute("stroke-width",String(w)),y.appendChild(b),f){let k=document.createElementNS("http://www.w3.org/2000/svg","path");k.setAttribute("d",`M ${S+2} ${g/2} L ${g/2-1} ${g-S-2} L ${g-S-2} ${S+2}`),k.setAttribute("stroke","white"),k.setAttribute("stroke-width",String(Math.max(1.5,w))),k.setAttribute("fill","none"),k.setAttribute("stroke-linecap","round"),k.setAttribute("stroke-linejoin","round"),y.appendChild(k)}else if(m){let k=document.createElementNS("http://www.w3.org/2000/svg","rect"),N=Math.max(6,E-4);k.setAttribute("x",String((g-N)/2)),k.setAttribute("y",String((g-w)/2)),k.setAttribute("width",String(N)),k.setAttribute("height",String(w)),k.setAttribute("fill",x),k.setAttribute("rx","1"),y.appendChild(k)}}else{let b=document.createElementNS("http://www.w3.org/2000/svg","circle");if(b.setAttribute("cx",String(g/2)),b.setAttribute("cy",String(g/2)),b.setAttribute("r",String((g-w)/2)),b.setAttribute("fill",f?x:"none"),b.setAttribute("stroke",x),b.setAttribute("stroke-width",String(w)),y.appendChild(b),f){let k=document.createElementNS("http://www.w3.org/2000/svg","circle"),N=Math.max(2,(g-w*2)*.35);k.setAttribute("cx",String(g/2)),k.setAttribute("cy",String(g/2)),k.setAttribute("r",String(N)),k.setAttribute("fill","white"),y.appendChild(k)}}p.style.setProperty("width",`${g}px`,"important"),p.style.setProperty("height",`${g}px`,"important"),p.style.setProperty("min-width",`${g}px`,"important"),p.style.setProperty("min-height",`${g}px`,"important")}return v(),{el:p,applyVisual:v}}var _e=new Y(80);async function De(e){if(C.resource?.has(e))return C.resource.get(e);if(_e.has(e))return _e.get(e);let t=(async()=>{let n=await X(e,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return C.resource?.set(e,n.data),n.data})();_e.set(e,t);try{let n=await t;return _e.set(e,n),n}catch(n){throw _e.delete(e),n}}var da=/\bblob:[^)"'\s]+/g;async function In(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(da)||[]));if(t.length===0)return e;let n=e;for(let r of t)try{let i=await De(r);n=n.split(r).join(i)}catch{}return n}function Xe(e){return typeof e=="string"&&e.startsWith("blob:")}function fa(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 ma(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}async function pa(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(Xe(l)){let d=await De(l);c.setAttribute("src",d)}let u=c.getAttribute("srcset");if(u&&u.includes("blob:")){let d=fa(u),f=!1;for(let m of d)if(Xe(m.url))try{m.url=await De(m.url),f=!0}catch(g){_(n,"blobUrlToDataUrl for srcset item failed",g)}f&&c.setAttribute("srcset",ma(d))}}catch(l){_(n,"resolveBlobUrls for img failed",l)}let i=e.querySelectorAll?e.querySelectorAll("image"):[];for(let c of i)try{let l="http://www.w3.org/1999/xlink",u=c.getAttribute("href")||c.getAttributeNS?.(l,"href");if(Xe(u)){let d=await De(u);c.setAttribute("href",d),c.removeAttributeNS?.(l,"href")}}catch(l){_(n,"resolveBlobUrls for SVG image href failed",l)}let o=e.querySelectorAll?e.querySelectorAll("[style*='blob:']"):[];for(let c of o)try{let l=c.getAttribute("style");if(l&&l.includes("blob:")){let u=await In(l);c.setAttribute("style",u)}}catch(l){_(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 In(l))}catch(l){_(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);Xe(d)&&u.setAttribute(c,await De(d))}catch(d){_(n,`resolveBlobUrls for ${c} failed`,d)}}}We();async function Ze(e,t,n){if(!e)throw new Error("Invalid node");let r=new Set,i=null,o=null;if(e.nodeType===Node.ELEMENT_NODE){let u=(e.localName||e.tagName||"").toLowerCase();if(e.id==="snapdom-sandbox"||e.hasAttribute("data-snapdom-sandbox")||Qn.has(u))return null;if(u==="foreignobject"&&e.parentElement?.closest?.("foreignObject"))return _(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}=K(e),m=d||e.getBoundingClientRect().width||0,g=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${g}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}=K(e),g=f||e.getBoundingClientRect().width||0,h=m||e.getBoundingClientRect().height||0;return d.style.cssText=`display:inline-block;width:${g}px;height:${h}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}=K(e),m=d||e.getBoundingClientRect().width||0,g=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${g}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){_(t,"iframe same-origin probe failed",d)}if(u)try{return await ca(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}=K(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;`,he(e,m,t,n),m}else{let{width:d,height:f}=K(e),m=document.createElement("div");return m.style.cssText=`display:inline-block;width:${d}px;height:${f}px;visibility:hidden;`,he(e,m,t,n),m}}if(e.getAttribute("data-capture")==="placeholder"){let u=e.cloneNode(!1);t.nodeMap.set(u,e),he(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 g=e.getContext("2d",{willReadFrequently:!0});try{g&&g.getImageData(0,0,1,1)}catch{}if(await new Promise(h=>requestAnimationFrame(h)),u=e.toDataURL("image/png"),!u||u==="data:,"){try{g&&g.getImageData(0,0,1,1)}catch{}if(await new Promise(h=>requestAnimationFrame(h)),u=e.toDataURL("image/png"),!u||u==="data:,"){let h=document.createElement("canvas");h.width=e.width,h.height=e.height;let p=h.getContext("2d");p&&(p.drawImage(e,0,0),u=h.toDataURL("image/png"))}}}catch(g){_(t,"Canvas toDataURL failed, using empty/fallback",g)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch(g){_(t,"img decoding/loading hints failed",g)}u&&(d.src=u),d.width=e.width,d.height=e.height;let{width:f,height:m}=K(e);return f>0&&(d.style.width=`${f}px`),m>0&&(d.style.height=`${m}px`),t.nodeMap.set(d,e),he(e,d,t,n),d}if(e.tagName==="VIDEO"){let u="";try{let g=document.createElement("canvas");g.width=e.videoWidth||e.offsetWidth||320,g.height=e.videoHeight||e.offsetHeight||240;let h=g.getContext("2d");h&&(h.drawImage(e,0,0,g.width,g.height),u=g.toDataURL("image/png"),(!u||u==="data:,")&&(u=""))}catch(g){_(t,"Video frame capture failed, using poster fallback",g)}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}=K(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),he(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(Xi(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){ta(e,a);try{let{width:u,height:d}=K(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){_(t,"getUnscaledDimensions for IMG failed",u)}try{let u=e.getAttribute("style")||"",d=window.getComputedStyle(e),f=x=>{let w=u.match(new RegExp(`${x}\\s*:\\s*([^;]+)`,"i")),S=w?w[1].trim():d.getPropertyValue(x);return/%|auto/i.test(String(S||""))},m=parseInt(a.dataset.snapdomWidth||"0",10),g=parseInt(a.dataset.snapdomHeight||"0",10),h=f("width")||!m,p=f("height")||!g;h&&m&&(a.style.width=`${m}px`),p&&g&&(a.style.height=`${g}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`),g&&(a.style.minHeight=`${g}px`))}catch(u){_(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}=K(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")&&Ci()){let{el:d,applyVisual:f}=ua(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&&(i=e.value),e instanceof HTMLTextAreaElement&&(o=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(he(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(x,w){if(x.nodeType===Node.ELEMENT_NODE&&x.tagName==="STYLE")return w(null);Ze(x,t,n).then(S=>{w(S||null)}).catch(()=>{w(null)})};try{let x=e.shadowRoot.querySelectorAll("slot");for(let w of x){let S=[];try{S=w.assignedNodes?.({flatten:!0})||w.assignedNodes?.()||[]}catch{S=w.assignedNodes?.()||[]}for(let E of S)r.add(E)}}catch{}let d=Zi(t),f=`[data-sd="${d}"]`;try{a.setAttribute("data-sd",d)}catch{}let m=Qi(e.shadowRoot),g=Ji(m,f),h=na(m),p=oa(e,h,f);ea(a,p+g,d);let y=document.createDocumentFragment(),v=await Nt(Array.from(e.shadowRoot.childNodes),u,n.fast);y.append(...v.filter(x=>!!x)),a.appendChild(y)}if(e.tagName==="SLOT"){let u=function(h,p){Ze(h,t,n).then(y=>{y&&ia(y),p(y||null)}).catch(()=>{p(null)})},d=e.assignedNodes?.({flatten:!0})||[],f=d.length>0?d:Array.from(e.childNodes),m=document.createDocumentFragment(),g=await Nt(Array.from(f),u,n.fast);return m.append(...g.filter(h=>!!h)),m}function c(u,d){if(r.has(u))return d(null);Ze(u,t,n).then(f=>{d(f||null)}).catch(()=>{d(null)})}let l=await Nt(Array.from(e.childNodes),c,n.fast);if(a.append(...l.filter(u=>!!u)),i!==null&&a instanceof HTMLSelectElement){a.value=i;for(let u of a.options)u.value===i?u.setAttribute("selected",""):u.removeAttribute("selected")}return o!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=o),a}J();rt();G();var ha=[/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],Ce=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__||{}),It=[];function ga(e){let t=Array.isArray(e)?e:[e];for(let n of t)n instanceof RegExp?It.push(n):typeof n=="string"?It.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function ie(e){let t=typeof e=="string"?e:"",n=[...ha,...It];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 ya(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var On=new Map;function wa(e=""){let t=Object.create(null),n=String(e||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)t[i[1].toUpperCase()]=Number(i[2]);return t}async function ba(e,t,n){let r=String(e||""),i=r.toLowerCase(),o=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),s="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?s="rounded":/\bsharp\b/.test(o)?s="sharp":/\boutlined\b/.test(o)&&(s="outlined");let c=a===1,l=null;if(c&&(s==="outlined"&&Ce.materialIconsFilled?l={url:Ce.materialIconsFilled,alias:"snapdom-mi-filled"}:s==="rounded"&&Ce.materialIconsRound?l={url:Ce.materialIconsRound,alias:"snapdom-mi-round"}:s==="sharp"&&Ce.materialIconsSharp&&(l={url:Ce.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!On.has(l.alias))try{let d=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),On.set(l.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function xa(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function va(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 Sa(e,{family:t="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:a=""}={}){let s=String(t||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,l=wa(o),{familyForMeasure:u,familyForCanvas:d}=await ba(s,a,l);await xa(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=i,document.body.appendChild(f);let m=f.getBoundingClientRect(),g=Math.max(1,Math.ceil(m.width)),h=Math.max(1,Math.ceil(m.height));document.body.removeChild(f);let p=document.createElement("canvas");p.width=g*c,p.height=h*c;let y=p.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${r}px ${d}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:p.toDataURL(),width:g,height:h}}async function Ea(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 i=t instanceof Element?Array.from(t.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],o=0;for(let a=0;a<r.length;a++){let s=r[a],c=i[a]||null;try{let l=getComputedStyle(c||s),u=l.fontFamily||"Material Icons";if(!ya(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",g=va(l),h=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",p=(c||s).className||"",{dataUrl:y,width:v,height:x}=await Sa(d,{family:u,weight:m,fontSize:f,color:g,variation:h,className:p});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/x*f))}px`,w.style.objectFit="contain",w.style.verticalAlign=getComputedStyle(s).verticalAlign||"baseline",s.appendChild(w),o++}catch{}}return o}$e();async function Ca(e,t,n,r=32,i="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let o=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*o),u.height=Math.max(1,l*o);let d=u.getContext("2d");return d.scale(o,o),d.font=n?`${n} ${r}px "${t}"`:`${r}px "${t}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=i,d.fillText(e,0,0),{dataUrl:u.toDataURL(),width:c,height:l}}var mr=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),ka=["katex","mathjax","mathml"];function Yt(e){if(!e)return"";for(let t of e.split(",")){let n=t.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!mr.has(n.toLowerCase()))return n}return""}function Ma(e){if(!e)return[];let t=[];for(let n of e.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(mr.has(r.toLowerCase())||t.push(r))}return t}function Qe(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 et(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function Aa(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function $a(e){let t=String(e||"400").trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let i=Qe(n[1]),o=Qe(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=Qe(t);return{min:r,max:r}}function La(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Na(e){let t=String(e||"100%").trim(),n=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(o,a),max:Math.max(o,a)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function Ta(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function Ra(e,t,n=[]){if(!e)return!1;try{let r=new URL(e,location.href);if(r.origin===location.origin)return!0;let i=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=>i.endsWith(a))||n.some(a=>i===a.toLowerCase()||i.endsWith("."+a.toLowerCase())))return!0;let o=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(o)||/\.woff2?(\b|$)/.test(o)||ka.some(a=>o.includes(a)))return!0;for(let a of t){let s=a.toLowerCase().replace(/\s+/g,"+"),c=a.toLowerCase().replace(/\s+/g,"-"),l=Ta(a);if(o.includes(s)||o.includes(c)||l&&o.includes(l))return!0}return!1}catch{return!1}}function _a(e){let t=new Set;for(let n of e||[]){let r=String(n).split("__")[0]?.trim();r&&t.add(r)}return t}function Hn(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,i)=>{let o=(i||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let a=o;try{a=new URL(o,t||location.href).href}catch{}return`url("${a}")`})}var Ot=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,nt=4;async function Pa(e,t,n){if(!e)return e;let r=new Set;function i(s,c){try{return new URL(s,c||location.href).href}catch{return s}}async function o(s,c,l=0){if(l>nt)return console.warn(`[snapDOM] @import depth exceeded (${nt}) at ${c}`),s;let u="",d=0,f;for(;f=Ot.exec(s);){u+=s.slice(d,f.index),d=Ot.lastIndex;let m=(f[2]||f[4]||"").trim(),g=i(m,c);if(r.has(g)){console.warn(`[snapDOM] Skipping circular @import: ${g}`);continue}r.add(g);let h="";try{let p=await X(g,{as:"text",useProxy:n,silent:!0});p.ok&&typeof p.data=="string"&&(h=p.data)}catch{}h?(h=Hn(h,g),h=await o(h,g,l+1),u+=`
|
|
7
7
|
/* inlined: ${g} */
|
|
8
8
|
${h}
|
|
9
|
-
`):u+=f[0]}return u+=s.slice(d),u}let a=Hn(e,t||location.href);return a=await o(a,t||location.href,0),a}var pr=/url\((["']?)([^"')]+)\1\)/g,Fa=/@font-face[^{}]*\{[^}]*\}/g;function hr(e){if(!e)return[];let t=[],n=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let i=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let o=i[1],a=i[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(o),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(o);Array.isArray(c)?t.push([c[0],c[1]]):t.push([c,c])}}return t}function gr(e,t){if(!t.length||!e||e.size===0)return!0;for(let n of e)for(let[r,i]of t)if(n>=r&&n<=i)return!0;return!1}function Xt(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(pr)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,t||location.href).href}catch{}n.push(i)}}return n}async function yr(e,t,n=""){let r=e;for(let i of e.matchAll(pr)){let o=jt(i[0]);if(!o)continue;let a=o;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,t||location.href).href}catch{}if(!ie(a)){if(C.resource?.has(a)){C.font?.add(a),r=r.replace(i[0],`url(${C.resource.get(a)})`);continue}if(!C.font?.has(a))try{let s=await X(a,{as:"dataURL",useProxy:n,silent:!0});if(s.ok&&typeof s.data=="string"){let c=s.data;C.resource?.set(a,c),C.font?.add(a),r=r.replace(i[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return r}function Da(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),i=t(880,1023),o=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function Wn(e={}){let t=new Set((e.families||[]).map(i=>String(i).toLowerCase())),n=new Set((e.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((e.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(t.size&&t.has(i.family.toLowerCase()))return!0;if(n.size)for(let a of i.srcUrls)try{if(n.has(new URL(a).host.toLowerCase()))return!0}catch{}if(r.size){let a=Da(o);if(a&&r.has(a))return!0}return!1}}function Ia(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of e.match(t)||[]){let a=o.match(/font-family:\s*([^;]+);/i)?.[1]||"",s=Yt(a),c=(o.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),l=(o.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),u=(o.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),d=(o.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),f=(o.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),m=Xt(f,location.href),g=m.length?m.map(p=>String(p).toLowerCase()).sort().join("|"):f.toLowerCase(),h=[String(s||"").toLowerCase(),c,l,u,d.toLowerCase(),g].join("|");n.has(h)||(n.add(h),r.push(o))}if(r.length===0)return e;let i=0;return e.replace(t,()=>r[i++]||"")}function Oa(e,t,n,r,i){let o=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=(i||[]).map(u=>String(u).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${o}::ex=${a}::lf=${s}::px=${c}::fd=${l}`}async function wr(e,t,n,r){let i;try{i=e.cssRules||[]}catch{return}let o=(a,s)=>{try{return new URL(a,s||location.href).href}catch{return a}};for(let a of i){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let s=a.href?o(a.href,t):t;if(r.depth>=nt){console.warn(`[snapDOM] CSSOM import depth exceeded (${nt}) 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 wr(a.styleSheet,s,n,c);continue}if(a.type===CSSRule.FONT_FACE_RULE){let s=(a.style.getPropertyValue("font-family")||"").trim(),c=Yt(s);if(!c||ie(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 g=hr(m);if(!gr(r.usedCodepoints,g))continue;let h={family:c,weightSpec:l,styleSpec:u,stretchSpec:d,unicodeRange:m,srcRaw:f,srcUrls:Xt(f,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(h,g))continue;if(/url\(/i.test(f)){let p=await yr(f,t||location.href,r.useProxy);await n(`@font-face{font-family:${c};src:${p};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 Ha({required:e,usedCodepoints:t,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[]}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let a=new Map;for(let p of e){let[y,v,b,w]=String(p).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(p,y,v,b){if(!a.has(p))return!1;let w=a.get(p),S=$a(v),E=La(y),x=Na(b),k=S.min!==S.max,N=S.min,O=L=>E.kind==="normal"&&L==="normal"||E.kind!=="normal"&&(L==="italic"||L==="oblique"),F=!1;for(let L of w){let $=k?L.w>=S.min&&L.w<=S.max:L.w===N,D=O(et(L.s)),B=L.st>=x.min&&L.st<=x.max;if($&&D&&B){F=!0;break}}if(F)return!0;if(!k)for(let L of w){let $=O(et(L.s)),D=L.st>=x.min&&L.st<=x.max;if(Math.abs(N-L.w)<=300&&$&&D)return!0}if(!k&&E.kind==="normal"&&w.some(L=>et(L.s)!=="normal"))for(let L of w){let $=Math.abs(N-L.w)<=300,D=L.st>=x.min&&L.st<=x.max;if($&&D)return!0}return!1}let c=Wn(n),l=Oa(e,n,r,i,o);if(C.resource?.has(l))return C.resource.get(l);let u=_a(e),d=[],f=Ot;for(let p of document.querySelectorAll("style")){let y=p.textContent||"";for(let v of y.matchAll(f)){let b=(v[2]||v[4]||"").trim();!b||ie(b)||document.querySelector(`link[rel="stylesheet"][href="${b}"]`)||d.push(b)}}d.length&&await Promise.all(d.map(p=>new Promise(y=>{if(document.querySelector(`link[rel="stylesheet"][href="${p}"]`))return y(null);let v=document.createElement("link");v.rel="stylesheet",v.href=p,v.setAttribute("data-snapdom","injected-import"),v.onload=()=>y(v),v.onerror=()=>y(null),document.head.appendChild(v)})));let m="",g=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(p=>!!p.href);for(let p of g)try{if(ie(p.href))continue;let y="",v=!1;try{v=new URL(p.href,location.href).origin===location.origin}catch{}if(!v){let w=Array.isArray(o)?o:[];if(!Ra(p.href,u,w))continue}if(v){let w=Array.from(document.styleSheets).find(S=>S.href===p.href);if(w)try{let S=w.cssRules||[];y=Array.from(S).map(E=>E.cssText).join("")}catch{}}if(!y){let w=await X(p.href,{as:"text",useProxy:i});if(w?.ok&&typeof w.data=="string"&&(y=w.data),ie(p.href))continue}y=await Pa(y,p.href,i);let b="";for(let w of y.match(Fa)||[]){let S=(w.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),E=Yt(S);if(!E||ie(E))continue;let x=(w.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),k=(w.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),N=(w.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),O=(w.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),F=(w.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),L=Xt(F,p.href);if(!s(E,k,x,N))continue;let $=hr(O);if(!gr(t,$))continue;let D={family:E,weightSpec:x,styleSpec:k,stretchSpec:N,unicodeRange:O,srcRaw:F,srcUrls:L,href:p.href};if(n&&c(D,$))continue;let B=/url\(/i.test(F)?await yr(w,p.href,i):w;b+=B}b.trim()&&(m+=b)}catch{console.warn("[snapDOM] Failed to process stylesheet:",p.href)}let h={requiredIndex:a,usedCodepoints:t,faceMatchesRequired:s,simpleExcluder:n?Wn(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(let p of document.styleSheets)if(!(p.href&&g.some(y=>y.href===p.href)))try{let y=p.href||location.origin+"/";y&&h.visitedSheets.add(y),await wr(p,y,async v=>{m+=v},h)}catch{}try{for(let p of document.fonts||[]){if(!p||!p.family||p.status!=="loaded"||!p._snapdomSrc)continue;let y=String(p.family).replace(/^['"]+|['"]+$/g,"");if(ie(y)||!a.has(y)||n?.families&&n.families.some(b=>String(b).toLowerCase()===y.toLowerCase()))continue;let v=p._snapdomSrc;if(!String(v).startsWith("data:")){if(C.resource?.has(p._snapdomSrc))v=C.resource.get(p._snapdomSrc),C.font?.add(p._snapdomSrc);else if(!C.font?.has(p._snapdomSrc))try{let b=await X(p._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(b.ok&&typeof b.data=="string")v=b.data,C.resource?.set(p._snapdomSrc,v),C.font?.add(p._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",p._snapdomSrc);continue}}m+=`@font-face{font-family:'${y}';src:url(${v});font-style:${p.style||"normal"};font-weight:${p.weight||"normal"};}`}}catch{}for(let p of r){if(!p||typeof p!="object")continue;let y=String(p.family||"").replace(/^['"]+|['"]+$/g,"");if(!y||ie(y)||!a.has(y)||n?.families&&n.families.some(x=>String(x).toLowerCase()===y.toLowerCase()))continue;let v=p.weight!=null?String(p.weight):"normal",b=p.style!=null?String(p.style):"normal",w=p.stretchPct!=null?`${p.stretchPct}%`:"100%",S=String(p.src||""),E=S;if(!E.startsWith("data:")){if(C.resource?.has(S))E=C.resource.get(S),C.font?.add(S);else if(!C.font?.has(S))try{let x=await X(S,{as:"dataURL",useProxy:i,silent:!0});if(x.ok&&typeof x.data=="string")E=x.data,C.resource?.set(S,E),C.font?.add(S);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",S);continue}}m+=`@font-face{font-family:'${y}';src:url(${E});font-style:${b};font-weight:${v};font-stretch:${w};}`}return m&&(m=Ia(m),C.resource?.set(l,m)),m}function br(e){let t=new Set;if(!e)return t;let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),r=a=>{let s=Ma(a.fontFamily);if(s.length)for(let c of s){let l=(u,d,f)=>`${c}__${Qe(u)}__${et(d)}__${Aa(f)}`;t.add(l(a.fontWeight,a.fontStyle,a.fontStretch))}};r(getComputedStyle(e));let i=getComputedStyle(e,"::before");i&&i.content&&i.content!=="none"&&r(i);let o=getComputedStyle(e,"::after");for(o&&o.content&&o.content!=="none"&&r(o);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 Wa(e){let t=new Set,n=i=>{if(i)for(let o of i)t.add(o.codePointAt(0))},r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let i=r.currentNode;if(i.nodeType===Node.TEXT_NODE)n(i.nodeValue||"");else if(i.nodeType===Node.ELEMENT_NODE){let o=i;for(let a of["::before","::after"]){let s=getComputedStyle(o,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 xr(e,t=2){try{await document.fonts.ready}catch{}let n=Array.from(e||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let i=document.createElement("div");i.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let o of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${o}"`,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",i.appendChild(a)}document.body.appendChild(i),i.offsetWidth,document.body.removeChild(i)};for(let i=0;i<Math.max(1,t);i++)r(),await new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o)))}G();function Ba(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function Ua(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Bn(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 Un(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)),i="";for(let[o,a]of n)for(;r>=o;)i+=a,r-=o;return t?i:i.toLowerCase()}function qn(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 Bn(e,!1);case"upper-alpha":return Bn(e,!0);case"lower-roman":return Un(e,!1);case"upper-roman":return Un(e,!0);default:return String(e)}}function qa(e){let t=()=>C?.session?.__counterEpoch??0,n=t(),r=new WeakMap,i=e instanceof Document?e.documentElement:e,o=f=>f&&f.tagName==="LI",a=f=>{let m=0,g=f?.parentElement;if(!g)return 0;for(let h of g.children){if(h===f)break;h.tagName==="LI"&&m++}return m},s=f=>{let m=new Map;for(let[g,h]of f)m.set(g,h.slice());return m},c=(f,m,g)=>{let h=s(f),p;try{p=g.style?.counterReset||getComputedStyle(g).counterReset}catch{}if(p&&p!=="none")for(let b of p.split(",")){let w=b.trim().split(/\s+/),S=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!S)continue;let x=m.get(S);if(x&&x.length){let k=x.slice();k.push(E),h.set(S,k)}else h.set(S,[E])}let y;try{y=g.style?.counterSet||getComputedStyle(g).counterSet}catch{}if(y&&y!=="none")for(let b of y.split(",")){let w=b.trim().split(/\s+/),S=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!S)continue;let x=h.get(S)||[];x.length===0&&x.push(0),x[x.length-1]=E,h.set(S,x)}let v;try{v=g.style?.counterIncrement||getComputedStyle(g).counterIncrement}catch{}if(v&&v!=="none")for(let b of v.split(",")){let w=b.trim().split(/\s+/),S=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):1;if(!S)continue;let x=h.get(S)||[];x.length===0&&x.push(0),x[x.length-1]+=E,h.set(S,x)}try{if(getComputedStyle(g).display==="list-item"&&o(g)){let b=g.parentElement,w=1;if(b&&b.tagName==="OL"){let E=b.getAttribute("start"),x=Number.isFinite(Number(E))?Number(E):1,k=a(g),N=g.getAttribute("value");w=Number.isFinite(Number(N))?Number(N):x+k}else w=1+a(g);let S=h.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=w,h.set("list-item",S)}}catch{}return h},l=(f,m,g)=>{let h=c(g,m,f);r.set(f,h);let p=h;for(let v of f.children)p=l(v,h,p);let y=new Map;for(let[v,b]of g){let w=b.length,S=p.get(v);y.set(v,S&&S.length?S.slice(0,w):b.slice())}for(let[v,b]of p)!y.has(v)&&b.length&&!m.has(v)&&y.set(v,b.slice(0,1));return y},u=new Map;l(i,u,u);function d(){let f=t();if(f!==n){n=f;let m=new Map;l(i,m,m)}}return{get(f,m){d();let g=r.get(f)?.get(m);return g&&g.length?g[g.length-1]:0},getStack(f,m){d();let g=r.get(f)?.get(m);return g?g.slice():[]}}}function ja(e,t,n){if(!e||e==="none")return e;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,i=e.replace(r,(o,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 qn(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=>qn(m,d)).join(u):""}});return Ua(i)}catch{return"- "}}$e();G();var ke=new WeakMap,jn=1e3;function Va(e,t){let n=vr(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=zn(e),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):zn(e)}function Ht(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function vr(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${t.length}|`,r=0;for(let o=0;o<t.length;o++){let a=t[o];if(a.tagName==="STYLE"){let s=a.textContent?a.textContent.length:0;n+=`S${s}|`;let c=a.sheet,l=c?Ht(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?Ht(l):null;u&&(r+=u.length)}}let i=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(i)?i.length:0}|tr:${r}`,n}function Vn(e,t,n){let r=Ht(e);if(!r)return!1;for(let i=0;i<r.length;i++){if(n.budget<=0)return!1;let o=r[i],a=o&&o.cssText?o.cssText:"";n.budget--;for(let s of t)if(a.includes(s))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let s=0;s<o.cssRules.length&&n.budget>0;s++){let c=o.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 zn(e=document){let t=vr(e),n=ke.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"],i=e.querySelectorAll("style");for(let a=0;a<i.length;a++){let s=i[a].textContent||"";for(let c of r)if(s.includes(c))return ke.set(e,{fingerprint:t,result:!0}),!0}let o=e.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let a={budget:jn};try{for(let s of o)if(Vn(s,r,a))return ke.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),s={budget:jn};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&&Vn(u,r,s))return ke.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(ke.set(e,{fingerprint:t,result:!0}),!0):(ke.set(e,{fingerprint:t,result:!1}),!1)}var Ae=new WeakMap,Yn=-1;function za(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Ya(e){if(!e)return"";let t=[],n=/"([^"]*)"/g,r;for(;r=n.exec(e);)t.push(r[1]);return t.length?t.join(""):za(e)}function Wt(e,t){let n=e.parentElement,r=n?Ae.get(n):null;return r?{get(i,o){let a=t.get(i,o),s=r.get(o);return typeof s=="number"?Math.max(a,s):a},getStack(i,o){let a=t.getStack(i,o);if(!a.length)return a;let s=r.get(o);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 Bt(e,t,n){let r=new Map;function i(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 o=i(t?.counterReset),a=i(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=o.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 Xa(e,t,n){let r;try{r=ae(e,t)}catch{}let i=r?.content;if(!i||i==="none"||i==="normal")return{text:"",incs:[]};let o=Wt(e,n),a=Bt(e,r,o),s=Ba(i)?ja(i,e,a):i;return{text:Ya(s),incs:a.__incs||[]}}async function Ut(e,t,n,r){if(!(e instanceof Element)||!(t instanceof Element))return;let i=e.ownerDocument||document;if(!Va(i,n))return;let o=C?.session?.__counterEpoch??0;if(Yn!==o&&(Ae=new WeakMap,n&&(n.__counterCtx=null),Yn=o),!n.__counterCtx)try{n.__counterCtx=qa(e.ownerDocument||document)}catch(c){_(n,"buildCounterContext failed",c)}let a=n.__counterCtx;for(let c of["::before","::after","::first-letter"])try{let l=ae(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 T=ae(e);if(!(l.color!==T.color||l.fontSize!==T.fontSize||l.fontWeight!==T.fontWeight||l.fontFamily!==T.fontFamily||l.fontStyle!==T.fontStyle||l.textTransform!==T.textTransform||l.float!==T.float||l.paddingTop!==T.paddingTop||l.paddingRight!==T.paddingRight||l.paddingBottom!==T.paddingBottom||l.paddingLeft!==T.paddingLeft||l.marginTop!==T.marginTop||l.marginRight!==T.marginRight||l.marginBottom!==T.marginBottom||l.marginLeft!==T.marginLeft))continue;let R=Array.from(t.childNodes).find(Te=>Te.nodeType===Node.TEXT_NODE&&Te.textContent?.trim().length>0);if(!R)continue;let H=R.textContent,I=H.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],le=H.slice(I?.length||0);if(!I||/[\uD800-\uDFFF]/.test(I))continue;let Q=document.createElement("span");Q.textContent=I,Q.dataset.snapdomPseudo="::first-letter";let be=Ln(l),xe=_t(be,"span");n.styleMap.set(Q,xe);let fe=document.createTextNode(le);t.replaceChild(fe,R),t.insertBefore(Q,fe);continue}let u=l.content??"",d=u===""||u==="none"||u==="normal",{text:f,incs:m}=Xa(e,c,a),g=l.backgroundImage,h=l.backgroundColor,p=l.fontFamily,y=parseInt(l.fontSize)||32,v=parseInt(l.fontWeight)||!1,b=l.color||"#000",w=l.borderStyle,S=parseFloat(l.borderWidth),E=l.transform,x=ie(p),k=!d&&f!=="",N=g&&g!=="none",O=h&&h!=="transparent"&&h!=="rgba(0, 0, 0, 0)",F=w&&w!=="none"&&S>0,L=E&&E!=="none";if(!(k||N||O||F||L)){if(m&&m.length&&e.parentElement){let T=Ae.get(e.parentElement)||new Map;for(let{name:R}of m){if(!R)continue;let H=Wt(e,a),I=Bt(e,ae(e,c),H).get(e,R);T.set(R,I)}Ae.set(e.parentElement,T)}continue}let $=document.createElement("span");$.dataset.snapdomPseudo=c,$.style.pointerEvents="none";let D=Ln(l),B=_t(D,"span");if(n.styleMap.set($,B),x&&f&&f.length===1){let{dataUrl:T,width:R,height:H}=await Ca(f,p,v,y,b),I=document.createElement("img");I.src=T,I.style=`height:${y}px;width:${R/H*y}px;object-fit:contain;`,$.appendChild(I),t.dataset.snapdomHasIcon="true"}else if(f&&f.startsWith("url(")){let T=jt(f);if(T?.trim())try{let R=await X(tt(T),{as:"dataURL",useProxy:r.useProxy});if(R?.ok&&typeof R.data=="string"){let H=document.createElement("img");H.src=R.data,H.style=`width:${y}px;height:auto;object-fit:contain;`,$.appendChild(H)}}catch(R){console.error(`[snapdom] Error in pseudo ${c} for`,e,R)}}else!x&&k&&($.textContent=f);$.style.backgroundImage="none","maskImage"in $.style&&($.style.maskImage="none"),"webkitMaskImage"in $.style&&($.style.webkitMaskImage="none");try{$.style.backgroundRepeat=l.backgroundRepeat,$.style.backgroundSize=l.backgroundSize,l.backgroundPositionX&&l.backgroundPositionY?($.style.backgroundPositionX=l.backgroundPositionX,$.style.backgroundPositionY=l.backgroundPositionY):$.style.backgroundPosition=l.backgroundPosition,$.style.backgroundOrigin=l.backgroundOrigin,$.style.backgroundClip=l.backgroundClip,$.style.backgroundAttachment=l.backgroundAttachment,$.style.backgroundBlendMode=l.backgroundBlendMode}catch{}if(N)try{let T=Pt(g),R=await Promise.all(T.map(Zn));$.style.backgroundImage=R.join(", ")}catch(T){console.warn(`[snapdom] Failed to inline background-image for ${c}`,T)}O&&($.style.backgroundColor=h);let je=$.childNodes.length>0||$.textContent?.trim()!==""||N||O||F||L;if(m&&m.length&&e.parentElement){let T=Ae.get(e.parentElement)||new Map,R=Wt(e,a),H=Bt(e,ae(e,c),R);for(let{name:I}of m){if(!I)continue;let le=H.get(e,I);T.set(I,le)}Ae.set(e.parentElement,T)}if(!je)continue;c==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore($,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild($))}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 Ut(l,c,n,r)}else{let c=Array.from(e.children);for(let l=0;l<Math.min(c.length,s.length);l++)await Ut(c[l],s[l],n,r)}}function Ga(e,t){if(!e||!(e instanceof Element))return;let n=e.ownerDocument||document,r=t||n,i=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(i.length===0)return;let o=/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 E=w.attributes;if(!E)return null;for(let x=0;x<E.length;x++){let k=E[x];if(!k||!k.name)continue;if(k.name==="href")return k.value;let N=k.name.indexOf(":");if(N!==-1&&k.name.slice(N+1)==="href")return k.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;o.lastIndex=0;let E;for(;E=o.exec(w);){f=!0;let x=(E[1]||"").trim();x&&(u.has(x)||(d.add(x),S&&!S.has(x)&&S.add(x)))}},g=w=>{let S=w.querySelectorAll("use");for(let x of S){let k=l(x);if(!k||!k.startsWith("#"))continue;f=!0;let N=k.slice(1).trim();N&&!u.has(N)&&d.add(N)}let E=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 x of E){m(x.getAttribute("style")||"");for(let k of a)m(x.getAttribute(k))}};for(let w of i)g(w);if(!f)return;let h=e.querySelector("svg.inline-defs-container");h||(h=n.createElementNS("http://www.w3.org/2000/svg","svg"),h.classList.add("inline-defs-container"),h.setAttribute("aria-hidden","true"),h.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(h,e.firstChild||null));let p=h.querySelector("defs")||null,y=w=>{if(!w||u.has(w))return null;let S=s(w),E=x=>{let k=r.querySelector(x);return k&&!e.contains(k)?k:null};return E(`svg defs > *#${S}`)||E(`svg > symbol#${S}`)||E(`*#${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}p||(p=n.createElementNS("http://www.w3.org/2000/svg","defs"),h.appendChild(p));let E=S.cloneNode(!0);E.id||E.setAttribute("id",w),p.appendChild(E),b.add(w),u.add(w);let x=[E,...E.querySelectorAll("*")];for(let k of x){let N=l(k);if(N&&N.startsWith("#")){let F=N.slice(1).trim();F&&!u.has(F)&&!b.has(F)&&v.add(F)}let O=k.getAttribute?.("style")||"";O&&m(O,v);for(let F of a){let L=k.getAttribute?.(F);L&&m(L,v)}}}}G();function Ka(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(),i=e.clientHeight,o="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=Xn(c.top),d=Xn(c.bottom);if(u==null&&d==null)continue;let f=Ja(s,e),m=Za(t,f,o);if(!m)continue;let g=s.getBoundingClientRect(),h=g.width,p=g.height,y=g.left-r.left;if(!(h>0&&p>0)||!Number.isFinite(y))continue;let v=u!=null?u+n:n+(i-p-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,E=w?b-1:0,x=m.cloneNode(!1);x.setAttribute(o,"1"),x.style.position="sticky",x.style.left=`${y}px`,x.style.top=`${v}px`,x.style.width=`${h}px`,x.style.height=`${p}px`,x.style.visibility="hidden",x.style.zIndex=String(E),x.style.overflow="hidden",x.style.background="transparent",x.style.boxShadow="none",x.style.filter="none",m.parentElement?.insertBefore(x,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 Xn(e){if(!e||e==="auto")return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function Ja(e,t){let n=[];for(let r=e;r&&r!==t;){let i=r.parentElement;if(!i)break;n.push(Array.prototype.indexOf.call(i.children,r)),r=i}return n.reverse()}function Za(e,t,n){let r=e;for(let i=0;i<t.length;i++)if(r=Qa(r,n)[t[i]],!r)return null;return r instanceof HTMLElement?r:null}function Qa(e,t){let n=[],r=e.children;for(let i=0;i<r.length;i++){let o=r[i];o.hasAttribute(t)||n.push(o)}return n}function el(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=t.borderStyle,o=t.borderWidth,a=n!=="none"&&parseFloat(r)>0,s=i==="none"||parseFloat(o)===0;a&&s&&(e.style.border=`${r} solid transparent`)}function tl(e){let t=[];try{let n=e.querySelectorAll("*");for(let r of n){if(!(r instanceof HTMLElement))continue;let i=r.style.contentVisibility||"",o=getComputedStyle(r),a=o.contentVisibility||o.getPropertyValue("content-visibility")||"";(a==="auto"||a==="hidden")&&(t.push({el:r,original:i}),r.style.contentVisibility="visible")}if(e instanceof HTMLElement){let r=getComputedStyle(e),i=r.contentVisibility||r.getPropertyValue("content-visibility")||"";(i==="auto"||i==="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 nl(e,t={}){let n={styleMap:C.session.styleMap,styleCache:C.session.styleCache,nodeMap:C.session.nodeMap,options:t},r,i="",o="";el(e);let a=tl(e);try{Ga(e)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{r=await Ze(e,n,t)}catch(l){throw console.warn("deepClone failed:",l),l}finally{a()}try{await Ut(e,r,n,t)}catch(l){console.warn("inlinePseudoElements failed:",l)}await pa(r,n);try{let l=r.querySelectorAll("style[data-sd]");for(let u of l)o+=u.textContent||"",u.remove()}catch(l){_(n,"Failed to extract shadow CSS from style[data-sd]",l)}let s=xi(n.styleMap);i=Array.from(s.entries()).map(([l,u])=>`.${u}{${l}}`).join(""),i=o+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+i;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 g=l.querySelectorAll("*");for(let h of g){if(!(h instanceof HTMLElement))continue;let p=h.style.position;if(p==="fixed"||p==="absolute"){let y=parseFloat(h.style.top)||0,v=parseFloat(h.style.left)||0;h.style.top=`${y+f}px`,h.style.left=`${v+d}px`,p==="fixed"&&(h.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(Ka(e,c),e===n.nodeMap.get(r)){let l=n.styleCache.get(e)||ae(e);n.styleCache.set(e,l);let u=si(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:i,styleCache:n.styleCache}}$e();var Sr="http://www.w3.org/1999/xlink";function rl(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(Sr,"href"):null)}function ol(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,n=parseInt(e.dataset?.snapdomHeight||"",10)||0,r=parseInt(e.getAttribute("width")||"",10)||0,i=parseInt(e.getAttribute("height")||"",10)||0,o=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0,s=t||o||r||e.width||e.naturalWidth||100,c=n||a||i||e.height||e.naturalHeight||100;return{width:s,height:c}}async function il(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 X(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}=ol(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 X(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 i=Array.from(e.querySelectorAll("image")),o=async a=>{let s=rl(a);if(!s||s.startsWith("data:")||s.startsWith("blob:"))return;let c=await X(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(Sr,"href"))};for(let a=0;a<i.length;a+=4){let s=i.slice(a,a+4).map(o);await Promise.allSettled(s)}}J();async function al(e,t,n,r={}){let i=[[e,t]],o=["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(;i.length;){let[l,u]=i.shift();if(!u)continue;let d=n.get(l)||ae(l);n.has(l)||n.set(l,d);let f=(()=>{let h=d.getPropertyValue("border-image"),p=d.getPropertyValue("border-image-source");return h&&h!=="none"||p&&p!=="none"})();for(let h of s){let p=d.getPropertyValue(h);p&&u.style.setProperty(h,p)}for(let h of o){let p=d.getPropertyValue(h);if(h==="background-image"&&(!p||p==="none")){let b=d.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(p=Pt(b).filter(w=>/url\s*\(/.test(w)).join(", ")||p)}if(!p||p==="none")continue;let y=Pt(p),v=await Promise.all(y.map(b=>Zn(b,r)));v.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&u.style.setProperty(h,v.join(", "))}for(let h of a){let p=d.getPropertyValue(h);!p||p==="initial"||u.style.setProperty(h,p)}if(f)for(let h of c){let p=d.getPropertyValue(h);!p||p==="initial"||u.style.setProperty(h,p)}let m=l.shadowRoot?Array.from(l.shadowRoot.children).filter(h=>h.tagName!=="STYLE"):Array.from(l.children),g=Array.from(u.children).filter(h=>!(h.dataset?.snapdomPseudo||h.tagName==="STYLE"&&h.dataset?.sd));for(let h=0;h<Math.min(m.length,g.length);h++)i.push([m[h],g[h]])}}J();G();function ll(e){if(!e)return()=>{};let t=[];function n(r){let i=sl(r);i&&t.push(i);for(let o of r.children||[])n(o)}return n(e),()=>t.forEach(r=>r())}function sl(e){if(!e)return()=>{};let t=cl(e);if(t<=0)return()=>{};if(!fl(e))return()=>{};let n=getComputedStyle(e),r=Math.round(ul(n)*t+dl(n)),i=e.textContent??"",o=i;if(e.scrollHeight<=r+.5)return()=>{};let a=0,s=i.length,c=-1;for(;a<=s;){let l=a+s>>1;e.textContent=i.slice(0,l)+"\u2026",e.scrollHeight<=r+.5?(c=l,a=l+1):s=l-1}return e.textContent=(c>=0?i.slice(0,c):"")+"\u2026",()=>{e.textContent=o}}function cl(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 ul(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 dl(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function fl(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var Oe=[];function Er(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 ml(...e){let t=e.flat();for(let n of t){let r=Er(n);r&&(Oe.some(i=>i&&i.name&&r.name&&i.name===r.name)||Oe.push(r))}}function Cr(e){return(e&&Array.isArray(e.plugins)?e.plugins:Oe)||Oe}async function de(e,t,n){let r=n,i=Cr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let s=await a(t,r);typeof s<"u"&&(r=s)}return r}async function pl(e,t,n){let r=[],i=Cr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let s=await a(t,n);typeof s<"u"&&r.push(s)}return r}function hl(e){let t=[];if(Array.isArray(e))for(let n of e){let r=Er(n);if(!r||!r.name)continue;let i=t.findIndex(o=>o&&o.name===r.name);i>=0&&t.splice(i,1),t.push(r)}for(let n of Oe)n&&n.name&&!t.some(r=>r.name===n.name)&&t.push(n);return Object.freeze(t)}function gl(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=hl(t)),e}J();function yl(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow="none"}catch(o){_(n,"stripRootShadows boxShadow",o)}try{t.style.textShadow="none"}catch(o){_(n,"stripRootShadows textShadow",o)}try{t.style.outline="none"}catch(o){_(n,"stripRootShadows outline",o)}let i=(r.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=i.length?i:"none"}catch(o){_(n,"stripRootShadows filter",o)}}function wl(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 bl(e,t={}){let{stripFrameworkDirectives:n=!0}=t,r=new Set(["xml","xlink"]),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let o=i.currentNode;for(let a of Array.from(o.attributes)){let s=a.name;if(s.includes("@")){o.removeAttribute(s);continue}if(s.includes(":")){let c=s.split(":",1)[0];if(!r.has(c)){o.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:"))){o.removeAttribute(s);continue}}}}function xl(e,t={}){e&&(bl(e,t),wl(e))}function vl(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function Sl(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function El(e,t){if(!(e instanceof Element)||vl(e)||Sl(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 Cl(e,t,n=new Map){function r(i,o){if(!(i instanceof Element)||!(o instanceof Element))return;let a=i.childElementCount>o.childElementCount,s=n.get(i)||getComputedStyle(i);if(n.has(i)||n.set(i,s),a&&El(i,s)){o.style.height||(o.style.height="auto"),o.style.width||(o.style.width="auto"),o.style.removeProperty("block-size"),o.style.removeProperty("inline-size"),o.style.minHeight||(o.style.minHeight="0"),o.style.minWidth||(o.style.minWidth="0"),o.style.maxHeight||(o.style.maxHeight="none"),o.style.maxWidth||(o.style.maxWidth="none");let u=s.overflowY||s.overflowBlock||"visible",d=s.overflowX||s.overflowInline||"visible";(u!=="visible"||d!=="visible")&&(o.style.overflow="visible")}let c=Array.from(i.children),l=Array.from(o.children);for(let u=0;u<Math.min(c.length,l.length);u++)r(c[u],l[u])}r(e,t)}function kl(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function Ml(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){_(t,"exclude selector match failed",r)}return!1}function Al(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,o=-1/0,a=!1,s=Array.from(e.children);for(let m of s){if(Ml(m,t)||!kl(m))continue;let g=m.getBoundingClientRect(),h=g.top-r.top,p=g.bottom-r.top;p<=h||(h<i&&(i=h),p>o&&(o=p),a=!0)}let c=a?Math.max(0,o-i):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 A=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,$l=/::-webkit-scrollbar(-[a-z]+)?\b/i;function qt(e,t=new Set){let n="";if(!e)return n;for(let r=0;r<e.length;r++){let i=e[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=qt(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=qt(i.cssRules,t);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if($l.test(o)){let a=i.cssText;a&&!t.has(a)&&(t.add(a),n+=a)}}}catch{}}return n}function Ll(e){if(!e||!e.styleSheets)return"";let t=new Set,n="";for(let r of Array.from(e.styleSheets))try{let i=r.cssRules;i&&(n+=qt(i,t))}catch{}return n}function Nl(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,i=0,o=0,a=0;for(let s of n){let c=s.match(/-?\d+(\.\d+)?px/g)?.map(h=>parseFloat(h))||[];if(c.length<2)continue;let[l,u,d=0,f=0]=c,m=Math.abs(l)+d+f,g=Math.abs(u)+d+f;i=Math.max(i,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),o=Math.max(o,g+Math.max(u,0)),r=Math.max(r,g+Math.max(-u,0))}return{top:Math.ceil(r),right:Math.ceil(i),bottom:Math.ceil(o),left:Math.ceil(a)}}function Tl(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 Rl(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 _l(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,i=0,o=0,a=0,s=!1;for(let c of n){s=!0;let l=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(h=>parseFloat(h))||[],[u=0,d=0,f=0]=l,m=Math.abs(u)+f,g=Math.abs(d)+f;i=Math.max(i,m+Math.max(u,0)),a=Math.max(a,m+Math.max(-u,0)),o=Math.max(o,g+Math.max(d,0)),r=Math.max(r,g+Math.max(-d,0))}return{bleed:{top:A(r),right:A(i),bottom:A(o),left:A(a)},has:s}}function Pl(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=kr(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 i(s,c,l,u){let d=Math.sqrt(s*s+c*c)||0,f=0,m=0;if(d>0){let g=s/d,h=c/d;f=g*l+h*u;let p=l-g*f,y=u-h*f;m=Math.sqrt(p*p+y*y)||0,m>0?f=f/m:f=0}return{a:d,b:0,c:f*m,d:m}}let o=r.match(/^matrix\(\s*([^)]+)\)$/i);if(o){let s=o[1].split(",").map(c=>parseFloat(c.trim()));if(s.length===6&&s.every(Number.isFinite)){let[c,l,u,d]=s,f=i(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=i(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=i(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 Gn(e,t,n,r,i){let o=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-i,S=o*b+s*w,E=a*b+c*w;return S+=r+l,E+=i+u,[S,E]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],m=1/0,g=1/0,h=-1/0,p=-1/0;for(let[y,v]of f)y<m&&(m=y),v<g&&(g=v),y>h&&(h=y),v>p&&(p=v);return{minX:m,minY:g,maxX:h,maxY:p,width:h-m,height:p-g}}function Fl(e,t,n){let r=(e.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[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(i,t),oy:a(o,n)}}function Dl(e){let t={rotate:"0deg",scale:null,translate:null},n=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(n){let i=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},o=i("rotate");if(o)if(o.angle){let c=o.angle;t.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else o.unit?t.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:t.rotate=String(o);else{let c=getComputedStyle(e);t.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let a=i("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=i("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 Tt=null;function Il(){if(Tt)return Tt;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),Tt=e,e}function Ol(e){let t=Il(),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=kr(n);return t.removeChild(n),r}function Hl(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",i=t.scale&&t.scale!=="none"&&t.scale!=="1",o=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(r||i||o)}function kr(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 Mr(e,t){if(!e)throw new Error("Element cannot be null or undefined");li(t.cache);let n=t.fast,r=t.outerTransforms!==!1,i=!!t.outerShadows,o={element:e,options:t,plugins:t.plugins},a,s,c,l="",u="",d,f,m=null;await de("beforeSnap",o),await de("beforeClone",o);let g=ll(o.element);try{({clone:a,classCSS:s,styleCache:c}=await nl(o.element,o.options)),!r&&a&&(m=Pl(o.element,a)),!i&&a&&yl(o.element,a,o.options)}finally{g()}if(o={clone:a,classCSS:s,styleCache:c,...o},await de("afterClone",o),xl(o.clone),o.options?.excludeMode==="remove")try{Cl(o.element,o.clone,o.styleCache)}catch(b){console.warn("[snapdom] shrink pass failed:",b)}try{await Ea(o.clone,o.element)}catch{}await new Promise(b=>{Me(async()=>{await il(o.clone,o.options),b()},{fast:n})}),await new Promise(b=>{Me(async()=>{await al(o.element,o.clone,o.styleCache,o.options),b()},{fast:n})}),t.embedFonts&&await new Promise(b=>{Me(async()=>{let w=br(o.element),S=Wa(o.element);if(ge()){let E=new Set(Array.from(w).map(x=>String(x).split("__")[0]).filter(Boolean));await xr(E,1)}l=await Ha({required:w,usedCodepoints:S,preCached:!1,exclude:o.options.excludeFonts,useProxy:o.options.useProxy,fontStylesheetDomains:o.options.fontStylesheetDomains}),b()},{fast:n})});let h=wi(o.clone).sort(),p=h.join(",");C.baseStyle.has(p)?u=C.baseStyle.get(p):await new Promise(b=>{Me(()=>{u=bi(h),C.baseStyle.set(p,u),b()},{fast:n})});let y=Ll(o.element?.ownerDocument||document);o={fontsCSS:l,baseCSS:u,scrollbarCSS:y,...o},await de("beforeRender",o),await new Promise(b=>{Me(()=>{let w=ae(o.element),S=o.element.getBoundingClientRect(),E=Math.max(1,A(o.element.offsetWidth||parseFloat(w.width)||S.width||1)),x=Math.max(1,A(o.element.offsetHeight||parseFloat(w.height)||S.height||1)),k=o.element.ownerDocument||document;if(o.element===k.body||o.element===k.documentElement){let U=Math.max(o.element.scrollHeight||0,k.documentElement?.scrollHeight||0,k.body?.scrollHeight||0),q=Math.max(o.element.scrollWidth||0,k.documentElement?.scrollWidth||0,k.body?.scrollWidth||0);U>0&&(x=Math.max(x,A(U))),q>0&&(E=Math.max(E,A(q)));try{let ee=(o.scrollbarCSS||"").length+(o.baseCSS||"").length+(o.fontsCSS||"").length+(o.classCSS||"").length,te=C.measureHints.get(o.element);if(te&&te.cssLen===ee&&te.w0===E)te.csh>0&&(x=Math.max(x,A(te.csh))),te.csw>0&&(E=Math.max(E,A(te.csw)));else{let ne=k.createElement("div");ne.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+E+"px!important;overflow:visible!important;visibility:hidden!important;";let ze=k.createElement("style");ze.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,ne.appendChild(ze),ne.appendChild(o.clone.cloneNode(!0)),k.body.appendChild(ne);let ue=ne.scrollHeight,bt=ne.scrollWidth;k.body.removeChild(ne),C.measureHints.set(o.element,{cssLen:ee,w0:E,csh:ue,csw:bt}),ue>0&&(x=Math.max(x,A(ue))),bt>0&&(E=Math.max(E,A(bt)))}}catch{}}if(o.options?.excludeMode==="remove"){let U=Al(o.element,o.options);Number.isFinite(U)&&U>0&&(x=Math.max(1,Math.min(x,A(U+1))))}let N=(U,q=NaN)=>{let ee=typeof U=="string"?parseFloat(U):U;return Number.isFinite(ee)?ee:q},O=N(o.options.width),F=N(o.options.height),L=E,$=x,D=Number.isFinite(O),B=Number.isFinite(F),je=x>0?E/x:1;D&&B?(L=Math.max(1,A(O)),$=Math.max(1,A(F))):D?(L=Math.max(1,A(O)),$=Math.max(1,A(L/(je||1)))):B?($=Math.max(1,A(F)),L=Math.max(1,A($*(je||1)))):(L=E,$=x);let T=0,R=0,H=E,I=x;if(!r&&m&&Number.isFinite(m.a)){let U={a:m.a,b:m.b||0,c:m.c||0,d:m.d||1,e:0,f:0},q=Gn(E,x,U,0,0);T=A(q.minX),R=A(q.minY),H=A(q.maxX),I=A(q.maxY)}else if(r&&Kn(o.element)){let U=w.transform&&w.transform!=="none"?w.transform:"",q=Dl(o.element),ee=Ol({baseTransform:U,rotate:q.rotate||"0deg",scale:q.scale,translate:q.translate}),{ox:te,oy:ne}=Fl(w,E,x),ze=ee.is2D?ee:new DOMMatrix(ee.toString()),ue=Gn(E,x,ze,te,ne);T=A(ue.minX),R=A(ue.minY),H=A(ue.maxX),I=A(ue.maxY)}let le=Nl(w),Q=Tl(w),be=Rl(w),xe=_l(w),fe=i?{top:A(le.top+Q.top+be.top+xe.bleed.top),right:A(le.right+Q.right+be.right+xe.bleed.right),bottom:A(le.bottom+Q.bottom+be.bottom+xe.bleed.bottom),left:A(le.left+Q.left+be.left+xe.bleed.left)}:{top:0,right:0,bottom:0,left:0};T=A(T-fe.left),R=A(R-fe.top),H=A(H+fe.right),I=A(I+fe.bottom);let Te=Math.max(1,A(H-T)),tn=Math.max(1,A(I-R)),So=D||B?A(L/E):1,Eo=B||D?A($/x):1,Co=Math.max(1,A(Te*So)),ko=Math.max(1,A(tn*Eo)),nn="http://www.w3.org/2000/svg",Mo=ge()&&Kn(o.element)?1:0,se=A(Mo+(r?0:1)),ce=document.createElementNS(nn,"foreignObject"),Ao=A(T),$o=A(R);ce.setAttribute("x",String(A(-(Ao-se)))),ce.setAttribute("y",String(A(-($o-se)))),ce.setAttribute("width",String(A(E+se*2))),ce.setAttribute("height",String(A(x+se*2))),ce.style.overflow="visible";let rn=document.createElement("style"),Lo='svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject *{min-width:0;} foreignObject pre,foreignObject [style*="white-space"]{white-space:inherit;}';rn.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+Lo+o.classCSS,ce.appendChild(rn);let Ve=document.createElement("div");Ve.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ve.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${A(E)}px;height:${A(x)}px`,Ve.appendChild(o.clone),ce.appendChild(Ve);let No=new XMLSerializer().serializeToString(ce),yt=A(Te+se*2),wt=A(tn+se*2),on=D||B;t.meta={w0:E,h0:x,vbW:yt,vbH:wt,targetW:L,targetH:$};let To=ge()&&on?yt:A(Co+se*2),Ro=ge()&&on?wt:A(ko+se*2),_o=parseFloat(ae(k.documentElement)?.fontSize)||16;f=`<svg xmlns="${nn}" width="${To}" height="${Ro}" viewBox="0 0 ${yt} ${wt}" font-size="${_o}px">`+No+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,o={svgString:f,dataURL:d,...o},b()},{fast:n})}),await de("afterRender",o);let v=document.getElementById("snapdom-sandbox");return v&&v.style.position==="absolute"&&v.remove(),o.dataURL}function Kn(e){return Hl(e)}G();function Wl(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let n=ai(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}}We();or();J();$e();G();function Bl(...e){return ml(...e),P}var P=Object.assign(ql,{plugins:Bl}),Ar=Symbol("snapdom.internal"),Ul=Symbol("snapdom.internal.silent"),Jn=!1;async function ql(e,t){if(!e)throw new Error("Element cannot be null or undefined");let n=Wl(t);if(gl(n,t&&t.plugins),ge()&&(n.embedFonts===!0||Vl(e))){if(n.embedFonts)try{let i=br(e),o=new Set([...i].map(a=>String(a).split("__")[0]).filter(Boolean));await xr(o,1)}catch{}let r=n.safariWarmupAttempts??3;for(let i=0;i<r;i++)try{await jl(e,t)}catch{}}return n.iconFonts&&n.iconFonts.length>0&&ga(n.iconFonts),n.snap||(n.snap={toPng:(r,i)=>P.toPng(r,i),toSvg:(r,i)=>P.toSvg(r,i)}),P.capture(e,n,Ar)}P.capture=async(e,t,n)=>{if(n!==Ar)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await Mr(e,t),i={img:async(h,p)=>{let{toImg:y}=await Promise.resolve().then(()=>(Tn(),Ft));return y(r,{...h,...p||{}})},svg:async(h,p)=>{let{toSvg:y}=await Promise.resolve().then(()=>(Tn(),Ft));return y(r,{...h,...p||{}})},canvas:async(h,p)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(it(),ir));return y(r,{...h,...p||{}})},blob:async(h,p)=>{let{toBlob:y}=await Promise.resolve().then(()=>(ur(),sr));return y(r,{...h,...p||{}})},png:async(h,p)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Je(),Ke));return y(r,{...h,...p||{},format:"png"})},jpeg:async(h,p)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Je(),Ke));return y(r,{...h,...p||{},format:"jpeg"})},webp:async(h,p)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Je(),Ke));return y(r,{...h,...p||{},format:"webp"})},download:async(h,p)=>{let{download:y}=await Promise.resolve().then(()=>(Pi(),dr));return y(r,{...h,...p||{}})}},o={};for(let h of["img","svg","canvas","blob","png","jpeg","webp"])o[h]=async p=>i[h](t,{...p||{},[Ul]:!0});o.jpg=o.jpeg;let a={...t,export:{url:r},exports:o},s=await pl("defineExports",a),c=Object.assign({},...s.filter(h=>h&&typeof h=="object")),l={...i,...c};l.jpeg&&!l.jpg&&(l.jpg=(h,p)=>l.jpeg(h,p));function u(h,p){let y={...t,...p||{}};return(h==="jpeg"||h==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,f=Promise.resolve();async function m(h,p){let y=async()=>{let v=l[h];if(!v)throw new Error(`[snapdom] Unknown export type: ${h}`);let b=u(h,p),w={...t,export:{type:h,options:b,url:r}};await de("beforeExport",w);let S=await v(w,b);return await de("afterExport",w,S),d||(d=!0,await de("afterSnap",t)),S};return f=f.then(y)}let g={url:r,toRaw:()=>r,to:(h,p)=>m(h,p),toImg:h=>m("img",h),toSvg:h=>m("svg",h),toCanvas:h=>m("canvas",h),toBlob:h=>m("blob",h),toPng:h=>m("png",h),toJpg:h=>m("jpg",h),toWebp:h=>m("webp",h),download:h=>m("download",h)};for(let h of Object.keys(l)){let p="to"+h.charAt(0).toUpperCase()+h.slice(1);g[p]||(g[p]=y=>m(h,y))}return g};P.toRaw=(e,t)=>P(e,t).then(n=>n.toRaw());P.toImg=(e,t)=>P(e,t).then(n=>n.toImg());P.toSvg=(e,t)=>P(e,t).then(n=>n.toSvg());P.toCanvas=(e,t)=>P(e,t).then(n=>n.toCanvas());P.toBlob=(e,t)=>P(e,t).then(n=>n.toBlob());P.toPng=(e,t)=>P(e,{...t,format:"png"}).then(n=>n.toPng());P.toJpg=(e,t)=>P(e,{...t,format:"jpeg"}).then(n=>n.toJpg());P.toWebp=(e,t)=>P(e,{...t,format:"webp"}).then(n=>n.toWebp());P.download=(e,t)=>P(e,t).then(n=>n.download());async function jl(e,t){if(Jn)return;let n={...t,fast:!0,embedFonts:!0,scale:.2},r;try{r=await Mr(e,n)}catch(i){_(t,"safariWarmup pre-capture failed",i)}await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i))),r&&await new Promise(i=>{let o=new Image;try{o.decoding="sync",o.loading="eager"}catch(a){_(t,"safariWarmup img hints failed",a)}o.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",o.src=r,document.body.appendChild(o),(async()=>{try{typeof o.decode=="function"&&await o.decode()}catch(s){_(t,"safariWarmup img.decode failed",s)}let a=performance.now();for(;!(o.complete&&o.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,o.naturalWidth||10),s.height=Math.max(1,o.naturalHeight||10);let c=s.getContext("2d");c&&c.drawImage(o,0,0)}catch{}await new Promise(s=>requestAnimationFrame(s));try{o.remove()}catch(s){_(t,"safariWarmup img.remove failed",s)}i()})()}),e.querySelectorAll("canvas").forEach(i=>{try{let o=i.getContext("2d",{willReadFrequently:!0});o&&o.getImageData(0,0,1,1)}catch(o){_(t,"safariWarmup canvas poke failed",o)}}),Jn=!0}function Vl(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();){let n=t.currentNode,r=getComputedStyle(n),i=r.backgroundImage&&r.backgroundImage!=="none",o=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(i||o||n.tagName==="CANVAS")return!0}return!1}function $r(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 Lr(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 Nr(){let e=document.querySelectorAll('link[rel~="stylesheet"]');for(let t of e)$r(t)&&Lr(t)}function zl(){let e=M().fonts;e.observer||(e.observer=new MutationObserver(t=>{for(let n of t)for(let r of n.addedNodes)r instanceof HTMLLinkElement&&$r(r)&&Lr(r)}),e.observer.observe(document.documentElement,{childList:!0,subtree:!0}))}function Tr(){let e=M().fonts;e.initialized||(e.initialized=!0,Nr(),zl())}async function Rr(){Nr();try{await document.fonts.ready}catch{}}var Yl=750,Xl=400;var ye=2,Pr=["#__mindstudio-cursor","#__mindstudio-cursor-ripple","#__mindstudio-notes-cursor","#__mindstudio-camera","#__mindstudio-flash"],Gl="#DD2590",Kl=`<svg width="44" height="44" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9
|
+
`):u+=f[0]}return u+=s.slice(d),u}let a=Hn(e,t||location.href);return a=await o(a,t||location.href,0),a}var pr=/url\((["']?)([^"')]+)\1\)/g,Fa=/@font-face[^{}]*\{[^}]*\}/g;function hr(e){if(!e)return[];let t=[],n=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let i=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let o=i[1],a=i[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(o),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(o);Array.isArray(c)?t.push([c[0],c[1]]):t.push([c,c])}}return t}function gr(e,t){if(!t.length||!e||e.size===0)return!0;for(let n of e)for(let[r,i]of t)if(n>=r&&n<=i)return!0;return!1}function Xt(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(pr)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,t||location.href).href}catch{}n.push(i)}}return n}async function yr(e,t,n=""){let r=e;for(let i of e.matchAll(pr)){let o=jt(i[0]);if(!o)continue;let a=o;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,t||location.href).href}catch{}if(!ie(a)){if(C.resource?.has(a)){C.font?.add(a),r=r.replace(i[0],`url(${C.resource.get(a)})`);continue}if(!C.font?.has(a))try{let s=await X(a,{as:"dataURL",useProxy:n,silent:!0});if(s.ok&&typeof s.data=="string"){let c=s.data;C.resource?.set(a,c),C.font?.add(a),r=r.replace(i[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return r}function Da(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),i=t(880,1023),o=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function Wn(e={}){let t=new Set((e.families||[]).map(i=>String(i).toLowerCase())),n=new Set((e.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((e.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(t.size&&t.has(i.family.toLowerCase()))return!0;if(n.size)for(let a of i.srcUrls)try{if(n.has(new URL(a).host.toLowerCase()))return!0}catch{}if(r.size){let a=Da(o);if(a&&r.has(a))return!0}return!1}}function Ia(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of e.match(t)||[]){let a=o.match(/font-family:\s*([^;]+);/i)?.[1]||"",s=Yt(a),c=(o.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),l=(o.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),u=(o.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),d=(o.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),f=(o.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),m=Xt(f,location.href),g=m.length?m.map(p=>String(p).toLowerCase()).sort().join("|"):f.toLowerCase(),h=[String(s||"").toLowerCase(),c,l,u,d.toLowerCase(),g].join("|");n.has(h)||(n.add(h),r.push(o))}if(r.length===0)return e;let i=0;return e.replace(t,()=>r[i++]||"")}function Oa(e,t,n,r,i){let o=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=(i||[]).map(u=>String(u).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${o}::ex=${a}::lf=${s}::px=${c}::fd=${l}`}async function wr(e,t,n,r){let i;try{i=e.cssRules||[]}catch{return}let o=(a,s)=>{try{return new URL(a,s||location.href).href}catch{return a}};for(let a of i){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let s=a.href?o(a.href,t):t;if(r.depth>=nt){console.warn(`[snapDOM] CSSOM import depth exceeded (${nt}) 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 wr(a.styleSheet,s,n,c);continue}if(a.type===CSSRule.FONT_FACE_RULE){let s=(a.style.getPropertyValue("font-family")||"").trim(),c=Yt(s);if(!c||ie(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 g=hr(m);if(!gr(r.usedCodepoints,g))continue;let h={family:c,weightSpec:l,styleSpec:u,stretchSpec:d,unicodeRange:m,srcRaw:f,srcUrls:Xt(f,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(h,g))continue;if(/url\(/i.test(f)){let p=await yr(f,t||location.href,r.useProxy);await n(`@font-face{font-family:${c};src:${p};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 Ha({required:e,usedCodepoints:t,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[]}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let a=new Map;for(let p of e){let[y,v,x,w]=String(p).split("__");if(!y)continue;let S=a.get(y)||[];S.push({w:parseInt(v,10),s:x,st:parseInt(w,10)}),a.set(y,S)}function s(p,y,v,x){if(!a.has(p))return!1;let w=a.get(p),S=$a(v),E=La(y),b=Na(x),k=S.min!==S.max,N=S.min,O=L=>E.kind==="normal"&&L==="normal"||E.kind!=="normal"&&(L==="italic"||L==="oblique"),F=!1;for(let L of w){let $=k?L.w>=S.min&&L.w<=S.max:L.w===N,D=O(et(L.s)),B=L.st>=b.min&&L.st<=b.max;if($&&D&&B){F=!0;break}}if(F)return!0;if(!k)for(let L of w){let $=O(et(L.s)),D=L.st>=b.min&&L.st<=b.max;if(Math.abs(N-L.w)<=300&&$&&D)return!0}if(!k&&E.kind==="normal"&&w.some(L=>et(L.s)!=="normal"))for(let L of w){let $=Math.abs(N-L.w)<=300,D=L.st>=b.min&&L.st<=b.max;if($&&D)return!0}return!1}let c=Wn(n),l=Oa(e,n,r,i,o);if(C.resource?.has(l))return C.resource.get(l);let u=_a(e),d=[],f=Ot;for(let p of document.querySelectorAll("style")){let y=p.textContent||"";for(let v of y.matchAll(f)){let x=(v[2]||v[4]||"").trim();!x||ie(x)||document.querySelector(`link[rel="stylesheet"][href="${x}"]`)||d.push(x)}}d.length&&await Promise.all(d.map(p=>new Promise(y=>{if(document.querySelector(`link[rel="stylesheet"][href="${p}"]`))return y(null);let v=document.createElement("link");v.rel="stylesheet",v.href=p,v.setAttribute("data-snapdom","injected-import"),v.onload=()=>y(v),v.onerror=()=>y(null),document.head.appendChild(v)})));let m="",g=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(p=>!!p.href);for(let p of g)try{if(ie(p.href))continue;let y="",v=!1;try{v=new URL(p.href,location.href).origin===location.origin}catch{}if(!v){let w=Array.isArray(o)?o:[];if(!Ra(p.href,u,w))continue}if(v){let w=Array.from(document.styleSheets).find(S=>S.href===p.href);if(w)try{let S=w.cssRules||[];y=Array.from(S).map(E=>E.cssText).join("")}catch{}}if(!y){let w=await X(p.href,{as:"text",useProxy:i});if(w?.ok&&typeof w.data=="string"&&(y=w.data),ie(p.href))continue}y=await Pa(y,p.href,i);let x="";for(let w of y.match(Fa)||[]){let S=(w.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),E=Yt(S);if(!E||ie(E))continue;let b=(w.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),k=(w.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),N=(w.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),O=(w.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),F=(w.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),L=Xt(F,p.href);if(!s(E,k,b,N))continue;let $=hr(O);if(!gr(t,$))continue;let D={family:E,weightSpec:b,styleSpec:k,stretchSpec:N,unicodeRange:O,srcRaw:F,srcUrls:L,href:p.href};if(n&&c(D,$))continue;let B=/url\(/i.test(F)?await yr(w,p.href,i):w;x+=B}x.trim()&&(m+=x)}catch{console.warn("[snapDOM] Failed to process stylesheet:",p.href)}let h={requiredIndex:a,usedCodepoints:t,faceMatchesRequired:s,simpleExcluder:n?Wn(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(let p of document.styleSheets)if(!(p.href&&g.some(y=>y.href===p.href)))try{let y=p.href||location.origin+"/";y&&h.visitedSheets.add(y),await wr(p,y,async v=>{m+=v},h)}catch{}try{for(let p of document.fonts||[]){if(!p||!p.family||p.status!=="loaded"||!p._snapdomSrc)continue;let y=String(p.family).replace(/^['"]+|['"]+$/g,"");if(ie(y)||!a.has(y)||n?.families&&n.families.some(x=>String(x).toLowerCase()===y.toLowerCase()))continue;let v=p._snapdomSrc;if(!String(v).startsWith("data:")){if(C.resource?.has(p._snapdomSrc))v=C.resource.get(p._snapdomSrc),C.font?.add(p._snapdomSrc);else if(!C.font?.has(p._snapdomSrc))try{let x=await X(p._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(x.ok&&typeof x.data=="string")v=x.data,C.resource?.set(p._snapdomSrc,v),C.font?.add(p._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",p._snapdomSrc);continue}}m+=`@font-face{font-family:'${y}';src:url(${v});font-style:${p.style||"normal"};font-weight:${p.weight||"normal"};}`}}catch{}for(let p of r){if(!p||typeof p!="object")continue;let y=String(p.family||"").replace(/^['"]+|['"]+$/g,"");if(!y||ie(y)||!a.has(y)||n?.families&&n.families.some(b=>String(b).toLowerCase()===y.toLowerCase()))continue;let v=p.weight!=null?String(p.weight):"normal",x=p.style!=null?String(p.style):"normal",w=p.stretchPct!=null?`${p.stretchPct}%`:"100%",S=String(p.src||""),E=S;if(!E.startsWith("data:")){if(C.resource?.has(S))E=C.resource.get(S),C.font?.add(S);else if(!C.font?.has(S))try{let b=await X(S,{as:"dataURL",useProxy:i,silent:!0});if(b.ok&&typeof b.data=="string")E=b.data,C.resource?.set(S,E),C.font?.add(S);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",S);continue}}m+=`@font-face{font-family:'${y}';src:url(${E});font-style:${x};font-weight:${v};font-stretch:${w};}`}return m&&(m=Ia(m),C.resource?.set(l,m)),m}function br(e){let t=new Set;if(!e)return t;let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),r=a=>{let s=Ma(a.fontFamily);if(s.length)for(let c of s){let l=(u,d,f)=>`${c}__${Qe(u)}__${et(d)}__${Aa(f)}`;t.add(l(a.fontWeight,a.fontStyle,a.fontStretch))}};r(getComputedStyle(e));let i=getComputedStyle(e,"::before");i&&i.content&&i.content!=="none"&&r(i);let o=getComputedStyle(e,"::after");for(o&&o.content&&o.content!=="none"&&r(o);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 Wa(e){let t=new Set,n=i=>{if(i)for(let o of i)t.add(o.codePointAt(0))},r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let i=r.currentNode;if(i.nodeType===Node.TEXT_NODE)n(i.nodeValue||"");else if(i.nodeType===Node.ELEMENT_NODE){let o=i;for(let a of["::before","::after"]){let s=getComputedStyle(o,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 xr(e,t=2){try{await document.fonts.ready}catch{}let n=Array.from(e||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let i=document.createElement("div");i.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let o of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${o}"`,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",i.appendChild(a)}document.body.appendChild(i),i.offsetWidth,document.body.removeChild(i)};for(let i=0;i<Math.max(1,t);i++)r(),await new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o)))}G();function Ba(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function Ua(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Bn(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 Un(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)),i="";for(let[o,a]of n)for(;r>=o;)i+=a,r-=o;return t?i:i.toLowerCase()}function qn(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 Bn(e,!1);case"upper-alpha":return Bn(e,!0);case"lower-roman":return Un(e,!1);case"upper-roman":return Un(e,!0);default:return String(e)}}function qa(e){let t=()=>C?.session?.__counterEpoch??0,n=t(),r=new WeakMap,i=e instanceof Document?e.documentElement:e,o=f=>f&&f.tagName==="LI",a=f=>{let m=0,g=f?.parentElement;if(!g)return 0;for(let h of g.children){if(h===f)break;h.tagName==="LI"&&m++}return m},s=f=>{let m=new Map;for(let[g,h]of f)m.set(g,h.slice());return m},c=(f,m,g)=>{let h=s(f),p;try{p=g.style?.counterReset||getComputedStyle(g).counterReset}catch{}if(p&&p!=="none")for(let x of p.split(",")){let w=x.trim().split(/\s+/),S=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!S)continue;let b=m.get(S);if(b&&b.length){let k=b.slice();k.push(E),h.set(S,k)}else h.set(S,[E])}let y;try{y=g.style?.counterSet||getComputedStyle(g).counterSet}catch{}if(y&&y!=="none")for(let x of y.split(",")){let w=x.trim().split(/\s+/),S=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!S)continue;let b=h.get(S)||[];b.length===0&&b.push(0),b[b.length-1]=E,h.set(S,b)}let v;try{v=g.style?.counterIncrement||getComputedStyle(g).counterIncrement}catch{}if(v&&v!=="none")for(let x of v.split(",")){let w=x.trim().split(/\s+/),S=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):1;if(!S)continue;let b=h.get(S)||[];b.length===0&&b.push(0),b[b.length-1]+=E,h.set(S,b)}try{if(getComputedStyle(g).display==="list-item"&&o(g)){let x=g.parentElement,w=1;if(x&&x.tagName==="OL"){let E=x.getAttribute("start"),b=Number.isFinite(Number(E))?Number(E):1,k=a(g),N=g.getAttribute("value");w=Number.isFinite(Number(N))?Number(N):b+k}else w=1+a(g);let S=h.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=w,h.set("list-item",S)}}catch{}return h},l=(f,m,g)=>{let h=c(g,m,f);r.set(f,h);let p=h;for(let v of f.children)p=l(v,h,p);let y=new Map;for(let[v,x]of g){let w=x.length,S=p.get(v);y.set(v,S&&S.length?S.slice(0,w):x.slice())}for(let[v,x]of p)!y.has(v)&&x.length&&!m.has(v)&&y.set(v,x.slice(0,1));return y},u=new Map;l(i,u,u);function d(){let f=t();if(f!==n){n=f;let m=new Map;l(i,m,m)}}return{get(f,m){d();let g=r.get(f)?.get(m);return g&&g.length?g[g.length-1]:0},getStack(f,m){d();let g=r.get(f)?.get(m);return g?g.slice():[]}}}function ja(e,t,n){if(!e||e==="none")return e;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,i=e.replace(r,(o,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 qn(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=>qn(m,d)).join(u):""}});return Ua(i)}catch{return"- "}}$e();G();var ke=new WeakMap,jn=1e3;function Va(e,t){let n=vr(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=zn(e),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):zn(e)}function Ht(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function vr(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${t.length}|`,r=0;for(let o=0;o<t.length;o++){let a=t[o];if(a.tagName==="STYLE"){let s=a.textContent?a.textContent.length:0;n+=`S${s}|`;let c=a.sheet,l=c?Ht(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?Ht(l):null;u&&(r+=u.length)}}let i=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(i)?i.length:0}|tr:${r}`,n}function Vn(e,t,n){let r=Ht(e);if(!r)return!1;for(let i=0;i<r.length;i++){if(n.budget<=0)return!1;let o=r[i],a=o&&o.cssText?o.cssText:"";n.budget--;for(let s of t)if(a.includes(s))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let s=0;s<o.cssRules.length&&n.budget>0;s++){let c=o.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 zn(e=document){let t=vr(e),n=ke.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"],i=e.querySelectorAll("style");for(let a=0;a<i.length;a++){let s=i[a].textContent||"";for(let c of r)if(s.includes(c))return ke.set(e,{fingerprint:t,result:!0}),!0}let o=e.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let a={budget:jn};try{for(let s of o)if(Vn(s,r,a))return ke.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),s={budget:jn};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&&Vn(u,r,s))return ke.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(ke.set(e,{fingerprint:t,result:!0}),!0):(ke.set(e,{fingerprint:t,result:!1}),!1)}var Ae=new WeakMap,Yn=-1;function za(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Ya(e){if(!e)return"";let t=[],n=/"([^"]*)"/g,r;for(;r=n.exec(e);)t.push(r[1]);return t.length?t.join(""):za(e)}function Wt(e,t){let n=e.parentElement,r=n?Ae.get(n):null;return r?{get(i,o){let a=t.get(i,o),s=r.get(o);return typeof s=="number"?Math.max(a,s):a},getStack(i,o){let a=t.getStack(i,o);if(!a.length)return a;let s=r.get(o);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 Bt(e,t,n){let r=new Map;function i(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 o=i(t?.counterReset),a=i(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=o.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 Xa(e,t,n){let r;try{r=ae(e,t)}catch{}let i=r?.content;if(!i||i==="none"||i==="normal")return{text:"",incs:[]};let o=Wt(e,n),a=Bt(e,r,o),s=Ba(i)?ja(i,e,a):i;return{text:Ya(s),incs:a.__incs||[]}}async function Ut(e,t,n,r){if(!(e instanceof Element)||!(t instanceof Element))return;let i=e.ownerDocument||document;if(!Va(i,n))return;let o=C?.session?.__counterEpoch??0;if(Yn!==o&&(Ae=new WeakMap,n&&(n.__counterCtx=null),Yn=o),!n.__counterCtx)try{n.__counterCtx=qa(e.ownerDocument||document)}catch(c){_(n,"buildCounterContext failed",c)}let a=n.__counterCtx;for(let c of["::before","::after","::first-letter"])try{let l=ae(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 T=ae(e);if(!(l.color!==T.color||l.fontSize!==T.fontSize||l.fontWeight!==T.fontWeight||l.fontFamily!==T.fontFamily||l.fontStyle!==T.fontStyle||l.textTransform!==T.textTransform||l.float!==T.float||l.paddingTop!==T.paddingTop||l.paddingRight!==T.paddingRight||l.paddingBottom!==T.paddingBottom||l.paddingLeft!==T.paddingLeft||l.marginTop!==T.marginTop||l.marginRight!==T.marginRight||l.marginBottom!==T.marginBottom||l.marginLeft!==T.marginLeft))continue;let R=Array.from(t.childNodes).find(Te=>Te.nodeType===Node.TEXT_NODE&&Te.textContent?.trim().length>0);if(!R)continue;let H=R.textContent,I=H.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],le=H.slice(I?.length||0);if(!I||/[\uD800-\uDFFF]/.test(I))continue;let Q=document.createElement("span");Q.textContent=I,Q.dataset.snapdomPseudo="::first-letter";let be=Ln(l),xe=_t(be,"span");n.styleMap.set(Q,xe);let fe=document.createTextNode(le);t.replaceChild(fe,R),t.insertBefore(Q,fe);continue}let u=l.content??"",d=u===""||u==="none"||u==="normal",{text:f,incs:m}=Xa(e,c,a),g=l.backgroundImage,h=l.backgroundColor,p=l.fontFamily,y=parseInt(l.fontSize)||32,v=parseInt(l.fontWeight)||!1,x=l.color||"#000",w=l.borderStyle,S=parseFloat(l.borderWidth),E=l.transform,b=ie(p),k=!d&&f!=="",N=g&&g!=="none",O=h&&h!=="transparent"&&h!=="rgba(0, 0, 0, 0)",F=w&&w!=="none"&&S>0,L=E&&E!=="none";if(!(k||N||O||F||L)){if(m&&m.length&&e.parentElement){let T=Ae.get(e.parentElement)||new Map;for(let{name:R}of m){if(!R)continue;let H=Wt(e,a),I=Bt(e,ae(e,c),H).get(e,R);T.set(R,I)}Ae.set(e.parentElement,T)}continue}let $=document.createElement("span");$.dataset.snapdomPseudo=c,$.style.pointerEvents="none";let D=Ln(l),B=_t(D,"span");if(n.styleMap.set($,B),b&&f&&f.length===1){let{dataUrl:T,width:R,height:H}=await Ca(f,p,v,y,x),I=document.createElement("img");I.src=T,I.style=`height:${y}px;width:${R/H*y}px;object-fit:contain;`,$.appendChild(I),t.dataset.snapdomHasIcon="true"}else if(f&&f.startsWith("url(")){let T=jt(f);if(T?.trim())try{let R=await X(tt(T),{as:"dataURL",useProxy:r.useProxy});if(R?.ok&&typeof R.data=="string"){let H=document.createElement("img");H.src=R.data,H.style=`width:${y}px;height:auto;object-fit:contain;`,$.appendChild(H)}}catch(R){console.error(`[snapdom] Error in pseudo ${c} for`,e,R)}}else!b&&k&&($.textContent=f);$.style.backgroundImage="none","maskImage"in $.style&&($.style.maskImage="none"),"webkitMaskImage"in $.style&&($.style.webkitMaskImage="none");try{$.style.backgroundRepeat=l.backgroundRepeat,$.style.backgroundSize=l.backgroundSize,l.backgroundPositionX&&l.backgroundPositionY?($.style.backgroundPositionX=l.backgroundPositionX,$.style.backgroundPositionY=l.backgroundPositionY):$.style.backgroundPosition=l.backgroundPosition,$.style.backgroundOrigin=l.backgroundOrigin,$.style.backgroundClip=l.backgroundClip,$.style.backgroundAttachment=l.backgroundAttachment,$.style.backgroundBlendMode=l.backgroundBlendMode}catch{}if(N)try{let T=Pt(g),R=await Promise.all(T.map(Zn));$.style.backgroundImage=R.join(", ")}catch(T){console.warn(`[snapdom] Failed to inline background-image for ${c}`,T)}O&&($.style.backgroundColor=h);let je=$.childNodes.length>0||$.textContent?.trim()!==""||N||O||F||L;if(m&&m.length&&e.parentElement){let T=Ae.get(e.parentElement)||new Map,R=Wt(e,a),H=Bt(e,ae(e,c),R);for(let{name:I}of m){if(!I)continue;let le=H.get(e,I);T.set(I,le)}Ae.set(e.parentElement,T)}if(!je)continue;c==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore($,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild($))}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 Ut(l,c,n,r)}else{let c=Array.from(e.children);for(let l=0;l<Math.min(c.length,s.length);l++)await Ut(c[l],s[l],n,r)}}function Ga(e,t){if(!e||!(e instanceof Element))return;let n=e.ownerDocument||document,r=t||n,i=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(i.length===0)return;let o=/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 E=w.attributes;if(!E)return null;for(let b=0;b<E.length;b++){let k=E[b];if(!k||!k.name)continue;if(k.name==="href")return k.value;let N=k.name.indexOf(":");if(N!==-1&&k.name.slice(N+1)==="href")return k.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;o.lastIndex=0;let E;for(;E=o.exec(w);){f=!0;let b=(E[1]||"").trim();b&&(u.has(b)||(d.add(b),S&&!S.has(b)&&S.add(b)))}},g=w=>{let S=w.querySelectorAll("use");for(let b of S){let k=l(b);if(!k||!k.startsWith("#"))continue;f=!0;let N=k.slice(1).trim();N&&!u.has(N)&&d.add(N)}let E=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 b of E){m(b.getAttribute("style")||"");for(let k of a)m(b.getAttribute(k))}};for(let w of i)g(w);if(!f)return;let h=e.querySelector("svg.inline-defs-container");h||(h=n.createElementNS("http://www.w3.org/2000/svg","svg"),h.classList.add("inline-defs-container"),h.setAttribute("aria-hidden","true"),h.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(h,e.firstChild||null));let p=h.querySelector("defs")||null,y=w=>{if(!w||u.has(w))return null;let S=s(w),E=b=>{let k=r.querySelector(b);return k&&!e.contains(k)?k:null};return E(`svg defs > *#${S}`)||E(`svg > symbol#${S}`)||E(`*#${S}`)};if(!d.size)return;let v=new Set(d),x=new Set;for(;v.size;){let w=v.values().next().value;if(v.delete(w),!w||u.has(w)||x.has(w))continue;let S=y(w);if(!S){x.add(w);continue}p||(p=n.createElementNS("http://www.w3.org/2000/svg","defs"),h.appendChild(p));let E=S.cloneNode(!0);E.id||E.setAttribute("id",w),p.appendChild(E),x.add(w),u.add(w);let b=[E,...E.querySelectorAll("*")];for(let k of b){let N=l(k);if(N&&N.startsWith("#")){let F=N.slice(1).trim();F&&!u.has(F)&&!x.has(F)&&v.add(F)}let O=k.getAttribute?.("style")||"";O&&m(O,v);for(let F of a){let L=k.getAttribute?.(F);L&&m(L,v)}}}}G();function Ka(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(),i=e.clientHeight,o="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=Xn(c.top),d=Xn(c.bottom);if(u==null&&d==null)continue;let f=Ja(s,e),m=Za(t,f,o);if(!m)continue;let g=s.getBoundingClientRect(),h=g.width,p=g.height,y=g.left-r.left;if(!(h>0&&p>0)||!Number.isFinite(y))continue;let v=u!=null?u+n:n+(i-p-d);if(!Number.isFinite(v))continue;let x=Number.parseInt(c.zIndex,10),w=Number.isFinite(x),S=w?Math.max(x,1)+1:2,E=w?x-1:0,b=m.cloneNode(!1);b.setAttribute(o,"1"),b.style.position="sticky",b.style.left=`${y}px`,b.style.top=`${v}px`,b.style.width=`${h}px`,b.style.height=`${p}px`,b.style.visibility="hidden",b.style.zIndex=String(E),b.style.overflow="hidden",b.style.background="transparent",b.style.boxShadow="none",b.style.filter="none",m.parentElement?.insertBefore(b,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 Xn(e){if(!e||e==="auto")return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function Ja(e,t){let n=[];for(let r=e;r&&r!==t;){let i=r.parentElement;if(!i)break;n.push(Array.prototype.indexOf.call(i.children,r)),r=i}return n.reverse()}function Za(e,t,n){let r=e;for(let i=0;i<t.length;i++)if(r=Qa(r,n)[t[i]],!r)return null;return r instanceof HTMLElement?r:null}function Qa(e,t){let n=[],r=e.children;for(let i=0;i<r.length;i++){let o=r[i];o.hasAttribute(t)||n.push(o)}return n}function el(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=t.borderStyle,o=t.borderWidth,a=n!=="none"&&parseFloat(r)>0,s=i==="none"||parseFloat(o)===0;a&&s&&(e.style.border=`${r} solid transparent`)}function tl(e){let t=[];try{let n=e.querySelectorAll("*");for(let r of n){if(!(r instanceof HTMLElement))continue;let i=r.style.contentVisibility||"",o=getComputedStyle(r),a=o.contentVisibility||o.getPropertyValue("content-visibility")||"";(a==="auto"||a==="hidden")&&(t.push({el:r,original:i}),r.style.contentVisibility="visible")}if(e instanceof HTMLElement){let r=getComputedStyle(e),i=r.contentVisibility||r.getPropertyValue("content-visibility")||"";(i==="auto"||i==="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 nl(e,t={}){let n={styleMap:C.session.styleMap,styleCache:C.session.styleCache,nodeMap:C.session.nodeMap,options:t},r,i="",o="";el(e);let a=tl(e);try{Ga(e)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{r=await Ze(e,n,t)}catch(l){throw console.warn("deepClone failed:",l),l}finally{a()}try{await Ut(e,r,n,t)}catch(l){console.warn("inlinePseudoElements failed:",l)}await pa(r,n);try{let l=r.querySelectorAll("style[data-sd]");for(let u of l)o+=u.textContent||"",u.remove()}catch(l){_(n,"Failed to extract shadow CSS from style[data-sd]",l)}let s=xi(n.styleMap);i=Array.from(s.entries()).map(([l,u])=>`.${u}{${l}}`).join(""),i=o+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+i;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 g=l.querySelectorAll("*");for(let h of g){if(!(h instanceof HTMLElement))continue;let p=h.style.position;if(p==="fixed"||p==="absolute"){let y=parseFloat(h.style.top)||0,v=parseFloat(h.style.left)||0;h.style.top=`${y+f}px`,h.style.left=`${v+d}px`,p==="fixed"&&(h.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(Ka(e,c),e===n.nodeMap.get(r)){let l=n.styleCache.get(e)||ae(e);n.styleCache.set(e,l);let u=si(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:i,styleCache:n.styleCache}}$e();var Sr="http://www.w3.org/1999/xlink";function rl(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(Sr,"href"):null)}function ol(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,n=parseInt(e.dataset?.snapdomHeight||"",10)||0,r=parseInt(e.getAttribute("width")||"",10)||0,i=parseInt(e.getAttribute("height")||"",10)||0,o=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0,s=t||o||r||e.width||e.naturalWidth||100,c=n||a||i||e.height||e.naturalHeight||100;return{width:s,height:c}}async function il(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 X(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}=ol(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 X(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 i=Array.from(e.querySelectorAll("image")),o=async a=>{let s=rl(a);if(!s||s.startsWith("data:")||s.startsWith("blob:"))return;let c=await X(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(Sr,"href"))};for(let a=0;a<i.length;a+=4){let s=i.slice(a,a+4).map(o);await Promise.allSettled(s)}}J();async function al(e,t,n,r={}){let i=[[e,t]],o=["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(;i.length;){let[l,u]=i.shift();if(!u)continue;let d=n.get(l)||ae(l);n.has(l)||n.set(l,d);let f=(()=>{let h=d.getPropertyValue("border-image"),p=d.getPropertyValue("border-image-source");return h&&h!=="none"||p&&p!=="none"})();for(let h of s){let p=d.getPropertyValue(h);p&&u.style.setProperty(h,p)}for(let h of o){let p=d.getPropertyValue(h);if(h==="background-image"&&(!p||p==="none")){let x=d.getPropertyValue("background");x&&/url\s*\(/.test(x)&&(p=Pt(x).filter(w=>/url\s*\(/.test(w)).join(", ")||p)}if(!p||p==="none")continue;let y=Pt(p),v=await Promise.all(y.map(x=>Zn(x,r)));v.some(x=>x&&x!=="none"&&!/^url\(undefined/.test(x))&&u.style.setProperty(h,v.join(", "))}for(let h of a){let p=d.getPropertyValue(h);!p||p==="initial"||u.style.setProperty(h,p)}if(f)for(let h of c){let p=d.getPropertyValue(h);!p||p==="initial"||u.style.setProperty(h,p)}let m=l.shadowRoot?Array.from(l.shadowRoot.children).filter(h=>h.tagName!=="STYLE"):Array.from(l.children),g=Array.from(u.children).filter(h=>!(h.dataset?.snapdomPseudo||h.tagName==="STYLE"&&h.dataset?.sd));for(let h=0;h<Math.min(m.length,g.length);h++)i.push([m[h],g[h]])}}J();G();function ll(e){if(!e)return()=>{};let t=[];function n(r){let i=sl(r);i&&t.push(i);for(let o of r.children||[])n(o)}return n(e),()=>t.forEach(r=>r())}function sl(e){if(!e)return()=>{};let t=cl(e);if(t<=0)return()=>{};if(!fl(e))return()=>{};let n=getComputedStyle(e),r=Math.round(ul(n)*t+dl(n)),i=e.textContent??"",o=i;if(e.scrollHeight<=r+.5)return()=>{};let a=0,s=i.length,c=-1;for(;a<=s;){let l=a+s>>1;e.textContent=i.slice(0,l)+"\u2026",e.scrollHeight<=r+.5?(c=l,a=l+1):s=l-1}return e.textContent=(c>=0?i.slice(0,c):"")+"\u2026",()=>{e.textContent=o}}function cl(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 ul(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 dl(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function fl(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var Oe=[];function Er(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 ml(...e){let t=e.flat();for(let n of t){let r=Er(n);r&&(Oe.some(i=>i&&i.name&&r.name&&i.name===r.name)||Oe.push(r))}}function Cr(e){return(e&&Array.isArray(e.plugins)?e.plugins:Oe)||Oe}async function de(e,t,n){let r=n,i=Cr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let s=await a(t,r);typeof s<"u"&&(r=s)}return r}async function pl(e,t,n){let r=[],i=Cr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let s=await a(t,n);typeof s<"u"&&r.push(s)}return r}function hl(e){let t=[];if(Array.isArray(e))for(let n of e){let r=Er(n);if(!r||!r.name)continue;let i=t.findIndex(o=>o&&o.name===r.name);i>=0&&t.splice(i,1),t.push(r)}for(let n of Oe)n&&n.name&&!t.some(r=>r.name===n.name)&&t.push(n);return Object.freeze(t)}function gl(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=hl(t)),e}J();function yl(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow="none"}catch(o){_(n,"stripRootShadows boxShadow",o)}try{t.style.textShadow="none"}catch(o){_(n,"stripRootShadows textShadow",o)}try{t.style.outline="none"}catch(o){_(n,"stripRootShadows outline",o)}let i=(r.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=i.length?i:"none"}catch(o){_(n,"stripRootShadows filter",o)}}function wl(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 bl(e,t={}){let{stripFrameworkDirectives:n=!0}=t,r=new Set(["xml","xlink"]),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let o=i.currentNode;for(let a of Array.from(o.attributes)){let s=a.name;if(s.includes("@")){o.removeAttribute(s);continue}if(s.includes(":")){let c=s.split(":",1)[0];if(!r.has(c)){o.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:"))){o.removeAttribute(s);continue}}}}function xl(e,t={}){e&&(bl(e,t),wl(e))}function vl(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function Sl(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function El(e,t){if(!(e instanceof Element)||vl(e)||Sl(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 Cl(e,t,n=new Map){function r(i,o){if(!(i instanceof Element)||!(o instanceof Element))return;let a=i.childElementCount>o.childElementCount,s=n.get(i)||getComputedStyle(i);if(n.has(i)||n.set(i,s),a&&El(i,s)){o.style.height||(o.style.height="auto"),o.style.width||(o.style.width="auto"),o.style.removeProperty("block-size"),o.style.removeProperty("inline-size"),o.style.minHeight||(o.style.minHeight="0"),o.style.minWidth||(o.style.minWidth="0"),o.style.maxHeight||(o.style.maxHeight="none"),o.style.maxWidth||(o.style.maxWidth="none");let u=s.overflowY||s.overflowBlock||"visible",d=s.overflowX||s.overflowInline||"visible";(u!=="visible"||d!=="visible")&&(o.style.overflow="visible")}let c=Array.from(i.children),l=Array.from(o.children);for(let u=0;u<Math.min(c.length,l.length);u++)r(c[u],l[u])}r(e,t)}function kl(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function Ml(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){_(t,"exclude selector match failed",r)}return!1}function Al(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,o=-1/0,a=!1,s=Array.from(e.children);for(let m of s){if(Ml(m,t)||!kl(m))continue;let g=m.getBoundingClientRect(),h=g.top-r.top,p=g.bottom-r.top;p<=h||(h<i&&(i=h),p>o&&(o=p),a=!0)}let c=a?Math.max(0,o-i):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 A=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,$l=/::-webkit-scrollbar(-[a-z]+)?\b/i;function qt(e,t=new Set){let n="";if(!e)return n;for(let r=0;r<e.length;r++){let i=e[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=qt(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=qt(i.cssRules,t);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if($l.test(o)){let a=i.cssText;a&&!t.has(a)&&(t.add(a),n+=a)}}}catch{}}return n}function Ll(e){if(!e||!e.styleSheets)return"";let t=new Set,n="";for(let r of Array.from(e.styleSheets))try{let i=r.cssRules;i&&(n+=qt(i,t))}catch{}return n}function Nl(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,i=0,o=0,a=0;for(let s of n){let c=s.match(/-?\d+(\.\d+)?px/g)?.map(h=>parseFloat(h))||[];if(c.length<2)continue;let[l,u,d=0,f=0]=c,m=Math.abs(l)+d+f,g=Math.abs(u)+d+f;i=Math.max(i,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),o=Math.max(o,g+Math.max(u,0)),r=Math.max(r,g+Math.max(-u,0))}return{top:Math.ceil(r),right:Math.ceil(i),bottom:Math.ceil(o),left:Math.ceil(a)}}function Tl(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 Rl(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 _l(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,i=0,o=0,a=0,s=!1;for(let c of n){s=!0;let l=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(h=>parseFloat(h))||[],[u=0,d=0,f=0]=l,m=Math.abs(u)+f,g=Math.abs(d)+f;i=Math.max(i,m+Math.max(u,0)),a=Math.max(a,m+Math.max(-u,0)),o=Math.max(o,g+Math.max(d,0)),r=Math.max(r,g+Math.max(-d,0))}return{bleed:{top:A(r),right:A(i),bottom:A(o),left:A(a)},has:s}}function Pl(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=kr(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 i(s,c,l,u){let d=Math.sqrt(s*s+c*c)||0,f=0,m=0;if(d>0){let g=s/d,h=c/d;f=g*l+h*u;let p=l-g*f,y=u-h*f;m=Math.sqrt(p*p+y*y)||0,m>0?f=f/m:f=0}return{a:d,b:0,c:f*m,d:m}}let o=r.match(/^matrix\(\s*([^)]+)\)$/i);if(o){let s=o[1].split(",").map(c=>parseFloat(c.trim()));if(s.length===6&&s.every(Number.isFinite)){let[c,l,u,d]=s,f=i(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=i(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=i(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 Gn(e,t,n,r,i){let o=n.a,a=n.b,s=n.c,c=n.d,l=n.e||0,u=n.f||0;function d(y,v){let x=y-r,w=v-i,S=o*x+s*w,E=a*x+c*w;return S+=r+l,E+=i+u,[S,E]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],m=1/0,g=1/0,h=-1/0,p=-1/0;for(let[y,v]of f)y<m&&(m=y),v<g&&(g=v),y>h&&(h=y),v>p&&(p=v);return{minX:m,minY:g,maxX:h,maxY:p,width:h-m,height:p-g}}function Fl(e,t,n){let r=(e.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[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(i,t),oy:a(o,n)}}function Dl(e){let t={rotate:"0deg",scale:null,translate:null},n=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(n){let i=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},o=i("rotate");if(o)if(o.angle){let c=o.angle;t.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else o.unit?t.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:t.rotate=String(o);else{let c=getComputedStyle(e);t.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let a=i("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=i("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 Tt=null;function Il(){if(Tt)return Tt;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),Tt=e,e}function Ol(e){let t=Il(),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=kr(n);return t.removeChild(n),r}function Hl(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",i=t.scale&&t.scale!=="none"&&t.scale!=="1",o=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(r||i||o)}function kr(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 Mr(e,t){if(!e)throw new Error("Element cannot be null or undefined");li(t.cache);let n=t.fast,r=t.outerTransforms!==!1,i=!!t.outerShadows,o={element:e,options:t,plugins:t.plugins},a,s,c,l="",u="",d,f,m=null;await de("beforeSnap",o),await de("beforeClone",o);let g=ll(o.element);try{({clone:a,classCSS:s,styleCache:c}=await nl(o.element,o.options)),!r&&a&&(m=Pl(o.element,a)),!i&&a&&yl(o.element,a,o.options)}finally{g()}if(o={clone:a,classCSS:s,styleCache:c,...o},await de("afterClone",o),xl(o.clone),o.options?.excludeMode==="remove")try{Cl(o.element,o.clone,o.styleCache)}catch(x){console.warn("[snapdom] shrink pass failed:",x)}try{await Ea(o.clone,o.element)}catch{}await new Promise(x=>{Me(async()=>{await il(o.clone,o.options),x()},{fast:n})}),await new Promise(x=>{Me(async()=>{await al(o.element,o.clone,o.styleCache,o.options),x()},{fast:n})}),t.embedFonts&&await new Promise(x=>{Me(async()=>{let w=br(o.element),S=Wa(o.element);if(ge()){let E=new Set(Array.from(w).map(b=>String(b).split("__")[0]).filter(Boolean));await xr(E,1)}l=await Ha({required:w,usedCodepoints:S,preCached:!1,exclude:o.options.excludeFonts,useProxy:o.options.useProxy,fontStylesheetDomains:o.options.fontStylesheetDomains}),x()},{fast:n})});let h=wi(o.clone).sort(),p=h.join(",");C.baseStyle.has(p)?u=C.baseStyle.get(p):await new Promise(x=>{Me(()=>{u=bi(h),C.baseStyle.set(p,u),x()},{fast:n})});let y=Ll(o.element?.ownerDocument||document);o={fontsCSS:l,baseCSS:u,scrollbarCSS:y,...o},await de("beforeRender",o),await new Promise(x=>{Me(()=>{let w=ae(o.element),S=o.element.getBoundingClientRect(),E=Math.max(1,A(o.element.offsetWidth||parseFloat(w.width)||S.width||1)),b=Math.max(1,A(o.element.offsetHeight||parseFloat(w.height)||S.height||1)),k=o.element.ownerDocument||document;if(o.element===k.body||o.element===k.documentElement){let U=Math.max(o.element.scrollHeight||0,k.documentElement?.scrollHeight||0,k.body?.scrollHeight||0),q=Math.max(o.element.scrollWidth||0,k.documentElement?.scrollWidth||0,k.body?.scrollWidth||0);U>0&&(b=Math.max(b,A(U))),q>0&&(E=Math.max(E,A(q)));try{let ee=(o.scrollbarCSS||"").length+(o.baseCSS||"").length+(o.fontsCSS||"").length+(o.classCSS||"").length,te=C.measureHints.get(o.element);if(te&&te.cssLen===ee&&te.w0===E)te.csh>0&&(b=Math.max(b,A(te.csh))),te.csw>0&&(E=Math.max(E,A(te.csw)));else{let ne=k.createElement("div");ne.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+E+"px!important;overflow:visible!important;visibility:hidden!important;";let ze=k.createElement("style");ze.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,ne.appendChild(ze),ne.appendChild(o.clone.cloneNode(!0)),k.body.appendChild(ne);let ue=ne.scrollHeight,bt=ne.scrollWidth;k.body.removeChild(ne),C.measureHints.set(o.element,{cssLen:ee,w0:E,csh:ue,csw:bt}),ue>0&&(b=Math.max(b,A(ue))),bt>0&&(E=Math.max(E,A(bt)))}}catch{}}if(o.options?.excludeMode==="remove"){let U=Al(o.element,o.options);Number.isFinite(U)&&U>0&&(b=Math.max(1,Math.min(b,A(U+1))))}let N=(U,q=NaN)=>{let ee=typeof U=="string"?parseFloat(U):U;return Number.isFinite(ee)?ee:q},O=N(o.options.width),F=N(o.options.height),L=E,$=b,D=Number.isFinite(O),B=Number.isFinite(F),je=b>0?E/b:1;D&&B?(L=Math.max(1,A(O)),$=Math.max(1,A(F))):D?(L=Math.max(1,A(O)),$=Math.max(1,A(L/(je||1)))):B?($=Math.max(1,A(F)),L=Math.max(1,A($*(je||1)))):(L=E,$=b);let T=0,R=0,H=E,I=b;if(!r&&m&&Number.isFinite(m.a)){let U={a:m.a,b:m.b||0,c:m.c||0,d:m.d||1,e:0,f:0},q=Gn(E,b,U,0,0);T=A(q.minX),R=A(q.minY),H=A(q.maxX),I=A(q.maxY)}else if(r&&Kn(o.element)){let U=w.transform&&w.transform!=="none"?w.transform:"",q=Dl(o.element),ee=Ol({baseTransform:U,rotate:q.rotate||"0deg",scale:q.scale,translate:q.translate}),{ox:te,oy:ne}=Fl(w,E,b),ze=ee.is2D?ee:new DOMMatrix(ee.toString()),ue=Gn(E,b,ze,te,ne);T=A(ue.minX),R=A(ue.minY),H=A(ue.maxX),I=A(ue.maxY)}let le=Nl(w),Q=Tl(w),be=Rl(w),xe=_l(w),fe=i?{top:A(le.top+Q.top+be.top+xe.bleed.top),right:A(le.right+Q.right+be.right+xe.bleed.right),bottom:A(le.bottom+Q.bottom+be.bottom+xe.bleed.bottom),left:A(le.left+Q.left+be.left+xe.bleed.left)}:{top:0,right:0,bottom:0,left:0};T=A(T-fe.left),R=A(R-fe.top),H=A(H+fe.right),I=A(I+fe.bottom);let Te=Math.max(1,A(H-T)),tn=Math.max(1,A(I-R)),So=D||B?A(L/E):1,Eo=B||D?A($/b):1,Co=Math.max(1,A(Te*So)),ko=Math.max(1,A(tn*Eo)),nn="http://www.w3.org/2000/svg",Mo=ge()&&Kn(o.element)?1:0,se=A(Mo+(r?0:1)),ce=document.createElementNS(nn,"foreignObject"),Ao=A(T),$o=A(R);ce.setAttribute("x",String(A(-(Ao-se)))),ce.setAttribute("y",String(A(-($o-se)))),ce.setAttribute("width",String(A(E+se*2))),ce.setAttribute("height",String(A(b+se*2))),ce.style.overflow="visible";let rn=document.createElement("style"),Lo='svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject *{min-width:0;} foreignObject pre,foreignObject [style*="white-space"]{white-space:inherit;}';rn.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+Lo+o.classCSS,ce.appendChild(rn);let Ve=document.createElement("div");Ve.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ve.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${A(E)}px;height:${A(b)}px`,Ve.appendChild(o.clone),ce.appendChild(Ve);let No=new XMLSerializer().serializeToString(ce),yt=A(Te+se*2),wt=A(tn+se*2),on=D||B;t.meta={w0:E,h0:b,vbW:yt,vbH:wt,targetW:L,targetH:$};let To=ge()&&on?yt:A(Co+se*2),Ro=ge()&&on?wt:A(ko+se*2),_o=parseFloat(ae(k.documentElement)?.fontSize)||16;f=`<svg xmlns="${nn}" width="${To}" height="${Ro}" viewBox="0 0 ${yt} ${wt}" font-size="${_o}px">`+No+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,o={svgString:f,dataURL:d,...o},x()},{fast:n})}),await de("afterRender",o);let v=document.getElementById("snapdom-sandbox");return v&&v.style.position==="absolute"&&v.remove(),o.dataURL}function Kn(e){return Hl(e)}G();function Wl(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let n=ai(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}}We();or();J();$e();G();function Bl(...e){return ml(...e),P}var P=Object.assign(ql,{plugins:Bl}),Ar=Symbol("snapdom.internal"),Ul=Symbol("snapdom.internal.silent"),Jn=!1;async function ql(e,t){if(!e)throw new Error("Element cannot be null or undefined");let n=Wl(t);if(gl(n,t&&t.plugins),ge()&&(n.embedFonts===!0||Vl(e))){if(n.embedFonts)try{let i=br(e),o=new Set([...i].map(a=>String(a).split("__")[0]).filter(Boolean));await xr(o,1)}catch{}let r=n.safariWarmupAttempts??3;for(let i=0;i<r;i++)try{await jl(e,t)}catch{}}return n.iconFonts&&n.iconFonts.length>0&&ga(n.iconFonts),n.snap||(n.snap={toPng:(r,i)=>P.toPng(r,i),toSvg:(r,i)=>P.toSvg(r,i)}),P.capture(e,n,Ar)}P.capture=async(e,t,n)=>{if(n!==Ar)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await Mr(e,t),i={img:async(h,p)=>{let{toImg:y}=await Promise.resolve().then(()=>(Tn(),Ft));return y(r,{...h,...p||{}})},svg:async(h,p)=>{let{toSvg:y}=await Promise.resolve().then(()=>(Tn(),Ft));return y(r,{...h,...p||{}})},canvas:async(h,p)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(it(),ir));return y(r,{...h,...p||{}})},blob:async(h,p)=>{let{toBlob:y}=await Promise.resolve().then(()=>(ur(),sr));return y(r,{...h,...p||{}})},png:async(h,p)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Je(),Ke));return y(r,{...h,...p||{},format:"png"})},jpeg:async(h,p)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Je(),Ke));return y(r,{...h,...p||{},format:"jpeg"})},webp:async(h,p)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Je(),Ke));return y(r,{...h,...p||{},format:"webp"})},download:async(h,p)=>{let{download:y}=await Promise.resolve().then(()=>(Pi(),dr));return y(r,{...h,...p||{}})}},o={};for(let h of["img","svg","canvas","blob","png","jpeg","webp"])o[h]=async p=>i[h](t,{...p||{},[Ul]:!0});o.jpg=o.jpeg;let a={...t,export:{url:r},exports:o},s=await pl("defineExports",a),c=Object.assign({},...s.filter(h=>h&&typeof h=="object")),l={...i,...c};l.jpeg&&!l.jpg&&(l.jpg=(h,p)=>l.jpeg(h,p));function u(h,p){let y={...t,...p||{}};return(h==="jpeg"||h==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,f=Promise.resolve();async function m(h,p){let y=async()=>{let v=l[h];if(!v)throw new Error(`[snapdom] Unknown export type: ${h}`);let x=u(h,p),w={...t,export:{type:h,options:x,url:r}};await de("beforeExport",w);let S=await v(w,x);return await de("afterExport",w,S),d||(d=!0,await de("afterSnap",t)),S};return f=f.then(y)}let g={url:r,toRaw:()=>r,to:(h,p)=>m(h,p),toImg:h=>m("img",h),toSvg:h=>m("svg",h),toCanvas:h=>m("canvas",h),toBlob:h=>m("blob",h),toPng:h=>m("png",h),toJpg:h=>m("jpg",h),toWebp:h=>m("webp",h),download:h=>m("download",h)};for(let h of Object.keys(l)){let p="to"+h.charAt(0).toUpperCase()+h.slice(1);g[p]||(g[p]=y=>m(h,y))}return g};P.toRaw=(e,t)=>P(e,t).then(n=>n.toRaw());P.toImg=(e,t)=>P(e,t).then(n=>n.toImg());P.toSvg=(e,t)=>P(e,t).then(n=>n.toSvg());P.toCanvas=(e,t)=>P(e,t).then(n=>n.toCanvas());P.toBlob=(e,t)=>P(e,t).then(n=>n.toBlob());P.toPng=(e,t)=>P(e,{...t,format:"png"}).then(n=>n.toPng());P.toJpg=(e,t)=>P(e,{...t,format:"jpeg"}).then(n=>n.toJpg());P.toWebp=(e,t)=>P(e,{...t,format:"webp"}).then(n=>n.toWebp());P.download=(e,t)=>P(e,t).then(n=>n.download());async function jl(e,t){if(Jn)return;let n={...t,fast:!0,embedFonts:!0,scale:.2},r;try{r=await Mr(e,n)}catch(i){_(t,"safariWarmup pre-capture failed",i)}await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i))),r&&await new Promise(i=>{let o=new Image;try{o.decoding="sync",o.loading="eager"}catch(a){_(t,"safariWarmup img hints failed",a)}o.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",o.src=r,document.body.appendChild(o),(async()=>{try{typeof o.decode=="function"&&await o.decode()}catch(s){_(t,"safariWarmup img.decode failed",s)}let a=performance.now();for(;!(o.complete&&o.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,o.naturalWidth||10),s.height=Math.max(1,o.naturalHeight||10);let c=s.getContext("2d");c&&c.drawImage(o,0,0)}catch{}await new Promise(s=>requestAnimationFrame(s));try{o.remove()}catch(s){_(t,"safariWarmup img.remove failed",s)}i()})()}),e.querySelectorAll("canvas").forEach(i=>{try{let o=i.getContext("2d",{willReadFrequently:!0});o&&o.getImageData(0,0,1,1)}catch(o){_(t,"safariWarmup canvas poke failed",o)}}),Jn=!0}function Vl(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();){let n=t.currentNode,r=getComputedStyle(n),i=r.backgroundImage&&r.backgroundImage!=="none",o=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(i||o||n.tagName==="CANVAS")return!0}return!1}function $r(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 Lr(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 Nr(){let e=document.querySelectorAll('link[rel~="stylesheet"]');for(let t of e)$r(t)&&Lr(t)}function zl(){let e=M().fonts;e.observer||(e.observer=new MutationObserver(t=>{for(let n of t)for(let r of n.addedNodes)r instanceof HTMLLinkElement&&$r(r)&&Lr(r)}),e.observer.observe(document.documentElement,{childList:!0,subtree:!0}))}function Tr(){let e=M().fonts;e.initialized||(e.initialized=!0,Nr(),zl())}async function Rr(){Nr();try{await document.fonts.ready}catch{}}var Yl=750,Xl=400;var ye=2,Pr=["#__mindstudio-cursor","#__mindstudio-cursor-ripple","#__mindstudio-notes-cursor","#__mindstudio-camera","#__mindstudio-flash"],Gl="#DD2590",Kl=`<svg width="44" height="44" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
10
10
|
<g filter="url(#filter0_d_2_302)">
|
|
11
11
|
<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"/>
|
|
12
12
|
<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"/>
|
|
@@ -40,7 +40,7 @@ ${h}
|
|
|
40
40
|
white-space: nowrap;
|
|
41
41
|
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
|
42
42
|
">Remy</div>
|
|
43
|
-
`,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=Fr,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 Zl(e,t){let{cameraEl:n}=M().screenshot;n&&(n.style.left=`${e}px`,n.style.top=`${t}px`,n.style.opacity="1")}function _r(e,t){let{cameraEl:n}=M().screenshot;n&&(n.style.left=`${e}px`,n.style.top=`${t}px`)}async function Ql(){let{flashEl:e}=M().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 W(600))}function es(){let{cameraEl:e}=M().screenshot;e&&(e.style.opacity="0")}function ts(){let e=M().screenshot;document.getElementById(Gt)?.remove(),document.getElementById(Fr)?.remove(),e.cameraEl=null,e.flashEl=null}function ns(e,t){return new Promise(n=>{let r=window.scrollY,i=e-r;if(Math.abs(i)<1){n();return}let o=Math.abs(i),s=Math.max(t,o/2),c=performance.now();function l(u){let d=u-c,f=Math.min(d/s,1),m=f<.5?4*f*f*f:1-Math.pow(-2*f+2,3)/2;window.scrollTo(0,r+i*m),f<1?requestAnimationFrame(l):n()}requestAnimationFrame(l)})}async function Be(e){await Rr();let t=window.innerWidth,n=window.innerHeight;if(e?.viewportOnly)return rs(t,n);let r=window.scrollY,i=document.documentElement.style.scrollBehavior;document.documentElement.style.scrollBehavior="auto",Jl();try{let o=Math.random()<.5?t+30:-60,a=n*.3+Math.random()*n*.4;Zl(o,a),await W(200);let s=t*.4+Math.random()*t*.15,c=n*.35+Math.random()*n*.15;_r(s,c),await W(700);let l=[],u=0,d=()=>Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);for(;u<d();){let v=d()-n,
|
|
43
|
+
`,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=Fr,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 Zl(e,t){let{cameraEl:n}=M().screenshot;n&&(n.style.left=`${e}px`,n.style.top=`${t}px`,n.style.opacity="1")}function _r(e,t){let{cameraEl:n}=M().screenshot;n&&(n.style.left=`${e}px`,n.style.top=`${t}px`)}async function Ql(){let{flashEl:e}=M().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 W(600))}function es(){let{cameraEl:e}=M().screenshot;e&&(e.style.opacity="0")}function ts(){let e=M().screenshot;document.getElementById(Gt)?.remove(),document.getElementById(Fr)?.remove(),e.cameraEl=null,e.flashEl=null}function ns(e,t){return new Promise(n=>{let r=window.scrollY,i=e-r;if(Math.abs(i)<1){n();return}let o=Math.abs(i),s=Math.max(t,o/2),c=performance.now();function l(u){let d=u-c,f=Math.min(d/s,1),m=f<.5?4*f*f*f:1-Math.pow(-2*f+2,3)/2;window.scrollTo(0,r+i*m),f<1?requestAnimationFrame(l):n()}requestAnimationFrame(l)})}async function Be(e){await Rr();let t=window.innerWidth,n=window.innerHeight;if(e?.viewportOnly)return rs(t,n);let r=window.scrollY,i=document.documentElement.style.scrollBehavior;document.documentElement.style.scrollBehavior="auto",Jl();try{let o=Math.random()<.5?t+30:-60,a=n*.3+Math.random()*n*.4;Zl(o,a),await W(200);let s=t*.4+Math.random()*t*.15,c=n*.35+Math.random()*n*.15;_r(s,c),await W(700);let l=[],u=0,d=()=>Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);for(;u<d();){let v=d()-n,x=Math.min(u,v);Math.abs(x-window.scrollY)>1&&(await ns(x,Xl),_r(s,c),await W(Yl));let S=d(),E=window.scrollY,b=Math.min(n,S-E);await Ql();try{let N=await(await P(document.body,{embedFonts:!0,exclude:Pr})).toCanvas({width:t});if(N){let O=N.height/S,F=Math.round(E*O),L=Math.round(b*O),$=N.width,D=document.createElement("canvas");D.width=$,D.height=L;let B=D.getContext("2d");B&&(B.drawImage(N,0,F,$,L,0,0,$,L),l.push({y:E,canvas:D}))}}catch{}u+=n}if(l.length===0)throw new Error("Screenshot capture produced no image data");let f=d(),m=l[0].canvas.width/t,g=document.createElement("canvas");g.width=l[0].canvas.width,g.height=Math.round(f*m);let h=g.getContext("2d");if(!h)throw new Error("Failed to create output canvas");for(let v of l)h.drawImage(v.canvas,0,Math.round(v.y*m));let y=g.toDataURL("image/jpeg",.85).replace(/^data:image\/jpeg;base64,/,"");if(!y)throw new Error("Canvas export produced no image data");return{image:y,width:g.width,height:g.height}}finally{es(),ts(),document.documentElement.style.scrollBehavior="auto",window.scrollTo(0,r),document.documentElement.style.scrollBehavior=i}}async function rs(e,t){let r=await(await P(document.body,{embedFonts:!0,exclude:Pr})).toCanvas({width:e,scale:ye});if(!r)throw new Error("SnapDOM viewport capture returned empty result");let i=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),o=document.createElement("canvas");o.width=e*ye,o.height=t*ye;let a=o.getContext("2d");if(!a)throw new Error("Failed to create canvas context");let s=window.scrollY/i*r.height,c=t/i*r.height;a.drawImage(r,0,s,r.width,c,0,0,e*ye,t*ye);let u=o.toDataURL("image/jpeg",.85).replace(/^data:image\/jpeg;base64,/,"");if(!u)throw new Error("Canvas export produced no image data");return{image:u,width:e*ye,height:t*ye}}function Dr(){let e=M().zoom,t=new URLSearchParams(window.location.search);e.pipMode=t.get("display-mode")==="pip",window.addEventListener("message",n=>{!n.data||typeof n.data.command!="string"||(n.data.command==="display-mode-pip"?e.pipMode=!0:n.data.command==="display-mode-full"&&(e.pipMode=!1))})}var Ir="__mindstudio-cursor",os="__mindstudio-cursor-ripple",Or=.07,is=250,lt=300,as=2e3,at=10,Hr=1,st="#DD2590",ls=`<svg width="40" height="41" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
44
44
|
<g filter="url(#filter0_d_4_78)">
|
|
45
45
|
<path d="M12.5448 26L6.72762 5.59339L26 14.8132L17.1816 17.9377L12.5448 26Z" fill="${st}"/>
|
|
46
46
|
<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="${st}"/>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindstudio-ai/browser-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"description": "Browser-side agent for MindStudio dev previews — captures logs, provides DOM snapshots, and enables remote interaction.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|