From 001da04286e02737f00c89eb2e7c628b115bc5ad Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 4 Nov 2026 09:16:14 +0800 Subject: [PATCH 1/2] feat(Dom2Image): update SnapDOM to v3.7.1 --- .../wwwroot/lib/snapdom.mjs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs b/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs index a3edb3ab..93f0b3d5 100644 --- a/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs +++ b/src/components/BootstrapBlazor.Dom2Image/wwwroot/lib/snapdom.mjs @@ -1,19 +1,19 @@ /* * SnapDOM -* v3.7.0 +* v3.7.1 * License: MIT */ -var Wc=Object.defineProperty;var ot=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var oe=(t,e)=>{for(var n in e)Wc(t,n,{get:e[n],enumerable:!0})};function Bi(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function zi(t="soft"){t==="disabled"&&(j.computedStyle=new WeakMap,j.measureHints=new WeakMap,j.baseStyle=new yt(50),j.defaultStyle=new yt(64),j.image=new yt(100),j.background=new yt(100),j.resource=new yt(150),j.compress=new yt(50))}var yt,j,Mt=ot(()=>{"use strict";yt=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let o=this.keys().next().value;o!==void 0&&this.delete(o)}return super.set(e,n)}},j={image:new yt(100),background:new yt(100),resource:new yt(150),defaultStyle:new yt(64),baseStyle:new yt(50),compress:new yt(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function me(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Dc(t){let e=[],n=0,o=0,r="";for(let i=0;ii.dppx-s.dppx),(o.find(i=>i.dppx>=e)||o[o.length-1]).url):null}function or(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(i=>i.trim());return r.length!==6?`matrix(${o})`:(r[4]="0",r[5]="0",`matrix(${r.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(i=>i.trim());return r.length!==16?`matrix3d(${o})`:(r[12]="0",r[13]="0",`matrix3d(${r.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function re(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function rr(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}}function dn(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function ir(t){return"\u2022".repeat(String(t??"").length)}function ct(t,e){return t?.nodeType===1&&t.localName===e}function Tt(t){return t?.nodeType===1&&t.namespaceURI===Bc}function $t(t){return t?.nodeType===1&&t.namespaceURI===zc}function Kt(t){return t?.nodeType===11&&!!t.host}function Dt(t){let e=t?.parentNode;return e?.nodeType===11?e.host:null}function sr(t){return t?.nodeType===9}var nr,Oc,Bc,zc,Pt=ot(()=>{"use strict";nr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,Oc=nr;Bc="http://www.w3.org/1999/xhtml",zc="http://www.w3.org/2000/svg"});function Uc(t="[SnapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function i(s,a,l){if(r>=n)return;let u=Date.now();(o.get(a)||0)>u||(o.set(a,u+e),r++,s==="warn"&&console&&console.warn?console.warn(`${t} ${l}`):console&&console.error&&console.error(`${t} ${l}`))}return{warnOnce(s,a){i("warn",s,a)},errorOnce(s,a){i("error",s,a)},reset(){o.clear(),r=0}}}function ji(t,e,n){if(Jt.size>=Hi){let o=Date.now();for(let[r,i]of Jt)i.until<=o&&Jt.delete(r);for(;Jt.size>=Hi;)Jt.delete(Jt.keys().next().value)}Jt.set(t,{until:Date.now()+n,result:e})}function Hc(t){return/^data:|^blob:|^about:blank$/i.test(t)}function jc(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=e.split(/\{url(?:Raw)?\}/)[0],r=new URL(o||".",n);if(new URL(t,n).origin===r.origin)return!0}catch{}return!1}function Vc(t,e){if(!e||Hc(t)||jc(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location<"u"?o.origin!==location.origin:!0}catch{return!!e}}function Gc(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>re(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}${re(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Vi(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"").replace(/^data:[^,]*/,r=>r.replace(/\s+/g,""))),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function qc(t,e){return new Headers(e.headers||{}).keys().next().done?JSON.stringify([e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,e.credentials||"",t]):null}function Gi(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function lr(t,e){try{t.onError?.(e)}catch{}}async function dt(t,e={}){let n=e.as??"blob",o=e.timeout??3e3,r=e.useProxy||"",i=e.errorTTL??8e3,s=e.headers||{},a=!!e.debug;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[,p="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(p)?atob(y):decodeURIComponent(y),S=new Uint8Array([...w].map(C=>C.charCodeAt(0))),v=new Blob([S],{type:(p||"").split(";")[0]||""});return{ok:!0,data:v,status:200,url:t,fromCache:!1,mime:v.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let p=await fetch(t);if(!p.ok)return{ok:!1,data:null,status:p.status,url:t,fromCache:!1,reason:"http_error"};let y=await p.blob(),b=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Vi(y),blob:y,status:p.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:p.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:p.status,url:t,fromCache:!1,mime:b}}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;try{l=qc(t,{as:n,timeout:o,useProxy:r,errorTTL:i,credentials:e.credentials,headers:s})}catch{let p={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return lr(e,p),p}let u=Jt.get(l);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&Jt.delete(l);let c=ar.get(l);if(c)return c;let f=Vc(t,r)?Gc(t,r):t,d=e.credentials;if(!d)try{let p=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,p);d=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{d="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),o),g=(async()=>{try{let p=await fetch(f,{signal:h.signal,credentials:d,headers:s});if(!p.ok){let w={ok:!1,data:null,status:p.status,url:f,fromCache:!1,reason:"http_error"};if(l!==null&&i>0&&ji(l,w,i),a){let S=`${p.status} ${p.statusText||""}`.trim();Ui.warnOnce(`http:${p.status}:${n}:${Gi(t)}`,`Couldn't load ${t} (HTTP ${S}).`)}return lr(e,w),w}if(n==="text")return{ok:!0,data:await p.text(),status:p.status,url:f,fromCache:!1};let y=await p.blob(),b=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Vi(y),blob:y,status:p.status,url:f,fromCache:!1,mime:b}:{ok:!0,data:y,status:p.status,url:f,fromCache:!1,mime:b}}catch(p){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":p&&typeof p=="object"&&p.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:y};if(l!==null&&!/^blob:/i.test(t)&&i>0&&ji(l,b,i),a){let w=`${y}:${n}:${Gi(t)}`,S=y==="timeout"?`Timed out loading ${t} after ${o}ms. Raise the timeout option or set useProxy.`:y==="abort"?`Loading ${t} was cancelled.`:`Couldn't load ${t} (network or CORS). Try the useProxy option.`;Ui.errorOnce(w,S)}return lr(e,b),b}finally{clearTimeout(m),ar.delete(l)}})();return l!==null&&ar.set(l,g),g}var Ui,ar,Hi,Jt,ge=ot(()=>{"use strict";Pt();Ui=Uc("[SnapDOM]",{ttlMs:3*6e4,maxEntries:10}),ar=new Map,Hi=50,Jt=new Map});async function Ne(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=un(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??me(t);if(!o)return t;let r=rr(o),i=re(r),s=(e.useProxy||"")+"|"+i;if(j.background.has(s)){let a=j.background.get(s);return a?`url("${a}")`:"none"}try{let a=await dt(i,{as:"dataURL",useProxy:e.useProxy,debug:e.debug});return a.ok?(j.background.set(s,a.data),`url("${a.data}")`):(j.background.set(s,null),"none")}catch{return j.background.set(s,null),"none"}}var qi=ot(()=>{"use strict";Mt();Pt();ge()});function Ki(t,e){if(Xc.has(e))t.add(e);else if(e.startsWith("transform-origin-"))t.add("transform-origin");else return!1;return!0}function Zi(t){let e=t.replace(Zc,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function ts(t,e,n,o){for(let r=0;r5&&(d[0]==="m"||d[0]==="p")){let h=d.startsWith("margin")?"marginUnstable":d.startsWith("padding")?"paddingUnstable":null;h&&!o[h]&&Qc.test(s.getPropertyValue(d))&&(o[h]=!0)}}}let u=i.selectorText;if(u&&u.includes(":has(")&&(o.usesHas=!0),u&&/[+~]|:has\(|:nth-(?:last-)?child\([^)]*\bof\b/i.test(u)&&(o.leaksAcrossSubtrees=!0),s&&(s.counterReset||s.counterIncrement||s.counterSet||s.content&&s.content.includes("counter"))&&(o.leaksAcrossSubtrees=!0),u&&u.includes("&"))for(let c=i.parentRule;c&&u.includes("&");c=c.parentRule)c.selectorText&&(u=u.replace(/&/g,`:is(${c.selectorText})`));if(u&&(o.inContainer||Yi.test(u)||u.includes("+")||u.includes("~")))for(let c of Hn(u,",")){let f=c.trim();f&&(o.inContainer||Yi.test(f)||f.includes("+")||f.includes("~"))&&o.shareUnsafeSels.add(f)}if((a||l)&&tf(i,u,a,o),u&&u.includes(":"))for(let c in Xi)Xi[c].test(u)&&n[c].push(Zi(u));if(i.styleSheet){if(!Un(i.styleSheet,e,n,o))return!1}else if(i.cssRules&&i.cssRules.length){let c=i.constructor?.name==="CSSContainerRule",f=i.constructor?.name==="CSSScopeRule";c&&o.inContainer++,f&&(o.inScope=(o.inScope||0)+1);let d=ts(i.cssRules,e,n,o);if(c&&o.inContainer--,f&&o.inScope--,!d)return!1}}return!0}function tf(t,e,n,o){if(n&&t.constructor?.name==="CSSKeyframeRule"){o.svgKeyframes=!0;return}if(!e||o.inScope){n&&(o.svgGeometryAll=!0);return}let r=n?o.svgGeometrySels:o.svgAnimSels;for(let i of Hn(e,",")){let s=i.trim();s&&r.add(Ji.test(s)?Zi(s):s)}}function Un(t,e,n,o){let r;try{r=t.cssRules}catch{r=o.crossOriginRules?.(t)}return r?ts(r,e,n,o):!1}function fr(t,e){for(let n of t){let o=n.effect?.getKeyframes?.()||[];for(let r of o)for(let i of Object.keys(r))i==="offset"||i==="easing"||i==="composite"||i==="computedOffset"||e.add(i.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function es(t){let e=new Set;return Un(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:Qi,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function Hn(t,e){if(!t.includes(e))return[t];let n=[],o=0,r=null,i=0;for(let s=0;s"||f==="+"||f==="~")&&(o=c+1)}let r="",i=0;for(let c of t.slice(o))c==="("||c==="["?i++:c===")"||c==="]"?i--:i===0&&(r+=c);let s=c=>!c||/\\[0-9a-fA-F]/.test(c)?null:c.replace(/\\(.)/g,"$1"),a=s((r.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let l=s((r.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(l)return"i"+l;let u=(r.match(/^([a-zA-Z][\w-]*)/)||[])[1];return u?"t"+u.toLowerCase():null}function ns(t,e){if(!e.length)return"";if(e.some(o=>o.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function nf(t,e){let n=t.createElement("div"),o={};for(let r in e){let i=e[r];(r==="before"||r==="after")&&i.push("q"),o[r]=ns(n,i)}return o}function os(t,e){let n={universe:null,pseudoUniverse:null,svgGeometry:null,svgGeometrySel:null,usesHas:!0,leaksAcrossSubtrees:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let o=new Set(cr),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:Qi,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set,svgGeometry:new Set,svgGeometrySels:new Set,svgAnimSels:new Set,svgKeyframes:!1,svgGeometryAll:!1,inScope:0,crossOriginRules:e};for(let f of t.styleSheets)if(!Un(f,o,r,i))return n;let s=t.adoptedStyleSheets;if(Array.isArray(s)){for(let f of s)if(!Un(f,o,r,i))return n}if(typeof t.getAnimations=="function"){let f=new Set;fr(t.getAnimations(),f);for(let d of f)o.add(d),Ki(i.svgGeometry,d)&&(i.svgGeometryAll=!0)}if(i.svgKeyframes)for(let f of i.svgAnimSels)i.svgGeometrySels.add(f);let a=i.svgGeometryAll?null:Array.from(i.svgGeometrySels).join(","),l=Array.from(i.shareUnsafeSels),u=ns(t.createElement("div"),l)===null?null:l.map(f=>({sel:f,key:ef(f)})),c=new Set(Jc);for(let f of Kc)o.has(f)&&c.add(f);for(let f of i.pseudoProps)c.add(f);return(i.pseudoProps.has("transform")||i.pseudoProps.has("rotate")||i.pseudoProps.has("scale"))&&c.add("transform-origin"),i.pseudoProps.has("perspective")&&c.add("perspective-origin"),{universe:o,pseudoUniverse:c,svgGeometry:i.svgGeometry,svgGeometrySel:a,pseudoGates:nf(t,r),usesHas:i.usesHas,leaksAcrossSubtrees:i.leaksAcrossSubtrees,shareGate:u,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return n}}var Xc,Yc,cr,Kc,Jc,Ji,Qi,Qc,Xi,Zc,Yi,jn=ot(()=>{"use strict";Xc=new Set(["r","cx","cy","rx","ry","x","y","width","height","d","transform","translate","rotate","scale","transform-origin","transform-box","vector-effect"]);Yc=/^(?:animation|transition)/,cr=["display","position","top","right","bottom","left","float","clear","z-index","box-sizing","width","height","min-width","min-height","max-width","max-height","margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left","overflow-x","overflow-y","visibility","opacity","content-visibility","vertical-align","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","order","align-items","align-self","align-content","justify-content","justify-items","justify-self","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-auto-flow","grid-auto-columns","grid-auto-rows","grid-column-start","grid-column-end","grid-row-start","grid-row-end","color","font-family","font-size","font-weight","font-style","font-stretch","line-height","letter-spacing","word-spacing","white-space","text-align","text-transform","text-indent","text-overflow","text-shadow","direction","unicode-bidi","writing-mode","text-orientation","word-break","overflow-wrap","tab-size","list-style-type","list-style-position","list-style-image","counter-reset","counter-increment","counter-set","background-color","background-image","background-size","background-position","background-repeat","background-clip","background-origin","background-attachment","box-shadow","outline-width","outline-style","outline-color","outline-offset","transform","transform-origin","rotate","scale","translate","filter","mix-blend-mode","clip-path","object-fit","object-position","border-collapse","border-spacing","table-layout","caption-side","empty-cells"],Kc=["color","font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-kerning","font-feature-settings","font-variation-settings","line-height","letter-spacing","word-spacing","white-space","text-align","text-align-last","text-indent","text-transform","text-shadow","text-rendering","direction","unicode-bidi","word-break","overflow-wrap","writing-mode","text-orientation","hyphens","tab-size","visibility","list-style-type","list-style-position","list-style-image","border-collapse","border-spacing","caption-side","empty-cells","quotes","color-scheme","-webkit-text-fill-color","-webkit-font-smoothing","image-rendering"],Jc=["display","width","height","min-width","min-height"],Ji=/::?(?:before|after|first-letter|first-line|marker)/,Qi=2e4,Qc=/%|\bauto\b|calc\(|var\(/i,Xi={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Zc=/::?(?:before|after|first-letter|first-line|marker)\b/g;Yi=/:(nth-|first-child|last-child|only-|first-of-type|last-of-type|empty|hover|focus|active|target|checked|indeterminate|disabled|enabled|read-only|read-write|placeholder-shown|autofill|valid|invalid|user-valid|user-invalid|in-range|out-of-range|required|optional|default|link|any-link|scope|defined|modal|fullscreen|picture-in-picture|playing|paused|dir\(|lang\(|has\()/});function Q(t){return rs.add(t),t.setAttribute("data-snapdom-internal",""),t}function qt(t){return rs.has(t)}var rs,At=ot(()=>{"use strict";rs=new WeakSet});function dr(t){if(t=String(t).toLowerCase(),pn.has(t)){let i={};return j.defaultStyle.set(t,i),i}if(j.defaultStyle.has(t))return j.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(qt);e||(e=document.createElement("div"),Q(e),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.includes("-")?"span":t);n.style.all="initial",e.appendChild(n);let o=getComputedStyle(n),r={};for(let i of o){if(Le(i))continue;let s=o.getPropertyValue(i);r[i]=s}for(let i of cr)!(i in r)&&!Le(i)&&(r[i]=o.getPropertyValue(i));return e.removeChild(n),j.defaultStyle.set(t,r),r}function Le(t){let e=is.get(t);if(e===void 0){let n=String(t).toLowerCase();e=sf.has(n)||rf.test(n)||of.test(n),is.set(t,e)}return e}function ls(t,e){let n=uf.get(t);if(n===void 0||e[n]!==e[t])return!1;let o=e["writing-mode"];if(o&&o!=="horizontal-tb")return!1;let r=e.direction;return!(r&&r!=="ltr")}function Vn(t,e){return!lf.has(t)&&(e==="inline"||af.has(t)||as.has(t))}function pr(t,e,n){let o=(e.display||"").toLowerCase();if(o==="inline"||as.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let i=(e.position||"static").toLowerCase();return i==="absolute"||i==="fixed"?!1:!pf.has(o)}function Ie(t,e,n=!0,o=!1){if(e=String(e||"").toLowerCase(),pn.has(e))return"";let r=[],i=dr(e),s=(t.display||"").toLowerCase(),a=s==="inline",l=Vn(e,s),u=t["text-wrap-mode"]||t["white-space"]||"",c=u==="nowrap"||u==="pre",d=l&&n&&!(l&&n&&!a&&c),h=!1;for(let m in t){if(Le(m)||ls(m,t))continue;let g=t[m];if(!(ss.has(m)&&cf.has(e))){if(d){if(ss.has(m))continue;if(ff.has(m)){g&&g!==i[m]&&(r.push(`${m}:${g}`),g!=="auto"&&(h=!0));continue}}if(g&&g!==i[m]){if((m==="height"||m==="block-size"||!c&&(m==="width"||m==="inline-size"))&&g.endsWith("px")&&g.includes(".")){let y=parseFloat(g);if(Number.isFinite(y)){r.push(`${m}:${(y+df).toFixed(3)}px`);continue}}r.push(`${m}:${g}`)}}}if(d&&!a&&!o&&!h){let m=t.width;m&&m!=="auto"&&m!==i.width&&r.push(`min-width:${m}`)}return r.sort(),r.join(";")}function hr(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 mr(t,e=null){let n=new Map;for(let s of t){let a=dr(s);if(!a)continue;let c=(e?Object.entries(a).filter(([d])=>e.has(d)):Object.entries(a)).filter(([d])=>!ls(d,a)).map(([d,h])=>`${d}:${h};`).sort(),f=c.join("");f&&(n.has(f)||n.set(f,{tagList:[],declarations:c}),n.get(f).tagList.push(s))}let o=[...n.values()],r=null;for(let{declarations:s}of o){let a=new Set(s);if(!r){r=a;continue}for(let l of r)a.has(l)||r.delete(l)}r??=new Set;let i="";if(r.size&&o.length>1){let s=o.flatMap(a=>a.tagList);i+=`${s.join(",")} { ${[...r].join("")} } +var Dc=Object.defineProperty;var it=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var re=(t,e)=>{for(var n in e)Dc(t,n,{get:e[n],enumerable:!0})};function Vi(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function Gi(t="soft"){t==="disabled"&&(j.computedStyle=new WeakMap,j.measureHints=new WeakMap,j.baseStyle=new bt(50),j.defaultStyle=new bt(64),j.image=new bt(100),j.background=new bt(100),j.resource=new bt(150),j.compress=new bt(50))}var bt,j,At=it(()=>{"use strict";bt=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let o=this.keys().next().value;o!==void 0&&this.delete(o)}return super.set(e,n)}},j={image:new bt(100),background:new bt(100),resource:new bt(150),defaultStyle:new bt(64),baseStyle:new bt(50),compress:new bt(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function ge(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function zc(t){let e=[],n=0,o=0,r="";for(let i=0;ii.dppx-s.dppx),(o.find(i=>i.dppx>=e)||o[o.length-1]).url):null}function ir(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(i=>i.trim());return r.length!==6?`matrix(${o})`:(r[4]="0",r[5]="0",`matrix(${r.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(i=>i.trim());return r.length!==16?`matrix3d(${o})`:(r[12]="0",r[13]="0",`matrix3d(${r.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function Hn(t,e){if(!e)return t;let[n,o,r]=e.zoomed,i=t.indexOf("")+8;if(i<8||!t.startsWith(n)||!t.startsWith(o,i)||!t.endsWith(r))return t;let[s,a,l]=e.flat;return s+t.slice(n.length,i)+a+t.slice(i+o.length,t.length-r.length)+l}function ie(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function sr(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}}function hn(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function ar(t){return"\u2022".repeat(String(t??"").length)}function ut(t,e){return t?.nodeType===1&&t.localName===e}function Pt(t){return t?.nodeType===1&&t.namespaceURI===Uc}function Nt(t){return t?.nodeType===1&&t.namespaceURI===Hc}function Qt(t){return t?.nodeType===11&&!!t.host}function Bt(t){let e=t?.parentNode;return e?.nodeType===11?e.host:null}function lr(t){return t?.nodeType===9}var rr,Bc,Uc,Hc,vt=it(()=>{"use strict";rr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,Bc=rr;Uc="http://www.w3.org/1999/xhtml",Hc="http://www.w3.org/2000/svg"});function jc(t="[SnapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function i(s,a,l){if(r>=n)return;let u=Date.now();(o.get(a)||0)>u||(o.set(a,u+e),r++,s==="warn"&&console&&console.warn?console.warn(`${t} ${l}`):console&&console.error&&console.error(`${t} ${l}`))}return{warnOnce(s,a){i("warn",s,a)},errorOnce(s,a){i("error",s,a)},reset(){o.clear(),r=0}}}function Yi(t,e,n){if(Zt.size>=Xi){let o=Date.now();for(let[r,i]of Zt)i.until<=o&&Zt.delete(r);for(;Zt.size>=Xi;)Zt.delete(Zt.keys().next().value)}Zt.set(t,{until:Date.now()+n,result:e})}function Vc(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Gc(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=e.split(/\{url(?:Raw)?\}/)[0],r=new URL(o||".",n);if(new URL(t,n).origin===r.origin)return!0}catch{}return!1}function qc(t,e){if(!e||Vc(t)||Gc(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location<"u"?o.origin!==location.origin:!0}catch{return!!e}}function Xc(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>ie(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}${ie(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Ki(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"").replace(/^data:[^,]*/,r=>r.replace(/\s+/g,""))),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function Yc(t,e){return new Headers(e.headers||{}).keys().next().done?JSON.stringify([e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,e.credentials||"",t]):null}function Ji(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function fr(t,e){try{t.onError?.(e)}catch{}}async function pt(t,e={}){let n=e.as??"blob",o=e.timeout??3e3,r=e.useProxy||"",i=e.errorTTL??8e3,s=e.headers||{},a=!!e.debug;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[,p="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(p)?atob(y):decodeURIComponent(y),S=new Uint8Array([...w].map(C=>C.charCodeAt(0))),v=new Blob([S],{type:(p||"").split(";")[0]||""});return{ok:!0,data:v,status:200,url:t,fromCache:!1,mime:v.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let p=await fetch(t);if(!p.ok)return{ok:!1,data:null,status:p.status,url:t,fromCache:!1,reason:"http_error"};let y=await p.blob(),b=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Ki(y),blob:y,status:p.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:p.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:p.status,url:t,fromCache:!1,mime:b}}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;try{l=Yc(t,{as:n,timeout:o,useProxy:r,errorTTL:i,credentials:e.credentials,headers:s})}catch{let p={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return fr(e,p),p}let u=Zt.get(l);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&Zt.delete(l);let c=cr.get(l);if(c)return c;let f=qc(t,r)?Xc(t,r):t,d=e.credentials;if(!d)try{let p=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,p);d=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{d="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),o),g=(async()=>{try{let p=await fetch(f,{signal:h.signal,credentials:d,headers:s});if(!p.ok){let w={ok:!1,data:null,status:p.status,url:f,fromCache:!1,reason:"http_error"};if(l!==null&&i>0&&Yi(l,w,i),a){let S=`${p.status} ${p.statusText||""}`.trim();qi.warnOnce(`http:${p.status}:${n}:${Ji(t)}`,`Couldn't load ${t} (HTTP ${S}).`)}return fr(e,w),w}if(n==="text")return{ok:!0,data:await p.text(),status:p.status,url:f,fromCache:!1};let y=await p.blob(),b=y.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Ki(y),blob:y,status:p.status,url:f,fromCache:!1,mime:b}:{ok:!0,data:y,status:p.status,url:f,fromCache:!1,mime:b}}catch(p){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":p&&typeof p=="object"&&p.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:y};if(l!==null&&!/^blob:/i.test(t)&&i>0&&Yi(l,b,i),a){let w=`${y}:${n}:${Ji(t)}`,S=y==="timeout"?`Timed out loading ${t} after ${o}ms. Raise the timeout option or set useProxy.`:y==="abort"?`Loading ${t} was cancelled.`:`Couldn't load ${t} (network or CORS). Try the useProxy option.`;qi.errorOnce(w,S)}return fr(e,b),b}finally{clearTimeout(m),cr.delete(l)}})();return l!==null&&cr.set(l,g),g}var qi,cr,Xi,Zt,ye=it(()=>{"use strict";vt();qi=jc("[SnapDOM]",{ttlMs:3*6e4,maxEntries:10}),cr=new Map,Xi=50,Zt=new Map});async function We(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=pn(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??ge(t);if(!o)return t;let r=sr(o),i=ie(r),s=(e.useProxy||"")+"|"+i;if(j.background.has(s)){let a=j.background.get(s);return a?`url("${a}")`:"none"}try{let a=await pt(i,{as:"dataURL",useProxy:e.useProxy,debug:e.debug});return a.ok?(j.background.set(s,a.data),`url("${a.data}")`):(j.background.set(s,null),"none")}catch{return j.background.set(s,null),"none"}}var Qi=it(()=>{"use strict";At();vt();ye()});function es(t,e){if(Kc.has(e))t.add(e);else if(e.startsWith("transform-origin-"))t.add("transform-origin");else return!1;return!0}function rs(t){let e=t.replace(ef,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function is(t,e,n,o){for(let r=0;r5&&(d[0]==="m"||d[0]==="p")){let h=d.startsWith("margin")?"marginUnstable":d.startsWith("padding")?"paddingUnstable":null;h&&!o[h]&&tf.test(s.getPropertyValue(d))&&(o[h]=!0)}}}let u=i.selectorText;if(u&&u.includes(":has(")&&(o.usesHas=!0),u&&/[+~]|:has\(|:nth-(?:last-)?child\([^)]*\bof\b/i.test(u)&&(o.leaksAcrossSubtrees=!0),s&&(s.counterReset||s.counterIncrement||s.counterSet||s.content&&s.content.includes("counter"))&&(o.leaksAcrossSubtrees=!0),u&&u.includes("&"))for(let c=i.parentRule;c&&u.includes("&");c=c.parentRule)c.selectorText&&(u=u.replace(/&/g,`:is(${c.selectorText})`));if(u&&(o.inContainer||ts.test(u)||u.includes("+")||u.includes("~")))for(let c of Vn(u,",")){let f=c.trim();f&&(o.inContainer||ts.test(f)||f.includes("+")||f.includes("~"))&&o.shareUnsafeSels.add(f)}if((a||l)&&nf(i,u,a,o),u&&u.includes(":"))for(let c in Zi)Zi[c].test(u)&&n[c].push(rs(u));if(i.styleSheet){if(!jn(i.styleSheet,e,n,o))return!1}else if(i.cssRules&&i.cssRules.length){let c=i.constructor?.name==="CSSContainerRule",f=i.constructor?.name==="CSSScopeRule";c&&o.inContainer++,f&&(o.inScope=(o.inScope||0)+1);let d=is(i.cssRules,e,n,o);if(c&&o.inContainer--,f&&o.inScope--,!d)return!1}}return!0}function nf(t,e,n,o){if(n&&t.constructor?.name==="CSSKeyframeRule"){o.svgKeyframes=!0;return}if(!e||o.inScope){n&&(o.svgGeometryAll=!0);return}let r=n?o.svgGeometrySels:o.svgAnimSels;for(let i of Vn(e,",")){let s=i.trim();s&&r.add(ns.test(s)?rs(s):s)}}function jn(t,e,n,o){let r;try{r=t.cssRules}catch{r=o.crossOriginRules?.(t)}return r?is(r,e,n,o):!1}function pr(t,e){for(let n of t){let o=n.effect?.getKeyframes?.()||[];for(let r of o)for(let i of Object.keys(r))i==="offset"||i==="easing"||i==="composite"||i==="computedOffset"||e.add(i.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function ss(t){let e=new Set;return jn(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:os,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function Vn(t,e){if(!t.includes(e))return[t];let n=[],o=0,r=null,i=0;for(let s=0;s"||f==="+"||f==="~")&&(o=c+1)}let r="",i=0;for(let c of t.slice(o))c==="("||c==="["?i++:c===")"||c==="]"?i--:i===0&&(r+=c);let s=c=>!c||/\\[0-9a-fA-F]/.test(c)?null:c.replace(/\\(.)/g,"$1"),a=s((r.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let l=s((r.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(l)return"i"+l;let u=(r.match(/^([a-zA-Z][\w-]*)/)||[])[1];return u?"t"+u.toLowerCase():null}function ur(t,e){if(!e.length)return"";if(e.some(o=>o.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function rf(t,e){let n={};for(let o in e){let r=e[o];(o==="before"||o==="after")&&r.push("q"),n[o]=ur(t,r)}return n}function as(t,e){let n={universe:null,pseudoUniverse:null,svgGeometry:null,svgGeometrySel:null,usesHas:!0,leaksAcrossSubtrees:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let o=new Set(dr),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:os,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set,svgGeometry:new Set,svgGeometrySels:new Set,svgAnimSels:new Set,svgKeyframes:!1,svgGeometryAll:!1,inScope:0,crossOriginRules:e};for(let d of t.styleSheets)if(!jn(d,o,r,i))return n;let s=t.adoptedStyleSheets;if(Array.isArray(s)){for(let d of s)if(!jn(d,o,r,i))return n}if(typeof t.getAnimations=="function"){let d=new Set;pr(t.getAnimations(),d);for(let h of d)o.add(h),es(i.svgGeometry,h)&&(i.svgGeometryAll=!0)}if(i.svgKeyframes)for(let d of i.svgAnimSels)i.svgGeometrySels.add(d);let a=t.createElement("div"),l=i.svgGeometryAll?null:ur(a,Array.from(i.svgGeometrySels)),u=Array.from(i.shareUnsafeSels),c=ur(a,u)===null?null:u.map(d=>({sel:d,key:of(d)})),f=new Set(Zc);for(let d of Qc)o.has(d)&&f.add(d);for(let d of i.pseudoProps)f.add(d);return(i.pseudoProps.has("transform")||i.pseudoProps.has("rotate")||i.pseudoProps.has("scale"))&&f.add("transform-origin"),i.pseudoProps.has("perspective")&&f.add("perspective-origin"),{universe:o,pseudoUniverse:f,svgGeometry:i.svgGeometry,svgGeometrySel:l,pseudoGates:rf(a,r),usesHas:i.usesHas,leaksAcrossSubtrees:i.leaksAcrossSubtrees,shareGate:c,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return n}}var Kc,Jc,dr,Qc,Zc,ns,os,tf,Zi,ef,ts,Gn=it(()=>{"use strict";Kc=new Set(["r","cx","cy","rx","ry","x","y","width","height","d","transform","translate","rotate","scale","transform-origin","transform-box","vector-effect"]);Jc=/^(?:animation|transition)/,dr=["display","position","top","right","bottom","left","float","clear","z-index","box-sizing","width","height","min-width","min-height","max-width","max-height","margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left","overflow-x","overflow-y","visibility","opacity","content-visibility","vertical-align","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","order","align-items","align-self","align-content","justify-content","justify-items","justify-self","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-auto-flow","grid-auto-columns","grid-auto-rows","grid-column-start","grid-column-end","grid-row-start","grid-row-end","color","font-family","font-size","font-weight","font-style","font-stretch","line-height","letter-spacing","word-spacing","white-space","text-align","text-transform","text-indent","text-overflow","text-shadow","direction","unicode-bidi","writing-mode","text-orientation","word-break","overflow-wrap","tab-size","list-style-type","list-style-position","list-style-image","counter-reset","counter-increment","counter-set","background-color","background-image","background-size","background-position","background-repeat","background-clip","background-origin","background-attachment","box-shadow","outline-width","outline-style","outline-color","outline-offset","transform","transform-origin","rotate","scale","translate","filter","mix-blend-mode","clip-path","object-fit","object-position","border-collapse","border-spacing","table-layout","caption-side","empty-cells"],Qc=["color","font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-kerning","font-feature-settings","font-variation-settings","line-height","letter-spacing","word-spacing","white-space","text-align","text-align-last","text-indent","text-transform","text-shadow","text-rendering","direction","unicode-bidi","word-break","overflow-wrap","writing-mode","text-orientation","hyphens","tab-size","visibility","list-style-type","list-style-position","list-style-image","border-collapse","border-spacing","caption-side","empty-cells","quotes","color-scheme","-webkit-text-fill-color","-webkit-font-smoothing","image-rendering"],Zc=["display","width","height","min-width","min-height"],ns=/(?{"use strict";ls=new WeakSet});function mr(t){if(t=String(t).toLowerCase(),mn.has(t)){let i={};return j.defaultStyle.set(t,i),i}if(j.defaultStyle.has(t))return j.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(Xt);e||(e=document.createElement("div"),Z(e),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.includes("-")?"span":t);n.style.all="initial",e.appendChild(n);let o=getComputedStyle(n),r={};for(let i of o){if(Oe(i))continue;let s=o.getPropertyValue(i);r[i]=s}for(let i of dr)!(i in r)&&!Oe(i)&&(r[i]=o.getPropertyValue(i));return e.removeChild(n),j.defaultStyle.set(t,r),r}function Oe(t){let e=cs.get(t);if(e===void 0){let n=String(t).toLowerCase();e=lf.has(n)||af.test(n)||sf.test(n),cs.set(t,e)}return e}function ds(t,e){let n=pf.get(t);if(n===void 0||e[n]!==e[t])return!1;let o=e["writing-mode"];if(o&&o!=="horizontal-tb")return!1;let r=e.direction;return!(r&&r!=="ltr")}function qn(t,e){return!ff.has(t)&&(e==="inline"||cf.has(t)||us.has(t))}function gr(t,e,n){let o=(e.display||"").toLowerCase();if(o==="inline"||us.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let i=(e.position||"static").toLowerCase();return i==="absolute"||i==="fixed"?!1:!mf.has(o)}function De(t,e,n=!0,o=!1){if(e=String(e||"").toLowerCase(),mn.has(e))return"";let r=[],i=mr(e),s=(t.display||"").toLowerCase(),a=s==="inline",l=qn(e,s),u=t["text-wrap-mode"]||t["white-space"]||"",c=u==="nowrap"||u==="pre",d=l&&n&&!(l&&n&&!a&&c),h=!1;for(let m in t){if(Oe(m)||ds(m,t))continue;let g=t[m];if(!(fs.has(m)&&uf.has(e))){if(d){if(fs.has(m))continue;if(df.has(m)){g&&g!==i[m]&&(r.push(`${m}:${g}`),g!=="auto"&&(h=!0));continue}}if(g&&g!==i[m]){if((m==="height"||m==="block-size"||!c&&(m==="width"||m==="inline-size"))&&g.endsWith("px")&&g.includes(".")){let y=parseFloat(g);if(Number.isFinite(y)){r.push(`${m}:${(y+hf).toFixed(3)}px`);continue}}r.push(`${m}:${g}`)}}}if(d&&!a&&!o&&!h){let m=t.width;m&&m!=="auto"&&m!==i.width&&r.push(`min-width:${m}`)}return r.sort(),r.join(";")}function yr(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 br(t,e=null){let n=new Map;for(let s of t){let a=mr(s);if(!a)continue;let c=(e?Object.entries(a).filter(([d])=>e.has(d)):Object.entries(a)).filter(([d])=>!ds(d,a)).map(([d,h])=>`${d}:${h};`).sort(),f=c.join("");f&&(n.has(f)||n.set(f,{tagList:[],declarations:c}),n.get(f).tagList.push(s))}let o=[...n.values()],r=null;for(let{declarations:s}of o){let a=new Set(s);if(!r){r=a;continue}for(let l of r)a.has(l)||r.delete(l)}r??=new Set;let i="";if(r.size&&o.length>1){let s=o.flatMap(a=>a.tagList);i+=`${s.join(",")} { ${[...r].join("")} } `}for(let{tagList:s,declarations:a}of o){let l=o.length>1?a.filter(c=>!r.has(c)):a;if(!l.length)continue;let u=l.join("");i+=`${s.join(",")} { ${u} } -`}return i}function hn(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,o=1;for(let r of e)n.set(r,`c${o++}`);return n}function hf(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 o=0;o{let i={length:0,getPropertyValue:()=>"",item:()=>""};return i[Symbol.iterator]=function*(){},i};if(t?.nodeType!==1){let i=typeof window<"u"?window:null;if(i&&typeof i.getComputedStyle=="function")try{return i.getComputedStyle(t,e)||n()}catch{return n()}return n()}let o=j.computedStyle.get(t);o||(o=new Map,j.computedStyle.set(t,o));let r=o.get(e);if(!r){let i=hf(t),s=null;try{s=i&&typeof i.getComputedStyle=="function"?i.getComputedStyle(t,e):null}catch{}if(!s&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(s=window.getComputedStyle(t,e))}catch{}r=s||n(),o.set(e,r)}return r}function We(t,e=null){let n={};for(let o of e||t){let r=t.getPropertyValue(o);r&&(n[o]=r)}for(let o of mf){let r=n[`border-${o}-style`],i=n[`border-${o}-width`];(r==="none"||r==="hidden"||i==="0px")&&(delete n[`border-${o}-style`],delete n[`border-${o}-width`],delete n[`border-${o}-color`])}return n}function ie(t){let e=[],n=0,o=0,r="";for(let i=0;i{"use strict";Mt();jn();At();ur=new Set(["meta","script","noscript","title","link","template"]),pn=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);of=/(?:^|-)(animation|transition)(?:-|$)/i,rf=/^(--.+|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,sf=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","stroke-color"]),is=new Map;af=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),as=new Set(["table","thead","tbody","tfoot","tr","td","th"]),lf=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),ss=new Set(["width","max-width","inline-size","max-inline-size"]),cf=new Set(["mi","mn","mo","ms","mtext"]),ff=new Set(["min-width","min-inline-size"]),uf=new Map(Object.entries({"block-size":"height","inline-size":"width","min-block-size":"min-height","min-inline-size":"min-width","max-block-size":"max-height","max-inline-size":"max-width","margin-block-start":"margin-top","margin-block-end":"margin-bottom","margin-inline-start":"margin-left","margin-inline-end":"margin-right","padding-block-start":"padding-top","padding-block-end":"padding-bottom","padding-inline-start":"padding-left","padding-inline-end":"padding-right","inset-block-start":"top","inset-block-end":"bottom","inset-inline-start":"left","inset-inline-end":"right","border-block-start-width":"border-top-width","border-block-start-style":"border-top-style","border-block-start-color":"border-top-color","border-block-end-width":"border-bottom-width","border-block-end-style":"border-bottom-style","border-block-end-color":"border-bottom-color","border-inline-start-width":"border-left-width","border-inline-start-style":"border-left-style","border-inline-start-color":"border-left-color","border-inline-end-width":"border-right-width","border-inline-end-style":"border-right-style","border-inline-end-color":"border-right-color","border-start-start-radius":"border-top-left-radius","border-start-end-radius":"border-top-right-radius","border-end-start-radius":"border-bottom-left-radius","border-end-end-radius":"border-bottom-right-radius","overflow-block":"overflow-y","overflow-inline":"overflow-x","overscroll-behavior-block":"overscroll-behavior-y","overscroll-behavior-inline":"overscroll-behavior-x","contain-intrinsic-block-size":"contain-intrinsic-height","contain-intrinsic-inline-size":"contain-intrinsic-width"}));df=.001;pf=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);mf=["top","right","bottom","left"]});function vt(t=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(e=>{let n=!1,o=()=>{n||(n=!0,e())};try{requestAnimationFrame(o)}catch{o();return}setTimeout(o,t)})}async function gn(t=document){let e=t.fonts,n=!1,o=e.ready.then(()=>{n=!0},()=>{n=!0});for(;!n&&e.status==="loading";){let r=[...e].filter(i=>i.status==="loading");if(!r.length)return;await Promise.race([o,Promise.allSettled(r.map(i=>i.loaded))])}}function cs(t){if(t!==!1&&t!=="auto")return null;let e=performance.now()+(t==="auto"?gf:gr),n=null,o={yielded:!1,due:()=>performance.now()>=e,pause:()=>n||(n=yr().then(()=>{n=null,o.yielded=!0,e=performance.now()+gr}))};return o}function yr(){return new Promise(t=>{let e=new MessageChannel;e.port1.onmessage=()=>t(),e.port2.postMessage(0)})}async function Gn(){mn>=0&&performance.now()-mn>gr&&await yr(),mn<0&&(mn=performance.now(),yr().then(()=>{mn=-1}))}function yn(){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 Y(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),o=/applewebkit/i.test(t),r=/mobile/i.test(t),i=!/safari/i.test(t),s=o&&r&&i,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),u=/ipad|iphone|ipod/.test(e)&&o;return n||s||a||l||u}function Et(){return typeof navigator>"u"?!1:(navigator.userAgent||"").toLowerCase().includes("firefox")}var gr,gf,mn,ht=ot(()=>{"use strict";gr=16,gf=40;mn=-1});function D(t,e,n){let o=t&&typeof t=="object"&&(t.options||t);o&&o.debug&&(n!==void 0?console.warn("[SnapDOM]",e,n):console.warn("[SnapDOM]",e))}function et(t,e,n,o){let r=t&&t.warnings;r&&r.length{"use strict";yf=50});var _t=ot(()=>{"use strict";qi();Oe();ht();Pt();wt()});function Bt(){Be++}function Xn(t){let e=t&&(t.nodeType===1?t:t.parentElement);for(;e;){if(qt(e))return!0;e.parentElement?e=e.parentElement:e=Dt(e)}return!1}function Kn(t){for(let e of t)if(we(e))return!0;return!1}function we(t){if(Xn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!Xn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!Xn(n)){e=!1;break}}if(e)return!1}return!0}function bs(t){for(let e of t){if(!we(e))continue;let n=e.target.ownerDocument||document;De.set(n,(De.get(n)||0)+1);let o=e.target.nodeType===1?e.target:e.target.parentElement||e.target.host;for(;o;o=o.parentElement||Dt(o))De.set(o,(De.get(o)||0)+1)}}function Sn(t){let e=t.ownerDocument||document;return He(e),(De.get(e)||0)-(De.get(t)||0)}function ze(t=document){return He(t),Nt}function xe(){return He(),Be}function vn(t){return t?(He(t.ownerDocument||document),Jn(t,Mr(t))):0}function Ue(){Bt(),Nt++}function wf(t){be.set(t,++se)}function Cr(t){if(!t||t.nodeType!==1)return;se++,be.set(t,se);let e=t.querySelectorAll("*");for(let n=0;nn?.nodeType===1&&(n.matches?.("style,link")||n.querySelector?.("style,link"));for(let n of t){let o=n.target,r=o&&(o.nodeType===1?o:o.parentElement);if(r&&(r.tagName==="STYLE"||r.tagName==="LINK"))return r.ownerDocument||document;for(let i of n.addedNodes)if(e(i))return i.ownerDocument||document;for(let i of n.removedNodes)if(e(i))return i.ownerDocument||o&&o.ownerDocument||document}return null}function ws(t){if(!Kn(t))return;bs(t),Bt();let e=new Set;for(let n of t){if(!we(n))continue;let o=n.target.getRootNode&&n.target.getRootNode();if(!o||o.nodeType!==11||e.has(o))continue;e.add(o),o.host?Cr(o.host):se++;let r=o.querySelectorAll("*");for(let i=0;i{Kn(r)&&(Bt(),Nt++)},o=()=>{Bt(),Nt++};try{let r=new MutationObserver(xs);r.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),xn.push({o:r,env:!1,doc:t})}catch{}try{let r=new MutationObserver(n);r.observe(t.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),xn.push({o:r,env:!0,doc:t})}catch{}try{e?.addEventListener("resize",o,{passive:!0})}catch{}try{let r=i=>{Bt();let s=i.composedPath?.()[0]||i.target;s&&s.nodeType===1&&!Xn(s)&&Ar(s.ownerDocument||t)?kr(s):ae++};t.addEventListener("focusin",r,{capture:!0,passive:!0}),t.addEventListener("focusout",r,{capture:!0,passive:!0}),t.addEventListener("change",r,{capture:!0,passive:!0}),t.addEventListener("pointerdown",r,{capture:!0,passive:!0}),t.addEventListener("pointerup",r,{capture:!0,passive:!0}),t.addEventListener("pointercancel",r,{capture:!0,passive:!0}),t.addEventListener("keydown",r,{capture:!0,passive:!0}),t.addEventListener("keyup",r,{capture:!0,passive:!0}),t.addEventListener("beforetoggle",r,{capture:!0,passive:!0}),t.addEventListener("toggle",r,{capture:!0,passive:!0}),e?.addEventListener("hashchange",()=>{Bt(),ae++},{passive:!0})}catch{}try{let r=t.fonts;r&&(r.addEventListener?.("loadingdone",o),r.status==="loading"&&r.ready?.then(o).catch(()=>{}))}catch{}}function ds(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let o=us.get(t)||[];if(o.length===n.length&&o.every((i,s)=>i===n[s]))return;if(us.set(t,n),Bt(),t.nodeType===11){t.host?Cr(t.host):se++;for(let i of t.querySelectorAll("*"))be.set(i,se);return}let r=o.filter(i=>!n.includes(i)).concat(n.filter(i=>!o.includes(i)));for(let i of r)if(i.isConnected)if(Ar(e))kr(i);else{ae++;return}}function Qn(t,e=null){if(!t)return;ds(t,t);let n=e||bn.filter(({root:o})=>o.host?.isConnected).map(({root:o})=>o);for(let o of n)ds(o,t)}function zt(){He();try{for(let t=xn.length-1;t>=0;t--){let{o:e,env:n,doc:o}=xn[t];if(o!==document&&!o.defaultView){try{e.disconnect()}catch{}Sr.delete(o),wn===o&&(wn=null),xn.splice(t,1);continue}let r=e.takeRecords();r.length&&(n?Kn(r)&&(Bt(),Nt++):xs(r))}for(let t=bn.length-1;t>=0;t--){let{o:e,root:n}=bn[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}xr.delete(n),bn.splice(t,1);continue}let o=e.takeRecords();o.length&&ws(o)}}catch{}}function Se(t){if(!(!t||t.nodeType!==1)){le.delete(t);try{let e=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();)le.delete(e.currentNode)}catch{}}}function _r(t){let e=le.get(t);if(e&&Zn(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function Ss(t){let e=le.get(t);if(!e||!Zn(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}function vf(t){let e=t.href;return!e||typeof CSSStyleSheet!="function"?null:qn.has(e)?qn.get(e):(qn.set(e,null),dt(e,{as:"text"}).then(n=>{if(!n.ok||typeof n.data!="string"||/@import/i.test(n.data))return;let o=new CSSStyleSheet;o.replaceSync(n.data),qn.set(e,o.cssRules),Bt(),Nt++}).catch(()=>{}),null)}function Ut(t){let e=ps.get(t);if(!e||e.epoch!==Be){let n=e&&e.universe;e={epoch:Be,...os(t,vf)};let o=e.universe;if(n&&o&&n.size===o.size){let r=!0;for(let i of o)if(!n.has(i)){r=!1;break}r&&(e.universe=n)}ps.set(t,e)}return e}function vs(t){return Ut(t).leaksAcrossSubtrees}function Cs(t){try{let e=Ut(t.ownerDocument||document).shareGate;if(e===null)return!1;if(!e.length)return!0;let n=new Set,o=s=>{n.add("t"+s.localName),s.id&&n.add("i"+s.id);let a=s.classList;for(let l=0;l{for(;Kt(a)&&!r.roots.has(a);a=a.host.getRootNode()){r.roots.add(a);for(let l of[...a.styleSheets,...a.adoptedStyleSheets||[]]){let u=hs.get(l);if((!u||u.epoch!==Be)&&hs.set(l,u={epoch:Be,props:es(l)}),!u.props)return!1;for(let c of u.props)r.universe.add(c)}fr(a.getAnimations(),r.universe)}return!0},s=i(e)&&(!t.shadowRoot||i(t.shadowRoot));for(let a=t.assignedSlot;s&&a;a=a.assignedSlot)s=i(a.getRootNode());return s?r.universe:o.__shadowUniverse=null}function Yn(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Ut(e).pseudoUniverse}function ks(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Ut(e).svgGeometry}function Ms(t){let e=Ut(t.ownerDocument||document).svgGeometrySel;if(e==null)return!0;if(!e)return!1;try{return t.matches(e)}catch{return!0}}function ce(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?Mf:Ut(e).pseudoGates}function Af(t,e={},n=null,o=null){let r={},i=e.excludeStyleProps,s=h=>{if(r[h]!==void 0||Le(h)||i&&(i instanceof RegExp&&i.test(h)||typeof i=="function"&&i(h)))return;let m=t.getPropertyValue(h);m&&((h==="background-image"||h==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),r[h]=m)};if(o){for(let m of o)s(m);let h=n&&n.style;if(h&&h.length)for(let m=0;mi==="transparent"||i==="rgba(0, 0, 0, 0)",o=t["-webkit-text-fill-color"];if(!n(o!==void 0?o:t.color))return;let r=Ff(t["background-image"],t["background-color"]);r&&(n(t.color)&&(t.color=r),o!==void 0&&(t["-webkit-text-fill-color"]=r),t["background-image"]="none",t["background-color"]="transparent",delete t["background-clip"],delete t["-webkit-background-clip"],Object.defineProperty(t,"__bgClipTextFix",{value:r,enumerable:!1}))}function _f(t,e,n){let o=n.textShadow;if(!o||o==="none"||!(parseFloat(n.webkitTextStrokeWidth)>0)||t.firstElementChild||n.backgroundImage!=="none"||n.boxShadow!=="none"||As(n.backgroundColor)[3]!==0||["Top","Right","Bottom","Left"].some(u=>parseFloat(n[`border${u}Width`])>0)||o.replace(/\([^)]*\)/g,"").includes(","))return;let r=(o.match(/(?:rgba?|hsla?|color|oklch|oklab|lab|lch)\([^)]*\)|#[\da-f]+|\b[a-z]+\b/i)||[])[0],[i=0,s=0,a=0]=(o.match(/-?[\d.]+px/g)||[]).map(parseFloat);if(!r)return;let l=n.filter&&n.filter!=="none"?`${n.filter} `:"";e.style.setProperty("text-shadow","none","important"),e.style.setProperty("filter",`${l}drop-shadow(${i}px ${s}px ${a/2}px ${r})`,"important")}function As(t){if(!ye){let e=document.createElement("canvas");e.width=e.height=1,ye=e.getContext("2d",{willReadFrequently:!0})}return ye.clearRect(0,0,1,1),ye.fillStyle="transparent",ye.fillStyle=t,ye.fillRect(0,0,1,1),ye.getImageData(0,0,1,1).data}function Ff(t,e){let n=i=>{let s=[];for(let a of(i||"").match(Rf)||[]){let[l,u,c,f]=As(a);f>13&&s.push([l,u,c])}return s},o=n(t);if(o.length||(o=n(e)),!o.length)return null;let r=[0,0,0];for(let[i,s,a]of o)r[0]+=i,r[1]+=s,r[2]+=a;return`rgb(${r.map(i=>Math.round(i/o.length)).join(", ")})`}function Es(t){let e=t.getPropertyValue("background-image");if(e&&e!=="none")return!0;let n=t.getPropertyValue("background-color");if(n&&n!=="rgba(0, 0, 0, 0)"&&n!=="transparent")return!0;for(let r of Sf){let i=t.getPropertyValue(r);if(i&&i!=="none")return!0}let o=t.getPropertyValue("background");return!!(o&&/url\s*\(/i.test(o))}function Tf(t){for(let e=t.firstChild;e;e=e.nextSibling){if(e.nodeType===3&&/\S/.test(e.nodeValue||""))return!0;if(e.nodeType===1){let n=O(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function $f(t,e,n){try{if(typeof t.computedStyleMap=="function"){let r=t.computedStyleMap().get("width");if(r!=null)return!ms(String(r).trim().toLowerCase())}}catch{}let o=t.style&&(t.style.width||t.style.inlineSize);return o&&!ms(String(o).trim().toLowerCase())?!0:Nf(t,e)?n||Lf(t,e):!1}function ms(t){return Pf.has(t)||t.startsWith("fit-content")}function Nf(t,e){let n=t.getBoundingClientRect().width-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)-(parseFloat(e.borderLeftWidth)||0)-(parseFloat(e.borderRightWidth)||0);if(!(n>0))return!1;let o=1/0,r=-1/0,i=null;for(let s=t.firstChild;s;s=s.nextSibling){let a;if(s.nodeType===3){if(!/\S/.test(s.nodeValue||"")||(i=i||document.createRange(),i.selectNode(s),a=i.getBoundingClientRect(),!a.width&&!a.height))continue}else if(s.nodeType===1){let l=O(s);if(l.display==="none"||l.position==="absolute"||l.position==="fixed")continue;a=s.getBoundingClientRect()}else continue;a.leftr&&(r=a.right)}return r===-1/0?!1:r-o0?Math.abs(t.getBoundingClientRect().width-r)>.5:!1}function If(t,e){let n=vr.get(t);if(n)return n;let o=[e];for(let r in t)o.push(r,t[r]);return n=o.join(""),vr.set(t,n),n}function Zn(t,e){return t.env===Nt&&t.stamp===Jn(e,t.hosts)}function Bf(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function zf(t,e){let n=e.ids.get(t);if(n!==void 0)return n;let o=t.parentElement,r;if(!o)r="R";else if(r=e.ids.get(o),r===void 0){if(e.rootSeen)return e.ids.set(t,-1),-1;r="R"}if(e.rootSeen=!0,r===-1)return e.ids.set(t,-1),-1;let i="",s=t.attributes;if(s&&s.length)if(s.length===1)i=s[0].name+"="+s[0].value;else{let l=[];for(let u=0;uu[g])),h&&c.push(""+h),vr.set(u,f.sig+""+c.join("")+("height"in u?"":"")+("block-size"in u?"":"")));let m=Mr(t);return le.set(t,{env:Nt,stamp:Jn(t,m),hosts:m,snapshot:u,embedFonts:s,excludeStyleProps:a}),u}function Hf(t,e){if(t&&t.session&&t.persist)return t;if(t&&(t.styleMap||t.styleCache||t.nodeMap)){let n=t.__ctx;return(!n||t.__ctxOpts!==e)&&(n={session:t,persist:{snapshotKeyCache:br,defaultStyle:j.defaultStyle,baseStyle:j.baseStyle,image:j.image,resource:j.resource,background:j.background},options:e||{}},t.__ctx=n,t.__ctxOpts=e),n}return{session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},persist:{snapshotKeyCache:br,defaultStyle:j.defaultStyle,baseStyle:j.baseStyle,image:j.image,resource:j.resource,background:j.background},options:t||e||{}}}function Gf(t,e,n){if(!t.style||t.style.length===0)return;let o=Cf(t),r=o!=null&&!jf.test(t.getAttribute("style")||""),i;for(let s=0;sf.snapshot[d]===c)||n.borderWidth===c}if(r&&!o.has(a)&&(!l||i)&&!(a.startsWith("background")&&Vf(t)))continue;let u=n.getPropertyValue(a);u&&(!l||u!==t.style.getPropertyValue(a))&&e.style.setProperty(a,u,t.style.getPropertyPriority(a))}}function xt(t,e,n,o){if(t.tagName==="STYLE")return;let r=Hf(n,o),i=r.options&&r.options.cache||"soft";i!=="disabled"&&He(t.ownerDocument),i==="disabled"&&!r.session.__bumpedForDisabled&&(Bt(),br.clear(),r.session.__bumpedForDisabled=!0);let{session:s,persist:a}=r;if(!s.styleCache.has(t)){let y=null;try{y=getComputedStyle(t)}catch{}s.styleCache.set(t,y||getComputedStyle((t.ownerDocument||document).documentElement))}let l=s.styleCache.get(t);t.getAttribute?.("style")&&Gf(t,e,l);let u=l.getPropertyValue("animation-name");e&&e.style&&u&&u!=="none"&&e.style.setProperty("animation","none","important");let c=t.tagName?.toLowerCase()||"div";if(pn.has(c)){let y={};Object.defineProperty(y,"__needsBgInline",{value:Es(l),enumerable:!1});let b=Mr(t);le.set(t,{env:Nt,stamp:Jn(t,b),hosts:b,snapshot:y,embedFonts:!!(r.options&&r.options.embedFonts),excludeStyleProps:r.options&&r.options.excludeStyleProps||null}),s.styleMap.set(e,"");return}let f=null;if(r.options&&r.options.__styleShare&&s.styleMap){let y=Bf(s),b=zf(t,y),w=t.ownerDocument||document,S=w.activeElement;b!==-1&&!Df.has(t.tagName)&&!(S&&S!==w.body&&S!==w.documentElement&&S===t)&&(!t.getRootNode||t.getRootNode()===w)&&!t.shadowRoot&&!t.assignedSlot&&(f={st:y,id:b})}let d=Uf(t,l,r.options,f,s);if(t.getAttribute?.("style"))for(let y of["top","right","bottom","left"]){let b=`margin-${y}`;d[b]==="auto"&&e.style.setProperty(b,"auto","important")}d.__bgClipTextFix&&e&&e.style&&(e.style.setProperty("background-image","none","important"),e.style.setProperty("background-color","transparent","important"),e.style.setProperty("color",d.__bgClipTextFix,"important"),e.style.setProperty("-webkit-text-fill-color",d.__bgClipTextFix,"important"),(s.bgClipText||=[]).push([t,e])),Y()&&_f(t,e,l),qf(t,l,d),e.style?.length&&d["box-sizing"]==="border-box"&&l.getPropertyValue("box-sizing")!=="border-box"&&Jf(t,e,d);let h=Ns(t);if(Zf(t,e,d,h,s),h){let y=l.getPropertyValue("min-width");if(!y||y==="auto"||y==="0px"){d["min-width"]="0px";let b=l.getPropertyValue("overflow-x"),w=t.parentElement;if(y==="auto"&&(b==="visible"||b==="clip")&&w&&O(w).display.includes("flex")){let S=s.flexOverflow||(s.flexOverflow=new WeakMap),v=S.get(w);if(v===void 0){if(v=w.scrollWidth>w.clientWidth,!v){let C=O(w),M=E=>parseFloat(C.getPropertyValue(E))||0,F=M("width")-(C.boxSizing==="border-box"?M("padding-left")+M("padding-right")+M("border-left-width")+M("border-right-width"):0),A=C.flexDirection.startsWith("row")===(C.writingMode==="horizontal-tb")&&C.flexWrap==="nowrap",x=0,_=0;for(let E of w.children){s.styleCache.has(E)||s.styleCache.set(E,getComputedStyle(E));let $=s.styleCache.get(E);if($.display==="none"||$.position==="absolute"||$.position==="fixed")continue;let R=k=>parseFloat($.getPropertyValue(k))||0,W=R("width")+R("margin-left")+R("margin-right")+($.boxSizing==="border-box"?0:R("padding-left")+R("padding-right")+R("border-left-width")+R("border-right-width"));x=A?x+W:Math.max(x,W),_++}v=x+(A?Math.max(0,_-1)*M("column-gap"):0)>F+_/60}S.set(w,v)}v&&(d["min-width"]=d.width)}}}let m=If(d,c),g=!0;if(Vn(c,(d.display||"").toLowerCase())){g=Tf(t),g&&pr(c,d,h)&&$f(t,l,h)&&(g=!1),m=`${m}${g?"|c":""}${h?"|f":""}`;let y=d["text-wrap-mode"]||d["white-space"]||"";g&&y!=="nowrap"&&y!=="pre"&&(s.reconcileRisk=(s.reconcileRisk||0)+1)}let p=a.snapshotKeyCache.get(m);p===void 0&&(p=Ie(d,c,g,h),a.snapshotKeyCache.size>=bf&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(m,p)),s.styleMap.set(e,p)}function qf(t,e,n){let o=e.getPropertyValue("overflow-x"),r=e.getPropertyValue("overflow-y");if((o==="visible"||!o)&&(r==="visible"||!r)||e.getPropertyValue("box-sizing")==="border-box"||typeof t.clientWidth!="number"||!t.offsetWidth)return;let i=u=>parseFloat(u)||0,s=t.offsetWidth-t.clientWidth-i(e.getPropertyValue("border-left-width"))-i(e.getPropertyValue("border-right-width")),a=t.offsetHeight-t.clientHeight-i(e.getPropertyValue("border-top-width"))-i(e.getPropertyValue("border-bottom-width")),l=(u,c)=>{let f=n[u];if(!f||!f.endsWith("px"))return;let d=parseFloat(f);Number.isFinite(d)&&(n[u]=`${Math.round((d+c)*1e3)/1e3}px`)};s>=2&&(l("width",s),l("inline-size",s)),a>=2&&(l("height",a),l("block-size",a))}function Xf(t,e,n){if(!Fs.some(l=>n[l]?.includes("."))||e.getPropertyValue("box-sizing")==="border-box"||n.display==="inline")return"";for(let l of["width","height"]){let u=n[`min-${l}`],c=n[`max-${l}`];if(u&&u!=="0px"&&u!=="auto"||c&&c!=="none")return""}let o=l=>parseFloat(n[l])||0,r=o("padding-left")+o("padding-right")+o("border-left-width")+o("border-right-width"),i=o("padding-top")+o("padding-bottom")+o("border-top-width")+o("border-bottom-width"),s=(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb";for(let l of Ts){let u=n[l];if(!u||!u.endsWith("px"))continue;let f=l==="width"||l==="inline-size"&&!s||l==="block-size"&&s?r:i;n[l]=`${Math.round((parseFloat(u)+f)*1e3)/1e3}px`}n["box-sizing"]="border-box";let a="";if(e.getPropertyValue("overflow-x")==="auto"){let l=t.scrollWidth<=t.clientWidth;n["overflow-x"]=l?"hidden":"auto",l&&(a+="x")}if(e.getPropertyValue("overflow-y")==="auto"){let l=t.scrollHeight<=t.clientHeight;n["overflow-y"]=l?"hidden":"auto",l&&(a+="y")}return a}function Jf(t,e,n){if(Kf.test(t.getAttribute("style")))for(let o of Yf)e.style.getPropertyValue(o)&&n[o]&&e.style.setProperty(o,n[o],e.style.getPropertyPriority(o))}function Qf(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 Zf(t,e,n,o,r){let i=n.display||"";if(!o&&!i.startsWith("inline-")&&(n.float||"none")==="none"&&n.position!=="absolute"&&n.position!=="fixed")return;let s=n["text-wrap-mode"]||n["white-space"]||"";if(s==="nowrap"||s==="pre"||gs==="white-space"&&s!=="normal"||(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb"||!e.style)return;let a=r.__oneLine||=new WeakSet;for(let l=t.parentElement;l;l=l.parentElement)if(a.has(l))return;tu(t,n,r)&&(a.add(t),e.style.setProperty(gs,"nowrap"))}function tu(t,e,n){let o=t.clientHeight-(parseFloat(e["padding-top"])||0)-(parseFloat(e["padding-bottom"])||0);if(o>3*(parseFloat(e["font-size"])||16)||e["word-break"]==="normal"&&e["overflow-wrap"]==="normal"&&/^[\w\u00C0-\u024F.,:;!?'"()%]*$/.test(t.textContent.trim()))return!1;let r=t.ownerDocument||document,i=r.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),s=r.createRange(),a=null,l=0,u=0;for(let d=i.nextNode();d;d=i.nextNode()){if(d.nodeType===1){if(d.shadowRoot||d.localName==="br"||d.localName==="textarea")return!1;continue}if(/\S/.test(d.data)){if(++u>64)return!1;s.selectNodeContents(d);for(let h of s.getClientRects())if(h.height){if(a||=h,Math.min(a.bottom,h.bottom)-Math.max(a.top,h.top)2||(delete n.height,delete n["block-size"])}var le,fs,br,bf,Be,De,Nt,be,se,ae,wr,xr,bn,Sr,wn,xn,us,Sf,ps,qn,hs,Mf,Rf,ye,Pf,vr,Wf,Of,Df,jf,Vf,Fs,Ts,Yf,Kf,gs,eu,ys,$s,Rt=ot(()=>{"use strict";_t();ht();Mt();jn();At();ge();le=new WeakMap,fs=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],br=new Map,bf=2e3,Be=0;De=new WeakMap;Nt=0;be=new WeakMap,se=0,ae=0;wr=new WeakMap;xr=new WeakSet,bn=[];Sr=new WeakSet,wn=null,xn=[];us=new WeakMap;Sf=["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"];ps=new WeakMap,qn=new Map;hs=new WeakMap;Mf={before:null,after:null,firstLetter:null,marker:null,firstLine:null};Rf=/(?:rgba?|hsla?|oklch|oklab|lab|lch|color)\([^()]*\)/g;Pf=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);vr=new WeakMap;Wf=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,Of=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,Df=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);jf=/%|[\d.](?:em|rem|ex|ch|cap|ic|lh|rlh|v[whib]|vmin|vmax|cq[whbi]|cqmin|cqmax)\b|\b(?:calc|var|min|max|clamp|env|attr)\(|\b(?:auto|inherit|initial|unset|revert|currentcolor|-webkit-fill-available|fit-content|min-content|max-content)\b/i,Vf=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";Fs=["border-top-width","border-right-width","border-bottom-width","border-left-width"],Ts=["width","inline-size","height","block-size"];Yf=["box-sizing",...Ts,"overflow-x","overflow-y"],Kf=/(?:box-sizing|width|height|inline-size|block-size|overflow(?:-[xy])?)\s*:/i;gs=typeof CSS<"u"&&CSS.supports?.("text-wrap-mode","nowrap")?"text-wrap-mode":"white-space";eu=0,ys=1,$s=2});function jr(t){return Va(t.boxShadow)}function Vr(t){return Va(t.textShadow)}function Va(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",o=0;for(let l=0;lparseFloat(p))||[];if(u.length<2)continue;let[c,f,d=0,h=0]=u,m=Math.abs(c)+d+h,g=Math.abs(f)+d+h;i=Math.max(i,m+Math.max(c,0)),a=Math.max(a,m+Math.max(-c,0)),s=Math.max(s,g+Math.max(f,0)),r=Math.max(r,g+Math.max(-f,0))}return{top:Math.ceil(r),right:Math.ceil(i),bottom:Math.ceil(s),left:Math.ceil(a)}}function Gr(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,o=0,r;for(;r=n.exec(e);)o+=parseFloat(r[1])||0;let i=Math.ceil(o*2);return{top:i,right:i,bottom:i,left:i}}function qr(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,o=e+Math.max(0,Math.ceil(n));return{top:o,right:o,bottom:o,left:o}}function Xr(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],o=0,r=0,i=0,s=0,a=!1;for(let l of n){a=!0;let u=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(g=>parseFloat(g))||[],[c=0,f=0,d=0]=u,h=Math.abs(c)+d,m=Math.abs(f)+d;r=Math.max(r,h+Math.max(c,0)),s=Math.max(s,h+Math.max(-c,0)),i=Math.max(i,m+Math.max(f,0)),o=Math.max(o,m+Math.max(-f,0))}return{bleed:{top:H(o),right:H(r),bottom:H(i),left:H(s)},has:a}}function zd(t){let e=jr(t),n=Vr(t),o=Gr(t),r=qr(t),i=Xr(t);return{top:Math.max(e.top,n.top)+o.top+r.top+i.bleed.top,right:Math.max(e.right,n.right)+o.right+r.right+i.bleed.right,bottom:Math.max(e.bottom,n.bottom)+o.bottom+r.bottom+i.bleed.bottom,left:Math.max(e.left,n.left)+o.left+r.left+i.bleed.left}}function Ud(t){return t.boxShadow&&t.boxShadow!=="none"||t.textShadow&&t.textShadow!=="none"||(t.outlineStyle||"none")!=="none"||t.filter&&t.filter!=="none"?!0:!!t.webkitFilter&&t.webkitFilter!=="none"}function ja(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",o=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:o||e!=="visible",y:o||n!=="visible"}}function Yr(t,e,n,o=1,r=1){let i=0,s=0,a=0,l=0,u=ja(n.get(t)||O(t));if(u.x&&u.y)return{top:0,right:0,bottom:0,left:0};let c=t.getBoundingClientRect();for(let f of e.values()){if(f===t||f.nodeType!==1||f.ownerDocument!==t.ownerDocument)continue;let d=n.get(f);if(!d||!Ud(d))continue;let h=zd(d);if(!(h.top||h.right||h.bottom||h.left))continue;let m=f.getBoundingClientRect(),g={left:m.left-h.left/o,top:m.top-h.top/r,right:m.right+h.right/o,bottom:m.bottom+h.bottom/r};for(let p=f.parentElement;p;p=p.parentElement){let y=ja(n.get(p)||O(p));if(y.x||y.y){let b=p.getBoundingClientRect();y.x&&(g.left=Math.max(g.left,b.left),g.right=Math.min(g.right,b.right)),y.y&&(g.top=Math.max(g.top,b.top),g.bottom=Math.min(g.bottom,b.bottom))}if(p===t)break}u.x||(l=Math.max(l,(c.left-g.left)*o),s=Math.max(s,(g.right-c.right)*o)),u.y||(i=Math.max(i,(c.top-g.top)*r),a=Math.max(a,(g.bottom-c.bottom)*r))}return{top:Math.max(0,Math.ceil(i)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(l))}}function Ga(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let o=n.transform||"none";if(!o||o==="none"){let l=null;try{l=Ce(t).scale}catch{}try{e.style.transform="none"}catch{}if(!l)return{a:1,b:0,c:0,d:1};let u=ue({scale:l});return{a:u.a,b:u.b,c:u.c,d:u.d}}function r(l,u,c,f){let d=Math.sqrt(l*l+u*u)||0,h=0,m=0;if(d>0){let g=l/d,p=u/d;h=g*c+p*f;let y=c-g*h,b=f-p*h;m=Math.sqrt(y*y+b*b)||0,m>0?h=h/m:h=0}return{a:d,b:0,c:h*m,d:m}}let i=l=>{let u=Ce(t).scale;if(!u)return l;let c=ue({scale:u,baseTransform:`matrix(${l.a},${l.b},${l.c},${l.d},0,0)`});return{a:c.a,b:c.b,c:c.c,d:c.d}},s=o.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let l=s[1].split(",").map(u=>parseFloat(u.trim()));if(l.length===6&&l.every(Number.isFinite)){let[u,c,f,d]=l,h=r(u,c,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return i(h)}}let a=o.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let l=a[1].split(",").map(u=>parseFloat(u.trim()));if(l.length===16&&l.every(Number.isFinite)){let u=l[0],c=l[1],f=l[4],d=l[5],h=r(u,c,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return i(h)}}try{let l=new DOMMatrix(o),u=r(l.a,l.b,l.c,l.d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return i(u)}catch{return null}}function Ke(t,e,n,o,r){let i=n.a,s=n.b,a=n.c,l=n.d,u=n.e||0,c=n.f||0;function f(y,b){let w=y-o,S=b-r,v=i*w+a*S,C=s*w+l*S;return v+=o+u,C+=r+c,[v,C]}let d=[f(0,0),f(t,0),f(0,e),f(t,e)],h=1/0,m=1/0,g=-1/0,p=-1/0;for(let[y,b]of d)yg&&(g=y),b>p&&(p=b);return{minX:h,minY:m,maxX:g,maxY:p,width:g-h,height:p-m}}function Fn(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[r,i]=[o[0]||"0",o[1]||"0"],s=(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:s(r,e),oy:s(i,n)}}function Ce(t){let e={rotate:"0deg",scale:null,translate:null},n=null;try{n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null}catch{}if(n){let r=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},i=r("rotate");if(i)if(i.angle){let l=i.angle;e.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.unit,i.is2D===!1&&i.x&&i.y&&i.z&&(e.rotate=`${i.x.value} ${i.y.value} ${i.z.value} ${e.rotate}`)}else i.unit?e.rotate=i.unit==="rad"?i.value*180/Math.PI+"deg":i.value+i.unit:e.rotate=String(i);else{let l=getComputedStyle(t);e.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let s=r("scale");if(s){let l=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[l(s.x),l(s.y)??l(s.x),...s.is2D===!1?[l(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(l).join(" "):e.scale=String(s)}else{let l=getComputedStyle(t);e.scale=l.scale&&l.scale!=="none"?l.scale:null}let a=r("translate");if(a){let l=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":u.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[l(a.x),l(a.y)??"0px",...a.is2D===!1?[l(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(l).join(" "):e.translate=String(a)}else{let l=getComputedStyle(t);e.translate=l.translate&&l.translate!=="none"?l.translate:null}return(!e.rotate||e.rotate==="none")&&(e.rotate="0deg"),(!e.scale||e.scale==="none")&&(e.scale=null),(!e.translate||e.translate==="none")&&(e.translate=null),e}let o=getComputedStyle(t);return e.rotate=o.rotate&&o.rotate!=="none"?o.rotate:"0deg",e.scale=o.scale&&o.scale!=="none"?o.scale:null,e.translate=o.translate&&o.translate!=="none"?o.translate:null,e}function Hd(){if(Hr?.isConnected)return Hr;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Q(t),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),Hr=t,t}function ue(t){let e=i=>{let s=[],a=0,l=0,u=String(i).trim();for(let c=0;cl&&s.push(u.slice(l,c)),l=c+1);return li&&i!=="none",o=[];if(n(t.translate)){let i=e(t.translate);for(let s=0;s<2&&s2?`translate3d(${i.join(",")})`:`translate(${i.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let i=e(t.rotate);i.length===4?o.push(`rotate3d(${i.join(",")})`):i.length===2&&/^[xyz]$/i.test(i[0])?o.push(`rotate${i[0].toUpperCase()}(${i[1]})`):o.push(`rotate(${i.join(" ")})`)}if(n(t.scale)){let i=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);o.push(i.length>2?`scale3d(${i.join(",")})`:`scale(${i.join(",")})`)}if(n(t.baseTransform)&&o.push(t.baseTransform),!o.length)return new DOMMatrix;let r=o.join(" ");try{if(r.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(r)}catch{let i=Hd(),s=document.createElement("div");if(s.style.cssText="all:initial!important;display:block!important;transform-origin:0 0!important",s.style.setProperty("width",`${Number.isFinite(t.width)?t.width:0}px`,"important"),s.style.setProperty("height",`${Number.isFinite(t.height)?t.height:0}px`,"important"),s.style.setProperty("transform",r,"important"),!s.style.transform)throw new Error("[SnapDOM] Couldn't read the transform of an element.");i.appendChild(s);try{return jd(s)}finally{s.remove()}}}function qa(t){let e=O(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",i=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(r||i||s)}function jd(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var Hr,Tn=ot(()=>{"use strict";ke();Oe();At();Hr=null});function vo(t,e){if(!e)return null;let n=t.ownerDocument||document,o=n.defaultView||window,r,i,s,a;if(e==="viewport")r=0,i=0,s=n.documentElement?.clientWidth||o.innerWidth,a=n.documentElement?.clientHeight||o.innerHeight;else if(typeof e=="object")r=(Number(e.x)||0)-(o.scrollX||0),i=(Number(e.y)||0)-(o.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:r,top:i,width:s,height:a,right:r+s,bottom:i+a}:null}function $n(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return Kt(e)?e.host:null}function Vd(t,e){for(let n=e;n;n=$n(n))if(n===t)return!0;return!1}function Gd(t,e){for(let n=$n(t);n&&n!==e&&n?.nodeType===1;n=$n(n)){let o=O(n);if(o.position!=="static"||Kr(o))return n}return null}function Kr(t){return t.transform&&t.transform!=="none"||t.filter&&t.filter!=="none"||t.backdropFilter&&t.backdropFilter!=="none"||t.perspective&&t.perspective!=="none"||/transform|perspective|filter/.test(t.willChange||"")||/layout|paint|strict|content/.test(t.contain||"")}function Ja(t,e,n,o,r,i){if(t.scrollTop||t.scrollLeft)return;let s=o.get(t)||O(t);if(Kr(s))return;let a=s.position!=="static",l=new Map;for(let[u,c]of e){let f=n.get(u);if(!f)continue;let d=l.get(f);if(d===void 0&&l.set(f,d=qd.exec(f)?.[1]||""),!d||d==="absolute"&&a||Qr.has(u))continue;let h=!1;for(let y=$n(c);y&&y!==t&&y.nodeType===1;y=$n(y)){let b=o.get(y)||O(y);if(d==="absolute"&&b.position!=="static"||Kr(b)){h=!0;break}}if(h)continue;let m=o.get(c)||O(c),g=parseFloat(m.left),p=parseFloat(m.top);r&&Number.isFinite(g)&&(u.style.left=`${g+r}px`),i&&Number.isFinite(p)&&(u.style.top=`${p+i}px`)}}function Zr(t,e){try{return ue({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function Qa(t,e,n,o,r){let i=t.getBoundingClientRect();Tt(e)&&O(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,l]of n){if(l?.nodeType!==1)continue;let u=a.localName==="svg"&&$t(a)&&!$t(l.parentNode);if(!Tt(a)&&!u||l===t||!Vd(t,l))continue;let c=o.get(l)||O(l),f=c.position;if(f!=="fixed"&&f!=="sticky"&&f!=="-webkit-sticky"||a.style.position==="absolute")continue;let d=l.getBoundingClientRect();if(!(d.width>0&&d.height>0))continue;Qr.add(a);let h=c.transform&&c.transform!=="none"?c.transform:"",m=Ce(l),g=!!(h||m.rotate!=="0deg"||m.scale||m.translate),p=g?Zr(h,m):null,y=!p||!p.is2D||p.a===1&&p.b===0&&p.c===0&&p.d===1,b=d.width,w=d.height;y||(b=l.offsetWidth||d.width,w=l.offsetHeight||d.height);let S=l.getRootNode&&Kt(l.getRootNode()),v=i,C=t.clientLeft||0,M=t.clientTop||0;if(S){let _=Gd(l,t);_&&(v=_.getBoundingClientRect(),C=_.clientLeft||0,M=_.clientTop||0)}let F=d.left-v.left-C,T=d.top-v.top-M;if(g)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",y)a.style.transform="none";else{a.style.transform=`matrix(${p.a},${p.b},${p.c},${p.d},0,0)`;let{ox:_,oy:E}=Fn(c,b,w),$=Ke(b,w,{a:p.a,b:p.b,c:p.c,d:p.d,e:0,f:0},_,E);F-=$.minX,T-=$.minY}if(f!=="fixed"){let _=a.cloneNode(!1);_.setAttribute("data-snap-ph","1"),_.style.position="static",_.style.visibility="hidden",_.style.width=`${b}px`,_.style.height=`${w}px`,_.style.boxSizing="border-box",a.parentElement?.insertBefore(_,a)}let A=u?b:b+2,x=w;r&&(Math.abs(T-r.y)<.5&&(T-=1,x+=1),Math.abs(F-r.x)<.5&&(F-=1,A+=1)),a.style.position="absolute",a.style.left=`${F}px`,a.style.top=`${T}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${A}px`,a.style.height=`${x}px`,a.style.boxSizing="border-box",S||s.push(a)}for(let a of s)e.appendChild(a)}function Za(t,e,n={}){if(!t||!e||!e.style)return;let o=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){D(n,"Couldn't remove the root box-shadow.",s)}try{e.style.textShadow="none"}catch(s){D(n,"Couldn't remove the root text-shadow.",s)}try{e.style.outline="none"}catch(s){D(n,"Couldn't remove the root outline.",s)}let i=(o.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=i.length?i:"none"}catch(s){D(n,"Couldn't remove the root drop-shadow filter.",s)}}function tl(t,e){if(!t||!e||!e.style)return;let n=1;try{n=parseFloat(getComputedStyle(t).zoom)}catch{return}if(!(!e.style.getPropertyValue("zoom")&&(!Number.isFinite(n)||n===1)))try{e.style.setProperty("zoom","1","important")}catch{}}function Xa(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",o=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||o!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function el(t,e){let n=Array.from(t.childNodes),o=e==="top"?n:n.reverse();for(let r of o){if(r.nodeType===Node.TEXT_NODE){if(/\S/.test(r.textContent||""))return null;continue}if(r.nodeType!==Node.ELEMENT_NODE)continue;let i=getComputedStyle(r),s=String(i.display||"");if(s!=="none"){if(s==="contents"){let a=el(r,e);if(a!==void 0)return a;continue}if(!(i.position==="absolute"||i.position==="fixed"))return i.float&&i.float!=="none"||s.startsWith("inline")?null:r}}}function nl(t,e,n,o=null){if(!t||!e||!e.style)return;let r=getComputedStyle(t);if(!Xa(r))for(let i of["top","bottom"]){let s=i==="top"?"Top":"Bottom";if((parseFloat(r[`border${s}Width`])||0)>0||(parseFloat(r[`padding${s}`])||0)>0)continue;let a=t,l=e;for(;a&&l;){let u=el(a,i);if(!u)break;let c=n?Array.from(l.children).find(h=>n.get(h)===u)||o?.get(u)||null:l.children[Array.from(a.children).indexOf(u)]||null,f=getComputedStyle(u),d=parseFloat(f[`margin${s}`])||0;if(c&&c.style&&d>0&&(c.style[`margin${s}`]="0px"),Xa(f)||(parseFloat(f[`border${s}Width`])||0)>0||(parseFloat(f[`padding${s}`])||0)>0)break;a=u,l=c}}}function Yd(t,e){if(t.startsWith("*")||t==="xmlns"||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!Xd.has(n))return!0}return e?t.startsWith("x-")||t.startsWith("v-")||t.startsWith(":")||t.startsWith("on:")||t.startsWith("bind:")||t.startsWith("let:")||t.startsWith("class:"):!1}function Co(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,o=a=>{for(let l of Array.from(a.attributes)){if(Yd(l.name,n)){a.removeAttribute(l.name);continue}if(Jd.test(l.value))continue;let u=Ya(l.value);if(u!==l.value)try{a.setAttribute(l.name,u)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&o(t);let r=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=i.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)o(s);else if(s.nodeType===Node.COMMENT_NODE)r.push(s);else{let a=Ya(s.data);a!==s.data&&(s.data=a)}for(let a of r)a.remove()}function Qd(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function tp(t){return $t(t)||Zd.has(t?.localName)}function ep(t,e){if(t?.nodeType!==1||Qd(t)||tp(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let o=e.display||"";return!(o.includes("flex")||o.includes("grid")||o.startsWith("table")||e.transform&&e.transform!=="none")}function ol(t,e,n=new Map,o=null){function r(i,s){if(i?.nodeType!==1||s?.nodeType!==1)return;let a=i.childElementCount>s.childElementCount,l=n.get(i)||getComputedStyle(i);if(n.has(i)||n.set(i,l),a&&ep(i,l)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let c=l.overflowY||l.overflowBlock||"visible",f=l.overflowX||l.overflowInline||"visible";(c!=="visible"||f!=="visible")&&(s.style.overflow="visible")}let u=Array.from(s.children);if(o)for(let c of u){let f=o.get(c);f&&f.nodeType===1&&r(f,c)}else{let c=Array.from(i.children);for(let f=0;fi&&(i=p),s=!0)}let l=s?Math.max(0,i-r):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}function ei(t){let e=document.implementation.createHTMLDocument(""),n=e.importNode(t,!0);for(let o of[n,...n.querySelectorAll("*")]){let r=o.localName.includes("-");if(!Tt(o)||!(r||o.hasAttribute("is")))continue;let i=e.createElement(r?"span":o.localName);for(let s of o.attributes)s.name!=="is"&&i.setAttribute(s.name,s.value);i.append(...o.childNodes),o===n?n=i:o.replaceWith(i)}return n}function Pn(t,e){try{let n=new t.ownerDocument.defaultView.CSSStyleSheet;n.replaceSync(e),t.adoptedStyleSheets=[n]}catch{let n=t.ownerDocument.createElement("style");n.textContent=e,t.appendChild(n)}}function rl(t,e,n,o,r,i){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),l=r>0&&a.width>0?a.width/r:1,u=i>0&&a.height>0?a.height/i:1;if(Math.abs(l-u)>.02)return 0;let c=s.createElement("div");Q(c),c.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+r+"px!important;overflow:visible!important;visibility:hidden!important;";let f=c.attachShadow({mode:"open"});Pn(f,n);let d=ei(e);f.appendChild(d),s.body.appendChild(c);let h=0,m=["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],g=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"],p=(y,b,w)=>{let S=O(y),v=S.boxSizing==="border-box",C=(M,F,T)=>{let A=parseFloat(M);if(!Number.isFinite(A))return F;let x=0;if(!v)for(let E of T)x+=parseFloat(S[E])||0;let _=A+x;return Math.abs(_-F)<=.51?_:F};return{width:C(S.width,b,m),height:C(S.height,w,g)}};try{let y=d.getBoundingClientRect(),b=d.offsetWidth||r,w=d.offsetHeight||i,S=b>0&&y.width>0?y.width/b:1,v=w>0&&y.height>0?y.height/w:1,C=(M,F,T=!1)=>{let A=M.children,x=F.children,_=Math.min(A.length,x.length);for(let E=0;E<_;E++){let $=A[E],R=x[E],W=o.get($),k=T||Qr.has($);if(W?.nodeType===1&&Tt($)&&$.style&&W.isConnected){let I=W.getBoundingClientRect();if(I.width>0&&I.height>0){let L=R.getBoundingClientRect(),P=I.width/l,N=I.height/u,B=L.width,U=L.height,V=W.offsetWidth||P,z=W.offsetHeight||N,at=R.offsetWidth||B,rt=R.offsetHeight||U,pt=Math.abs(P-V)>Je||Math.abs(N-z)>Je||Math.abs(B-at)>Je||Math.abs(U-rt)>Je;if(k){let lt=p(R,at,rt);P=B>0?P*S*lt.width/B:P,N=U>0?N*v*lt.height/U:N,B=lt.width,U=lt.height}else if(pt){let lt=p(W,V,z),Yt=p(R,at,rt);P=lt.width,N=lt.height,B=Yt.width,U=Yt.height}let kt=B-P,he=U-N;(Math.abs(kt)>Je||Math.abs(he)>Je)&&($.style.boxSizing="border-box",$.style.width=`${H(P)}px`,$.style.height=`${H(N)}px`,h++)}}C($,R,k)}};C(e,d)}finally{c.remove()}return h}function Jr(t,e=new Set){let n="";if(!t)return n;for(let o=0;o`${a*f/100}px`),u=parseFloat(i==="x"?n.width:n.height);e.style.setProperty(r,Number.isFinite(u)?`${r.slice(0,3)}(${l}, ${u}px)`:l)}}function lp(t,e){let n=t.ownerDocument,o=n.documentElement,r={w:o.clientWidth,h:o.clientHeight};if(e.position==="fixed")return r;if(e.position==="absolute"){let l=t.offsetParent;return!l||(l===n.body||l===o)&&getComputedStyle(l).position==="static"?r:{w:l.clientWidth,h:l.clientHeight}}let i=t.parentElement;if(!i)return r;let s=getComputedStyle(i),a=l=>parseFloat(s.getPropertyValue(l))||0;return{w:i.clientWidth-a("padding-left")-a("padding-right"),h:i.clientHeight-a("padding-top")-a("padding-bottom")}}var Qr,qd,Xd,Kd,Ya,Jd,Zd,H,Je,rp,Ka,ap,ke=ot(()=>{"use strict";_t();Mt();Rt();At();Tn();Qr=new WeakSet;qd=/(?:^|;)position:(absolute|fixed)(?:;|$)/;Xd=new Set(["xml","xlink"]);Kd=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,Ya=t=>t.replace(Kd,e=>e.length===2?e:""),Jd=/^data:[^,]{0,120};base64,/;Zd=new Set(["img","canvas","video","iframe","object","embed"]);H=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t;Je=.75;rp=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;Ka=new WeakMap;ap=[["max-width","x"],["min-width","x"],["max-height","y"],["min-height","y"]]});var Fl={};oe(Fl,{detectDrawApi:()=>Rl,tryCanvasEngine:()=>fh});function Rl(){try{let t=document.createElement("canvas").getContext("2d");if(t&&typeof t.drawElementImage=="function")return"drawElementImage"}catch{}return null}function ch(t,e,n,o){let r=document.createElement("canvas");r.setAttribute("layoutsubtree",""),r.setAttribute("content","drawable"),Q(r),r.style.cssText="position:fixed;top:0;left:0;z-index:-2147483647;pointer-events:none";let i=document.createElement("div");i.setAttribute("drawable",""),i.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${n}px;height:${o}px`;let s=i.attachShadow({mode:"open"});return Pn(s,e),s.appendChild(t),r.appendChild(i),{canvas:r,wrapper:i}}async function fh(t,e){let n=Rl();if(!n)return null;let o=t.element,r=t.clone;if(!o||!r)return null;let i=o.ownerDocument||document;if(!o.isConnected||i!==document||o===i.body||o===i.documentElement||o.scrollTop||o.scrollLeft||e.outerShadows||e.clip||e.excludeMode==="remove"||typeof e.filter=="function"&&e.filterMode==="remove"||e.width!=null||e.height!=null)return null;try{for(let v=o;v;v=v.assignedSlot||v.parentElement||v.getRootNode?.().host){let C=getComputedStyle(v);if(C.transform&&C.transform!=="none"||C.rotate&&C.rotate!=="none"||C.scale&&C.scale!=="none"||C.translate&&C.translate!=="none"||v===o&&C.filter&&C.filter!=="none")return null;let M=C.getPropertyValue("zoom");if(M&&Number.isFinite(parseFloat(M))&&Math.abs(parseFloat(M)-1)>1e-4)return null}}catch{return null}let s=o.getBoundingClientRect(),a=Math.max(1,s.width||o.offsetWidth||1),l=Math.max(1,s.height||o.offsetHeight||1),u=o.offsetWidth||Math.ceil(a),c=o.offsetHeight||Math.ceil(l),f=Number.isFinite(e.scale)&&e.scale>0?e.scale:1,d=Number.isFinite(e.dpr)&&e.dpr>0?e.dpr:window.devicePixelRatio||1,h=Math.max(1,Math.round(u*f*d)),m=Math.max(1,Math.round(c*f*d)),g=(t.scrollbarCSS||"")+(t.baseCSS||"")+(t.fontsCSS||"")+(t.classCSS||""),{canvas:p,wrapper:y}=ch(r,g,a,l);p.width=h,p.height=m,document.body.appendChild(p);let b;try{p.getBoundingClientRect(),await new Promise(T=>{requestAnimationFrame(()=>setTimeout(T,0)),setTimeout(T,50)});let v=p.getContext("2d"),C=v&&v[n];if(typeof C!="function")return null;v.save(),v.scale(d*f,d*f),C.call(v,y,0,0,a,l),v.restore();let M;try{M=v.getImageData(0,0,Math.min(64,h),Math.min(64,m)).data}catch{return D(e,`html-in-canvas: ${n} tainted the canvas; used the SVG engine.`),null}let F=!1;for(let T=3;T0){F=!0;break}if(!F){let T=v.getImageData(0,0,h,m).data,A=!1;for(let x=3;x0){A=!0;break}if(!A)return null}b=document.createElement("canvas"),b.width=h,b.height=m,b.getContext("2d").drawImage(p,0,0),b.style.width=`${u*f}px`,b.style.height=`${c*f}px`}catch(v){return D(e,"html-in-canvas: the browser couldn't paint it; used the SVG engine.",v),null}finally{try{p.remove()}catch{}}let w=Object.freeze({w0:a,h0:l,vbW:u,vbH:c,targetW:a,targetH:l,contentX:0,contentY:0,clip:null});Object.defineProperty(e,"meta",{value:w,enumerable:!0,writable:!1,configurable:!0}),e.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},t.clone=t.nodeMap=t.styleCache=t.svgString=null;let S=[...document.querySelectorAll("#snapdom-sandbox")].find(qt);return S&&S.style.position==="absolute"&&S.remove(),b}var Tl=ot(()=>{"use strict";wt();At();ke()});var fc={};oe(fc,{MAX_RASTER_AREA:()=>pe,MAX_RASTER_SIDE:()=>jt,WEBP_MAX_SIDE:()=>_i,__setDecodeFrameIdleMs:()=>Gh,cropSvgText:()=>Xo,decodeSvgFromDataURL:()=>Ee,encodeSvgToDataURL:()=>_e,fixSafariShadows:()=>Ko,peekSvgHeader:()=>Yo,toCanvas:()=>Zt});function Lh(t,e){let n=e.__session;try{let o=t.match(/]*>/i);if(!o)return t;let r=o[0],i=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),s=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(s)||i<=0||s<=0)return t;let a=Math.min(1,jt/i,jt/s,Math.sqrt(pe/(i*s)));if(a>=1)return t;let l=Math.max(1,Math.floor(i*a)),u=Math.max(1,Math.floor(s*a));return et(n,"raster-clamp",`capture ${Math.round(i)}x${Math.round(s)}px exceeds decode limits; downscaled to ${l}x${u}px`),D(e,`${Math.round(i)}\xD7${Math.round(s)}px is too large for the browser to draw; scaled down to ${l}\xD7${u}px. For full size, export ${typeof CompressionStream=="function"?"a PNG or JPEG":"a JPEG"} blob, an SVG, or crop.`),t.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${l}`).replace(/(\bheight=")[\d.]+/i,`$1${u}`))}catch{return t}}function Xo(t,e,{shiftContent:n=Y()}={}){let o=["x","y","width","height"].map(T=>Number(e?.[T]));if(!o.every(Number.isFinite)||o[2]<=0||o[3]<=0)throw new RangeError("[SnapDOM] crop needs finite x/y and a positive width/height.");let r=t.match(/]*>/i);if(!r)throw new Error("[SnapDOM] Only SVG captures can be cropped.");let i=r[0],s=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],a=String(s||"").trim().split(/[\s,]+/).map(Number);if(a.length!==4||!a.every(Number.isFinite)||a[2]<=0||a[3]<=0)throw new Error("[SnapDOM] Can't crop: the SVG has no valid viewBox.");let[l,u,c,f]=a,d=Math.max(l,o[0]),h=Math.max(u,o[1]),m=Math.min(l+c,o[0]+o[2]),g=Math.min(u+f,o[1]+o[3]);if(!(m>d)||!(g>h))throw new RangeError("[SnapDOM] The crop area does not intersect the capture.");let p=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),y=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),b=Number.isFinite(p)&&p>0?p/c:1,w=Number.isFinite(y)&&y>0?y/f:1,S=Math.max(1,(m-d)*b),v=Math.max(1,(g-h)*w),C=i.replace(/(\bwidth=")[^"]*/i,`$1${S}`).replace(/(\bheight=")[^"]*/i,`$1${v}`),M=n?Ih(t,i,d,h):null;if(M)return C.replace(/(\bviewBox=")[^"]*/i,(A,x)=>`${x}0 0 ${m-d} ${g-h}`)+M.slice(i.length);let F=C.replace(/(\bviewBox=")[^"]*/i,`$1${d} ${h} ${m-d} ${g-h}`);return t.replace(i,F)}function Ih(t,e,n,o){if(!t.startsWith(e))return null;let r=/^\s*]*>/i.exec(t.slice(e.length,e.length+2048));if(!r)return null;let i=r[0],s=(u,c,f)=>{let d=new RegExp(`(\\s${c}=")([^"]*)`),h=u.match(d),m=h?parseFloat(h[2]):0;return Number.isFinite(m)?h?u.replace(d,(g,p)=>`${p}${m-f}`):u.replace(/^(\s*`${p} ${c}="${-f}"`):null},a=s(i,"x",n),l=a&&s(a,"y",o);return l?e+l+t.slice(e.length+i.length):null}function ki(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function Ee(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function Yo(t){let e=t.indexOf(",");if(e<0)return"";let n=t.slice(e+1,e+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(n)}catch{return""}}function _e(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function sc(t){let e=[],n="",o=0;for(let r=0;rr.trim()).filter(Boolean)}function Wh(t){let e=[],n="",o=0;for(let i=0;i`${a}:${l}`).join(";")}function Oh(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${ac(o)}}`)}function Dh(t){return t=t.replace(/]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Oh(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${ac(o)}${n}`),t}function Bh(){return jo||(jo=(async()=>{try{let t='
',e=new Image;e.decoding="sync",e.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await e.decode();let n=document.createElement("canvas");n.width=8,n.height=20;let o=n.getContext("2d",{willReadFrequently:!0});o.drawImage(e,0,0);let r=o.getImageData(2,18,1,1).data[3]>128,i=o.getImageData(2,2,1,1).data[3]>128;return{native:r||i,flippedY:i&&!r}}catch{return{native:!1,flippedY:!1}}})(),jo)}function zh(t){let e=[],n=0,o=0;for(let r=0;r{let i=0,s=0,a="",l=0;for(;lsc(o).map(r=>{let i=r.indexOf(":");if(i<0)return r;let s=r.slice(0,i).trim().toLowerCase();return s==="text-shadow"||e&&s==="box-shadow"?`${s}:${zh(r.slice(i+1))}`:r}).join(";");return t=t.replace(/]*>([\s\S]*?)<\/style>/gi,(o,r)=>o.replace(r,r.replace(/([^{}]+)\{([^}]*)\}/g,(i,s,a)=>`${s}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(o,r,i)=>`style=${r}${n(i)}${r}`),t}async function Ko(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:o}=await Bh();try{let r=t;return n||(r=Dh(r)),o&&(r=Uh(r,n)),{svg:r,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function Hh(t,e,n){let o=t.naturalWidth,r=t.naturalHeight,i=Math.min(8,r),s=document.createElement("canvas");s.width=Math.max(1,Math.ceil(o*e)),s.height=Math.max(1,Math.ceil(i*6*n));let a=s.getContext("2d",{willReadFrequently:!0});return!a||!(o>0&&r>0)?null:()=>{a.clearRect(0,0,s.width,s.height);for(let f=0;f<6;f++){let d=Math.floor((r-i)*f/5);a.drawImage(t,0,d,o,i,0,f*i*n,o*e,i*n)}let l=a.getImageData(0,0,s.width,s.height).data,u=!1,c=0;for(let f=3;f0&&(u=!0),c=c*31+l[f-3]+l[f-2]*7+l[f-1]*13+l[f]|0;return{ink:u,sig:c}}}async function jh(t,e,n){Q(t),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{if(!n)return await Vo(),await Vo(),!1;let o=performance.now()+(e?600:150),r=null;for(;;){let i;try{i=n()}catch{return!1}if(i.ink&&(!e||i.sig===r))return!0;if(r=i.sig,performance.now()>o)return i.ink;await Vo()}}finally{try{t.remove()}catch{}}}function qo(){clearTimeout(Ri),de?.remove(),de=null,Go=0}function Gh(t){cc=t??lc}function rc(t){if(typeof document>"u"||!document.body)return new Image;if(clearTimeout(Ri),de&&!de.contentDocument&&qo(),de&&Go>Vh&&Wn===0&&qo(),!de){let n=document.createElement("iframe");Q(n),n.setAttribute("aria-hidden","true"),n.style.cssText="position:absolute;left:-9999px;top:0;width:0;height:0;border:0;visibility:hidden;pointer-events:none";try{document.body.appendChild(n)}catch{}if(n.contentDocument)de=n,Go=0;else{try{n.remove()}catch{}return new Image}}Go+=t.length,Wn+=1;let e=de.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function Ai(t,e=!1){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,Wn=Math.max(0,Wn-1),e&&(Mi=!0),!(Wn>0)&&(Mi?(Mi=!1,qo()):Ri=setTimeout(qo,cc)))}function ic(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function Jh(t){if(typeof t!="string")return!1;let e=t.indexOf(",")+1,n=Math.max(48,Math.floor((t.length-e)/200)),o=0,r=0;for(let i=e;i+48<=t.length;i+=n){let s=t.slice(i,i+48);o++,Kh.some(a=>s.includes(a))||r++}return r*2>o}function Ei(t,e,n,o,r){if(!e.naturalWidth){t.drawImage(e,0,0,n,o);return}let i=n*o,s=i>qh&&!Jh(r)?Math.min(Yh,Math.ceil(i/Xh)):1;if(s===1){t.drawImage(e,0,0,n,o);return}let a=e.naturalWidth,l=e.naturalHeight/o;for(let u=0;u]*>/i)||[])[0]||"",g=parseFloat((m.match(/\bwidth="([\d.]+)/i)||[])[1]),p=parseFloat((m.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(g)&&Number.isFinite(p)&&g>0&&p>0&&Math.min(1,jt/g,jt/p,Math.sqrt(pe/(g*p)))<1;if(l||y||Y())try{let b=Ee(t);if(l&&(b=Xo(b,l)),Y()){let w=await Ko(b);b=w.svg,f=w.naturalOnly,d=/@font-face|data:image\//i.test(b)}(y||l)&&(b=Lh(b,e)),c=_e(b)}catch(b){if(l)throw b;c=t}}let h=u||rc(c);try{u||await ic(h,c)}catch(m){if(!h.__snapdomDecodeFrame)throw m;let g=h;h=rc(c),Ai(g);try{await ic(h,c)}catch(p){throw Ai(h,e.__releaseDecodeFrame),p}}try{!u&&!Y()&&ki(c)&&(Et()?/.data(?:%3A|:)image(?:%2F|\/)svg/i:/(?:%40|@)font-face/i).test(c)&&await new Promise(N=>{let B=new MessageChannel;B.port1.onmessage=()=>{B.port1.close(),B.port2.close(),N()},B.port2.postMessage(0)});let m=u?u.width:h.naturalWidth,g=u?u.height:h.naturalHeight,p=l?m:Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:m,y=l?g:Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:g,b,w,S=Number.isFinite(n),v=Number.isFinite(o);if(S&&v)b=Math.max(1,n),w=Math.max(1,o);else if(S){let N=n/Math.max(1,p);b=n,w=y*N}else if(v){let N=o/Math.max(1,y);w=o,b=p*N}else{let N=u&&Number.isFinite(s.vbW)&&Number.isFinite(s.vbH);b=N?s.vbW:m,w=N?s.vbH:g}!S&&!v&&(b=b*r,w=w*r);let C=b*i,M=w*i,F=Math.max(C/jt,M/jt,Math.sqrt(C*M/pe)),T=e.__encodeFormat==="webp"?Math.max(C,M)/_i:0,A=Math.max(F,T);if(A>1){let N=F<=1;et(e.__session,"canvas-clamp",`output ${Math.round(C)}x${Math.round(M)}px exceeds ${N?"WebP":"canvas"} limits; downscaled`),D(e,N?`${Math.round(C)}\xD7${Math.round(M)}px is larger than WebP can encode (${_i}px per side); scaled down. For full size, export a PNG, an SVG, or crop.`:`${Math.round(C)}\xD7${Math.round(M)}px is larger than a canvas allows; scaled down. For full size, export ${typeof CompressionStream=="function"?"a PNG or JPEG":"a JPEG"} blob, an SVG, or crop.`),b/=A,w/=A}let x=Tt(e.canvas)&&ct(e.canvas,"canvas")?e.canvas:document.createElement("canvas");x.width=Math.max(1,b*i),x.height=Math.max(1,w*i),x.style.width=`${b}px`,x.style.height=`${w}px`;let _=x.getContext("2d");if(!_)throw new Error("[SnapDOM] The canvas you passed has no 2D context (is it already used for WebGL?).");let E=null,$=e.__layoutZoom||1;if(!u&&Et()){let N=$*p/(b*i),B=Math.round(b*i*N),U=Math.round(w*i*N);N>1.01&&B<=jt&&U<=jt&&B*U<=pe&&(E={w:B,h:U})}let R=f&&(Math.round(b*i)!==m||Math.round(w*i)!==g),W=R?m:E?E.w:b*i,k=R?g:E?E.h:w*i,I=Y()&&!u?Hh(h,W/Math.max(1,m),k/Math.max(1,g)):null,L=!1;I&&(L=await jh(h,d,I));let P=()=>{if(_.save(),i!==1&&_.scale(i,i),a&&(_.save(),_.fillStyle=a,_.fillRect(0,0,b,w),_.restore()),R){let N=document.createElement("canvas");N.width=m,N.height=g,Ei(N.getContext("2d"),h,m,g,c),_.drawImage(N,0,0,b,w)}else{if(_.save(),_.setTransform(1,0,0,1,0,0),E){let N=document.createElement("canvas");for(N.width=E.w,N.height=E.h,Ei(N.getContext("2d"),h,E.w,E.h,c);N.width>b*i*2;){let B=document.createElement("canvas");B.width=Math.ceil(N.width/2),B.height=Math.ceil(N.height/2),B.getContext("2d").drawImage(N,0,0,B.width,B.height),N=B}_.imageSmoothingQuality="high",_.drawImage(N,0,0,b*i,w*i)}else Ei(_,h,b*i,w*i,c);_.restore()}_.restore()};if(P(),I&&L&&d){let N=!0;try{N=I().ink}catch{}if(!N){let B=performance.now()+600;do{await Vo();try{N=I().ink}catch{break}}while(!N&&performance.now(){"use strict";ht();wt();Pt();At();jt=Y()?16384:32767,pe=16384*16384,_i=16383;jo=null;Vo=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});Vh=24*1024*1024,lc=5e3,de=null,Go=0,Wn=0,Mi=!1,cc=lc,Ri=0;qh=4e6,Xh=2e6,Yh=8,Kh=["%3C","%3E","%20","%7B","%7D","%3B"]});var On={};oe(On,{rasterize:()=>Fi});async function Fi(t,e){let n=await Zt(t,{...e,__encodeFormat:e.format}),i=n.width*n.height<=2e6?n.toDataURL(`image/${e.format}`,e.quality):await new Promise(a=>{let l=()=>a(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(u=>{if(!u)return l();let c=new FileReader;c.onload=()=>a(String(c.result||"")),c.onerror=l,c.readAsDataURL(u)},`image/${e.format}`,e.quality)}catch{l()}}),s=new Image;return s.src=i,Y()?await s.decode():await new Promise((a,l)=>{if(s.complete&&s.naturalWidth)return a();s.onload=a,s.onerror=l}),s.style.width=`${n.width/e.dpr}px`,s.style.height=`${n.height/e.dpr}px`,s}var an=ot(()=>{"use strict";Re();ht()});var Ti={};oe(Ti,{toImg:()=>Qh,toSvg:()=>Qh});async function Qh(t,e){let{scale:n=1,width:o,height:r,meta:i={}}=e,s=Number.isFinite(o),a=Number.isFinite(r),l=Number.isFinite(n)&&n!==1||s||a;if(Y()&&l)try{let{svg:d}=await Ko(Ee(t)),h=(d.match(/]*>/i)||[])[0]||"",m=parseFloat((h.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((h.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(m)||!Number.isFinite(g))throw new Error("The SVG has no size.");let p=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:m,y=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:g,b,w;s&&a?(b=o,w=r):s?(b=o,w=Math.max(1,Math.round(y*(o/Math.max(1,p))))):a?(w=r,b=Math.max(1,Math.round(p*(r/Math.max(1,y))))):(b=Math.max(1,Math.round(m*n)),w=Math.max(1,Math.round(g*n)));let S=d.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${w}"`),v=new Image;return v.decoding="sync",v.loading="eager",v.src=_e(S),await v.decode(),v.style.width=`${b}px`,v.style.height=`${w}px`,v}catch(d){return et(e.__session,"safari-png-fallback","Safari vector toImg failed; using PNG",d),D(e,"Safari couldn't show the SVG; used a PNG.",d),Fi(t,{...e,format:"png",quality:1,meta:i})}let u=t,c=!1;if(!s&&!a&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let d=Ee(t),h=(d.match(/]*>/i)||[])[0]||"",m=Number((h.match(/\bwidth="([\d.]+)"/i)||[])[1]),g=Number((h.match(/\bheight="([\d.]+)"/i)||[])[1]);if(m>0&&g>0){let p=h.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(m*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(g*n))}"`);u=_e(d.replace(h,p)),c=!0}}catch{}let f=new Image;f.decoding="sync",f.loading="eager",f.src=u;try{await f.decode()}catch(d){if(!c)throw d;f.src=t,c=!1,await f.decode()}if(s&&a)f.style.width=`${o}px`,f.style.height=`${r}px`;else if(s){let d=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:f.naturalWidth,h=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:f.naturalHeight,m=o/Math.max(1,d);f.style.width=`${o}px`,f.style.height=`${Math.max(1,Math.round(h*m))}px`}else if(a){let d=Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:f.naturalWidth,h=Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:f.naturalHeight,m=r/Math.max(1,h);f.style.height=`${r}px`,f.style.width=`${Math.max(1,Math.round(d*m))}px`}else{let d=Math.max(1,Math.round(f.naturalWidth*(c?1:n))),h=Math.max(1,Math.round(f.naturalHeight*(c?1:n)));if(f.style.width=`${d}px`,f.style.height=`${h}px`,!c&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let g=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${d}"`).replace(/height="[^"]*"/,`height="${h}"`);f.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,await f.decode()}catch(m){D(e,"Couldn't size the SVG image.",m),f.src!==t&&(f.src=t,await f.decode().catch(()=>{}))}}return f}var $i=ot(()=>{"use strict";_t();wt();an();Re()});var dc={};oe(dc,{encodePng:()=>Zh});function Jo(t,e=new Uint8Array(0)){let n=new Uint8Array(e.length+12),o=new DataView(n.buffer);o.setUint32(0,e.length);for(let i=0;i<4;i++)n[i+4]=t.charCodeAt(i);n.set(e,8);let r=4294967295;for(let i=4;i>>8;return o.setUint32(n.length-4,(r^4294967295)>>>0),n}async function Zh(t,e,n){if(![t,e].every(g=>Number.isInteger(g)&&g>0&&g<=2147483647))throw new RangeError("[SnapDOM] PNG dimensions must be integers from 1 to 2147483647");let o=new Uint8Array(13),r=new DataView(o.buffer);r.setUint32(0,t),r.setUint32(4,e),o[8]=8,o[9]=6;let i=[new Uint8Array([137,80,78,71,13,10,26,10]),Jo("IHDR",o),Jo("sRGB",new Uint8Array([0]))],s=t*4,a=Math.max(1,Math.floor(65536/(s+1))),l=new Uint8Array(s),u=0,c=new CompressionStream("deflate"),f=c.writable.getWriter(),d=c.readable.getReader(),h,m=(async()=>{try{for(;;){let{done:g,value:p}=await d.read();if(g)return;i.push(Jo("IDAT",p))}}catch(g){h=g,await f.abort(g).catch(()=>{})}})();try{for await(let g of n){if(!(g instanceof Uint8Array||g instanceof Uint8ClampedArray)||!g.length||g.length%s)throw new RangeError("[SnapDOM] PNG input must contain complete RGBA rows");let p=g.length/s;if(u+p>e)throw new RangeError("[SnapDOM] PNG input exceeds the declared height");for(let y=0;y{"use strict";uc=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;uc[t]=e}});var Sc={};oe(Sc,{encodeJpeg:()=>om});function gc(t){let e=[0,240];for(let n=0;n<16;n++)for(let o=1;o<=10;o++)e.push(n<<4|o);return t.concat(e.filter(n=>!t.includes(n)).sort((n,o)=>n-o))}function nm(t){for(let e=0;e<64;e+=8)wc(t,e,1);for(let e=0;e<8;e++)wc(t,e,8)}function wc(t,e,n){let o=t[e]+t[e+7*n],r=t[e]-t[e+7*n],i=t[e+n]+t[e+6*n],s=t[e+n]-t[e+6*n],a=t[e+2*n]+t[e+5*n],l=t[e+2*n]-t[e+5*n],u=t[e+3*n]+t[e+4*n],c=t[e+3*n]-t[e+4*n],f=o+u,d=o-u,h=i+a,m=i-a;t[e]=f+h,t[e+4*n]=f-h;let g=(m+d)*.707106781;t[e+2*n]=d+g,t[e+6*n]=d-g,f=c+l,h=l+s,m=s+r;let p=(f-m)*.382683433,y=.5411961*f+p,b=1.306562965*m+p,w=h*.707106781,S=r+w,v=r-w;t[e+5*n]=v+y,t[e+3*n]=v-y,t[e+n]=S+b,t[e+7*n]=S-b}async function om(t,e,n,o){if(![t,e].every(R=>Number.isInteger(R)&&R>0&&R<=65535))throw new RangeError("[SnapDOM] JPEG dimensions must be integers from 1 to 65535");let r=Math.min(100,Math.max(1,Math.round((typeof o=="number"&&o>=0&&o<=1?o:.92)*100))),i=r<50?5e3/r:200-r*2,s=r<90?1:0,a=8<{let k=new Uint8Array(64),I=new Float32Array(64);for(let L=0;L<64;L++){let P=Math.min(255,Math.max(1,Math.floor((R[L]*i+50)/100)));k[hc[L]]=P,I[L]=1/(P*mc[L>>3]*mc[L&7]*8)}return l.push(...W?[1]:[],...k),I}),c=(R,W)=>[255,R,W.length+2>>8,W.length+2&255,...W],f=[255,216,...c(224,[74,70,73,70,0,1,1,0,0,1,0,1,0,0]),...c(219,l),...c(192,[8,e>>8,e&255,t>>8,t&255,3,1,s?34:17,0,2,17,1,3,17,1]),...c(196,xc.flatMap(([R,,W,k])=>[R,...W,...k])),...c(218,[3,1,0,2,17,3,17,0,63,0])],d=[new Uint8Array(f)],h=new Uint8Array(65536),m=0,g=0,p=0;function y(R,W){for(g=g<=8;){p-=8;let k=g>>>p&255;m>=h.length-1&&(d.push(h.subarray(0,m)),h=new Uint8Array(65536),m=0),h[m++]=k,k===255&&(h[m++]=0)}g&=(1<15;B-=16)y(L[240][0],L[240][1]);N=32-Math.clz32(Math.abs(P));let V=L[B<<4|N];y(V[0],V[1]),y((P<0?P-1:P)&(1<>s)*8+(L>>s);T[V]+=(-.168736*N-.331264*B+.5*U)*x,A[V]+=(.5*N-.418688*B-.081312*U)*x}}for(let k=0;k<(s?4:1);k++){let I=(k>>1)*128+(k&1)*8;for(let L=0;L<64;L++)b[L]=F[I+(L>>3)*a+(L&7)];v(0,0)}b.set(T),v(1,1),b.set(A),v(2,1)}}let E=0,$=0;for await(let R of n){if(!(R instanceof Uint8Array||R instanceof Uint8ClampedArray)||!R.length||R.length%C)throw new RangeError("[SnapDOM] JPEG input must contain complete RGBA rows");let W=R.length/C;if(E+W>e)throw new RangeError("[SnapDOM] JPEG input exceeds the declared height");for(let k=0;k{"use strict";hc=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],tm=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],em=Array.from({length:64},(t,e)=>(e&7)<4&&e<32?[17,18,24,47,18,21,26,66,24,26,56,99,47,66,99,99][(e>>3)*4+(e&7)]:99),mc=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379];yc=[0,1,2,3,4,5,6,7,8,9,10,11],xc=[[0,0,[0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],yc],[16,0,[0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],gc([1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130])],[1,1,[0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],yc],[17,1,[0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],gc([0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241])]],bc=xc.map(([,,t,e])=>{let n=[],o=0,r=0;for(let i=1;i<=16;i++,o<<=1)for(let s=0;s]*>/i)?.[0];if(!o)return null;let r=e.crop?Xo(o,e.crop):o,i=parseFloat(r.match(/\bwidth="([^"]+)/i)?.[1]),s=parseFloat(r.match(/\bheight="([^"]+)/i)?.[1]),a=(r.match(/\bviewBox="([^"]+)/i)?.[1]||"").trim().split(/[\s,]+/).map(Number);if(!(i>0&&s>0)||a.length!==4||!a.every(Number.isFinite)||!(a[2]>0&&a[3]>0))return null;let l=Number.isFinite(e.width),u=Number.isFinite(e.height),c=e.meta||{},f=Math.max(1,Math.floor(i)),d=Math.max(1,Math.floor(s)),h=e.crop?f:Number.isFinite(c.vbW)?c.vbW:Number.isFinite(c.w0)?c.w0:f,m=e.crop?d:Number.isFinite(c.vbH)?c.vbH:Number.isFinite(c.h0)?c.h0:d,g=e.dpr??1,p=e.scale??1,y=(l&&u?Math.max(1,e.width):l?e.width:u?e.height*h/Math.max(1,m):f*p)*g,b=(l&&u?Math.max(1,e.height):u?e.height:l?e.width*m/Math.max(1,h):d*p)*g;if(Math.max(i,s,y,b)<=jt&&i*s<=pe&&y*b<=pe||(n==="png"?typeof CompressionStream!="function":Math.max(y,b)>=65536))return null;return w();async function w(){let S=Math.max(1,Math.floor(y)),v=Math.max(1,Math.floor(b)),C=Ee(t),M=C.slice(C.indexOf(o)+o.length,C.lastIndexOf("")),F=r.match(/\bpreserveAspectRatio="([^"]*)"/i)?.[1]||"xMidYMid meet",T=i/a[2],A=s/a[3],x=0,_=0;/\bnone\b/.test(F)||(T=A=/\bslice\b/.test(F)?Math.max(T,A):Math.min(T,A),x=(i-a[2]*T)*(/xMin/.test(F)?0:/xMax/.test(F)?1:.5),_=(s-a[3]*A)*(/YMin/.test(F)?0:/YMax/.test(F)?1:.5)),x-=a[0]*T,_-=a[1]*A;let E=r.replace(/\s(?:width|height|preserveAspectRatio)="[^"]*"/gi,"").slice(0,-1),$=Y()&&/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(C),R=i/y,W=s/b,k=Math.max(1,Math.min(8192,Math.floor(4*1024*1024/S),$?Math.floor(2046/W):8192)),I=Math.max(1,Math.min(8192,S,$?Math.floor(2046/R):8192));async function*L(){for(let P=0;P${M}`,X=await Zt(_e(q),{width:rt,height:pt,dpr:1,backgroundColor:$?null:e.backgroundColor,__session:e.__session,__releaseDecodeFrame:!0}),G=X;try{if($){G=document.createElement("canvas"),G.width=V,G.height=N;let nt=G.getContext("2d");e.backgroundColor&&(nt.fillStyle=e.backgroundColor,nt.fillRect(0,0,V,N)),nt.drawImage(X,U*R-z,P*W-at,V*R,N*W,0,0,V,N)}let mt=G.getContext("2d").getImageData(0,0,V,N).data;for(let nt=0;nt(pc(),dc))).encodePng(S,v,L()):(await Promise.resolve().then(()=>(vc(),Sc))).encodeJpeg(S,v,L(),e.quality)}}var Pi=ot(()=>{"use strict";Re();ht()});var Cc={};oe(Cc,{toBlob:()=>Ni});async function Ni(t,e){let n=e.format||e.type||"svg";if(n==="svg"){if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)throw new Error("[SnapDOM] html-in-canvas makes a raster capture, not an SVG; ask for png, jpeg or webp.");let s=decodeURIComponent(t.split(",")[1]);return new Blob([s],{type:"image/svg+xml"})}let o=n==="jpg"?"jpeg":n,r=(o==="png"||o==="jpeg")&&Qo(t,e,o);if(r)return r;let i=await Zt(t,{...e,__encodeFormat:o});return new Promise(s=>i.toBlob(a=>s(a),`image/${o}`,e.quality))}var Li=ot(()=>{"use strict";Re();Pi()});var Mc={};oe(Mc,{download:()=>rm});async function kc(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(o){if(o.name!=="AbortError")return!1}return!0}async function rm(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),o=(e?.type||"").toLowerCase(),r=n.has(o)?o:"",i=(e?.format||r||"").toLowerCase(),s=i==="jpg"?"jpeg":i||"png",a=e?.filename||"snapdom",l=/\.(png|jpe?g|webp|svg)$/i.test(a)?a:`${a}.${s}`,u={...e||{},format:s,type:s};u.dpr=1;let c=yn(),f=(s==="png"||s==="jpeg")&&Qo(t,u,s);if(s==="svg"||f){let m=f?await f:await Ni(t,{...u,type:"svg"});if(c&&await kc(m,l))return;let g=URL.createObjectURL(m),p=document.createElement("a");p.href=g,p.download=l,document.body.appendChild(p),p.click(),setTimeout(()=>URL.revokeObjectURL(g),1e3),p.remove();return}let d=await Zt(t,{...u,__encodeFormat:s});if(c){let m=`image/${s}`,g=await new Promise(p=>d.toBlob(p,m,e?.quality));if(g&&await kc(g,l))return}let h=document.createElement("a");h.href=d.toDataURL(`image/${s}`,e?.quality),h.download=l,document.body.appendChild(h),h.click(),h.remove()}var Ac=ot(()=>{"use strict";Li();Re();Pi();ht()});_t();Rt();Oe();Rt();var iu=new Set(["symbol","defs"]),su=new Set(["mask","clipPath","linearGradient","radialGradient","pattern","marker","filter"]),Rr=new WeakMap,Ls=-1;function to(t){let e=xe();return e!==Ls&&(Rr=new WeakMap,Ls=e),Is(t)}function Is(t){let e=Rr.get(t);if(e!==void 0)return e;let n;if(t.namespaceURI==="http://www.w3.org/2000/svg"&&(su.has(t.localName)?n=!1:iu.has(t.localName)&&(n=!0)),n===void 0){let o=t.parentNode;n=!!(o&&o.nodeType===1)&&Is(o)}return Rr.set(t,n),n}function Ws(t,e){if(t?.nodeType!==1||e?.nodeType!==1||to(t))return;let n=t.getAttribute?.("style"),o=!!(n&&n.includes("var("));if(!o&&t.attributes?.length){let i=t.attributes;for(let s=0;si.d-s.d);let r=window.devicePixelRatio||1;return(o.find(i=>i.d>=r)||o[o.length-1]).url}function Os(t,e){let n=t.currentSrc||"";if(n&&!je(n))return n;let o=e.querySelectorAll("source[srcset]"),r=null;for(let i of o){let s=i.getAttribute("srcset");if(!s||je(s))continue;let a=i.getAttribute("type");if(a&&!nr.test(a.trim()))continue;let l=i.getAttribute("media");if(l)try{if(window.matchMedia(l).matches)return Ve(s,t)}catch{}r||(r=Ve(s,t))}return r}function Ds(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let o of e)if(o&&!je(o))return o;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let o=n.split(",")[0].trim().split(/\s+/)[0];if(o&&!je(o))return o}return null}At();ht();function au(t,e){if(t=t.trim(),!t)return t;let n=e?`[data-sd-slotted~="${e}"]`:"[data-sd-slotted]";return t.endsWith(":not([data-sd-slotted])")||t.endsWith(`:not(${n})`)?t:`${t}:not(${n})`}var lu=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,cu=/^::?(?:before|after|first-letter)$/;function fu(t,e,n=!0,o){return Hn(t,",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")&&r.includes("data-sd")||r.startsWith("@"))return r;let i=r.match(lu);if(i&&cu.test(i[0]))return":not(*)";let s=i?r.slice(0,i.index).trim():r,a=n?au(s,o):s;return`:where(${e} ${a})${i?i[0]:""}`}).join(", ")}function Hs(t,e,n){return t?(t=t.replace(/:host-context\(([^)]+)\)/g,(o,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/:host\(([^)]+)\)/g,(o,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(o,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(o,r,i,s)=>{let a=fu(s,e,!0,n);return`${r}${i}${a}{`}),t):""}function js(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function ve(t){let e="";for(let n of t)if(n.media&&n.cssRules){let o=!1;try{o=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}o&&(e+=ve(n.cssRules))}else if(n.constructor?.name==="CSSSupportsRule")e+=`@supports ${n.conditionText}{${ve(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let o=n.cssText.slice(0,n.cssText.indexOf("{")+1);e+=o+(n.style?n.style.cssText:"")+ve(n.cssRules)+"}"}else e+=n.cssText+` -`;return e}function Vs(t){let e="";try{t.querySelectorAll("style").forEach(o=>{let r=null;try{r=o.sheet&&o.sheet.cssRules}catch{}e+=(r?ve(r):o.textContent||"")+` -`});let n=t.adoptedStyleSheets||[];for(let o of n)try{o&&o.cssRules&&(e+=ve(o.cssRules))}catch{}}catch{}return e}function Gs(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function qs(t,e,n={}){try{let o=null,r=O(t).content;if(r&&r.includes("url(")){let u=r.match(/url\(["']?([^"')]+)["']?\)/);u&&(o=u[1])}let i=t.closest?.("picture"),s=t.getAttribute("src")||"",a=t.getAttribute("srcset")||"",l=o||(i?Os(t,i):!a.trim()&&s.startsWith("data:")?s:t.currentSrc)||Ve(a,t)||t.src||"";if((!l||je(l))&&n.resolvePicturePlaceholders!==!1){let u=Ds(t);u&&(l=u)}if(!l)return;e.getAttribute("src")!==l&&e.setAttribute("src",l),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function Xs(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function uu(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch{}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch{}return""}function Ys(t,e,n){let o=[];for(let r of e){let i=uu(t,r);i&&o.push(`${r}: ${i};`)}return o.length?`${n}{${o.join("")}} -`:""}function Ks(t,e){if(!t)return;let n=o=>{let r=o.getAttribute("data-sd-slotted")||"";e?` ${r} `.includes(` ${e} `)||o.setAttribute("data-sd-slotted",r?`${r} ${e}`:e):o.setAttribute("data-sd-slotted",r)};t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll?.("*").forEach(n)}async function du(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},o=n(),r=0;for(;rsetTimeout(i,0)),o=n(),r++;return o&&(o.body||o.documentElement)?o:null}function pu(t){let e=t.getBoundingClientRect(),n=0,o=0,r=0,i=0;try{let l=getComputedStyle(t);n=parseFloat(l.borderLeftWidth)||0,o=parseFloat(l.borderRightWidth)||0,r=parseFloat(l.borderTopWidth)||0,i=parseFloat(l.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+o))),a=Math.max(0,Math.round(e.height-(r+i)));return{contentWidth:s,contentHeight:a,rect:e}}function Ft(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 o=getComputedStyle(t);if(e===0){let r=parseFloat(o.width);!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(o.height);!isNaN(r)&&r>0&&(n=r)}}catch{}if(e===0||n===0)try{if(e===0){let o=parseFloat(t.getAttribute("width"));!isNaN(o)&&o>0&&(e=o)}if(n===0){let o=parseFloat(t.getAttribute("height"));!isNaN(o)&&o>0&&(n=o)}}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}}var Bs=new WeakMap;function hu(t,e,n){let o=t.defaultView,r=o?o.scrollX:0,i=o?o.scrollY:0,s=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=0,f=0,d=0,h=0;try{let p=o&&t.body?o.getComputedStyle(t.body):null;p&&(c=(parseFloat(p.marginTop)||0)+(parseFloat(p.paddingTop)||0),f=(parseFloat(p.marginRight)||0)+(parseFloat(p.paddingRight)||0),d=(parseFloat(p.marginBottom)||0)+(parseFloat(p.paddingBottom)||0),h=(parseFloat(p.marginLeft)||0)+(parseFloat(p.paddingLeft)||0))}catch{}let m=`html {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;}body {margin: 0 !important;padding: ${c}px ${f}px ${d}px ${h}px !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;}`,g;try{let p=Bs.get(t);p||Bs.set(t,p=new o.CSSStyleSheet),p.replaceSync(m),t.adoptedStyleSheets=[...t.adoptedStyleSheets,p],g=()=>{t.adoptedStyleSheets=t.adoptedStyleSheets.filter(y=>y!==p)}}catch{let p=t.createElement("style");p.setAttribute("data-sd-iframe-pin",""),Q(p),p.textContent=m,(t.head||t.documentElement).appendChild(p),g=()=>p.remove()}if(Se(t.documentElement),r||i)try{t.body&&(t.body.scrollLeft=r,t.body.scrollTop=i),t.documentElement&&(t.documentElement.scrollLeft||(t.documentElement.scrollLeft=r),t.documentElement.scrollTop||(t.documentElement.scrollTop=i))}catch{}return()=>{try{g()}catch{}try{o&&typeof o.scrollTo=="function"&&o.scrollTo(r,i),t.body&&(t.body.scrollLeft=s,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=l,t.documentElement.scrollTop=u)}catch{}Se(t.documentElement)}}async function Fr(t,e,n){let o=await du(t,3);if(!o)throw new Error("The iframe document isn't ready.");let{contentWidth:r,contentHeight:i,rect:s}=pu(t),a=n?.snap;if(!a||typeof a.toPng!="function")throw new Error("Iframes are only captured through snapdom(el).");let l={...n,scale:1,clip:null,__pinned:!0},u=hu(o,r,i),c;try{c=await a.toPng(o.documentElement,l)}finally{u()}c.style.display="block",c.style.width=`${r}px`,c.style.height=`${i}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),xt(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(s.width)}px`),f.style.height||(f.style.height=`${Math.round(s.height)}px`),f.appendChild(c),f}function Js(t){try{let e=t&&t.accentColor;if(e&&e!=="auto"&&e!=="none")return e;let n=t&&t.color;if(n)return n}catch{}return"#0a6ed1"}function Qs(t){let{width:e,height:n}=Ft(t),o=t.getBoundingClientRect(),r;try{r=window.getComputedStyle(t)}catch{}let i=r?parseFloat(r.width):NaN,s=r?parseFloat(r.height):NaN,a=Number.isFinite(i)&&i>0?i:e||o.width||128,l=Number.isFinite(s)&&s>0?s:n||o.height||16,u=Number.parseFloat(t.min)||0,c=Number.isFinite(Number.parseFloat(t.max))?Number.parseFloat(t.max):100,f=Number.parseFloat(t.value),d=c-u,h=d>0&&Number.isFinite(f)?Math.min(1,Math.max(0,(f-u)/d)):.5,m="middle";try{r&&r.verticalAlign&&(m=r.verticalAlign)}catch{}let g=document.createElement("div");g.setAttribute("data-snapdom-input-replacement","range"),g.style.cssText=`display:inline-block;width:${a}px;height:${l}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("width",String(a)),p.setAttribute("height",String(l)),p.setAttribute("viewBox",`0 0 ${a} ${l}`),p.style.cssText=`width:${a}px;height:${l}px;overflow:visible`,g.appendChild(p);function y(){let b=Js(r),w=!!t.disabled,S=Math.max(2,Math.min(4,l)),v=(l-S)/2,C=Math.max(10,Math.min(14,Math.max(l,10))),M=C/2,F=M+h*Math.max(0,a-C);p.innerHTML="";let T=(x,_,E,$)=>{let R=document.createElementNS("http://www.w3.org/2000/svg","rect");R.setAttribute("x",String(x)),R.setAttribute("y",String(v)),R.setAttribute("width",String(Math.max(0,_))),R.setAttribute("height",String(S)),R.setAttribute("rx",String(S/2)),R.setAttribute("fill",E),$&&R.setAttribute("fill-opacity",$),p.appendChild(R)};T(0,a,"#808080","0.4"),T(0,F,b);let A=document.createElementNS("http://www.w3.org/2000/svg","circle");A.setAttribute("cx",String(F)),A.setAttribute("cy",String(l/2)),A.setAttribute("r",String(M)),A.setAttribute("fill",b),p.appendChild(A),w&&p.setAttribute("opacity","0.5"),g.style.setProperty("width",`${a}px`,"important"),g.style.setProperty("height",`${l}px`,"important"),g.style.setProperty("min-width",`${a}px`,"important"),g.style.setProperty("min-height",`${l}px`,"important")}return y(),{el:g,applyVisual:y}}function Zs(t){let{width:e,height:n}=Ft(t),o=t.getBoundingClientRect(),r;try{r=window.getComputedStyle(t)}catch{}let i=r?parseFloat(r.width):NaN,s=r?parseFloat(r.height):NaN,a=Math.round(e||o.width||0),l=Math.round(n||o.height||0),u=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,a||16),c=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,l||16),f=(t.type||"text").toLowerCase()==="checkbox",d=!!t.checked,h=!!t.indeterminate,g=Math.max(Math.min(u,c),12),p=Math.max(u,g),y=Math.max(c,g),b="middle";try{r&&r.verticalAlign&&(b=r.verticalAlign)}catch{}let w=document.createElement("div");w.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),w.style.cssText=`display:inline-block;width:${p}px;height:${y}px;vertical-align:${b};flex-shrink:0;line-height:0;`;let S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("width",String(p)),S.setAttribute("height",String(y)),S.setAttribute("viewBox",`0 0 ${g} ${g}`),S.style.cssText=`width:${p}px;height:${y}px`,w.appendChild(S);function v(){let C=Js(r),M=2,F=M/2,T=g-M;if(S.innerHTML="",f){let A=document.createElementNS("http://www.w3.org/2000/svg","rect");if(A.setAttribute("x",String(F)),A.setAttribute("y",String(F)),A.setAttribute("width",String(T)),A.setAttribute("height",String(T)),A.setAttribute("rx","2"),A.setAttribute("ry","2"),A.setAttribute("fill",d?C:"none"),A.setAttribute("stroke",C),A.setAttribute("stroke-width",String(M)),S.appendChild(A),d){let x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",`M ${F+2} ${g/2} L ${g/2-1} ${g-F-2} L ${g-F-2} ${F+2}`),x.setAttribute("stroke","white"),x.setAttribute("stroke-width",String(Math.max(1.5,M))),x.setAttribute("fill","none"),x.setAttribute("stroke-linecap","round"),x.setAttribute("stroke-linejoin","round"),S.appendChild(x)}else if(h){let x=document.createElementNS("http://www.w3.org/2000/svg","rect"),_=Math.max(6,T-4);x.setAttribute("x",String((g-_)/2)),x.setAttribute("y",String((g-M)/2)),x.setAttribute("width",String(_)),x.setAttribute("height",String(M)),x.setAttribute("fill",C),x.setAttribute("rx","1"),S.appendChild(x)}}else{let A=document.createElementNS("http://www.w3.org/2000/svg","circle");if(A.setAttribute("cx",String(g/2)),A.setAttribute("cy",String(g/2)),A.setAttribute("r",String((g-M)/2)),A.setAttribute("fill",d?C:"none"),A.setAttribute("stroke",C),A.setAttribute("stroke-width",String(M)),S.appendChild(A),d){let x=document.createElementNS("http://www.w3.org/2000/svg","circle"),_=Math.max(2,(g-M*2)*.35);x.setAttribute("cx",String(g/2)),x.setAttribute("cy",String(g/2)),x.setAttribute("r",String(_)),x.setAttribute("fill","white"),S.appendChild(x)}}w.style.setProperty("width",`${p}px`,"important"),w.style.setProperty("height",`${y}px`,"important"),w.style.setProperty("min-width",`${p}px`,"important"),w.style.setProperty("min-height",`${y}px`,"important")}return v(),{el:w,applyVisual:v}}var kn=new yt(80);async function mu(t){if(j.resource?.has(t))return j.resource.get(t);if(kn.has(t))return kn.get(t);let e=(async()=>{let n=await dt(t,{as:"dataURL"});if(!n.ok||typeof n.data!="string")throw new Error(`Couldn't read ${t}`);return j.resource?.set(t,n.data),n.data})();kn.set(t,e);try{let n=await e;return kn.set(t,n),n}catch(n){throw kn.delete(t),n}}var zs=/\bblob:[^)"'\s]+/g;function eo(t){return typeof t=="string"&&t.startsWith("blob:")}function gu(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 yu(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function Mn(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function no(t,e=null){if(!t)return;let n=e,o=new Set,r=[],i=new Map,s=(g,p,y,b)=>{o.add(y),r.push(()=>{i.has(y)&&(g.setAttribute(p,i.get(y)),b?.())})},a=(g,p)=>{if(!g||!g.includes("blob:"))return;let y=g.match(zs)||[];if(y.length){for(let b of y)o.add(b);r.push(()=>{let b=g.replace(zs,w=>i.get(w)||w);b!==g&&p(b)})}},l=Mn(t,"img");for(let g of l)try{let y=g.getAttribute("src")||g.currentSrc||"";eo(y)&&s(g,"src",y);let b=g.getAttribute("srcset");if(b&&b.includes("blob:")){let w=gu(b);for(let S of w)eo(S.url)&&o.add(S.url);r.push(()=>{let S=!1;for(let v of w)i.has(v.url)&&(v.url=i.get(v.url),S=!0);S&&g.setAttribute("srcset",yu(w))})}}catch(p){D(n,"Couldn't inline a blob: image.",p)}let u=Mn(t,"image");for(let g of u)try{let p="http://www.w3.org/1999/xlink",y=g.getAttribute("href")||g.getAttributeNS?.(p,"href");eo(y)&&s(g,"href",y,()=>g.removeAttributeNS?.(p,"href"))}catch(p){D(n,"Couldn't inline a blob: SVG image.",p)}let c=Mn(t,"[style*='blob:']");for(let g of c)try{let p=g.getAttribute("style");a(p,y=>g.setAttribute("style",y))}catch(p){D(n,"Couldn't inline blob: URLs in a style attribute.",p)}let f=Mn(t,"style");for(let g of f)try{let p=g.textContent||"";a(p,y=>{g.textContent=y})}catch(p){D(n,"Couldn't inline blob: URLs in a ");if(n===-1)return t;let o=/]*>[\s\S]*?<\/style>/g,r=[],i=n,s;for(o.lastIndex=n;s=o.exec(t);)r.push({text:t.slice(i,s.index),intern:!0}),r.push({text:s[0],intern:!1}),i=o.lastIndex;r.push({text:t.slice(i),intern:!0});let a=new Map,l=/ style="([^"]*)"/g,u;for(let y of r)if(y.intern)for(l.lastIndex=0;u=l.exec(y.text);)a.set(u[1],(a.get(u[1])||0)+1);let c=0;for(let[y,b]of a)b>1&&(c+=(b-1)*y.length);if(c<2048||t.includes(" data-sdi="))return t;let f=ah(e,r.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(f===null)return t;let d=new Map,h=0,m=[],g=(y,b)=>{if((a.get(b)||0)<2||f.has(b))return y;let w=d.get(b);return w===void 0&&(w="i"+(h++).toString(36),d.set(b,w),m.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},p="";for(let y of r)p+=y.intern?y.text.replace(l,g):y.text;return t.slice(0,n)+m.join("")+p}function ah(t,e,n){let o=new Set;if(!e&&!n)return o;if(!t||t.querySelector("[data-sdi]"))return null;let r=l=>{let u=l.getAttribute("style");u&&o.add(u)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(r),e)try{let l=u=>{for(let c of u){if(c.type===CSSRule.IMPORT_RULE||c.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(c.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(c.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(c.selectorText).forEach(r)}c.cssRules&&l(c.cssRules)}};for(let u of[...t.querySelectorAll("style")].slice(1)){let c=u.textContent||"";if(/@import\b/i.test(c))return null;let f=new CSSStyleSheet;f.replaceSync(c),l(f.cssRules)}}catch{return null}let i=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let l of o){s.setAttribute("style",l);let u=a.serializeToString(s).match(/ style="([^"]*)"/);u&&i.add(u[1])}return i}async function Oo(t,e){let{clipWindow:n,outerTransforms:o,outerShadows:r,rootTransform2D:i,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:J,...tt}=t;t=Object.assign(a,tt),Object.defineProperty(t,"options",{value:t,configurable:!0})}let l,u;ko(t,s),await Qt("beforeRender",t);let c=O(t.element),f=t.element.getBoundingClientRect(),d=Math.max(1,H(t.element.offsetWidth||parseFloat(c.width)||f.width||1)),h=Math.max(1,H(t.element.offsetHeight||parseFloat(c.height)||f.height||1)),m=t.element.ownerDocument||document,g=!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned,p=null,y=null,b=0;if(g){let J=Math.max(t.element.scrollHeight||0,m.documentElement?.scrollHeight||0,m.body?.scrollHeight||0),tt=Math.max(t.element.scrollWidth||0,m.documentElement?.scrollWidth||0,m.body?.scrollWidth||0),it=Math.max(d,H(tt)),ut=t.element===m.body,Vt=ut&&O(m.documentElement).direction==="rtl",St=K=>{K>0&&(Vt?b=Math.max(b,H(K-f.width)):d=Math.max(d,H(K)))};if(ut&&m.documentElement){let K=m.documentElement.getBoundingClientRect(),st={top:Math.max(0,f.top-K.top),right:Math.max(0,K.right-f.right),bottom:Math.max(0,K.bottom-f.bottom),left:Math.max(0,f.left-K.left)};if(p=st,r!=="subtree"&&(st.top||st.right||st.bottom||st.left)){let bt=t.__session?.styleMap,fn=new Map,zn=new Map;for(let[ne,Wt]of t.nodeMap){let Ot=bt?.get(ne);if(Ot){let er=fn.get(Ot);if(er===void 0&&fn.set(Ot,er=ih.test(Ot)),!er)continue}zn.set(ne,Wt)}let Gt=Yr(t.element,zn,t.styleCache,f.width>0?d/f.width:1,f.height>0?h/f.height:1);y={top:Math.min(Gt.top,st.top),right:Math.min(Gt.right,st.right),bottom:Math.min(Gt.bottom,st.bottom),left:Math.min(Gt.left,st.left)}}J=Math.max(t.element.scrollHeight||0,nn(J,K.height,f.top-K.top,f.bottom-K.top)),tt=Math.max(t.element.scrollWidth||0,Vt?nn(tt,K.width,K.right-f.right,K.right-f.left):nn(tt,K.width,f.left-K.left,f.right-K.left))}J>0&&(h=Math.max(h,H(J))),St(tt);try{let K=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,st=j.measureHints.get(t.element);if(st&&st.cssLen===K&&st.w0===it&&st.docH===J&&st.docW===tt)st.csh>0&&(h=Math.max(h,H(st.csh))),St(st.csw);else{let bt=m.createElement("div");Q(bt),bt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+it+"px!important;overflow:visible!important;visibility:hidden!important;";let fn=bt.attachShadow({mode:"open"});Pn(fn,(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS);let zn=fn.appendChild(ei(t.clone));m.body.appendChild(bt);let Gt=bt.scrollHeight,ne=bt.scrollWidth;if(ut){let Wt=bt.getBoundingClientRect(),Ot=zn.getBoundingClientRect();Gt=nn(Gt,Wt.height,Ot.top-Wt.top,Ot.bottom-Wt.top),ne=Vt?nn(ne,Wt.width,Wt.right-Ot.right,Wt.right-Ot.left):nn(ne,Wt.width,Ot.left-Wt.left,Ot.right-Wt.left)}m.body.removeChild(bt),j.measureHints.set(t.element,{cssLen:K,w0:it,docH:J,docW:tt,csh:Gt,csw:ne}),Gt>0&&(h=Math.max(h,H(Gt))),St(ne)}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let J=ti(t.element,t.options),tt=1,it=ti(t.element,{}),ut=Math.max(2,h*.15);Number.isFinite(it)&&it>=h-ut&&Number.isFinite(J)&&J>0&&(h=Math.max(1,Math.min(h,H(J+tt))))}if(t.options?.reconcile)try{let J=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;rl(t.element,t.clone,J,t.nodeMap,d,h)}catch(J){et(t.options.__session,"reconcile-failed","reconcile pass failed",J),D(t.options,"reconcile couldn't run; captured without it.",J)}let w=(J,tt=NaN)=>{let it=typeof J=="string"?parseFloat(J):J;return Number.isFinite(it)?it:tt},S=w(t.options.width),v=w(t.options.height),C=n?H(n.width):d,M=n?H(n.height):h,F=C,T=M,A=Number.isFinite(S),x=Number.isFinite(v),_=M>0?C/M:1;A&&x?(F=Math.max(1,H(S)),T=Math.max(1,H(v))):A?(F=Math.max(1,H(S)),T=Math.max(1,H(F/(_||1)))):x&&(T=Math.max(1,H(v)),F=Math.max(1,H(T*(_||1))));let E=0,$=0,R=d,W=h;if(n){let J=0,tt=0;if(fi(t.element)){let ut=null;if(!o&&i&&Number.isFinite(i.a))ut={a:i.a,b:i.b||0,c:i.c||0,d:i.d||1,e:0,f:0};else{let Vt=Ce(t.element),St=Zr(c.transform&&c.transform!=="none"?c.transform:"",Vt);St&&St.is2D&&(ut={a:St.a,b:St.b,c:St.c,d:St.d,e:0,f:0})}if(ut&&!(ut.a===1&&ut.b===0&&ut.c===0&&ut.d===1)){let{ox:Vt,oy:St}=Fn(c,d,h),K=Ke(d,h,ut,Vt,St);J=K.minX,tt=K.minY}}let it=Y()?0:(a.dpr||1)*(A||x?F/C:a.scale||1);E=H(it?Math.round((n.x+J)*it)/it:n.x+J),$=H(it?Math.round((n.y+tt)*it)/it:n.y+tt),R=H(E+n.width),W=H($+n.height)}else if(!o&&i&&Number.isFinite(i.a)){let J={a:i.a,b:i.b||0,c:i.c||0,d:i.d||1,e:0,f:0},tt=Ke(d,h,J,0,0);E=H(tt.minX),$=H(tt.minY),R=H(tt.maxX),W=H(tt.maxY)}else if(o&&fi(t.element)){let tt=c.transform&&c.transform!=="none"?c.transform:"",it=Ce(t.element),ut=ue({baseTransform:tt,rotate:it.rotate||"0deg",scale:it.scale,translate:it.translate,width:d,height:h}),{ox:Vt,oy:St}=Fn(c,d,h),K=ut.is2D?ut:new DOMMatrix(ut.toString()),st={a:K.a,b:K.b,c:K.c,d:K.d,e:0,f:0},bt=Ke(d,h,st,Vt,St);E=H(bt.minX),$=H(bt.minY),R=H(bt.maxX),W=H(bt.maxY)}let k=jr(c),I=Vr(c),L=Gr(c),P=qr(c),N=Xr(c),B=f.width>0?(R-E)/f.width:1,U=f.height>0?(W-$)/f.height:1,V=r==="subtree"&&!n?Yr(t.element,t.nodeMap,t.styleCache,B,U):{top:0,right:0,bottom:0,left:0};y&&(V={top:y.top,right:Math.max(0,y.right-(d-f.width)),bottom:Math.max(0,y.bottom-(h-f.height)),left:y.left}),b>0&&(V={...V,left:Math.max(V.left,b)});let z=n?{top:0,right:0,bottom:0,left:0}:r?{top:H(Math.max(k.top,I.top,V.top)+L.top+P.top+N.bleed.top),right:H(Math.max(k.right,I.right,V.right)+L.right+P.right+N.bleed.right),bottom:H(Math.max(k.bottom,I.bottom,V.bottom)+L.bottom+P.bottom+N.bleed.bottom),left:H(Math.max(k.left,I.left,V.left)+L.left+P.left+N.bleed.left)}:{top:H(L.top+V.top),right:H(L.right+V.right),bottom:H(L.bottom+V.bottom),left:H(L.left+V.left)};E=H(E-z.left),$=H($-z.top),R=H(R+z.right),W=H(W+z.bottom);let at=Math.max(1,H(R-E)),rt=Math.max(1,H(W-$)),pt="http://www.w3.org/2000/svg",kt=fi(t.element)?2:0,lt=H(kt+(o?0:1)),Yt=a.__subpixel?.x||0,Fe=a.__subpixel?.y||0,q=Math.ceil(at+lt*2+Yt),X=Math.ceil(rt+lt*2+Fe),G=H(-(H(E)-lt)),mt=H(-(H($)-lt)),nt=m.defaultView||window,ft=!Y()&&CSS.supports("zoom","2")?lh(nt):1;a.__layoutZoom=ft;let Te=n&&!Y(),te=Te?H(G-Math.floor(G*ft+.01)/ft):0,$e=Te?H(mt-Math.floor(mt*ft+.01)/ft):0,ee=Math.min(0,G-te)-(te?1/ft:0),ln=Math.min(0,mt-$e)-($e?1/ft:0),It=G-te-ee+Yt,Pe=mt-$e-ln+Fe,Dn=H(q-ee),cn=H(X-ln),gt=document.createElementNS(pt,"foreignObject");gt.setAttribute("x",String(ee*ft)),gt.setAttribute("y",String(ln*ft)),gt.setAttribute("width",String(Dn*ft)),gt.setAttribute("height",String(cn*ft)),gt.style.overflow="visible";let Oi=document.createElement("style"),Rc="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";Oi.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+Rc+t.classCSS,gt.appendChild(Oi);let Bn=document.createElement("div");Bn.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Bn.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${a.__subpixel?H(It+f.width):Dn}px;height:${cn}px`+(It!==0||Pe!==0?`;padding:${Pe}px 0 0 ${It}px !important`:"")+(ft!==1?`;zoom:${ft} !important`:"")+";direction:ltr !important"+(p?rh(m):""),p&&(It!==p.left||Pe!==p.top)&&t.__session&&Ja(t.element,t.nodeMap,t.__session.styleMap,t.styleCache,It-p.left,Pe-p.top),Bn.appendChild(t.clone),gt.appendChild(Bn);let Fc=new XMLSerializer().serializeToString(gt),Di=A||x,Tc=Object.freeze({w0:C,h0:M,vbW:q,vbH:X,targetW:F,targetH:T,contentX:H(G+(n?E:0)),contentY:H(mt+(n?$:0)),clip:n?Object.freeze({x:H(E),y:H($),width:C,height:M}):null});Object.defineProperty(a,"meta",{value:Tc,enumerable:!0,writable:!1,configurable:!0});let $c=!Di||Y()?q:A?F:H(q*(T/X)),Pc=!Di||Y()?X:x?T:H(X*(F/q)),Nc=parseFloat(O(m.documentElement)?.fontSize)||16,Zo=[te||$e?`translate(${te} ${$e})`:"",ft!==1?`scale(${1/ft})`:""].join(" ").trim(),Lc=`${Zo?``:""}`,Ic=Zo?"":"";u=Lc+sh(Fc,gt)+Ic,l=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,t.svgString=u,t.dataURL=l,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Qt("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let tr=[...document.querySelectorAll("#snapdom-sandbox")].find(qt);return tr&&tr.style.position==="absolute"&&tr.remove(),t.dataURL}function fi(t){return qa(t)}function lh(t){let e=t.devicePixelRatio||1;if(e===1)return 1;let n=t.document,o=e;try{let r=n.createElement("div");Q(r),r.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:0!important;height:0!important;visibility:hidden!important;pointer-events:none!important;border:0 solid transparent!important;border-top-width:0.5px!important",(n.body||n.documentElement).appendChild(r);let i=parseFloat(t.getComputedStyle(r).borderTopWidth);r.remove(),i>=1&&(o=1)}catch{}return o}ke();Tn();function uh(t){let e=Array.isArray(t.plugins)?t.plugins:ai(),n=[];for(let o of e){let r=en(o);r&&typeof r.resolveNode=="function"&&n.push(r.resolveNode.bind(r))}return n.length?n:null}async function $l(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=ri(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=uh(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let o,r,i,s,a,l,u,c,f="",d=null,h=e.needs||Ct,m=n.format,g=n.type;await Qt("beforeSnap",n);let p=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),y=n.type!==g&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(p||y){let E=String(p?n.format:n.type).toLowerCase();n.format=E==="jpg"?"jpeg":E,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Qt("beforeClone",n);let b=n.outerTransforms!==!1,w=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,S=n.clip?vo(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=Cs(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let v=cs(e.fast);for(;;){e.__slicer=v;let E=Fo(n.element,S);try{({clone:o,classCSS:r,classPrefixCSS:i,styleCache:s,nodeMap:a,reconcileRisk:l,clipWindow:u,standIns:c}=await sl(n.element,n.options)),l>0&&!e.reconcile&&(et(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),e.debug&&!j.warnedReconcile&&(j.warnedReconcile=!0,D(e,"Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!b&&o&&(d=Ga(n.element,o)),!w&&o&&Za(n.element,o,n.options),o&&(nl(n.element,o,a,c),tl(n.element,o))}finally{E()}if(!v?.yielded||!e.__tornSinceStart?.())break;v=null,e.__session=ri(e.cache)}if(e.__slicer=null,n.clone=o,n.classCSS=r,n.styleCache=s,n.nodeMap=a,await Qt("afterClone",n),!Ze(h,"render"))return null;if(v?.due()&&await v.pause(),Co(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{ol(n.element,n.clone,n.styleCache,n.nodeMap)}catch(E){et(e.__session,"shrink-failed","shrink pass failed",E),D(e,"Couldn't close the gaps left by removed elements.",E)}try{await lo(n.clone,n.element,n.nodeMap)}catch{}try{let E=e.__session?.styleMap;E&&co(E.keys(),E,n.nodeMap,n.options.__iconMatchers)}catch{}let C=E=>Promise.resolve().then(E),M=(async()=>{await Promise.all([C(()=>Ao(n.clone,n.options)),C(()=>_o(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{cl(n.element,n.clone,n.nodeMap)}catch(E){et(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",E),D(e,"Couldn't reproduce a backdrop-filter; captured without it.",E)}if(e.compress&&(e.__compressionClip=u,e.__compressionRootTransform=d,await C(()=>Wo(n.clone,n.options,n.nodeMap))),e.captureSelection)try{ia(n.nodeMap)}catch(E){et(e.__session,"selection-compose-failed","field selection compose failed",E)}})(),F=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(F=C(async()=>{let E=n.element.ownerDocument||document,$=S?L=>{try{let P=L.getBoundingClientRect();return P.right>=S.left-200&&P.left<=S.right+200&&P.bottom>=S.top-200&&P.top<=S.bottom+200}catch{return!0}}:null,{required:R,usedCodepoints:W}=!S&&e.__fontUsage||yo(n.element,$),k=R,I=R;if(e.embedFonts==="auto"){let{declared:L,drawn:P}=go(E),N=B=>_n(B).toLowerCase();if(k=new Set(Array.from(R).filter(B=>P.has(N(B)))),!k.size)return;I=new Set(Array.from(R).filter(B=>P.has(N(B))||!L.has(N(B))))}Y()&&await bo(k,W,E),f=await _a({required:I,usedCodepoints:W,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:E,debug:n.options.debug})})),await Promise.all([M,F]);let A=(n.options.plugins||[]).some(E=>E&&(typeof E.beforeRender=="function"||typeof E.afterRender=="function"));if(n.options.engine==="html-in-canvas"&&!A){let{tryCanvasEngine:E}=await Promise.resolve().then(()=>(Tl(),Fl));ko(n,f);let $=await E(n,n.options);if($)return $}v?.due()&&await v.pause();let x=n.clone;Io(x,e.__compressedAssets);let _=await Oo(n,{clipWindow:u,outerTransforms:b,outerShadows:w,rootTransform2D:d,fontsCSS:f});if(e.__compressedSnapshot=Lo(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:o,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:i,fontsCSS:f,clipWindow:u,outerTransforms:b,outerShadows:w,rootTransform2D:d,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return _}Mt();Pt();wt();var dh=new Set(["png","jpeg","jpg","webp","svg"]);function Pl(t={}){let e=typeof t.type=="string"&&dh.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let o=t.format!=null?n:e==="jpg"?"jpeg":e,r=Bi(t.cache),i=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let f of i)if(typeof f=="string")try{document.createDocumentFragment().querySelector(f),s.push(f)}catch{D(t,`Invalid exclude selector "${f}"; ignored.`)}else typeof f=="function"?a.push(f):f!=null&&D(t,"Ignored an exclude entry: use a CSS selector or a function.",f);let l=t.excludeMode??"hide",u=f=>{if(!f||f.nodeType!==1)return!1;if(f.getAttribute("data-capture")==="exclude")return!0;for(let d of Array.isArray(c.exclude)?c.exclude:[])try{if(f.matches(d))return!0}catch{}for(let d of Array.isArray(c.excludePredicates)?c.excludePredicates:[])try{if(d(f))return!0}catch{}if(typeof c.filter=="function")try{if(!c.filter(f))return!0}catch{}return!1},c={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:l,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:u,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:ct(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:ba(t.iconFonts,t),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:r,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:o,type:n,quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(n)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst,fast:t.fast===!1||t.fast==="auto"?t.fast:!0,engine:t.engine,invalidate:t.invalidate??!1,__pinned:t.__pinned===!0,__subpixel:t.__subpixel??null,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return c}ht();wt();Rt();Rt();Rt();_t();ke();var Nl="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function ph(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var hh=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function mh(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(hh.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function gh(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(i=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(i.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let o=[t];t.querySelectorAll&&o.push(...t.querySelectorAll("*"));for(let r of o){let i=getComputedStyle(r),s=i.getPropertyValue("backdrop-filter")||i.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var yh=1/16;function bh(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),o=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n-o)<=yh}var Do=new Map,wh=["width","height","min-width","min-height"];function xh(t){let e=Do.get(t);if(e===void 0){e=null;for(let n of wh){let o=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));o&&o[1].endsWith("px")&&((e||={})[n]=o[1])}Do.size>5e3&&Do.clear(),Do.set(t,e)}return e}function Sh(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function vh(t,e){let n=[t];for(;n.length;){let o=n.pop();if(o.nodeType===1){let r=e.nodeMap.get(o);r!==void 0&&(e.nodeMap.delete(o),e.srcToClone.get(r)===o&&e.srcToClone.delete(r)),e.styleMap.delete(o)}for(let r=o.firstChild;r;r=r.nextSibling)n.push(r)}}var ui={attempts:0,served:0,reconciled:0};async function Ll(t,e,n){ui.attempts++;try{let o=await Ch(t,e,n);return o&&ui.served++,o}catch{return null}}async function Ch(t,e,n){let o=e.retained;if(!o||!o.clone||!o.styleMap||!o.srcToClone||n.reconcile||n.clip||n.captureSelection||o.clipWindow||t.scrollTop||t.scrollLeft||ph(t)||mh(o)||o.fontsCSS||$o(n))return null;for(let d of n.plugins||[])if(d&&(typeof d.beforeSnap=="function"||typeof d.beforeClone=="function"||typeof d.resolveNode=="function"||typeof d.afterClone=="function"))return null;if(o.classPrefixCSS&&(o.classPrefixCSS.includes("::marker")||o.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let r=t.ownerDocument||document,i=Cn(t);if(!i||vs(r))return null;let s=[];t:for(let d of e.dirtyRoots){if(!d.isConnected||d===t||!t.contains(d))return null;for(let h of e.dirtyRoots)if(h!==d&&h!==t&&h.contains(d))continue t;s.push(d)}if(!s.length)return null;n.__compressedAssets=o.__compressedAssets,n.__compressionDensity=o.__compressionDensity,n.__compressionRootTransform=o.rootTransform2D;for(let d of s){if(d.parentElement===t||d.matches?.(Nl)||d.querySelector?.(Nl)||gh(d,i))return null;let h=o.srcToClone.get(d);if(!h||!h.parentNode)return null;let m=new Map,g={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:m,options:n},p=Fo(d,null),y=So(d),b;try{b=await fe(d,g,n)}finally{y(),p()}if(!b||b.nodeType!==1||b.querySelector?.("style[data-sd]")||(await Ye(d,b,g,n),g.__pseudoCSS)||g.__usesPlaceholder&&!o.classPrefixCSS?.includes("[data-sd-ph]"))return null;await no(b,g),Co(b);try{await lo(b,d,m)}catch{}try{co([b,...b.querySelectorAll("*")],o.styleMap,m,n.__iconMatchers)}catch{}if(await Promise.all([Ao(b,n),_o(d,b,o.styleCache,n,m)]),n.compress)try{await Wo(b,n,m)}catch{}for(let[w,S]of m.entries())oi(w,S,m,o.styleCache);h.replaceWith(b),vh(h,o);for(let[w,S]of m.entries())o.nodeMap.set(w,S),o.srcToClone.set(S,w)}let a={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:o.nodeMap,options:n},l=new WeakSet;for(let[d,h]of o.nodeMap.entries()){if(!h||h.nodeType!==1||!h.isConnected)continue;let m=o.styleMap.get(d);if(!m)continue;let g=xh(m);if(!g)continue;let p=null,y=!1;for(let b in g){p||=getComputedStyle(h);let w=p.getPropertyValue(b);if(b==="min-width"&&w==="auto"&&!l.has(h.parentElement)){let S=parseFloat(p.width);p.boxSizing!=="border-box"&&m.includes("box-sizing:border-box")&&(S+=["padding-left","padding-right","border-left-width","border-right-width"].reduce((v,C)=>v+(parseFloat(p.getPropertyValue(C))||0),0)),w=`${S}px`}if(!bh(w,g[b])){y=!0;break}}if(y){if(n.__compressedAssets?.has(d))return null;l.add(h),ui.reconciled++,await xt(h,d,a,n)}}let u=hn(o.styleMap);for(let[d,h]of o.styleMap.entries())Sh(d),ni(d,h,u);let c=(o.classPrefixCSS||"")+Array.from(u.entries()).map(([d,h])=>`.${h}{${d}}`).join("");Io(o.clone,n.__compressedAssets);let f=await Oo({element:t,options:n,plugins:n.plugins,clone:o.clone,classCSS:c,styleCache:o.styleCache,nodeMap:o.nodeMap},{clipWindow:null,outerTransforms:o.outerTransforms,outerShadows:o.outerShadows,rootTransform2D:o.rootTransform2D,fontsCSS:o.fontsCSS||""});return n.__compressedSnapshot=Lo(o.clone,n.__compressedAssets),o.__compressedAssets=n.__compressedAssets,o.__compressionDensity=n.__compressionDensity,f}Pt();ht();var pi=new WeakMap,zo=new WeakMap,Gl=new WeakSet,di=new WeakMap,kh=64,Ln=new Map,ql=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],Mh=["(prefers-color-scheme: dark)","(prefers-reduced-motion: reduce)","(prefers-contrast: more)","(forced-colors: active)","(inverted-colors: inverted)","(prefers-reduced-transparency: reduce)","(hover: hover)","(any-hover: hover)","(pointer: coarse)","(any-pointer: coarse)","(color-gamut: p3)","(dynamic-range: high)"];function Ah(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":Mh.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function Il(t){let e=[];for(let n=t;n;){try{let o=n.getBoundingClientRect();e.push(o.x,o.y,o.width,o.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=Dt(n)||null}return e.join("|")}function Wl(t,e){if(e.disposed||(Ln.delete(t),Ln.set(t,e),Ln.size<=kh))return;let[n,o]=Ln.entries().next().value;Xl(n,o)}function Xl(t,e){e.disposed=!0,Ln.delete(t),pi.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of ql)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let o of mi)n.removeEventListener(o,e.onMediaDirty,!0);for(let[n,o]of e.trackedImages)n.removeEventListener("load",o),n.removeEventListener("error",o);e.trackedImages.clear(),e.trackedShadowRoots.clear(),e.images.length=0,e.controls.length=0,e.scrollNodes.length=0,e.observers.length=0,e.last=null,e.retained=null,e.retainedFrameDriven=!1}function Yl(t){if(Gl.has(t))return!1;zo.delete(t);let e=[t],n=[],o=[];for(let r=0;r=0&&e.observers.splice(s,1)}for(let r of o)if(!e.trackedShadowRoots.has(r))try{let i=new MutationObserver(e.markDirty);i.observe(r,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),i.__flush=e.markDirty,e.observers.push(i),e.trackedShadowRoots.set(r,i);for(let s of mi)r.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var mi=["scroll","change","beforetoggle","toggle"];function Uo(t,e){return[t,...e.trackedShadowRoots.keys()]}function gi(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let o of Uo(t,e))o.querySelectorAll&&n.push(...o.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let o=new Set(n);for(let[r,i]of e.trackedImages)o.has(r)||(r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r))}for(let o of n){if(o.complete||e.trackedImages.has(o))continue;let r=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,o.removeEventListener("load",r),o.removeEventListener("error",r),e.trackedImages.delete(o)};e.trackedImages.set(o,r),o.addEventListener("load",r),o.addEventListener("error",r)}}function Ol(t){let e=new Map,n=new Map,o=new Map;for(let r of t)if(we(r))if(r.type==="attributes"){let i=e.get(r.target);i||e.set(r.target,i=new Map),i.has(r.attributeName)||i.set(r.attributeName,r.oldValue)}else if(r.type==="characterData")n.has(r.target)||n.set(r.target,r.oldValue);else if(r.type==="childList"){let i=o.get(r.target);i||o.set(r.target,i=new Map);for(let s of r.addedNodes){if(s.nodeType!==3)return!0;i.set(s.data,(i.get(s.data)||0)+1)}for(let s of r.removedNodes){if(s.nodeType!==3)return!0;i.set(s.data,(i.get(s.data)||0)-1)}}else return!0;for(let[r,i]of e)for(let[s,a]of i)if(r.getAttribute(s)!==a)return!0;for(let[r,i]of n)if(r.data!==i)return!0;for(let r of o.values())for(let i of r.values())if(i!==0)return!0;return!1}var Eh=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,rn=t=>t&&(typeof t=="object"||typeof t=="function")?Bo(t):"-";function _h(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let o=t.slice(0,n),r=t.slice(n+1);try{if(/;base64/i.test(o)){let i=Math.ceil(e/3)*4;return atob(r.slice(0,i-i%4))}return r.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(i,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function Rh(t){let e=(t.match(/^data:([^;,]+)/i)?.[1]||"").toLowerCase();if(e==="image/gif"||e==="image/apng")return!0;if(!/image\/(?:png|webp|avif|svg\+xml)/.test(e))return!1;let n=_h(t);return e==="image/png"?n.includes("acTL"):e==="image/webp"?n.includes("ANIM")||n.includes("ANMF")||n.includes("VP8X")&&!!(n.charCodeAt(n.indexOf("VP8X")+8)&2):e==="image/avif"?n.includes("avis"):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function Dl(t){let e=String(t||"").trim();return e?Eh.test(e)?!0:/^data:/i.test(e)?Rh(e):!1:!1}function sn(t){let e=String(t||"");if(Dl(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(Dl(n[1]??n[2]??n[3]))return!0;return!1}function Bl(t,e=null){let n=t&&t.clone;if(!n)return!1;let o=e?e.map(r=>t.srcToClone?.get(r)).filter(Boolean):[n];for(let r of o)for(let i of Kl(r))if(sn(i.getAttribute?.("src"))||sn(i.getAttribute?.("href"))||sn(i.getAttribute?.("style"))||sn(t.styleMap?.get(i)))return!0;return!1}function Kl(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function yi(t,e){let n=[],o=new Set,r=i=>{i&&!o.has(i)&&(o.add(i),n.push(i))};t.matches?.("input,textarea,select,option")&&r(t);for(let i of Uo(t,e))try{for(let s of i.querySelectorAll("input,textarea,select,option"))r(s)}catch{}e.controls=n}function bi(t,e){let n=[],o=new Set,r=(i,s=!1)=>{if(!(!i||o.has(i))){o.add(i);try{(s||i.scrollLeft||i.scrollTop||i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight)&&n.push(i)}catch{}}};for(let i=t;i;i=i.parentElement)r(i,!0);for(let i of Uo(t,e))for(let s of Kl(i))r(s);e.scrollNodes=n}function zl(t,e){let n=t.ownerDocument||document,o=n.defaultView,r=[o?.location?.hash||"",Ah(n),o?.innerWidth||0,o?.innerHeight||0,o?.devicePixelRatio||1,o?.screen?.orientation?.type||""];try{r.push(...[...n.adoptedStyleSheets||[]].map(rn))}catch{}for(let c of e.trackedShadowRoots.keys())try{r.push("#shadow",...[...c.adoptedStyleSheets||[]].map(rn))}catch{}let i=n.activeElement,s=n.fullscreenElement;(i?.contains(t)||t.contains(i))&&r.push(rn(i)),(s?.contains(t)||t.contains(s))&&r.push(rn(s));let a=[o?.scrollX||0,o?.scrollY||0];for(let c of e.scrollNodes)a.push(c.scrollLeft||0,c.scrollTop||0);let l=[];for(let c of e.controls){let f=String(c.localName||"").toLowerCase();f==="input"?l.push(c.type,dn(c)?c.value.length:c.value,c.checked?1:0,c.indeterminate?1:0):f==="textarea"?l.push(c.value):f==="select"?l.push(c.selectedIndex,c.value):l.push(c.selected?1:0)}let u=[];for(let c of e.images){let f="";try{f=c.currentSrc||c.src||""}catch{}u.push(f,c.complete?1:0,c.naturalWidth||0,c.naturalHeight||0)}return{style:r.join("|"),scroll:a.join("|"),controls:l,images:u,frameDriven:e.retainedFrameDriven}}function on(t,e,n){if(!t)return!1;let o=t[n],r=e[n];if(o===r)return!0;if(!Array.isArray(o)||o.length!==r.length)return!1;for(let i=0;i[rn(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Fh(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let o of e.trackedShadowRoots.keys())if(o.contains(n))return o;return null}function Th(t){let e={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:ze(),styleEpoch:xe(),styleStamp:vn(t),outsideMutations:Sn(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},o=a=>{if(!e.dirtyRoots)return;let l=a&&(a.nodeType===1?a:a.parentElement);if(!l||l===t||!t.contains(l)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(l)},r=a=>{if(e.capturing){for(let l of a)e.pending.push(l);return}for(let l of a)we(l)&&(e.dirty=!0,o(l.target))},i=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(r);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=r,e.observers.push(a)}catch{}e.markDirty=r,e.onMediaDirty=i;try{for(let a of ql)t.addEventListener(a,i,{capture:!0,passive:!0})}catch{}return hi(t,e)||yi(t,e),bi(t,e),gi(t,e),e}var $h=0,jl=new WeakMap;function Bo(t){let e=jl.get(t);return e||(e="@"+ ++$h,jl.set(t,e)),e}function wi(t,e){let n=typeof t;if(n==="undefined")return null;if(t===null||n==="boolean"||n==="number"||n==="string")return JSON.stringify(t);if(n==="function"||n==="symbol")return n==="symbol"?null:JSON.stringify(Bo(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(Bo(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let i=[];for(let s of t){let a=wi(s,e);if(a===null)return null;i.push(a)}return"["+i.join(",")+"]"}let o=Object.getPrototypeOf(t);if(o!==Object.prototype&&o!==null)return JSON.stringify(Bo(t));let r=[];for(let i of Object.keys(t).sort()){let s=t[i];if(s===void 0)continue;let a=wi(s,e);if(a===null)return null;r.push(JSON.stringify(i)+":"+a)}return"{"+r.join(",")+"}"}finally{e.delete(t)}}function Vl(t,e){let{burst:n,invalidate:o,...r}=t||{};try{let i=wi(r,new Set);return i===null?null:`${(e||[]).map(rn).join(",")}:${i}`}catch{return null}}function Jl(t,e,n,o,r=null){let i=pi.get(t);i||(i=Th(t),i.baselineSignature=Vl(e,n.plugins),pi.set(t,i));let s=Vl(e,n.plugins),a=async()=>{if(await Gn(),i.disposed)return o();let u=s===null||s!==i.baselineSignature;u&&s!==null?i.pendingSig===s?(i.baselineSignature=s,i.last=null,i.dirty=!0,i.dirtyRoots=null,i.pendingSig=null,u=!1):i.pendingSig=s:i.pendingSig=null,hi(t,i),gi(t,i);for(let M of i.observers)M.__flush(M.takeRecords());zt();let c=Sn(t);i.dirty&&i.outsideMutations!==c&&i.dirtyAll(),i.outsideMutations=c;let f=t.getRootNode?.(),d=[...i.trackedShadowRoots.keys()];f?.nodeType===11&&!d.includes(f)&&d.push(f),Qn(t.ownerDocument||document,d);let h=vn(t);i.styleStamp!==h&&(i.styleStamp=h,i.dirty||i.dirtyAll());let m=zl(t,i),g=Ul(t,i);m.animation=Hl(g),i.renderState&&(!on(i.renderState,m,"style")&&(Ue(),i.dirtyAll()),on(i.renderState,m,"scroll")||i.dirtyAll(),on(i.renderState,m,"controls")||(Se(t),i.dirtyAll()),!on(i.renderState,m,"images")&&!i.dirty&&i.dirtyAll());let p=ze();i.envEpoch!==p&&(i.dirtyAll(),i.envEpoch=p);let y=xe();if(i.styleEpoch!==y&&(i.styleEpoch=y,!i.dirty)){let M=Il(t);i.geometry!==null&&M!==i.geometry&&(Se(t),i.dirtyAll()),i.geometry=M}n.invalidate&&i.dirtyAll();let b=!1,w=!!i.renderState&&!on(i.renderState,m,"animation");try{let M=new Set;w&&g.length===0&&(M=null);for(let F of g){let T=F.playState==="running";if(!T&&!w)continue;T&&(b=!0),w=!0;let A=F.effect?.target;if(Fh(t,i,A)===t)M.add(A);else{M=null;break}}if(w&&M&&M.size&&i.retained){i.dirty=!0;for(let F of M)i.dirtyRoots&&i.dirtyRoots.add(F),Se(F)}else w&&!M&&i.dirtyAll()}catch{}let S=m.frameDriven,v=b||S;if(v&&(i.last=null),S&&i.dirtyAll(),!u&&!v&&!i.dirty&&i.last)return Wl(t,i),i.last;i.capturing=!0;let C=null;try{let M=null,F=!1,T=null;if(!u&&i.dirty&&i.retained&&i.dirtyRoots&&i.dirtyRoots.size&&r){T=[...i.dirtyRoots];let A=await Ll(t,i,n);A&&(M=await r(A),F=!0)}if(M||(u||(n.__retain=A=>{let x=new Map;for(let[_,E]of A.nodeMap.entries())x.set(E,_);C={...A,srcToClone:x}}),n.__tornSinceStart=()=>{for(let A of i.observers)for(let x of A.takeRecords())i.pending.push(x);return zt(),i.torn||Ol(i.pending)||Sn(t)!==c},M=await o()),!u&&!i.disposed){i.dirty=!1,i.dirtyRoots=new Set,C?(i.retained=C,i.retainedFrameDriven=Bl(C),yi(t,i),bi(t,i)):F&&(i.retainedFrameDriven||=Bl(i.retained,T),yi(t,i),bi(t,i));let A=zl(t,i);A.animation=Hl(Ul(t,i));let x=["style","scroll","controls","images"];b||x.push("animation");let _=x.every(E=>on(m,A,E));i.renderState=A,i.styleEpoch=xe(),i.styleStamp=vn(t),i.geometry=Il(t),i.renderState.frameDriven?(Gl.add(t),Xl(t,i)):_?!v&&!i.renderState.frameDriven&&(i.last=M,Wl(t,i)):(i.dirtyAll(),i.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let F of i.observers)for(let T of F.takeRecords())i.pending.push(T);zt();let M=Sn(t);(i.torn||Ol(i.pending)||M!==c)&&(i.dirtyAll(),i.last=null),i.outsideMutations=M,i.styleEpoch=xe(),i.styleStamp=vn(t),i.pending.length=0,i.torn=!1,i.capturing=!1,i.disposed||(hi(t,i),gi(t,i))}},l=i.inflight.then(a,a);return i.inflight=l.catch(()=>{}),l}var Ho=null;function tc(t){Ho=t}var Ph='button, a[href], [role="button"], input, select, summary, label, [tabindex]',xi=!1,In=null,Si=new WeakMap,Ql=!1;function ec(t,e){!xi||!In||e&&e.burst===!1||Si.set(In.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function nc(t){let e={control:t};In=e,setTimeout(()=>{In===e&&(In=null)},0)}function Ci(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Ph):null}function Zl(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=Ci(t);e&&(nc(e),vi(t,!1))}function Nh(t){let e=Ci(t);e&&nc(e)}function vi(t,e=!0){if(!Ho||document.visibilityState==="hidden")return;let n=Ci(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let o=Si.get(n);if(o){if(!o.element.isConnected){Si.delete(n);return}Ho(o.element,o.options).catch(()=>{});return}e&&!Ql&&(Ql=!0,Ho(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function oc(){if(xi||typeof document>"u"||typeof document.addEventListener!="function")return;xi=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Zl,t),document.addEventListener("keydown",Zl,t),document.addEventListener("click",Nh,t),document.addEventListener("pointerenter",vi,t),document.addEventListener("focusin",vi,t)}At();function im(...t){return si(...t),Z}async function sm(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");Q(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await vt();let o=Array.from(n.childNodes).some(i=>i.nodeType===3&&i.textContent.trim()),r=n.children.length===1&&!o?n.firstElementChild:n;return await Wi(r,{...e||{},burst:!1})}finally{n.remove()}}var am="3.7.0",Z=Object.assign(Wi,{plugins:im,fromString:sm,version:am,preCapture:oc});tc(Wi);var Ii=Symbol("snapdom.internal"),lm=Symbol("snapdom.internal.silent"),Ec=new Set(["png","jpeg","jpg","webp","svg"]);async function Wi(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=Pl(e);n.element=t,n.invalidate&&Ue(),wl(n,e&&e.plugins);let{stage:o,loweredBy:r}=ml(n);n.needs=o,n.__needsLoweredBy=r;let i=Ze(o,"render"),s=n.burst===!0||!$o(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",u=i&&!n.captureSelection&&n.burst!==!1&&s&&!a&&Yl(t);return u&&ec(t,e),n.snap||(n.snap={toPng:(c,f)=>Z.toPng(c,f),toSvg:(c,f)=>Z.toSvg(c,f)}),u?Jl(t,e,n,()=>Z.capture(t,n,Ii),c=>_c(c,n)):(await Gn(),Z.capture(t,n,Ii))}Z.capture=async(t,e,n)=>{if(n!==Ii)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(Ze(e.needs||Ct,"render")&&Y()){if(e.embedFonts)try{let i=t.ownerDocument||document,s=null;if(e.embedFonts==="auto"&&(t.getBoundingClientRect(),s=go(i).drawn,s.size===0))throw null;let a=yo(t);e.clip||(e.__fontUsage=a);let l=a.required;if(s&&(l=new Set([...l].filter(u=>s.has(_n(u).toLowerCase()))),l.size===0))throw null;await bo(l,a.usedCodepoints,i)}catch{}let r=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&r.unshift(t);for(let i of r)try{if(En(i))continue;let s=i.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){D(e,"Couldn't prepare canvases for Safari.",s)}}let o=await $l(t,e);return _c(o,e)};async function _c(t,e){let n=e.needs||Ct,o=Ze(n,"render"),r=k=>yl(n,e.__needsLoweredBy||[],k),i=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=i?null:t,a=()=>s??=i.toDataURL(),l=i||t;i&&(t="");let u=e.__compressedSnapshot,c=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let f,d=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),g=m?Number.isFinite(e.width)?d.targetW/d.vbW:d.targetH/d.vbH:1,p=m?Number.isFinite(e.height)?d.targetH/d.vbH:d.targetW/d.vbW:1,y=k=>{if(i||!u?.size)return l;let I=d.vbW,L=d.vbH,P=k.crop;P&&(I=Math.max(1,Math.min(I,P.x+P.width)-Math.max(0,P.x)),L=Math.max(1,Math.min(L,P.y+P.height)-Math.max(0,P.y)));let N=Number.isFinite(k.width),B=Number.isFinite(k.height);return(N&&B?Math.max(k.width/I,k.height/L):N?k.width/I*(P?Math.max(1,p/g):1):B?k.height/L*(P?Math.max(1,g/p):1):(k.scale||1)*Math.max(g,p))*(k.dpr||1)<=c?l:f??=Ml(a(),u)},b=async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),On));return L(l,{...k,...I||{},format:"png"})},w=()=>{if(!o)throw r("svgString");if(i)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let k=t.indexOf(",");return k>=0?decodeURIComponent(t.slice(k+1)):""},S=k=>Object.defineProperty({...k||{},svgString:w},"url",o?{get:a,enumerable:!0}:{get(){throw r("export.url")},enumerable:!1,configurable:!0}),v={img:async(k,I)=>{if(i)return b(k,I);let{toImg:L}=await Promise.resolve().then(()=>($i(),Ti)),P={...k,...I||{}};return L(y(P),P)},svg:async(k,I)=>{if(i)return b(k,I);let{toSvg:L}=await Promise.resolve().then(()=>($i(),Ti)),P={...k,...I||{}};return L(y(P),P)},canvas:async(k,I)=>{let{toCanvas:L}=await Promise.resolve().then(()=>(Re(),fc)),P={...k,...I||{}};return L(y(P),P)},blob:async(k,I)=>{let{toBlob:L}=await Promise.resolve().then(()=>(Li(),Cc)),P={...k,...I||{}};return L(y(P),P)},png:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),On)),P={...k,...I||{},format:"png"};return L(y(P),P)},jpeg:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),On)),P={...k,...I||{},format:"jpeg"};return L(y(P),P)},webp:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(an(),On)),P={...k,...I||{},format:"webp"};return L(y(P),P)},download:async(k,I)=>{let{download:L}=await Promise.resolve().then(()=>(Ac(),Mc)),P={...k,...I||{}};return L(y(P),P)}};if(!o)for(let k of Object.keys(v)){let I=k==="download"?"download()":`to${k.charAt(0).toUpperCase()}${k.slice(1)}()`;v[k]=async()=>{throw r(I)}}let C={};for(let k of["img","svg","canvas","blob","png","jpeg","webp"])C[k]=async I=>v[k](e,{..._(k,I||{}),[lm]:!0});C.jpg=C.jpeg;let M=k=>Object.defineProperty({...e,...k},"options",{value:e,configurable:!0}),F=M({artifacts:e.__artifacts||null,export:S(),exports:C}),T=await To("defineExports",F),A=Object.assign({},...T.filter(k=>k&&typeof k=="object").reverse()),x={...v,...A};x.jpeg&&!x.jpg&&(x.jpg=(k,I)=>x.jpeg(k,I));function _(k,I){let L=I||{},P={...e,...L},N=typeof L.type=="string"?L.type.toLowerCase():"",B=typeof L.format=="string"?L.format.toLowerCase():Ec.has(N)?N:"";B&&(P.format=B==="jpg"?"jpeg":B),P.__explicitFormat=B?P.format:e.__explicitFormat??null,k==="blob"&&!P.__explicitFormat&&(P.format=i?"png":"svg"),P.type=P.format;let U=z=>z==="jpeg"||z==="jpg"||z==="webp";return[k,P.format,N].map(z=>typeof z=="string"?z.toLowerCase():"").find(U)&&(P.backgroundColor==null||P.backgroundColor==="transparent")&&(P.backgroundColor="#ffffff"),P.scale!==1&&(Number.isFinite(P.width)||Number.isFinite(P.height))&&D(P,"scale ignored: width/height already set the size."),P}let E=!1,$=Promise.resolve();async function R(k,I){let L=Object.freeze(I&&typeof I=="object"?{...I}:{}),P=async()=>{let B=x[k];if(!B)throw new Error(`[SnapDOM] Unknown export type: ${k}`);let U=_(k,L),V=M({artifacts:e.__artifacts||null,export:S({type:k,options:U,requestedOptions:L})}),z=U.format,at=U.type;await To("beforeExport",V,{format:k,options:U});let rt=U.format!==z?U.format:U.type!==at?U.type:"",pt=typeof rt=="string"?rt.toLowerCase():"";Ec.has(pt)&&(U.format=pt==="jpg"?"jpeg":pt,U.type=U.format,U.__explicitFormat=U.format,/^(?:jpeg|webp)$/.test(U.format)&&(U.backgroundColor==null||U.backgroundColor==="transparent")&&(U.backgroundColor="#ffffff"));let kt=await B(V,U);return await To("afterExport",V,{format:k,options:U,result:kt}),E||(E=!0,await Qt("afterSnap",e)),kt},N=$.then(P);return $=N.catch(()=>{}),N}let W={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!o)throw r("toRaw()");return a()},to:(k,I)=>R(k,I),toImg:k=>R("img",k),toSvg:k=>R("svg",k),toCanvas:k=>R("canvas",k),toBlob:k=>R("blob",k),toPng:k=>R("png",k),toJpg:k=>R("jpg",k),toWebp:k=>R("webp",k),download:k=>R("download",k)};o?i&&Object.defineProperty(W,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(W,"url",{get(){throw r("url")},enumerable:!1,configurable:!0}),Object.defineProperty(W,"meta",o?{value:e.meta,enumerable:!0}:{get(){throw r("meta")},enumerable:!1,configurable:!0});for(let k of Object.keys(x)){let I="to"+k.charAt(0).toUpperCase()+k.slice(1);W[I]||(W[I]=L=>R(k,L))}return W}Z.toRaw=(t,e)=>Z(t,e).then(n=>n.toRaw());Z.toImg=(t,e)=>Z(t,e).then(n=>n.toImg());Z.toSvg=(t,e)=>Z(t,e).then(n=>n.toSvg());Z.toCanvas=(t,e)=>Z(t,e).then(n=>n.toCanvas());Z.toBlob=(t,e)=>Z(t,e).then(n=>n.toBlob());Z.toPng=(t,e)=>Z(t,{...e,format:"png"}).then(n=>n.toPng());Z.toJpg=(t,e)=>Z(t,{...e,format:"jpeg"}).then(n=>n.toJpg());Z.toWebp=(t,e)=>Z(t,{...e,format:"webp"}).then(n=>n.toWebp());Z.download=(t,e)=>Z(t,e).then(n=>n.download());export{Ct as DEFAULT_STAGE,Qe as STAGES,gl as assertNeeds,Np as clearPlugins,ai as getGlobalPlugins,en as normalizePlugin,si as registerPlugins,Z as snapdom}; +}`,Xp=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Yt=null,Yp=0,Kp=0,Ae=new Map;function $l(){for(let t of Ae.values())t(void 0);if(Ae.clear(),Array.isArray(Yt))for(let t of Yt)try{t?.terminate()}catch{}Yt=!1}function Jp(){let t,e=null;try{t=URL.createObjectURL(new Blob([qp],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let o=Ae.get(n.data.id);o&&(Ae.delete(n.data.id),o(n.data.error?void 0:n.data.url??null))},e.onerror=$l}catch{e=null}return t&&URL.revokeObjectURL(t),e}function Qp(){if(Yt===!1)return!1;if(Yt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Yt=!1;Yt=[]}let t=Yp++%Xp;if(!Yt[t]){let e=Jp();if(!e)return $l(),!1;Yt[t]=e}return Yt[t]}var Zp=5e3;function th(t,e,n,o,r){let i=Qp();return i?new Promise(s=>{let a=++Kp,l=setTimeout(()=>{Ae.delete(a),s(void 0)},Zp);Ae.set(a,u=>{clearTimeout(l),s(u)});try{i.postMessage({id:a,dataURL:r?"":t,blob:r,srcLength:t.length,targetW:e,targetH:n,resFactor:Tl,quality:Fl,mime:o})}catch{clearTimeout(l),Ae.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function di(t,e,n,o){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let r=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,i=j.compress,s=i.get(r);if(s?.source===t)return s.result;let a=Lo.get(r);if(a?.source===t&&a.cache===i)return a.promise;let l=(async()=>{let c=Up(t),f=c==="image/jpeg"?"image/jpeg":c==="image/webp"?"image/webp":"image/png",d=Gp(t);if(d&&d.w>0&&d.h>0&&!Al(d.w,d.h,e,n))return null;if(t.length>=Hp){let C=await th(t,e,n,f,o);if(C!==void 0)return C}let h;try{h=await zp(t)}catch{return null}let m=h.naturalWidth||h.width,g=h.naturalHeight||h.height;if(!m||!g)return null;let p=Al(m,g,e,n);if(!p)return null;let y=p*Tl,b=Math.max(1,Math.round(m*y)),w=Math.max(1,Math.round(g*y)),S=document.createElement("canvas");S.width=b,S.height=w;let v=S.getContext("2d");if(!v)return null;v.imageSmoothingEnabled=!0,v.imageSmoothingQuality="high",v.drawImage(h,0,0,b,w);try{let C=S.toDataURL(f,Fl);if(typeof C=="string"&&C.startsWith("data:image")&&C.length{let f=c.getAttribute("src")||"";if(!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let d=parseFloat(c.dataset.snapdomWidth)||parseFloat(c.style.width)||c.width||0,h=parseFloat(c.dataset.snapdomHeight)||parseFloat(c.style.height)||c.height||0;if(!d||!h)return;let m=o.value||=ui(t,e),g=m.density*m.stretch(n.get(c)||c),p=await di(f,d*g,h*g,c.__snapdomBlob);p&&(i++,s+=f.length,a+=p.length,c.setAttribute("src",p),Io(c,"attribute","src",f,p,e))},u=6;for(let c=0;c{let c=n.get(u);if(!c||!c.isConnected)return;let f;try{f=getComputedStyle(c)}catch{return}if((f.backgroundRepeat||"repeat").toLowerCase().split(",").some(F=>F.trim()!=="no-repeat"))return;let h=(u.style.backgroundSize||f.backgroundSize||"auto").toLowerCase();if(h.split(",").some(F=>!nh.test(F.trim())))return;let{w:m,h:g}=oh(c);if(!m||!g)return;let p=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(F=>parseFloat(F)/100)),y=o.value||=ui(t,e),b=y.density*y.stretch(c)*p,w=m*b,S=g*b,v=u.style.backgroundImage,C=[...v.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],M=v;for(let F of C){let T=F[2];if(T.startsWith("data:image/svg"))continue;let A=await di(T,w,S);A&&(M=M.split(T).join(A),s++)}M!==v&&(u.style.setProperty("background-image",M,u.style.getPropertyPriority("background-image")),Io(u,"style","background-image",v,u.style.backgroundImage,e))},l=6;for(let u=0;u{let u=l.getAttribute("href")||(typeof l.getAttributeNS=="function"?l.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!u||!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let c=l.getAttribute("width")||"",f=l.getAttribute("height")||"";if(c.includes("%")||f.includes("%"))return;let d=n.get(l),h=d?O(d):l.style,m=(S,v)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[S]||""))return parseFloat(h[S]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(v.trim()))return parseFloat(v);try{return d?.[S]?.baseVal?.value||0}catch{return 0}},g=m("width",c),p=m("height",f);if(!g||!p)return;let y=o.value||=ui(t,e),b=y.density*y.stretch(d||l),w=await di(u,g*b,p*b);w&&(l.setAttribute("href",w),Io(l,"attribute","href",u,w,e),l.hasAttribute("xlink:href")&&(l.setAttributeNS(_l,"xlink:href",w),Io(l,"attribute","xlink:href",u,w,e)),i++)},a=6;for(let l=0;le+.5?t-n:o-n}function sh(t){let e=r=>r&&r!=="transparent"&&!/^rgba\(.*,\s*0\)$/.test(r),n=O(t.documentElement).backgroundColor,o=e(n)?n:O(t.body).backgroundColor;return e(o)?`;background-color:${o} !important`:""}var ah=/(?:^|;)(?:box-shadow|text-shadow|outline-style|filter|-webkit-filter):/;function lh(t,e){if(Y())return t;let n=t.indexOf("");if(n===-1)return t;let o=/]*>[\s\S]*?<\/style>/g,r=[],i=n,s;for(o.lastIndex=n;s=o.exec(t);)r.push({text:t.slice(i,s.index),intern:!0}),r.push({text:s[0],intern:!1}),i=o.lastIndex;r.push({text:t.slice(i),intern:!0});let a=new Map,l=/ style="([^"]*)"/g,u;for(let y of r)if(y.intern)for(l.lastIndex=0;u=l.exec(y.text);)a.set(u[1],(a.get(u[1])||0)+1);let c=0;for(let[y,b]of a)b>1&&(c+=(b-1)*y.length);if(c<2048||t.includes(" data-sdi="))return t;let f=ch(e,r.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(f===null)return t;let d=new Map,h=0,m=[],g=(y,b)=>{if((a.get(b)||0)<2||f.has(b))return y;let w=d.get(b);return w===void 0&&(w="i"+(h++).toString(36),d.set(b,w),m.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},p="";for(let y of r)p+=y.intern?y.text.replace(l,g):y.text;return t.slice(0,n)+m.join("")+p}function ch(t,e,n){let o=new Set;if(!e&&!n)return o;if(!t||t.querySelector("[data-sdi]"))return null;let r=l=>{let u=l.getAttribute("style");u&&o.add(u)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(r),e)try{let l=u=>{for(let c of u){if(c.type===CSSRule.IMPORT_RULE||c.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(c.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(c.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(c.selectorText).forEach(r)}c.cssRules&&l(c.cssRules)}};for(let u of[...t.querySelectorAll("style")].slice(1)){let c=u.textContent||"";if(/@import\b/i.test(c))return null;let f=new CSSStyleSheet;f.replaceSync(c),l(f.cssRules)}}catch{return null}let i=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let l of o){s.setAttribute("style",l);let u=a.serializeToString(s).match(/ style="([^"]*)"/);u&&i.add(u[1])}return i}async function Bo(t,e){let{clipWindow:n,outerTransforms:o,outerShadows:r,rootTransform2D:i,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:K,...Q}=t;t=Object.assign(a,Q),Object.defineProperty(t,"options",{value:t,configurable:!0})}let l,u;Ao(t,s),await te("beforeRender",t);let c=O(t.element),f=t.element.getBoundingClientRect(),d=Math.max(1,H(t.element.offsetWidth||parseFloat(c.width)||f.width||1)),h=Math.max(1,H(t.element.offsetHeight||parseFloat(c.height)||f.height||1)),m=t.element.ownerDocument||document,g=!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned,p=null,y=null,b=0;if(g){let K=Math.max(t.element.scrollHeight||0,m.documentElement?.scrollHeight||0,m.body?.scrollHeight||0),Q=Math.max(t.element.scrollWidth||0,m.documentElement?.scrollWidth||0,m.body?.scrollWidth||0),ot=Math.max(d,H(Q)),rt=t.element===m.body,$t=rt&&O(m.documentElement).direction==="rtl",yt=J=>{J>0&&($t?b=Math.max(b,H(J-f.width)):d=Math.max(d,H(J)))};if(rt&&m.documentElement){let J=m.documentElement.getBoundingClientRect(),at={top:Math.max(0,f.top-J.top),right:Math.max(0,J.right-f.right),bottom:Math.max(0,J.bottom-f.bottom),left:Math.max(0,f.left-J.left)};if(p=at,r!=="subtree"&&(at.top||at.right||at.bottom||at.left)){let wt=t.__session?.styleMap,dn=new Map,Un=new Map;for(let[oe,Ot]of t.nodeMap){let Dt=wt?.get(oe);if(Dt){let or=dn.get(Dt);if(or===void 0&&dn.set(Dt,or=ah.test(Dt)),!or)continue}Un.set(oe,Ot)}let qt=Qr(t.element,Un,t.styleCache,f.width>0?d/f.width:1,f.height>0?h/f.height:1);y={top:Math.min(qt.top,at.top),right:Math.min(qt.right,at.right),bottom:Math.min(qt.bottom,at.bottom),left:Math.min(qt.left,at.left)}}K=Math.max(t.element.scrollHeight||0,sn(K,J.height,f.top-J.top,f.bottom-J.top)),Q=Math.max(t.element.scrollWidth||0,$t?sn(Q,J.width,J.right-f.right,J.right-f.left):sn(Q,J.width,f.left-J.left,f.right-J.left))}K>0&&(h=Math.max(h,H(K))),yt(Q);try{let J=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,at=j.measureHints.get(t.element);if(at&&at.cssLen===J&&at.w0===ot&&at.docH===K&&at.docW===Q)at.csh>0&&(h=Math.max(h,H(at.csh))),yt(at.csw);else{let wt=m.createElement("div");Z(wt),wt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+ot+"px!important;overflow:visible!important;visibility:hidden!important;";let dn=wt.attachShadow({mode:"open"});Ln(dn,(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS);let Un=dn.appendChild(ri(t.clone));m.body.appendChild(wt);let qt=wt.scrollHeight,oe=wt.scrollWidth;if(rt){let Ot=wt.getBoundingClientRect(),Dt=Un.getBoundingClientRect();qt=sn(qt,Ot.height,Dt.top-Ot.top,Dt.bottom-Ot.top),oe=$t?sn(oe,Ot.width,Ot.right-Dt.right,Ot.right-Dt.left):sn(oe,Ot.width,Dt.left-Ot.left,Dt.right-Ot.left)}m.body.removeChild(wt),j.measureHints.set(t.element,{cssLen:J,w0:ot,docH:K,docW:Q,csh:qt,csw:oe}),qt>0&&(h=Math.max(h,H(qt))),yt(oe)}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let K=oi(t.element,t.options),Q=1,ot=oi(t.element,{}),rt=Math.max(2,h*.15);Number.isFinite(ot)&&ot>=h-rt&&Number.isFinite(K)&&K>0&&(h=Math.max(1,Math.min(h,H(K+Q))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;ll(t.element,t.clone,K,t.nodeMap,d,h)}catch(K){et(t.options.__session,"reconcile-failed","reconcile pass failed",K),D(t.options,"reconcile couldn't run; captured without it.",K)}let w=(K,Q=NaN)=>{let ot=typeof K=="string"?parseFloat(K):K;return Number.isFinite(ot)?ot:Q},S=w(t.options.width),v=w(t.options.height),C=n?H(n.width):d,M=n?H(n.height):h,F=C,T=M,A=Number.isFinite(S),x=Number.isFinite(v),E=M>0?C/M:1;A&&x?(F=Math.max(1,H(S)),T=Math.max(1,H(v))):A?(F=Math.max(1,H(S)),T=Math.max(1,H(F/(E||1)))):x&&(T=Math.max(1,H(v)),F=Math.max(1,H(T*(E||1))));let _=0,$=0,R=d,W=h;if(n){let K=0,Q=0;if(pi(t.element)){let rt=null;if(!o&&i&&Number.isFinite(i.a))rt={a:i.a,b:i.b||0,c:i.c||0,d:i.d||1,e:0,f:0};else{let $t=ke(t.element),yt=ni(c.transform&&c.transform!=="none"?c.transform:"",$t);yt&&yt.is2D&&(rt={a:yt.a,b:yt.b,c:yt.c,d:yt.d,e:0,f:0})}if(rt&&!(rt.a===1&&rt.b===0&&rt.c===0&&rt.d===1)){let{ox:$t,oy:yt}=$n(c,d,h),J=Ze(d,h,rt,$t,yt);K=J.minX,Q=J.minY}}let ot=Y()?0:(a.dpr||1)*(A||x?F/C:a.scale||1);_=H(ot?Math.round((n.x+K)*ot)/ot:n.x+K),$=H(ot?Math.round((n.y+Q)*ot)/ot:n.y+Q),R=H(_+n.width),W=H($+n.height)}else if(!o&&i&&Number.isFinite(i.a)){let K={a:i.a,b:i.b||0,c:i.c||0,d:i.d||1,e:0,f:0},Q=Ze(d,h,K,0,0);_=H(Q.minX),$=H(Q.minY),R=H(Q.maxX),W=H(Q.maxY)}else if(o&&pi(t.element)){let Q=c.transform&&c.transform!=="none"?c.transform:"",ot=ke(t.element),rt=de({baseTransform:Q,rotate:ot.rotate||"0deg",scale:ot.scale,translate:ot.translate,width:d,height:h}),{ox:$t,oy:yt}=$n(c,d,h),J=rt.is2D?rt:new DOMMatrix(rt.toString()),at={a:J.a,b:J.b,c:J.c,d:J.d,e:0,f:0},wt=Ze(d,h,at,$t,yt);_=H(wt.minX),$=H(wt.minY),R=H(wt.maxX),W=H(wt.maxY)}let k=qr(c),I=Xr(c),L=Yr(c),P=Kr(c),N=Jr(c),B=f.width>0?(R-_)/f.width:1,U=f.height>0?(W-$)/f.height:1,V=r==="subtree"&&!n?Qr(t.element,t.nodeMap,t.styleCache,B,U):{top:0,right:0,bottom:0,left:0};y&&(V={top:y.top,right:Math.max(0,y.right-(d-f.width)),bottom:Math.max(0,y.bottom-(h-f.height)),left:y.left}),b>0&&(V={...V,left:Math.max(V.left,b)});let z=n?{top:0,right:0,bottom:0,left:0}:r?{top:H(Math.max(k.top,I.top,V.top)+L.top+P.top+N.bleed.top),right:H(Math.max(k.right,I.right,V.right)+L.right+P.right+N.bleed.right),bottom:H(Math.max(k.bottom,I.bottom,V.bottom)+L.bottom+P.bottom+N.bleed.bottom),left:H(Math.max(k.left,I.left,V.left)+L.left+P.left+N.bleed.left)}:{top:H(L.top+V.top),right:H(L.right+V.right),bottom:H(L.bottom+V.bottom),left:H(L.left+V.left)};_=H(_-z.left),$=H($-z.top),R=H(R+z.right),W=H(W+z.bottom);let lt=Math.max(1,H(R-_)),st=Math.max(1,H(W-$)),ht="http://www.w3.org/2000/svg",Mt=pi(t.element)?2:0,ct=H(Mt+(o?0:1)),Kt=a.__subpixel?.x||0,Te=a.__subpixel?.y||0,q=Math.ceil(lt+ct*2+Kt),X=Math.ceil(st+ct*2+Te),G=H(-(H(_)-ct)),gt=H(-(H($)-ct)),nt=m.defaultView||window,ft=!Y()&&CSS.supports("zoom","2")?fh(nt):1;a.__layoutZoom=ft;let $e=n&&!Y(),Gt=$e?H(G-Math.floor(G*ft+.01)/ft):0,ne=$e?H(gt-Math.floor(gt*ft+.01)/ft):0,Jt=Math.min(0,G-Gt)-(Gt?1/ft:0),Pe=Math.min(0,gt-ne)-(ne?1/ft:0),Wt=G-Gt-Jt+Kt,Ne=gt-ne-Pe+Te,un=H(q-Jt),Le=H(X-Pe),dt=document.createElementNS(ht,"foreignObject");dt.setAttribute("x",String(Jt*ft)),dt.setAttribute("y",String(Pe*ft)),dt.setAttribute("width",String(un*ft)),dt.setAttribute("height",String(Le*ft)),dt.style.overflow="visible";let zi=document.createElement("style"),Pc="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";zi.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+Pc+t.classCSS,dt.appendChild(zi);let Ie=document.createElement("div");Ie.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ie.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${a.__subpixel?H(Wt+f.width):un}px;height:${Le}px`+(Wt!==0||Ne!==0?`;padding:${Ne}px 0 0 ${Wt}px !important`:"")+(ft!==1?`;zoom:${ft} !important`:"")+";direction:ltr !important"+(p?sh(m):""),p&&(Wt!==p.left||Ne!==p.top)&&t.__session&&el(t.element,t.nodeMap,t.__session.styleMap,t.styleCache,Wt-p.left,Ne-p.top),Ie.appendChild(t.clone),dt.appendChild(Ie);let Ui=new XMLSerializer,Nc=Ui.serializeToString(dt),Hi=A||x,Lc=Object.freeze({w0:C,h0:M,vbW:q,vbH:X,targetW:F,targetH:T,contentX:H(G+(n?_:0)),contentY:H(gt+(n?$:0)),clip:n?Object.freeze({x:H(_),y:H($),width:C,height:M}):null});Object.defineProperty(a,"meta",{value:Lc,enumerable:!0,writable:!1,configurable:!0});let Ic=!Hi||Y()?q:A?F:H(q*(T/X)),Wc=!Hi||Y()?X:x?T:H(X*(F/q)),Oc=parseFloat(O(m.documentElement)?.fontSize)||16,er=[Gt||ne?`translate(${Gt} ${ne})`:"",ft!==1?`scale(${1/ft})`:""].join(" ").trim(),zn=`${er?``:""}`,ji=er?"":"";if(u=zn+lh(Nc,dt)+ji,a.__fileSvg=null,ft!==1){let K=yt=>{let J=Ui.serializeToString(yt.cloneNode(!1));return J.slice(0,J.indexOf(">")+1).replace(/\/>$/,">")},Q=dt.cloneNode(!1);Q.setAttribute("x",String(Jt)),Q.setAttribute("y",String(Pe)),Q.setAttribute("width",String(un)),Q.setAttribute("height",String(Le));let ot=Ie.cloneNode(!1);ot.style.removeProperty("zoom");let rt=Gt||ne?`translate(${Gt} ${ne})`:"",$t=zn.slice(0,zn.indexOf(">")+1)+(rt?``:"");a.__fileSvg={zoomed:[zn+K(dt),K(Ie),ji],flat:[$t+K(Q),K(ot),rt?"":""]}}l=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,t.svgString=u,t.dataURL=l,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await te("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let nr=[...document.querySelectorAll("#snapdom-sandbox")].find(Xt);return nr&&nr.style.position==="absolute"&&nr.remove(),t.dataURL}function pi(t){return Ja(t)}function fh(t){let e=t.devicePixelRatio||1;if(e===1)return 1;let n=t.document,o=e;try{let r=n.createElement("div");Z(r),r.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:0!important;height:0!important;visibility:hidden!important;pointer-events:none!important;border:0 solid transparent!important;border-top-width:0.5px!important",(n.body||n.documentElement).appendChild(r);let i=parseFloat(t.getComputedStyle(r).borderTopWidth);r.remove(),i>=1&&(o=1)}catch{}return o}Me();Pn();function ph(t){let e=Array.isArray(t.plugins)?t.plugins:fi(),n=[];for(let o of e){let r=rn(o);r&&typeof r.resolveNode=="function"&&n.push(r.resolveNode.bind(r))}return n.length?n:null}async function Il(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=ai(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=ph(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let o,r,i,s,a,l,u,c,f="",d=null,h=e.needs||kt,m=n.format,g=n.type;await te("beforeSnap",n);let p=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),y=n.type!==g&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(p||y){let _=String(p?n.format:n.type).toLowerCase();n.format=_==="jpg"?"jpeg":_,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await te("beforeClone",n);let b=n.outerTransforms!==!1,w=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,S=n.clip?ko(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=_s(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let v=ps(e.fast);for(;;){e.__slicer=v;let _=$o(n.element,S);try{({clone:o,classCSS:r,classPrefixCSS:i,styleCache:s,nodeMap:a,reconcileRisk:l,clipWindow:u,standIns:c}=await fl(n.element,n.options)),l>0&&!e.reconcile&&(et(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),e.debug&&!j.warnedReconcile&&(j.warnedReconcile=!0,D(e,"Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!b&&o&&(d=Ka(n.element,o)),!w&&o&&ol(n.element,o,n.options),o&&(sl(n.element,o,a,c),rl(n.element,o))}finally{_()}if(!v?.yielded||!e.__tornSinceStart?.())break;v=null,e.__session=ai(e.cache)}if(e.__slicer=null,n.clone=o,n.classCSS=r,n.styleCache=s,n.nodeMap=a,await te("afterClone",n),!nn(h,"render"))return null;if(v?.due()&&await v.pause(),Mo(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{al(n.element,n.clone,n.styleCache,n.nodeMap)}catch(_){et(e.__session,"shrink-failed","shrink pass failed",_),D(e,"Couldn't close the gaps left by removed elements.",_)}try{await fo(n.clone,n.element,n.nodeMap)}catch{}try{let _=e.__session?.styleMap;_&&uo(_.keys(),_,n.nodeMap,n.options.__iconMatchers)}catch{}let C=_=>Promise.resolve().then(_),M=(async()=>{await Promise.all([C(()=>Eo(n.clone,n.options)),C(()=>Fo(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{pl(n.element,n.clone,n.nodeMap)}catch(_){et(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",_),D(e,"Couldn't reproduce a backdrop-filter; captured without it.",_)}if(e.compress&&(e.__compressionClip=u,e.__compressionRootTransform=d,await C(()=>Do(n.clone,n.options,n.nodeMap))),e.captureSelection)try{ca(n.nodeMap)}catch(_){et(e.__session,"selection-compose-failed","field selection compose failed",_)}})(),F=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(F=C(async()=>{let _=n.element.ownerDocument||document,$=S?L=>{try{let P=L.getBoundingClientRect();return P.right>=S.left-200&&P.left<=S.right+200&&P.bottom>=S.top-200&&P.top<=S.bottom+200}catch{return!0}}:null,{required:R,usedCodepoints:W}=!S&&e.__fontUsage||wo(n.element,$),k=R,I=R;if(e.embedFonts==="auto"){let{declared:L,drawn:P}=bo(_),N=B=>Fn(B).toLowerCase();if(k=new Set(Array.from(R).filter(B=>P.has(N(B)))),!k.size)return;I=new Set(Array.from(R).filter(B=>P.has(N(B))||!L.has(N(B))))}Y()&&await xo(k,W,_),f=await $a({required:I,usedCodepoints:W,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:_,debug:n.options.debug})})),await Promise.all([M,F]);let A=(n.options.plugins||[]).some(_=>_&&(typeof _.beforeRender=="function"||typeof _.afterRender=="function"));if(n.options.engine==="html-in-canvas"&&!A){let{tryCanvasEngine:_}=await Promise.resolve().then(()=>(Ll(),Nl));Ao(n,f);let $=await _(n,n.options);if($)return $}v?.due()&&await v.pause();let x=n.clone;Oo(x,e.__compressedAssets);let E=await Bo(n,{clipWindow:u,outerTransforms:b,outerShadows:w,rootTransform2D:d,fontsCSS:f});if(e.__compressedSnapshot=Wo(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:o,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:i,fontsCSS:f,clipWindow:u,outerTransforms:b,outerShadows:w,rootTransform2D:d,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return E}At();vt();xt();var hh=new Set(["png","jpeg","jpg","webp","svg"]);function Wl(t={}){let e=typeof t.type=="string"&&hh.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let o=t.format!=null?n:e==="jpg"?"jpeg":e,r=Vi(t.cache),i=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let f of i)if(typeof f=="string")try{document.createDocumentFragment().querySelector(f),s.push(f)}catch{D(t,`Invalid exclude selector "${f}"; ignored.`)}else typeof f=="function"?a.push(f):f!=null&&D(t,"Ignored an exclude entry: use a CSS selector or a function.",f);let l=t.excludeMode??"hide",u=f=>{if(!f||f.nodeType!==1)return!1;if(f.getAttribute("data-capture")==="exclude")return!0;for(let d of Array.isArray(c.exclude)?c.exclude:[])try{if(f.matches(d))return!0}catch{}for(let d of Array.isArray(c.excludePredicates)?c.excludePredicates:[])try{if(d(f))return!0}catch{}if(typeof c.filter=="function")try{if(!c.filter(f))return!0}catch{}return!1},c={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:l,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:u,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:ut(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:va(t.iconFonts,t),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:r,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:o,type:n,quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(n)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst,fast:t.fast===!1||t.fast==="auto"?t.fast:!0,engine:t.engine,invalidate:t.invalidate??!1,__pinned:t.__pinned===!0,__subpixel:t.__subpixel??null,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return c}mt();xt();Ft();Ft();Ft();Rt();Me();var Ol="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function mh(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var gh=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function yh(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(gh.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function bh(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(i=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(i.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let o=[t];t.querySelectorAll&&o.push(...t.querySelectorAll("*"));for(let r of o){let i=getComputedStyle(r),s=i.getPropertyValue("backdrop-filter")||i.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var wh=1/16;function xh(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),o=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n-o)<=wh}var zo=new Map,Sh=["width","height","min-width","min-height"];function vh(t){let e=zo.get(t);if(e===void 0){e=null;for(let n of Sh){let o=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));o&&o[1].endsWith("px")&&((e||={})[n]=o[1])}zo.size>5e3&&zo.clear(),zo.set(t,e)}return e}function Ch(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function kh(t,e){let n=[t];for(;n.length;){let o=n.pop();if(o.nodeType===1){let r=e.nodeMap.get(o);r!==void 0&&(e.nodeMap.delete(o),e.srcToClone.get(r)===o&&e.srcToClone.delete(r)),e.styleMap.delete(o)}for(let r=o.firstChild;r;r=r.nextSibling)n.push(r)}}var hi={attempts:0,served:0,reconciled:0};async function Dl(t,e,n){hi.attempts++;try{let o=await Mh(t,e,n);return o&&hi.served++,o}catch{return null}}async function Mh(t,e,n){let o=e.retained;if(!o||!o.clone||!o.styleMap||!o.srcToClone||n.reconcile||n.clip||n.captureSelection||o.clipWindow||t.scrollTop||t.scrollLeft||mh(t)||yh(o)||o.fontsCSS||No(n))return null;for(let d of n.plugins||[])if(d&&(typeof d.beforeSnap=="function"||typeof d.beforeClone=="function"||typeof d.resolveNode=="function"||typeof d.afterClone=="function"))return null;if(o.classPrefixCSS&&(o.classPrefixCSS.includes("::marker")||o.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let r=t.ownerDocument||document,i=Mn(t);if(!i||As(r))return null;let s=[];t:for(let d of e.dirtyRoots){if(!d.isConnected||d===t||!t.contains(d))return null;for(let h of e.dirtyRoots)if(h!==d&&h!==t&&h.contains(d))continue t;s.push(d)}if(!s.length)return null;n.__compressedAssets=o.__compressedAssets,n.__compressionDensity=o.__compressionDensity,n.__compressionRootTransform=o.rootTransform2D;for(let d of s){if(d.parentElement===t||d.matches?.(Ol)||d.querySelector?.(Ol)||bh(d,i))return null;let h=o.srcToClone.get(d);if(!h||!h.parentNode)return null;let m=new Map,g={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:m,options:n},p=$o(d,null),y=Co(d),b;try{b=await ue(d,g,n)}finally{y(),p()}if(!b||b.nodeType!==1||b.querySelector?.("style[data-sd]")||(await Qe(d,b,g,n),g.__pseudoCSS)||g.__usesPlaceholder&&!o.classPrefixCSS?.includes("[data-sd-ph]"))return null;await ro(b,g),Mo(b);try{await fo(b,d,m)}catch{}try{uo([b,...b.querySelectorAll("*")],o.styleMap,m,n.__iconMatchers)}catch{}if(await Promise.all([Eo(b,n),Fo(d,b,o.styleCache,n,m)]),n.compress)try{await Do(b,n,m)}catch{}for(let[w,S]of m.entries())si(w,S,m,o.styleCache);h.replaceWith(b),kh(h,o);for(let[w,S]of m.entries())o.nodeMap.set(w,S),o.srcToClone.set(S,w)}let a={styleMap:o.styleMap,styleCache:o.styleCache,nodeMap:o.nodeMap,options:n},l=new WeakSet;for(let[d,h]of o.nodeMap.entries()){if(!h||h.nodeType!==1||!h.isConnected)continue;let m=o.styleMap.get(d);if(!m)continue;let g=vh(m);if(!g)continue;let p=null,y=!1;for(let b in g){p||=getComputedStyle(h);let w=p.getPropertyValue(b);if(b==="min-width"&&w==="auto"&&!l.has(h.parentElement)){let S=parseFloat(p.width);p.boxSizing!=="border-box"&&m.includes("box-sizing:border-box")&&(S+=["padding-left","padding-right","border-left-width","border-right-width"].reduce((v,C)=>v+(parseFloat(p.getPropertyValue(C))||0),0)),w=`${S}px`}if(!xh(w,g[b])){y=!0;break}}if(y){if(n.__compressedAssets?.has(d))return null;l.add(h),hi.reconciled++,await St(h,d,a,n)}}let u=gn(o.styleMap);for(let[d,h]of o.styleMap.entries())Ch(d),ii(d,h,u);let c=(o.classPrefixCSS||"")+Array.from(u.entries()).map(([d,h])=>`.${h}{${d}}`).join("");Oo(o.clone,n.__compressedAssets);let f=await Bo({element:t,options:n,plugins:n.plugins,clone:o.clone,classCSS:c,styleCache:o.styleCache,nodeMap:o.nodeMap},{clipWindow:null,outerTransforms:o.outerTransforms,outerShadows:o.outerShadows,rootTransform2D:o.rootTransform2D,fontsCSS:o.fontsCSS||""});return n.__compressedSnapshot=Wo(o.clone,n.__compressedAssets),o.__compressedAssets=n.__compressedAssets,o.__compressionDensity=n.__compressionDensity,f}vt();mt();var gi=new WeakMap,Ho=new WeakMap,Kl=new WeakSet,mi=new WeakMap,Ah=64,Wn=new Map,Jl=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],_h=["(prefers-color-scheme: dark)","(prefers-reduced-motion: reduce)","(prefers-contrast: more)","(forced-colors: active)","(inverted-colors: inverted)","(prefers-reduced-transparency: reduce)","(hover: hover)","(any-hover: hover)","(pointer: coarse)","(any-pointer: coarse)","(color-gamut: p3)","(dynamic-range: high)"];function Eh(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":_h.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function Bl(t){let e=[];for(let n=t;n;){try{let o=n.getBoundingClientRect();e.push(o.x,o.y,o.width,o.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=Bt(n)||null}return e.join("|")}function zl(t,e){if(e.disposed||(Wn.delete(t),Wn.set(t,e),Wn.size<=Ah))return;let[n,o]=Wn.entries().next().value;Ql(n,o)}function Ql(t,e){e.disposed=!0,Wn.delete(t),gi.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of Jl)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let o of bi)n.removeEventListener(o,e.onMediaDirty,!0);for(let[n,o]of e.trackedImages)n.removeEventListener("load",o),n.removeEventListener("error",o);e.trackedImages.clear(),e.trackedShadowRoots.clear(),e.images.length=0,e.controls.length=0,e.scrollNodes.length=0,e.observers.length=0,e.last=null,e.retained=null,e.retainedFrameDriven=!1}function Zl(t){if(Kl.has(t))return!1;Ho.delete(t);let e=[t],n=[],o=[];for(let r=0;r=0&&e.observers.splice(s,1)}for(let r of o)if(!e.trackedShadowRoots.has(r))try{let i=new MutationObserver(e.markDirty);i.observe(r,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),i.__flush=e.markDirty,e.observers.push(i),e.trackedShadowRoots.set(r,i);for(let s of bi)r.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var bi=["scroll","change","beforetoggle","toggle"];function jo(t,e){return[t,...e.trackedShadowRoots.keys()]}function wi(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let o of jo(t,e))o.querySelectorAll&&n.push(...o.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let o=new Set(n);for(let[r,i]of e.trackedImages)o.has(r)||(r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r))}for(let o of n){if(o.complete||e.trackedImages.has(o))continue;let r=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,o.removeEventListener("load",r),o.removeEventListener("error",r),e.trackedImages.delete(o)};e.trackedImages.set(o,r),o.addEventListener("load",r),o.addEventListener("error",r)}}function Ul(t){let e=new Map,n=new Map,o=new Map;for(let r of t)if(xe(r))if(r.type==="attributes"){let i=e.get(r.target);i||e.set(r.target,i=new Map),i.has(r.attributeName)||i.set(r.attributeName,r.oldValue)}else if(r.type==="characterData")n.has(r.target)||n.set(r.target,r.oldValue);else if(r.type==="childList"){let i=o.get(r.target);i||o.set(r.target,i=new Map);for(let s of r.addedNodes){if(s.nodeType!==3)return!0;i.set(s.data,(i.get(s.data)||0)+1)}for(let s of r.removedNodes){if(s.nodeType!==3)return!0;i.set(s.data,(i.get(s.data)||0)-1)}}else return!0;for(let[r,i]of e)for(let[s,a]of i)if(r.getAttribute(s)!==a)return!0;for(let[r,i]of n)if(r.data!==i)return!0;for(let r of o.values())for(let i of r.values())if(i!==0)return!0;return!1}var Rh=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,ln=t=>t&&(typeof t=="object"||typeof t=="function")?Uo(t):"-";function Fh(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let o=t.slice(0,n),r=t.slice(n+1);try{if(/;base64/i.test(o)){let i=Math.ceil(e/3)*4;return atob(r.slice(0,i-i%4))}return r.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(i,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function Th(t){let e=(t.match(/^data:([^;,]+)/i)?.[1]||"").toLowerCase();if(e==="image/gif"||e==="image/apng")return!0;if(!/image\/(?:png|webp|avif|svg\+xml)/.test(e))return!1;let n=Fh(t);return e==="image/png"?n.includes("acTL"):e==="image/webp"?n.includes("ANIM")||n.includes("ANMF")||n.includes("VP8X")&&!!(n.charCodeAt(n.indexOf("VP8X")+8)&2):e==="image/avif"?n.includes("avis"):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function Hl(t){let e=String(t||"").trim();return e?Rh.test(e)?!0:/^data:/i.test(e)?Th(e):!1:!1}function cn(t){let e=String(t||"");if(Hl(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(Hl(n[1]??n[2]??n[3]))return!0;return!1}function jl(t,e=null){let n=t&&t.clone;if(!n)return!1;let o=e?e.map(r=>t.srcToClone?.get(r)).filter(Boolean):[n];for(let r of o)for(let i of tc(r))if(cn(i.getAttribute?.("src"))||cn(i.getAttribute?.("href"))||cn(i.getAttribute?.("style"))||cn(t.styleMap?.get(i)))return!0;return!1}function tc(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function xi(t,e){let n=[],o=new Set,r=i=>{i&&!o.has(i)&&(o.add(i),n.push(i))};t.matches?.("input,textarea,select,option")&&r(t);for(let i of jo(t,e))try{for(let s of i.querySelectorAll("input,textarea,select,option"))r(s)}catch{}e.controls=n}function Si(t,e){let n=[],o=new Set,r=(i,s=!1)=>{if(!(!i||o.has(i))){o.add(i);try{(s||i.scrollLeft||i.scrollTop||i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight)&&n.push(i)}catch{}}};for(let i=t;i;i=i.parentElement)r(i,!0);for(let i of jo(t,e))for(let s of tc(i))r(s);e.scrollNodes=n}function Vl(t,e){let n=t.ownerDocument||document,o=n.defaultView,r=[o?.location?.hash||"",Eh(n),o?.innerWidth||0,o?.innerHeight||0,o?.devicePixelRatio||1,o?.screen?.orientation?.type||""];try{r.push(...[...n.adoptedStyleSheets||[]].map(ln))}catch{}for(let c of e.trackedShadowRoots.keys())try{r.push("#shadow",...[...c.adoptedStyleSheets||[]].map(ln))}catch{}let i=n.activeElement,s=n.fullscreenElement;(i?.contains(t)||t.contains(i))&&r.push(ln(i)),(s?.contains(t)||t.contains(s))&&r.push(ln(s));let a=[o?.scrollX||0,o?.scrollY||0];for(let c of e.scrollNodes)a.push(c.scrollLeft||0,c.scrollTop||0);let l=[];for(let c of e.controls){let f=String(c.localName||"").toLowerCase();f==="input"?l.push(c.type,hn(c)?c.value.length:c.value,c.checked?1:0,c.indeterminate?1:0):f==="textarea"?l.push(c.value):f==="select"?l.push(c.selectedIndex,c.value):l.push(c.selected?1:0)}let u=[];for(let c of e.images){let f="";try{f=c.currentSrc||c.src||""}catch{}u.push(f,c.complete?1:0,c.naturalWidth||0,c.naturalHeight||0)}return{style:r.join("|"),scroll:a.join("|"),controls:l,images:u,frameDriven:e.retainedFrameDriven}}function an(t,e,n){if(!t)return!1;let o=t[n],r=e[n];if(o===r)return!0;if(!Array.isArray(o)||o.length!==r.length)return!1;for(let i=0;i[ln(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function $h(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let o of e.trackedShadowRoots.keys())if(o.contains(n))return o;return null}function Ph(t){let e={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:je(),styleEpoch:Se(),styleStamp:kn(t),outsideMutations:Cn(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},o=a=>{if(!e.dirtyRoots)return;let l=a&&(a.nodeType===1?a:a.parentElement);if(!l||l===t||!t.contains(l)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(l)},r=a=>{if(e.capturing){for(let l of a)e.pending.push(l);return}for(let l of a)xe(l)&&(e.dirty=!0,o(l.target))},i=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(r);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=r,e.observers.push(a)}catch{}e.markDirty=r,e.onMediaDirty=i;try{for(let a of Jl)t.addEventListener(a,i,{capture:!0,passive:!0})}catch{}return yi(t,e)||xi(t,e),Si(t,e),wi(t,e),e}var Nh=0,Xl=new WeakMap;function Uo(t){let e=Xl.get(t);return e||(e="@"+ ++Nh,Xl.set(t,e)),e}function vi(t,e){let n=typeof t;if(n==="undefined")return null;if(t===null||n==="boolean"||n==="number"||n==="string")return JSON.stringify(t);if(n==="function"||n==="symbol")return n==="symbol"?null:JSON.stringify(Uo(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(Uo(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let i=[];for(let s of t){let a=vi(s,e);if(a===null)return null;i.push(a)}return"["+i.join(",")+"]"}let o=Object.getPrototypeOf(t);if(o!==Object.prototype&&o!==null)return JSON.stringify(Uo(t));let r=[];for(let i of Object.keys(t).sort()){let s=t[i];if(s===void 0)continue;let a=vi(s,e);if(a===null)return null;r.push(JSON.stringify(i)+":"+a)}return"{"+r.join(",")+"}"}finally{e.delete(t)}}function Yl(t,e){let{burst:n,invalidate:o,...r}=t||{};try{let i=vi(r,new Set);return i===null?null:`${(e||[]).map(ln).join(",")}:${i}`}catch{return null}}function ec(t,e,n,o,r=null){let i=gi.get(t);i||(i=Ph(t),i.baselineSignature=Yl(e,n.plugins),gi.set(t,i));let s=Yl(e,n.plugins),a=async()=>{if(await Xn(),i.disposed)return o();let u=s===null||s!==i.baselineSignature;u&&s!==null?i.pendingSig===s?(i.baselineSignature=s,i.last=null,i.dirty=!0,i.dirtyRoots=null,i.pendingSig=null,u=!1):i.pendingSig=s:i.pendingSig=null,yi(t,i),wi(t,i);for(let M of i.observers)M.__flush(M.takeRecords());Ut();let c=Cn(t);i.dirty&&i.outsideMutations!==c&&i.dirtyAll(),i.outsideMutations=c;let f=t.getRootNode?.(),d=[...i.trackedShadowRoots.keys()];f?.nodeType===11&&!d.includes(f)&&d.push(f),to(t.ownerDocument||document,d);let h=kn(t);i.styleStamp!==h&&(i.styleStamp=h,i.dirty||i.dirtyAll());let m=Vl(t,i),g=Gl(t,i);m.animation=ql(g),i.renderState&&(!an(i.renderState,m,"style")&&(Ve(),i.dirtyAll()),an(i.renderState,m,"scroll")||i.dirtyAll(),an(i.renderState,m,"controls")||(ve(t),i.dirtyAll()),!an(i.renderState,m,"images")&&!i.dirty&&i.dirtyAll());let p=je();i.envEpoch!==p&&(i.dirtyAll(),i.envEpoch=p);let y=Se();if(i.styleEpoch!==y&&(i.styleEpoch=y,!i.dirty)){let M=Bl(t);i.geometry!==null&&M!==i.geometry&&(ve(t),i.dirtyAll()),i.geometry=M}n.invalidate&&i.dirtyAll();let b=!1,w=!!i.renderState&&!an(i.renderState,m,"animation");try{let M=new Set;w&&g.length===0&&(M=null);for(let F of g){let T=F.playState==="running";if(!T&&!w)continue;T&&(b=!0),w=!0;let A=F.effect?.target;if($h(t,i,A)===t)M.add(A);else{M=null;break}}if(w&&M&&M.size&&i.retained){i.dirty=!0;for(let F of M)i.dirtyRoots&&i.dirtyRoots.add(F),ve(F)}else w&&!M&&i.dirtyAll()}catch{}let S=m.frameDriven,v=b||S;if(v&&(i.last=null),S&&i.dirtyAll(),!u&&!v&&!i.dirty&&i.last)return zl(t,i),i.last;i.capturing=!0;let C=null;try{let M=null,F=!1,T=null;if(!u&&i.dirty&&i.retained&&i.dirtyRoots&&i.dirtyRoots.size&&r){T=[...i.dirtyRoots];let A=await Dl(t,i,n);A&&(M=await r(A),F=!0)}if(M||(u||(n.__retain=A=>{let x=new Map;for(let[E,_]of A.nodeMap.entries())x.set(_,E);C={...A,srcToClone:x}}),n.__tornSinceStart=()=>{for(let A of i.observers)for(let x of A.takeRecords())i.pending.push(x);return Ut(),i.torn||Ul(i.pending)||Cn(t)!==c},M=await o()),!u&&!i.disposed){i.dirty=!1,i.dirtyRoots=new Set,C?(i.retained=C,i.retainedFrameDriven=jl(C),xi(t,i),Si(t,i)):F&&(i.retainedFrameDriven||=jl(i.retained,T),xi(t,i),Si(t,i));let A=Vl(t,i);A.animation=ql(Gl(t,i));let x=["style","scroll","controls","images"];b||x.push("animation");let E=x.every(_=>an(m,A,_));i.renderState=A,i.styleEpoch=Se(),i.styleStamp=kn(t),i.geometry=Bl(t),i.renderState.frameDriven?(Kl.add(t),Ql(t,i)):E?!v&&!i.renderState.frameDriven&&(i.last=M,zl(t,i)):(i.dirtyAll(),i.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let F of i.observers)for(let T of F.takeRecords())i.pending.push(T);Ut();let M=Cn(t);(i.torn||Ul(i.pending)||M!==c)&&(i.dirtyAll(),i.last=null),i.outsideMutations=M,i.styleEpoch=Se(),i.styleStamp=kn(t),i.pending.length=0,i.torn=!1,i.capturing=!1,i.disposed||(yi(t,i),wi(t,i))}},l=i.inflight.then(a,a);return i.inflight=l.catch(()=>{}),l}var Vo=null;function rc(t){Vo=t}var Lh='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Ci=!1,On=null,ki=new WeakMap,nc=!1;function ic(t,e){!Ci||!On||e&&e.burst===!1||ki.set(On.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function sc(t){let e={control:t};On=e,setTimeout(()=>{On===e&&(On=null)},0)}function Ai(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Lh):null}function oc(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=Ai(t);e&&(sc(e),Mi(t,!1))}function Ih(t){let e=Ai(t);e&&sc(e)}function Mi(t,e=!0){if(!Vo||document.visibilityState==="hidden")return;let n=Ai(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let o=ki.get(n);if(o){if(!o.element.isConnected){ki.delete(n);return}Vo(o.element,o.options).catch(()=>{});return}e&&!nc&&(nc=!0,Vo(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function ac(){if(Ci||typeof document>"u"||typeof document.addEventListener!="function")return;Ci=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",oc,t),document.addEventListener("keydown",oc,t),document.addEventListener("click",Ih,t),document.addEventListener("pointerenter",Mi,t),document.addEventListener("focusin",Mi,t)}_t();vt();function am(...t){return ci(...t),tt}async function lm(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");Z(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await Ct();let o=Array.from(n.childNodes).some(i=>i.nodeType===3&&i.textContent.trim()),r=n.children.length===1&&!o?n.firstElementChild:n;return await Bi(r,{...e||{},burst:!1})}finally{n.remove()}}var cm="3.7.1",tt=Object.assign(Bi,{plugins:am,fromString:lm,version:cm,preCapture:ac});rc(Bi);var Di=Symbol("snapdom.internal"),fm=Symbol("snapdom.internal.silent"),Tc=new Set(["png","jpeg","jpg","webp","svg"]);async function Bi(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=Wl(e);n.element=t,n.invalidate&&Ve(),Cl(n,e&&e.plugins);let{stage:o,loweredBy:r}=wl(n);n.needs=o,n.__needsLoweredBy=r;let i=nn(o,"render"),s=n.burst===!0||!No(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",u=i&&!n.captureSelection&&n.burst!==!1&&s&&!a&&Zl(t);return u&&ic(t,e),n.snap||(n.snap={toPng:(c,f)=>tt.toPng(c,f),toSvg:(c,f)=>tt.toSvg(c,f)}),u?ec(t,e,n,()=>tt.capture(t,n,Di),c=>$c(c,n)):(await Xn(),tt.capture(t,n,Di))}tt.capture=async(t,e,n)=>{if(n!==Di)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(nn(e.needs||kt,"render")&&Y()){if(e.embedFonts)try{let i=t.ownerDocument||document,s=null;if(e.embedFonts==="auto"&&(t.getBoundingClientRect(),s=bo(i).drawn,s.size===0))throw null;let a=wo(t);e.clip||(e.__fontUsage=a);let l=a.required;if(s&&(l=new Set([...l].filter(u=>s.has(Fn(u).toLowerCase()))),l.size===0))throw null;await xo(l,a.usedCodepoints,i)}catch{}let r=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&r.unshift(t);for(let i of r)try{if(Rn(i))continue;let s=i.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){D(e,"Couldn't prepare canvases for Safari.",s)}}let o=await Il(t,e);return $c(o,e)};async function $c(t,e){let n=e.needs||kt,o=nn(n,"render"),r=k=>Sl(n,e.__needsLoweredBy||[],k),i=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=i?null:t,a=()=>s??=i.toDataURL(),l=i||t;i&&(t="");let u=e.__compressedSnapshot,c=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let f,d=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),g=m?Number.isFinite(e.width)?d.targetW/d.vbW:d.targetH/d.vbH:1,p=m?Number.isFinite(e.height)?d.targetH/d.vbH:d.targetW/d.vbW:1,y=k=>{if(i||!u?.size)return l;let I=d.vbW,L=d.vbH,P=k.crop;P&&(I=Math.max(1,Math.min(I,P.x+P.width)-Math.max(0,P.x)),L=Math.max(1,Math.min(L,P.y+P.height)-Math.max(0,P.y)));let N=Number.isFinite(k.width),B=Number.isFinite(k.height);return(N&&B?Math.max(k.width/I,k.height/L):N?k.width/I*(P?Math.max(1,p/g):1):B?k.height/L*(P?Math.max(1,g/p):1):(k.scale||1)*Math.max(g,p))*(k.dpr||1)<=c?l:f??=Rl(a(),u)},b=async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(fn(),Bn));return L(l,{...k,...I||{},format:"png"})},w=()=>{if(!o)throw r("svgString");if(i)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let k=t.indexOf(",");return k>=0?Hn(decodeURIComponent(t.slice(k+1)),e.__fileSvg):""},S=k=>Object.defineProperty({...k||{},svgString:w},"url",o?{get:a,enumerable:!0}:{get(){throw r("export.url")},enumerable:!1,configurable:!0}),v={img:async(k,I)=>{if(i)return b(k,I);let{toImg:L}=await Promise.resolve().then(()=>(Li(),Ni)),P={...k,...I||{}};return L(y(P),P)},svg:async(k,I)=>{if(i)return b(k,I);let{toSvg:L}=await Promise.resolve().then(()=>(Li(),Ni)),P={...k,...I||{}};return L(y(P),P)},canvas:async(k,I)=>{let{toCanvas:L}=await Promise.resolve().then(()=>(Fe(),hc)),P={...k,...I||{}};return L(y(P),P)},blob:async(k,I)=>{let{toBlob:L}=await Promise.resolve().then(()=>(Oi(),_c)),P={...k,...I||{}};return L(y(P),P)},png:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(fn(),Bn)),P={...k,...I||{},format:"png"};return L(y(P),P)},jpeg:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(fn(),Bn)),P={...k,...I||{},format:"jpeg"};return L(y(P),P)},webp:async(k,I)=>{let{rasterize:L}=await Promise.resolve().then(()=>(fn(),Bn)),P={...k,...I||{},format:"webp"};return L(y(P),P)},download:async(k,I)=>{let{download:L}=await Promise.resolve().then(()=>(Fc(),Rc)),P={...k,...I||{}};return L(y(P),P)}};if(!o)for(let k of Object.keys(v)){let I=k==="download"?"download()":`to${k.charAt(0).toUpperCase()}${k.slice(1)}()`;v[k]=async()=>{throw r(I)}}let C={};for(let k of["img","svg","canvas","blob","png","jpeg","webp"])C[k]=async I=>v[k](e,{...E(k,I||{}),[fm]:!0});C.jpg=C.jpeg;let M=k=>Object.defineProperty({...e,...k},"options",{value:e,configurable:!0}),F=M({artifacts:e.__artifacts||null,export:S(),exports:C}),T=await Po("defineExports",F),A=Object.assign({},...T.filter(k=>k&&typeof k=="object").reverse()),x={...v,...A};x.jpeg&&!x.jpg&&(x.jpg=(k,I)=>x.jpeg(k,I));function E(k,I){let L=I||{},P={...e,...L},N=typeof L.type=="string"?L.type.toLowerCase():"",B=typeof L.format=="string"?L.format.toLowerCase():Tc.has(N)?N:"";B&&(P.format=B==="jpg"?"jpeg":B),P.__explicitFormat=B?P.format:e.__explicitFormat??null,k==="blob"&&!P.__explicitFormat&&(P.format=i?"png":"svg"),P.type=P.format;let U=z=>z==="jpeg"||z==="jpg"||z==="webp";return[k,P.format,N].map(z=>typeof z=="string"?z.toLowerCase():"").find(U)&&(P.backgroundColor==null||P.backgroundColor==="transparent")&&(P.backgroundColor="#ffffff"),P.scale!==1&&(Number.isFinite(P.width)||Number.isFinite(P.height))&&D(P,"scale ignored: width/height already set the size."),P}let _=!1,$=Promise.resolve();async function R(k,I){let L=Object.freeze(I&&typeof I=="object"?{...I}:{}),P=async()=>{let B=x[k];if(!B)throw new Error(`[SnapDOM] Unknown export type: ${k}`);let U=E(k,L),V=M({artifacts:e.__artifacts||null,export:S({type:k,options:U,requestedOptions:L})}),z=U.format,lt=U.type;await Po("beforeExport",V,{format:k,options:U});let st=U.format!==z?U.format:U.type!==lt?U.type:"",ht=typeof st=="string"?st.toLowerCase():"";Tc.has(ht)&&(U.format=ht==="jpg"?"jpeg":ht,U.type=U.format,U.__explicitFormat=U.format,/^(?:jpeg|webp)$/.test(U.format)&&(U.backgroundColor==null||U.backgroundColor==="transparent")&&(U.backgroundColor="#ffffff"));let Mt=await B(V,U);return await Po("afterExport",V,{format:k,options:U,result:Mt}),_||(_=!0,await te("afterSnap",e)),Mt},N=$.then(P);return $=N.catch(()=>{}),N}let W={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!o)throw r("toRaw()");return a()},to:(k,I)=>R(k,I),toImg:k=>R("img",k),toSvg:k=>R("svg",k),toCanvas:k=>R("canvas",k),toBlob:k=>R("blob",k),toPng:k=>R("png",k),toJpg:k=>R("jpg",k),toWebp:k=>R("webp",k),download:k=>R("download",k)};o?i&&Object.defineProperty(W,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(W,"url",{get(){throw r("url")},enumerable:!1,configurable:!0}),Object.defineProperty(W,"meta",o?{value:e.meta,enumerable:!0}:{get(){throw r("meta")},enumerable:!1,configurable:!0});for(let k of Object.keys(x)){let I="to"+k.charAt(0).toUpperCase()+k.slice(1);W[I]||(W[I]=L=>R(k,L))}return W}tt.toRaw=(t,e)=>tt(t,e).then(n=>n.toRaw());tt.toImg=(t,e)=>tt(t,e).then(n=>n.toImg());tt.toSvg=(t,e)=>tt(t,e).then(n=>n.toSvg());tt.toCanvas=(t,e)=>tt(t,e).then(n=>n.toCanvas());tt.toBlob=(t,e)=>tt(t,e).then(n=>n.toBlob());tt.toPng=(t,e)=>tt(t,{...e,format:"png"}).then(n=>n.toPng());tt.toJpg=(t,e)=>tt(t,{...e,format:"jpeg"}).then(n=>n.toJpg());tt.toWebp=(t,e)=>tt(t,{...e,format:"webp"}).then(n=>n.toWebp());tt.download=(t,e)=>tt(t,e).then(n=>n.download());export{kt as DEFAULT_STAGE,en as STAGES,xl as assertNeeds,Ip as clearPlugins,fi as getGlobalPlugins,rn as normalizePlugin,ci as registerPlugins,tt as snapdom}; From 5e4c9349b5670814b93d133ac0572ac22ca50a21 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 4 Nov 2026 09:41:59 +0800 Subject: [PATCH 2/2] chore: bump version 11.0.0-rc.3.4 --- .../BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj b/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj index 633c5678..2d89bdfc 100644 --- a/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj +++ b/src/components/BootstrapBlazor.Dom2Image/BootstrapBlazor.Dom2Image.csproj @@ -1,7 +1,7 @@ - 11.0.0-rc.3.3 + 11.0.0-rc.3.4