@zumer/snapdom 2.15.0-dev.0 → 2.15.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/plugins.mjs +1 -1
- package/dist/preCache.mjs +5 -5
- package/dist/snapdom.js +6 -6
- package/dist/snapdom.mjs +6 -6
- package/package.json +1 -1
package/dist/snapdom.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* SnapDOM
|
|
3
|
-
* v2.15.0-dev.
|
|
3
|
+
* v2.15.0-dev.1
|
|
4
4
|
* Author: Juan Martin Muda
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
|
-
var jr=Object.defineProperty;var
|
|
8
|
-
`;return n}function Ae(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let s of e)n.set(s,`c${r++}`);return n}function co(t){try{let e=t?.ownerDocument;if(!e)return typeof window<"u"?window:null;let n=e.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let r=0;r<window.frames.length;r++)try{if(window.frames[r]?.document===e)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function _(t,e=null){let n=()=>{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(!(t instanceof Element)){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(t,e)||n()}catch{return n()}return n()}let r=C.computedStyle.get(t);r||(r=new Map,C.computedStyle.set(t,r));let s=r.get(e);if(!s){let o=co(t),i=null;try{i=o&&typeof o.getComputedStyle=="function"?o.getComputedStyle(t,e):null}catch{}if(!i&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(i=window.getComputedStyle(t,e))}catch{}s=i||n(),r.set(e,s)}return s}function Jt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);for(let n of lo){let r=e[`border-${n}-style`],s=e[`border-${n}-width`];(r==="none"||r==="hidden"||s==="0px")&&(delete e[`border-${n}-style`],delete e[`border-${n}-width`],delete e[`border-${n}-color`])}return e}function St(t){let e=[],n=0,r=0;for(let s=0;s<t.length;s++){let o=t[s];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,s).trim()),r=s+1)}return e.push(t.slice(r).trim()),e}var Yt,Kt,Zr,to,eo,no,Ze,ro,oo,so,io,ao,lo,Zt=j(()=>{z();Yt=new Set(["meta","script","noscript","title","link","template"]),Kt=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"]),Zr=["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"];to=/(?:^|-)(animation|transition)(?:-|$)/i,eo=/^(--.+|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,no=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom"]),Ze=new Map;ro=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),oo=new Set(["table","thead","tbody","tfoot","tr","td","th"]),so=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),io=new Set(["width","max-width","inline-size","max-inline-size"]),ao=new Set(["min-width","min-inline-size"]);lo=["top","right","bottom","left"]});function tt(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function ke(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let t=navigator.userAgent||"",e=/iPhone|iPad|iPod/.test(t),n=navigator.maxTouchPoints>2&&/Macintosh/.test(t);return e||n}function D(){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"),r=/applewebkit/i.test(t),s=/mobile/i.test(t),o=!/safari/i.test(t),i=r&&s&&o,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),u=/ipad|iphone|ipod/.test(e)&&r;return n||i||a||l||u}function tn(){if(typeof navigator>"u")return!1;let t=(navigator.userAgent||"").toLowerCase();return t.includes("firefox")||t.includes("fxios")}var xt=j(()=>{});function R(t,e,n){let r=t&&typeof t=="object"&&(t.options||t);r&&r.debug&&(n!==void 0?console.warn("[snapdom]",e,n):console.warn("[snapdom]",e))}var ve=j(()=>{});var J=j(()=>{Je();Zt();xt();Tt();ve()});var Tr={};Rt(Tr,{toCanvas:()=>bt});function Hs(t){if(!Mr(t))return t;try{let e=Fr(t),n=e.match(/<svg\b[^>]*>/i);if(!n)return t;let r=n[0],s=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(s)||!Number.isFinite(o)||s<=0||o<=0)return t;let i=Math.min(1,Mt/s,Mt/o,Math.sqrt(Er/(s*o)));if(i>=1)return t;let a=Math.max(1,Math.floor(s*i)),l=Math.max(1,Math.floor(o*i));console.warn(`[snapDOM] Capture ${Math.round(s)}\xD7${Math.round(o)}px exceeds the browser image-decode limit (${Mt}px/side); downscaling to ${a}\xD7${l}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`);let u=e.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${l}`));return $r(u)}catch{return t}}function Mr(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 $r(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Ds(t){let e=[],n="",r=0;for(let s=0;s<t.length;s++){let o=t[s];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(e.push(n),n=""):n+=o}return n.trim()&&e.push(n),e.map(s=>s.trim()).filter(Boolean)}function zs(t){let e=[],n="",r=0;for(let o=0;o<t.length;o++){let i=t[o];i==="("&&r++,i===")"&&(r=Math.max(0,r-1)),i===","&&r===0?(e.push(n.trim()),n=""):n+=i}n.trim()&&e.push(n.trim());let s=[];for(let o of e){if(/\binset\b/i.test(o))continue;let i=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",l="0px",u="0px"]=i,c=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!c&&c!==",";s.push(`drop-shadow(${a} ${l} ${u}${f?` ${c}`:""})`)}return s.join(" ")}function Rr(t){let e=Ds(t),n=null,r=null,s=null,o=[];for(let a of e){let l=a.indexOf(":");if(l<0)continue;let u=a.slice(0,l).trim().toLowerCase(),c=a.slice(l+1).trim();u==="box-shadow"?s=c:u==="filter"?n=c:u==="-webkit-filter"?r=c:o.push([u,c])}if(s){let a=zs(s);a&&(n=n?`${n} ${a}`:a,r=r?`${r} ${a}`:a)}let i=[...o];return n&&i.push(["filter",n]),r&&i.push(["-webkit-filter",r]),i.map(([a,l])=>`${a}:${l}`).join(";")}function qs(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${Rr(r)}}`)}function Vs(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,qs(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${Rr(r)}${n}`),t}function js(t){if(!D()||!Mr(t))return t;try{let e=Fr(t),n=Vs(e);return $r(n)}catch{return t}}async function bt(t,e){let{width:n,height:r,scale:s=1,dpr:o=1,meta:i={},backgroundColor:a}=e;t=js(t),t=Hs(t);let l=new Image;if(l.loading="eager",l.decoding="sync",l.crossOrigin="anonymous",l.src=t,await l.decode(),D()){l.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(l);try{await new Promise(k=>requestAnimationFrame(()=>requestAnimationFrame(k)))}finally{try{l.remove()}catch{}}}let u=l.naturalWidth,c=l.naturalHeight,f=Number.isFinite(i.w0)?i.w0:u,d=Number.isFinite(i.h0)?i.h0:c,m,h,p=Number.isFinite(n),y=Number.isFinite(r);if(p&&y)m=Math.max(1,n),h=Math.max(1,r);else if(p){let k=n/Math.max(1,f);m=n,h=d*k}else if(y){let k=r/Math.max(1,d);h=r,m=f*k}else m=u,h=c;m=m*s,h=h*s;let g=m*o,w=h*o,S=Math.max(g/Mt,w/Mt,Math.sqrt(g*w/Er));S>1&&(console.warn(`[snapDOM] Output ${Math.round(g)}\xD7${Math.round(w)}px exceeds the browser canvas limit (${Mt}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),m/=S,h/=S);let b=document.createElement("canvas");b.width=m*o,b.height=h*o,b.style.width=`${m}px`,b.style.height=`${h}px`;let x=b.getContext("2d");return o!==1&&x.scale(o,o),a&&(x.save(),x.fillStyle=a,x.fillRect(0,0,m,h),x.restore()),x.drawImage(l,0,0,m,h),b}var Mt,Er,Ut=j(()=>{xt();Mt=16384,Er=16384*16384});var fe={};Rt(fe,{rasterize:()=>He});async function He(t,e){let n=await bt(t,e),r=new Image;return r.src=n.toDataURL(`image/${e.format}`,e.quality),await r.decode(),r.style.width=`${n.width/e.dpr}px`,r.style.height=`${n.height/e.dpr}px`,r}var Bt=j(()=>{Ut()});var De={};Rt(De,{toImg:()=>Xs,toSvg:()=>Xs});async function Xs(t,e){let{scale:n=1,width:r,height:s,meta:o={}}=e,i=Number.isFinite(r),a=Number.isFinite(s),l=Number.isFinite(n)&&n!==1||i||a;if(D()&&l)return await He(t,{...e,format:"png",quality:1,meta:o});let u=new Image;if(u.decoding="sync",u.loading="eager",u.src=t,await u.decode(),i&&a)u.style.width=`${r}px`,u.style.height=`${s}px`;else if(i){let c=Number.isFinite(o.w0)?o.w0:u.naturalWidth,f=Number.isFinite(o.h0)?o.h0:u.naturalHeight,d=r/Math.max(1,c);u.style.width=`${r}px`,u.style.height=`${Math.round(f*d)}px`}else if(a){let c=Number.isFinite(o.w0)?o.w0:u.naturalWidth,f=Number.isFinite(o.h0)?o.h0:u.naturalHeight,d=s/Math.max(1,f);u.style.height=`${s}px`,u.style.width=`${Math.round(c*d)}px`}else{let c=Math.round(u.naturalWidth*n),f=Math.round(u.naturalHeight*n);if(u.style.width=`${c}px`,u.style.height=`${f}px`,typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let m=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${c}"`).replace(/height="[^"]*"/,`height="${f}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,u.src=t}catch(d){R(e,"SVG width/height patch in toImg failed",d)}}return u}var ze=j(()=>{J();Bt()});var Lr={};Rt(Lr,{toBlob:()=>qe});async function qe(t,e){let n=e.type;if(n==="svg"){let s=decodeURIComponent(t.split(",")[1]);return new Blob([s],{type:"image/svg+xml"})}let r=await bt(t,e);return new Promise(s=>r.toBlob(o=>s(o),`image/${n}`,e.quality))}var Ve=j(()=>{Ut()});var Nr={};Rt(Nr,{download:()=>Gs});async function Pr(t,e){let n=new File([t],e,{type:t.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:e})}catch(r){if(r.name!=="AbortError")return!1}return!0}async function Gs(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(e?.type||"").toLowerCase(),s=n.has(r)?r:"",o=(e?.format||s||"").toLowerCase(),i=o==="jpg"?"jpeg":o||"png",a=e?.filename||`snapdom.${i}`,l={...e||{},format:i,type:i};l.dpr=1;let u=ke();if(i==="svg"){let d=await qe(t,{...l,type:"svg"});if(u&&await Pr(d,a))return;let m=URL.createObjectURL(d),h=document.createElement("a");h.href=m,h.download=a,document.body.appendChild(h),h.click(),URL.revokeObjectURL(m),h.remove();return}let c=await bt(t,l);if(u){let d=`image/${i}`,m=await new Promise(h=>c.toBlob(h,d,e?.quality));if(m&&await Pr(m,a))return}let f=document.createElement("a");f.href=c.toDataURL(`image/${i}`,e?.quality),f.download=a,document.body.appendChild(f),f.click(),f.remove()}var Ir=j(()=>{Ve();Ut();xt()});J();J();z();var en=new WeakMap,Nt=new Map,uo=2e3,Ee=0;function Pt(){Ee++,Nt.size>uo&&Nt.clear()}var nn=!1;function fo(t=document.documentElement){if(!nn){nn=!0;try{new MutationObserver(()=>Pt()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>Pt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let e=document.fonts;e&&(e.addEventListener?.("loadingdone",Pt),e.ready?.then(()=>Pt()).catch(()=>{}))}catch{}}}function mo(t,e={}){let n={},r=t.getPropertyValue("visibility"),s=e.excludeStyleProps;for(let f=0;f<t.length;f++){let d=t[f];if(Lt(d)||s&&(s instanceof RegExp&&s.test(d)||typeof s=="function"&&s(d)))continue;let m=t.getPropertyValue(d);(d==="background-image"||d==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),n[d]=m}let o=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let f of o)if(!n[f])try{let d=t.getPropertyValue(f);d&&(n[f]=d)}catch{}let i=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let f of i)if(!n[f])try{let d=t.getPropertyValue(f);d&&(n[f]=d)}catch{}if(e.embedFonts){let f=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let d of f)if(!n[d])try{let m=t.getPropertyValue(d);m&&(n[d]=m)}catch{}}r==="hidden"&&(n.opacity="0");try{(n["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(n.visibility="hidden")}catch{}let a=parseFloat(t.getPropertyValue("border-top-width")||0)||0,l=parseFloat(t.getPropertyValue("border-right-width")||0)||0,u=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,c=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(a===0&&l===0&&u===0&&c===0){let f=(t.getPropertyValue("border-image-source")||"").trim(),d=f&&f!=="none",m=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let h of m)delete n[h];d||(n.border="none")}return n}function po(t){if(t.firstElementChild)return!0;for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType===3&&/\S/.test(e.nodeValue||""))return!0;return!1}var rn=new WeakMap;function ho(t){let e=rn.get(t);return e||(e=Object.entries(t).sort((r,s)=>r[0]<s[0]?-1:r[0]>s[0]?1:0).map(([r,s])=>`${r}:${s}`).join(";"),rn.set(t,e),e)}function go(t,e=null,n={}){let r=en.get(t),s=!!(n&&n.embedFonts),o=n&&n.excludeStyleProps||null;if(r&&r.epoch===Ee&&r.embedFonts===s&&r.excludeStyleProps===o)return r.snapshot;let i=e||getComputedStyle(t),a=mo(i,n);return Co(t,i,a),en.set(t,{epoch:Ee,snapshot:a,embedFonts:s,excludeStyleProps:o}),a}function yo(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Nt,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:e||{}}:{session:C.session,persist:{snapshotKeyCache:Nt,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:t||e||{}}}function bo(t,e,n){if(!(!t.style||t.style.length===0))for(let r=0;r<t.style.length;r++){let s=t.style[r],o=n.getPropertyValue(s);o&&e.style.setProperty(s,o)}}async function st(t,e,n,r){if(t.tagName==="STYLE")return;let s=yo(n,r),o=s.options&&s.options.cache||"auto";o!=="disabled"&&fo(document.documentElement),o==="disabled"&&!s.session.__bumpedForDisabled&&(Pt(),Nt.clear(),s.session.__bumpedForDisabled=!0);let{session:i,persist:a}=s;if(!i.styleCache.has(t)){let p=null;try{p=getComputedStyle(t)}catch{}i.styleCache.set(t,p||getComputedStyle(document.documentElement))}let l=i.styleCache.get(t);t.getAttribute?.("style")&&bo(t,e,l);let u=go(t,l,s.options),c=on(t);if(c){let p=l.getPropertyValue("min-width");(!p||p==="auto"||p==="0px")&&(u["min-width"]="0px")}let f=t.tagName?.toLowerCase()||"div",d=ho(u),m=!0;Qt(f,(u.display||"").toLowerCase())&&(m=po(t),d=`${d}|${f}${m?"|c":""}${c?"|f":""}`);let h=a.snapshotKeyCache.get(d);h===void 0&&(h=wt(u,f,m,c),a.snapshotKeyCache.set(d,h)),i.styleMap.set(e,h)}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 So(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 on(t){let e=t.parentElement;if(!e)return!1;let n=_(e).display||"";return n.includes("flex")||n.includes("grid")}function xo(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,r=t.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let s=t.scrollHeight;if(s===0)return!1;let o=parseFloat(e.paddingTop)||0,i=parseFloat(e.paddingBottom)||0;return s>o+i}function Co(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let r=t.tagName&&t.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r))return;let o=parseFloat(e.height);if(Number.isFinite(o)&&t.scrollHeight>0&&Math.abs(o-t.scrollHeight)>2||e.aspectRatio&&e.aspectRatio!=="none"&&e.aspectRatio!=="auto")return;let a=e.display||"";if(a.includes("flex")||a.includes("grid")||wo(t))return;let l=e.position;if(l==="absolute"||l==="fixed"||l==="sticky"||e.transform!=="none"||So(e)||on(t))return;let u=e.overflowX||e.overflow||"visible",c=e.overflowY||e.overflow||"visible";if(u!=="visible"||c!=="visible")return;let f=e.clip;f&&f!=="auto"&&f!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||xo(t,e)&&(delete n.height,delete n["block-size"])}Zt();var an=["fill","stroke","color","background-color","stop-color"],Ao=new Set(["symbol","defs","pattern","mask","clipPath","marker","linearGradient","radialGradient","filter"]);function te(t){let e=t;for(;e&&e.nodeType===1;){if(e.namespaceURI==="http://www.w3.org/2000/svg"&&Ao.has(e.localName))return!0;e=e.parentNode}return!1}var sn=new Map;function ko(t,e){let n=e+"::"+t.toLowerCase(),r=sn.get(n);if(r)return r;let s=document,o=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(o),s.documentElement.appendChild(i);let a=getComputedStyle(o),l={};for(let u of an)l[u]=a.getPropertyValue(u)||"";return i.remove(),sn.set(n,l),l}function cn(t,e){if(!(t instanceof Element)||!(e instanceof Element)||te(t))return;let n=t.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&t.attributes?.length){let o=t.attributes;for(let i=0;i<o.length;i++){let a=o[i];if(a&&typeof a.value=="string"&&a.value.includes("var(")){r=!0;break}}}let s=null;if(r)try{s=getComputedStyle(t)}catch{}if(r){let o=t.style;if(o&&o.length){let i=new Set;for(let a=0;a<o.length;a++){let l=o[a];if(i.has(l))continue;i.add(l);let u=o.getPropertyValue(l);if(!u||!u.includes("var("))continue;let c=s&&s.getPropertyValue(l);if(c)try{e.style.setProperty(l,c.trim(),o.getPropertyPriority(l))}catch{}}}}if(r&&t.attributes?.length){let o=t.attributes;for(let i=0;i<o.length;i++){let a=o[i];if(!a||typeof a.value!="string"||!a.value.includes("var("))continue;let l=a.name,u=s&&s.getPropertyValue(l);if(u)try{e.style.setProperty(l,u.trim())}catch{}}}if(!r){if(!s)try{s=getComputedStyle(t)}catch{s=null}if(!s)return;let o=t.namespaceURI||"html",i=ko(t.tagName,o);for(let a of an){let l=s.getPropertyValue(a)||"",u=i[a]||"";if(l&&l!==u)try{e.style.setProperty(a,l.trim())}catch{}}}}J();J();z();ht();function ne(t,e,n){return Promise.all(t.map(r=>new Promise(s=>{function o(){tt(i=>{(i&&typeof i.timeRemaining=="function"?i.timeRemaining()>0:!0)?e(r,s):o()},{fast:n})}o()})))}function vo(t){return t=t.trim(),!t||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function Eo(t,e,n=!0){return t.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let s=n?vo(r):r;return`:where(${e} ${s})`}).join(", ")}function un(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,s,o)=>{let i=Eo(o,e,!0);return`${r}${s}${i}{`}),t):""}function fn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function dn(t){let e="";try{t.querySelectorAll("style").forEach(r=>{e+=(r.textContent||"")+`
|
|
7
|
+
var jr=Object.defineProperty;var G=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var Tt=(t,e)=>{for(var n in e)jr(t,n,{get:e[n],enumerable:!0})};function Ye(t){if(t===!0)return"soft";if(t===!1)return"disabled";if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="auto")return"auto";if(e==="full")return"full";if(e==="soft"||e==="disabled")return e}return"soft"}function Xt(t="soft"){switch(C.session.__counterEpoch=(C.session.__counterEpoch||0)+1,t){case"auto":{C.session.styleMap=new Map,C.session.nodeMap=new Map;return}case"soft":{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap,C.computedStyle=new WeakMap,C.measureHints=new WeakMap,C.baseStyle=new B(50),C.defaultStyle=new B(30),C.image=new B(100),C.background=new B(100),C.resource=new B(150),C.font=new Set;return}default:{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap;return}}}var B,C,H=G(()=>{B=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,n)}},C={image:new B(100),background:new B(100),resource:new B(150),defaultStyle:new B(30),baseStyle:new B(50),computedStyle:new WeakMap,measureHints:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function ht(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function ge(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let s=r.split(",").map(o=>o.trim());return s.length!==6?`matrix(${r})`:(s[4]="0",s[5]="0",`matrix(${s.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let s=r.split(",").map(o=>o.trim());return s.length!==16?`matrix3d(${r})`:(s[12]="0",s[13]="0",`matrix3d(${s.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function dt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function ye(t,e){if(!t||/^(data|blob|about|#)/i.test(t.trim()))return t;try{let n=e||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(t,n).href}catch{return t}}var Lt=G(()=>{});function Xr(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,s=0;function o(i,a,l){if(s>=n)return;let u=Date.now();(r.get(a)||0)>u||(r.set(a,u+e),s++,i==="warn"&&console&&console.warn?console.warn(`${t} ${l}`):console&&console.error&&console.error(`${t} ${l}`))}return{warnOnce(i,a){o("warn",i,a)},errorOnce(i,a){o("error",i,a)},reset(){r.clear(),s=0}}}function Gr(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Yr(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=e.includes("{url}")?e.split("{url}")[0]:e,s=new URL(r||".",n),o=new URL(t,n);if(o.origin===s.origin)return!0;let i=o.searchParams;if(i&&(i.has("url")||i.has("target")))return!0}catch{}return!1}function Kr(t,e){if(!e||Gr(t)||Yr(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!e}}function Qr(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",dt(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}${dt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Qe(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function Jr(t,e){return[e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,t].join("|")}async function U(t,e={}){let n=e.as??"blob",r=e.timeout??3e3,s=e.useProxy||"",o=e.errorTTL??8e3,i=e.headers||{},a=!!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[,g="",b=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],x=/;base64/i.test(g)?atob(b):decodeURIComponent(b),y=new Uint8Array([...x].map(k=>k.charCodeAt(0))),S=new Blob([y],{type:(g||"").split(";")[0]||""});return{ok:!0,data:S,status:200,url:t,fromCache:!1,mime:S.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let g=await fetch(t);if(!g.ok)return{ok:!1,data:null,status:g.status,url:t,fromCache:!1,reason:"http_error"};let b=await g.blob(),w=b.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Qe(b),status:g.status,url:t,fromCache:!1,mime:w}:n==="text"?{ok:!0,data:await b.text(),status:g.status,url:t,fromCache:!1,mime:w}:{ok:!0,data:b,status:g.status,url:t,fromCache:!1,mime:w}}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 l=Jr(t,{as:n,timeout:r,useProxy:s,errorTTL:o}),u=Gt.get(l);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&Gt.delete(l);let c=be.get(l);if(c)return c;let f=Kr(t,s)?Qr(t,s):t,m=e.credentials;if(!m)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",b=new URL(t,g);m=typeof location<"u"&&b.origin===location.origin?"include":"omit"}catch{m="omit"}let d=new AbortController,h=setTimeout(()=>d.abort("timeout"),r),p=(async()=>{try{let g=await fetch(f,{signal:d.signal,credentials:m,headers:i});if(!g.ok){let x={ok:!1,data:null,status:g.status,url:f,fromCache:!1,reason:"http_error"};if(o>0&&Gt.set(l,{until:Date.now()+o,result:x}),!a){let y=`${g.status} ${g.statusText||""}`.trim();Ke.warnOnce(`http:${g.status}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,`HTTP error ${y} while fetching ${n} ${t}`)}return e.onError&&e.onError(x),x}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:f,fromCache:!1};let b=await g.blob(),w=b.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Qe(b),status:g.status,url:f,fromCache:!1,mime:w}:{ok:!0,data:b,status:g.status,url:f,fromCache:!1,mime:w}}catch(g){let b=g&&typeof g=="object"&&"name"in g&&g.name==="AbortError"?String(g.message||"").includes("timeout")?"timeout":"abort":"network",w={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:b};if(!/^blob:/i.test(t)&&o>0&&Gt.set(l,{until:Date.now()+o,result:w}),!a){let x=`${b}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,y=b==="timeout"?`Timeout after ${r}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`;Ke.errorOnce(x,y)}return e.onError&&e.onError(w),w}finally{clearTimeout(h),be.delete(l)}})();return be.set(l,p),p}var Ke,be,Gt,gt=G(()=>{Lt();Ke=Xr("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),be=new Map,Gt=new Map});async function yt(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=ht(t);if(!r)return t;let s=ye(r),o=dt(s),i=(e.useProxy||"")+"|"+o;if(C.background.has(i)){let a=C.background.get(i);return a?`url("${a}")`:"none"}try{let a=await U(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(C.background.set(i,a.data),`url("${a.data}")`):(C.background.set(i,null),"none")}catch{return C.background.set(i,null),"none"}}var Je=G(()=>{H();Lt();gt()});function we(){for(let t of Zr){let e=String(t).toLowerCase();Yt.has(e)||Kt.has(e)||Se(e)}}function Se(t){if(t=String(t).toLowerCase(),Kt.has(t)){let o={};return C.defaultStyle.set(t,o),o}if(C.defaultStyle.has(t))return C.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 r=getComputedStyle(n),s={};for(let o of r){if(Pt(o))continue;let i=r.getPropertyValue(o);s[o]=i}return e.removeChild(n),C.defaultStyle.set(t,s),s}function Pt(t){let e=Ze.get(t);if(e===void 0){let n=String(t).toLowerCase();e=no.has(n)||eo.test(n)||to.test(n),Ze.set(t,e)}return e}function Qt(t,e){return!so.has(t)&&(e==="inline"||ro.has(t)||oo.has(t))}function St(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),Kt.has(e))return"";let s=[],o=Se(e),i=(t.display||"").toLowerCase(),a=i==="inline",u=Qt(e,i)&&n,c=!1;for(let f in t){if(Pt(f))continue;let m=t[f];if(u){if(io.has(f))continue;if(ao.has(f)){m&&m!==o[f]&&(s.push(`${f}:${m}`),m!=="auto"&&(c=!0));continue}}m&&m!==o[f]&&s.push(`${f}:${m}`)}if(u&&!a&&!r&&!c){let f=t.width;f&&f!=="auto"&&f!==o.width&&s.push(`min-width:${f}`)}return s.sort(),s.join(";")}function xe(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 Ce(t){let e=new Map;for(let r of t){let s=C.defaultStyle.get(r);if(!s)continue;let o=Object.entries(s).map(([i,a])=>`${i}:${a};`).sort().join("");o&&(e.has(o)||e.set(o,[]),e.get(o).push(r))}let n="";for(let[r,s]of e.entries())n+=`${s.join(",")} { ${r} }
|
|
8
|
+
`;return n}function Ae(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let s of e)n.set(s,`c${r++}`);return n}function co(t){try{let e=t?.ownerDocument;if(!e)return typeof window<"u"?window:null;let n=e.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let r=0;r<window.frames.length;r++)try{if(window.frames[r]?.document===e)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function I(t,e=null){let n=()=>{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(!(t instanceof Element)){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(t,e)||n()}catch{return n()}return n()}let r=C.computedStyle.get(t);r||(r=new Map,C.computedStyle.set(t,r));let s=r.get(e);if(!s){let o=co(t),i=null;try{i=o&&typeof o.getComputedStyle=="function"?o.getComputedStyle(t,e):null}catch{}if(!i&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(i=window.getComputedStyle(t,e))}catch{}s=i||n(),r.set(e,s)}return s}function Jt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);for(let n of lo){let r=e[`border-${n}-style`],s=e[`border-${n}-width`];(r==="none"||r==="hidden"||s==="0px")&&(delete e[`border-${n}-style`],delete e[`border-${n}-width`],delete e[`border-${n}-color`])}return e}function xt(t){let e=[],n=0,r=0;for(let s=0;s<t.length;s++){let o=t[s];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,s).trim()),r=s+1)}return e.push(t.slice(r).trim()),e}var Yt,Kt,Zr,to,eo,no,Ze,ro,oo,so,io,ao,lo,Zt=G(()=>{H();Yt=new Set(["meta","script","noscript","title","link","template"]),Kt=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"]),Zr=["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"];to=/(?:^|-)(animation|transition)(?:-|$)/i,eo=/^(--.+|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,no=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom"]),Ze=new Map;ro=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),oo=new Set(["table","thead","tbody","tfoot","tr","td","th"]),so=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),io=new Set(["width","max-width","inline-size","max-inline-size"]),ao=new Set(["min-width","min-inline-size"]);lo=["top","right","bottom","left"]});function tt(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function ke(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let t=navigator.userAgent||"",e=/iPhone|iPad|iPod/.test(t),n=navigator.maxTouchPoints>2&&/Macintosh/.test(t);return e||n}function D(){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"),r=/applewebkit/i.test(t),s=/mobile/i.test(t),o=!/safari/i.test(t),i=r&&s&&o,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),u=/ipad|iphone|ipod/.test(e)&&r;return n||i||a||l||u}function tn(){if(typeof navigator>"u")return!1;let t=(navigator.userAgent||"").toLowerCase();return t.includes("firefox")||t.includes("fxios")}var Ct=G(()=>{});function R(t,e,n){let r=t&&typeof t=="object"&&(t.options||t);r&&r.debug&&(n!==void 0?console.warn("[snapdom]",e,n):console.warn("[snapdom]",e))}var ve=G(()=>{});var J=G(()=>{Je();Zt();Ct();Lt();ve()});var Tr={};Tt(Tr,{toCanvas:()=>wt});function Ds(t){if(!Er(t))return t;try{let e=Fr(t),n=e.match(/<svg\b[^>]*>/i);if(!n)return t;let r=n[0],s=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(s)||!Number.isFinite(o)||s<=0||o<=0)return t;let i=Math.min(1,Ft/s,Ft/o,Math.sqrt(Mr/(s*o)));if(i>=1)return t;let a=Math.max(1,Math.floor(s*i)),l=Math.max(1,Math.floor(o*i));console.warn(`[snapDOM] Capture ${Math.round(s)}\xD7${Math.round(o)}px exceeds the browser image-decode limit (${Ft}px/side); downscaling to ${a}\xD7${l}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`);let u=e.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${l}`));return $r(u)}catch{return t}}function Er(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 $r(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Hs(t){let e=[],n="",r=0;for(let s=0;s<t.length;s++){let o=t[s];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(e.push(n),n=""):n+=o}return n.trim()&&e.push(n),e.map(s=>s.trim()).filter(Boolean)}function zs(t){let e=[],n="",r=0;for(let o=0;o<t.length;o++){let i=t[o];i==="("&&r++,i===")"&&(r=Math.max(0,r-1)),i===","&&r===0?(e.push(n.trim()),n=""):n+=i}n.trim()&&e.push(n.trim());let s=[];for(let o of e){if(/\binset\b/i.test(o))continue;let i=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",l="0px",u="0px"]=i,c=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!c&&c!==",";s.push(`drop-shadow(${a} ${l} ${u}${f?` ${c}`:""})`)}return s.join(" ")}function Rr(t){let e=Hs(t),n=null,r=null,s=null,o=[];for(let a of e){let l=a.indexOf(":");if(l<0)continue;let u=a.slice(0,l).trim().toLowerCase(),c=a.slice(l+1).trim();u==="box-shadow"?s=c:u==="filter"?n=c:u==="-webkit-filter"?r=c:o.push([u,c])}if(s){let a=zs(s);a&&(n=n?`${n} ${a}`:a,r=r?`${r} ${a}`:a)}let i=[...o];return n&&i.push(["filter",n]),r&&i.push(["-webkit-filter",r]),i.map(([a,l])=>`${a}:${l}`).join(";")}function qs(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${Rr(r)}}`)}function Vs(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,qs(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${Rr(r)}${n}`),t}function js(t){if(!D()||!Er(t))return t;try{let e=Fr(t),n=Vs(e);return $r(n)}catch{return t}}async function wt(t,e){let{width:n,height:r,scale:s=1,dpr:o=1,meta:i={},backgroundColor:a}=e;t=js(t),t=Ds(t);let l=new Image;if(l.loading="eager",l.decoding="sync",l.crossOrigin="anonymous",l.src=t,await l.decode(),D()){l.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(l);try{await new Promise(k=>requestAnimationFrame(()=>requestAnimationFrame(k)))}finally{try{l.remove()}catch{}}}let u=l.naturalWidth,c=l.naturalHeight,f=Number.isFinite(i.w0)?i.w0:u,m=Number.isFinite(i.h0)?i.h0:c,d,h,p=Number.isFinite(n),g=Number.isFinite(r);if(p&&g)d=Math.max(1,n),h=Math.max(1,r);else if(p){let k=n/Math.max(1,f);d=n,h=m*k}else if(g){let k=r/Math.max(1,m);h=r,d=f*k}else d=u,h=c;d=d*s,h=h*s;let b=d*o,w=h*o,x=Math.max(b/Ft,w/Ft,Math.sqrt(b*w/Mr));x>1&&(console.warn(`[snapDOM] Output ${Math.round(b)}\xD7${Math.round(w)}px exceeds the browser canvas limit (${Ft}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),d/=x,h/=x);let y=document.createElement("canvas");y.width=d*o,y.height=h*o,y.style.width=`${d}px`,y.style.height=`${h}px`;let S=y.getContext("2d");return o!==1&&S.scale(o,o),a&&(S.save(),S.fillStyle=a,S.fillRect(0,0,d,h),S.restore()),S.drawImage(l,0,0,d,h),y}var Ft,Mr,Bt=G(()=>{Ct();Ft=16384,Mr=16384*16384});var fe={};Tt(fe,{rasterize:()=>De});async function De(t,e){let n=await wt(t,e),r=new Image;return r.src=n.toDataURL(`image/${e.format}`,e.quality),await r.decode(),r.style.width=`${n.width/e.dpr}px`,r.style.height=`${n.height/e.dpr}px`,r}var Dt=G(()=>{Bt()});var He={};Tt(He,{toImg:()=>Xs,toSvg:()=>Xs});async function Xs(t,e){let{scale:n=1,width:r,height:s,meta:o={}}=e,i=Number.isFinite(r),a=Number.isFinite(s),l=Number.isFinite(n)&&n!==1||i||a;if(D()&&l)return await De(t,{...e,format:"png",quality:1,meta:o});let u=new Image;if(u.decoding="sync",u.loading="eager",u.src=t,await u.decode(),i&&a)u.style.width=`${r}px`,u.style.height=`${s}px`;else if(i){let c=Number.isFinite(o.w0)?o.w0:u.naturalWidth,f=Number.isFinite(o.h0)?o.h0:u.naturalHeight,m=r/Math.max(1,c);u.style.width=`${r}px`,u.style.height=`${Math.round(f*m)}px`}else if(a){let c=Number.isFinite(o.w0)?o.w0:u.naturalWidth,f=Number.isFinite(o.h0)?o.h0:u.naturalHeight,m=s/Math.max(1,f);u.style.height=`${s}px`,u.style.width=`${Math.round(c*m)}px`}else{let c=Math.round(u.naturalWidth*n),f=Math.round(u.naturalHeight*n);if(u.style.width=`${c}px`,u.style.height=`${f}px`,typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let d=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${c}"`).replace(/height="[^"]*"/,`height="${f}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,u.src=t}catch(m){R(e,"SVG width/height patch in toImg failed",m)}}return u}var ze=G(()=>{J();Dt()});var Lr={};Tt(Lr,{toBlob:()=>qe});async function qe(t,e){let n=e.type;if(n==="svg"){let s=decodeURIComponent(t.split(",")[1]);return new Blob([s],{type:"image/svg+xml"})}let r=await wt(t,e);return new Promise(s=>r.toBlob(o=>s(o),`image/${n}`,e.quality))}var Ve=G(()=>{Bt()});var Nr={};Tt(Nr,{download:()=>Gs});async function Pr(t,e){let n=new File([t],e,{type:t.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:e})}catch(r){if(r.name!=="AbortError")return!1}return!0}async function Gs(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(e?.type||"").toLowerCase(),s=n.has(r)?r:"",o=(e?.format||s||"").toLowerCase(),i=o==="jpg"?"jpeg":o||"png",a=e?.filename||`snapdom.${i}`,l={...e||{},format:i,type:i};l.dpr=1;let u=ke();if(i==="svg"){let m=await qe(t,{...l,type:"svg"});if(u&&await Pr(m,a))return;let d=URL.createObjectURL(m),h=document.createElement("a");h.href=d,h.download=a,document.body.appendChild(h),h.click(),URL.revokeObjectURL(d),h.remove();return}let c=await wt(t,l);if(u){let m=`image/${i}`,d=await new Promise(h=>c.toBlob(h,m,e?.quality));if(d&&await Pr(d,a))return}let f=document.createElement("a");f.href=c.toDataURL(`image/${i}`,e?.quality),f.download=a,document.body.appendChild(f),f.click(),f.remove()}var Ir=G(()=>{Ve();Bt();Ct()});J();J();H();var en=new WeakMap,It=new Map,uo=2e3,Me=0;function Nt(){Me++,It.size>uo&&It.clear()}var nn=!1;function fo(t=document.documentElement){if(!nn){nn=!0;try{new MutationObserver(()=>Nt()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>Nt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let e=document.fonts;e&&(e.addEventListener?.("loadingdone",Nt),e.ready?.then(()=>Nt()).catch(()=>{}))}catch{}}}function mo(t,e={}){let n={},r=t.getPropertyValue("visibility"),s=e.excludeStyleProps;for(let f=0;f<t.length;f++){let m=t[f];if(Pt(m)||s&&(s instanceof RegExp&&s.test(m)||typeof s=="function"&&s(m)))continue;let d=t.getPropertyValue(m);(m==="background-image"||m==="content")&&d.includes("url(")&&!d.includes("data:")&&(d="none"),n[m]=d}let o=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let f of o)if(!n[f])try{let m=t.getPropertyValue(f);m&&(n[f]=m)}catch{}let i=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let f of i)if(!n[f])try{let m=t.getPropertyValue(f);m&&(n[f]=m)}catch{}if(e.embedFonts){let f=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let m of f)if(!n[m])try{let d=t.getPropertyValue(m);d&&(n[m]=d)}catch{}}r==="hidden"&&(n.opacity="0");try{(n["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(n.visibility="hidden")}catch{}let a=parseFloat(t.getPropertyValue("border-top-width")||0)||0,l=parseFloat(t.getPropertyValue("border-right-width")||0)||0,u=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,c=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(a===0&&l===0&&u===0&&c===0){let f=(t.getPropertyValue("border-image-source")||"").trim(),m=f&&f!=="none",d=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let h of d)delete n[h];m||(n.border="none")}return n}function po(t){if(t.firstElementChild)return!0;for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType===3&&/\S/.test(e.nodeValue||""))return!0;return!1}var rn=new WeakMap;function ho(t){let e=rn.get(t);return e||(e=Object.entries(t).sort((r,s)=>r[0]<s[0]?-1:r[0]>s[0]?1:0).map(([r,s])=>`${r}:${s}`).join(";"),rn.set(t,e),e)}function go(t,e=null,n={}){let r=en.get(t),s=!!(n&&n.embedFonts),o=n&&n.excludeStyleProps||null;if(r&&r.epoch===Me&&r.embedFonts===s&&r.excludeStyleProps===o)return r.snapshot;let i=e||getComputedStyle(t),a=mo(i,n);return Co(t,i,a),en.set(t,{epoch:Me,snapshot:a,embedFonts:s,excludeStyleProps:o}),a}function yo(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:It,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:e||{}}:{session:C.session,persist:{snapshotKeyCache:It,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:t||e||{}}}function bo(t,e,n){if(!(!t.style||t.style.length===0))for(let r=0;r<t.style.length;r++){let s=t.style[r],o=n.getPropertyValue(s);o&&e.style.setProperty(s,o)}}async function it(t,e,n,r){if(t.tagName==="STYLE")return;let s=yo(n,r),o=s.options&&s.options.cache||"auto";o!=="disabled"&&fo(document.documentElement),o==="disabled"&&!s.session.__bumpedForDisabled&&(Nt(),It.clear(),s.session.__bumpedForDisabled=!0);let{session:i,persist:a}=s;if(!i.styleCache.has(t)){let p=null;try{p=getComputedStyle(t)}catch{}i.styleCache.set(t,p||getComputedStyle(document.documentElement))}let l=i.styleCache.get(t);t.getAttribute?.("style")&&bo(t,e,l);let u=go(t,l,s.options),c=on(t);if(c){let p=l.getPropertyValue("min-width");(!p||p==="auto"||p==="0px")&&(u["min-width"]="0px")}let f=t.tagName?.toLowerCase()||"div",m=ho(u),d=!0;Qt(f,(u.display||"").toLowerCase())&&(d=po(t),m=`${m}|${f}${d?"|c":""}${c?"|f":""}`);let h=a.snapshotKeyCache.get(m);h===void 0&&(h=St(u,f,d,c),a.snapshotKeyCache.set(m,h)),i.styleMap.set(e,h)}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 So(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 on(t){let e=t.parentElement;if(!e)return!1;let n=I(e).display||"";return n.includes("flex")||n.includes("grid")}function xo(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,r=t.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let s=t.scrollHeight;if(s===0)return!1;let o=parseFloat(e.paddingTop)||0,i=parseFloat(e.paddingBottom)||0;return s>o+i}function Co(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let r=t.tagName&&t.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r))return;let o=parseFloat(e.height);if(Number.isFinite(o)&&t.scrollHeight>0&&Math.abs(o-t.scrollHeight)>2||e.aspectRatio&&e.aspectRatio!=="none"&&e.aspectRatio!=="auto")return;let a=e.display||"";if(a.includes("flex")||a.includes("grid")||wo(t))return;let l=e.position;if(l==="absolute"||l==="fixed"||l==="sticky"||e.transform!=="none"||So(e)||on(t))return;let u=e.overflowX||e.overflow||"visible",c=e.overflowY||e.overflow||"visible";if(u!=="visible"||c!=="visible")return;let f=e.clip;f&&f!=="auto"&&f!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||xo(t,e)&&(delete n.height,delete n["block-size"])}Zt();var an=["fill","stroke","color","background-color","stop-color"],Ao=new Set(["symbol","defs","pattern","mask","clipPath","marker","linearGradient","radialGradient","filter"]);function te(t){let e=t;for(;e&&e.nodeType===1;){if(e.namespaceURI==="http://www.w3.org/2000/svg"&&Ao.has(e.localName))return!0;e=e.parentNode}return!1}var sn=new Map;function ko(t,e){let n=e+"::"+t.toLowerCase(),r=sn.get(n);if(r)return r;let s=document,o=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(o),s.documentElement.appendChild(i);let a=getComputedStyle(o),l={};for(let u of an)l[u]=a.getPropertyValue(u)||"";return i.remove(),sn.set(n,l),l}function cn(t,e){if(!(t instanceof Element)||!(e instanceof Element)||te(t))return;let n=t.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&t.attributes?.length){let o=t.attributes;for(let i=0;i<o.length;i++){let a=o[i];if(a&&typeof a.value=="string"&&a.value.includes("var(")){r=!0;break}}}let s=null;if(r)try{s=getComputedStyle(t)}catch{}if(r){let o=t.style;if(o&&o.length){let i=new Set;for(let a=0;a<o.length;a++){let l=o[a];if(i.has(l))continue;i.add(l);let u=o.getPropertyValue(l);if(!u||!u.includes("var("))continue;let c=s&&s.getPropertyValue(l);if(c)try{e.style.setProperty(l,c.trim(),o.getPropertyPriority(l))}catch{}}}}if(r&&t.attributes?.length){let o=t.attributes;for(let i=0;i<o.length;i++){let a=o[i];if(!a||typeof a.value!="string"||!a.value.includes("var("))continue;let l=a.name,u=s&&s.getPropertyValue(l);if(u)try{e.style.setProperty(l,u.trim())}catch{}}}if(!r){if(!s)try{s=getComputedStyle(t)}catch{s=null}if(!s)return;let o=t.namespaceURI||"html",i=ko(t.tagName,o);for(let a of an){let l=s.getPropertyValue(a)||"",u=i[a]||"";if(l&&l!==u)try{e.style.setProperty(a,l.trim())}catch{}}}}J();J();H();gt();function ne(t,e,n){return Promise.all(t.map(r=>new Promise(s=>{function o(){tt(i=>{(i&&typeof i.timeRemaining=="function"?i.timeRemaining()>0:!0)?e(r,s):o()},{fast:n})}o()})))}function vo(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(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let s=n?vo(r):r;return`:where(${e} ${s})`}).join(", ")}function un(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,s,o)=>{let i=Mo(o,e,!0);return`${r}${s}${i}{`}),t):""}function fn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function dn(t){let e="";try{t.querySelectorAll("style").forEach(r=>{e+=(r.textContent||"")+`
|
|
9
9
|
`});let n=t.adoptedStyleSheets||[];for(let r of n)try{if(r&&r.cssRules)for(let s of r.cssRules)e+=s.cssText+`
|
|
10
|
-
`}catch{}}catch{}return e}function mn(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function pn(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 hn(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function
|
|
11
|
-
`:""}function yn(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 Fo(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),s=0;for(;s<e&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),s++;return r&&(r.body||r.documentElement)?r:null}function $o(t){let e=t.getBoundingClientRect(),n=0,r=0,s=0,o=0;try{let l=getComputedStyle(t);n=parseFloat(l.borderLeftWidth)||0,r=parseFloat(l.borderRightWidth)||0,s=parseFloat(l.borderTopWidth)||0,o=parseFloat(l.borderBottomWidth)||0}catch{}let i=Math.max(0,Math.round(e.width-(n+r))),a=Math.max(0,Math.round(e.height-(s+o)));return{contentWidth:i,contentHeight:a,rect:e}}function it(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let r=getComputedStyle(t);if(e===0){let s=parseFloat(r.width);!isNaN(s)&&s>0&&(e=s)}if(n===0){let s=parseFloat(r.height);!isNaN(s)&&s>0&&(n=s)}}catch{}if(e===0||n===0)try{if(e===0){let r=parseFloat(t.getAttribute("width"));!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(t.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}function Ro(t,e,n){let r=t.defaultView,s=r?r.scrollX:0,o=r?r.scrollY:0,i=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,l=t.documentElement?t.documentElement.scrollLeft:0,u=t.documentElement?t.documentElement.scrollTop:0,c=t.createElement("style");return c.setAttribute("data-sd-iframe-pin",""),c.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(c),()=>{try{c.remove()}catch{}try{r&&typeof r.scrollTo=="function"&&r.scrollTo(s,o),t.body&&(t.body.scrollLeft=i,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=l,t.documentElement.scrollTop=u)}catch{}}}async function bn(t,e,n){let r=await Fo(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:s,contentHeight:o,rect:i}=$o(t),a=n?.snap;if(!a&&typeof window<"u"&&window.snapdom&&(a=window.snapdom),!a||typeof a.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let l={...n,scale:1},u=Ro(r,s,o),c;try{c=await a.toPng(r.documentElement,l)}finally{u()}c.style.display="block",c.style.width=`${s}px`,c.style.height=`${o}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),st(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(i.width)}px`),f.style.height||(f.style.height=`${Math.round(i.height)}px`),f.appendChild(c),f}function wn(t){let{width:e,height:n}=it(t),r=t.getBoundingClientRect(),s;try{s=window.getComputedStyle(t)}catch{}let o=s?parseFloat(s.width):NaN,i=s?parseFloat(s.height):NaN,a=Math.round(e||r.width||0),l=Math.round(n||r.height||0),u=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,a||16),c=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,l||16),f=(t.type||"text").toLowerCase()==="checkbox",d=!!t.checked,m=!!t.indeterminate,p=Math.max(Math.min(u,c),12),y="middle";try{s&&s.verticalAlign&&(y=s.verticalAlign)}catch{}let g=document.createElement("div");g.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),g.style.cssText=`display:inline-block;width:${p}px;height:${p}px;vertical-align:${y};flex-shrink:0;line-height:0;`;let w=document.createElementNS("http://www.w3.org/2000/svg","svg");w.setAttribute("width",String(p)),w.setAttribute("height",String(p)),w.setAttribute("viewBox",`0 0 ${p} ${p}`),g.appendChild(w);function S(){let b="#0a6ed1";try{s&&(b=s.accentColor||s.color||b)}catch{}let x=2,k=x/2,A=p-x;if(w.innerHTML="",f){let v=document.createElementNS("http://www.w3.org/2000/svg","rect");if(v.setAttribute("x",String(k)),v.setAttribute("y",String(k)),v.setAttribute("width",String(A)),v.setAttribute("height",String(A)),v.setAttribute("rx","2"),v.setAttribute("ry","2"),v.setAttribute("fill",d?b:"none"),v.setAttribute("stroke",b),v.setAttribute("stroke-width",String(x)),w.appendChild(v),d){let E=document.createElementNS("http://www.w3.org/2000/svg","path");E.setAttribute("d",`M ${k+2} ${p/2} L ${p/2-1} ${p-k-2} L ${p-k-2} ${k+2}`),E.setAttribute("stroke","white"),E.setAttribute("stroke-width",String(Math.max(1.5,x))),E.setAttribute("fill","none"),E.setAttribute("stroke-linecap","round"),E.setAttribute("stroke-linejoin","round"),w.appendChild(E)}else if(m){let E=document.createElementNS("http://www.w3.org/2000/svg","rect"),P=Math.max(6,A-4);E.setAttribute("x",String((p-P)/2)),E.setAttribute("y",String((p-x)/2)),E.setAttribute("width",String(P)),E.setAttribute("height",String(x)),E.setAttribute("fill",b),E.setAttribute("rx","1"),w.appendChild(E)}}else{let v=document.createElementNS("http://www.w3.org/2000/svg","circle");if(v.setAttribute("cx",String(p/2)),v.setAttribute("cy",String(p/2)),v.setAttribute("r",String((p-x)/2)),v.setAttribute("fill",d?b:"none"),v.setAttribute("stroke",b),v.setAttribute("stroke-width",String(x)),w.appendChild(v),d){let E=document.createElementNS("http://www.w3.org/2000/svg","circle"),P=Math.max(2,(p-x*2)*.35);E.setAttribute("cx",String(p/2)),E.setAttribute("cy",String(p/2)),E.setAttribute("r",String(P)),E.setAttribute("fill","white"),w.appendChild(E)}}g.style.setProperty("width",`${p}px`,"important"),g.style.setProperty("height",`${p}px`,"important"),g.style.setProperty("min-width",`${p}px`,"important"),g.style.setProperty("min-height",`${p}px`,"important")}return S(),{el:g,applyVisual:S}}var It=new H(80);async function _t(t){if(C.resource?.has(t))return C.resource.get(t);if(It.has(t))return It.get(t);let e=(async()=>{let n=await B(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return C.resource?.set(t,n.data),n.data})();It.set(t,e);try{let n=await e;return It.set(t,n),n}catch(n){throw It.delete(t),n}}var To=/\bblob:[^)"'\s]+/g;async function ln(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(To)||[]));if(e.length===0)return t;let n=t;for(let r of e)try{let s=await _t(r);n=n.split(r).join(s)}catch{}return n}function ee(t){return typeof t=="string"&&t.startsWith("blob:")}function Lo(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 Po(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}async function Sn(t,e=null){if(!t)return;let n=e,r=t.querySelectorAll?t.querySelectorAll("img"):[];for(let l of r)try{let c=l.getAttribute("src")||l.currentSrc||"";if(ee(c)){let d=await _t(c);l.setAttribute("src",d)}let f=l.getAttribute("srcset");if(f&&f.includes("blob:")){let d=Lo(f),m=!1;for(let h of d)if(ee(h.url))try{h.url=await _t(h.url),m=!0}catch(p){R(n,"blobUrlToDataUrl for srcset item failed",p)}m&&l.setAttribute("srcset",Po(d))}}catch(u){R(n,"resolveBlobUrls for img failed",u)}let s=t.querySelectorAll?t.querySelectorAll("image"):[];for(let l of s)try{let u="http://www.w3.org/1999/xlink",c=l.getAttribute("href")||l.getAttributeNS?.(u,"href");if(ee(c)){let f=await _t(c);l.setAttribute("href",f),l.removeAttributeNS?.(u,"href")}}catch(u){R(n,"resolveBlobUrls for SVG image href failed",u)}let o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let l of o)try{let u=l.getAttribute("style");if(u&&u.includes("blob:")){let c=await ln(u);l.setAttribute("style",c)}}catch(u){R(n,"replaceBlobUrls in inline style failed",u)}let i=t.querySelectorAll?t.querySelectorAll("style"):[];for(let l of i)try{let u=l.textContent||"";u.includes("blob:")&&(l.textContent=await ln(u))}catch(u){R(n,"replaceBlobUrls in style tag failed",u)}let a=["poster"];for(let l of a){let u=t.querySelectorAll?t.querySelectorAll(`[${l}^='blob:']`):[];for(let c of u)try{let f=c.getAttribute(l);ee(f)&&c.setAttribute(l,await _t(f))}catch(f){R(n,`resolveBlobUrls for ${l} failed`,f)}}}xt();function Me(t){let{width:e,height:n}=it(t),r=e,s=n;if(!r||!s){let i=t.getBoundingClientRect();r=r||i.width||0,s=s||i.height||0}let o=document.createElement("div");return o.style.cssText=`display:inline-block;width:${r}px;height:${s}px;visibility:hidden;`,o}async function Wt(t,e,n){if(!t)throw new Error("Invalid node");let r=new Set,s=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let c=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Yt.has(c))return null;if(c==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return R(e,"Nested <foreignObject> skipped (SVG spec limitation \u2014 not rendered by browsers)"),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")return Me(t);if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let c of n.exclude)try{if(t.matches?.(c)){if(n.excludeMode==="hide")return Me(t);if(n.excludeMode==="remove")return null}}catch(f){console.warn(`Invalid selector in exclude option: ${c}`,f)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide")return Me(t);if(n.filterMode==="remove")return null}}catch(c){console.warn("Error in filter function:",c)}if(t.tagName==="IFRAME"){let c=!1;try{c=!!(t.contentDocument||t.contentWindow?.document)}catch(f){R(e,"iframe same-origin probe failed",f)}if(c)try{return await bn(t,e,n)}catch(f){console.warn("[SnapDOM] iframe rasterization failed, fallback:",f)}if(c||console.warn("[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.",t),n.placeholders){let{width:f,height:d}=it(t),m=document.createElement("div");return m.style.cssText=`width:${f}px;height:${d}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,m,e,n),m}else{let{width:f,height:d}=it(t),m=document.createElement("div");return m.style.cssText=`display:inline-block;width:${f}px;height:${d}px;visibility:hidden;`,st(t,m,e,n),m}}if(t.getAttribute("data-capture")==="placeholder"){let c=t.cloneNode(!1);e.nodeMap.set(c,t),st(t,c,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;",c.appendChild(f),c}if(t.tagName==="CANVAS"){let c="";try{let h=t.getContext("2d",{willReadFrequently:!0});try{h&&h.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),c=t.toDataURL("image/png"),!c||c==="data:,"){try{h&&h.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),c=t.toDataURL("image/png"),!c||c==="data:,"){let p=document.createElement("canvas");p.width=t.width,p.height=t.height;let y=p.getContext("2d");y&&(y.drawImage(t,0,0),c=p.toDataURL("image/png"))}}}catch(h){R(e,"Canvas toDataURL failed, using empty/fallback",h)}let f=document.createElement("img");try{f.decoding="sync",f.loading="eager"}catch(h){R(e,"img decoding/loading hints failed",h)}c&&(f.src=c),f.width=t.width,f.height=t.height;let{width:d,height:m}=it(t);return d>0&&(f.style.width=`${d}px`),m>0&&(f.style.height=`${m}px`),e.nodeMap.set(f,t),st(t,f,e,n),f}if(t.tagName==="VIDEO"){let c="";try{let h=document.createElement("canvas");h.width=t.videoWidth||t.offsetWidth||320,h.height=t.videoHeight||t.offsetHeight||240;let p=h.getContext("2d");p&&(p.drawImage(t,0,0,h.width,h.height),c=h.toDataURL("image/png"),(!c||c==="data:,")&&(c=""))}catch(h){R(e,"Video frame capture failed, using poster fallback",h)}let f=document.createElement("img");try{f.decoding="sync",f.loading="eager"}catch{}c?f.src=c:t.poster&&(f.src=t.poster),f.width=t.videoWidth||t.offsetWidth||0,f.height=t.videoHeight||t.offsetHeight||0;let{width:d,height:m}=it(t);return d>0&&(f.style.width=`${d}px`),m>0&&(f.style.height=`${m}px`),f.style.objectFit="contain",e.nodeMap.set(f,t),st(t,f,e,n),f}let i;try{if(i=t.cloneNode(!1),i.attributes?.length)try{for(let c of i.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(c.value)&&i.setAttribute(c.name,c.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(cn(t,i),e.nodeMap.set(i,t),t.tagName==="IMG"){pn(t,i);try{let{width:c,height:f}=it(t),d=Math.round(c||0),m=Math.round(f||0);d&&(i.dataset.snapdomWidth=String(d)),m&&(i.dataset.snapdomHeight=String(m))}catch(c){R(e,"getUnscaledDimensions for IMG failed",c)}try{let c=t.getAttribute("style")||"",f=window.getComputedStyle(t),d=S=>{let b=c.match(new RegExp(`${S}\\s*:\\s*([^;]+)`,"i")),x=b?b[1].trim():f.getPropertyValue(S);return/%|auto/i.test(String(x||""))},m=parseInt(i.dataset.snapdomWidth||"0",10),h=parseInt(i.dataset.snapdomHeight||"0",10),p=d("width")||!m,y=d("height")||!h;p&&m&&(i.style.width=`${m}px`),y&&h&&(i.style.height=`${h}px`);let g=f.getPropertyValue("object-fit"),w=f.getPropertyValue("object-position");g&&g!=="fill"?(i.style.objectFit=g,w&&(i.style.objectPosition=w)):(m&&(i.style.minWidth=`${m}px`),h&&(i.style.minHeight=`${h}px`))}catch(c){R(e,"IMG dimension freeze failed",c)}}}catch(c){throw console.error("[Snapdom] Failed to clone node:",t,c),c}let a=null;if(t instanceof HTMLTextAreaElement){let{width:c,height:f}=it(t),d=c||t.getBoundingClientRect().width||0,m=f||t.getBoundingClientRect().height||0;d&&(i.style.width=`${d}px`),m&&(i.style.height=`${m}px`)}if(t instanceof HTMLInputElement){let c=(t.type||"text").toLowerCase();if((c==="checkbox"||c==="radio")&&tn()){let{el:d,applyVisual:m}=wn(t);e.nodeMap.set(d,t),a=m,i=d}else 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))}if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!t.value&&t.placeholder)try{let c=window.getComputedStyle(t,"::placeholder"),f=c&&c.color;if(f&&f!=="rgba(0, 0, 0, 0)"){let d="snapdom-ph-"+(Math.random()*1e6|0);i.classList.add(d);let m=document.createElement("style");m.textContent=`.${d}::placeholder{color:${f}!important;opacity:${c.opacity||"1"}!important;-webkit-text-fill-color:${f}!important;}`,i.prepend(m)}}catch{}if(t instanceof HTMLSelectElement&&(s=t.value),t instanceof HTMLTextAreaElement&&(o=t.value),t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement){t.disabled&&i.setAttribute("disabled",""),t.required&&i.setAttribute("required",""),t.readOnly&&i.setAttribute("readonly","");let c=t;c.min!==void 0&&c.min!==""&&i.setAttribute("min",c.min),c.max!==void 0&&c.max!==""&&i.setAttribute("max",c.max),c.pattern!==void 0&&c.pattern!==""&&i.setAttribute("pattern",c.pattern);let f=t.getAttribute("aria-invalid");f!==null&&i.setAttribute("aria-invalid",f)}if(te(t)||st(t,i,e,n),a&&a(),t instanceof SVGElement&&!te(t)){let c=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let f=window.getComputedStyle(t);for(let d of c){let m=f.getPropertyValue(d);m&&i.style.setProperty(d,m)}}catch{}}if(t.shadowRoot){let g=function(S,b){if(S.nodeType===Node.ELEMENT_NODE&&S.tagName==="STYLE")return b(null);Wt(S,e,n).then(x=>{b(x||null)}).catch(()=>{b(null)})};try{let S=t.shadowRoot.querySelectorAll("slot");for(let b of S){let x=[];try{x=b.assignedNodes?.({flatten:!0})||b.assignedNodes?.()||[]}catch{x=b.assignedNodes?.()||[]}for(let k of x)r.add(k)}}catch{}let c=fn(e),f=`[data-sd="${c}"]`;try{i.setAttribute("data-sd",c)}catch{}let d=dn(t.shadowRoot),m=un(d,f),h=hn(d),p=gn(t,h,f);mn(i,p+m,c);let y=document.createDocumentFragment(),w=await ne(Array.from(t.shadowRoot.childNodes),g,n.fast);y.append(...w.filter(S=>!!S)),i.appendChild(y)}if(t.tagName==="SLOT"){let m=function(p,y){Wt(p,e,n).then(g=>{g&&yn(g),y(g||null)}).catch(()=>{y(null)})},c=t.assignedNodes?.({flatten:!0})||[],f=c.length>0?c:Array.from(t.childNodes),d=document.createDocumentFragment(),h=await ne(Array.from(f),m,n.fast);return d.append(...h.filter(p=>!!p)),d}function l(c,f){if(r.has(c))return f(null);Wt(c,e,n).then(d=>{f(d||null)}).catch(()=>{f(null)})}let u=await ne(Array.from(t.childNodes),l,n.fast);if(i.append(...u.filter(c=>!!c)),s!==null&&i instanceof HTMLSelectElement){i.value=s;for(let c of i.options)c.value===s?c.setAttribute("selected",""):c.removeAttribute("selected")}return o!==null&&i instanceof HTMLTextAreaElement&&(i.textContent=o),i}J();Tt();z();z();var No=[/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],Ct=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__||{}),Fe=[];function Io(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Cn(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?Fe.push(n):typeof n=="string"?Fe.push(new RegExp(Io(n),"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function Z(t){let e=typeof t=="string"?t:"",n=[...No,...Fe];for(let r of n)if(r instanceof RegExp&&r.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 _o(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var xn=new Map;function Wo(t=""){let e=Object.create(null),n=String(t||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,s;for(;s=r.exec(n);)e[s[1].toUpperCase()]=Number(s[2]);return e}async function Oo(t,e,n){let r=String(t||""),s=r.toLowerCase(),o=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(s)&&!/\bsymbols\b/.test(s))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(s))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),l="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?l="rounded":/\bsharp\b/.test(o)?l="sharp":/\boutlined\b/.test(o)&&(l="outlined");let u=a===1,c=null;if(u&&(l==="outlined"&&Ct.materialIconsFilled?c={url:Ct.materialIconsFilled,alias:"snapdom-mi-filled"}:l==="rounded"&&Ct.materialIconsRound?c={url:Ct.materialIconsRound,alias:"snapdom-mi-round"}:l==="sharp"&&Ct.materialIconsSharp&&(c={url:Ct.materialIconsSharp,alias:"snapdom-mi-sharp"})),!c)return{familyForMeasure:r,familyForCanvas:r};if(!xn.has(c.alias))try{let d=new FontFace(c.alias,`url(${c.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),xn.set(c.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let f=`"${c.alias}"`;return{familyForMeasure:f,familyForCanvas:f}}async function Uo(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function Bo(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 r=t.color?.trim();return r&&r!=="inherit"?r:"#000"}async function Ho(t,{family:e="Material Icons",weight:n="normal",fontSize:r=32,color:s="#000",variation:o="",className:i=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),l=window.devicePixelRatio||1,u=Wo(o),{familyForMeasure:c,familyForCanvas:f}=await Oo(a,i,u);await Uo(f.replace(/^["']+|["']+$/g,""),r);let d=document.createElement("span");d.textContent=t,d.style.position="absolute",d.style.visibility="hidden",d.style.left="-99999px",d.style.whiteSpace="nowrap",d.style.fontFamily=c,d.style.fontWeight=String(n||"normal"),d.style.fontSize=`${r}px`,d.style.lineHeight="1",d.style.margin="0",d.style.padding="0",d.style.fontFeatureSettings="'liga' 1",d.style.fontVariantLigatures="normal",d.style.color=s,document.body.appendChild(d);let m=d.getBoundingClientRect(),h=Math.max(1,Math.ceil(m.width)),p=Math.max(1,Math.ceil(m.height));document.body.removeChild(d);let y=document.createElement("canvas");y.width=h*l,y.height=p*l;let g=y.getContext("2d");g.scale(l,l),g.font=`${n?`${n} `:""}${r}px ${f}`,g.textAlign="left",g.textBaseline="top",g.fillStyle=s;try{g.fontKerning="normal"}catch{}return g.fillText(t,0,0),{dataUrl:y.toDataURL(),width:h,height:p}}async function An(t,e){if(!(t instanceof Element))return 0;let n='.material-icons, [class*="material-symbols"]',r=Array.from(t.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim());if(r.length===0)return 0;let s=C.session.nodeMap,o=e instanceof Element?Array.from(e.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],i=0;for(let a=0;a<r.length;a++){let l=r[a],u=s&&s.get(l)||o[a]||null;try{let c=getComputedStyle(u||l),f=c.fontFamily||"Material Icons";if(!_o(f))continue;let d=(u||l).textContent.trim();if(!d)continue;let m=parseInt(c.fontSize,10)||24,h=c.fontWeight&&c.fontWeight!=="normal"?c.fontWeight:"normal",p=Bo(c),y=c.fontVariationSettings&&c.fontVariationSettings!=="normal"?c.fontVariationSettings:"",g=(u||l).className||"",{dataUrl:w,width:S,height:b}=await Ho(d,{family:f,weight:h,fontSize:m,color:p,variation:y,className:g});l.textContent="";let x=l.ownerDocument.createElement("img");x.src=w,x.alt=d,x.style.height=`${m}px`,x.style.width=`${Math.max(1,Math.round(S/b*m))}px`,x.style.objectFit="contain",x.style.verticalAlign=getComputedStyle(l).verticalAlign||"baseline",l.appendChild(x),i++}catch{}}return i}ht();async function En(t,e,n,r=32,s="#000"){e=e.replace(/^['"]+|['"]+$/g,"");let o=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=`${r}px`,i.style.lineHeight="1",i.style.whiteSpace="nowrap",i.style.padding="0",i.style.margin="0",document.body.appendChild(i);let a=i.getBoundingClientRect(),l=Math.ceil(a.width),u=Math.ceil(a.height);document.body.removeChild(i);let c=document.createElement("canvas");c.width=Math.max(1,l*o),c.height=Math.max(1,u*o);let f=c.getContext("2d");return f.scale(o,o),f.font=n?`${n} ${r}px "${e}"`:`${r}px "${e}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=s,f.fillText(t,0,0),{dataUrl:c.toDataURL(),width:l,height:u}}var Mn=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Do=["katex","mathjax","mathml"];function Re(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Mn.has(n.toLowerCase()))return n}return""}function zo(t){if(!t)return[];let e=[];for(let n of t.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(Mn.has(r.toLowerCase())||e.push(r))}return e}function re(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 oe(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function qo(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Vo(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let s=re(n[1]),o=re(n[2]);return{min:Math.min(s,o),max:Math.max(s,o)}}let r=re(e);return{min:r,max:r}}function jo(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Xo(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),i=parseFloat(n[2]);return{min:Math.min(o,i),max:Math.max(o,i)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),s=r?parseFloat(r[1]):100;return{min:s,max:s}}function Go(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function Yo(t,e,n=[]){if(!t)return!1;try{let r=new URL(t,location.href);if(r.origin===location.origin)return!0;let o=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(l=>o.endsWith(l))||n.some(l=>o===l.toLowerCase()||o.endsWith("."+l.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||Do.some(l=>a.includes(l)))return!0;for(let l of e){let u=l.toLowerCase().replace(/\s+/g,"+"),c=l.toLowerCase().replace(/\s+/g,"-"),f=Go(l);if(a.includes(u)||a.includes(c)||f&&a.includes(f))return!0}return!1}catch{return!1}}function Ko(t){let e=new Set;for(let n of t||[]){let r=String(n).split("__")[0]?.trim();r&&e.add(r)}return e}function kn(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,s)=>{let o=(s||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let i=o;try{i=new URL(o,e||location.href).href}catch{}return`url("${i}")`})}var $e=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,se=4;async function Qo(t,e,n){if(!t)return t;let r=new Set;function s(a,l){try{return new URL(a,l||location.href).href}catch{return a}}async function o(a,l,u=0){if(u>se)return console.warn(`[snapDOM] @import depth exceeded (${se}) at ${l}`),a;let c="",f=0,d;for(;d=$e.exec(a);){c+=a.slice(f,d.index),f=$e.lastIndex;let m=(d[2]||d[4]||"").trim(),h=s(m,l);if(r.has(h)){console.warn(`[snapDOM] Skipping circular @import: ${h}`);continue}r.add(h);let p="";try{let y=await B(h,{as:"text",useProxy:n,silent:!0});y.ok&&typeof y.data=="string"&&(p=y.data)}catch{}p?(p=kn(p,h),p=await o(p,h,u+1),c+=`
|
|
10
|
+
`}catch{}}catch{}return e}function mn(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function pn(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 hn(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function Eo(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch{}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch{}return""}function gn(t,e,n){let r=[];for(let s of e){let o=Eo(t,s);o&&r.push(`${s}: ${o};`)}return r.length?`${n}{${r.join("")}}
|
|
11
|
+
`:""}function yn(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 Fo(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),s=0;for(;s<e&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),s++;return r&&(r.body||r.documentElement)?r:null}function $o(t){let e=t.getBoundingClientRect(),n=0,r=0,s=0,o=0;try{let l=getComputedStyle(t);n=parseFloat(l.borderLeftWidth)||0,r=parseFloat(l.borderRightWidth)||0,s=parseFloat(l.borderTopWidth)||0,o=parseFloat(l.borderBottomWidth)||0}catch{}let i=Math.max(0,Math.round(e.width-(n+r))),a=Math.max(0,Math.round(e.height-(s+o)));return{contentWidth:i,contentHeight:a,rect:e}}function at(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let r=getComputedStyle(t);if(e===0){let s=parseFloat(r.width);!isNaN(s)&&s>0&&(e=s)}if(n===0){let s=parseFloat(r.height);!isNaN(s)&&s>0&&(n=s)}}catch{}if(e===0||n===0)try{if(e===0){let r=parseFloat(t.getAttribute("width"));!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(t.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}function Ro(t,e,n){let r=t.defaultView,s=r?r.scrollX:0,o=r?r.scrollY:0,i=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,l=t.documentElement?t.documentElement.scrollLeft:0,u=t.documentElement?t.documentElement.scrollTop:0,c=t.createElement("style");return c.setAttribute("data-sd-iframe-pin",""),c.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(c),()=>{try{c.remove()}catch{}try{r&&typeof r.scrollTo=="function"&&r.scrollTo(s,o),t.body&&(t.body.scrollLeft=i,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=l,t.documentElement.scrollTop=u)}catch{}}}async function bn(t,e,n){let r=await Fo(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:s,contentHeight:o,rect:i}=$o(t),a=n?.snap;if(!a&&typeof window<"u"&&window.snapdom&&(a=window.snapdom),!a||typeof a.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let l={...n,scale:1},u=Ro(r,s,o),c=C.session.nodeMap,f=C.session.styleMap,m=C.session.styleCache,d;try{d=await a.toPng(r.documentElement,l)}finally{u(),C.session.nodeMap=c,C.session.styleMap=f,C.session.styleCache=m}d.style.display="block",d.style.width=`${s}px`,d.style.height=`${o}px`;let h=document.createElement("div");return e.nodeMap.set(h,t),it(t,h,e,n),h.style.overflow="hidden",h.style.display="block",h.style.width||(h.style.width=`${Math.round(i.width)}px`),h.style.height||(h.style.height=`${Math.round(i.height)}px`),h.appendChild(d),h}function wn(t){let{width:e,height:n}=at(t),r=t.getBoundingClientRect(),s;try{s=window.getComputedStyle(t)}catch{}let o=s?parseFloat(s.width):NaN,i=s?parseFloat(s.height):NaN,a=Math.round(e||r.width||0),l=Math.round(n||r.height||0),u=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,a||16),c=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,l||16),f=(t.type||"text").toLowerCase()==="checkbox",m=!!t.checked,d=!!t.indeterminate,p=Math.max(Math.min(u,c),12),g="middle";try{s&&s.verticalAlign&&(g=s.verticalAlign)}catch{}let b=document.createElement("div");b.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),b.style.cssText=`display:inline-block;width:${p}px;height:${p}px;vertical-align:${g};flex-shrink:0;line-height:0;`;let w=document.createElementNS("http://www.w3.org/2000/svg","svg");w.setAttribute("width",String(p)),w.setAttribute("height",String(p)),w.setAttribute("viewBox",`0 0 ${p} ${p}`),b.appendChild(w);function x(){let y="#0a6ed1";try{s&&(y=s.accentColor||s.color||y)}catch{}let S=2,k=S/2,A=p-S;if(w.innerHTML="",f){let v=document.createElementNS("http://www.w3.org/2000/svg","rect");if(v.setAttribute("x",String(k)),v.setAttribute("y",String(k)),v.setAttribute("width",String(A)),v.setAttribute("height",String(A)),v.setAttribute("rx","2"),v.setAttribute("ry","2"),v.setAttribute("fill",m?y:"none"),v.setAttribute("stroke",y),v.setAttribute("stroke-width",String(S)),w.appendChild(v),m){let M=document.createElementNS("http://www.w3.org/2000/svg","path");M.setAttribute("d",`M ${k+2} ${p/2} L ${p/2-1} ${p-k-2} L ${p-k-2} ${k+2}`),M.setAttribute("stroke","white"),M.setAttribute("stroke-width",String(Math.max(1.5,S))),M.setAttribute("fill","none"),M.setAttribute("stroke-linecap","round"),M.setAttribute("stroke-linejoin","round"),w.appendChild(M)}else if(d){let M=document.createElementNS("http://www.w3.org/2000/svg","rect"),L=Math.max(6,A-4);M.setAttribute("x",String((p-L)/2)),M.setAttribute("y",String((p-S)/2)),M.setAttribute("width",String(L)),M.setAttribute("height",String(S)),M.setAttribute("fill",y),M.setAttribute("rx","1"),w.appendChild(M)}}else{let v=document.createElementNS("http://www.w3.org/2000/svg","circle");if(v.setAttribute("cx",String(p/2)),v.setAttribute("cy",String(p/2)),v.setAttribute("r",String((p-S)/2)),v.setAttribute("fill",m?y:"none"),v.setAttribute("stroke",y),v.setAttribute("stroke-width",String(S)),w.appendChild(v),m){let M=document.createElementNS("http://www.w3.org/2000/svg","circle"),L=Math.max(2,(p-S*2)*.35);M.setAttribute("cx",String(p/2)),M.setAttribute("cy",String(p/2)),M.setAttribute("r",String(L)),M.setAttribute("fill","white"),w.appendChild(M)}}b.style.setProperty("width",`${p}px`,"important"),b.style.setProperty("height",`${p}px`,"important"),b.style.setProperty("min-width",`${p}px`,"important"),b.style.setProperty("min-height",`${p}px`,"important")}return x(),{el:b,applyVisual:x}}var _t=new B(80);async function Wt(t){if(C.resource?.has(t))return C.resource.get(t);if(_t.has(t))return _t.get(t);let e=(async()=>{let n=await U(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return C.resource?.set(t,n.data),n.data})();_t.set(t,e);try{let n=await e;return _t.set(t,n),n}catch(n){throw _t.delete(t),n}}var To=/\bblob:[^)"'\s]+/g;async function ln(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(To)||[]));if(e.length===0)return t;let n=t;for(let r of e)try{let s=await Wt(r);n=n.split(r).join(s)}catch{}return n}function ee(t){return typeof t=="string"&&t.startsWith("blob:")}function Lo(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 Po(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}async function Sn(t,e=null){if(!t)return;let n=e,r=t.querySelectorAll?t.querySelectorAll("img"):[];for(let l of r)try{let c=l.getAttribute("src")||l.currentSrc||"";if(ee(c)){let m=await Wt(c);l.setAttribute("src",m)}let f=l.getAttribute("srcset");if(f&&f.includes("blob:")){let m=Lo(f),d=!1;for(let h of m)if(ee(h.url))try{h.url=await Wt(h.url),d=!0}catch(p){R(n,"blobUrlToDataUrl for srcset item failed",p)}d&&l.setAttribute("srcset",Po(m))}}catch(u){R(n,"resolveBlobUrls for img failed",u)}let s=t.querySelectorAll?t.querySelectorAll("image"):[];for(let l of s)try{let u="http://www.w3.org/1999/xlink",c=l.getAttribute("href")||l.getAttributeNS?.(u,"href");if(ee(c)){let f=await Wt(c);l.setAttribute("href",f),l.removeAttributeNS?.(u,"href")}}catch(u){R(n,"resolveBlobUrls for SVG image href failed",u)}let o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let l of o)try{let u=l.getAttribute("style");if(u&&u.includes("blob:")){let c=await ln(u);l.setAttribute("style",c)}}catch(u){R(n,"replaceBlobUrls in inline style failed",u)}let i=t.querySelectorAll?t.querySelectorAll("style"):[];for(let l of i)try{let u=l.textContent||"";u.includes("blob:")&&(l.textContent=await ln(u))}catch(u){R(n,"replaceBlobUrls in style tag failed",u)}let a=["poster"];for(let l of a){let u=t.querySelectorAll?t.querySelectorAll(`[${l}^='blob:']`):[];for(let c of u)try{let f=c.getAttribute(l);ee(f)&&c.setAttribute(l,await Wt(f))}catch(f){R(n,`resolveBlobUrls for ${l} failed`,f)}}}Ct();function Ee(t){let{width:e,height:n}=at(t),r=e,s=n;if(!r||!s){let i=t.getBoundingClientRect();r=r||i.width||0,s=s||i.height||0}let o=document.createElement("div");return o.style.cssText=`display:inline-block;width:${r}px;height:${s}px;visibility:hidden;`,o}async function Ot(t,e,n){if(!t)throw new Error("Invalid node");let r=new Set,s=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let c=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Yt.has(c))return null;if(c==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return R(e,"Nested <foreignObject> skipped (SVG spec limitation \u2014 not rendered by browsers)"),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")return Ee(t);if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let c of n.exclude)try{if(t.matches?.(c)){if(n.excludeMode==="hide")return Ee(t);if(n.excludeMode==="remove")return null}}catch(f){console.warn(`Invalid selector in exclude option: ${c}`,f)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide")return Ee(t);if(n.filterMode==="remove")return null}}catch(c){console.warn("Error in filter function:",c)}if(t.tagName==="IFRAME"){let c=!1;try{c=!!(t.contentDocument||t.contentWindow?.document)}catch(f){R(e,"iframe same-origin probe failed",f)}if(c)try{return await bn(t,e,n)}catch(f){console.warn("[SnapDOM] iframe rasterization failed, fallback:",f)}if(c||console.warn("[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.",t),n.placeholders){let{width:f,height:m}=at(t),d=document.createElement("div");return d.style.cssText=`width:${f}px;height:${m}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,it(t,d,e,n),d}else{let{width:f,height:m}=at(t),d=document.createElement("div");return d.style.cssText=`display:inline-block;width:${f}px;height:${m}px;visibility:hidden;`,it(t,d,e,n),d}}if(t.getAttribute("data-capture")==="placeholder"){let c=t.cloneNode(!1);e.nodeMap.set(c,t),it(t,c,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;",c.appendChild(f),c}if(t.tagName==="CANVAS"){let c="";try{let h=t.getContext("2d",{willReadFrequently:!0});try{h&&h.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),c=t.toDataURL("image/png"),!c||c==="data:,"){try{h&&h.getImageData(0,0,1,1)}catch{}if(await new Promise(p=>requestAnimationFrame(p)),c=t.toDataURL("image/png"),!c||c==="data:,"){let p=document.createElement("canvas");p.width=t.width,p.height=t.height;let g=p.getContext("2d");g&&(g.drawImage(t,0,0),c=p.toDataURL("image/png"))}}}catch(h){R(e,"Canvas toDataURL failed, using empty/fallback",h)}let f=document.createElement("img");try{f.decoding="sync",f.loading="eager"}catch(h){R(e,"img decoding/loading hints failed",h)}c&&(f.src=c),f.width=t.width,f.height=t.height;let{width:m,height:d}=at(t);return m>0&&(f.style.width=`${m}px`),d>0&&(f.style.height=`${d}px`),e.nodeMap.set(f,t),it(t,f,e,n),f}if(t.tagName==="VIDEO"){let c="";try{let h=document.createElement("canvas");h.width=t.videoWidth||t.offsetWidth||320,h.height=t.videoHeight||t.offsetHeight||240;let p=h.getContext("2d");p&&(p.drawImage(t,0,0,h.width,h.height),c=h.toDataURL("image/png"),(!c||c==="data:,")&&(c=""))}catch(h){R(e,"Video frame capture failed, using poster fallback",h)}let f=document.createElement("img");try{f.decoding="sync",f.loading="eager"}catch{}c?f.src=c:t.poster&&(f.src=t.poster),f.width=t.videoWidth||t.offsetWidth||0,f.height=t.videoHeight||t.offsetHeight||0;let{width:m,height:d}=at(t);return m>0&&(f.style.width=`${m}px`),d>0&&(f.style.height=`${d}px`),f.style.objectFit="contain",e.nodeMap.set(f,t),it(t,f,e,n),f}let i;try{if(i=t.cloneNode(!1),i.attributes?.length)try{for(let c of i.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(c.value)&&i.setAttribute(c.name,c.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(cn(t,i),e.nodeMap.set(i,t),t.tagName==="IMG"){pn(t,i);try{let{width:c,height:f}=at(t),m=Math.round(c||0),d=Math.round(f||0);m&&(i.dataset.snapdomWidth=String(m)),d&&(i.dataset.snapdomHeight=String(d))}catch(c){R(e,"getUnscaledDimensions for IMG failed",c)}try{let c=t.getAttribute("style")||"",f=window.getComputedStyle(t),m=x=>{let y=c.match(new RegExp(`${x}\\s*:\\s*([^;]+)`,"i")),S=y?y[1].trim():f.getPropertyValue(x);return/%|auto/i.test(String(S||""))},d=parseInt(i.dataset.snapdomWidth||"0",10),h=parseInt(i.dataset.snapdomHeight||"0",10),p=m("width")||!d,g=m("height")||!h;p&&d&&(i.style.width=`${d}px`),g&&h&&(i.style.height=`${h}px`);let b=f.getPropertyValue("object-fit"),w=f.getPropertyValue("object-position");b&&b!=="fill"?(i.style.objectFit=b,w&&(i.style.objectPosition=w)):(d&&(i.style.minWidth=`${d}px`),h&&(i.style.minHeight=`${h}px`))}catch(c){R(e,"IMG dimension freeze failed",c)}}}catch(c){throw console.error("[Snapdom] Failed to clone node:",t,c),c}let a=null;if(t instanceof HTMLTextAreaElement){let{width:c,height:f}=at(t),m=c||t.getBoundingClientRect().width||0,d=f||t.getBoundingClientRect().height||0;m&&(i.style.width=`${m}px`),d&&(i.style.height=`${d}px`)}if(t instanceof HTMLInputElement){let c=(t.type||"text").toLowerCase();if((c==="checkbox"||c==="radio")&&tn()){let{el:m,applyVisual:d}=wn(t);e.nodeMap.set(m,t),a=d,i=m}else 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))}if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!t.value&&t.placeholder)try{let c=window.getComputedStyle(t,"::placeholder"),f=c&&c.color;if(f&&f!=="rgba(0, 0, 0, 0)"){let m="snapdom-ph-"+(Math.random()*1e6|0);i.classList.add(m);let d=document.createElement("style");d.textContent=`.${m}::placeholder{color:${f}!important;opacity:${c.opacity||"1"}!important;-webkit-text-fill-color:${f}!important;}`,i.prepend(d)}}catch{}if(t instanceof HTMLSelectElement&&(s=t.value),t instanceof HTMLTextAreaElement&&(o=t.value),t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement){t.disabled&&i.setAttribute("disabled",""),t.required&&i.setAttribute("required",""),t.readOnly&&i.setAttribute("readonly","");let c=t;c.min!==void 0&&c.min!==""&&i.setAttribute("min",c.min),c.max!==void 0&&c.max!==""&&i.setAttribute("max",c.max),c.pattern!==void 0&&c.pattern!==""&&i.setAttribute("pattern",c.pattern);let f=t.getAttribute("aria-invalid");f!==null&&i.setAttribute("aria-invalid",f)}if(te(t)||it(t,i,e,n),a&&a(),t instanceof SVGElement&&!te(t)){let c=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let f=window.getComputedStyle(t);for(let m of c){let d=f.getPropertyValue(m);d&&i.style.setProperty(m,d)}}catch{}}if(t.shadowRoot){let b=function(x,y){if(x.nodeType===Node.ELEMENT_NODE&&x.tagName==="STYLE")return y(null);Ot(x,e,n).then(S=>{y(S||null)}).catch(()=>{y(null)})};try{let x=t.shadowRoot.querySelectorAll("slot");for(let y of x){let S=[];try{S=y.assignedNodes?.({flatten:!0})||y.assignedNodes?.()||[]}catch{S=y.assignedNodes?.()||[]}for(let k of S)r.add(k)}}catch{}let c=fn(e),f=`[data-sd="${c}"]`;try{i.setAttribute("data-sd",c)}catch{}let m=dn(t.shadowRoot),d=un(m,f),h=hn(m),p=gn(t,h,f);mn(i,p+d,c);let g=document.createDocumentFragment(),w=await ne(Array.from(t.shadowRoot.childNodes),b,n.fast);g.append(...w.filter(x=>!!x)),i.appendChild(g)}if(t.tagName==="SLOT"){let d=function(p,g){Ot(p,e,n).then(b=>{b&&yn(b),g(b||null)}).catch(()=>{g(null)})},c=t.assignedNodes?.({flatten:!0})||[],f=c.length>0?c:Array.from(t.childNodes),m=document.createDocumentFragment(),h=await ne(Array.from(f),d,n.fast);return m.append(...h.filter(p=>!!p)),m}function l(c,f){if(r.has(c))return f(null);Ot(c,e,n).then(m=>{f(m||null)}).catch(()=>{f(null)})}let u=await ne(Array.from(t.childNodes),l,n.fast);if(i.append(...u.filter(c=>!!c)),s!==null&&i instanceof HTMLSelectElement){i.value=s;for(let c of i.options)c.value===s?c.setAttribute("selected",""):c.removeAttribute("selected")}return o!==null&&i instanceof HTMLTextAreaElement&&(i.textContent=o),i}J();Lt();H();H();var No=[/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],At=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__||{}),Fe=[];function Io(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Cn(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?Fe.push(n):typeof n=="string"?Fe.push(new RegExp(Io(n),"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function Z(t){let e=typeof t=="string"?t:"",n=[...No,...Fe];for(let r of n)if(r instanceof RegExp&&r.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 _o(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var xn=new Map;function Wo(t=""){let e=Object.create(null),n=String(t||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,s;for(;s=r.exec(n);)e[s[1].toUpperCase()]=Number(s[2]);return e}async function Oo(t,e,n){let r=String(t||""),s=r.toLowerCase(),o=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(s)&&!/\bsymbols\b/.test(s))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(s))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),l="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?l="rounded":/\bsharp\b/.test(o)?l="sharp":/\boutlined\b/.test(o)&&(l="outlined");let u=a===1,c=null;if(u&&(l==="outlined"&&At.materialIconsFilled?c={url:At.materialIconsFilled,alias:"snapdom-mi-filled"}:l==="rounded"&&At.materialIconsRound?c={url:At.materialIconsRound,alias:"snapdom-mi-round"}:l==="sharp"&&At.materialIconsSharp&&(c={url:At.materialIconsSharp,alias:"snapdom-mi-sharp"})),!c)return{familyForMeasure:r,familyForCanvas:r};if(!xn.has(c.alias))try{let m=new FontFace(c.alias,`url(${c.url})`,{style:"normal",weight:"400"});document.fonts.add(m),await m.load(),xn.set(c.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let f=`"${c.alias}"`;return{familyForMeasure:f,familyForCanvas:f}}async function Uo(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function Bo(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 r=t.color?.trim();return r&&r!=="inherit"?r:"#000"}async function Do(t,{family:e="Material Icons",weight:n="normal",fontSize:r=32,color:s="#000",variation:o="",className:i=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),l=window.devicePixelRatio||1,u=Wo(o),{familyForMeasure:c,familyForCanvas:f}=await Oo(a,i,u);await Uo(f.replace(/^["']+|["']+$/g,""),r);let m=document.createElement("span");m.textContent=t,m.style.position="absolute",m.style.visibility="hidden",m.style.left="-99999px",m.style.whiteSpace="nowrap",m.style.fontFamily=c,m.style.fontWeight=String(n||"normal"),m.style.fontSize=`${r}px`,m.style.lineHeight="1",m.style.margin="0",m.style.padding="0",m.style.fontFeatureSettings="'liga' 1",m.style.fontVariantLigatures="normal",m.style.color=s,document.body.appendChild(m);let d=m.getBoundingClientRect(),h=Math.max(1,Math.ceil(d.width)),p=Math.max(1,Math.ceil(d.height));document.body.removeChild(m);let g=document.createElement("canvas");g.width=h*l,g.height=p*l;let b=g.getContext("2d");b.scale(l,l),b.font=`${n?`${n} `:""}${r}px ${f}`,b.textAlign="left",b.textBaseline="top",b.fillStyle=s;try{b.fontKerning="normal"}catch{}return b.fillText(t,0,0),{dataUrl:g.toDataURL(),width:h,height:p}}async function An(t,e){if(!(t instanceof Element))return 0;let n='.material-icons, [class*="material-symbols"]',r=Array.from(t.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim());if(r.length===0)return 0;let s=C.session.nodeMap,o=e instanceof Element?Array.from(e.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],i=0;for(let a=0;a<r.length;a++){let l=r[a],u=s&&s.get(l)||o[a]||null;try{let c=getComputedStyle(u||l),f=c.fontFamily||"Material Icons";if(!_o(f))continue;let m=(u||l).textContent.trim();if(!m)continue;let d=parseInt(c.fontSize,10)||24,h=c.fontWeight&&c.fontWeight!=="normal"?c.fontWeight:"normal",p=Bo(c),g=c.fontVariationSettings&&c.fontVariationSettings!=="normal"?c.fontVariationSettings:"",b=(u||l).className||"",{dataUrl:w,width:x,height:y}=await Do(m,{family:f,weight:h,fontSize:d,color:p,variation:g,className:b});l.textContent="";let S=l.ownerDocument.createElement("img");S.src=w,S.alt=m,S.style.height=`${d}px`,S.style.width=`${Math.max(1,Math.round(x/y*d))}px`,S.style.objectFit="contain",S.style.verticalAlign=getComputedStyle(l).verticalAlign||"baseline",l.appendChild(S),i++}catch{}}return i}gt();async function Mn(t,e,n,r=32,s="#000"){e=e.replace(/^['"]+|['"]+$/g,"");let o=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=`${r}px`,i.style.lineHeight="1",i.style.whiteSpace="nowrap",i.style.padding="0",i.style.margin="0",document.body.appendChild(i);let a=i.getBoundingClientRect(),l=Math.ceil(a.width),u=Math.ceil(a.height);document.body.removeChild(i);let c=document.createElement("canvas");c.width=Math.max(1,l*o),c.height=Math.max(1,u*o);let f=c.getContext("2d");return f.scale(o,o),f.font=n?`${n} ${r}px "${e}"`:`${r}px "${e}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=s,f.fillText(t,0,0),{dataUrl:c.toDataURL(),width:l,height:u}}var En=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Ho=["katex","mathjax","mathml"];function Re(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!En.has(n.toLowerCase()))return n}return""}function zo(t){if(!t)return[];let e=[];for(let n of t.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(En.has(r.toLowerCase())||e.push(r))}return e}function re(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 oe(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function qo(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Vo(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let s=re(n[1]),o=re(n[2]);return{min:Math.min(s,o),max:Math.max(s,o)}}let r=re(e);return{min:r,max:r}}function jo(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Xo(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),i=parseFloat(n[2]);return{min:Math.min(o,i),max:Math.max(o,i)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),s=r?parseFloat(r[1]):100;return{min:s,max:s}}function Go(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function Yo(t,e,n=[]){if(!t)return!1;try{let r=new URL(t,location.href);if(r.origin===location.origin)return!0;let o=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(l=>o.endsWith(l))||n.some(l=>o===l.toLowerCase()||o.endsWith("."+l.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||Ho.some(l=>a.includes(l)))return!0;for(let l of e){let u=l.toLowerCase().replace(/\s+/g,"+"),c=l.toLowerCase().replace(/\s+/g,"-"),f=Go(l);if(a.includes(u)||a.includes(c)||f&&a.includes(f))return!0}return!1}catch{return!1}}function Ko(t){let e=new Set;for(let n of t||[]){let r=String(n).split("__")[0]?.trim();r&&e.add(r)}return e}function kn(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,s)=>{let o=(s||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let i=o;try{i=new URL(o,e||location.href).href}catch{}return`url("${i}")`})}var $e=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,se=4;async function Qo(t,e,n){if(!t)return t;let r=new Set;function s(a,l){try{return new URL(a,l||location.href).href}catch{return a}}async function o(a,l,u=0){if(u>se)return console.warn(`[snapDOM] @import depth exceeded (${se}) at ${l}`),a;let c="",f=0,m;for(;m=$e.exec(a);){c+=a.slice(f,m.index),f=$e.lastIndex;let d=(m[2]||m[4]||"").trim(),h=s(d,l);if(r.has(h)){console.warn(`[snapDOM] Skipping circular @import: ${h}`);continue}r.add(h);let p="";try{let g=await U(h,{as:"text",useProxy:n,silent:!0});g.ok&&typeof g.data=="string"&&(p=g.data)}catch{}p?(p=kn(p,h),p=await o(p,h,u+1),c+=`
|
|
12
12
|
/* inlined: ${h} */
|
|
13
13
|
${p}
|
|
14
|
-
`):c+=d[0]}return c+=a.slice(f),c}let i=kn(t,e||location.href);return i=await o(i,e||location.href,0),i}var Fn=/url\((["']?)([^"')]+)\1\)/g,Jo=/@font-face[^{}]*\{[^}]*\}/g;function $n(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let s=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!s)continue;let o=s[1],i=s[2],a=l=>{if(!l.includes("?"))return parseInt(l,16);let u=parseInt(l.replace(/\?/g,"0"),16),c=parseInt(l.replace(/\?/g,"F"),16);return[u,c]};if(i){let l=a(o),u=a(i),c=Array.isArray(l)?l[0]:l,f=Array.isArray(u)?u[1]:u;e.push([Math.min(c,f),Math.max(c,f)])}else{let l=a(o);Array.isArray(l)?e.push([l[0],l[1]]):e.push([l,l])}}return e}function Rn(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,s]of e)if(n>=r&&n<=s)return!0;return!1}function Te(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(Fn)){let s=(r[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 Tn(t,e,n=""){let r=t;for(let s of t.matchAll(Fn)){let o=pt(s[0]);if(!o)continue;let i=o;if(!i.startsWith("http")&&!i.startsWith("data:"))try{i=new URL(i,e||location.href).href}catch{}if(!Z(i)){if(C.resource?.has(i)){C.font?.add(i),r=r.replace(s[0],`url(${C.resource.get(i)})`);continue}try{let a=await B(i,{as:"dataURL",useProxy:n,silent:!0});if(a.ok&&typeof a.data=="string"){let l=a.data;C.resource?.set(i,l),C.font?.add(i),r=r.replace(s[0],`url(${l})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",i)}}}return r}function Zo(t){if(!t.length)return null;let e=(a,l)=>t.some(([u,c])=>!(c<a||u>l)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),s=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":s?"greek":r?"latin-ext":n?"latin":null}function vn(t={}){let e=new Set((t.families||[]).map(s=>String(s).toLowerCase())),n=new Set((t.domains||[]).map(s=>String(s).toLowerCase())),r=new Set((t.subsets||[]).map(s=>String(s).toLowerCase()));return(s,o)=>{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(r.size){let i=Zo(o);if(i&&r.has(i))return!0}return!1}}function ts(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of t.match(e)||[]){let i=o.match(/font-family:\s*([^;]+);/i)?.[1]||"",a=Re(i),l=(o.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),u=(o.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),c=(o.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),f=(o.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),d=(o.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),m=Te(d,location.href),h=m.length?m.map(y=>String(y).toLowerCase()).sort().join("|"):d.toLowerCase(),p=[String(a||"").toLowerCase(),l,u,c,f.toLowerCase(),h].join("|");n.has(p)||(n.add(p),r.push(o))}if(r.length===0)return t;let s=0;return t.replace(e,()=>r[s++]||"")}function es(t,e,n,r,s){let o=Array.from(t||[]).sort().join("|"),i=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("|"),l=r||"",u=(s||[]).map(c=>String(c).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${o}::ex=${i}::lf=${a}::px=${l}::fd=${u}`}async function Ln(t,e,n,r){let s;try{s=t.cssRules||[]}catch{return}let o=(i,a)=>{try{return new URL(i,a||location.href).href}catch{return i}};for(let i of s){if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){let a=i.href?o(i.href,e):e;if(r.depth>=se){console.warn(`[snapDOM] CSSOM import depth exceeded (${se}) at ${a}`);continue}if(a&&r.visitedSheets.has(a)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${a}`);continue}a&&r.visitedSheets.add(a);let l={...r,depth:(r.depth||0)+1};await Ln(i.styleSheet,a,n,l);continue}if(i.type===CSSRule.FONT_FACE_RULE){let a=(i.style.getPropertyValue("font-family")||"").trim(),l=Re(a);if(!l||Z(l))continue;let u=(i.style.getPropertyValue("font-weight")||"400").trim(),c=(i.style.getPropertyValue("font-style")||"normal").trim(),f=(i.style.getPropertyValue("font-stretch")||"100%").trim(),d=(i.style.getPropertyValue("src")||"").trim(),m=(i.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(l,c,u,f))continue;let h=$n(m);if(!Rn(r.usedCodepoints,h))continue;let p={family:l,weightSpec:u,styleSpec:c,stretchSpec:f,unicodeRange:m,srcRaw:d,srcUrls:Te(d,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(p,h))continue;if(/url\(/i.test(d)){let y=await Tn(d,e||location.href,r.useProxy);await n(`@font-face{font-family:${l};src:${y};font-style:${c};font-weight:${u};font-stretch:${f};${m?`unicode-range:${m};`:""}}`)}else await n(`@font-face{font-family:${l};src:${d};font-style:${c};font-weight:${u};font-stretch:${f};${m?`unicode-range:${m};`:""}}`)}}}async function ie({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:s="",fontStylesheetDomains:o=[]}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let i=new Map;for(let g of t){let[w,S,b,x]=String(g).split("__");if(!w)continue;let k=w.toLowerCase(),A=i.get(k)||[];A.push({w:parseInt(S,10),s:b,st:parseInt(x,10)}),i.set(k,A)}function a(g,w,S,b){let x=String(g).toLowerCase();if(!i.has(x))return!1;let k=i.get(x),A=Vo(S),v=jo(w),E=Xo(b),P=A.min!==A.max,W=A.min,q=T=>v.kind==="normal"&&T==="normal"||v.kind!=="normal"&&(T==="italic"||T==="oblique"),Y=!1;for(let T of k){let I=P?T.w>=A.min&&T.w<=A.max:T.w===W,F=q(oe(T.s)),X=T.st>=E.min&&T.st<=E.max;if(I&&F&&X){Y=!0;break}}if(Y)return!0;if(!P)for(let T of k){let I=q(oe(T.s)),F=T.st>=E.min&&T.st<=E.max;if(Math.abs(W-T.w)<=300&&I&&F)return!0}if(!P&&v.kind==="normal"&&k.some(I=>oe(I.s)!=="normal"))for(let I of k){let F=Math.abs(W-I.w)<=300,X=I.st>=E.min&&I.st<=E.max;if(F&&X)return!0}return!1}let l=vn(n),u=es(t,n,r,s,o);if(C.resource?.has(u))return C.resource.get(u);let c=Ko(t),f=[],d=$e;for(let g of document.querySelectorAll("style")){let w=g.textContent||"";for(let S of w.matchAll(d)){let b=(S[2]||S[4]||"").trim();if(!b||Z(b))continue;document.querySelector(`link[rel="stylesheet"][href="${b}"]`)||f.push(b)}}let m=[];f.length&&await Promise.all(f.map(g=>new Promise(w=>{if(document.querySelector(`link[rel="stylesheet"][href="${g}"]`))return w(null);let S=document.createElement("link");S.rel="stylesheet",S.href=g,S.setAttribute("data-snapdom","injected-import"),S.onload=()=>w(S),S.onerror=()=>w(null),document.head.appendChild(S),m.push(S)})));let h="",p=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(g=>!!g.href);for(let g of m)try{g.remove()}catch{}for(let g of p)try{if(Z(g.href))continue;let w="",S=!1;try{S=new URL(g.href,location.href).origin===location.origin}catch{}if(!S){let x=Array.isArray(o)?o:[];if(!Yo(g.href,c,x))continue}if(S){let x=Array.from(document.styleSheets).find(k=>k.href===g.href);if(x)try{let k=x.cssRules||[];w=Array.from(k).map(A=>A.cssText).join("")}catch{}}if(!w){let x=await B(g.href,{as:"text",useProxy:s});if(x?.ok&&typeof x.data=="string"&&(w=x.data),Z(g.href))continue}w=await Qo(w,g.href,s);let b="";for(let x of w.match(Jo)||[]){let k=(x.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),A=Re(k);if(!A||Z(A))continue;let v=(x.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),E=(x.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),P=(x.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),W=(x.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),q=(x.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),Y=Te(q,g.href);if(!a(A,E,v,P))continue;let T=$n(W);if(!Rn(e,T))continue;let I={family:A,weightSpec:v,styleSpec:E,stretchSpec:P,unicodeRange:W,srcRaw:q,srcUrls:Y,href:g.href};if(n&&l(I,T))continue;let F=/url\(/i.test(q)?await Tn(x,g.href,s):x;b+=F}b.trim()&&(h+=b)}catch{console.warn("[snapDOM] Failed to process stylesheet:",g.href)}let y={requiredIndex:i,usedCodepoints:e,faceMatchesRequired:a,simpleExcluder:n?vn(n):null,useProxy:s,visitedSheets:new Set,depth:0};for(let g of document.styleSheets)if(!(g.href&&p.some(w=>w.href===g.href)))try{let w=g.href||location.origin+"/";w&&y.visitedSheets.add(w),await Ln(g,w,async S=>{h+=S},y)}catch{}try{for(let g of document.fonts||[]){if(!g||!g.family||g.status!=="loaded"||!g._snapdomSrc)continue;let w=String(g.family).replace(/^['"]+|['"]+$/g,"");if(Z(w)||!i.has(w.toLowerCase())||n?.families&&n.families.some(b=>String(b).toLowerCase()===w.toLowerCase()))continue;let S=g._snapdomSrc;if(!String(S).startsWith("data:")){if(C.resource?.has(g._snapdomSrc))S=C.resource.get(g._snapdomSrc),C.font?.add(g._snapdomSrc);else if(!C.font?.has(g._snapdomSrc))try{let b=await B(g._snapdomSrc,{as:"dataURL",useProxy:s,silent:!0});if(b.ok&&typeof b.data=="string")S=b.data,C.resource?.set(g._snapdomSrc,S),C.font?.add(g._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",g._snapdomSrc);continue}}h+=`@font-face{font-family:'${w}';src:url(${S});font-style:${g.style||"normal"};font-weight:${g.weight||"normal"};}`}}catch{}for(let g of r){if(!g||typeof g!="object")continue;let w=String(g.family||"").replace(/^['"]+|['"]+$/g,"");if(!w||Z(w)||!i.has(w.toLowerCase())||n?.families&&n.families.some(v=>String(v).toLowerCase()===w.toLowerCase()))continue;let S=g.weight!=null?String(g.weight):"normal",b=g.style!=null?String(g.style):"normal",x=g.stretchPct!=null?`${g.stretchPct}%`:"100%",k=String(g.src||""),A=k;if(!A.startsWith("data:")){if(C.resource?.has(k))A=C.resource.get(k),C.font?.add(k);else if(!C.font?.has(k))try{let v=await B(k,{as:"dataURL",useProxy:s,silent:!0});if(v.ok&&typeof v.data=="string")A=v.data,C.resource?.set(k,A),C.font?.add(k);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",k);continue}}h+=`@font-face{font-family:'${w}';src:url(${A});font-style:${b};font-weight:${S};font-stretch:${x};}`}return h&&(h=ts(h),C.resource?.set(u,h)),h}function At(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),r=i=>{let a=zo(i.fontFamily);if(a.length)for(let l of a){let u=(c,f,d)=>`${l}__${re(c)}__${oe(f)}__${qo(d)}`;e.add(u(i.fontWeight,i.fontStyle,i.fontStretch))}};r(getComputedStyle(t));let s=getComputedStyle(t,"::before");s&&s.content&&s.content!=="none"&&r(s);let o=getComputedStyle(t,"::after");for(o&&o.content&&o.content!=="none"&&r(o);n.nextNode();){let i=n.currentNode,a=getComputedStyle(i);r(a);let l=getComputedStyle(i,"::before");l&&l.content&&l.content!=="none"&&r(l);let u=getComputedStyle(i,"::after");u&&u.content&&u.content!=="none"&&r(u)}return e}function ae(t){let e=new Set,n=s=>{if(s)for(let o of s)e.add(o.codePointAt(0))},r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let s=r.currentNode;if(s.nodeType===Node.TEXT_NODE)n(s.nodeValue||"");else if(s.nodeType===Node.ELEMENT_NODE){let o=s;for(let i of["::before","::after"]){let l=getComputedStyle(o,i)?.getPropertyValue("content");if(!(!l||l==="none"))if(/^"/.test(l)||/^'/.test(l))n(l.slice(1,-1));else{let u=l.match(/\\[0-9A-Fa-f]{1,6}/g);if(u)for(let c of u)try{e.add(parseInt(c.slice(1),16))}catch{}}}}}return e}async function kt(t,e=2){try{await document.fonts.ready}catch{}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let r=()=>{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 o of n){let i=document.createElement("span");i.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",i.style.fontFamily=`"${o}"`,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++)r(),await new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o)))}z();function _n(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Pn(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function Nn(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"]],r=Math.max(1,Math.min(3999,t)),s="";for(let[o,i]of n)for(;r>=o;)s+=i,r-=o;return e?s:s.toLowerCase()}function In(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":return Pn(t,!1);case"upper-alpha":return Pn(t,!0);case"lower-roman":return Nn(t,!1);case"upper-roman":return Nn(t,!0);default:return String(t)}}function Wn(t){let e=()=>C?.session?.__counterEpoch??0,n=e(),r=new WeakMap,s=t instanceof Document?t.documentElement:t,o=d=>d&&d.tagName==="LI",i=d=>{let m=0,h=d?.parentElement;if(!h)return 0;for(let p of h.children){if(p===d)break;p.tagName==="LI"&&m++}return m},a=d=>{let m=new Map;for(let[h,p]of d)m.set(h,p.slice());return m},l=(d,m,h)=>{let p=a(d),y;try{y=h.style?.counterReset||getComputedStyle(h).counterReset}catch{}if(y&&y!=="none")for(let S of y.split(",")){let b=S.trim().split(/\s+/),x=b[0],k=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!x)continue;let A=m.get(x);if(A&&A.length){let v=A.slice();v.push(k),p.set(x,v)}else p.set(x,[k])}let g;try{g=h.style?.counterSet||getComputedStyle(h).counterSet}catch{}if(g&&g!=="none")for(let S of g.split(",")){let b=S.trim().split(/\s+/),x=b[0],k=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!x)continue;let A=p.get(x)||[];A.length===0&&A.push(0),A[A.length-1]=k,p.set(x,A)}let w;try{w=h.style?.counterIncrement||getComputedStyle(h).counterIncrement}catch{}if(w&&w!=="none")for(let S of w.split(",")){let b=S.trim().split(/\s+/),x=b[0],k=Number.isFinite(Number(b[1]))?Number(b[1]):1;if(!x)continue;let A=p.get(x)||[];A.length===0&&A.push(0),A[A.length-1]+=k,p.set(x,A)}try{if(getComputedStyle(h).display==="list-item"&&o(h)){let b=h.parentElement,x=1;if(b&&b.tagName==="OL"){let A=b.getAttribute("start"),v=Number.isFinite(Number(A))?Number(A):1,E=i(h),P=h.getAttribute("value");x=Number.isFinite(Number(P))?Number(P):v+E}else x=1+i(h);let k=p.get("list-item")||[];k.length===0&&k.push(0),k[k.length-1]=x,p.set("list-item",k)}}catch{}return p},u=(d,m,h)=>{let p=l(h,m,d);r.set(d,p);let y=p;for(let w of d.children)y=u(w,p,y);let g=new Map;for(let[w,S]of h){let b=S.length,x=y.get(w);g.set(w,x&&x.length?x.slice(0,b):S.slice())}for(let[w,S]of y)!g.has(w)&&S.length&&!m.has(w)&&g.set(w,S.slice(0,1));return g},c=new Map;u(s,c,c);function f(){let d=e();if(d!==n){n=d;let m=new Map;u(s,m,m)}}return{get(d,m){f();let h=r.get(d)?.get(m);return h&&h.length?h[h.length-1]:0},getStack(d,m){f();let h=r.get(d)?.get(m);return h?h.slice():[]}}}function On(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(r,(s,o,i)=>{let a=String(i).split(",").map(l=>l.trim());if(o==="counter"){let l=a[0]?.replace(/^["']|["']$/g,""),u=(a[1]||"decimal").toLowerCase(),c=n.get(e,l);return In(c,u)}else{let l=a[0]?.replace(/^["']|["']$/g,""),u=a[1]?.replace(/^["']|["']$/g,"")??"",c=(a[2]||"decimal").toLowerCase(),f=n.getStack(e,l);return f.length?f.map(m=>In(m,c)).join(u):""}})}catch{return"- "}}ht();z();var vt=new WeakMap,Un=1e3;function ns(t,e){let n=qn(t);return e?(e.__pseudoPreflightFp!==n&&(e.__pseudoPreflight=Hn(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):Hn(t,n)}function Le(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function qn(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.tagName==="STYLE"){let a=i.textContent?i.textContent.length:0;n+=`S${a}|`;let l=i.sheet,u=l?Le(l):null;u&&(r+=u.length)}else{let a=i.getAttribute("href")||"",l=i.getAttribute("media")||"all";n+=`L${a}|m:${l}|`;let u=i.sheet,c=u?Le(u):null;c&&(r+=c.length)}}let s=t.adoptedStyleSheets;return n+=`ass:${Array.isArray(s)?s.length:0}|tr:${r}`,n}function Bn(t,e,n){let r=Le(t);if(!r)return!1;for(let s=0;s<r.length;s++){if(n.budget<=0)return!1;let o=r[s],i=o&&o.cssText?o.cssText:"";n.budget--;for(let a of e)if(i.includes(a))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let a=0;a<o.cssRules.length&&n.budget>0;a++){let l=o.cssRules[a],u=l&&l.cssText?l.cssText:"";n.budget--;for(let c of e)if(u.includes(c))return!0}if(n.budget<=0)return!1}return!1}function Hn(t=document,e=qn(t)){let n=vt.get(t);if(n&&n.fingerprint===e)return n.result;let r=["::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 a=s[i].textContent||"";for(let l of r)if(a.includes(l))return vt.set(t,{fingerprint:e,result:!0}),!0}let o=t.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let i={budget:Un};try{for(let a of o)if(Bn(a,r,i))return vt.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let i=t.querySelectorAll('style,link[rel~="stylesheet"]'),a={budget:Un};for(let l=0;l<i.length&&a.budget>0;l++){let u=i[l],c=null;if(u.tagName,c=u.sheet||null,c&&Bn(c,r,a))return vt.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(vt.set(t,{fingerprint:e,result:!0}),!0):(vt.set(t,{fingerprint:e,result:!1}),!1)}var Et=new WeakMap;function Dn(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,r=t[`border${e}Style`];if(n>0&&r&&r!=="none"&&r!=="hidden")return!0}return!1}var zn=-1;function rs(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,r=0,s;for(;s=n.exec(t);){let i=t.slice(r,s.index).trim();i&&e.push(i),e.push(s[1]),r=n.lastIndex}let o=t.slice(r).trim();return o&&e.push(o),e.join("")}function Pe(t,e){let n=t.parentElement,r=n?Et.get(n):null;return r?{get(s,o){let i=e.get(s,o),a=r.get(o);return typeof a=="number"?Math.max(i,a):i},getStack(s,o){let i=e.getStack(s,o);if(!i.length)return i;let a=r.get(o);if(typeof a=="number"){let l=i.slice();return l[l.length-1]=Math.max(l[l.length-1],a),l}return i}}:e}function Ne(t,e,n){let r=new Map;function s(u){let c=[];if(!u||u==="none")return c;for(let f of String(u).split(",")){let d=f.trim().split(/\s+/),m=d[0],h=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;m&&c.push({name:m,num:h})}return c}let o=s(e?.counterReset),i=s(e?.counterSet),a=s(e?.counterIncrement);function l(u){if(r.has(u))return r.get(u).slice();let c=n.getStack(t,u);c=c.length?c.slice():[];let f=o.find(h=>h.name===u);if(f){let h=Number.isFinite(f.num)?f.num:0;c=c.length?[...c,h]:[h]}let d=i.find(h=>h.name===u);if(d){let h=Number.isFinite(d.num)?d.num:0;c.length===0&&(c=[0]),c[c.length-1]=h}let m=a.find(h=>h.name===u);if(m){let h=Number.isFinite(m.num)?m.num:1;c.length===0&&(c=[0]),c[c.length-1]+=h}return r.set(u,c.slice()),c}return{get(u,c){let f=l(c);return f.length?f[f.length-1]:0},getStack(u,c){return l(c)},__incs:a}}function os(t,e,n){let r;try{r=_(t,e)}catch{}let s=r?.content;if(!s||s==="none"||s==="normal")return{text:"",incs:[]};let o=Pe(t,n),i=Ne(t,r,o),a=_n(s)?On(s,t,i):s;return{text:rs(a),incs:i.__incs||[]}}async function ce(t,e,n,r){if(!(t instanceof Element)||!(e instanceof Element))return;let s=t.ownerDocument||document;if(!ns(s,n))return;let o=C?.session?.__counterEpoch??0;if(zn!==o&&(Et=new WeakMap,n&&(n.__counterCtx=null),zn=o),!n.__counterCtx)try{n.__counterCtx=Wn(t.ownerDocument||document)}catch(l){R(n,"buildCounterContext failed",l)}let i=n.__counterCtx;for(let l of["::before","::after","::first-letter"])try{let u=_(t,l);if(!u||u.content==="none"&&u.backgroundImage==="none"&&u.backgroundColor==="transparent"&&!Dn(u)&&(!u.transform||u.transform==="none")&&u.display==="inline")continue;if(l==="::first-letter"){let $=_(t),L=($?.display||"").toLowerCase();if(L.includes("flex")||L.includes("grid")||!(u.color!==$.color||u.fontSize!==$.fontSize||u.fontWeight!==$.fontWeight||u.fontFamily!==$.fontFamily||u.fontStyle!==$.fontStyle||u.textTransform!==$.textTransform||u.float!==$.float||u.paddingTop!==$.paddingTop||u.paddingRight!==$.paddingRight||u.paddingBottom!==$.paddingBottom||u.paddingLeft!==$.paddingLeft||u.marginTop!==$.marginTop||u.marginRight!==$.marginRight||u.marginBottom!==$.marginBottom||u.marginLeft!==$.marginLeft))continue;let U=Array.from(e.childNodes).find(qt=>qt.nodeType===Node.TEXT_NODE&&qt.textContent?.trim().length>0);if(!U)continue;let K=U.textContent,nt=K.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],Dt=K.slice(nt?.length||0);if(!nt||/[\uD800-\uDFFF]/.test(nt))continue;let mt=document.createElement("span");mt.textContent=nt,mt.dataset.snapdomPseudo="::first-letter";let de=Jt(u),me=wt(de,"span");n.styleMap.set(mt,me);let zt=document.createTextNode(Dt);e.replaceChild(zt,U),e.insertBefore(mt,zt);continue}let f=u.content??"",d=f===""||f==="none"||f==="normal",{text:m,incs:h}=os(t,l,i),p=u.backgroundImage,y=u.backgroundColor,g=u.fontFamily,w=parseInt(u.fontSize)||32,S=parseInt(u.fontWeight)||!1,b=u.color||"#000",x=u.transform,k=Z(g),A=!d&&m!=="",v=p&&p!=="none",E=y&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)",P=Dn(u),W=x&&x!=="none",Y=f!=="none"&&f!=="normal"&&((parseFloat(u.width)||0)>0||(parseFloat(u.height)||0)>0);if(!(A||v||E||P||W||Y)){if(h&&h.length&&t.parentElement){let $=Et.get(t.parentElement)||new Map;for(let{name:L}of h){if(!L)continue;let O=Pe(t,i),K=Ne(t,_(t,l),O).get(t,L);$.set(L,K)}Et.set(t.parentElement,$)}continue}let I=!1;if(A&&!k&&m.length>1&&!m.startsWith("url(")){let $=_(t),L=parseFloat($.fontSize)||16,O=parseFloat($.lineHeight);Number.isFinite(O)||(O=L*1.5),t.getBoundingClientRect().height<O*1.6&&(e.style.whiteSpace="nowrap",I=!0)}let F=document.createElement("span");F.dataset.snapdomPseudo=l,F.style.pointerEvents="none",I&&(F.style.whiteSpace="nowrap");let X=Jt(u),Ht=wt(X,"span");if(n.styleMap.set(F,Ht),k&&m&&m.length===1){let{dataUrl:$,width:L,height:O}=await En(m,g,S,w,b),U=document.createElement("img");U.src=$,U.style=`height:${w}px;width:${L/O*w}px;object-fit:contain;`,F.appendChild(U),e.dataset.snapdomHasIcon="true"}else if(m&&m.startsWith("url(")){let $=pt(m);if($?.trim())try{let L=await B(ft($),{as:"dataURL",useProxy:r.useProxy});if(L?.ok&&typeof L.data=="string"){let O=document.createElement("img");O.src=L.data,O.style=`width:${w}px;height:auto;object-fit:contain;`,F.appendChild(O)}}catch(L){console.error(`[snapdom] Error in pseudo ${l} for`,t,L)}}else!k&&A&&(F.textContent=m);F.style.backgroundImage="none","maskImage"in F.style&&(F.style.maskImage="none"),"webkitMaskImage"in F.style&&(F.style.webkitMaskImage="none");try{F.style.backgroundRepeat=u.backgroundRepeat,F.style.backgroundSize=u.backgroundSize,u.backgroundPositionX&&u.backgroundPositionY?(F.style.backgroundPositionX=u.backgroundPositionX,F.style.backgroundPositionY=u.backgroundPositionY):F.style.backgroundPosition=u.backgroundPosition,F.style.backgroundOrigin=u.backgroundOrigin,F.style.backgroundClip=u.backgroundClip,F.style.backgroundAttachment=u.backgroundAttachment,F.style.backgroundBlendMode=u.backgroundBlendMode}catch{}if(v)try{let $=St(p),L=await Promise.all($.map(gt));F.style.backgroundImage=L.join(", ")}catch($){console.warn(`[snapdom] Failed to inline background-image for ${l}`,$)}E&&(F.style.backgroundColor=y);let at=F.childNodes.length>0||F.textContent?.trim()!==""||v||E||P||W||Y;if(h&&h.length&&t.parentElement){let $=Et.get(t.parentElement)||new Map,L=Pe(t,i),O=Ne(t,_(t,l),L);for(let{name:U}of h){if(!U)continue;let K=O.get(t,U);$.set(U,K)}Et.set(t.parentElement,$)}if(!at)continue;l==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(F,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(F))}catch(u){console.warn(`[snapdom] Failed to capture ${l} for`,t,u)}let a=Array.from(e.children).filter(l=>!l.dataset.snapdomPseudo);if(n.nodeMap)for(let l of a){let u=n.nodeMap.get(l);u instanceof Element&&await ce(u,l,n,r)}else{let l=Array.from(t.children);for(let u=0;u<Math.min(l.length,a.length);u++)await ce(l[u],a[u],n,r)}}function Vn(t,e){if(!t||!(t instanceof Element))return;let n=t.ownerDocument||document,r=e||n,s=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(s.length===0)return;let o=/url\(\s*#([^)]+)\)/g,i=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],a=b=>window.CSS&&CSS.escape?CSS.escape(b):b.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),l="http://www.w3.org/1999/xlink",u=b=>{if(!b||!b.getAttribute)return null;let x=b.getAttribute("href")||b.getAttribute("xlink:href")||(typeof b.getAttributeNS=="function"?b.getAttributeNS(l,"href"):null);if(x)return x;let k=b.attributes;if(!k)return null;for(let A=0;A<k.length;A++){let v=k[A];if(!v||!v.name)continue;if(v.name==="href")return v.value;let E=v.name.indexOf(":");if(E!==-1&&v.name.slice(E+1)==="href")return v.value}return null},c=new Set(Array.from(t.querySelectorAll("[id]")).map(b=>b.id)),f=new Set,d=!1,m=(b,x=null)=>{if(!b)return;o.lastIndex=0;let k;for(;k=o.exec(b);){d=!0;let A=(k[1]||"").trim();A&&(c.has(A)||(f.add(A),x&&!x.has(A)&&x.add(A)))}},h=b=>{let x=b.querySelectorAll("use");for(let v of x){let E=u(v);if(!E||!E.startsWith("#"))continue;d=!0;let P=E.slice(1).trim();P&&!c.has(P)&&f.add(P)}let A=b.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let v of A){m(v.getAttribute("style")||"");for(let E of i)m(v.getAttribute(E))}};for(let b of s)h(b);if(!d)return;let p=t.querySelector("svg.inline-defs-container");p||(p=n.createElementNS("http://www.w3.org/2000/svg","svg"),p.classList.add("inline-defs-container"),p.setAttribute("aria-hidden","true"),p.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(p,t.firstChild||null));let y=p.querySelector("defs")||null,g=b=>{if(!b||c.has(b))return null;let x=a(b),k=A=>{let v=r.querySelector(A);return v&&!t.contains(v)?v:null};return k(`svg defs > *#${x}`)||k(`svg > symbol#${x}`)||k(`*#${x}`)};if(!f.size)return;let w=new Set(f),S=new Set;for(;w.size;){let b=w.values().next().value;if(w.delete(b),!b||c.has(b)||S.has(b))continue;let x=g(b);if(!x){S.add(b);continue}y||(y=n.createElementNS("http://www.w3.org/2000/svg","defs"),p.appendChild(y));let k=x.cloneNode(!0);k.id||k.setAttribute("id",b),y.appendChild(k),S.add(b),c.add(b);let A=[k,...k.querySelectorAll("*")];for(let v of A){let E=u(v);if(E&&E.startsWith("#")){let W=E.slice(1).trim();W&&!c.has(W)&&!S.has(W)&&w.add(W)}let P=v.getAttribute?.("style")||"";P&&m(P,w);for(let W of i){let q=v.getAttribute?.(W);q&&m(q,w)}}}}z();function Xn(t,e){if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let r=t.getBoundingClientRect(),s=t.clientHeight,o="data-snap-ph",i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let a=i.currentNode,l=getComputedStyle(a),u=l.position;if(u!=="sticky"&&u!=="-webkit-sticky")continue;let c=jn(l.top),f=jn(l.bottom);if(c==null&&f==null)continue;let d=ss(a,t),m=is(e,d,o);if(!m)continue;let h=a.getBoundingClientRect(),p=h.width,y=h.height,g=h.left-r.left;if(!(p>0&&y>0)||!Number.isFinite(g))continue;let w=c!=null?c+n:n+(s-y-f);if(!Number.isFinite(w))continue;let S=Number.parseInt(l.zIndex,10),b=Number.isFinite(S),x=b?Math.max(S,1)+1:2,k=b?S-1:0,A=m.cloneNode(!1);A.setAttribute(o,"1"),A.style.position="sticky",A.style.left=`${g}px`,A.style.top=`${w}px`,A.style.width=`${p}px`,A.style.height=`${y}px`,A.style.visibility="hidden",A.style.zIndex=String(k),A.style.overflow="hidden",A.style.background="transparent",A.style.boxShadow="none",A.style.filter="none",m.parentElement?.insertBefore(A,m),m.style.position="absolute",m.style.left=`${g}px`,m.style.top=`${w}px`,m.style.bottom="auto",m.style.zIndex=String(x),m.style.pointerEvents="none"}}function jn(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function ss(t,e){let n=[];for(let r=t;r&&r!==e;){let s=r.parentElement;if(!s)break;n.push(Array.prototype.indexOf.call(s.children,r)),r=s}return n.reverse()}function is(t,e,n){let r=t;for(let s=0;s<e.length;s++)if(r=as(r,n)[e[s]],!r)return null;return r instanceof HTMLElement?r:null}function as(t,e){let n=[],r=t.children;for(let s=0;s<r.length;s++){let o=r[s];o.hasAttribute(e)||n.push(o)}return n}function Gn(t){let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,s=e.borderStyle,o=e.borderWidth,i=n!=="none"&&parseFloat(r)>0,a=s==="none"||parseFloat(o)===0;i&&a&&(t.style.border=`${r} solid transparent`)}function Yn(t){let e=[];try{let n=t.querySelectorAll("*");for(let r of n){if(!(r instanceof HTMLElement))continue;let s=r.style.contentVisibility||"",o=getComputedStyle(r),i=o.contentVisibility||o.getPropertyValue("content-visibility")||"";(i==="auto"||i==="hidden")&&(e.push({el:r,original:s}),r.style.contentVisibility="visible")}if(t instanceof HTMLElement){let r=getComputedStyle(t),s=r.contentVisibility||r.getPropertyValue("content-visibility")||"";(s==="auto"||s==="hidden")&&(e.push({el:t,original:t.style.contentVisibility||""}),t.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:n,original:r}of e)try{n.style.contentVisibility=r}catch{}}}async function Kn(t,e={}){let n={styleMap:C.session.styleMap,styleCache:C.session.styleCache,nodeMap:C.session.nodeMap,options:e},r,s="",o="";Gn(t);let i=Yn(t);try{r=await Wt(t,n,e)}catch(c){throw console.warn("deepClone failed:",c),c}finally{i()}try{Vn(r)}catch(c){console.warn("inlineExternal defs or symbol failed:",c)}try{await ce(t,r,n,e)}catch(c){console.warn("inlinePseudoElements failed:",c)}await Sn(r,n);try{let c=r.querySelectorAll("style[data-sd]");for(let f of c)o+=f.textContent||"",f.remove()}catch(c){R(n,"Failed to extract shadow CSS from style[data-sd]",c)}let a=Ae(n.styleMap);s=Array.from(a.entries()).map(([c,f])=>`.${f}{${c}}`).join(""),s=o+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+s;for(let[c,f]of n.styleMap.entries()){if(c.tagName==="STYLE")continue;if(c.getRootNode&&c.getRootNode()instanceof ShadowRoot){c.setAttribute("style",f.replace(/;/g,"; "));continue}let d=a.get(f);d&&c.classList.add(d);let m=c.style?.backgroundImage,h=c.dataset?.snapdomHasIcon;m&&m!=="none"&&(c.style.backgroundImage=m),h&&(c.style.verticalAlign="middle",c.style.display="inline")}for(let[c,f]of n.nodeMap.entries()){let d=f.scrollLeft,m=f.scrollTop;if((d||m)&&c instanceof HTMLElement){c.style.overflow="hidden",c.style.scrollbarWidth="none",c.style.msOverflowStyle="none";try{let y=c.querySelectorAll("*");for(let g of y){if(!(g instanceof HTMLElement))continue;let w=g.style.position;if(w==="fixed"||w==="absolute"){let S=parseFloat(g.style.top)||0,b=parseFloat(g.style.left)||0;g.style.top=`${S+m}px`,g.style.left=`${b+d}px`,w==="fixed"&&(g.style.position="absolute")}}}catch{}let p=document.createElement("div");for(p.style.all="unset",p.style.transform=`translate(${-d}px, ${-m}px)`,p.style.willChange="transform",p.style.display="inline-block",p.style.width="100%";c.firstChild;)p.appendChild(c.firstChild);c.appendChild(p)}}let u=r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r;if(Xn(t,u),t===n.nodeMap.get(r)){let c=n.styleCache.get(t)||_(t);n.styleCache.set(t,c);let f=ge(c.transform);r.style.margin="0",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.animation="none",r.style.transition="none",r.style.willChange="auto",r.style.float="none",r.style.clear="none",r.style.transform=f||""}for(let[c,f]of n.nodeMap.entries())f.tagName==="PRE"&&(c.style.marginTop="0",c.style.marginBlockStart="0");return{clone:r,classCSS:s,styleCache:n.styleCache}}ht();z();var Qn="http://www.w3.org/1999/xlink";function cs(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(Qn,"href"):null)}function ls(t){let e=parseInt(t.dataset?.snapdomWidth||"",10)||0,n=parseInt(t.dataset?.snapdomHeight||"",10)||0,r=parseInt(t.getAttribute("width")||"",10)||0,s=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,i=parseFloat(t.style?.height||"")||0,a=e||o||r||t.width||t.naturalWidth||100,l=n||i||s||t.height||t.naturalHeight||100;return{width:a,height:l}}async function Jn(t,e={}){let n=Array.from(t.querySelectorAll("img")),r=async a=>{if(!a.getAttribute("src")){let h=a.currentSrc||a.src||"";h&&a.setAttribute("src",h)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let l=a.src||"";if(!l)return;let u=C.image?.get(l);if(u){a.src=u,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let c=await B(l,{as:"dataURL",useProxy:e.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){C.image?.set(l,c.data),a.src=c.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:f,height:d}=ls(a),{fallbackURL:m}=e||{};if(m)try{let h=typeof m=="function"?await m({width:f,height:d,src:l,element:a}):m;if(h){let p=await B(h,{as:"dataURL",useProxy:e.useProxy});if(p?.ok&&typeof p.data=="string"){a.src=p.data,a.width||(a.width=f),a.height||(a.height=d);return}}}catch{}if(e.placeholders!==!1){let h=document.createElement("div");h.style.cssText=[`width:${f}px`,`height:${d}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${d}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),h.textContent="img",a.replaceWith(h)}else{let h=document.createElement("div");h.style.cssText=`display:inline-block;width:${f}px;height:${d}px;visibility:hidden;`,a.replaceWith(h)}},s=6;for(let a=0;a<n.length;a+=s){let l=n.slice(a,a+s).map(r);await Promise.allSettled(l)}let o=Array.from(t.querySelectorAll("image")),i=async a=>{let l=cs(a);if(!l||l.startsWith("data:")||l.startsWith("blob:"))return;let u=await B(l,{as:"dataURL",useProxy:e.useProxy});u.ok&&typeof u.data=="string"&&u.data.startsWith("data:")&&(a.setAttribute("href",u.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(Qn,"href"))};for(let a=0;a<o.length;a+=s){let l=o.slice(a,a+s).map(i);await Promise.allSettled(l)}}J();async function le(t,e,n,r={}){let s=[[t,e]],o=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],i=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],a=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],l=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;s.length;){let[u,c]=s.shift();if(!c)continue;let f=n.get(u)||_(u);n.has(u)||n.set(u,f);let d=(()=>{let w=f.getPropertyValue("border-image"),S=f.getPropertyValue("border-image-source");return w&&w!=="none"||S&&S!=="none"})(),m=f.getPropertyValue("background-image"),h=f.getPropertyValue("background-color");if(m&&m!=="none"||h&&h!=="rgba(0, 0, 0, 0)"&&h!=="transparent"||/url\s*\(|gradient\s*\(/i.test(f.getPropertyValue("background")||""))for(let w of a){let S=f.getPropertyValue(w);S&&c.style.setProperty(w,S)}for(let w of o){let S=f.getPropertyValue(w);if(w==="background-image"&&(!S||S==="none")){let k=f.getPropertyValue("background");k&&/url\s*\(/.test(k)&&(S=St(k).filter(A=>/url\s*\(/.test(A)).join(", ")||S)}if(!S||S==="none")continue;let b=St(S),x=await Promise.all(b.map(k=>gt(k,r)));x.some(k=>k&&k!=="none"&&!/^url\(undefined/.test(k))&&c.style.setProperty(w,x.join(", "))}for(let w of i){let S=f.getPropertyValue(w);!S||S==="initial"||c.style.setProperty(w,S)}if(d)for(let w of l){let S=f.getPropertyValue(w);!S||S==="initial"||c.style.setProperty(w,S)}let y=u.shadowRoot?Array.from(u.shadowRoot.children).filter(w=>w.tagName!=="STYLE"):Array.from(u.children),g=Array.from(c.children).filter(w=>!(w.dataset?.snapdomPseudo||w.tagName==="STYLE"&&w.dataset?.sd));for(let w=0;w<Math.min(y.length,g.length);w++)s.push([y[w],g[w]])}}J();z();function Zn(t){if(!t)return()=>{};let e=[];function n(r){let s=us(r);s&&e.push(s);for(let o of r.children||[])n(o)}return n(t),()=>e.forEach(r=>r())}function us(t){if(!t)return()=>{};let e=fs(t);if(e<=0)return()=>{};if(!ps(t))return()=>{};let n=getComputedStyle(t),r=Math.round(ds(n)*e+ms(n)),s=t.textContent??"",o=s;if(t.scrollHeight<=r+.5)return()=>{};let i=0,a=s.length,l=-1;for(;i<=a;){let u=i+a>>1;t.textContent=s.slice(0,u)+"\u2026",t.scrollHeight<=r+.5?(l=u,i=u+1):a=u-1}return t.textContent=(l>=0?s.slice(0,l):"")+"\u2026",()=>{t.textContent=o}}function fs(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function ds(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 ms(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function ps(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var Ot=[];function ue(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 tr(...t){let e=t.flat();for(let n of e){let r=ue(n);r&&(Ot.some(s=>s&&s.name&&r.name&&s.name===r.name)||Ot.push(r))}}function er(t){return t&&Array.isArray(t.plugins)?t.plugins:Ot}async function et(t,e,n){let r=n,s=er(e);for(let o of s){let i=o&&typeof o[t]=="function"?o[t]:null;if(!i)continue;let a=await i(e,r);typeof a<"u"&&(r=a)}return r}async function nr(t,e,n){let r=[],s=er(e);for(let o of s){let i=o&&typeof o[t]=="function"?o[t]:null;if(!i)continue;let a=await i(e,n);typeof a<"u"&&r.push(a)}return r}function hs(t){let e=[];if(Array.isArray(t))for(let n of t){let r=ue(n);if(!r||!r.name)continue;let s=e.findIndex(o=>o&&o.name===r.name);s>=0&&e.splice(s,1),e.push(r)}for(let n of Ot)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function rr(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=hs(e)),t}function or(){return Ot.slice()}function yt(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(t)&&t.length<200)}function gs(t,e){return!t||!(t instanceof Element)?!1:t.querySelector("picture")?!0:e?!!t.querySelector("img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]"):!1}function ys(t,e){let n=t.currentSrc||"";if(n&&!yt(n))return n;let r=e.querySelectorAll("source[srcset]"),s=null;for(let o of r){let i=o.getAttribute("srcset");if(!i||yt(i))continue;let a=o.getAttribute("media");if(a)try{if(window.matchMedia(a).matches)return i.split(",")[0].trim().split(/\s+/)[0]}catch{}s||(s=i.split(",")[0].trim().split(/\s+/)[0])}return s}function bs(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let r of e)if(r&&!yt(r))return r;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let r=n.split(",")[0].trim().split(/\s+/)[0];if(r&&!yt(r))return r}return null}function ws(t={}){let e=t.pictureResolver&&typeof t.pictureResolver=="object"?t.pictureResolver:{};return{timeout:e.timeout??5e3,concurrency:e.concurrency??4,resolveLazySrc:e.resolveLazySrc!==!1,silent:e.silent??!1,useProxy:typeof t.useProxy=="string"?t.useProxy:""}}async function sr(t,e={}){if(!t||!(t instanceof Element)||e.resolvePicturePlaceholders===!1)return null;let{timeout:n,concurrency:r,resolveLazySrc:s,silent:o,useProxy:i}=ws(e);if(!gs(t,s))return null;let a=[],l=[];async function u(d){let m=new AbortController,h=setTimeout(()=>m.abort(),n);try{let p=await fetch(d,{credentials:"include",signal:m.signal});if(!p.ok&&i){let g=i.includes("{url}")?i.replace("{url}",encodeURIComponent(d)):i.endsWith("?")?`${i}${encodeURIComponent(d)}`:`${i}${i.includes("?")?"&":"?"}url=${encodeURIComponent(d)}`;p=await fetch(g,{signal:m.signal})}if(!p.ok)return null;let y=await p.blob();return await new Promise((g,w)=>{let S=new FileReader;S.onload=()=>g(S.result),S.onerror=w,S.readAsDataURL(y)})}catch{return null}finally{clearTimeout(h)}}async function c(d){for(let m=0;m<d.length;m+=r){let h=d.slice(m,m+r);await Promise.allSettled(h.map(p=>p()))}}let f=t.querySelectorAll("picture");for(let d of f){let m=d.querySelector("img");if(!m)continue;let h=m.getAttribute("src")||"";if(!yt(h))continue;let p=ys(m,d);p&&l.push(async()=>{let y=await u(p);if(!y){o||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${p.slice(0,60)}`);return}let g=m.getAttribute("src"),w=m.getAttribute("srcset"),S=m.getAttribute("sizes"),b=[];m.src=y,m.setAttribute("src",y),m.removeAttribute("srcset"),m.removeAttribute("sizes");let x=d.querySelectorAll("source");for(let k of x)b.push({el:k,parent:k.parentElement,next:k.nextSibling}),k.remove();a.push(()=>{g!==null?m.setAttribute("src",g):m.removeAttribute("src"),w!==null&&m.setAttribute("srcset",w),S!==null&&m.setAttribute("sizes",S);for(let{el:k,parent:A,next:v}of b)A&&A.insertBefore(k,v)})})}if(s){let d=t.querySelectorAll("img");for(let m of d){if(m.closest("picture")&&yt(m.getAttribute("src")||""))continue;let h=m.getAttribute("src")||"",p=bs(m);p&&yt(h)&&l.push(async()=>{let y=await u(p);if(!y)return;let g=m.getAttribute("src");m.src=y,m.setAttribute("src",y),m.removeAttribute("srcset"),m.removeAttribute("sizes"),a.push(()=>{g!==null?m.setAttribute("src",g):m.removeAttribute("src")})})}}return l.length===0?null:(await c(l),async function(){for(let m of a)try{m()}catch{}})}z();var Ss=.92,xs=.6;async function Cs(t){let e=new Image;if(e.decoding="sync",e.src=t,typeof e.decode=="function")try{return await e.decode(),e}catch{}return await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=r}),e}function As(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}async function Ie(t,e,n){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;let r;try{r=await Cs(t)}catch{return null}let s=r.naturalWidth||r.width,o=r.naturalHeight||r.height;if(!s||!o)return null;let i=Math.min(1,Math.max(e/s,n/o));if(!(i>0)||i>=.95)return null;let a=i*xs,l=Math.max(1,Math.round(s*a)),u=Math.max(1,Math.round(o*a)),c=document.createElement("canvas");c.width=l,c.height=u;let f=c.getContext("2d");if(!f)return null;f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high",f.drawImage(r,0,0,l,u);let d=As(t),m=d==="image/jpeg"?"image/jpeg":d==="image/webp"?"image/webp":"image/png";try{let h=c.toDataURL(m,Ss);if(typeof h=="string"&&h.startsWith("data:image")&&h.length<t.length)return h}catch{}return null}async function ks(t,e){if(!e.compress)return{count:0,before:0,after:0};let n=(e.scale||1)*(e.dpr||1),r=Array.from(t.querySelectorAll("img")),s=0,o=0,i=0,a=async u=>{let c=u.getAttribute("src")||"";if(!c.startsWith("data:image")||c.startsWith("data:image/svg"))return;let f=parseFloat(u.dataset.snapdomWidth)||parseFloat(u.style.width)||u.width||0,d=parseFloat(u.dataset.snapdomHeight)||parseFloat(u.style.height)||u.height||0;if(!f||!d)return;let m=await Ie(c,f*n,d*n);m&&(s++,o+=c.length,i+=m.length,u.setAttribute("src",m))},l=6;for(let u=0;u<r.length;u+=l)await Promise.allSettled(r.slice(u,u+l).map(a));return{count:s,before:o,after:i}}function vs(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function Es(t,e){if(!e.compress)return{count:0};let n=(e.scale||1)*(e.dpr||1),r=C.session.nodeMap,s=[],o=[t,...t.querySelectorAll("*")];for(let u of o){let c=u.style&&u.style.backgroundImage;c&&c.includes("data:image")&&s.push(u)}let i=0,a=async u=>{let c=r.get(u);if(!c||!c.isConnected)return;let f;try{f=getComputedStyle(c)}catch{return}if((f.backgroundRepeat||"repeat").toLowerCase().split(",").some(b=>b.trim()!=="no-repeat"))return;let{w:m,h}=vs(c);if(!m||!h)return;let p=m*n,y=h*n,g=u.style.backgroundImage,w=[...g.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],S=g;for(let b of w){let x=b[2];if(x.startsWith("data:image/svg"))continue;let k=await Ie(x,p,y);k&&(S=S.split(x).join(k),i++)}S!==g&&(u.style.backgroundImage=S)},l=6;for(let u=0;u<s.length;u+=l)await Promise.allSettled(s.slice(u,u+l).map(a));return{count:i}}async function Ms(t,e){if(!e.compress)return{count:0};let n=(e.scale||1)*(e.dpr||1),r=Array.from(t.querySelectorAll("image")),s=0,o=async a=>{let l=a.getAttribute("href")||(typeof a.getAttributeNS=="function"?a.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!l||!l.startsWith("data:image")||l.startsWith("data:image/svg"))return;let u=parseFloat(a.getAttribute("width"))||0,c=parseFloat(a.getAttribute("height"))||0;if(!u||!c)return;let f=await Ie(l,u*n,c*n);f&&(a.setAttribute("href",f),a.hasAttribute("xlink:href")&&a.setAttribute("xlink:href",f),s++)},i=6;for(let a=0;a<r.length;a+=i)await Promise.allSettled(r.slice(a,a+i).map(o));return{count:s}}async function ir(t,e){e.compress&&(await ks(t,e),await Es(t,e),await Ms(t,e))}J();function lr(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(i){R(n,"stripRootShadows boxShadow",i)}try{e.style.textShadow="none"}catch(i){R(n,"stripRootShadows textShadow",i)}try{e.style.outline="none"}catch(i){R(n,"stripRootShadows outline",i)}let o=(r.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch(i){R(n,"stripRootShadows filter",i)}}function ar(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",r=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||r!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function Fs(t,e){let n=Array.from(t.childNodes),r=e==="top"?n:n.reverse();for(let s of r){if(s.nodeType===Node.TEXT_NODE){if(/\S/.test(s.textContent||""))return null;continue}if(s.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(s),i=String(o.display||"");if(!(i==="none"||i==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||i.startsWith("inline")?null:s}return null}function ur(t,e){if(!t||!e||!e.style)return;let n=getComputedStyle(t);if(!ar(n))for(let r of["top","bottom"]){let s=r==="top"?"Top":"Bottom";if((parseFloat(n[`border${s}Width`])||0)>0||(parseFloat(n[`padding${s}`])||0)>0)continue;let o=t,i=e;for(;o&&i;){let a=Fs(o,r);if(!a)break;let l=Array.from(o.children).indexOf(a),u=l>=0?i.children[l]:null,c=getComputedStyle(a),f=parseFloat(c[`margin${s}`])||0;if(u&&u.style&&f>0&&(u.style[`margin${s}`]="0px"),ar(c)||(parseFloat(c[`border${s}Width`])||0)>0||(parseFloat(c[`padding${s}`])||0)>0)break;o=a,i=u}}}function $s(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),n=[];for(;e.nextNode();)n.push(e.currentNode);for(let r of n)r.remove()}function Rs(t,e={}){let{stripFrameworkDirectives:n=!0}=e,r=new Set(["xml","xlink"]),s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;s.nextNode();){let o=s.currentNode;for(let i of Array.from(o.attributes)){let a=i.name;if(a.includes("@")){o.removeAttribute(a);continue}if(a.includes(":")){let l=a.split(":",1)[0];if(!r.has(l)){o.removeAttribute(a);continue}}if(n&&(a.startsWith("x-")||a.startsWith("v-")||a.startsWith(":")||a.startsWith("on:")||a.startsWith("bind:")||a.startsWith("let:")||a.startsWith("class:"))){o.removeAttribute(a);continue}}}}var cr=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function Ts(t){if(!t)return;let e=s=>{if(s.nodeType===Node.ELEMENT_NODE){if(s.attributes)for(let o of Array.from(s.attributes)){let i=o.value.replace(cr,"");if(i!==o.value)try{s.setAttribute(o.name,i)}catch{}}}else if(s.nodeType===Node.TEXT_NODE||s.nodeType===Node.CDATA_SECTION_NODE){let o=s.data.replace(cr,"");o!==s.data&&(s.data=o)}};e(t);let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),r;for(;r=n.nextNode();)e(r)}function fr(t,e={}){t&&(Rs(t,e),$s(t),Ts(t))}function Ls(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function Ps(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Ns(t,e){if(!(t instanceof Element)||Ls(t)||Ps(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function dr(t,e,n=new Map){function r(s,o){if(!(s instanceof Element)||!(o instanceof Element))return;let i=s.childElementCount>o.childElementCount,a=n.get(s)||getComputedStyle(s);if(n.has(s)||n.set(s,a),i&&Ns(s,a)){o.style.height||(o.style.height="auto"),o.style.width||(o.style.width="auto"),o.style.removeProperty("block-size"),o.style.removeProperty("inline-size"),o.style.minHeight||(o.style.minHeight="0"),o.style.minWidth||(o.style.minWidth="0"),o.style.maxHeight||(o.style.maxHeight="none"),o.style.maxWidth||(o.style.maxWidth="none");let c=a.overflowY||a.overflowBlock||"visible",f=a.overflowX||a.overflowInline||"visible";(c!=="visible"||f!=="visible")&&(o.style.overflow="visible")}let l=Array.from(s.children),u=Array.from(o.children);for(let c=0;c<Math.min(l.length,u.length);c++)r(l[c],u[c])}r(t,e)}function Is(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function _s(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(r){R(e,"exclude selector match failed",r)}return!1}function mr(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),s=1/0,o=-1/0,i=!1,a=Array.from(t.children);for(let m of a){if(_s(m,e)||!Is(m))continue;let h=m.getBoundingClientRect(),p=h.top-r.top,y=h.bottom-r.top;y<=p||(p<s&&(s=p),y>o&&(o=y),i=!0)}let l=i?Math.max(0,o-s):0,u=parseFloat(n.borderTopWidth)||0,c=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return u+c+f+d+l}var M=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,Ws=/::-webkit-scrollbar(-[a-z]+)?\b/i;function _e(t,e=new Set){let n="";if(!t)return n;for(let r=0;r<t.length;r++){let s=t[r];try{if(s.type===CSSRule.IMPORT_RULE&&s.styleSheet){n+=_e(s.styleSheet.cssRules,e);continue}if(s.type===CSSRule.MEDIA_RULE&&s.cssRules){let o=_e(s.cssRules,e);o&&(n+=`@media ${s.conditionText}{${o}}`);continue}if(s.type===CSSRule.STYLE_RULE){let o=s.selectorText||"";if(Ws.test(o)){let i=s.cssText;i&&!e.has(i)&&(e.add(i),n+=i)}}}catch{}}return n}function pr(t){if(!t||!t.styleSheets)return"";let e=new Set,n="";for(let r of Array.from(t.styleSheets))try{let s=r.cssRules;s&&(n+=_e(s,e))}catch{}return n}Zt();function hr(t){let e=t.boxShadow||"";if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let n=[],r="",s=0;for(let u=0;u<e.length;u++){let c=e[u];c==="("?s++:c===")"&&(s=Math.max(0,s-1)),c===","&&s===0?(n.push(r),r=""):r+=c}r.trim()&&n.push(r);let o=0,i=0,a=0,l=0;for(let u of n){if(/\binset\b/i.test(u))continue;let c=u.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(c.length<2)continue;let[f,d,m=0,h=0]=c,p=Math.abs(f)+m+h,y=Math.abs(d)+m+h;i=Math.max(i,p+Math.max(f,0)),l=Math.max(l,p+Math.max(-f,0)),a=Math.max(a,y+Math.max(d,0)),o=Math.max(o,y+Math.max(-d,0))}return{top:Math.ceil(o),right:Math.ceil(i),bottom:Math.ceil(a),left:Math.ceil(l)}}function gr(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,s;for(;s=n.exec(e);)r+=parseFloat(s[1])||0;let o=Math.ceil(r);return{top:o,right:o,bottom:o,left:o}}function yr(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function br(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)||[],r=0,s=0,o=0,i=0,a=!1;for(let l of n){a=!0;let u=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[c=0,f=0,d=0]=u,m=Math.abs(c)+d,h=Math.abs(f)+d;s=Math.max(s,m+Math.max(c,0)),i=Math.max(i,m+Math.max(-c,0)),o=Math.max(o,h+Math.max(f,0)),r=Math.max(r,h+Math.max(-f,0))}return{bleed:{top:M(r),right:M(s),bottom:M(o),left:M(i)},has:a}}function wr(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 r=n.transform||"none";if(!r||r==="none"){let a=null;try{a=Ue(t).scale}catch{}try{e.style.transform="none"}catch{}if(!a)return{a:1,b:0,c:0,d:1};let l=a.trim().split(/\s+/).map(parseFloat),u=Number.isFinite(l[0])?l[0]:1,c=Number.isFinite(l[1])?l[1]:u;return{a:u,b:0,c:0,d:c}}function s(a,l,u,c){let f=Math.sqrt(a*a+l*l)||0,d=0,m=0;if(f>0){let h=a/f,p=l/f;d=h*u+p*c;let y=u-h*d,g=c-p*d;m=Math.sqrt(y*y+g*g)||0,m>0?d=d/m:d=0}return{a:f,b:0,c:d*m,d:m}}let o=r.match(/^matrix\(\s*([^)]+)\)$/i);if(o){let a=o[1].split(",").map(l=>parseFloat(l.trim()));if(a.length===6&&a.every(Number.isFinite)){let[l,u,c,f]=a,d=s(l,u,c,f);try{e.style.transform=`matrix(${d.a}, ${d.b}, ${d.c}, ${d.d}, 0, 0)`}catch{}return d}}let i=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(i){let a=i[1].split(",").map(l=>parseFloat(l.trim()));if(a.length===16&&a.every(Number.isFinite)){let l=a[0],u=a[1],c=a[4],f=a[5],d=s(l,u,c,f);try{e.style.transform=`matrix(${d.a}, ${d.b}, ${d.c}, ${d.d}, 0, 0)`}catch{}return d}}try{let a=new DOMMatrix(r),l=s(a.a,a.b,a.c,a.d);try{e.style.transform=`matrix(${l.a}, ${l.b}, ${l.c}, ${l.d}, 0, 0)`}catch{}return l}catch{return null}}function Oe(t,e,n,r,s){let o=n.a,i=n.b,a=n.c,l=n.d,u=n.e||0,c=n.f||0;function f(g,w){let S=g-r,b=w-s,x=o*S+a*b,k=i*S+l*b;return x+=r+u,k+=s+c,[x,k]}let d=[f(0,0),f(t,0),f(0,e),f(t,e)],m=1/0,h=1/0,p=-1/0,y=-1/0;for(let[g,w]of d)g<m&&(m=g),w<h&&(h=w),g>p&&(p=g),w>y&&(y=w);return{minX:m,minY:h,maxX:p,maxY:y,width:p-m,height:y-h}}function Sr(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[s,o]=[r[0]||"0",r[1]||"0"],i=(a,l)=>{let u=a.toLowerCase();return u==="left"||u==="top"?0:u==="center"?l/2:u==="right"||u==="bottom"?l:u.endsWith("px")?parseFloat(u)||0:u.endsWith("%")?(parseFloat(u)||0)*l/100:/^-?\d+(\.\d+)?$/.test(u)&&parseFloat(u)||0};return{ox:i(s,e),oy:i(o,n)}}function Ue(t){let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let s=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},o=s("rotate");if(o)if(o.angle){let l=o.angle;e.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.unit}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let l=getComputedStyle(t);e.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let i=s("scale");if(i){let l="x"in i&&i.x?.value!=null?i.x.value:Array.isArray(i)?i[0]?.value:Number(i)||1,u="y"in i&&i.y?.value!=null?i.y.value:Array.isArray(i)?i[1]?.value:l;e.scale=`${l} ${u}`}else{let l=getComputedStyle(t);e.scale=l.scale&&l.scale!=="none"?l.scale:null}let a=s("translate");if(a){let l="x"in a&&"value"in a.x?a.x.value:Array.isArray(a)?a[0]?.value:0,u="y"in a&&"value"in a.y?a.y.value:Array.isArray(a)?a[1]?.value:0,c="x"in a&&a.x?.unit?a.x.unit:"px",f="y"in a&&a.y?.unit?a.y.unit:"px";e.translate=`${l}${c} ${u}${f}`}else{let l=getComputedStyle(t);e.translate=l.translate&&l.translate!=="none"?l.translate:null}return e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}var We=null;function Os(){if(We)return We;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),We=t,t}function xr(t){let e=Os(),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 r=Us(n);return e.removeChild(n),r}function Cr(t){let e=_(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",o=e.scale&&e.scale!=="none"&&e.scale!=="1",i=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(s||o||i)}function Us(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}function Bs(t){if(Array.isArray(t.plugins)){for(let e of t.plugins)if(ue(e)?.name==="picture-resolver")return!0}return or().some(e=>e?.name==="picture-resolver")}async function Be(t,e){if(!t)throw new Error("Element cannot be null or undefined");Xt(e.cache);let n=e.fast,r=e.outerTransforms!==!1,s=!!e.outerShadows,o={element:t,options:e,plugins:e.plugins},i,a,l,u="",c="",f,d,m=null;await et("beforeSnap",o);let h=null;e.resolvePicturePlaceholders!==!1&&!Bs(e)&&(h=await sr(o.element,o.options)),await et("beforeClone",o);let p=Zn(o.element);try{({clone:i,classCSS:a,styleCache:l}=await Kn(o.element,o.options)),!r&&i&&(m=wr(o.element,i)),!s&&i&&lr(o.element,i,o.options),i&&ur(o.element,i)}finally{p()}if(o={clone:i,classCSS:a,styleCache:l,...o},await et("afterClone",o),h&&await h(),fr(o.clone),o.options?.excludeMode==="remove")try{dr(o.element,o.clone,o.styleCache)}catch(b){console.warn("[snapdom] shrink pass failed:",b)}try{await An(o.clone,o.element)}catch{}await new Promise(b=>{tt(async()=>{await Jn(o.clone,o.options),b()},{fast:n})}),await new Promise(b=>{tt(async()=>{await le(o.element,o.clone,o.styleCache,o.options),b()},{fast:n})}),e.compress&&await new Promise(b=>{tt(async()=>{await ir(o.clone,o.options),b()},{fast:n})}),e.embedFonts&&await new Promise(b=>{tt(async()=>{let x=At(o.element),k=ae(o.element);if(D()){let A=new Set(Array.from(x).map(v=>String(v).split("__")[0]).filter(Boolean));await kt(A,1)}u=await ie({required:x,usedCodepoints:k,preCached:!1,exclude:o.options.excludeFonts,localFonts:o.options.localFonts,useProxy:o.options.useProxy,fontStylesheetDomains:o.options.fontStylesheetDomains}),b()},{fast:n})});let y=xe(o.clone).sort(),g=y.join(",");C.baseStyle.has(g)?c=C.baseStyle.get(g):await new Promise(b=>{tt(()=>{c=Ce(y),C.baseStyle.set(g,c),b()},{fast:n})});let w=pr(o.element?.ownerDocument||document);o={fontsCSS:u,baseCSS:c,scrollbarCSS:w,...o},await et("beforeRender",o),await new Promise(b=>{tt(()=>{let x=_(o.element),k=o.element.getBoundingClientRect(),A=Math.max(1,M(o.element.offsetWidth||parseFloat(x.width)||k.width||1)),v=Math.max(1,M(o.element.offsetHeight||parseFloat(x.height)||k.height||1)),E=o.element.ownerDocument||document;if(o.element===E.body||o.element===E.documentElement){let V=Math.max(o.element.scrollHeight||0,E.documentElement?.scrollHeight||0,E.body?.scrollHeight||0),G=Math.max(o.element.scrollWidth||0,E.documentElement?.scrollWidth||0,E.body?.scrollWidth||0);V>0&&(v=Math.max(v,M(V))),G>0&&(A=Math.max(A,M(G)));try{let rt=(o.scrollbarCSS||"").length+(o.baseCSS||"").length+(o.fontsCSS||"").length+(o.classCSS||"").length,Q=C.measureHints.get(o.element);if(Q&&Q.cssLen===rt&&Q.w0===A)Q.csh>0&&(v=Math.max(v,M(Q.csh))),Q.csw>0&&(A=Math.max(A,M(Q.csw)));else{let ot=E.createElement("div");ot.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+A+"px!important;overflow:visible!important;visibility:hidden!important;";let jt=E.createElement("style");jt.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,ot.appendChild(jt),ot.appendChild(o.clone.cloneNode(!0)),E.body.appendChild(ot);let $t=ot.scrollHeight,ut=ot.scrollWidth;E.body.removeChild(ot),C.measureHints.set(o.element,{cssLen:rt,w0:A,csh:$t,csw:ut}),$t>0&&(v=Math.max(v,M($t))),ut>0&&(A=Math.max(A,M(ut)))}}catch{}}if(o.options?.excludeMode==="remove"){let V=mr(o.element,o.options);Number.isFinite(V)&&V>0&&(v=Math.max(1,Math.min(v,M(V+1))))}let W=(V,G=NaN)=>{let rt=typeof V=="string"?parseFloat(V):V;return Number.isFinite(rt)?rt:G},q=W(o.options.width),Y=W(o.options.height),T=A,I=v,F=Number.isFinite(q),X=Number.isFinite(Y),Ht=v>0?A/v:1;F&&X?(T=Math.max(1,M(q)),I=Math.max(1,M(Y))):F?(T=Math.max(1,M(q)),I=Math.max(1,M(T/(Ht||1)))):X?(I=Math.max(1,M(Y)),T=Math.max(1,M(I*(Ht||1)))):(T=A,I=v);let dt=0,at=0,$=A,L=v;if(!r&&m&&Number.isFinite(m.a)){let V={a:m.a,b:m.b||0,c:m.c||0,d:m.d||1,e:0,f:0},G=Oe(A,v,V,0,0);dt=M(G.minX),at=M(G.minY),$=M(G.maxX),L=M(G.maxY)}else if(r&&Ar(o.element)){let G=x.transform&&x.transform!=="none"?x.transform:"",rt=Ue(o.element),Q=xr({baseTransform:G,rotate:rt.rotate||"0deg",scale:rt.scale,translate:rt.translate}),{ox:ot,oy:jt}=Sr(x,A,v),$t=Q.is2D?Q:new DOMMatrix(Q.toString()),ut=Oe(A,v,$t,ot,jt);dt=M(ut.minX),at=M(ut.minY),$=M(ut.maxX),L=M(ut.maxY)}let O=hr(x),U=gr(x),K=yr(x),Ft=br(x),nt=s?{top:M(O.top+U.top+K.top+Ft.bleed.top),right:M(O.right+U.right+K.right+Ft.bleed.right),bottom:M(O.bottom+U.bottom+K.bottom+Ft.bleed.bottom),left:M(O.left+U.left+K.left+Ft.bleed.left)}:{top:0,right:0,bottom:0,left:0};dt=M(dt-nt.left),at=M(at-nt.top),$=M($+nt.right),L=M(L+nt.bottom);let Dt=Math.max(1,M($-dt)),mt=Math.max(1,M(L-at)),de=F||X?M(T/A):1,me=X||F?M(I/v):1,zt=Math.max(1,M(Dt*de)),qt=Math.max(1,M(mt*me)),je="http://www.w3.org/2000/svg",Or=D()&&Ar(o.element)?1:0,ct=M(Or+(r?0:1)),lt=document.createElementNS(je,"foreignObject"),Ur=M(dt),Br=M(at);lt.setAttribute("x",String(M(-(Ur-ct)))),lt.setAttribute("y",String(M(-(Br-ct)))),lt.setAttribute("width",String(M(A+ct*2))),lt.setAttribute("height",String(M(v+ct*2))),lt.style.overflow="visible";let Xe=document.createElement("style"),Hr="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";Xe.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+Hr+o.classCSS,lt.appendChild(Xe);let Vt=document.createElement("div");Vt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Vt.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${M(A)}px;height:${M(v)}px`,Vt.appendChild(o.clone),lt.appendChild(Vt);let Dr=new XMLSerializer().serializeToString(lt),pe=M(Dt+ct*2),he=M(mt+ct*2),Ge=F||X;e.meta={w0:A,h0:v,vbW:pe,vbH:he,targetW:T,targetH:I};let zr=D()&&Ge?pe:M(zt+ct*2),qr=D()&&Ge?he:M(qt+ct*2),Vr=parseFloat(_(E.documentElement)?.fontSize)||16;d=`<svg xmlns="${je}" width="${zr}" height="${qr}" viewBox="0 0 ${pe} ${he}" font-size="${Vr}px">`+Dr+"</svg>",f=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,o={svgString:d,dataURL:f,...o},b()},{fast:n})}),await et("afterRender",o);let S=document.getElementById("snapdom-sandbox");return S&&S.style.position==="absolute"&&S.remove(),o.dataURL}function Ar(t){return Cr(t)}z();function kr(t={}){let e=t.format??"png";e==="jpg"&&(e="jpeg");let n=Ye(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,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],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,compress:t.compress!==!1,safariWarmupAttempts:Math.min(3,Math.max(1,(t.safariWarmupAttempts??3)|0)),excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1,pictureResolver:t.pictureResolver&&typeof t.pictureResolver=="object"?t.pictureResolver:{}}}xt();ve();J();ht();z();async function vr(t=document,e={}){let{embedFonts:n=!0,useProxy:r=""}=e,s=e.cache??e.cacheOpt??"full";Xt(s);try{await document.fonts?.ready}catch{}try{we()}catch{}C.session=C.session||{},C.session.styleCache||(C.session.styleCache=new WeakMap),C.image=C.image||new H(100),C.background=C.background||new H(100);try{await le(t,void 0,C.session.styleCache,{useProxy:r})}catch{}let o=[],i=[];try{if(t&&t.nodeType===1){let l=t.querySelectorAll?Array.from(t.querySelectorAll("*")):[];i=[t,...l],o=[],t.tagName==="IMG"&&t.getAttribute("src")&&o.push(t),o.push(...Array.from(t.querySelectorAll?.("img[src]")||[]))}else t?.querySelectorAll&&(o=Array.from(t.querySelectorAll("img[src]")),i=Array.from(t.querySelectorAll("*")))}catch{}let a=[];for(let l of o){let u=l?.currentSrc||l?.src;if(u&&!C.image.has(u)){let c=Promise.resolve().then(async()=>{let f=await B(u,{as:"dataURL",useProxy:r});f?.ok&&typeof f.data=="string"&&C.image.set(u,f.data)}).catch(()=>{});a.push(c)}}for(let l of i){let u="";try{u=l?.style?.backgroundImage||"",(!u||u==="none")&&(u=_(l).backgroundImage)}catch{}if(u&&u!=="none"){let c=u.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let f of c){let d=Promise.resolve().then(()=>gt(f,{...e,useProxy:r})).catch(()=>{});a.push(d)}}}if(n)try{let l=At(t),u=ae(t);if(typeof D=="function"?D():!!D){let f=new Set(Array.from(l).map(d=>String(d).split("__")[0]).filter(Boolean));await kt(f,3)}await ie({required:l,usedCodepoints:u,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:e.useProxy??r,fontStylesheetDomains:e.fontStylesheetDomains})}catch{}await Promise.allSettled(a)}function Ys(...t){return tr(...t),N}var N=Object.assign(Qs,{plugins:Ys}),Wr=Symbol("snapdom.internal"),Ks=Symbol("snapdom.internal.silent"),_r=!1;async function Qs(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=kr(e);if(rr(n,e&&e.plugins),D()&&(n.embedFonts===!0||Zs(t))){if(n.embedFonts)try{let s=At(t),o=new Set([...s].map(i=>String(i).split("__")[0]).filter(Boolean));await kt(o,1)}catch{}let r=n.safariWarmupAttempts??3;for(let s=0;s<r;s++)try{await Js(t,e)}catch{}}return n.iconFonts&&n.iconFonts.length>0&&Cn(n.iconFonts),n.snap||(n.snap={toPng:(r,s)=>N.toPng(r,s),toSvg:(r,s)=>N.toSvg(r,s)}),N.capture(t,n,Wr)}N.capture=async(t,e,n)=>{if(n!==Wr)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await Be(t,e),s={img:async(p,y)=>{let{toImg:g}=await Promise.resolve().then(()=>(ze(),De));return g(r,{...p,...y||{}})},svg:async(p,y)=>{let{toSvg:g}=await Promise.resolve().then(()=>(ze(),De));return g(r,{...p,...y||{}})},canvas:async(p,y)=>{let{toCanvas:g}=await Promise.resolve().then(()=>(Ut(),Tr));return g(r,{...p,...y||{}})},blob:async(p,y)=>{let{toBlob:g}=await Promise.resolve().then(()=>(Ve(),Lr));return g(r,{...p,...y||{}})},png:async(p,y)=>{let{rasterize:g}=await Promise.resolve().then(()=>(Bt(),fe));return g(r,{...p,...y||{},format:"png"})},jpeg:async(p,y)=>{let{rasterize:g}=await Promise.resolve().then(()=>(Bt(),fe));return g(r,{...p,...y||{},format:"jpeg"})},webp:async(p,y)=>{let{rasterize:g}=await Promise.resolve().then(()=>(Bt(),fe));return g(r,{...p,...y||{},format:"webp"})},download:async(p,y)=>{let{download:g}=await Promise.resolve().then(()=>(Ir(),Nr));return g(r,{...p,...y||{}})}},o={};for(let p of["img","svg","canvas","blob","png","jpeg","webp"])o[p]=async y=>s[p](e,{...y||{},[Ks]:!0});o.jpg=o.jpeg;let i={...e,export:{url:r},exports:o},a=await nr("defineExports",i),l=Object.assign({},...a.filter(p=>p&&typeof p=="object").reverse()),u={...s,...l};u.jpeg&&!u.jpg&&(u.jpg=(p,y)=>u.jpeg(p,y));function c(p,y){let g={...e,...y||{}},w=b=>b==="jpeg"||b==="jpg"||b==="webp";return[p,g.format,g.type].map(b=>typeof b=="string"?b.toLowerCase():"").find(w)&&(g.backgroundColor==null||g.backgroundColor==="transparent")&&(g.backgroundColor="#ffffff"),g}let f=!1,d=Promise.resolve();async function m(p,y){let g=async()=>{let w=u[p];if(!w)throw new Error(`[snapdom] Unknown export type: ${p}`);let S=c(p,y),b={...e,export:{type:p,options:S,url:r}};await et("beforeExport",b,{format:p,options:S});let x=await w(b,S);return await et("afterExport",b,{format:p,options:S,result:x}),f||(f=!0,await et("afterSnap",e)),x};return d=d.then(g)}let h={url:r,toRaw:()=>r,to:(p,y)=>m(p,y),toImg:p=>m("img",p),toSvg:p=>m("svg",p),toCanvas:p=>m("canvas",p),toBlob:p=>m("blob",p),toPng:p=>m("png",p),toJpg:p=>m("jpg",p),toWebp:p=>m("webp",p),download:p=>m("download",p)};for(let p of Object.keys(u)){let y="to"+p.charAt(0).toUpperCase()+p.slice(1);h[y]||(h[y]=g=>m(p,g))}return h};N.toRaw=(t,e)=>N(t,e).then(n=>n.toRaw());N.toImg=(t,e)=>N(t,e).then(n=>n.toImg());N.toSvg=(t,e)=>N(t,e).then(n=>n.toSvg());N.toCanvas=(t,e)=>N(t,e).then(n=>n.toCanvas());N.toBlob=(t,e)=>N(t,e).then(n=>n.toBlob());N.toPng=(t,e)=>N(t,{...e,format:"png"}).then(n=>n.toPng());N.toJpg=(t,e)=>N(t,{...e,format:"jpeg"}).then(n=>n.toJpg());N.toWebp=(t,e)=>N(t,{...e,format:"webp"}).then(n=>n.toWebp());N.download=(t,e)=>N(t,e).then(n=>n.download());async function Js(t,e){if(_r)return;let n={...e,fast:!0,embedFonts:!0,scale:.2},r;try{r=await Be(t,n)}catch(s){R(e,"safariWarmup pre-capture failed",s)}await new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s))),r&&await new Promise(s=>{let o=new Image;try{o.decoding="sync",o.loading="eager"}catch(i){R(e,"safariWarmup img hints failed",i)}o.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",o.src=r,document.body.appendChild(o),(async()=>{try{typeof o.decode=="function"&&await o.decode()}catch(a){R(e,"safariWarmup img.decode failed",a)}let i=performance.now();for(;!(o.complete&&o.naturalWidth>0)&&performance.now()-i<900;)await new Promise(a=>setTimeout(a,200));await new Promise(a=>requestAnimationFrame(a));try{let a=document.createElement("canvas");a.width=Math.max(1,o.naturalWidth||10),a.height=Math.max(1,o.naturalHeight||10);let l=a.getContext("2d");l&&l.drawImage(o,0,0)}catch{}await new Promise(a=>requestAnimationFrame(a));try{o.remove()}catch(a){R(e,"safariWarmup img.remove failed",a)}s()})()}),t.querySelectorAll("canvas").forEach(s=>{try{let o=s.getContext("2d",{willReadFrequently:!0});o&&o.getImageData(0,0,1,1)}catch(o){R(e,"safariWarmup canvas poke failed",o)}}),_r=!0}function Zs(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,r=getComputedStyle(n),s=r.backgroundImage&&r.backgroundImage!=="none",o=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(s||o||n.tagName==="CANVAS")return!0}return!1}typeof window<"u"&&(window.snapdom=N,window.preCache=vr);
|
|
14
|
+
`):c+=m[0]}return c+=a.slice(f),c}let i=kn(t,e||location.href);return i=await o(i,e||location.href,0),i}var Fn=/url\((["']?)([^"')]+)\1\)/g,Jo=/@font-face[^{}]*\{[^}]*\}/g;function $n(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let s=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!s)continue;let o=s[1],i=s[2],a=l=>{if(!l.includes("?"))return parseInt(l,16);let u=parseInt(l.replace(/\?/g,"0"),16),c=parseInt(l.replace(/\?/g,"F"),16);return[u,c]};if(i){let l=a(o),u=a(i),c=Array.isArray(l)?l[0]:l,f=Array.isArray(u)?u[1]:u;e.push([Math.min(c,f),Math.max(c,f)])}else{let l=a(o);Array.isArray(l)?e.push([l[0],l[1]]):e.push([l,l])}}return e}function Rn(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,s]of e)if(n>=r&&n<=s)return!0;return!1}function Te(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(Fn)){let s=(r[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 Tn(t,e,n=""){let r=t;for(let s of t.matchAll(Fn)){let o=ht(s[0]);if(!o)continue;let i=o;if(!i.startsWith("http")&&!i.startsWith("data:"))try{i=new URL(i,e||location.href).href}catch{}if(!Z(i)){if(C.resource?.has(i)){C.font?.add(i),r=r.replace(s[0],`url(${C.resource.get(i)})`);continue}try{let a=await U(i,{as:"dataURL",useProxy:n,silent:!0});if(a.ok&&typeof a.data=="string"){let l=a.data;C.resource?.set(i,l),C.font?.add(i),r=r.replace(s[0],`url(${l})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",i)}}}return r}function Zo(t){if(!t.length)return null;let e=(a,l)=>t.some(([u,c])=>!(c<a||u>l)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),s=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":s?"greek":r?"latin-ext":n?"latin":null}function vn(t={}){let e=new Set((t.families||[]).map(s=>String(s).toLowerCase())),n=new Set((t.domains||[]).map(s=>String(s).toLowerCase())),r=new Set((t.subsets||[]).map(s=>String(s).toLowerCase()));return(s,o)=>{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(r.size){let i=Zo(o);if(i&&r.has(i))return!0}return!1}}function ts(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of t.match(e)||[]){let i=o.match(/font-family:\s*([^;]+);/i)?.[1]||"",a=Re(i),l=(o.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),u=(o.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),c=(o.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),f=(o.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),m=(o.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),d=Te(m,location.href),h=d.length?d.map(g=>String(g).toLowerCase()).sort().join("|"):m.toLowerCase(),p=[String(a||"").toLowerCase(),l,u,c,f.toLowerCase(),h].join("|");n.has(p)||(n.add(p),r.push(o))}if(r.length===0)return t;let s=0;return t.replace(e,()=>r[s++]||"")}function es(t,e,n,r,s){let o=Array.from(t||[]).sort().join("|"),i=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("|"),l=r||"",u=(s||[]).map(c=>String(c).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${o}::ex=${i}::lf=${a}::px=${l}::fd=${u}`}async function Ln(t,e,n,r){let s;try{s=t.cssRules||[]}catch{return}let o=(i,a)=>{try{return new URL(i,a||location.href).href}catch{return i}};for(let i of s){if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){let a=i.href?o(i.href,e):e;if(r.depth>=se){console.warn(`[snapDOM] CSSOM import depth exceeded (${se}) at ${a}`);continue}if(a&&r.visitedSheets.has(a)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${a}`);continue}a&&r.visitedSheets.add(a);let l={...r,depth:(r.depth||0)+1};await Ln(i.styleSheet,a,n,l);continue}if(i.type===CSSRule.FONT_FACE_RULE){let a=(i.style.getPropertyValue("font-family")||"").trim(),l=Re(a);if(!l||Z(l))continue;let u=(i.style.getPropertyValue("font-weight")||"400").trim(),c=(i.style.getPropertyValue("font-style")||"normal").trim(),f=(i.style.getPropertyValue("font-stretch")||"100%").trim(),m=(i.style.getPropertyValue("src")||"").trim(),d=(i.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(l,c,u,f))continue;let h=$n(d);if(!Rn(r.usedCodepoints,h))continue;let p={family:l,weightSpec:u,styleSpec:c,stretchSpec:f,unicodeRange:d,srcRaw:m,srcUrls:Te(m,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(p,h))continue;if(/url\(/i.test(m)){let g=await Tn(m,e||location.href,r.useProxy);await n(`@font-face{font-family:${l};src:${g};font-style:${c};font-weight:${u};font-stretch:${f};${d?`unicode-range:${d};`:""}}`)}else await n(`@font-face{font-family:${l};src:${m};font-style:${c};font-weight:${u};font-stretch:${f};${d?`unicode-range:${d};`:""}}`)}}}async function ie({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:s="",fontStylesheetDomains:o=[],doc:i=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let a=new Map;for(let w of t){let[x,y,S,k]=String(w).split("__");if(!x)continue;let A=x.toLowerCase(),v=a.get(A)||[];v.push({w:parseInt(y,10),s:S,st:parseInt(k,10)}),a.set(A,v)}function l(w,x,y,S){let k=String(w).toLowerCase();if(!a.has(k))return!1;let A=a.get(k),v=Vo(y),M=jo(x),L=Xo(S),_=v.min!==v.max,q=v.min,V=T=>M.kind==="normal"&&T==="normal"||M.kind!=="normal"&&(T==="italic"||T==="oblique"),j=!1;for(let T of A){let F=_?T.w>=v.min&&T.w<=v.max:T.w===q,z=V(oe(T.s)),nt=T.st>=L.min&&T.st<=L.max;if(F&&z&&nt){j=!0;break}}if(j)return!0;if(!_)for(let T of A){let F=V(oe(T.s)),z=T.st>=L.min&&T.st<=L.max;if(Math.abs(q-T.w)<=300&&F&&z)return!0}if(!_&&M.kind==="normal"&&A.some(F=>oe(F.s)!=="normal"))for(let F of A){let z=Math.abs(q-F.w)<=300,nt=F.st>=L.min&&F.st<=L.max;if(z&&nt)return!0}return!1}let u=vn(n),c=es(t,n,r,s,o);if(C.resource?.has(c))return C.resource.get(c);let f=Ko(t),m=[],d=$e;for(let w of i.querySelectorAll("style")){let x=w.textContent||"";for(let y of x.matchAll(d)){let S=(y[2]||y[4]||"").trim();if(!S||Z(S))continue;i.querySelector(`link[rel="stylesheet"][href="${S}"]`)||m.push(S)}}let h=[];m.length&&await Promise.all(m.map(w=>new Promise(x=>{if(i.querySelector(`link[rel="stylesheet"][href="${w}"]`))return x(null);let y=i.createElement("link");y.rel="stylesheet",y.href=w,y.setAttribute("data-snapdom","injected-import"),y.onload=()=>x(y),y.onerror=()=>x(null),i.head.appendChild(y),h.push(y)})));let p="",g=Array.from(i.querySelectorAll('link[rel="stylesheet"]')).filter(w=>!!w.href);for(let w of h)try{w.remove()}catch{}for(let w of g)try{if(Z(w.href))continue;let x="",y=!1;try{y=new URL(w.href,location.href).origin===location.origin}catch{}if(!y){let k=Array.isArray(o)?o:[];if(!Yo(w.href,f,k))continue}if(y){let k=Array.from(i.styleSheets).find(A=>A.href===w.href);if(k)try{let A=k.cssRules||[];x=Array.from(A).map(v=>v.cssText).join("")}catch{}}if(!x){let k=await U(w.href,{as:"text",useProxy:s});if(k?.ok&&typeof k.data=="string"&&(x=k.data),Z(w.href))continue}x=await Qo(x,w.href,s);let S="";for(let k of x.match(Jo)||[]){let A=(k.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),v=Re(A);if(!v||Z(v))continue;let M=(k.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),L=(k.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),_=(k.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),q=(k.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),V=(k.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),j=Te(V,w.href);if(!l(v,L,M,_))continue;let T=$n(q);if(!Rn(e,T))continue;let F={family:v,weightSpec:M,styleSpec:L,stretchSpec:_,unicodeRange:q,srcRaw:V,srcUrls:j,href:w.href};if(n&&u(F,T))continue;let z=/url\(/i.test(V)?await Tn(k,w.href,s):k;S+=z}S.trim()&&(p+=S)}catch{console.warn("[snapDOM] Failed to process stylesheet:",w.href)}let b={requiredIndex:a,usedCodepoints:e,faceMatchesRequired:l,simpleExcluder:n?vn(n):null,useProxy:s,visitedSheets:new Set,depth:0};for(let w of i.styleSheets)if(!(w.href&&g.some(x=>x.href===w.href)))try{let x=w.href||location.origin+"/";x&&b.visitedSheets.add(x),await Ln(w,x,async y=>{p+=y},b)}catch{}try{for(let w of i.fonts||[]){if(!w||!w.family||w.status!=="loaded"||!w._snapdomSrc)continue;let x=String(w.family).replace(/^['"]+|['"]+$/g,"");if(Z(x)||!a.has(x.toLowerCase())||n?.families&&n.families.some(S=>String(S).toLowerCase()===x.toLowerCase()))continue;let y=w._snapdomSrc;if(!String(y).startsWith("data:")){if(C.resource?.has(w._snapdomSrc))y=C.resource.get(w._snapdomSrc),C.font?.add(w._snapdomSrc);else if(!C.font?.has(w._snapdomSrc))try{let S=await U(w._snapdomSrc,{as:"dataURL",useProxy:s,silent:!0});if(S.ok&&typeof S.data=="string")y=S.data,C.resource?.set(w._snapdomSrc,y),C.font?.add(w._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",w._snapdomSrc);continue}}p+=`@font-face{font-family:'${x}';src:url(${y});font-style:${w.style||"normal"};font-weight:${w.weight||"normal"};}`}}catch{}for(let w of r){if(!w||typeof w!="object")continue;let x=String(w.family||"").replace(/^['"]+|['"]+$/g,"");if(!x||Z(x)||!a.has(x.toLowerCase())||n?.families&&n.families.some(M=>String(M).toLowerCase()===x.toLowerCase()))continue;let y=w.weight!=null?String(w.weight):"normal",S=w.style!=null?String(w.style):"normal",k=w.stretchPct!=null?`${w.stretchPct}%`:"100%",A=String(w.src||""),v=A;if(!v.startsWith("data:")){if(C.resource?.has(A))v=C.resource.get(A),C.font?.add(A);else if(!C.font?.has(A))try{let M=await U(A,{as:"dataURL",useProxy:s,silent:!0});if(M.ok&&typeof M.data=="string")v=M.data,C.resource?.set(A,v),C.font?.add(A);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",A);continue}}p+=`@font-face{font-family:'${x}';src:url(${v});font-style:${S};font-weight:${y};font-stretch:${k};}`}return p&&(p=ts(p),C.resource?.set(c,p)),p}function kt(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),r=i=>{let a=zo(i.fontFamily);if(a.length)for(let l of a){let u=(c,f,m)=>`${l}__${re(c)}__${oe(f)}__${qo(m)}`;e.add(u(i.fontWeight,i.fontStyle,i.fontStretch))}};r(getComputedStyle(t));let s=getComputedStyle(t,"::before");s&&s.content&&s.content!=="none"&&r(s);let o=getComputedStyle(t,"::after");for(o&&o.content&&o.content!=="none"&&r(o);n.nextNode();){let i=n.currentNode,a=getComputedStyle(i);r(a);let l=getComputedStyle(i,"::before");l&&l.content&&l.content!=="none"&&r(l);let u=getComputedStyle(i,"::after");u&&u.content&&u.content!=="none"&&r(u)}return e}function ae(t){let e=new Set,n=s=>{if(s)for(let o of s)e.add(o.codePointAt(0))},r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let s=r.currentNode;if(s.nodeType===Node.TEXT_NODE)n(s.nodeValue||"");else if(s.nodeType===Node.ELEMENT_NODE){let o=s;for(let i of["::before","::after"]){let l=getComputedStyle(o,i)?.getPropertyValue("content");if(!(!l||l==="none"))if(/^"/.test(l)||/^'/.test(l))n(l.slice(1,-1));else{let u=l.match(/\\[0-9A-Fa-f]{1,6}/g);if(u)for(let c of u)try{e.add(parseInt(c.slice(1),16))}catch{}}}}}return e}async function vt(t,e=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(t||[]).filter(Boolean);if(r.length===0)return;let s=()=>{let o=n.createElement("div");o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let i of r){let a=n.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${i}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}n.body.appendChild(o),o.offsetWidth,n.body.removeChild(o)};for(let o=0;o<Math.max(1,e);o++)s(),await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i)))}H();function _n(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Pn(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function Nn(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"]],r=Math.max(1,Math.min(3999,t)),s="";for(let[o,i]of n)for(;r>=o;)s+=i,r-=o;return e?s:s.toLowerCase()}function In(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":return Pn(t,!1);case"upper-alpha":return Pn(t,!0);case"lower-roman":return Nn(t,!1);case"upper-roman":return Nn(t,!0);default:return String(t)}}function Wn(t){let e=()=>C?.session?.__counterEpoch??0,n=e(),r=new WeakMap,s=t instanceof Document?t.documentElement:t,o=m=>m&&m.tagName==="LI",i=m=>{let d=0,h=m?.parentElement;if(!h)return 0;for(let p of h.children){if(p===m)break;p.tagName==="LI"&&d++}return d},a=m=>{let d=new Map;for(let[h,p]of m)d.set(h,p.slice());return d},l=(m,d,h)=>{let p=a(m),g;try{g=h.style?.counterReset||getComputedStyle(h).counterReset}catch{}if(g&&g!=="none")for(let x of g.split(",")){let y=x.trim().split(/\s+/),S=y[0],k=Number.isFinite(Number(y[1]))?Number(y[1]):0;if(!S)continue;let A=d.get(S);if(A&&A.length){let v=A.slice();v.push(k),p.set(S,v)}else p.set(S,[k])}let b;try{b=h.style?.counterSet||getComputedStyle(h).counterSet}catch{}if(b&&b!=="none")for(let x of b.split(",")){let y=x.trim().split(/\s+/),S=y[0],k=Number.isFinite(Number(y[1]))?Number(y[1]):0;if(!S)continue;let A=p.get(S)||[];A.length===0&&A.push(0),A[A.length-1]=k,p.set(S,A)}let w;try{w=h.style?.counterIncrement||getComputedStyle(h).counterIncrement}catch{}if(w&&w!=="none")for(let x of w.split(",")){let y=x.trim().split(/\s+/),S=y[0],k=Number.isFinite(Number(y[1]))?Number(y[1]):1;if(!S)continue;let A=p.get(S)||[];A.length===0&&A.push(0),A[A.length-1]+=k,p.set(S,A)}try{if(getComputedStyle(h).display==="list-item"&&o(h)){let y=h.parentElement,S=1;if(y&&y.tagName==="OL"){let A=y.getAttribute("start"),v=Number.isFinite(Number(A))?Number(A):1,M=i(h),L=h.getAttribute("value");S=Number.isFinite(Number(L))?Number(L):v+M}else S=1+i(h);let k=p.get("list-item")||[];k.length===0&&k.push(0),k[k.length-1]=S,p.set("list-item",k)}}catch{}return p},u=(m,d,h)=>{let p=l(h,d,m);r.set(m,p);let g=p;for(let w of m.children)g=u(w,p,g);let b=new Map;for(let[w,x]of h){let y=x.length,S=g.get(w);b.set(w,S&&S.length?S.slice(0,y):x.slice())}for(let[w,x]of g)!b.has(w)&&x.length&&!d.has(w)&&b.set(w,x.slice(0,1));return b},c=new Map;u(s,c,c);function f(){let m=e();if(m!==n){n=m;let d=new Map;u(s,d,d)}}return{get(m,d){f();let h=r.get(m)?.get(d);return h&&h.length?h[h.length-1]:0},getStack(m,d){f();let h=r.get(m)?.get(d);return h?h.slice():[]}}}function On(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(r,(s,o,i)=>{let a=String(i).split(",").map(l=>l.trim());if(o==="counter"){let l=a[0]?.replace(/^["']|["']$/g,""),u=(a[1]||"decimal").toLowerCase(),c=n.get(e,l);return In(c,u)}else{let l=a[0]?.replace(/^["']|["']$/g,""),u=a[1]?.replace(/^["']|["']$/g,"")??"",c=(a[2]||"decimal").toLowerCase(),f=n.getStack(e,l);return f.length?f.map(d=>In(d,c)).join(u):""}})}catch{return"- "}}gt();H();var Mt=new WeakMap,Un=1e3;function ns(t,e){let n=qn(t);return e?(e.__pseudoPreflightFp!==n&&(e.__pseudoPreflight=Dn(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):Dn(t,n)}function Le(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function qn(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.tagName==="STYLE"){let a=i.textContent?i.textContent.length:0;n+=`S${a}|`;let l=i.sheet,u=l?Le(l):null;u&&(r+=u.length)}else{let a=i.getAttribute("href")||"",l=i.getAttribute("media")||"all";n+=`L${a}|m:${l}|`;let u=i.sheet,c=u?Le(u):null;c&&(r+=c.length)}}let s=t.adoptedStyleSheets;return n+=`ass:${Array.isArray(s)?s.length:0}|tr:${r}`,n}function Bn(t,e,n){let r=Le(t);if(!r)return!1;for(let s=0;s<r.length;s++){if(n.budget<=0)return!1;let o=r[s],i=o&&o.cssText?o.cssText:"";n.budget--;for(let a of e)if(i.includes(a))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let a=0;a<o.cssRules.length&&n.budget>0;a++){let l=o.cssRules[a],u=l&&l.cssText?l.cssText:"";n.budget--;for(let c of e)if(u.includes(c))return!0}if(n.budget<=0)return!1}return!1}function Dn(t=document,e=qn(t)){let n=Mt.get(t);if(n&&n.fingerprint===e)return n.result;let r=["::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 a=s[i].textContent||"";for(let l of r)if(a.includes(l))return Mt.set(t,{fingerprint:e,result:!0}),!0}let o=t.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let i={budget:Un};try{for(let a of o)if(Bn(a,r,i))return Mt.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let i=t.querySelectorAll('style,link[rel~="stylesheet"]'),a={budget:Un};for(let l=0;l<i.length&&a.budget>0;l++){let u=i[l],c=null;if(u.tagName,c=u.sheet||null,c&&Bn(c,r,a))return Mt.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Mt.set(t,{fingerprint:e,result:!0}),!0):(Mt.set(t,{fingerprint:e,result:!1}),!1)}var Et=new WeakMap;function Hn(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,r=t[`border${e}Style`];if(n>0&&r&&r!=="none"&&r!=="hidden")return!0}return!1}var zn=-1;function rs(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,r=0,s;for(;s=n.exec(t);){let i=t.slice(r,s.index).trim();i&&e.push(i),e.push(s[1]),r=n.lastIndex}let o=t.slice(r).trim();return o&&e.push(o),e.join("")}function Pe(t,e){let n=t.parentElement,r=n?Et.get(n):null;return r?{get(s,o){let i=e.get(s,o),a=r.get(o);return typeof a=="number"?Math.max(i,a):i},getStack(s,o){let i=e.getStack(s,o);if(!i.length)return i;let a=r.get(o);if(typeof a=="number"){let l=i.slice();return l[l.length-1]=Math.max(l[l.length-1],a),l}return i}}:e}function Ne(t,e,n){let r=new Map;function s(u){let c=[];if(!u||u==="none")return c;for(let f of String(u).split(",")){let m=f.trim().split(/\s+/),d=m[0],h=Number.isFinite(Number(m[1]))?Number(m[1]):void 0;d&&c.push({name:d,num:h})}return c}let o=s(e?.counterReset),i=s(e?.counterSet),a=s(e?.counterIncrement);function l(u){if(r.has(u))return r.get(u).slice();let c=n.getStack(t,u);c=c.length?c.slice():[];let f=o.find(h=>h.name===u);if(f){let h=Number.isFinite(f.num)?f.num:0;c=c.length?[...c,h]:[h]}let m=i.find(h=>h.name===u);if(m){let h=Number.isFinite(m.num)?m.num:0;c.length===0&&(c=[0]),c[c.length-1]=h}let d=a.find(h=>h.name===u);if(d){let h=Number.isFinite(d.num)?d.num:1;c.length===0&&(c=[0]),c[c.length-1]+=h}return r.set(u,c.slice()),c}return{get(u,c){let f=l(c);return f.length?f[f.length-1]:0},getStack(u,c){return l(c)},__incs:a}}function os(t,e,n){let r;try{r=I(t,e)}catch{}let s=r?.content;if(!s||s==="none"||s==="normal")return{text:"",incs:[]};let o=Pe(t,n),i=Ne(t,r,o),a=_n(s)?On(s,t,i):s;return{text:rs(a),incs:i.__incs||[]}}async function ce(t,e,n,r){if(!(t instanceof Element)||!(e instanceof Element))return;let s=t.ownerDocument||document;if(!ns(s,n))return;let o=C?.session?.__counterEpoch??0;if(zn!==o&&(Et=new WeakMap,n&&(n.__counterCtx=null),zn=o),!n.__counterCtx)try{n.__counterCtx=Wn(t.ownerDocument||document)}catch(l){R(n,"buildCounterContext failed",l)}let i=n.__counterCtx;for(let l of["::before","::after","::first-letter"])try{let u=I(t,l);if(!u||u.content==="none"&&u.backgroundImage==="none"&&u.backgroundColor==="transparent"&&!Hn(u)&&(!u.transform||u.transform==="none")&&u.display==="inline")continue;if(l==="::first-letter"){let $=I(t),P=($?.display||"").toLowerCase();if(P.includes("flex")||P.includes("grid")||!(u.color!==$.color||u.fontSize!==$.fontSize||u.fontWeight!==$.fontWeight||u.fontFamily!==$.fontFamily||u.fontStyle!==$.fontStyle||u.textTransform!==$.textTransform||u.float!==$.float||u.paddingTop!==$.paddingTop||u.paddingRight!==$.paddingRight||u.paddingBottom!==$.paddingBottom||u.paddingLeft!==$.paddingLeft||u.marginTop!==$.marginTop||u.marginRight!==$.marginRight||u.marginBottom!==$.marginBottom||u.marginLeft!==$.marginLeft))continue;let O=Array.from(e.childNodes).find(qt=>qt.nodeType===Node.TEXT_NODE&&qt.textContent?.trim().length>0);if(!O)continue;let K=O.textContent,rt=K.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],Ht=K.slice(rt?.length||0);if(!rt||/[\uD800-\uDFFF]/.test(rt))continue;let pt=document.createElement("span");pt.textContent=rt,pt.dataset.snapdomPseudo="::first-letter";let de=Jt(u),me=St(de,"span");n.styleMap.set(pt,me);let zt=document.createTextNode(Ht);e.replaceChild(zt,O),e.insertBefore(pt,zt);continue}let f=u.content??"",m=f===""||f==="none"||f==="normal",{text:d,incs:h}=os(t,l,i),p=u.backgroundImage,g=u.backgroundColor,b=u.fontFamily,w=parseInt(u.fontSize)||32,x=parseInt(u.fontWeight)||!1,y=u.color||"#000",S=u.transform,k=Z(b),A=!m&&d!=="",v=p&&p!=="none",M=g&&g!=="transparent"&&g!=="rgba(0, 0, 0, 0)",L=Hn(u),_=S&&S!=="none",V=f!=="none"&&f!=="normal"&&((parseFloat(u.width)||0)>0||(parseFloat(u.height)||0)>0);if(!(A||v||M||L||_||V)){if(h&&h.length&&t.parentElement){let $=Et.get(t.parentElement)||new Map;for(let{name:P}of h){if(!P)continue;let W=Pe(t,i),K=Ne(t,I(t,l),W).get(t,P);$.set(P,K)}Et.set(t.parentElement,$)}continue}let T=!1;if(A&&!k&&d.length>1&&!d.startsWith("url(")){let $=I(t),P=parseFloat($.fontSize)||16,W=parseFloat($.lineHeight);Number.isFinite(W)||(W=P*1.5),t.getBoundingClientRect().height<W*1.6&&(e.style.whiteSpace="nowrap",T=!0)}let F=document.createElement("span");F.dataset.snapdomPseudo=l,F.style.pointerEvents="none",T&&(F.style.whiteSpace="nowrap");let z=Jt(u),nt=St(z,"span");if(n.styleMap.set(F,nt),k&&d&&d.length===1){let{dataUrl:$,width:P,height:W}=await Mn(d,b,x,w,y),O=document.createElement("img");O.src=$,O.style=`height:${w}px;width:${P/W*w}px;object-fit:contain;`,F.appendChild(O),e.dataset.snapdomHasIcon="true"}else if(d&&d.startsWith("url(")){let $=ht(d);if($?.trim())try{let P=await U(dt($),{as:"dataURL",useProxy:r.useProxy});if(P?.ok&&typeof P.data=="string"){let W=document.createElement("img");W.src=P.data,W.style=`width:${w}px;height:auto;object-fit:contain;`,F.appendChild(W)}}catch(P){console.error(`[snapdom] Error in pseudo ${l} for`,t,P)}}else!k&&A&&(F.textContent=d);F.style.backgroundImage="none","maskImage"in F.style&&(F.style.maskImage="none"),"webkitMaskImage"in F.style&&(F.style.webkitMaskImage="none");try{F.style.backgroundRepeat=u.backgroundRepeat,F.style.backgroundSize=u.backgroundSize,u.backgroundPositionX&&u.backgroundPositionY?(F.style.backgroundPositionX=u.backgroundPositionX,F.style.backgroundPositionY=u.backgroundPositionY):F.style.backgroundPosition=u.backgroundPosition,F.style.backgroundOrigin=u.backgroundOrigin,F.style.backgroundClip=u.backgroundClip,F.style.backgroundAttachment=u.backgroundAttachment,F.style.backgroundBlendMode=u.backgroundBlendMode}catch{}if(v)try{let $=xt(p),P=await Promise.all($.map(yt));F.style.backgroundImage=P.join(", ")}catch($){console.warn(`[snapdom] Failed to inline background-image for ${l}`,$)}M&&(F.style.backgroundColor=g);let ct=F.childNodes.length>0||F.textContent?.trim()!==""||v||M||L||_||V;if(h&&h.length&&t.parentElement){let $=Et.get(t.parentElement)||new Map,P=Pe(t,i),W=Ne(t,I(t,l),P);for(let{name:O}of h){if(!O)continue;let K=W.get(t,O);$.set(O,K)}Et.set(t.parentElement,$)}if(!ct)continue;l==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(F,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(F))}catch(u){console.warn(`[snapdom] Failed to capture ${l} for`,t,u)}let a=Array.from(e.children).filter(l=>!l.dataset.snapdomPseudo);if(n.nodeMap)for(let l of a){let u=n.nodeMap.get(l);u instanceof Element&&await ce(u,l,n,r)}else{let l=Array.from(t.children);for(let u=0;u<Math.min(l.length,a.length);u++)await ce(l[u],a[u],n,r)}}function Vn(t,e){if(!t||!(t instanceof Element))return;let n=t.ownerDocument||document,r=e||n,s=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(s.length===0)return;let o=/url\(\s*#([^)]+)\)/g,i=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],a=y=>window.CSS&&CSS.escape?CSS.escape(y):y.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),l="http://www.w3.org/1999/xlink",u=y=>{if(!y||!y.getAttribute)return null;let S=y.getAttribute("href")||y.getAttribute("xlink:href")||(typeof y.getAttributeNS=="function"?y.getAttributeNS(l,"href"):null);if(S)return S;let k=y.attributes;if(!k)return null;for(let A=0;A<k.length;A++){let v=k[A];if(!v||!v.name)continue;if(v.name==="href")return v.value;let M=v.name.indexOf(":");if(M!==-1&&v.name.slice(M+1)==="href")return v.value}return null},c=new Set(Array.from(t.querySelectorAll("[id]")).map(y=>y.id)),f=new Set,m=!1,d=(y,S=null)=>{if(!y)return;o.lastIndex=0;let k;for(;k=o.exec(y);){m=!0;let A=(k[1]||"").trim();A&&(c.has(A)||(f.add(A),S&&!S.has(A)&&S.add(A)))}},h=y=>{let S=y.querySelectorAll("use");for(let v of S){let M=u(v);if(!M||!M.startsWith("#"))continue;m=!0;let L=M.slice(1).trim();L&&!c.has(L)&&f.add(L)}let A=y.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let v of A){d(v.getAttribute("style")||"");for(let M of i)d(v.getAttribute(M))}};for(let y of s)h(y);if(!m)return;let p=t.querySelector("svg.inline-defs-container");p||(p=n.createElementNS("http://www.w3.org/2000/svg","svg"),p.classList.add("inline-defs-container"),p.setAttribute("aria-hidden","true"),p.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(p,t.firstChild||null));let g=p.querySelector("defs")||null,b=y=>{if(!y||c.has(y))return null;let S=a(y),k=A=>{let v=r.querySelector(A);return v&&!t.contains(v)?v:null};return k(`svg defs > *#${S}`)||k(`svg > symbol#${S}`)||k(`*#${S}`)};if(!f.size)return;let w=new Set(f),x=new Set;for(;w.size;){let y=w.values().next().value;if(w.delete(y),!y||c.has(y)||x.has(y))continue;let S=b(y);if(!S){x.add(y);continue}g||(g=n.createElementNS("http://www.w3.org/2000/svg","defs"),p.appendChild(g));let k=S.cloneNode(!0);k.id||k.setAttribute("id",y),g.appendChild(k),x.add(y),c.add(y);let A=[k,...k.querySelectorAll("*")];for(let v of A){let M=u(v);if(M&&M.startsWith("#")){let _=M.slice(1).trim();_&&!c.has(_)&&!x.has(_)&&w.add(_)}let L=v.getAttribute?.("style")||"";L&&d(L,w);for(let _ of i){let q=v.getAttribute?.(_);q&&d(q,w)}}}}H();function Xn(t,e){if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let r=t.getBoundingClientRect(),s=t.clientHeight,o="data-snap-ph",i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let a=i.currentNode,l=getComputedStyle(a),u=l.position;if(u!=="sticky"&&u!=="-webkit-sticky")continue;let c=jn(l.top),f=jn(l.bottom);if(c==null&&f==null)continue;let m=ss(a,t),d=is(e,m,o);if(!d)continue;let h=a.getBoundingClientRect(),p=h.width,g=h.height,b=h.left-r.left;if(!(p>0&&g>0)||!Number.isFinite(b))continue;let w=c!=null?c+n:n+(s-g-f);if(!Number.isFinite(w))continue;let x=Number.parseInt(l.zIndex,10),y=Number.isFinite(x),S=y?Math.max(x,1)+1:2,k=y?x-1:0,A=d.cloneNode(!1);A.setAttribute(o,"1"),A.style.position="sticky",A.style.left=`${b}px`,A.style.top=`${w}px`,A.style.width=`${p}px`,A.style.height=`${g}px`,A.style.visibility="hidden",A.style.zIndex=String(k),A.style.overflow="hidden",A.style.background="transparent",A.style.boxShadow="none",A.style.filter="none",d.parentElement?.insertBefore(A,d),d.style.position="absolute",d.style.left=`${b}px`,d.style.top=`${w}px`,d.style.bottom="auto",d.style.zIndex=String(S),d.style.pointerEvents="none"}}function jn(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function ss(t,e){let n=[];for(let r=t;r&&r!==e;){let s=r.parentElement;if(!s)break;n.push(Array.prototype.indexOf.call(s.children,r)),r=s}return n.reverse()}function is(t,e,n){let r=t;for(let s=0;s<e.length;s++)if(r=as(r,n)[e[s]],!r)return null;return r instanceof HTMLElement?r:null}function as(t,e){let n=[],r=t.children;for(let s=0;s<r.length;s++){let o=r[s];o.hasAttribute(e)||n.push(o)}return n}function Gn(t){let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,s=e.borderStyle,o=e.borderWidth,i=n!=="none"&&parseFloat(r)>0,a=s==="none"||parseFloat(o)===0;i&&a&&(t.style.border=`${r} solid transparent`)}function Yn(t){let e=[];try{let n=t.querySelectorAll("*");for(let r of n){if(!(r instanceof HTMLElement))continue;let s=r.style.contentVisibility||"",o=getComputedStyle(r),i=o.contentVisibility||o.getPropertyValue("content-visibility")||"";(i==="auto"||i==="hidden")&&(e.push({el:r,original:s}),r.style.contentVisibility="visible")}if(t instanceof HTMLElement){let r=getComputedStyle(t),s=r.contentVisibility||r.getPropertyValue("content-visibility")||"";(s==="auto"||s==="hidden")&&(e.push({el:t,original:t.style.contentVisibility||""}),t.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:n,original:r}of e)try{n.style.contentVisibility=r}catch{}}}async function Kn(t,e={}){let n={styleMap:C.session.styleMap,styleCache:C.session.styleCache,nodeMap:C.session.nodeMap,options:e},r,s="",o="";Gn(t);let i=Yn(t);try{r=await Ot(t,n,e)}catch(c){throw console.warn("deepClone failed:",c),c}finally{i()}try{Vn(r)}catch(c){console.warn("inlineExternal defs or symbol failed:",c)}try{await ce(t,r,n,e)}catch(c){console.warn("inlinePseudoElements failed:",c)}await Sn(r,n);try{let c=r.querySelectorAll("style[data-sd]");for(let f of c)o+=f.textContent||"",f.remove()}catch(c){R(n,"Failed to extract shadow CSS from style[data-sd]",c)}let a=Ae(n.styleMap);s=Array.from(a.entries()).map(([c,f])=>`.${f}{${c}}`).join(""),s=o+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+s;for(let[c,f]of n.styleMap.entries()){if(c.tagName==="STYLE")continue;if(c.getRootNode&&c.getRootNode()instanceof ShadowRoot){c.setAttribute("style",f.replace(/;/g,"; "));continue}let m=a.get(f);m&&c.classList.add(m);let d=c.style?.backgroundImage,h=c.dataset?.snapdomHasIcon;d&&d!=="none"&&(c.style.backgroundImage=d),h&&(c.style.verticalAlign="middle",c.style.display="inline")}for(let[c,f]of n.nodeMap.entries()){let m=f.scrollLeft,d=f.scrollTop;if((m||d)&&c instanceof HTMLElement){c.style.overflow="hidden",c.style.scrollbarWidth="none",c.style.msOverflowStyle="none";try{let g=c.querySelectorAll("*");for(let b of g){if(!(b instanceof HTMLElement))continue;let w=b.style.position;if(w==="fixed"||w==="absolute"){let x=parseFloat(b.style.top)||0,y=parseFloat(b.style.left)||0;b.style.top=`${x+d}px`,b.style.left=`${y+m}px`,w==="fixed"&&(b.style.position="absolute")}}}catch{}let p=document.createElement("div");for(p.style.all="unset",p.style.transform=`translate(${-m}px, ${-d}px)`,p.style.willChange="transform",p.style.display="inline-block",p.style.width="100%";c.firstChild;)p.appendChild(c.firstChild);c.appendChild(p)}}let u=r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r;if(Xn(t,u),t===n.nodeMap.get(r)){let c=n.styleCache.get(t)||I(t);n.styleCache.set(t,c);let f=ge(c.transform);r.style.margin="0",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.animation="none",r.style.transition="none",r.style.willChange="auto",r.style.float="none",r.style.clear="none",r.style.transform=f||""}for(let[c,f]of n.nodeMap.entries())f.tagName==="PRE"&&(c.style.marginTop="0",c.style.marginBlockStart="0");return{clone:r,classCSS:s,styleCache:n.styleCache}}gt();H();var Qn="http://www.w3.org/1999/xlink";function cs(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(Qn,"href"):null)}function ls(t){let e=parseInt(t.dataset?.snapdomWidth||"",10)||0,n=parseInt(t.dataset?.snapdomHeight||"",10)||0,r=parseInt(t.getAttribute("width")||"",10)||0,s=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,i=parseFloat(t.style?.height||"")||0,a=e||o||r||t.width||t.naturalWidth||100,l=n||i||s||t.height||t.naturalHeight||100;return{width:a,height:l}}async function Jn(t,e={}){let n=Array.from(t.querySelectorAll("img")),r=async a=>{if(!a.getAttribute("src")){let h=a.currentSrc||a.src||"";h&&a.setAttribute("src",h)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let l=a.src||"";if(!l)return;let u=C.image?.get(l);if(u){a.src=u,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let c=await U(l,{as:"dataURL",useProxy:e.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){C.image?.set(l,c.data),a.src=c.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:f,height:m}=ls(a),{fallbackURL:d}=e||{};if(d)try{let h=typeof d=="function"?await d({width:f,height:m,src:l,element:a}):d;if(h){let p=await U(h,{as:"dataURL",useProxy:e.useProxy});if(p?.ok&&typeof p.data=="string"){a.src=p.data,a.width||(a.width=f),a.height||(a.height=m);return}}}catch{}if(e.placeholders!==!1){let h=document.createElement("div");h.style.cssText=[`width:${f}px`,`height:${m}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${m}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),h.textContent="img",a.replaceWith(h)}else{let h=document.createElement("div");h.style.cssText=`display:inline-block;width:${f}px;height:${m}px;visibility:hidden;`,a.replaceWith(h)}},s=6;for(let a=0;a<n.length;a+=s){let l=n.slice(a,a+s).map(r);await Promise.allSettled(l)}let o=Array.from(t.querySelectorAll("image")),i=async a=>{let l=cs(a);if(!l||l.startsWith("data:")||l.startsWith("blob:"))return;let u=await U(l,{as:"dataURL",useProxy:e.useProxy});u.ok&&typeof u.data=="string"&&u.data.startsWith("data:")&&(a.setAttribute("href",u.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(Qn,"href"))};for(let a=0;a<o.length;a+=s){let l=o.slice(a,a+s).map(i);await Promise.allSettled(l)}}J();H();async function le(t,e,n,r={}){let s=[[t,e]],o=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],i=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],a=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],l=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;s.length;){let[u,c]=s.shift();if(!c)continue;let f=n.get(u)||I(u);n.has(u)||n.set(u,f);let m=(()=>{let g=f.getPropertyValue("border-image"),b=f.getPropertyValue("border-image-source");return g&&g!=="none"||b&&b!=="none"})(),d=f.getPropertyValue("background-image"),h=f.getPropertyValue("background-color");if(d&&d!=="none"||h&&h!=="rgba(0, 0, 0, 0)"&&h!=="transparent"||/url\s*\(|gradient\s*\(/i.test(f.getPropertyValue("background")||""))for(let g of a){let b=f.getPropertyValue(g);b&&c.style.setProperty(g,b)}for(let g of o){let b=f.getPropertyValue(g);if(g==="background-image"&&(!b||b==="none")){let y=f.getPropertyValue("background");y&&/url\s*\(/.test(y)&&(b=xt(y).filter(S=>/url\s*\(/.test(S)).join(", ")||b)}if(!b||b==="none")continue;let w=xt(b),x=await Promise.all(w.map(y=>yt(y,r)));x.some(y=>y&&y!=="none"&&!/^url\(undefined/.test(y))&&c.style.setProperty(g,x.join(", "))}for(let g of i){let b=f.getPropertyValue(g);!b||b==="initial"||c.style.setProperty(g,b)}if(m)for(let g of l){let b=f.getPropertyValue(g);!b||b==="initial"||c.style.setProperty(g,b)}if(u.shadowRoot){let g=Array.from(u.shadowRoot.children).filter(w=>w.tagName!=="STYLE"),b=Array.from(c.children).filter(w=>!w.dataset?.snapdomPseudo&&!(w.tagName==="STYLE"&&w.dataset?.sd));for(let w=0;w<Math.min(g.length,b.length);w++)s.push([g[w],b[w]])}else{let g=C.session.nodeMap;for(let b of c.children){let w=g.get(b);w&&s.push([w,b])}}}}J();H();function Zn(t){if(!t)return()=>{};let e=[];function n(r){let s=us(r);s&&e.push(s);for(let o of r.children||[])n(o)}return n(t),()=>e.forEach(r=>r())}function us(t){if(!t)return()=>{};let e=fs(t);if(e<=0)return()=>{};if(!ps(t))return()=>{};let n=getComputedStyle(t),r=Math.round(ds(n)*e+ms(n)),s=t.textContent??"",o=s;if(t.scrollHeight<=r+.5)return()=>{};let i=0,a=s.length,l=-1;for(;i<=a;){let u=i+a>>1;t.textContent=s.slice(0,u)+"\u2026",t.scrollHeight<=r+.5?(l=u,i=u+1):a=u-1}return t.textContent=(l>=0?s.slice(0,l):"")+"\u2026",()=>{t.textContent=o}}function fs(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function ds(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 ms(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function ps(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var Ut=[];function ue(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 tr(...t){let e=t.flat();for(let n of e){let r=ue(n);r&&(Ut.some(s=>s&&s.name&&r.name&&s.name===r.name)||Ut.push(r))}}function er(t){return t&&Array.isArray(t.plugins)?t.plugins:Ut}async function et(t,e,n){let r=n,s=er(e);for(let o of s){let i=o&&typeof o[t]=="function"?o[t]:null;if(!i)continue;let a=await i(e,r);typeof a<"u"&&(r=a)}return r}async function nr(t,e,n){let r=[],s=er(e);for(let o of s){let i=o&&typeof o[t]=="function"?o[t]:null;if(!i)continue;let a=await i(e,n);typeof a<"u"&&r.push(a)}return r}function hs(t){let e=[];if(Array.isArray(t))for(let n of t){let r=ue(n);if(!r||!r.name)continue;let s=e.findIndex(o=>o&&o.name===r.name);s>=0&&e.splice(s,1),e.push(r)}for(let n of Ut)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function rr(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=hs(e)),t}function or(){return Ut.slice()}function bt(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(t)&&t.length<200)}function gs(t,e){return!t||!(t instanceof Element)?!1:t.querySelector("picture")?!0:e?!!t.querySelector("img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]"):!1}function ys(t,e){let n=t.currentSrc||"";if(n&&!bt(n))return n;let r=e.querySelectorAll("source[srcset]"),s=null;for(let o of r){let i=o.getAttribute("srcset");if(!i||bt(i))continue;let a=o.getAttribute("media");if(a)try{if(window.matchMedia(a).matches)return i.split(",")[0].trim().split(/\s+/)[0]}catch{}s||(s=i.split(",")[0].trim().split(/\s+/)[0])}return s}function bs(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let r of e)if(r&&!bt(r))return r;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let r=n.split(",")[0].trim().split(/\s+/)[0];if(r&&!bt(r))return r}return null}function ws(t={}){let e=t.pictureResolver&&typeof t.pictureResolver=="object"?t.pictureResolver:{};return{timeout:e.timeout??5e3,concurrency:e.concurrency??4,resolveLazySrc:e.resolveLazySrc!==!1,silent:e.silent??!1,useProxy:typeof t.useProxy=="string"?t.useProxy:""}}async function sr(t,e={}){if(!t||!(t instanceof Element)||e.resolvePicturePlaceholders===!1)return null;let{timeout:n,concurrency:r,resolveLazySrc:s,silent:o,useProxy:i}=ws(e);if(!gs(t,s))return null;let a=[],l=[];async function u(m){let d=new AbortController,h=setTimeout(()=>d.abort(),n);try{let p=await fetch(m,{credentials:"include",signal:d.signal});if(!p.ok&&i){let b=i.includes("{url}")?i.replace("{url}",encodeURIComponent(m)):i.endsWith("?")?`${i}${encodeURIComponent(m)}`:`${i}${i.includes("?")?"&":"?"}url=${encodeURIComponent(m)}`;p=await fetch(b,{signal:d.signal})}if(!p.ok)return null;let g=await p.blob();return await new Promise((b,w)=>{let x=new FileReader;x.onload=()=>b(x.result),x.onerror=w,x.readAsDataURL(g)})}catch{return null}finally{clearTimeout(h)}}async function c(m){for(let d=0;d<m.length;d+=r){let h=m.slice(d,d+r);await Promise.allSettled(h.map(p=>p()))}}let f=t.querySelectorAll("picture");for(let m of f){let d=m.querySelector("img");if(!d)continue;let h=d.getAttribute("src")||"";if(!bt(h))continue;let p=ys(d,m);p&&l.push(async()=>{let g=await u(p);if(!g){o||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${p.slice(0,60)}`);return}let b=d.getAttribute("src"),w=d.getAttribute("srcset"),x=d.getAttribute("sizes"),y=[];d.src=g,d.setAttribute("src",g),d.removeAttribute("srcset"),d.removeAttribute("sizes");let S=m.querySelectorAll("source");for(let k of S)y.push({el:k,parent:k.parentElement,next:k.nextSibling}),k.remove();a.push(()=>{b!==null?d.setAttribute("src",b):d.removeAttribute("src"),w!==null&&d.setAttribute("srcset",w),x!==null&&d.setAttribute("sizes",x);for(let{el:k,parent:A,next:v}of y)A&&A.insertBefore(k,v)})})}if(s){let m=t.querySelectorAll("img");for(let d of m){if(d.closest("picture")&&bt(d.getAttribute("src")||""))continue;let h=d.getAttribute("src")||"",p=bs(d);p&&bt(h)&&l.push(async()=>{let g=await u(p);if(!g)return;let b=d.getAttribute("src");d.src=g,d.setAttribute("src",g),d.removeAttribute("srcset"),d.removeAttribute("sizes"),a.push(()=>{b!==null?d.setAttribute("src",b):d.removeAttribute("src")})})}}return l.length===0?null:(await c(l),async function(){for(let d of a)try{d()}catch{}})}H();var Ss=.92,xs=.95;async function Cs(t){let e=new Image;if(e.decoding="sync",e.src=t,typeof e.decode=="function")try{return await e.decode(),e}catch{}return await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=r}),e}function As(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}async function Ie(t,e,n){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;let r;try{r=await Cs(t)}catch{return null}let s=r.naturalWidth||r.width,o=r.naturalHeight||r.height;if(!s||!o)return null;let i=Math.min(1,Math.max(e/s,n/o));if(!(i>0)||i>=.95)return null;let a=i*xs,l=Math.max(1,Math.round(s*a)),u=Math.max(1,Math.round(o*a)),c=document.createElement("canvas");c.width=l,c.height=u;let f=c.getContext("2d");if(!f)return null;f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high",f.drawImage(r,0,0,l,u);let m=As(t),d=m==="image/jpeg"?"image/jpeg":m==="image/webp"?"image/webp":"image/png";try{let h=c.toDataURL(d,Ss);if(typeof h=="string"&&h.startsWith("data:image")&&h.length<t.length)return h}catch{}return null}async function ks(t,e){if(!e.compress)return{count:0,before:0,after:0};let n=(e.scale||1)*(e.dpr||1),r=Array.from(t.querySelectorAll("img")),s=0,o=0,i=0,a=async u=>{let c=u.getAttribute("src")||"";if(!c.startsWith("data:image")||c.startsWith("data:image/svg"))return;let f=parseFloat(u.dataset.snapdomWidth)||parseFloat(u.style.width)||u.width||0,m=parseFloat(u.dataset.snapdomHeight)||parseFloat(u.style.height)||u.height||0;if(!f||!m)return;let d=await Ie(c,f*n,m*n);d&&(s++,o+=c.length,i+=d.length,u.setAttribute("src",d))},l=6;for(let u=0;u<r.length;u+=l)await Promise.allSettled(r.slice(u,u+l).map(a));return{count:s,before:o,after:i}}function vs(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function Ms(t,e){if(!e.compress)return{count:0};let n=(e.scale||1)*(e.dpr||1),r=C.session.nodeMap,s=[],o=[t,...t.querySelectorAll("*")];for(let u of o){let c=u.style&&u.style.backgroundImage;c&&c.includes("data:image")&&s.push(u)}let i=0,a=async u=>{let c=r.get(u);if(!c||!c.isConnected)return;let f;try{f=getComputedStyle(c)}catch{return}if((f.backgroundRepeat||"repeat").toLowerCase().split(",").some(y=>y.trim()!=="no-repeat"))return;let{w:d,h}=vs(c);if(!d||!h)return;let p=d*n,g=h*n,b=u.style.backgroundImage,w=[...b.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],x=b;for(let y of w){let S=y[2];if(S.startsWith("data:image/svg"))continue;let k=await Ie(S,p,g);k&&(x=x.split(S).join(k),i++)}x!==b&&(u.style.backgroundImage=x)},l=6;for(let u=0;u<s.length;u+=l)await Promise.allSettled(s.slice(u,u+l).map(a));return{count:i}}async function Es(t,e){if(!e.compress)return{count:0};let n=(e.scale||1)*(e.dpr||1),r=Array.from(t.querySelectorAll("image")),s=0,o=async a=>{let l=a.getAttribute("href")||(typeof a.getAttributeNS=="function"?a.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!l||!l.startsWith("data:image")||l.startsWith("data:image/svg"))return;let u=parseFloat(a.getAttribute("width"))||0,c=parseFloat(a.getAttribute("height"))||0;if(!u||!c)return;let f=await Ie(l,u*n,c*n);f&&(a.setAttribute("href",f),a.hasAttribute("xlink:href")&&a.setAttribute("xlink:href",f),s++)},i=6;for(let a=0;a<r.length;a+=i)await Promise.allSettled(r.slice(a,a+i).map(o));return{count:s}}async function ir(t,e){e.compress&&(await ks(t,e),await Ms(t,e),await Es(t,e))}J();function lr(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(i){R(n,"stripRootShadows boxShadow",i)}try{e.style.textShadow="none"}catch(i){R(n,"stripRootShadows textShadow",i)}try{e.style.outline="none"}catch(i){R(n,"stripRootShadows outline",i)}let o=(r.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch(i){R(n,"stripRootShadows filter",i)}}function ar(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",r=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||r!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function Fs(t,e){let n=Array.from(t.childNodes),r=e==="top"?n:n.reverse();for(let s of r){if(s.nodeType===Node.TEXT_NODE){if(/\S/.test(s.textContent||""))return null;continue}if(s.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(s),i=String(o.display||"");if(!(i==="none"||i==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||i.startsWith("inline")?null:s}return null}function ur(t,e){if(!t||!e||!e.style)return;let n=getComputedStyle(t);if(!ar(n))for(let r of["top","bottom"]){let s=r==="top"?"Top":"Bottom";if((parseFloat(n[`border${s}Width`])||0)>0||(parseFloat(n[`padding${s}`])||0)>0)continue;let o=t,i=e;for(;o&&i;){let a=Fs(o,r);if(!a)break;let l=Array.from(o.children).indexOf(a),u=l>=0?i.children[l]:null,c=getComputedStyle(a),f=parseFloat(c[`margin${s}`])||0;if(u&&u.style&&f>0&&(u.style[`margin${s}`]="0px"),ar(c)||(parseFloat(c[`border${s}Width`])||0)>0||(parseFloat(c[`padding${s}`])||0)>0)break;o=a,i=u}}}function $s(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),n=[];for(;e.nextNode();)n.push(e.currentNode);for(let r of n)r.remove()}function Rs(t,e={}){let{stripFrameworkDirectives:n=!0}=e,r=new Set(["xml","xlink"]),s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;s.nextNode();){let o=s.currentNode;for(let i of Array.from(o.attributes)){let a=i.name;if(a.includes("@")){o.removeAttribute(a);continue}if(a.includes(":")){let l=a.split(":",1)[0];if(!r.has(l)){o.removeAttribute(a);continue}}if(n&&(a.startsWith("x-")||a.startsWith("v-")||a.startsWith(":")||a.startsWith("on:")||a.startsWith("bind:")||a.startsWith("let:")||a.startsWith("class:"))){o.removeAttribute(a);continue}}}}var cr=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function Ts(t){if(!t)return;let e=s=>{if(s.nodeType===Node.ELEMENT_NODE){if(s.attributes)for(let o of Array.from(s.attributes)){let i=o.value.replace(cr,"");if(i!==o.value)try{s.setAttribute(o.name,i)}catch{}}}else if(s.nodeType===Node.TEXT_NODE||s.nodeType===Node.CDATA_SECTION_NODE){let o=s.data.replace(cr,"");o!==s.data&&(s.data=o)}};e(t);let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),r;for(;r=n.nextNode();)e(r)}function fr(t,e={}){t&&(Rs(t,e),$s(t),Ts(t))}function Ls(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function Ps(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Ns(t,e){if(!(t instanceof Element)||Ls(t)||Ps(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function dr(t,e,n=new Map){function r(s,o){if(!(s instanceof Element)||!(o instanceof Element))return;let i=s.childElementCount>o.childElementCount,a=n.get(s)||getComputedStyle(s);if(n.has(s)||n.set(s,a),i&&Ns(s,a)){o.style.height||(o.style.height="auto"),o.style.width||(o.style.width="auto"),o.style.removeProperty("block-size"),o.style.removeProperty("inline-size"),o.style.minHeight||(o.style.minHeight="0"),o.style.minWidth||(o.style.minWidth="0"),o.style.maxHeight||(o.style.maxHeight="none"),o.style.maxWidth||(o.style.maxWidth="none");let c=a.overflowY||a.overflowBlock||"visible",f=a.overflowX||a.overflowInline||"visible";(c!=="visible"||f!=="visible")&&(o.style.overflow="visible")}let l=Array.from(s.children),u=Array.from(o.children);for(let c=0;c<Math.min(l.length,u.length);c++)r(l[c],u[c])}r(t,e)}function Is(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function _s(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(r){R(e,"exclude selector match failed",r)}return!1}function mr(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),s=1/0,o=-1/0,i=!1,a=Array.from(t.children);for(let d of a){if(_s(d,e)||!Is(d))continue;let h=d.getBoundingClientRect(),p=h.top-r.top,g=h.bottom-r.top;g<=p||(p<s&&(s=p),g>o&&(o=g),i=!0)}let l=i?Math.max(0,o-s):0,u=parseFloat(n.borderTopWidth)||0,c=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,m=parseFloat(n.paddingBottom)||0;return u+c+f+m+l}var E=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,Ws=/::-webkit-scrollbar(-[a-z]+)?\b/i;function _e(t,e=new Set){let n="";if(!t)return n;for(let r=0;r<t.length;r++){let s=t[r];try{if(s.type===CSSRule.IMPORT_RULE&&s.styleSheet){n+=_e(s.styleSheet.cssRules,e);continue}if(s.type===CSSRule.MEDIA_RULE&&s.cssRules){let o=_e(s.cssRules,e);o&&(n+=`@media ${s.conditionText}{${o}}`);continue}if(s.type===CSSRule.STYLE_RULE){let o=s.selectorText||"";if(Ws.test(o)){let i=s.cssText;i&&!e.has(i)&&(e.add(i),n+=i)}}}catch{}}return n}function pr(t){if(!t||!t.styleSheets)return"";let e=new Set,n="";for(let r of Array.from(t.styleSheets))try{let s=r.cssRules;s&&(n+=_e(s,e))}catch{}return n}Zt();function hr(t){let e=t.boxShadow||"";if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let n=[],r="",s=0;for(let u=0;u<e.length;u++){let c=e[u];c==="("?s++:c===")"&&(s=Math.max(0,s-1)),c===","&&s===0?(n.push(r),r=""):r+=c}r.trim()&&n.push(r);let o=0,i=0,a=0,l=0;for(let u of n){if(/\binset\b/i.test(u))continue;let c=u.match(/-?\d+(\.\d+)?px/g)?.map(b=>parseFloat(b))||[];if(c.length<2)continue;let[f,m,d=0,h=0]=c,p=Math.abs(f)+d+h,g=Math.abs(m)+d+h;i=Math.max(i,p+Math.max(f,0)),l=Math.max(l,p+Math.max(-f,0)),a=Math.max(a,g+Math.max(m,0)),o=Math.max(o,g+Math.max(-m,0))}return{top:Math.ceil(o),right:Math.ceil(i),bottom:Math.ceil(a),left:Math.ceil(l)}}function gr(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,s;for(;s=n.exec(e);)r+=parseFloat(s[1])||0;let o=Math.ceil(r);return{top:o,right:o,bottom:o,left:o}}function yr(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function br(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)||[],r=0,s=0,o=0,i=0,a=!1;for(let l of n){a=!0;let u=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[c=0,f=0,m=0]=u,d=Math.abs(c)+m,h=Math.abs(f)+m;s=Math.max(s,d+Math.max(c,0)),i=Math.max(i,d+Math.max(-c,0)),o=Math.max(o,h+Math.max(f,0)),r=Math.max(r,h+Math.max(-f,0))}return{bleed:{top:E(r),right:E(s),bottom:E(o),left:E(i)},has:a}}function wr(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 r=n.transform||"none";if(!r||r==="none"){let a=null;try{a=Ue(t).scale}catch{}try{e.style.transform="none"}catch{}if(!a)return{a:1,b:0,c:0,d:1};let l=a.trim().split(/\s+/).map(parseFloat),u=Number.isFinite(l[0])?l[0]:1,c=Number.isFinite(l[1])?l[1]:u;return{a:u,b:0,c:0,d:c}}function s(a,l,u,c){let f=Math.sqrt(a*a+l*l)||0,m=0,d=0;if(f>0){let h=a/f,p=l/f;m=h*u+p*c;let g=u-h*m,b=c-p*m;d=Math.sqrt(g*g+b*b)||0,d>0?m=m/d:m=0}return{a:f,b:0,c:m*d,d}}let o=r.match(/^matrix\(\s*([^)]+)\)$/i);if(o){let a=o[1].split(",").map(l=>parseFloat(l.trim()));if(a.length===6&&a.every(Number.isFinite)){let[l,u,c,f]=a,m=s(l,u,c,f);try{e.style.transform=`matrix(${m.a}, ${m.b}, ${m.c}, ${m.d}, 0, 0)`}catch{}return m}}let i=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(i){let a=i[1].split(",").map(l=>parseFloat(l.trim()));if(a.length===16&&a.every(Number.isFinite)){let l=a[0],u=a[1],c=a[4],f=a[5],m=s(l,u,c,f);try{e.style.transform=`matrix(${m.a}, ${m.b}, ${m.c}, ${m.d}, 0, 0)`}catch{}return m}}try{let a=new DOMMatrix(r),l=s(a.a,a.b,a.c,a.d);try{e.style.transform=`matrix(${l.a}, ${l.b}, ${l.c}, ${l.d}, 0, 0)`}catch{}return l}catch{return null}}function Oe(t,e,n,r,s){let o=n.a,i=n.b,a=n.c,l=n.d,u=n.e||0,c=n.f||0;function f(b,w){let x=b-r,y=w-s,S=o*x+a*y,k=i*x+l*y;return S+=r+u,k+=s+c,[S,k]}let m=[f(0,0),f(t,0),f(0,e),f(t,e)],d=1/0,h=1/0,p=-1/0,g=-1/0;for(let[b,w]of m)b<d&&(d=b),w<h&&(h=w),b>p&&(p=b),w>g&&(g=w);return{minX:d,minY:h,maxX:p,maxY:g,width:p-d,height:g-h}}function Sr(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[s,o]=[r[0]||"0",r[1]||"0"],i=(a,l)=>{let u=a.toLowerCase();return u==="left"||u==="top"?0:u==="center"?l/2:u==="right"||u==="bottom"?l:u.endsWith("px")?parseFloat(u)||0:u.endsWith("%")?(parseFloat(u)||0)*l/100:/^-?\d+(\.\d+)?$/.test(u)&&parseFloat(u)||0};return{ox:i(s,e),oy:i(o,n)}}function Ue(t){let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let s=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},o=s("rotate");if(o)if(o.angle){let l=o.angle;e.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.unit}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let l=getComputedStyle(t);e.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let i=s("scale");if(i){let l="x"in i&&i.x?.value!=null?i.x.value:Array.isArray(i)?i[0]?.value:Number(i)||1,u="y"in i&&i.y?.value!=null?i.y.value:Array.isArray(i)?i[1]?.value:l;e.scale=`${l} ${u}`}else{let l=getComputedStyle(t);e.scale=l.scale&&l.scale!=="none"?l.scale:null}let a=s("translate");if(a){let l="x"in a&&"value"in a.x?a.x.value:Array.isArray(a)?a[0]?.value:0,u="y"in a&&"value"in a.y?a.y.value:Array.isArray(a)?a[1]?.value:0,c="x"in a&&a.x?.unit?a.x.unit:"px",f="y"in a&&a.y?.unit?a.y.unit:"px";e.translate=`${l}${c} ${u}${f}`}else{let l=getComputedStyle(t);e.translate=l.translate&&l.translate!=="none"?l.translate:null}return e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}var We=null;function Os(){if(We)return We;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),We=t,t}function xr(t){let e=Os(),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 r=Us(n);return e.removeChild(n),r}function Cr(t){let e=I(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",o=e.scale&&e.scale!=="none"&&e.scale!=="1",i=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(s||o||i)}function Us(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}function Bs(t){if(Array.isArray(t.plugins)){for(let e of t.plugins)if(ue(e)?.name==="picture-resolver")return!0}return or().some(e=>e?.name==="picture-resolver")}async function Be(t,e){if(!t)throw new Error("Element cannot be null or undefined");Xt(e.cache);let n=e.fast,r=e.outerTransforms!==!1,s=!!e.outerShadows,o={element:t,options:e,plugins:e.plugins},i,a,l,u="",c="",f,m,d=null;await et("beforeSnap",o);let h=null;e.resolvePicturePlaceholders!==!1&&!Bs(e)&&(h=await sr(o.element,o.options)),await et("beforeClone",o);let p=Zn(o.element);try{({clone:i,classCSS:a,styleCache:l}=await Kn(o.element,o.options)),!r&&i&&(d=wr(o.element,i)),!s&&i&&lr(o.element,i,o.options),i&&ur(o.element,i)}finally{p()}if(o={clone:i,classCSS:a,styleCache:l,...o},await et("afterClone",o),h&&await h(),fr(o.clone),o.options?.excludeMode==="remove")try{dr(o.element,o.clone,o.styleCache)}catch(y){console.warn("[snapdom] shrink pass failed:",y)}try{await An(o.clone,o.element)}catch{}await new Promise(y=>{tt(async()=>{await Jn(o.clone,o.options),y()},{fast:n})}),await new Promise(y=>{tt(async()=>{await le(o.element,o.clone,o.styleCache,o.options),y()},{fast:n})}),e.compress&&await new Promise(y=>{tt(async()=>{await ir(o.clone,o.options),y()},{fast:n})}),e.embedFonts&&await new Promise(y=>{tt(async()=>{let S=o.element.ownerDocument||document,k=kt(o.element),A=ae(o.element);if(D()){let v=new Set(Array.from(k).map(M=>String(M).split("__")[0]).filter(Boolean));await vt(v,1,S)}u=await ie({required:k,usedCodepoints:A,preCached:!1,exclude:o.options.excludeFonts,localFonts:o.options.localFonts,useProxy:o.options.useProxy,fontStylesheetDomains:o.options.fontStylesheetDomains,doc:S}),y()},{fast:n})});let g=xe(o.clone).sort(),b=g.join(",");C.baseStyle.has(b)?c=C.baseStyle.get(b):await new Promise(y=>{tt(()=>{c=Ce(g),C.baseStyle.set(b,c),y()},{fast:n})});let w=pr(o.element?.ownerDocument||document);o={fontsCSS:u,baseCSS:c,scrollbarCSS:w,...o},await et("beforeRender",o),await new Promise(y=>{tt(()=>{let S=I(o.element),k=o.element.getBoundingClientRect(),A=Math.max(1,E(o.element.offsetWidth||parseFloat(S.width)||k.width||1)),v=Math.max(1,E(o.element.offsetHeight||parseFloat(S.height)||k.height||1)),M=o.element.ownerDocument||document;if(o.element===M.body||o.element===M.documentElement){let X=Math.max(o.element.scrollHeight||0,M.documentElement?.scrollHeight||0,M.body?.scrollHeight||0),Y=Math.max(o.element.scrollWidth||0,M.documentElement?.scrollWidth||0,M.body?.scrollWidth||0);X>0&&(v=Math.max(v,E(X))),Y>0&&(A=Math.max(A,E(Y)));try{let ot=(o.scrollbarCSS||"").length+(o.baseCSS||"").length+(o.fontsCSS||"").length+(o.classCSS||"").length,Q=C.measureHints.get(o.element);if(Q&&Q.cssLen===ot&&Q.w0===A)Q.csh>0&&(v=Math.max(v,E(Q.csh))),Q.csw>0&&(A=Math.max(A,E(Q.csw)));else{let st=M.createElement("div");st.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+A+"px!important;overflow:visible!important;visibility:hidden!important;";let jt=M.createElement("style");jt.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,st.appendChild(jt),st.appendChild(o.clone.cloneNode(!0)),M.body.appendChild(st);let Rt=st.scrollHeight,ft=st.scrollWidth;M.body.removeChild(st),C.measureHints.set(o.element,{cssLen:ot,w0:A,csh:Rt,csw:ft}),Rt>0&&(v=Math.max(v,E(Rt))),ft>0&&(A=Math.max(A,E(ft)))}}catch{}}if(o.options?.excludeMode==="remove"){let X=mr(o.element,o.options);Number.isFinite(X)&&X>0&&(v=Math.max(1,Math.min(v,E(X+1))))}let _=(X,Y=NaN)=>{let ot=typeof X=="string"?parseFloat(X):X;return Number.isFinite(ot)?ot:Y},q=_(o.options.width),V=_(o.options.height),j=A,T=v,F=Number.isFinite(q),z=Number.isFinite(V),nt=v>0?A/v:1;F&&z?(j=Math.max(1,E(q)),T=Math.max(1,E(V))):F?(j=Math.max(1,E(q)),T=Math.max(1,E(j/(nt||1)))):z?(T=Math.max(1,E(V)),j=Math.max(1,E(T*(nt||1)))):(j=A,T=v);let mt=0,ct=0,$=A,P=v;if(!r&&d&&Number.isFinite(d.a)){let X={a:d.a,b:d.b||0,c:d.c||0,d:d.d||1,e:0,f:0},Y=Oe(A,v,X,0,0);mt=E(Y.minX),ct=E(Y.minY),$=E(Y.maxX),P=E(Y.maxY)}else if(r&&Ar(o.element)){let Y=S.transform&&S.transform!=="none"?S.transform:"",ot=Ue(o.element),Q=xr({baseTransform:Y,rotate:ot.rotate||"0deg",scale:ot.scale,translate:ot.translate}),{ox:st,oy:jt}=Sr(S,A,v),Rt=Q.is2D?Q:new DOMMatrix(Q.toString()),ft=Oe(A,v,Rt,st,jt);mt=E(ft.minX),ct=E(ft.minY),$=E(ft.maxX),P=E(ft.maxY)}let W=hr(S),O=gr(S),K=yr(S),$t=br(S),rt=s?{top:E(W.top+O.top+K.top+$t.bleed.top),right:E(W.right+O.right+K.right+$t.bleed.right),bottom:E(W.bottom+O.bottom+K.bottom+$t.bleed.bottom),left:E(W.left+O.left+K.left+$t.bleed.left)}:{top:0,right:0,bottom:0,left:0};mt=E(mt-rt.left),ct=E(ct-rt.top),$=E($+rt.right),P=E(P+rt.bottom);let Ht=Math.max(1,E($-mt)),pt=Math.max(1,E(P-ct)),de=F||z?E(j/A):1,me=z||F?E(T/v):1,zt=Math.max(1,E(Ht*de)),qt=Math.max(1,E(pt*me)),je="http://www.w3.org/2000/svg",Or=D()&&Ar(o.element)?1:0,lt=E(Or+(r?0:1)),ut=document.createElementNS(je,"foreignObject"),Ur=E(mt),Br=E(ct);ut.setAttribute("x",String(E(-(Ur-lt)))),ut.setAttribute("y",String(E(-(Br-lt)))),ut.setAttribute("width",String(E(A+lt*2))),ut.setAttribute("height",String(E(v+lt*2))),ut.style.overflow="visible";let Xe=document.createElement("style"),Dr="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";Xe.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+Dr+o.classCSS,ut.appendChild(Xe);let Vt=document.createElement("div");Vt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Vt.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${E(A)}px;height:${E(v)}px`,Vt.appendChild(o.clone),ut.appendChild(Vt);let Hr=new XMLSerializer().serializeToString(ut),pe=E(Ht+lt*2),he=E(pt+lt*2),Ge=F||z;e.meta={w0:A,h0:v,vbW:pe,vbH:he,targetW:j,targetH:T};let zr=D()&&Ge?pe:E(zt+lt*2),qr=D()&&Ge?he:E(qt+lt*2),Vr=parseFloat(I(M.documentElement)?.fontSize)||16;m=`<svg xmlns="${je}" width="${zr}" height="${qr}" viewBox="0 0 ${pe} ${he}" font-size="${Vr}px">`+Hr+"</svg>",f=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,o={svgString:m,dataURL:f,...o},y()},{fast:n})}),await et("afterRender",o);let x=document.getElementById("snapdom-sandbox");return x&&x.style.position==="absolute"&&x.remove(),o.dataURL}function Ar(t){return Cr(t)}H();function kr(t={}){let e=t.format??"png";e==="jpg"&&(e="jpeg");let n=Ye(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,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],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,compress:t.compress!==!1,safariWarmupAttempts:Math.min(3,Math.max(1,(t.safariWarmupAttempts??3)|0)),excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1,pictureResolver:t.pictureResolver&&typeof t.pictureResolver=="object"?t.pictureResolver:{}}}Ct();ve();J();gt();H();async function vr(t=document,e={}){let{embedFonts:n=!0,useProxy:r=""}=e,s=e.cache??e.cacheOpt??"full";Xt(s);try{await document.fonts?.ready}catch{}try{we()}catch{}C.session=C.session||{},C.session.styleCache||(C.session.styleCache=new WeakMap),C.image=C.image||new B(100),C.background=C.background||new B(100);try{await le(t,void 0,C.session.styleCache,{useProxy:r})}catch{}let o=[],i=[];try{if(t&&t.nodeType===1){let l=t.querySelectorAll?Array.from(t.querySelectorAll("*")):[];i=[t,...l],o=[],t.tagName==="IMG"&&t.getAttribute("src")&&o.push(t),o.push(...Array.from(t.querySelectorAll?.("img[src]")||[]))}else t?.querySelectorAll&&(o=Array.from(t.querySelectorAll("img[src]")),i=Array.from(t.querySelectorAll("*")))}catch{}let a=[];for(let l of o){let u=l?.currentSrc||l?.src;if(u&&!C.image.has(u)){let c=Promise.resolve().then(async()=>{let f=await U(u,{as:"dataURL",useProxy:r});f?.ok&&typeof f.data=="string"&&C.image.set(u,f.data)}).catch(()=>{});a.push(c)}}for(let l of i){let u="";try{u=l?.style?.backgroundImage||"",(!u||u==="none")&&(u=I(l).backgroundImage)}catch{}if(u&&u!=="none"){let c=u.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let f of c){let m=Promise.resolve().then(()=>yt(f,{...e,useProxy:r})).catch(()=>{});a.push(m)}}}if(n)try{let l=kt(t),u=ae(t);if(typeof D=="function"?D():!!D){let f=new Set(Array.from(l).map(m=>String(m).split("__")[0]).filter(Boolean));await vt(f,3)}await ie({required:l,usedCodepoints:u,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:e.useProxy??r,fontStylesheetDomains:e.fontStylesheetDomains})}catch{}await Promise.allSettled(a)}function Ys(...t){return tr(...t),N}var N=Object.assign(Qs,{plugins:Ys}),Wr=Symbol("snapdom.internal"),Ks=Symbol("snapdom.internal.silent"),_r=!1;async function Qs(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=kr(e);if(rr(n,e&&e.plugins),D()&&(n.embedFonts===!0||Zs(t))){if(n.embedFonts)try{let s=kt(t),o=new Set([...s].map(i=>String(i).split("__")[0]).filter(Boolean));await vt(o,1)}catch{}let r=n.safariWarmupAttempts??3;for(let s=0;s<r;s++)try{await Js(t,e)}catch{}}return n.iconFonts&&n.iconFonts.length>0&&Cn(n.iconFonts),n.snap||(n.snap={toPng:(r,s)=>N.toPng(r,s),toSvg:(r,s)=>N.toSvg(r,s)}),N.capture(t,n,Wr)}N.capture=async(t,e,n)=>{if(n!==Wr)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await Be(t,e),s={img:async(p,g)=>{let{toImg:b}=await Promise.resolve().then(()=>(ze(),He));return b(r,{...p,...g||{}})},svg:async(p,g)=>{let{toSvg:b}=await Promise.resolve().then(()=>(ze(),He));return b(r,{...p,...g||{}})},canvas:async(p,g)=>{let{toCanvas:b}=await Promise.resolve().then(()=>(Bt(),Tr));return b(r,{...p,...g||{}})},blob:async(p,g)=>{let{toBlob:b}=await Promise.resolve().then(()=>(Ve(),Lr));return b(r,{...p,...g||{}})},png:async(p,g)=>{let{rasterize:b}=await Promise.resolve().then(()=>(Dt(),fe));return b(r,{...p,...g||{},format:"png"})},jpeg:async(p,g)=>{let{rasterize:b}=await Promise.resolve().then(()=>(Dt(),fe));return b(r,{...p,...g||{},format:"jpeg"})},webp:async(p,g)=>{let{rasterize:b}=await Promise.resolve().then(()=>(Dt(),fe));return b(r,{...p,...g||{},format:"webp"})},download:async(p,g)=>{let{download:b}=await Promise.resolve().then(()=>(Ir(),Nr));return b(r,{...p,...g||{}})}},o={};for(let p of["img","svg","canvas","blob","png","jpeg","webp"])o[p]=async g=>s[p](e,{...g||{},[Ks]:!0});o.jpg=o.jpeg;let i={...e,export:{url:r},exports:o},a=await nr("defineExports",i),l=Object.assign({},...a.filter(p=>p&&typeof p=="object").reverse()),u={...s,...l};u.jpeg&&!u.jpg&&(u.jpg=(p,g)=>u.jpeg(p,g));function c(p,g){let b={...e,...g||{}},w=y=>y==="jpeg"||y==="jpg"||y==="webp";return[p,b.format,b.type].map(y=>typeof y=="string"?y.toLowerCase():"").find(w)&&(b.backgroundColor==null||b.backgroundColor==="transparent")&&(b.backgroundColor="#ffffff"),b}let f=!1,m=Promise.resolve();async function d(p,g){let b=async()=>{let w=u[p];if(!w)throw new Error(`[snapdom] Unknown export type: ${p}`);let x=c(p,g),y={...e,export:{type:p,options:x,url:r}};await et("beforeExport",y,{format:p,options:x});let S=await w(y,x);return await et("afterExport",y,{format:p,options:x,result:S}),f||(f=!0,await et("afterSnap",e)),S};return m=m.then(b)}let h={url:r,toRaw:()=>r,to:(p,g)=>d(p,g),toImg:p=>d("img",p),toSvg:p=>d("svg",p),toCanvas:p=>d("canvas",p),toBlob:p=>d("blob",p),toPng:p=>d("png",p),toJpg:p=>d("jpg",p),toWebp:p=>d("webp",p),download:p=>d("download",p)};for(let p of Object.keys(u)){let g="to"+p.charAt(0).toUpperCase()+p.slice(1);h[g]||(h[g]=b=>d(p,b))}return h};N.toRaw=(t,e)=>N(t,e).then(n=>n.toRaw());N.toImg=(t,e)=>N(t,e).then(n=>n.toImg());N.toSvg=(t,e)=>N(t,e).then(n=>n.toSvg());N.toCanvas=(t,e)=>N(t,e).then(n=>n.toCanvas());N.toBlob=(t,e)=>N(t,e).then(n=>n.toBlob());N.toPng=(t,e)=>N(t,{...e,format:"png"}).then(n=>n.toPng());N.toJpg=(t,e)=>N(t,{...e,format:"jpeg"}).then(n=>n.toJpg());N.toWebp=(t,e)=>N(t,{...e,format:"webp"}).then(n=>n.toWebp());N.download=(t,e)=>N(t,e).then(n=>n.download());async function Js(t,e){if(_r)return;let n={...e,fast:!0,embedFonts:!0,scale:.2},r;try{r=await Be(t,n)}catch(s){R(e,"safariWarmup pre-capture failed",s)}await new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s))),r&&await new Promise(s=>{let o=new Image;try{o.decoding="sync",o.loading="eager"}catch(i){R(e,"safariWarmup img hints failed",i)}o.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",o.src=r,document.body.appendChild(o),(async()=>{try{typeof o.decode=="function"&&await o.decode()}catch(a){R(e,"safariWarmup img.decode failed",a)}let i=performance.now();for(;!(o.complete&&o.naturalWidth>0)&&performance.now()-i<900;)await new Promise(a=>setTimeout(a,200));await new Promise(a=>requestAnimationFrame(a));try{let a=document.createElement("canvas");a.width=Math.max(1,o.naturalWidth||10),a.height=Math.max(1,o.naturalHeight||10);let l=a.getContext("2d");l&&l.drawImage(o,0,0)}catch{}await new Promise(a=>requestAnimationFrame(a));try{o.remove()}catch(a){R(e,"safariWarmup img.remove failed",a)}s()})()}),t.querySelectorAll("canvas").forEach(s=>{try{let o=s.getContext("2d",{willReadFrequently:!0});o&&o.getImageData(0,0,1,1)}catch(o){R(e,"safariWarmup canvas poke failed",o)}}),_r=!0}function Zs(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,r=getComputedStyle(n),s=r.backgroundImage&&r.backgroundImage!=="none",o=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(s||o||n.tagName==="CANVAS")return!0}return!1}typeof window<"u"&&(window.snapdom=N,window.preCache=vr);
|