@mindstudio-ai/browser-agent 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
`:""}function Zi(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 Qi(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 ea(e){let t=e.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let l=getComputedStyle(e);n=parseFloat(l.borderLeftWidth)||0,r=parseFloat(l.borderRightWidth)||0,i=parseFloat(l.borderTopWidth)||0,o=parseFloat(l.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(n+r))),c=Math.max(0,Math.round(t.height-(i+o)));return{contentWidth:a,contentHeight:c,rect:t}}function se(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 ta(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 na(e,t,n){let r=await Qi(e,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:a}=ea(e),c=n?.snap;if(!c&&typeof window<"u"&&window.snapdom&&(c=window.snapdom),!c||typeof c.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 l={...n,scale:1},s=ta(r,i,o),u;try{u=await c.toPng(r.documentElement,l)}finally{s()}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),Te(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 ra(e){let{width:t,height:n}=se(e),r=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let o=i?parseFloat(i.width):NaN,a=i?parseFloat(i.height):NaN,c=Math.round(t||r.width||0),l=Math.round(n||r.height||0),s=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,c||16),u=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,l||16),d=(e.type||"text").toLowerCase()==="checkbox",m=!!e.checked,h=!!e.indeterminate,g=Math.max(Math.min(s,u),12),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:middle;flex-shrink:0;line-height:0;`;let f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("width",String(g)),f.setAttribute("height",String(g)),f.setAttribute("viewBox",`0 0 ${g} ${g}`),p.appendChild(f);function y(){let x="#0a6ed1";try{i&&(x=i.accentColor||i.color||x)}catch{}let w=2,b=w/2,E=g-w;if(f.innerHTML="",d){let S=document.createElementNS("http://www.w3.org/2000/svg","rect");if(S.setAttribute("x",String(b)),S.setAttribute("y",String(b)),S.setAttribute("width",String(E)),S.setAttribute("height",String(E)),S.setAttribute("rx","2"),S.setAttribute("ry","2"),S.setAttribute("fill",m?x:"none"),S.setAttribute("stroke",x),S.setAttribute("stroke-width",String(w)),f.appendChild(S),m){let v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",`M ${b+2} ${g/2} L ${g/2-1} ${g-b-2} L ${g-b-2} ${b+2}`),v.setAttribute("stroke","white"),v.setAttribute("stroke-width",String(Math.max(1.5,w))),v.setAttribute("fill","none"),v.setAttribute("stroke-linecap","round"),v.setAttribute("stroke-linejoin","round"),f.appendChild(v)}else if(h){let v=document.createElementNS("http://www.w3.org/2000/svg","rect"),$=Math.max(6,E-4);v.setAttribute("x",String((g-$)/2)),v.setAttribute("y",String((g-w)/2)),v.setAttribute("width",String($)),v.setAttribute("height",String(w)),v.setAttribute("fill",x),v.setAttribute("rx","1"),f.appendChild(v)}}else{let S=document.createElementNS("http://www.w3.org/2000/svg","circle");if(S.setAttribute("cx",String(g/2)),S.setAttribute("cy",String(g/2)),S.setAttribute("r",String((g-w)/2)),S.setAttribute("fill",m?x:"none"),S.setAttribute("stroke",x),S.setAttribute("stroke-width",String(w)),f.appendChild(S),m){let v=document.createElementNS("http://www.w3.org/2000/svg","circle"),$=Math.max(2,(g-w*2)*.35);v.setAttribute("cx",String(g/2)),v.setAttribute("cy",String(g/2)),v.setAttribute("r",String($)),v.setAttribute("fill","white"),f.appendChild(v)}}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 y(),{el:p,applyVisual:y}}var je=new Q(80);async function Xe(e){if(C.resource?.has(e))return C.resource.get(e);if(je.has(e))return je.get(e);let t=(async()=>{let n=await te(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})();je.set(e,t);try{let n=await t;return je.set(e,n),n}catch(n){throw je.delete(e),n}}var oa=/\bblob:[^)"'\s]+/g;async function er(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(oa)||[]));if(t.length===0)return e;let n=e;for(let r of t)try{let i=await Xe(r);n=n.split(r).join(i)}catch{}return n}function ct(e){return typeof e=="string"&&e.startsWith("blob:")}function ia(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 aa(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}async function la(e,t=null){if(!e)return;let n=t,r=e.querySelectorAll?e.querySelectorAll("img"):[];for(let l of r)try{let s=l.getAttribute("src")||l.currentSrc||"";if(ct(s)){let d=await Xe(s);l.setAttribute("src",d)}let u=l.getAttribute("srcset");if(u&&u.includes("blob:")){let d=ia(u),m=!1;for(let h of d)if(ct(h.url))try{h.url=await Xe(h.url),m=!0}catch(g){F(n,"blobUrlToDataUrl for srcset item failed",g)}m&&l.setAttribute("srcset",aa(d))}}catch(s){F(n,"resolveBlobUrls for img failed",s)}let i=e.querySelectorAll?e.querySelectorAll("image"):[];for(let l of i)try{let s="http://www.w3.org/1999/xlink",u=l.getAttribute("href")||l.getAttributeNS?.(s,"href");if(ct(u)){let d=await Xe(u);l.setAttribute("href",d),l.removeAttributeNS?.(s,"href")}}catch(s){F(n,"resolveBlobUrls for SVG image href failed",s)}let o=e.querySelectorAll?e.querySelectorAll("[style*='blob:']"):[];for(let l of o)try{let s=l.getAttribute("style");if(s&&s.includes("blob:")){let u=await er(s);l.setAttribute("style",u)}}catch(s){F(n,"replaceBlobUrls in inline style failed",s)}let a=e.querySelectorAll?e.querySelectorAll("style"):[];for(let l of a)try{let s=l.textContent||"";s.includes("blob:")&&(l.textContent=await er(s))}catch(s){F(n,"replaceBlobUrls in style tag failed",s)}let c=["poster"];for(let l of c){let s=e.querySelectorAll?e.querySelectorAll(`[${l}^='blob:']`):[];for(let u of s)try{let d=u.getAttribute(l);ct(d)&&u.setAttribute(l,await Xe(d))}catch(d){F(n,`resolveBlobUrls for ${l} failed`,d)}}}Ke();async function mt(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")||gr.has(u))return 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:m}=se(e),h=d||e.getBoundingClientRect().width||0,g=m||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${h}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:m,height:h}=se(e),g=m||e.getBoundingClientRect().width||0,p=h||e.getBoundingClientRect().height||0;return d.style.cssText=`display:inline-block;width:${g}px;height:${p}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:m}=se(e),h=d||e.getBoundingClientRect().width||0,g=m||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${h}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){F(t,"iframe same-origin probe failed",d)}if(u)try{return await na(e,t,n)}catch(d){console.warn("[SnapDOM] iframe rasterization failed, fallback:",d)}if(n.placeholders){let{width:d,height:m}=se(e),h=document.createElement("div");return h.style.cssText=`width:${d}px;height:${m}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;`,Te(e,h,t,n),h}else{let{width:d,height:m}=se(e),h=document.createElement("div");return h.style.cssText=`display:inline-block;width:${d}px;height:${m}px;visibility:hidden;`,Te(e,h,t,n),h}}if(e.getAttribute("data-capture")==="placeholder"){let u=e.cloneNode(!1);t.nodeMap.set(u,e),Te(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(p=>requestAnimationFrame(p)),u=e.toDataURL("image/png"),!u||u==="data:,"){try{g&&g.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),u=e.toDataURL("image/png"),!u||u==="data:,"){let p=document.createElement("canvas");p.width=e.width,p.height=e.height;let f=p.getContext("2d");f&&(f.drawImage(e,0,0),u=p.toDataURL("image/png"))}}}catch(g){F(t,"Canvas toDataURL failed, using empty/fallback",g)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch(g){F(t,"img decoding/loading hints failed",g)}u&&(d.src=u),d.width=e.width,d.height=e.height;let{width:m,height:h}=se(e);return m>0&&(d.style.width=`${m}px`),h>0&&(d.style.height=`${h}px`),t.nodeMap.set(d,e),Te(e,d,t,n),d}let a;try{if(a=e.cloneNode(!1),Bi(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){Yi(e,a);try{let{width:u,height:d}=se(e),m=Math.round(u||0),h=Math.round(d||0);m&&(a.dataset.snapdomWidth=String(m)),h&&(a.dataset.snapdomHeight=String(h))}catch(u){F(t,"getUnscaledDimensions for IMG failed",u)}try{let u=e.getAttribute("style")||"",d=window.getComputedStyle(e),m=y=>{let x=u.match(new RegExp(`${y}\\s*:\\s*([^;]+)`,"i")),w=x?x[1].trim():d.getPropertyValue(y);return/%|auto/i.test(String(w||""))},h=parseInt(a.dataset.snapdomWidth||"0",10),g=parseInt(a.dataset.snapdomHeight||"0",10),p=m("width")||!h,f=m("height")||!g;p&&h&&(a.style.width=`${h}px`),f&&g&&(a.style.height=`${g}px`),h&&(a.style.minWidth=`${h}px`),g&&(a.style.minHeight=`${g}px`)}catch(u){F(t,"IMG dimension freeze failed",u)}}}catch(u){throw console.error("[Snapdom] Failed to clone node:",e,u),u}let c=null;if(e instanceof HTMLTextAreaElement){let{width:u,height:d}=se(e),m=u||e.getBoundingClientRect().width||0,h=d||e.getBoundingClientRect().height||0;m&&(a.style.width=`${m}px`),h&&(a.style.height=`${h}px`)}if(e instanceof HTMLInputElement){let u=(e.type||"text").toLowerCase();if((u==="checkbox"||u==="radio")&&bi()){let{el:d,applyVisual:m}=ra(e);t.nodeMap.set(d,e),c=m,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 HTMLSelectElement&&(i=e.value),e instanceof HTMLTextAreaElement&&(o=e.value),Te(e,a,t,n),c&&c(),e.shadowRoot){let u=function(w,b){if(w.nodeType===Node.ELEMENT_NODE&&w.tagName==="STYLE")return b(null);mt(w,t,n).then(E=>{b(E||null)}).catch(()=>{b(null)})};try{let w=e.shadowRoot.querySelectorAll("slot");for(let b of w){let E=[];try{E=b.assignedNodes?.({flatten:!0})||b.assignedNodes?.()||[]}catch{E=b.assignedNodes?.()||[]}for(let S of E)r.add(S)}}catch{}let d=zi(t),m=`[data-sd="${d}"]`;try{a.setAttribute("data-sd",d)}catch{}let h=Vi(e.shadowRoot),g=ji(h,m),p=Gi(h),f=Ji(e,p,m);Xi(a,f+g,d);let y=document.createDocumentFragment(),x=await Vt(Array.from(e.shadowRoot.childNodes),u,n.fast);y.append(...x.filter(w=>!!w)),a.appendChild(y)}if(e.tagName==="SLOT"){let u=function(p,f){mt(p,t,n).then(y=>{y&&Zi(y),f(y||null)}).catch(()=>{f(null)})},d=e.assignedNodes?.({flatten:!0})||[],m=d.length>0?d:Array.from(e.childNodes),h=document.createDocumentFragment(),g=await Vt(Array.from(m),u,n.fast);return h.append(...g.filter(p=>!!p)),h}function l(u,d){if(r.has(u))return d(null);mt(u,t,n).then(m=>{d(m||null)}).catch(()=>{d(null)})}let s=await Vt(Array.from(e.childNodes),l,n.fast);if(a.append(...s.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}re();bt();ne();var sa=[/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],Ae=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__||{}),en=[];function ca(e){let t=Array.isArray(e)?e:[e];for(let n of t)n instanceof RegExp?en.push(n):typeof n=="string"?en.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function ce(e){let t=typeof e=="string"?e:"",n=[...sa,...en];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 ua(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var tr=new Map;function da(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 fa(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),c="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?c="rounded":/\bsharp\b/.test(o)?c="sharp":/\boutlined\b/.test(o)&&(c="outlined");let l=a===1,s=null;if(l&&(c==="outlined"&&Ae.materialIconsFilled?s={url:Ae.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&Ae.materialIconsRound?s={url:Ae.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&Ae.materialIconsSharp&&(s={url:Ae.materialIconsSharp,alias:"snapdom-mi-sharp"})),!s)return{familyForMeasure:r,familyForCanvas:r};if(!tr.has(s.alias))try{let d=new FontFace(s.alias,`url(${s.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),tr.set(s.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let u=`"${s.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function ma(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function pa(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 ha(e,{family:t="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:a=""}={}){let c=String(t||"").replace(/^['"]+|['"]+$/g,""),l=window.devicePixelRatio||1,s=da(o),{familyForMeasure:u,familyForCanvas:d}=await fa(c,a,s);await ma(d.replace(/^["']+|["']+$/g,""),r);let m=document.createElement("span");m.textContent=e,m.style.position="absolute",m.style.visibility="hidden",m.style.left="-99999px",m.style.whiteSpace="nowrap",m.style.fontFamily=u,m.style.fontWeight=String(n||"normal"),m.style.fontSize=`${r}px`,m.style.lineHeight="1",m.style.margin="0",m.style.padding="0",m.style.fontFeatureSettings="'liga' 1",m.style.fontVariantLigatures="normal",m.style.color=i,document.body.appendChild(m);let h=m.getBoundingClientRect(),g=Math.max(1,Math.ceil(h.width)),p=Math.max(1,Math.ceil(h.height));document.body.removeChild(m);let f=document.createElement("canvas");f.width=g*l,f.height=p*l;let y=f.getContext("2d");y.scale(l,l),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:f.toDataURL(),width:g,height:p}}async function ga(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 c=r[a],l=i[a]||null;try{let s=getComputedStyle(l||c),u=s.fontFamily||"Material Icons";if(!ua(u))continue;let d=(l||c).textContent.trim();if(!d)continue;let m=parseInt(s.fontSize,10)||24,h=s.fontWeight&&s.fontWeight!=="normal"?s.fontWeight:"normal",g=pa(s),p=s.fontVariationSettings&&s.fontVariationSettings!=="normal"?s.fontVariationSettings:"",f=(l||c).className||"",{dataUrl:y,width:x,height:w}=await ha(d,{family:u,weight:h,fontSize:m,color:g,variation:p,className:f});c.textContent="";let b=c.ownerDocument.createElement("img");b.src=y,b.alt=d,b.style.height=`${m}px`,b.style.width=`${Math.max(1,Math.round(x/w*m))}px`,b.style.objectFit="contain",b.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(b),o++}catch{}}return o}_e();async function ya(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 c=a.getBoundingClientRect(),l=Math.ceil(c.width),s=Math.ceil(c.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,l*o),u.height=Math.max(1,s*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:l,height:s}}var ba=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),wa=["katex","mathjax","mathml"];function vt(e){if(!e)return"";for(let t of e.split(",")){let n=t.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!ba.has(n.toLowerCase()))return n}return""}function pt(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 ht(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function xa(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function va(e){let t=String(e||"400").trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let i=pt(n[1]),o=pt(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=pt(t);return{min:r,max:r}}function Sa(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Ca(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 Ea(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function ka(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)||wa.some(a=>o.includes(a)))return!0;for(let a of t){let c=a.toLowerCase().replace(/\s+/g,"+"),l=a.toLowerCase().replace(/\s+/g,"-"),s=Ea(a);if(o.includes(c)||o.includes(l)||s&&o.includes(s))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 nr(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 tn=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,yt=4;async function Ma(e,t,n){if(!e)return e;let r=new Set;function i(c,l){try{return new URL(c,l||location.href).href}catch{return c}}async function o(c,l,s=0){if(s>yt)return console.warn(`[snapDOM] @import depth exceeded (${yt}) at ${l}`),c;let u="",d=0,m;for(;m=tn.exec(c);){u+=c.slice(d,m.index),d=tn.lastIndex;let h=(m[2]||m[4]||"").trim(),g=i(h,l);if(r.has(g)){console.warn(`[snapDOM] Skipping circular @import: ${g}`);continue}r.add(g);let p="";try{let f=await te(g,{as:"text",useProxy:n,silent:!0});f.ok&&typeof f.data=="string"&&(p=f.data)}catch{}p?(p=nr(p,g),p=await o(p,g,s+1),u+=`
|
|
7
7
|
/* inlined: ${g} */
|
|
8
8
|
${p}
|
|
9
|
-
`):u+=m[0]}return u+=c.slice(d),u}let a=nr(e,t||location.href);return a=await o(a,t||location.href,0),a}var Nr=/url\((["']?)([^"')]+)\1\)/g,Aa=/@font-face[^{}]*\{[^}]*\}/g;function Tr(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],c=l=>{if(!l.includes("?"))return parseInt(l,16);let s=parseInt(l.replace(/\?/g,"0"),16),u=parseInt(l.replace(/\?/g,"F"),16);return[s,u]};if(a){let l=c(o),s=c(a),u=Array.isArray(l)?l[0]:l,d=Array.isArray(s)?s[1]:s;t.push([Math.min(u,d),Math.max(u,d)])}else{let l=c(o);Array.isArray(l)?t.push([l[0],l[1]]):t.push([l,l])}}return t}function Rr(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 dn(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(Nr)){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 _r(e,t,n=""){let r=e;for(let i of e.matchAll(Nr)){let o=sn(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(!ce(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 c=await te(a,{as:"dataURL",useProxy:n,silent:!0});if(c.ok&&typeof c.data=="string"){let l=c.data;C.resource?.set(a,l),C.font?.add(a),r=r.replace(i[0],`url(${l})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return r}function La(e){if(!e.length)return null;let t=(a,c)=>e.some(([l,s])=>!(s<a||l>c)),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 rr(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=La(o);if(a&&r.has(a))return!0}return!1}}function Na(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]||"",c=vt(a),l=(o.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),s=(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(),m=(o.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),h=dn(m,location.href),g=h.length?h.map(f=>String(f).toLowerCase()).sort().join("|"):m.toLowerCase(),p=[String(c||"").toLowerCase(),l,s,u,d.toLowerCase(),g].join("|");n.has(p)||(n.add(p),r.push(o))}if(r.length===0)return e;let i=0;return e.replace(t,()=>r[i++]||"")}function Ta(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()}):"",c=(n||[]).map(u=>`${(u.family||"").toLowerCase()}::${u.weight||"normal"}::${u.style||"normal"}::${u.src||""}`).sort().join("|"),l=r||"",s=(i||[]).map(u=>String(u).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${o}::ex=${a}::lf=${c}::px=${l}::fd=${s}`}async function Pr(e,t,n,r){let i;try{i=e.cssRules||[]}catch{return}let o=(a,c)=>{try{return new URL(a,c||location.href).href}catch{return a}};for(let a of i){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let c=a.href?o(a.href,t):t;if(r.depth>=yt){console.warn(`[snapDOM] CSSOM import depth exceeded (${yt}) at ${c}`);continue}if(c&&r.visitedSheets.has(c)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${c}`);continue}c&&r.visitedSheets.add(c);let l={...r,depth:(r.depth||0)+1};await Pr(a.styleSheet,c,n,l);continue}if(a.type===CSSRule.FONT_FACE_RULE){let c=(a.style.getPropertyValue("font-family")||"").trim(),l=vt(c);if(!l||ce(l))continue;let s=(a.style.getPropertyValue("font-weight")||"400").trim(),u=(a.style.getPropertyValue("font-style")||"normal").trim(),d=(a.style.getPropertyValue("font-stretch")||"100%").trim(),m=(a.style.getPropertyValue("src")||"").trim(),h=(a.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(l,u,s,d))continue;let g=Tr(h);if(!Rr(r.usedCodepoints,g))continue;let p={family:l,weightSpec:s,styleSpec:u,stretchSpec:d,unicodeRange:h,srcRaw:m,srcUrls:dn(m,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(p,g))continue;if(/url\(/i.test(m)){let f=await _r(m,t||location.href,r.useProxy);await n(`@font-face{font-family:${l};src:${f};font-style:${u};font-weight:${s};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}else await n(`@font-face{font-family:${l};src:${m};font-style:${u};font-weight:${s};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}}}async function Ra({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 f of e){let[y,x,w,b]=String(f).split("__");if(!y)continue;let E=a.get(y)||[];E.push({w:parseInt(x,10),s:w,st:parseInt(b,10)}),a.set(y,E)}function c(f,y,x,w){if(!a.has(f))return!1;let b=a.get(f),E=va(x),S=Sa(y),v=Ca(w),$=E.min!==E.max,P=E.min,B=A=>S.kind==="normal"&&A==="normal"||S.kind!=="normal"&&(A==="italic"||A==="oblique"),D=!1;for(let A of b){let M=$?A.w>=E.min&&A.w<=E.max:A.w===P,U=B(ht(A.s)),ee=A.st>=v.min&&A.st<=v.max;if(M&&U&&ee){D=!0;break}}if(D)return!0;if(!$)for(let A of b){let M=B(ht(A.s)),U=A.st>=v.min&&A.st<=v.max;if(Math.abs(P-A.w)<=300&&M&&U)return!0}if(!$&&S.kind==="normal"&&b.some(A=>ht(A.s)!=="normal"))for(let A of b){let M=Math.abs(P-A.w)<=300,U=A.st>=v.min&&A.st<=v.max;if(M&&U)return!0}return!1}let l=rr(n),s=Ta(e,n,r,i,o);if(C.resource?.has(s))return C.resource.get(s);let u=$a(e),d=[],m=tn;for(let f of document.querySelectorAll("style")){let y=f.textContent||"";for(let x of y.matchAll(m)){let w=(x[2]||x[4]||"").trim();!w||ce(w)||document.querySelector(`link[rel="stylesheet"][href="${w}"]`)||d.push(w)}}d.length&&await Promise.all(d.map(f=>new Promise(y=>{if(document.querySelector(`link[rel="stylesheet"][href="${f}"]`))return y(null);let x=document.createElement("link");x.rel="stylesheet",x.href=f,x.setAttribute("data-snapdom","injected-import"),x.onload=()=>y(x),x.onerror=()=>y(null),document.head.appendChild(x)})));let h="",g=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(f=>!!f.href);for(let f of g)try{if(ce(f.href))continue;let y="",x=!1;try{x=new URL(f.href,location.href).origin===location.origin}catch{}if(!x){let b=Array.isArray(o)?o:[];if(!ka(f.href,u,b))continue}if(x){let b=Array.from(document.styleSheets).find(E=>E.href===f.href);if(b)try{let E=b.cssRules||[];y=Array.from(E).map(S=>S.cssText).join("")}catch{}}if(!y){let b=await te(f.href,{as:"text",useProxy:i});if(b?.ok&&typeof b.data=="string"&&(y=b.data),ce(f.href))continue}y=await Ma(y,f.href,i);let w="";for(let b of y.match(Aa)||[]){let E=(b.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),S=vt(E);if(!S||ce(S))continue;let v=(b.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),$=(b.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),P=(b.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),B=(b.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),D=(b.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),A=dn(D,f.href);if(!c(S,$,v,P))continue;let M=Tr(B);if(!Rr(t,M))continue;let U={family:S,weightSpec:v,styleSpec:$,stretchSpec:P,unicodeRange:B,srcRaw:D,srcUrls:A,href:f.href};if(n&&l(U,M))continue;let ee=/url\(/i.test(D)?await _r(b,f.href,i):b;w+=ee}w.trim()&&(h+=w)}catch{console.warn("[snapDOM] Failed to process stylesheet:",f.href)}let p={requiredIndex:a,usedCodepoints:t,faceMatchesRequired:c,simpleExcluder:n?rr(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(let f of document.styleSheets)if(!(f.href&&g.some(y=>y.href===f.href)))try{let y=f.href||location.origin+"/";y&&p.visitedSheets.add(y),await Pr(f,y,async x=>{h+=x},p)}catch{}try{for(let f of document.fonts||[]){if(!f||!f.family||f.status!=="loaded"||!f._snapdomSrc)continue;let y=String(f.family).replace(/^['"]+|['"]+$/g,"");if(ce(y)||!a.has(y)||n?.families&&n.families.some(w=>String(w).toLowerCase()===y.toLowerCase()))continue;let x=f._snapdomSrc;if(!String(x).startsWith("data:")){if(C.resource?.has(f._snapdomSrc))x=C.resource.get(f._snapdomSrc),C.font?.add(f._snapdomSrc);else if(!C.font?.has(f._snapdomSrc))try{let w=await te(f._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(w.ok&&typeof w.data=="string")x=w.data,C.resource?.set(f._snapdomSrc,x),C.font?.add(f._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",f._snapdomSrc);continue}}h+=`@font-face{font-family:'${y}';src:url(${x});font-style:${f.style||"normal"};font-weight:${f.weight||"normal"};}`}}catch{}for(let f of r){if(!f||typeof f!="object")continue;let y=String(f.family||"").replace(/^['"]+|['"]+$/g,"");if(!y||ce(y)||!a.has(y)||n?.families&&n.families.some(v=>String(v).toLowerCase()===y.toLowerCase()))continue;let x=f.weight!=null?String(f.weight):"normal",w=f.style!=null?String(f.style):"normal",b=f.stretchPct!=null?`${f.stretchPct}%`:"100%",E=String(f.src||""),S=E;if(!S.startsWith("data:")){if(C.resource?.has(E))S=C.resource.get(E),C.font?.add(E);else if(!C.font?.has(E))try{let v=await te(E,{as:"dataURL",useProxy:i,silent:!0});if(v.ok&&typeof v.data=="string")S=v.data,C.resource?.set(E,S),C.font?.add(E);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",E);continue}}h+=`@font-face{font-family:'${y}';src:url(${S});font-style:${w};font-weight:${x};font-stretch:${b};}`}return h&&(h=Na(h),C.resource?.set(s,h)),h}function Fr(e){let t=new Set;if(!e)return t;let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),r=a=>{let c=vt(a.fontFamily);if(!c)return;let l=(s,u,d)=>`${c}__${pt(s)}__${ht(u)}__${xa(d)}`;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,c=getComputedStyle(a);r(c);let l=getComputedStyle(a,"::before");l&&l.content&&l.content!=="none"&&r(l);let s=getComputedStyle(a,"::after");s&&s.content&&s.content!=="none"&&r(s)}return t}function _a(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 c=getComputedStyle(o,a)?.getPropertyValue("content");if(!(!c||c==="none"))if(/^"/.test(c)||/^'/.test(c))n(c.slice(1,-1));else{let l=c.match(/\\[0-9A-Fa-f]{1,6}/g);if(l)for(let s of l)try{t.add(parseInt(s.slice(1),16))}catch{}}}}}return t}async function Ir(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)))}ne();function Pa(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function Fa(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function or(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 ir(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 ar(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,e));case"decimal-leading-zero":return(e<10?"0":"")+String(Math.max(0,e));case"lower-alpha":return or(e,!1);case"upper-alpha":return or(e,!0);case"lower-roman":return ir(e,!1);case"upper-roman":return ir(e,!0);default:return String(Math.max(0,e))}}function Ia(e){let t=()=>C?.session?.__counterEpoch??0,n=t(),r=new WeakMap,i=e instanceof Document?e.documentElement:e,o=m=>m&&m.tagName==="LI",a=m=>{let h=0,g=m?.parentElement;if(!g)return 0;for(let p of g.children){if(p===m)break;p.tagName==="LI"&&h++}return h},c=m=>{let h=new Map;for(let[g,p]of m)h.set(g,p.slice());return h},l=(m,h,g)=>{let p=c(m),f;try{f=g.style?.counterReset||getComputedStyle(g).counterReset}catch{}if(f&&f!=="none")for(let x of f.split(",")){let w=x.trim().split(/\s+/),b=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!b)continue;let S=h.get(b);if(S&&S.length){let v=S.slice();v.push(E),p.set(b,v)}else p.set(b,[E])}let y;try{y=g.style?.counterIncrement||getComputedStyle(g).counterIncrement}catch{}if(y&&y!=="none")for(let x of y.split(",")){let w=x.trim().split(/\s+/),b=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):1;if(!b)continue;let S=p.get(b)||[];S.length===0&&S.push(0),S[S.length-1]+=E,p.set(b,S)}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"),S=Number.isFinite(Number(E))?Number(E):1,v=a(g),$=g.getAttribute("value");w=Number.isFinite(Number($))?Number($):S+v}else w=1+a(g);let b=p.get("list-item")||[];b.length===0&&b.push(0),b[b.length-1]=w,p.set("list-item",b)}}catch{}return p},s=(m,h,g)=>{let p=l(g,h,m);r.set(m,p);let f=p;for(let y of m.children)f=s(y,p,f);return p},u=new Map;s(i,u,u);function d(){let m=t();if(m!==n){n=m;let h=new Map;s(i,h,h)}}return{get(m,h){d();let g=r.get(m)?.get(h);return g&&g.length?g[g.length-1]:0},getStack(m,h){d();let g=r.get(m)?.get(h);return g?g.slice():[]}}}function Da(e,t,n){if(!e||e==="none")return e;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,i=e.replace(r,(o,a,c)=>{let l=String(c).split(",").map(s=>s.trim());if(a==="counter"){let s=l[0]?.replace(/^["']|["']$/g,""),u=(l[1]||"decimal").toLowerCase(),d=n.get(t,s);return ar(d,u)}else{let s=l[0]?.replace(/^["']|["']$/g,""),u=l[1]?.replace(/^["']|["']$/g,"")??"",d=(l[2]||"decimal").toLowerCase(),m=n.getStack(t,s);return m.length?m.map(h=>ar(h,d)).join(u):""}});return Fa(i)}catch{return"- "}}_e();ne();var Le=new WeakMap,lr=300;function Oa(e,t){let n=Dr(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=cr(e),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):cr(e)}function nn(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Dr(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 c=a.textContent?a.textContent.length:0;n+=`S${c}|`;let l=a.sheet,s=l?nn(l):null;s&&(r+=s.length)}else{let c=a.getAttribute("href")||"",l=a.getAttribute("media")||"all";n+=`L${c}|m:${l}|`;let s=a.sheet,u=s?nn(s):null;u&&(r+=u.length)}}let i=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(i)?i.length:0}|tr:${r}`,n}function sr(e,t,n){let r=nn(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 c of t)if(a.includes(c))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let c=0;c<o.cssRules.length&&n.budget>0;c++){let l=o.cssRules[c],s=l&&l.cssText?l.cssText:"";n.budget--;for(let u of t)if(s.includes(u))return!0}if(n.budget<=0)return!1}return!1}function cr(e=document){let t=Dr(e),n=Le.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 c=i[a].textContent||"";for(let l of r)if(c.includes(l))return Le.set(e,{fingerprint:t,result:!0}),!0}let o=e.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let a={budget:lr};try{for(let c of o)if(sr(c,r,a))return Le.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),c={budget:lr};for(let l=0;l<a.length&&c.budget>0;l++){let s=a[l],u=null;if(s.tagName,u=s.sheet||null,u&&sr(u,r,c))return Le.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(Le.set(e,{fingerprint:t,result:!0}),!0):(Le.set(e,{fingerprint:t,result:!1}),!1)}var Re=new WeakMap,ur=-1;function Wa(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Ha(e){if(!e)return"";let t=[],n=/"([^"]*)"/g,r;for(;r=n.exec(e);)t.push(r[1]);return t.length?t.join(""):Wa(e)}function rn(e,t){let n=e.parentElement,r=n?Re.get(n):null;return r?{get(i,o){let a=t.get(i,o),c=r.get(o);return typeof c=="number"?Math.max(a,c):a},getStack(i,o){let a=t.getStack(i,o);if(!a.length)return a;let c=r.get(o);if(typeof c=="number"){let l=a.slice();return l[l.length-1]=Math.max(l[l.length-1],c),l}return a}}:t}function on(e,t,n){let r=new Map;function i(l){let s=[];if(!l||l==="none")return s;for(let u of String(l).split(",")){let d=u.trim().split(/\s+/),m=d[0],h=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;m&&s.push({name:m,num:h})}return s}let o=i(t?.counterReset),a=i(t?.counterIncrement);function c(l){if(r.has(l))return r.get(l).slice();let s=n.getStack(e,l);s=s.length?s.slice():[];let u=o.find(m=>m.name===l);if(u){let m=Number.isFinite(u.num)?u.num:0;s=s.length?[...s,m]:[m]}let d=a.find(m=>m.name===l);if(d){let m=Number.isFinite(d.num)?d.num:1;s.length===0&&(s=[0]),s[s.length-1]+=m}return r.set(l,s.slice()),s}return{get(l,s){let u=c(s);return u.length?u[u.length-1]:0},getStack(l,s){return c(s)},__incs:a}}function Ba(e,t,n){let r;try{r=ue(e,t)}catch{}let i=r?.content;if(!i||i==="none"||i==="normal")return{text:"",incs:[]};let o=rn(e,n),a=on(e,r,o),c=Pa(i)?Da(i,e,a):i;return{text:Ha(c),incs:a.__incs||[]}}async function an(e,t,n,r){if(!(e instanceof Element)||!(t instanceof Element))return;let i=e.ownerDocument||document;if(!Oa(i,n))return;let o=C?.session?.__counterEpoch??0;if(ur!==o&&(Re=new WeakMap,n&&(n.__counterCtx=null),ur=o),!n.__counterCtx)try{n.__counterCtx=Ia(e.ownerDocument||document)}catch(l){F(n,"buildCounterContext failed",l)}let a=n.__counterCtx;for(let l of["::before","::after","::first-letter"])try{let s=ue(e,l);if(!s||s.content==="none"&&s.backgroundImage==="none"&&s.backgroundColor==="transparent"&&(s.borderStyle==="none"||parseFloat(s.borderWidth)===0)&&(!s.transform||s.transform==="none")&&s.display==="inline")continue;if(l==="::first-letter"){let R=ue(e);if(!(s.color!==R.color||s.fontSize!==R.fontSize||s.fontWeight!==R.fontWeight))continue;let T=Array.from(t.childNodes).find(We=>We.nodeType===Node.TEXT_NODE&&We.textContent?.trim().length>0);if(!T)continue;let W=T.textContent,O=W.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],de=W.slice(O?.length||0);if(!O||/[\uD800-\uDFFF]/.test(O))continue;let ae=document.createElement("span");ae.textContent=O,ae.dataset.snapdomPseudo="::first-letter";let Ee=Vn(s),ke=Gt(Ee,"span");n.styleMap.set(ae,ke);let ge=document.createTextNode(de);t.replaceChild(ge,T),t.insertBefore(ae,ge);continue}let u=s.content??"",d=u===""||u==="none"||u==="normal",{text:m,incs:h}=Ba(e,l,a),g=s.backgroundImage,p=s.backgroundColor,f=s.fontFamily,y=parseInt(s.fontSize)||32,x=parseInt(s.fontWeight)||!1,w=s.color||"#000",b=s.borderStyle,E=parseFloat(s.borderWidth),S=s.transform,v=ce(f),$=!d&&m!=="",P=g&&g!=="none",B=p&&p!=="transparent"&&p!=="rgba(0, 0, 0, 0)",D=b&&b!=="none"&&E>0,A=S&&S!=="none";if(!($||P||B||D||A)){if(h&&h.length&&e.parentElement){let R=Re.get(e.parentElement)||new Map;for(let{name:T}of h){if(!T)continue;let W=rn(e,a),O=on(e,ue(e,l),W).get(e,T);R.set(T,O)}Re.set(e.parentElement,R)}continue}let M=document.createElement("span");M.dataset.snapdomPseudo=l,M.style.pointerEvents="none";let U=Vn(s),ee=Gt(U,"span");if(n.styleMap.set(M,ee),v&&m&&m.length===1){let{dataUrl:R,width:T,height:W}=await ya(m,f,x,y,w),O=document.createElement("img");O.src=R,O.style=`height:${y}px;width:${T/W*y}px;object-fit:contain;`,M.appendChild(O),t.dataset.snapdomHasIcon="true"}else if(m&&m.startsWith("url(")){let R=sn(m);if(R?.trim())try{let T=await te(gt(R),{as:"dataURL",useProxy:r.useProxy});if(T?.ok&&typeof T.data=="string"){let W=document.createElement("img");W.src=T.data,W.style=`width:${y}px;height:auto;object-fit:contain;`,M.appendChild(W)}}catch(T){console.error(`[snapdom] Error in pseudo ${l} for`,e,T)}}else!v&&$&&(M.textContent=m);M.style.backgroundImage="none","maskImage"in M.style&&(M.style.maskImage="none"),"webkitMaskImage"in M.style&&(M.style.webkitMaskImage="none");try{M.style.backgroundRepeat=s.backgroundRepeat,M.style.backgroundSize=s.backgroundSize,s.backgroundPositionX&&s.backgroundPositionY?(M.style.backgroundPositionX=s.backgroundPositionX,M.style.backgroundPositionY=s.backgroundPositionY):M.style.backgroundPosition=s.backgroundPosition,M.style.backgroundOrigin=s.backgroundOrigin,M.style.backgroundClip=s.backgroundClip,M.style.backgroundAttachment=s.backgroundAttachment,M.style.backgroundBlendMode=s.backgroundBlendMode}catch{}if(P)try{let R=Kt(g),T=await Promise.all(R.map(hr));M.style.backgroundImage=T.join(", ")}catch(R){console.warn(`[snapdom] Failed to inline background-image for ${l}`,R)}B&&(M.style.backgroundColor=p);let et=M.childNodes.length>0||M.textContent?.trim()!==""||P||B||D||A;if(h&&h.length&&e.parentElement){let R=Re.get(e.parentElement)||new Map,T=rn(e,a),W=on(e,ue(e,l),T);for(let{name:O}of h){if(!O)continue;let de=W.get(e,O);R.set(O,de)}Re.set(e.parentElement,R)}if(!et)continue;l==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(M,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(M))}catch(s){console.warn(`[snapdom] Failed to capture ${l} for`,e,s)}let c=Array.from(t.children).filter(l=>!l.dataset.snapdomPseudo);if(n.nodeMap)for(let l of c){let s=n.nodeMap.get(l);s instanceof Element&&await an(s,l,n,r)}else{let l=Array.from(e.children);for(let s=0;s<Math.min(l.length,c.length);s++)await an(l[s],c[s],n,r)}}function Ua(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"],c=b=>window.CSS&&CSS.escape?CSS.escape(b):b.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),l="http://www.w3.org/1999/xlink",s=b=>{if(!b||!b.getAttribute)return null;let E=b.getAttribute("href")||b.getAttribute("xlink:href")||(typeof b.getAttributeNS=="function"?b.getAttributeNS(l,"href"):null);if(E)return E;let S=b.attributes;if(!S)return null;for(let v=0;v<S.length;v++){let $=S[v];if(!$||!$.name)continue;if($.name==="href")return $.value;let P=$.name.indexOf(":");if(P!==-1&&$.name.slice(P+1)==="href")return $.value}return null},u=new Set(Array.from(e.querySelectorAll("[id]")).map(b=>b.id)),d=new Set,m=!1,h=(b,E=null)=>{if(!b)return;o.lastIndex=0;let S;for(;S=o.exec(b);){m=!0;let v=(S[1]||"").trim();v&&(u.has(v)||(d.add(v),E&&!E.has(v)&&E.add(v)))}},g=b=>{let E=b.querySelectorAll("use");for(let v of E){let $=s(v);if(!$||!$.startsWith("#"))continue;m=!0;let P=$.slice(1).trim();P&&!u.has(P)&&d.add(P)}let S=b.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 v of S){h(v.getAttribute("style")||"");for(let $ of a)h(v.getAttribute($))}};for(let b of i)g(b);if(!m)return;let p=e.querySelector("svg.inline-defs-container");p||(p=n.createElementNS("http://www.w3.org/2000/svg","svg"),p.classList.add("inline-defs-container"),p.setAttribute("aria-hidden","true"),p.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(p,e.firstChild||null));let f=p.querySelector("defs")||null,y=b=>{if(!b||u.has(b))return null;let E=c(b),S=v=>{let $=r.querySelector(v);return $&&!e.contains($)?$:null};return S(`svg defs > *#${E}`)||S(`svg > symbol#${E}`)||S(`*#${E}`)};if(!d.size)return;let x=new Set(d),w=new Set;for(;x.size;){let b=x.values().next().value;if(x.delete(b),!b||u.has(b)||w.has(b))continue;let E=y(b);if(!E){w.add(b);continue}f||(f=n.createElementNS("http://www.w3.org/2000/svg","defs"),p.appendChild(f));let S=E.cloneNode(!0);S.id||S.setAttribute("id",b),f.appendChild(S),w.add(b),u.add(b);let v=[S,...S.querySelectorAll("*")];for(let $ of v){let P=s($);if(P&&P.startsWith("#")){let D=P.slice(1).trim();D&&!u.has(D)&&!w.has(D)&&x.add(D)}let B=$.getAttribute?.("style")||"";B&&h(B,x);for(let D of a){let A=$.getAttribute?.(D);A&&h(A,x)}}}}ne();function qa(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 c=a.currentNode,l=getComputedStyle(c),s=l.position;if(s!=="sticky"&&s!=="-webkit-sticky")continue;let u=dr(l.top),d=dr(l.bottom);if(u==null&&d==null)continue;let m=ja(c,e),h=za(t,m,o);if(!h)continue;let g=c.getBoundingClientRect(),p=g.width,f=g.height,y=g.left-r.left;if(!(p>0&&f>0)||!Number.isFinite(y))continue;let x=u!=null?u+n:n+(i-f-d);if(!Number.isFinite(x))continue;let w=Number.parseInt(l.zIndex,10),b=Number.isFinite(w),E=b?Math.max(w,1)+1:2,S=b?w-1:0,v=h.cloneNode(!1);v.setAttribute(o,"1"),v.style.position="sticky",v.style.left=`${y}px`,v.style.top=`${x}px`,v.style.width=`${p}px`,v.style.height=`${f}px`,v.style.visibility="hidden",v.style.zIndex=String(S),v.style.overflow="hidden",v.style.background="transparent",v.style.boxShadow="none",v.style.filter="none",h.parentElement?.insertBefore(v,h),h.style.position="absolute",h.style.left=`${y}px`,h.style.top=`${x}px`,h.style.bottom="auto",h.style.zIndex=String(E),h.style.pointerEvents="none"}}function dr(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=Va(r,n)[t[i]],!r)return null;return r instanceof HTMLElement?r:null}function Va(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 Xa(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=t.borderStyle,o=t.borderWidth,a=n!=="none"&&parseFloat(r)>0,c=i==="none"||parseFloat(o)===0;a&&c&&(e.style.border=`${r} solid transparent`)}async function Ya(e,t={}){let n={styleMap:C.session.styleMap,styleCache:C.session.styleCache,nodeMap:C.session.nodeMap,options:t},r,i="",o="";Xa(e);try{Ua(e)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{r=await mt(e,n,t)}catch(l){throw console.warn("deepClone failed:",l),l}try{await an(e,r,n,t)}catch(l){console.warn("inlinePseudoElements failed:",l)}await la(r,n);try{let l=r.querySelectorAll("style[data-sd]");for(let s of l)o+=s.textContent||"",s.remove()}catch(l){F(n,"Failed to extract shadow CSS from style[data-sd]",l)}let a=pi(n.styleMap);i=Array.from(a.entries()).map(([l,s])=>`.${s}{${l}}`).join(""),i=o+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+i;for(let[l,s]of n.styleMap.entries()){if(l.tagName==="STYLE")continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",s.replace(/;/g,"; "));continue}let u=a.get(s);u&&l.classList.add(u);let d=l.style?.backgroundImage,m=l.dataset?.snapdomHasIcon;d&&d!=="none"&&(l.style.backgroundImage=d),m&&(l.style.verticalAlign="middle",l.style.display="inline")}for(let[l,s]of n.nodeMap.entries()){let u=s.scrollLeft,d=s.scrollTop;if((u||d)&&l instanceof HTMLElement){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";let m=document.createElement("div");for(m.style.transform=`translate(${-u}px, ${-d}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(qa(e,c),e===n.nodeMap.get(r)){let l=n.styleCache.get(e)||ue(e);n.styleCache.set(e,l);let s=ni(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=s||""}for(let[l,s]of n.nodeMap.entries())s.tagName==="PRE"&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:r,classCSS:i,styleCache:n.styleCache}}_e();var Or="http://www.w3.org/1999/xlink";function Ga(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(Or,"href"):null)}function Ka(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,c=t||o||r||e.width||e.naturalWidth||100,l=n||a||i||e.height||e.naturalHeight||100;return{width:c,height:l}}async function Ja(e,t={}){let n=Array.from(e.querySelectorAll("img")),r=async a=>{if(!a.getAttribute("src")){let m=a.currentSrc||a.src||"";m&&a.setAttribute("src",m)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let c=a.src||"";if(!c)return;let l=await te(c,{as:"dataURL",useProxy:t.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){a.src=l.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:s,height:u}=Ka(a),{fallbackURL:d}=t||{};if(d)try{let m=typeof d=="function"?await d({width:s,height:u,src:c,element:a}):d;if(m){let h=await te(m,{as:"dataURL",useProxy:t.useProxy});if(h?.ok&&typeof h.data=="string"){a.src=h.data,a.width||(a.width=s),a.height||(a.height=u);return}}}catch{}if(t.placeholders!==!1){let m=document.createElement("div");m.style.cssText=[`width:${s}px`,`height:${u}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${u}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),m.textContent="img",a.replaceWith(m)}else{let m=document.createElement("div");m.style.cssText=`display:inline-block;width:${s}px;height:${u}px;visibility:hidden;`,a.replaceWith(m)}};for(let a=0;a<n.length;a+=4){let c=n.slice(a,a+4).map(r);await Promise.allSettled(c)}let i=Array.from(e.querySelectorAll("image")),o=async a=>{let c=Ga(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let l=await te(c,{as:"dataURL",useProxy:t.useProxy});l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")&&(a.setAttribute("href",l.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(Or,"href"))};for(let a=0;a<i.length;a+=4){let c=i.slice(a,a+4).map(o);await Promise.allSettled(c)}}re();async function Za(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"],c=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],l=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;i.length;){let[s,u]=i.shift();if(!u)continue;let d=n.get(s)||ue(s);n.has(s)||n.set(s,d);let m=(()=>{let p=d.getPropertyValue("border-image"),f=d.getPropertyValue("border-image-source");return p&&p!=="none"||f&&f!=="none"})();for(let p of c){let f=d.getPropertyValue(p);f&&u.style.setProperty(p,f)}for(let p of o){let f=d.getPropertyValue(p);if(p==="background-image"&&(!f||f==="none")){let w=d.getPropertyValue("background");w&&/url\s*\(/.test(w)&&(f=Kt(w).find(b=>/url\s*\(/.test(b))||f)}if(!f||f==="none")continue;let y=Kt(f),x=await Promise.all(y.map(w=>hr(w,r)));x.some(w=>w&&w!=="none"&&!/^url\(undefined/.test(w))&&u.style.setProperty(p,x.join(", "))}for(let p of a){let f=d.getPropertyValue(p);!f||f==="initial"||u.style.setProperty(p,f)}if(m)for(let p of l){let f=d.getPropertyValue(p);!f||f==="initial"||u.style.setProperty(p,f)}let h=s.shadowRoot?Array.from(s.shadowRoot.children).filter(p=>p.tagName!=="STYLE"):Array.from(s.children),g=Array.from(u.children).filter(p=>!(p.dataset?.snapdomPseudo||p.tagName==="STYLE"&&p.dataset?.sd));for(let p=0;p<Math.min(h.length,g.length);p++)i.push([h[p],g[p]])}}re();ne();function Qa(e){if(!e)return()=>{};let t=[];function n(r){let i=el(r);i&&t.push(i);for(let o of r.children||[])n(o)}return n(e),()=>t.forEach(r=>r())}function el(e){if(!e)return()=>{};let t=tl(e);if(t<=0)return()=>{};if(!ol(e))return()=>{};let n=getComputedStyle(e),r=Math.round(nl(n)*t+rl(n)),i=e.textContent??"",o=i;if(e.scrollHeight<=r+.5)return()=>{};let a=0,c=i.length,l=-1;for(;a<=c;){let s=a+c>>1;e.textContent=i.slice(0,s)+"\u2026",e.scrollHeight<=r+.5?(l=s,a=s+1):c=s-1}return e.textContent=(l>=0?i.slice(0,l):"")+"\u2026",()=>{e.textContent=o}}function tl(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 nl(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 rl(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function ol(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var Ye=[];function Wr(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 il(...e){let t=e.flat();for(let n of t){let r=Wr(n);r&&(Ye.some(i=>i&&i.name&&r.name&&i.name===r.name)||Ye.push(r))}}function Hr(e){return(e&&Array.isArray(e.plugins)?e.plugins:Ye)||Ye}async function he(e,t,n){let r=n,i=Hr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let c=await a(t,r);typeof c<"u"&&(r=c)}return r}async function al(e,t,n){let r=[],i=Hr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let c=await a(t,n);typeof c<"u"&&r.push(c)}return r}function ll(e){let t=[];if(Array.isArray(e))for(let n of e){let r=Wr(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 Ye)n&&n.name&&!t.some(r=>r.name===n.name)&&t.push(n);return Object.freeze(t)}function sl(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=ll(t)),e}re();function cl(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow="none"}catch(o){F(n,"stripRootShadows boxShadow",o)}try{t.style.textShadow="none"}catch(o){F(n,"stripRootShadows textShadow",o)}try{t.style.outline="none"}catch(o){F(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){F(n,"stripRootShadows filter",o)}}function ul(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 dl(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 c=a.name;if(c.includes("@")){o.removeAttribute(c);continue}if(c.includes(":")){let l=c.split(":",1)[0];if(!r.has(l)){o.removeAttribute(c);continue}}if(n&&(c.startsWith("x-")||c.startsWith("v-")||c.startsWith(":")||c.startsWith("on:")||c.startsWith("bind:")||c.startsWith("let:")||c.startsWith("class:"))){o.removeAttribute(c);continue}}}}function fl(e,t={}){e&&(dl(e,t),ul(e))}function ml(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function pl(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function hl(e,t){if(!(e instanceof Element)||ml(e)||pl(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 gl(e,t,n=new Map){function r(i,o){if(!(i instanceof Element)||!(o instanceof Element))return;let a=i.childElementCount>o.childElementCount,c=n.get(i)||getComputedStyle(i);if(n.has(i)||n.set(i,c),a&&hl(i,c)){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=c.overflowY||c.overflowBlock||"visible",d=c.overflowX||c.overflowInline||"visible";(u!=="visible"||d!=="visible")&&(o.style.overflow="visible")}let l=Array.from(i.children),s=Array.from(o.children);for(let u=0;u<Math.min(l.length,s.length);u++)r(l[u],s[u])}r(e,t)}function yl(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function bl(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){F(t,"exclude selector match failed",r)}return!1}function wl(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,o=-1/0,a=!1,c=Array.from(e.children);for(let h of c){if(bl(h,t)||!yl(h))continue;let g=h.getBoundingClientRect(),p=g.top-r.top,f=g.bottom-r.top;f<=p||(p<i&&(i=p),f>o&&(o=f),a=!0)}let l=a?Math.max(0,o-i):0,s=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,m=parseFloat(n.paddingBottom)||0;return s+u+d+m+l}var k=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,xl=/::-webkit-scrollbar(-[a-z]+)?\b/i;function ln(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+=ln(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=ln(i.cssRules,t);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(xl.test(o)){let a=i.cssText;a&&!t.has(a)&&(t.add(a),n+=a)}}}catch{}}return n}function vl(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+=ln(i,t))}catch{}return n}function Sl(e){let t=e.boxShadow||"";if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let n=t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(c=>c.trim()),r=0,i=0,o=0,a=0;for(let c of n){let l=c.match(/-?\d+(\.\d+)?px/g)?.map(p=>parseFloat(p))||[];if(l.length<2)continue;let[s,u,d=0,m=0]=l,h=Math.abs(s)+d+m,g=Math.abs(u)+d+m;i=Math.max(i,h+Math.max(s,0)),a=Math.max(a,h+Math.max(-s,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 Cl(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 El(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0);return{top:t,right:t,bottom:t,left:t}}function kl(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,c=!1;for(let l of n){c=!0;let s=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[u=0,d=0,m=0]=s,h=Math.abs(u)+m,g=Math.abs(d)+m;i=Math.max(i,h+Math.max(u,0)),a=Math.max(a,h+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:k(r),right:k(i),bottom:k(o),left:k(a)},has:c}}function $l(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 o=Br(e);if(o.a===1&&o.b===0&&o.c===0&&o.d===1)return t.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}let i=r.match(/^matrix\(\s*([^)]+)\)$/i);if(i){let o=i[1].split(",").map(a=>parseFloat(a.trim()));if(o.length===6&&o.every(Number.isFinite)){let[a,c,l,s]=o,u=Math.sqrt(a*a+c*c)||0,d=0,m=0,h=0,g=0,p=0,f=0;u>0&&(d=a/u,m=c/u,h=d*l+m*s,g=l-d*h,p=s-m*h,f=Math.sqrt(g*g+p*p)||0,f>0?h=h/f:h=0);let y=u,x=0,w=h*f,b=f;try{t.style.transform=`matrix(${y}, ${x}, ${w}, ${b}, 0, 0)`}catch{}return{a:y,b:x,c:w,d:b}}}try{let o=String(r).trim();return t.style.transform=o+" translate(0px, 0px) rotate(0deg)",null}catch{return null}}function fr(e,t,n,r,i){let o=n.a,a=n.b,c=n.c,l=n.d,s=n.e||0,u=n.f||0;function d(y,x){let w=y-r,b=x-i,E=o*w+c*b,S=a*w+l*b;return E+=r+s,S+=i+u,[E,S]}let m=[d(0,0),d(e,0),d(0,t),d(e,t)],h=1/0,g=1/0,p=-1/0,f=-1/0;for(let[y,x]of m)y<h&&(h=y),x<g&&(g=x),y>p&&(p=y),x>f&&(f=x);return{minX:h,minY:g,maxX:p,maxY:f,width:p-h,height:f-g}}function Ml(e,t,n){let r=(e.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],a=(c,l)=>{let s=c.toLowerCase();return s==="left"||s==="top"?0:s==="center"?l/2:s==="right"||s==="bottom"?l:s.endsWith("px")?parseFloat(s)||0:s.endsWith("%")?(parseFloat(s)||0)*l/100:/^-?\d+(\.\d+)?$/.test(s)&&parseFloat(s)||0};return{ox:a(i,t),oy:a(o,n)}}function Al(e){let t={rotate:"0deg",scale:null,translate:null},n=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(n){let i=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},o=i("rotate");if(o)if(o.angle){let l=o.angle;t.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.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 l=getComputedStyle(e);t.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let a=i("scale");if(a){let l="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,s="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:l;t.scale=`${l} ${s}`}else{let l=getComputedStyle(e);t.scale=l.scale&&l.scale!=="none"?l.scale:null}let c=i("translate");if(c){let l="x"in c&&"value"in c.x?c.x.value:Array.isArray(c)?c[0]?.value:0,s="y"in c&&"value"in c.y?c.y.value:Array.isArray(c)?c[1]?.value:0,u="x"in c&&c.x?.unit?c.x.unit:"px",d="y"in c&&c.y?.unit?c.y.unit:"px";t.translate=`${l}${u} ${s}${d}`}else{let l=getComputedStyle(e);t.translate=l.translate&&l.translate!=="none"?l.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 Xt=null;function Ll(){if(Xt)return Xt;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),Xt=e,e}function Nl(e){let t=Ll(),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=Br(n);return t.removeChild(n),r}function Tl(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 Br(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 Ur(e,t){if(!e)throw new Error("Element cannot be null or undefined");ti(t.cache);let n=t.fast,r=t.outerTransforms!==!1,i=!!t.outerShadows,o={element:e,options:t,plugins:t.plugins},a,c,l,s="",u="",d,m,h=null;await he("beforeSnap",o),await he("beforeClone",o);let g=Qa(o.element);try{({clone:a,classCSS:c,styleCache:l}=await Ya(o.element,o.options)),!r&&a&&(h=$l(o.element,a)),!i&&a&&cl(o.element,a,o.options)}finally{g()}if(o={clone:a,classCSS:c,styleCache:l,...o},await he("afterClone",o),fl(o.clone),o.options?.excludeMode==="remove")try{gl(o.element,o.clone,o.styleCache)}catch(w){console.warn("[snapdom] shrink pass failed:",w)}try{await ga(o.clone,o.element)}catch{}await new Promise(w=>{Ne(async()=>{await Ja(o.clone,o.options),w()},{fast:n})}),await new Promise(w=>{Ne(async()=>{await Za(o.element,o.clone,o.styleCache,o.options),w()},{fast:n})}),t.embedFonts&&await new Promise(w=>{Ne(async()=>{let b=Fr(o.element),E=_a(o.element);if(xe()){let S=new Set(Array.from(b).map(v=>String(v).split("__")[0]).filter(Boolean));await Ir(S,1)}s=await Ra({required:b,usedCodepoints:E,preCached:!1,exclude:o.options.excludeFonts,useProxy:o.options.useProxy,fontStylesheetDomains:o.options.fontStylesheetDomains}),w()},{fast:n})});let p=fi(o.clone).sort(),f=p.join(",");C.baseStyle.has(f)?u=C.baseStyle.get(f):await new Promise(w=>{Ne(()=>{u=mi(p),C.baseStyle.set(f,u),w()},{fast:n})});let y=vl(o.element?.ownerDocument||document);o={fontsCSS:s,baseCSS:u,scrollbarCSS:y,...o},await he("beforeRender",o),await new Promise(w=>{Ne(()=>{let b=ue(o.element),E=o.element.getBoundingClientRect(),S=Math.max(1,k(o.element.offsetWidth||parseFloat(b.width)||E.width||1)),v=Math.max(1,k(o.element.offsetHeight||parseFloat(b.height)||E.height||1)),$=o.element.ownerDocument||document;if(o.element===$.body||o.element===$.documentElement){let j=Math.max(o.element.scrollHeight||0,$.documentElement?.scrollHeight||0,$.body?.scrollHeight||0),V=Math.max(o.element.scrollWidth||0,$.documentElement?.scrollWidth||0,$.body?.scrollWidth||0);j>0&&(v=Math.max(v,k(j))),V>0&&(S=Math.max(S,k(V)));try{let z=$.createElement("div");z.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+S+"px!important;overflow:visible!important;visibility:hidden!important;";let nt=$.createElement("style");nt.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,z.appendChild(nt),z.appendChild(o.clone.cloneNode(!0)),$.body.appendChild(z);let rt=z.scrollHeight,ot=z.scrollWidth;$.body.removeChild(z),rt>0&&(v=Math.max(v,k(rt))),ot>0&&(S=Math.max(S,k(ot)))}catch{}}if(o.options?.excludeMode==="remove"){let j=wl(o.element,o.options);Number.isFinite(j)&&j>0&&(v=Math.max(1,Math.min(v,k(j+1))))}let P=(j,V=NaN)=>{let z=typeof j=="string"?parseFloat(j):j;return Number.isFinite(z)?z:V},B=P(o.options.width),D=P(o.options.height),A=S,M=v,U=Number.isFinite(B),ee=Number.isFinite(D),et=v>0?S/v:1;U&&ee?(A=Math.max(1,k(B)),M=Math.max(1,k(D))):U?(A=Math.max(1,k(B)),M=Math.max(1,k(A/(et||1)))):ee?(M=Math.max(1,k(D)),A=Math.max(1,k(M*(et||1)))):(A=S,M=v);let R=0,T=0,W=S,O=v;if(!r&&h&&Number.isFinite(h.a)){let j={a:h.a,b:h.b||0,c:h.c||0,d:h.d||1,e:0,f:0},V=fr(S,v,j,0,0);R=k(V.minX),T=k(V.minY),W=k(V.maxX),O=k(V.maxY)}else if(r&&mr(o.element)){let j=b.transform&&b.transform!=="none"?b.transform:"",V=Al(o.element),z=Nl({baseTransform:j,rotate:V.rotate||"0deg",scale:V.scale,translate:V.translate}),{ox:nt,oy:rt}=Ml(b,S,v),ot=z.is2D?z:new DOMMatrix(z.toString()),it=fr(S,v,ot,nt,rt);R=k(it.minX),T=k(it.minY),W=k(it.maxX),O=k(it.maxY)}let de=Sl(b),ae=Cl(b),Ee=El(b),ke=kl(b),ge=i?{top:k(de.top+ae.top+Ee.top+ke.bleed.top),right:k(de.right+ae.right+Ee.right+ke.bleed.right),bottom:k(de.bottom+ae.bottom+Ee.bottom+ke.bleed.bottom),left:k(de.left+ae.left+Ee.left+ke.bleed.left)}:{top:0,right:0,bottom:0,left:0};R=k(R-ge.left),T=k(T-ge.top),W=k(W+ge.right),O=k(O+ge.bottom);let We=Math.max(1,k(W-R)),bn=Math.max(1,k(O-T)),xo=U||ee?k(A/S):1,vo=ee||U?k(M/v):1,So=Math.max(1,k(We*xo)),Co=Math.max(1,k(bn*vo)),wn="http://www.w3.org/2000/svg",Eo=xe()&&mr(o.element)?1:0,fe=k(Eo+(r?0:1)),me=document.createElementNS(wn,"foreignObject"),ko=k(R),$o=k(T);me.setAttribute("x",String(k(-(ko-fe)))),me.setAttribute("y",String(k(-($o-fe)))),me.setAttribute("width",String(k(S+fe*2))),me.setAttribute("height",String(k(v+fe*2))),me.style.overflow="visible";let xn=document.createElement("style");xn.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,me.appendChild(xn);let tt=document.createElement("div");tt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),tt.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${k(S)}px;height:${k(v)}px`,tt.appendChild(o.clone),me.appendChild(tt);let Mo=new XMLSerializer().serializeToString(me),Ft=k(We+fe*2),It=k(bn+fe*2),vn=U||ee;t.meta={w0:S,h0:v,vbW:Ft,vbH:It,targetW:A,targetH:M};let Ao=xe()&&vn?Ft:k(So+fe*2),Lo=xe()&&vn?It:k(Co+fe*2),No=parseFloat(ue($.documentElement)?.fontSize)||16;m=`<svg xmlns="${wn}" width="${Ao}" height="${Lo}" viewBox="0 0 ${Ft} ${It}" font-size="${No}px">`+Mo+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,o={svgString:m,dataURL:d,...o},w()},{fast:n})}),await he("afterRender",o);let x=document.getElementById("snapdom-sandbox");return x&&x.style.position==="absolute"&&x.remove(),o.dataURL}function mr(e){return Tl(e)}ne();function Rl(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let n=ei(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}}Ke();vr();re();_e();ne();function _l(...e){return il(...e),_}var _=Object.assign(Fl,{plugins:_l}),qr=Symbol("snapdom.internal"),Pl=Symbol("snapdom.internal.silent"),pr=!1;async function Fl(e,t){if(!e)throw new Error("Element cannot be null or undefined");let n=Rl(t);if(sl(n,t&&t.plugins),xe()&&(n.embedFonts===!0||Dl(e))){if(n.embedFonts)try{let i=Fr(e),o=new Set([...i].map(a=>String(a).split("__")[0]).filter(Boolean));await Ir(o,1)}catch{}let r=n.safariWarmupAttempts??3;for(let i=0;i<r;i++)try{await Il(e,t)}catch{}}return n.iconFonts&&n.iconFonts.length>0&&ca(n.iconFonts),n.snap||(n.snap={toPng:(r,i)=>_.toPng(r,i),toSvg:(r,i)=>_.toSvg(r,i)}),_.capture(e,n,qr)}_.capture=async(e,t,n)=>{if(n!==qr)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await Ur(e,t),i={img:async(p,f)=>{let{toImg:y}=await Promise.resolve().then(()=>(Yn(),Jt));return y(r,{...p,...f||{}})},svg:async(p,f)=>{let{toSvg:y}=await Promise.resolve().then(()=>(Yn(),Jt));return y(r,{...p,...f||{}})},canvas:async(p,f)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(xt(),Sr));return y(r,{...p,...f||{}})},blob:async(p,f)=>{let{toBlob:y}=await Promise.resolve().then(()=>(Mr(),kr));return y(r,{...p,...f||{}})},png:async(p,f)=>{let{rasterize:y}=await Promise.resolve().then(()=>(ft(),dt));return y(r,{...p,...f||{},format:"png"})},jpeg:async(p,f)=>{let{rasterize:y}=await Promise.resolve().then(()=>(ft(),dt));return y(r,{...p,...f||{},format:"jpeg"})},webp:async(p,f)=>{let{rasterize:y}=await Promise.resolve().then(()=>(ft(),dt));return y(r,{...p,...f||{},format:"webp"})},download:async(p,f)=>{let{download:y}=await Promise.resolve().then(()=>(Ai(),Ar));return y(r,{...p,...f||{}})}},o={};for(let p of["img","svg","canvas","blob","png","jpeg","webp"])o[p]=async f=>i[p](t,{...f||{},[Pl]:!0});o.jpg=o.jpeg;let a={...t,export:{url:r},exports:o},c=await al("defineExports",a),l=Object.assign({},...c.filter(p=>p&&typeof p=="object")),s={...i,...l};s.jpeg&&!s.jpg&&(s.jpg=(p,f)=>s.jpeg(p,f));function u(p,f){let y={...t,...f||{}};return(p==="jpeg"||p==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,m=Promise.resolve();async function h(p,f){let y=async()=>{let x=s[p];if(!x)throw new Error(`[snapdom] Unknown export type: ${p}`);let w=u(p,f),b={...t,export:{type:p,options:w,url:r}};await he("beforeExport",b);let E=await x(b,w);return await he("afterExport",b,E),d||(d=!0,await he("afterSnap",t)),E};return m=m.then(y)}let g={url:r,toRaw:()=>r,to:(p,f)=>h(p,f),toImg:p=>h("img",p),toSvg:p=>h("svg",p),toCanvas:p=>h("canvas",p),toBlob:p=>h("blob",p),toPng:p=>h("png",p),toJpg:p=>h("jpg",p),toWebp:p=>h("webp",p),download:p=>h("download",p)};for(let p of Object.keys(s)){let f="to"+p.charAt(0).toUpperCase()+p.slice(1);g[f]||(g[f]=y=>h(p,y))}return g};_.toRaw=(e,t)=>_(e,t).then(n=>n.toRaw());_.toImg=(e,t)=>_(e,t).then(n=>n.toImg());_.toSvg=(e,t)=>_(e,t).then(n=>n.toSvg());_.toCanvas=(e,t)=>_(e,t).then(n=>n.toCanvas());_.toBlob=(e,t)=>_(e,t).then(n=>n.toBlob());_.toPng=(e,t)=>_(e,{...t,format:"png"}).then(n=>n.toPng());_.toJpg=(e,t)=>_(e,{...t,format:"jpeg"}).then(n=>n.toJpg());_.toWebp=(e,t)=>_(e,{...t,format:"webp"}).then(n=>n.toWebp());_.download=(e,t)=>_(e,t).then(n=>n.download());async function Il(e,t){if(pr)return;let n={...t,fast:!0,embedFonts:!0,scale:.2},r;try{r=await Ur(e,n)}catch(i){F(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){F(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(c){F(t,"safariWarmup img.decode failed",c)}let a=performance.now();for(;!(o.complete&&o.naturalWidth>0)&&performance.now()-a<900;)await new Promise(c=>setTimeout(c,200));await new Promise(c=>requestAnimationFrame(c));try{let c=document.createElement("canvas");c.width=Math.max(1,o.naturalWidth||10),c.height=Math.max(1,o.naturalHeight||10);let l=c.getContext("2d");l&&l.drawImage(o,0,0)}catch{}await new Promise(c=>requestAnimationFrame(c));try{o.remove()}catch(c){F(t,"safariWarmup img.remove failed",c)}i()})()}),e.querySelectorAll("canvas").forEach(i=>{try{let o=i.getContext("2d",{willReadFrequently:!0});o&&o.getImageData(0,0,1,1)}catch(o){F(t,"safariWarmup canvas poke failed",o)}}),pr=!0}function Dl(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}async function St(){let e=document.documentElement,t=window.innerWidth,n=window.innerHeight,r=await _.toPng(e,{width:t,height:n});if(!r)throw new Error("SnapDOM capture returned empty result");if(typeof r=="string"){let l=r.replace(/^data:image\/png;base64,/,"");if(!l)throw new Error("SnapDOM capture produced no image data");return{image:l,width:t,height:n}}r.complete||await Promise.race([new Promise((l,s)=>{r.onload=()=>l(),r.onerror=()=>s(new Error("SnapDOM image failed to load"))}),X(1e4).then(()=>{throw new Error("Screenshot image load timed out")})]);let i=document.createElement("canvas");i.width=r.naturalWidth||t,i.height=r.naturalHeight||n;let o=i.getContext("2d");if(!o)throw new Error("Failed to create canvas context");o.drawImage(r,0,0);let c=i.toDataURL("image/png").replace(/^data:image\/png;base64,/,"");if(!c)throw new Error("Canvas export produced no image data");return{image:c,width:t,height:n}}var jr="__mindstudio-cursor",Ol="__mindstudio-cursor-ripple",ve=450,$t=180,Ct=200,Wl=1500,Et="#DD2590",Hl=`<svg width="31" height="32" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9
|
+
`):u+=m[0]}return u+=c.slice(d),u}let a=nr(e,t||location.href);return a=await o(a,t||location.href,0),a}var Nr=/url\((["']?)([^"')]+)\1\)/g,Aa=/@font-face[^{}]*\{[^}]*\}/g;function Tr(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],c=l=>{if(!l.includes("?"))return parseInt(l,16);let s=parseInt(l.replace(/\?/g,"0"),16),u=parseInt(l.replace(/\?/g,"F"),16);return[s,u]};if(a){let l=c(o),s=c(a),u=Array.isArray(l)?l[0]:l,d=Array.isArray(s)?s[1]:s;t.push([Math.min(u,d),Math.max(u,d)])}else{let l=c(o);Array.isArray(l)?t.push([l[0],l[1]]):t.push([l,l])}}return t}function Rr(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 dn(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(Nr)){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 _r(e,t,n=""){let r=e;for(let i of e.matchAll(Nr)){let o=sn(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(!ce(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 c=await te(a,{as:"dataURL",useProxy:n,silent:!0});if(c.ok&&typeof c.data=="string"){let l=c.data;C.resource?.set(a,l),C.font?.add(a),r=r.replace(i[0],`url(${l})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return r}function La(e){if(!e.length)return null;let t=(a,c)=>e.some(([l,s])=>!(s<a||l>c)),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 rr(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=La(o);if(a&&r.has(a))return!0}return!1}}function Na(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]||"",c=vt(a),l=(o.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),s=(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(),m=(o.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),h=dn(m,location.href),g=h.length?h.map(f=>String(f).toLowerCase()).sort().join("|"):m.toLowerCase(),p=[String(c||"").toLowerCase(),l,s,u,d.toLowerCase(),g].join("|");n.has(p)||(n.add(p),r.push(o))}if(r.length===0)return e;let i=0;return e.replace(t,()=>r[i++]||"")}function Ta(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()}):"",c=(n||[]).map(u=>`${(u.family||"").toLowerCase()}::${u.weight||"normal"}::${u.style||"normal"}::${u.src||""}`).sort().join("|"),l=r||"",s=(i||[]).map(u=>String(u).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${o}::ex=${a}::lf=${c}::px=${l}::fd=${s}`}async function Pr(e,t,n,r){let i;try{i=e.cssRules||[]}catch{return}let o=(a,c)=>{try{return new URL(a,c||location.href).href}catch{return a}};for(let a of i){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let c=a.href?o(a.href,t):t;if(r.depth>=yt){console.warn(`[snapDOM] CSSOM import depth exceeded (${yt}) at ${c}`);continue}if(c&&r.visitedSheets.has(c)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${c}`);continue}c&&r.visitedSheets.add(c);let l={...r,depth:(r.depth||0)+1};await Pr(a.styleSheet,c,n,l);continue}if(a.type===CSSRule.FONT_FACE_RULE){let c=(a.style.getPropertyValue("font-family")||"").trim(),l=vt(c);if(!l||ce(l))continue;let s=(a.style.getPropertyValue("font-weight")||"400").trim(),u=(a.style.getPropertyValue("font-style")||"normal").trim(),d=(a.style.getPropertyValue("font-stretch")||"100%").trim(),m=(a.style.getPropertyValue("src")||"").trim(),h=(a.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(l,u,s,d))continue;let g=Tr(h);if(!Rr(r.usedCodepoints,g))continue;let p={family:l,weightSpec:s,styleSpec:u,stretchSpec:d,unicodeRange:h,srcRaw:m,srcUrls:dn(m,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(p,g))continue;if(/url\(/i.test(m)){let f=await _r(m,t||location.href,r.useProxy);await n(`@font-face{font-family:${l};src:${f};font-style:${u};font-weight:${s};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}else await n(`@font-face{font-family:${l};src:${m};font-style:${u};font-weight:${s};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}}}async function Ra({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 f of e){let[y,x,w,b]=String(f).split("__");if(!y)continue;let E=a.get(y)||[];E.push({w:parseInt(x,10),s:w,st:parseInt(b,10)}),a.set(y,E)}function c(f,y,x,w){if(!a.has(f))return!1;let b=a.get(f),E=va(x),S=Sa(y),v=Ca(w),$=E.min!==E.max,P=E.min,B=A=>S.kind==="normal"&&A==="normal"||S.kind!=="normal"&&(A==="italic"||A==="oblique"),D=!1;for(let A of b){let M=$?A.w>=E.min&&A.w<=E.max:A.w===P,U=B(ht(A.s)),ee=A.st>=v.min&&A.st<=v.max;if(M&&U&&ee){D=!0;break}}if(D)return!0;if(!$)for(let A of b){let M=B(ht(A.s)),U=A.st>=v.min&&A.st<=v.max;if(Math.abs(P-A.w)<=300&&M&&U)return!0}if(!$&&S.kind==="normal"&&b.some(A=>ht(A.s)!=="normal"))for(let A of b){let M=Math.abs(P-A.w)<=300,U=A.st>=v.min&&A.st<=v.max;if(M&&U)return!0}return!1}let l=rr(n),s=Ta(e,n,r,i,o);if(C.resource?.has(s))return C.resource.get(s);let u=$a(e),d=[],m=tn;for(let f of document.querySelectorAll("style")){let y=f.textContent||"";for(let x of y.matchAll(m)){let w=(x[2]||x[4]||"").trim();!w||ce(w)||document.querySelector(`link[rel="stylesheet"][href="${w}"]`)||d.push(w)}}d.length&&await Promise.all(d.map(f=>new Promise(y=>{if(document.querySelector(`link[rel="stylesheet"][href="${f}"]`))return y(null);let x=document.createElement("link");x.rel="stylesheet",x.href=f,x.setAttribute("data-snapdom","injected-import"),x.onload=()=>y(x),x.onerror=()=>y(null),document.head.appendChild(x)})));let h="",g=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(f=>!!f.href);for(let f of g)try{if(ce(f.href))continue;let y="",x=!1;try{x=new URL(f.href,location.href).origin===location.origin}catch{}if(!x){let b=Array.isArray(o)?o:[];if(!ka(f.href,u,b))continue}if(x){let b=Array.from(document.styleSheets).find(E=>E.href===f.href);if(b)try{let E=b.cssRules||[];y=Array.from(E).map(S=>S.cssText).join("")}catch{}}if(!y){let b=await te(f.href,{as:"text",useProxy:i});if(b?.ok&&typeof b.data=="string"&&(y=b.data),ce(f.href))continue}y=await Ma(y,f.href,i);let w="";for(let b of y.match(Aa)||[]){let E=(b.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),S=vt(E);if(!S||ce(S))continue;let v=(b.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),$=(b.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),P=(b.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),B=(b.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),D=(b.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),A=dn(D,f.href);if(!c(S,$,v,P))continue;let M=Tr(B);if(!Rr(t,M))continue;let U={family:S,weightSpec:v,styleSpec:$,stretchSpec:P,unicodeRange:B,srcRaw:D,srcUrls:A,href:f.href};if(n&&l(U,M))continue;let ee=/url\(/i.test(D)?await _r(b,f.href,i):b;w+=ee}w.trim()&&(h+=w)}catch{console.warn("[snapDOM] Failed to process stylesheet:",f.href)}let p={requiredIndex:a,usedCodepoints:t,faceMatchesRequired:c,simpleExcluder:n?rr(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(let f of document.styleSheets)if(!(f.href&&g.some(y=>y.href===f.href)))try{let y=f.href||location.origin+"/";y&&p.visitedSheets.add(y),await Pr(f,y,async x=>{h+=x},p)}catch{}try{for(let f of document.fonts||[]){if(!f||!f.family||f.status!=="loaded"||!f._snapdomSrc)continue;let y=String(f.family).replace(/^['"]+|['"]+$/g,"");if(ce(y)||!a.has(y)||n?.families&&n.families.some(w=>String(w).toLowerCase()===y.toLowerCase()))continue;let x=f._snapdomSrc;if(!String(x).startsWith("data:")){if(C.resource?.has(f._snapdomSrc))x=C.resource.get(f._snapdomSrc),C.font?.add(f._snapdomSrc);else if(!C.font?.has(f._snapdomSrc))try{let w=await te(f._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(w.ok&&typeof w.data=="string")x=w.data,C.resource?.set(f._snapdomSrc,x),C.font?.add(f._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",f._snapdomSrc);continue}}h+=`@font-face{font-family:'${y}';src:url(${x});font-style:${f.style||"normal"};font-weight:${f.weight||"normal"};}`}}catch{}for(let f of r){if(!f||typeof f!="object")continue;let y=String(f.family||"").replace(/^['"]+|['"]+$/g,"");if(!y||ce(y)||!a.has(y)||n?.families&&n.families.some(v=>String(v).toLowerCase()===y.toLowerCase()))continue;let x=f.weight!=null?String(f.weight):"normal",w=f.style!=null?String(f.style):"normal",b=f.stretchPct!=null?`${f.stretchPct}%`:"100%",E=String(f.src||""),S=E;if(!S.startsWith("data:")){if(C.resource?.has(E))S=C.resource.get(E),C.font?.add(E);else if(!C.font?.has(E))try{let v=await te(E,{as:"dataURL",useProxy:i,silent:!0});if(v.ok&&typeof v.data=="string")S=v.data,C.resource?.set(E,S),C.font?.add(E);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",E);continue}}h+=`@font-face{font-family:'${y}';src:url(${S});font-style:${w};font-weight:${x};font-stretch:${b};}`}return h&&(h=Na(h),C.resource?.set(s,h)),h}function Fr(e){let t=new Set;if(!e)return t;let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),r=a=>{let c=vt(a.fontFamily);if(!c)return;let l=(s,u,d)=>`${c}__${pt(s)}__${ht(u)}__${xa(d)}`;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,c=getComputedStyle(a);r(c);let l=getComputedStyle(a,"::before");l&&l.content&&l.content!=="none"&&r(l);let s=getComputedStyle(a,"::after");s&&s.content&&s.content!=="none"&&r(s)}return t}function _a(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 c=getComputedStyle(o,a)?.getPropertyValue("content");if(!(!c||c==="none"))if(/^"/.test(c)||/^'/.test(c))n(c.slice(1,-1));else{let l=c.match(/\\[0-9A-Fa-f]{1,6}/g);if(l)for(let s of l)try{t.add(parseInt(s.slice(1),16))}catch{}}}}}return t}async function Ir(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)))}ne();function Pa(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function Fa(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function or(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 ir(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 ar(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,e));case"decimal-leading-zero":return(e<10?"0":"")+String(Math.max(0,e));case"lower-alpha":return or(e,!1);case"upper-alpha":return or(e,!0);case"lower-roman":return ir(e,!1);case"upper-roman":return ir(e,!0);default:return String(Math.max(0,e))}}function Ia(e){let t=()=>C?.session?.__counterEpoch??0,n=t(),r=new WeakMap,i=e instanceof Document?e.documentElement:e,o=m=>m&&m.tagName==="LI",a=m=>{let h=0,g=m?.parentElement;if(!g)return 0;for(let p of g.children){if(p===m)break;p.tagName==="LI"&&h++}return h},c=m=>{let h=new Map;for(let[g,p]of m)h.set(g,p.slice());return h},l=(m,h,g)=>{let p=c(m),f;try{f=g.style?.counterReset||getComputedStyle(g).counterReset}catch{}if(f&&f!=="none")for(let x of f.split(",")){let w=x.trim().split(/\s+/),b=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!b)continue;let S=h.get(b);if(S&&S.length){let v=S.slice();v.push(E),p.set(b,v)}else p.set(b,[E])}let y;try{y=g.style?.counterIncrement||getComputedStyle(g).counterIncrement}catch{}if(y&&y!=="none")for(let x of y.split(",")){let w=x.trim().split(/\s+/),b=w[0],E=Number.isFinite(Number(w[1]))?Number(w[1]):1;if(!b)continue;let S=p.get(b)||[];S.length===0&&S.push(0),S[S.length-1]+=E,p.set(b,S)}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"),S=Number.isFinite(Number(E))?Number(E):1,v=a(g),$=g.getAttribute("value");w=Number.isFinite(Number($))?Number($):S+v}else w=1+a(g);let b=p.get("list-item")||[];b.length===0&&b.push(0),b[b.length-1]=w,p.set("list-item",b)}}catch{}return p},s=(m,h,g)=>{let p=l(g,h,m);r.set(m,p);let f=p;for(let y of m.children)f=s(y,p,f);return p},u=new Map;s(i,u,u);function d(){let m=t();if(m!==n){n=m;let h=new Map;s(i,h,h)}}return{get(m,h){d();let g=r.get(m)?.get(h);return g&&g.length?g[g.length-1]:0},getStack(m,h){d();let g=r.get(m)?.get(h);return g?g.slice():[]}}}function Da(e,t,n){if(!e||e==="none")return e;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,i=e.replace(r,(o,a,c)=>{let l=String(c).split(",").map(s=>s.trim());if(a==="counter"){let s=l[0]?.replace(/^["']|["']$/g,""),u=(l[1]||"decimal").toLowerCase(),d=n.get(t,s);return ar(d,u)}else{let s=l[0]?.replace(/^["']|["']$/g,""),u=l[1]?.replace(/^["']|["']$/g,"")??"",d=(l[2]||"decimal").toLowerCase(),m=n.getStack(t,s);return m.length?m.map(h=>ar(h,d)).join(u):""}});return Fa(i)}catch{return"- "}}_e();ne();var Le=new WeakMap,lr=300;function Oa(e,t){let n=Dr(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=cr(e),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):cr(e)}function nn(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Dr(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 c=a.textContent?a.textContent.length:0;n+=`S${c}|`;let l=a.sheet,s=l?nn(l):null;s&&(r+=s.length)}else{let c=a.getAttribute("href")||"",l=a.getAttribute("media")||"all";n+=`L${c}|m:${l}|`;let s=a.sheet,u=s?nn(s):null;u&&(r+=u.length)}}let i=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(i)?i.length:0}|tr:${r}`,n}function sr(e,t,n){let r=nn(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 c of t)if(a.includes(c))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let c=0;c<o.cssRules.length&&n.budget>0;c++){let l=o.cssRules[c],s=l&&l.cssText?l.cssText:"";n.budget--;for(let u of t)if(s.includes(u))return!0}if(n.budget<=0)return!1}return!1}function cr(e=document){let t=Dr(e),n=Le.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 c=i[a].textContent||"";for(let l of r)if(c.includes(l))return Le.set(e,{fingerprint:t,result:!0}),!0}let o=e.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let a={budget:lr};try{for(let c of o)if(sr(c,r,a))return Le.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),c={budget:lr};for(let l=0;l<a.length&&c.budget>0;l++){let s=a[l],u=null;if(s.tagName,u=s.sheet||null,u&&sr(u,r,c))return Le.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(Le.set(e,{fingerprint:t,result:!0}),!0):(Le.set(e,{fingerprint:t,result:!1}),!1)}var Re=new WeakMap,ur=-1;function Wa(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Ha(e){if(!e)return"";let t=[],n=/"([^"]*)"/g,r;for(;r=n.exec(e);)t.push(r[1]);return t.length?t.join(""):Wa(e)}function rn(e,t){let n=e.parentElement,r=n?Re.get(n):null;return r?{get(i,o){let a=t.get(i,o),c=r.get(o);return typeof c=="number"?Math.max(a,c):a},getStack(i,o){let a=t.getStack(i,o);if(!a.length)return a;let c=r.get(o);if(typeof c=="number"){let l=a.slice();return l[l.length-1]=Math.max(l[l.length-1],c),l}return a}}:t}function on(e,t,n){let r=new Map;function i(l){let s=[];if(!l||l==="none")return s;for(let u of String(l).split(",")){let d=u.trim().split(/\s+/),m=d[0],h=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;m&&s.push({name:m,num:h})}return s}let o=i(t?.counterReset),a=i(t?.counterIncrement);function c(l){if(r.has(l))return r.get(l).slice();let s=n.getStack(e,l);s=s.length?s.slice():[];let u=o.find(m=>m.name===l);if(u){let m=Number.isFinite(u.num)?u.num:0;s=s.length?[...s,m]:[m]}let d=a.find(m=>m.name===l);if(d){let m=Number.isFinite(d.num)?d.num:1;s.length===0&&(s=[0]),s[s.length-1]+=m}return r.set(l,s.slice()),s}return{get(l,s){let u=c(s);return u.length?u[u.length-1]:0},getStack(l,s){return c(s)},__incs:a}}function Ba(e,t,n){let r;try{r=ue(e,t)}catch{}let i=r?.content;if(!i||i==="none"||i==="normal")return{text:"",incs:[]};let o=rn(e,n),a=on(e,r,o),c=Pa(i)?Da(i,e,a):i;return{text:Ha(c),incs:a.__incs||[]}}async function an(e,t,n,r){if(!(e instanceof Element)||!(t instanceof Element))return;let i=e.ownerDocument||document;if(!Oa(i,n))return;let o=C?.session?.__counterEpoch??0;if(ur!==o&&(Re=new WeakMap,n&&(n.__counterCtx=null),ur=o),!n.__counterCtx)try{n.__counterCtx=Ia(e.ownerDocument||document)}catch(l){F(n,"buildCounterContext failed",l)}let a=n.__counterCtx;for(let l of["::before","::after","::first-letter"])try{let s=ue(e,l);if(!s||s.content==="none"&&s.backgroundImage==="none"&&s.backgroundColor==="transparent"&&(s.borderStyle==="none"||parseFloat(s.borderWidth)===0)&&(!s.transform||s.transform==="none")&&s.display==="inline")continue;if(l==="::first-letter"){let R=ue(e);if(!(s.color!==R.color||s.fontSize!==R.fontSize||s.fontWeight!==R.fontWeight))continue;let T=Array.from(t.childNodes).find(We=>We.nodeType===Node.TEXT_NODE&&We.textContent?.trim().length>0);if(!T)continue;let W=T.textContent,O=W.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],de=W.slice(O?.length||0);if(!O||/[\uD800-\uDFFF]/.test(O))continue;let ae=document.createElement("span");ae.textContent=O,ae.dataset.snapdomPseudo="::first-letter";let Ee=Vn(s),ke=Gt(Ee,"span");n.styleMap.set(ae,ke);let ge=document.createTextNode(de);t.replaceChild(ge,T),t.insertBefore(ae,ge);continue}let u=s.content??"",d=u===""||u==="none"||u==="normal",{text:m,incs:h}=Ba(e,l,a),g=s.backgroundImage,p=s.backgroundColor,f=s.fontFamily,y=parseInt(s.fontSize)||32,x=parseInt(s.fontWeight)||!1,w=s.color||"#000",b=s.borderStyle,E=parseFloat(s.borderWidth),S=s.transform,v=ce(f),$=!d&&m!=="",P=g&&g!=="none",B=p&&p!=="transparent"&&p!=="rgba(0, 0, 0, 0)",D=b&&b!=="none"&&E>0,A=S&&S!=="none";if(!($||P||B||D||A)){if(h&&h.length&&e.parentElement){let R=Re.get(e.parentElement)||new Map;for(let{name:T}of h){if(!T)continue;let W=rn(e,a),O=on(e,ue(e,l),W).get(e,T);R.set(T,O)}Re.set(e.parentElement,R)}continue}let M=document.createElement("span");M.dataset.snapdomPseudo=l,M.style.pointerEvents="none";let U=Vn(s),ee=Gt(U,"span");if(n.styleMap.set(M,ee),v&&m&&m.length===1){let{dataUrl:R,width:T,height:W}=await ya(m,f,x,y,w),O=document.createElement("img");O.src=R,O.style=`height:${y}px;width:${T/W*y}px;object-fit:contain;`,M.appendChild(O),t.dataset.snapdomHasIcon="true"}else if(m&&m.startsWith("url(")){let R=sn(m);if(R?.trim())try{let T=await te(gt(R),{as:"dataURL",useProxy:r.useProxy});if(T?.ok&&typeof T.data=="string"){let W=document.createElement("img");W.src=T.data,W.style=`width:${y}px;height:auto;object-fit:contain;`,M.appendChild(W)}}catch(T){console.error(`[snapdom] Error in pseudo ${l} for`,e,T)}}else!v&&$&&(M.textContent=m);M.style.backgroundImage="none","maskImage"in M.style&&(M.style.maskImage="none"),"webkitMaskImage"in M.style&&(M.style.webkitMaskImage="none");try{M.style.backgroundRepeat=s.backgroundRepeat,M.style.backgroundSize=s.backgroundSize,s.backgroundPositionX&&s.backgroundPositionY?(M.style.backgroundPositionX=s.backgroundPositionX,M.style.backgroundPositionY=s.backgroundPositionY):M.style.backgroundPosition=s.backgroundPosition,M.style.backgroundOrigin=s.backgroundOrigin,M.style.backgroundClip=s.backgroundClip,M.style.backgroundAttachment=s.backgroundAttachment,M.style.backgroundBlendMode=s.backgroundBlendMode}catch{}if(P)try{let R=Kt(g),T=await Promise.all(R.map(hr));M.style.backgroundImage=T.join(", ")}catch(R){console.warn(`[snapdom] Failed to inline background-image for ${l}`,R)}B&&(M.style.backgroundColor=p);let et=M.childNodes.length>0||M.textContent?.trim()!==""||P||B||D||A;if(h&&h.length&&e.parentElement){let R=Re.get(e.parentElement)||new Map,T=rn(e,a),W=on(e,ue(e,l),T);for(let{name:O}of h){if(!O)continue;let de=W.get(e,O);R.set(O,de)}Re.set(e.parentElement,R)}if(!et)continue;l==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(M,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(M))}catch(s){console.warn(`[snapdom] Failed to capture ${l} for`,e,s)}let c=Array.from(t.children).filter(l=>!l.dataset.snapdomPseudo);if(n.nodeMap)for(let l of c){let s=n.nodeMap.get(l);s instanceof Element&&await an(s,l,n,r)}else{let l=Array.from(e.children);for(let s=0;s<Math.min(l.length,c.length);s++)await an(l[s],c[s],n,r)}}function Ua(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"],c=b=>window.CSS&&CSS.escape?CSS.escape(b):b.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),l="http://www.w3.org/1999/xlink",s=b=>{if(!b||!b.getAttribute)return null;let E=b.getAttribute("href")||b.getAttribute("xlink:href")||(typeof b.getAttributeNS=="function"?b.getAttributeNS(l,"href"):null);if(E)return E;let S=b.attributes;if(!S)return null;for(let v=0;v<S.length;v++){let $=S[v];if(!$||!$.name)continue;if($.name==="href")return $.value;let P=$.name.indexOf(":");if(P!==-1&&$.name.slice(P+1)==="href")return $.value}return null},u=new Set(Array.from(e.querySelectorAll("[id]")).map(b=>b.id)),d=new Set,m=!1,h=(b,E=null)=>{if(!b)return;o.lastIndex=0;let S;for(;S=o.exec(b);){m=!0;let v=(S[1]||"").trim();v&&(u.has(v)||(d.add(v),E&&!E.has(v)&&E.add(v)))}},g=b=>{let E=b.querySelectorAll("use");for(let v of E){let $=s(v);if(!$||!$.startsWith("#"))continue;m=!0;let P=$.slice(1).trim();P&&!u.has(P)&&d.add(P)}let S=b.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 v of S){h(v.getAttribute("style")||"");for(let $ of a)h(v.getAttribute($))}};for(let b of i)g(b);if(!m)return;let p=e.querySelector("svg.inline-defs-container");p||(p=n.createElementNS("http://www.w3.org/2000/svg","svg"),p.classList.add("inline-defs-container"),p.setAttribute("aria-hidden","true"),p.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(p,e.firstChild||null));let f=p.querySelector("defs")||null,y=b=>{if(!b||u.has(b))return null;let E=c(b),S=v=>{let $=r.querySelector(v);return $&&!e.contains($)?$:null};return S(`svg defs > *#${E}`)||S(`svg > symbol#${E}`)||S(`*#${E}`)};if(!d.size)return;let x=new Set(d),w=new Set;for(;x.size;){let b=x.values().next().value;if(x.delete(b),!b||u.has(b)||w.has(b))continue;let E=y(b);if(!E){w.add(b);continue}f||(f=n.createElementNS("http://www.w3.org/2000/svg","defs"),p.appendChild(f));let S=E.cloneNode(!0);S.id||S.setAttribute("id",b),f.appendChild(S),w.add(b),u.add(b);let v=[S,...S.querySelectorAll("*")];for(let $ of v){let P=s($);if(P&&P.startsWith("#")){let D=P.slice(1).trim();D&&!u.has(D)&&!w.has(D)&&x.add(D)}let B=$.getAttribute?.("style")||"";B&&h(B,x);for(let D of a){let A=$.getAttribute?.(D);A&&h(A,x)}}}}ne();function qa(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 c=a.currentNode,l=getComputedStyle(c),s=l.position;if(s!=="sticky"&&s!=="-webkit-sticky")continue;let u=dr(l.top),d=dr(l.bottom);if(u==null&&d==null)continue;let m=ja(c,e),h=za(t,m,o);if(!h)continue;let g=c.getBoundingClientRect(),p=g.width,f=g.height,y=g.left-r.left;if(!(p>0&&f>0)||!Number.isFinite(y))continue;let x=u!=null?u+n:n+(i-f-d);if(!Number.isFinite(x))continue;let w=Number.parseInt(l.zIndex,10),b=Number.isFinite(w),E=b?Math.max(w,1)+1:2,S=b?w-1:0,v=h.cloneNode(!1);v.setAttribute(o,"1"),v.style.position="sticky",v.style.left=`${y}px`,v.style.top=`${x}px`,v.style.width=`${p}px`,v.style.height=`${f}px`,v.style.visibility="hidden",v.style.zIndex=String(S),v.style.overflow="hidden",v.style.background="transparent",v.style.boxShadow="none",v.style.filter="none",h.parentElement?.insertBefore(v,h),h.style.position="absolute",h.style.left=`${y}px`,h.style.top=`${x}px`,h.style.bottom="auto",h.style.zIndex=String(E),h.style.pointerEvents="none"}}function dr(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=Va(r,n)[t[i]],!r)return null;return r instanceof HTMLElement?r:null}function Va(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 Xa(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=t.borderStyle,o=t.borderWidth,a=n!=="none"&&parseFloat(r)>0,c=i==="none"||parseFloat(o)===0;a&&c&&(e.style.border=`${r} solid transparent`)}async function Ya(e,t={}){let n={styleMap:C.session.styleMap,styleCache:C.session.styleCache,nodeMap:C.session.nodeMap,options:t},r,i="",o="";Xa(e);try{Ua(e)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{r=await mt(e,n,t)}catch(l){throw console.warn("deepClone failed:",l),l}try{await an(e,r,n,t)}catch(l){console.warn("inlinePseudoElements failed:",l)}await la(r,n);try{let l=r.querySelectorAll("style[data-sd]");for(let s of l)o+=s.textContent||"",s.remove()}catch(l){F(n,"Failed to extract shadow CSS from style[data-sd]",l)}let a=pi(n.styleMap);i=Array.from(a.entries()).map(([l,s])=>`.${s}{${l}}`).join(""),i=o+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+i;for(let[l,s]of n.styleMap.entries()){if(l.tagName==="STYLE")continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",s.replace(/;/g,"; "));continue}let u=a.get(s);u&&l.classList.add(u);let d=l.style?.backgroundImage,m=l.dataset?.snapdomHasIcon;d&&d!=="none"&&(l.style.backgroundImage=d),m&&(l.style.verticalAlign="middle",l.style.display="inline")}for(let[l,s]of n.nodeMap.entries()){let u=s.scrollLeft,d=s.scrollTop;if((u||d)&&l instanceof HTMLElement){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";let m=document.createElement("div");for(m.style.transform=`translate(${-u}px, ${-d}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(qa(e,c),e===n.nodeMap.get(r)){let l=n.styleCache.get(e)||ue(e);n.styleCache.set(e,l);let s=ni(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=s||""}for(let[l,s]of n.nodeMap.entries())s.tagName==="PRE"&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:r,classCSS:i,styleCache:n.styleCache}}_e();var Or="http://www.w3.org/1999/xlink";function Ga(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(Or,"href"):null)}function Ka(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,c=t||o||r||e.width||e.naturalWidth||100,l=n||a||i||e.height||e.naturalHeight||100;return{width:c,height:l}}async function Ja(e,t={}){let n=Array.from(e.querySelectorAll("img")),r=async a=>{if(!a.getAttribute("src")){let m=a.currentSrc||a.src||"";m&&a.setAttribute("src",m)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let c=a.src||"";if(!c)return;let l=await te(c,{as:"dataURL",useProxy:t.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){a.src=l.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:s,height:u}=Ka(a),{fallbackURL:d}=t||{};if(d)try{let m=typeof d=="function"?await d({width:s,height:u,src:c,element:a}):d;if(m){let h=await te(m,{as:"dataURL",useProxy:t.useProxy});if(h?.ok&&typeof h.data=="string"){a.src=h.data,a.width||(a.width=s),a.height||(a.height=u);return}}}catch{}if(t.placeholders!==!1){let m=document.createElement("div");m.style.cssText=[`width:${s}px`,`height:${u}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${u}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),m.textContent="img",a.replaceWith(m)}else{let m=document.createElement("div");m.style.cssText=`display:inline-block;width:${s}px;height:${u}px;visibility:hidden;`,a.replaceWith(m)}};for(let a=0;a<n.length;a+=4){let c=n.slice(a,a+4).map(r);await Promise.allSettled(c)}let i=Array.from(e.querySelectorAll("image")),o=async a=>{let c=Ga(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let l=await te(c,{as:"dataURL",useProxy:t.useProxy});l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")&&(a.setAttribute("href",l.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(Or,"href"))};for(let a=0;a<i.length;a+=4){let c=i.slice(a,a+4).map(o);await Promise.allSettled(c)}}re();async function Za(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"],c=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],l=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;i.length;){let[s,u]=i.shift();if(!u)continue;let d=n.get(s)||ue(s);n.has(s)||n.set(s,d);let m=(()=>{let p=d.getPropertyValue("border-image"),f=d.getPropertyValue("border-image-source");return p&&p!=="none"||f&&f!=="none"})();for(let p of c){let f=d.getPropertyValue(p);f&&u.style.setProperty(p,f)}for(let p of o){let f=d.getPropertyValue(p);if(p==="background-image"&&(!f||f==="none")){let w=d.getPropertyValue("background");w&&/url\s*\(/.test(w)&&(f=Kt(w).find(b=>/url\s*\(/.test(b))||f)}if(!f||f==="none")continue;let y=Kt(f),x=await Promise.all(y.map(w=>hr(w,r)));x.some(w=>w&&w!=="none"&&!/^url\(undefined/.test(w))&&u.style.setProperty(p,x.join(", "))}for(let p of a){let f=d.getPropertyValue(p);!f||f==="initial"||u.style.setProperty(p,f)}if(m)for(let p of l){let f=d.getPropertyValue(p);!f||f==="initial"||u.style.setProperty(p,f)}let h=s.shadowRoot?Array.from(s.shadowRoot.children).filter(p=>p.tagName!=="STYLE"):Array.from(s.children),g=Array.from(u.children).filter(p=>!(p.dataset?.snapdomPseudo||p.tagName==="STYLE"&&p.dataset?.sd));for(let p=0;p<Math.min(h.length,g.length);p++)i.push([h[p],g[p]])}}re();ne();function Qa(e){if(!e)return()=>{};let t=[];function n(r){let i=el(r);i&&t.push(i);for(let o of r.children||[])n(o)}return n(e),()=>t.forEach(r=>r())}function el(e){if(!e)return()=>{};let t=tl(e);if(t<=0)return()=>{};if(!ol(e))return()=>{};let n=getComputedStyle(e),r=Math.round(nl(n)*t+rl(n)),i=e.textContent??"",o=i;if(e.scrollHeight<=r+.5)return()=>{};let a=0,c=i.length,l=-1;for(;a<=c;){let s=a+c>>1;e.textContent=i.slice(0,s)+"\u2026",e.scrollHeight<=r+.5?(l=s,a=s+1):c=s-1}return e.textContent=(l>=0?i.slice(0,l):"")+"\u2026",()=>{e.textContent=o}}function tl(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 nl(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 rl(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function ol(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var Ye=[];function Wr(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 il(...e){let t=e.flat();for(let n of t){let r=Wr(n);r&&(Ye.some(i=>i&&i.name&&r.name&&i.name===r.name)||Ye.push(r))}}function Hr(e){return(e&&Array.isArray(e.plugins)?e.plugins:Ye)||Ye}async function he(e,t,n){let r=n,i=Hr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let c=await a(t,r);typeof c<"u"&&(r=c)}return r}async function al(e,t,n){let r=[],i=Hr(t);for(let o of i){let a=o&&typeof o[e]=="function"?o[e]:null;if(!a)continue;let c=await a(t,n);typeof c<"u"&&r.push(c)}return r}function ll(e){let t=[];if(Array.isArray(e))for(let n of e){let r=Wr(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 Ye)n&&n.name&&!t.some(r=>r.name===n.name)&&t.push(n);return Object.freeze(t)}function sl(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=ll(t)),e}re();function cl(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow="none"}catch(o){F(n,"stripRootShadows boxShadow",o)}try{t.style.textShadow="none"}catch(o){F(n,"stripRootShadows textShadow",o)}try{t.style.outline="none"}catch(o){F(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){F(n,"stripRootShadows filter",o)}}function ul(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 dl(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 c=a.name;if(c.includes("@")){o.removeAttribute(c);continue}if(c.includes(":")){let l=c.split(":",1)[0];if(!r.has(l)){o.removeAttribute(c);continue}}if(n&&(c.startsWith("x-")||c.startsWith("v-")||c.startsWith(":")||c.startsWith("on:")||c.startsWith("bind:")||c.startsWith("let:")||c.startsWith("class:"))){o.removeAttribute(c);continue}}}}function fl(e,t={}){e&&(dl(e,t),ul(e))}function ml(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function pl(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function hl(e,t){if(!(e instanceof Element)||ml(e)||pl(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 gl(e,t,n=new Map){function r(i,o){if(!(i instanceof Element)||!(o instanceof Element))return;let a=i.childElementCount>o.childElementCount,c=n.get(i)||getComputedStyle(i);if(n.has(i)||n.set(i,c),a&&hl(i,c)){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=c.overflowY||c.overflowBlock||"visible",d=c.overflowX||c.overflowInline||"visible";(u!=="visible"||d!=="visible")&&(o.style.overflow="visible")}let l=Array.from(i.children),s=Array.from(o.children);for(let u=0;u<Math.min(l.length,s.length);u++)r(l[u],s[u])}r(e,t)}function yl(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function bl(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){F(t,"exclude selector match failed",r)}return!1}function wl(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,o=-1/0,a=!1,c=Array.from(e.children);for(let h of c){if(bl(h,t)||!yl(h))continue;let g=h.getBoundingClientRect(),p=g.top-r.top,f=g.bottom-r.top;f<=p||(p<i&&(i=p),f>o&&(o=f),a=!0)}let l=a?Math.max(0,o-i):0,s=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,m=parseFloat(n.paddingBottom)||0;return s+u+d+m+l}var k=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,xl=/::-webkit-scrollbar(-[a-z]+)?\b/i;function ln(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+=ln(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=ln(i.cssRules,t);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(xl.test(o)){let a=i.cssText;a&&!t.has(a)&&(t.add(a),n+=a)}}}catch{}}return n}function vl(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+=ln(i,t))}catch{}return n}function Sl(e){let t=e.boxShadow||"";if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let n=t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(c=>c.trim()),r=0,i=0,o=0,a=0;for(let c of n){let l=c.match(/-?\d+(\.\d+)?px/g)?.map(p=>parseFloat(p))||[];if(l.length<2)continue;let[s,u,d=0,m=0]=l,h=Math.abs(s)+d+m,g=Math.abs(u)+d+m;i=Math.max(i,h+Math.max(s,0)),a=Math.max(a,h+Math.max(-s,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 Cl(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 El(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0);return{top:t,right:t,bottom:t,left:t}}function kl(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,c=!1;for(let l of n){c=!0;let s=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[u=0,d=0,m=0]=s,h=Math.abs(u)+m,g=Math.abs(d)+m;i=Math.max(i,h+Math.max(u,0)),a=Math.max(a,h+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:k(r),right:k(i),bottom:k(o),left:k(a)},has:c}}function $l(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 o=Br(e);if(o.a===1&&o.b===0&&o.c===0&&o.d===1)return t.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}let i=r.match(/^matrix\(\s*([^)]+)\)$/i);if(i){let o=i[1].split(",").map(a=>parseFloat(a.trim()));if(o.length===6&&o.every(Number.isFinite)){let[a,c,l,s]=o,u=Math.sqrt(a*a+c*c)||0,d=0,m=0,h=0,g=0,p=0,f=0;u>0&&(d=a/u,m=c/u,h=d*l+m*s,g=l-d*h,p=s-m*h,f=Math.sqrt(g*g+p*p)||0,f>0?h=h/f:h=0);let y=u,x=0,w=h*f,b=f;try{t.style.transform=`matrix(${y}, ${x}, ${w}, ${b}, 0, 0)`}catch{}return{a:y,b:x,c:w,d:b}}}try{let o=String(r).trim();return t.style.transform=o+" translate(0px, 0px) rotate(0deg)",null}catch{return null}}function fr(e,t,n,r,i){let o=n.a,a=n.b,c=n.c,l=n.d,s=n.e||0,u=n.f||0;function d(y,x){let w=y-r,b=x-i,E=o*w+c*b,S=a*w+l*b;return E+=r+s,S+=i+u,[E,S]}let m=[d(0,0),d(e,0),d(0,t),d(e,t)],h=1/0,g=1/0,p=-1/0,f=-1/0;for(let[y,x]of m)y<h&&(h=y),x<g&&(g=x),y>p&&(p=y),x>f&&(f=x);return{minX:h,minY:g,maxX:p,maxY:f,width:p-h,height:f-g}}function Ml(e,t,n){let r=(e.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],a=(c,l)=>{let s=c.toLowerCase();return s==="left"||s==="top"?0:s==="center"?l/2:s==="right"||s==="bottom"?l:s.endsWith("px")?parseFloat(s)||0:s.endsWith("%")?(parseFloat(s)||0)*l/100:/^-?\d+(\.\d+)?$/.test(s)&&parseFloat(s)||0};return{ox:a(i,t),oy:a(o,n)}}function Al(e){let t={rotate:"0deg",scale:null,translate:null},n=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(n){let i=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},o=i("rotate");if(o)if(o.angle){let l=o.angle;t.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.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 l=getComputedStyle(e);t.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let a=i("scale");if(a){let l="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,s="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:l;t.scale=`${l} ${s}`}else{let l=getComputedStyle(e);t.scale=l.scale&&l.scale!=="none"?l.scale:null}let c=i("translate");if(c){let l="x"in c&&"value"in c.x?c.x.value:Array.isArray(c)?c[0]?.value:0,s="y"in c&&"value"in c.y?c.y.value:Array.isArray(c)?c[1]?.value:0,u="x"in c&&c.x?.unit?c.x.unit:"px",d="y"in c&&c.y?.unit?c.y.unit:"px";t.translate=`${l}${u} ${s}${d}`}else{let l=getComputedStyle(e);t.translate=l.translate&&l.translate!=="none"?l.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 Xt=null;function Ll(){if(Xt)return Xt;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),Xt=e,e}function Nl(e){let t=Ll(),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=Br(n);return t.removeChild(n),r}function Tl(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 Br(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 Ur(e,t){if(!e)throw new Error("Element cannot be null or undefined");ti(t.cache);let n=t.fast,r=t.outerTransforms!==!1,i=!!t.outerShadows,o={element:e,options:t,plugins:t.plugins},a,c,l,s="",u="",d,m,h=null;await he("beforeSnap",o),await he("beforeClone",o);let g=Qa(o.element);try{({clone:a,classCSS:c,styleCache:l}=await Ya(o.element,o.options)),!r&&a&&(h=$l(o.element,a)),!i&&a&&cl(o.element,a,o.options)}finally{g()}if(o={clone:a,classCSS:c,styleCache:l,...o},await he("afterClone",o),fl(o.clone),o.options?.excludeMode==="remove")try{gl(o.element,o.clone,o.styleCache)}catch(w){console.warn("[snapdom] shrink pass failed:",w)}try{await ga(o.clone,o.element)}catch{}await new Promise(w=>{Ne(async()=>{await Ja(o.clone,o.options),w()},{fast:n})}),await new Promise(w=>{Ne(async()=>{await Za(o.element,o.clone,o.styleCache,o.options),w()},{fast:n})}),t.embedFonts&&await new Promise(w=>{Ne(async()=>{let b=Fr(o.element),E=_a(o.element);if(xe()){let S=new Set(Array.from(b).map(v=>String(v).split("__")[0]).filter(Boolean));await Ir(S,1)}s=await Ra({required:b,usedCodepoints:E,preCached:!1,exclude:o.options.excludeFonts,useProxy:o.options.useProxy,fontStylesheetDomains:o.options.fontStylesheetDomains}),w()},{fast:n})});let p=fi(o.clone).sort(),f=p.join(",");C.baseStyle.has(f)?u=C.baseStyle.get(f):await new Promise(w=>{Ne(()=>{u=mi(p),C.baseStyle.set(f,u),w()},{fast:n})});let y=vl(o.element?.ownerDocument||document);o={fontsCSS:s,baseCSS:u,scrollbarCSS:y,...o},await he("beforeRender",o),await new Promise(w=>{Ne(()=>{let b=ue(o.element),E=o.element.getBoundingClientRect(),S=Math.max(1,k(o.element.offsetWidth||parseFloat(b.width)||E.width||1)),v=Math.max(1,k(o.element.offsetHeight||parseFloat(b.height)||E.height||1)),$=o.element.ownerDocument||document;if(o.element===$.body||o.element===$.documentElement){let j=Math.max(o.element.scrollHeight||0,$.documentElement?.scrollHeight||0,$.body?.scrollHeight||0),V=Math.max(o.element.scrollWidth||0,$.documentElement?.scrollWidth||0,$.body?.scrollWidth||0);j>0&&(v=Math.max(v,k(j))),V>0&&(S=Math.max(S,k(V)));try{let z=$.createElement("div");z.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+S+"px!important;overflow:visible!important;visibility:hidden!important;";let nt=$.createElement("style");nt.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,z.appendChild(nt),z.appendChild(o.clone.cloneNode(!0)),$.body.appendChild(z);let rt=z.scrollHeight,ot=z.scrollWidth;$.body.removeChild(z),rt>0&&(v=Math.max(v,k(rt))),ot>0&&(S=Math.max(S,k(ot)))}catch{}}if(o.options?.excludeMode==="remove"){let j=wl(o.element,o.options);Number.isFinite(j)&&j>0&&(v=Math.max(1,Math.min(v,k(j+1))))}let P=(j,V=NaN)=>{let z=typeof j=="string"?parseFloat(j):j;return Number.isFinite(z)?z:V},B=P(o.options.width),D=P(o.options.height),A=S,M=v,U=Number.isFinite(B),ee=Number.isFinite(D),et=v>0?S/v:1;U&&ee?(A=Math.max(1,k(B)),M=Math.max(1,k(D))):U?(A=Math.max(1,k(B)),M=Math.max(1,k(A/(et||1)))):ee?(M=Math.max(1,k(D)),A=Math.max(1,k(M*(et||1)))):(A=S,M=v);let R=0,T=0,W=S,O=v;if(!r&&h&&Number.isFinite(h.a)){let j={a:h.a,b:h.b||0,c:h.c||0,d:h.d||1,e:0,f:0},V=fr(S,v,j,0,0);R=k(V.minX),T=k(V.minY),W=k(V.maxX),O=k(V.maxY)}else if(r&&mr(o.element)){let j=b.transform&&b.transform!=="none"?b.transform:"",V=Al(o.element),z=Nl({baseTransform:j,rotate:V.rotate||"0deg",scale:V.scale,translate:V.translate}),{ox:nt,oy:rt}=Ml(b,S,v),ot=z.is2D?z:new DOMMatrix(z.toString()),it=fr(S,v,ot,nt,rt);R=k(it.minX),T=k(it.minY),W=k(it.maxX),O=k(it.maxY)}let de=Sl(b),ae=Cl(b),Ee=El(b),ke=kl(b),ge=i?{top:k(de.top+ae.top+Ee.top+ke.bleed.top),right:k(de.right+ae.right+Ee.right+ke.bleed.right),bottom:k(de.bottom+ae.bottom+Ee.bottom+ke.bleed.bottom),left:k(de.left+ae.left+Ee.left+ke.bleed.left)}:{top:0,right:0,bottom:0,left:0};R=k(R-ge.left),T=k(T-ge.top),W=k(W+ge.right),O=k(O+ge.bottom);let We=Math.max(1,k(W-R)),bn=Math.max(1,k(O-T)),xo=U||ee?k(A/S):1,vo=ee||U?k(M/v):1,So=Math.max(1,k(We*xo)),Co=Math.max(1,k(bn*vo)),wn="http://www.w3.org/2000/svg",Eo=xe()&&mr(o.element)?1:0,fe=k(Eo+(r?0:1)),me=document.createElementNS(wn,"foreignObject"),ko=k(R),$o=k(T);me.setAttribute("x",String(k(-(ko-fe)))),me.setAttribute("y",String(k(-($o-fe)))),me.setAttribute("width",String(k(S+fe*2))),me.setAttribute("height",String(k(v+fe*2))),me.style.overflow="visible";let xn=document.createElement("style");xn.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,me.appendChild(xn);let tt=document.createElement("div");tt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),tt.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${k(S)}px;height:${k(v)}px`,tt.appendChild(o.clone),me.appendChild(tt);let Mo=new XMLSerializer().serializeToString(me),Ft=k(We+fe*2),It=k(bn+fe*2),vn=U||ee;t.meta={w0:S,h0:v,vbW:Ft,vbH:It,targetW:A,targetH:M};let Ao=xe()&&vn?Ft:k(So+fe*2),Lo=xe()&&vn?It:k(Co+fe*2),No=parseFloat(ue($.documentElement)?.fontSize)||16;m=`<svg xmlns="${wn}" width="${Ao}" height="${Lo}" viewBox="0 0 ${Ft} ${It}" font-size="${No}px">`+Mo+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,o={svgString:m,dataURL:d,...o},w()},{fast:n})}),await he("afterRender",o);let x=document.getElementById("snapdom-sandbox");return x&&x.style.position==="absolute"&&x.remove(),o.dataURL}function mr(e){return Tl(e)}ne();function Rl(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let n=ei(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}}Ke();vr();re();_e();ne();function _l(...e){return il(...e),_}var _=Object.assign(Fl,{plugins:_l}),qr=Symbol("snapdom.internal"),Pl=Symbol("snapdom.internal.silent"),pr=!1;async function Fl(e,t){if(!e)throw new Error("Element cannot be null or undefined");let n=Rl(t);if(sl(n,t&&t.plugins),xe()&&(n.embedFonts===!0||Dl(e))){if(n.embedFonts)try{let i=Fr(e),o=new Set([...i].map(a=>String(a).split("__")[0]).filter(Boolean));await Ir(o,1)}catch{}let r=n.safariWarmupAttempts??3;for(let i=0;i<r;i++)try{await Il(e,t)}catch{}}return n.iconFonts&&n.iconFonts.length>0&&ca(n.iconFonts),n.snap||(n.snap={toPng:(r,i)=>_.toPng(r,i),toSvg:(r,i)=>_.toSvg(r,i)}),_.capture(e,n,qr)}_.capture=async(e,t,n)=>{if(n!==qr)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await Ur(e,t),i={img:async(p,f)=>{let{toImg:y}=await Promise.resolve().then(()=>(Yn(),Jt));return y(r,{...p,...f||{}})},svg:async(p,f)=>{let{toSvg:y}=await Promise.resolve().then(()=>(Yn(),Jt));return y(r,{...p,...f||{}})},canvas:async(p,f)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(xt(),Sr));return y(r,{...p,...f||{}})},blob:async(p,f)=>{let{toBlob:y}=await Promise.resolve().then(()=>(Mr(),kr));return y(r,{...p,...f||{}})},png:async(p,f)=>{let{rasterize:y}=await Promise.resolve().then(()=>(ft(),dt));return y(r,{...p,...f||{},format:"png"})},jpeg:async(p,f)=>{let{rasterize:y}=await Promise.resolve().then(()=>(ft(),dt));return y(r,{...p,...f||{},format:"jpeg"})},webp:async(p,f)=>{let{rasterize:y}=await Promise.resolve().then(()=>(ft(),dt));return y(r,{...p,...f||{},format:"webp"})},download:async(p,f)=>{let{download:y}=await Promise.resolve().then(()=>(Ai(),Ar));return y(r,{...p,...f||{}})}},o={};for(let p of["img","svg","canvas","blob","png","jpeg","webp"])o[p]=async f=>i[p](t,{...f||{},[Pl]:!0});o.jpg=o.jpeg;let a={...t,export:{url:r},exports:o},c=await al("defineExports",a),l=Object.assign({},...c.filter(p=>p&&typeof p=="object")),s={...i,...l};s.jpeg&&!s.jpg&&(s.jpg=(p,f)=>s.jpeg(p,f));function u(p,f){let y={...t,...f||{}};return(p==="jpeg"||p==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,m=Promise.resolve();async function h(p,f){let y=async()=>{let x=s[p];if(!x)throw new Error(`[snapdom] Unknown export type: ${p}`);let w=u(p,f),b={...t,export:{type:p,options:w,url:r}};await he("beforeExport",b);let E=await x(b,w);return await he("afterExport",b,E),d||(d=!0,await he("afterSnap",t)),E};return m=m.then(y)}let g={url:r,toRaw:()=>r,to:(p,f)=>h(p,f),toImg:p=>h("img",p),toSvg:p=>h("svg",p),toCanvas:p=>h("canvas",p),toBlob:p=>h("blob",p),toPng:p=>h("png",p),toJpg:p=>h("jpg",p),toWebp:p=>h("webp",p),download:p=>h("download",p)};for(let p of Object.keys(s)){let f="to"+p.charAt(0).toUpperCase()+p.slice(1);g[f]||(g[f]=y=>h(p,y))}return g};_.toRaw=(e,t)=>_(e,t).then(n=>n.toRaw());_.toImg=(e,t)=>_(e,t).then(n=>n.toImg());_.toSvg=(e,t)=>_(e,t).then(n=>n.toSvg());_.toCanvas=(e,t)=>_(e,t).then(n=>n.toCanvas());_.toBlob=(e,t)=>_(e,t).then(n=>n.toBlob());_.toPng=(e,t)=>_(e,{...t,format:"png"}).then(n=>n.toPng());_.toJpg=(e,t)=>_(e,{...t,format:"jpeg"}).then(n=>n.toJpg());_.toWebp=(e,t)=>_(e,{...t,format:"webp"}).then(n=>n.toWebp());_.download=(e,t)=>_(e,t).then(n=>n.download());async function Il(e,t){if(pr)return;let n={...t,fast:!0,embedFonts:!0,scale:.2},r;try{r=await Ur(e,n)}catch(i){F(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){F(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(c){F(t,"safariWarmup img.decode failed",c)}let a=performance.now();for(;!(o.complete&&o.naturalWidth>0)&&performance.now()-a<900;)await new Promise(c=>setTimeout(c,200));await new Promise(c=>requestAnimationFrame(c));try{let c=document.createElement("canvas");c.width=Math.max(1,o.naturalWidth||10),c.height=Math.max(1,o.naturalHeight||10);let l=c.getContext("2d");l&&l.drawImage(o,0,0)}catch{}await new Promise(c=>requestAnimationFrame(c));try{o.remove()}catch(c){F(t,"safariWarmup img.remove failed",c)}i()})()}),e.querySelectorAll("canvas").forEach(i=>{try{let o=i.getContext("2d",{willReadFrequently:!0});o&&o.getImageData(0,0,1,1)}catch(o){F(t,"safariWarmup canvas poke failed",o)}}),pr=!0}function Dl(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}async function St(){let e=document.documentElement,t=window.innerWidth,n=window.innerHeight,r=await _.toPng(e,{width:t,height:n,embedFonts:!0,exclude:["#__mindstudio-cursor","#__mindstudio-cursor-ripple","#__mindstudio-notes-cursor"],excludeMode:"remove"});if(!r)throw new Error("SnapDOM capture returned empty result");if(typeof r=="string"){let l=r.replace(/^data:image\/png;base64,/,"");if(!l)throw new Error("SnapDOM capture produced no image data");return{image:l,width:t,height:n}}r.complete||await Promise.race([new Promise((l,s)=>{r.onload=()=>l(),r.onerror=()=>s(new Error("SnapDOM image failed to load"))}),X(1e4).then(()=>{throw new Error("Screenshot image load timed out")})]);let i=document.createElement("canvas");i.width=r.naturalWidth||t,i.height=r.naturalHeight||n;let o=i.getContext("2d");if(!o)throw new Error("Failed to create canvas context");o.drawImage(r,0,0);let c=i.toDataURL("image/png").replace(/^data:image\/png;base64,/,"");if(!c)throw new Error("Canvas export produced no image data");return{image:c,width:t,height:n}}var jr="__mindstudio-cursor",Ol="__mindstudio-cursor-ripple",ve=450,$t=180,Ct=200,Wl=1500,Et="#DD2590",Hl=`<svg width="31" height="32" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
10
10
|
<g filter="url(#filter0_d_4_78)">
|
|
11
11
|
<path d="M12.5448 26L6.72762 5.59339L26 14.8132L17.1816 17.9377L12.5448 26Z" fill="${Et}"/>
|
|
12
12
|
<path d="M6.9457 5.14539L26.2178 14.3651L27.2985 14.8826L26.1697 15.2813L17.5259 18.3444L12.9812 26.2464L12.3881 27.2792L12.0614 26.1349L6.24434 5.72851L5.94119 4.66488L6.9457 5.14539Z" stroke="${Et}"/>
|
|
@@ -41,7 +41,7 @@ ${p}
|
|
|
41
41
|
letter-spacing: 0.3px;
|
|
42
42
|
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
|
43
43
|
">${Bl}</div>
|
|
44
|
-
`,e.style.cssText=["position: fixed","top: 0","left: 0","z-index: 2147483647","pointer-events: none",`transition: left ${ve}ms cubic-bezier(0.4, 0, 0, 1), top ${ve}ms cubic-bezier(0.4, 0, 0, 1), transform ${$t}ms cubic-bezier(0.2, 0, 0.2, 1), opacity ${Ct}ms ease`,"will-change: left, top, transform, opacity","opacity: 0"].join("; ");let t=document.createElement("div");t.id=Ol,t.style.cssText=["position: fixed","z-index: 2147483646","pointer-events: none","width: 0","height: 0","border-radius: 50%",`background: ${Et}`,"opacity: 0","transform: translate(-50%, -50%)","transition: width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out"].join("; "),document.body.appendChild(t),document.body.appendChild(e),N=e,G=t}async function Mt(e){if(!N)return;K&&(clearTimeout(K),K=null);let t=e.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2;if(!Pe){if(!kt){let i=window.innerWidth,o=window.innerHeight,a=Math.random(),c,l;a<.25?(c=i+20,l=o*.2+Math.random()*o*.6):a<.5?(c=i*.2+Math.random()*i*.6,l=o+20):a<.75?(c=-40,l=o*.2+Math.random()*o*.6):(c=i*.2+Math.random()*i*.6,l=-40),N.style.transition="none",N.style.left=`${c}px`,N.style.top=`${l}px`,N.style.opacity="0",N.offsetWidth}N.style.transition=`left ${ve}ms cubic-bezier(0.4, 0, 0, 1), top ${ve}ms cubic-bezier(0.4, 0, 0, 1), transform ${$t}ms cubic-bezier(0.2, 0, 0.2, 1), opacity ${Ct}ms ease`,N.style.opacity="1",Pe=!0,await X(Ct)}return fn=n,mn=r,kt=!0,N.style.left=`${fn}px`,N.style.top=`${mn}px`,X(ve)}async function At(){N&&(N.style.transform="scale(0.85) translateY(1px)",G&&(G.style.transition="none",G.style.left=`${fn}px`,G.style.top=`${mn}px`,G.style.width="0",G.style.height="0",G.style.opacity="0.35",G.offsetWidth,G.style.transition="width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out",G.style.width="40px",G.style.height="40px",G.style.opacity="0"),await X($t),N&&(N.style.transform="scale(1) translateY(0)"),await X(100))}function pn(){console.info("[cursor] scheduleHide",{hasCursorEl:!!N,forcedState:Je}),N&&Je!=="visible"&&(K&&clearTimeout(K),K=setTimeout(()=>{Je!=="visible"&&(N&&(N.style.opacity="0",Pe=!1),K=null)},Wl))}function Lt(e){if(console.info("[cursor] setForcedVisibility",e,{hasCursorEl:!!N,visible:Pe,hasPosition:kt,forcedState:Je}),Je=e,e==="visible"&&!N&&(console.info("[cursor] Creating cursor elements on demand"),Vr()),!N){console.info("[cursor] No cursorEl after create attempt");return}if(e==="visible"){if(K&&(clearTimeout(K),K=null),!kt){let t=window.innerWidth,n=window.innerHeight,r=Math.random(),i,o;r<.25?(i=t+20,o=n*.2+Math.random()*n*.6):r<.5?(i=t*.2+Math.random()*t*.6,o=n+20):r<.75?(i=-40,o=n*.2+Math.random()*n*.6):(i=t*.2+Math.random()*t*.6,o=-40),N.style.transition="none",N.style.left=`${i}px`,N.style.top=`${o}px`,N.offsetWidth,N.style.transition=`left ${ve}ms cubic-bezier(0.4, 0, 0, 1), top ${ve}ms cubic-bezier(0.4, 0, 0, 1), transform ${$t}ms cubic-bezier(0.2, 0, 0.2, 1), opacity ${Ct}ms ease`}N.style.opacity="1",Pe=!0}else e==="hidden"?(K&&(clearTimeout(K),K=null),N.style.opacity="0",Pe=!1):pn()}async function Nt(e,t){let n=Date.now(),r=[];En();for(let a=0;a<t.length;a++){let c=t[a],l=c.command;try{let s=await ql(c);r.push({index:a,command:l,...s})}catch(s){r.push({index:a,command:l,error:s instanceof Error?s.message:String(s)});break}}let i=kn(),o=await qe();return pn(),{id:e,steps:r,snapshot:o,logs:i,duration:Date.now()-n}}async function ql(e){switch(e.command){case"snapshot":return{result:await qe()};case"click":{let{element:t,matched:n}=pe(e);return await Mt(t),await At(),zt(t),{result:"ok",matched:n}}case"type":{let{element:t,matched:n}=pe(e),r=e.text;if(!r&&r!=="")throw new Error('type command requires a "text" field');return await Mt(t),await At(),await Bn(t,r,{clear:!!e.clear}),{result:"ok",matched:n}}case"select":{let{element:t,matched:n}=pe(e),r=e.option;if(!r)throw new Error('select command requires an "option" field');return await Mt(t),await At(),{result:`selected "${qn(t,r)}"`,matched:n}}case"wait":{let{matched:t,elapsed:n}=await Un(e);return{result:"ok",matched:t,elapsed:n}}case"evaluate":{let t=e.script;if(!t)throw new Error('evaluate command requires a "script" field');return{result:jn(t)}}case"screenshot":{let{image:t,width:n,height:r}=await St();return{result:{image:t,width:n,height:r}}}default:throw new Error(`Unknown command: ${e.command}`)}}var jl="/__mindstudio_dev__/commands",zl="/__mindstudio_dev__/results",Vl=100,Xl=1e3,hn=!1;function Yr(){window.location.search.includes("mode=iframe")&&(hn||(hn=!0,Yl()))}async function Yl(){for(;hn;)try{let e=await fetch(jl);if(e.status===200){let t=await e.json();t?.id&&Array.isArray(t.steps)&&await Gl(t.id,t.steps)}await X(Vl)}catch{await X(Xl)}}async function Gl(e,t){try{let n=await Nt(e,t);await Xr(n)}catch{await Xr({id:e,steps:[],snapshot:"",logs:[],duration:0})}}async function Xr(e){try{await fetch(zl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}var oe="#DD2590";var Gr="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",Kl=200,Kr=`
|
|
44
|
+
`,e.style.cssText=["position: fixed","top: 0","left: 0","z-index: 2147483647","pointer-events: none",`transition: left ${ve}ms cubic-bezier(0.4, 0, 0, 1), top ${ve}ms cubic-bezier(0.4, 0, 0, 1), transform ${$t}ms cubic-bezier(0.2, 0, 0.2, 1), opacity ${Ct}ms ease`,"will-change: left, top, transform, opacity","opacity: 0"].join("; ");let t=document.createElement("div");t.id=Ol,t.style.cssText=["position: fixed","z-index: 2147483646","pointer-events: none","width: 0","height: 0","border-radius: 50%",`background: ${Et}`,"opacity: 0","transform: translate(-50%, -50%)","transition: width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out"].join("; "),document.body.appendChild(t),document.body.appendChild(e),N=e,G=t}async function Mt(e){if(!N)return;K&&(clearTimeout(K),K=null);let t=e.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2;if(!Pe){if(!kt){let i=window.innerWidth,o=window.innerHeight,a=Math.random(),c,l;a<.25?(c=i+20,l=o*.2+Math.random()*o*.6):a<.5?(c=i*.2+Math.random()*i*.6,l=o+20):a<.75?(c=-40,l=o*.2+Math.random()*o*.6):(c=i*.2+Math.random()*i*.6,l=-40),N.style.transition="none",N.style.left=`${c}px`,N.style.top=`${l}px`,N.style.opacity="0",N.offsetWidth}N.style.transition=`left ${ve}ms cubic-bezier(0.4, 0, 0, 1), top ${ve}ms cubic-bezier(0.4, 0, 0, 1), transform ${$t}ms cubic-bezier(0.2, 0, 0.2, 1), opacity ${Ct}ms ease`,N.style.opacity="1",Pe=!0,await X(Ct)}return fn=n,mn=r,kt=!0,N.style.left=`${fn}px`,N.style.top=`${mn}px`,X(ve)}async function At(){N&&(N.style.transform="scale(0.85) translateY(1px)",G&&(G.style.transition="none",G.style.left=`${fn}px`,G.style.top=`${mn}px`,G.style.width="0",G.style.height="0",G.style.opacity="0.35",G.offsetWidth,G.style.transition="width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out",G.style.width="40px",G.style.height="40px",G.style.opacity="0"),await X($t),N&&(N.style.transform="scale(1) translateY(0)"),await X(100))}function pn(){console.info("[cursor] scheduleHide",{hasCursorEl:!!N,forcedState:Je}),N&&Je!=="visible"&&(K&&clearTimeout(K),K=setTimeout(()=>{Je!=="visible"&&(N&&(N.style.opacity="0",Pe=!1),K=null)},Wl))}function Lt(e){if(console.info("[cursor] setForcedVisibility",e,{hasCursorEl:!!N,visible:Pe,hasPosition:kt,forcedState:Je}),Je=e,e==="visible"&&!N&&(console.info("[cursor] Creating cursor elements on demand"),Vr()),!N){console.info("[cursor] No cursorEl after create attempt");return}if(e==="visible"){if(K&&(clearTimeout(K),K=null),!kt){let t=window.innerWidth,n=window.innerHeight,r=Math.random(),i,o;r<.25?(i=t+20,o=n*.2+Math.random()*n*.6):r<.5?(i=t*.2+Math.random()*t*.6,o=n+20):r<.75?(i=-40,o=n*.2+Math.random()*n*.6):(i=t*.2+Math.random()*t*.6,o=-40),N.style.transition="none",N.style.left=`${i}px`,N.style.top=`${o}px`,N.offsetWidth,N.style.transition=`left ${ve}ms cubic-bezier(0.4, 0, 0, 1), top ${ve}ms cubic-bezier(0.4, 0, 0, 1), transform ${$t}ms cubic-bezier(0.2, 0, 0.2, 1), opacity ${Ct}ms ease`}N.style.opacity="1",Pe=!0}else e==="hidden"?(K&&(clearTimeout(K),K=null),N.style.opacity="0",Pe=!1):pn()}async function Nt(e,t){let n=Date.now(),r=[];En();for(let a=0;a<t.length;a++){let c=t[a],l=c.command;try{let s=await ql(c);r.push({index:a,command:l,...s})}catch(s){r.push({index:a,command:l,error:s instanceof Error?s.message:String(s)});break}}let i=kn(),o=await qe();return pn(),{id:e,steps:r,snapshot:o,logs:i,duration:Date.now()-n}}async function ql(e){switch(e.command){case"snapshot":return{result:await qe()};case"click":{let{element:t,matched:n}=pe(e);return await Mt(t),await At(),zt(t),{result:"ok",matched:n}}case"type":{let{element:t,matched:n}=pe(e),r=e.text;if(!r&&r!=="")throw new Error('type command requires a "text" field');return await Mt(t),await At(),await Bn(t,r,{clear:!!e.clear}),{result:"ok",matched:n}}case"select":{let{element:t,matched:n}=pe(e),r=e.option;if(!r)throw new Error('select command requires an "option" field');return await Mt(t),await At(),{result:`selected "${qn(t,r)}"`,matched:n}}case"wait":{let{matched:t,elapsed:n}=await Un(e);return{result:"ok",matched:t,elapsed:n}}case"evaluate":{let t=e.script;if(!t)throw new Error('evaluate command requires a "script" field');return{result:await jn(t)}}case"screenshot":{let{image:t,width:n,height:r}=await St();return{result:{image:t,width:n,height:r}}}default:throw new Error(`Unknown command: ${e.command}`)}}var jl="/__mindstudio_dev__/commands",zl="/__mindstudio_dev__/results",Vl=100,Xl=1e3,hn=!1;function Yr(){window.location.search.includes("mode=iframe")&&(hn||(hn=!0,Yl()))}async function Yl(){for(;hn;)try{let e=await fetch(jl);if(e.status===200){let t=await e.json();t?.id&&Array.isArray(t.steps)&&await Gl(t.id,t.steps)}await X(Vl)}catch{await X(Xl)}}async function Gl(e,t){try{let n=await Nt(e,t);await Xr(n)}catch{await Xr({id:e,steps:[],snapshot:"",logs:[],duration:0})}}async function Xr(e){try{await fetch(zl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}var oe="#DD2590";var Gr="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",Kl=200,Kr=`
|
|
45
45
|
width: ${Kl}px;
|
|
46
46
|
background: ${oe};
|
|
47
47
|
border-radius: 19px 120px 120px;
|
package/package.json
CHANGED