@zumer/snapdom 3.1.1-dev.1 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/snapdom.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * SnapDOM
3
- * v3.1.1-dev.1
3
+ * v3.1.1
4
4
  * License: MIT
5
5
  */
6
6
  "use strict";(()=>{var za=Object.defineProperty;var ct=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var Ue=(t,e)=>{for(var n in e)za(t,n,{get:e[n],enumerable:!0})};function zo(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function jo(t="soft"){t==="disabled"&&(N.computedStyle=new WeakMap,N.measureHints=new WeakMap,N.baseStyle=new ot(50),N.defaultStyle=new ot(64),N.image=new ot(100),N.background=new ot(100),N.resource=new ot(150),N.compress=new ot(50))}var ot,N,ut=ct(()=>{"use strict";ot=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,n)}},N={image:new ot(100),background:new ot(100),resource:new ot(150),defaultStyle:new ot(64),baseStyle:new ot(50),compress:new ot(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function te(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Va(t){let e=[],n=0,r=0,i="";for(let o=0;o<t.length;o++){let s=t[o];if(s==="\\"){o++;continue}i?s===i&&(i=""):s==='"'||s==="'"?i=s:s==="("?r++:s===")"?r--:s===","&&r===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e}function He(t,e=1){let n=t.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let o of Va(n[1])){let s=o.match(/url\((['"]?)(.*?)(\1)\)/);if(!s)continue;let a=o.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!ja.test(a[1].trim()))continue;let c=o.replace(/url\((['"]?)[\s\S]*?\1\)/," ").match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)\b/i),f=1;if(c){let l=parseFloat(c[1]);f=/dpi/i.test(c[2])?l/96:l}r.push({url:s[2].trim(),dppx:f})}return r.length?(r.sort((o,s)=>o.dppx-s.dppx),(r.find(o=>o.dppx>=e)||r[r.length-1]).url):null}function gr(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function zt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function yr(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 ze(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function br(t){return"\u2022".repeat(String(t??"").length)}function rt(t,e){return t?.nodeType===1&&t.localName===e}function kt(t){return t?.nodeType===1&&t.namespaceURI===qa}function Nt(t){return t?.nodeType===1&&t.namespaceURI===Ga}function Lt(t){return t?.nodeType===11&&!!t.host}function wr(t){return t?.nodeType===9}var mr,ja,qa,Ga,yt=ct(()=>{"use strict";mr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,ja=mr;qa="http://www.w3.org/1999/xhtml",Ga="http://www.w3.org/2000/svg"});function Xa(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(s,a,c){if(i>=n)return;let f=Date.now();(r.get(a)||0)>f||(r.set(a,f+e),i++,s==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(s,a){o("warn",s,a)},errorOnce(s,a){o("error",s,a)},reset(){r.clear(),i=0}}}function Go(t,e,n){if(It.size>=qo){let r=Date.now();for(let[i,o]of It)o.until<=r&&It.delete(i);for(;It.size>=qo;)It.delete(It.keys().next().value)}It.set(t,{until:Date.now()+n,result:e})}function Ya(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Ka(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=e.split(/\{url(?:Raw)?\}/)[0],i=new URL(r||".",n);if(new URL(t,n).origin===i.origin)return!0}catch{}return!1}function Qa(t,e){if(!e||Ya(t)||Ka(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!e}}function Ja(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>zt(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}${zt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Xo(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function Za(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 Yo(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function xr(t,e){try{t.onError?.(e)}catch{}}async function it(t,e={}){let n=e.as??"blob",r=e.timeout??3e3,i=e.useProxy||"",o=e.errorTTL??8e3,s=e.headers||{},a=!!e.silent;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,g="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],S=/;base64/i.test(g)?atob(y):decodeURIComponent(y),k=new Uint8Array([...S].map(w=>w.charCodeAt(0))),v=new Blob([k],{type:(g||"").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 g=await fetch(t);if(!g.ok)return{ok:!1,data:null,status:g.status,url:t,fromCache:!1,reason:"http_error"};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Xo(y),blob:y,status:g.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:g.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.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 c;try{c=Za(t,{as:n,timeout:r,useProxy:i,errorTTL:o,credentials:e.credentials,headers:s})}catch{let g={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return xr(e,g),g}let f=It.get(c);if(f&&f.until>Date.now())return{...f.result,fromCache:!0};f&&It.delete(c);let l=Sr.get(c);if(l)return l;let u=Qa(t,i)?Ja(t,i):t,p=e.credentials;if(!p)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,g);p=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{p="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),r),d=(async()=>{try{let g=await fetch(u,{signal:h.signal,credentials:p,headers:s});if(!g.ok){let S={ok:!1,data:null,status:g.status,url:u,fromCache:!1,reason:"http_error"};if(c!==null&&o>0&&Go(c,S,o),!a){let k=`${g.status} ${g.statusText||""}`.trim();Vo.warnOnce(`http:${g.status}:${n}:${Yo(t)}`,`HTTP error ${k} while fetching ${n} ${t}`)}return xr(e,S),S}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:u,fromCache:!1};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Xo(y),blob:y,status:g.status,url:u,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:u,fromCache:!1,mime:b}}catch(g){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":g&&typeof g=="object"&&g.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:u,fromCache:!1,reason:y};if(c!==null&&!/^blob:/i.test(t)&&o>0&&Go(c,b,o),!a){let S=`${y}:${n}:${Yo(t)}`,k=y==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${t}`:y==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;Vo.errorOnce(S,k)}return xr(e,b),b}finally{clearTimeout(m),Sr.delete(c)}})();return c!==null&&Sr.set(c,d),d}var Vo,Sr,qo,It,de=ct(()=>{"use strict";yt();Vo=Xa("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Sr=new Map,qo=50,It=new Map});async function pe(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=He(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??te(t);if(!r)return t;let i=yr(r),o=zt(i),s=(e.useProxy||"")+"|"+o;if(N.background.has(s)){let a=N.background.get(s);return a?`url("${a}")`:"none"}try{let a=await it(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(N.background.set(s,a.data),`url("${a.data}")`):(N.background.set(s,null),"none")}catch{return N.background.set(s,null),"none"}}var Ko=ct(()=>{"use strict";ut();yt();de()});function ic(t){let e=t.replace(oc,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function Zo(t,e,n,r){for(let i=0;i<t.length;i++){if(--r.budget<0)return!1;let o=t[i],s=o.style;if(s){let c=!!o.selectorText&&nc.test(o.selectorText);for(let f=0;f<s.length;f++){let l=s[f];if(e.add(l),c&&r.pseudoProps.add(l),s.getPropertyPriority(l)&&r.importantProps.add(l),l.length>5&&(l[0]==="m"||l[0]==="p")){let u=l.startsWith("margin")?"marginUnstable":l.startsWith("padding")?"paddingUnstable":null;u&&!r[u]&&rc.test(s.getPropertyValue(l))&&(r[u]=!0)}}}let a=o.selectorText;if(a&&a.includes(":has(")&&(r.usesHas=!0),a&&a.includes("&"))for(let c=o.parentRule;c&&a.includes("&");c=c.parentRule)c.selectorText&&(a=a.replace(/&/g,`:is(${c.selectorText})`));if(a&&(r.inContainer||Jo.test(a)||a.includes("+")||a.includes("~")))for(let c of Cr(a,",")){let f=c.trim();f&&(r.inContainer||Jo.test(f)||f.includes("+")||f.includes("~"))&&r.shareUnsafeSels.add(f)}if(a&&a.includes(":"))for(let c in Qo)Qo[c].test(a)&&n[c].push(ic(a));if(o.styleSheet){if(!hn(o.styleSheet,e,n,r))return!1}else if(o.cssRules&&o.cssRules.length){let c=o.constructor?.name==="CSSContainerRule";c&&r.inContainer++;let f=Zo(o.cssRules,e,n,r);if(c&&r.inContainer--,!f)return!1}}return!0}function hn(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?Zo(i,e,n,r):!1}function kr(t,e){for(let n of t){let r=n.effect?.getKeyframes?.()||[];for(let i of r)for(let o of Object.keys(i))o==="offset"||o==="easing"||o==="composite"||o==="computedOffset"||e.add(o.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function ti(t){let e=new Set;return hn(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function Cr(t,e){if(!t.includes(e))return[t];let n=[],r=0,i=null,o=0;for(let s=0;s<t.length;s++){let a=t[s];if(a==="\\"){s++;continue}if(i){a===i&&(i=null);continue}a==='"'||a==="'"?i=a:a==="("||a==="["?r++:a===")"||a==="]"?r--:r===0&&a===e&&(n.push(t.slice(o,s)),o=s+1)}return n.push(t.slice(o)),n}function sc(t){let e=0,n=null,r=0;for(let l=0;l<t.length;l++){let u=t[l];if(n){u===n&&t[l-1]!=="\\"&&(n=null);continue}u==='"'||u==="'"?n=u:u==="("||u==="["?e++:u===")"||u==="]"?e--:e===0&&(u===" "||u===">"||u==="+"||u==="~")&&(r=l+1)}let i="",o=0;for(let l of t.slice(r))l==="("||l==="["?o++:l===")"||l==="]"?o--:o===0&&(i+=l);let s=l=>!l||/\\[0-9a-fA-F]/.test(l)?null:l.replace(/\\(.)/g,"$1"),a=s((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let c=s((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(c)return"i"+c;let f=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return f?"t"+f.toLowerCase():null}function ei(t,e){if(!e.length)return"";if(e.some(r=>r.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function ac(t,e){let n=t.createElement("div"),r={};for(let i in e){let o=e[i];(i==="before"||i==="after")&&o.push("q"),r[i]=ei(n,o)}return r}function ni(t){let e={universe:null,pseudoUniverse:null,usesHas:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let n=new Set(vr),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set};for(let f of t.styleSheets)if(!hn(f,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let f of o)if(!hn(f,n,r,i))return e}typeof t.getAnimations=="function"&&kr(t.getAnimations(),n);let s=Array.from(i.shareUnsafeSels),a=ei(t.createElement("div"),s)===null?null:s.map(f=>({sel:f,key:sc(f)})),c=new Set(ec);for(let f of tc)n.has(f)&&c.add(f);for(let f of i.pseudoProps)c.add(f);return{universe:n,pseudoUniverse:c,pseudoGates:ac(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var vr,tc,ec,nc,rc,Qo,oc,Jo,mn=ct(()=>{"use strict";vr=["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"],tc=["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"],ec=["display","width","height","min-width","min-height"],nc=/::?(?:before|after|first-letter|first-line|marker)/,rc=/%|\bauto\b|calc\(|var\(/i,Qo={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},oc=/::?(?:before|after|first-letter|first-line|marker)\b/g;Jo=/:(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 J(t){return ri.add(t),t.setAttribute("data-snapdom-internal",""),t}function jt(t){return ri.has(t)}var ri,bt=ct(()=>{"use strict";ri=new WeakSet});function Mr(t){if(t=String(t).toLowerCase(),je.has(t)){let o={};return N.defaultStyle.set(t,o),o}if(N.defaultStyle.has(t))return N.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(jt);e||(e=document.createElement("div"),J(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 r=getComputedStyle(n),i={};for(let o of r){if(he(o))continue;let s=r.getPropertyValue(o);i[o]=s}for(let o of vr)!(o in i)&&!he(o)&&(i[o]=r.getPropertyValue(o));return e.removeChild(n),N.defaultStyle.set(t,i),i}function he(t){let e=oi.get(t);if(e===void 0){let n=String(t).toLowerCase();e=fc.has(n)||lc.test(n)||cc.test(n),oi.set(t,e)}return e}function si(t,e){let n=mc.get(t);if(n===void 0||e[n]!==e[t])return!1;let r=e["writing-mode"];if(r&&r!=="horizontal-tb")return!1;let i=e.direction;return!(i&&i!=="ltr")}function gn(t,e){return!dc.has(t)&&(e==="inline"||uc.has(t)||ii.has(t))}function _r(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||ii.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let o=(e.position||"static").toLowerCase();return o==="absolute"||o==="fixed"?!1:!yc.has(r)}function me(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),je.has(e))return"";let i=[],o=Mr(e),s=(t.display||"").toLowerCase(),a=s==="inline",c=gn(e,s),f=t["text-wrap-mode"]||t["white-space"]||"",l=f==="nowrap"||f==="pre",p=c&&n&&!(c&&n&&!a&&l),h=!1;for(let m in t){if(he(m)||si(m,t))continue;let d=t[m];if(p){if(pc.has(m))continue;if(hc.has(m)){d&&d!==o[m]&&(i.push(`${m}:${d}`),d!=="auto"&&(h=!0));continue}}if(d&&d!==o[m]){if(!l&&(m==="width"||m==="inline-size")&&d.endsWith("px")&&d.includes(".")){let g=parseFloat(d);if(Number.isFinite(g)){i.push(`${m}:${(g+gc).toFixed(3)}px`);continue}}i.push(`${m}:${d}`)}}if(p&&!a&&!r&&!h){let m=t.width;m&&m!=="auto"&&m!==o.width&&i.push(`min-width:${m}`)}return i.sort(),i.join(";")}function Er(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 Rr(t,e=null){let n=new Map;for(let s of t){let a=Mr(s);if(!a)continue;let l=(e?Object.entries(a).filter(([p])=>e.has(p)):Object.entries(a)).filter(([p])=>!si(p,a)).map(([p,h])=>`${p}:${h};`).sort(),u=l.join("");u&&(n.has(u)||n.set(u,{tagList:[],declarations:l}),n.get(u).tagList.push(s))}let r=[...n.values()],i=null;for(let{declarations:s}of r){let a=new Set(s);if(!i){i=a;continue}for(let c of i)a.has(c)||i.delete(c)}i??(i=new Set);let o="";if(i.size&&r.length>1){let s=r.flatMap(a=>a.tagList);o+=`${s.join(",")} { ${[...i].join("")} }
@@ -36,4 +36,4 @@ ${g}
36
36
  } catch (err) {
37
37
  self.postMessage({ id, error: String(err) })
38
38
  }
39
- }`,nu=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Tt=null,ru=0,ou=0,ce=new Map;function ra(){for(let t of ce.values())t(void 0);if(ce.clear(),Array.isArray(Tt))for(let t of Tt)try{t?.terminate()}catch{}Tt=!1}function iu(){let t,e=null;try{t=URL.createObjectURL(new Blob([eu],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=ce.get(n.data.id);r&&(ce.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=ra}catch{e=null}return t&&URL.revokeObjectURL(t),e}function su(){if(Tt===!1)return!1;if(Tt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Tt=!1;Tt=[]}let t=ru++%nu;if(!Tt[t]){let e=iu();if(!e)return ra(),!1;Tt[t]=e}return Tt[t]}var au=5e3;function cu(t,e,n,r,i){let o=su();return o?new Promise(s=>{let a=++ou,c=setTimeout(()=>{ce.delete(a),s(void 0)},au);ce.set(a,f=>{clearTimeout(c),s(f)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:na,quality:ea,mime:r})}catch{clearTimeout(c),ce.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function yo(t,e,n,r){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let i=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,o=N.compress,s=o.get(i);if(s?.source===t)return s.result;let a=Kn.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Kf(t),u=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=tu(t);if(p&&p.w>0&&p.h>0&&!Qs(p.w,p.h,e,n))return null;if(t.length>=Qf){let w=await cu(t,e,n,u,r);if(w!==void 0)return w}let h;try{h=await Yf(t)}catch{return null}let m=h.naturalWidth||h.width,d=h.naturalHeight||h.height;if(!m||!d)return null;let g=Qs(m,d,e,n);if(!g)return null;let y=g*na,b=Math.max(1,Math.round(m*y)),S=Math.max(1,Math.round(d*y)),k=document.createElement("canvas");k.width=b,k.height=S;let v=k.getContext("2d");if(!v)return null;v.imageSmoothingEnabled=!0,v.imageSmoothingQuality="high",v.drawImage(h,0,0,b,S);try{let w=k.toDataURL(u,ea);if(typeof w=="string"&&w.startsWith("data:image")&&w.length<t.length)return w}catch{}return null})(),f={source:t,promise:c,cache:o};Kn.set(i,f);try{let l=await c;return Jf(o,i,t,l),l}finally{Kn.get(i)===f&&Kn.delete(i)}}async function lu(t,e,n=new Map,r={}){if(!e.compress)return{count:0,before:0,after:0};let i=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&i.unshift(t);let o=0,s=0,a=0,c=async l=>{let u=l.getAttribute("src")||"";if(!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let p=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,h=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!h)return;let m=r.value||(r.value=go(t,e)),d=m.density*m.stretch(n.get(l)||l),g=await yo(u,p*d,h*d,l.__snapdomBlob);g&&(o++,s+=u.length,a+=g.length,l.setAttribute("src",g),Qn(l,"attribute","src",u,g,e))},f=6;for(let l=0;l<i.length;l+=f)await Promise.allSettled(i.slice(l,l+f).map(c));return{count:o,before:s,after:a}}var fu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function uu(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function du(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=[],o=[t,...t.querySelectorAll("*")];for(let f of o){let l=f.style&&f.style.backgroundImage;l&&l.includes("data:image")&&i.push(f)}let s=0,a=async f=>{let l=n.get(f);if(!l||!l.isConnected)return;let u;try{u=getComputedStyle(l)}catch{return}if((u.backgroundRepeat||"repeat").toLowerCase().split(",").some(A=>A.trim()!=="no-repeat"))return;let h=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(h.split(",").some(A=>!fu.test(A.trim())))return;let{w:m,h:d}=uu(l);if(!m||!d)return;let g=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(A=>parseFloat(A)/100)),y=r.value||(r.value=go(t,e)),b=y.density*y.stretch(l)*g,S=m*b,k=d*b,v=f.style.backgroundImage,w=[...v.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],C=v;for(let A of w){let M=A[2];if(M.startsWith("data:image/svg"))continue;let x=await yo(M,S,k);x&&(C=C.split(M).join(x),s++)}C!==v&&(f.style.setProperty("background-image",C,f.style.getPropertyPriority("background-image")),Qn(f,"style","background-image",v,f.style.backgroundImage,e))},c=6;for(let f=0;f<i.length;f+=c)await Promise.allSettled(i.slice(f,f+c).map(a));return{count:s}}async function pu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=Array.from(t.querySelectorAll("image"));t.localName==="image"&&i.unshift(t);let o=0,s=async c=>{let f=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!f||!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",u=c.getAttribute("height")||"";if(l.includes("%")||u.includes("%"))return;let p=n.get(c),h=p?W(p):c.style,m=(k,v)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[k]||""))return parseFloat(h[k]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(v.trim()))return parseFloat(v);try{return p?.[k]?.baseVal?.value||0}catch{return 0}},d=m("width",l),g=m("height",u);if(!d||!g)return;let y=r.value||(r.value=go(t,e)),b=y.density*y.stretch(p||c),S=await yo(f,d*b,g*b);S&&(c.setAttribute("href",S),Qn(c,"attribute","href",f,S,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(Js,"xlink:href",S),Qn(c,"attribute","xlink:href",f,S,e)),o++)},a=6;for(let c=0;c<i.length;c+=a)await Promise.allSettled(i.slice(c,c+a).map(s));return{count:o}}async function tr(t,e,n){if(!e.compress)return;let r={};await lu(t,e,n,r),await du(t,e,n,r),await pu(t,e,n,r)}pt();ut();bt();function hu(t,e){if(Y())return t;let n=t.indexOf("</style>");if(n===-1)return t;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,f;for(let y of i)if(y.intern)for(c.lastIndex=0;f=c.exec(y.text);)a.set(f[1],(a.get(f[1])||0)+1);let l=0;for(let[y,b]of a)b>1&&(l+=(b-1)*y.length);if(l<2048||t.includes(" data-sdi="))return t;let u=mu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let p=new Map,h=0,m=[],d=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let S=p.get(b);return S===void 0&&(S="i"+(h++).toString(36),p.set(b,S),m.push(`[data-sdi="${S}"]{${b}}`)),` data-sdi="${S}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,d):y.text;return t.slice(0,n)+m.join("")+g}function mu(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let f=c.getAttribute("style");f&&r.add(f)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=f=>{for(let l of f){if(l.type===CSSRule.IMPORT_RULE||l.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(l.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(l.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(l.selectorText).forEach(i)}l.cssRules&&c(l.cssRules)}};for(let f of[...t.querySelectorAll("style")].slice(1)){let l=f.textContent||"";if(/@import\b/i.test(l))return null;let u=new CSSStyleSheet;u.replaceSync(l),c(u.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let c of r){s.setAttribute("style",c);let f=a.serializeToString(s).match(/ style="([^"]*)"/);f&&o.add(f[1])}return o}async function er(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:K,...tt}=t;t=Object.assign(a,tt),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,f;Ns(t,s),await Ot("beforeRender",t);let l=W(t.element),u=t.element.getBoundingClientRect(),p=Math.max(1,I(t.element.offsetWidth||parseFloat(l.width)||u.width||1)),h=Math.max(1,I(t.element.offsetHeight||parseFloat(l.height)||u.height||1)),m=t.element.ownerDocument||document;if(!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned){let K=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);K>0&&(h=Math.max(h,I(K))),tt>0&&(p=Math.max(p,I(tt)));try{let Q=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,et=N.measureHints.get(t.element);if(et&&et.cssLen===Q&&et.w0===p&&et.docH===K&&et.docW===tt)et.csh>0&&(h=Math.max(h,I(et.csh))),et.csw>0&&(p=Math.max(p,I(et.csw)));else{let nt=m.createElement("div");J(nt),nt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+p+"px!important;overflow:visible!important;visibility:hidden!important;";let Jt=nt.attachShadow({mode:"open"}),Zt=m.createElement("style");Zt.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,Jt.appendChild(Zt),Jt.appendChild(t.clone.cloneNode(!0)),m.body.appendChild(nt);let Be=nt.scrollHeight,Ht=nt.scrollWidth;m.body.removeChild(nt),N.measureHints.set(t.element,{cssLen:Q,w0:p,docH:K,docW:tt,csh:Be,csw:Ht}),Be>0&&(h=Math.max(h,I(Be))),Ht>0&&(p=Math.max(p,I(Ht)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let K=uo(t.element,t.options),tt=1,Q=uo(t.element,{}),et=Math.max(2,h*.15);Number.isFinite(Q)&&Q>=h-et&&Number.isFinite(K)&&K>0&&(h=Math.max(1,Math.min(h,I(K+tt))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Ps(t.element,t.clone,K,t.nodeMap,p,h)}catch(K){console.warn("[snapdom] reconcile pass failed:",K)}let g=(K,tt=NaN)=>{let Q=typeof K=="string"?parseFloat(K):K;return Number.isFinite(Q)?Q:tt},y=g(t.options.width),b=g(t.options.height),S=n?I(n.width):p,k=n?I(n.height):h,v=S,w=k,C=Number.isFinite(y),A=Number.isFinite(b),M=k>0?S/k:1;C&&A?(v=Math.max(1,I(y)),w=Math.max(1,I(b))):C?(v=Math.max(1,I(y)),w=Math.max(1,I(v/(M||1)))):A&&(w=Math.max(1,I(b)),v=Math.max(1,I(w*(M||1))));let x=0,_=0,R=p,T=h;if(n){let K=0,tt=0;if(bo(t.element)){let Q=null;if(!r&&o&&Number.isFinite(o.a))Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let et=ae(t.element),nt=fo(l.transform&&l.transform!=="none"?l.transform:"",et);nt&&nt.is2D&&(Q={a:nt.a,b:nt.b,c:nt.c,d:nt.d,e:0,f:0})}if(Q&&!(Q.a===1&&Q.b===0&&Q.c===0&&Q.d===1)){let{ox:et,oy:nt}=rn(l,p,h),Jt=Fe(p,h,Q,et,nt);K=Jt.minX,tt=Jt.minY}}x=I(n.x+K),_=I(n.y+tt),R=I(x+n.width),T=I(_+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let K={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},tt=Fe(p,h,K,0,0);x=I(tt.minX),_=I(tt.minY),R=I(tt.maxX),T=I(tt.maxY)}else if(r&&bo(t.element)){let tt=l.transform&&l.transform!=="none"?l.transform:"",Q=ae(t.element),et=Kt({baseTransform:tt,rotate:Q.rotate||"0deg",scale:Q.scale,translate:Q.translate,width:p,height:h}),{ox:nt,oy:Jt}=rn(l,p,h),Zt=et.is2D?et:new DOMMatrix(et.toString()),Be={a:Zt.a,b:Zt.b,c:Zt.c,d:Zt.d,e:0,f:0},Ht=Fe(p,h,Be,nt,Jt);x=I(Ht.minX),_=I(Ht.minY),R=I(Ht.maxX),T=I(Ht.maxY)}let $=ro(l),O=oo(l),H=io(l),E=so(l),L=ao(l),P=u.width>0?(R-x)/u.width:1,F=u.height>0?(T-_)/u.height:1,V=i==="subtree"&&!n?xs(t.element,t.nodeMap,t.styleCache,P,F):{top:0,right:0,bottom:0,left:0},z=n?{top:0,right:0,bottom:0,left:0}:i?{top:I(Math.max($.top,O.top,V.top)+H.top+E.top+L.bleed.top),right:I(Math.max($.right,O.right,V.right)+H.right+E.right+L.bleed.right),bottom:I(Math.max($.bottom,O.bottom,V.bottom)+H.bottom+E.bottom+L.bleed.bottom),left:I(Math.max($.left,O.left,V.left)+H.left+E.left+L.bleed.left)}:{top:H.top,right:H.right,bottom:H.bottom,left:H.left};x=I(x-z.left),_=I(_-z.top),R=I(R+z.right),T=I(T+z.bottom);let q=Math.max(1,I(R-x)),B=Math.max(1,I(T-_)),Z="http://www.w3.org/2000/svg",_t=bo(t.element)?2:0,mt=I(_t+(r?0:1)),st=Math.ceil(q+mt*2),at=Math.ceil(B+mt*2),Pt=I(-(I(x)-mt)),U=I(-(I(_)-mt)),G=Math.max(0,Pt),j=Math.max(0,U),ft=I(st-Math.min(0,Pt)),Et=I(at-Math.min(0,U)),gt=document.createElementNS(Z,"foreignObject");gt.setAttribute("x",String(Math.min(0,Pt))),gt.setAttribute("y",String(Math.min(0,U))),gt.setAttribute("width",String(ft)),gt.setAttribute("height",String(Et)),gt.style.overflow="visible";let ue=document.createElement("style"),dn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";ue.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+dn+t.classCSS,gt.appendChild(ue);let Oe=document.createElement("div");Oe.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Oe.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${ft}px;height:${Et}px`+(G!==0||j!==0?`;padding:${j}px 0 0 ${G}px !important`:""),Oe.appendChild(t.clone),gt.appendChild(Oe);let ur=new XMLSerializer().serializeToString(gt),Bt=C||A,dr=Object.freeze({w0:S,h0:k,vbW:st,vbH:at,targetW:v,targetH:w,contentX:I(Pt+(n?x:0)),contentY:I(U+(n?_:0)),clip:n?Object.freeze({x:I(x),y:I(_),width:S,height:k}):null});Object.defineProperty(a,"meta",{value:dr,enumerable:!0,writable:!1,configurable:!0});let pr=!Bt||Y()?st:C?v:I(st*(w/at)),pn=!Bt||Y()?at:A?w:I(at*(v/st)),Ut=parseFloat(W(m.documentElement)?.fontSize)||16;f=`<svg xmlns="${Z}" width="${pr}" height="${pn}" viewBox="0 0 ${st} ${at}" font-size="${Ut}px">`+hu(ur,gt)+"</svg>",c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,t.svgString=f,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Ot("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let hr=[...document.querySelectorAll("#snapdom-sandbox")].find(jt);return hr&&hr.style.position==="absolute"&&hr.remove(),t.dataURL}function bo(t){return ks(t)}function gu(t){let e=Array.isArray(t.plugins)?t.plugins:Xs(),n=[];for(let r of e){let i=sn(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function oa(t,e){if(!t)throw new Error("Element cannot be null or undefined");e.__session=mo(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=gu(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,f,l="",u=null,p=e.needs||vt,h=n.format,m=n.type;await Ot("beforeSnap",n);let d=n.format!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(d||g){let R=String(d?n.format:n.type).toLowerCase();n.format=R==="jpg"?"jpeg":R,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Ot("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,S=n.clip?On(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=wi(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let k=ci(e.fast);for(;;){e.__slicer=k;let R=qn(n.element,S);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:f}=await Ls(n.element,n.options)),c>0&&!e.reconcile&&(St(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),N.warnedReconcile||(N.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time)."))),!y&&r&&(u=vs(n.element,r)),!b&&r&&Rs(n.element,r,n.options),r&&(Ts(n.element,r,a),Fs(n.element,r))}finally{R()}if(!k?.yielded||!e.__tornSinceStart?.())break;k=null,e.__session=mo(e.cache)}if(e.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Ot("afterClone",n),!$e(p,"render"))return null;if(k?.due()&&await k.pause(),Dn(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{$s(n.element,n.clone,n.styleCache,n.nodeMap)}catch(R){St(e.__session,"shrink-failed","shrink pass failed",R),console.warn("[snapdom] shrink pass failed:",R)}try{await Rn(n.clone,n.element,n.nodeMap)}catch{}let v=R=>Promise.resolve().then(R),w=(async()=>{await Promise.all([v(()=>Un(n.clone,n.options)),v(()=>zn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Os(n.element,n.clone,n.nodeMap)}catch(R){St(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",R),console.warn("[snapdom] backdrop-filter emulation failed:",R)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await v(()=>tr(n.clone,n.options,n.nodeMap))),e.captureSelection)try{Vi(n.nodeMap)}catch(R){St(e.__session,"selection-compose-failed","field selection compose failed",R)}})(),C=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(C=v(async()=>{let R=n.element.ownerDocument||document,T=S?H=>{try{let E=H.getBoundingClientRect();return E.right>=S.left-200&&E.left<=S.right+200&&E.bottom>=S.top-200&&E.top<=S.bottom+200}catch{return!0}}:null,{required:$,usedCodepoints:O}=!S&&e.__fontUsage||Pn(n.element,T);if(e.embedFonts==="auto"){let H=new Set;try{for(let L of R.fonts)H.add(String(L.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(H.size>0&&Array.from($).some(L=>H.has(String(L).split("__")[0].toLowerCase()))))return}if(Y()){let H=new Set(Array.from($).map(E=>String(E).split("__")[0]).filter(Boolean));await Nn(H,1,R)}l=await is({required:$,usedCodepoints:O,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:R})})),await Promise.all([w,C]);let M=(n.options.plugins||[]).some(R=>R&&(typeof R.beforeRender=="function"||typeof R.afterRender=="function"));n.options.engine,k?.due()&&await k.pause();let x=n.clone;Zn(x,e.__compressedAssets);let _=await er(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:l});if(e.__compressedSnapshot=Jn(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return _}ut();yt();var yu=new Set(["png","jpeg","jpg","webp","svg"]);function ia(t={}){let e=typeof t.type=="string"&&yu.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let r=t.format!=null?n:e==="jpg"?"jpeg":e,i=zo(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let u of o)typeof u=="string"?s.push(u):typeof u=="function"?a.push(u):u!=null&&console.warn("[snapdom] Ignored invalid exclude entry (expected selector string or predicate):",u);let c=t.excludeMode??"hide",f=u=>{if(!u||u.nodeType!==1)return!1;if(u.getAttribute("data-capture")==="exclude")return!0;for(let p of Array.isArray(l.exclude)?l.exclude:[])try{if(u.matches(p))return!0}catch{}for(let p of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(p(u))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(u))return!0}catch{}return!1},l={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:c,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:f,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:rt(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:Yi(t.iconFonts),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:i,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:r,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,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return l}wt();ee();pt();var sa="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function bu(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var wu=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function Su(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(wu.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function xu(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(o=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(o.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let r=[t];t.querySelectorAll&&r.push(...t.querySelectorAll("*"));for(let i of r){let o=getComputedStyle(i),s=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var aa=new WeakMap;function vu(t){let e=Wt(),n=aa.get(t);if(n&&n.epoch===e)return n.leaky;let r=!1,i={budget:2e4},o=s=>{for(let a=0;a<s.length&&!r;a++){if(--i.budget<0){r=!0;return}let c=s[a],f=c.selectorText;if(f&&/[+~]|:has\(/.test(f)){r=!0;return}let l=c.style;if(l&&(l.counterReset||l.counterIncrement||l.counterSet||l.content&&l.content.includes("counter"))){r=!0;return}c.cssRules&&c.cssRules.length&&o(c.cssRules)}};try{for(let s of t.styleSheets){let a=null;try{a=s.cssRules}catch{r=!0}if(r)break;a&&o(a)}if(!r){let s=t.adoptedStyleSheets;if(Array.isArray(s))for(let a of s){if(r)break;try{o(a.cssRules)}catch{r=!0}}}}catch{r=!0}return aa.set(t,{epoch:e,leaky:r}),r}var ku=1/16;function Cu(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),r=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(r)&&Math.abs(n-r)<=ku}var nr=new Map,Au=["width","height","min-width","min-height"];function Mu(t){let e=nr.get(t);if(e===void 0){e=null;for(let n of Au){let r=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));r&&r[1].endsWith("px")&&((e||(e={}))[n]=r[1])}nr.size>5e3&&nr.clear(),nr.set(t,e)}return e}function _u(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function Eu(t,e){let n=[t];for(;n.length;){let r=n.pop();if(r.nodeType===1){let i=e.nodeMap.get(r);i!==void 0&&(e.nodeMap.delete(r),e.srcToClone.get(i)===r&&e.srcToClone.delete(i)),e.styleMap.delete(r)}for(let i=r.firstChild;i;i=i.nextSibling)n.push(i)}}var wo={attempts:0,served:0,reconciled:0};async function ca(t,e,n){wo.attempts++;try{let r=await Ru(t,e,n);return r&&wo.served++,r}catch{return null}}async function Ru(t,e,n){let r=e.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||t.scrollTop||t.scrollLeft||bu(t)||Su(r)||r.fontsCSS||Yn(n))return null;for(let u of n.plugins||[])if(u&&(typeof u.beforeSnap=="function"||typeof u.beforeClone=="function"||typeof u.resolveNode=="function"||typeof u.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=Je(t);if(!o||vu(i))return null;let s=[];t:for(let u of e.dirtyRoots){if(!u.isConnected||u===t||!t.contains(u))return null;for(let p of e.dirtyRoots)if(p!==u&&p!==t&&p.contains(u))continue t;s.push(u)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let u of s){if(u.parentElement===t||u.matches?.(sa)||u.querySelector?.(sa)||xu(u,o))return null;let p=r.srcToClone.get(u);if(!p||!p.parentNode)return null;let h=new Map,m={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:h,options:n},d=qn(u,null),g=Wn(u),y;try{y=await Yt(u,m,n)}finally{g(),d()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Re(u,y,m,n),m.__pseudoCSS))return null;await Cn(y,m),Dn(y);try{await Rn(y,u,h)}catch{}if(await Promise.all([Un(y,n),zn(u,y,r.styleCache,n,h)]),n.compress)try{await tr(y,n,h)}catch{}for(let[b,S]of h.entries())ho(b,S);p.replaceWith(y),Eu(p,r);for(let[b,S]of h.entries())r.nodeMap.set(b,S),r.srcToClone.set(S,b)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[u,p]of r.nodeMap.entries()){if(!p||p.nodeType!==1||!p.isConnected)continue;let h=r.styleMap.get(u);if(!h)continue;let m=Mu(h);if(!m)continue;let d=null,g=!1;for(let y in m)if(d||(d=getComputedStyle(p)),!Cu(d.getPropertyValue(y),m[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(u))return null;wo.reconciled++,await lt(p,u,a,n)}}let c=Ve(r.styleMap);for(let[u,p]of r.styleMap.entries())_u(u),po(u,p,c);let f=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([u,p])=>`.${p}{${u}}`).join("");Zn(r.clone,n.__compressedAssets);let l=await er({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:f,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=Jn(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}yt();var xo=new WeakMap,or=new WeakMap,wa=new WeakSet,So=new WeakMap,Fu=64,an=new Map,Sa=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],Tu=["(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 $u(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":Tu.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function la(t){let e=[];for(let n=t;n;){try{let r=n.getBoundingClientRect();e.push(r.x,r.y,r.width,r.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=n.getRootNode?.()?.host||null}return e.join("|")}function fa(t,e){if(e.disposed||(an.delete(t),an.set(t,e),an.size<=Fu))return;let[n,r]=an.entries().next().value;xa(n,r)}function xa(t,e){e.disposed=!0,an.delete(t),xo.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of Sa)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of ko)n.removeEventListener(r,e.onMediaDirty,!0);for(let[n,r]of e.trackedImages)n.removeEventListener("load",r),n.removeEventListener("error",r);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 va(t){if(wa.has(t))return!1;or.delete(t);let e=[t],n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i],s=[];o?.nodeType===1&&s.push(o);try{s.push(...o.querySelectorAll("*"))}catch{return!1}for(let a of s){a.shadowRoot&&e.push(a.shadowRoot);let c=String(a.localName||a.tagName||"").toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(c)||c==="progress"&&!a.hasAttribute("value")||/^(?:animate|animatetransform|animatemotion|set)$/.test(c))return!1;let f="";if(c==="img"){r.push(a);try{f=a.currentSrc||a.src||""}catch{}}/^(?:input|textarea|select|option)$/.test(c)&&n.push(a);let l=a.getAttribute?.("style")||"",u=So.get(a);if(f||l){if((!u||u.src!==f||u.style!==l)&&(u={src:f,style:l,animated:Le(f)||Le(l)},So.set(a,u)),u.animated)return!1}else u&&So.delete(a)}}return or.set(t,{roots:e.slice(1),controls:n,images:r}),!0}function vo(t,e){if(!t.querySelectorAll)return!1;let n=or.get(t);or.delete(t);let r=new Set(n?.roots||[]);if(n&&(e.controls=n.controls,e.scannedImages=n.images),!n){let i=[t];for(let o=0;o<i.length;o++){let s=i[o];s.shadowRoot&&!r.has(s.shadowRoot)&&(r.add(s.shadowRoot),i.push(s.shadowRoot));for(let a of s.querySelectorAll("*"))a.shadowRoot&&!r.has(a.shadowRoot)&&(r.add(a.shadowRoot),i.push(a.shadowRoot))}}for(let[i,o]of e.trackedShadowRoots)if(!r.has(i)){try{o.disconnect()}catch{}for(let a of ko)i.removeEventListener(a,e.onMediaDirty,!0);e.trackedShadowRoots.delete(i);let s=e.observers.indexOf(o);s>=0&&e.observers.splice(s,1)}for(let i of r)if(!e.trackedShadowRoots.has(i))try{let o=new MutationObserver(e.markDirty);o.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),o.__flush=e.markDirty,e.observers.push(o),e.trackedShadowRoots.set(i,o);for(let s of ko)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var ko=["scroll","change","beforetoggle","toggle"];function ir(t,e){return[t,...e.trackedShadowRoots.keys()]}function Co(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of ir(t,e))r.querySelectorAll&&n.push(...r.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let r=new Set(n);for(let[i,o]of e.trackedImages)r.has(i)||(i.removeEventListener("load",o),i.removeEventListener("error",o),e.trackedImages.delete(i))}for(let r of n){if(r.complete||e.trackedImages.has(r))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r)};e.trackedImages.set(r,i),r.addEventListener("load",i),r.addEventListener("error",i)}}function ua(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(oe(i))if(i.type==="attributes"){let o=e.get(i.target);o||e.set(i.target,o=new Map),o.has(i.attributeName)||o.set(i.attributeName,i.oldValue)}else if(i.type==="characterData")n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type==="childList"){let o=r.get(i.target);o||r.set(i.target,o=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)-1)}}else return!0;for(let[i,o]of e)for(let[s,a]of o)if(i.getAttribute(s)!==a)return!0;for(let[i,o]of n)if(i.data!==o)return!0;for(let i of r.values())for(let o of i.values())if(o!==0)return!0;return!1}var Pu=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,Ne=t=>t&&(typeof t=="object"||typeof t=="function")?rr(t):"-";function Nu(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let r=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(r)){let o=Math.ceil(e/3)*4;return atob(i.slice(0,o-o%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(o,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function Lu(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=Nu(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 da(t){let e=String(t||"").trim();return e?Pu.test(e)?!0:/^data:/i.test(e)?Lu(e):!1:!1}function Le(t){let e=String(t||"");if(da(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(da(n[1]??n[2]??n[3]))return!0;return!1}function pa(t,e=null){let n=t&&t.clone;if(!n)return!1;let r=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of r)for(let o of ka(i))if(Le(o.getAttribute?.("src"))||Le(o.getAttribute?.("href"))||Le(o.getAttribute?.("style"))||Le(t.styleMap?.get(o)))return!0;return!1}function ka(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function Ao(t,e){let n=[],r=new Set,i=o=>{o&&!r.has(o)&&(r.add(o),n.push(o))};t.matches?.("input,textarea,select,option")&&i(t);for(let o of ir(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function Mo(t,e){let n=[],r=new Set,i=(o,s=!1)=>{if(!(!o||r.has(o))){r.add(o);try{(s||o.scrollLeft||o.scrollTop||o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)&&n.push(o)}catch{}}};for(let o=t;o;o=o.parentElement)i(o,!0);for(let o of ir(t,e))for(let s of ka(o))i(s);e.scrollNodes=n}function ha(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",$u(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(Ne))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(Ne))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(Ne(o)),(s?.contains(t)||t.contains(s))&&i.push(Ne(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let l of e.scrollNodes)a.push(l.scrollLeft||0,l.scrollTop||0);let c=[];for(let l of e.controls){let u=String(l.localName||"").toLowerCase();u==="input"?c.push(l.type,ze(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):u==="textarea"?c.push(l.value):u==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let f=[];for(let l of e.images){let u="";try{u=l.currentSrc||l.src||""}catch{}f.push(u,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:f,frameDriven:e.retainedFrameDriven}}function Pe(t,e,n){if(!t)return!1;let r=t[n],i=e[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function ma(t,e){let n=new Set;for(let r of ir(t,e))try{let i=r.getAnimations?.(r.nodeType===1?{subtree:!0}:void 0)||[];for(let o of i)n.add(o)}catch{}return[...n]}function ga(t){return t.map(e=>[Ne(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Iu(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let r of e.trackedShadowRoots.keys())if(r.contains(n))return r;return null}function Wu(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:Se(),styleEpoch:Wt(),styleStamp:Qe(t),outsideMutations:Ke(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let c=a&&(a.nodeType===1?a:a.parentElement);if(!c||c===t||!t.contains(c)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(c)},i=a=>{if(e.capturing){for(let c of a)e.pending.push(c);return}for(let c of a)oe(c)&&(e.dirty=!0,r(c.target))},o=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(i);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=i,e.observers.push(a)}catch{}e.markDirty=i,e.onMediaDirty=o;try{for(let a of Sa)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return vo(t,e)||Ao(t,e),Mo(t,e),Co(t,e),e}var Ou=0,ya=new WeakMap;function rr(t){let e=ya.get(t);return e||(e="@"+ ++Ou,ya.set(t,e)),e}function _o(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(rr(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(rr(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=_o(s,e);if(a===null)return null;o.push(a)}return"["+o.join(",")+"]"}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return JSON.stringify(rr(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=_o(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function ba(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=_o(i,new Set);return o===null?null:`${(e||[]).map(Ne).join(",")}:${o}`}catch{return null}}function Ca(t,e,n,r,i=null){let o=xo.get(t);o||(o=Wu(t),o.baselineSignature=ba(e,n.plugins),xo.set(t,o));let s=ba(e,n.plugins),a=async()=>{if(o.disposed)return r();let f=s===null||s!==o.baselineSignature;f&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,f=!1):o.pendingSig=s:o.pendingSig=null,vo(t,o),Co(t,o);for(let C of o.observers)C.__flush(C.takeRecords());At();let l=Ke(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let u=t.getRootNode?.(),p=[...o.trackedShadowRoots.keys()];u?.nodeType===11&&!p.includes(u)&&p.push(u),xn(t.ownerDocument||document,p);let h=Qe(t);o.styleStamp!==h&&(o.styleStamp=h,o.dirty||o.dirtyAll());let m=ha(t,o),d=ma(t,o);m.animation=ga(d),o.renderState&&(!Pe(o.renderState,m,"style")&&(xe(),o.dirtyAll()),Pe(o.renderState,m,"scroll")||o.dirtyAll(),Pe(o.renderState,m,"controls")||(ie(t),o.dirtyAll()),!Pe(o.renderState,m,"images")&&!o.dirty&&o.dirtyAll());let g=Se();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Wt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let C=la(t);o.geometry!==null&&C!==o.geometry&&(ie(t),o.dirtyAll()),o.geometry=C}n.invalidate&&o.dirtyAll();let b=!1,S=!!o.renderState&&!Pe(o.renderState,m,"animation");try{let C=new Set;S&&d.length===0&&(C=null);for(let A of d){let M=A.playState==="running";if(!M&&!S)continue;M&&(b=!0),S=!0;let x=A.effect?.target;if(Iu(t,o,x)===t)C.add(x);else{C=null;break}}if(S&&C&&C.size&&o.retained){o.dirty=!0;for(let A of C)o.dirtyRoots&&o.dirtyRoots.add(A),ie(A)}else S&&!C&&o.dirtyAll()}catch{}let k=m.frameDriven,v=b||k;if(v&&(o.last=null),k&&o.dirtyAll(),!f&&!v&&!o.dirty&&o.last)return fa(t,o),o.last;o.capturing=!0;let w=null;try{let C=null,A=!1,M=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){M=[...o.dirtyRoots];let x=await ca(t,o,n);x&&(C=await i(x),A=!0)}if(C||(f||(n.__retain=x=>{let _=new Map;for(let[R,T]of x.nodeMap.entries())_.set(T,R);w={...x,srcToClone:_}}),n.__tornSinceStart=()=>{for(let x of o.observers)for(let _ of x.takeRecords())o.pending.push(_);return At(),o.torn||ua(o.pending)||Ke(t)!==l},C=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,w?(o.retained=w,o.retainedFrameDriven=pa(w),Ao(t,o),Mo(t,o)):A&&(o.retainedFrameDriven||(o.retainedFrameDriven=pa(o.retained,M)),Ao(t,o),Mo(t,o));let x=ha(t,o);x.animation=ga(ma(t,o));let _=["style","scroll","controls","images"];b||_.push("animation");let R=_.every(T=>Pe(m,x,T));o.renderState=x,o.styleEpoch=Wt(),o.styleStamp=Qe(t),o.geometry=la(t),o.renderState.frameDriven?(wa.add(t),xa(t,o)):R?!v&&!o.renderState.frameDriven&&(o.last=C,fa(t,o)):(o.dirtyAll(),o.last=null)}return C}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let A of o.observers)for(let M of A.takeRecords())o.pending.push(M);At();let C=Ke(t);(o.torn||ua(o.pending)||C!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=C,o.styleEpoch=Wt(),o.styleStamp=Qe(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||(vo(t,o),Co(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var sr=null;function _a(t){sr=t}var Du='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Eo=!1,cn=null,Ro=new WeakMap,Aa=!1;function Ea(t,e){!Eo||!cn||e&&e.burst===!1||Ro.set(cn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Ra(t){let e={control:t};cn=e,setTimeout(()=>{cn===e&&(cn=null)},0)}function To(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Du):null}function Ma(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=To(t);e&&(Ra(e),Fo(t,!1))}function Bu(t){let e=To(t);e&&Ra(e)}function Fo(t,e=!0){if(!sr||document.visibilityState==="hidden")return;let n=To(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=Ro.get(n);if(r){if(!r.element.isConnected){Ro.delete(n);return}sr(r.element,r.options).catch(()=>{});return}e&&!Aa&&(Aa=!0,sr(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Fa(){if(Eo||typeof document>"u"||typeof document.addEventListener!="function")return;Eo=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Ma,t),document.addEventListener("keydown",Ma,t),document.addEventListener("click",Bu,t),document.addEventListener("pointerenter",Fo,t),document.addEventListener("focusin",Fo,t)}bt();function sd(...t){return Vs(...t),X}async function ad(t,e){if(typeof t!="string"||!t.trim())throw new Error("[snapdom.fromString] html string required");let n=document.createElement("div");J(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await dt();let r=Array.from(n.childNodes).some(o=>o.nodeType===3&&o.textContent.trim()),i=n.children.length===1&&!r?n.firstElementChild:n;return await Ho(i,{...e||{},burst:!1})}finally{n.remove()}}var cd="3.1.1-dev.1",X=Object.assign(Ho,{plugins:sd,fromString:ad,version:cd,preCapture:Fa});_a(Ho);var Uo=Symbol("snapdom.internal"),ld=Symbol("snapdom.internal.silent"),Ua=new Set(["png","jpeg","jpg","webp","svg"]);async function Ho(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=ia(e);n.element=t,n.invalidate&&xe(),Gs(n,e&&e.plugins);let{stage:r,loweredBy:i}=zs(n);n.needs=r,n.__needsLoweredBy=i;let o=$e(r,"render"),s=n.burst===!0||!Yn(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",f=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&va(t);return f&&Ea(t,e),n.snap||(n.snap={toPng:(l,u)=>X.toPng(l,u),toSvg:(l,u)=>X.toSvg(l,u)}),f?Ca(t,e,n,()=>X.capture(t,n,Uo),l=>Ha(l,n)):X.capture(t,n,Uo)}X.capture=async(t,e,n)=>{if(n!==Uo)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");if($e(e.needs||vt,"render")&&Y()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=Pn(t);e.clip||(e.__fontUsage=a);let c=a.required,f=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(f=new Set([...f].filter(l=>s.has(l.toLowerCase()))),f.size===0))throw null;await Nn(f,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(en(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){D(e,"safari canvas poke failed",s)}}let r=await oa(t,e);return Ha(r,e)};async function Ha(t,e){let n=e.needs||vt,r=$e(n,"render"),i=E=>js(n,e.__needsLoweredBy||[],E),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??(s=o.toDataURL()),c=o||t;o&&(t="");let f=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let u,p=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),d=m?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=m?Number.isFinite(e.height)?p.targetH/p.vbH:p.targetW/p.vbW:1,y=E=>{if(o||!f?.size)return c;let L=p.vbW,P=p.vbH,F=E.crop;F&&(L=Math.max(1,Math.min(L,F.x+F.width)-Math.max(0,F.x)),P=Math.max(1,Math.min(P,F.y+F.height)-Math.max(0,F.y)));let V=Number.isFinite(E.width),z=Number.isFinite(E.height);return(V&&z?Math.max(E.width/L,E.height/P):V?E.width/L*(F?Math.max(1,g/d):1):z?E.height/P*(F?Math.max(1,d/g):1):(E.scale||1)*Math.max(d,g))*(E.dpr||1)<=l?c:u??(u=ta(a(),f))},b=async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(We(),un));return P(c,{...E,...L||{},format:"png"})},S=()=>{if(!r)throw i("svgString");if(o)throw new Error("[snapdom] svgString: engine:'html-in-canvas' produces a raster capture; there is no serialized SVG");let E=t.indexOf(",");return E>=0?decodeURIComponent(t.slice(E+1)):""},k=E=>Object.defineProperty({...E||{},svgString:S},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),v={img:async(E,L)=>{if(o)return b(E,L);let{toImg:P}=await Promise.resolve().then(()=>(Oo(),Wo)),F={...E,...L||{}};return P(y(F),F)},svg:async(E,L)=>{if(o)return b(E,L);let{toSvg:P}=await Promise.resolve().then(()=>(Oo(),Wo)),F={...E,...L||{}};return P(y(F),F)},canvas:async(E,L)=>{let{toCanvas:P}=await Promise.resolve().then(()=>(Ie(),Ia)),F={...E,...L||{}};return P(y(F),F)},blob:async(E,L)=>{let{toBlob:P}=await Promise.resolve().then(()=>(Bo(),Wa)),F={...E,...L||{}};return P(y(F),F)},png:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"png"};return P(y(F),F)},jpeg:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"jpeg"};return P(y(F),F)},webp:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"webp"};return P(y(F),F)},download:async(E,L)=>{let{download:P}=await Promise.resolve().then(()=>(Ba(),Da)),F={...E,...L||{}};return P(y(F),F)}};if(!r)for(let E of Object.keys(v)){let L=E==="download"?"download()":`to${E.charAt(0).toUpperCase()}${E.slice(1)}()`;v[E]=async()=>{throw i(L)}}let w={};for(let E of["img","svg","canvas","blob","png","jpeg","webp"])w[E]=async L=>v[E](e,{...R(E,L||{}),[ld]:!0});w.jpg=w.jpeg;let C=E=>Object.defineProperty({...e,...E},"options",{value:e,configurable:!0}),A=C({artifacts:e.__artifacts||null,export:k(),exports:w}),M=await Xn("defineExports",A),x=Object.assign({},...M.filter(E=>E&&typeof E=="object").reverse()),_={...v,...x};_.jpeg&&!_.jpg&&(_.jpg=(E,L)=>_.jpeg(E,L));function R(E,L){let P=L||{},F={...e,...P},V=typeof P.type=="string"?P.type.toLowerCase():"",z=typeof P.format=="string"?P.format.toLowerCase():Ua.has(V)?V:"";z&&(F.format=z==="jpg"?"jpeg":z),F.__explicitFormat=z?F.format:e.__explicitFormat??null,E==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let q=Z=>Z==="jpeg"||Z==="jpg"||Z==="webp";return[E,F.format,V].map(Z=>typeof Z=="string"?Z.toLowerCase():"").find(q)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&D(F,"width/height define the output size \u2014 scale is ignored when either is set"),F}let T=!1,$=Promise.resolve();async function O(E,L){let P=Object.freeze(L&&typeof L=="object"?{...L}:{}),F=async()=>{let z=_[E];if(!z)throw new Error(`[snapdom] Unknown export type: ${E}`);let q=R(E,P),B=C({artifacts:e.__artifacts||null,export:k({type:E,options:q,requestedOptions:P})}),Z=q.format,_t=q.type;await Xn("beforeExport",B,{format:E,options:q});let Dt=q.format!==Z?q.format:q.type!==_t?q.type:"",mt=typeof Dt=="string"?Dt.toLowerCase():"";Ua.has(mt)&&(q.format=mt==="jpg"?"jpeg":mt,q.type=q.format,q.__explicitFormat=q.format,/^(?:jpeg|webp)$/.test(q.format)&&(q.backgroundColor==null||q.backgroundColor==="transparent")&&(q.backgroundColor="#ffffff"));let st=await z(B,q);return await Xn("afterExport",B,{format:E,options:q,result:st}),T||(T=!0,await Ot("afterSnap",e)),st},V=$.then(F);return $=V.catch(()=>{}),V}let H={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(E,L)=>O(E,L),toImg:E=>O("img",E),toSvg:E=>O("svg",E),toCanvas:E=>O("canvas",E),toBlob:E=>O("blob",E),toPng:E=>O("png",E),toJpg:E=>O("jpg",E),toWebp:E=>O("webp",E),download:E=>O("download",E)};r?o&&Object.defineProperty(H,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(H,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(H,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let E of Object.keys(_)){let L="to"+E.charAt(0).toUpperCase()+E.slice(1);H[L]||(H[L]=P=>O(E,P))}return H}X.toRaw=(t,e)=>X(t,e).then(n=>n.toRaw());X.toImg=(t,e)=>X(t,e).then(n=>n.toImg());X.toSvg=(t,e)=>X(t,e).then(n=>n.toSvg());X.toCanvas=(t,e)=>X(t,e).then(n=>n.toCanvas());X.toBlob=(t,e)=>X(t,e).then(n=>n.toBlob());X.toPng=(t,e)=>X(t,{...e,format:"png"}).then(n=>n.toPng());X.toJpg=(t,e)=>X(t,{...e,format:"jpeg"}).then(n=>n.toJpg());X.toWebp=(t,e)=>X(t,{...e,format:"webp"}).then(n=>n.toWebp());X.download=(t,e)=>X(t,e).then(n=>n.download());typeof window<"u"&&(window.snapdom=X);})();
39
+ }`,nu=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Tt=null,ru=0,ou=0,ce=new Map;function ra(){for(let t of ce.values())t(void 0);if(ce.clear(),Array.isArray(Tt))for(let t of Tt)try{t?.terminate()}catch{}Tt=!1}function iu(){let t,e=null;try{t=URL.createObjectURL(new Blob([eu],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=ce.get(n.data.id);r&&(ce.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=ra}catch{e=null}return t&&URL.revokeObjectURL(t),e}function su(){if(Tt===!1)return!1;if(Tt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Tt=!1;Tt=[]}let t=ru++%nu;if(!Tt[t]){let e=iu();if(!e)return ra(),!1;Tt[t]=e}return Tt[t]}var au=5e3;function cu(t,e,n,r,i){let o=su();return o?new Promise(s=>{let a=++ou,c=setTimeout(()=>{ce.delete(a),s(void 0)},au);ce.set(a,f=>{clearTimeout(c),s(f)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:na,quality:ea,mime:r})}catch{clearTimeout(c),ce.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function yo(t,e,n,r){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let i=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,o=N.compress,s=o.get(i);if(s?.source===t)return s.result;let a=Kn.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Kf(t),u=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=tu(t);if(p&&p.w>0&&p.h>0&&!Qs(p.w,p.h,e,n))return null;if(t.length>=Qf){let w=await cu(t,e,n,u,r);if(w!==void 0)return w}let h;try{h=await Yf(t)}catch{return null}let m=h.naturalWidth||h.width,d=h.naturalHeight||h.height;if(!m||!d)return null;let g=Qs(m,d,e,n);if(!g)return null;let y=g*na,b=Math.max(1,Math.round(m*y)),S=Math.max(1,Math.round(d*y)),k=document.createElement("canvas");k.width=b,k.height=S;let v=k.getContext("2d");if(!v)return null;v.imageSmoothingEnabled=!0,v.imageSmoothingQuality="high",v.drawImage(h,0,0,b,S);try{let w=k.toDataURL(u,ea);if(typeof w=="string"&&w.startsWith("data:image")&&w.length<t.length)return w}catch{}return null})(),f={source:t,promise:c,cache:o};Kn.set(i,f);try{let l=await c;return Jf(o,i,t,l),l}finally{Kn.get(i)===f&&Kn.delete(i)}}async function lu(t,e,n=new Map,r={}){if(!e.compress)return{count:0,before:0,after:0};let i=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&i.unshift(t);let o=0,s=0,a=0,c=async l=>{let u=l.getAttribute("src")||"";if(!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let p=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,h=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!h)return;let m=r.value||(r.value=go(t,e)),d=m.density*m.stretch(n.get(l)||l),g=await yo(u,p*d,h*d,l.__snapdomBlob);g&&(o++,s+=u.length,a+=g.length,l.setAttribute("src",g),Qn(l,"attribute","src",u,g,e))},f=6;for(let l=0;l<i.length;l+=f)await Promise.allSettled(i.slice(l,l+f).map(c));return{count:o,before:s,after:a}}var fu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function uu(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function du(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=[],o=[t,...t.querySelectorAll("*")];for(let f of o){let l=f.style&&f.style.backgroundImage;l&&l.includes("data:image")&&i.push(f)}let s=0,a=async f=>{let l=n.get(f);if(!l||!l.isConnected)return;let u;try{u=getComputedStyle(l)}catch{return}if((u.backgroundRepeat||"repeat").toLowerCase().split(",").some(A=>A.trim()!=="no-repeat"))return;let h=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(h.split(",").some(A=>!fu.test(A.trim())))return;let{w:m,h:d}=uu(l);if(!m||!d)return;let g=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(A=>parseFloat(A)/100)),y=r.value||(r.value=go(t,e)),b=y.density*y.stretch(l)*g,S=m*b,k=d*b,v=f.style.backgroundImage,w=[...v.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],C=v;for(let A of w){let M=A[2];if(M.startsWith("data:image/svg"))continue;let x=await yo(M,S,k);x&&(C=C.split(M).join(x),s++)}C!==v&&(f.style.setProperty("background-image",C,f.style.getPropertyPriority("background-image")),Qn(f,"style","background-image",v,f.style.backgroundImage,e))},c=6;for(let f=0;f<i.length;f+=c)await Promise.allSettled(i.slice(f,f+c).map(a));return{count:s}}async function pu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=Array.from(t.querySelectorAll("image"));t.localName==="image"&&i.unshift(t);let o=0,s=async c=>{let f=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!f||!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",u=c.getAttribute("height")||"";if(l.includes("%")||u.includes("%"))return;let p=n.get(c),h=p?W(p):c.style,m=(k,v)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[k]||""))return parseFloat(h[k]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(v.trim()))return parseFloat(v);try{return p?.[k]?.baseVal?.value||0}catch{return 0}},d=m("width",l),g=m("height",u);if(!d||!g)return;let y=r.value||(r.value=go(t,e)),b=y.density*y.stretch(p||c),S=await yo(f,d*b,g*b);S&&(c.setAttribute("href",S),Qn(c,"attribute","href",f,S,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(Js,"xlink:href",S),Qn(c,"attribute","xlink:href",f,S,e)),o++)},a=6;for(let c=0;c<i.length;c+=a)await Promise.allSettled(i.slice(c,c+a).map(s));return{count:o}}async function tr(t,e,n){if(!e.compress)return;let r={};await lu(t,e,n,r),await du(t,e,n,r),await pu(t,e,n,r)}pt();ut();bt();function hu(t,e){if(Y())return t;let n=t.indexOf("</style>");if(n===-1)return t;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,f;for(let y of i)if(y.intern)for(c.lastIndex=0;f=c.exec(y.text);)a.set(f[1],(a.get(f[1])||0)+1);let l=0;for(let[y,b]of a)b>1&&(l+=(b-1)*y.length);if(l<2048||t.includes(" data-sdi="))return t;let u=mu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let p=new Map,h=0,m=[],d=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let S=p.get(b);return S===void 0&&(S="i"+(h++).toString(36),p.set(b,S),m.push(`[data-sdi="${S}"]{${b}}`)),` data-sdi="${S}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,d):y.text;return t.slice(0,n)+m.join("")+g}function mu(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let f=c.getAttribute("style");f&&r.add(f)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=f=>{for(let l of f){if(l.type===CSSRule.IMPORT_RULE||l.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(l.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(l.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(l.selectorText).forEach(i)}l.cssRules&&c(l.cssRules)}};for(let f of[...t.querySelectorAll("style")].slice(1)){let l=f.textContent||"";if(/@import\b/i.test(l))return null;let u=new CSSStyleSheet;u.replaceSync(l),c(u.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let c of r){s.setAttribute("style",c);let f=a.serializeToString(s).match(/ style="([^"]*)"/);f&&o.add(f[1])}return o}async function er(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:K,...tt}=t;t=Object.assign(a,tt),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,f;Ns(t,s),await Ot("beforeRender",t);let l=W(t.element),u=t.element.getBoundingClientRect(),p=Math.max(1,I(t.element.offsetWidth||parseFloat(l.width)||u.width||1)),h=Math.max(1,I(t.element.offsetHeight||parseFloat(l.height)||u.height||1)),m=t.element.ownerDocument||document;if(!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned){let K=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);K>0&&(h=Math.max(h,I(K))),tt>0&&(p=Math.max(p,I(tt)));try{let Q=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,et=N.measureHints.get(t.element);if(et&&et.cssLen===Q&&et.w0===p&&et.docH===K&&et.docW===tt)et.csh>0&&(h=Math.max(h,I(et.csh))),et.csw>0&&(p=Math.max(p,I(et.csw)));else{let nt=m.createElement("div");J(nt),nt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+p+"px!important;overflow:visible!important;visibility:hidden!important;";let Jt=nt.attachShadow({mode:"open"}),Zt=m.createElement("style");Zt.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,Jt.appendChild(Zt),Jt.appendChild(t.clone.cloneNode(!0)),m.body.appendChild(nt);let Be=nt.scrollHeight,Ht=nt.scrollWidth;m.body.removeChild(nt),N.measureHints.set(t.element,{cssLen:Q,w0:p,docH:K,docW:tt,csh:Be,csw:Ht}),Be>0&&(h=Math.max(h,I(Be))),Ht>0&&(p=Math.max(p,I(Ht)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let K=uo(t.element,t.options),tt=1,Q=uo(t.element,{}),et=Math.max(2,h*.15);Number.isFinite(Q)&&Q>=h-et&&Number.isFinite(K)&&K>0&&(h=Math.max(1,Math.min(h,I(K+tt))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Ps(t.element,t.clone,K,t.nodeMap,p,h)}catch(K){console.warn("[snapdom] reconcile pass failed:",K)}let g=(K,tt=NaN)=>{let Q=typeof K=="string"?parseFloat(K):K;return Number.isFinite(Q)?Q:tt},y=g(t.options.width),b=g(t.options.height),S=n?I(n.width):p,k=n?I(n.height):h,v=S,w=k,C=Number.isFinite(y),A=Number.isFinite(b),M=k>0?S/k:1;C&&A?(v=Math.max(1,I(y)),w=Math.max(1,I(b))):C?(v=Math.max(1,I(y)),w=Math.max(1,I(v/(M||1)))):A&&(w=Math.max(1,I(b)),v=Math.max(1,I(w*(M||1))));let x=0,_=0,R=p,T=h;if(n){let K=0,tt=0;if(bo(t.element)){let Q=null;if(!r&&o&&Number.isFinite(o.a))Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let et=ae(t.element),nt=fo(l.transform&&l.transform!=="none"?l.transform:"",et);nt&&nt.is2D&&(Q={a:nt.a,b:nt.b,c:nt.c,d:nt.d,e:0,f:0})}if(Q&&!(Q.a===1&&Q.b===0&&Q.c===0&&Q.d===1)){let{ox:et,oy:nt}=rn(l,p,h),Jt=Fe(p,h,Q,et,nt);K=Jt.minX,tt=Jt.minY}}x=I(n.x+K),_=I(n.y+tt),R=I(x+n.width),T=I(_+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let K={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},tt=Fe(p,h,K,0,0);x=I(tt.minX),_=I(tt.minY),R=I(tt.maxX),T=I(tt.maxY)}else if(r&&bo(t.element)){let tt=l.transform&&l.transform!=="none"?l.transform:"",Q=ae(t.element),et=Kt({baseTransform:tt,rotate:Q.rotate||"0deg",scale:Q.scale,translate:Q.translate,width:p,height:h}),{ox:nt,oy:Jt}=rn(l,p,h),Zt=et.is2D?et:new DOMMatrix(et.toString()),Be={a:Zt.a,b:Zt.b,c:Zt.c,d:Zt.d,e:0,f:0},Ht=Fe(p,h,Be,nt,Jt);x=I(Ht.minX),_=I(Ht.minY),R=I(Ht.maxX),T=I(Ht.maxY)}let $=ro(l),O=oo(l),H=io(l),E=so(l),L=ao(l),P=u.width>0?(R-x)/u.width:1,F=u.height>0?(T-_)/u.height:1,V=i==="subtree"&&!n?xs(t.element,t.nodeMap,t.styleCache,P,F):{top:0,right:0,bottom:0,left:0},z=n?{top:0,right:0,bottom:0,left:0}:i?{top:I(Math.max($.top,O.top,V.top)+H.top+E.top+L.bleed.top),right:I(Math.max($.right,O.right,V.right)+H.right+E.right+L.bleed.right),bottom:I(Math.max($.bottom,O.bottom,V.bottom)+H.bottom+E.bottom+L.bleed.bottom),left:I(Math.max($.left,O.left,V.left)+H.left+E.left+L.bleed.left)}:{top:H.top,right:H.right,bottom:H.bottom,left:H.left};x=I(x-z.left),_=I(_-z.top),R=I(R+z.right),T=I(T+z.bottom);let q=Math.max(1,I(R-x)),B=Math.max(1,I(T-_)),Z="http://www.w3.org/2000/svg",_t=bo(t.element)?2:0,mt=I(_t+(r?0:1)),st=Math.ceil(q+mt*2),at=Math.ceil(B+mt*2),Pt=I(-(I(x)-mt)),U=I(-(I(_)-mt)),G=Math.max(0,Pt),j=Math.max(0,U),ft=I(st-Math.min(0,Pt)),Et=I(at-Math.min(0,U)),gt=document.createElementNS(Z,"foreignObject");gt.setAttribute("x",String(Math.min(0,Pt))),gt.setAttribute("y",String(Math.min(0,U))),gt.setAttribute("width",String(ft)),gt.setAttribute("height",String(Et)),gt.style.overflow="visible";let ue=document.createElement("style"),dn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";ue.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+dn+t.classCSS,gt.appendChild(ue);let Oe=document.createElement("div");Oe.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Oe.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${ft}px;height:${Et}px`+(G!==0||j!==0?`;padding:${j}px 0 0 ${G}px !important`:""),Oe.appendChild(t.clone),gt.appendChild(Oe);let ur=new XMLSerializer().serializeToString(gt),Bt=C||A,dr=Object.freeze({w0:S,h0:k,vbW:st,vbH:at,targetW:v,targetH:w,contentX:I(Pt+(n?x:0)),contentY:I(U+(n?_:0)),clip:n?Object.freeze({x:I(x),y:I(_),width:S,height:k}):null});Object.defineProperty(a,"meta",{value:dr,enumerable:!0,writable:!1,configurable:!0});let pr=!Bt||Y()?st:C?v:I(st*(w/at)),pn=!Bt||Y()?at:A?w:I(at*(v/st)),Ut=parseFloat(W(m.documentElement)?.fontSize)||16;f=`<svg xmlns="${Z}" width="${pr}" height="${pn}" viewBox="0 0 ${st} ${at}" font-size="${Ut}px">`+hu(ur,gt)+"</svg>",c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,t.svgString=f,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Ot("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let hr=[...document.querySelectorAll("#snapdom-sandbox")].find(jt);return hr&&hr.style.position==="absolute"&&hr.remove(),t.dataURL}function bo(t){return ks(t)}function gu(t){let e=Array.isArray(t.plugins)?t.plugins:Xs(),n=[];for(let r of e){let i=sn(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function oa(t,e){if(!t)throw new Error("Element cannot be null or undefined");e.__session=mo(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=gu(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,f,l="",u=null,p=e.needs||vt,h=n.format,m=n.type;await Ot("beforeSnap",n);let d=n.format!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(d||g){let R=String(d?n.format:n.type).toLowerCase();n.format=R==="jpg"?"jpeg":R,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Ot("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,S=n.clip?On(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=wi(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let k=ci(e.fast);for(;;){e.__slicer=k;let R=qn(n.element,S);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:f}=await Ls(n.element,n.options)),c>0&&!e.reconcile&&(St(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),N.warnedReconcile||(N.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time)."))),!y&&r&&(u=vs(n.element,r)),!b&&r&&Rs(n.element,r,n.options),r&&(Ts(n.element,r,a),Fs(n.element,r))}finally{R()}if(!k?.yielded||!e.__tornSinceStart?.())break;k=null,e.__session=mo(e.cache)}if(e.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Ot("afterClone",n),!$e(p,"render"))return null;if(k?.due()&&await k.pause(),Dn(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{$s(n.element,n.clone,n.styleCache,n.nodeMap)}catch(R){St(e.__session,"shrink-failed","shrink pass failed",R),console.warn("[snapdom] shrink pass failed:",R)}try{await Rn(n.clone,n.element,n.nodeMap)}catch{}let v=R=>Promise.resolve().then(R),w=(async()=>{await Promise.all([v(()=>Un(n.clone,n.options)),v(()=>zn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Os(n.element,n.clone,n.nodeMap)}catch(R){St(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",R),console.warn("[snapdom] backdrop-filter emulation failed:",R)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await v(()=>tr(n.clone,n.options,n.nodeMap))),e.captureSelection)try{Vi(n.nodeMap)}catch(R){St(e.__session,"selection-compose-failed","field selection compose failed",R)}})(),C=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(C=v(async()=>{let R=n.element.ownerDocument||document,T=S?H=>{try{let E=H.getBoundingClientRect();return E.right>=S.left-200&&E.left<=S.right+200&&E.bottom>=S.top-200&&E.top<=S.bottom+200}catch{return!0}}:null,{required:$,usedCodepoints:O}=!S&&e.__fontUsage||Pn(n.element,T);if(e.embedFonts==="auto"){let H=new Set;try{for(let L of R.fonts)H.add(String(L.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(H.size>0&&Array.from($).some(L=>H.has(String(L).split("__")[0].toLowerCase()))))return}if(Y()){let H=new Set(Array.from($).map(E=>String(E).split("__")[0]).filter(Boolean));await Nn(H,1,R)}l=await is({required:$,usedCodepoints:O,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:R})})),await Promise.all([w,C]);let M=(n.options.plugins||[]).some(R=>R&&(typeof R.beforeRender=="function"||typeof R.afterRender=="function"));n.options.engine,k?.due()&&await k.pause();let x=n.clone;Zn(x,e.__compressedAssets);let _=await er(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:l});if(e.__compressedSnapshot=Jn(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return _}ut();yt();var yu=new Set(["png","jpeg","jpg","webp","svg"]);function ia(t={}){let e=typeof t.type=="string"&&yu.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let r=t.format!=null?n:e==="jpg"?"jpeg":e,i=zo(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let u of o)typeof u=="string"?s.push(u):typeof u=="function"?a.push(u):u!=null&&console.warn("[snapdom] Ignored invalid exclude entry (expected selector string or predicate):",u);let c=t.excludeMode??"hide",f=u=>{if(!u||u.nodeType!==1)return!1;if(u.getAttribute("data-capture")==="exclude")return!0;for(let p of Array.isArray(l.exclude)?l.exclude:[])try{if(u.matches(p))return!0}catch{}for(let p of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(p(u))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(u))return!0}catch{}return!1},l={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:c,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:f,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:rt(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:Yi(t.iconFonts),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:i,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:r,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,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return l}wt();ee();pt();var sa="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function bu(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var wu=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function Su(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(wu.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function xu(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(o=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(o.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let r=[t];t.querySelectorAll&&r.push(...t.querySelectorAll("*"));for(let i of r){let o=getComputedStyle(i),s=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var aa=new WeakMap;function vu(t){let e=Wt(),n=aa.get(t);if(n&&n.epoch===e)return n.leaky;let r=!1,i={budget:2e4},o=s=>{for(let a=0;a<s.length&&!r;a++){if(--i.budget<0){r=!0;return}let c=s[a],f=c.selectorText;if(f&&/[+~]|:has\(/.test(f)){r=!0;return}let l=c.style;if(l&&(l.counterReset||l.counterIncrement||l.counterSet||l.content&&l.content.includes("counter"))){r=!0;return}c.cssRules&&c.cssRules.length&&o(c.cssRules)}};try{for(let s of t.styleSheets){let a=null;try{a=s.cssRules}catch{r=!0}if(r)break;a&&o(a)}if(!r){let s=t.adoptedStyleSheets;if(Array.isArray(s))for(let a of s){if(r)break;try{o(a.cssRules)}catch{r=!0}}}}catch{r=!0}return aa.set(t,{epoch:e,leaky:r}),r}var ku=1/16;function Cu(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),r=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(r)&&Math.abs(n-r)<=ku}var nr=new Map,Au=["width","height","min-width","min-height"];function Mu(t){let e=nr.get(t);if(e===void 0){e=null;for(let n of Au){let r=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));r&&r[1].endsWith("px")&&((e||(e={}))[n]=r[1])}nr.size>5e3&&nr.clear(),nr.set(t,e)}return e}function _u(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function Eu(t,e){let n=[t];for(;n.length;){let r=n.pop();if(r.nodeType===1){let i=e.nodeMap.get(r);i!==void 0&&(e.nodeMap.delete(r),e.srcToClone.get(i)===r&&e.srcToClone.delete(i)),e.styleMap.delete(r)}for(let i=r.firstChild;i;i=i.nextSibling)n.push(i)}}var wo={attempts:0,served:0,reconciled:0};async function ca(t,e,n){wo.attempts++;try{let r=await Ru(t,e,n);return r&&wo.served++,r}catch{return null}}async function Ru(t,e,n){let r=e.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||t.scrollTop||t.scrollLeft||bu(t)||Su(r)||r.fontsCSS||Yn(n))return null;for(let u of n.plugins||[])if(u&&(typeof u.beforeSnap=="function"||typeof u.beforeClone=="function"||typeof u.resolveNode=="function"||typeof u.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=Je(t);if(!o||vu(i))return null;let s=[];t:for(let u of e.dirtyRoots){if(!u.isConnected||u===t||!t.contains(u))return null;for(let p of e.dirtyRoots)if(p!==u&&p!==t&&p.contains(u))continue t;s.push(u)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let u of s){if(u.parentElement===t||u.matches?.(sa)||u.querySelector?.(sa)||xu(u,o))return null;let p=r.srcToClone.get(u);if(!p||!p.parentNode)return null;let h=new Map,m={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:h,options:n},d=qn(u,null),g=Wn(u),y;try{y=await Yt(u,m,n)}finally{g(),d()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Re(u,y,m,n),m.__pseudoCSS))return null;await Cn(y,m),Dn(y);try{await Rn(y,u,h)}catch{}if(await Promise.all([Un(y,n),zn(u,y,r.styleCache,n,h)]),n.compress)try{await tr(y,n,h)}catch{}for(let[b,S]of h.entries())ho(b,S);p.replaceWith(y),Eu(p,r);for(let[b,S]of h.entries())r.nodeMap.set(b,S),r.srcToClone.set(S,b)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[u,p]of r.nodeMap.entries()){if(!p||p.nodeType!==1||!p.isConnected)continue;let h=r.styleMap.get(u);if(!h)continue;let m=Mu(h);if(!m)continue;let d=null,g=!1;for(let y in m)if(d||(d=getComputedStyle(p)),!Cu(d.getPropertyValue(y),m[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(u))return null;wo.reconciled++,await lt(p,u,a,n)}}let c=Ve(r.styleMap);for(let[u,p]of r.styleMap.entries())_u(u),po(u,p,c);let f=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([u,p])=>`.${p}{${u}}`).join("");Zn(r.clone,n.__compressedAssets);let l=await er({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:f,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=Jn(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}yt();var xo=new WeakMap,or=new WeakMap,wa=new WeakSet,So=new WeakMap,Fu=64,an=new Map,Sa=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],Tu=["(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 $u(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":Tu.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function la(t){let e=[];for(let n=t;n;){try{let r=n.getBoundingClientRect();e.push(r.x,r.y,r.width,r.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=n.getRootNode?.()?.host||null}return e.join("|")}function fa(t,e){if(e.disposed||(an.delete(t),an.set(t,e),an.size<=Fu))return;let[n,r]=an.entries().next().value;xa(n,r)}function xa(t,e){e.disposed=!0,an.delete(t),xo.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of Sa)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of ko)n.removeEventListener(r,e.onMediaDirty,!0);for(let[n,r]of e.trackedImages)n.removeEventListener("load",r),n.removeEventListener("error",r);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 va(t){if(wa.has(t))return!1;or.delete(t);let e=[t],n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i],s=[];o?.nodeType===1&&s.push(o);try{s.push(...o.querySelectorAll("*"))}catch{return!1}for(let a of s){a.shadowRoot&&e.push(a.shadowRoot);let c=String(a.localName||a.tagName||"").toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(c)||c==="progress"&&!a.hasAttribute("value")||/^(?:animate|animatetransform|animatemotion|set)$/.test(c))return!1;let f="";if(c==="img"){r.push(a);try{f=a.currentSrc||a.src||""}catch{}}/^(?:input|textarea|select|option)$/.test(c)&&n.push(a);let l=a.getAttribute?.("style")||"",u=So.get(a);if(f||l){if((!u||u.src!==f||u.style!==l)&&(u={src:f,style:l,animated:Le(f)||Le(l)},So.set(a,u)),u.animated)return!1}else u&&So.delete(a)}}return or.set(t,{roots:e.slice(1),controls:n,images:r}),!0}function vo(t,e){if(!t.querySelectorAll)return!1;let n=or.get(t);or.delete(t);let r=new Set(n?.roots||[]);if(n&&(e.controls=n.controls,e.scannedImages=n.images),!n){let i=[t];for(let o=0;o<i.length;o++){let s=i[o];s.shadowRoot&&!r.has(s.shadowRoot)&&(r.add(s.shadowRoot),i.push(s.shadowRoot));for(let a of s.querySelectorAll("*"))a.shadowRoot&&!r.has(a.shadowRoot)&&(r.add(a.shadowRoot),i.push(a.shadowRoot))}}for(let[i,o]of e.trackedShadowRoots)if(!r.has(i)){try{o.disconnect()}catch{}for(let a of ko)i.removeEventListener(a,e.onMediaDirty,!0);e.trackedShadowRoots.delete(i);let s=e.observers.indexOf(o);s>=0&&e.observers.splice(s,1)}for(let i of r)if(!e.trackedShadowRoots.has(i))try{let o=new MutationObserver(e.markDirty);o.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),o.__flush=e.markDirty,e.observers.push(o),e.trackedShadowRoots.set(i,o);for(let s of ko)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var ko=["scroll","change","beforetoggle","toggle"];function ir(t,e){return[t,...e.trackedShadowRoots.keys()]}function Co(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of ir(t,e))r.querySelectorAll&&n.push(...r.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let r=new Set(n);for(let[i,o]of e.trackedImages)r.has(i)||(i.removeEventListener("load",o),i.removeEventListener("error",o),e.trackedImages.delete(i))}for(let r of n){if(r.complete||e.trackedImages.has(r))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r)};e.trackedImages.set(r,i),r.addEventListener("load",i),r.addEventListener("error",i)}}function ua(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(oe(i))if(i.type==="attributes"){let o=e.get(i.target);o||e.set(i.target,o=new Map),o.has(i.attributeName)||o.set(i.attributeName,i.oldValue)}else if(i.type==="characterData")n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type==="childList"){let o=r.get(i.target);o||r.set(i.target,o=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)-1)}}else return!0;for(let[i,o]of e)for(let[s,a]of o)if(i.getAttribute(s)!==a)return!0;for(let[i,o]of n)if(i.data!==o)return!0;for(let i of r.values())for(let o of i.values())if(o!==0)return!0;return!1}var Pu=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,Ne=t=>t&&(typeof t=="object"||typeof t=="function")?rr(t):"-";function Nu(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let r=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(r)){let o=Math.ceil(e/3)*4;return atob(i.slice(0,o-o%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(o,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function Lu(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=Nu(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 da(t){let e=String(t||"").trim();return e?Pu.test(e)?!0:/^data:/i.test(e)?Lu(e):!1:!1}function Le(t){let e=String(t||"");if(da(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(da(n[1]??n[2]??n[3]))return!0;return!1}function pa(t,e=null){let n=t&&t.clone;if(!n)return!1;let r=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of r)for(let o of ka(i))if(Le(o.getAttribute?.("src"))||Le(o.getAttribute?.("href"))||Le(o.getAttribute?.("style"))||Le(t.styleMap?.get(o)))return!0;return!1}function ka(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function Ao(t,e){let n=[],r=new Set,i=o=>{o&&!r.has(o)&&(r.add(o),n.push(o))};t.matches?.("input,textarea,select,option")&&i(t);for(let o of ir(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function Mo(t,e){let n=[],r=new Set,i=(o,s=!1)=>{if(!(!o||r.has(o))){r.add(o);try{(s||o.scrollLeft||o.scrollTop||o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)&&n.push(o)}catch{}}};for(let o=t;o;o=o.parentElement)i(o,!0);for(let o of ir(t,e))for(let s of ka(o))i(s);e.scrollNodes=n}function ha(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",$u(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(Ne))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(Ne))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(Ne(o)),(s?.contains(t)||t.contains(s))&&i.push(Ne(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let l of e.scrollNodes)a.push(l.scrollLeft||0,l.scrollTop||0);let c=[];for(let l of e.controls){let u=String(l.localName||"").toLowerCase();u==="input"?c.push(l.type,ze(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):u==="textarea"?c.push(l.value):u==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let f=[];for(let l of e.images){let u="";try{u=l.currentSrc||l.src||""}catch{}f.push(u,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:f,frameDriven:e.retainedFrameDriven}}function Pe(t,e,n){if(!t)return!1;let r=t[n],i=e[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function ma(t,e){let n=new Set;for(let r of ir(t,e))try{let i=r.getAnimations?.(r.nodeType===1?{subtree:!0}:void 0)||[];for(let o of i)n.add(o)}catch{}return[...n]}function ga(t){return t.map(e=>[Ne(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Iu(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let r of e.trackedShadowRoots.keys())if(r.contains(n))return r;return null}function Wu(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:Se(),styleEpoch:Wt(),styleStamp:Qe(t),outsideMutations:Ke(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let c=a&&(a.nodeType===1?a:a.parentElement);if(!c||c===t||!t.contains(c)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(c)},i=a=>{if(e.capturing){for(let c of a)e.pending.push(c);return}for(let c of a)oe(c)&&(e.dirty=!0,r(c.target))},o=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(i);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=i,e.observers.push(a)}catch{}e.markDirty=i,e.onMediaDirty=o;try{for(let a of Sa)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return vo(t,e)||Ao(t,e),Mo(t,e),Co(t,e),e}var Ou=0,ya=new WeakMap;function rr(t){let e=ya.get(t);return e||(e="@"+ ++Ou,ya.set(t,e)),e}function _o(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(rr(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(rr(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=_o(s,e);if(a===null)return null;o.push(a)}return"["+o.join(",")+"]"}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return JSON.stringify(rr(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=_o(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function ba(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=_o(i,new Set);return o===null?null:`${(e||[]).map(Ne).join(",")}:${o}`}catch{return null}}function Ca(t,e,n,r,i=null){let o=xo.get(t);o||(o=Wu(t),o.baselineSignature=ba(e,n.plugins),xo.set(t,o));let s=ba(e,n.plugins),a=async()=>{if(o.disposed)return r();let f=s===null||s!==o.baselineSignature;f&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,f=!1):o.pendingSig=s:o.pendingSig=null,vo(t,o),Co(t,o);for(let C of o.observers)C.__flush(C.takeRecords());At();let l=Ke(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let u=t.getRootNode?.(),p=[...o.trackedShadowRoots.keys()];u?.nodeType===11&&!p.includes(u)&&p.push(u),xn(t.ownerDocument||document,p);let h=Qe(t);o.styleStamp!==h&&(o.styleStamp=h,o.dirty||o.dirtyAll());let m=ha(t,o),d=ma(t,o);m.animation=ga(d),o.renderState&&(!Pe(o.renderState,m,"style")&&(xe(),o.dirtyAll()),Pe(o.renderState,m,"scroll")||o.dirtyAll(),Pe(o.renderState,m,"controls")||(ie(t),o.dirtyAll()),!Pe(o.renderState,m,"images")&&!o.dirty&&o.dirtyAll());let g=Se();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Wt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let C=la(t);o.geometry!==null&&C!==o.geometry&&(ie(t),o.dirtyAll()),o.geometry=C}n.invalidate&&o.dirtyAll();let b=!1,S=!!o.renderState&&!Pe(o.renderState,m,"animation");try{let C=new Set;S&&d.length===0&&(C=null);for(let A of d){let M=A.playState==="running";if(!M&&!S)continue;M&&(b=!0),S=!0;let x=A.effect?.target;if(Iu(t,o,x)===t)C.add(x);else{C=null;break}}if(S&&C&&C.size&&o.retained){o.dirty=!0;for(let A of C)o.dirtyRoots&&o.dirtyRoots.add(A),ie(A)}else S&&!C&&o.dirtyAll()}catch{}let k=m.frameDriven,v=b||k;if(v&&(o.last=null),k&&o.dirtyAll(),!f&&!v&&!o.dirty&&o.last)return fa(t,o),o.last;o.capturing=!0;let w=null;try{let C=null,A=!1,M=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){M=[...o.dirtyRoots];let x=await ca(t,o,n);x&&(C=await i(x),A=!0)}if(C||(f||(n.__retain=x=>{let _=new Map;for(let[R,T]of x.nodeMap.entries())_.set(T,R);w={...x,srcToClone:_}}),n.__tornSinceStart=()=>{for(let x of o.observers)for(let _ of x.takeRecords())o.pending.push(_);return At(),o.torn||ua(o.pending)||Ke(t)!==l},C=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,w?(o.retained=w,o.retainedFrameDriven=pa(w),Ao(t,o),Mo(t,o)):A&&(o.retainedFrameDriven||(o.retainedFrameDriven=pa(o.retained,M)),Ao(t,o),Mo(t,o));let x=ha(t,o);x.animation=ga(ma(t,o));let _=["style","scroll","controls","images"];b||_.push("animation");let R=_.every(T=>Pe(m,x,T));o.renderState=x,o.styleEpoch=Wt(),o.styleStamp=Qe(t),o.geometry=la(t),o.renderState.frameDriven?(wa.add(t),xa(t,o)):R?!v&&!o.renderState.frameDriven&&(o.last=C,fa(t,o)):(o.dirtyAll(),o.last=null)}return C}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let A of o.observers)for(let M of A.takeRecords())o.pending.push(M);At();let C=Ke(t);(o.torn||ua(o.pending)||C!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=C,o.styleEpoch=Wt(),o.styleStamp=Qe(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||(vo(t,o),Co(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var sr=null;function _a(t){sr=t}var Du='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Eo=!1,cn=null,Ro=new WeakMap,Aa=!1;function Ea(t,e){!Eo||!cn||e&&e.burst===!1||Ro.set(cn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Ra(t){let e={control:t};cn=e,setTimeout(()=>{cn===e&&(cn=null)},0)}function To(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Du):null}function Ma(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=To(t);e&&(Ra(e),Fo(t,!1))}function Bu(t){let e=To(t);e&&Ra(e)}function Fo(t,e=!0){if(!sr||document.visibilityState==="hidden")return;let n=To(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=Ro.get(n);if(r){if(!r.element.isConnected){Ro.delete(n);return}sr(r.element,r.options).catch(()=>{});return}e&&!Aa&&(Aa=!0,sr(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Fa(){if(Eo||typeof document>"u"||typeof document.addEventListener!="function")return;Eo=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Ma,t),document.addEventListener("keydown",Ma,t),document.addEventListener("click",Bu,t),document.addEventListener("pointerenter",Fo,t),document.addEventListener("focusin",Fo,t)}bt();function sd(...t){return Vs(...t),X}async function ad(t,e){if(typeof t!="string"||!t.trim())throw new Error("[snapdom.fromString] html string required");let n=document.createElement("div");J(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await dt();let r=Array.from(n.childNodes).some(o=>o.nodeType===3&&o.textContent.trim()),i=n.children.length===1&&!r?n.firstElementChild:n;return await Ho(i,{...e||{},burst:!1})}finally{n.remove()}}var cd="3.1.1",X=Object.assign(Ho,{plugins:sd,fromString:ad,version:cd,preCapture:Fa});_a(Ho);var Uo=Symbol("snapdom.internal"),ld=Symbol("snapdom.internal.silent"),Ua=new Set(["png","jpeg","jpg","webp","svg"]);async function Ho(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=ia(e);n.element=t,n.invalidate&&xe(),Gs(n,e&&e.plugins);let{stage:r,loweredBy:i}=zs(n);n.needs=r,n.__needsLoweredBy=i;let o=$e(r,"render"),s=n.burst===!0||!Yn(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",f=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&va(t);return f&&Ea(t,e),n.snap||(n.snap={toPng:(l,u)=>X.toPng(l,u),toSvg:(l,u)=>X.toSvg(l,u)}),f?Ca(t,e,n,()=>X.capture(t,n,Uo),l=>Ha(l,n)):X.capture(t,n,Uo)}X.capture=async(t,e,n)=>{if(n!==Uo)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");if($e(e.needs||vt,"render")&&Y()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=Pn(t);e.clip||(e.__fontUsage=a);let c=a.required,f=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(f=new Set([...f].filter(l=>s.has(l.toLowerCase()))),f.size===0))throw null;await Nn(f,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(en(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){D(e,"safari canvas poke failed",s)}}let r=await oa(t,e);return Ha(r,e)};async function Ha(t,e){let n=e.needs||vt,r=$e(n,"render"),i=E=>js(n,e.__needsLoweredBy||[],E),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??(s=o.toDataURL()),c=o||t;o&&(t="");let f=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let u,p=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),d=m?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=m?Number.isFinite(e.height)?p.targetH/p.vbH:p.targetW/p.vbW:1,y=E=>{if(o||!f?.size)return c;let L=p.vbW,P=p.vbH,F=E.crop;F&&(L=Math.max(1,Math.min(L,F.x+F.width)-Math.max(0,F.x)),P=Math.max(1,Math.min(P,F.y+F.height)-Math.max(0,F.y)));let V=Number.isFinite(E.width),z=Number.isFinite(E.height);return(V&&z?Math.max(E.width/L,E.height/P):V?E.width/L*(F?Math.max(1,g/d):1):z?E.height/P*(F?Math.max(1,d/g):1):(E.scale||1)*Math.max(d,g))*(E.dpr||1)<=l?c:u??(u=ta(a(),f))},b=async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(We(),un));return P(c,{...E,...L||{},format:"png"})},S=()=>{if(!r)throw i("svgString");if(o)throw new Error("[snapdom] svgString: engine:'html-in-canvas' produces a raster capture; there is no serialized SVG");let E=t.indexOf(",");return E>=0?decodeURIComponent(t.slice(E+1)):""},k=E=>Object.defineProperty({...E||{},svgString:S},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),v={img:async(E,L)=>{if(o)return b(E,L);let{toImg:P}=await Promise.resolve().then(()=>(Oo(),Wo)),F={...E,...L||{}};return P(y(F),F)},svg:async(E,L)=>{if(o)return b(E,L);let{toSvg:P}=await Promise.resolve().then(()=>(Oo(),Wo)),F={...E,...L||{}};return P(y(F),F)},canvas:async(E,L)=>{let{toCanvas:P}=await Promise.resolve().then(()=>(Ie(),Ia)),F={...E,...L||{}};return P(y(F),F)},blob:async(E,L)=>{let{toBlob:P}=await Promise.resolve().then(()=>(Bo(),Wa)),F={...E,...L||{}};return P(y(F),F)},png:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"png"};return P(y(F),F)},jpeg:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"jpeg"};return P(y(F),F)},webp:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"webp"};return P(y(F),F)},download:async(E,L)=>{let{download:P}=await Promise.resolve().then(()=>(Ba(),Da)),F={...E,...L||{}};return P(y(F),F)}};if(!r)for(let E of Object.keys(v)){let L=E==="download"?"download()":`to${E.charAt(0).toUpperCase()}${E.slice(1)}()`;v[E]=async()=>{throw i(L)}}let w={};for(let E of["img","svg","canvas","blob","png","jpeg","webp"])w[E]=async L=>v[E](e,{...R(E,L||{}),[ld]:!0});w.jpg=w.jpeg;let C=E=>Object.defineProperty({...e,...E},"options",{value:e,configurable:!0}),A=C({artifacts:e.__artifacts||null,export:k(),exports:w}),M=await Xn("defineExports",A),x=Object.assign({},...M.filter(E=>E&&typeof E=="object").reverse()),_={...v,...x};_.jpeg&&!_.jpg&&(_.jpg=(E,L)=>_.jpeg(E,L));function R(E,L){let P=L||{},F={...e,...P},V=typeof P.type=="string"?P.type.toLowerCase():"",z=typeof P.format=="string"?P.format.toLowerCase():Ua.has(V)?V:"";z&&(F.format=z==="jpg"?"jpeg":z),F.__explicitFormat=z?F.format:e.__explicitFormat??null,E==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let q=Z=>Z==="jpeg"||Z==="jpg"||Z==="webp";return[E,F.format,V].map(Z=>typeof Z=="string"?Z.toLowerCase():"").find(q)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&D(F,"width/height define the output size \u2014 scale is ignored when either is set"),F}let T=!1,$=Promise.resolve();async function O(E,L){let P=Object.freeze(L&&typeof L=="object"?{...L}:{}),F=async()=>{let z=_[E];if(!z)throw new Error(`[snapdom] Unknown export type: ${E}`);let q=R(E,P),B=C({artifacts:e.__artifacts||null,export:k({type:E,options:q,requestedOptions:P})}),Z=q.format,_t=q.type;await Xn("beforeExport",B,{format:E,options:q});let Dt=q.format!==Z?q.format:q.type!==_t?q.type:"",mt=typeof Dt=="string"?Dt.toLowerCase():"";Ua.has(mt)&&(q.format=mt==="jpg"?"jpeg":mt,q.type=q.format,q.__explicitFormat=q.format,/^(?:jpeg|webp)$/.test(q.format)&&(q.backgroundColor==null||q.backgroundColor==="transparent")&&(q.backgroundColor="#ffffff"));let st=await z(B,q);return await Xn("afterExport",B,{format:E,options:q,result:st}),T||(T=!0,await Ot("afterSnap",e)),st},V=$.then(F);return $=V.catch(()=>{}),V}let H={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(E,L)=>O(E,L),toImg:E=>O("img",E),toSvg:E=>O("svg",E),toCanvas:E=>O("canvas",E),toBlob:E=>O("blob",E),toPng:E=>O("png",E),toJpg:E=>O("jpg",E),toWebp:E=>O("webp",E),download:E=>O("download",E)};r?o&&Object.defineProperty(H,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(H,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(H,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let E of Object.keys(_)){let L="to"+E.charAt(0).toUpperCase()+E.slice(1);H[L]||(H[L]=P=>O(E,P))}return H}X.toRaw=(t,e)=>X(t,e).then(n=>n.toRaw());X.toImg=(t,e)=>X(t,e).then(n=>n.toImg());X.toSvg=(t,e)=>X(t,e).then(n=>n.toSvg());X.toCanvas=(t,e)=>X(t,e).then(n=>n.toCanvas());X.toBlob=(t,e)=>X(t,e).then(n=>n.toBlob());X.toPng=(t,e)=>X(t,{...e,format:"png"}).then(n=>n.toPng());X.toJpg=(t,e)=>X(t,{...e,format:"jpeg"}).then(n=>n.toJpg());X.toWebp=(t,e)=>X(t,{...e,format:"webp"}).then(n=>n.toWebp());X.download=(t,e)=>X(t,e).then(n=>n.download());typeof window<"u"&&(window.snapdom=X);})();
package/dist/snapdom.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * SnapDOM
3
- * v3.1.1-dev.1
3
+ * v3.1.1
4
4
  * License: MIT
5
5
  */
6
6
  var ja=Object.defineProperty;var ct=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var je=(t,e)=>{for(var n in e)ja(t,n,{get:e[n],enumerable:!0})};function qo(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function Go(t="soft"){t==="disabled"&&(N.computedStyle=new WeakMap,N.measureHints=new WeakMap,N.baseStyle=new ot(50),N.defaultStyle=new ot(64),N.image=new ot(100),N.background=new ot(100),N.resource=new ot(150),N.compress=new ot(50))}var ot,N,dt=ct(()=>{"use strict";ot=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,n)}},N={image:new ot(100),background:new ot(100),resource:new ot(150),defaultStyle:new ot(64),baseStyle:new ot(50),compress:new ot(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function te(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function qa(t){let e=[],n=0,r=0,i="";for(let o=0;o<t.length;o++){let s=t[o];if(s==="\\"){o++;continue}i?s===i&&(i=""):s==='"'||s==="'"?i=s:s==="("?r++:s===")"?r--:s===","&&r===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e}function Ve(t,e=1){let n=t.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let o of qa(n[1])){let s=o.match(/url\((['"]?)(.*?)(\1)\)/);if(!s)continue;let a=o.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!Va.test(a[1].trim()))continue;let c=o.replace(/url\((['"]?)[\s\S]*?\1\)/," ").match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)\b/i),f=1;if(c){let l=parseFloat(c[1]);f=/dpi/i.test(c[2])?l/96:l}r.push({url:s[2].trim(),dppx:f})}return r.length?(r.sort((o,s)=>o.dppx-s.dppx),(r.find(o=>o.dppx>=e)||r[r.length-1]).url):null}function yr(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function zt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function br(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 qe(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function wr(t){return"\u2022".repeat(String(t??"").length)}function rt(t,e){return t?.nodeType===1&&t.localName===e}function kt(t){return t?.nodeType===1&&t.namespaceURI===Ga}function Nt(t){return t?.nodeType===1&&t.namespaceURI===Xa}function Lt(t){return t?.nodeType===11&&!!t.host}function Sr(t){return t?.nodeType===9}var gr,Va,Ga,Xa,bt=ct(()=>{"use strict";gr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,Va=gr;Ga="http://www.w3.org/1999/xhtml",Xa="http://www.w3.org/2000/svg"});function Ya(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(s,a,c){if(i>=n)return;let f=Date.now();(r.get(a)||0)>f||(r.set(a,f+e),i++,s==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(s,a){o("warn",s,a)},errorOnce(s,a){o("error",s,a)},reset(){r.clear(),i=0}}}function Ko(t,e,n){if(It.size>=Yo){let r=Date.now();for(let[i,o]of It)o.until<=r&&It.delete(i);for(;It.size>=Yo;)It.delete(It.keys().next().value)}It.set(t,{until:Date.now()+n,result:e})}function Ka(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Qa(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=e.split(/\{url(?:Raw)?\}/)[0],i=new URL(r||".",n);if(new URL(t,n).origin===i.origin)return!0}catch{}return!1}function Ja(t,e){if(!e||Ka(t)||Qa(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!e}}function Za(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>zt(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}${zt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Qo(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function tc(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 Jo(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function vr(t,e){try{t.onError?.(e)}catch{}}async function it(t,e={}){let n=e.as??"blob",r=e.timeout??3e3,i=e.useProxy||"",o=e.errorTTL??8e3,s=e.headers||{},a=!!e.silent;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,g="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],S=/;base64/i.test(g)?atob(y):decodeURIComponent(y),k=new Uint8Array([...S].map(w=>w.charCodeAt(0))),v=new Blob([k],{type:(g||"").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 g=await fetch(t);if(!g.ok)return{ok:!1,data:null,status:g.status,url:t,fromCache:!1,reason:"http_error"};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Qo(y),blob:y,status:g.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:g.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.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 c;try{c=tc(t,{as:n,timeout:r,useProxy:i,errorTTL:o,credentials:e.credentials,headers:s})}catch{let g={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return vr(e,g),g}let f=It.get(c);if(f&&f.until>Date.now())return{...f.result,fromCache:!0};f&&It.delete(c);let l=xr.get(c);if(l)return l;let u=Ja(t,i)?Za(t,i):t,p=e.credentials;if(!p)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,g);p=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{p="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),r),d=(async()=>{try{let g=await fetch(u,{signal:h.signal,credentials:p,headers:s});if(!g.ok){let S={ok:!1,data:null,status:g.status,url:u,fromCache:!1,reason:"http_error"};if(c!==null&&o>0&&Ko(c,S,o),!a){let k=`${g.status} ${g.statusText||""}`.trim();Xo.warnOnce(`http:${g.status}:${n}:${Jo(t)}`,`HTTP error ${k} while fetching ${n} ${t}`)}return vr(e,S),S}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:u,fromCache:!1};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Qo(y),blob:y,status:g.status,url:u,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:u,fromCache:!1,mime:b}}catch(g){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":g&&typeof g=="object"&&g.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:u,fromCache:!1,reason:y};if(c!==null&&!/^blob:/i.test(t)&&o>0&&Ko(c,b,o),!a){let S=`${y}:${n}:${Jo(t)}`,k=y==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${t}`:y==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;Xo.errorOnce(S,k)}return vr(e,b),b}finally{clearTimeout(m),xr.delete(c)}})();return c!==null&&xr.set(c,d),d}var Xo,xr,Yo,It,de=ct(()=>{"use strict";bt();Xo=Ya("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),xr=new Map,Yo=50,It=new Map});async function pe(t,e={}){if(/^\s*url\(\s*['"]?data:/i.test(t)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=Ve(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??te(t);if(!r)return t;let i=br(r),o=zt(i),s=(e.useProxy||"")+"|"+o;if(N.background.has(s)){let a=N.background.get(s);return a?`url("${a}")`:"none"}try{let a=await it(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(N.background.set(s,a.data),`url("${a.data}")`):(N.background.set(s,null),"none")}catch{return N.background.set(s,null),"none"}}var Zo=ct(()=>{"use strict";dt();bt();de()});function sc(t){let e=t.replace(ic,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function ni(t,e,n,r){for(let i=0;i<t.length;i++){if(--r.budget<0)return!1;let o=t[i],s=o.style;if(s){let c=!!o.selectorText&&rc.test(o.selectorText);for(let f=0;f<s.length;f++){let l=s[f];if(e.add(l),c&&r.pseudoProps.add(l),s.getPropertyPriority(l)&&r.importantProps.add(l),l.length>5&&(l[0]==="m"||l[0]==="p")){let u=l.startsWith("margin")?"marginUnstable":l.startsWith("padding")?"paddingUnstable":null;u&&!r[u]&&oc.test(s.getPropertyValue(l))&&(r[u]=!0)}}}let a=o.selectorText;if(a&&a.includes(":has(")&&(r.usesHas=!0),a&&a.includes("&"))for(let c=o.parentRule;c&&a.includes("&");c=c.parentRule)c.selectorText&&(a=a.replace(/&/g,`:is(${c.selectorText})`));if(a&&(r.inContainer||ei.test(a)||a.includes("+")||a.includes("~")))for(let c of Ar(a,",")){let f=c.trim();f&&(r.inContainer||ei.test(f)||f.includes("+")||f.includes("~"))&&r.shareUnsafeSels.add(f)}if(a&&a.includes(":"))for(let c in ti)ti[c].test(a)&&n[c].push(sc(a));if(o.styleSheet){if(!gn(o.styleSheet,e,n,r))return!1}else if(o.cssRules&&o.cssRules.length){let c=o.constructor?.name==="CSSContainerRule";c&&r.inContainer++;let f=ni(o.cssRules,e,n,r);if(c&&r.inContainer--,!f)return!1}}return!0}function gn(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?ni(i,e,n,r):!1}function Cr(t,e){for(let n of t){let r=n.effect?.getKeyframes?.()||[];for(let i of r)for(let o of Object.keys(i))o==="offset"||o==="easing"||o==="composite"||o==="computedOffset"||e.add(o.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()))}}function ri(t){let e=new Set;return gn(t,e,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?e:null}function Ar(t,e){if(!t.includes(e))return[t];let n=[],r=0,i=null,o=0;for(let s=0;s<t.length;s++){let a=t[s];if(a==="\\"){s++;continue}if(i){a===i&&(i=null);continue}a==='"'||a==="'"?i=a:a==="("||a==="["?r++:a===")"||a==="]"?r--:r===0&&a===e&&(n.push(t.slice(o,s)),o=s+1)}return n.push(t.slice(o)),n}function ac(t){let e=0,n=null,r=0;for(let l=0;l<t.length;l++){let u=t[l];if(n){u===n&&t[l-1]!=="\\"&&(n=null);continue}u==='"'||u==="'"?n=u:u==="("||u==="["?e++:u===")"||u==="]"?e--:e===0&&(u===" "||u===">"||u==="+"||u==="~")&&(r=l+1)}let i="",o=0;for(let l of t.slice(r))l==="("||l==="["?o++:l===")"||l==="]"?o--:o===0&&(i+=l);let s=l=>!l||/\\[0-9a-fA-F]/.test(l)?null:l.replace(/\\(.)/g,"$1"),a=s((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let c=s((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(c)return"i"+c;let f=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return f?"t"+f.toLowerCase():null}function oi(t,e){if(!e.length)return"";if(e.some(r=>r.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function cc(t,e){let n=t.createElement("div"),r={};for(let i in e){let o=e[i];(i==="before"||i==="after")&&o.push("q"),r[i]=oi(n,o)}return r}function ii(t){let e={universe:null,pseudoUniverse:null,usesHas:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let n=new Set(kr),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set};for(let f of t.styleSheets)if(!gn(f,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let f of o)if(!gn(f,n,r,i))return e}typeof t.getAnimations=="function"&&Cr(t.getAnimations(),n);let s=Array.from(i.shareUnsafeSels),a=oi(t.createElement("div"),s)===null?null:s.map(f=>({sel:f,key:ac(f)})),c=new Set(nc);for(let f of ec)n.has(f)&&c.add(f);for(let f of i.pseudoProps)c.add(f);return{universe:n,pseudoUniverse:c,pseudoGates:cc(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var kr,ec,nc,rc,oc,ti,ic,ei,yn=ct(()=>{"use strict";kr=["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"],ec=["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"],nc=["display","width","height","min-width","min-height"],rc=/::?(?:before|after|first-letter|first-line|marker)/,oc=/%|\bauto\b|calc\(|var\(/i,ti={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},ic=/::?(?:before|after|first-letter|first-line|marker)\b/g;ei=/:(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 J(t){return si.add(t),t.setAttribute("data-snapdom-internal",""),t}function jt(t){return si.has(t)}var si,wt=ct(()=>{"use strict";si=new WeakSet});function _r(t){if(t=String(t).toLowerCase(),Ge.has(t)){let o={};return N.defaultStyle.set(t,o),o}if(N.defaultStyle.has(t))return N.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(jt);e||(e=document.createElement("div"),J(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 r=getComputedStyle(n),i={};for(let o of r){if(he(o))continue;let s=r.getPropertyValue(o);i[o]=s}for(let o of kr)!(o in i)&&!he(o)&&(i[o]=r.getPropertyValue(o));return e.removeChild(n),N.defaultStyle.set(t,i),i}function he(t){let e=ai.get(t);if(e===void 0){let n=String(t).toLowerCase();e=uc.has(n)||fc.test(n)||lc.test(n),ai.set(t,e)}return e}function li(t,e){let n=gc.get(t);if(n===void 0||e[n]!==e[t])return!1;let r=e["writing-mode"];if(r&&r!=="horizontal-tb")return!1;let i=e.direction;return!(i&&i!=="ltr")}function bn(t,e){return!pc.has(t)&&(e==="inline"||dc.has(t)||ci.has(t))}function Er(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||ci.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let o=(e.position||"static").toLowerCase();return o==="absolute"||o==="fixed"?!1:!bc.has(r)}function me(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),Ge.has(e))return"";let i=[],o=_r(e),s=(t.display||"").toLowerCase(),a=s==="inline",c=bn(e,s),f=t["text-wrap-mode"]||t["white-space"]||"",l=f==="nowrap"||f==="pre",p=c&&n&&!(c&&n&&!a&&l),h=!1;for(let m in t){if(he(m)||li(m,t))continue;let d=t[m];if(p){if(hc.has(m))continue;if(mc.has(m)){d&&d!==o[m]&&(i.push(`${m}:${d}`),d!=="auto"&&(h=!0));continue}}if(d&&d!==o[m]){if(!l&&(m==="width"||m==="inline-size")&&d.endsWith("px")&&d.includes(".")){let g=parseFloat(d);if(Number.isFinite(g)){i.push(`${m}:${(g+yc).toFixed(3)}px`);continue}}i.push(`${m}:${d}`)}}if(p&&!a&&!r&&!h){let m=t.width;m&&m!=="auto"&&m!==o.width&&i.push(`min-width:${m}`)}return i.sort(),i.join(";")}function Rr(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 Fr(t,e=null){let n=new Map;for(let s of t){let a=_r(s);if(!a)continue;let l=(e?Object.entries(a).filter(([p])=>e.has(p)):Object.entries(a)).filter(([p])=>!li(p,a)).map(([p,h])=>`${p}:${h};`).sort(),u=l.join("");u&&(n.has(u)||n.set(u,{tagList:[],declarations:l}),n.get(u).tagList.push(s))}let r=[...n.values()],i=null;for(let{declarations:s}of r){let a=new Set(s);if(!i){i=a;continue}for(let c of i)a.has(c)||i.delete(c)}i??=new Set;let o="";if(i.size&&r.length>1){let s=r.flatMap(a=>a.tagList);o+=`${s.join(",")} { ${[...i].join("")} }
@@ -36,4 +36,4 @@ ${g}
36
36
  } catch (err) {
37
37
  self.postMessage({ id, error: String(err) })
38
38
  }
39
- }`,ou=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Tt=null,iu=0,su=0,ce=new Map;function oa(){for(let t of ce.values())t(void 0);if(ce.clear(),Array.isArray(Tt))for(let t of Tt)try{t?.terminate()}catch{}Tt=!1}function au(){let t,e=null;try{t=URL.createObjectURL(new Blob([ru],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=ce.get(n.data.id);r&&(ce.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=oa}catch{e=null}return t&&URL.revokeObjectURL(t),e}function cu(){if(Tt===!1)return!1;if(Tt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Tt=!1;Tt=[]}let t=iu++%ou;if(!Tt[t]){let e=au();if(!e)return oa(),!1;Tt[t]=e}return Tt[t]}var lu=5e3;function fu(t,e,n,r,i){let o=cu();return o?new Promise(s=>{let a=++su,c=setTimeout(()=>{ce.delete(a),s(void 0)},lu);ce.set(a,f=>{clearTimeout(c),s(f)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:ra,quality:na,mime:r})}catch{clearTimeout(c),ce.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function So(t,e,n,r){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let i=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,o=N.compress,s=o.get(i);if(s?.source===t)return s.result;let a=Qn.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Jf(t),u=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=nu(t);if(p&&p.w>0&&p.h>0&&!Js(p.w,p.h,e,n))return null;if(t.length>=Zf){let w=await fu(t,e,n,u,r);if(w!==void 0)return w}let h;try{h=await Qf(t)}catch{return null}let m=h.naturalWidth||h.width,d=h.naturalHeight||h.height;if(!m||!d)return null;let g=Js(m,d,e,n);if(!g)return null;let y=g*ra,b=Math.max(1,Math.round(m*y)),S=Math.max(1,Math.round(d*y)),k=document.createElement("canvas");k.width=b,k.height=S;let v=k.getContext("2d");if(!v)return null;v.imageSmoothingEnabled=!0,v.imageSmoothingQuality="high",v.drawImage(h,0,0,b,S);try{let w=k.toDataURL(u,na);if(typeof w=="string"&&w.startsWith("data:image")&&w.length<t.length)return w}catch{}return null})(),f={source:t,promise:c,cache:o};Qn.set(i,f);try{let l=await c;return tu(o,i,t,l),l}finally{Qn.get(i)===f&&Qn.delete(i)}}async function uu(t,e,n=new Map,r={}){if(!e.compress)return{count:0,before:0,after:0};let i=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&i.unshift(t);let o=0,s=0,a=0,c=async l=>{let u=l.getAttribute("src")||"";if(!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let p=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,h=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!h)return;let m=r.value||=wo(t,e),d=m.density*m.stretch(n.get(l)||l),g=await So(u,p*d,h*d,l.__snapdomBlob);g&&(o++,s+=u.length,a+=g.length,l.setAttribute("src",g),Jn(l,"attribute","src",u,g,e))},f=6;for(let l=0;l<i.length;l+=f)await Promise.allSettled(i.slice(l,l+f).map(c));return{count:o,before:s,after:a}}var du=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function pu(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function hu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=[],o=[t,...t.querySelectorAll("*")];for(let f of o){let l=f.style&&f.style.backgroundImage;l&&l.includes("data:image")&&i.push(f)}let s=0,a=async f=>{let l=n.get(f);if(!l||!l.isConnected)return;let u;try{u=getComputedStyle(l)}catch{return}if((u.backgroundRepeat||"repeat").toLowerCase().split(",").some(A=>A.trim()!=="no-repeat"))return;let h=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(h.split(",").some(A=>!du.test(A.trim())))return;let{w:m,h:d}=pu(l);if(!m||!d)return;let g=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(A=>parseFloat(A)/100)),y=r.value||=wo(t,e),b=y.density*y.stretch(l)*g,S=m*b,k=d*b,v=f.style.backgroundImage,w=[...v.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],C=v;for(let A of w){let M=A[2];if(M.startsWith("data:image/svg"))continue;let x=await So(M,S,k);x&&(C=C.split(M).join(x),s++)}C!==v&&(f.style.setProperty("background-image",C,f.style.getPropertyPriority("background-image")),Jn(f,"style","background-image",v,f.style.backgroundImage,e))},c=6;for(let f=0;f<i.length;f+=c)await Promise.allSettled(i.slice(f,f+c).map(a));return{count:s}}async function mu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=Array.from(t.querySelectorAll("image"));t.localName==="image"&&i.unshift(t);let o=0,s=async c=>{let f=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!f||!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",u=c.getAttribute("height")||"";if(l.includes("%")||u.includes("%"))return;let p=n.get(c),h=p?W(p):c.style,m=(k,v)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[k]||""))return parseFloat(h[k]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(v.trim()))return parseFloat(v);try{return p?.[k]?.baseVal?.value||0}catch{return 0}},d=m("width",l),g=m("height",u);if(!d||!g)return;let y=r.value||=wo(t,e),b=y.density*y.stretch(p||c),S=await So(f,d*b,g*b);S&&(c.setAttribute("href",S),Jn(c,"attribute","href",f,S,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(Zs,"xlink:href",S),Jn(c,"attribute","xlink:href",f,S,e)),o++)},a=6;for(let c=0;c<i.length;c+=a)await Promise.allSettled(i.slice(c,c+a).map(s));return{count:o}}async function er(t,e,n){if(!e.compress)return;let r={};await uu(t,e,n,r),await hu(t,e,n,r),await mu(t,e,n,r)}ht();dt();wt();function gu(t,e){if(X())return t;let n=t.indexOf("</style>");if(n===-1)return t;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,f;for(let y of i)if(y.intern)for(c.lastIndex=0;f=c.exec(y.text);)a.set(f[1],(a.get(f[1])||0)+1);let l=0;for(let[y,b]of a)b>1&&(l+=(b-1)*y.length);if(l<2048||t.includes(" data-sdi="))return t;let u=yu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let p=new Map,h=0,m=[],d=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let S=p.get(b);return S===void 0&&(S="i"+(h++).toString(36),p.set(b,S),m.push(`[data-sdi="${S}"]{${b}}`)),` data-sdi="${S}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,d):y.text;return t.slice(0,n)+m.join("")+g}function yu(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let f=c.getAttribute("style");f&&r.add(f)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=f=>{for(let l of f){if(l.type===CSSRule.IMPORT_RULE||l.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(l.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(l.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(l.selectorText).forEach(i)}l.cssRules&&c(l.cssRules)}};for(let f of[...t.querySelectorAll("style")].slice(1)){let l=f.textContent||"";if(/@import\b/i.test(l))return null;let u=new CSSStyleSheet;u.replaceSync(l),c(u.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let c of r){s.setAttribute("style",c);let f=a.serializeToString(s).match(/ style="([^"]*)"/);f&&o.add(f[1])}return o}async function nr(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:K,...tt}=t;t=Object.assign(a,tt),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,f;Ws(t,s),await Ot("beforeRender",t);let l=W(t.element),u=t.element.getBoundingClientRect(),p=Math.max(1,I(t.element.offsetWidth||parseFloat(l.width)||u.width||1)),h=Math.max(1,I(t.element.offsetHeight||parseFloat(l.height)||u.height||1)),m=t.element.ownerDocument||document;if(!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned){let K=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);K>0&&(h=Math.max(h,I(K))),tt>0&&(p=Math.max(p,I(tt)));try{let Q=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,et=N.measureHints.get(t.element);if(et&&et.cssLen===Q&&et.w0===p&&et.docH===K&&et.docW===tt)et.csh>0&&(h=Math.max(h,I(et.csh))),et.csw>0&&(p=Math.max(p,I(et.csw)));else{let nt=m.createElement("div");J(nt),nt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+p+"px!important;overflow:visible!important;visibility:hidden!important;";let Jt=nt.attachShadow({mode:"open"}),Zt=m.createElement("style");Zt.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,Jt.appendChild(Zt),Jt.appendChild(t.clone.cloneNode(!0)),m.body.appendChild(nt);let ze=nt.scrollHeight,Ht=nt.scrollWidth;m.body.removeChild(nt),N.measureHints.set(t.element,{cssLen:Q,w0:p,docH:K,docW:tt,csh:ze,csw:Ht}),ze>0&&(h=Math.max(h,I(ze))),Ht>0&&(p=Math.max(p,I(Ht)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let K=po(t.element,t.options),tt=1,Q=po(t.element,{}),et=Math.max(2,h*.15);Number.isFinite(Q)&&Q>=h-et&&Number.isFinite(K)&&K>0&&(h=Math.max(1,Math.min(h,I(K+tt))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Is(t.element,t.clone,K,t.nodeMap,p,h)}catch(K){console.warn("[snapdom] reconcile pass failed:",K)}let g=(K,tt=NaN)=>{let Q=typeof K=="string"?parseFloat(K):K;return Number.isFinite(Q)?Q:tt},y=g(t.options.width),b=g(t.options.height),S=n?I(n.width):p,k=n?I(n.height):h,v=S,w=k,C=Number.isFinite(y),A=Number.isFinite(b),M=k>0?S/k:1;C&&A?(v=Math.max(1,I(y)),w=Math.max(1,I(b))):C?(v=Math.max(1,I(y)),w=Math.max(1,I(v/(M||1)))):A&&(w=Math.max(1,I(b)),v=Math.max(1,I(w*(M||1))));let x=0,_=0,R=p,T=h;if(n){let K=0,tt=0;if(xo(t.element)){let Q=null;if(!r&&o&&Number.isFinite(o.a))Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let et=ae(t.element),nt=uo(l.transform&&l.transform!=="none"?l.transform:"",et);nt&&nt.is2D&&(Q={a:nt.a,b:nt.b,c:nt.c,d:nt.d,e:0,f:0})}if(Q&&!(Q.a===1&&Q.b===0&&Q.c===0&&Q.d===1)){let{ox:et,oy:nt}=an(l,p,h),Jt=Fe(p,h,Q,et,nt);K=Jt.minX,tt=Jt.minY}}x=I(n.x+K),_=I(n.y+tt),R=I(x+n.width),T=I(_+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let K={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},tt=Fe(p,h,K,0,0);x=I(tt.minX),_=I(tt.minY),R=I(tt.maxX),T=I(tt.maxY)}else if(r&&xo(t.element)){let tt=l.transform&&l.transform!=="none"?l.transform:"",Q=ae(t.element),et=Kt({baseTransform:tt,rotate:Q.rotate||"0deg",scale:Q.scale,translate:Q.translate,width:p,height:h}),{ox:nt,oy:Jt}=an(l,p,h),Zt=et.is2D?et:new DOMMatrix(et.toString()),ze={a:Zt.a,b:Zt.b,c:Zt.c,d:Zt.d,e:0,f:0},Ht=Fe(p,h,ze,nt,Jt);x=I(Ht.minX),_=I(Ht.minY),R=I(Ht.maxX),T=I(Ht.maxY)}let $=oo(l),O=io(l),H=so(l),E=ao(l),L=co(l),P=u.width>0?(R-x)/u.width:1,F=u.height>0?(T-_)/u.height:1,V=i==="subtree"&&!n?Cs(t.element,t.nodeMap,t.styleCache,P,F):{top:0,right:0,bottom:0,left:0},z=n?{top:0,right:0,bottom:0,left:0}:i?{top:I(Math.max($.top,O.top,V.top)+H.top+E.top+L.bleed.top),right:I(Math.max($.right,O.right,V.right)+H.right+E.right+L.bleed.right),bottom:I(Math.max($.bottom,O.bottom,V.bottom)+H.bottom+E.bottom+L.bleed.bottom),left:I(Math.max($.left,O.left,V.left)+H.left+E.left+L.bleed.left)}:{top:H.top,right:H.right,bottom:H.bottom,left:H.left};x=I(x-z.left),_=I(_-z.top),R=I(R+z.right),T=I(T+z.bottom);let q=Math.max(1,I(R-x)),B=Math.max(1,I(T-_)),Z="http://www.w3.org/2000/svg",_t=xo(t.element)?2:0,gt=I(_t+(r?0:1)),st=Math.ceil(q+gt*2),at=Math.ceil(B+gt*2),Pt=I(-(I(x)-gt)),U=I(-(I(_)-gt)),G=Math.max(0,Pt),j=Math.max(0,U),ut=I(st-Math.min(0,Pt)),Et=I(at-Math.min(0,U)),yt=document.createElementNS(Z,"foreignObject");yt.setAttribute("x",String(Math.min(0,Pt))),yt.setAttribute("y",String(Math.min(0,U))),yt.setAttribute("width",String(ut)),yt.setAttribute("height",String(Et)),yt.style.overflow="visible";let ue=document.createElement("style"),hn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";ue.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+hn+t.classCSS,yt.appendChild(ue);let Ue=document.createElement("div");Ue.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ue.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${ut}px;height:${Et}px`+(G!==0||j!==0?`;padding:${j}px 0 0 ${G}px !important`:""),Ue.appendChild(t.clone),yt.appendChild(Ue);let dr=new XMLSerializer().serializeToString(yt),Bt=C||A,pr=Object.freeze({w0:S,h0:k,vbW:st,vbH:at,targetW:v,targetH:w,contentX:I(Pt+(n?x:0)),contentY:I(U+(n?_:0)),clip:n?Object.freeze({x:I(x),y:I(_),width:S,height:k}):null});Object.defineProperty(a,"meta",{value:pr,enumerable:!0,writable:!1,configurable:!0});let hr=!Bt||X()?st:C?v:I(st*(w/at)),mn=!Bt||X()?at:A?w:I(at*(v/st)),Ut=parseFloat(W(m.documentElement)?.fontSize)||16;f=`<svg xmlns="${Z}" width="${hr}" height="${mn}" viewBox="0 0 ${st} ${at}" font-size="${Ut}px">`+gu(dr,yt)+"</svg>",c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,t.svgString=f,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Ot("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let mr=[...document.querySelectorAll("#snapdom-sandbox")].find(jt);return mr&&mr.style.position==="absolute"&&mr.remove(),t.dataURL}function xo(t){return Ms(t)}function bu(t){let e=Array.isArray(t.plugins)?t.plugins:bo(),n=[];for(let r of e){let i=Le(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function ia(t,e){if(!t)throw new Error("Element cannot be null or undefined");e.__session=go(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=bu(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,f,l="",u=null,p=e.needs||ft,h=n.format,m=n.type;await Ot("beforeSnap",n);let d=n.format!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(d||g){let R=String(d?n.format:n.type).toLowerCase();n.format=R==="jpg"?"jpeg":R,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Ot("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,S=n.clip?Bn(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=vi(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let k=ui(e.fast);for(;;){e.__slicer=k;let R=Xn(n.element,S);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:f}=await Os(n.element,n.options)),c>0&&!e.reconcile&&(xt(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),N.warnedReconcile||(N.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time)."))),!y&&r&&(u=As(n.element,r)),!b&&r&&$s(n.element,r,n.options),r&&(Ns(n.element,r,a),Ps(n.element,r))}finally{R()}if(!k?.yielded||!e.__tornSinceStart?.())break;k=null,e.__session=go(e.cache)}if(e.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Ot("afterClone",n),!Pe(p,"render"))return null;if(k?.due()&&await k.pause(),Un(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{Ls(n.element,n.clone,n.styleCache,n.nodeMap)}catch(R){xt(e.__session,"shrink-failed","shrink pass failed",R),console.warn("[snapdom] shrink pass failed:",R)}try{await Tn(n.clone,n.element,n.nodeMap)}catch{}let v=R=>Promise.resolve().then(R),w=(async()=>{await Promise.all([v(()=>zn(n.clone,n.options)),v(()=>Vn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Us(n.element,n.clone,n.nodeMap)}catch(R){xt(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",R),console.warn("[snapdom] backdrop-filter emulation failed:",R)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await v(()=>er(n.clone,n.options,n.nodeMap))),e.captureSelection)try{Xi(n.nodeMap)}catch(R){xt(e.__session,"selection-compose-failed","field selection compose failed",R)}})(),C=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(C=v(async()=>{let R=n.element.ownerDocument||document,T=S?H=>{try{let E=H.getBoundingClientRect();return E.right>=S.left-200&&E.left<=S.right+200&&E.bottom>=S.top-200&&E.top<=S.bottom+200}catch{return!0}}:null,{required:$,usedCodepoints:O}=!S&&e.__fontUsage||Ln(n.element,T);if(e.embedFonts==="auto"){let H=new Set;try{for(let L of R.fonts)H.add(String(L.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(H.size>0&&Array.from($).some(L=>H.has(String(L).split("__")[0].toLowerCase()))))return}if(X()){let H=new Set(Array.from($).map(E=>String(E).split("__")[0]).filter(Boolean));await In(H,1,R)}l=await cs({required:$,usedCodepoints:O,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:R})})),await Promise.all([w,C]);let M=(n.options.plugins||[]).some(R=>R&&(typeof R.beforeRender=="function"||typeof R.afterRender=="function"));n.options.engine,k?.due()&&await k.pause();let x=n.clone;tr(x,e.__compressedAssets);let _=await nr(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:l});if(e.__compressedSnapshot=Zn(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return _}dt();bt();var wu=new Set(["png","jpeg","jpg","webp","svg"]);function sa(t={}){let e=typeof t.type=="string"&&wu.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let r=t.format!=null?n:e==="jpg"?"jpeg":e,i=qo(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let u of o)typeof u=="string"?s.push(u):typeof u=="function"?a.push(u):u!=null&&console.warn("[snapdom] Ignored invalid exclude entry (expected selector string or predicate):",u);let c=t.excludeMode??"hide",f=u=>{if(!u||u.nodeType!==1)return!1;if(u.getAttribute("data-capture")==="exclude")return!0;for(let p of Array.isArray(l.exclude)?l.exclude:[])try{if(u.matches(p))return!0}catch{}for(let p of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(p(u))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(u))return!0}catch{}return!1},l={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:c,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:f,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:rt(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:Ji(t.iconFonts),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:i,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:r,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,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return l}St();ee();ht();var aa="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function Su(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var xu=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function vu(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(xu.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function ku(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(o=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(o.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let r=[t];t.querySelectorAll&&r.push(...t.querySelectorAll("*"));for(let i of r){let o=getComputedStyle(i),s=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var ca=new WeakMap;function Cu(t){let e=Wt(),n=ca.get(t);if(n&&n.epoch===e)return n.leaky;let r=!1,i={budget:2e4},o=s=>{for(let a=0;a<s.length&&!r;a++){if(--i.budget<0){r=!0;return}let c=s[a],f=c.selectorText;if(f&&/[+~]|:has\(/.test(f)){r=!0;return}let l=c.style;if(l&&(l.counterReset||l.counterIncrement||l.counterSet||l.content&&l.content.includes("counter"))){r=!0;return}c.cssRules&&c.cssRules.length&&o(c.cssRules)}};try{for(let s of t.styleSheets){let a=null;try{a=s.cssRules}catch{r=!0}if(r)break;a&&o(a)}if(!r){let s=t.adoptedStyleSheets;if(Array.isArray(s))for(let a of s){if(r)break;try{o(a.cssRules)}catch{r=!0}}}}catch{r=!0}return ca.set(t,{epoch:e,leaky:r}),r}var Au=1/16;function Mu(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),r=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(r)&&Math.abs(n-r)<=Au}var rr=new Map,_u=["width","height","min-width","min-height"];function Eu(t){let e=rr.get(t);if(e===void 0){e=null;for(let n of _u){let r=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));r&&r[1].endsWith("px")&&((e||={})[n]=r[1])}rr.size>5e3&&rr.clear(),rr.set(t,e)}return e}function Ru(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function Fu(t,e){let n=[t];for(;n.length;){let r=n.pop();if(r.nodeType===1){let i=e.nodeMap.get(r);i!==void 0&&(e.nodeMap.delete(r),e.srcToClone.get(i)===r&&e.srcToClone.delete(i)),e.styleMap.delete(r)}for(let i=r.firstChild;i;i=i.nextSibling)n.push(i)}}var vo={attempts:0,served:0,reconciled:0};async function la(t,e,n){vo.attempts++;try{let r=await Tu(t,e,n);return r&&vo.served++,r}catch{return null}}async function Tu(t,e,n){let r=e.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||t.scrollTop||t.scrollLeft||Su(t)||vu(r)||r.fontsCSS||Kn(n))return null;for(let u of n.plugins||[])if(u&&(typeof u.beforeSnap=="function"||typeof u.beforeClone=="function"||typeof u.resolveNode=="function"||typeof u.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=en(t);if(!o||Cu(i))return null;let s=[];t:for(let u of e.dirtyRoots){if(!u.isConnected||u===t||!t.contains(u))return null;for(let p of e.dirtyRoots)if(p!==u&&p!==t&&p.contains(u))continue t;s.push(u)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let u of s){if(u.parentElement===t||u.matches?.(aa)||u.querySelector?.(aa)||ku(u,o))return null;let p=r.srcToClone.get(u);if(!p||!p.parentNode)return null;let h=new Map,m={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:h,options:n},d=Xn(u,null),g=Dn(u),y;try{y=await Yt(u,m,n)}finally{g(),d()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Re(u,y,m,n),m.__pseudoCSS))return null;await Mn(y,m),Un(y);try{await Tn(y,u,h)}catch{}if(await Promise.all([zn(y,n),Vn(u,y,r.styleCache,n,h)]),n.compress)try{await er(y,n,h)}catch{}for(let[b,S]of h.entries())mo(b,S);p.replaceWith(y),Fu(p,r);for(let[b,S]of h.entries())r.nodeMap.set(b,S),r.srcToClone.set(S,b)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[u,p]of r.nodeMap.entries()){if(!p||p.nodeType!==1||!p.isConnected)continue;let h=r.styleMap.get(u);if(!h)continue;let m=Eu(h);if(!m)continue;let d=null,g=!1;for(let y in m)if(d||=getComputedStyle(p),!Mu(d.getPropertyValue(y),m[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(u))return null;vo.reconciled++,await lt(p,u,a,n)}}let c=Xe(r.styleMap);for(let[u,p]of r.styleMap.entries())Ru(u),ho(u,p,c);let f=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([u,p])=>`.${p}{${u}}`).join("");tr(r.clone,n.__compressedAssets);let l=await nr({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:f,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=Zn(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}bt();var Co=new WeakMap,ir=new WeakMap,Sa=new WeakSet,ko=new WeakMap,$u=64,ln=new Map,xa=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],Pu=["(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 Nu(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":Pu.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function fa(t){let e=[];for(let n=t;n;){try{let r=n.getBoundingClientRect();e.push(r.x,r.y,r.width,r.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=n.getRootNode?.()?.host||null}return e.join("|")}function ua(t,e){if(e.disposed||(ln.delete(t),ln.set(t,e),ln.size<=$u))return;let[n,r]=ln.entries().next().value;va(n,r)}function va(t,e){e.disposed=!0,ln.delete(t),Co.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of xa)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of Mo)n.removeEventListener(r,e.onMediaDirty,!0);for(let[n,r]of e.trackedImages)n.removeEventListener("load",r),n.removeEventListener("error",r);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 ka(t){if(Sa.has(t))return!1;ir.delete(t);let e=[t],n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i],s=[];o?.nodeType===1&&s.push(o);try{s.push(...o.querySelectorAll("*"))}catch{return!1}for(let a of s){a.shadowRoot&&e.push(a.shadowRoot);let c=String(a.localName||a.tagName||"").toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(c)||c==="progress"&&!a.hasAttribute("value")||/^(?:animate|animatetransform|animatemotion|set)$/.test(c))return!1;let f="";if(c==="img"){r.push(a);try{f=a.currentSrc||a.src||""}catch{}}/^(?:input|textarea|select|option)$/.test(c)&&n.push(a);let l=a.getAttribute?.("style")||"",u=ko.get(a);if(f||l){if((!u||u.src!==f||u.style!==l)&&(u={src:f,style:l,animated:Oe(f)||Oe(l)},ko.set(a,u)),u.animated)return!1}else u&&ko.delete(a)}}return ir.set(t,{roots:e.slice(1),controls:n,images:r}),!0}function Ao(t,e){if(!t.querySelectorAll)return!1;let n=ir.get(t);ir.delete(t);let r=new Set(n?.roots||[]);if(n&&(e.controls=n.controls,e.scannedImages=n.images),!n){let i=[t];for(let o=0;o<i.length;o++){let s=i[o];s.shadowRoot&&!r.has(s.shadowRoot)&&(r.add(s.shadowRoot),i.push(s.shadowRoot));for(let a of s.querySelectorAll("*"))a.shadowRoot&&!r.has(a.shadowRoot)&&(r.add(a.shadowRoot),i.push(a.shadowRoot))}}for(let[i,o]of e.trackedShadowRoots)if(!r.has(i)){try{o.disconnect()}catch{}for(let a of Mo)i.removeEventListener(a,e.onMediaDirty,!0);e.trackedShadowRoots.delete(i);let s=e.observers.indexOf(o);s>=0&&e.observers.splice(s,1)}for(let i of r)if(!e.trackedShadowRoots.has(i))try{let o=new MutationObserver(e.markDirty);o.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),o.__flush=e.markDirty,e.observers.push(o),e.trackedShadowRoots.set(i,o);for(let s of Mo)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var Mo=["scroll","change","beforetoggle","toggle"];function sr(t,e){return[t,...e.trackedShadowRoots.keys()]}function _o(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of sr(t,e))r.querySelectorAll&&n.push(...r.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let r=new Set(n);for(let[i,o]of e.trackedImages)r.has(i)||(i.removeEventListener("load",o),i.removeEventListener("error",o),e.trackedImages.delete(i))}for(let r of n){if(r.complete||e.trackedImages.has(r))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r)};e.trackedImages.set(r,i),r.addEventListener("load",i),r.addEventListener("error",i)}}function da(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(oe(i))if(i.type==="attributes"){let o=e.get(i.target);o||e.set(i.target,o=new Map),o.has(i.attributeName)||o.set(i.attributeName,i.oldValue)}else if(i.type==="characterData")n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type==="childList"){let o=r.get(i.target);o||r.set(i.target,o=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)-1)}}else return!0;for(let[i,o]of e)for(let[s,a]of o)if(i.getAttribute(s)!==a)return!0;for(let[i,o]of n)if(i.data!==o)return!0;for(let i of r.values())for(let o of i.values())if(o!==0)return!0;return!1}var Lu=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,We=t=>t&&(typeof t=="object"||typeof t=="function")?or(t):"-";function Iu(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let r=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(r)){let o=Math.ceil(e/3)*4;return atob(i.slice(0,o-o%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(o,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function Wu(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=Iu(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 pa(t){let e=String(t||"").trim();return e?Lu.test(e)?!0:/^data:/i.test(e)?Wu(e):!1:!1}function Oe(t){let e=String(t||"");if(pa(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(pa(n[1]??n[2]??n[3]))return!0;return!1}function ha(t,e=null){let n=t&&t.clone;if(!n)return!1;let r=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of r)for(let o of Ca(i))if(Oe(o.getAttribute?.("src"))||Oe(o.getAttribute?.("href"))||Oe(o.getAttribute?.("style"))||Oe(t.styleMap?.get(o)))return!0;return!1}function Ca(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function Eo(t,e){let n=[],r=new Set,i=o=>{o&&!r.has(o)&&(r.add(o),n.push(o))};t.matches?.("input,textarea,select,option")&&i(t);for(let o of sr(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function Ro(t,e){let n=[],r=new Set,i=(o,s=!1)=>{if(!(!o||r.has(o))){r.add(o);try{(s||o.scrollLeft||o.scrollTop||o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)&&n.push(o)}catch{}}};for(let o=t;o;o=o.parentElement)i(o,!0);for(let o of sr(t,e))for(let s of Ca(o))i(s);e.scrollNodes=n}function ma(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",Nu(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(We))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(We))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(We(o)),(s?.contains(t)||t.contains(s))&&i.push(We(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let l of e.scrollNodes)a.push(l.scrollLeft||0,l.scrollTop||0);let c=[];for(let l of e.controls){let u=String(l.localName||"").toLowerCase();u==="input"?c.push(l.type,qe(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):u==="textarea"?c.push(l.value):u==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let f=[];for(let l of e.images){let u="";try{u=l.currentSrc||l.src||""}catch{}f.push(u,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:f,frameDriven:e.retainedFrameDriven}}function Ie(t,e,n){if(!t)return!1;let r=t[n],i=e[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function ga(t,e){let n=new Set;for(let r of sr(t,e))try{let i=r.getAnimations?.(r.nodeType===1?{subtree:!0}:void 0)||[];for(let o of i)n.add(o)}catch{}return[...n]}function ya(t){return t.map(e=>[We(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Ou(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let r of e.trackedShadowRoots.keys())if(r.contains(n))return r;return null}function Du(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:Se(),styleEpoch:Wt(),styleStamp:tn(t),outsideMutations:Ze(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let c=a&&(a.nodeType===1?a:a.parentElement);if(!c||c===t||!t.contains(c)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(c)},i=a=>{if(e.capturing){for(let c of a)e.pending.push(c);return}for(let c of a)oe(c)&&(e.dirty=!0,r(c.target))},o=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(i);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=i,e.observers.push(a)}catch{}e.markDirty=i,e.onMediaDirty=o;try{for(let a of xa)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return Ao(t,e)||Eo(t,e),Ro(t,e),_o(t,e),e}var Bu=0,ba=new WeakMap;function or(t){let e=ba.get(t);return e||(e="@"+ ++Bu,ba.set(t,e)),e}function Fo(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(or(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(or(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=Fo(s,e);if(a===null)return null;o.push(a)}return"["+o.join(",")+"]"}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return JSON.stringify(or(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=Fo(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function wa(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=Fo(i,new Set);return o===null?null:`${(e||[]).map(We).join(",")}:${o}`}catch{return null}}function Aa(t,e,n,r,i=null){let o=Co.get(t);o||(o=Du(t),o.baselineSignature=wa(e,n.plugins),Co.set(t,o));let s=wa(e,n.plugins),a=async()=>{if(o.disposed)return r();let f=s===null||s!==o.baselineSignature;f&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,f=!1):o.pendingSig=s:o.pendingSig=null,Ao(t,o),_o(t,o);for(let C of o.observers)C.__flush(C.takeRecords());At();let l=Ze(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let u=t.getRootNode?.(),p=[...o.trackedShadowRoots.keys()];u?.nodeType===11&&!p.includes(u)&&p.push(u),kn(t.ownerDocument||document,p);let h=tn(t);o.styleStamp!==h&&(o.styleStamp=h,o.dirty||o.dirtyAll());let m=ma(t,o),d=ga(t,o);m.animation=ya(d),o.renderState&&(!Ie(o.renderState,m,"style")&&(xe(),o.dirtyAll()),Ie(o.renderState,m,"scroll")||o.dirtyAll(),Ie(o.renderState,m,"controls")||(ie(t),o.dirtyAll()),!Ie(o.renderState,m,"images")&&!o.dirty&&o.dirtyAll());let g=Se();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Wt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let C=fa(t);o.geometry!==null&&C!==o.geometry&&(ie(t),o.dirtyAll()),o.geometry=C}n.invalidate&&o.dirtyAll();let b=!1,S=!!o.renderState&&!Ie(o.renderState,m,"animation");try{let C=new Set;S&&d.length===0&&(C=null);for(let A of d){let M=A.playState==="running";if(!M&&!S)continue;M&&(b=!0),S=!0;let x=A.effect?.target;if(Ou(t,o,x)===t)C.add(x);else{C=null;break}}if(S&&C&&C.size&&o.retained){o.dirty=!0;for(let A of C)o.dirtyRoots&&o.dirtyRoots.add(A),ie(A)}else S&&!C&&o.dirtyAll()}catch{}let k=m.frameDriven,v=b||k;if(v&&(o.last=null),k&&o.dirtyAll(),!f&&!v&&!o.dirty&&o.last)return ua(t,o),o.last;o.capturing=!0;let w=null;try{let C=null,A=!1,M=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){M=[...o.dirtyRoots];let x=await la(t,o,n);x&&(C=await i(x),A=!0)}if(C||(f||(n.__retain=x=>{let _=new Map;for(let[R,T]of x.nodeMap.entries())_.set(T,R);w={...x,srcToClone:_}}),n.__tornSinceStart=()=>{for(let x of o.observers)for(let _ of x.takeRecords())o.pending.push(_);return At(),o.torn||da(o.pending)||Ze(t)!==l},C=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,w?(o.retained=w,o.retainedFrameDriven=ha(w),Eo(t,o),Ro(t,o)):A&&(o.retainedFrameDriven||=ha(o.retained,M),Eo(t,o),Ro(t,o));let x=ma(t,o);x.animation=ya(ga(t,o));let _=["style","scroll","controls","images"];b||_.push("animation");let R=_.every(T=>Ie(m,x,T));o.renderState=x,o.styleEpoch=Wt(),o.styleStamp=tn(t),o.geometry=fa(t),o.renderState.frameDriven?(Sa.add(t),va(t,o)):R?!v&&!o.renderState.frameDriven&&(o.last=C,ua(t,o)):(o.dirtyAll(),o.last=null)}return C}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let A of o.observers)for(let M of A.takeRecords())o.pending.push(M);At();let C=Ze(t);(o.torn||da(o.pending)||C!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=C,o.styleEpoch=Wt(),o.styleStamp=tn(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||(Ao(t,o),_o(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var ar=null;function Ea(t){ar=t}var Uu='button, a[href], [role="button"], input, select, summary, label, [tabindex]',To=!1,fn=null,$o=new WeakMap,Ma=!1;function Ra(t,e){!To||!fn||e&&e.burst===!1||$o.set(fn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Fa(t){let e={control:t};fn=e,setTimeout(()=>{fn===e&&(fn=null)},0)}function No(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Uu):null}function _a(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=No(t);e&&(Fa(e),Po(t,!1))}function Hu(t){let e=No(t);e&&Fa(e)}function Po(t,e=!0){if(!ar||document.visibilityState==="hidden")return;let n=No(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=$o.get(n);if(r){if(!r.element.isConnected){$o.delete(n);return}ar(r.element,r.options).catch(()=>{});return}e&&!Ma&&(Ma=!0,ar(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Ta(){if(To||typeof document>"u"||typeof document.addEventListener!="function")return;To=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",_a,t),document.addEventListener("keydown",_a,t),document.addEventListener("click",Hu,t),document.addEventListener("pointerenter",Po,t),document.addEventListener("focusin",Po,t)}wt();function cd(...t){return yo(...t),Y}async function ld(t,e){if(typeof t!="string"||!t.trim())throw new Error("[snapdom.fromString] html string required");let n=document.createElement("div");J(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await pt();let r=Array.from(n.childNodes).some(o=>o.nodeType===3&&o.textContent.trim()),i=n.children.length===1&&!r?n.firstElementChild:n;return await Vo(i,{...e||{},burst:!1})}finally{n.remove()}}var fd="3.1.1-dev.1",Y=Object.assign(Vo,{plugins:cd,fromString:ld,version:fd,preCapture:Ta});Ea(Vo);var jo=Symbol("snapdom.internal"),ud=Symbol("snapdom.internal.silent"),Ha=new Set(["png","jpeg","jpg","webp","svg"]);async function Vo(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=sa(e);n.element=t,n.invalidate&&xe(),Ys(n,e&&e.plugins);let{stage:r,loweredBy:i}=Vs(n);n.needs=r,n.__needsLoweredBy=i;let o=Pe(r,"render"),s=n.burst===!0||!Kn(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",f=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&ka(t);return f&&Ra(t,e),n.snap||(n.snap={toPng:(l,u)=>Y.toPng(l,u),toSvg:(l,u)=>Y.toSvg(l,u)}),f?Aa(t,e,n,()=>Y.capture(t,n,jo),l=>za(l,n)):Y.capture(t,n,jo)}Y.capture=async(t,e,n)=>{if(n!==jo)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");if(Pe(e.needs||ft,"render")&&X()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=Ln(t);e.clip||(e.__fontUsage=a);let c=a.required,f=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(f=new Set([...f].filter(l=>s.has(l.toLowerCase()))),f.size===0))throw null;await In(f,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(on(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){D(e,"safari canvas poke failed",s)}}let r=await ia(t,e);return za(r,e)};async function za(t,e){let n=e.needs||ft,r=Pe(n,"render"),i=E=>Gs(n,e.__needsLoweredBy||[],E),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??=o.toDataURL(),c=o||t;o&&(t="");let f=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let u,p=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!X(),d=m?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=m?Number.isFinite(e.height)?p.targetH/p.vbH:p.targetW/p.vbW:1,y=E=>{if(o||!f?.size)return c;let L=p.vbW,P=p.vbH,F=E.crop;F&&(L=Math.max(1,Math.min(L,F.x+F.width)-Math.max(0,F.x)),P=Math.max(1,Math.min(P,F.y+F.height)-Math.max(0,F.y)));let V=Number.isFinite(E.width),z=Number.isFinite(E.height);return(V&&z?Math.max(E.width/L,E.height/P):V?E.width/L*(F?Math.max(1,g/d):1):z?E.height/P*(F?Math.max(1,d/g):1):(E.scale||1)*Math.max(d,g))*(E.dpr||1)<=l?c:u??=ea(a(),f)},b=async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(Be(),pn));return P(c,{...E,...L||{},format:"png"})},S=()=>{if(!r)throw i("svgString");if(o)throw new Error("[snapdom] svgString: engine:'html-in-canvas' produces a raster capture; there is no serialized SVG");let E=t.indexOf(",");return E>=0?decodeURIComponent(t.slice(E+1)):""},k=E=>Object.defineProperty({...E||{},svgString:S},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),v={img:async(E,L)=>{if(o)return b(E,L);let{toImg:P}=await Promise.resolve().then(()=>(Uo(),Bo)),F={...E,...L||{}};return P(y(F),F)},svg:async(E,L)=>{if(o)return b(E,L);let{toSvg:P}=await Promise.resolve().then(()=>(Uo(),Bo)),F={...E,...L||{}};return P(y(F),F)},canvas:async(E,L)=>{let{toCanvas:P}=await Promise.resolve().then(()=>(De(),Wa)),F={...E,...L||{}};return P(y(F),F)},blob:async(E,L)=>{let{toBlob:P}=await Promise.resolve().then(()=>(zo(),Oa)),F={...E,...L||{}};return P(y(F),F)},png:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"png"};return P(y(F),F)},jpeg:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"jpeg"};return P(y(F),F)},webp:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"webp"};return P(y(F),F)},download:async(E,L)=>{let{download:P}=await Promise.resolve().then(()=>(Ua(),Ba)),F={...E,...L||{}};return P(y(F),F)}};if(!r)for(let E of Object.keys(v)){let L=E==="download"?"download()":`to${E.charAt(0).toUpperCase()}${E.slice(1)}()`;v[E]=async()=>{throw i(L)}}let w={};for(let E of["img","svg","canvas","blob","png","jpeg","webp"])w[E]=async L=>v[E](e,{...R(E,L||{}),[ud]:!0});w.jpg=w.jpeg;let C=E=>Object.defineProperty({...e,...E},"options",{value:e,configurable:!0}),A=C({artifacts:e.__artifacts||null,export:k(),exports:w}),M=await Yn("defineExports",A),x=Object.assign({},...M.filter(E=>E&&typeof E=="object").reverse()),_={...v,...x};_.jpeg&&!_.jpg&&(_.jpg=(E,L)=>_.jpeg(E,L));function R(E,L){let P=L||{},F={...e,...P},V=typeof P.type=="string"?P.type.toLowerCase():"",z=typeof P.format=="string"?P.format.toLowerCase():Ha.has(V)?V:"";z&&(F.format=z==="jpg"?"jpeg":z),F.__explicitFormat=z?F.format:e.__explicitFormat??null,E==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let q=Z=>Z==="jpeg"||Z==="jpg"||Z==="webp";return[E,F.format,V].map(Z=>typeof Z=="string"?Z.toLowerCase():"").find(q)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&D(F,"width/height define the output size \u2014 scale is ignored when either is set"),F}let T=!1,$=Promise.resolve();async function O(E,L){let P=Object.freeze(L&&typeof L=="object"?{...L}:{}),F=async()=>{let z=_[E];if(!z)throw new Error(`[snapdom] Unknown export type: ${E}`);let q=R(E,P),B=C({artifacts:e.__artifacts||null,export:k({type:E,options:q,requestedOptions:P})}),Z=q.format,_t=q.type;await Yn("beforeExport",B,{format:E,options:q});let Dt=q.format!==Z?q.format:q.type!==_t?q.type:"",gt=typeof Dt=="string"?Dt.toLowerCase():"";Ha.has(gt)&&(q.format=gt==="jpg"?"jpeg":gt,q.type=q.format,q.__explicitFormat=q.format,/^(?:jpeg|webp)$/.test(q.format)&&(q.backgroundColor==null||q.backgroundColor==="transparent")&&(q.backgroundColor="#ffffff"));let st=await z(B,q);return await Yn("afterExport",B,{format:E,options:q,result:st}),T||(T=!0,await Ot("afterSnap",e)),st},V=$.then(F);return $=V.catch(()=>{}),V}let H={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(E,L)=>O(E,L),toImg:E=>O("img",E),toSvg:E=>O("svg",E),toCanvas:E=>O("canvas",E),toBlob:E=>O("blob",E),toPng:E=>O("png",E),toJpg:E=>O("jpg",E),toWebp:E=>O("webp",E),download:E=>O("download",E)};r?o&&Object.defineProperty(H,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(H,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(H,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let E of Object.keys(_)){let L="to"+E.charAt(0).toUpperCase()+E.slice(1);H[L]||(H[L]=P=>O(E,P))}return H}Y.toRaw=(t,e)=>Y(t,e).then(n=>n.toRaw());Y.toImg=(t,e)=>Y(t,e).then(n=>n.toImg());Y.toSvg=(t,e)=>Y(t,e).then(n=>n.toSvg());Y.toCanvas=(t,e)=>Y(t,e).then(n=>n.toCanvas());Y.toBlob=(t,e)=>Y(t,e).then(n=>n.toBlob());Y.toPng=(t,e)=>Y(t,{...e,format:"png"}).then(n=>n.toPng());Y.toJpg=(t,e)=>Y(t,{...e,format:"jpeg"}).then(n=>n.toJpg());Y.toWebp=(t,e)=>Y(t,{...e,format:"webp"}).then(n=>n.toWebp());Y.download=(t,e)=>Y(t,e).then(n=>n.download());export{ft as DEFAULT_STAGE,$e as STAGES,qs as assertNeeds,qf as clearPlugins,bo as getGlobalPlugins,Le as normalizePlugin,yo as registerPlugins,Y as snapdom};
39
+ }`,ou=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Tt=null,iu=0,su=0,ce=new Map;function oa(){for(let t of ce.values())t(void 0);if(ce.clear(),Array.isArray(Tt))for(let t of Tt)try{t?.terminate()}catch{}Tt=!1}function au(){let t,e=null;try{t=URL.createObjectURL(new Blob([ru],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=ce.get(n.data.id);r&&(ce.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=oa}catch{e=null}return t&&URL.revokeObjectURL(t),e}function cu(){if(Tt===!1)return!1;if(Tt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Tt=!1;Tt=[]}let t=iu++%ou;if(!Tt[t]){let e=au();if(!e)return oa(),!1;Tt[t]=e}return Tt[t]}var lu=5e3;function fu(t,e,n,r,i){let o=cu();return o?new Promise(s=>{let a=++su,c=setTimeout(()=>{ce.delete(a),s(void 0)},lu);ce.set(a,f=>{clearTimeout(c),s(f)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:ra,quality:na,mime:r})}catch{clearTimeout(c),ce.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function So(t,e,n,r){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let i=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,o=N.compress,s=o.get(i);if(s?.source===t)return s.result;let a=Qn.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Jf(t),u=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=nu(t);if(p&&p.w>0&&p.h>0&&!Js(p.w,p.h,e,n))return null;if(t.length>=Zf){let w=await fu(t,e,n,u,r);if(w!==void 0)return w}let h;try{h=await Qf(t)}catch{return null}let m=h.naturalWidth||h.width,d=h.naturalHeight||h.height;if(!m||!d)return null;let g=Js(m,d,e,n);if(!g)return null;let y=g*ra,b=Math.max(1,Math.round(m*y)),S=Math.max(1,Math.round(d*y)),k=document.createElement("canvas");k.width=b,k.height=S;let v=k.getContext("2d");if(!v)return null;v.imageSmoothingEnabled=!0,v.imageSmoothingQuality="high",v.drawImage(h,0,0,b,S);try{let w=k.toDataURL(u,na);if(typeof w=="string"&&w.startsWith("data:image")&&w.length<t.length)return w}catch{}return null})(),f={source:t,promise:c,cache:o};Qn.set(i,f);try{let l=await c;return tu(o,i,t,l),l}finally{Qn.get(i)===f&&Qn.delete(i)}}async function uu(t,e,n=new Map,r={}){if(!e.compress)return{count:0,before:0,after:0};let i=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&i.unshift(t);let o=0,s=0,a=0,c=async l=>{let u=l.getAttribute("src")||"";if(!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let p=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,h=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!h)return;let m=r.value||=wo(t,e),d=m.density*m.stretch(n.get(l)||l),g=await So(u,p*d,h*d,l.__snapdomBlob);g&&(o++,s+=u.length,a+=g.length,l.setAttribute("src",g),Jn(l,"attribute","src",u,g,e))},f=6;for(let l=0;l<i.length;l+=f)await Promise.allSettled(i.slice(l,l+f).map(c));return{count:o,before:s,after:a}}var du=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function pu(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function hu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=[],o=[t,...t.querySelectorAll("*")];for(let f of o){let l=f.style&&f.style.backgroundImage;l&&l.includes("data:image")&&i.push(f)}let s=0,a=async f=>{let l=n.get(f);if(!l||!l.isConnected)return;let u;try{u=getComputedStyle(l)}catch{return}if((u.backgroundRepeat||"repeat").toLowerCase().split(",").some(A=>A.trim()!=="no-repeat"))return;let h=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(h.split(",").some(A=>!du.test(A.trim())))return;let{w:m,h:d}=pu(l);if(!m||!d)return;let g=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(A=>parseFloat(A)/100)),y=r.value||=wo(t,e),b=y.density*y.stretch(l)*g,S=m*b,k=d*b,v=f.style.backgroundImage,w=[...v.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],C=v;for(let A of w){let M=A[2];if(M.startsWith("data:image/svg"))continue;let x=await So(M,S,k);x&&(C=C.split(M).join(x),s++)}C!==v&&(f.style.setProperty("background-image",C,f.style.getPropertyPriority("background-image")),Jn(f,"style","background-image",v,f.style.backgroundImage,e))},c=6;for(let f=0;f<i.length;f+=c)await Promise.allSettled(i.slice(f,f+c).map(a));return{count:s}}async function mu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=Array.from(t.querySelectorAll("image"));t.localName==="image"&&i.unshift(t);let o=0,s=async c=>{let f=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!f||!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",u=c.getAttribute("height")||"";if(l.includes("%")||u.includes("%"))return;let p=n.get(c),h=p?W(p):c.style,m=(k,v)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[k]||""))return parseFloat(h[k]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(v.trim()))return parseFloat(v);try{return p?.[k]?.baseVal?.value||0}catch{return 0}},d=m("width",l),g=m("height",u);if(!d||!g)return;let y=r.value||=wo(t,e),b=y.density*y.stretch(p||c),S=await So(f,d*b,g*b);S&&(c.setAttribute("href",S),Jn(c,"attribute","href",f,S,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(Zs,"xlink:href",S),Jn(c,"attribute","xlink:href",f,S,e)),o++)},a=6;for(let c=0;c<i.length;c+=a)await Promise.allSettled(i.slice(c,c+a).map(s));return{count:o}}async function er(t,e,n){if(!e.compress)return;let r={};await uu(t,e,n,r),await hu(t,e,n,r),await mu(t,e,n,r)}ht();dt();wt();function gu(t,e){if(X())return t;let n=t.indexOf("</style>");if(n===-1)return t;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,f;for(let y of i)if(y.intern)for(c.lastIndex=0;f=c.exec(y.text);)a.set(f[1],(a.get(f[1])||0)+1);let l=0;for(let[y,b]of a)b>1&&(l+=(b-1)*y.length);if(l<2048||t.includes(" data-sdi="))return t;let u=yu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let p=new Map,h=0,m=[],d=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let S=p.get(b);return S===void 0&&(S="i"+(h++).toString(36),p.set(b,S),m.push(`[data-sdi="${S}"]{${b}}`)),` data-sdi="${S}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,d):y.text;return t.slice(0,n)+m.join("")+g}function yu(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let f=c.getAttribute("style");f&&r.add(f)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=f=>{for(let l of f){if(l.type===CSSRule.IMPORT_RULE||l.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(l.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(l.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(l.selectorText).forEach(i)}l.cssRules&&c(l.cssRules)}};for(let f of[...t.querySelectorAll("style")].slice(1)){let l=f.textContent||"";if(/@import\b/i.test(l))return null;let u=new CSSStyleSheet;u.replaceSync(l),c(u.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let c of r){s.setAttribute("style",c);let f=a.serializeToString(s).match(/ style="([^"]*)"/);f&&o.add(f[1])}return o}async function nr(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:K,...tt}=t;t=Object.assign(a,tt),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,f;Ws(t,s),await Ot("beforeRender",t);let l=W(t.element),u=t.element.getBoundingClientRect(),p=Math.max(1,I(t.element.offsetWidth||parseFloat(l.width)||u.width||1)),h=Math.max(1,I(t.element.offsetHeight||parseFloat(l.height)||u.height||1)),m=t.element.ownerDocument||document;if(!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned){let K=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);K>0&&(h=Math.max(h,I(K))),tt>0&&(p=Math.max(p,I(tt)));try{let Q=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,et=N.measureHints.get(t.element);if(et&&et.cssLen===Q&&et.w0===p&&et.docH===K&&et.docW===tt)et.csh>0&&(h=Math.max(h,I(et.csh))),et.csw>0&&(p=Math.max(p,I(et.csw)));else{let nt=m.createElement("div");J(nt),nt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+p+"px!important;overflow:visible!important;visibility:hidden!important;";let Jt=nt.attachShadow({mode:"open"}),Zt=m.createElement("style");Zt.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,Jt.appendChild(Zt),Jt.appendChild(t.clone.cloneNode(!0)),m.body.appendChild(nt);let ze=nt.scrollHeight,Ht=nt.scrollWidth;m.body.removeChild(nt),N.measureHints.set(t.element,{cssLen:Q,w0:p,docH:K,docW:tt,csh:ze,csw:Ht}),ze>0&&(h=Math.max(h,I(ze))),Ht>0&&(p=Math.max(p,I(Ht)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let K=po(t.element,t.options),tt=1,Q=po(t.element,{}),et=Math.max(2,h*.15);Number.isFinite(Q)&&Q>=h-et&&Number.isFinite(K)&&K>0&&(h=Math.max(1,Math.min(h,I(K+tt))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Is(t.element,t.clone,K,t.nodeMap,p,h)}catch(K){console.warn("[snapdom] reconcile pass failed:",K)}let g=(K,tt=NaN)=>{let Q=typeof K=="string"?parseFloat(K):K;return Number.isFinite(Q)?Q:tt},y=g(t.options.width),b=g(t.options.height),S=n?I(n.width):p,k=n?I(n.height):h,v=S,w=k,C=Number.isFinite(y),A=Number.isFinite(b),M=k>0?S/k:1;C&&A?(v=Math.max(1,I(y)),w=Math.max(1,I(b))):C?(v=Math.max(1,I(y)),w=Math.max(1,I(v/(M||1)))):A&&(w=Math.max(1,I(b)),v=Math.max(1,I(w*(M||1))));let x=0,_=0,R=p,T=h;if(n){let K=0,tt=0;if(xo(t.element)){let Q=null;if(!r&&o&&Number.isFinite(o.a))Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let et=ae(t.element),nt=uo(l.transform&&l.transform!=="none"?l.transform:"",et);nt&&nt.is2D&&(Q={a:nt.a,b:nt.b,c:nt.c,d:nt.d,e:0,f:0})}if(Q&&!(Q.a===1&&Q.b===0&&Q.c===0&&Q.d===1)){let{ox:et,oy:nt}=an(l,p,h),Jt=Fe(p,h,Q,et,nt);K=Jt.minX,tt=Jt.minY}}x=I(n.x+K),_=I(n.y+tt),R=I(x+n.width),T=I(_+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let K={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},tt=Fe(p,h,K,0,0);x=I(tt.minX),_=I(tt.minY),R=I(tt.maxX),T=I(tt.maxY)}else if(r&&xo(t.element)){let tt=l.transform&&l.transform!=="none"?l.transform:"",Q=ae(t.element),et=Kt({baseTransform:tt,rotate:Q.rotate||"0deg",scale:Q.scale,translate:Q.translate,width:p,height:h}),{ox:nt,oy:Jt}=an(l,p,h),Zt=et.is2D?et:new DOMMatrix(et.toString()),ze={a:Zt.a,b:Zt.b,c:Zt.c,d:Zt.d,e:0,f:0},Ht=Fe(p,h,ze,nt,Jt);x=I(Ht.minX),_=I(Ht.minY),R=I(Ht.maxX),T=I(Ht.maxY)}let $=oo(l),O=io(l),H=so(l),E=ao(l),L=co(l),P=u.width>0?(R-x)/u.width:1,F=u.height>0?(T-_)/u.height:1,V=i==="subtree"&&!n?Cs(t.element,t.nodeMap,t.styleCache,P,F):{top:0,right:0,bottom:0,left:0},z=n?{top:0,right:0,bottom:0,left:0}:i?{top:I(Math.max($.top,O.top,V.top)+H.top+E.top+L.bleed.top),right:I(Math.max($.right,O.right,V.right)+H.right+E.right+L.bleed.right),bottom:I(Math.max($.bottom,O.bottom,V.bottom)+H.bottom+E.bottom+L.bleed.bottom),left:I(Math.max($.left,O.left,V.left)+H.left+E.left+L.bleed.left)}:{top:H.top,right:H.right,bottom:H.bottom,left:H.left};x=I(x-z.left),_=I(_-z.top),R=I(R+z.right),T=I(T+z.bottom);let q=Math.max(1,I(R-x)),B=Math.max(1,I(T-_)),Z="http://www.w3.org/2000/svg",_t=xo(t.element)?2:0,gt=I(_t+(r?0:1)),st=Math.ceil(q+gt*2),at=Math.ceil(B+gt*2),Pt=I(-(I(x)-gt)),U=I(-(I(_)-gt)),G=Math.max(0,Pt),j=Math.max(0,U),ut=I(st-Math.min(0,Pt)),Et=I(at-Math.min(0,U)),yt=document.createElementNS(Z,"foreignObject");yt.setAttribute("x",String(Math.min(0,Pt))),yt.setAttribute("y",String(Math.min(0,U))),yt.setAttribute("width",String(ut)),yt.setAttribute("height",String(Et)),yt.style.overflow="visible";let ue=document.createElement("style"),hn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";ue.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+hn+t.classCSS,yt.appendChild(ue);let Ue=document.createElement("div");Ue.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ue.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${ut}px;height:${Et}px`+(G!==0||j!==0?`;padding:${j}px 0 0 ${G}px !important`:""),Ue.appendChild(t.clone),yt.appendChild(Ue);let dr=new XMLSerializer().serializeToString(yt),Bt=C||A,pr=Object.freeze({w0:S,h0:k,vbW:st,vbH:at,targetW:v,targetH:w,contentX:I(Pt+(n?x:0)),contentY:I(U+(n?_:0)),clip:n?Object.freeze({x:I(x),y:I(_),width:S,height:k}):null});Object.defineProperty(a,"meta",{value:pr,enumerable:!0,writable:!1,configurable:!0});let hr=!Bt||X()?st:C?v:I(st*(w/at)),mn=!Bt||X()?at:A?w:I(at*(v/st)),Ut=parseFloat(W(m.documentElement)?.fontSize)||16;f=`<svg xmlns="${Z}" width="${hr}" height="${mn}" viewBox="0 0 ${st} ${at}" font-size="${Ut}px">`+gu(dr,yt)+"</svg>",c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,t.svgString=f,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Ot("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let mr=[...document.querySelectorAll("#snapdom-sandbox")].find(jt);return mr&&mr.style.position==="absolute"&&mr.remove(),t.dataURL}function xo(t){return Ms(t)}function bu(t){let e=Array.isArray(t.plugins)?t.plugins:bo(),n=[];for(let r of e){let i=Le(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function ia(t,e){if(!t)throw new Error("Element cannot be null or undefined");e.__session=go(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=bu(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,f,l="",u=null,p=e.needs||ft,h=n.format,m=n.type;await Ot("beforeSnap",n);let d=n.format!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(d||g){let R=String(d?n.format:n.type).toLowerCase();n.format=R==="jpg"?"jpeg":R,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Ot("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,S=n.clip?Bn(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=vi(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let k=ui(e.fast);for(;;){e.__slicer=k;let R=Xn(n.element,S);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:f}=await Os(n.element,n.options)),c>0&&!e.reconcile&&(xt(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),N.warnedReconcile||(N.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time)."))),!y&&r&&(u=As(n.element,r)),!b&&r&&$s(n.element,r,n.options),r&&(Ns(n.element,r,a),Ps(n.element,r))}finally{R()}if(!k?.yielded||!e.__tornSinceStart?.())break;k=null,e.__session=go(e.cache)}if(e.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Ot("afterClone",n),!Pe(p,"render"))return null;if(k?.due()&&await k.pause(),Un(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{Ls(n.element,n.clone,n.styleCache,n.nodeMap)}catch(R){xt(e.__session,"shrink-failed","shrink pass failed",R),console.warn("[snapdom] shrink pass failed:",R)}try{await Tn(n.clone,n.element,n.nodeMap)}catch{}let v=R=>Promise.resolve().then(R),w=(async()=>{await Promise.all([v(()=>zn(n.clone,n.options)),v(()=>Vn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Us(n.element,n.clone,n.nodeMap)}catch(R){xt(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",R),console.warn("[snapdom] backdrop-filter emulation failed:",R)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await v(()=>er(n.clone,n.options,n.nodeMap))),e.captureSelection)try{Xi(n.nodeMap)}catch(R){xt(e.__session,"selection-compose-failed","field selection compose failed",R)}})(),C=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(C=v(async()=>{let R=n.element.ownerDocument||document,T=S?H=>{try{let E=H.getBoundingClientRect();return E.right>=S.left-200&&E.left<=S.right+200&&E.bottom>=S.top-200&&E.top<=S.bottom+200}catch{return!0}}:null,{required:$,usedCodepoints:O}=!S&&e.__fontUsage||Ln(n.element,T);if(e.embedFonts==="auto"){let H=new Set;try{for(let L of R.fonts)H.add(String(L.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(H.size>0&&Array.from($).some(L=>H.has(String(L).split("__")[0].toLowerCase()))))return}if(X()){let H=new Set(Array.from($).map(E=>String(E).split("__")[0]).filter(Boolean));await In(H,1,R)}l=await cs({required:$,usedCodepoints:O,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:R})})),await Promise.all([w,C]);let M=(n.options.plugins||[]).some(R=>R&&(typeof R.beforeRender=="function"||typeof R.afterRender=="function"));n.options.engine,k?.due()&&await k.pause();let x=n.clone;tr(x,e.__compressedAssets);let _=await nr(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:l});if(e.__compressedSnapshot=Zn(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return _}dt();bt();var wu=new Set(["png","jpeg","jpg","webp","svg"]);function sa(t={}){let e=typeof t.type=="string"&&wu.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let r=t.format!=null?n:e==="jpg"?"jpeg":e,i=qo(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let u of o)typeof u=="string"?s.push(u):typeof u=="function"?a.push(u):u!=null&&console.warn("[snapdom] Ignored invalid exclude entry (expected selector string or predicate):",u);let c=t.excludeMode??"hide",f=u=>{if(!u||u.nodeType!==1)return!1;if(u.getAttribute("data-capture")==="exclude")return!0;for(let p of Array.isArray(l.exclude)?l.exclude:[])try{if(u.matches(p))return!0}catch{}for(let p of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(p(u))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(u))return!0}catch{}return!1},l={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:c,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:f,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:rt(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:Ji(t.iconFonts),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:i,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:r,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,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return l}St();ee();ht();var aa="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function Su(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var xu=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function vu(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(xu.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function ku(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(o=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(o.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let r=[t];t.querySelectorAll&&r.push(...t.querySelectorAll("*"));for(let i of r){let o=getComputedStyle(i),s=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var ca=new WeakMap;function Cu(t){let e=Wt(),n=ca.get(t);if(n&&n.epoch===e)return n.leaky;let r=!1,i={budget:2e4},o=s=>{for(let a=0;a<s.length&&!r;a++){if(--i.budget<0){r=!0;return}let c=s[a],f=c.selectorText;if(f&&/[+~]|:has\(/.test(f)){r=!0;return}let l=c.style;if(l&&(l.counterReset||l.counterIncrement||l.counterSet||l.content&&l.content.includes("counter"))){r=!0;return}c.cssRules&&c.cssRules.length&&o(c.cssRules)}};try{for(let s of t.styleSheets){let a=null;try{a=s.cssRules}catch{r=!0}if(r)break;a&&o(a)}if(!r){let s=t.adoptedStyleSheets;if(Array.isArray(s))for(let a of s){if(r)break;try{o(a.cssRules)}catch{r=!0}}}}catch{r=!0}return ca.set(t,{epoch:e,leaky:r}),r}var Au=1/16;function Mu(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),r=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(r)&&Math.abs(n-r)<=Au}var rr=new Map,_u=["width","height","min-width","min-height"];function Eu(t){let e=rr.get(t);if(e===void 0){e=null;for(let n of _u){let r=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));r&&r[1].endsWith("px")&&((e||={})[n]=r[1])}rr.size>5e3&&rr.clear(),rr.set(t,e)}return e}function Ru(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function Fu(t,e){let n=[t];for(;n.length;){let r=n.pop();if(r.nodeType===1){let i=e.nodeMap.get(r);i!==void 0&&(e.nodeMap.delete(r),e.srcToClone.get(i)===r&&e.srcToClone.delete(i)),e.styleMap.delete(r)}for(let i=r.firstChild;i;i=i.nextSibling)n.push(i)}}var vo={attempts:0,served:0,reconciled:0};async function la(t,e,n){vo.attempts++;try{let r=await Tu(t,e,n);return r&&vo.served++,r}catch{return null}}async function Tu(t,e,n){let r=e.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||t.scrollTop||t.scrollLeft||Su(t)||vu(r)||r.fontsCSS||Kn(n))return null;for(let u of n.plugins||[])if(u&&(typeof u.beforeSnap=="function"||typeof u.beforeClone=="function"||typeof u.resolveNode=="function"||typeof u.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=en(t);if(!o||Cu(i))return null;let s=[];t:for(let u of e.dirtyRoots){if(!u.isConnected||u===t||!t.contains(u))return null;for(let p of e.dirtyRoots)if(p!==u&&p!==t&&p.contains(u))continue t;s.push(u)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let u of s){if(u.parentElement===t||u.matches?.(aa)||u.querySelector?.(aa)||ku(u,o))return null;let p=r.srcToClone.get(u);if(!p||!p.parentNode)return null;let h=new Map,m={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:h,options:n},d=Xn(u,null),g=Dn(u),y;try{y=await Yt(u,m,n)}finally{g(),d()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Re(u,y,m,n),m.__pseudoCSS))return null;await Mn(y,m),Un(y);try{await Tn(y,u,h)}catch{}if(await Promise.all([zn(y,n),Vn(u,y,r.styleCache,n,h)]),n.compress)try{await er(y,n,h)}catch{}for(let[b,S]of h.entries())mo(b,S);p.replaceWith(y),Fu(p,r);for(let[b,S]of h.entries())r.nodeMap.set(b,S),r.srcToClone.set(S,b)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[u,p]of r.nodeMap.entries()){if(!p||p.nodeType!==1||!p.isConnected)continue;let h=r.styleMap.get(u);if(!h)continue;let m=Eu(h);if(!m)continue;let d=null,g=!1;for(let y in m)if(d||=getComputedStyle(p),!Mu(d.getPropertyValue(y),m[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(u))return null;vo.reconciled++,await lt(p,u,a,n)}}let c=Xe(r.styleMap);for(let[u,p]of r.styleMap.entries())Ru(u),ho(u,p,c);let f=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([u,p])=>`.${p}{${u}}`).join("");tr(r.clone,n.__compressedAssets);let l=await nr({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:f,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=Zn(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}bt();var Co=new WeakMap,ir=new WeakMap,Sa=new WeakSet,ko=new WeakMap,$u=64,ln=new Map,xa=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],Pu=["(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 Nu(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":Pu.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function fa(t){let e=[];for(let n=t;n;){try{let r=n.getBoundingClientRect();e.push(r.x,r.y,r.width,r.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=n.getRootNode?.()?.host||null}return e.join("|")}function ua(t,e){if(e.disposed||(ln.delete(t),ln.set(t,e),ln.size<=$u))return;let[n,r]=ln.entries().next().value;va(n,r)}function va(t,e){e.disposed=!0,ln.delete(t),Co.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of xa)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of Mo)n.removeEventListener(r,e.onMediaDirty,!0);for(let[n,r]of e.trackedImages)n.removeEventListener("load",r),n.removeEventListener("error",r);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 ka(t){if(Sa.has(t))return!1;ir.delete(t);let e=[t],n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i],s=[];o?.nodeType===1&&s.push(o);try{s.push(...o.querySelectorAll("*"))}catch{return!1}for(let a of s){a.shadowRoot&&e.push(a.shadowRoot);let c=String(a.localName||a.tagName||"").toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(c)||c==="progress"&&!a.hasAttribute("value")||/^(?:animate|animatetransform|animatemotion|set)$/.test(c))return!1;let f="";if(c==="img"){r.push(a);try{f=a.currentSrc||a.src||""}catch{}}/^(?:input|textarea|select|option)$/.test(c)&&n.push(a);let l=a.getAttribute?.("style")||"",u=ko.get(a);if(f||l){if((!u||u.src!==f||u.style!==l)&&(u={src:f,style:l,animated:Oe(f)||Oe(l)},ko.set(a,u)),u.animated)return!1}else u&&ko.delete(a)}}return ir.set(t,{roots:e.slice(1),controls:n,images:r}),!0}function Ao(t,e){if(!t.querySelectorAll)return!1;let n=ir.get(t);ir.delete(t);let r=new Set(n?.roots||[]);if(n&&(e.controls=n.controls,e.scannedImages=n.images),!n){let i=[t];for(let o=0;o<i.length;o++){let s=i[o];s.shadowRoot&&!r.has(s.shadowRoot)&&(r.add(s.shadowRoot),i.push(s.shadowRoot));for(let a of s.querySelectorAll("*"))a.shadowRoot&&!r.has(a.shadowRoot)&&(r.add(a.shadowRoot),i.push(a.shadowRoot))}}for(let[i,o]of e.trackedShadowRoots)if(!r.has(i)){try{o.disconnect()}catch{}for(let a of Mo)i.removeEventListener(a,e.onMediaDirty,!0);e.trackedShadowRoots.delete(i);let s=e.observers.indexOf(o);s>=0&&e.observers.splice(s,1)}for(let i of r)if(!e.trackedShadowRoots.has(i))try{let o=new MutationObserver(e.markDirty);o.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),o.__flush=e.markDirty,e.observers.push(o),e.trackedShadowRoots.set(i,o);for(let s of Mo)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var Mo=["scroll","change","beforetoggle","toggle"];function sr(t,e){return[t,...e.trackedShadowRoots.keys()]}function _o(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of sr(t,e))r.querySelectorAll&&n.push(...r.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let r=new Set(n);for(let[i,o]of e.trackedImages)r.has(i)||(i.removeEventListener("load",o),i.removeEventListener("error",o),e.trackedImages.delete(i))}for(let r of n){if(r.complete||e.trackedImages.has(r))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r)};e.trackedImages.set(r,i),r.addEventListener("load",i),r.addEventListener("error",i)}}function da(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(oe(i))if(i.type==="attributes"){let o=e.get(i.target);o||e.set(i.target,o=new Map),o.has(i.attributeName)||o.set(i.attributeName,i.oldValue)}else if(i.type==="characterData")n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type==="childList"){let o=r.get(i.target);o||r.set(i.target,o=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)-1)}}else return!0;for(let[i,o]of e)for(let[s,a]of o)if(i.getAttribute(s)!==a)return!0;for(let[i,o]of n)if(i.data!==o)return!0;for(let i of r.values())for(let o of i.values())if(o!==0)return!0;return!1}var Lu=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,We=t=>t&&(typeof t=="object"||typeof t=="function")?or(t):"-";function Iu(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let r=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(r)){let o=Math.ceil(e/3)*4;return atob(i.slice(0,o-o%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(o,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function Wu(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=Iu(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 pa(t){let e=String(t||"").trim();return e?Lu.test(e)?!0:/^data:/i.test(e)?Wu(e):!1:!1}function Oe(t){let e=String(t||"");if(pa(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(pa(n[1]??n[2]??n[3]))return!0;return!1}function ha(t,e=null){let n=t&&t.clone;if(!n)return!1;let r=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of r)for(let o of Ca(i))if(Oe(o.getAttribute?.("src"))||Oe(o.getAttribute?.("href"))||Oe(o.getAttribute?.("style"))||Oe(t.styleMap?.get(o)))return!0;return!1}function Ca(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function Eo(t,e){let n=[],r=new Set,i=o=>{o&&!r.has(o)&&(r.add(o),n.push(o))};t.matches?.("input,textarea,select,option")&&i(t);for(let o of sr(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function Ro(t,e){let n=[],r=new Set,i=(o,s=!1)=>{if(!(!o||r.has(o))){r.add(o);try{(s||o.scrollLeft||o.scrollTop||o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)&&n.push(o)}catch{}}};for(let o=t;o;o=o.parentElement)i(o,!0);for(let o of sr(t,e))for(let s of Ca(o))i(s);e.scrollNodes=n}function ma(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",Nu(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(We))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(We))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(We(o)),(s?.contains(t)||t.contains(s))&&i.push(We(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let l of e.scrollNodes)a.push(l.scrollLeft||0,l.scrollTop||0);let c=[];for(let l of e.controls){let u=String(l.localName||"").toLowerCase();u==="input"?c.push(l.type,qe(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):u==="textarea"?c.push(l.value):u==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let f=[];for(let l of e.images){let u="";try{u=l.currentSrc||l.src||""}catch{}f.push(u,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:f,frameDriven:e.retainedFrameDriven}}function Ie(t,e,n){if(!t)return!1;let r=t[n],i=e[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function ga(t,e){let n=new Set;for(let r of sr(t,e))try{let i=r.getAnimations?.(r.nodeType===1?{subtree:!0}:void 0)||[];for(let o of i)n.add(o)}catch{}return[...n]}function ya(t){return t.map(e=>[We(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Ou(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let r of e.trackedShadowRoots.keys())if(r.contains(n))return r;return null}function Du(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:Se(),styleEpoch:Wt(),styleStamp:tn(t),outsideMutations:Ze(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let c=a&&(a.nodeType===1?a:a.parentElement);if(!c||c===t||!t.contains(c)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(c)},i=a=>{if(e.capturing){for(let c of a)e.pending.push(c);return}for(let c of a)oe(c)&&(e.dirty=!0,r(c.target))},o=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(i);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=i,e.observers.push(a)}catch{}e.markDirty=i,e.onMediaDirty=o;try{for(let a of xa)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return Ao(t,e)||Eo(t,e),Ro(t,e),_o(t,e),e}var Bu=0,ba=new WeakMap;function or(t){let e=ba.get(t);return e||(e="@"+ ++Bu,ba.set(t,e)),e}function Fo(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(or(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(or(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=Fo(s,e);if(a===null)return null;o.push(a)}return"["+o.join(",")+"]"}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return JSON.stringify(or(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=Fo(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function wa(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=Fo(i,new Set);return o===null?null:`${(e||[]).map(We).join(",")}:${o}`}catch{return null}}function Aa(t,e,n,r,i=null){let o=Co.get(t);o||(o=Du(t),o.baselineSignature=wa(e,n.plugins),Co.set(t,o));let s=wa(e,n.plugins),a=async()=>{if(o.disposed)return r();let f=s===null||s!==o.baselineSignature;f&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,f=!1):o.pendingSig=s:o.pendingSig=null,Ao(t,o),_o(t,o);for(let C of o.observers)C.__flush(C.takeRecords());At();let l=Ze(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let u=t.getRootNode?.(),p=[...o.trackedShadowRoots.keys()];u?.nodeType===11&&!p.includes(u)&&p.push(u),kn(t.ownerDocument||document,p);let h=tn(t);o.styleStamp!==h&&(o.styleStamp=h,o.dirty||o.dirtyAll());let m=ma(t,o),d=ga(t,o);m.animation=ya(d),o.renderState&&(!Ie(o.renderState,m,"style")&&(xe(),o.dirtyAll()),Ie(o.renderState,m,"scroll")||o.dirtyAll(),Ie(o.renderState,m,"controls")||(ie(t),o.dirtyAll()),!Ie(o.renderState,m,"images")&&!o.dirty&&o.dirtyAll());let g=Se();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Wt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let C=fa(t);o.geometry!==null&&C!==o.geometry&&(ie(t),o.dirtyAll()),o.geometry=C}n.invalidate&&o.dirtyAll();let b=!1,S=!!o.renderState&&!Ie(o.renderState,m,"animation");try{let C=new Set;S&&d.length===0&&(C=null);for(let A of d){let M=A.playState==="running";if(!M&&!S)continue;M&&(b=!0),S=!0;let x=A.effect?.target;if(Ou(t,o,x)===t)C.add(x);else{C=null;break}}if(S&&C&&C.size&&o.retained){o.dirty=!0;for(let A of C)o.dirtyRoots&&o.dirtyRoots.add(A),ie(A)}else S&&!C&&o.dirtyAll()}catch{}let k=m.frameDriven,v=b||k;if(v&&(o.last=null),k&&o.dirtyAll(),!f&&!v&&!o.dirty&&o.last)return ua(t,o),o.last;o.capturing=!0;let w=null;try{let C=null,A=!1,M=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){M=[...o.dirtyRoots];let x=await la(t,o,n);x&&(C=await i(x),A=!0)}if(C||(f||(n.__retain=x=>{let _=new Map;for(let[R,T]of x.nodeMap.entries())_.set(T,R);w={...x,srcToClone:_}}),n.__tornSinceStart=()=>{for(let x of o.observers)for(let _ of x.takeRecords())o.pending.push(_);return At(),o.torn||da(o.pending)||Ze(t)!==l},C=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,w?(o.retained=w,o.retainedFrameDriven=ha(w),Eo(t,o),Ro(t,o)):A&&(o.retainedFrameDriven||=ha(o.retained,M),Eo(t,o),Ro(t,o));let x=ma(t,o);x.animation=ya(ga(t,o));let _=["style","scroll","controls","images"];b||_.push("animation");let R=_.every(T=>Ie(m,x,T));o.renderState=x,o.styleEpoch=Wt(),o.styleStamp=tn(t),o.geometry=fa(t),o.renderState.frameDriven?(Sa.add(t),va(t,o)):R?!v&&!o.renderState.frameDriven&&(o.last=C,ua(t,o)):(o.dirtyAll(),o.last=null)}return C}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let A of o.observers)for(let M of A.takeRecords())o.pending.push(M);At();let C=Ze(t);(o.torn||da(o.pending)||C!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=C,o.styleEpoch=Wt(),o.styleStamp=tn(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||(Ao(t,o),_o(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var ar=null;function Ea(t){ar=t}var Uu='button, a[href], [role="button"], input, select, summary, label, [tabindex]',To=!1,fn=null,$o=new WeakMap,Ma=!1;function Ra(t,e){!To||!fn||e&&e.burst===!1||$o.set(fn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Fa(t){let e={control:t};fn=e,setTimeout(()=>{fn===e&&(fn=null)},0)}function No(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Uu):null}function _a(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=No(t);e&&(Fa(e),Po(t,!1))}function Hu(t){let e=No(t);e&&Fa(e)}function Po(t,e=!0){if(!ar||document.visibilityState==="hidden")return;let n=No(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=$o.get(n);if(r){if(!r.element.isConnected){$o.delete(n);return}ar(r.element,r.options).catch(()=>{});return}e&&!Ma&&(Ma=!0,ar(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Ta(){if(To||typeof document>"u"||typeof document.addEventListener!="function")return;To=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",_a,t),document.addEventListener("keydown",_a,t),document.addEventListener("click",Hu,t),document.addEventListener("pointerenter",Po,t),document.addEventListener("focusin",Po,t)}wt();function cd(...t){return yo(...t),Y}async function ld(t,e){if(typeof t!="string"||!t.trim())throw new Error("[snapdom.fromString] html string required");let n=document.createElement("div");J(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await pt();let r=Array.from(n.childNodes).some(o=>o.nodeType===3&&o.textContent.trim()),i=n.children.length===1&&!r?n.firstElementChild:n;return await Vo(i,{...e||{},burst:!1})}finally{n.remove()}}var fd="3.1.1",Y=Object.assign(Vo,{plugins:cd,fromString:ld,version:fd,preCapture:Ta});Ea(Vo);var jo=Symbol("snapdom.internal"),ud=Symbol("snapdom.internal.silent"),Ha=new Set(["png","jpeg","jpg","webp","svg"]);async function Vo(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=sa(e);n.element=t,n.invalidate&&xe(),Ys(n,e&&e.plugins);let{stage:r,loweredBy:i}=Vs(n);n.needs=r,n.__needsLoweredBy=i;let o=Pe(r,"render"),s=n.burst===!0||!Kn(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",f=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&ka(t);return f&&Ra(t,e),n.snap||(n.snap={toPng:(l,u)=>Y.toPng(l,u),toSvg:(l,u)=>Y.toSvg(l,u)}),f?Aa(t,e,n,()=>Y.capture(t,n,jo),l=>za(l,n)):Y.capture(t,n,jo)}Y.capture=async(t,e,n)=>{if(n!==jo)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");if(Pe(e.needs||ft,"render")&&X()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=Ln(t);e.clip||(e.__fontUsage=a);let c=a.required,f=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(f=new Set([...f].filter(l=>s.has(l.toLowerCase()))),f.size===0))throw null;await In(f,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(on(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){D(e,"safari canvas poke failed",s)}}let r=await ia(t,e);return za(r,e)};async function za(t,e){let n=e.needs||ft,r=Pe(n,"render"),i=E=>Gs(n,e.__needsLoweredBy||[],E),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??=o.toDataURL(),c=o||t;o&&(t="");let f=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let u,p=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!X(),d=m?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=m?Number.isFinite(e.height)?p.targetH/p.vbH:p.targetW/p.vbW:1,y=E=>{if(o||!f?.size)return c;let L=p.vbW,P=p.vbH,F=E.crop;F&&(L=Math.max(1,Math.min(L,F.x+F.width)-Math.max(0,F.x)),P=Math.max(1,Math.min(P,F.y+F.height)-Math.max(0,F.y)));let V=Number.isFinite(E.width),z=Number.isFinite(E.height);return(V&&z?Math.max(E.width/L,E.height/P):V?E.width/L*(F?Math.max(1,g/d):1):z?E.height/P*(F?Math.max(1,d/g):1):(E.scale||1)*Math.max(d,g))*(E.dpr||1)<=l?c:u??=ea(a(),f)},b=async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(Be(),pn));return P(c,{...E,...L||{},format:"png"})},S=()=>{if(!r)throw i("svgString");if(o)throw new Error("[snapdom] svgString: engine:'html-in-canvas' produces a raster capture; there is no serialized SVG");let E=t.indexOf(",");return E>=0?decodeURIComponent(t.slice(E+1)):""},k=E=>Object.defineProperty({...E||{},svgString:S},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),v={img:async(E,L)=>{if(o)return b(E,L);let{toImg:P}=await Promise.resolve().then(()=>(Uo(),Bo)),F={...E,...L||{}};return P(y(F),F)},svg:async(E,L)=>{if(o)return b(E,L);let{toSvg:P}=await Promise.resolve().then(()=>(Uo(),Bo)),F={...E,...L||{}};return P(y(F),F)},canvas:async(E,L)=>{let{toCanvas:P}=await Promise.resolve().then(()=>(De(),Wa)),F={...E,...L||{}};return P(y(F),F)},blob:async(E,L)=>{let{toBlob:P}=await Promise.resolve().then(()=>(zo(),Oa)),F={...E,...L||{}};return P(y(F),F)},png:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"png"};return P(y(F),F)},jpeg:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"jpeg"};return P(y(F),F)},webp:async(E,L)=>{let{rasterize:P}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"webp"};return P(y(F),F)},download:async(E,L)=>{let{download:P}=await Promise.resolve().then(()=>(Ua(),Ba)),F={...E,...L||{}};return P(y(F),F)}};if(!r)for(let E of Object.keys(v)){let L=E==="download"?"download()":`to${E.charAt(0).toUpperCase()}${E.slice(1)}()`;v[E]=async()=>{throw i(L)}}let w={};for(let E of["img","svg","canvas","blob","png","jpeg","webp"])w[E]=async L=>v[E](e,{...R(E,L||{}),[ud]:!0});w.jpg=w.jpeg;let C=E=>Object.defineProperty({...e,...E},"options",{value:e,configurable:!0}),A=C({artifacts:e.__artifacts||null,export:k(),exports:w}),M=await Yn("defineExports",A),x=Object.assign({},...M.filter(E=>E&&typeof E=="object").reverse()),_={...v,...x};_.jpeg&&!_.jpg&&(_.jpg=(E,L)=>_.jpeg(E,L));function R(E,L){let P=L||{},F={...e,...P},V=typeof P.type=="string"?P.type.toLowerCase():"",z=typeof P.format=="string"?P.format.toLowerCase():Ha.has(V)?V:"";z&&(F.format=z==="jpg"?"jpeg":z),F.__explicitFormat=z?F.format:e.__explicitFormat??null,E==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let q=Z=>Z==="jpeg"||Z==="jpg"||Z==="webp";return[E,F.format,V].map(Z=>typeof Z=="string"?Z.toLowerCase():"").find(q)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&D(F,"width/height define the output size \u2014 scale is ignored when either is set"),F}let T=!1,$=Promise.resolve();async function O(E,L){let P=Object.freeze(L&&typeof L=="object"?{...L}:{}),F=async()=>{let z=_[E];if(!z)throw new Error(`[snapdom] Unknown export type: ${E}`);let q=R(E,P),B=C({artifacts:e.__artifacts||null,export:k({type:E,options:q,requestedOptions:P})}),Z=q.format,_t=q.type;await Yn("beforeExport",B,{format:E,options:q});let Dt=q.format!==Z?q.format:q.type!==_t?q.type:"",gt=typeof Dt=="string"?Dt.toLowerCase():"";Ha.has(gt)&&(q.format=gt==="jpg"?"jpeg":gt,q.type=q.format,q.__explicitFormat=q.format,/^(?:jpeg|webp)$/.test(q.format)&&(q.backgroundColor==null||q.backgroundColor==="transparent")&&(q.backgroundColor="#ffffff"));let st=await z(B,q);return await Yn("afterExport",B,{format:E,options:q,result:st}),T||(T=!0,await Ot("afterSnap",e)),st},V=$.then(F);return $=V.catch(()=>{}),V}let H={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(E,L)=>O(E,L),toImg:E=>O("img",E),toSvg:E=>O("svg",E),toCanvas:E=>O("canvas",E),toBlob:E=>O("blob",E),toPng:E=>O("png",E),toJpg:E=>O("jpg",E),toWebp:E=>O("webp",E),download:E=>O("download",E)};r?o&&Object.defineProperty(H,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(H,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(H,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let E of Object.keys(_)){let L="to"+E.charAt(0).toUpperCase()+E.slice(1);H[L]||(H[L]=P=>O(E,P))}return H}Y.toRaw=(t,e)=>Y(t,e).then(n=>n.toRaw());Y.toImg=(t,e)=>Y(t,e).then(n=>n.toImg());Y.toSvg=(t,e)=>Y(t,e).then(n=>n.toSvg());Y.toCanvas=(t,e)=>Y(t,e).then(n=>n.toCanvas());Y.toBlob=(t,e)=>Y(t,e).then(n=>n.toBlob());Y.toPng=(t,e)=>Y(t,{...e,format:"png"}).then(n=>n.toPng());Y.toJpg=(t,e)=>Y(t,{...e,format:"jpeg"}).then(n=>n.toJpg());Y.toWebp=(t,e)=>Y(t,{...e,format:"webp"}).then(n=>n.toWebp());Y.download=(t,e)=>Y(t,e).then(n=>n.download());export{ft as DEFAULT_STAGE,$e as STAGES,qs as assertNeeds,qf as clearPlugins,bo as getGlobalPlugins,Le as normalizePlugin,yo as registerPlugins,Y as snapdom};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zumer/snapdom",
3
- "version": "3.1.1-dev.1",
3
+ "version": "3.1.1",
4
4
  "description": "Browser capture engine for web interfaces. Reusable images and canvas, with plugins for HTML, context, PDF and recordings.",
5
5
  "type": "module",
6
6
  "main": "./dist/snapdom.js",