@zumer/snapdom 2.0.0-dev.2 → 2.0.0-dev.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.
@@ -1,8 +1,8 @@
1
- var x={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function vt(t="soft"){switch(x.session.__counterEpoch=(x.session.__counterEpoch||0)+1,t){case"auto":{x.session.styleMap=new Map,x.session.nodeMap=new Map;return}case"soft":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap,x.computedStyle=new WeakMap,x.baseStyle=new Map,x.defaultStyle=new Map,x.image=new Map,x.background=new Map,x.resource=new Map,x.font=new Set;return}default:{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}}}function nt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function jt(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(s=>s.trim());return r.length!==6?`matrix(${o})`:(r[4]="0",r[5]="0",`matrix(${r.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(s=>s.trim());return r.length!==16?`matrix3d(${o})`:(r[12]="0",r[13]="0",`matrix3d(${r.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function J(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function mn(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function s(a,l,c){if(r>=n)return;let i=Date.now();(o.get(l)||0)>i||(o.set(l,i+e),r++,a==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(a,l){s("warn",a,l)},errorOnce(a,l){s("error",a,l)},reset(){o.clear(),r=0}}}var me=mn("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),zt=new Map,Et=new Map;function pn(t){return/^data:|^blob:|^about:blank$/i.test(t)}function hn(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=e.includes("{url}")?e.split("{url}")[0]:e,r=new URL(o||".",n),s=new URL(t,n);if(s.origin===r.origin)return!0;let a=s.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function gn(t,e){if(!e||pn(t)||hn(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location<"u"?o.origin!==location.origin:!0}catch{return!!e}}function yn(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",J(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${J(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function pe(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"")),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function wn(t,e){return[e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,t].join("|")}async function T(t,e={}){let n=e.as??"blob",o=e.timeout??3e3,r=e.useProxy||"",s=e.errorTTL??8e3,a=e.headers||{},l=!!e.silent;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,m="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],b=/;base64/i.test(m)?atob(y):decodeURIComponent(y),S=new Uint8Array([...b].map(C=>C.charCodeAt(0))),k=new Blob([S],{type:(m||"").split(";")[0]||""});return{ok:!0,data:k,status:200,url:t,fromCache:!1,mime:k.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let m=await fetch(t);if(!m.ok)return{ok:!1,data:null,status:m.status,url:t,fromCache:!1,reason:"http_error"};let y=await m.blob(),g=y.type||m.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await pe(y),status:m.status,url:t,fromCache:!1,mime:g}:n==="text"?{ok:!0,data:await y.text(),status:m.status,url:t,fromCache:!1,mime:g}:{ok:!0,data:y,status:m.status,url:t,fromCache:!1,mime:g}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let c=wn(t,{as:n,timeout:o,useProxy:r,errorTTL:s}),i=Et.get(c);if(i&&i.until>Date.now())return{...i.result,fromCache:!0};i&&Et.delete(c);let f=zt.get(c);if(f)return f;let d=gn(t,r)?yn(t,r):t,p=e.credentials;if(!p)try{let m=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,m);p=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{p="omit"}let h=new AbortController,w=setTimeout(()=>h.abort("timeout"),o),u=(async()=>{try{let m=await fetch(d,{signal:h.signal,credentials:p,headers:a});if(!m.ok){let b={ok:!1,data:null,status:m.status,url:d,fromCache:!1,reason:"http_error"};if(s>0&&Et.set(c,{until:Date.now()+s,result:b}),!l){let S=`${m.status} ${m.statusText||""}`.trim();me.warnOnce(`http:${m.status}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,`HTTP error ${S} while fetching ${n} ${t}`)}return e.onError&&e.onError(b),b}if(n==="text")return{ok:!0,data:await m.text(),status:m.status,url:d,fromCache:!1};let y=await m.blob(),g=y.type||m.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await pe(y),status:m.status,url:d,fromCache:!1,mime:g}:{ok:!0,data:y,status:m.status,url:d,fromCache:!1,mime:g}}catch(m){let y=m&&typeof m=="object"&&"name"in m&&m.name==="AbortError"?String(m.message||"").includes("timeout")?"timeout":"abort":"network",g={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:y};if(!/^blob:/i.test(t)&&s>0&&Et.set(c,{until:Date.now()+s,result:g}),!l){let b=`${y}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,S=y==="timeout"?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:y==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;me.errorOnce(b,S)}return e.onError&&e.onError(g),g}finally{clearTimeout(w),zt.delete(c)}})();return zt.set(c,u),u}async function ot(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=nt(t);if(!o)return t;let r=J(o);if(x.background.has(r)){let s=x.background.get(r);return s?`url("${s}")`:"none"}try{let s=await T(r,{as:"dataURL",useProxy:e.useProxy});return s.ok?(x.background.set(r,s.data),`url("${s.data}")`):(x.background.set(r,null),"none")}catch{return x.background.set(r,null),"none"}}var Ft=new Set(["meta","script","noscript","title","link","template"]),ut=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),bn=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"];function Vt(){for(let t of bn){let e=String(t).toLowerCase();Ft.has(e)||ut.has(e)||Xt(e)}}function Xt(t){if(t=String(t).toLowerCase(),ut.has(t)){let s={};return x.defaultStyle.set(t,s),s}if(x.defaultStyle.has(t))return x.defaultStyle.get(t);let e=document.getElementById("snapdom-sandbox");e||(e=document.createElement("div"),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t);n.style.all="initial",e.appendChild(n);let o=getComputedStyle(n),r={};for(let s of o){if(he(s))continue;let a=o.getPropertyValue(s);r[s]=a}return e.removeChild(n),x.defaultStyle.set(t,r),r}var xn=/(?:^|-)(animation|transition)(?:-|$)/i,Sn=/^(--|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Cn=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"]);function he(t){let e=String(t).toLowerCase();return!!(Cn.has(e)||Sn.test(e)||xn.test(e))}function ft(t,e){if(e=String(e||"").toLowerCase(),ut.has(e))return"";let n=[],o=Xt(e);for(let[r,s]of Object.entries(t)){if(he(r))continue;let a=o[r];s&&s!==a&&n.push(`${r}:${s}`)}return n.sort(),n.join(";")}function Yt(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(n=>e.add(n.tagName.toLowerCase())),Array.from(e))}function Kt(t){let e=new Map;for(let o of t){let r=x.defaultStyle.get(o);if(!r)continue;let s=Object.entries(r).map(([a,l])=>`${a}:${l};`).sort().join("");s&&(e.has(s)||e.set(s,[]),e.get(s).push(o))}let n="";for(let[o,r]of e.entries())n+=`${r.join(",")} { ${o} }
2
- `;return n}function Gt(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,o=1;for(let r of e)n.set(r,`c${o++}`);return n}function rt(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=x.computedStyle.get(t);if(n||(n=new Map,x.computedStyle.set(t,n)),!n.has(e)){let o=window.getComputedStyle(t,e);n.set(e,o)}return n.get(e)}function $t(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function gt(t){let e=[],n=0,o=0;for(let r=0;r<t.length;r++){let s=t[r];s==="("&&n++,s===")"&&n--,s===","&&n===0&&(e.push(t.slice(o,r).trim()),o=r+1)}return e.push(t.slice(o).trim()),e}function V(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function W(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),o=/applewebkit/i.test(t),r=/mobile/i.test(t),s=!/safari/i.test(t),a=o&&r&&s,l=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),i=/ipad|iphone|ipod/.test(e)&&o;return n||a||l||c||i}var ge=new WeakMap,Qt=new Map,Jt=0;function yt(){Jt++}var ye=!1;function kn(t=document.documentElement){if(!ye){ye=!0;try{new MutationObserver(()=>yt()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>yt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let e=document.fonts;e&&(e.addEventListener?.("loadingdone",yt),e.ready?.then(()=>yt()).catch(()=>{}))}catch{}}}function An(t,e={}){let n={},o=t.getPropertyValue("visibility");for(let s=0;s<t.length;s++){let a=t[s],l=t.getPropertyValue(a);(a==="background-image"||a==="content")&&l.includes("url(")&&!l.includes("data:")&&(l="none"),n[a]=l}let r=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let s of r)if(!n[s])try{let a=t.getPropertyValue(s);a&&(n[s]=a)}catch{}if(e.embedFonts){let s=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let a of s)if(!n[a])try{let l=t.getPropertyValue(a);l&&(n[a]=l)}catch{}}return o==="hidden"&&(n.opacity="0"),n}var we=new WeakMap;function Mn(t){let e=we.get(t);return e||(e=Object.entries(t).sort((o,r)=>o[0]<r[0]?-1:o[0]>r[0]?1:0).map(([o,r])=>`${o}:${r}`).join(";"),we.set(t,e),e)}function vn(t,e=null,n={}){let o=ge.get(t);if(o&&o.epoch===Jt)return o.snapshot;let r=e||getComputedStyle(t),s=An(r,n);return Nn(t,r,s),ge.set(t,{epoch:Jt,snapshot:s}),s}function En(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Qt,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:e||{}}:{session:x.session,persist:{snapshotKeyCache:Qt,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:t||e||{}}}async function st(t,e,n,o){if(t.tagName==="STYLE")return;let r=En(n,o),s=r.options&&r.options.cache||"auto";if(s!=="disabled"&&kn(document.documentElement),s==="disabled"&&!r.session.__bumpedForDisabled&&(yt(),Qt.clear(),r.session.__bumpedForDisabled=!0),ut.has(t.tagName?.toLowerCase())){let p=t.getAttribute?.("style");p&&e.setAttribute("style",p)}let{session:a,persist:l}=r;a.styleCache.has(t)||a.styleCache.set(t,getComputedStyle(t));let c=a.styleCache.get(t),i=vn(t,c,r.options),f=Mn(i),d=l.snapshotKeyCache.get(f);if(!d){let p=t.tagName?.toLowerCase()||"div";d=ft(i,p),l.snapshotKeyCache.set(f,d)}a.styleMap.set(e,d)}function Fn(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function $n(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}function In(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function Ln(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,o=t.lastElementChild;if(n&&n.tagName==="BR"||o&&o.tagName==="BR")return!0;let r=t.scrollHeight;if(r===0)return!1;let s=parseFloat(e.paddingTop)||0,a=parseFloat(e.paddingBottom)||0;return r>s+a}function Nn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let o=e.display||"";if(o.includes("flex")||o.includes("grid")||Fn(t))return;let r=e.position;r==="absolute"||r==="fixed"||r==="sticky"||e.transform==="none"&&($n(e)||In(t)||Ln(t,e)&&(delete n.height,delete n["block-size"]))}var xe=["fill","stroke","color","background-color","stop-color"],be=new Map;function Rn(t,e){let n=e+"::"+t.toLowerCase(),o=be.get(n);if(o)return o;let r=document,s=e==="http://www.w3.org/2000/svg"?r.createElementNS(e,t):r.createElement(t),a=r.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(s),r.documentElement.appendChild(a);let l=getComputedStyle(s),c={};for(let i of xe)c[i]=l.getPropertyValue(i)||"";return a.remove(),be.set(n,c),c}function Se(t,e){if(!(t instanceof Element)||!(e instanceof Element))return;let n=t.getAttribute?.("style"),o=!!(n&&n.includes("var("));if(!o&&t.attributes?.length){let s=t.attributes;for(let a=0;a<s.length;a++){let l=s[a];if(l&&typeof l.value=="string"&&l.value.includes("var(")){o=!0;break}}}let r=null;if(o)try{r=getComputedStyle(t)}catch{}if(o){let s=t.style;if(s&&s.length)for(let a=0;a<s.length;a++){let l=s[a],c=s.getPropertyValue(l);if(!c||!c.includes("var("))continue;let i=r&&r.getPropertyValue(l);if(i)try{e.style.setProperty(l,i.trim(),s.getPropertyPriority(l))}catch{}}}if(o&&t.attributes?.length){let s=t.attributes;for(let a=0;a<s.length;a++){let l=s[a];if(!l||typeof l.value!="string"||!l.value.includes("var("))continue;let c=l.name,i=r&&r.getPropertyValue(c);if(i)try{e.style.setProperty(c,i.trim())}catch{}}}if(!o){if(!r)try{r=getComputedStyle(t)}catch{r=null}if(!r)return;let s=t.namespaceURI||"html",a=Rn(t.tagName,s);for(let l of xe){let c=r.getPropertyValue(l)||"",i=a[l]||"";if(c&&c!==i)try{e.style.setProperty(l,c.trim())}catch{}}}}function Zt(t,e,n){return Promise.all(t.map(o=>new Promise(r=>{function s(){V(a=>{(a&&typeof a.timeRemaining=="function"?a.timeRemaining()>0:!0)?e(o,r):s()},{fast:n})}s()})))}function Tn(t){return t=t.trim(),!t||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function Pn(t,e,n=!0){return t.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let r=n?Tn(o):o;return`:where(${e} ${r})`}).join(", ")}function _n(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${e}:is(${o.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${e} ${o.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,r,s)=>{let a=Pn(s,e,!0);return`${o}${r}${a}{`}),t):""}function Wn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Un(t){let e="";try{t.querySelectorAll("style").forEach(o=>{e+=(o.textContent||"")+`
3
- `});let n=t.adoptedStyleSheets||[];for(let o of n)try{if(o&&o.cssRules)for(let r of o.cssRules)e+=r.cssText+`
4
- `}catch{}}catch{}return e}function On(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function Bn(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function Dn(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function Hn(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch{}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch{}return""}function qn(t,e,n){let o=[];for(let r of e){let s=Hn(t,r);s&&o.push(`${r}: ${s};`)}return o.length?`${n}{${o.join("")}}
5
- `:""}function jn(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}async function zn(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},o=n(),r=0;for(;r<e&&(!o||!o.body&&!o.documentElement);)await new Promise(s=>setTimeout(s,0)),o=n(),r++;return o&&(o.body||o.documentElement)?o:null}function Vn(t){let e=t.getBoundingClientRect(),n=0,o=0,r=0,s=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,o=parseFloat(c.borderRightWidth)||0,r=parseFloat(c.borderTopWidth)||0,s=parseFloat(c.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(e.width-(n+o))),l=Math.max(0,Math.round(e.height-(r+s)));return{contentWidth:a,contentHeight:l,rect:e}}function Xn(t,e,n){let o=t.createElement("style");return o.setAttribute("data-sd-iframe-pin",""),o.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(o),()=>{try{o.remove()}catch{}}}async function Yn(t,e,n){let o=await zn(t,3);if(!o)throw new Error("iframe document not accessible/ready");let{contentWidth:r,contentHeight:s,rect:a}=Vn(t),l=n?.snap;if(!l||typeof l.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let c={...n,scale:1},i=Xn(o,r,s),f;try{f=await l.toPng(o.documentElement,c)}finally{i()}f.style.display="block",f.style.width=`${r}px`,f.style.height=`${s}px`;let d=document.createElement("div");return e.nodeMap.set(d,t),st(t,d,e,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(f),d}async function wt(t,e,n){if(!t)throw new Error("Invalid node");let o=new Set,r=null,s=null;if(t.nodeType===Node.ELEMENT_NODE){let i=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Ft.has(i))return null}if(t.nodeType===Node.TEXT_NODE||t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let i=document.createElement("div"),f=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${f.width}px;height:${f.height}px;visibility:hidden;`,i}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let i of n.exclude)try{if(t.matches?.(i)){if(n.excludeMode==="hide"){let f=document.createElement("div"),d=t.getBoundingClientRect();return f.style.cssText=`display:inline-block;width:${d.width}px;height:${d.height}px;visibility:hidden;`,f}else if(n.excludeMode==="remove")return null}}catch(f){console.warn(`Invalid selector in exclude option: ${i}`,f)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let i=document.createElement("div"),f=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${f.width}px;height:${f.height}px;visibility:hidden;`,i}else if(n.filterMode==="remove")return null}}catch(i){console.warn("Error in filter function:",i)}if(t.tagName==="IFRAME"){let i=!1;try{i=!!(t.contentDocument||t.contentWindow?.document)}catch{i=!1}if(i)try{return await Yn(t,e,n)}catch(f){console.warn("[SnapDOM] iframe rasterization failed, fallback:",f)}if(n.placeholders){let f=document.createElement("div");return f.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}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;`,st(t,f,e,n),f}else{let f=t.getBoundingClientRect(),d=document.createElement("div");return d.style.cssText=`display:inline-block;width:${f.width}px;height:${f.height}px;visibility:hidden;`,st(t,d,e,n),d}}if(t.getAttribute("data-capture")==="placeholder"){let i=t.cloneNode(!1);e.nodeMap.set(i,t),st(t,i,e,n);let f=document.createElement("div");return f.textContent=t.getAttribute("data-placeholder-text")||"",f.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",i.appendChild(f),i}if(t.tagName==="CANVAS"){let i="";try{let d=t.getContext("2d",{willReadFrequently:!0});try{d&&d.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),i=t.toDataURL("image/png"),!i||i==="data:,"){try{d&&d.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),i=t.toDataURL("image/png"),!i||i==="data:,"){let p=document.createElement("canvas");p.width=t.width,p.height=t.height;let h=p.getContext("2d");h&&(h.drawImage(t,0,0),i=p.toDataURL("image/png"))}}}catch{}let f=document.createElement("img");try{f.decoding="sync",f.loading="eager"}catch{}i&&(f.src=i),f.width=t.width,f.height=t.height;try{let d=getComputedStyle(t);d.width&&(f.style.width=d.width),d.height&&(f.style.height=d.height)}catch{}return e.nodeMap.set(f,t),st(t,f,e,n),f}let a;try{if(a=t.cloneNode(!1),Se(t,a),e.nodeMap.set(a,t),t.tagName==="IMG"){Bn(t,a);try{let i=t.getBoundingClientRect(),f=Math.round(i.width||0),d=Math.round(i.height||0);if(!f||!d){let p=window.getComputedStyle(t),h=parseFloat(p.width)||0,w=parseFloat(p.height)||0,u=parseInt(t.getAttribute("width")||"",10)||0,m=parseInt(t.getAttribute("height")||"",10)||0,y=t.width||t.naturalWidth||0,g=t.height||t.naturalHeight||0;f=Math.round(f||h||u||y||0),d=Math.round(d||w||m||g||0)}f&&(a.dataset.snapdomWidth=String(f)),d&&(a.dataset.snapdomHeight=String(d))}catch{}}}catch(i){throw console.error("[Snapdom] Failed to clone node:",t,i),i}if(t instanceof HTMLTextAreaElement){let i=t.getBoundingClientRect();a.style.width=`${i.width}px`,a.style.height=`${i.height}px`}if(t instanceof HTMLInputElement&&(a.value=t.value,a.setAttribute("value",t.value),t.checked!==void 0&&(a.checked=t.checked,t.checked&&a.setAttribute("checked",""),t.indeterminate&&(a.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(r=t.value),t instanceof HTMLTextAreaElement&&(s=t.value),st(t,a,e,n),t.shadowRoot){let m=function(g,b){if(g.nodeType===Node.ELEMENT_NODE&&g.tagName==="STYLE")return b(null);wt(g,e,n).then(S=>{b(S||null)}).catch(()=>{b(null)})};try{let g=t.shadowRoot.querySelectorAll("slot");for(let b of g){let S=[];try{S=b.assignedNodes?.({flatten:!0})||b.assignedNodes?.()||[]}catch{S=b.assignedNodes?.()||[]}for(let k of S)o.add(k)}}catch{}let i=Wn(e),f=`[data-sd="${i}"]`;try{a.setAttribute("data-sd",i)}catch{}let d=Un(t.shadowRoot),p=_n(d,f),h=Dn(d),w=qn(t,h,f);On(a,w+p,i);let u=document.createDocumentFragment(),y=await Zt(Array.from(t.shadowRoot.childNodes),m,n.fast);u.append(...y.filter(g=>!!g)),a.appendChild(u)}if(t.tagName==="SLOT"){let p=function(w,u){wt(w,e,n).then(m=>{m&&jn(m),u(m||null)}).catch(()=>{u(null)})},i=t.assignedNodes?.({flatten:!0})||[],f=i.length>0?i:Array.from(t.childNodes),d=document.createDocumentFragment(),h=await Zt(Array.from(f),p,n.fast);return d.append(...h.filter(w=>!!w)),d}function l(i,f){if(o.has(i))return f(null);wt(i,e,n).then(d=>{f(d||null)}).catch(()=>{f(null)})}let c=await Zt(Array.from(t.childNodes),l,n.fast);if(a.append(...c.filter(i=>!!i)),r!==null&&a instanceof HTMLSelectElement){a.value=r;for(let i of a.options)i.value===r?i.setAttribute("selected",""):i.removeAttribute("selected")}return s!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=s),a}var Kn=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],dt=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),te=[];function ke(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?te.push(n):typeof n=="string"?te.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function B(t){let e=typeof t=="string"?t:"",n=[...Kn,...te];for(let o of n)if(o instanceof RegExp&&o.test(e))return!0;return!!(/icon/i.test(e)||/glyph/i.test(e)||/symbols/i.test(e)||/feather/i.test(e)||/fontawesome/i.test(e))}function Gn(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var Ce=new Map;function Qn(t=""){let e=Object.create(null),n=String(t||""),o=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,r;for(;r=o.exec(n);)e[r[1].toUpperCase()]=Number(r[2]);return e}async function Jn(t,e,n){let o=String(t||""),r=o.toLowerCase(),s=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(r)&&!/\bsymbols\b/.test(r))return{familyForMeasure:o,familyForCanvas:o};if(!/\bmaterial\s*symbols\b/.test(r))return{familyForMeasure:o,familyForCanvas:o};let l=n&&(n.FILL??n.fill),c="outlined";/\brounded\b/.test(s)||/\bround\b/.test(s)?c="rounded":/\bsharp\b/.test(s)?c="sharp":/\boutlined\b/.test(s)&&(c="outlined");let i=l===1,f=null;if(i&&(c==="outlined"&&dt.materialIconsFilled?f={url:dt.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&dt.materialIconsRound?f={url:dt.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&dt.materialIconsSharp&&(f={url:dt.materialIconsSharp,alias:"snapdom-mi-sharp"})),!f)return{familyForMeasure:o,familyForCanvas:o};if(!Ce.has(f.alias))try{let p=new FontFace(f.alias,`url(${f.url})`,{style:"normal",weight:"400"});document.fonts.add(p),await p.load(),Ce.set(f.alias,!0)}catch{return{familyForMeasure:o,familyForCanvas:o}}let d=`"${f.alias}"`;return{familyForMeasure:d,familyForCanvas:d}}async function Zn(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function to(t){let e=t.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(e)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!n&&e.toLowerCase()!=="currentcolor")return e;let o=t.color?.trim();return o&&o!=="inherit"?o:"#000"}async function eo(t,{family:e="Material Icons",weight:n="normal",fontSize:o=32,color:r="#000",variation:s="",className:a=""}={}){let l=String(e||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,i=Qn(s),{familyForMeasure:f,familyForCanvas:d}=await Jn(l,a,i);await Zn(d.replace(/^["']+|["']+$/g,""),o);let p=document.createElement("span");p.textContent=t,p.style.position="absolute",p.style.visibility="hidden",p.style.left="-99999px",p.style.whiteSpace="nowrap",p.style.fontFamily=f,p.style.fontWeight=String(n||"normal"),p.style.fontSize=`${o}px`,p.style.lineHeight="1",p.style.margin="0",p.style.padding="0",p.style.fontFeatureSettings="'liga' 1",p.style.fontVariantLigatures="normal",p.style.color=r,document.body.appendChild(p);let h=p.getBoundingClientRect(),w=Math.max(1,Math.ceil(h.width)),u=Math.max(1,Math.ceil(h.height));document.body.removeChild(p);let m=document.createElement("canvas");m.width=w*c,m.height=u*c;let y=m.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${o}px ${d}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=r;try{y.fontKerning="normal"}catch{}return y.fillText(t,0,0),{dataUrl:m.toDataURL(),width:w,height:u}}async function Ae(t,e){if(!(t instanceof Element))return 0;let n='.material-icons, [class*="material-symbols"]',o=Array.from(t.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim());if(o.length===0)return 0;let r=e instanceof Element?Array.from(e.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],s=0;for(let a=0;a<o.length;a++){let l=o[a],c=r[a]||null;try{let i=getComputedStyle(c||l),f=i.fontFamily||"Material Icons";if(!Gn(f))continue;let d=(c||l).textContent.trim();if(!d)continue;let p=parseInt(i.fontSize,10)||24,h=i.fontWeight&&i.fontWeight!=="normal"?i.fontWeight:"normal",w=to(i),u=i.fontVariationSettings&&i.fontVariationSettings!=="normal"?i.fontVariationSettings:"",m=(c||l).className||"",{dataUrl:y,width:g,height:b}=await eo(d,{family:f,weight:h,fontSize:p,color:w,variation:u,className:m});l.textContent="";let S=l.ownerDocument.createElement("img");S.src=y,S.alt=d,S.style.height=`${p}px`,S.style.width=`${Math.max(1,Math.round(g/b*p))}px`,S.style.objectFit="contain",S.style.verticalAlign=getComputedStyle(l).verticalAlign||"baseline",l.appendChild(S),s++}catch{}}return s}async function Ee(t,e,n,o=32,r="#000"){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${o}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let l=a.getBoundingClientRect(),c=Math.ceil(l.width),i=Math.ceil(l.height);document.body.removeChild(a);let f=document.createElement("canvas");f.width=Math.max(1,c*s),f.height=Math.max(1,i*s);let d=f.getContext("2d");return d.scale(s,s),d.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=r,d.fillText(t,0,0),{dataUrl:f.toDataURL(),width:c,height:i}}var no=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Nt(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!no.has(n.toLowerCase()))return n}return""}function It(t){let e=String(t??"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function ee(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function oo(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function ro(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let r=It(n[1]),s=It(n[2]);return{min:Math.min(r,s),max:Math.max(r,s)}}let o=It(e);return{min:o,max:o}}function so(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function ao(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let s=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(s,a),max:Math.max(s,a)}}let o=e.match(/(\d+(?:\.\d+)?)\s*%/),r=o?parseFloat(o[1]):100;return{min:r,max:r}}function io(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let r=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(l=>r.endsWith(l)))return!0;let a=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a))return!0;for(let l of e){let c=l.toLowerCase().replace(/\s+/g,"+"),i=l.toLowerCase().replace(/\s+/g,"-");if(a.includes(c)||a.includes(i))return!0}return!1}catch{return!1}}function co(t){let e=new Set;for(let n of t||[]){let o=String(n).split("__")[0]?.trim();o&&e.add(o)}return e}function Me(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,o,r)=>{let s=(r||"").trim();if(!s||/^data:|^blob:|^https?:|^file:|^about:/i.test(s))return n;let a=s;try{a=new URL(s,e||location.href).href}catch{}return`url("${a}")`})}var ne=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Lt=4;async function lo(t,e,n){if(!t)return t;let o=new Set;function r(l,c){try{return new URL(l,c||location.href).href}catch{return l}}async function s(l,c,i=0){if(i>Lt)return console.warn(`[snapDOM] @import depth exceeded (${Lt}) at ${c}`),l;let f="",d=0,p;for(;p=ne.exec(l);){f+=l.slice(d,p.index),d=ne.lastIndex;let h=(p[2]||p[4]||"").trim(),w=r(h,c);if(o.has(w)){console.warn(`[snapDOM] Skipping circular @import: ${w}`);continue}o.add(w);let u="";try{let m=await T(w,{as:"text",useProxy:n,silent:!0});m.ok&&typeof m.data=="string"&&(u=m.data)}catch{}u?(u=Me(u,w),u=await s(u,w,i+1),f+=`
6
- /* inlined: ${w} */
7
- ${u}
8
- `):f+=p[0]}return f+=l.slice(d),f}let a=Me(t,e||location.href);return a=await s(a,e||location.href,0),a}var Fe=/url\((["']?)([^"')]+)\1\)/g,uo=/@font-face[^{}]*\{[^}]*\}/g;function $e(t){if(!t)return[];let e=[],n=t.split(",").map(o=>o.trim()).filter(Boolean);for(let o of n){let r=o.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!r)continue;let s=r[1],a=r[2],l=c=>{if(!c.includes("?"))return parseInt(c,16);let i=parseInt(c.replace(/\?/g,"0"),16),f=parseInt(c.replace(/\?/g,"F"),16);return[i,f]};if(a){let c=l(s),i=l(a),f=Array.isArray(c)?c[0]:c,d=Array.isArray(i)?i[1]:i;e.push([Math.min(f,d),Math.max(f,d)])}else{let c=l(s);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function Ie(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[o,r]of e)if(n>=o&&n<=r)return!0;return!1}function oe(t,e){let n=[];if(!t)return n;for(let o of t.matchAll(Fe)){let r=(o[2]||"").trim();if(!(!r||r.startsWith("data:"))){if(!/^https?:/i.test(r))try{r=new URL(r,e||location.href).href}catch{}n.push(r)}}return n}async function Le(t,e,n=""){let o=t;for(let r of t.matchAll(Fe)){let s=nt(r[0]);if(!s)continue;let a=s;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,e||location.href).href}catch{}if(!B(a)){if(x.resource?.has(a)){x.font?.add(a),o=o.replace(r[0],`url(${x.resource.get(a)})`);continue}if(!x.font?.has(a))try{let l=await T(a,{as:"dataURL",useProxy:n,silent:!0});if(l.ok&&typeof l.data=="string"){let c=l.data;x.resource?.set(a,c),x.font?.add(a),o=o.replace(r[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return o}function fo(t){if(!t.length)return null;let e=(l,c)=>t.some(([i,f])=>!(f<l||i>c)),n=e(0,255)||e(305,305),o=e(256,591)||e(7680,7935),r=e(880,1023),s=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":s?"cyrillic":r?"greek":o?"latin-ext":n?"latin":null}function ve(t={}){let e=new Set((t.families||[]).map(r=>String(r).toLowerCase())),n=new Set((t.domains||[]).map(r=>String(r).toLowerCase())),o=new Set((t.subsets||[]).map(r=>String(r).toLowerCase()));return(r,s)=>{if(e.size&&e.has(r.family.toLowerCase()))return!0;if(n.size)for(let a of r.srcUrls)try{if(n.has(new URL(a).host.toLowerCase()))return!0}catch{}if(o.size){let a=fo(s);if(a&&o.has(a))return!0}return!1}}function mo(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,o=[];for(let s of t.match(e)||[]){let a=s.match(/font-family:\s*([^;]+);/i)?.[1]||"",l=Nt(a),c=(s.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),i=(s.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),f=(s.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),d=(s.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),p=(s.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),h=oe(p,location.href),w=h.length?h.map(m=>String(m).toLowerCase()).sort().join("|"):p.toLowerCase(),u=[String(l||"").toLowerCase(),c,i,f,d.toLowerCase(),w].join("|");n.has(u)||(n.add(u),o.push(s))}if(o.length===0)return t;let r=0;return t.replace(e,()=>o[r++]||"")}function po(t,e,n,o){let r=Array.from(t||[]).sort().join("|"),s=e?JSON.stringify({families:(e.families||[]).map(c=>String(c).toLowerCase()).sort(),domains:(e.domains||[]).map(c=>String(c).toLowerCase()).sort(),subsets:(e.subsets||[]).map(c=>String(c).toLowerCase()).sort()}):"",a=(n||[]).map(c=>`${(c.family||"").toLowerCase()}::${c.weight||"normal"}::${c.style||"normal"}::${c.src||""}`).sort().join("|");return`fonts-embed-css::req=${r}::ex=${s}::lf=${a}::px=${o||""}`}async function Ne(t,e,n,o){let r;try{r=t.cssRules||[]}catch{return}let s=(a,l)=>{try{return new URL(a,l||location.href).href}catch{return a}};for(let a of r){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let l=a.href?s(a.href,e):e;if(o.depth>=Lt){console.warn(`[snapDOM] CSSOM import depth exceeded (${Lt}) at ${l}`);continue}if(l&&o.visitedSheets.has(l)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${l}`);continue}l&&o.visitedSheets.add(l);let c={...o,depth:(o.depth||0)+1};await Ne(a.styleSheet,l,n,c);continue}if(a.type===CSSRule.FONT_FACE_RULE){let l=(a.style.getPropertyValue("font-family")||"").trim(),c=Nt(l);if(!c||B(c))continue;let i=(a.style.getPropertyValue("font-weight")||"400").trim(),f=(a.style.getPropertyValue("font-style")||"normal").trim(),d=(a.style.getPropertyValue("font-stretch")||"100%").trim(),p=(a.style.getPropertyValue("src")||"").trim(),h=(a.style.getPropertyValue("unicode-range")||"").trim();if(!o.faceMatchesRequired(c,f,i,d))continue;let w=$e(h);if(!Ie(o.usedCodepoints,w))continue;let u={family:c,weightSpec:i,styleSpec:f,stretchSpec:d,unicodeRange:h,srcRaw:p,srcUrls:oe(p,e||location.href),href:e||location.href};if(o.simpleExcluder&&o.simpleExcluder(u,w))continue;if(/url\(/i.test(p)){let m=await Le(p,e||location.href,o.useProxy);await n(`@font-face{font-family:${c};src:${m};font-style:${f};font-weight:${i};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}else await n(`@font-face{font-family:${c};src:${p};font-style:${f};font-weight:${i};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}}}async function Rt({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:o=[],useProxy:r=""}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let s=new Map;for(let u of t){let[m,y,g,b]=String(u).split("__");if(!m)continue;let S=s.get(m)||[];S.push({w:parseInt(y,10),s:g,st:parseInt(b,10)}),s.set(m,S)}function a(u,m,y,g){if(!s.has(u))return!1;let b=s.get(u),S=ro(y),k=so(m),C=ao(g),M=S.min!==S.max,L=S.min,$=E=>k.kind==="normal"&&E==="normal"||k.kind!=="normal"&&(E==="italic"||E==="oblique"),N=!1;for(let E of b){let U=M?E.w>=S.min&&E.w<=S.max:E.w===L,O=$(ee(E.s)),v=E.st>=C.min&&E.st<=C.max;if(U&&O&&v){N=!0;break}}if(N)return!0;if(!M)for(let E of b){let U=$(ee(E.s)),O=E.st>=C.min&&E.st<=C.max;if(Math.abs(L-E.w)<=300&&U&&O)return!0}return!1}let l=ve(n),c=po(t,n,o,r);if(x.resource?.has(c))return x.resource.get(c);let i=co(t),f=[],d=ne;for(let u of document.querySelectorAll("style")){let m=u.textContent||"";for(let y of m.matchAll(d)){let g=(y[2]||y[4]||"").trim();if(!g||B(g))continue;!!document.querySelector(`link[rel="stylesheet"][href="${g}"]`)||f.push(g)}}f.length&&await Promise.all(f.map(u=>new Promise(m=>{if(document.querySelector(`link[rel="stylesheet"][href="${u}"]`))return m(null);let y=document.createElement("link");y.rel="stylesheet",y.href=u,y.setAttribute("data-snapdom","injected-import"),y.onload=()=>m(y),y.onerror=()=>m(null),document.head.appendChild(y)})));let p="",h=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(u=>!!u.href);for(let u of h)try{if(B(u.href))continue;let m="",y=!1;try{y=new URL(u.href,location.href).origin===location.origin}catch{}if(!y&&!io(u.href,i))continue;if(y){let b=Array.from(document.styleSheets).find(S=>S.href===u.href);if(b)try{let S=b.cssRules||[];m=Array.from(S).map(k=>k.cssText).join("")}catch{}}if(!m&&(m=(await T(u.href,{as:"text",useProxy:r})).data,B(u.href)))continue;m=await lo(m,u.href,r);let g="";for(let b of m.match(uo)||[]){let S=(b.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),k=Nt(S);if(!k||B(k))continue;let C=(b.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),M=(b.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),L=(b.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),$=(b.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),N=(b.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),E=oe(N,u.href);if(!a(k,M,C,L))continue;let U=$e($);if(!Ie(e,U))continue;let O={family:k,weightSpec:C,styleSpec:M,stretchSpec:L,unicodeRange:$,srcRaw:N,srcUrls:E,href:u.href};if(n&&l(O,U))continue;let v=/url\(/i.test(N)?await Le(b,u.href,r):b;g+=v}g.trim()&&(p+=g)}catch{console.warn("[snapDOM] Failed to process stylesheet:",u.href)}let w={requiredIndex:s,usedCodepoints:e,faceMatchesRequired:a,simpleExcluder:n?ve(n):null,useProxy:r,visitedSheets:new Set,depth:0};for(let u of document.styleSheets)if(!(u.href&&h.some(m=>m.href===u.href)))try{let m=u.href||location.href;m&&w.visitedSheets.add(m),await Ne(u,m,async y=>{p+=y},w)}catch{}try{for(let u of document.fonts||[]){if(!u||!u.family||u.status!=="loaded"||!u._snapdomSrc)continue;let m=String(u.family).replace(/^['"]+|['"]+$/g,"");if(B(m)||!s.has(m)||n?.families&&n.families.some(g=>String(g).toLowerCase()===m.toLowerCase()))continue;let y=u._snapdomSrc;if(!String(y).startsWith("data:")){if(x.resource?.has(u._snapdomSrc))y=x.resource.get(u._snapdomSrc),x.font?.add(u._snapdomSrc);else if(!x.font?.has(u._snapdomSrc))try{let g=await T(u._snapdomSrc,{as:"dataURL",useProxy:r,silent:!0});if(g.ok&&typeof g.data=="string")y=g.data,x.resource?.set(u._snapdomSrc,y),x.font?.add(u._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",u._snapdomSrc);continue}}p+=`@font-face{font-family:'${m}';src:url(${y});font-style:${u.style||"normal"};font-weight:${u.weight||"normal"};}`}}catch{}for(let u of o){if(!u||typeof u!="object")continue;let m=String(u.family||"").replace(/^['"]+|['"]+$/g,"");if(!m||B(m)||!s.has(m)||n?.families&&n.families.some(C=>String(C).toLowerCase()===m.toLowerCase()))continue;let y=u.weight!=null?String(u.weight):"normal",g=u.style!=null?String(u.style):"normal",b=u.stretchPct!=null?`${u.stretchPct}%`:"100%",S=String(u.src||""),k=S;if(!k.startsWith("data:")){if(x.resource?.has(S))k=x.resource.get(S),x.font?.add(S);else if(!x.font?.has(S))try{let C=await T(S,{as:"dataURL",useProxy:r,silent:!0});if(C.ok&&typeof C.data=="string")k=C.data,x.resource?.set(S,k),x.font?.add(S);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",S);continue}}p+=`@font-face{font-family:'${m}';src:url(${k});font-style:${g};font-weight:${y};font-stretch:${b};}`}return p&&(p=mo(p),x.resource?.set(c,p)),p}function Tt(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),o=a=>{let l=Nt(a.fontFamily);if(!l)return;let c=(i,f,d)=>`${l}__${It(i)}__${ee(f)}__${oo(d)}`;e.add(c(a.fontWeight,a.fontStyle,a.fontStretch))};o(getComputedStyle(t));let r=getComputedStyle(t,"::before");r&&r.content&&r.content!=="none"&&o(r);let s=getComputedStyle(t,"::after");for(s&&s.content&&s.content!=="none"&&o(s);n.nextNode();){let a=n.currentNode,l=getComputedStyle(a);o(l);let c=getComputedStyle(a,"::before");c&&c.content&&c.content!=="none"&&o(c);let i=getComputedStyle(a,"::after");i&&i.content&&i.content!=="none"&&o(i)}return e}function Pt(t){let e=new Set,n=r=>{if(r)for(let s of r)e.add(s.codePointAt(0))},o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){let r=o.currentNode;if(r.nodeType===Node.TEXT_NODE)n(r.nodeValue||"");else if(r.nodeType===Node.ELEMENT_NODE){let s=r;for(let a of["::before","::after"]){let c=getComputedStyle(s,a)?.getPropertyValue("content");if(!(!c||c==="none"))if(/^"/.test(c)||/^'/.test(c))n(c.slice(1,-1));else{let i=c.match(/\\[0-9A-Fa-f]{1,6}/g);if(i)for(let f of i)try{e.add(parseInt(f.slice(1),16))}catch{}}}}}return e}async function _t(t,e=2){try{await document.fonts.ready}catch{}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let o=()=>{let r=document.createElement("div");r.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let s of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${s}"`,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",r.appendChild(a)}document.body.appendChild(r),r.offsetWidth,document.body.removeChild(r)};for(let r=0;r<Math.max(1,e);r++)o(),await new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s)))}function _e(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function ho(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function Re(t,e=!1){let n="",o=Math.max(1,t);for(;o>0;)o--,n=String.fromCharCode(97+o%26)+n,o=Math.floor(o/26);return e?n.toUpperCase():n}function Te(t,e=!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"]],o=Math.max(1,Math.min(3999,t)),r="";for(let[s,a]of n)for(;o>=s;)r+=a,o-=s;return e?r:r.toLowerCase()}function Pe(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return Re(t,!1);case"upper-alpha":return Re(t,!0);case"lower-roman":return Te(t,!1);case"upper-roman":return Te(t,!0);default:return String(Math.max(0,t))}}function We(t){let e=()=>x?.session?.__counterEpoch??0,n=e(),o=new WeakMap,r=t instanceof Document?t.documentElement:t,s=p=>p&&p.tagName==="LI",a=p=>{let h=0,w=p?.parentElement;if(!w)return 0;for(let u of w.children){if(u===p)break;u.tagName==="LI"&&h++}return h},l=p=>{let h=new Map;for(let[w,u]of p)h.set(w,u.slice());return h},c=(p,h,w)=>{let u=l(p),m;try{m=w.style?.counterReset||getComputedStyle(w).counterReset}catch{}if(m&&m!=="none")for(let g of m.split(",")){let b=g.trim().split(/\s+/),S=b[0],k=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!S)continue;let C=h.get(S);if(C&&C.length){let M=C.slice();M.push(k),u.set(S,M)}else u.set(S,[k])}let y;try{y=w.style?.counterIncrement||getComputedStyle(w).counterIncrement}catch{}if(y&&y!=="none")for(let g of y.split(",")){let b=g.trim().split(/\s+/),S=b[0],k=Number.isFinite(Number(b[1]))?Number(b[1]):1;if(!S)continue;let C=u.get(S)||[];C.length===0&&C.push(0),C[C.length-1]+=k,u.set(S,C)}try{if(getComputedStyle(w).display==="list-item"&&s(w)){let b=w.parentElement,S=1;if(b&&b.tagName==="OL"){let C=b.getAttribute("start"),M=Number.isFinite(Number(C))?Number(C):1,L=a(w),$=w.getAttribute("value");S=Number.isFinite(Number($))?Number($):M+L}else S=1+a(w);let k=u.get("list-item")||[];k.length===0&&k.push(0),k[k.length-1]=S,u.set("list-item",k)}}catch{}return u},i=(p,h,w)=>{let u=c(w,h,p);o.set(p,u);let m=u;for(let y of p.children)m=i(y,u,m);return u},f=new Map;i(r,f,f);function d(){let p=e();if(p!==n){n=p;let h=new Map;i(r,h,h)}}return{get(p,h){d();let w=o.get(p)?.get(h);return w&&w.length?w[w.length-1]:0},getStack(p,h){d();let w=o.get(p)?.get(h);return w?w.slice():[]}}}function Ue(t,e,n){if(!t||t==="none")return t;try{let o=/\b(counter|counters)\s*\(([^)]+)\)/g,r=t.replace(o,(s,a,l)=>{let c=String(l).split(",").map(i=>i.trim());if(a==="counter"){let i=c[0]?.replace(/^["']|["']$/g,""),f=(c[1]||"decimal").toLowerCase(),d=n.get(e,i);return Pe(d,f)}else{let i=c[0]?.replace(/^["']|["']$/g,""),f=c[1]?.replace(/^["']|["']$/g,"")??"",d=(c[2]||"decimal").toLowerCase(),p=n.getStack(e,i);return p.length?p.map(w=>Pe(w,d)).join(f):""}});return ho(r)}catch{return"- "}}var mt=new WeakMap,Oe=-1;function go(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function yo(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,o;for(;o=n.exec(t);)e.push(o[1]);return e.length?e.join(""):go(t)}function re(t,e){let n=t.parentElement,o=n?mt.get(n):null;return o?{get(r,s){let a=e.get(r,s),l=o.get(s);return typeof l=="number"?Math.max(a,l):a},getStack(r,s){let a=e.getStack(r,s);if(!a.length)return a;let l=o.get(s);if(typeof l=="number"){let c=a.slice();return c[c.length-1]=Math.max(c[c.length-1],l),c}return a}}:e}function se(t,e,n){let o=new Map;function r(c){let i=[];if(!c||c==="none")return i;for(let f of String(c).split(",")){let d=f.trim().split(/\s+/),p=d[0],h=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;p&&i.push({name:p,num:h})}return i}let s=r(e?.counterReset),a=r(e?.counterIncrement);function l(c){if(o.has(c))return o.get(c).slice();let i=n.getStack(t,c);i=i.length?i.slice():[];let f=s.find(p=>p.name===c);if(f){let p=Number.isFinite(f.num)?f.num:0;i=i.length?[...i,p]:[p]}let d=a.find(p=>p.name===c);if(d){let p=Number.isFinite(d.num)?d.num:1;i.length===0&&(i=[0]),i[i.length-1]+=p}return o.set(c,i.slice()),i}return{get(c,i){let f=l(i);return f.length?f[f.length-1]:0},getStack(c,i){return l(i)},__incs:a}}function wo(t,e,n){let o;try{o=getComputedStyle(t,e)}catch{}let r=o?.content;if(!r||r==="none"||r==="normal")return{text:"",incs:[]};let s=re(t,n),a=se(t,o,s),l=_e(r)?Ue(r,t,a):r;return{text:yo(l),incs:a.__incs||[]}}async function ae(t,e,n,o){if(!(t instanceof Element)||!(e instanceof Element))return;let r=x?.session?.__counterEpoch??0;if(Oe!==r&&(mt=new WeakMap,n&&(n.__counterCtx=null),Oe=r),!n.__counterCtx)try{n.__counterCtx=We(t.ownerDocument||document)}catch{}let s=n.__counterCtx;for(let c of["::before","::after","::first-letter"])try{let i=rt(t,c);if(!i||typeof i[Symbol.iterator]!="function"||i.content==="none"&&i.backgroundImage==="none"&&i.backgroundColor==="transparent"&&(i.borderStyle==="none"||parseFloat(i.borderWidth)===0)&&(!i.transform||i.transform==="none")&&i.display==="inline")continue;if(c==="::first-letter"){let I=getComputedStyle(t);if(!(i.color!==I.color||i.fontSize!==I.fontSize||i.fontWeight!==I.fontWeight))continue;let P=Array.from(e.childNodes).find(ht=>ht.nodeType===Node.TEXT_NODE&&ht.textContent?.trim().length>0);if(!P)continue;let _=P.textContent,et=_.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],kt=_.slice(et?.length||0);if(!et||/[\uD800-\uDFFF]/.test(et))continue;let it=document.createElement("span");it.textContent=et,it.dataset.snapdomPseudo="::first-letter";let Ot=$t(i),Bt=ft(Ot,"span");n.styleMap.set(it,Bt);let At=document.createTextNode(kt);e.replaceChild(At,P),e.insertBefore(it,At);continue}let d=i.content,{text:p,incs:h}=wo(t,c,s),w=i.backgroundImage,u=i.backgroundColor,m=i.fontFamily,y=parseInt(i.fontSize)||32,g=parseInt(i.fontWeight)||!1,b=i.color||"#000",S=i.borderStyle,k=parseFloat(i.borderWidth),C=i.transform,M=B(m),L=d!=="none"&&p!=="",$=w&&w!=="none",N=u&&u!=="transparent"&&u!=="rgba(0, 0, 0, 0)",E=S&&S!=="none"&&k>0,U=C&&C!=="none";if(!(L||$||N||E||U)){if(h&&h.length&&t.parentElement){let I=mt.get(t.parentElement)||new Map;for(let{name:R}of h){if(!R)continue;let P=re(t,s),j=se(t,getComputedStyle(t,c),P).get(t,R);I.set(R,j)}mt.set(t.parentElement,I)}continue}let v=document.createElement("span");v.dataset.snapdomPseudo=c,v.style.display="inline",v.style.verticalAlign="baseline",v.style.pointerEvents="none";let Y=$t(i),K=ft(Y,"span");if(n.styleMap.set(v,K),M&&p&&p.length===1){let{dataUrl:I,width:R,height:P}=await Ee(p,m,g,y,b),_=document.createElement("img");_.src=I,_.style=`height:${y}px;width:${R/P*y}px;object-fit:contain;`,v.appendChild(_),e.dataset.snapdomHasIcon="true"}else if(p&&p.startsWith("url(")){let I=nt(p);if(I?.trim())try{let R=document.createElement("img"),P=await T(J(I),{as:"dataURL",useProxy:o.useProxy});R.src=P.data,R.style=`width:${y}px;height:auto;object-fit:contain;`,v.appendChild(R)}catch(R){console.error(`[snapdom] Error in pseudo ${c} for`,t,R)}}else!M&&L&&(v.textContent=p);v.style.backgroundImage="none","maskImage"in v.style&&(v.style.maskImage="none"),"webkitMaskImage"in v.style&&(v.style.webkitMaskImage="none");try{v.style.backgroundRepeat=i.backgroundRepeat,v.style.backgroundSize=i.backgroundSize,i.backgroundPositionX&&i.backgroundPositionY?(v.style.backgroundPositionX=i.backgroundPositionX,v.style.backgroundPositionY=i.backgroundPositionY):v.style.backgroundPosition=i.backgroundPosition,v.style.backgroundOrigin=i.backgroundOrigin,v.style.backgroundClip=i.backgroundClip,v.style.backgroundAttachment=i.backgroundAttachment,v.style.backgroundBlendMode=i.backgroundBlendMode}catch{}if($)try{let I=gt(w),R=await Promise.all(I.map(ot));v.style.backgroundImage=R.join(", ")}catch(I){console.warn(`[snapdom] Failed to inline background-image for ${c}`,I)}N&&(v.style.backgroundColor=u);let tt=v.childNodes.length>0||v.textContent?.trim()!==""||$||N||E||U;if(h&&h.length&&t.parentElement){let I=mt.get(t.parentElement)||new Map,R=re(t,s),P=se(t,getComputedStyle(t,c),R);for(let{name:_}of h){if(!_)continue;let j=P.get(t,_);I.set(_,j)}mt.set(t.parentElement,I)}if(!tt)continue;c==="::before"?e.insertBefore(v,e.firstChild):e.appendChild(v)}catch(i){console.warn(`[snapdom] Failed to capture ${c} for`,t,i)}let a=Array.from(t.children),l=Array.from(e.children).filter(c=>!c.dataset.snapdomPseudo);for(let c=0;c<Math.min(a.length,l.length);c++)await ae(a[c],l[c],n,o)}function Be(t,e){if(!t||!(t instanceof Element))return;let n=t.ownerDocument||document,o=e||n,r=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(r.length===0)return;let s=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],l=g=>window.CSS&&CSS.escape?CSS.escape(g):g.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c=new Set(Array.from(t.querySelectorAll("[id]")).map(g=>g.id)),i=new Set,f=!1,d=g=>{if(!g)return;s.lastIndex=0;let b;for(;b=s.exec(g);){f=!0;let S=(b[1]||"").trim();S&&!c.has(S)&&i.add(S)}},p=g=>{let b=g.querySelectorAll('use[href^="#"], use[xlink\\:href^="#"]');for(let C of b){let M=C.getAttribute("href")||C.getAttribute("xlink:href");if(!M||!M.startsWith("#"))continue;f=!0;let L=M.slice(1).trim();L&&!c.has(L)&&i.add(L)}let k=g.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("], *[clip-path^="url("],*[mask^="url("],*[marker^="url("], *[marker-start^="url("],*[marker-mid^="url("], *[marker-end^="url("]');for(let C of k){d(C.getAttribute("style")||"");for(let M of a)d(C.getAttribute(M))}};for(let g of r)p(g);if(!f)return;let h=t.querySelector("svg.inline-defs-container");h||(h=n.createElementNS("http://www.w3.org/2000/svg","svg"),h.classList.add("inline-defs-container"),h.setAttribute("aria-hidden","true"),h.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(h,t.firstChild||null));let w=h.querySelector("defs")||null,u=g=>{if(!g||c.has(g))return null;let b=l(g),S=k=>{let C=o.querySelector(k);return C&&!t.contains(C)?C:null};return S(`svg defs > *#${b}`)||S(`svg > symbol#${b}`)||S(`*#${b}`)};if(!i.size)return;let m=new Set(i),y=new Set;for(;m.size;){let g=m.values().next().value;if(m.delete(g),!g||c.has(g)||y.has(g))continue;let b=u(g);if(!b){y.add(g);continue}w||(w=n.createElementNS("http://www.w3.org/2000/svg","defs"),h.appendChild(w));let S=b.cloneNode(!0);S.id||S.setAttribute("id",g),w.appendChild(S),y.add(g),c.add(g);let k=[S,...S.querySelectorAll("*")];for(let C of k){let M=C.getAttribute?.("href")||C.getAttribute?.("xlink:href");if(M&&M.startsWith("#")){let $=M.slice(1).trim();$&&!c.has($)&&!y.has($)&&m.add($)}let L=C.getAttribute?.("style")||"";L&&d(L);for(let $ of a){let N=C.getAttribute?.($);N&&d(N)}}}}function He(t,e){if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let o=t.getBoundingClientRect(),r=t.clientHeight,s="data-snap-ph",a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let l=a.currentNode,c=getComputedStyle(l),i=c.position;if(i!=="sticky"&&i!=="-webkit-sticky")continue;let f=De(c.top),d=De(c.bottom);if(f==null&&d==null)continue;let p=bo(l,t),h=xo(e,p,s);if(!h)continue;let w=l.getBoundingClientRect(),u=w.width,m=w.height,y=w.left-o.left;if(!(u>0&&m>0)||!Number.isFinite(y))continue;let g=f!=null?f+n:n+(r-m-d);if(!Number.isFinite(g))continue;let b=Number.parseInt(c.zIndex,10),S=Number.isFinite(b),k=S?Math.max(b,1)+1:2,C=S?b-1:0,M=h.cloneNode(!1);M.setAttribute(s,"1"),M.style.position="sticky",M.style.left=`${y}px`,M.style.top=`${g}px`,M.style.width=`${u}px`,M.style.height=`${m}px`,M.style.visibility="hidden",M.style.zIndex=String(C),M.style.overflow="hidden",M.style.background="transparent",M.style.boxShadow="none",M.style.filter="none",h.parentElement?.insertBefore(M,h),h.style.position="absolute",h.style.left=`${y}px`,h.style.top=`${g}px`,h.style.bottom="auto",h.style.zIndex=String(k),h.style.pointerEvents="none"}}function De(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function bo(t,e){let n=[];for(let o=t;o&&o!==e;){let r=o.parentElement;if(!r)break;n.push(Array.prototype.indexOf.call(r.children,o)),o=r}return n.reverse()}function xo(t,e,n){let o=t;for(let r=0;r<e.length;r++)if(o=So(o,n)[e[r]],!o)return null;return o instanceof HTMLElement?o:null}function So(t,e){let n=[],o=t.children;for(let r=0;r<o.length;r++){let s=o[r];s.hasAttribute(e)||n.push(s)}return n}async function je(t,e={}){let n={styleMap:x.session.styleMap,styleCache:x.session.styleCache,nodeMap:x.session.nodeMap},o,r="",s="";Co(t);try{Be(t)}catch(c){console.warn("inlineExternal defs or symbol failed:",c)}try{o=await wt(t,n,e,t)}catch(c){throw console.warn("deepClone failed:",c),c}try{await ae(t,o,n,e)}catch(c){console.warn("inlinePseudoElements failed:",c)}await vo(o);try{let c=o.querySelectorAll("style[data-sd]");for(let i of c)s+=i.textContent||"",i.remove()}catch{}let a=Gt(n.styleMap);r=Array.from(a.entries()).map(([c,i])=>`.${i}{${c}}`).join(""),r=s+r;for(let[c,i]of n.styleMap.entries()){if(c.tagName==="STYLE")continue;if(c.getRootNode&&c.getRootNode()instanceof ShadowRoot){c.setAttribute("style",i.replace(/;/g,"; "));continue}let f=a.get(i);f&&c.classList.add(f);let d=c.style?.backgroundImage,p=c.dataset?.snapdomHasIcon;d&&d!=="none"&&(c.style.backgroundImage=d),p&&(c.style.verticalAlign="middle",c.style.display="inline")}for(let[c,i]of n.nodeMap.entries()){let f=i.scrollLeft,d=i.scrollTop;if((f||d)&&c instanceof HTMLElement){c.style.overflow="hidden",c.style.scrollbarWidth="none",c.style.msOverflowStyle="none";let h=document.createElement("div");for(h.style.transform=`translate(${-f}px, ${-d}px)`,h.style.willChange="transform",h.style.display="inline-block",h.style.width="100%";c.firstChild;)h.appendChild(c.firstChild);c.appendChild(h)}}let l=o instanceof HTMLElement&&o.firstElementChild instanceof HTMLElement?o.firstElementChild:o;if(He(t,l),t===n.nodeMap.get(o)){let c=n.styleCache.get(t)||window.getComputedStyle(t);n.styleCache.set(t,c);let i=jt(c.transform);o.style.margin="0",o.style.top="auto",o.style.left="auto",o.style.right="auto",o.style.bottom="auto",o.style.animation="none",o.style.transition="none",o.style.willChange="auto",o.style.float="none",o.style.clear="none",o.style.transform=i||""}for(let[c,i]of n.nodeMap.entries())i.tagName==="PRE"&&(c.style.marginTop="0",c.style.marginBlockStart="0");return{clone:o,classCSS:r,styleCache:n.styleCache}}function Co(t){let e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,r=e.borderStyle,s=e.borderWidth,a=n!=="none"&&parseFloat(o)>0,l=r==="none"||parseFloat(s)===0;a&&l&&(t.style.border=`${o} solid transparent`)}var bt=new Map;async function xt(t){if(x.resource?.has(t))return x.resource.get(t);if(bt.has(t))return bt.get(t);let e=(async()=>{let n=await T(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return x.resource?.set(t,n.data),n.data})();bt.set(t,e);try{let n=await e;return bt.set(t,n),n}catch(n){throw bt.delete(t),n}}var ko=/\bblob:[^)"'\s]+/g;async function qe(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(ko)||[]));if(e.length===0)return t;let n=t;for(let o of e)try{let r=await xt(o);n=n.split(o).join(r)}catch{}return n}function Wt(t){return typeof t=="string"&&t.startsWith("blob:")}function Ao(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function Mo(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}async function vo(t){if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let a of e)try{let c=a.getAttribute("src")||a.currentSrc||"";if(Wt(c)){let f=await xt(c);a.setAttribute("src",f)}let i=a.getAttribute("srcset");if(i&&i.includes("blob:")){let f=Ao(i),d=!1;for(let p of f)if(Wt(p.url))try{p.url=await xt(p.url),d=!0}catch{}d&&a.setAttribute("srcset",Mo(f))}}catch{}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let a of n)try{let l="http://www.w3.org/1999/xlink",c=a.getAttribute("href")||a.getAttributeNS?.(l,"href");if(Wt(c)){let i=await xt(c);a.setAttribute("href",i),a.removeAttributeNS?.(l,"href")}}catch{}let o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let a of o)try{let l=a.getAttribute("style");if(l&&l.includes("blob:")){let c=await qe(l);a.setAttribute("style",c)}}catch{}let r=t.querySelectorAll?t.querySelectorAll("style"):[];for(let a of r)try{let l=a.textContent||"";l.includes("blob:")&&(a.textContent=await qe(l))}catch{}let s=["poster"];for(let a of s){let l=t.querySelectorAll?t.querySelectorAll(`[${a}^='blob:']`):[];for(let c of l)try{let i=c.getAttribute(a);Wt(i)&&c.setAttribute(a,await xt(i))}catch{}}}async function ze(t,e={}){let n=Array.from(t.querySelectorAll("img")),o=async r=>{if(!r.getAttribute("src")){let f=r.currentSrc||r.src||"";f&&r.setAttribute("src",f)}r.removeAttribute("srcset"),r.removeAttribute("sizes");let s=r.src||"";if(!s)return;let a=await T(s,{as:"dataURL",useProxy:e.useProxy});if(a.ok&&typeof a.data=="string"&&a.data.startsWith("data:")){r.src=a.data,r.width||(r.width=r.naturalWidth||100),r.height||(r.height=r.naturalHeight||100);return}let{fallbackURL:l}=e||{};if(l)try{let f=parseInt(r.dataset?.snapdomWidth||"",10)||0,d=parseInt(r.dataset?.snapdomHeight||"",10)||0,p=parseInt(r.getAttribute("width")||"",10)||0,h=parseInt(r.getAttribute("height")||"",10)||0,w=parseFloat(r.style?.width||"")||0,u=parseFloat(r.style?.height||"")||0,m=f||w||p||r.width||void 0,y=d||u||h||r.height||void 0,g=typeof l=="function"?await l({width:m,height:y,src:s,element:r}):l;if(g){let b=await T(g,{as:"dataURL",useProxy:e.useProxy});r.src=b.data,!r.width&&m&&(r.width=m),!r.height&&y&&(r.height=y),r.width||(r.width=r.naturalWidth||100),r.height||(r.height=r.naturalHeight||100);return}}catch{}let c=r.width||r.naturalWidth||100,i=r.height||r.naturalHeight||100;if(e.placeholders!==!1){let f=document.createElement("div");f.style.cssText=[`width:${c}px`,`height:${i}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${i}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),f.textContent="img",r.replaceWith(f)}else{let f=document.createElement("div");f.style.cssText=`display:inline-block;width:${c}px;height:${i}px;visibility:hidden;`,r.replaceWith(f)}};for(let r=0;r<n.length;r+=4){let s=n.slice(r,r+4).map(o);await Promise.allSettled(s)}}async function Ut(t,e,n,o={}){let r=[[t,e]],s=["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"],l=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],c=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;r.length;){let[i,f]=r.shift(),d=n.get(i)||rt(i);n.has(i)||n.set(i,d);let p=(()=>{let u=d.getPropertyValue("border-image"),m=d.getPropertyValue("border-image-source");return u&&u!=="none"||m&&m!=="none"})();for(let u of l){let m=d.getPropertyValue(u);m&&f.style.setProperty(u,m)}for(let u of s){let m=d.getPropertyValue(u);if(!m||m==="none")continue;let y=gt(m),g=await Promise.all(y.map(b=>ot(b,o)));g.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&f.style.setProperty(u,g.join(", "))}for(let u of a){let m=d.getPropertyValue(u);!m||m==="initial"||f.style.setProperty(u,m)}if(p)for(let u of c){let m=d.getPropertyValue(u);!m||m==="initial"||f.style.setProperty(u,m)}let h=Array.from(i.children),w=Array.from(f.children).filter(u=>!(u.dataset&&u.dataset.snapdomPseudo));for(let u=0;u<Math.min(h.length,w.length);u++)r.push([h[u],w[u]])}}function Ve(t){if(!t)return()=>{};let e=Eo(t);if(e<=0)return()=>{};if(!Io(t))return()=>{};let n=getComputedStyle(t),o=Math.round(Fo(n)*e+$o(n)),r=t.textContent??"",s=r;if(t.scrollHeight<=o+.5)return()=>{};let a=0,l=r.length,c=-1;for(;a<=l;){let i=a+l>>1;t.textContent=r.slice(0,i)+"\u2026",t.scrollHeight<=o+.5?(c=i,a=i+1):l=i-1}return t.textContent=(c>=0?r.slice(0,c):"")+"\u2026",()=>{t.textContent=s}}function Eo(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let o=parseInt(n,10);return Number.isFinite(o)&&o>0?o:0}function Fo(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function $o(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function Io(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var St=[];function Xe(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function ie(...t){let e=t.flat();for(let n of e){let o=Xe(n);o&&(St.some(r=>r&&r.name&&o.name&&r.name===o.name)||St.push(o))}}function Ye(t){return(t&&Array.isArray(t.plugins)?t.plugins:St)||St}async function H(t,e,n){let o=n,r=Ye(e);for(let s of r){let a=s&&typeof s[t]=="function"?s[t]:null;if(!a)continue;let l=await a(e,o);typeof l<"u"&&(o=l)}return o}async function Ke(t,e,n){let o=[],r=Ye(e);for(let s of r){let a=s&&typeof s[t]=="function"?s[t]:null;if(!a)continue;let l=await a(e,n);typeof l<"u"&&o.push(l)}return o}function Lo(t){let e=[];if(Array.isArray(t))for(let n of t){let o=Xe(n);if(!o||!o.name)continue;let r=e.findIndex(s=>s&&s.name===o.name);r>=0&&e.splice(r,1),e.push(o)}for(let n of St)n&&n.name&&!e.some(o=>o.name===n.name)&&e.push(n);return Object.freeze(e)}function Ge(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Lo(e)),t}function No(t,e){if(!t||!e||!e.style)return;let n=getComputedStyle(t);try{e.style.boxShadow="none"}catch{}try{e.style.textShadow="none"}catch{}try{e.style.outline="none"}catch{}let r=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=r.length?r:"none"}catch{}}function Ro(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),n=[];for(;e.nextNode();)n.push(e.currentNode);for(let o of n)o.remove()}function To(t,e={}){let{stripFrameworkDirectives:n=!0}=e,o=new Set(["xml","xlink"]),r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;r.nextNode();){let s=r.currentNode;for(let a of Array.from(s.attributes)){let l=a.name;if(l.includes("@")){s.removeAttribute(l);continue}if(l.includes(":")){let c=l.split(":",1)[0];if(!o.has(c)){s.removeAttribute(l);continue}}if(n&&(l.startsWith("x-")||l.startsWith("v-")||l.startsWith(":")||l.startsWith("on:")||l.startsWith("bind:")||l.startsWith("let:")||l.startsWith("class:"))){s.removeAttribute(l);continue}}}}function Po(t,e={}){t&&(To(t,e),Ro(t))}async function le(t,e){if(!t)throw new Error("Element cannot be null or undefined");vt(e.cache);let n=e.fast,o=e.outerTransforms!==!1,r=!!e.outerShadows,s={element:t,options:e,plugins:e.plugins},a,l,c,i="",f="",d,p,h=null;await H("beforeSnap",s),await H("beforeClone",s);let w=Ve(s.element);try{({clone:a,classCSS:l,styleCache:c}=await je(s.element,s.options)),!o&&a&&(h=Do(s.element,a)),!r&&a&&No(s.element,a)}finally{w()}if(s={clone:a,classCSS:l,styleCache:c,...s},await H("afterClone",s),Po(s.clone),s.options?.excludeMode==="remove")try{Oo(s.element,s.clone,s.styleCache)}catch(g){console.warn("[snapdom] shrink pass failed:",g)}try{await Ae(s.clone,s.element)}catch{}await new Promise(g=>{V(async()=>{await ze(s.clone,s.options),g()},{fast:n})}),await new Promise(g=>{V(async()=>{await Ut(s.element,s.clone,s.styleCache,s.options),g()},{fast:n})}),e.embedFonts&&await new Promise(g=>{V(async()=>{let b=Tt(s.element),S=Pt(s.element);if(W()){let k=new Set(Array.from(b).map(C=>String(C).split("__")[0]).filter(Boolean));await _t(k,1)}i=await Rt({required:b,usedCodepoints:S,preCached:!1,exclude:s.options.excludeFonts,useProxy:s.options.useProxy}),g()},{fast:n})});let u=Yt(s.clone).sort(),m=u.join(",");x.baseStyle.has(m)?f=x.baseStyle.get(m):await new Promise(g=>{V(()=>{f=Kt(u),x.baseStyle.set(m,f),g()},{fast:n})}),s={fontsCSS:i,baseCSS:f,...s},await H("beforeRender",s),await new Promise(g=>{V(()=>{let b=getComputedStyle(s.element),S=s.element.getBoundingClientRect(),k=Math.max(1,A(s.element.offsetWidth||parseFloat(b.width)||S.width||1)),C=Math.max(1,A(s.element.offsetHeight||parseFloat(b.height)||S.height||1));if(s.options?.excludeMode==="remove"){let D=Zo(s.element,s.options);Number.isFinite(D)&&D>0&&(C=Math.max(1,Math.min(C,A(D+1))))}let M=(D,z=NaN)=>{let lt=typeof D=="string"?parseFloat(D):D;return Number.isFinite(lt)?lt:z},L=M(s.options.width),$=M(s.options.height),N=k,E=C,U=Number.isFinite(L),O=Number.isFinite($),v=C>0?k/C:1;U&&O?(N=Math.max(1,A(L)),E=Math.max(1,A($))):U?(N=Math.max(1,A(L)),E=Math.max(1,A(N/(v||1)))):O?(E=Math.max(1,A($)),N=Math.max(1,A(E*(v||1)))):(N=k,E=C);let Y=0,K=0,at=k,tt=C;if(!o&&h&&Number.isFinite(h.a)){let D={a:h.a,b:h.b||0,c:h.c||0,d:h.d||1,e:0,f:0},z=Qe(k,C,D,0,0);Y=A(z.minX),K=A(z.minY),at=A(z.maxX),tt=A(z.maxY)}else if(o&&zo(s.element)){let z=b.transform&&b.transform!=="none"?b.transform:"",lt=Vo(s.element),qt=Go({baseTransform:z,rotate:lt.rotate||"0deg",scale:lt.scale,translate:lt.translate}),{ox:un,oy:fn}=Yo(b,k,C),dn=qt.is2D?qt:new DOMMatrix(qt.toString()),Mt=Qe(k,C,dn,un,fn);Y=A(Mt.minX),K=A(Mt.minY),at=A(Mt.maxX),tt=A(Mt.maxY)}let I=Ho(b),R=qo(b),P=jo(b),_=Bo(b),j=r?{top:A(I.top+R.top+P.top+_.bleed.top),right:A(I.right+R.right+P.right+_.bleed.right),bottom:A(I.bottom+R.bottom+P.bottom+_.bleed.bottom),left:A(I.left+R.left+P.left+_.bleed.left)}:{top:0,right:0,bottom:0,left:0};Y=A(Y-j.left),K=A(K-j.top),at=A(at+j.right),tt=A(tt+j.bottom);let et=Math.max(1,A(at-Y)),kt=Math.max(1,A(tt-K)),it=U||O?A(N/k):1,Ot=O||U?A(E/C):1,Bt=Math.max(1,A(et*it)),At=Math.max(1,A(kt*Ot)),ht="http://www.w3.org/2000/svg",on=W()?1:0,G=A(on+(o?0:1)),Q=document.createElementNS(ht,"foreignObject"),rn=A(Y),sn=A(K);Q.setAttribute("x",String(A(-(rn-G)))),Q.setAttribute("y",String(A(-(sn-G)))),Q.setAttribute("width",String(A(k+G*2))),Q.setAttribute("height",String(A(C+G*2))),Q.style.overflow="visible";let fe=document.createElement("style");fe.textContent=s.baseCSS+s.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+s.classCSS,Q.appendChild(fe);let ct=document.createElement("div");ct.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),ct.style.width=`${A(k)}px`,ct.style.height=`${A(C)}px`,ct.style.overflow="visible",s.clone.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),ct.appendChild(s.clone),Q.appendChild(ct);let an=new XMLSerializer().serializeToString(Q),Dt=A(et+G*2),Ht=A(kt+G*2),de=U||O;e.meta={w0:k,h0:C,vbW:Dt,vbH:Ht,targetW:N,targetH:E};let cn=W()&&de?Dt:A(Bt+G*2),ln=W()&&de?Ht:A(At+G*2);p=`<svg xmlns="${ht}" width="${cn}" height="${ln}" viewBox="0 0 ${Dt} ${Ht}">`+an+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,s={svgString:p,dataURL:d,...s},g()},{fast:n})}),await H("afterRender",s);let y=document.getElementById("snapdom-sandbox");return y&&y.style.position==="absolute"&&y.remove(),s.dataURL}function _o(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function Wo(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Uo(t,e){if(!(t instanceof Element)||_o(t)||Wo(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let o=e.display||"";return!(o.includes("flex")||o.includes("grid")||o.startsWith("table")||e.transform&&e.transform!=="none")}function Oo(t,e,n=new Map){function o(r,s){if(!(r instanceof Element)||!(s instanceof Element))return;let a=r.childElementCount>s.childElementCount,l=n.get(r)||getComputedStyle(r);if(n.has(r)||n.set(r,l),a&&Uo(r,l)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let f=l.overflowY||l.overflowBlock||"visible",d=l.overflowX||l.overflowInline||"visible";(f!=="visible"||d!=="visible")&&(s.style.overflow="visible")}let c=Array.from(r.children),i=Array.from(s.children);for(let f=0;f<Math.min(c.length,i.length);f++)o(c[f],i[f])}o(t,e)}var A=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t;function Bo(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],o=0,r=0,s=0,a=0,l=!1;for(let c of n){l=!0;let i=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(u=>parseFloat(u))||[],[f=0,d=0,p=0]=i,h=Math.abs(f)+p,w=Math.abs(d)+p;r=Math.max(r,h+Math.max(f,0)),a=Math.max(a,h+Math.max(-f,0)),s=Math.max(s,w+Math.max(d,0)),o=Math.max(o,w+Math.max(-d,0))}return{bleed:{top:A(o),right:A(r),bottom:A(s),left:A(a)},has:l}}function Do(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let o=n.transform||"none";if(!o||o==="none")try{let s=Je(t);if(s.a===1&&s.b===0&&s.c===0&&s.d===1)return e.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}let r=o.match(/^matrix\(\s*([^)]+)\)$/i);if(r){let s=r[1].split(",").map(a=>parseFloat(a.trim()));if(s.length===6&&s.every(Number.isFinite)){let[a,l,c,i]=s,f=Math.sqrt(a*a+l*l)||0,d=0,p=0,h=0,w=0,u=0,m=0;f>0&&(d=a/f,p=l/f,h=d*c+p*i,w=c-d*h,u=i-p*h,m=Math.sqrt(w*w+u*u)||0,m>0?h=h/m:h=0);let y=f,g=0,b=h*m,S=m;try{e.style.transform=`matrix(${y}, ${g}, ${b}, ${S}, 0, 0)`}catch{}return{a:y,b:g,c:b,d:S}}}try{let s=String(o).trim();return e.style.transform=s+" translate(0px, 0px) rotate(0deg)",null}catch{return null}}function Ho(t){let e=t.boxShadow||"";if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let n=e.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(l=>l.trim()),o=0,r=0,s=0,a=0;for(let l of n){let c=l.match(/-?\d+(\.\d+)?px/g)?.map(u=>parseFloat(u))||[];if(c.length<2)continue;let[i,f,d=0,p=0]=c,h=Math.abs(i)+d+p,w=Math.abs(f)+d+p;r=Math.max(r,h+Math.max(i,0)),a=Math.max(a,h+Math.max(-i,0)),s=Math.max(s,w+Math.max(f,0)),o=Math.max(o,w+Math.max(-f,0))}return{top:Math.ceil(o),right:Math.ceil(r),bottom:Math.ceil(s),left:Math.ceil(a)}}function qo(t){let e=(t.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=e?Math.ceil(parseFloat(e[1])||0):0;return{top:n,right:n,bottom:n,left:n}}function jo(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0);return{top:e,right:e,bottom:e,left:e}}function Qe(t,e,n,o,r){let s=n.a,a=n.b,l=n.c,c=n.d,i=n.e||0,f=n.f||0;function d(y,g){let b=y-o,S=g-r,k=s*b+l*S,C=a*b+c*S;return k+=o+i,C+=r+f,[k,C]}let p=[d(0,0),d(t,0),d(0,e),d(t,e)],h=1/0,w=1/0,u=-1/0,m=-1/0;for(let[y,g]of p)y<h&&(h=y),g<w&&(w=g),y>u&&(u=y),g>m&&(m=g);return{minX:h,minY:w,maxX:u,maxY:m,width:u-h,height:m-w}}function zo(t){return Xo(t)}function Je(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}function Vo(t){let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let r=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},s=r("rotate");if(s)if(s.angle){let c=s.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else s.unit?e.rotate=s.unit==="rad"?s.value*180/Math.PI+"deg":s.value+s.unit:e.rotate=String(s);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let a=r("scale");if(a){let c="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,i="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:c;e.scale=`${c} ${i}`}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let l=r("translate");if(l){let c="x"in l&&"value"in l.x?l.x.value:Array.isArray(l)?l[0]?.value:0,i="y"in l&&"value"in l.y?l.y.value:Array.isArray(l)?l[1]?.value:0,f="x"in l&&l.x?.unit?l.x.unit:"px",d="y"in l&&l.y?.unit?l.y.unit:"px";e.translate=`${c}${f} ${i}${d}`}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return e}let o=getComputedStyle(t);return e.rotate=o.rotate&&o.rotate!=="none"?o.rotate:"0deg",e.scale=o.scale&&o.scale!=="none"?o.scale:null,e.translate=o.translate&&o.translate!=="none"?o.translate:null,e}function Xo(t){let e=getComputedStyle(t),n=e.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=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",s=e.scale&&e.scale!=="none"&&e.scale!=="1",a=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(r||s||a)}function Yo(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[r,s]=[o[0]||"0",o[1]||"0"],a=(l,c)=>{let i=l.toLowerCase();return i==="left"||i==="top"?0:i==="center"?c/2:i==="right"||i==="bottom"?c:i.endsWith("px")?parseFloat(i)||0:i.endsWith("%")?(parseFloat(i)||0)*c/100:/^-?\d+(\.\d+)?$/.test(i)&&parseFloat(i)||0};return{ox:a(r,e),oy:a(s,n)}}var ce=null;function Ko(){if(ce)return ce;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),ce=t,t}function Go(t){let e=Ko(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform),t.rotate&&(n.style.rotate=t.rotate),t.scale&&(n.style.scale=t.scale),t.translate&&(n.style.translate=t.translate),e.appendChild(n);let o=Je(n);return e.removeChild(n),o}function Qo(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed"||e.position==="sticky"||(e.cssFloat||e.float||"none")!=="none"||e.transform&&e.transform!=="none")}function Jo(t,e){if(!(t instanceof Element))return!1;if(t.getAttribute("data-capture")==="exclude"&&e?.excludeMode==="remove")return!0;if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch{}return!1}function Zo(t,e){let n=getComputedStyle(t),o=t.getBoundingClientRect(),r=1/0,s=-1/0,a=!1,l=Array.from(t.children);for(let h of l){if(Jo(h,e)||!Qo(h))continue;let w=h.getBoundingClientRect(),u=w.top-o.top,m=w.bottom-o.top;m<=u||(u<r&&(r=u),m>s&&(s=m),a=!0)}let c=a?Math.max(0,s-r):0,i=parseFloat(n.borderTopWidth)||0,f=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,p=parseFloat(n.paddingBottom)||0;return i+f+d+p+c}function tr(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function Ze(t={}){let e=t.format??"png";e==="jpg"&&(e="jpeg");let n=tr(t.cache);return{debug:t.debug??!1,fast:t.fast??!0,scale:t.scale??1,exclude:t.exclude??[],excludeMode:t.excludeMode??"hide",filter:t.filter??null,filterMode:t.filterMode??"hide",placeholders:t.placeholders!==!1,embedFonts:t.embedFonts??!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fallbackURL:t.fallbackURL??void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:e,type:t.type??"svg",quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(e)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1}}function er(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function nr(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function or(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function rr(t){let e=[],n="",o=0;for(let r=0;r<t.length;r++){let s=t[r];s==="("&&o++,s===")"&&(o=Math.max(0,o-1)),s===";"&&o===0?(e.push(n),n=""):n+=s}return n.trim()&&e.push(n),e.map(r=>r.trim()).filter(Boolean)}function sr(t){let e=[],n="",o=0;for(let s=0;s<t.length;s++){let a=t[s];a==="("&&o++,a===")"&&(o=Math.max(0,o-1)),a===","&&o===0?(e.push(n.trim()),n=""):n+=a}n.trim()&&e.push(n.trim());let r=[];for(let s of e){if(/\binset\b/i.test(s))continue;let a=s.match(/-?\d+(?:\.\d+)?px/gi)||[],[l="0px",c="0px",i="0px"]=a,f=s.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!f&&f!==",";r.push(`drop-shadow(${l} ${c} ${i}${d?` ${f}`:""})`)}return r.join(" ")}function tn(t){let e=rr(t),n=null,o=null,r=null,s=[];for(let l of e){let c=l.indexOf(":");if(c<0)continue;let i=l.slice(0,c).trim().toLowerCase(),f=l.slice(c+1).trim();i==="box-shadow"?r=f:i==="filter"?n=f:i==="-webkit-filter"?o=f:s.push([i,f])}if(r){let l=sr(r);l&&(n=n?`${n} ${l}`:l,o=o?`${o} ${l}`:l)}let a=[...s];return n&&a.push(["filter",n]),o&&a.push(["-webkit-filter",o]),a.map(([l,c])=>`${l}:${c}`).join(";")}function ar(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${tn(o)}}`)}function ir(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,ar(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${tn(o)}${n}`),t}function cr(t){if(!W()||!er(t))return t;try{let e=nr(t),n=ir(e);return or(n)}catch{return t}}async function X(t,e){let{width:n,height:o,scale:r=1,dpr:s=1,meta:a={},backgroundColor:l}=e;t=cr(t);let c=new Image;c.loading="eager",c.decoding="sync",c.crossOrigin="anonymous",c.src=t,await c.decode();let i=c.naturalWidth,f=c.naturalHeight,d=Number.isFinite(a.w0)?a.w0:i,p=Number.isFinite(a.h0)?a.h0:f,h,w,u=Number.isFinite(n),m=Number.isFinite(o);if(u&&m)h=Math.max(1,n),w=Math.max(1,o);else if(u){let b=n/Math.max(1,d);h=n,w=p*b}else if(m){let b=o/Math.max(1,p);w=o,h=d*b}else h=i,w=f;h=h*r,w=w*r;let y=document.createElement("canvas");y.width=h*s,y.height=w*s,y.style.width=`${h}px`,y.style.height=`${w}px`;let g=y.getContext("2d");return s!==1&&g.scale(s,s),l&&(g.save(),g.fillStyle=l,g.fillRect(0,0,h,w),g.restore()),g.drawImage(c,0,0,h,w),y}async function q(t,e){let n=await X(t,e),o=new Image;return o.src=n.toDataURL(`image/${e.format}`,e.quality),await o.decode(),o.style.width=`${n.width/e.dpr}px`,o.style.height=`${n.height/e.dpr}px`,o}async function pt(t,e){let{scale:n=1,width:o,height:r,meta:s={}}=e,a=Number.isFinite(o),l=Number.isFinite(r),c=Number.isFinite(n)&&n!==1||a||l;if(W()&&c)return await q(t,{...e,format:"png",quality:1,meta:s});let i=new Image;if(i.decoding="sync",i.loading="eager",i.src=t,await i.decode(),a&&l)i.style.width=`${o}px`,i.style.height=`${r}px`;else if(a){let f=Number.isFinite(s.w0)?s.w0:i.naturalWidth,d=Number.isFinite(s.h0)?s.h0:i.naturalHeight,p=o/Math.max(1,f);i.style.width=`${o}px`,i.style.height=`${Math.round(d*p)}px`}else if(l){let f=Number.isFinite(s.w0)?s.w0:i.naturalWidth,d=Number.isFinite(s.h0)?s.h0:i.naturalHeight,p=r/Math.max(1,d);i.style.height=`${r}px`,i.style.width=`${Math.round(f*p)}px`}else{let f=Math.round(i.naturalWidth*n),d=Math.round(i.naturalHeight*n);if(i.style.width=`${f}px`,i.style.height=`${d}px`,typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let h=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${f}"`).replace(/height="[^"]*"/,`height="${d}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h)}`,i.src=t}catch{}}return i}async function Ct(t,e){let n=e.type;if(n==="svg"){let r=decodeURIComponent(t.split(",")[1]);return new Blob([r],{type:"image/svg+xml"})}let o=await X(t,e);return new Promise(r=>o.toBlob(s=>r(s),`image/${n}`,e.quality))}async function en(t,e){if(e.dpr=1,e.format==="svg"){let r=await Ct(t,{...e,type:"svg"}),s=URL.createObjectURL(r),a=document.createElement("a");a.href=s,a.download=e.filename,a.click(),URL.revokeObjectURL(s);return}let n=await X(t,e),o=document.createElement("a");o.href=n.toDataURL(`image/${e.format}`,e.quality),o.download=e.filename,o.click()}F.plugins=(...t)=>(ie(...t),F);var nn=Symbol("snapdom.internal"),Z=Symbol("snapdom.internal.silent"),ue=!1;async function F(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=Ze(e);if(Ge(n,e&&e.plugins),W()&&(n.embedFonts===!0||ur(t)))for(let o=0;o<3;o++)try{await lr(t,e),console.log("safariWarmup:",o),ue=!1}catch{}return n.iconFonts&&n.iconFonts.length>0&&ke(n.iconFonts),n.snap||(n.snap={toPng:(o,r)=>F.toPng(o,r),toSvg:(o,r)=>F.toSvg(o,r)}),F.capture(t,n,nn)}F.plugins=(...t)=>(ie(...t),F);F.capture=async(t,e,n)=>{if(n!==nn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let o=await le(t,e),r={img:async(u,m)=>pt(o,{...u,...m||{}}),svg:async(u,m)=>pt(o,{...u,...m||{}}),canvas:async(u,m)=>X(o,{...u,...m||{}}),blob:async(u,m)=>Ct(o,{...u,...m||{}}),png:async(u,m)=>q(o,{...u,...m||{},format:"png"}),jpeg:async(u,m)=>q(o,{...u,...m||{},format:"jpeg"}),webp:async(u,m)=>q(o,{...u,...m||{},format:"webp"}),download:async(u,m)=>en(o,{...u,...m||{}})},a={...e,export:{url:o},exports:{svg:u=>pt(o,{...e,...u||{},[Z]:!0}),canvas:u=>X(o,{...e,...u||{},[Z]:!0}),png:u=>q(o,{...e,...u||{},format:"png",[Z]:!0}),jpeg:u=>q(o,{...e,...u||{},format:"jpeg",[Z]:!0}),jpg:u=>q(o,{...e,...u||{},format:"jpeg",[Z]:!0}),webp:u=>q(o,{...e,...u||{},format:"webp",[Z]:!0}),blob:u=>Ct(o,{...e,...u||{},[Z]:!0}),img:u=>pt(o,{...e,...u||{},[Z]:!0})}},l=await Ke("defineExports",a),c=Object.assign({},...l.filter(u=>u&&typeof u=="object")),i={...r,...c};i.jpeg&&!i.jpg&&(i.jpg=(u,m)=>i.jpeg(u,m));function f(u,m){let y={...e,...m||{}};return(u==="jpeg"||u==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,p=Promise.resolve();async function h(u,m){let y=async()=>{let g=i[u];if(!g)throw new Error(`[snapdom] Unknown export type: ${u}`);let b=f(u,m),S={...e,export:{type:u,options:b,url:o}};await H("beforeExport",S);let k=await g(S,b);return await H("afterExport",S,k),d||(d=!0,await H("afterSnap",e)),k};return p=p.then(y)}let w={url:o,toRaw:()=>o,to:(u,m)=>h(u,m),toImg:u=>h("img",u),toSvg:u=>h("svg",u),toCanvas:u=>h("canvas",u),toBlob:u=>h("blob",u),toPng:u=>h("png",u),toJpg:u=>h("jpg",u),toWebp:u=>h("webp",u),download:u=>h("download",u)};for(let u of Object.keys(i)){let m="to"+u.charAt(0).toUpperCase()+u.slice(1);w[m]||(w[m]=y=>h(u,y))}return w};F.toRaw=(t,e)=>F(t,e).then(n=>n.toRaw());F.toImg=(t,e)=>F(t,e).then(n=>n.toImg());F.toSvg=(t,e)=>F(t,e).then(n=>n.toSvg());F.toCanvas=(t,e)=>F(t,e).then(n=>n.toCanvas());F.toBlob=(t,e)=>F(t,e).then(n=>n.toBlob());F.toPng=(t,e)=>F(t,{...e,format:"png"}).then(n=>n.toPng());F.toJpg=(t,e)=>F(t,{...e,format:"jpeg"}).then(n=>n.toJpg());F.toWebp=(t,e)=>F(t,{...e,format:"webp"}).then(n=>n.toWebp());F.download=(t,e)=>F(t,e).then(n=>n.download());async function lr(t,e){if(ue)return;let n={...e,fast:!0,embedFonts:!0,scale:.2},o;try{o=await le(t,n)}catch{}await new Promise(r=>requestAnimationFrame(()=>requestAnimationFrame(r))),o&&await new Promise(r=>{let s=new Image;try{s.decoding="sync",s.loading="eager"}catch{}s.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",s.src=o,document.body.appendChild(s),(async()=>{try{typeof s.decode=="function"&&await s.decode()}catch{}let a=performance.now();for(;!(s.complete&&s.naturalWidth>0)&&performance.now()-a<900;)await new Promise(l=>setTimeout(l,50));await new Promise(l=>requestAnimationFrame(l));try{s.remove()}catch{}r()})()}),t.querySelectorAll("canvas").forEach(r=>{try{let s=r.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch{}}),ue=!0}function ur(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,o=getComputedStyle(n),r=o.backgroundImage&&o.backgroundImage!=="none",s=o.maskImage&&o.maskImage!=="none"||o.webkitMaskImage&&o.webkitMaskImage!=="none";if(r||s||n.tagName==="CANVAS")return!0}return!1}async function fr(t=document,e={}){let{embedFonts:n=!0,useProxy:o=""}=e,r=e.cache??e.cacheOpt??"full";vt(r);try{await document.fonts?.ready}catch{}try{Vt()}catch{}x.session=x.session||{},x.session.styleCache||(x.session.styleCache=new WeakMap),x.image=x.image||new Map,x.background=x.background||new Map;try{await Ut(t,void 0,x.session.styleCache,{useProxy:o})}catch{}let s=[],a=[];try{if(t&&t.nodeType===1){let c=t.querySelectorAll?Array.from(t.querySelectorAll("*")):[];a=[t,...c],s=[],t.tagName==="IMG"&&t.getAttribute("src")&&s.push(t),s.push(...Array.from(t.querySelectorAll?.("img[src]")||[]))}else t?.querySelectorAll&&(s=Array.from(t.querySelectorAll("img[src]")),a=Array.from(t.querySelectorAll("*")))}catch{}let l=[];for(let c of s){let i=c?.currentSrc||c?.src;if(i&&!x.image.has(i)){let f=Promise.resolve().then(async()=>{let d=await T(i,{as:"dataURL",useProxy:o});d?.ok&&typeof d.data=="string"&&x.image.set(i,d.data)}).catch(()=>{});l.push(f)}}for(let c of a){let i="";try{i=c?.style?.backgroundImage||"",(!i||i==="none")&&(i=rt(c).backgroundImage)}catch{}if(i&&i!=="none"){let f=i.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let d of f){let p=Promise.resolve().then(()=>ot(d,{...e,useProxy:o})).catch(()=>{});l.push(p)}}}if(n)try{let c=Tt(t),i=Pt(t);if(typeof W=="function"?W():!!W){let d=new Set(Array.from(c).map(p=>String(p).split("__")[0]).filter(Boolean));await _t(d,3)}await Rt({required:c,usedCodepoints:i,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:e.useProxy??o})}catch{}await Promise.allSettled(l)}export{fr as preCache,F as snapdom};
1
+ var x={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function Ft(t="soft"){switch(x.session.__counterEpoch=(x.session.__counterEpoch||0)+1,t){case"auto":{x.session.styleMap=new Map,x.session.nodeMap=new Map;return}case"soft":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap,x.computedStyle=new WeakMap,x.baseStyle=new Map,x.defaultStyle=new Map,x.image=new Map,x.background=new Map,x.resource=new Map,x.font=new Set;return}default:{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}}}function ot(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Yt(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let s=o.split(",").map(r=>r.trim());return s.length!==6?`matrix(${o})`:(s[4]="0",s[5]="0",`matrix(${s.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let s=o.split(",").map(r=>r.trim());return s.length!==16?`matrix3d(${o})`:(s[12]="0",s[13]="0",`matrix3d(${s.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function G(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function zn(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,s=0;function r(i,l,c){if(s>=n)return;let a=Date.now();(o.get(l)||0)>a||(o.set(l,a+e),s++,i==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(i,l){r("warn",i,l)},errorOnce(i,l){r("error",i,l)},reset(){o.clear(),s=0}}}var be=zn("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Kt=new Map,$t=new Map;function jn(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Vn(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=e.includes("{url}")?e.split("{url}")[0]:e,s=new URL(o||".",n),r=new URL(t,n);if(r.origin===s.origin)return!0;let i=r.searchParams;if(i&&(i.has("url")||i.has("target")))return!0}catch{}return!1}function Xn(t,e){if(!e||jn(t)||Vn(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location<"u"?o.origin!==location.origin:!0}catch{return!!e}}function Yn(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",G(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${G(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function we(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"")),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function Kn(t,e){return[e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,t].join("|")}async function T(t,e={}){let n=e.as??"blob",o=e.timeout??3e3,s=e.useProxy||"",r=e.errorTTL??8e3,i=e.headers||{},l=!!e.silent;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,m="",b=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(m)?atob(b):decodeURIComponent(b),S=new Uint8Array([...w].map(C=>C.charCodeAt(0))),k=new Blob([S],{type:(m||"").split(";")[0]||""});return{ok:!0,data:k,status:200,url:t,fromCache:!1,mime:k.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let m=await fetch(t);if(!m.ok)return{ok:!1,data:null,status:m.status,url:t,fromCache:!1,reason:"http_error"};let b=await m.blob(),g=b.type||m.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await we(b),status:m.status,url:t,fromCache:!1,mime:g}:n==="text"?{ok:!0,data:await b.text(),status:m.status,url:t,fromCache:!1,mime:g}:{ok:!0,data:b,status:m.status,url:t,fromCache:!1,mime:g}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let c=Kn(t,{as:n,timeout:o,useProxy:s,errorTTL:r}),a=$t.get(c);if(a&&a.until>Date.now())return{...a.result,fromCache:!0};a&&$t.delete(c);let u=Kt.get(c);if(u)return u;let d=Xn(t,s)?Yn(t,s):t,p=e.credentials;if(!p)try{let m=typeof location<"u"&&location.href?location.href:"http://localhost/",b=new URL(t,m);p=typeof location<"u"&&b.origin===location.origin?"include":"omit"}catch{p="omit"}let h=new AbortController,y=setTimeout(()=>h.abort("timeout"),o),f=(async()=>{try{let m=await fetch(d,{signal:h.signal,credentials:p,headers:i});if(!m.ok){let w={ok:!1,data:null,status:m.status,url:d,fromCache:!1,reason:"http_error"};if(r>0&&$t.set(c,{until:Date.now()+r,result:w}),!l){let S=`${m.status} ${m.statusText||""}`.trim();be.warnOnce(`http:${m.status}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,`HTTP error ${S} while fetching ${n} ${t}`)}return e.onError&&e.onError(w),w}if(n==="text")return{ok:!0,data:await m.text(),status:m.status,url:d,fromCache:!1};let b=await m.blob(),g=b.type||m.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await we(b),status:m.status,url:d,fromCache:!1,mime:g}:{ok:!0,data:b,status:m.status,url:d,fromCache:!1,mime:g}}catch(m){let b=m&&typeof m=="object"&&"name"in m&&m.name==="AbortError"?String(m.message||"").includes("timeout")?"timeout":"abort":"network",g={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:b};if(!/^blob:/i.test(t)&&r>0&&$t.set(c,{until:Date.now()+r,result:g}),!l){let w=`${b}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,S=b==="timeout"?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:b==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;be.errorOnce(w,S)}return e.onError&&e.onError(g),g}finally{clearTimeout(y),Kt.delete(c)}})();return Kt.set(c,f),f}async function rt(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=ot(t);if(!o)return t;let s=G(o);if(x.background.has(s)){let r=x.background.get(s);return r?`url("${r}")`:"none"}try{let r=await T(s,{as:"dataURL",useProxy:e.useProxy});return r.ok?(x.background.set(s,r.data),`url("${r.data}")`):(x.background.set(s,null),"none")}catch{return x.background.set(s,null),"none"}}var It=new Set(["meta","script","noscript","title","link","template"]),ft=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Gn=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"];function Gt(){for(let t of Gn){let e=String(t).toLowerCase();It.has(e)||ft.has(e)||Qt(e)}}function Qt(t){if(t=String(t).toLowerCase(),ft.has(t)){let r={};return x.defaultStyle.set(t,r),r}if(x.defaultStyle.has(t))return x.defaultStyle.get(t);let e=document.getElementById("snapdom-sandbox");e||(e=document.createElement("div"),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t);n.style.all="initial",e.appendChild(n);let o=getComputedStyle(n),s={};for(let r of o){if(xe(r))continue;let i=o.getPropertyValue(r);s[r]=i}return e.removeChild(n),x.defaultStyle.set(t,s),s}var Qn=/(?:^|-)(animation|transition)(?:-|$)/i,Jn=/^(--|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Zn=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"]);function xe(t){let e=String(t).toLowerCase();return!!(Zn.has(e)||Jn.test(e)||Qn.test(e))}function dt(t,e){if(e=String(e||"").toLowerCase(),ft.has(e))return"";let n=[],o=Qt(e);for(let[s,r]of Object.entries(t)){if(xe(s))continue;let i=o[s];r&&r!==i&&n.push(`${s}:${r}`)}return n.sort(),n.join(";")}function Jt(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(n=>e.add(n.tagName.toLowerCase())),Array.from(e))}function Zt(t){let e=new Map;for(let o of t){let s=x.defaultStyle.get(o);if(!s)continue;let r=Object.entries(s).map(([i,l])=>`${i}:${l};`).sort().join("");r&&(e.has(r)||e.set(r,[]),e.get(r).push(o))}let n="";for(let[o,s]of e.entries())n+=`${s.join(",")} { ${o} }
2
+ `;return n}function te(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,o=1;for(let s of e)n.set(s,`c${o++}`);return n}function st(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=x.computedStyle.get(t);if(n||(n=new Map,x.computedStyle.set(t,n)),!n.has(e)){let o=window.getComputedStyle(t,e);n.set(e,o)}return n.get(e)}function Lt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function bt(t){let e=[],n=0,o=0;for(let s=0;s<t.length;s++){let r=t[s];r==="("&&n++,r===")"&&n--,r===","&&n===0&&(e.push(t.slice(o,s).trim()),o=s+1)}return e.push(t.slice(o).trim()),e}function V(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function W(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),o=/applewebkit/i.test(t),s=/mobile/i.test(t),r=!/safari/i.test(t),i=o&&s&&r,l=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),a=/ipad|iphone|ipod/.test(e)&&o;return n||i||l||c||a}var Se=new WeakMap,ee=new Map,ne=0;function wt(){ne++}var Ce=!1;function to(t=document.documentElement){if(!Ce){Ce=!0;try{new MutationObserver(()=>wt()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>wt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let e=document.fonts;e&&(e.addEventListener?.("loadingdone",wt),e.ready?.then(()=>wt()).catch(()=>{}))}catch{}}}function eo(t,e={}){let n={},o=t.getPropertyValue("visibility");for(let r=0;r<t.length;r++){let i=t[r],l=t.getPropertyValue(i);(i==="background-image"||i==="content")&&l.includes("url(")&&!l.includes("data:")&&(l="none"),n[i]=l}let s=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let r of s)if(!n[r])try{let i=t.getPropertyValue(r);i&&(n[r]=i)}catch{}if(e.embedFonts){let r=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let i of r)if(!n[i])try{let l=t.getPropertyValue(i);l&&(n[i]=l)}catch{}}return o==="hidden"&&(n.opacity="0"),n}var ke=new WeakMap;function no(t){let e=ke.get(t);return e||(e=Object.entries(t).sort((o,s)=>o[0]<s[0]?-1:o[0]>s[0]?1:0).map(([o,s])=>`${o}:${s}`).join(";"),ke.set(t,e),e)}function oo(t,e=null,n={}){let o=Se.get(t);if(o&&o.epoch===ne)return o.snapshot;let s=e||getComputedStyle(t),r=eo(s,n);return lo(t,s,r),Se.set(t,{epoch:ne,snapshot:r}),r}function ro(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:ee,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:e||{}}:{session:x.session,persist:{snapshotKeyCache:ee,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:t||e||{}}}async function Q(t,e,n,o){if(t.tagName==="STYLE")return;let s=ro(n,o),r=s.options&&s.options.cache||"auto";if(r!=="disabled"&&to(document.documentElement),r==="disabled"&&!s.session.__bumpedForDisabled&&(wt(),ee.clear(),s.session.__bumpedForDisabled=!0),ft.has(t.tagName?.toLowerCase())){let p=t.getAttribute?.("style");p&&e.setAttribute("style",p)}let{session:i,persist:l}=s;i.styleCache.has(t)||i.styleCache.set(t,getComputedStyle(t));let c=i.styleCache.get(t),a=oo(t,c,s.options),u=no(a),d=l.snapshotKeyCache.get(u);if(!d){let p=t.tagName?.toLowerCase()||"div";d=dt(a,p),l.snapshotKeyCache.set(u,d)}i.styleMap.set(e,d)}function so(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function io(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}function ao(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function co(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,o=t.lastElementChild;if(n&&n.tagName==="BR"||o&&o.tagName==="BR")return!0;let s=t.scrollHeight;if(s===0)return!1;let r=parseFloat(e.paddingTop)||0,i=parseFloat(e.paddingBottom)||0;return s>r+i}function lo(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let o=e.display||"";if(o.includes("flex")||o.includes("grid")||so(t))return;let s=e.position;s==="absolute"||s==="fixed"||s==="sticky"||e.transform==="none"&&(io(e)||ao(t)||co(t,e)&&(delete n.height,delete n["block-size"]))}var Me=["fill","stroke","color","background-color","stop-color"],Ae=new Map;function uo(t,e){let n=e+"::"+t.toLowerCase(),o=Ae.get(n);if(o)return o;let s=document,r=e==="http://www.w3.org/2000/svg"?s.createElementNS(e,t):s.createElement(t),i=s.createElement("div");i.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",i.appendChild(r),s.documentElement.appendChild(i);let l=getComputedStyle(r),c={};for(let a of Me)c[a]=l.getPropertyValue(a)||"";return i.remove(),Ae.set(n,c),c}function ve(t,e){if(!(t instanceof Element)||!(e instanceof Element))return;let n=t.getAttribute?.("style"),o=!!(n&&n.includes("var("));if(!o&&t.attributes?.length){let r=t.attributes;for(let i=0;i<r.length;i++){let l=r[i];if(l&&typeof l.value=="string"&&l.value.includes("var(")){o=!0;break}}}let s=null;if(o)try{s=getComputedStyle(t)}catch{}if(o){let r=t.style;if(r&&r.length)for(let i=0;i<r.length;i++){let l=r[i],c=r.getPropertyValue(l);if(!c||!c.includes("var("))continue;let a=s&&s.getPropertyValue(l);if(a)try{e.style.setProperty(l,a.trim(),r.getPropertyPriority(l))}catch{}}}if(o&&t.attributes?.length){let r=t.attributes;for(let i=0;i<r.length;i++){let l=r[i];if(!l||typeof l.value!="string"||!l.value.includes("var("))continue;let c=l.name,a=s&&s.getPropertyValue(c);if(a)try{e.style.setProperty(c,a.trim())}catch{}}}if(!o){if(!s)try{s=getComputedStyle(t)}catch{s=null}if(!s)return;let r=t.namespaceURI||"html",i=uo(t.tagName,r);for(let l of Me){let c=s.getPropertyValue(l)||"",a=i[l]||"";if(c&&c!==a)try{e.style.setProperty(l,c.trim())}catch{}}}}function Nt(t,e,n){return Promise.all(t.map(o=>new Promise(s=>{function r(){V(i=>{(i&&typeof i.timeRemaining=="function"?i.timeRemaining()>0:!0)?e(o,s):r()},{fast:n})}r()})))}function fo(t){return t=t.trim(),!t||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function mo(t,e,n=!0){return t.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let s=n?fo(o):o;return`:where(${e} ${s})`}).join(", ")}function Fe(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${e}:is(${o.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${e} ${o.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,s,r)=>{let i=mo(r,e,!0);return`${o}${s}${i}{`}),t):""}function $e(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Ie(t){let e="";try{t.querySelectorAll("style").forEach(o=>{e+=(o.textContent||"")+`
3
+ `});let n=t.adoptedStyleSheets||[];for(let o of n)try{if(o&&o.cssRules)for(let s of o.cssRules)e+=s.cssText+`
4
+ `}catch{}}catch{}return e}function Le(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function Re(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function Ne(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function po(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch{}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch{}return""}function Te(t,e,n){let o=[];for(let s of e){let r=po(t,s);r&&o.push(`${s}: ${r};`)}return o.length?`${n}{${o.join("")}}
5
+ `:""}function Pe(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}async function ho(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},o=n(),s=0;for(;s<e&&(!o||!o.body&&!o.documentElement);)await new Promise(r=>setTimeout(r,0)),o=n(),s++;return o&&(o.body||o.documentElement)?o:null}function go(t){let e=t.getBoundingClientRect(),n=0,o=0,s=0,r=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,o=parseFloat(c.borderRightWidth)||0,s=parseFloat(c.borderTopWidth)||0,r=parseFloat(c.borderBottomWidth)||0}catch{}let i=Math.max(0,Math.round(e.width-(n+o))),l=Math.max(0,Math.round(e.height-(s+r)));return{contentWidth:i,contentHeight:l,rect:e}}function yo(t,e,n){let o=t.createElement("style");return o.setAttribute("data-sd-iframe-pin",""),o.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(o),()=>{try{o.remove()}catch{}}}async function _e(t,e,n){let o=await ho(t,3);if(!o)throw new Error("iframe document not accessible/ready");let{contentWidth:s,contentHeight:r,rect:i}=go(t),l=n?.snap;if(!l||typeof l.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let c={...n,scale:1},a=yo(o,s,r),u;try{u=await l.toPng(o.documentElement,c)}finally{a()}u.style.display="block",u.style.width=`${s}px`,u.style.height=`${r}px`;let d=document.createElement("div");return e.nodeMap.set(d,t),Q(t,d,e,n),d.style.overflow="hidden",d.style.display="block",d.style.width||(d.style.width=`${Math.round(i.width)}px`),d.style.height||(d.style.height=`${Math.round(i.height)}px`),d.appendChild(u),d}var xt=new Map;async function St(t){if(x.resource?.has(t))return x.resource.get(t);if(xt.has(t))return xt.get(t);let e=(async()=>{let n=await T(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return x.resource?.set(t,n.data),n.data})();xt.set(t,e);try{let n=await e;return xt.set(t,n),n}catch(n){throw xt.delete(t),n}}var bo=/\bblob:[^)"'\s]+/g;async function Ee(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(bo)||[]));if(e.length===0)return t;let n=t;for(let o of e)try{let s=await St(o);n=n.split(o).join(s)}catch{}return n}function Rt(t){return typeof t=="string"&&t.startsWith("blob:")}function wo(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function xo(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}async function We(t){if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let i of e)try{let c=i.getAttribute("src")||i.currentSrc||"";if(Rt(c)){let u=await St(c);i.setAttribute("src",u)}let a=i.getAttribute("srcset");if(a&&a.includes("blob:")){let u=wo(a),d=!1;for(let p of u)if(Rt(p.url))try{p.url=await St(p.url),d=!0}catch{}d&&i.setAttribute("srcset",xo(u))}}catch{}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let i of n)try{let l="http://www.w3.org/1999/xlink",c=i.getAttribute("href")||i.getAttributeNS?.(l,"href");if(Rt(c)){let a=await St(c);i.setAttribute("href",a),i.removeAttributeNS?.(l,"href")}}catch{}let o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let i of o)try{let l=i.getAttribute("style");if(l&&l.includes("blob:")){let c=await Ee(l);i.setAttribute("style",c)}}catch{}let s=t.querySelectorAll?t.querySelectorAll("style"):[];for(let i of s)try{let l=i.textContent||"";l.includes("blob:")&&(i.textContent=await Ee(l))}catch{}let r=["poster"];for(let i of r){let l=t.querySelectorAll?t.querySelectorAll(`[${i}^='blob:']`):[];for(let c of l)try{let a=c.getAttribute(i);Rt(a)&&c.setAttribute(i,await St(a))}catch{}}}async function Ct(t,e,n){if(!t)throw new Error("Invalid node");let o=new Set,s=null,r=null;if(t.nodeType===Node.ELEMENT_NODE){let a=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||It.has(a))return null}if(t.nodeType===Node.TEXT_NODE||t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let a=document.createElement("div"),u=t.getBoundingClientRect();return a.style.cssText=`display:inline-block;width:${u.width}px;height:${u.height}px;visibility:hidden;`,a}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let a of n.exclude)try{if(t.matches?.(a)){if(n.excludeMode==="hide"){let u=document.createElement("div"),d=t.getBoundingClientRect();return u.style.cssText=`display:inline-block;width:${d.width}px;height:${d.height}px;visibility:hidden;`,u}else if(n.excludeMode==="remove")return null}}catch(u){console.warn(`Invalid selector in exclude option: ${a}`,u)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let a=document.createElement("div"),u=t.getBoundingClientRect();return a.style.cssText=`display:inline-block;width:${u.width}px;height:${u.height}px;visibility:hidden;`,a}else if(n.filterMode==="remove")return null}}catch(a){console.warn("Error in filter function:",a)}if(t.tagName==="IFRAME"){let a=!1;try{a=!!(t.contentDocument||t.contentWindow?.document)}catch{a=!1}if(a)try{return await _e(t,e,n)}catch(u){console.warn("[SnapDOM] iframe rasterization failed, fallback:",u)}if(n.placeholders){let u=document.createElement("div");return u.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}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;`,Q(t,u,e,n),u}else{let u=t.getBoundingClientRect(),d=document.createElement("div");return d.style.cssText=`display:inline-block;width:${u.width}px;height:${u.height}px;visibility:hidden;`,Q(t,d,e,n),d}}if(t.getAttribute("data-capture")==="placeholder"){let a=t.cloneNode(!1);e.nodeMap.set(a,t),Q(t,a,e,n);let u=document.createElement("div");return u.textContent=t.getAttribute("data-placeholder-text")||"",u.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",a.appendChild(u),a}if(t.tagName==="CANVAS"){let a="";try{let d=t.getContext("2d",{willReadFrequently:!0});try{d&&d.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),a=t.toDataURL("image/png"),!a||a==="data:,"){try{d&&d.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),a=t.toDataURL("image/png"),!a||a==="data:,"){let p=document.createElement("canvas");p.width=t.width,p.height=t.height;let h=p.getContext("2d");h&&(h.drawImage(t,0,0),a=p.toDataURL("image/png"))}}}catch{}let u=document.createElement("img");try{u.decoding="sync",u.loading="eager"}catch{}a&&(u.src=a),u.width=t.width,u.height=t.height;try{let d=getComputedStyle(t);d.width&&(u.style.width=d.width),d.height&&(u.style.height=d.height)}catch{}return e.nodeMap.set(u,t),Q(t,u,e,n),u}let i;try{if(i=t.cloneNode(!1),ve(t,i),e.nodeMap.set(i,t),t.tagName==="IMG"){Re(t,i);try{let a=t.getBoundingClientRect(),u=Math.round(a.width||0),d=Math.round(a.height||0);if(!u||!d){let p=window.getComputedStyle(t),h=parseFloat(p.width)||0,y=parseFloat(p.height)||0,f=parseInt(t.getAttribute("width")||"",10)||0,m=parseInt(t.getAttribute("height")||"",10)||0,b=t.width||t.naturalWidth||0,g=t.height||t.naturalHeight||0;u=Math.round(u||h||f||b||0),d=Math.round(d||y||m||g||0)}u&&(i.dataset.snapdomWidth=String(u)),d&&(i.dataset.snapdomHeight=String(d))}catch{}}}catch(a){throw console.error("[Snapdom] Failed to clone node:",t,a),a}if(t instanceof HTMLTextAreaElement){let a=t.getBoundingClientRect();i.style.width=`${a.width}px`,i.style.height=`${a.height}px`}if(t instanceof HTMLInputElement&&(i.value=t.value,i.setAttribute("value",t.value),t.checked!==void 0&&(i.checked=t.checked,t.checked&&i.setAttribute("checked",""),t.indeterminate&&(i.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(s=t.value),t instanceof HTMLTextAreaElement&&(r=t.value),Q(t,i,e,n),t.shadowRoot){let m=function(g,w){if(g.nodeType===Node.ELEMENT_NODE&&g.tagName==="STYLE")return w(null);Ct(g,e,n).then(S=>{w(S||null)}).catch(()=>{w(null)})};try{let g=t.shadowRoot.querySelectorAll("slot");for(let w of g){let S=[];try{S=w.assignedNodes?.({flatten:!0})||w.assignedNodes?.()||[]}catch{S=w.assignedNodes?.()||[]}for(let k of S)o.add(k)}}catch{}let a=$e(e),u=`[data-sd="${a}"]`;try{i.setAttribute("data-sd",a)}catch{}let d=Ie(t.shadowRoot),p=Fe(d,u),h=Ne(d),y=Te(t,h,u);Le(i,y+p,a);let f=document.createDocumentFragment(),b=await Nt(Array.from(t.shadowRoot.childNodes),m,n.fast);f.append(...b.filter(g=>!!g)),i.appendChild(f)}if(t.tagName==="SLOT"){let p=function(y,f){Ct(y,e,n).then(m=>{m&&Pe(m),f(m||null)}).catch(()=>{f(null)})},a=t.assignedNodes?.({flatten:!0})||[],u=a.length>0?a:Array.from(t.childNodes),d=document.createDocumentFragment(),h=await Nt(Array.from(u),p,n.fast);return d.append(...h.filter(y=>!!y)),d}function l(a,u){if(o.has(a))return u(null);Ct(a,e,n).then(d=>{u(d||null)}).catch(()=>{u(null)})}let c=await Nt(Array.from(t.childNodes),l,n.fast);if(i.append(...c.filter(a=>!!a)),s!==null&&i instanceof HTMLSelectElement){i.value=s;for(let a of i.options)a.value===s?a.setAttribute("selected",""):a.removeAttribute("selected")}return r!==null&&i instanceof HTMLTextAreaElement&&(i.textContent=r),i}var So=[/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],mt=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__||{}),oe=[];function Oe(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?oe.push(n):typeof n=="string"?oe.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function B(t){let e=typeof t=="string"?t:"",n=[...So,...oe];for(let o of n)if(o instanceof RegExp&&o.test(e))return!0;return!!(/icon/i.test(e)||/glyph/i.test(e)||/symbols/i.test(e)||/feather/i.test(e)||/fontawesome/i.test(e))}function Co(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var Ue=new Map;function ko(t=""){let e=Object.create(null),n=String(t||""),o=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,s;for(;s=o.exec(n);)e[s[1].toUpperCase()]=Number(s[2]);return e}async function Ao(t,e,n){let o=String(t||""),s=o.toLowerCase(),r=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(s)&&!/\bsymbols\b/.test(s))return{familyForMeasure:o,familyForCanvas:o};if(!/\bmaterial\s*symbols\b/.test(s))return{familyForMeasure:o,familyForCanvas:o};let l=n&&(n.FILL??n.fill),c="outlined";/\brounded\b/.test(r)||/\bround\b/.test(r)?c="rounded":/\bsharp\b/.test(r)?c="sharp":/\boutlined\b/.test(r)&&(c="outlined");let a=l===1,u=null;if(a&&(c==="outlined"&&mt.materialIconsFilled?u={url:mt.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&mt.materialIconsRound?u={url:mt.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&mt.materialIconsSharp&&(u={url:mt.materialIconsSharp,alias:"snapdom-mi-sharp"})),!u)return{familyForMeasure:o,familyForCanvas:o};if(!Ue.has(u.alias))try{let p=new FontFace(u.alias,`url(${u.url})`,{style:"normal",weight:"400"});document.fonts.add(p),await p.load(),Ue.set(u.alias,!0)}catch{return{familyForMeasure:o,familyForCanvas:o}}let d=`"${u.alias}"`;return{familyForMeasure:d,familyForCanvas:d}}async function Mo(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function vo(t){let e=t.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(e)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!n&&e.toLowerCase()!=="currentcolor")return e;let o=t.color?.trim();return o&&o!=="inherit"?o:"#000"}async function Eo(t,{family:e="Material Icons",weight:n="normal",fontSize:o=32,color:s="#000",variation:r="",className:i=""}={}){let l=String(e||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,a=ko(r),{familyForMeasure:u,familyForCanvas:d}=await Ao(l,i,a);await Mo(d.replace(/^["']+|["']+$/g,""),o);let p=document.createElement("span");p.textContent=t,p.style.position="absolute",p.style.visibility="hidden",p.style.left="-99999px",p.style.whiteSpace="nowrap",p.style.fontFamily=u,p.style.fontWeight=String(n||"normal"),p.style.fontSize=`${o}px`,p.style.lineHeight="1",p.style.margin="0",p.style.padding="0",p.style.fontFeatureSettings="'liga' 1",p.style.fontVariantLigatures="normal",p.style.color=s,document.body.appendChild(p);let h=p.getBoundingClientRect(),y=Math.max(1,Math.ceil(h.width)),f=Math.max(1,Math.ceil(h.height));document.body.removeChild(p);let m=document.createElement("canvas");m.width=y*c,m.height=f*c;let b=m.getContext("2d");b.scale(c,c),b.font=`${n?`${n} `:""}${o}px ${d}`,b.textAlign="left",b.textBaseline="top",b.fillStyle=s;try{b.fontKerning="normal"}catch{}return b.fillText(t,0,0),{dataUrl:m.toDataURL(),width:y,height:f}}async function Be(t,e){if(!(t instanceof Element))return 0;let n='.material-icons, [class*="material-symbols"]',o=Array.from(t.querySelectorAll(n)).filter(i=>i&&i.textContent&&i.textContent.trim());if(o.length===0)return 0;let s=e instanceof Element?Array.from(e.querySelectorAll(n)).filter(i=>i&&i.textContent&&i.textContent.trim()):[],r=0;for(let i=0;i<o.length;i++){let l=o[i],c=s[i]||null;try{let a=getComputedStyle(c||l),u=a.fontFamily||"Material Icons";if(!Co(u))continue;let d=(c||l).textContent.trim();if(!d)continue;let p=parseInt(a.fontSize,10)||24,h=a.fontWeight&&a.fontWeight!=="normal"?a.fontWeight:"normal",y=vo(a),f=a.fontVariationSettings&&a.fontVariationSettings!=="normal"?a.fontVariationSettings:"",m=(c||l).className||"",{dataUrl:b,width:g,height:w}=await Eo(d,{family:u,weight:h,fontSize:p,color:y,variation:f,className:m});l.textContent="";let S=l.ownerDocument.createElement("img");S.src=b,S.alt=d,S.style.height=`${p}px`,S.style.width=`${Math.max(1,Math.round(g/w*p))}px`,S.style.objectFit="contain",S.style.verticalAlign=getComputedStyle(l).verticalAlign||"baseline",l.appendChild(S),r++}catch{}}return r}async function qe(t,e,n,o=32,s="#000"){e=e.replace(/^['"]+|['"]+$/g,"");let r=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let i=document.createElement("span");i.textContent=t,i.style.position="absolute",i.style.visibility="hidden",i.style.fontFamily=`"${e}"`,i.style.fontWeight=n||"normal",i.style.fontSize=`${o}px`,i.style.lineHeight="1",i.style.whiteSpace="nowrap",i.style.padding="0",i.style.margin="0",document.body.appendChild(i);let l=i.getBoundingClientRect(),c=Math.ceil(l.width),a=Math.ceil(l.height);document.body.removeChild(i);let u=document.createElement("canvas");u.width=Math.max(1,c*r),u.height=Math.max(1,a*r);let d=u.getContext("2d");return d.scale(r,r),d.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=s,d.fillText(t,0,0),{dataUrl:u.toDataURL(),width:c,height:a}}var Fo=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function _t(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Fo.has(n.toLowerCase()))return n}return""}function Tt(t){let e=String(t??"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function re(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function $o(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Io(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let s=Tt(n[1]),r=Tt(n[2]);return{min:Math.min(s,r),max:Math.max(s,r)}}let o=Tt(e);return{min:o,max:o}}function Lo(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Ro(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let r=parseFloat(n[1]),i=parseFloat(n[2]);return{min:Math.min(r,i),max:Math.max(r,i)}}let o=e.match(/(\d+(?:\.\d+)?)\s*%/),s=o?parseFloat(o[1]):100;return{min:s,max:s}}function No(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let s=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(l=>s.endsWith(l)))return!0;let i=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(i)||/\.woff2?(\b|$)/.test(i))return!0;for(let l of e){let c=l.toLowerCase().replace(/\s+/g,"+"),a=l.toLowerCase().replace(/\s+/g,"-");if(i.includes(c)||i.includes(a))return!0}return!1}catch{return!1}}function To(t){let e=new Set;for(let n of t||[]){let o=String(n).split("__")[0]?.trim();o&&e.add(o)}return e}function De(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,o,s)=>{let r=(s||"").trim();if(!r||/^data:|^blob:|^https?:|^file:|^about:/i.test(r))return n;let i=r;try{i=new URL(r,e||location.href).href}catch{}return`url("${i}")`})}var se=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Pt=4;async function Po(t,e,n){if(!t)return t;let o=new Set;function s(l,c){try{return new URL(l,c||location.href).href}catch{return l}}async function r(l,c,a=0){if(a>Pt)return console.warn(`[snapDOM] @import depth exceeded (${Pt}) at ${c}`),l;let u="",d=0,p;for(;p=se.exec(l);){u+=l.slice(d,p.index),d=se.lastIndex;let h=(p[2]||p[4]||"").trim(),y=s(h,c);if(o.has(y)){console.warn(`[snapDOM] Skipping circular @import: ${y}`);continue}o.add(y);let f="";try{let m=await T(y,{as:"text",useProxy:n,silent:!0});m.ok&&typeof m.data=="string"&&(f=m.data)}catch{}f?(f=De(f,y),f=await r(f,y,a+1),u+=`
6
+ /* inlined: ${y} */
7
+ ${f}
8
+ `):u+=p[0]}return u+=l.slice(d),u}let i=De(t,e||location.href);return i=await r(i,e||location.href,0),i}var ze=/url\((["']?)([^"')]+)\1\)/g,_o=/@font-face[^{}]*\{[^}]*\}/g;function je(t){if(!t)return[];let e=[],n=t.split(",").map(o=>o.trim()).filter(Boolean);for(let o of n){let s=o.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!s)continue;let r=s[1],i=s[2],l=c=>{if(!c.includes("?"))return parseInt(c,16);let a=parseInt(c.replace(/\?/g,"0"),16),u=parseInt(c.replace(/\?/g,"F"),16);return[a,u]};if(i){let c=l(r),a=l(i),u=Array.isArray(c)?c[0]:c,d=Array.isArray(a)?a[1]:a;e.push([Math.min(u,d),Math.max(u,d)])}else{let c=l(r);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function Ve(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[o,s]of e)if(n>=o&&n<=s)return!0;return!1}function ie(t,e){let n=[];if(!t)return n;for(let o of t.matchAll(ze)){let s=(o[2]||"").trim();if(!(!s||s.startsWith("data:"))){if(!/^https?:/i.test(s))try{s=new URL(s,e||location.href).href}catch{}n.push(s)}}return n}async function Xe(t,e,n=""){let o=t;for(let s of t.matchAll(ze)){let r=ot(s[0]);if(!r)continue;let i=r;if(!i.startsWith("http")&&!i.startsWith("data:"))try{i=new URL(i,e||location.href).href}catch{}if(!B(i)){if(x.resource?.has(i)){x.font?.add(i),o=o.replace(s[0],`url(${x.resource.get(i)})`);continue}if(!x.font?.has(i))try{let l=await T(i,{as:"dataURL",useProxy:n,silent:!0});if(l.ok&&typeof l.data=="string"){let c=l.data;x.resource?.set(i,c),x.font?.add(i),o=o.replace(s[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",i)}}}return o}function Wo(t){if(!t.length)return null;let e=(l,c)=>t.some(([a,u])=>!(u<l||a>c)),n=e(0,255)||e(305,305),o=e(256,591)||e(7680,7935),s=e(880,1023),r=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":r?"cyrillic":s?"greek":o?"latin-ext":n?"latin":null}function He(t={}){let e=new Set((t.families||[]).map(s=>String(s).toLowerCase())),n=new Set((t.domains||[]).map(s=>String(s).toLowerCase())),o=new Set((t.subsets||[]).map(s=>String(s).toLowerCase()));return(s,r)=>{if(e.size&&e.has(s.family.toLowerCase()))return!0;if(n.size)for(let i of s.srcUrls)try{if(n.has(new URL(i).host.toLowerCase()))return!0}catch{}if(o.size){let i=Wo(r);if(i&&o.has(i))return!0}return!1}}function Uo(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,o=[];for(let r of t.match(e)||[]){let i=r.match(/font-family:\s*([^;]+);/i)?.[1]||"",l=_t(i),c=(r.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),a=(r.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),u=(r.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),d=(r.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),p=(r.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),h=ie(p,location.href),y=h.length?h.map(m=>String(m).toLowerCase()).sort().join("|"):p.toLowerCase(),f=[String(l||"").toLowerCase(),c,a,u,d.toLowerCase(),y].join("|");n.has(f)||(n.add(f),o.push(r))}if(o.length===0)return t;let s=0;return t.replace(e,()=>o[s++]||"")}function Oo(t,e,n,o){let s=Array.from(t||[]).sort().join("|"),r=e?JSON.stringify({families:(e.families||[]).map(c=>String(c).toLowerCase()).sort(),domains:(e.domains||[]).map(c=>String(c).toLowerCase()).sort(),subsets:(e.subsets||[]).map(c=>String(c).toLowerCase()).sort()}):"",i=(n||[]).map(c=>`${(c.family||"").toLowerCase()}::${c.weight||"normal"}::${c.style||"normal"}::${c.src||""}`).sort().join("|");return`fonts-embed-css::req=${s}::ex=${r}::lf=${i}::px=${o||""}`}async function Ye(t,e,n,o){let s;try{s=t.cssRules||[]}catch{return}let r=(i,l)=>{try{return new URL(i,l||location.href).href}catch{return i}};for(let i of s){if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){let l=i.href?r(i.href,e):e;if(o.depth>=Pt){console.warn(`[snapDOM] CSSOM import depth exceeded (${Pt}) at ${l}`);continue}if(l&&o.visitedSheets.has(l)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${l}`);continue}l&&o.visitedSheets.add(l);let c={...o,depth:(o.depth||0)+1};await Ye(i.styleSheet,l,n,c);continue}if(i.type===CSSRule.FONT_FACE_RULE){let l=(i.style.getPropertyValue("font-family")||"").trim(),c=_t(l);if(!c||B(c))continue;let a=(i.style.getPropertyValue("font-weight")||"400").trim(),u=(i.style.getPropertyValue("font-style")||"normal").trim(),d=(i.style.getPropertyValue("font-stretch")||"100%").trim(),p=(i.style.getPropertyValue("src")||"").trim(),h=(i.style.getPropertyValue("unicode-range")||"").trim();if(!o.faceMatchesRequired(c,u,a,d))continue;let y=je(h);if(!Ve(o.usedCodepoints,y))continue;let f={family:c,weightSpec:a,styleSpec:u,stretchSpec:d,unicodeRange:h,srcRaw:p,srcUrls:ie(p,e||location.href),href:e||location.href};if(o.simpleExcluder&&o.simpleExcluder(f,y))continue;if(/url\(/i.test(p)){let m=await Xe(p,e||location.href,o.useProxy);await n(`@font-face{font-family:${c};src:${m};font-style:${u};font-weight:${a};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}else await n(`@font-face{font-family:${c};src:${p};font-style:${u};font-weight:${a};font-stretch:${d};${h?`unicode-range:${h};`:""}}`)}}}async function Wt({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:o=[],useProxy:s=""}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let r=new Map;for(let f of t){let[m,b,g,w]=String(f).split("__");if(!m)continue;let S=r.get(m)||[];S.push({w:parseInt(b,10),s:g,st:parseInt(w,10)}),r.set(m,S)}function i(f,m,b,g){if(!r.has(f))return!1;let w=r.get(f),S=Io(b),k=Lo(m),C=Ro(g),M=S.min!==S.max,L=S.min,I=E=>k.kind==="normal"&&E==="normal"||k.kind!=="normal"&&(E==="italic"||E==="oblique"),N=!1;for(let E of w){let P=M?E.w>=S.min&&E.w<=S.max:E.w===L,U=I(re(E.s)),D=E.st>=C.min&&E.st<=C.max;if(P&&U&&D){N=!0;break}}if(N)return!0;if(!M)for(let E of w){let P=I(re(E.s)),U=E.st>=C.min&&E.st<=C.max;if(Math.abs(L-E.w)<=300&&P&&U)return!0}return!1}let l=He(n),c=Oo(t,n,o,s);if(x.resource?.has(c))return x.resource.get(c);let a=To(t),u=[],d=se;for(let f of document.querySelectorAll("style")){let m=f.textContent||"";for(let b of m.matchAll(d)){let g=(b[2]||b[4]||"").trim();if(!g||B(g))continue;!!document.querySelector(`link[rel="stylesheet"][href="${g}"]`)||u.push(g)}}u.length&&await Promise.all(u.map(f=>new Promise(m=>{if(document.querySelector(`link[rel="stylesheet"][href="${f}"]`))return m(null);let b=document.createElement("link");b.rel="stylesheet",b.href=f,b.setAttribute("data-snapdom","injected-import"),b.onload=()=>m(b),b.onerror=()=>m(null),document.head.appendChild(b)})));let p="",h=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(f=>!!f.href);for(let f of h)try{if(B(f.href))continue;let m="",b=!1;try{b=new URL(f.href,location.href).origin===location.origin}catch{}if(!b&&!No(f.href,a))continue;if(b){let w=Array.from(document.styleSheets).find(S=>S.href===f.href);if(w)try{let S=w.cssRules||[];m=Array.from(S).map(k=>k.cssText).join("")}catch{}}if(!m&&(m=(await T(f.href,{as:"text",useProxy:s})).data,B(f.href)))continue;m=await Po(m,f.href,s);let g="";for(let w of m.match(_o)||[]){let S=(w.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),k=_t(S);if(!k||B(k))continue;let C=(w.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),M=(w.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),L=(w.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),I=(w.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),N=(w.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),E=ie(N,f.href);if(!i(k,M,C,L))continue;let P=je(I);if(!Ve(e,P))continue;let U={family:k,weightSpec:C,styleSpec:M,stretchSpec:L,unicodeRange:I,srcRaw:N,srcUrls:E,href:f.href};if(n&&l(U,P))continue;let D=/url\(/i.test(N)?await Xe(w,f.href,s):w;g+=D}g.trim()&&(p+=g)}catch{console.warn("[snapDOM] Failed to process stylesheet:",f.href)}let y={requiredIndex:r,usedCodepoints:e,faceMatchesRequired:i,simpleExcluder:n?He(n):null,useProxy:s,visitedSheets:new Set,depth:0};for(let f of document.styleSheets)if(!(f.href&&h.some(m=>m.href===f.href)))try{let m=f.href||location.href;m&&y.visitedSheets.add(m),await Ye(f,m,async b=>{p+=b},y)}catch{}try{for(let f of document.fonts||[]){if(!f||!f.family||f.status!=="loaded"||!f._snapdomSrc)continue;let m=String(f.family).replace(/^['"]+|['"]+$/g,"");if(B(m)||!r.has(m)||n?.families&&n.families.some(g=>String(g).toLowerCase()===m.toLowerCase()))continue;let b=f._snapdomSrc;if(!String(b).startsWith("data:")){if(x.resource?.has(f._snapdomSrc))b=x.resource.get(f._snapdomSrc),x.font?.add(f._snapdomSrc);else if(!x.font?.has(f._snapdomSrc))try{let g=await T(f._snapdomSrc,{as:"dataURL",useProxy:s,silent:!0});if(g.ok&&typeof g.data=="string")b=g.data,x.resource?.set(f._snapdomSrc,b),x.font?.add(f._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",f._snapdomSrc);continue}}p+=`@font-face{font-family:'${m}';src:url(${b});font-style:${f.style||"normal"};font-weight:${f.weight||"normal"};}`}}catch{}for(let f of o){if(!f||typeof f!="object")continue;let m=String(f.family||"").replace(/^['"]+|['"]+$/g,"");if(!m||B(m)||!r.has(m)||n?.families&&n.families.some(C=>String(C).toLowerCase()===m.toLowerCase()))continue;let b=f.weight!=null?String(f.weight):"normal",g=f.style!=null?String(f.style):"normal",w=f.stretchPct!=null?`${f.stretchPct}%`:"100%",S=String(f.src||""),k=S;if(!k.startsWith("data:")){if(x.resource?.has(S))k=x.resource.get(S),x.font?.add(S);else if(!x.font?.has(S))try{let C=await T(S,{as:"dataURL",useProxy:s,silent:!0});if(C.ok&&typeof C.data=="string")k=C.data,x.resource?.set(S,k),x.font?.add(S);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",S);continue}}p+=`@font-face{font-family:'${m}';src:url(${k});font-style:${g};font-weight:${b};font-stretch:${w};}`}return p&&(p=Uo(p),x.resource?.set(c,p)),p}function Ut(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),o=i=>{let l=_t(i.fontFamily);if(!l)return;let c=(a,u,d)=>`${l}__${Tt(a)}__${re(u)}__${$o(d)}`;e.add(c(i.fontWeight,i.fontStyle,i.fontStretch))};o(getComputedStyle(t));let s=getComputedStyle(t,"::before");s&&s.content&&s.content!=="none"&&o(s);let r=getComputedStyle(t,"::after");for(r&&r.content&&r.content!=="none"&&o(r);n.nextNode();){let i=n.currentNode,l=getComputedStyle(i);o(l);let c=getComputedStyle(i,"::before");c&&c.content&&c.content!=="none"&&o(c);let a=getComputedStyle(i,"::after");a&&a.content&&a.content!=="none"&&o(a)}return e}function Ot(t){let e=new Set,n=s=>{if(s)for(let r of s)e.add(r.codePointAt(0))},o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){let s=o.currentNode;if(s.nodeType===Node.TEXT_NODE)n(s.nodeValue||"");else if(s.nodeType===Node.ELEMENT_NODE){let r=s;for(let i of["::before","::after"]){let c=getComputedStyle(r,i)?.getPropertyValue("content");if(!(!c||c==="none"))if(/^"/.test(c)||/^'/.test(c))n(c.slice(1,-1));else{let a=c.match(/\\[0-9A-Fa-f]{1,6}/g);if(a)for(let u of a)try{e.add(parseInt(u.slice(1),16))}catch{}}}}}return e}async function Bt(t,e=2){try{await document.fonts.ready}catch{}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let o=()=>{let s=document.createElement("div");s.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let r of n){let i=document.createElement("span");i.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",i.style.fontFamily=`"${r}"`,i.style.fontWeight="700",i.style.fontStyle="italic",i.style.fontSize="32px",i.style.lineHeight="1",i.style.whiteSpace="nowrap",i.style.margin="0",i.style.padding="0",s.appendChild(i)}document.body.appendChild(s),s.offsetWidth,document.body.removeChild(s)};for(let s=0;s<Math.max(1,e);s++)o(),await new Promise(r=>requestAnimationFrame(()=>requestAnimationFrame(r)))}function Je(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Bo(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function Ke(t,e=!1){let n="",o=Math.max(1,t);for(;o>0;)o--,n=String.fromCharCode(97+o%26)+n,o=Math.floor(o/26);return e?n.toUpperCase():n}function Ge(t,e=!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"]],o=Math.max(1,Math.min(3999,t)),s="";for(let[r,i]of n)for(;o>=r;)s+=i,o-=r;return e?s:s.toLowerCase()}function Qe(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return Ke(t,!1);case"upper-alpha":return Ke(t,!0);case"lower-roman":return Ge(t,!1);case"upper-roman":return Ge(t,!0);default:return String(Math.max(0,t))}}function Ze(t){let e=()=>x?.session?.__counterEpoch??0,n=e(),o=new WeakMap,s=t instanceof Document?t.documentElement:t,r=p=>p&&p.tagName==="LI",i=p=>{let h=0,y=p?.parentElement;if(!y)return 0;for(let f of y.children){if(f===p)break;f.tagName==="LI"&&h++}return h},l=p=>{let h=new Map;for(let[y,f]of p)h.set(y,f.slice());return h},c=(p,h,y)=>{let f=l(p),m;try{m=y.style?.counterReset||getComputedStyle(y).counterReset}catch{}if(m&&m!=="none")for(let g of m.split(",")){let w=g.trim().split(/\s+/),S=w[0],k=Number.isFinite(Number(w[1]))?Number(w[1]):0;if(!S)continue;let C=h.get(S);if(C&&C.length){let M=C.slice();M.push(k),f.set(S,M)}else f.set(S,[k])}let b;try{b=y.style?.counterIncrement||getComputedStyle(y).counterIncrement}catch{}if(b&&b!=="none")for(let g of b.split(",")){let w=g.trim().split(/\s+/),S=w[0],k=Number.isFinite(Number(w[1]))?Number(w[1]):1;if(!S)continue;let C=f.get(S)||[];C.length===0&&C.push(0),C[C.length-1]+=k,f.set(S,C)}try{if(getComputedStyle(y).display==="list-item"&&r(y)){let w=y.parentElement,S=1;if(w&&w.tagName==="OL"){let C=w.getAttribute("start"),M=Number.isFinite(Number(C))?Number(C):1,L=i(y),I=y.getAttribute("value");S=Number.isFinite(Number(I))?Number(I):M+L}else S=1+i(y);let k=f.get("list-item")||[];k.length===0&&k.push(0),k[k.length-1]=S,f.set("list-item",k)}}catch{}return f},a=(p,h,y)=>{let f=c(y,h,p);o.set(p,f);let m=f;for(let b of p.children)m=a(b,f,m);return f},u=new Map;a(s,u,u);function d(){let p=e();if(p!==n){n=p;let h=new Map;a(s,h,h)}}return{get(p,h){d();let y=o.get(p)?.get(h);return y&&y.length?y[y.length-1]:0},getStack(p,h){d();let y=o.get(p)?.get(h);return y?y.slice():[]}}}function tn(t,e,n){if(!t||t==="none")return t;try{let o=/\b(counter|counters)\s*\(([^)]+)\)/g,s=t.replace(o,(r,i,l)=>{let c=String(l).split(",").map(a=>a.trim());if(i==="counter"){let a=c[0]?.replace(/^["']|["']$/g,""),u=(c[1]||"decimal").toLowerCase(),d=n.get(e,a);return Qe(d,u)}else{let a=c[0]?.replace(/^["']|["']$/g,""),u=c[1]?.replace(/^["']|["']$/g,"")??"",d=(c[2]||"decimal").toLowerCase(),p=n.getStack(e,a);return p.length?p.map(y=>Qe(y,d)).join(u):""}});return Bo(s)}catch{return"- "}}var pt=new WeakMap,en=300;function Do(t,e){let n=sn(t);return e?(e.__pseudoPreflightFp!==n&&(e.__pseudoPreflight=on(t),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):on(t)}function ae(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function sn(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,o=0;for(let r=0;r<e.length;r++){let i=e[r];if(i.tagName==="STYLE"){let l=i.textContent?i.textContent.length:0;n+=`S${l}|`;let c=i.sheet,a=c?ae(c):null;a&&(o+=a.length)}else{let l=i.getAttribute("href")||"",c=i.getAttribute("media")||"all";n+=`L${l}|m:${c}|`;let a=i.sheet,u=a?ae(a):null;u&&(o+=u.length)}}let s=t.adoptedStyleSheets;return n+=`ass:${Array.isArray(s)?s.length:0}|tr:${o}`,n}function nn(t,e,n){let o=ae(t);if(!o)return!1;for(let s=0;s<o.length;s++){if(n.budget<=0)return!1;let r=o[s],i=r&&r.cssText?r.cssText:"";n.budget--;for(let l of e)if(i.includes(l))return!0;if(r&&r.cssRules&&r.cssRules.length)for(let l=0;l<r.cssRules.length&&n.budget>0;l++){let c=r.cssRules[l],a=c&&c.cssText?c.cssText:"";n.budget--;for(let u of e)if(a.includes(u))return!0}if(n.budget<=0)return!1}return!1}function on(t=document){let e=sn(t),n=pt.get(t);if(n&&n.fingerprint===e)return n.result;let o=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],s=t.querySelectorAll("style");for(let i=0;i<s.length;i++){let l=s[i].textContent||"";for(let c of o)if(l.includes(c))return pt.set(t,{fingerprint:e,result:!0}),!0}let r=t.adoptedStyleSheets;if(Array.isArray(r)&&r.length){let i={budget:en};try{for(let l of r)if(nn(l,o,i))return pt.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let i=t.querySelectorAll('style,link[rel~="stylesheet"]'),l={budget:en};for(let c=0;c<i.length&&l.budget>0;c++){let a=i[c],u=null;if(a.tagName,u=a.sheet||null,u&&nn(u,o,l))return pt.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(pt.set(t,{fingerprint:e,result:!0}),!0):(pt.set(t,{fingerprint:e,result:!1}),!1)}var ht=new WeakMap,rn=-1;function Ho(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function qo(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,o;for(;o=n.exec(t);)e.push(o[1]);return e.length?e.join(""):Ho(t)}function ce(t,e){let n=t.parentElement,o=n?ht.get(n):null;return o?{get(s,r){let i=e.get(s,r),l=o.get(r);return typeof l=="number"?Math.max(i,l):i},getStack(s,r){let i=e.getStack(s,r);if(!i.length)return i;let l=o.get(r);if(typeof l=="number"){let c=i.slice();return c[c.length-1]=Math.max(c[c.length-1],l),c}return i}}:e}function le(t,e,n){let o=new Map;function s(c){let a=[];if(!c||c==="none")return a;for(let u of String(c).split(",")){let d=u.trim().split(/\s+/),p=d[0],h=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;p&&a.push({name:p,num:h})}return a}let r=s(e?.counterReset),i=s(e?.counterIncrement);function l(c){if(o.has(c))return o.get(c).slice();let a=n.getStack(t,c);a=a.length?a.slice():[];let u=r.find(p=>p.name===c);if(u){let p=Number.isFinite(u.num)?u.num:0;a=a.length?[...a,p]:[p]}let d=i.find(p=>p.name===c);if(d){let p=Number.isFinite(d.num)?d.num:1;a.length===0&&(a=[0]),a[a.length-1]+=p}return o.set(c,a.slice()),a}return{get(c,a){let u=l(a);return u.length?u[u.length-1]:0},getStack(c,a){return l(a)},__incs:i}}function zo(t,e,n){let o;try{o=getComputedStyle(t,e)}catch{}let s=o?.content;if(!s||s==="none"||s==="normal")return{text:"",incs:[]};let r=ce(t,n),i=le(t,o,r),l=Je(s)?tn(s,t,i):s;return{text:qo(l),incs:i.__incs||[]}}async function ue(t,e,n,o){if(!(t instanceof Element)||!(e instanceof Element))return;let s=t.ownerDocument||document;if(!Do(s,n))return;let r=x?.session?.__counterEpoch??0;if(rn!==r&&(ht=new WeakMap,n&&(n.__counterCtx=null),rn=r),!n.__counterCtx)try{n.__counterCtx=Ze(t.ownerDocument||document)}catch{}let i=n.__counterCtx;for(let a of["::before","::after","::first-letter"])try{let u=st(t,a);if(!u||u.content==="none"&&u.backgroundImage==="none"&&u.backgroundColor==="transparent"&&(u.borderStyle==="none"||parseFloat(u.borderWidth)===0)&&(!u.transform||u.transform==="none")&&u.display==="inline")continue;if(a==="::first-letter"){let $=getComputedStyle(t);if(!(u.color!==$.color||u.fontSize!==$.fontSize||u.fontWeight!==$.fontWeight))continue;let _=Array.from(e.childNodes).find(zt=>zt.nodeType===Node.TEXT_NODE&&zt.textContent?.trim().length>0);if(!_)continue;let O=_.textContent,at=O.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],Ht=O.slice(at?.length||0);if(!at||/[\uD800-\uDFFF]/.test(at))continue;let ct=document.createElement("span");ct.textContent=at,ct.dataset.snapdomPseudo="::first-letter";let qt=Lt(u),Mt=dt(qt,"span");n.styleMap.set(ct,Mt);let vt=document.createTextNode(Ht);e.replaceChild(vt,_),e.insertBefore(ct,vt);continue}let p=u.content??"",h=p===""||p==="none"||p==="normal",{text:y,incs:f}=zo(t,a,i),m=u.backgroundImage,b=u.backgroundColor,g=u.fontFamily,w=parseInt(u.fontSize)||32,S=parseInt(u.fontWeight)||!1,k=u.color||"#000",C=u.borderStyle,M=parseFloat(u.borderWidth),L=u.transform,I=B(g),N=!h&&y!=="",E=m&&m!=="none",P=b&&b!=="transparent"&&b!=="rgba(0, 0, 0, 0)",U=C&&C!=="none"&&M>0,D=L&&L!=="none";if(!(N||E||P||U||D)){if(f&&f.length&&t.parentElement){let $=ht.get(t.parentElement)||new Map;for(let{name:R}of f){if(!R)continue;let _=ce(t,i),nt=le(t,getComputedStyle(t,a),_).get(t,R);$.set(R,nt)}ht.set(t.parentElement,$)}continue}let v=document.createElement("span");v.dataset.snapdomPseudo=a,v.style.pointerEvents="none";let tt=Lt(u),et=dt(tt,"span");if(n.styleMap.set(v,et),I&&y&&y.length===1){let{dataUrl:$,width:R,height:_}=await qe(y,g,S,w,k),O=document.createElement("img");O.src=$,O.style=`height:${w}px;width:${R/_*w}px;object-fit:contain;`,v.appendChild(O),e.dataset.snapdomHasIcon="true"}else if(y&&y.startsWith("url(")){let $=ot(y);if($?.trim())try{let R=document.createElement("img"),_=await T(G($),{as:"dataURL",useProxy:o.useProxy});R.src=_.data,R.style=`width:${w}px;height:auto;object-fit:contain;`,v.appendChild(R)}catch(R){console.error(`[snapdom] Error in pseudo ${a} for`,t,R)}}else!I&&N&&(v.textContent=y);v.style.backgroundImage="none","maskImage"in v.style&&(v.style.maskImage="none"),"webkitMaskImage"in v.style&&(v.style.webkitMaskImage="none");try{v.style.backgroundRepeat=u.backgroundRepeat,v.style.backgroundSize=u.backgroundSize,u.backgroundPositionX&&u.backgroundPositionY?(v.style.backgroundPositionX=u.backgroundPositionX,v.style.backgroundPositionY=u.backgroundPositionY):v.style.backgroundPosition=u.backgroundPosition,v.style.backgroundOrigin=u.backgroundOrigin,v.style.backgroundClip=u.backgroundClip,v.style.backgroundAttachment=u.backgroundAttachment,v.style.backgroundBlendMode=u.backgroundBlendMode}catch{}if(E)try{let $=bt(m),R=await Promise.all($.map(rt));v.style.backgroundImage=R.join(", ")}catch($){console.warn(`[snapdom] Failed to inline background-image for ${a}`,$)}P&&(v.style.backgroundColor=b);let it=v.childNodes.length>0||v.textContent?.trim()!==""||E||P||U||D;if(f&&f.length&&t.parentElement){let $=ht.get(t.parentElement)||new Map,R=ce(t,i),_=le(t,getComputedStyle(t,a),R);for(let{name:O}of f){if(!O)continue;let nt=_.get(t,O);$.set(O,nt)}ht.set(t.parentElement,$)}if(!it)continue;a==="::before"?e.insertBefore(v,e.firstChild):e.appendChild(v)}catch(u){console.warn(`[snapdom] Failed to capture ${a} for`,t,u)}let l=Array.from(t.children),c=Array.from(e.children).filter(a=>!a.dataset.snapdomPseudo);for(let a=0;a<Math.min(l.length,c.length);a++)await ue(l[a],c[a],n,o)}function an(t,e){if(!t||!(t instanceof Element))return;let n=t.ownerDocument||document,o=e||n,s=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(s.length===0)return;let r=/url\(\s*#([^)]+)\)/g,i=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],l=g=>window.CSS&&CSS.escape?CSS.escape(g):g.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c=new Set(Array.from(t.querySelectorAll("[id]")).map(g=>g.id)),a=new Set,u=!1,d=g=>{if(!g)return;r.lastIndex=0;let w;for(;w=r.exec(g);){u=!0;let S=(w[1]||"").trim();S&&!c.has(S)&&a.add(S)}},p=g=>{let w=g.querySelectorAll('use[href^="#"], use[xlink\\:href^="#"]');for(let C of w){let M=C.getAttribute("href")||C.getAttribute("xlink:href");if(!M||!M.startsWith("#"))continue;u=!0;let L=M.slice(1).trim();L&&!c.has(L)&&a.add(L)}let k=g.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("], *[clip-path^="url("],*[mask^="url("],*[marker^="url("], *[marker-start^="url("],*[marker-mid^="url("], *[marker-end^="url("]');for(let C of k){d(C.getAttribute("style")||"");for(let M of i)d(C.getAttribute(M))}};for(let g of s)p(g);if(!u)return;let h=t.querySelector("svg.inline-defs-container");h||(h=n.createElementNS("http://www.w3.org/2000/svg","svg"),h.classList.add("inline-defs-container"),h.setAttribute("aria-hidden","true"),h.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(h,t.firstChild||null));let y=h.querySelector("defs")||null,f=g=>{if(!g||c.has(g))return null;let w=l(g),S=k=>{let C=o.querySelector(k);return C&&!t.contains(C)?C:null};return S(`svg defs > *#${w}`)||S(`svg > symbol#${w}`)||S(`*#${w}`)};if(!a.size)return;let m=new Set(a),b=new Set;for(;m.size;){let g=m.values().next().value;if(m.delete(g),!g||c.has(g)||b.has(g))continue;let w=f(g);if(!w){b.add(g);continue}y||(y=n.createElementNS("http://www.w3.org/2000/svg","defs"),h.appendChild(y));let S=w.cloneNode(!0);S.id||S.setAttribute("id",g),y.appendChild(S),b.add(g),c.add(g);let k=[S,...S.querySelectorAll("*")];for(let C of k){let M=C.getAttribute?.("href")||C.getAttribute?.("xlink:href");if(M&&M.startsWith("#")){let I=M.slice(1).trim();I&&!c.has(I)&&!b.has(I)&&m.add(I)}let L=C.getAttribute?.("style")||"";L&&d(L);for(let I of i){let N=C.getAttribute?.(I);N&&d(N)}}}}function ln(t,e){if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let o=t.getBoundingClientRect(),s=t.clientHeight,r="data-snap-ph",i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let l=i.currentNode,c=getComputedStyle(l),a=c.position;if(a!=="sticky"&&a!=="-webkit-sticky")continue;let u=cn(c.top),d=cn(c.bottom);if(u==null&&d==null)continue;let p=jo(l,t),h=Vo(e,p,r);if(!h)continue;let y=l.getBoundingClientRect(),f=y.width,m=y.height,b=y.left-o.left;if(!(f>0&&m>0)||!Number.isFinite(b))continue;let g=u!=null?u+n:n+(s-m-d);if(!Number.isFinite(g))continue;let w=Number.parseInt(c.zIndex,10),S=Number.isFinite(w),k=S?Math.max(w,1)+1:2,C=S?w-1:0,M=h.cloneNode(!1);M.setAttribute(r,"1"),M.style.position="sticky",M.style.left=`${b}px`,M.style.top=`${g}px`,M.style.width=`${f}px`,M.style.height=`${m}px`,M.style.visibility="hidden",M.style.zIndex=String(C),M.style.overflow="hidden",M.style.background="transparent",M.style.boxShadow="none",M.style.filter="none",h.parentElement?.insertBefore(M,h),h.style.position="absolute",h.style.left=`${b}px`,h.style.top=`${g}px`,h.style.bottom="auto",h.style.zIndex=String(k),h.style.pointerEvents="none"}}function cn(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function jo(t,e){let n=[];for(let o=t;o&&o!==e;){let s=o.parentElement;if(!s)break;n.push(Array.prototype.indexOf.call(s.children,o)),o=s}return n.reverse()}function Vo(t,e,n){let o=t;for(let s=0;s<e.length;s++)if(o=Xo(o,n)[e[s]],!o)return null;return o instanceof HTMLElement?o:null}function Xo(t,e){let n=[],o=t.children;for(let s=0;s<o.length;s++){let r=o[s];r.hasAttribute(e)||n.push(r)}return n}function un(t){let e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,s=e.borderStyle,r=e.borderWidth,i=n!=="none"&&parseFloat(o)>0,l=s==="none"||parseFloat(r)===0;i&&l&&(t.style.border=`${o} solid transparent`)}async function fn(t,e={}){let n={styleMap:x.session.styleMap,styleCache:x.session.styleCache,nodeMap:x.session.nodeMap},o,s="",r="";un(t);try{an(t)}catch(c){console.warn("inlineExternal defs or symbol failed:",c)}try{o=await Ct(t,n,e,t)}catch(c){throw console.warn("deepClone failed:",c),c}try{await ue(t,o,n,e)}catch(c){console.warn("inlinePseudoElements failed:",c)}await We(o);try{let c=o.querySelectorAll("style[data-sd]");for(let a of c)r+=a.textContent||"",a.remove()}catch{}let i=te(n.styleMap);s=Array.from(i.entries()).map(([c,a])=>`.${a}{${c}}`).join(""),s=r+s;for(let[c,a]of n.styleMap.entries()){if(c.tagName==="STYLE")continue;if(c.getRootNode&&c.getRootNode()instanceof ShadowRoot){c.setAttribute("style",a.replace(/;/g,"; "));continue}let u=i.get(a);u&&c.classList.add(u);let d=c.style?.backgroundImage,p=c.dataset?.snapdomHasIcon;d&&d!=="none"&&(c.style.backgroundImage=d),p&&(c.style.verticalAlign="middle",c.style.display="inline")}for(let[c,a]of n.nodeMap.entries()){let u=a.scrollLeft,d=a.scrollTop;if((u||d)&&c instanceof HTMLElement){c.style.overflow="hidden",c.style.scrollbarWidth="none",c.style.msOverflowStyle="none";let h=document.createElement("div");for(h.style.transform=`translate(${-u}px, ${-d}px)`,h.style.willChange="transform",h.style.display="inline-block",h.style.width="100%";c.firstChild;)h.appendChild(c.firstChild);c.appendChild(h)}}let l=o instanceof HTMLElement&&o.firstElementChild instanceof HTMLElement?o.firstElementChild:o;if(ln(t,l),t===n.nodeMap.get(o)){let c=n.styleCache.get(t)||window.getComputedStyle(t);n.styleCache.set(t,c);let a=Yt(c.transform);o.style.margin="0",o.style.top="auto",o.style.left="auto",o.style.right="auto",o.style.bottom="auto",o.style.animation="none",o.style.transition="none",o.style.willChange="auto",o.style.float="none",o.style.clear="none",o.style.transform=a||""}for(let[c,a]of n.nodeMap.entries())a.tagName==="PRE"&&(c.style.marginTop="0",c.style.marginBlockStart="0");return{clone:o,classCSS:s,styleCache:n.styleCache}}function Yo(t){let e=parseInt(t.dataset?.snapdomWidth||"",10)||0,n=parseInt(t.dataset?.snapdomHeight||"",10)||0,o=parseInt(t.getAttribute("width")||"",10)||0,s=parseInt(t.getAttribute("height")||"",10)||0,r=parseFloat(t.style?.width||"")||0,i=parseFloat(t.style?.height||"")||0,l=e||r||o||t.width||t.naturalWidth||100,c=n||i||s||t.height||t.naturalHeight||100;return{width:l,height:c}}async function dn(t,e={}){let n=Array.from(t.querySelectorAll("img")),o=async s=>{if(!s.getAttribute("src")){let u=s.currentSrc||s.src||"";u&&s.setAttribute("src",u)}s.removeAttribute("srcset"),s.removeAttribute("sizes");let r=s.src||"";if(!r)return;let i=await T(r,{as:"dataURL",useProxy:e.useProxy});if(i.ok&&typeof i.data=="string"&&i.data.startsWith("data:")){s.src=i.data,s.width||(s.width=s.naturalWidth||100),s.height||(s.height=s.naturalHeight||100);return}let{width:l,height:c}=Yo(s),{fallbackURL:a}=e||{};if(a)try{let u=typeof a=="function"?await a({width:l,height:c,src:r,element:s}):a;if(u){let d=await T(u,{as:"dataURL",useProxy:e.useProxy});s.src=d.data,s.width||(s.width=l),s.height||(s.height=c);return}}catch{}if(e.placeholders!==!1){let u=document.createElement("div");u.style.cssText=[`width:${l}px`,`height:${c}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${c}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),u.textContent="img",s.replaceWith(u)}else{let u=document.createElement("div");u.style.cssText=`display:inline-block;width:${l}px;height:${c}px;visibility:hidden;`,s.replaceWith(u)}};for(let s=0;s<n.length;s+=4){let r=n.slice(s,s+4).map(o);await Promise.allSettled(r)}}async function Dt(t,e,n,o={}){let s=[[t,e]],r=["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"],i=["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"],l=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],c=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;s.length;){let[a,u]=s.shift(),d=n.get(a)||st(a);n.has(a)||n.set(a,d);let p=(()=>{let f=d.getPropertyValue("border-image"),m=d.getPropertyValue("border-image-source");return f&&f!=="none"||m&&m!=="none"})();for(let f of l){let m=d.getPropertyValue(f);m&&u.style.setProperty(f,m)}for(let f of r){let m=d.getPropertyValue(f);if(!m||m==="none")continue;let b=bt(m),g=await Promise.all(b.map(w=>rt(w,o)));g.some(w=>w&&w!=="none"&&!/^url\(undefined/.test(w))&&u.style.setProperty(f,g.join(", "))}for(let f of i){let m=d.getPropertyValue(f);!m||m==="initial"||u.style.setProperty(f,m)}if(p)for(let f of c){let m=d.getPropertyValue(f);!m||m==="initial"||u.style.setProperty(f,m)}let h=Array.from(a.children),y=Array.from(u.children).filter(f=>!(f.dataset&&f.dataset.snapdomPseudo));for(let f=0;f<Math.min(h.length,y.length);f++)s.push([h[f],y[f]])}}function mn(t){if(!t)return()=>{};let e=Ko(t);if(e<=0)return()=>{};if(!Jo(t))return()=>{};let n=getComputedStyle(t),o=Math.round(Go(n)*e+Qo(n)),s=t.textContent??"",r=s;if(t.scrollHeight<=o+.5)return()=>{};let i=0,l=s.length,c=-1;for(;i<=l;){let a=i+l>>1;t.textContent=s.slice(0,a)+"\u2026",t.scrollHeight<=o+.5?(c=a,i=a+1):l=a-1}return t.textContent=(c>=0?s.slice(0,c):"")+"\u2026",()=>{t.textContent=r}}function Ko(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let o=parseInt(n,10);return Number.isFinite(o)&&o>0?o:0}function Go(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function Qo(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function Jo(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var kt=[];function pn(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function fe(...t){let e=t.flat();for(let n of e){let o=pn(n);o&&(kt.some(s=>s&&s.name&&o.name&&s.name===o.name)||kt.push(o))}}function hn(t){return(t&&Array.isArray(t.plugins)?t.plugins:kt)||kt}async function q(t,e,n){let o=n,s=hn(e);for(let r of s){let i=r&&typeof r[t]=="function"?r[t]:null;if(!i)continue;let l=await i(e,o);typeof l<"u"&&(o=l)}return o}async function gn(t,e,n){let o=[],s=hn(e);for(let r of s){let i=r&&typeof r[t]=="function"?r[t]:null;if(!i)continue;let l=await i(e,n);typeof l<"u"&&o.push(l)}return o}function Zo(t){let e=[];if(Array.isArray(t))for(let n of t){let o=pn(n);if(!o||!o.name)continue;let s=e.findIndex(r=>r&&r.name===o.name);s>=0&&e.splice(s,1),e.push(o)}for(let n of kt)n&&n.name&&!e.some(o=>o.name===n.name)&&e.push(n);return Object.freeze(e)}function yn(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Zo(e)),t}function bn(t,e){if(!t||!e||!e.style)return;let n=getComputedStyle(t);try{e.style.boxShadow="none"}catch{}try{e.style.textShadow="none"}catch{}try{e.style.outline="none"}catch{}let s=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=s.length?s:"none"}catch{}}function tr(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),n=[];for(;e.nextNode();)n.push(e.currentNode);for(let o of n)o.remove()}function er(t,e={}){let{stripFrameworkDirectives:n=!0}=e,o=new Set(["xml","xlink"]),s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;s.nextNode();){let r=s.currentNode;for(let i of Array.from(r.attributes)){let l=i.name;if(l.includes("@")){r.removeAttribute(l);continue}if(l.includes(":")){let c=l.split(":",1)[0];if(!o.has(c)){r.removeAttribute(l);continue}}if(n&&(l.startsWith("x-")||l.startsWith("v-")||l.startsWith(":")||l.startsWith("on:")||l.startsWith("bind:")||l.startsWith("let:")||l.startsWith("class:"))){r.removeAttribute(l);continue}}}}function wn(t,e={}){t&&(er(t,e),tr(t))}function nr(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function or(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function rr(t,e){if(!(t instanceof Element)||nr(t)||or(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let o=e.display||"";return!(o.includes("flex")||o.includes("grid")||o.startsWith("table")||e.transform&&e.transform!=="none")}function xn(t,e,n=new Map){function o(s,r){if(!(s instanceof Element)||!(r instanceof Element))return;let i=s.childElementCount>r.childElementCount,l=n.get(s)||getComputedStyle(s);if(n.has(s)||n.set(s,l),i&&rr(s,l)){r.style.height||(r.style.height="auto"),r.style.width||(r.style.width="auto"),r.style.removeProperty("block-size"),r.style.removeProperty("inline-size"),r.style.minHeight||(r.style.minHeight="0"),r.style.minWidth||(r.style.minWidth="0"),r.style.maxHeight||(r.style.maxHeight="none"),r.style.maxWidth||(r.style.maxWidth="none");let u=l.overflowY||l.overflowBlock||"visible",d=l.overflowX||l.overflowInline||"visible";(u!=="visible"||d!=="visible")&&(r.style.overflow="visible")}let c=Array.from(s.children),a=Array.from(r.children);for(let u=0;u<Math.min(c.length,a.length);u++)o(c[u],a[u])}o(t,e)}function sr(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed"||e.position==="sticky"||(e.cssFloat||e.float||"none")!=="none"||e.transform&&e.transform!=="none")}function ir(t,e){if(!(t instanceof Element))return!1;if(t.getAttribute("data-capture")==="exclude"&&e?.excludeMode==="remove")return!0;if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch{}return!1}function Sn(t,e){let n=getComputedStyle(t),o=t.getBoundingClientRect(),s=1/0,r=-1/0,i=!1,l=Array.from(t.children);for(let h of l){if(ir(h,e)||!sr(h))continue;let y=h.getBoundingClientRect(),f=y.top-o.top,m=y.bottom-o.top;m<=f||(f<s&&(s=f),m>r&&(r=m),i=!0)}let c=i?Math.max(0,r-s):0,a=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,p=parseFloat(n.paddingBottom)||0;return a+u+d+p+c}var A=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t;function Cn(t){let e=t.boxShadow||"";if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let n=e.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(l=>l.trim()),o=0,s=0,r=0,i=0;for(let l of n){let c=l.match(/-?\d+(\.\d+)?px/g)?.map(f=>parseFloat(f))||[];if(c.length<2)continue;let[a,u,d=0,p=0]=c,h=Math.abs(a)+d+p,y=Math.abs(u)+d+p;s=Math.max(s,h+Math.max(a,0)),i=Math.max(i,h+Math.max(-a,0)),r=Math.max(r,y+Math.max(u,0)),o=Math.max(o,y+Math.max(-u,0))}return{top:Math.ceil(o),right:Math.ceil(s),bottom:Math.ceil(r),left:Math.ceil(i)}}function kn(t){let e=(t.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=e?Math.ceil(parseFloat(e[1])||0):0;return{top:n,right:n,bottom:n,left:n}}function An(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0);return{top:e,right:e,bottom:e,left:e}}function Mn(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],o=0,s=0,r=0,i=0,l=!1;for(let c of n){l=!0;let a=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(f=>parseFloat(f))||[],[u=0,d=0,p=0]=a,h=Math.abs(u)+p,y=Math.abs(d)+p;s=Math.max(s,h+Math.max(u,0)),i=Math.max(i,h+Math.max(-u,0)),r=Math.max(r,y+Math.max(d,0)),o=Math.max(o,y+Math.max(-d,0))}return{bleed:{top:A(o),right:A(s),bottom:A(r),left:A(i)},has:l}}function vn(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let o=n.transform||"none";if(!o||o==="none")try{let r=Ln(t);if(r.a===1&&r.b===0&&r.c===0&&r.d===1)return e.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}let s=o.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let r=s[1].split(",").map(i=>parseFloat(i.trim()));if(r.length===6&&r.every(Number.isFinite)){let[i,l,c,a]=r,u=Math.sqrt(i*i+l*l)||0,d=0,p=0,h=0,y=0,f=0,m=0;u>0&&(d=i/u,p=l/u,h=d*c+p*a,y=c-d*h,f=a-p*h,m=Math.sqrt(y*y+f*f)||0,m>0?h=h/m:h=0);let b=u,g=0,w=h*m,S=m;try{e.style.transform=`matrix(${b}, ${g}, ${w}, ${S}, 0, 0)`}catch{}return{a:b,b:g,c:w,d:S}}}try{let r=String(o).trim();return e.style.transform=r+" translate(0px, 0px) rotate(0deg)",null}catch{return null}}function me(t,e,n,o,s){let r=n.a,i=n.b,l=n.c,c=n.d,a=n.e||0,u=n.f||0;function d(b,g){let w=b-o,S=g-s,k=r*w+l*S,C=i*w+c*S;return k+=o+a,C+=s+u,[k,C]}let p=[d(0,0),d(t,0),d(0,e),d(t,e)],h=1/0,y=1/0,f=-1/0,m=-1/0;for(let[b,g]of p)b<h&&(h=b),g<y&&(y=g),b>f&&(f=b),g>m&&(m=g);return{minX:h,minY:y,maxX:f,maxY:m,width:f-h,height:m-y}}function En(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[s,r]=[o[0]||"0",o[1]||"0"],i=(l,c)=>{let a=l.toLowerCase();return a==="left"||a==="top"?0:a==="center"?c/2:a==="right"||a==="bottom"?c:a.endsWith("px")?parseFloat(a)||0:a.endsWith("%")?(parseFloat(a)||0)*c/100:/^-?\d+(\.\d+)?$/.test(a)&&parseFloat(a)||0};return{ox:i(s,e),oy:i(r,n)}}function Fn(t){let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let s=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},r=s("rotate");if(r)if(r.angle){let c=r.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else r.unit?e.rotate=r.unit==="rad"?r.value*180/Math.PI+"deg":r.value+r.unit:e.rotate=String(r);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let i=s("scale");if(i){let c="x"in i&&i.x?.value!=null?i.x.value:Array.isArray(i)?i[0]?.value:Number(i)||1,a="y"in i&&i.y?.value!=null?i.y.value:Array.isArray(i)?i[1]?.value:c;e.scale=`${c} ${a}`}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let l=s("translate");if(l){let c="x"in l&&"value"in l.x?l.x.value:Array.isArray(l)?l[0]?.value:0,a="y"in l&&"value"in l.y?l.y.value:Array.isArray(l)?l[1]?.value:0,u="x"in l&&l.x?.unit?l.x.unit:"px",d="y"in l&&l.y?.unit?l.y.unit:"px";e.translate=`${c}${u} ${a}${d}`}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return e}let o=getComputedStyle(t);return e.rotate=o.rotate&&o.rotate!=="none"?o.rotate:"0deg",e.scale=o.scale&&o.scale!=="none"?o.scale:null,e.translate=o.translate&&o.translate!=="none"?o.translate:null,e}var de=null;function ar(){if(de)return de;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),de=t,t}function $n(t){let e=ar(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform),t.rotate&&(n.style.rotate=t.rotate),t.scale&&(n.style.scale=t.scale),t.translate&&(n.style.translate=t.translate),e.appendChild(n);let o=Ln(n);return e.removeChild(n),o}function In(t){let e=getComputedStyle(t),n=e.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 s=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",r=e.scale&&e.scale!=="none"&&e.scale!=="1",i=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(s||r||i)}function Ln(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}async function pe(t,e){if(!t)throw new Error("Element cannot be null or undefined");Ft(e.cache);let n=e.fast,o=e.outerTransforms!==!1,s=!!e.outerShadows,r={element:t,options:e,plugins:e.plugins},i,l,c,a="",u="",d,p,h=null;await q("beforeSnap",r),await q("beforeClone",r);let y=mn(r.element);try{({clone:i,classCSS:l,styleCache:c}=await fn(r.element,r.options)),!o&&i&&(h=vn(r.element,i)),!s&&i&&bn(r.element,i)}finally{y()}if(r={clone:i,classCSS:l,styleCache:c,...r},await q("afterClone",r),wn(r.clone),r.options?.excludeMode==="remove")try{xn(r.element,r.clone,r.styleCache)}catch(g){console.warn("[snapdom] shrink pass failed:",g)}try{await Be(r.clone,r.element)}catch{}await new Promise(g=>{V(async()=>{await dn(r.clone,r.options),g()},{fast:n})}),await new Promise(g=>{V(async()=>{await Dt(r.element,r.clone,r.styleCache,r.options),g()},{fast:n})}),e.embedFonts&&await new Promise(g=>{V(async()=>{let w=Ut(r.element),S=Ot(r.element);if(W()){let k=new Set(Array.from(w).map(C=>String(C).split("__")[0]).filter(Boolean));await Bt(k,1)}a=await Wt({required:w,usedCodepoints:S,preCached:!1,exclude:r.options.excludeFonts,useProxy:r.options.useProxy}),g()},{fast:n})});let f=Jt(r.clone).sort(),m=f.join(",");x.baseStyle.has(m)?u=x.baseStyle.get(m):await new Promise(g=>{V(()=>{u=Zt(f),x.baseStyle.set(m,u),g()},{fast:n})}),r={fontsCSS:a,baseCSS:u,...r},await q("beforeRender",r),await new Promise(g=>{V(()=>{let w=getComputedStyle(r.element),S=r.element.getBoundingClientRect(),k=Math.max(1,A(r.element.offsetWidth||parseFloat(w.width)||S.width||1)),C=Math.max(1,A(r.element.offsetHeight||parseFloat(w.height)||S.height||1));if(r.options?.excludeMode==="remove"){let H=Sn(r.element,r.options);Number.isFinite(H)&&H>0&&(C=Math.max(1,Math.min(C,A(H+1))))}let M=(H,j=NaN)=>{let ut=typeof H=="string"?parseFloat(H):H;return Number.isFinite(ut)?ut:j},L=M(r.options.width),I=M(r.options.height),N=k,E=C,P=Number.isFinite(L),U=Number.isFinite(I),D=C>0?k/C:1;P&&U?(N=Math.max(1,A(L)),E=Math.max(1,A(I))):P?(N=Math.max(1,A(L)),E=Math.max(1,A(N/(D||1)))):U?(E=Math.max(1,A(I)),N=Math.max(1,A(E*(D||1)))):(N=k,E=C);let Z=0,v=0,tt=k,et=C;if(!o&&h&&Number.isFinite(h.a)){let H={a:h.a,b:h.b||0,c:h.c||0,d:h.d||1,e:0,f:0},j=me(k,C,H,0,0);Z=A(j.minX),v=A(j.minY),tt=A(j.maxX),et=A(j.maxY)}else if(o&&cr(r.element)){let j=w.transform&&w.transform!=="none"?w.transform:"",ut=Fn(r.element),Xt=$n({baseTransform:j,rotate:ut.rotate||"0deg",scale:ut.scale,translate:ut.translate}),{ox:Dn,oy:Hn}=En(w,k,C),qn=Xt.is2D?Xt:new DOMMatrix(Xt.toString()),Et=me(k,C,qn,Dn,Hn);Z=A(Et.minX),v=A(Et.minY),tt=A(Et.maxX),et=A(Et.maxY)}let yt=Cn(w),it=kn(w),$=An(w),R=Mn(w),_=s?{top:A(yt.top+it.top+$.top+R.bleed.top),right:A(yt.right+it.right+$.right+R.bleed.right),bottom:A(yt.bottom+it.bottom+$.bottom+R.bleed.bottom),left:A(yt.left+it.left+$.left+R.bleed.left)}:{top:0,right:0,bottom:0,left:0};Z=A(Z-_.left),v=A(v-_.top),tt=A(tt+_.right),et=A(et+_.bottom);let O=Math.max(1,A(tt-Z)),nt=Math.max(1,A(et-v)),at=P||U?A(N/k):1,Ht=U||P?A(E/C):1,ct=Math.max(1,A(O*at)),qt=Math.max(1,A(nt*Ht)),Mt="http://www.w3.org/2000/svg",vt=W()?1:0,Y=A(vt+(o?0:1)),K=document.createElementNS(Mt,"foreignObject"),_n=A(Z),Wn=A(v);K.setAttribute("x",String(A(-(_n-Y)))),K.setAttribute("y",String(A(-(Wn-Y)))),K.setAttribute("width",String(A(k+Y*2))),K.setAttribute("height",String(A(C+Y*2))),K.style.overflow="visible";let ge=document.createElement("style");ge.textContent=r.baseCSS+r.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+r.classCSS,K.appendChild(ge);let lt=document.createElement("div");lt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),lt.style.width=`${A(k)}px`,lt.style.height=`${A(C)}px`,lt.style.overflow="visible",r.clone.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),lt.appendChild(r.clone),K.appendChild(lt);let Un=new XMLSerializer().serializeToString(K),jt=A(O+Y*2),Vt=A(nt+Y*2),ye=P||U;e.meta={w0:k,h0:C,vbW:jt,vbH:Vt,targetW:N,targetH:E};let On=W()&&ye?jt:A(ct+Y*2),Bn=W()&&ye?Vt:A(qt+Y*2);p=`<svg xmlns="${Mt}" width="${On}" height="${Bn}" viewBox="0 0 ${jt} ${Vt}">`+Un+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,r={svgString:p,dataURL:d,...r},g()},{fast:n})}),await q("afterRender",r);let b=document.getElementById("snapdom-sandbox");return b&&b.style.position==="absolute"&&b.remove(),r.dataURL}function cr(t){return In(t)}function lr(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function Rn(t={}){let e=t.format??"png";e==="jpg"&&(e="jpeg");let n=lr(t.cache);return{debug:t.debug??!1,fast:t.fast??!0,scale:t.scale??1,exclude:t.exclude??[],excludeMode:t.excludeMode??"hide",filter:t.filter??null,filterMode:t.filterMode??"hide",placeholders:t.placeholders!==!1,embedFonts:t.embedFonts??!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fallbackURL:t.fallbackURL??void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:e,type:t.type??"svg",quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(e)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1}}function ur(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function fr(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function dr(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function mr(t){let e=[],n="",o=0;for(let s=0;s<t.length;s++){let r=t[s];r==="("&&o++,r===")"&&(o=Math.max(0,o-1)),r===";"&&o===0?(e.push(n),n=""):n+=r}return n.trim()&&e.push(n),e.map(s=>s.trim()).filter(Boolean)}function pr(t){let e=[],n="",o=0;for(let r=0;r<t.length;r++){let i=t[r];i==="("&&o++,i===")"&&(o=Math.max(0,o-1)),i===","&&o===0?(e.push(n.trim()),n=""):n+=i}n.trim()&&e.push(n.trim());let s=[];for(let r of e){if(/\binset\b/i.test(r))continue;let i=r.match(/-?\d+(?:\.\d+)?px/gi)||[],[l="0px",c="0px",a="0px"]=i,u=r.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!u&&u!==",";s.push(`drop-shadow(${l} ${c} ${a}${d?` ${u}`:""})`)}return s.join(" ")}function Nn(t){let e=mr(t),n=null,o=null,s=null,r=[];for(let l of e){let c=l.indexOf(":");if(c<0)continue;let a=l.slice(0,c).trim().toLowerCase(),u=l.slice(c+1).trim();a==="box-shadow"?s=u:a==="filter"?n=u:a==="-webkit-filter"?o=u:r.push([a,u])}if(s){let l=pr(s);l&&(n=n?`${n} ${l}`:l,o=o?`${o} ${l}`:l)}let i=[...r];return n&&i.push(["filter",n]),o&&i.push(["-webkit-filter",o]),i.map(([l,c])=>`${l}:${c}`).join(";")}function hr(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${Nn(o)}}`)}function gr(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,hr(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${Nn(o)}${n}`),t}function yr(t){if(!W()||!ur(t))return t;try{let e=fr(t),n=gr(e);return dr(n)}catch{return t}}async function X(t,e){let{width:n,height:o,scale:s=1,dpr:r=1,meta:i={},backgroundColor:l}=e;t=yr(t);let c=new Image;c.loading="eager",c.decoding="sync",c.crossOrigin="anonymous",c.src=t,await c.decode();let a=c.naturalWidth,u=c.naturalHeight,d=Number.isFinite(i.w0)?i.w0:a,p=Number.isFinite(i.h0)?i.h0:u,h,y,f=Number.isFinite(n),m=Number.isFinite(o);if(f&&m)h=Math.max(1,n),y=Math.max(1,o);else if(f){let w=n/Math.max(1,d);h=n,y=p*w}else if(m){let w=o/Math.max(1,p);y=o,h=d*w}else h=a,y=u;h=h*s,y=y*s;let b=document.createElement("canvas");b.width=h*r,b.height=y*r,b.style.width=`${h}px`,b.style.height=`${y}px`;let g=b.getContext("2d");return r!==1&&g.scale(r,r),l&&(g.save(),g.fillStyle=l,g.fillRect(0,0,h,y),g.restore()),g.drawImage(c,0,0,h,y),b}async function z(t,e){let n=await X(t,e),o=new Image;return o.src=n.toDataURL(`image/${e.format}`,e.quality),await o.decode(),o.style.width=`${n.width/e.dpr}px`,o.style.height=`${n.height/e.dpr}px`,o}async function gt(t,e){let{scale:n=1,width:o,height:s,meta:r={}}=e,i=Number.isFinite(o),l=Number.isFinite(s),c=Number.isFinite(n)&&n!==1||i||l;if(W()&&c)return await z(t,{...e,format:"png",quality:1,meta:r});let a=new Image;if(a.decoding="sync",a.loading="eager",a.src=t,await a.decode(),i&&l)a.style.width=`${o}px`,a.style.height=`${s}px`;else if(i){let u=Number.isFinite(r.w0)?r.w0:a.naturalWidth,d=Number.isFinite(r.h0)?r.h0:a.naturalHeight,p=o/Math.max(1,u);a.style.width=`${o}px`,a.style.height=`${Math.round(d*p)}px`}else if(l){let u=Number.isFinite(r.w0)?r.w0:a.naturalWidth,d=Number.isFinite(r.h0)?r.h0:a.naturalHeight,p=s/Math.max(1,d);a.style.height=`${s}px`,a.style.width=`${Math.round(u*p)}px`}else{let u=Math.round(a.naturalWidth*n),d=Math.round(a.naturalHeight*n);if(a.style.width=`${u}px`,a.style.height=`${d}px`,typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let h=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${u}"`).replace(/height="[^"]*"/,`height="${d}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h)}`,a.src=t}catch{}}return a}async function At(t,e){let n=e.type;if(n==="svg"){let s=decodeURIComponent(t.split(",")[1]);return new Blob([s],{type:"image/svg+xml"})}let o=await X(t,e);return new Promise(s=>o.toBlob(r=>s(r),`image/${n}`,e.quality))}async function Tn(t,e){if(e.dpr=1,e.format==="svg"){let s=await At(t,{...e,type:"svg"}),r=URL.createObjectURL(s),i=document.createElement("a");i.href=r,i.download=e.filename,i.click(),URL.revokeObjectURL(r);return}let n=await X(t,e),o=document.createElement("a");o.href=n.toDataURL(`image/${e.format}`,e.quality),o.download=e.filename,o.click()}F.plugins=(...t)=>(fe(...t),F);var Pn=Symbol("snapdom.internal"),J=Symbol("snapdom.internal.silent"),he=!1;async function F(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=Rn(e);if(yn(n,e&&e.plugins),W()&&(n.embedFonts===!0||wr(t)))for(let o=0;o<3;o++)try{await br(t,e),console.log("safariWarmup:",o),he=!1}catch{}return n.iconFonts&&n.iconFonts.length>0&&Oe(n.iconFonts),n.snap||(n.snap={toPng:(o,s)=>F.toPng(o,s),toSvg:(o,s)=>F.toSvg(o,s)}),F.capture(t,n,Pn)}F.plugins=(...t)=>(fe(...t),F);F.capture=async(t,e,n)=>{if(n!==Pn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let o=await pe(t,e),s={img:async(f,m)=>gt(o,{...f,...m||{}}),svg:async(f,m)=>gt(o,{...f,...m||{}}),canvas:async(f,m)=>X(o,{...f,...m||{}}),blob:async(f,m)=>At(o,{...f,...m||{}}),png:async(f,m)=>z(o,{...f,...m||{},format:"png"}),jpeg:async(f,m)=>z(o,{...f,...m||{},format:"jpeg"}),webp:async(f,m)=>z(o,{...f,...m||{},format:"webp"}),download:async(f,m)=>Tn(o,{...f,...m||{}})},i={...e,export:{url:o},exports:{svg:f=>gt(o,{...e,...f||{},[J]:!0}),canvas:f=>X(o,{...e,...f||{},[J]:!0}),png:f=>z(o,{...e,...f||{},format:"png",[J]:!0}),jpeg:f=>z(o,{...e,...f||{},format:"jpeg",[J]:!0}),jpg:f=>z(o,{...e,...f||{},format:"jpeg",[J]:!0}),webp:f=>z(o,{...e,...f||{},format:"webp",[J]:!0}),blob:f=>At(o,{...e,...f||{},[J]:!0}),img:f=>gt(o,{...e,...f||{},[J]:!0})}},l=await gn("defineExports",i),c=Object.assign({},...l.filter(f=>f&&typeof f=="object")),a={...s,...c};a.jpeg&&!a.jpg&&(a.jpg=(f,m)=>a.jpeg(f,m));function u(f,m){let b={...e,...m||{}};return(f==="jpeg"||f==="jpg")&&(b.backgroundColor==null||b.backgroundColor==="transparent")&&(b.backgroundColor="#ffffff"),b}let d=!1,p=Promise.resolve();async function h(f,m){let b=async()=>{let g=a[f];if(!g)throw new Error(`[snapdom] Unknown export type: ${f}`);let w=u(f,m),S={...e,export:{type:f,options:w,url:o}};await q("beforeExport",S);let k=await g(S,w);return await q("afterExport",S,k),d||(d=!0,await q("afterSnap",e)),k};return p=p.then(b)}let y={url:o,toRaw:()=>o,to:(f,m)=>h(f,m),toImg:f=>h("img",f),toSvg:f=>h("svg",f),toCanvas:f=>h("canvas",f),toBlob:f=>h("blob",f),toPng:f=>h("png",f),toJpg:f=>h("jpg",f),toWebp:f=>h("webp",f),download:f=>h("download",f)};for(let f of Object.keys(a)){let m="to"+f.charAt(0).toUpperCase()+f.slice(1);y[m]||(y[m]=b=>h(f,b))}return y};F.toRaw=(t,e)=>F(t,e).then(n=>n.toRaw());F.toImg=(t,e)=>F(t,e).then(n=>n.toImg());F.toSvg=(t,e)=>F(t,e).then(n=>n.toSvg());F.toCanvas=(t,e)=>F(t,e).then(n=>n.toCanvas());F.toBlob=(t,e)=>F(t,e).then(n=>n.toBlob());F.toPng=(t,e)=>F(t,{...e,format:"png"}).then(n=>n.toPng());F.toJpg=(t,e)=>F(t,{...e,format:"jpeg"}).then(n=>n.toJpg());F.toWebp=(t,e)=>F(t,{...e,format:"webp"}).then(n=>n.toWebp());F.download=(t,e)=>F(t,e).then(n=>n.download());async function br(t,e){if(he)return;let n={...e,fast:!0,embedFonts:!0,scale:.2},o;try{o=await pe(t,n)}catch{}await new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s))),o&&await new Promise(s=>{let r=new Image;try{r.decoding="sync",r.loading="eager"}catch{}r.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",r.src=o,document.body.appendChild(r),(async()=>{try{typeof r.decode=="function"&&await r.decode()}catch{}let i=performance.now();for(;!(r.complete&&r.naturalWidth>0)&&performance.now()-i<900;)await new Promise(l=>setTimeout(l,50));await new Promise(l=>requestAnimationFrame(l));try{r.remove()}catch{}s()})()}),t.querySelectorAll("canvas").forEach(s=>{try{let r=s.getContext("2d",{willReadFrequently:!0});r&&r.getImageData(0,0,1,1)}catch{}}),he=!0}function wr(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,o=getComputedStyle(n),s=o.backgroundImage&&o.backgroundImage!=="none",r=o.maskImage&&o.maskImage!=="none"||o.webkitMaskImage&&o.webkitMaskImage!=="none";if(s||r||n.tagName==="CANVAS")return!0}return!1}async function xr(t=document,e={}){let{embedFonts:n=!0,useProxy:o=""}=e,s=e.cache??e.cacheOpt??"full";Ft(s);try{await document.fonts?.ready}catch{}try{Gt()}catch{}x.session=x.session||{},x.session.styleCache||(x.session.styleCache=new WeakMap),x.image=x.image||new Map,x.background=x.background||new Map;try{await Dt(t,void 0,x.session.styleCache,{useProxy:o})}catch{}let r=[],i=[];try{if(t&&t.nodeType===1){let c=t.querySelectorAll?Array.from(t.querySelectorAll("*")):[];i=[t,...c],r=[],t.tagName==="IMG"&&t.getAttribute("src")&&r.push(t),r.push(...Array.from(t.querySelectorAll?.("img[src]")||[]))}else t?.querySelectorAll&&(r=Array.from(t.querySelectorAll("img[src]")),i=Array.from(t.querySelectorAll("*")))}catch{}let l=[];for(let c of r){let a=c?.currentSrc||c?.src;if(a&&!x.image.has(a)){let u=Promise.resolve().then(async()=>{let d=await T(a,{as:"dataURL",useProxy:o});d?.ok&&typeof d.data=="string"&&x.image.set(a,d.data)}).catch(()=>{});l.push(u)}}for(let c of i){let a="";try{a=c?.style?.backgroundImage||"",(!a||a==="none")&&(a=st(c).backgroundImage)}catch{}if(a&&a!=="none"){let u=a.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let d of u){let p=Promise.resolve().then(()=>rt(d,{...e,useProxy:o})).catch(()=>{});l.push(p)}}}if(n)try{let c=Ut(t),a=Ot(t);if(typeof W=="function"?W():!!W){let d=new Set(Array.from(c).map(p=>String(p).split("__")[0]).filter(Boolean));await Bt(d,3)}await Wt({required:c,usedCodepoints:a,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:e.useProxy??o})}catch{}await Promise.allSettled(l)}export{xr as preCache,F as snapdom};