@zumer/snapdom 3.0.1-dev.1 → 3.1.0

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.0.1-dev.1
3
+ * v3.1.0
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 Ho(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function zo(t="soft"){t==="disabled"&&(P.computedStyle=new WeakMap,P.measureHints=new WeakMap,P.baseStyle=new ot(50),P.defaultStyle=new ot(64),P.image=new ot(100),P.background=new ot(100),P.resource=new ot(150),P.compress=new ot(50))}var ot,P,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)}},P={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 Zt(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 Ut(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 Ht(t){return t?.nodeType===1&&t.namespaceURI===Ga}function Pt(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 qo(t,e,n){if(Nt.size>=Vo){let r=Date.now();for(let[i,o]of Nt)o.until<=r&&Nt.delete(i);for(;Nt.size>=Vo;)Nt.delete(Nt.keys().next().value)}Nt.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}",()=>Ut(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}${Ut(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Go(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 Xo(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:([^,]*),(.*)$/)||[],w=/;base64/i.test(g)?atob(y):decodeURIComponent(y),k=new Uint8Array([...w].map(S=>S.charCodeAt(0))),x=new Blob([k],{type:(g||"").split(";")[0]||""});return{ok:!0,data:x,status:200,url:t,fromCache:!1,mime:x.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 Go(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=Nt.get(c);if(f&&f.until>Date.now())return{...f.result,fromCache:!0};f&&Nt.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 m=new AbortController,d=setTimeout(()=>m.abort("timeout"),r),h=(async()=>{try{let g=await fetch(u,{signal:m.signal,credentials:p,headers:s});if(!g.ok){let w={ok:!1,data:null,status:g.status,url:u,fromCache:!1,reason:"http_error"};if(c!==null&&o>0&&qo(c,w,o),!a){let k=`${g.status} ${g.statusText||""}`.trim();jo.warnOnce(`http:${g.status}:${n}:${Xo(t)}`,`HTTP error ${k} while fetching ${n} ${t}`)}return xr(e,w),w}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 Go(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=m.signal.aborted?m.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&&qo(c,b,o),!a){let w=`${y}:${n}:${Xo(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`;jo.errorOnce(w,k)}return xr(e,b),b}finally{clearTimeout(d),Sr.delete(c)}})();return c!==null&&Sr.set(c,h),h}var jo,Sr,Vo,Nt,de=ct(()=>{"use strict";yt();jo=Xa("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Sr=new Map,Vo=50,Nt=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)??Zt(t);if(!r)return t;let i=yr(r),o=Ut(i),s=(e.useProxy||"")+"|"+o;if(P.background.has(s)){let a=P.background.get(s);return a?`url("${a}")`:"none"}try{let a=await it(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(P.background.set(s,a.data),`url("${a.data}")`):(P.background.set(s,null),"none")}catch{return P.background.set(s,null),"none"}}var Yo=ct(()=>{"use strict";ut();yt();de()});function ic(t){let e=t.replace(oc,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function Jo(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||Qo.test(a)||a.includes("+")||a.includes("~")))for(let c of Cr(a,",")){let f=c.trim();f&&(r.inContainer||Qo.test(f)||f.includes("+")||f.includes("~"))&&r.shareUnsafeSels.add(f)}if(a&&a.includes(":"))for(let c in Ko)Ko[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=Jo(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?Jo(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 Zo(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 ti(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]=ti(n,o)}return r}function ei(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=ti(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,Ko,oc,Qo,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,Ko={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;Qo=/:(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 ni.add(t),t.setAttribute("data-snapdom-internal",""),t}function zt(t){return ni.has(t)}var ni,bt=ct(()=>{"use strict";ni=new WeakSet});function Mr(t){if(t=String(t).toLowerCase(),je.has(t)){let o={};return P.defaultStyle.set(t,o),o}if(P.defaultStyle.has(t))return P.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(zt);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);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),P.defaultStyle.set(t,i),i}function he(t){let e=ri.get(t);if(e===void 0){let n=String(t).toLowerCase();e=fc.has(n)||lc.test(n)||cc.test(n),ri.set(t,e)}return e}function ii(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)||oi.has(t))}function _r(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||oi.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),m=!1;for(let d in t){if(he(d)||ii(d,t))continue;let h=t[d];if(p){if(pc.has(d))continue;if(hc.has(d)){h&&h!==o[d]&&(i.push(`${d}:${h}`),h!=="auto"&&(m=!0));continue}}if(h&&h!==o[d]){if(!l&&(d==="width"||d==="inline-size")&&h.endsWith("px")&&h.includes(".")){let g=parseFloat(h);if(Number.isFinite(g)){i.push(`${d}:${(g+gc).toFixed(3)}px`);continue}}i.push(`${d}:${h}`)}}if(p&&!a&&!r&&!m){let d=t.width;d&&d!=="auto"&&d!==o.width&&i.push(`min-width:${d}`)}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])=>!ii(p,a)).map(([p,m])=>`${p}:${m};`).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
- }`,eu=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Ft=null,nu=0,ru=0,ce=new Map;function na(){for(let t of ce.values())t(void 0);if(ce.clear(),Array.isArray(Ft))for(let t of Ft)try{t?.terminate()}catch{}Ft=!1}function ou(){let t,e=null;try{t=URL.createObjectURL(new Blob([tu],{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=na}catch{e=null}return t&&URL.revokeObjectURL(t),e}function iu(){if(Ft===!1)return!1;if(Ft===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Ft=!1;Ft=[]}let t=nu++%eu;if(!Ft[t]){let e=ou();if(!e)return na(),!1;Ft[t]=e}return Ft[t]}var su=5e3;function au(t,e,n,r,i){let o=iu();return o?new Promise(s=>{let a=++ru,c=setTimeout(()=>{ce.delete(a),s(void 0)},su);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:ea,quality:ta,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=P.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=Yf(t),u=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=Zf(t);if(p&&p.w>0&&p.h>0&&!Ks(p.w,p.h,e,n))return null;if(t.length>=Kf){let S=await au(t,e,n,u,r);if(S!==void 0)return S}let m;try{m=await Xf(t)}catch{return null}let d=m.naturalWidth||m.width,h=m.naturalHeight||m.height;if(!d||!h)return null;let g=Ks(d,h,e,n);if(!g)return null;let y=g*ea,b=Math.max(1,Math.round(d*y)),w=Math.max(1,Math.round(h*y)),k=document.createElement("canvas");k.width=b,k.height=w;let x=k.getContext("2d");if(!x)return null;x.imageSmoothingEnabled=!0,x.imageSmoothingQuality="high",x.drawImage(m,0,0,b,w);try{let S=k.toDataURL(u,ta);if(typeof S=="string"&&S.startsWith("data:image")&&S.length<t.length)return S}catch{}return null})(),f={source:t,promise:c,cache:o};Kn.set(i,f);try{let l=await c;return Qf(o,i,t,l),l}finally{Kn.get(i)===f&&Kn.delete(i)}}async function cu(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,m=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!m)return;let d=r.value||(r.value=go(t,e)),h=d.density*d.stretch(n.get(l)||l),g=await yo(u,p*h,m*h,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 lu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function fu(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function uu(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(v=>v.trim()!=="no-repeat"))return;let m=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(m.split(",").some(v=>!lu.test(v.trim())))return;let{w:d,h}=fu(l);if(!d||!h)return;let g=Math.max(1,...(m.match(/\d+(?:\.\d+)?%/g)||[]).map(v=>parseFloat(v)/100)),y=r.value||(r.value=go(t,e)),b=y.density*y.stretch(l)*g,w=d*b,k=h*b,x=f.style.backgroundImage,S=[...x.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],A=x;for(let v of S){let M=v[2];if(M.startsWith("data:image/svg"))continue;let C=await yo(M,w,k);C&&(A=A.split(M).join(C),s++)}A!==x&&(f.style.setProperty("background-image",A,f.style.getPropertyPriority("background-image")),Qn(f,"style","background-image",x,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 du(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),m=p?W(p):c.style,d=(k,x)=>{if(/^\d+(?:\.\d+)?px$/.test(m?.[k]||""))return parseFloat(m[k]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(x.trim()))return parseFloat(x);try{return p?.[k]?.baseVal?.value||0}catch{return 0}},h=d("width",l),g=d("height",u);if(!h||!g)return;let y=r.value||(r.value=go(t,e)),b=y.density*y.stretch(p||c),w=await yo(f,h*b,g*b);w&&(c.setAttribute("href",w),Qn(c,"attribute","href",f,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(Qs,"xlink:href",w),Qn(c,"attribute","xlink:href",f,w,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 cu(t,e,n,r),await uu(t,e,n,r),await du(t,e,n,r)}pt();ut();bt();function pu(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=hu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let p=new Map,m=0,d=[],h=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let w=p.get(b);return w===void 0&&(w="i"+(m++).toString(36),p.set(b,w),d.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,h):y.text;return t.slice(0,n)+d.join("")+g}function hu(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;Ps(t,s),await It("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)),m=Math.max(1,I(t.element.offsetHeight||parseFloat(l.height)||u.height||1)),d=t.element.ownerDocument||document;if(!n&&(t.element===d.body||t.element===d.documentElement)&&!t.__pinned){let K=Math.max(t.element.scrollHeight||0,d.documentElement?.scrollHeight||0,d.body?.scrollHeight||0),tt=Math.max(t.element.scrollWidth||0,d.documentElement?.scrollWidth||0,d.body?.scrollWidth||0);K>0&&(m=Math.max(m,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=P.measureHints.get(t.element);if(et&&et.cssLen===Q&&et.w0===p&&et.docH===K&&et.docW===tt)et.csh>0&&(m=Math.max(m,I(et.csh))),et.csw>0&&(p=Math.max(p,I(et.csw)));else{let nt=d.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 Qt=nt.attachShadow({mode:"open"}),Jt=d.createElement("style");Jt.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,Qt.appendChild(Jt),Qt.appendChild(t.clone.cloneNode(!0)),d.body.appendChild(nt);let Be=nt.scrollHeight,Bt=nt.scrollWidth;d.body.removeChild(nt),P.measureHints.set(t.element,{cssLen:Q,w0:p,docH:K,docW:tt,csh:Be,csw:Bt}),Be>0&&(m=Math.max(m,I(Be))),Bt>0&&(p=Math.max(p,I(Bt)))}}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,m*.15);Number.isFinite(Q)&&Q>=m-et&&Number.isFinite(K)&&K>0&&(m=Math.max(1,Math.min(m,I(K+tt))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;$s(t.element,t.clone,K,t.nodeMap,p,m)}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),w=n?I(n.width):p,k=n?I(n.height):m,x=w,S=k,A=Number.isFinite(y),v=Number.isFinite(b),M=k>0?w/k:1;A&&v?(x=Math.max(1,I(y)),S=Math.max(1,I(b))):A?(x=Math.max(1,I(y)),S=Math.max(1,I(x/(M||1)))):v&&(S=Math.max(1,I(b)),x=Math.max(1,I(S*(M||1))));let C=0,R=0,_=p,T=m;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,m),Qt=Fe(p,m,Q,et,nt);K=Qt.minX,tt=Qt.minY}}C=I(n.x+K),R=I(n.y+tt),_=I(C+n.width),T=I(R+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,m,K,0,0);C=I(tt.minX),R=I(tt.minY),_=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=Yt({baseTransform:tt,rotate:Q.rotate||"0deg",scale:Q.scale,translate:Q.translate,width:p,height:m}),{ox:nt,oy:Qt}=rn(l,p,m),Jt=et.is2D?et:new DOMMatrix(et.toString()),Be={a:Jt.a,b:Jt.b,c:Jt.c,d:Jt.d,e:0,f:0},Bt=Fe(p,m,Be,nt,Qt);C=I(Bt.minX),R=I(Bt.minY),_=I(Bt.maxX),T=I(Bt.maxY)}let N=ro(l),O=oo(l),H=io(l),E=so(l),L=ao(l),$=u.width>0?(_-C)/u.width:1,F=u.height>0?(T-R)/u.height:1,V=i==="subtree"&&!n?Ss(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},z=n?{top:0,right:0,bottom:0,left:0}:i?{top:I(Math.max(N.top,O.top,V.top)+H.top+E.top+L.bleed.top),right:I(Math.max(N.right,O.right,V.right)+H.right+E.right+L.bleed.right),bottom:I(Math.max(N.bottom,O.bottom,V.bottom)+H.bottom+E.bottom+L.bleed.bottom),left:I(Math.max(N.left,O.left,V.left)+H.left+E.left+L.bleed.left)}:{top:H.top,right:H.right,bottom:H.bottom,left:H.left};C=I(C-z.left),R=I(R-z.top),_=I(_+z.right),T=I(T+z.bottom);let q=Math.max(1,I(_-C)),B=Math.max(1,I(T-R)),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),$t=I(-(I(C)-mt)),U=I(-(I(R)-mt)),G=Math.max(0,$t),j=Math.max(0,U),ft=I(st-Math.min(0,$t)),Et=I(at-Math.min(0,U)),gt=document.createElementNS(Z,"foreignObject");gt.setAttribute("x",String(Math.min(0,$t))),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),Ot=A||v,dr=Object.freeze({w0:w,h0:k,vbW:st,vbH:at,targetW:x,targetH:S,contentX:I($t+(n?C:0)),contentY:I(U+(n?R:0)),clip:n?Object.freeze({x:I(C),y:I(R),width:w,height:k}):null});Object.defineProperty(a,"meta",{value:dr,enumerable:!0,writable:!1,configurable:!0});let pr=!Ot||Y()?st:A?x:I(st*(S/at)),pn=!Ot||Y()?at:v?S:I(at*(x/st)),Dt=parseFloat(W(d.documentElement)?.fontSize)||16;f=`<svg xmlns="${Z}" width="${pr}" height="${pn}" viewBox="0 0 ${st} ${at}" font-size="${Dt}px">`+pu(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 It("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let hr=[...document.querySelectorAll("#snapdom-sandbox")].find(zt);return hr&&hr.style.position==="absolute"&&hr.remove(),t.dataURL}function bo(t){return vs(t)}function mu(t){let e=Array.isArray(t.plugins)?t.plugins:Gs(),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 ra(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=mu(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,m=n.format,d=n.type;await It("beforeSnap",n);let h=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==d&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(h||g){let _=String(h?n.format:n.type).toLowerCase();n.format=_==="jpg"?"jpeg":_,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await It("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?On(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=bi(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let k=ai(e.fast);for(;;){e.__slicer=k;let _=qn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:f}=await Ns(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"),P.warnedReconcile||(P.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=xs(n.element,r)),!b&&r&&Es(n.element,r,n.options),r&&(Fs(n.element,r,a),Rs(n.element,r))}finally{_()}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 It("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{Ts(n.element,n.clone,n.styleCache,n.nodeMap)}catch(_){St(e.__session,"shrink-failed","shrink pass failed",_),console.warn("[snapdom] shrink pass failed:",_)}try{await Rn(n.clone,n.element,n.nodeMap)}catch{}let x=_=>Promise.resolve().then(_),S=(async()=>{await Promise.all([x(()=>Un(n.clone,n.options)),x(()=>zn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Ws(n.element,n.clone,n.nodeMap)}catch(_){St(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",_),console.warn("[snapdom] backdrop-filter emulation failed:",_)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await x(()=>tr(n.clone,n.options,n.nodeMap))),e.captureSelection)try{ji(n.nodeMap)}catch(_){St(e.__session,"selection-compose-failed","field selection compose failed",_)}})(),A=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(A=x(async()=>{let _=n.element.ownerDocument||document,T=w?H=>{try{let E=H.getBoundingClientRect();return E.right>=w.left-200&&E.left<=w.right+200&&E.bottom>=w.top-200&&E.top<=w.bottom+200}catch{return!0}}:null,{required:N,usedCodepoints:O}=!w&&e.__fontUsage||Pn(n.element,T);if(e.embedFonts==="auto"){let H=new Set;try{for(let L of _.fonts)H.add(String(L.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(H.size>0&&Array.from(N).some(L=>H.has(String(L).split("__")[0].toLowerCase()))))return}if(Y()){let H=new Set(Array.from(N).map(E=>String(E).split("__")[0]).filter(Boolean));await Nn(H,1,_)}l=await os({required:N,usedCodepoints:O,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:_})})),await Promise.all([S,A]);let M=(n.options.plugins||[]).some(_=>_&&(typeof _.beforeRender=="function"||typeof _.afterRender=="function"));n.options.engine,k?.due()&&await k.pause();let C=n.clone;Zn(C,e.__compressedAssets);let R=await er(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:l});if(e.__compressedSnapshot=Jn(C,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 R}ut();yt();var gu=new Set(["png","jpeg","jpg","webp","svg"]);function oa(t={}){let e=typeof t.type=="string"&&gu.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=Ho(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:Xi(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();te();pt();var ia="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function yu(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var bu=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function wu(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(bu.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function Su(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 sa=new WeakMap;function xu(t){let e=Lt(),n=sa.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 sa.set(t,{epoch:e,leaky:r}),r}var vu=1/16;function ku(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)<=vu}var nr=new Map,Cu=["width","height","min-width","min-height"];function Au(t){let e=nr.get(t);if(e===void 0){e=null;for(let n of Cu){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 Mu(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function _u(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 aa(t,e,n){wo.attempts++;try{let r=await Eu(t,e,n);return r&&wo.served++,r}catch{return null}}async function Eu(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||yu(t)||wu(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||xu(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?.(ia)||u.querySelector?.(ia)||Su(u,o))return null;let p=r.srcToClone.get(u);if(!p||!p.parentNode)return null;let m=new Map,d={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:m,options:n},h=qn(u,null),g=Wn(u),y;try{y=await se(u,d,n)}finally{g(),h()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Re(u,y,d,n),d.__pseudoCSS))return null;await Cn(y,d),Dn(y);try{await Rn(y,u,m)}catch{}if(await Promise.all([Un(y,n),zn(u,y,r.styleCache,n,m)]),n.compress)try{await tr(y,n,m)}catch{}for(let[b,w]of m.entries())ho(b,w);p.replaceWith(y),_u(p,r);for(let[b,w]of m.entries())r.nodeMap.set(b,w),r.srcToClone.set(w,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 m=r.styleMap.get(u);if(!m)continue;let d=Au(m);if(!d)continue;let h=null,g=!1;for(let y in d)if(h||(h=getComputedStyle(p)),!ku(h.getPropertyValue(y),d[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())Mu(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,ba=new WeakSet,So=new WeakMap,Ru=64,an=new Map,wa=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],Fu=["(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 Tu(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":Fu.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function ca(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 la(t,e){if(e.disposed||(an.delete(t),an.set(t,e),an.size<=Ru))return;let[n,r]=an.entries().next().value;Sa(n,r)}function Sa(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 wa)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 xa(t){if(ba.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 fa(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(re(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 $u=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,Ne=t=>t&&(typeof t=="object"||typeof t=="function")?rr(t):"-";function Pu(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 Nu(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=Pu(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 ua(t){let e=String(t||"").trim();return e?$u.test(e)?!0:/^data:/i.test(e)?Nu(e):!1:!1}function Le(t){let e=String(t||"");if(ua(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(ua(n[1]??n[2]??n[3]))return!0;return!1}function da(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 va(i))if(Le(o.getAttribute?.("src"))||Le(o.getAttribute?.("href"))||Le(o.getAttribute?.("style"))||Le(t.styleMap?.get(o)))return!0;return!1}function va(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 va(o))i(s);e.scrollNodes=n}function pa(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",Tu(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 ha(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 ma(t){return t.map(e=>[Ne(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Lu(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 Iu(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:Lt(),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)re(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 wa)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return vo(t,e)||Ao(t,e),Mo(t,e),Co(t,e),e}var Wu=0,ga=new WeakMap;function rr(t){let e=ga.get(t);return e||(e="@"+ ++Wu,ga.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 ya(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 ka(t,e,n,r,i=null){let o=xo.get(t);o||(o=Iu(t),o.baselineSignature=ya(e,n.plugins),xo.set(t,o));let s=ya(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 A of o.observers)A.__flush(A.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 m=Qe(t);o.styleStamp!==m&&(o.styleStamp=m,o.dirty||o.dirtyAll());let d=pa(t,o),h=ha(t,o);d.animation=ma(h),o.renderState&&(!Pe(o.renderState,d,"style")&&(xe(),o.dirtyAll()),Pe(o.renderState,d,"scroll")||o.dirtyAll(),Pe(o.renderState,d,"controls")||(oe(t),o.dirtyAll()),!Pe(o.renderState,d,"images")&&!o.dirty&&o.dirtyAll());let g=Se();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Lt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let A=ca(t);o.geometry!==null&&A!==o.geometry&&(oe(t),o.dirtyAll()),o.geometry=A}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!Pe(o.renderState,d,"animation");try{let A=new Set;w&&h.length===0&&(A=null);for(let v of h){let M=v.playState==="running";if(!M&&!w)continue;M&&(b=!0),w=!0;let C=v.effect?.target;if(Lu(t,o,C)===t)A.add(C);else{A=null;break}}if(w&&A&&A.size&&o.retained){o.dirty=!0;for(let v of A)o.dirtyRoots&&o.dirtyRoots.add(v),oe(v)}else w&&!A&&o.dirtyAll()}catch{}let k=d.frameDriven,x=b||k;if(x&&(o.last=null),k&&o.dirtyAll(),!f&&!x&&!o.dirty&&o.last)return la(t,o),o.last;o.capturing=!0;let S=null;try{let A=null,v=!1,M=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){M=[...o.dirtyRoots];let C=await aa(t,o,n);C&&(A=await i(C),v=!0)}if(A||(f||(n.__retain=C=>{let R=new Map;for(let[_,T]of C.nodeMap.entries())R.set(T,_);S={...C,srcToClone:R}}),n.__tornSinceStart=()=>{for(let C of o.observers)for(let R of C.takeRecords())o.pending.push(R);return At(),o.torn||fa(o.pending)||Ke(t)!==l},A=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=da(S),Ao(t,o),Mo(t,o)):v&&(o.retainedFrameDriven||(o.retainedFrameDriven=da(o.retained,M)),Ao(t,o),Mo(t,o));let C=pa(t,o);C.animation=ma(ha(t,o));let R=["style","scroll","controls","images"];b||R.push("animation");let _=R.every(T=>Pe(d,C,T));o.renderState=C,o.styleEpoch=Lt(),o.styleStamp=Qe(t),o.geometry=ca(t),o.renderState.frameDriven?(ba.add(t),Sa(t,o)):_?!x&&!o.renderState.frameDriven&&(o.last=A,la(t,o)):(o.dirtyAll(),o.last=null)}return A}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let v of o.observers)for(let M of v.takeRecords())o.pending.push(M);At();let A=Ke(t);(o.torn||fa(o.pending)||A!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=A,o.styleEpoch=Lt(),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 Ma(t){sr=t}var Ou='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Eo=!1,cn=null,Ro=new WeakMap,Ca=!1;function _a(t,e){!Eo||!cn||e&&e.burst===!1||Ro.set(cn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Ea(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(Ou):null}function Aa(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=To(t);e&&(Ea(e),Fo(t,!1))}function Du(t){let e=To(t);e&&Ea(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&&!Ca&&(Ca=!0,sr(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Ra(){if(Eo||typeof document>"u"||typeof document.addEventListener!="function")return;Eo=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Aa,t),document.addEventListener("keydown",Aa,t),document.addEventListener("click",Du,t),document.addEventListener("pointerenter",Fo,t),document.addEventListener("focusin",Fo,t)}bt();function id(...t){return js(...t),X}async function sd(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 Uo(i,{...e||{},burst:!1})}finally{n.remove()}}var ad="3.0.1-dev.1",X=Object.assign(Uo,{plugins:id,fromString:sd,version:ad,preCapture:Ra});Ma(Uo);var Bo=Symbol("snapdom.internal"),cd=Symbol("snapdom.internal.silent"),Ua=new Set(["png","jpeg","jpg","webp","svg"]);async function Uo(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=oa(e);n.element=t,n.invalidate&&xe(),qs(n,e&&e.plugins);let{stage:r,loweredBy:i}=Hs(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&&xa(t);return f&&_a(t,e),n.snap||(n.snap={toPng:(l,u)=>X.toPng(l,u),toSvg:(l,u)=>X.toSvg(l,u)}),f?ka(t,e,n,()=>X.capture(t,n,Bo),l=>Ha(l,n)):X.capture(t,n,Bo)}X.capture=async(t,e,n)=>{if(n!==Bo)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 ra(t,e);return Ha(r,e)};async function Ha(t,e){let n=e.needs||vt,r=$e(n,"render"),i=E=>zs(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||{},d=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),h=d?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=d?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.vbH,F=E.crop;F&&(L=Math.max(1,Math.min(L,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,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/$):V?E.width/L*(F?Math.max(1,g/h):1):z?E.height/$*(F?Math.max(1,h/g):1):(E.scale||1)*Math.max(h,g))*(E.dpr||1)<=l?c:u??(u=Zs(a(),f))},b=async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un));return $(c,{...E,...L||{},format:"png"})},w=()=>{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:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),x={img:async(E,L)=>{if(o)return b(E,L);let{toImg:$}=await Promise.resolve().then(()=>(Wo(),Io)),F={...E,...L||{}};return $(y(F),F)},svg:async(E,L)=>{if(o)return b(E,L);let{toSvg:$}=await Promise.resolve().then(()=>(Wo(),Io)),F={...E,...L||{}};return $(y(F),F)},canvas:async(E,L)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(Ie(),Ia)),F={...E,...L||{}};return $(y(F),F)},blob:async(E,L)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Do(),Wa)),F={...E,...L||{}};return $(y(F),F)},png:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"png"};return $(y(F),F)},jpeg:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"jpeg"};return $(y(F),F)},webp:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"webp"};return $(y(F),F)},download:async(E,L)=>{let{download:$}=await Promise.resolve().then(()=>(Ba(),Da)),F={...E,...L||{}};return $(y(F),F)}};if(!r)for(let E of Object.keys(x)){let L=E==="download"?"download()":`to${E.charAt(0).toUpperCase()}${E.slice(1)}()`;x[E]=async()=>{throw i(L)}}let S={};for(let E of["img","svg","canvas","blob","png","jpeg","webp"])S[E]=async L=>x[E](e,{..._(E,L||{}),[cd]:!0});S.jpg=S.jpeg;let A=E=>Object.defineProperty({...e,...E},"options",{value:e,configurable:!0}),v=A({artifacts:e.__artifacts||null,export:k(),exports:S}),M=await Xn("defineExports",v),C=Object.assign({},...M.filter(E=>E&&typeof E=="object").reverse()),R={...x,...C};R.jpeg&&!R.jpg&&(R.jpg=(E,L)=>R.jpeg(E,L));function _(E,L){let $=L||{},F={...e,...$},V=typeof $.type=="string"?$.type.toLowerCase():"",z=typeof $.format=="string"?$.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,N=Promise.resolve();async function O(E,L){let $=Object.freeze(L&&typeof L=="object"?{...L}:{}),F=async()=>{let z=R[E];if(!z)throw new Error(`[snapdom] Unknown export type: ${E}`);let q=_(E,$),B=A({artifacts:e.__artifacts||null,export:k({type:E,options:q,requestedOptions:$})}),Z=q.format,_t=q.type;await Xn("beforeExport",B,{format:E,options:q});let Wt=q.format!==Z?q.format:q.type!==_t?q.type:"",mt=typeof Wt=="string"?Wt.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 It("afterSnap",e)),st},V=N.then(F);return N=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(R)){let L="to"+E.charAt(0).toUpperCase()+E.slice(1);H[L]||(H[L]=$=>O(E,$))}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
+ }`,eu=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Ft=null,nu=0,ru=0,ce=new Map;function na(){for(let t of ce.values())t(void 0);if(ce.clear(),Array.isArray(Ft))for(let t of Ft)try{t?.terminate()}catch{}Ft=!1}function ou(){let t,e=null;try{t=URL.createObjectURL(new Blob([tu],{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=na}catch{e=null}return t&&URL.revokeObjectURL(t),e}function iu(){if(Ft===!1)return!1;if(Ft===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Ft=!1;Ft=[]}let t=nu++%eu;if(!Ft[t]){let e=ou();if(!e)return na(),!1;Ft[t]=e}return Ft[t]}var su=5e3;function au(t,e,n,r,i){let o=iu();return o?new Promise(s=>{let a=++ru,c=setTimeout(()=>{ce.delete(a),s(void 0)},su);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:ea,quality:ta,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=P.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=Yf(t),u=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=Zf(t);if(p&&p.w>0&&p.h>0&&!Ks(p.w,p.h,e,n))return null;if(t.length>=Kf){let S=await au(t,e,n,u,r);if(S!==void 0)return S}let m;try{m=await Xf(t)}catch{return null}let d=m.naturalWidth||m.width,h=m.naturalHeight||m.height;if(!d||!h)return null;let g=Ks(d,h,e,n);if(!g)return null;let y=g*ea,b=Math.max(1,Math.round(d*y)),w=Math.max(1,Math.round(h*y)),k=document.createElement("canvas");k.width=b,k.height=w;let x=k.getContext("2d");if(!x)return null;x.imageSmoothingEnabled=!0,x.imageSmoothingQuality="high",x.drawImage(m,0,0,b,w);try{let S=k.toDataURL(u,ta);if(typeof S=="string"&&S.startsWith("data:image")&&S.length<t.length)return S}catch{}return null})(),f={source:t,promise:c,cache:o};Kn.set(i,f);try{let l=await c;return Qf(o,i,t,l),l}finally{Kn.get(i)===f&&Kn.delete(i)}}async function cu(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,m=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!m)return;let d=r.value||(r.value=go(t,e)),h=d.density*d.stretch(n.get(l)||l),g=await yo(u,p*h,m*h,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 lu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function fu(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function uu(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(v=>v.trim()!=="no-repeat"))return;let m=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(m.split(",").some(v=>!lu.test(v.trim())))return;let{w:d,h}=fu(l);if(!d||!h)return;let g=Math.max(1,...(m.match(/\d+(?:\.\d+)?%/g)||[]).map(v=>parseFloat(v)/100)),y=r.value||(r.value=go(t,e)),b=y.density*y.stretch(l)*g,w=d*b,k=h*b,x=f.style.backgroundImage,S=[...x.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],A=x;for(let v of S){let M=v[2];if(M.startsWith("data:image/svg"))continue;let C=await yo(M,w,k);C&&(A=A.split(M).join(C),s++)}A!==x&&(f.style.setProperty("background-image",A,f.style.getPropertyPriority("background-image")),Qn(f,"style","background-image",x,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 du(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),m=p?W(p):c.style,d=(k,x)=>{if(/^\d+(?:\.\d+)?px$/.test(m?.[k]||""))return parseFloat(m[k]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(x.trim()))return parseFloat(x);try{return p?.[k]?.baseVal?.value||0}catch{return 0}},h=d("width",l),g=d("height",u);if(!h||!g)return;let y=r.value||(r.value=go(t,e)),b=y.density*y.stretch(p||c),w=await yo(f,h*b,g*b);w&&(c.setAttribute("href",w),Qn(c,"attribute","href",f,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(Qs,"xlink:href",w),Qn(c,"attribute","xlink:href",f,w,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 cu(t,e,n,r),await uu(t,e,n,r),await du(t,e,n,r)}pt();ut();bt();function pu(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=hu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let p=new Map,m=0,d=[],h=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let w=p.get(b);return w===void 0&&(w="i"+(m++).toString(36),p.set(b,w),d.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,h):y.text;return t.slice(0,n)+d.join("")+g}function hu(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;Ps(t,s),await It("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)),m=Math.max(1,I(t.element.offsetHeight||parseFloat(l.height)||u.height||1)),d=t.element.ownerDocument||document;if(!n&&(t.element===d.body||t.element===d.documentElement)&&!t.__pinned){let K=Math.max(t.element.scrollHeight||0,d.documentElement?.scrollHeight||0,d.body?.scrollHeight||0),tt=Math.max(t.element.scrollWidth||0,d.documentElement?.scrollWidth||0,d.body?.scrollWidth||0);K>0&&(m=Math.max(m,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=P.measureHints.get(t.element);if(et&&et.cssLen===Q&&et.w0===p&&et.docH===K&&et.docW===tt)et.csh>0&&(m=Math.max(m,I(et.csh))),et.csw>0&&(p=Math.max(p,I(et.csw)));else{let nt=d.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 Qt=nt.attachShadow({mode:"open"}),Jt=d.createElement("style");Jt.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,Qt.appendChild(Jt),Qt.appendChild(t.clone.cloneNode(!0)),d.body.appendChild(nt);let Be=nt.scrollHeight,Bt=nt.scrollWidth;d.body.removeChild(nt),P.measureHints.set(t.element,{cssLen:Q,w0:p,docH:K,docW:tt,csh:Be,csw:Bt}),Be>0&&(m=Math.max(m,I(Be))),Bt>0&&(p=Math.max(p,I(Bt)))}}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,m*.15);Number.isFinite(Q)&&Q>=m-et&&Number.isFinite(K)&&K>0&&(m=Math.max(1,Math.min(m,I(K+tt))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;$s(t.element,t.clone,K,t.nodeMap,p,m)}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),w=n?I(n.width):p,k=n?I(n.height):m,x=w,S=k,A=Number.isFinite(y),v=Number.isFinite(b),M=k>0?w/k:1;A&&v?(x=Math.max(1,I(y)),S=Math.max(1,I(b))):A?(x=Math.max(1,I(y)),S=Math.max(1,I(x/(M||1)))):v&&(S=Math.max(1,I(b)),x=Math.max(1,I(S*(M||1))));let C=0,R=0,_=p,T=m;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,m),Qt=Fe(p,m,Q,et,nt);K=Qt.minX,tt=Qt.minY}}C=I(n.x+K),R=I(n.y+tt),_=I(C+n.width),T=I(R+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,m,K,0,0);C=I(tt.minX),R=I(tt.minY),_=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=Yt({baseTransform:tt,rotate:Q.rotate||"0deg",scale:Q.scale,translate:Q.translate,width:p,height:m}),{ox:nt,oy:Qt}=rn(l,p,m),Jt=et.is2D?et:new DOMMatrix(et.toString()),Be={a:Jt.a,b:Jt.b,c:Jt.c,d:Jt.d,e:0,f:0},Bt=Fe(p,m,Be,nt,Qt);C=I(Bt.minX),R=I(Bt.minY),_=I(Bt.maxX),T=I(Bt.maxY)}let N=ro(l),O=oo(l),H=io(l),E=so(l),L=ao(l),$=u.width>0?(_-C)/u.width:1,F=u.height>0?(T-R)/u.height:1,V=i==="subtree"&&!n?Ss(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},z=n?{top:0,right:0,bottom:0,left:0}:i?{top:I(Math.max(N.top,O.top,V.top)+H.top+E.top+L.bleed.top),right:I(Math.max(N.right,O.right,V.right)+H.right+E.right+L.bleed.right),bottom:I(Math.max(N.bottom,O.bottom,V.bottom)+H.bottom+E.bottom+L.bleed.bottom),left:I(Math.max(N.left,O.left,V.left)+H.left+E.left+L.bleed.left)}:{top:H.top,right:H.right,bottom:H.bottom,left:H.left};C=I(C-z.left),R=I(R-z.top),_=I(_+z.right),T=I(T+z.bottom);let q=Math.max(1,I(_-C)),B=Math.max(1,I(T-R)),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),$t=I(-(I(C)-mt)),U=I(-(I(R)-mt)),G=Math.max(0,$t),j=Math.max(0,U),ft=I(st-Math.min(0,$t)),Et=I(at-Math.min(0,U)),gt=document.createElementNS(Z,"foreignObject");gt.setAttribute("x",String(Math.min(0,$t))),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),Ot=A||v,dr=Object.freeze({w0:w,h0:k,vbW:st,vbH:at,targetW:x,targetH:S,contentX:I($t+(n?C:0)),contentY:I(U+(n?R:0)),clip:n?Object.freeze({x:I(C),y:I(R),width:w,height:k}):null});Object.defineProperty(a,"meta",{value:dr,enumerable:!0,writable:!1,configurable:!0});let pr=!Ot||Y()?st:A?x:I(st*(S/at)),pn=!Ot||Y()?at:v?S:I(at*(x/st)),Dt=parseFloat(W(d.documentElement)?.fontSize)||16;f=`<svg xmlns="${Z}" width="${pr}" height="${pn}" viewBox="0 0 ${st} ${at}" font-size="${Dt}px">`+pu(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 It("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let hr=[...document.querySelectorAll("#snapdom-sandbox")].find(zt);return hr&&hr.style.position==="absolute"&&hr.remove(),t.dataURL}function bo(t){return vs(t)}function mu(t){let e=Array.isArray(t.plugins)?t.plugins:Gs(),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 ra(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=mu(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,m=n.format,d=n.type;await It("beforeSnap",n);let h=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==d&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(h||g){let _=String(h?n.format:n.type).toLowerCase();n.format=_==="jpg"?"jpeg":_,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await It("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?On(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=bi(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let k=ai(e.fast);for(;;){e.__slicer=k;let _=qn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:f}=await Ns(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"),P.warnedReconcile||(P.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=xs(n.element,r)),!b&&r&&Es(n.element,r,n.options),r&&(Fs(n.element,r,a),Rs(n.element,r))}finally{_()}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 It("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{Ts(n.element,n.clone,n.styleCache,n.nodeMap)}catch(_){St(e.__session,"shrink-failed","shrink pass failed",_),console.warn("[snapdom] shrink pass failed:",_)}try{await Rn(n.clone,n.element,n.nodeMap)}catch{}let x=_=>Promise.resolve().then(_),S=(async()=>{await Promise.all([x(()=>Un(n.clone,n.options)),x(()=>zn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Ws(n.element,n.clone,n.nodeMap)}catch(_){St(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",_),console.warn("[snapdom] backdrop-filter emulation failed:",_)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await x(()=>tr(n.clone,n.options,n.nodeMap))),e.captureSelection)try{ji(n.nodeMap)}catch(_){St(e.__session,"selection-compose-failed","field selection compose failed",_)}})(),A=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(A=x(async()=>{let _=n.element.ownerDocument||document,T=w?H=>{try{let E=H.getBoundingClientRect();return E.right>=w.left-200&&E.left<=w.right+200&&E.bottom>=w.top-200&&E.top<=w.bottom+200}catch{return!0}}:null,{required:N,usedCodepoints:O}=!w&&e.__fontUsage||Pn(n.element,T);if(e.embedFonts==="auto"){let H=new Set;try{for(let L of _.fonts)H.add(String(L.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(H.size>0&&Array.from(N).some(L=>H.has(String(L).split("__")[0].toLowerCase()))))return}if(Y()){let H=new Set(Array.from(N).map(E=>String(E).split("__")[0]).filter(Boolean));await Nn(H,1,_)}l=await os({required:N,usedCodepoints:O,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:_})})),await Promise.all([S,A]);let M=(n.options.plugins||[]).some(_=>_&&(typeof _.beforeRender=="function"||typeof _.afterRender=="function"));n.options.engine,k?.due()&&await k.pause();let C=n.clone;Zn(C,e.__compressedAssets);let R=await er(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:l});if(e.__compressedSnapshot=Jn(C,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 R}ut();yt();var gu=new Set(["png","jpeg","jpg","webp","svg"]);function oa(t={}){let e=typeof t.type=="string"&&gu.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=Ho(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:Xi(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();te();pt();var ia="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function yu(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var bu=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function wu(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(bu.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function Su(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 sa=new WeakMap;function xu(t){let e=Lt(),n=sa.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 sa.set(t,{epoch:e,leaky:r}),r}var vu=1/16;function ku(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)<=vu}var nr=new Map,Cu=["width","height","min-width","min-height"];function Au(t){let e=nr.get(t);if(e===void 0){e=null;for(let n of Cu){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 Mu(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function _u(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 aa(t,e,n){wo.attempts++;try{let r=await Eu(t,e,n);return r&&wo.served++,r}catch{return null}}async function Eu(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||yu(t)||wu(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||xu(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?.(ia)||u.querySelector?.(ia)||Su(u,o))return null;let p=r.srcToClone.get(u);if(!p||!p.parentNode)return null;let m=new Map,d={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:m,options:n},h=qn(u,null),g=Wn(u),y;try{y=await se(u,d,n)}finally{g(),h()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Re(u,y,d,n),d.__pseudoCSS))return null;await Cn(y,d),Dn(y);try{await Rn(y,u,m)}catch{}if(await Promise.all([Un(y,n),zn(u,y,r.styleCache,n,m)]),n.compress)try{await tr(y,n,m)}catch{}for(let[b,w]of m.entries())ho(b,w);p.replaceWith(y),_u(p,r);for(let[b,w]of m.entries())r.nodeMap.set(b,w),r.srcToClone.set(w,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 m=r.styleMap.get(u);if(!m)continue;let d=Au(m);if(!d)continue;let h=null,g=!1;for(let y in d)if(h||(h=getComputedStyle(p)),!ku(h.getPropertyValue(y),d[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())Mu(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,ba=new WeakSet,So=new WeakMap,Ru=64,an=new Map,wa=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],Fu=["(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 Tu(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":Fu.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function ca(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 la(t,e){if(e.disposed||(an.delete(t),an.set(t,e),an.size<=Ru))return;let[n,r]=an.entries().next().value;Sa(n,r)}function Sa(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 wa)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 xa(t){if(ba.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 fa(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(re(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 $u=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,Ne=t=>t&&(typeof t=="object"||typeof t=="function")?rr(t):"-";function Pu(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 Nu(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=Pu(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 ua(t){let e=String(t||"").trim();return e?$u.test(e)?!0:/^data:/i.test(e)?Nu(e):!1:!1}function Le(t){let e=String(t||"");if(ua(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(ua(n[1]??n[2]??n[3]))return!0;return!1}function da(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 va(i))if(Le(o.getAttribute?.("src"))||Le(o.getAttribute?.("href"))||Le(o.getAttribute?.("style"))||Le(t.styleMap?.get(o)))return!0;return!1}function va(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 va(o))i(s);e.scrollNodes=n}function pa(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",Tu(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 ha(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 ma(t){return t.map(e=>[Ne(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Lu(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 Iu(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:Lt(),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)re(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 wa)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return vo(t,e)||Ao(t,e),Mo(t,e),Co(t,e),e}var Wu=0,ga=new WeakMap;function rr(t){let e=ga.get(t);return e||(e="@"+ ++Wu,ga.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 ya(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 ka(t,e,n,r,i=null){let o=xo.get(t);o||(o=Iu(t),o.baselineSignature=ya(e,n.plugins),xo.set(t,o));let s=ya(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 A of o.observers)A.__flush(A.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 m=Qe(t);o.styleStamp!==m&&(o.styleStamp=m,o.dirty||o.dirtyAll());let d=pa(t,o),h=ha(t,o);d.animation=ma(h),o.renderState&&(!Pe(o.renderState,d,"style")&&(xe(),o.dirtyAll()),Pe(o.renderState,d,"scroll")||o.dirtyAll(),Pe(o.renderState,d,"controls")||(oe(t),o.dirtyAll()),!Pe(o.renderState,d,"images")&&!o.dirty&&o.dirtyAll());let g=Se();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Lt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let A=ca(t);o.geometry!==null&&A!==o.geometry&&(oe(t),o.dirtyAll()),o.geometry=A}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!Pe(o.renderState,d,"animation");try{let A=new Set;w&&h.length===0&&(A=null);for(let v of h){let M=v.playState==="running";if(!M&&!w)continue;M&&(b=!0),w=!0;let C=v.effect?.target;if(Lu(t,o,C)===t)A.add(C);else{A=null;break}}if(w&&A&&A.size&&o.retained){o.dirty=!0;for(let v of A)o.dirtyRoots&&o.dirtyRoots.add(v),oe(v)}else w&&!A&&o.dirtyAll()}catch{}let k=d.frameDriven,x=b||k;if(x&&(o.last=null),k&&o.dirtyAll(),!f&&!x&&!o.dirty&&o.last)return la(t,o),o.last;o.capturing=!0;let S=null;try{let A=null,v=!1,M=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){M=[...o.dirtyRoots];let C=await aa(t,o,n);C&&(A=await i(C),v=!0)}if(A||(f||(n.__retain=C=>{let R=new Map;for(let[_,T]of C.nodeMap.entries())R.set(T,_);S={...C,srcToClone:R}}),n.__tornSinceStart=()=>{for(let C of o.observers)for(let R of C.takeRecords())o.pending.push(R);return At(),o.torn||fa(o.pending)||Ke(t)!==l},A=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=da(S),Ao(t,o),Mo(t,o)):v&&(o.retainedFrameDriven||(o.retainedFrameDriven=da(o.retained,M)),Ao(t,o),Mo(t,o));let C=pa(t,o);C.animation=ma(ha(t,o));let R=["style","scroll","controls","images"];b||R.push("animation");let _=R.every(T=>Pe(d,C,T));o.renderState=C,o.styleEpoch=Lt(),o.styleStamp=Qe(t),o.geometry=ca(t),o.renderState.frameDriven?(ba.add(t),Sa(t,o)):_?!x&&!o.renderState.frameDriven&&(o.last=A,la(t,o)):(o.dirtyAll(),o.last=null)}return A}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let v of o.observers)for(let M of v.takeRecords())o.pending.push(M);At();let A=Ke(t);(o.torn||fa(o.pending)||A!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=A,o.styleEpoch=Lt(),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 Ma(t){sr=t}var Ou='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Eo=!1,cn=null,Ro=new WeakMap,Ca=!1;function _a(t,e){!Eo||!cn||e&&e.burst===!1||Ro.set(cn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Ea(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(Ou):null}function Aa(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=To(t);e&&(Ea(e),Fo(t,!1))}function Du(t){let e=To(t);e&&Ea(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&&!Ca&&(Ca=!0,sr(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Ra(){if(Eo||typeof document>"u"||typeof document.addEventListener!="function")return;Eo=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Aa,t),document.addEventListener("keydown",Aa,t),document.addEventListener("click",Du,t),document.addEventListener("pointerenter",Fo,t),document.addEventListener("focusin",Fo,t)}bt();function id(...t){return js(...t),X}async function sd(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 Uo(i,{...e||{},burst:!1})}finally{n.remove()}}var ad="3.1.0",X=Object.assign(Uo,{plugins:id,fromString:sd,version:ad,preCapture:Ra});Ma(Uo);var Bo=Symbol("snapdom.internal"),cd=Symbol("snapdom.internal.silent"),Ua=new Set(["png","jpeg","jpg","webp","svg"]);async function Uo(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=oa(e);n.element=t,n.invalidate&&xe(),qs(n,e&&e.plugins);let{stage:r,loweredBy:i}=Hs(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&&xa(t);return f&&_a(t,e),n.snap||(n.snap={toPng:(l,u)=>X.toPng(l,u),toSvg:(l,u)=>X.toSvg(l,u)}),f?ka(t,e,n,()=>X.capture(t,n,Bo),l=>Ha(l,n)):X.capture(t,n,Bo)}X.capture=async(t,e,n)=>{if(n!==Bo)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 ra(t,e);return Ha(r,e)};async function Ha(t,e){let n=e.needs||vt,r=$e(n,"render"),i=E=>zs(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||{},d=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),h=d?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=d?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.vbH,F=E.crop;F&&(L=Math.max(1,Math.min(L,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,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/$):V?E.width/L*(F?Math.max(1,g/h):1):z?E.height/$*(F?Math.max(1,h/g):1):(E.scale||1)*Math.max(h,g))*(E.dpr||1)<=l?c:u??(u=Zs(a(),f))},b=async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un));return $(c,{...E,...L||{},format:"png"})},w=()=>{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:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),x={img:async(E,L)=>{if(o)return b(E,L);let{toImg:$}=await Promise.resolve().then(()=>(Wo(),Io)),F={...E,...L||{}};return $(y(F),F)},svg:async(E,L)=>{if(o)return b(E,L);let{toSvg:$}=await Promise.resolve().then(()=>(Wo(),Io)),F={...E,...L||{}};return $(y(F),F)},canvas:async(E,L)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(Ie(),Ia)),F={...E,...L||{}};return $(y(F),F)},blob:async(E,L)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Do(),Wa)),F={...E,...L||{}};return $(y(F),F)},png:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"png"};return $(y(F),F)},jpeg:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"jpeg"};return $(y(F),F)},webp:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),un)),F={...E,...L||{},format:"webp"};return $(y(F),F)},download:async(E,L)=>{let{download:$}=await Promise.resolve().then(()=>(Ba(),Da)),F={...E,...L||{}};return $(y(F),F)}};if(!r)for(let E of Object.keys(x)){let L=E==="download"?"download()":`to${E.charAt(0).toUpperCase()}${E.slice(1)}()`;x[E]=async()=>{throw i(L)}}let S={};for(let E of["img","svg","canvas","blob","png","jpeg","webp"])S[E]=async L=>x[E](e,{..._(E,L||{}),[cd]:!0});S.jpg=S.jpeg;let A=E=>Object.defineProperty({...e,...E},"options",{value:e,configurable:!0}),v=A({artifacts:e.__artifacts||null,export:k(),exports:S}),M=await Xn("defineExports",v),C=Object.assign({},...M.filter(E=>E&&typeof E=="object").reverse()),R={...x,...C};R.jpeg&&!R.jpg&&(R.jpg=(E,L)=>R.jpeg(E,L));function _(E,L){let $=L||{},F={...e,...$},V=typeof $.type=="string"?$.type.toLowerCase():"",z=typeof $.format=="string"?$.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,N=Promise.resolve();async function O(E,L){let $=Object.freeze(L&&typeof L=="object"?{...L}:{}),F=async()=>{let z=R[E];if(!z)throw new Error(`[snapdom] Unknown export type: ${E}`);let q=_(E,$),B=A({artifacts:e.__artifacts||null,export:k({type:E,options:q,requestedOptions:$})}),Z=q.format,_t=q.type;await Xn("beforeExport",B,{format:E,options:q});let Wt=q.format!==Z?q.format:q.type!==_t?q.type:"",mt=typeof Wt=="string"?Wt.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 It("afterSnap",e)),st},V=N.then(F);return N=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(R)){let L="to"+E.charAt(0).toUpperCase()+E.slice(1);H[L]||(H[L]=$=>O(E,$))}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.0.1-dev.1
3
+ * v3.1.0
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 Vo(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function qo(t="soft"){t==="disabled"&&(P.computedStyle=new WeakMap,P.measureHints=new WeakMap,P.baseStyle=new ot(50),P.defaultStyle=new ot(64),P.image=new ot(100),P.background=new ot(100),P.resource=new ot(150),P.compress=new ot(50))}var ot,P,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)}},P={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 Zt(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 Ut(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 Ht(t){return t?.nodeType===1&&t.namespaceURI===Xa}function Pt(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 Yo(t,e,n){if(Nt.size>=Xo){let r=Date.now();for(let[i,o]of Nt)o.until<=r&&Nt.delete(i);for(;Nt.size>=Xo;)Nt.delete(Nt.keys().next().value)}Nt.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}",()=>Ut(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}${Ut(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Ko(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 Qo(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:([^,]*),(.*)$/)||[],w=/;base64/i.test(g)?atob(y):decodeURIComponent(y),k=new Uint8Array([...w].map(S=>S.charCodeAt(0))),x=new Blob([k],{type:(g||"").split(";")[0]||""});return{ok:!0,data:x,status:200,url:t,fromCache:!1,mime:x.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 Ko(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=Nt.get(c);if(f&&f.until>Date.now())return{...f.result,fromCache:!0};f&&Nt.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 m=new AbortController,d=setTimeout(()=>m.abort("timeout"),r),h=(async()=>{try{let g=await fetch(u,{signal:m.signal,credentials:p,headers:s});if(!g.ok){let w={ok:!1,data:null,status:g.status,url:u,fromCache:!1,reason:"http_error"};if(c!==null&&o>0&&Yo(c,w,o),!a){let k=`${g.status} ${g.statusText||""}`.trim();Go.warnOnce(`http:${g.status}:${n}:${Qo(t)}`,`HTTP error ${k} while fetching ${n} ${t}`)}return vr(e,w),w}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 Ko(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=m.signal.aborted?m.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&&Yo(c,b,o),!a){let w=`${y}:${n}:${Qo(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`;Go.errorOnce(w,k)}return vr(e,b),b}finally{clearTimeout(d),xr.delete(c)}})();return c!==null&&xr.set(c,h),h}var Go,xr,Xo,Nt,de=ct(()=>{"use strict";bt();Go=Ya("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),xr=new Map,Xo=50,Nt=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)??Zt(t);if(!r)return t;let i=br(r),o=Ut(i),s=(e.useProxy||"")+"|"+o;if(P.background.has(s)){let a=P.background.get(s);return a?`url("${a}")`:"none"}try{let a=await it(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(P.background.set(s,a.data),`url("${a.data}")`):(P.background.set(s,null),"none")}catch{return P.background.set(s,null),"none"}}var Jo=ct(()=>{"use strict";dt();bt();de()});function sc(t){let e=t.replace(ic,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function ei(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||ti.test(a)||a.includes("+")||a.includes("~")))for(let c of Ar(a,",")){let f=c.trim();f&&(r.inContainer||ti.test(f)||f.includes("+")||f.includes("~"))&&r.shareUnsafeSels.add(f)}if(a&&a.includes(":"))for(let c in Zo)Zo[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=ei(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?ei(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 ni(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 ri(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]=ri(n,o)}return r}function oi(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=ri(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,Zo,ic,ti,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,Zo={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;ti=/:(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 ii.add(t),t.setAttribute("data-snapdom-internal",""),t}function zt(t){return ii.has(t)}var ii,wt=ct(()=>{"use strict";ii=new WeakSet});function _r(t){if(t=String(t).toLowerCase(),Ge.has(t)){let o={};return P.defaultStyle.set(t,o),o}if(P.defaultStyle.has(t))return P.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(zt);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);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),P.defaultStyle.set(t,i),i}function he(t){let e=si.get(t);if(e===void 0){let n=String(t).toLowerCase();e=uc.has(n)||fc.test(n)||lc.test(n),si.set(t,e)}return e}function ci(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)||ai.has(t))}function Er(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||ai.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),m=!1;for(let d in t){if(he(d)||ci(d,t))continue;let h=t[d];if(p){if(hc.has(d))continue;if(mc.has(d)){h&&h!==o[d]&&(i.push(`${d}:${h}`),h!=="auto"&&(m=!0));continue}}if(h&&h!==o[d]){if(!l&&(d==="width"||d==="inline-size")&&h.endsWith("px")&&h.includes(".")){let g=parseFloat(h);if(Number.isFinite(g)){i.push(`${d}:${(g+yc).toFixed(3)}px`);continue}}i.push(`${d}:${h}`)}}if(p&&!a&&!r&&!m){let d=t.width;d&&d!=="auto"&&d!==o.width&&i.push(`min-width:${d}`)}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])=>!ci(p,a)).map(([p,m])=>`${p}:${m};`).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
- }`,ru=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Ft=null,ou=0,iu=0,ce=new Map;function ra(){for(let t of ce.values())t(void 0);if(ce.clear(),Array.isArray(Ft))for(let t of Ft)try{t?.terminate()}catch{}Ft=!1}function su(){let t,e=null;try{t=URL.createObjectURL(new Blob([nu],{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 au(){if(Ft===!1)return!1;if(Ft===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Ft=!1;Ft=[]}let t=ou++%ru;if(!Ft[t]){let e=su();if(!e)return ra(),!1;Ft[t]=e}return Ft[t]}var cu=5e3;function lu(t,e,n,r,i){let o=au();return o?new Promise(s=>{let a=++iu,c=setTimeout(()=>{ce.delete(a),s(void 0)},cu);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 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=P.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=Qf(t),u=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=eu(t);if(p&&p.w>0&&p.h>0&&!Qs(p.w,p.h,e,n))return null;if(t.length>=Jf){let S=await lu(t,e,n,u,r);if(S!==void 0)return S}let m;try{m=await Kf(t)}catch{return null}let d=m.naturalWidth||m.width,h=m.naturalHeight||m.height;if(!d||!h)return null;let g=Qs(d,h,e,n);if(!g)return null;let y=g*na,b=Math.max(1,Math.round(d*y)),w=Math.max(1,Math.round(h*y)),k=document.createElement("canvas");k.width=b,k.height=w;let x=k.getContext("2d");if(!x)return null;x.imageSmoothingEnabled=!0,x.imageSmoothingQuality="high",x.drawImage(m,0,0,b,w);try{let S=k.toDataURL(u,ea);if(typeof S=="string"&&S.startsWith("data:image")&&S.length<t.length)return S}catch{}return null})(),f={source:t,promise:c,cache:o};Qn.set(i,f);try{let l=await c;return Zf(o,i,t,l),l}finally{Qn.get(i)===f&&Qn.delete(i)}}async function fu(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,m=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!m)return;let d=r.value||=wo(t,e),h=d.density*d.stretch(n.get(l)||l),g=await So(u,p*h,m*h,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 uu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function du(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function pu(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(v=>v.trim()!=="no-repeat"))return;let m=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(m.split(",").some(v=>!uu.test(v.trim())))return;let{w:d,h}=du(l);if(!d||!h)return;let g=Math.max(1,...(m.match(/\d+(?:\.\d+)?%/g)||[]).map(v=>parseFloat(v)/100)),y=r.value||=wo(t,e),b=y.density*y.stretch(l)*g,w=d*b,k=h*b,x=f.style.backgroundImage,S=[...x.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],A=x;for(let v of S){let M=v[2];if(M.startsWith("data:image/svg"))continue;let C=await So(M,w,k);C&&(A=A.split(M).join(C),s++)}A!==x&&(f.style.setProperty("background-image",A,f.style.getPropertyPriority("background-image")),Jn(f,"style","background-image",x,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 hu(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),m=p?W(p):c.style,d=(k,x)=>{if(/^\d+(?:\.\d+)?px$/.test(m?.[k]||""))return parseFloat(m[k]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(x.trim()))return parseFloat(x);try{return p?.[k]?.baseVal?.value||0}catch{return 0}},h=d("width",l),g=d("height",u);if(!h||!g)return;let y=r.value||=wo(t,e),b=y.density*y.stretch(p||c),w=await So(f,h*b,g*b);w&&(c.setAttribute("href",w),Jn(c,"attribute","href",f,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(Js,"xlink:href",w),Jn(c,"attribute","xlink:href",f,w,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 fu(t,e,n,r),await pu(t,e,n,r),await hu(t,e,n,r)}ht();dt();wt();function mu(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=gu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let p=new Map,m=0,d=[],h=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let w=p.get(b);return w===void 0&&(w="i"+(m++).toString(36),p.set(b,w),d.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,h):y.text;return t.slice(0,n)+d.join("")+g}function gu(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;Is(t,s),await It("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)),m=Math.max(1,I(t.element.offsetHeight||parseFloat(l.height)||u.height||1)),d=t.element.ownerDocument||document;if(!n&&(t.element===d.body||t.element===d.documentElement)&&!t.__pinned){let K=Math.max(t.element.scrollHeight||0,d.documentElement?.scrollHeight||0,d.body?.scrollHeight||0),tt=Math.max(t.element.scrollWidth||0,d.documentElement?.scrollWidth||0,d.body?.scrollWidth||0);K>0&&(m=Math.max(m,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=P.measureHints.get(t.element);if(et&&et.cssLen===Q&&et.w0===p&&et.docH===K&&et.docW===tt)et.csh>0&&(m=Math.max(m,I(et.csh))),et.csw>0&&(p=Math.max(p,I(et.csw)));else{let nt=d.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 Qt=nt.attachShadow({mode:"open"}),Jt=d.createElement("style");Jt.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,Qt.appendChild(Jt),Qt.appendChild(t.clone.cloneNode(!0)),d.body.appendChild(nt);let ze=nt.scrollHeight,Bt=nt.scrollWidth;d.body.removeChild(nt),P.measureHints.set(t.element,{cssLen:Q,w0:p,docH:K,docW:tt,csh:ze,csw:Bt}),ze>0&&(m=Math.max(m,I(ze))),Bt>0&&(p=Math.max(p,I(Bt)))}}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,m*.15);Number.isFinite(Q)&&Q>=m-et&&Number.isFinite(K)&&K>0&&(m=Math.max(1,Math.min(m,I(K+tt))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Ls(t.element,t.clone,K,t.nodeMap,p,m)}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),w=n?I(n.width):p,k=n?I(n.height):m,x=w,S=k,A=Number.isFinite(y),v=Number.isFinite(b),M=k>0?w/k:1;A&&v?(x=Math.max(1,I(y)),S=Math.max(1,I(b))):A?(x=Math.max(1,I(y)),S=Math.max(1,I(x/(M||1)))):v&&(S=Math.max(1,I(b)),x=Math.max(1,I(S*(M||1))));let C=0,R=0,_=p,T=m;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,m),Qt=Fe(p,m,Q,et,nt);K=Qt.minX,tt=Qt.minY}}C=I(n.x+K),R=I(n.y+tt),_=I(C+n.width),T=I(R+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,m,K,0,0);C=I(tt.minX),R=I(tt.minY),_=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=Yt({baseTransform:tt,rotate:Q.rotate||"0deg",scale:Q.scale,translate:Q.translate,width:p,height:m}),{ox:nt,oy:Qt}=an(l,p,m),Jt=et.is2D?et:new DOMMatrix(et.toString()),ze={a:Jt.a,b:Jt.b,c:Jt.c,d:Jt.d,e:0,f:0},Bt=Fe(p,m,ze,nt,Qt);C=I(Bt.minX),R=I(Bt.minY),_=I(Bt.maxX),T=I(Bt.maxY)}let N=oo(l),O=io(l),H=so(l),E=ao(l),L=co(l),$=u.width>0?(_-C)/u.width:1,F=u.height>0?(T-R)/u.height:1,V=i==="subtree"&&!n?ks(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},z=n?{top:0,right:0,bottom:0,left:0}:i?{top:I(Math.max(N.top,O.top,V.top)+H.top+E.top+L.bleed.top),right:I(Math.max(N.right,O.right,V.right)+H.right+E.right+L.bleed.right),bottom:I(Math.max(N.bottom,O.bottom,V.bottom)+H.bottom+E.bottom+L.bleed.bottom),left:I(Math.max(N.left,O.left,V.left)+H.left+E.left+L.bleed.left)}:{top:H.top,right:H.right,bottom:H.bottom,left:H.left};C=I(C-z.left),R=I(R-z.top),_=I(_+z.right),T=I(T+z.bottom);let q=Math.max(1,I(_-C)),B=Math.max(1,I(T-R)),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),$t=I(-(I(C)-gt)),U=I(-(I(R)-gt)),G=Math.max(0,$t),j=Math.max(0,U),ut=I(st-Math.min(0,$t)),Et=I(at-Math.min(0,U)),yt=document.createElementNS(Z,"foreignObject");yt.setAttribute("x",String(Math.min(0,$t))),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),Ot=A||v,pr=Object.freeze({w0:w,h0:k,vbW:st,vbH:at,targetW:x,targetH:S,contentX:I($t+(n?C:0)),contentY:I(U+(n?R:0)),clip:n?Object.freeze({x:I(C),y:I(R),width:w,height:k}):null});Object.defineProperty(a,"meta",{value:pr,enumerable:!0,writable:!1,configurable:!0});let hr=!Ot||Y()?st:A?x:I(st*(S/at)),mn=!Ot||Y()?at:v?S:I(at*(x/st)),Dt=parseFloat(W(d.documentElement)?.fontSize)||16;f=`<svg xmlns="${Z}" width="${hr}" height="${mn}" viewBox="0 0 ${st} ${at}" font-size="${Dt}px">`+mu(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 It("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let mr=[...document.querySelectorAll("#snapdom-sandbox")].find(zt);return mr&&mr.style.position==="absolute"&&mr.remove(),t.dataURL}function xo(t){return As(t)}function yu(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 oa(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=yu(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,m=n.format,d=n.type;await It("beforeSnap",n);let h=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==d&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(h||g){let _=String(h?n.format:n.type).toLowerCase();n.format=_==="jpg"?"jpeg":_,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await It("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?Bn(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=xi(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let k=fi(e.fast);for(;;){e.__slicer=k;let _=Xn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:f}=await Ws(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"),P.warnedReconcile||(P.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=Cs(n.element,r)),!b&&r&&Ts(n.element,r,n.options),r&&(Ps(n.element,r,a),$s(n.element,r))}finally{_()}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 It("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{Ns(n.element,n.clone,n.styleCache,n.nodeMap)}catch(_){xt(e.__session,"shrink-failed","shrink pass failed",_),console.warn("[snapdom] shrink pass failed:",_)}try{await Tn(n.clone,n.element,n.nodeMap)}catch{}let x=_=>Promise.resolve().then(_),S=(async()=>{await Promise.all([x(()=>zn(n.clone,n.options)),x(()=>Vn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Bs(n.element,n.clone,n.nodeMap)}catch(_){xt(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",_),console.warn("[snapdom] backdrop-filter emulation failed:",_)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await x(()=>er(n.clone,n.options,n.nodeMap))),e.captureSelection)try{Gi(n.nodeMap)}catch(_){xt(e.__session,"selection-compose-failed","field selection compose failed",_)}})(),A=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(A=x(async()=>{let _=n.element.ownerDocument||document,T=w?H=>{try{let E=H.getBoundingClientRect();return E.right>=w.left-200&&E.left<=w.right+200&&E.bottom>=w.top-200&&E.top<=w.bottom+200}catch{return!0}}:null,{required:N,usedCodepoints:O}=!w&&e.__fontUsage||Ln(n.element,T);if(e.embedFonts==="auto"){let H=new Set;try{for(let L of _.fonts)H.add(String(L.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(H.size>0&&Array.from(N).some(L=>H.has(String(L).split("__")[0].toLowerCase()))))return}if(Y()){let H=new Set(Array.from(N).map(E=>String(E).split("__")[0]).filter(Boolean));await In(H,1,_)}l=await as({required:N,usedCodepoints:O,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:_})})),await Promise.all([S,A]);let M=(n.options.plugins||[]).some(_=>_&&(typeof _.beforeRender=="function"||typeof _.afterRender=="function"));n.options.engine,k?.due()&&await k.pause();let C=n.clone;tr(C,e.__compressedAssets);let R=await nr(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:l});if(e.__compressedSnapshot=Zn(C,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 R}dt();bt();var bu=new Set(["png","jpeg","jpg","webp","svg"]);function ia(t={}){let e=typeof t.type=="string"&&bu.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=Vo(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:Qi(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();te();ht();var sa="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function wu(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var Su=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function xu(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(Su.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function vu(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 ku(t){let e=Lt(),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 Cu=1/16;function Au(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)<=Cu}var rr=new Map,Mu=["width","height","min-width","min-height"];function _u(t){let e=rr.get(t);if(e===void 0){e=null;for(let n of Mu){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 Eu(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function Ru(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 ca(t,e,n){vo.attempts++;try{let r=await Fu(t,e,n);return r&&vo.served++,r}catch{return null}}async function Fu(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||wu(t)||xu(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||ku(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)||vu(u,o))return null;let p=r.srcToClone.get(u);if(!p||!p.parentNode)return null;let m=new Map,d={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:m,options:n},h=Xn(u,null),g=Dn(u),y;try{y=await se(u,d,n)}finally{g(),h()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Re(u,y,d,n),d.__pseudoCSS))return null;await Mn(y,d),Un(y);try{await Tn(y,u,m)}catch{}if(await Promise.all([zn(y,n),Vn(u,y,r.styleCache,n,m)]),n.compress)try{await er(y,n,m)}catch{}for(let[b,w]of m.entries())mo(b,w);p.replaceWith(y),Ru(p,r);for(let[b,w]of m.entries())r.nodeMap.set(b,w),r.srcToClone.set(w,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 m=r.styleMap.get(u);if(!m)continue;let d=_u(m);if(!d)continue;let h=null,g=!1;for(let y in d)if(h||=getComputedStyle(p),!Au(h.getPropertyValue(y),d[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())Eu(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,wa=new WeakSet,ko=new WeakMap,Tu=64,ln=new Map,Sa=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],$u=["(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 Pu(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":$u.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||(ln.delete(t),ln.set(t,e),ln.size<=Tu))return;let[n,r]=ln.entries().next().value;xa(n,r)}function xa(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 Sa)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 va(t){if(wa.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 ua(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(re(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 Nu=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,We=t=>t&&(typeof t=="object"||typeof t=="function")?or(t):"-";function Lu(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 Iu(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=Lu(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?Nu.test(e)?!0:/^data:/i.test(e)?Iu(e):!1:!1}function Oe(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(Oe(o.getAttribute?.("src"))||Oe(o.getAttribute?.("href"))||Oe(o.getAttribute?.("style"))||Oe(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 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 ka(o))i(s);e.scrollNodes=n}function ha(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",Pu(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 ma(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 ga(t){return t.map(e=>[We(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Wu(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 Ou(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:Lt(),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)re(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 Ao(t,e)||Eo(t,e),Ro(t,e),_o(t,e),e}var Du=0,ya=new WeakMap;function or(t){let e=ya.get(t);return e||(e="@"+ ++Du,ya.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 ba(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 Ca(t,e,n,r,i=null){let o=Co.get(t);o||(o=Ou(t),o.baselineSignature=ba(e,n.plugins),Co.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,Ao(t,o),_o(t,o);for(let A of o.observers)A.__flush(A.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 m=tn(t);o.styleStamp!==m&&(o.styleStamp=m,o.dirty||o.dirtyAll());let d=ha(t,o),h=ma(t,o);d.animation=ga(h),o.renderState&&(!Ie(o.renderState,d,"style")&&(xe(),o.dirtyAll()),Ie(o.renderState,d,"scroll")||o.dirtyAll(),Ie(o.renderState,d,"controls")||(oe(t),o.dirtyAll()),!Ie(o.renderState,d,"images")&&!o.dirty&&o.dirtyAll());let g=Se();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Lt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let A=la(t);o.geometry!==null&&A!==o.geometry&&(oe(t),o.dirtyAll()),o.geometry=A}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!Ie(o.renderState,d,"animation");try{let A=new Set;w&&h.length===0&&(A=null);for(let v of h){let M=v.playState==="running";if(!M&&!w)continue;M&&(b=!0),w=!0;let C=v.effect?.target;if(Wu(t,o,C)===t)A.add(C);else{A=null;break}}if(w&&A&&A.size&&o.retained){o.dirty=!0;for(let v of A)o.dirtyRoots&&o.dirtyRoots.add(v),oe(v)}else w&&!A&&o.dirtyAll()}catch{}let k=d.frameDriven,x=b||k;if(x&&(o.last=null),k&&o.dirtyAll(),!f&&!x&&!o.dirty&&o.last)return fa(t,o),o.last;o.capturing=!0;let S=null;try{let A=null,v=!1,M=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){M=[...o.dirtyRoots];let C=await ca(t,o,n);C&&(A=await i(C),v=!0)}if(A||(f||(n.__retain=C=>{let R=new Map;for(let[_,T]of C.nodeMap.entries())R.set(T,_);S={...C,srcToClone:R}}),n.__tornSinceStart=()=>{for(let C of o.observers)for(let R of C.takeRecords())o.pending.push(R);return At(),o.torn||ua(o.pending)||Ze(t)!==l},A=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=pa(S),Eo(t,o),Ro(t,o)):v&&(o.retainedFrameDriven||=pa(o.retained,M),Eo(t,o),Ro(t,o));let C=ha(t,o);C.animation=ga(ma(t,o));let R=["style","scroll","controls","images"];b||R.push("animation");let _=R.every(T=>Ie(d,C,T));o.renderState=C,o.styleEpoch=Lt(),o.styleStamp=tn(t),o.geometry=la(t),o.renderState.frameDriven?(wa.add(t),xa(t,o)):_?!x&&!o.renderState.frameDriven&&(o.last=A,fa(t,o)):(o.dirtyAll(),o.last=null)}return A}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let v of o.observers)for(let M of v.takeRecords())o.pending.push(M);At();let A=Ze(t);(o.torn||ua(o.pending)||A!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=A,o.styleEpoch=Lt(),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 _a(t){ar=t}var Bu='button, a[href], [role="button"], input, select, summary, label, [tabindex]',To=!1,fn=null,$o=new WeakMap,Aa=!1;function Ea(t,e){!To||!fn||e&&e.burst===!1||$o.set(fn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Ra(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(Bu):null}function Ma(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=No(t);e&&(Ra(e),Po(t,!1))}function Uu(t){let e=No(t);e&&Ra(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&&!Aa&&(Aa=!0,ar(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Fa(){if(To||typeof document>"u"||typeof document.addEventListener!="function")return;To=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Ma,t),document.addEventListener("keydown",Ma,t),document.addEventListener("click",Uu,t),document.addEventListener("pointerenter",Po,t),document.addEventListener("focusin",Po,t)}wt();function ad(...t){return yo(...t),X}async function cd(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 jo(i,{...e||{},burst:!1})}finally{n.remove()}}var ld="3.0.1-dev.1",X=Object.assign(jo,{plugins:ad,fromString:cd,version:ld,preCapture:Fa});_a(jo);var zo=Symbol("snapdom.internal"),fd=Symbol("snapdom.internal.silent"),Ha=new Set(["png","jpeg","jpg","webp","svg"]);async function jo(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=ia(e);n.element=t,n.invalidate&&xe(),Xs(n,e&&e.plugins);let{stage:r,loweredBy:i}=js(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&&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,zo),l=>za(l,n)):X.capture(t,n,zo)}X.capture=async(t,e,n)=>{if(n!==zo)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");if(Pe(e.needs||ft,"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=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 oa(t,e);return za(r,e)};async function za(t,e){let n=e.needs||ft,r=Pe(n,"render"),i=E=>qs(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||{},d=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),h=d?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=d?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.vbH,F=E.crop;F&&(L=Math.max(1,Math.min(L,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,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/$):V?E.width/L*(F?Math.max(1,g/h):1):z?E.height/$*(F?Math.max(1,h/g):1):(E.scale||1)*Math.max(h,g))*(E.dpr||1)<=l?c:u??=ta(a(),f)},b=async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Be(),pn));return $(c,{...E,...L||{},format:"png"})},w=()=>{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:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),x={img:async(E,L)=>{if(o)return b(E,L);let{toImg:$}=await Promise.resolve().then(()=>(Bo(),Do)),F={...E,...L||{}};return $(y(F),F)},svg:async(E,L)=>{if(o)return b(E,L);let{toSvg:$}=await Promise.resolve().then(()=>(Bo(),Do)),F={...E,...L||{}};return $(y(F),F)},canvas:async(E,L)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(De(),Wa)),F={...E,...L||{}};return $(y(F),F)},blob:async(E,L)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Ho(),Oa)),F={...E,...L||{}};return $(y(F),F)},png:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"png"};return $(y(F),F)},jpeg:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"jpeg"};return $(y(F),F)},webp:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"webp"};return $(y(F),F)},download:async(E,L)=>{let{download:$}=await Promise.resolve().then(()=>(Ua(),Ba)),F={...E,...L||{}};return $(y(F),F)}};if(!r)for(let E of Object.keys(x)){let L=E==="download"?"download()":`to${E.charAt(0).toUpperCase()}${E.slice(1)}()`;x[E]=async()=>{throw i(L)}}let S={};for(let E of["img","svg","canvas","blob","png","jpeg","webp"])S[E]=async L=>x[E](e,{..._(E,L||{}),[fd]:!0});S.jpg=S.jpeg;let A=E=>Object.defineProperty({...e,...E},"options",{value:e,configurable:!0}),v=A({artifacts:e.__artifacts||null,export:k(),exports:S}),M=await Yn("defineExports",v),C=Object.assign({},...M.filter(E=>E&&typeof E=="object").reverse()),R={...x,...C};R.jpeg&&!R.jpg&&(R.jpg=(E,L)=>R.jpeg(E,L));function _(E,L){let $=L||{},F={...e,...$},V=typeof $.type=="string"?$.type.toLowerCase():"",z=typeof $.format=="string"?$.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,N=Promise.resolve();async function O(E,L){let $=Object.freeze(L&&typeof L=="object"?{...L}:{}),F=async()=>{let z=R[E];if(!z)throw new Error(`[snapdom] Unknown export type: ${E}`);let q=_(E,$),B=A({artifacts:e.__artifacts||null,export:k({type:E,options:q,requestedOptions:$})}),Z=q.format,_t=q.type;await Yn("beforeExport",B,{format:E,options:q});let Wt=q.format!==Z?q.format:q.type!==_t?q.type:"",gt=typeof Wt=="string"?Wt.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 It("afterSnap",e)),st},V=N.then(F);return N=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(R)){let L="to"+E.charAt(0).toUpperCase()+E.slice(1);H[L]||(H[L]=$=>O(E,$))}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());export{ft as DEFAULT_STAGE,$e as STAGES,Vs as assertNeeds,Vf as clearPlugins,bo as getGlobalPlugins,Le as normalizePlugin,yo as registerPlugins,X as snapdom};
39
+ }`,ru=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Ft=null,ou=0,iu=0,ce=new Map;function ra(){for(let t of ce.values())t(void 0);if(ce.clear(),Array.isArray(Ft))for(let t of Ft)try{t?.terminate()}catch{}Ft=!1}function su(){let t,e=null;try{t=URL.createObjectURL(new Blob([nu],{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 au(){if(Ft===!1)return!1;if(Ft===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Ft=!1;Ft=[]}let t=ou++%ru;if(!Ft[t]){let e=su();if(!e)return ra(),!1;Ft[t]=e}return Ft[t]}var cu=5e3;function lu(t,e,n,r,i){let o=au();return o?new Promise(s=>{let a=++iu,c=setTimeout(()=>{ce.delete(a),s(void 0)},cu);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 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=P.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=Qf(t),u=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=eu(t);if(p&&p.w>0&&p.h>0&&!Qs(p.w,p.h,e,n))return null;if(t.length>=Jf){let S=await lu(t,e,n,u,r);if(S!==void 0)return S}let m;try{m=await Kf(t)}catch{return null}let d=m.naturalWidth||m.width,h=m.naturalHeight||m.height;if(!d||!h)return null;let g=Qs(d,h,e,n);if(!g)return null;let y=g*na,b=Math.max(1,Math.round(d*y)),w=Math.max(1,Math.round(h*y)),k=document.createElement("canvas");k.width=b,k.height=w;let x=k.getContext("2d");if(!x)return null;x.imageSmoothingEnabled=!0,x.imageSmoothingQuality="high",x.drawImage(m,0,0,b,w);try{let S=k.toDataURL(u,ea);if(typeof S=="string"&&S.startsWith("data:image")&&S.length<t.length)return S}catch{}return null})(),f={source:t,promise:c,cache:o};Qn.set(i,f);try{let l=await c;return Zf(o,i,t,l),l}finally{Qn.get(i)===f&&Qn.delete(i)}}async function fu(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,m=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!m)return;let d=r.value||=wo(t,e),h=d.density*d.stretch(n.get(l)||l),g=await So(u,p*h,m*h,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 uu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function du(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function pu(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(v=>v.trim()!=="no-repeat"))return;let m=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(m.split(",").some(v=>!uu.test(v.trim())))return;let{w:d,h}=du(l);if(!d||!h)return;let g=Math.max(1,...(m.match(/\d+(?:\.\d+)?%/g)||[]).map(v=>parseFloat(v)/100)),y=r.value||=wo(t,e),b=y.density*y.stretch(l)*g,w=d*b,k=h*b,x=f.style.backgroundImage,S=[...x.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],A=x;for(let v of S){let M=v[2];if(M.startsWith("data:image/svg"))continue;let C=await So(M,w,k);C&&(A=A.split(M).join(C),s++)}A!==x&&(f.style.setProperty("background-image",A,f.style.getPropertyPriority("background-image")),Jn(f,"style","background-image",x,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 hu(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),m=p?W(p):c.style,d=(k,x)=>{if(/^\d+(?:\.\d+)?px$/.test(m?.[k]||""))return parseFloat(m[k]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(x.trim()))return parseFloat(x);try{return p?.[k]?.baseVal?.value||0}catch{return 0}},h=d("width",l),g=d("height",u);if(!h||!g)return;let y=r.value||=wo(t,e),b=y.density*y.stretch(p||c),w=await So(f,h*b,g*b);w&&(c.setAttribute("href",w),Jn(c,"attribute","href",f,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(Js,"xlink:href",w),Jn(c,"attribute","xlink:href",f,w,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 fu(t,e,n,r),await pu(t,e,n,r),await hu(t,e,n,r)}ht();dt();wt();function mu(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=gu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let p=new Map,m=0,d=[],h=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let w=p.get(b);return w===void 0&&(w="i"+(m++).toString(36),p.set(b,w),d.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,h):y.text;return t.slice(0,n)+d.join("")+g}function gu(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;Is(t,s),await It("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)),m=Math.max(1,I(t.element.offsetHeight||parseFloat(l.height)||u.height||1)),d=t.element.ownerDocument||document;if(!n&&(t.element===d.body||t.element===d.documentElement)&&!t.__pinned){let K=Math.max(t.element.scrollHeight||0,d.documentElement?.scrollHeight||0,d.body?.scrollHeight||0),tt=Math.max(t.element.scrollWidth||0,d.documentElement?.scrollWidth||0,d.body?.scrollWidth||0);K>0&&(m=Math.max(m,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=P.measureHints.get(t.element);if(et&&et.cssLen===Q&&et.w0===p&&et.docH===K&&et.docW===tt)et.csh>0&&(m=Math.max(m,I(et.csh))),et.csw>0&&(p=Math.max(p,I(et.csw)));else{let nt=d.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 Qt=nt.attachShadow({mode:"open"}),Jt=d.createElement("style");Jt.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,Qt.appendChild(Jt),Qt.appendChild(t.clone.cloneNode(!0)),d.body.appendChild(nt);let ze=nt.scrollHeight,Bt=nt.scrollWidth;d.body.removeChild(nt),P.measureHints.set(t.element,{cssLen:Q,w0:p,docH:K,docW:tt,csh:ze,csw:Bt}),ze>0&&(m=Math.max(m,I(ze))),Bt>0&&(p=Math.max(p,I(Bt)))}}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,m*.15);Number.isFinite(Q)&&Q>=m-et&&Number.isFinite(K)&&K>0&&(m=Math.max(1,Math.min(m,I(K+tt))))}if(t.options?.reconcile)try{let K=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Ls(t.element,t.clone,K,t.nodeMap,p,m)}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),w=n?I(n.width):p,k=n?I(n.height):m,x=w,S=k,A=Number.isFinite(y),v=Number.isFinite(b),M=k>0?w/k:1;A&&v?(x=Math.max(1,I(y)),S=Math.max(1,I(b))):A?(x=Math.max(1,I(y)),S=Math.max(1,I(x/(M||1)))):v&&(S=Math.max(1,I(b)),x=Math.max(1,I(S*(M||1))));let C=0,R=0,_=p,T=m;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,m),Qt=Fe(p,m,Q,et,nt);K=Qt.minX,tt=Qt.minY}}C=I(n.x+K),R=I(n.y+tt),_=I(C+n.width),T=I(R+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,m,K,0,0);C=I(tt.minX),R=I(tt.minY),_=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=Yt({baseTransform:tt,rotate:Q.rotate||"0deg",scale:Q.scale,translate:Q.translate,width:p,height:m}),{ox:nt,oy:Qt}=an(l,p,m),Jt=et.is2D?et:new DOMMatrix(et.toString()),ze={a:Jt.a,b:Jt.b,c:Jt.c,d:Jt.d,e:0,f:0},Bt=Fe(p,m,ze,nt,Qt);C=I(Bt.minX),R=I(Bt.minY),_=I(Bt.maxX),T=I(Bt.maxY)}let N=oo(l),O=io(l),H=so(l),E=ao(l),L=co(l),$=u.width>0?(_-C)/u.width:1,F=u.height>0?(T-R)/u.height:1,V=i==="subtree"&&!n?ks(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},z=n?{top:0,right:0,bottom:0,left:0}:i?{top:I(Math.max(N.top,O.top,V.top)+H.top+E.top+L.bleed.top),right:I(Math.max(N.right,O.right,V.right)+H.right+E.right+L.bleed.right),bottom:I(Math.max(N.bottom,O.bottom,V.bottom)+H.bottom+E.bottom+L.bleed.bottom),left:I(Math.max(N.left,O.left,V.left)+H.left+E.left+L.bleed.left)}:{top:H.top,right:H.right,bottom:H.bottom,left:H.left};C=I(C-z.left),R=I(R-z.top),_=I(_+z.right),T=I(T+z.bottom);let q=Math.max(1,I(_-C)),B=Math.max(1,I(T-R)),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),$t=I(-(I(C)-gt)),U=I(-(I(R)-gt)),G=Math.max(0,$t),j=Math.max(0,U),ut=I(st-Math.min(0,$t)),Et=I(at-Math.min(0,U)),yt=document.createElementNS(Z,"foreignObject");yt.setAttribute("x",String(Math.min(0,$t))),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),Ot=A||v,pr=Object.freeze({w0:w,h0:k,vbW:st,vbH:at,targetW:x,targetH:S,contentX:I($t+(n?C:0)),contentY:I(U+(n?R:0)),clip:n?Object.freeze({x:I(C),y:I(R),width:w,height:k}):null});Object.defineProperty(a,"meta",{value:pr,enumerable:!0,writable:!1,configurable:!0});let hr=!Ot||Y()?st:A?x:I(st*(S/at)),mn=!Ot||Y()?at:v?S:I(at*(x/st)),Dt=parseFloat(W(d.documentElement)?.fontSize)||16;f=`<svg xmlns="${Z}" width="${hr}" height="${mn}" viewBox="0 0 ${st} ${at}" font-size="${Dt}px">`+mu(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 It("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let mr=[...document.querySelectorAll("#snapdom-sandbox")].find(zt);return mr&&mr.style.position==="absolute"&&mr.remove(),t.dataURL}function xo(t){return As(t)}function yu(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 oa(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=yu(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,m=n.format,d=n.type;await It("beforeSnap",n);let h=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==d&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(h||g){let _=String(h?n.format:n.type).toLowerCase();n.format=_==="jpg"?"jpeg":_,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await It("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?Bn(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=xi(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let k=fi(e.fast);for(;;){e.__slicer=k;let _=Xn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:f}=await Ws(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"),P.warnedReconcile||(P.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=Cs(n.element,r)),!b&&r&&Ts(n.element,r,n.options),r&&(Ps(n.element,r,a),$s(n.element,r))}finally{_()}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 It("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{Ns(n.element,n.clone,n.styleCache,n.nodeMap)}catch(_){xt(e.__session,"shrink-failed","shrink pass failed",_),console.warn("[snapdom] shrink pass failed:",_)}try{await Tn(n.clone,n.element,n.nodeMap)}catch{}let x=_=>Promise.resolve().then(_),S=(async()=>{await Promise.all([x(()=>zn(n.clone,n.options)),x(()=>Vn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Bs(n.element,n.clone,n.nodeMap)}catch(_){xt(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",_),console.warn("[snapdom] backdrop-filter emulation failed:",_)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await x(()=>er(n.clone,n.options,n.nodeMap))),e.captureSelection)try{Gi(n.nodeMap)}catch(_){xt(e.__session,"selection-compose-failed","field selection compose failed",_)}})(),A=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(A=x(async()=>{let _=n.element.ownerDocument||document,T=w?H=>{try{let E=H.getBoundingClientRect();return E.right>=w.left-200&&E.left<=w.right+200&&E.bottom>=w.top-200&&E.top<=w.bottom+200}catch{return!0}}:null,{required:N,usedCodepoints:O}=!w&&e.__fontUsage||Ln(n.element,T);if(e.embedFonts==="auto"){let H=new Set;try{for(let L of _.fonts)H.add(String(L.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(H.size>0&&Array.from(N).some(L=>H.has(String(L).split("__")[0].toLowerCase()))))return}if(Y()){let H=new Set(Array.from(N).map(E=>String(E).split("__")[0]).filter(Boolean));await In(H,1,_)}l=await as({required:N,usedCodepoints:O,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:_})})),await Promise.all([S,A]);let M=(n.options.plugins||[]).some(_=>_&&(typeof _.beforeRender=="function"||typeof _.afterRender=="function"));n.options.engine,k?.due()&&await k.pause();let C=n.clone;tr(C,e.__compressedAssets);let R=await nr(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:l});if(e.__compressedSnapshot=Zn(C,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 R}dt();bt();var bu=new Set(["png","jpeg","jpg","webp","svg"]);function ia(t={}){let e=typeof t.type=="string"&&bu.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=Vo(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:Qi(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();te();ht();var sa="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function wu(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var Su=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function xu(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(Su.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function vu(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 ku(t){let e=Lt(),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 Cu=1/16;function Au(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)<=Cu}var rr=new Map,Mu=["width","height","min-width","min-height"];function _u(t){let e=rr.get(t);if(e===void 0){e=null;for(let n of Mu){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 Eu(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function Ru(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 ca(t,e,n){vo.attempts++;try{let r=await Fu(t,e,n);return r&&vo.served++,r}catch{return null}}async function Fu(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||wu(t)||xu(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||ku(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)||vu(u,o))return null;let p=r.srcToClone.get(u);if(!p||!p.parentNode)return null;let m=new Map,d={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:m,options:n},h=Xn(u,null),g=Dn(u),y;try{y=await se(u,d,n)}finally{g(),h()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Re(u,y,d,n),d.__pseudoCSS))return null;await Mn(y,d),Un(y);try{await Tn(y,u,m)}catch{}if(await Promise.all([zn(y,n),Vn(u,y,r.styleCache,n,m)]),n.compress)try{await er(y,n,m)}catch{}for(let[b,w]of m.entries())mo(b,w);p.replaceWith(y),Ru(p,r);for(let[b,w]of m.entries())r.nodeMap.set(b,w),r.srcToClone.set(w,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 m=r.styleMap.get(u);if(!m)continue;let d=_u(m);if(!d)continue;let h=null,g=!1;for(let y in d)if(h||=getComputedStyle(p),!Au(h.getPropertyValue(y),d[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())Eu(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,wa=new WeakSet,ko=new WeakMap,Tu=64,ln=new Map,Sa=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],$u=["(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 Pu(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":$u.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||(ln.delete(t),ln.set(t,e),ln.size<=Tu))return;let[n,r]=ln.entries().next().value;xa(n,r)}function xa(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 Sa)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 va(t){if(wa.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 ua(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(re(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 Nu=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,We=t=>t&&(typeof t=="object"||typeof t=="function")?or(t):"-";function Lu(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 Iu(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=Lu(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?Nu.test(e)?!0:/^data:/i.test(e)?Iu(e):!1:!1}function Oe(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(Oe(o.getAttribute?.("src"))||Oe(o.getAttribute?.("href"))||Oe(o.getAttribute?.("style"))||Oe(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 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 ka(o))i(s);e.scrollNodes=n}function ha(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",Pu(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 ma(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 ga(t){return t.map(e=>[We(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Wu(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 Ou(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:Lt(),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)re(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 Ao(t,e)||Eo(t,e),Ro(t,e),_o(t,e),e}var Du=0,ya=new WeakMap;function or(t){let e=ya.get(t);return e||(e="@"+ ++Du,ya.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 ba(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 Ca(t,e,n,r,i=null){let o=Co.get(t);o||(o=Ou(t),o.baselineSignature=ba(e,n.plugins),Co.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,Ao(t,o),_o(t,o);for(let A of o.observers)A.__flush(A.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 m=tn(t);o.styleStamp!==m&&(o.styleStamp=m,o.dirty||o.dirtyAll());let d=ha(t,o),h=ma(t,o);d.animation=ga(h),o.renderState&&(!Ie(o.renderState,d,"style")&&(xe(),o.dirtyAll()),Ie(o.renderState,d,"scroll")||o.dirtyAll(),Ie(o.renderState,d,"controls")||(oe(t),o.dirtyAll()),!Ie(o.renderState,d,"images")&&!o.dirty&&o.dirtyAll());let g=Se();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Lt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let A=la(t);o.geometry!==null&&A!==o.geometry&&(oe(t),o.dirtyAll()),o.geometry=A}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!Ie(o.renderState,d,"animation");try{let A=new Set;w&&h.length===0&&(A=null);for(let v of h){let M=v.playState==="running";if(!M&&!w)continue;M&&(b=!0),w=!0;let C=v.effect?.target;if(Wu(t,o,C)===t)A.add(C);else{A=null;break}}if(w&&A&&A.size&&o.retained){o.dirty=!0;for(let v of A)o.dirtyRoots&&o.dirtyRoots.add(v),oe(v)}else w&&!A&&o.dirtyAll()}catch{}let k=d.frameDriven,x=b||k;if(x&&(o.last=null),k&&o.dirtyAll(),!f&&!x&&!o.dirty&&o.last)return fa(t,o),o.last;o.capturing=!0;let S=null;try{let A=null,v=!1,M=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){M=[...o.dirtyRoots];let C=await ca(t,o,n);C&&(A=await i(C),v=!0)}if(A||(f||(n.__retain=C=>{let R=new Map;for(let[_,T]of C.nodeMap.entries())R.set(T,_);S={...C,srcToClone:R}}),n.__tornSinceStart=()=>{for(let C of o.observers)for(let R of C.takeRecords())o.pending.push(R);return At(),o.torn||ua(o.pending)||Ze(t)!==l},A=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=pa(S),Eo(t,o),Ro(t,o)):v&&(o.retainedFrameDriven||=pa(o.retained,M),Eo(t,o),Ro(t,o));let C=ha(t,o);C.animation=ga(ma(t,o));let R=["style","scroll","controls","images"];b||R.push("animation");let _=R.every(T=>Ie(d,C,T));o.renderState=C,o.styleEpoch=Lt(),o.styleStamp=tn(t),o.geometry=la(t),o.renderState.frameDriven?(wa.add(t),xa(t,o)):_?!x&&!o.renderState.frameDriven&&(o.last=A,fa(t,o)):(o.dirtyAll(),o.last=null)}return A}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let v of o.observers)for(let M of v.takeRecords())o.pending.push(M);At();let A=Ze(t);(o.torn||ua(o.pending)||A!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=A,o.styleEpoch=Lt(),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 _a(t){ar=t}var Bu='button, a[href], [role="button"], input, select, summary, label, [tabindex]',To=!1,fn=null,$o=new WeakMap,Aa=!1;function Ea(t,e){!To||!fn||e&&e.burst===!1||$o.set(fn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Ra(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(Bu):null}function Ma(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=No(t);e&&(Ra(e),Po(t,!1))}function Uu(t){let e=No(t);e&&Ra(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&&!Aa&&(Aa=!0,ar(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Fa(){if(To||typeof document>"u"||typeof document.addEventListener!="function")return;To=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",Ma,t),document.addEventListener("keydown",Ma,t),document.addEventListener("click",Uu,t),document.addEventListener("pointerenter",Po,t),document.addEventListener("focusin",Po,t)}wt();function ad(...t){return yo(...t),X}async function cd(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 jo(i,{...e||{},burst:!1})}finally{n.remove()}}var ld="3.1.0",X=Object.assign(jo,{plugins:ad,fromString:cd,version:ld,preCapture:Fa});_a(jo);var zo=Symbol("snapdom.internal"),fd=Symbol("snapdom.internal.silent"),Ha=new Set(["png","jpeg","jpg","webp","svg"]);async function jo(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=ia(e);n.element=t,n.invalidate&&xe(),Xs(n,e&&e.plugins);let{stage:r,loweredBy:i}=js(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&&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,zo),l=>za(l,n)):X.capture(t,n,zo)}X.capture=async(t,e,n)=>{if(n!==zo)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");if(Pe(e.needs||ft,"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=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 oa(t,e);return za(r,e)};async function za(t,e){let n=e.needs||ft,r=Pe(n,"render"),i=E=>qs(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||{},d=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!Y(),h=d?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=d?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.vbH,F=E.crop;F&&(L=Math.max(1,Math.min(L,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,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/$):V?E.width/L*(F?Math.max(1,g/h):1):z?E.height/$*(F?Math.max(1,h/g):1):(E.scale||1)*Math.max(h,g))*(E.dpr||1)<=l?c:u??=ta(a(),f)},b=async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Be(),pn));return $(c,{...E,...L||{},format:"png"})},w=()=>{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:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),x={img:async(E,L)=>{if(o)return b(E,L);let{toImg:$}=await Promise.resolve().then(()=>(Bo(),Do)),F={...E,...L||{}};return $(y(F),F)},svg:async(E,L)=>{if(o)return b(E,L);let{toSvg:$}=await Promise.resolve().then(()=>(Bo(),Do)),F={...E,...L||{}};return $(y(F),F)},canvas:async(E,L)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(De(),Wa)),F={...E,...L||{}};return $(y(F),F)},blob:async(E,L)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Ho(),Oa)),F={...E,...L||{}};return $(y(F),F)},png:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"png"};return $(y(F),F)},jpeg:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"jpeg"};return $(y(F),F)},webp:async(E,L)=>{let{rasterize:$}=await Promise.resolve().then(()=>(Be(),pn)),F={...E,...L||{},format:"webp"};return $(y(F),F)},download:async(E,L)=>{let{download:$}=await Promise.resolve().then(()=>(Ua(),Ba)),F={...E,...L||{}};return $(y(F),F)}};if(!r)for(let E of Object.keys(x)){let L=E==="download"?"download()":`to${E.charAt(0).toUpperCase()}${E.slice(1)}()`;x[E]=async()=>{throw i(L)}}let S={};for(let E of["img","svg","canvas","blob","png","jpeg","webp"])S[E]=async L=>x[E](e,{..._(E,L||{}),[fd]:!0});S.jpg=S.jpeg;let A=E=>Object.defineProperty({...e,...E},"options",{value:e,configurable:!0}),v=A({artifacts:e.__artifacts||null,export:k(),exports:S}),M=await Yn("defineExports",v),C=Object.assign({},...M.filter(E=>E&&typeof E=="object").reverse()),R={...x,...C};R.jpeg&&!R.jpg&&(R.jpg=(E,L)=>R.jpeg(E,L));function _(E,L){let $=L||{},F={...e,...$},V=typeof $.type=="string"?$.type.toLowerCase():"",z=typeof $.format=="string"?$.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,N=Promise.resolve();async function O(E,L){let $=Object.freeze(L&&typeof L=="object"?{...L}:{}),F=async()=>{let z=R[E];if(!z)throw new Error(`[snapdom] Unknown export type: ${E}`);let q=_(E,$),B=A({artifacts:e.__artifacts||null,export:k({type:E,options:q,requestedOptions:$})}),Z=q.format,_t=q.type;await Yn("beforeExport",B,{format:E,options:q});let Wt=q.format!==Z?q.format:q.type!==_t?q.type:"",gt=typeof Wt=="string"?Wt.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 It("afterSnap",e)),st},V=N.then(F);return N=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(R)){let L="to"+E.charAt(0).toUpperCase()+E.slice(1);H[L]||(H[L]=$=>O(E,$))}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());export{ft as DEFAULT_STAGE,$e as STAGES,Vs as assertNeeds,Vf as clearPlugins,bo as getGlobalPlugins,Le as normalizePlugin,yo as registerPlugins,X as snapdom};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zumer/snapdom",
3
- "version": "3.0.1-dev.1",
3
+ "version": "3.1.0",
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",