@zumer/snapdom 3.3.3 → 3.3.4
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 +11 -11
- package/dist/snapdom.mjs +11 -11
- package/package.json +1 -1
package/dist/snapdom.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* SnapDOM
|
|
3
|
-
* v3.3.
|
|
3
|
+
* v3.3.4
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
|
-
var uc=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 be=(t,e)=>{for(var n in e)uc(t,n,{get:e[n],enumerable:!0})};function ni(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function ri(t="soft"){t==="disabled"&&(I.computedStyle=new WeakMap,I.measureHints=new WeakMap,I.baseStyle=new lt(50),I.defaultStyle=new lt(64),I.image=new lt(100),I.background=new lt(100),I.resource=new lt(150),I.compress=new lt(50))}var lt,I,yt=ct(()=>{"use strict";lt=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)}},I={image:new lt(100),background:new lt(100),resource:new lt(150),defaultStyle:new lt(64),baseStyle:new lt(50),compress:new lt(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function re(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function pc(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 Ke(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 pc(n[1])){let s=o.match(/url\((['"]?)(.*?)(\1)\)/);if(!s)continue;let a=o.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!dc.test(a[1].trim()))continue;let c=o.replace(/url\((['"]?)[\s\S]*?\1\)/," ").match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)\b/i),u=1;if(c){let l=parseFloat(c[1]);u=/dpi/i.test(c[2])?l/96:l}r.push({url:s[2].trim(),dppx:u})}return r.length?(r.sort((o,s)=>o.dppx-s.dppx),(r.find(o=>o.dppx>=e)||r[r.length-1]).url):null}function Mr(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 qt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function Ar(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 _r(t){return"\u2022".repeat(String(t??"").length)}function it(t,e){return t?.nodeType===1&&t.localName===e}function Rt(t){return t?.nodeType===1&&t.namespaceURI===hc}function It(t){return t?.nodeType===1&&t.namespaceURI===mc}function Ot(t){return t?.nodeType===11&&!!t.host}function Er(t){return t?.nodeType===9}var kr,dc,hc,mc,kt=ct(()=>{"use strict";kr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,dc=kr;hc="http://www.w3.org/1999/xhtml",mc="http://www.w3.org/2000/svg"});function gc(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 u=Date.now();(r.get(a)||0)>u||(r.set(a,u+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 si(t,e,n){if(Dt.size>=ii){let r=Date.now();for(let[i,o]of Dt)o.until<=r&&Dt.delete(i);for(;Dt.size>=ii;)Dt.delete(Dt.keys().next().value)}Dt.set(t,{until:Date.now()+n,result:e})}function yc(t){return/^data:|^blob:|^about:blank$/i.test(t)}function bc(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 wc(t,e){if(!e||yc(t)||bc(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 Sc(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>qt(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}${qt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function ai(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 xc(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 ci(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function Fr(t,e){try{t.onError?.(e)}catch{}}async function ft(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),v=new Uint8Array([...w].map(S=>S.charCodeAt(0))),C=new Blob([v],{type:(g||"").split(";")[0]||""});return{ok:!0,data:C,status:200,url:t,fromCache:!1,mime:C.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 ai(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=xc(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 Fr(e,g),g}let u=Dt.get(c);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&Dt.delete(c);let l=Rr.get(c);if(l)return l;let f=wc(t,i)?Sc(t,i):t,d=e.credentials;if(!d)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,g);d=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{d="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),r),p=(async()=>{try{let g=await fetch(f,{signal:h.signal,credentials:d,headers:s});if(!g.ok){let w={ok:!1,data:null,status:g.status,url:f,fromCache:!1,reason:"http_error"};if(c!==null&&o>0&&si(c,w,o),!a){let v=`${g.status} ${g.statusText||""}`.trim();oi.warnOnce(`http:${g.status}:${n}:${ci(t)}`,`Couldn't load ${t} (HTTP ${v}).`)}return Fr(e,w),w}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:f,fromCache:!1};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await ai(y),blob:y,status:g.status,url:f,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:f,fromCache:!1,mime:b}}catch(g){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":g&&typeof g=="object"&&g.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:y};if(c!==null&&!/^blob:/i.test(t)&&o>0&&si(c,b,o),!a){let w=`${y}:${n}:${ci(t)}`,v=y==="timeout"?`Timed out loading ${t} after ${r}ms. Raise the timeout option or set useProxy.`:y==="abort"?`Loading ${t} was cancelled.`:`Couldn't load ${t} (network or CORS). Try the useProxy option.`;oi.errorOnce(w,v)}return Fr(e,b),b}finally{clearTimeout(m),Rr.delete(c)}})();return c!==null&&Rr.set(c,p),p}var oi,Rr,ii,Dt,we=ct(()=>{"use strict";kt();oi=gc("[SnapDOM]",{ttlMs:3*6e4,maxEntries:10}),Rr=new Map,ii=50,Dt=new Map});async function Se(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=Ke(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??re(t);if(!r)return t;let i=Ar(r),o=qt(i),s=(e.useProxy||"")+"|"+o;if(I.background.has(s)){let a=I.background.get(s);return a?`url("${a}")`:"none"}try{let a=await ft(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(I.background.set(s,a.data),`url("${a.data}")`):(I.background.set(s,null),"none")}catch{return I.background.set(s,null),"none"}}var li=ct(()=>{"use strict";yt();kt();we()});function _c(t){let e=t.replace(Ac,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function di(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&&kc.test(o.selectorText);for(let u=0;u<s.length;u++){let l=s[u];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 f=l.startsWith("margin")?"marginUnstable":l.startsWith("padding")?"paddingUnstable":null;f&&!r[f]&&Mc.test(s.getPropertyValue(l))&&(r[f]=!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||ui.test(a)||a.includes("+")||a.includes("~")))for(let c of $r(a,",")){let u=c.trim();u&&(r.inContainer||ui.test(u)||u.includes("+")||u.includes("~"))&&r.shareUnsafeSels.add(u)}if(a&&a.includes(":"))for(let c in fi)fi[c].test(a)&&n[c].push(_c(a));if(o.styleSheet){if(!Sn(o.styleSheet,e,n,r))return!1}else if(o.cssRules&&o.cssRules.length){let c=o.constructor?.name==="CSSContainerRule";c&&r.inContainer++;let u=di(o.cssRules,e,n,r);if(c&&r.inContainer--,!u)return!1}}return!0}function Sn(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?di(i,e,n,r):!1}function Pr(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 pi(t){let e=new Set;return Sn(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 $r(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 Ec(t){let e=0,n=null,r=0;for(let l=0;l<t.length;l++){let f=t[l];if(n){f===n&&t[l-1]!=="\\"&&(n=null);continue}f==='"'||f==="'"?n=f:f==="("||f==="["?e++:f===")"||f==="]"?e--:e===0&&(f===" "||f===">"||f==="+"||f==="~")&&(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 u=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return u?"t"+u.toLowerCase():null}function hi(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 Rc(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]=hi(n,o)}return r}function mi(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(Tr),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 u of t.styleSheets)if(!Sn(u,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let u of o)if(!Sn(u,n,r,i))return e}typeof t.getAnimations=="function"&&Pr(t.getAnimations(),n);let s=Array.from(i.shareUnsafeSels),a=hi(t.createElement("div"),s)===null?null:s.map(u=>({sel:u,key:Ec(u)})),c=new Set(Cc);for(let u of vc)n.has(u)&&c.add(u);for(let u of i.pseudoProps)c.add(u);return(i.pseudoProps.has("transform")||i.pseudoProps.has("rotate")||i.pseudoProps.has("scale"))&&c.add("transform-origin"),i.pseudoProps.has("perspective")&&c.add("perspective-origin"),{universe:n,pseudoUniverse:c,pseudoGates:Rc(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var Tr,vc,Cc,kc,Mc,fi,Ac,ui,xn=ct(()=>{"use strict";Tr=["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"],vc=["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"],Cc=["display","width","height","min-width","min-height"],kc=/::?(?:before|after|first-letter|first-line|marker)/,Mc=/%|\bauto\b|calc\(|var\(/i,fi={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Ac=/::?(?:before|after|first-letter|first-line|marker)\b/g;ui=/:(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 Z(t){return gi.add(t),t.setAttribute("data-snapdom-internal",""),t}function Gt(t){return gi.has(t)}var gi,Mt=ct(()=>{"use strict";gi=new WeakSet});function Lr(t){if(t=String(t).toLowerCase(),Je.has(t)){let o={};return I.defaultStyle.set(t,o),o}if(I.defaultStyle.has(t))return I.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(Gt);e||(e=document.createElement("div"),Z(e),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t.includes("-")?"span":t);n.style.all="initial",e.appendChild(n);let r=getComputedStyle(n),i={};for(let o of r){if(xe(o))continue;let s=r.getPropertyValue(o);i[o]=s}for(let o of Tr)!(o in i)&&!xe(o)&&(i[o]=r.getPropertyValue(o));return e.removeChild(n),I.defaultStyle.set(t,i),i}function xe(t){let e=yi.get(t);if(e===void 0){let n=String(t).toLowerCase();e=Pc.has(n)||Tc.test(n)||Fc.test(n),yi.set(t,e)}return e}function wi(t,e){let n=Oc.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 vn(t,e){return!Nc.has(t)&&(e==="inline"||$c.has(t)||bi.has(t))}function Ir(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||bi.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:!Wc.has(r)}function ve(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),Je.has(e))return"";let i=[],o=Lr(e),s=(t.display||"").toLowerCase(),a=s==="inline",c=vn(e,s),u=t["text-wrap-mode"]||t["white-space"]||"",l=u==="nowrap"||u==="pre",d=c&&n&&!(c&&n&&!a&&l),h=!1;for(let m in t){if(xe(m)||wi(m,t))continue;let p=t[m];if(d){if(Lc.has(m))continue;if(Ic.has(m)){p&&p!==o[m]&&(i.push(`${m}:${p}`),p!=="auto"&&(h=!0));continue}}if(p&&p!==o[m]){if(!l&&(m==="width"||m==="inline-size")&&p.endsWith("px")&&p.includes(".")){let g=parseFloat(p);if(Number.isFinite(g)){i.push(`${m}:${(g+Dc).toFixed(3)}px`);continue}}i.push(`${m}:${p}`)}}if(d&&!a&&!r&&!h){let m=t.width;m&&m!=="auto"&&m!==o.width&&i.push(`min-width:${m}`)}return i.sort(),i.join(";")}function Or(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 Dr(t,e=null){let n=new Map;for(let s of t){let a=Lr(s);if(!a)continue;let l=(e?Object.entries(a).filter(([d])=>e.has(d)):Object.entries(a)).filter(([d])=>!wi(d,a)).map(([d,h])=>`${d}:${h};`).sort(),f=l.join("");f&&(n.has(f)||n.set(f,{tagList:[],declarations:l}),n.get(f).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("")} }
|
|
7
|
-
`}for(let{tagList:s,declarations:a}of r){let
|
|
8
|
-
`}return o}function Ze(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let i of e)n.set(i,`c${r++}`);return n}function Bc(t){try{let e=t?.ownerDocument;if(!e)return typeof window<"u"?window:null;let n=e.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let r=0;r<window.frames.length;r++)try{if(window.frames[r]?.document===e)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function O(t,e=null){let n=()=>{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(t?.nodeType!==1){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(t,e)||n()}catch{return n()}return n()}let r=I.computedStyle.get(t);r||(r=new Map,I.computedStyle.set(t,r));let i=r.get(e);if(!i){let o=Bc(t),s=null;try{s=o&&typeof o.getComputedStyle=="function"?o.getComputedStyle(t,e):null}catch{}if(!s&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(s=window.getComputedStyle(t,e))}catch{}i=s||n(),r.set(e,i)}return i}function Ce(t,e=null){let n={};for(let r of e||t){let i=t.getPropertyValue(r);i&&(n[r]=i)}for(let r of Uc){let i=n[`border-${r}-style`],o=n[`border-${r}-width`];(i==="none"||i==="hidden"||o==="0px")&&(delete n[`border-${r}-style`],delete n[`border-${r}-width`],delete n[`border-${r}-color`])}return n}function Xt(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,i).trim()),r=i+1)}return e.push(t.slice(r).trim()),e}var Nr,Je,Fc,Tc,Pc,yi,$c,bi,Nc,Lc,Ic,Oc,Dc,Wc,Uc,ke=ct(()=>{"use strict";yt();xn();Mt();Nr=new Set(["meta","script","noscript","title","link","template"]),Je=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);Fc=/(?:^|-)(animation|transition)(?:-|$)/i,Tc=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Pc=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom","stroke-color"]),yi=new Map;$c=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),bi=new Set(["table","thead","tbody","tfoot","tr","td","th"]),Nc=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),Lc=new Set(["width","max-width","inline-size","max-inline-size"]),Ic=new Set(["min-width","min-inline-size"]),Oc=new Map(Object.entries({"block-size":"height","inline-size":"width","min-block-size":"min-height","min-inline-size":"min-width","max-block-size":"max-height","max-inline-size":"max-width","margin-block-start":"margin-top","margin-block-end":"margin-bottom","margin-inline-start":"margin-left","margin-inline-end":"margin-right","padding-block-start":"padding-top","padding-block-end":"padding-bottom","padding-inline-start":"padding-left","padding-inline-end":"padding-right","inset-block-start":"top","inset-block-end":"bottom","inset-inline-start":"left","inset-inline-end":"right","border-block-start-width":"border-top-width","border-block-start-style":"border-top-style","border-block-start-color":"border-top-color","border-block-end-width":"border-bottom-width","border-block-end-style":"border-bottom-style","border-block-end-color":"border-bottom-color","border-inline-start-width":"border-left-width","border-inline-start-style":"border-left-style","border-inline-start-color":"border-left-color","border-inline-end-width":"border-right-width","border-inline-end-style":"border-right-style","border-inline-end-color":"border-right-color","border-start-start-radius":"border-top-left-radius","border-start-end-radius":"border-top-right-radius","border-end-start-radius":"border-bottom-left-radius","border-end-end-radius":"border-bottom-right-radius","overflow-block":"overflow-y","overflow-inline":"overflow-x","overscroll-behavior-block":"overscroll-behavior-y","overscroll-behavior-inline":"overscroll-behavior-x","contain-intrinsic-block-size":"contain-intrinsic-height","contain-intrinsic-inline-size":"contain-intrinsic-width"}));Dc=.001;Wc=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);Uc=["top","right","bottom","left"]});function bt(t=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(e=>{let n=!1,r=()=>{n||(n=!0,e())};try{requestAnimationFrame(r)}catch{r();return}setTimeout(r,t)})}function xi(t){if(t!==!1&&t!=="auto")return null;let e=performance.now()+(t==="auto"?zc:Si),n=null,r={yielded:!1,due:()=>performance.now()>=e,pause:()=>n||(n=new Promise(i=>{let o=()=>{n=null,r.yielded=!0,e=performance.now()+Si,i()},s=new MessageChannel;s.port1.onmessage=o,s.port2.postMessage(0)}))};return r}function tn(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let t=navigator.userAgent||"",e=/iPhone|iPad|iPod/.test(t),n=navigator.maxTouchPoints>2&&/Macintosh/.test(t);return e||n}function X(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),r=/applewebkit/i.test(t),i=/mobile/i.test(t),o=!/safari/i.test(t),s=r&&i&&o,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),u=/ipad|iphone|ipod/.test(e)&&r;return n||s||a||c||u}function wt(){return typeof navigator>"u"?!1:(navigator.userAgent||"").toLowerCase().includes("firefox")}var Si,zc,mt=ct(()=>{"use strict";Si=16,zc=40});function H(t,e,n){let r=t&&typeof t=="object"&&(t.options||t);r&&r.debug&&(n!==void 0?console.warn("[SnapDOM]",e,n):console.warn("[SnapDOM]",e))}function At(t,e,n,r){let i=t&&t.warnings;i&&i.length<Hc&&i.push(r===void 0?{code:e,message:n}:{code:e,message:n,detail:r})}var Hc,oe=ct(()=>{"use strict";Hc=50});var St=ct(()=>{"use strict";li();ke();mt();kt();oe()});var Za={};be(Za,{MAX_RASTER_AREA:()=>te,MAX_RASTER_SIDE:()=>Pt,cropSvgText:()=>mr,decodeSvgFromDataURL:()=>pe,encodeSvgToDataURL:()=>he,fixSafariShadows:()=>yr,peekSvgHeader:()=>gr,toCanvas:()=>Ut});function Md(t,e){try{let n=t.match(/<svg\b[^>]*>/i);if(!n)return t;let r=n[0],i=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(o)||i<=0||o<=0)return t;let s=Math.min(1,Pt/i,Pt/o,Math.sqrt(te/(i*o)));if(s>=1)return t;let a=Math.max(1,Math.floor(i*s)),c=Math.max(1,Math.floor(o*s));return At(e,"raster-clamp",`capture ${Math.round(i)}x${Math.round(o)}px exceeds decode limits; downscaled to ${a}x${c}px`),console.warn(`[SnapDOM] ${Math.round(i)}\xD7${Math.round(o)}px is too large for the browser to draw; scaled down to ${a}\xD7${c}px. For full size, export ${typeof CompressionStream=="function"?"a PNG blob, ":""}an SVG, or crop.`),t.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${c}`))}catch{return t}}function mr(t,e){let n=["x","y","width","height"].map(S=>Number(e?.[S]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw new RangeError("[SnapDOM] crop needs finite x/y and a positive width/height.");let r=t.match(/<svg\b[^>]*>/i);if(!r)throw new Error("[SnapDOM] Only SVG captures can be cropped.");let i=r[0],o=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],s=String(o||"").trim().split(/[\s,]+/).map(Number);if(s.length!==4||!s.every(Number.isFinite)||s[2]<=0||s[3]<=0)throw new Error("[SnapDOM] Can't crop: the SVG has no valid viewBox.");let[a,c,u,l]=s,f=Math.max(a,n[0]),d=Math.max(c,n[1]),h=Math.min(a+u,n[0]+n[2]),m=Math.min(c+l,n[1]+n[3]);if(!(h>f)||!(m>d))throw new RangeError("[SnapDOM] The crop area does not intersect the capture.");let p=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(p)&&p>0?p/u:1,b=Number.isFinite(g)&&g>0?g/l:1,w=Math.max(1,(h-f)*y),v=Math.max(1,(m-d)*b),C=i.replace(/(\bwidth=")[^"]*/i,`$1${w}`).replace(/(\bheight=")[^"]*/i,`$1${v}`).replace(/(\bviewBox=")[^"]*/i,`$1${f} ${d} ${h-f} ${m-d}`);return t.replace(i,C)}function Ho(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function pe(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function gr(t){let e=t.indexOf(",");if(e<0)return"";let n=t.slice(e+1,e+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(n)}catch{return""}}function he(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Qa(t){let e=[],n="",r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(e.push(n),n=""):n+=o}return n.trim()&&e.push(n),e.map(i=>i.trim()).filter(Boolean)}function Ad(t){let e=[],n="",r=0;for(let o=0;o<t.length;o++){let s=t[o];s==="("&&r++,s===")"&&(r=Math.max(0,r-1)),s===","&&r===0?(e.push(n.trim()),n=""):n+=s}n.trim()&&e.push(n.trim());let i=[];for(let o of e){if(/\binset\b/i.test(o))continue;let s=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",c="0px",u="0px"]=s;u=`${parseFloat(u)/2}px`;let l=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!l&&l!==",";i.push(`drop-shadow(${a} ${c} ${u}${f?` ${l}`:""})`)}return i.join(" ")}function Ja(t){let e=Qa(t),n=null,r=null,i=null,o=[];for(let a of e){let c=a.indexOf(":");if(c<0)continue;let u=a.slice(0,c).trim().toLowerCase(),l=a.slice(c+1).trim();u==="box-shadow"?i=l:u==="filter"?n=l:u==="-webkit-filter"?r=l:o.push([u,l])}if(i){let a=Ad(i);a&&(n=n?`${n} ${a}`:a,r=r?`${r} ${a}`:a)}let s=[...o];return n&&s.push(["filter",n]),r&&s.push(["-webkit-filter",r]),s.map(([a,c])=>`${a}:${c}`).join(";")}function _d(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${Ja(r)}}`)}function Ed(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,_d(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${Ja(r)}${n}`),t}function Rd(){return dr||(dr=(async()=>{try{let t='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',e=new Image;e.decoding="sync",e.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await e.decode();let n=document.createElement("canvas");n.width=8,n.height=20;let r=n.getContext("2d",{willReadFrequently:!0});r.drawImage(e,0,0);let i=r.getImageData(2,18,1,1).data[3]>128,o=r.getImageData(2,2,1,1).data[3]>128;return{native:i||o,flippedY:o&&!i}}catch{return{native:!1,flippedY:!1}}})(),dr)}function Fd(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("?n++:o===")"?n=Math.max(0,n-1):o===","&&n===0&&(e.push(t.slice(r,i)),r=i+1)}return e.push(t.slice(r)),e.map(i=>{let o=0,s=0,a="",c=0;for(;c<i.length;){let u=i[c];if(u==="("?o++:u===")"&&(o=Math.max(0,o-1)),o===0&&(c===0||i[c-1]===" ")){let l=/^-?\d*\.?\d+px/.exec(i.slice(c));if(l){s++,a+=s===2?`${-parseFloat(l[0])}px`:l[0],c+=l[0].length;continue}}a+=u,c++}return a}).join(",")}function Td(t,e){let n=r=>Qa(r).map(i=>{let o=i.indexOf(":");if(o<0)return i;let s=i.slice(0,o).trim().toLowerCase();return s==="text-shadow"||e&&s==="box-shadow"?`${s}:${Fd(i.slice(o+1))}`:i}).join(";");return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(r,i)=>r.replace(i,i.replace(/([^{}]+)\{([^}]*)\}/g,(o,s,a)=>`${s}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(r,i,o)=>`style=${i}${n(o)}${i}`),t}async function yr(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:r}=await Rd();try{let i=t;return n||(i=Ed(i)),r&&(i=Td(i,n)),{svg:i,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function Pd(){let t=document.createElement("canvas");t.width=16,t.height=16;let e=t.getContext("2d",{willReadFrequently:!0});return e?n=>{e.clearRect(0,0,16,16),e.drawImage(n,0,0,16,16);let r=e.getImageData(0,0,16,16).data;for(let i=3;i<r.length;i+=4)if(r[i]>0)return!0;return!1}:null}async function $d(t,e,n){Z(t),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{if(!n)return await pr(),await pr(),!1;let r=performance.now()+(e?600:150);for(;;){let i;try{i=n(t)}catch{return!1}if(i)return!0;if(performance.now()>r)return!1;await pr()}}finally{try{t.remove()}catch{}}}function Ya(t){if(typeof document>"u"||!document.body)return new Image;if(Et&&!Et.contentDocument){try{Et.remove()}catch{}Et=null}if(Et&&hr>Nd&&gn===0){try{Et.remove()}catch{}Et=null}if(!Et){let n=document.createElement("iframe");Z(n),n.setAttribute("aria-hidden","true"),n.style.cssText="position:absolute;left:-9999px;top:0;width:0;height:0;border:0;visibility:hidden;pointer-events:none";try{document.body.appendChild(n)}catch{}if(n.contentDocument)Et=n,hr=0;else{try{n.remove()}catch{}return new Image}}hr+=t.length,gn+=1;let e=Et.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function Vo(t,e=!1){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,gn=Math.max(0,gn-1),e&&(jo=!0),jo&&gn===0&&(Et?.remove(),Et=null,hr=0,jo=!1))}function Ka(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function Wd(t){if(typeof t!="string")return!1;let e=t.indexOf(",")+1,n=Math.max(48,Math.floor((t.length-e)/200)),r=0,i=0;for(let o=e;o+48<=t.length;o+=n){let s=t.slice(o,o+48);r++,Dd.some(a=>s.includes(a))||i++}return i*2>r}function qo(t,e,n,r,i){if(!e.naturalWidth){t.drawImage(e,0,0,n,r);return}let o=n*r,s=o>Ld&&!Wd(i)?Math.min(Od,Math.ceil(o/Id)):1;if(s===1){t.drawImage(e,0,0,n,r);return}let a=e.naturalWidth,c=e.naturalHeight/r;for(let u=0;u<s;u++){let l=Math.round(u*r/s),f=u===s-1?r:Math.round((u+1)*r/s);t.drawImage(e,0,l*c,a,(f-l)*c,0,l,n,f-l)}}async function Ut(t,e){let{width:n,height:r,scale:i=1,dpr:o=1,meta:s={},backgroundColor:a,crop:c=null}=e,u=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,l=t,f=!1,d=!1;if(c&&!Ho(t))throw new RangeError("[SnapDOM] Only SVG captures can be cropped.");if(Ho(t)){let m=(gr(t).match(/<svg\b[^>]*>/i)||[])[0]||"",p=parseFloat((m.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((m.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(p)&&Number.isFinite(g)&&p>0&&g>0&&Math.min(1,Pt/p,Pt/g,Math.sqrt(te/(p*g)))<1;if(c||y||X())try{let b=pe(t);if(c&&(b=mr(b,c)),X()){let w=await yr(b);b=w.svg,f=w.naturalOnly,d=/@font-face|data:image\//i.test(b)}(y||c)&&(b=Md(b,e.__session)),l=he(b)}catch(b){if(c)throw b;l=t}}let h=u||Ya(l);try{u||await Ka(h,l)}catch(m){if(!h.__snapdomDecodeFrame)throw m;let p=h;h=Ya(l),Vo(p);try{await Ka(h,l)}catch(g){throw Vo(h,e.__releaseDecodeFrame),g}}try{!u&&!X()&&!wt()&&Ho(l)&&/(?:%40|@)font-face/i.test(l)&&await new Promise(P=>{let A=new MessageChannel;A.port1.onmessage=()=>{A.port1.close(),A.port2.close(),P()},A.port2.postMessage(0)});let m=X()&&!u?Pd():null,p=!1;m&&(p=await $d(h,d,m));let g=u?u.width:h.naturalWidth,y=u?u.height:h.naturalHeight,b=c?g:Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:g,w=c?y:Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:y,v,C,S=Number.isFinite(n),M=Number.isFinite(r);if(S&&M)v=Math.max(1,n),C=Math.max(1,r);else if(S){let P=n/Math.max(1,b);v=n,C=w*P}else if(M){let P=r/Math.max(1,w);C=r,v=b*P}else{let P=u&&Number.isFinite(s.vbW)&&Number.isFinite(s.vbH);v=P?s.vbW:g,C=P?s.vbH:y}!S&&!M&&(v=v*i,C=C*i);let _=v*o,E=C*o,x=Math.max(_/Pt,E/Pt,Math.sqrt(_*E/te));x>1&&(At(e.__session,"canvas-clamp",`output ${Math.round(_)}x${Math.round(E)}px exceeds canvas limits; downscaled`),console.warn(`[SnapDOM] ${Math.round(_)}\xD7${Math.round(E)}px is larger than a canvas allows; scaled down. For full size, export ${typeof CompressionStream=="function"?"a PNG blob, ":""}an SVG, or crop.`),v/=x,C/=x);let k=Rt(e.canvas)&&it(e.canvas,"canvas")?e.canvas:document.createElement("canvas");k.width=Math.max(1,v*o),k.height=Math.max(1,C*o),k.style.width=`${v}px`,k.style.height=`${C}px`;let R=k.getContext("2d");if(!R)throw new Error("[SnapDOM] The canvas you passed has no 2D context (is it already used for WebGL?).");let T=null,L=e.__layoutZoom||1;if(!u&&L>1&&wt()){let P=L*b/(v*o),A=Math.round(v*o*P),N=Math.round(C*o*P);P>1.01&&A<=Pt&&N<=Pt&&A*N<=te&&(T={w:A,h:N})}let W=()=>{if(o!==1&&R.scale(o,o),a&&(R.save(),R.fillStyle=a,R.fillRect(0,0,v,C),R.restore()),f&&(Math.round(v*o)!==g||Math.round(C*o)!==y)){let P=document.createElement("canvas");P.width=g,P.height=y,qo(P.getContext("2d"),h,g,y,l),R.drawImage(P,0,0,v,C)}else{if(R.save(),R.setTransform(1,0,0,1,0,0),T){let P=document.createElement("canvas");for(P.width=T.w,P.height=T.h,qo(P.getContext("2d"),h,T.w,T.h,l);P.width>v*o*2;){let A=document.createElement("canvas");A.width=Math.ceil(P.width/2),A.height=Math.ceil(P.height/2),A.getContext("2d").drawImage(P,0,0,A.width,A.height),P=A}R.imageSmoothingQuality="high",R.drawImage(P,0,0,v*o,C*o)}else qo(R,h,v*o,C*o,l);R.restore()}};if(W(),m&&p&&d){let P=!0;try{P=m(h)}catch{}if(!P){let A=performance.now()+600;do{await pr();try{P=m(h)}catch{break}}while(!P&&performance.now()<A);k.width=k.width,W()}}return k}finally{Vo(h,e.__releaseDecodeFrame)}}var Pt,te,dr,pr,Nd,Et,hr,gn,jo,Ld,Id,Od,Dd,me=ct(()=>{"use strict";mt();oe();kt();Mt();Pt=X()?16384:32767,te=16384*16384;dr=null;pr=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});Nd=24*1024*1024,Et=null,hr=0,gn=0,jo=!1;Ld=4e6,Id=2e6,Od=8,Dd=["%3C","%3E","%20","%7B","%7D","%3B"]});var yn={};be(yn,{rasterize:()=>Go});async function Go(t,e){let n=await Ut(t,e),o=n.width*n.height<=2e6?n.toDataURL(`image/${e.format}`,e.quality):await new Promise(a=>{let c=()=>a(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(u=>{if(!u)return c();let l=new FileReader;l.onload=()=>a(String(l.result||"")),l.onerror=c,l.readAsDataURL(u)},`image/${e.format}`,e.quality)}catch{c()}}),s=new Image;return s.src=o,X()?await s.decode():await new Promise((a,c)=>{if(s.complete&&s.naturalWidth)return a();s.onload=a,s.onerror=c}),s.style.width=`${n.width/e.dpr}px`,s.style.height=`${n.height/e.dpr}px`,s}var qe=ct(()=>{"use strict";me();mt()});var Xo={};be(Xo,{toImg:()=>Bd,toSvg:()=>Bd});async function Bd(t,e){let{scale:n=1,width:r,height:i,meta:o={}}=e,s=Number.isFinite(r),a=Number.isFinite(i),c=Number.isFinite(n)&&n!==1||s||a;if(X()&&c)try{let{svg:d}=await yr(pe(t)),h=(d.match(/<svg\b[^>]*>/i)||[])[0]||"",m=parseFloat((h.match(/\bwidth="([\d.]+)/i)||[])[1]),p=parseFloat((h.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(m)||!Number.isFinite(p))throw new Error("The SVG has no size.");let g=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:m,y=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:p,b,w;s&&a?(b=r,w=i):s?(b=r,w=Math.max(1,Math.round(y*(r/Math.max(1,g))))):a?(w=i,b=Math.max(1,Math.round(g*(i/Math.max(1,y))))):(b=Math.max(1,Math.round(m*n)),w=Math.max(1,Math.round(p*n)));let v=d.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${w}"`),C=new Image;return C.decoding="sync",C.loading="eager",C.src=he(v),await C.decode(),C.style.width=`${b}px`,C.style.height=`${w}px`,C}catch(d){return At(e.__session,"safari-png-fallback","Safari vector toImg failed; using PNG",d),H(e,"Safari couldn't show the SVG; used a PNG.",d),Go(t,{...e,format:"png",quality:1,meta:o})}let u=t,l=!1;if(!s&&!a&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let d=pe(t),h=(d.match(/<svg\b[^>]*>/i)||[])[0]||"",m=Number((h.match(/\bwidth="([\d.]+)"/i)||[])[1]),p=Number((h.match(/\bheight="([\d.]+)"/i)||[])[1]);if(m>0&&p>0){let g=h.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(m*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(p*n))}"`);u=he(d.replace(h,g)),l=!0}}catch{}let f=new Image;f.decoding="sync",f.loading="eager",f.src=u;try{await f.decode()}catch(d){if(!l)throw d;f.src=t,l=!1,await f.decode()}if(s&&a)f.style.width=`${r}px`,f.style.height=`${i}px`;else if(s){let d=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:f.naturalWidth,h=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:f.naturalHeight,m=r/Math.max(1,d);f.style.width=`${r}px`,f.style.height=`${Math.max(1,Math.round(h*m))}px`}else if(a){let d=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:f.naturalWidth,h=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:f.naturalHeight,m=i/Math.max(1,h);f.style.height=`${i}px`,f.style.width=`${Math.max(1,Math.round(d*m))}px`}else{let d=Math.max(1,Math.round(f.naturalWidth*(l?1:n))),h=Math.max(1,Math.round(f.naturalHeight*(l?1:n)));if(f.style.width=`${d}px`,f.style.height=`${h}px`,!l&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let p=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${d}"`).replace(/height="[^"]*"/,`height="${h}"`);f.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,await f.decode()}catch(m){H(e,"Couldn't size the SVG image.",m),f.src!==t&&(f.src=t,await f.decode().catch(()=>{}))}}return f}var Yo=ct(()=>{"use strict";St();oe();qe();me()});var ec={};be(ec,{encodePng:()=>Ud});function br(t,e=new Uint8Array(0)){let n=new Uint8Array(e.length+12),r=new DataView(n.buffer);r.setUint32(0,e.length);for(let o=0;o<4;o++)n[o+4]=t.charCodeAt(o);n.set(e,8);let i=4294967295;for(let o=4;o<n.length-4;o++)i=tc[(i^n[o])&255]^i>>>8;return r.setUint32(n.length-4,(i^4294967295)>>>0),n}async function Ud(t,e,n){if(![t,e].every(p=>Number.isInteger(p)&&p>0&&p<=2147483647))throw new RangeError("[SnapDOM] PNG dimensions must be integers from 1 to 2147483647");let r=new Uint8Array(13),i=new DataView(r.buffer);i.setUint32(0,t),i.setUint32(4,e),r[8]=8,r[9]=6;let o=[new Uint8Array([137,80,78,71,13,10,26,10]),br("IHDR",r),br("sRGB",new Uint8Array([0]))],s=t*4,a=Math.max(1,Math.floor(65536/(s+1))),c=new Uint8Array(s),u=0,l=new CompressionStream("deflate"),f=l.writable.getWriter(),d=l.readable.getReader(),h,m=(async()=>{try{for(;;){let{done:p,value:g}=await d.read();if(p)return;o.push(br("IDAT",g))}}catch(p){h=p,await f.abort(p).catch(()=>{})}})();try{for await(let p of n){if(!(p instanceof Uint8Array||p instanceof Uint8ClampedArray)||!p.length||p.length%s)throw new RangeError("[SnapDOM] PNG input must contain complete RGBA rows");let g=p.length/s;if(u+g>e)throw new RangeError("[SnapDOM] PNG input exceeds the declared height");for(let y=0;y<g;y+=a){let b=Math.min(g,y+a),w=new Uint8Array((b-y)*(s+1));for(let v=y;v<b;v++){let C=p.subarray(v*s,(v+1)*s),S=(v-y)*(s+1),M=0,_=0;for(let E=0;E<s;E++){let x=C[E]-(E<4?0:C[E-4])&255,k=C[E]-c[E]&255;M+=Math.min(x,256-x),_+=Math.min(k,256-k),w[S+E+1]=k}if(w[S]=_<=M?2:1,M<_)for(let E=0;E<s;E++)w[S+E+1]=C[E]-(E<4?0:C[E-4]);c=C}await f.write(w)}c=c.slice(),u+=g}if(u!==e)throw new RangeError("[SnapDOM] PNG input does not match the declared height");if(await f.close(),await m,h)throw h;return o.push(br("IEND")),new Blob(o,{type:"image/png"})}catch(p){throw await Promise.allSettled([f.abort(p),d.cancel(p)]),await m,p}finally{f.releaseLock(),d.releaseLock()}}var tc,nc=ct(()=>{"use strict";tc=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;tc[t]=e}});function wr(t,e){if(typeof t!="string"||!t.startsWith("data:image/svg+xml"))return null;let n=gr(t).match(/<svg\b[^>]*>/i)?.[0];if(!n)return null;let r=e.crop?mr(n,e.crop):n,i=parseFloat(r.match(/\bwidth="([^"]+)/i)?.[1]),o=parseFloat(r.match(/\bheight="([^"]+)/i)?.[1]),s=(r.match(/\bviewBox="([^"]+)/i)?.[1]||"").trim().split(/[\s,]+/).map(Number);if(!(i>0&&o>0)||s.length!==4||!s.every(Number.isFinite)||!(s[2]>0&&s[3]>0))return null;let a=Number.isFinite(e.width),c=Number.isFinite(e.height),u=e.meta||{},l=Math.max(1,Math.floor(i)),f=Math.max(1,Math.floor(o)),d=e.crop?l:Number.isFinite(u.vbW)?u.vbW:Number.isFinite(u.w0)?u.w0:l,h=e.crop?f:Number.isFinite(u.vbH)?u.vbH:Number.isFinite(u.h0)?u.h0:f,m=e.dpr??1,p=e.scale??1,g=(a&&c?Math.max(1,e.width):a?e.width:c?e.height*d/Math.max(1,h):l*p)*m,y=(a&&c?Math.max(1,e.height):c?e.height:a?e.width*h/Math.max(1,d):f*p)*m;if(Math.max(i,o,g,y)<=Pt&&i*o<=te&&g*y<=te||typeof CompressionStream!="function")return null;return b();async function b(){let{encodePng:w}=await Promise.resolve().then(()=>(nc(),ec)),v=Math.max(1,Math.floor(g)),C=Math.max(1,Math.floor(y)),S=pe(t),M=S.slice(S.indexOf(n)+n.length,S.lastIndexOf("</svg>")),_=r.match(/\bpreserveAspectRatio="([^"]*)"/i)?.[1]||"xMidYMid meet",E=i/s[2],x=o/s[3],k=0,R=0;/\bnone\b/.test(_)||(E=x=/\bslice\b/.test(_)?Math.max(E,x):Math.min(E,x),k=(i-s[2]*E)*(/xMin/.test(_)?0:/xMax/.test(_)?1:.5),R=(o-s[3]*x)*(/YMin/.test(_)?0:/YMax/.test(_)?1:.5)),k-=s[0]*E,R-=s[1]*x;let T=r.replace(/\s(?:width|height|preserveAspectRatio)="[^"]*"/gi,"").slice(0,-1),L=X()&&/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(S),W=i/g,P=o/y,A=Math.max(1,Math.min(8192,Math.floor(4*1024*1024/v),L?Math.floor(2046/P):8192)),N=Math.max(1,Math.min(8192,v,L?Math.floor(2046/W):8192));async function*$(){for(let F=0;F<C;F+=A){let z=Math.min(A,C-F),q=new Uint8Array(v*z*4);for(let j=0;j<v;j+=N){let J=Math.min(N,v-j),B=L?Math.max(0,Math.floor(j*W)-1):j*W,ut=L?Math.max(0,Math.floor(F*P)-1):F*P,vt=L?Math.min(l,Math.ceil((j+J)*W)+1)-B:J,at=L?Math.min(f,Math.ceil((F+z)*P)+1)-ut:z,st=vt/s[2],nt=at/s[3],pt=L?1:1/W,zt=L?1:1/P,ge=`matrix(${E*pt/st},0,0,${x*zt/nt},${(k-B)*pt/st+s[0]},${(R-ut)*zt/nt+s[1]})`,V=`${T} width="${vt}" height="${at}" preserveAspectRatio="none"><g style="all:unset!important;transform:${ge}!important;transform-origin:0 0!important">${M}</g></svg>`,G=await Ut(he(V),{width:vt,height:at,dpr:1,backgroundColor:L?null:e.backgroundColor,__session:e.__session,__releaseDecodeFrame:!0}),U=G;try{if(L){U=document.createElement("canvas"),U.width=J,U.height=z;let Y=U.getContext("2d");e.backgroundColor&&(Y.fillStyle=e.backgroundColor,Y.fillRect(0,0,J,z)),Y.drawImage(G,j*W-B,F*P-ut,J*W,z*P,0,0,J,z)}let ht=U.getContext("2d").getImageData(0,0,J,z).data;for(let Y=0;Y<z;Y++)q.set(ht.subarray(Y*J*4,(Y+1)*J*4),(Y*v+j)*4)}finally{G.width=G.height=0,U!==G&&(U.width=U.height=0)}}yield q}}return w(v,C,$())}}var Ko=ct(()=>{"use strict";me();mt()});var rc={};be(rc,{toBlob:()=>Qo});async function Qo(t,e){let n=e.format||e.type||"svg";if(n==="svg"){if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)throw new Error("[SnapDOM] html-in-canvas makes a raster capture, not an SVG; ask for png, jpeg or webp.");let o=decodeURIComponent(t.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let r=n==="png"&&wr(t,e);if(r)return r;let i=await Ut(t,e);return new Promise(o=>i.toBlob(s=>o(s),`image/${n==="jpg"?"jpeg":n}`,e.quality))}var Jo=ct(()=>{"use strict";me();Ko()});var ic={};be(ic,{download:()=>zd});async function oc(t,e){let n=new File([t],e,{type:t.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:e})}catch(r){if(r.name!=="AbortError")return!1}return!0}async function zd(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(e?.type||"").toLowerCase(),i=n.has(r)?r:"",o=(e?.format||i||"").toLowerCase(),s=o==="jpg"?"jpeg":o||"png",a=e?.filename||"snapdom",c=/\.(png|jpe?g|webp|svg)$/i.test(a)?a:`${a}.${s}`,u={...e||{},format:s,type:s};u.dpr=1;let l=tn(),f=s==="png"&&wr(t,u);if(s==="svg"||f){let m=f?await f:await Qo(t,{...u,type:"svg"});if(l&&await oc(m,c))return;let p=URL.createObjectURL(m),g=document.createElement("a");g.href=p,g.download=c,document.body.appendChild(g),g.click(),setTimeout(()=>URL.revokeObjectURL(p),1e3),g.remove();return}let d=await Ut(t,u);if(l){let m=`image/${s}`,p=await new Promise(g=>d.toBlob(g,m,e?.quality));if(p&&await oc(p,c))return}let h=document.createElement("a");h.href=d.toDataURL(`image/${s}`,e?.quality),h.download=c,document.body.appendChild(h),h.click(),h.remove()}var sc=ct(()=>{"use strict";Jo();me();Ko();mt()});St();St();mt();yt();xn();Mt();var ie=new WeakMap,vi=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],Wr=new Map,jc=2e3,Ae=0;function $t(){Ae++}function Cn(t){let e=t&&(t.nodeType===1?t:t.parentElement);for(;e;){if(Gt(e))return!0;if(e.parentElement)e=e.parentElement;else{let n=e.getRootNode?.();e=n&&n.host?n.host:null}}return!1}function Mn(t){for(let e of t)if(ae(e))return!0;return!1}function ae(t){if(Cn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!Cn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!Cn(n)){e=!1;break}}if(e)return!1}return!0}var Me=new WeakMap;function Fi(t){for(let e of t){if(!ae(e))continue;let n=e.target.ownerDocument||document;Me.set(n,(Me.get(n)||0)+1);let r=e.target.nodeType===1?e.target:e.target.parentElement||e.target.host;for(;r;r=r.parentElement||r.getRootNode?.()?.host)Me.set(r,(Me.get(r)||0)+1)}}function on(t){let e=t.ownerDocument||document;return Re(e),(Me.get(e)||0)-(Me.get(t)||0)}var Ft=0;function _e(t=document){return Re(t),Ft}function Wt(){return Re(),Ae}function sn(t){return t?(Re(t.ownerDocument||document),An(t,qr(t))):0}function Ee(){$t(),Ft++}var se=new WeakMap,Yt=0,Kt=0;function Vc(t){se.set(t,++Yt)}function jr(t){if(!t||t.nodeType!==1)return;Yt++,se.set(t,Yt);let e=t.querySelectorAll("*");for(let n=0;n<e.length;n++)se.set(e[n],Yt)}function Vr(t){jr(t.parentElement||t);for(let e=t.parentElement;e;e=e.parentElement)Vc(e)}function An(t,e=null){let n=se.get(t)||0;if(e)for(let r of e)n=Math.max(n,se.get(r)||0);return Kt*1e9+n}function qr(t){let e=t.getRootNode?.();if(!e?.host)return null;let n=[];for(;e?.host;)e.mode==="open"&&Xr(e),n.push(e.host),e=e.host.getRootNode?.();return n}var Br=new WeakMap;function Gr(t){t=t||document;let e=Br.get(t);if(!e||e.env!==Ft){let n=!0;try{n=Qt(t).usesHas}catch{}e={env:Ft,usesHas:n},Br.set(t,e)}return!e.usesHas}function qc(t){let e=n=>n?.nodeType===1&&(n.matches?.("style,link")||n.querySelector?.("style,link"));for(let n of t){let r=n.target,i=r&&(r.nodeType===1?r:r.parentElement);if(i&&(i.tagName==="STYLE"||i.tagName==="LINK"))return i.ownerDocument||document;for(let o of n.addedNodes)if(e(o))return o.ownerDocument||document;for(let o of n.removedNodes)if(e(o))return o.ownerDocument||r&&r.ownerDocument||document}return null}var Ur=new WeakSet,en=[];function Ti(t){if(!Mn(t))return;Fi(t),$t();let e=new Set;for(let n of t){if(!ae(n))continue;let r=n.target.getRootNode&&n.target.getRootNode();if(!r||r.nodeType!==11||e.has(r))continue;e.add(r),r.host?jr(r.host):Yt++;let i=r.querySelectorAll("*");for(let o=0;o<i.length;o++)se.set(i[o],Yt)}}function Xr(t){if(!(!t||Ur.has(t))){Ur.add(t);try{let e=new MutationObserver(Ti);e.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),en.push({o:e,root:t})}catch{}}}function Pi(t){if(!Mn(t))return;Fi(t),$t();let e=qc(t);if(e){Br.delete(e),Ft++,Kt++;return}let n=new Set;for(let r of t){if(!ae(r))continue;let i=r.target.nodeType===1?r.target:r.target.parentElement;if(!i)continue;let o=i.ownerDocument||document;if(!Gr(o)){Kt++;return}if(i===o.documentElement||i===o.body){Kt++;return}let s=i.parentElement||i;n.has(s)||(n.add(s),Vr(i))}}var zr=new WeakSet,nn=null,rn=[];function Re(t=document){if(t===nn||!t||t.nodeType!==9)return;if(zr.has(t)){nn=t;return}zr.add(t),nn=t;let e=t.defaultView,n=i=>{Mn(i)&&($t(),Ft++)},r=()=>{$t(),Ft++};try{let i=new MutationObserver(Pi);i.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),rn.push({o:i,env:!1,doc:t})}catch{}try{let i=new MutationObserver(n);i.observe(t.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),rn.push({o:i,env:!0,doc:t})}catch{}try{e?.addEventListener("resize",r,{passive:!0})}catch{}try{let i=o=>{$t();let s=o.composedPath?.()[0]||o.target;s&&s.nodeType===1&&!Cn(s)&&Gr(s.ownerDocument||t)?Vr(s):Kt++};t.addEventListener("focusin",i,{capture:!0,passive:!0}),t.addEventListener("focusout",i,{capture:!0,passive:!0}),t.addEventListener("change",i,{capture:!0,passive:!0}),t.addEventListener("pointerdown",i,{capture:!0,passive:!0}),t.addEventListener("pointerup",i,{capture:!0,passive:!0}),t.addEventListener("pointercancel",i,{capture:!0,passive:!0}),t.addEventListener("keydown",i,{capture:!0,passive:!0}),t.addEventListener("keyup",i,{capture:!0,passive:!0}),t.addEventListener("beforetoggle",i,{capture:!0,passive:!0}),t.addEventListener("toggle",i,{capture:!0,passive:!0}),e?.addEventListener("hashchange",()=>{$t(),Kt++},{passive:!0})}catch{}try{let i=t.fonts;i&&(i.addEventListener?.("loadingdone",r),i.status==="loading"&&i.ready?.then(r).catch(()=>{}))}catch{}}var Ci=new WeakMap;function ki(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let r=Ci.get(t)||[];if(r.length===n.length&&r.every((o,s)=>o===n[s]))return;if(Ci.set(t,n),$t(),t.nodeType===11){t.host?jr(t.host):Yt++;for(let o of t.querySelectorAll("*"))se.set(o,Yt);return}let i=r.filter(o=>!n.includes(o)).concat(n.filter(o=>!r.includes(o)));for(let o of i)if(o.isConnected)if(Gr(e))Vr(o);else{Kt++;return}}function _n(t,e=null){if(!t)return;ki(t,t);let n=e||en.filter(({root:r})=>r.host?.isConnected).map(({root:r})=>r);for(let r of n)ki(r,t)}function Tt(){Re();try{for(let t=rn.length-1;t>=0;t--){let{o:e,env:n,doc:r}=rn[t];if(r!==document&&!r.defaultView){try{e.disconnect()}catch{}zr.delete(r),nn===r&&(nn=null),rn.splice(t,1);continue}let i=e.takeRecords();i.length&&(n?Mn(i)&&($t(),Ft++):Pi(i))}for(let t=en.length-1;t>=0;t--){let{o:e,root:n}=en[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}Ur.delete(n),en.splice(t,1);continue}let r=e.takeRecords();r.length&&Ti(r)}}catch{}}function ce(t){if(!(!t||t.nodeType!==1)){ie.delete(t);try{let e=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();)ie.delete(e.currentNode)}catch{}}}var Gc=["mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"];function Yr(t){let e=ie.get(t);if(e&&Kr(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function $i(t){let e=ie.get(t);if(!e||!Kr(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}var Mi=new WeakMap;function Qt(t){let e=Mi.get(t);if(!e||e.epoch!==Ae){let n=e&&e.universe;e={epoch:Ae,...mi(t)};let r=e.universe;if(n&&r&&n.size===r.size){let i=!0;for(let o of r)if(!n.has(o)){i=!1;break}i&&(e.universe=n)}Mi.set(t,e)}return e}function Ni(t){try{let e=Qt(t.ownerDocument||document).shareGate;if(e===null)return!1;if(!e.length)return!0;let n=new Set,r=s=>{n.add("t"+s.localName),s.id&&n.add("i"+s.id);let a=s.classList;for(let c=0;c<a.length;c++)n.add("c"+a[c])};r(t);for(let s of t.querySelectorAll("*"))r(s);let i=[];for(let{sel:s,key:a}of e)(a===null||n.has(a))&&i.push(s);if(!i.length)return!0;let o=i.join(",");return!t.matches(o)&&t.querySelector(o)===null}catch{return!1}}function Xc(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Qt(e).importantProps}function an(t,e){let n=t.ownerDocument||document,r=t.getRootNode?t.getRootNode():n;return r===n?Qt(n).universe:e&&Ot(r)?Yc(t,r,n,e):null}var Ai=new WeakMap;function Yc(t,e,n,r){let i=r.__shadowUniverse;if(i===null)return null;if(!i){let a=Qt(n).universe;if(!a)return r.__shadowUniverse=null;i=r.__shadowUniverse={universe:new Set(a),roots:new Set}}let o=a=>{for(;Ot(a)&&!i.roots.has(a);a=a.host.getRootNode()){i.roots.add(a);for(let c of[...a.styleSheets,...a.adoptedStyleSheets||[]]){let u=Ai.get(c);if((!u||u.epoch!==Ae)&&Ai.set(c,u={epoch:Ae,props:pi(c)}),!u.props)return!1;for(let l of u.props)i.universe.add(l)}Pr(a.getAnimations(),i.universe)}return!0},s=o(e)&&(!t.shadowRoot||o(t.shadowRoot));for(let a=t.assignedSlot;s&&a;a=a.assignedSlot)s=o(a.getRootNode());return s?i.universe:r.__shadowUniverse=null}function kn(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Qt(e).pseudoUniverse}var Kc={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function Fe(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?Kc:Qt(e).pseudoGates}function Qc(t,e={},n=null,r=null){let i={},o=e.excludeStyleProps,s=h=>{if(i[h]!==void 0||xe(h)||o&&(o instanceof RegExp&&o.test(h)||typeof o=="function"&&o(h)))return;let m=t.getPropertyValue(h);m&&((h==="background-image"||h==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),i[h]=m)};if(r){for(let m of r)s(m);let h=n&&n.style;if(h&&h.length)for(let m=0;m<h.length;m++)s(h[m])}else for(let h=0;h<t.length;h++)s(t[h]);let a=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let h of a)if(!i[h])try{let m=t.getPropertyValue(h);m&&(i[h]=m)}catch{}let c=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let h of c)if(!i[h])try{let m=t.getPropertyValue(h);m&&(i[h]=m)}catch{}if(e.embedFonts){let h=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let m of h)if(!i[m])try{let p=t.getPropertyValue(m);p&&(i[m]=p)}catch{}}try{(i["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(i["content-visibility"]="hidden")}catch{}Object.defineProperty(i,"__needsBgInline",{value:Li(t),enumerable:!1});let u=parseFloat(t.getPropertyValue("border-top-width")||0)||0,l=parseFloat(t.getPropertyValue("border-right-width")||0)||0,f=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,d=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(u===0&&l===0&&f===0&&d===0){let h=(t.getPropertyValue("border-image-source")||"").trim(),m=h&&h!=="none",p=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color","border-block-start","border-block-start-width","border-block-start-style","border-block-start-color","border-block-end","border-block-end-width","border-block-end-style","border-block-end-color","border-inline-start","border-inline-start-width","border-inline-start-style","border-inline-start-color","border-inline-end","border-inline-end-width","border-inline-end-style","border-inline-end-color"];for(let g of p)delete i[g];m||(i.border="none")}return Jc(i),i}function Jc(t){if(!wt())return;let e=t["background-clip"]||t["-webkit-background-clip"];if(!e||!e.includes("text"))return;let n=o=>o==="transparent"||o==="rgba(0, 0, 0, 0)",r=t["-webkit-text-fill-color"];if(!n(r!==void 0?r:t.color))return;let i=Zc(t["background-image"],t["background-color"]);i&&(n(t.color)&&(t.color=i),r!==void 0&&(t["-webkit-text-fill-color"]=i),t["background-image"]="none",t["background-color"]="transparent",delete t["background-clip"],delete t["-webkit-background-clip"],Object.defineProperty(t,"__bgClipTextFix",{value:i,enumerable:!1}))}function Zc(t,e){let n=o=>{let s=[],a=/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)(?:[,\s/]+([\d.]+%?))?\s*\)/g,c;for(;c=a.exec(o||"");){let u=c[4];(u===void 0?1:parseFloat(u)/(u.endsWith("%")?100:1))>.05&&s.push([+c[1],+c[2],+c[3]])}return s},r=n(t);if(r.length||(r=n(e)),!r.length)return null;let i=[0,0,0];for(let[o,s,a]of r)i[0]+=o,i[1]+=s,i[2]+=a;return`rgb(${i.map(o=>Math.round(o/r.length)).join(", ")})`}function Li(t){let e=t.getPropertyValue("background-image");if(e&&e!=="none")return!0;let n=t.getPropertyValue("background-color");if(n&&n!=="rgba(0, 0, 0, 0)"&&n!=="transparent")return!0;for(let i of Gc){let o=t.getPropertyValue(i);if(o&&o!=="none")return!0}let r=t.getPropertyValue("background");return!!(r&&/url\s*\(/i.test(r))}function tl(t){for(let e=t.firstChild;e;e=e.nextSibling){if(e.nodeType===3&&/\S/.test(e.nodeValue||""))return!0;if(e.nodeType===1){let n=O(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function el(t,e,n){try{if(typeof t.computedStyleMap=="function"){let i=t.computedStyleMap().get("width");if(i!=null)return!_i(String(i).trim().toLowerCase())}}catch{}let r=t.style&&(t.style.width||t.style.inlineSize);return r&&!_i(String(r).trim().toLowerCase())?!0:rl(t,e)?n||ol(t,e):!1}var nl=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function _i(t){return nl.has(t)||t.startsWith("fit-content")}function rl(t,e){let n=t.getBoundingClientRect().width-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)-(parseFloat(e.borderLeftWidth)||0)-(parseFloat(e.borderRightWidth)||0);if(!(n>0))return!1;let r=1/0,i=-1/0,o=null;for(let s=t.firstChild;s;s=s.nextSibling){let a;if(s.nodeType===3){if(!/\S/.test(s.nodeValue||"")||(o=o||document.createRange(),o.selectNode(s),a=o.getBoundingClientRect(),!a.width&&!a.height))continue}else if(s.nodeType===1){let c=O(s);if(c.display==="none"||c.position==="absolute"||c.position==="fixed")continue;a=s.getBoundingClientRect()}else continue;a.left<r&&(r=a.left),a.right>i&&(i=a.right)}return i===-1/0?!1:i-r<n-.5}function ol(t,e){let n=t.parentElement;if(!n)return!1;let r=O(n),i=n.getBoundingClientRect().width-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0)-(parseFloat(r.borderLeftWidth)||0)-(parseFloat(r.borderRightWidth)||0)-(parseFloat(e.marginLeft)||0)-(parseFloat(e.marginRight)||0);return i>0?Math.abs(t.getBoundingClientRect().width-i)>.5:!1}var Hr=new WeakMap;function il(t,e){let n=Hr.get(t);if(n)return n;let r=[e];for(let i in t)r.push(i,t[i]);return n=r.join(""),Hr.set(t,n),n}function Kr(t,e){return t.env===Ft&&t.stamp===An(e,t.hosts)}var sl=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,al=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,cl=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);function ll(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function fl(t,e){let n=e.ids.get(t);if(n!==void 0)return n;let r=t.parentElement,i;if(!r)i="R";else if(i=e.ids.get(r),i===void 0){if(e.rootSeen)return e.ids.set(t,-1),-1;i="R"}if(e.rootSeen=!0,i===-1)return e.ids.set(t,-1),-1;let o="",s=t.attributes;if(s&&s.length)if(s.length===1)o=s[0].name+"="+s[0].value;else{let c=[];for(let u=0;u<s.length;u++)c.push(s[u].name+"="+s[u].value);c.sort(),o=c.join("")}let a=i+"|"+t.tagName+"|"+o;return n=e.intern.get(a),n===void 0&&(n=e.intern.size,e.intern.set(a,n)),e.ids.set(t,n),n}function Ii(t,e){let n=t.snap,r=t.snap={...n};Object.defineProperty(r,"__needsBgInline",{value:n.__needsBgInline,enumerable:!1}),n.__bgClipTextFix!==void 0&&Object.defineProperty(r,"__bgClipTextFix",{value:n.__bgClipTextFix,enumerable:!1});let i=Qt(e.ownerDocument||document),o=e.getAttribute&&e.getAttribute("style")||"",s=o&&al.test(o),a=!!i.marginUnstable||s&&/margin/i.test(o),c=!!i.paddingUnstable||s&&/padding/i.test(o),u=r.display!==void 0&&r.display.includes("grid"),l=r.transform!==void 0&&r.transform!=="none",f=[];for(let m in r)(sl.test(m)||u&&(m==="grid-template-columns"||m==="grid-template-rows")||l&&m==="transform"||a&&m.charCodeAt(0)===109&&m.startsWith("margin-")||c&&m.charCodeAt(0)===112&&m.startsWith("padding-"))&&f.push(m);t.h&&!("height"in r)&&f.push("height"),t.b&&!("block-size"in r)&&f.push("block-size");let d=new Set(f),h=[e.tagName.toLowerCase()];for(let m in r)d.has(m)||h.push(m,r[m]);return t.rr=f,t.sig=h.join("")+""+f.join(""),f}function Oi(t,e,n,r,i){let o=i&&i.__styleShare?r&&r.__styleShare:null,s=o?o.ids.get(t):void 0;if(s===void 0||s===-1||t.shadowRoot||t.assignedSlot)return Ce(n,kn(t));let a=s+e,c=o.pseudo||(o.pseudo=new Map),u=c.get(a);if(u){let f={...u.snap},d=u.rr||Ii(u,t);for(let h=0;h<d.length;h++){let m=n.getPropertyValue(d[h]);m?f[d[h]]=m:delete f[d[h]]}return f}let l=Ce(n,kn(t));return c.set(a,{snap:l,rr:null,sig:null,h:"height"in l,b:"block-size"in l}),l}function ul(t,e=null,n={},r=null,i=null){let o=ie.get(t),s=!!(n&&n.embedFonts),a=n&&n.excludeStyleProps||null;if(typeof a!="function"&&o&&Kr(o,t)&&o.embedFonts===s&&o.excludeStyleProps===a)return o.snapshot;let c=e||getComputedStyle(t),u,l=null,f=r&&r.st.snaps.get(r.id);if(f){u={...f.snap};let p=f.rr||Ii(f,t);l=[];for(let g=0;g<p.length;g++){let y=p[g],b=c.getPropertyValue(y);b?u[y]=b:delete u[y],l.push(b)}Object.defineProperty(u,"__needsBgInline",{value:f.snap.__needsBgInline,enumerable:!1}),f.snap.__bgClipTextFix!==void 0&&Object.defineProperty(u,"__bgClipTextFix",{value:f.snap.__bgClipTextFix,enumerable:!1})}else u=Qc(c,n,t,an(t,i)),r&&r.st.snaps.set(r.id,{snap:u,rr:null,sig:null,h:"height"in u,b:"block-size"in u});let d=!1;if(typeof t.computedStyleMap=="function"){let p;for(let g of vi)if(u[g]==="0px")try{p||=t.computedStyleMap(),p.get(g)?.toString()==="auto"&&(u[g]="auto",d=!0)}catch{}}El(t,c,u);let h=bl(t,c,u);l!==null&&(d&&l.push("",...vi.map(p=>u[p])),h&&l.push(""+h),Hr.set(u,f.sig+""+l.join("")+("height"in u?"":"")+("block-size"in u?"":"")));let m=qr(t);return ie.set(t,{env:Ft,stamp:An(t,m),hosts:m,snapshot:u,embedFonts:s,excludeStyleProps:a}),u}function dl(t,e){if(t&&t.session&&t.persist)return t;if(t&&(t.styleMap||t.styleCache||t.nodeMap)){let n=t.__ctx;return(!n||t.__ctxOpts!==e)&&(n={session:t,persist:{snapshotKeyCache:Wr,defaultStyle:I.defaultStyle,baseStyle:I.baseStyle,image:I.image,resource:I.resource,background:I.background},options:e||{}},t.__ctx=n,t.__ctxOpts=e),n}return{session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},persist:{snapshotKeyCache:Wr,defaultStyle:I.defaultStyle,baseStyle:I.baseStyle,image:I.image,resource:I.resource,background:I.background},options:t||e||{}}}var pl=/%|[\d.](?:em|rem|ex|ch|cap|ic|lh|rlh|v[whib]|vmin|vmax|cq[whbi]|cqmin|cqmax)\b|\b(?:calc|var|min|max|clamp|env|attr)\(|\b(?:auto|inherit|initial|unset|revert|currentcolor|-webkit-fill-available|fit-content|min-content|max-content)\b/i,hl=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";function ml(t,e,n){if(!t.style||t.style.length===0)return;let r=Xc(t),i=r!=null&&!pl.test(t.getAttribute("style")||"");for(let o=0;o<t.style.length;o++){let s=t.style[o];if(i&&!r.has(s)&&!(s.startsWith("background")&&hl(t)))continue;let a=n.getPropertyValue(s);a&&e.style.setProperty(s,a,t.style.getPropertyPriority(s))}}function dt(t,e,n,r){if(t.tagName==="STYLE")return;let i=dl(n,r),o=i.options&&i.options.cache||"soft";o!=="disabled"&&Re(t.ownerDocument),o==="disabled"&&!i.session.__bumpedForDisabled&&($t(),Wr.clear(),i.session.__bumpedForDisabled=!0);let{session:s,persist:a}=i;if(!s.styleCache.has(t)){let y=null;try{y=getComputedStyle(t)}catch{}s.styleCache.set(t,y||getComputedStyle((t.ownerDocument||document).documentElement))}let c=s.styleCache.get(t);t.getAttribute?.("style")&&ml(t,e,c);let u=c.getPropertyValue("animation-name");e&&e.style&&u&&u!=="none"&&e.style.setProperty("animation","none","important");let l=t.tagName?.toLowerCase()||"div";if(Je.has(l)){let y={};Object.defineProperty(y,"__needsBgInline",{value:Li(c),enumerable:!1});let b=qr(t);ie.set(t,{env:Ft,stamp:An(t,b),hosts:b,snapshot:y,embedFonts:!!(i.options&&i.options.embedFonts),excludeStyleProps:i.options&&i.options.excludeStyleProps||null}),s.styleMap.set(e,"");return}let f=null;if(i.options&&i.options.__styleShare&&s.styleMap){let y=ll(s),b=fl(t,y),w=t.ownerDocument||document,v=w.activeElement;b!==-1&&!cl.has(t.tagName)&&!(v&&v!==w.body&&v!==w.documentElement&&v===t)&&(!t.getRootNode||t.getRootNode()===w)&&!t.shadowRoot&&!t.assignedSlot&&(f={st:y,id:b})}let d=ul(t,c,i.options,f,s);if(t.getAttribute?.("style"))for(let y of["top","right","bottom","left"]){let b=`margin-${y}`;d[b]==="auto"&&e.style.setProperty(b,"auto","important")}d.__bgClipTextFix&&e&&e.style&&(e.style.setProperty("background-image","none","important"),e.style.setProperty("background-color","transparent","important"),e.style.setProperty("color",d.__bgClipTextFix,"important"),e.style.setProperty("-webkit-text-fill-color",d.__bgClipTextFix,"important")),gl(t,c,d),e.style?.length&&d["box-sizing"]==="border-box"&&c.getPropertyValue("box-sizing")!=="border-box"&&xl(t,e,d);let h=Ui(t);if(Cl(t,e,d,h,s),h){let y=c.getPropertyValue("min-width");(!y||y==="auto"||y==="0px")&&(d["min-width"]="0px")}let m=il(d,l),p=!0;if(vn(l,(d.display||"").toLowerCase())){p=tl(t),p&&Ir(l,d,h)&&el(t,c,h)&&(p=!1),m=`${m}${p?"|c":""}${h?"|f":""}`;let y=d["text-wrap-mode"]||d["white-space"]||"";p&&y!=="nowrap"&&y!=="pre"&&(s.reconcileRisk=(s.reconcileRisk||0)+1)}let g=a.snapshotKeyCache.get(m);g===void 0&&(g=ve(d,l,p,h),a.snapshotKeyCache.size>=jc&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(m,g)),s.styleMap.set(e,g)}function gl(t,e,n){let r=e.getPropertyValue("overflow-x"),i=e.getPropertyValue("overflow-y");if((r==="visible"||!r)&&(i==="visible"||!i)||e.getPropertyValue("box-sizing")==="border-box"||typeof t.clientWidth!="number"||!t.offsetWidth)return;let o=u=>parseFloat(u)||0,s=t.offsetWidth-t.clientWidth-o(e.getPropertyValue("border-left-width"))-o(e.getPropertyValue("border-right-width")),a=t.offsetHeight-t.clientHeight-o(e.getPropertyValue("border-top-width"))-o(e.getPropertyValue("border-bottom-width")),c=(u,l)=>{let f=n[u];if(!f||!f.endsWith("px"))return;let d=parseFloat(f);Number.isFinite(d)&&(n[u]=`${Math.round((d+l)*1e3)/1e3}px`)};s>=2&&(c("width",s),c("inline-size",s)),a>=2&&(c("height",a),c("block-size",a))}var yl=["border-top-width","border-right-width","border-bottom-width","border-left-width"],Di=["width","inline-size","height","block-size"];function bl(t,e,n){if(!yl.some(c=>n[c]?.includes("."))||e.getPropertyValue("box-sizing")==="border-box"||n.display==="inline")return"";for(let c of["width","height"]){let u=n[`min-${c}`],l=n[`max-${c}`];if(u&&u!=="0px"&&u!=="auto"||l&&l!=="none")return""}let r=c=>parseFloat(n[c])||0,i=r("padding-left")+r("padding-right")+r("border-left-width")+r("border-right-width"),o=r("padding-top")+r("padding-bottom")+r("border-top-width")+r("border-bottom-width"),s=(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb";for(let c of Di){let u=n[c];if(!u||!u.endsWith("px"))continue;let f=c==="width"||c==="inline-size"&&!s||c==="block-size"&&s?i:o;n[c]=`${Math.round((parseFloat(u)+f)*1e3)/1e3}px`}n["box-sizing"]="border-box";let a="";if(e.getPropertyValue("overflow-x")==="auto"){let c=t.scrollWidth<=t.clientWidth;n["overflow-x"]=c?"hidden":"auto",c&&(a+="x")}if(e.getPropertyValue("overflow-y")==="auto"){let c=t.scrollHeight<=t.clientHeight;n["overflow-y"]=c?"hidden":"auto",c&&(a+="y")}return a}var wl=["box-sizing",...Di,"overflow-x","overflow-y"],Sl=/(?:box-sizing|width|height|inline-size|block-size|overflow(?:-[xy])?)\s*:/i;function xl(t,e,n){if(Sl.test(t.getAttribute("style")))for(let r of wl)e.style.getPropertyValue(r)&&n[r]&&e.style.setProperty(r,n[r],e.style.getPropertyPriority(r))}function vl(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}var Ei=typeof CSS<"u"&&CSS.supports?.("text-wrap-mode","nowrap")?"text-wrap-mode":"white-space";function Cl(t,e,n,r,i){let o=n.display||"";if(!r&&!o.startsWith("inline-")&&(n.float||"none")==="none"&&n.position!=="absolute"&&n.position!=="fixed")return;let s=n["text-wrap-mode"]||n["white-space"]||"";if(s==="nowrap"||s==="pre"||Ei==="white-space"&&s!=="normal"||(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb"||!e.style)return;let a=i.__oneLine||=new WeakSet;for(let c=t.parentElement;c;c=c.parentElement)if(a.has(c))return;kl(t,n,i)&&(a.add(t),e.style.setProperty(Ei,"nowrap"))}function kl(t,e,n){let r=t.clientHeight-(parseFloat(e["padding-top"])||0)-(parseFloat(e["padding-bottom"])||0);if(r>3*(parseFloat(e["font-size"])||16)||e["word-break"]==="normal"&&e["overflow-wrap"]==="normal"&&/^[\w\u00C0-\u024F.,:;!?'"()%]*$/.test(t.textContent.trim()))return!1;let i=t.ownerDocument||document,o=i.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),s=i.createRange(),a=null,c=0,u=0;for(let d=o.nextNode();d;d=o.nextNode()){if(d.nodeType===1){if(d.shadowRoot||d.localName==="br"||d.localName==="textarea")return!1;continue}if(/\S/.test(d.data)){if(++u>64)return!1;s.selectNodeContents(d);for(let h of s.getClientRects())if(h.height){if(a||=h,Math.min(a.bottom,h.bottom)-Math.max(a.top,h.top)<Math.min(a.height,h.height)/2)return!1;c=Math.max(c,h.height)}}}if(!a)return!1;let l=Bi(t,n.__axes||=new WeakMap);if(!l)return!1;let f=l===Wi&&t.offsetHeight?t.getBoundingClientRect().height/t.offsetHeight:1;return r*f<=2*c}var Ml=0,Ri=1,Wi=2;function Bi(t,e){let n=e.get(t);if(n!==void 0)return n;let r=O(t),i=r.transform,o=i&&i!=="none"?i.slice(i.indexOf("(")+1,-1).split(",").map(parseFloat):null;if(r.rotate&&r.rotate!=="none"||o&&(i.startsWith("matrix3d")?o[1]||o[4]:o[1]||o[2]))n=Ml;else{let s=t.parentElement||t.getRootNode?.().host;n=s?Bi(s,e):Ri,n===Ri&&(r.scale&&r.scale!=="none"||r.zoom&&r.zoom!=="1"||o&&(i.startsWith("matrix3d")?o[0]!==1||o[5]!==1:o[0]!==1||o[3]!==1))&&(n=Wi)}return e.set(t,n),n}function Ui(t){let e=t.parentElement;if(!e)return!1;let n=O(e).display||"";return n.includes("flex")||n.includes("grid")}function Al(t){for(let r=t.firstChild;r;r=r.nextSibling)if(r.nodeType===3&&/\S/.test(r.nodeValue))return!0;let e=t.firstElementChild,n=t.lastElementChild;if(e&&e.tagName==="BR"||n&&n.tagName==="BR")return!0;for(let r=t.firstElementChild;r;r=r.nextElementSibling){let i=O(r);if(i.display==="none")continue;let o=i.position;if(o!=="absolute"&&o!=="fixed")return!0}return!1}function _l(t){let e=t.getBoundingClientRect().top,n=-1/0,r=null;for(let i=t.firstChild;i;i=i.nextSibling){if(i.nodeType===3){if(!/\S/.test(i.nodeValue||""))continue;r=r||document.createRange(),r.selectNode(i);let a=r.getBoundingClientRect();(a.width||a.height)&&(n=Math.max(n,a.bottom));continue}if(i.nodeType!==1)continue;let o=O(i);if(o.display==="none")continue;let s=o.position;s==="absolute"||s==="fixed"||o.float&&o.float!=="none"||(n=Math.max(n,i.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-e}function El(t,e,n){if(Rt(t)&&t.style&&t.style.height)return;let r=t.tagName&&t.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r)||e.aspectRatio&&e.aspectRatio!=="none"&&e.aspectRatio!=="auto")return;let o=e.display||"";if(o.includes("flex")||o.includes("grid"))return;let s=e.position;if(s==="absolute"||s==="fixed"||s==="sticky"||e.transform!=="none"||vl(e)||Ui(t))return;let a=e.overflowX||e.overflow||"visible",c=e.overflowY||e.overflow||"visible";if(a!=="visible"||c!=="visible")return;let u=e.clip;if(u&&u!=="auto"&&u!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||!Al(t))return;let l=parseFloat(e.height),f=_l(t);Number.isFinite(l)&&Number.isFinite(f)&&Math.abs(l-f)>2||(delete n.height,delete n["block-size"])}ke();var Rl=new Set(["symbol","defs"]),Fl=new Set(["mask","clipPath","linearGradient","radialGradient","pattern","marker","filter"]),Qr=new WeakMap,zi=-1;function En(t){let e=Wt();return e!==zi&&(Qr=new WeakMap,zi=e),Hi(t)}function Hi(t){let e=Qr.get(t);if(e!==void 0)return e;let n;if(t.namespaceURI==="http://www.w3.org/2000/svg"&&(Fl.has(t.localName)?n=!1:Rl.has(t.localName)&&(n=!0)),n===void 0){let r=t.parentNode;n=!!(r&&r.nodeType===1)&&Hi(r)}return Qr.set(t,n),n}function ji(t,e){if(t?.nodeType!==1||e?.nodeType!==1||En(t))return;let n=t.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(a&&typeof a.value=="string"&&!a.value.startsWith("data:")&&a.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(t)}catch{}if(r){let o=t.style;if(o&&o.length){let s=new Set;for(let a=0;a<o.length;a++){let c=o[a];if(s.has(c))continue;s.add(c);let u=o.getPropertyValue(c);if(!u||!u.includes("var("))continue;let l=i&&i.getPropertyValue(c);if(l)try{e.style.setProperty(c,l.trim(),o.getPropertyPriority(c))}catch{}}}}if(r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(!a||typeof a.value!="string"||a.value.startsWith("data:")||!a.value.includes("var("))continue;let c=a.name,u=i&&i.getPropertyValue(c);if(u)try{e.style.setProperty(c,u.trim())}catch{}}}}St();St();yt();we();xn();kt();function Te(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:"))}function Pe(t,e){if(!t)return null;let n=0;try{n=e?e.getBoundingClientRect().width||e.width:0}catch{}n||(n=window.innerWidth||1e3);let r=[];for(let o of t.split(",")){let s=o.trim().split(/\s+/);if(!s[0])continue;let a=s[1]||"",c=1;/^\d*\.?\d+x$/i.test(a)?c=parseFloat(a):/^\d+w$/i.test(a)&&(c=parseInt(a,10)/n),r.push({url:s[0],d:c})}if(!r.length)return null;r.sort((o,s)=>o.d-s.d);let i=window.devicePixelRatio||1;return(r.find(o=>o.d>=i)||r[r.length-1]).url}function Vi(t,e){let n=t.currentSrc||"";if(n&&!Te(n))return n;let r=e.querySelectorAll("source[srcset]"),i=null;for(let o of r){let s=o.getAttribute("srcset");if(!s||Te(s))continue;let a=o.getAttribute("type");if(a&&!kr.test(a.trim()))continue;let c=o.getAttribute("media");if(c)try{if(window.matchMedia(c).matches)return Pe(s,t)}catch{}i||(i=Pe(s,t))}return i}function qi(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let r of e)if(r&&!Te(r))return r;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let r=n.split(",")[0].trim().split(/\s+/)[0];if(r&&!Te(r))return r}return null}Mt();mt();function Tl(t,e){if(t=t.trim(),!t)return t;let n=e?`[data-sd-slotted~="${e}"]`:"[data-sd-slotted]";return t.endsWith(":not([data-sd-slotted])")||t.endsWith(`:not(${n})`)?t:`${t}:not(${n})`}var Pl=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,$l=/^::?(?:before|after|first-letter)$/;function Nl(t,e,n=!0,r){return $r(t,",").map(i=>i.trim()).filter(Boolean).map(i=>{if(i.startsWith(":where(")&&i.includes("data-sd")||i.startsWith("@"))return i;let o=i.match(Pl);if(o&&$l.test(o[0]))return":not(*)";let s=o?i.slice(0,o.index).trim():i,a=n?Tl(s,r):s;return`:where(${e} ${a})${o?o[0]:""}`}).join(", ")}function Yi(t,e,n){return t?(t=t.replace(/:host-context\(([^)]+)\)/g,(r,i)=>`:where(:where(${i.trim()}) ${e})`),t=t.replace(/:host\(([^)]+)\)/g,(r,i)=>`:where(${e}:is(${i.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(r,i)=>`:where(${e} ${i.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(r,i,o,s)=>{let a=Nl(s,e,!0,n);return`${i}${o}${a}{`}),t):""}function Ki(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function le(t){let e="";for(let n of t)if(n.media&&n.cssRules){let r=!1;try{r=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}r&&(e+=le(n.cssRules))}else if(n.constructor?.name==="CSSSupportsRule")e+=`@supports ${n.conditionText}{${le(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let r=n.cssText.slice(0,n.cssText.indexOf("{")+1);e+=r+(n.style?n.style.cssText:"")+le(n.cssRules)+"}"}else e+=n.cssText+`
|
|
9
|
-
`;return e}function
|
|
10
|
-
`});let n=t.adoptedStyleSheets||[];for(let r of n)try{r&&r.cssRules&&(e+=
|
|
11
|
-
`:""}function ns(t,e){if(!t)return;let n=r=>{let i=r.getAttribute("data-sd-slotted")||"";e?` ${i} `.includes(` ${e} `)||r.setAttribute("data-sd-slotted",i?`${i} ${e}`:e):r.setAttribute("data-sd-slotted",i)};t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll?.("*").forEach(n)}async function Il(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<e&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function Ol(t){let e=t.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,r=parseFloat(c.borderRightWidth)||0,i=parseFloat(c.borderTopWidth)||0,o=parseFloat(c.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+r))),a=Math.max(0,Math.round(e.height-(i+o)));return{contentWidth:s,contentHeight:a,rect:e}}function xt(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let r=getComputedStyle(t);if(e===0){let i=parseFloat(r.width);!isNaN(i)&&i>0&&(e=i)}if(n===0){let i=parseFloat(r.height);!isNaN(i)&&i>0&&(n=i)}}catch{}if(e===0||n===0)try{if(e===0){let r=parseFloat(t.getAttribute("width"));!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(t.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}function Dl(t,e,n){let r=t.defaultView,i=r?r.scrollX:0,o=r?r.scrollY:0,s=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,c=t.documentElement?t.documentElement.scrollLeft:0,u=t.documentElement?t.documentElement.scrollTop:0,l=0,f=0,d=0,h=0;try{let p=r&&t.body?r.getComputedStyle(t.body):null;p&&(l=(parseFloat(p.marginTop)||0)+(parseFloat(p.paddingTop)||0),f=(parseFloat(p.marginRight)||0)+(parseFloat(p.paddingRight)||0),d=(parseFloat(p.marginBottom)||0)+(parseFloat(p.paddingBottom)||0),h=(parseFloat(p.marginLeft)||0)+(parseFloat(p.paddingLeft)||0))}catch{}let m=t.createElement("style");if(m.setAttribute("data-sd-iframe-pin",""),Z(m),m.textContent=`html {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${l}px ${f}px ${d}px ${h}px !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(m),ce(t.documentElement),i||o)try{t.body&&(t.body.scrollLeft=i,t.body.scrollTop=o),t.documentElement&&(t.documentElement.scrollLeft||(t.documentElement.scrollLeft=i),t.documentElement.scrollTop||(t.documentElement.scrollTop=o))}catch{}return()=>{try{m.remove()}catch{}try{r&&typeof r.scrollTo=="function"&&r.scrollTo(i,o),t.body&&(t.body.scrollLeft=s,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=c,t.documentElement.scrollTop=u)}catch{}ce(t.documentElement)}}async function Jr(t,e,n){let r=await Il(t,3);if(!r)throw new Error("The iframe document isn't ready.");let{contentWidth:i,contentHeight:o,rect:s}=Ol(t),a=n?.snap;if(!a||typeof a.toPng!="function")throw new Error("Iframes are only captured through snapdom(el).");let c={...n,scale:1,clip:null,__pinned:!0},u=Dl(r,i,o),l;try{l=await a.toPng(r.documentElement,c)}finally{u()}l.style.display="block",l.style.width=`${i}px`,l.style.height=`${o}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),dt(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(s.width)}px`),f.style.height||(f.style.height=`${Math.round(s.height)}px`),f.appendChild(l),f}function rs(t){try{let e=t&&t.accentColor;if(e&&e!=="auto"&&e!=="none")return e;let n=t&&t.color;if(n)return n}catch{}return"#0a6ed1"}function os(t){let{width:e,height:n}=xt(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Number.isFinite(o)&&o>0?o:e||r.width||128,c=Number.isFinite(s)&&s>0?s:n||r.height||16,u=Number.parseFloat(t.min)||0,l=Number.isFinite(Number.parseFloat(t.max))?Number.parseFloat(t.max):100,f=Number.parseFloat(t.value),d=l-u,h=d>0&&Number.isFinite(f)?Math.min(1,Math.max(0,(f-u)/d)):.5,m="middle";try{i&&i.verticalAlign&&(m=i.verticalAlign)}catch{}let p=document.createElement("div");p.setAttribute("data-snapdom-input-replacement","range"),p.style.cssText=`display:inline-block;width:${a}px;height:${c}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let g=document.createElementNS("http://www.w3.org/2000/svg","svg");g.setAttribute("width",String(a)),g.setAttribute("height",String(c)),g.setAttribute("viewBox",`0 0 ${a} ${c}`),g.style.cssText=`width:${a}px;height:${c}px;overflow:visible`,p.appendChild(g);function y(){let b=rs(i),w=!!t.disabled,v=Math.max(2,Math.min(4,c)),C=(c-v)/2,S=Math.max(10,Math.min(14,Math.max(c,10))),M=S/2,_=M+h*Math.max(0,a-S);g.innerHTML="";let E=(k,R,T,L)=>{let W=document.createElementNS("http://www.w3.org/2000/svg","rect");W.setAttribute("x",String(k)),W.setAttribute("y",String(C)),W.setAttribute("width",String(Math.max(0,R))),W.setAttribute("height",String(v)),W.setAttribute("rx",String(v/2)),W.setAttribute("fill",T),L&&W.setAttribute("fill-opacity",L),g.appendChild(W)};E(0,a,"#808080","0.4"),E(0,_,b);let x=document.createElementNS("http://www.w3.org/2000/svg","circle");x.setAttribute("cx",String(_)),x.setAttribute("cy",String(c/2)),x.setAttribute("r",String(M)),x.setAttribute("fill",b),g.appendChild(x),w&&g.setAttribute("opacity","0.5"),p.style.setProperty("width",`${a}px`,"important"),p.style.setProperty("height",`${c}px`,"important"),p.style.setProperty("min-width",`${a}px`,"important"),p.style.setProperty("min-height",`${c}px`,"important")}return y(),{el:p,applyVisual:y}}function is(t){let{width:e,height:n}=xt(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Math.round(e||r.width||0),c=Math.round(n||r.height||0),u=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,a||16),l=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,c||16),f=(t.type||"text").toLowerCase()==="checkbox",d=!!t.checked,h=!!t.indeterminate,p=Math.max(Math.min(u,l),12),g=Math.max(u,p),y=Math.max(l,p),b="middle";try{i&&i.verticalAlign&&(b=i.verticalAlign)}catch{}let w=document.createElement("div");w.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),w.style.cssText=`display:inline-block;width:${g}px;height:${y}px;vertical-align:${b};flex-shrink:0;line-height:0;`;let v=document.createElementNS("http://www.w3.org/2000/svg","svg");v.setAttribute("width",String(g)),v.setAttribute("height",String(y)),v.setAttribute("viewBox",`0 0 ${p} ${p}`),v.style.cssText=`width:${g}px;height:${y}px`,w.appendChild(v);function C(){let S=rs(i),M=2,_=M/2,E=p-M;if(v.innerHTML="",f){let x=document.createElementNS("http://www.w3.org/2000/svg","rect");if(x.setAttribute("x",String(_)),x.setAttribute("y",String(_)),x.setAttribute("width",String(E)),x.setAttribute("height",String(E)),x.setAttribute("rx","2"),x.setAttribute("ry","2"),x.setAttribute("fill",d?S:"none"),x.setAttribute("stroke",S),x.setAttribute("stroke-width",String(M)),v.appendChild(x),d){let k=document.createElementNS("http://www.w3.org/2000/svg","path");k.setAttribute("d",`M ${_+2} ${p/2} L ${p/2-1} ${p-_-2} L ${p-_-2} ${_+2}`),k.setAttribute("stroke","white"),k.setAttribute("stroke-width",String(Math.max(1.5,M))),k.setAttribute("fill","none"),k.setAttribute("stroke-linecap","round"),k.setAttribute("stroke-linejoin","round"),v.appendChild(k)}else if(h){let k=document.createElementNS("http://www.w3.org/2000/svg","rect"),R=Math.max(6,E-4);k.setAttribute("x",String((p-R)/2)),k.setAttribute("y",String((p-M)/2)),k.setAttribute("width",String(R)),k.setAttribute("height",String(M)),k.setAttribute("fill",S),k.setAttribute("rx","1"),v.appendChild(k)}}else{let x=document.createElementNS("http://www.w3.org/2000/svg","circle");if(x.setAttribute("cx",String(p/2)),x.setAttribute("cy",String(p/2)),x.setAttribute("r",String((p-M)/2)),x.setAttribute("fill",d?S:"none"),x.setAttribute("stroke",S),x.setAttribute("stroke-width",String(M)),v.appendChild(x),d){let k=document.createElementNS("http://www.w3.org/2000/svg","circle"),R=Math.max(2,(p-M*2)*.35);k.setAttribute("cx",String(p/2)),k.setAttribute("cy",String(p/2)),k.setAttribute("r",String(R)),k.setAttribute("fill","white"),v.appendChild(k)}}w.style.setProperty("width",`${g}px`,"important"),w.style.setProperty("height",`${y}px`,"important"),w.style.setProperty("min-width",`${g}px`,"important"),w.style.setProperty("min-height",`${y}px`,"important")}return C(),{el:w,applyVisual:C}}var cn=new lt(80);async function Wl(t){if(I.resource?.has(t))return I.resource.get(t);if(cn.has(t))return cn.get(t);let e=(async()=>{let n=await ft(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`Couldn't read ${t}`);return I.resource?.set(t,n.data),n.data})();cn.set(t,e);try{let n=await e;return cn.set(t,n),n}catch(n){throw cn.delete(t),n}}var Gi=/\bblob:[^)"'\s]+/g;function Rn(t){return typeof t=="string"&&t.startsWith("blob:")}function Bl(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function Ul(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function ln(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function Fn(t,e=null){if(!t)return;let n=e,r=new Set,i=[],o=new Map,s=(p,g,y,b)=>{r.add(y),i.push(()=>{o.has(y)&&(p.setAttribute(g,o.get(y)),b?.())})},a=(p,g)=>{if(!p||!p.includes("blob:"))return;let y=p.match(Gi)||[];if(y.length){for(let b of y)r.add(b);i.push(()=>{let b=p.replace(Gi,w=>o.get(w)||w);b!==p&&g(b)})}},c=ln(t,"img");for(let p of c)try{let y=p.getAttribute("src")||p.currentSrc||"";Rn(y)&&s(p,"src",y);let b=p.getAttribute("srcset");if(b&&b.includes("blob:")){let w=Bl(b);for(let v of w)Rn(v.url)&&r.add(v.url);i.push(()=>{let v=!1;for(let C of w)o.has(C.url)&&(C.url=o.get(C.url),v=!0);v&&p.setAttribute("srcset",Ul(w))})}}catch(g){H(n,"Couldn't inline a blob: image.",g)}let u=ln(t,"image");for(let p of u)try{let g="http://www.w3.org/1999/xlink",y=p.getAttribute("href")||p.getAttributeNS?.(g,"href");Rn(y)&&s(p,"href",y,()=>p.removeAttributeNS?.(g,"href"))}catch(g){H(n,"Couldn't inline a blob: SVG image.",g)}let l=ln(t,"[style*='blob:']");for(let p of l)try{let g=p.getAttribute("style");a(g,y=>p.setAttribute("style",y))}catch(g){H(n,"Couldn't inline blob: URLs in a style attribute.",g)}let f=ln(t,"style");for(let p of f)try{let g=p.textContent||"";a(g,y=>{p.textContent=y})}catch(g){H(n,"Couldn't inline blob: URLs in a <style>.",g)}let d=["poster"];for(let p of d){let g=ln(t,`[${p}^='blob:']`);for(let y of g)try{let b=y.getAttribute(p);Rn(b)&&s(y,p,b)}catch(b){H(n,`Couldn't inline the blob: URL in ${p}.`,b)}}if(!r.size)return;let h=[...r],m=0;await Promise.all(Array.from({length:Math.min(4,h.length)},async()=>{for(;m<h.length;){let p=h[m++];try{o.set(p,await Wl(p))}catch(g){H(n,"Couldn't read a blob: URL; kept it as is.",g)}}}));for(let p of i)try{p()}catch(g){H(n,"Couldn't write an inlined blob: URL.",g)}}var zl=["font-family","font-size","font-style","font-weight","font-stretch","font-variant","font-feature-settings","font-variation-settings","font-kerning","letter-spacing","text-transform"],Hl=new Set(["text","search","email","url","tel","number","submit","reset","button"]),jl=/[^\s\uD800-\uDFFF]{2,}/;function ss(t,e=document){let n=e.defaultView||window;if(!wt()||!e.body||!(n.visualViewport?.scale<1||n.screen.width<e.documentElement.clientWidth))return;let r=Z(e.createElement("div"));r.style.cssText="position:absolute;left:0;top:0;width:0;height:0;overflow:hidden;visibility:hidden";let i=[];for(let[o,s]of t){if(o.nodeType!==1||s.nodeType!==1)continue;let a=n.getComputedStyle(s),c=s.localName==="textarea"||s.localName==="input"&&Hl.has(s.type)?ql(s,a,e):Vl(s);if(!c)continue;let u=s.getBoundingClientRect(),l=s.offsetWidth&&u.width?u.width/s.offsetWidth:1,f=e.createElement("span");f.style.whiteSpace="pre";for(let d of zl)f.style.setProperty(d,a.getPropertyValue(d));f.textContent=c.word,r.appendChild(f),i.push({clone:o,cs:a,span:f,live:c.distance/l,centers:c.centers})}if(i.length){e.body.appendChild(r);try{for(let{clone:o,cs:s,span:a,live:c,centers:u}of i){let l=a.firstChild,f=(parseFloat(s.letterSpacing)||0)*(u?l.length-1:l.length),d=u?Math.abs(Xi(l,l.length-1)-Xi(l,0)):a.getBoundingClientRect().width,h=(c-f)/(d-f);h>1.005&&Number.isFinite(h)&&(o.style.setProperty("font-size",`${parseFloat(s.fontSize)*h}px`),s.lineHeight!=="normal"&&o.style.setProperty("line-height",`${parseFloat(s.lineHeight)*h}px`))}}finally{r.remove()}}}function Xi(t,e){let n=t.ownerDocument.createRange();n.setStart(t,e),n.setEnd(t,e+1);let r=n.getBoundingClientRect();return r.left+r.width/2}function Vl(t){for(let e=t.firstChild;e;e=e.nextSibling){if(e.nodeType!==3)continue;let n=/\S+/.exec(e.data);if(!n)continue;let r=t.ownerDocument.createRange();r.setStart(e,n.index),r.setEnd(e,n.index+n[0].length);let i=r.getClientRects();return i.length===1?{word:n[0],distance:i[0].width,centers:!1}:null}return null}function ql(t,e,n){let r=jl.exec(t.value.split(`
|
|
12
|
-
`)[0]);if(!r||t.scrollLeft||t.scrollTop||!n.caretPositionFromPoint)return null;let i=t.getBoundingClientRect(),o=t.localName==="textarea"?i.top+(parseFloat(e.borderTopWidth)||0)+(parseFloat(e.paddingTop)||0)+3:i.top+i.height/2,s=l=>{let f=n.caretPositionFromPoint(l,o);return f&&f.offsetNode===t?f.offset:-1},a=i.width/16,c=l=>{let f=i.left;for(;f<=i.right&&s(f)<l;)f+=a;if(f>i.right)return NaN;let d=f-a;for(let h=0;h<16;h++){let m=(d+f)/2;s(m)>=l?f=m:d=m}return f},u=Math.abs(c(r.index+r[0].length)-c(r.index+1));return Number.isFinite(u)?{word:r[0],distance:u,centers:!0}:null}mt();var as=new Set(["rgba(0, 0, 0, 0)","transparent"]),Zr="Highlight";function cs(t){let n=(t.ownerDocument||document).getSelection?.();if(!n||n.isCollapsed||n.rangeCount===0)return null;let r=[];for(let i=0;i<n.rangeCount;i+=1){let o=n.getRangeAt(i);if(!o.collapsed)try{o.intersectsNode(t)&&r.push(o)}catch{}}return r.length?{ranges:r,styles:new Map}:null}function Gl(t,e){if(e.styles.has(t))return e.styles.get(t);let n;try{let r=getComputedStyle(t);if(r.userSelect==="none"||r.webkitUserSelect==="none"||r.getPropertyValue("-webkit-user-select")==="none")return e.styles.set(t,null),null;let i=getComputedStyle(t,"::selection"),o=[],s=i.backgroundColor,a=s&&!as.has(s)&&s!==r.backgroundColor;o.push(`background-color:${a?s:Zr}`),i.color&&i.color!==r.color&&o.push(`color:${i.color}`,`-webkit-text-fill-color:${i.color}`),i.textShadow&&i.textShadow!==r.textShadow&&o.push(`text-shadow:${i.textShadow}`),i.textDecorationLine&&i.textDecorationLine!=="none"&&i.textDecorationLine!==r.textDecorationLine&&o.push(`text-decoration:${i.textDecorationLine} ${i.textDecorationStyle||"solid"} ${i.textDecorationColor||"currentcolor"}`),n=o.join(";")}catch{n=`background-color:${Zr}`}return e.styles.set(t,n),n}function ls(t,e){let n=t.data;if(!n)return null;let r=t.parentElement;if(!r)return null;let i=[];for(let u of e.ranges){let l=!1;try{l=u.intersectsNode(t)}catch{}if(!l)continue;let f=u.startContainer===t?u.startOffset:0,d=u.endContainer===t?u.endOffset:n.length;d>f&&i.push([f,d])}if(i.length===0)return null;let o=Gl(r,e);if(!o)return null;i.sort((u,l)=>u[0]-l[0]);let s=t.ownerDocument||document,a=s.createDocumentFragment(),c=0;for(let[u,l]of i){u>c&&a.append(s.createTextNode(n.slice(c,u)));let f=s.createElement("span");f.setAttribute("data-snapdom-selection",""),f.setAttribute("style",`all:unset;${o}`),f.textContent=n.slice(u,l),a.append(f),c=l}return c<n.length&&a.append(s.createTextNode(n.slice(c))),a}var Tn=t=>Number.parseFloat(t)||0,Xl=["font-family","font-size","font-weight","font-style","font-variant","font-stretch","letter-spacing","word-spacing","text-transform","text-indent","text-align","line-height","tab-size","direction"];function Yl(t,e){try{let r=getComputedStyle(t,"::selection").backgroundColor;if(r&&!as.has(r)&&r!==e.backgroundColor)return r}catch{}return Zr}function fs(t,e){let n=t.ownerDocument||document;if(n.activeElement!==t)return;let r=null,i=null;try{r=t.selectionStart,i=t.selectionEnd}catch{return}if(r==null||i==null||r===i)return;let o=t.value||"";if(t.localName==="input"&&t.type==="password"&&(o="\u2022".repeat(o.length)),!o)return;let s=getComputedStyle(t),a=t.localName==="textarea",c=Tn(s.paddingLeft),u=Tn(s.paddingTop),l=t.clientWidth-c-Tn(s.paddingRight),f=t.clientHeight-u-Tn(s.paddingBottom),d=n.createElement("div");d.style.cssText="position:absolute;top:0;left:-99999px;visibility:hidden;margin:0;border:0;padding:0;box-sizing:content-box;";for(let g of Xl)d.style.setProperty(g,s.getPropertyValue(g));a?(d.style.whiteSpace="pre-wrap",d.style.overflowWrap="break-word",d.style.width=`${Math.max(0,l)}px`):d.style.whiteSpace="pre";let h=n.createElement("span");h.textContent=o.slice(r,i),d.append(n.createTextNode(o.slice(0,r)),h,n.createTextNode(o.slice(i))),n.body.appendChild(d);let m=[];try{let g=d.getBoundingClientRect(),y=-t.scrollLeft,b=-t.scrollTop;if(!a){b+=Math.max(0,(f-g.height)/2);let w=s.direction==="rtl",v=s.textAlign;v==="start"?v=w?"right":"left":v==="end"&&(v=w?"left":"right");let C=l-g.width;C>0&&(v==="right"?y+=C:v==="center"&&(y+=C/2))}for(let w of h.getClientRects())w.width<=0||w.height<=0||m.push({x:c+(w.left-g.left)+y,y:u+(w.top-g.top)+b,width:w.width,height:w.height})}finally{d.remove()}if(m.length===0)return;let p=Yl(t,s);e.__snapdomFieldSelection={images:m.map(()=>`linear-gradient(${p},${p})`),positions:m.map(g=>`${g.x}px ${g.y}px`),sizes:m.map(g=>`${g.width}px ${g.height}px`),repeats:m.map(()=>"no-repeat"),origins:m.map(()=>"padding-box"),clips:m.map(()=>"padding-box"),base:{image:s.backgroundImage,position:s.backgroundPosition,size:s.backgroundSize,repeat:s.backgroundRepeat,origin:s.backgroundOrigin,clip:s.backgroundClip}}}function us(t){for(let e of t.keys()){let n=e.__snapdomFieldSelection;if(!n)continue;delete e.__snapdomFieldSelection;let{images:r,positions:i,sizes:o,repeats:s,origins:a,clips:c,base:u}=n,l=e.style.backgroundImage||u.image;l&&l!=="none"?(r.push(l),i.push(e.style.backgroundPosition||u.position),o.push(e.style.backgroundSize||u.size),s.push(e.style.backgroundRepeat||u.repeat),a.push(e.style.backgroundOrigin||u.origin),c.push(e.style.backgroundClip||u.clip)):(r.push("linear-gradient(transparent,transparent)"),i.push("0% 0%"),o.push("auto"),s.push("repeat"),a.push(u.origin||"padding-box"),c.push(u.clip||"border-box")),e.style.backgroundImage=r.join(","),e.style.backgroundPosition=i.join(","),e.style.backgroundSize=o.join(","),e.style.backgroundRepeat=s.join(","),e.style.backgroundOrigin=a.join(","),e.style.backgroundClip=c.join(",")}}Mt();var to=new Map,ds=new Set(["IFRAME"]);function $e(t,e){to.set(String(t).toUpperCase(),e)}function Pn(t){let e=O(t),n=e.display;if(n==="none")return null;let r=/^(block|inline-block|flow-root|flex|inline-flex|grid|inline-grid|list-item)$/.test(n),i=h=>parseFloat(h)||0,o=(h,m,p,g,y)=>{if(!r||!h?.endsWith("px"))return null;let b=parseFloat(h);if(!Number.isFinite(b)||b<0)return null;if(e.boxSizing==="border-box")return b;let w=g-y-p;return b+m+p+(w>0&&b+m<y+w/2?w:0)},[s,a,c,u]=/scroll|auto/.test(e.overflow)?[t.offsetWidth,t.clientWidth,t.offsetHeight,t.clientHeight]:[0,0,0,0],l=o(e.width,i(e.paddingLeft)+i(e.paddingRight),i(e.borderLeftWidth)+i(e.borderRightWidth),s,a),f=o(e.height,i(e.paddingTop)+i(e.paddingBottom),i(e.borderTopWidth)+i(e.borderBottomWidth),c,u);if(l===null||f===null){let{width:h,height:m}=xt(t),p=h,g=m;if(l===null&&!p||f===null&&!g){let y=t.getBoundingClientRect();p||=y.width||0,g||=y.height||0}l??=p,f??=g}let d=document.createElement("div");return d.style.cssText=`display:${n==="inline"?"inline-block":n};box-sizing:border-box;width:${l}px;height:${f}px;visibility:hidden;`,d}var Kl=new Set(["style","option","optgroup"]),$n=200,Ql=new Set(["img","canvas","video","iframe","object","embed"]);function ps(t,e){return t.right>=e.left-$n&&t.left<=e.right+$n&&t.bottom>=e.top-$n&&t.top<=e.bottom+$n}function Jl(t,e){if(t===e.root)return!1;let n;try{n=t.getBoundingClientRect()}catch{return!1}if(n.width===0&&n.height===0)return!1;let r=O(t);if(r.display==="inline"&&!Ql.has((t.localName||"").toLowerCase()))return!1;let i=e.rect,o=t.scrollWidth||0,s=t.scrollHeight||0,a={left:r.direction==="rtl"?Math.min(n.left,n.right-o):n.left,top:n.top,right:Math.max(n.right,n.left+o),bottom:Math.max(n.bottom,n.top+s)},c=r.writingMode||"";if((c.startsWith("vertical")||c.startsWith("sideways"))&&(a.top=Math.min(n.top,n.bottom-s),a.left=Math.min(a.left,n.right-o)),ps(a,i))return!1;let u=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;u.nextNode();){let l=u.currentNode.getBoundingClientRect();if((l.width>0||l.height>0)&&ps(l,i))return!1}return!0}function Zl(t,e,n){let r=t.cloneNode(!1);t.tagName==="IMG"&&(r.removeAttribute("src"),r.removeAttribute("srcset"),r.removeAttribute("sizes")),dt(t,r,e,n);let{width:i,height:o}=xt(t);i>0&&(r.style.width=`${i}px`,r.style.minWidth=`${i}px`,r.style.maxWidth=`${i}px`),o>0&&(r.style.height=`${o}px`,r.style.minHeight=`${o}px`,r.style.maxHeight=`${o}px`),r.style.visibility="hidden";let s=t.parentElement?O(t.parentElement).display:"",a=O(t).position;if(!/flex|grid|table/.test(s)&&(a==="static"||a==="relative")){let c=d=>{let h=O(d);return h.display!=="none"&&h.position!=="absolute"&&h.position!=="fixed"},u=t.getBoundingClientRect(),l=t.previousElementSibling;for(;l&&!c(l);)l=l.previousElementSibling;if(l){let d=u.top-l.getBoundingClientRect().bottom;d>=0&&(r.style.marginTop=`${d}px`)}let f=t.nextElementSibling;for(;f&&!c(f);)f=f.nextElementSibling;if(f){let d=f.getBoundingClientRect().top-u.bottom;d>=0&&(r.style.marginBottom=`${d}px`)}}return r.style.boxSizing="border-box",r}async function Jt(t,e,n){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.slicer?.due()&&await e.slicer.pause();let r=new Set,i=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let l=(t.localName||t.tagName||"").toLowerCase(),f=Gt(t);if(f&&(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox"))||t!==n.element&&f||Nr.has(l))return null;if(l==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return H(e,"Skipped a nested <foreignObject>; it can't be captured."),null;if(l==="source"&&t.parentElement?.localName==="picture")return null}if(t.nodeType===Node.TEXT_NODE){if(e.selection){let l=ls(t,e.selection);if(l)return l}return t.cloneNode(!0)}if(t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide")return Pn(t);if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let l of n.exclude)try{if(t.matches?.(l)){if(n.excludeMode==="hide")return Pn(t);if(n.excludeMode==="remove")return null}}catch{console.warn(`[SnapDOM] Invalid exclude selector "${l}"; ignored.`)}if(n.excludePredicates)for(let l of n.excludePredicates)try{if(l(t))return n.excludeMode==="remove"?null:Pn(t)}catch(f){console.warn("[SnapDOM] Your exclude function threw; the element was kept.",f)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide")return Pn(t);if(n.filterMode==="remove")return null}}catch(l){console.warn("[SnapDOM] Your filter function threw; the element was kept.",l)}if(t!==n.element&&!Kl.has(t.localName)&&!It(t)&&O(t).display==="none"){let l=t.cloneNode(!1);t.tagName==="IMG"&&(l.removeAttribute("src"),l.removeAttribute("srcset")),l.style.setProperty("display","none","important");for(let f of t.querySelectorAll("style")){let d=await Jt(f,e,n);d&&l.appendChild(d)}return l}if(e.clip&&Jl(t,e.clip))return Zl(t,e,n);if(n.__resolveNodeHooks)for(let l of n.__resolveNodeHooks){let f;try{f=await l(t,n)}catch(d){H(e,"A plugin's resolveNode hook threw; ignored it.",d)}if(f===null)return null;if(f?.nodeType)return f.nodeType===Node.ELEMENT_NODE&&(e.nodeMap.set(f,t),dt(t,f,e,n)),f}{let l=ds.has(t.tagName)&&to.get(t.tagName);if(l){let f=await l(t,e,n);if(f!==void 0)return f}}if(t.getAttribute("data-capture")==="placeholder"){let l=t.cloneNode(!1);e.nodeMap.set(l,t),dt(t,l,e,n);let f=document.createElement("div");return f.textContent=t.getAttribute("data-placeholder-text")||"",f.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",l.appendChild(f),l}{let l=!ds.has(t.tagName)&&to.get(t.tagName);if(l){let f=await l(t,e,n);if(f!==void 0)return f}}let s;try{if(s=t.cloneNode(!1),ji(t,s),e.nodeMap.set(s,t),t.tagName==="IMG"){Zi(t,s,n);try{let l=window.getComputedStyle(t),f=parseFloat(l.width),d=parseFloat(l.height);if(!(f>0)||!(d>0)){let p=xt(t),g=b=>parseFloat(l.getPropertyValue(b))||0,y=l.getPropertyValue("box-sizing")==="border-box";f>0||(f=p.width-(y?0:g("padding-left")+g("padding-right")+g("border-left-width")+g("border-right-width"))),d>0||(d=p.height-(y?0:g("padding-top")+g("padding-bottom")+g("border-top-width")+g("border-bottom-width")))}let h=Math.round((f||0)*1e3)/1e3,m=Math.round((d||0)*1e3)/1e3;h&&(s.dataset.snapdomWidth=String(h)),m&&(s.dataset.snapdomHeight=String(m))}catch(l){H(e,"Couldn't measure an image; kept its own size.",l)}try{let l=t.getAttribute("style")||"",f=window.getComputedStyle(t),d=w=>{let v=l.match(new RegExp(`${w}\\s*:\\s*([^;]+)`,"i")),C=v?v[1].trim():f.getPropertyValue(w);return/%|auto/i.test(String(C||""))},h=parseFloat(s.dataset.snapdomWidth||"0")||0,m=parseFloat(s.dataset.snapdomHeight||"0")||0,p=d("width")||!(h>0),g=d("height")||!(m>0);p&&h>0&&(s.style.width=`${h}px`),g&&m>0&&(s.style.height=`${m}px`);let y=f.getPropertyValue("object-fit"),b=f.getPropertyValue("object-position");y&&y!=="fill"?(s.style.objectFit=y,b&&(s.style.objectPosition=b)):(h>0&&(s.style.minWidth=`${h}px`),m>0&&(s.style.minHeight=`${m}px`))}catch(l){H(e,"Couldn't fix the size of an image.",l)}}}catch(l){throw console.error("[SnapDOM] Couldn't copy this element:",t,l),l}let a=null;if(it(t,"textarea")){let{width:l,height:f}=xt(t),d=l||t.getBoundingClientRect().width||0,h=f||t.getBoundingClientRect().height||0;d&&(s.style.width=`${d}px`),h&&(s.style.height=`${h}px`)}if(it(t,"input")){let l=(t.type||"text").toLowerCase();if((l==="checkbox"||l==="radio")&&(wt()||t.indeterminate)){let{el:d,applyVisual:h}=is(t);e.nodeMap.set(d,t),a=h,s=d}else if(l==="range"&&(wt()||X())){let{el:d,applyVisual:h}=os(t);e.nodeMap.set(d,t),a=h,s=d}else if(l==="color"&&X()){let d=s,h=t.value||"#000000";a=()=>{d.style.setProperty("background-color",h,"important"),d.style.setProperty("color","transparent","important"),d.style.setProperty("-webkit-text-fill-color","transparent","important"),d.style.setProperty("appearance","none","important"),d.style.setProperty("-webkit-appearance","none","important")},d.removeAttribute("value")}else if((l==="date"||l==="time"||l==="datetime-local")&&(wt()||X())){s.setAttribute("type","text");let d=t.value;l==="date"&&t.valueAsDate&&(d=t.valueAsDate.toLocaleDateString(void 0,{timeZone:"UTC"})),s.value=d,s.setAttribute("value",d)}else{let d=Qe(t)?_r(t.value):t.value;s.value=d,s.setAttribute("value",d),t.checked!==void 0&&(s.checked=t.checked,t.checked?s.setAttribute("checked",""):s.removeAttribute("checked"),t.indeterminate&&(s.indeterminate=t.indeterminate))}}if((it(t,"input")||it(t,"textarea"))&&!t.value&&t.placeholder)try{let l=window.getComputedStyle(t,"::placeholder"),f=l&&l.color;f&&f!=="rgba(0, 0, 0, 0)"&&(e.__usesPlaceholder=!0,s.setAttribute("data-sd-ph",""),s.style.setProperty("--sd-ph",f),s.style.setProperty("--sd-ph-o",l.opacity||"1"))}catch{}if(it(t,"select")&&(i=new Set(Array.from(t.options).filter(l=>l.selected))),it(t,"textarea")&&(o=t.value),it(t,"input")||it(t,"textarea")||it(t,"select")){t.disabled&&s.setAttribute("disabled",""),t.required&&s.setAttribute("required",""),t.readOnly&&s.setAttribute("readonly","");let l=t;l.min!==void 0&&l.min!==""&&s.setAttribute("min",l.min),l.max!==void 0&&l.max!==""&&s.setAttribute("max",l.max),l.pattern!==void 0&&l.pattern!==""&&s.setAttribute("pattern",l.pattern);let f=t.getAttribute("aria-invalid");f!==null&&s.setAttribute("aria-invalid",f)}if(En(t)||dt(t,s,e,n),a&&a(),n.captureSelection&&(it(t,"input")||it(t,"textarea")))try{fs(t,s)}catch(l){H(e,"Couldn't copy the selection of a text field.",l)}if(It(t)&&!En(t)){let l=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display","color"];try{let f=window.getComputedStyle(t);for(let d of l){let h=f.getPropertyValue(d);h&&s.style.setProperty(d,h)}t.localName==="stop"&&(s.style.setProperty("stop-color",f.getPropertyValue("stop-color")),s.style.setProperty("stop-opacity",f.getPropertyValue("stop-opacity")))}catch{}}if(t.shadowRoot){Xr(t.shadowRoot);try{let b=t.shadowRoot.querySelectorAll("slot");for(let w of b){let v=w.assignedNodes?.()||[];for(let C of v)r.add(C)}}catch{}let l=Ki(e),f=`[data-sd="${l}"]`;e.shadowScopes||=new WeakMap,e.shadowScopes.set(t.shadowRoot,l);try{s.setAttribute("data-sd",l)}catch{}let d=Qi(t.shadowRoot);!e.__shadowPseudo&&/::?(?:before|after|first-l|marker)|counter/.test(d)&&(e.__shadowPseudo=!0);let h=Yi(d,f,l),m=ts(d),p=es(t,m,f);Ji(s,p+h,l);let g=document.createDocumentFragment(),y=await Promise.all(Array.from(t.shadowRoot.childNodes).map(b=>b.nodeType===Node.ELEMENT_NODE&&b.tagName==="STYLE"?null:Jt(b,e,n).catch(()=>null)));g.append(...y.filter(b=>!!b)),s.appendChild(g)}if(t.tagName==="SLOT"){let l=e.shadowScopes?.get(t.getRootNode()),f=t.assignedNodes?.()||[],d=f.length?t.assignedNodes?.({flatten:!0})||f:[],h=d.length?d:Array.from(t.childNodes),m=document.createDocumentFragment(),p=await Promise.all(h.map(g=>Jt(g,e,n).then(y=>(y&&f.length&&ns(y,l),y||null)).catch(()=>null)));return m.append(...p.filter(g=>!!g)),m}let c=l=>r.has(l)||t.shadowRoot&&!l.assignedSlot,u=await Promise.all(Array.from(t.childNodes).map(l=>c(l)?null:Jt(l,e,n).catch(()=>null)));if(s.append(...u.filter(l=>!!l)),i&&it(s,"select")){let l=!1;for(let f of s.options){let d=i.has(e.nodeMap.get(f));f.selected=d,d?f.setAttribute("selected",""):f.removeAttribute("selected"),l||=d}if(!l&&!s.multiple){let f=s.ownerDocument.createElement("option");f.hidden=!0,f.style.setProperty("display","none","important"),f.setAttribute("selected",""),f.value="",s.appendChild(f)}}return o!==null&&it(s,"textarea")&&(s.textContent=o),s}async function tf(t,e,n){let r=!1;try{r=!!(t.contentDocument||t.contentWindow?.document)}catch(i){H(e,"Couldn't tell if an iframe is same-origin; treated it as cross-origin.",i)}if(r)try{return await Jr(t,e,n)}catch(i){console.warn("[SnapDOM] Couldn't capture an iframe, so it was left out.",i)}if(r||console.warn(n.placeholders?"[SnapDOM] Can't capture a cross-origin iframe; showing a placeholder. Set placeholders: false to hide it.":"[SnapDOM] Can't capture a cross-origin iframe; left it out.",t),n.placeholders){let{width:i,height:o}=xt(t),s=document.createElement("div");return s.style.cssText=`width:${i}px;height:${o}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,dt(t,s,e,n),s}else{let{width:i,height:o}=xt(t),s=document.createElement("div");return s.style.cssText=`display:inline-block;width:${i}px;height:${o}px;visibility:hidden;`,dt(t,s,e,n),s}}function fn(t){try{let e=Math.max(1,Math.min(32,t.width)),n=Math.max(1,Math.min(32,t.height)),r=document.createElement("canvas");r.width=e,r.height=n;let i=r.getContext("2d",{willReadFrequently:!0});if(!i)return!1;i.drawImage(t,0,0,e,n);let o=i.getImageData(0,0,e,n).data;for(let s=3;s<o.length;s+=4)if(o[s]!==0)return!1;return!0}catch{return!1}}var ef=.95;function nf(t,e,n){try{let r=t.getImageData(0,0,e,n).data;for(let i=3;i<r.length;i+=4)if(r[i]!==255)return!1;return!0}catch{return!1}}async function rf(t,e,n){let r="";try{let a=fn(t);a&&(await bt(),a=fn(t));let c=null;if(!a){c=t.getContext("2d",{willReadFrequently:!0});try{c&&c.getImageData(0,0,1,1)}catch{}X()&&await bt()}if(r=t.toDataURL("image/png"),!r||r==="data:,"){try{c&&c.getImageData(0,0,1,1)}catch{}if(await bt(),r=t.toDataURL("image/png"),!r||r==="data:,"){let u=document.createElement("canvas");u.width=t.width,u.height=t.height;let l=u.getContext("2d");l&&(l.drawImage(t,0,0),r=u.toDataURL("image/png"))}}}catch(a){H(e,"Couldn't read the pixels of a canvas; used its fallback content.",a)}n&&n.debug&&r&&fn(t)&&H(e,"Empty canvas; capture after its first frame",t);let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch(a){H(e,"Couldn't set image loading hints.",a)}r&&(i.src=r),i.width=t.width,i.height=t.height;let{width:o,height:s}=xt(t);return o>0&&(i.style.width=`${o}px`),s>0&&(i.style.height=`${s}px`),e.nodeMap.set(i,t),dt(t,i,e,n),i}async function of(t,e,n){let r="",i=t.poster&&t.paused&&!t.currentTime&&!t.played.length,o=document.createElement("img");try{o.decoding="sync",o.loading="eager"}catch{}if(!i)try{let c=document.createElement("canvas");c.width=t.videoWidth||t.offsetWidth||320,c.height=t.videoHeight||t.offsetHeight||240;let u=c.getContext("2d");u&&(u.drawImage(t,0,0,c.width,c.height),r=c.toDataURL(nf(u,c.width,c.height)?"image/jpeg":"image/png",ef),(!r||r==="data:,")&&(r=""))}catch(c){H(e,"Couldn't capture a video frame; used its poster.",c)}r?o.src=r:t.poster&&(o.src=t.poster),o.width=t.videoWidth||t.offsetWidth||0,o.height=t.videoHeight||t.offsetHeight||0;let{width:s,height:a}=xt(t);return s>0&&(o.style.width=`${s}px`),a>0&&(o.style.height=`${a}px`),o.style.objectFit="contain",e.nodeMap.set(o,t),dt(t,o,e,n),o}async function sf(t,e,n){if(!t.controls)return;let{width:r,height:i}=xt(t),o=Math.round(r||t.offsetWidth||300),s=Math.round(i||t.offsetHeight||54),a=s/2,c=Math.max(4,s*.16),u=s*.34,l=o-s*.34,f=u+c+s*.55,d=Math.max(0,l-s*.7-f),h=Math.max(9,Math.round(s*.24)),m=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${s}" viewBox="0 0 ${o} ${s}"><rect width="${o}" height="${s}" rx="${Math.min(s/2,10)}" fill="#f1f3f4"/><path d="M ${u} ${a-c} L ${u+c} ${a} L ${u} ${a+c} Z" fill="#5f6368"/><rect x="${f}" y="${a-1.5}" width="${d}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${f}" cy="${a}" r="${Math.max(3,s*.09)}" fill="#5f6368"/><text x="${l}" y="${a}" fill="#5f6368" font-family="sans-serif" font-size="${h}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,p=document.createElement("img");try{p.decoding="sync",p.loading="eager"}catch{}return p.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,p.width=o,p.height=s,p.style.width=`${o}px`,p.style.height=`${s}px`,e.nodeMap.set(p,t),dt(t,p,e,n),p}async function hs(t,e,n){let r=t.getAttribute("data")||t.getAttribute("src")||"",i=(t.getAttribute("type")||"").toLowerCase(),o=/^image\//.test(i)||/\.(png|jpe?g|gif|webp|avif|bmp|ico|svg)(\?|#|$)/i.test(r);if(r&&o){let a=document.createElement("img");try{a.decoding="sync",a.loading="eager"}catch{}a.src=r;let{width:c,height:u}=xt(t);return c>0&&(a.style.width=`${c}px`),u>0&&(a.style.height=`${u}px`),e.nodeMap.set(a,t),dt(t,a,e,n),a}let s=null;try{s=t.contentDocument}catch{}if(s)try{let a=await Jr(t,e,n);if(a)return a}catch{}r&&console.warn(`[SnapDOM] Couldn't capture <${t.localName}>${i?` (${i})`:""}; showing its fallback content.`)}$e("IFRAME",tf);$e("CANVAS",rf);$e("VIDEO",of);$e("AUDIO",sf);$e("OBJECT",hs);$e("EMBED",hs);St();kt();ke();yt();Mt();var af=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],Ne=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{});function cf(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ms(t){let e=Array.isArray(t)?t:t?[t]:[],n=[];for(let r of e)r instanceof RegExp?n.push(r):typeof r=="string"?n.push(new RegExp(cf(r),"i")):console.warn("[SnapDOM] Ignored an iconFonts entry: use a string or a RegExp.",r);return n}function Nt(t,e){let n=typeof t=="string"?t:"";for(let r of af)if(r.test(n))return!0;if(e){for(let r of e)if(r instanceof RegExp&&r.test(n))return!0}return!!(/icon/i.test(n)||/glyph/i.test(n)||/symbols/i.test(n)||/feather/i.test(n)||/fontawesome/i.test(n))}function eo(t,e){if(typeof t!="string"||!t)return!1;let n;try{n=new URL(t,typeof location<"u"?location.href:void 0)}catch{return Nt(t,e)}let r=n.searchParams.getAll("family").flatMap(i=>i.split("|")).map(i=>i.split(":")[0].trim()).filter(Boolean);return r.length?r.every(i=>Nt(i,e)):Nt(t,e)}function lf(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var Nn=new Map;function ff(t=""){let e=Object.create(null),n=String(t||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)e[i[1].toUpperCase()]=Number(i[2]);return e}async function uf(t,e,n){let r=String(t||""),i=r.toLowerCase(),o=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),c="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?c="rounded":/\bsharp\b/.test(o)?c="sharp":/\boutlined\b/.test(o)&&(c="outlined");let u=a===1,l=null;if(u&&(c==="outlined"&&Ne.materialIconsFilled?l={url:Ne.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&Ne.materialIconsRound?l={url:Ne.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&Ne.materialIconsSharp&&(l={url:Ne.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!Nn.has(l.alias))try{let d=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});await d.load(),document.fonts.add(d),Nn.set(l.alias,!0)}catch{return Nn.set(l.alias,!1),{familyForMeasure:r,familyForCanvas:r}}if(Nn.get(l.alias)===!1)return{familyForMeasure:r,familyForCanvas:r};let f=`"${l.alias}"`;return{familyForMeasure:f,familyForCanvas:f}}async function df(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function pf(t){let e=t.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(e)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!n&&e.toLowerCase()!=="currentcolor")return e;let r=t.color?.trim();return r&&r!=="inherit"?r:"#000"}async function hf(t,{family:e="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:s=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,u=ff(o),{familyForMeasure:l,familyForCanvas:f}=await uf(a,s,u);await df(f.replace(/^["']+|["']+$/g,""),r);let d=document.createElement("span");Z(d),d.textContent=t,d.style.position="absolute",d.style.visibility="hidden",d.style.left="-99999px",d.style.whiteSpace="nowrap",d.style.fontFamily=l,d.style.fontWeight=String(n||"normal"),d.style.fontSize=`${r}px`,d.style.lineHeight="1",d.style.margin="0",d.style.padding="0",d.style.fontFeatureSettings="'liga' 1",d.style.fontVariantLigatures="normal",d.style.color=i,document.body.appendChild(d);let h=d.getBoundingClientRect(),m=Math.max(1,Math.ceil(h.width)),p=Math.max(1,Math.ceil(h.height));document.body.removeChild(d);let g=document.createElement("canvas");g.width=m*c,g.height=p*c;let y=g.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${r}px ${f}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(t,0,0),{dataUrl:g.toDataURL(),width:m,height:p}}async function Ln(t,e,n=new Map){if(t?.nodeType!==1)return 0;let r='.material-icons, [class*="material-symbols"]',i=Array.from(t.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim());if(t.matches?.(r)&&t.textContent&&t.textContent.trim()&&i.unshift(t),i.length===0)return 0;let o=e?.nodeType===1?Array.from(e.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim()):[];e?.nodeType===1&&e.matches?.(r)&&e.textContent&&e.textContent.trim()&&o.unshift(e);let s=0;for(let a=0;a<i.length;a++){let c=i[a],u=n&&n.get(c)||o[a]||null;try{let l=getComputedStyle(u||c),f=l.fontFamily||"Material Icons";if(!lf(f))continue;let d=(u||c).textContent.trim();if(!d)continue;let h=parseInt(l.fontSize,10)||24,m=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",p=pf(l),g=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",y=(u||c).className||"",{dataUrl:b,width:w,height:v}=await hf(d,{family:f,weight:m,fontSize:h,color:p,variation:g,className:y});c.textContent="";let C=c.ownerDocument.createElement("img");C.src=b,C.alt=d,C.style.height=`${h}px`,C.style.width=`${Math.max(1,Math.round(w/v*h))}px`,C.style.objectFit="contain",C.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(C),s++}catch{}}return s}we();mt();Mt();async function ws(t,e,n,r=32,i="#000",o="normal"){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");Z(a),a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontStyle=o||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let c=a.getBoundingClientRect(),u=Math.ceil(c.width),l=Math.ceil(c.height);document.body.removeChild(a);let f=document.createElement("canvas");f.width=Math.max(1,u*s),f.height=Math.max(1,l*s);let d=f.getContext("2d");return d.scale(s,s),d.font=`${o||"normal"} ${n||"normal"} ${r}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=i,d.fillText(t,0,0),{dataUrl:f.toDataURL(),width:u,height:l}}var Ss=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),mf=["katex","mathjax","mathml"];function oo(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Ss.has(n.toLowerCase()))return n}return""}function gf(t){if(!t)return[];let e=[];for(let n of t.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(Ss.has(r.toLowerCase())||e.push(r))}return e}function In(t){let e=String(t??"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function On(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function yf(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function bf(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let i=In(n[1]),o=In(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=In(e);return{min:r,max:r}}function wf(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Sf(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),s=parseFloat(n[2]);return{min:Math.min(o,s),max:Math.max(o,s)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function xf(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function vf(t,e,n=[]){if(!t)return!1;try{let r=new URL(t,location.href);if(r.origin===location.origin)return!0;let o=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(c=>o.endsWith(c))||n.some(c=>o===c.toLowerCase()||o.endsWith("."+c.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||mf.some(c=>a.includes(c)))return!0;for(let c of e){let u=c.toLowerCase().replace(/\s+/g,"+"),l=c.toLowerCase().replace(/\s+/g,"-"),f=xf(c);if(a.includes(u)||a.includes(l)||f&&a.includes(f))return!0}return!1}catch{return!1}}function Cf(t){let e=new Set;for(let n of t||[]){let r=String(n).split("__")[0]?.trim();r&&e.add(r)}return e}function gs(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,i)=>{let o=(i||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let s=o;try{s=new URL(o,e||location.href).href}catch{}return`url("${s}")`})}var xs=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Dn=4;async function kf(t,e,n){if(!t)return t;let r=new Set;function i(a,c){try{return new URL(a,c||location.href).href}catch{return a}}async function o(a,c,u=0){if(u>Dn)return console.warn(`[SnapDOM] Too many nested @import rules in ${c}; stopped at ${Dn} levels.`),a;let l="",f=0,d,h=new RegExp(xs.source,"g");for(;d=h.exec(a);){l+=a.slice(f,d.index),f=h.lastIndex;let m=(d[2]||d[4]||"").trim(),p=i(m,c);if(r.has(p)){console.warn(`[SnapDOM] Skipped an @import that loops back: ${p}`);continue}r.add(p);let g="";try{let y=await ft(p,{as:"text",useProxy:n,silent:!0});y.ok&&typeof y.data=="string"&&(g=y.data)}catch{}g?(g=gs(g,p),g=await o(g,p,u+1),l+=`
|
|
6
|
+
var pl=Object.defineProperty;var lt=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var we=(t,e)=>{for(var n in e)pl(t,n,{get:e[n],enumerable:!0})};function ri(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function oi(t="soft"){t==="disabled"&&(D.computedStyle=new WeakMap,D.measureHints=new WeakMap,D.baseStyle=new ct(50),D.defaultStyle=new ct(64),D.image=new ct(100),D.background=new ct(100),D.resource=new ct(150),D.compress=new ct(50))}var ct,D,yt=lt(()=>{"use strict";ct=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)}},D={image:new ct(100),background:new ct(100),resource:new ct(150),defaultStyle:new ct(64),baseStyle:new ct(50),compress:new ct(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function ie(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function ml(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 Qe(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 ml(n[1])){let s=o.match(/url\((['"]?)(.*?)(\1)\)/);if(!s)continue;let a=o.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!hl.test(a[1].trim()))continue;let l=o.replace(/url\((['"]?)[\s\S]*?\1\)/," ").match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)\b/i),f=1;if(l){let c=parseFloat(l[1]);f=/dpi/i.test(l[2])?c/96:c}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 _r(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 Gt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function Er(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 Je(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function Rr(t){return"\u2022".repeat(String(t??"").length)}function it(t,e){return t?.nodeType===1&&t.localName===e}function Rt(t){return t?.nodeType===1&&t.namespaceURI===gl}function Ot(t){return t?.nodeType===1&&t.namespaceURI===yl}function Dt(t){return t?.nodeType===11&&!!t.host}function Ft(t){let e=t?.parentNode;return e?.nodeType===11?e.host:null}function Fr(t){return t?.nodeType===9}var Ar,hl,gl,yl,kt=lt(()=>{"use strict";Ar=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,hl=Ar;gl="http://www.w3.org/1999/xhtml",yl="http://www.w3.org/2000/svg"});function bl(t="[SnapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(s,a,l){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} ${l}`):console&&console.error&&console.error(`${t} ${l}`))}return{warnOnce(s,a){o("warn",s,a)},errorOnce(s,a){o("error",s,a)},reset(){r.clear(),i=0}}}function ai(t,e,n){if(Wt.size>=si){let r=Date.now();for(let[i,o]of Wt)o.until<=r&&Wt.delete(i);for(;Wt.size>=si;)Wt.delete(Wt.keys().next().value)}Wt.set(t,{until:Date.now()+n,result:e})}function wl(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Sl(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 xl(t,e){if(!e||wl(t)||Sl(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 vl(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>Gt(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}${Gt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function li(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 Cl(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 ci(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function Pr(t,e){try{t.onError?.(e)}catch{}}async function ft(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),x=new Uint8Array([...w].map(S=>S.charCodeAt(0))),C=new Blob([x],{type:(g||"").split(";")[0]||""});return{ok:!0,data:C,status:200,url:t,fromCache:!1,mime:C.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 li(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 l;try{l=Cl(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 Pr(e,g),g}let f=Wt.get(l);if(f&&f.until>Date.now())return{...f.result,fromCache:!0};f&&Wt.delete(l);let c=Tr.get(l);if(c)return c;let u=xl(t,i)?vl(t,i):t,d=e.credentials;if(!d)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,g);d=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{d="omit"}let h=new AbortController,m=setTimeout(()=>h.abort("timeout"),r),p=(async()=>{try{let g=await fetch(u,{signal:h.signal,credentials:d,headers:s});if(!g.ok){let w={ok:!1,data:null,status:g.status,url:u,fromCache:!1,reason:"http_error"};if(l!==null&&o>0&&ai(l,w,o),!a){let x=`${g.status} ${g.statusText||""}`.trim();ii.warnOnce(`http:${g.status}:${n}:${ci(t)}`,`Couldn't load ${t} (HTTP ${x}).`)}return Pr(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 li(y),blob:y,status:g.status,url:u,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:u,fromCache:!1,mime:b}}catch(g){let y=h.signal.aborted?h.signal.reason==="timeout"?"timeout":"abort":g&&typeof g=="object"&&g.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:u,fromCache:!1,reason:y};if(l!==null&&!/^blob:/i.test(t)&&o>0&&ai(l,b,o),!a){let w=`${y}:${n}:${ci(t)}`,x=y==="timeout"?`Timed out loading ${t} after ${r}ms. Raise the timeout option or set useProxy.`:y==="abort"?`Loading ${t} was cancelled.`:`Couldn't load ${t} (network or CORS). Try the useProxy option.`;ii.errorOnce(w,x)}return Pr(e,b),b}finally{clearTimeout(m),Tr.delete(l)}})();return l!==null&&Tr.set(l,p),p}var ii,Tr,si,Wt,Se=lt(()=>{"use strict";kt();ii=bl("[SnapDOM]",{ttlMs:3*6e4,maxEntries:10}),Tr=new Map,si=50,Wt=new Map});async function xe(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=Qe(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??ie(t);if(!r)return t;let i=Er(r),o=Gt(i),s=(e.useProxy||"")+"|"+o;if(D.background.has(s)){let a=D.background.get(s);return a?`url("${a}")`:"none"}try{let a=await ft(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(D.background.set(s,a.data),`url("${a.data}")`):(D.background.set(s,null),"none")}catch{return D.background.set(s,null),"none"}}var fi=lt(()=>{"use strict";yt();kt();Se()});function Rl(t){let e=t.replace(El,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function pi(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 l=!!o.selectorText&&Al.test(o.selectorText);for(let f=0;f<s.length;f++){let c=s[f];if(e.add(c),l&&r.pseudoProps.add(c),s.getPropertyPriority(c)&&r.importantProps.add(c),c.length>5&&(c[0]==="m"||c[0]==="p")){let u=c.startsWith("margin")?"marginUnstable":c.startsWith("padding")?"paddingUnstable":null;u&&!r[u]&&_l.test(s.getPropertyValue(c))&&(r[u]=!0)}}}let a=o.selectorText;if(a&&a.includes(":has(")&&(r.usesHas=!0),a&&a.includes("&"))for(let l=o.parentRule;l&&a.includes("&");l=l.parentRule)l.selectorText&&(a=a.replace(/&/g,`:is(${l.selectorText})`));if(a&&(r.inContainer||di.test(a)||a.includes("+")||a.includes("~")))for(let l of Lr(a,",")){let f=l.trim();f&&(r.inContainer||di.test(f)||f.includes("+")||f.includes("~"))&&r.shareUnsafeSels.add(f)}if(a&&a.includes(":"))for(let l in ui)ui[l].test(a)&&n[l].push(Rl(a));if(o.styleSheet){if(!xn(o.styleSheet,e,n,r))return!1}else if(o.cssRules&&o.cssRules.length){let l=o.constructor?.name==="CSSContainerRule";l&&r.inContainer++;let f=pi(o.cssRules,e,n,r);if(l&&r.inContainer--,!f)return!1}}return!0}function xn(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?pi(i,e,n,r):!1}function Nr(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 hi(t){let e=new Set;return xn(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 Lr(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 Fl(t){let e=0,n=null,r=0;for(let c=0;c<t.length;c++){let u=t[c];if(n){u===n&&t[c-1]!=="\\"&&(n=null);continue}u==='"'||u==="'"?n=u:u==="("||u==="["?e++:u===")"||u==="]"?e--:e===0&&(u===" "||u===">"||u==="+"||u==="~")&&(r=c+1)}let i="",o=0;for(let c of t.slice(r))c==="("||c==="["?o++:c===")"||c==="]"?o--:o===0&&(i+=c);let s=c=>!c||/\\[0-9a-fA-F]/.test(c)?null:c.replace(/\\(.)/g,"$1"),a=s((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let l=s((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(l)return"i"+l;let f=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return f?"t"+f.toLowerCase():null}function mi(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 Tl(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]=mi(n,o)}return r}function gi(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($r),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(!xn(f,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let f of o)if(!xn(f,n,r,i))return e}typeof t.getAnimations=="function"&&Nr(t.getAnimations(),n);let s=Array.from(i.shareUnsafeSels),a=mi(t.createElement("div"),s)===null?null:s.map(f=>({sel:f,key:Fl(f)})),l=new Set(Ml);for(let f of kl)n.has(f)&&l.add(f);for(let f of i.pseudoProps)l.add(f);return(i.pseudoProps.has("transform")||i.pseudoProps.has("rotate")||i.pseudoProps.has("scale"))&&l.add("transform-origin"),i.pseudoProps.has("perspective")&&l.add("perspective-origin"),{universe:n,pseudoUniverse:l,pseudoGates:Tl(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var $r,kl,Ml,Al,_l,ui,El,di,vn=lt(()=>{"use strict";$r=["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"],kl=["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"],Ml=["display","width","height","min-width","min-height"],Al=/::?(?:before|after|first-letter|first-line|marker)/,_l=/%|\bauto\b|calc\(|var\(/i,ui={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},El=/::?(?:before|after|first-letter|first-line|marker)\b/g;di=/:(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 Z(t){return yi.add(t),t.setAttribute("data-snapdom-internal",""),t}function Xt(t){return yi.has(t)}var yi,Mt=lt(()=>{"use strict";yi=new WeakSet});function Or(t){if(t=String(t).toLowerCase(),Ze.has(t)){let o={};return D.defaultStyle.set(t,o),o}if(D.defaultStyle.has(t))return D.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(Xt);e||(e=document.createElement("div"),Z(e),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t.includes("-")?"span":t);n.style.all="initial",e.appendChild(n);let r=getComputedStyle(n),i={};for(let o of r){if(ve(o))continue;let s=r.getPropertyValue(o);i[o]=s}for(let o of $r)!(o in i)&&!ve(o)&&(i[o]=r.getPropertyValue(o));return e.removeChild(n),D.defaultStyle.set(t,i),i}function ve(t){let e=bi.get(t);if(e===void 0){let n=String(t).toLowerCase();e=Nl.has(n)||$l.test(n)||Pl.test(n),bi.set(t,e)}return e}function Si(t,e){let n=Wl.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 Cn(t,e){return!Il.has(t)&&(e==="inline"||Ll.has(t)||wi.has(t))}function Dr(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||wi.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:!Ul.has(r)}function Ce(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),Ze.has(e))return"";let i=[],o=Or(e),s=(t.display||"").toLowerCase(),a=s==="inline",l=Cn(e,s),f=t["text-wrap-mode"]||t["white-space"]||"",c=f==="nowrap"||f==="pre",d=l&&n&&!(l&&n&&!a&&c),h=!1;for(let m in t){if(ve(m)||Si(m,t))continue;let p=t[m];if(d){if(Ol.has(m))continue;if(Dl.has(m)){p&&p!==o[m]&&(i.push(`${m}:${p}`),p!=="auto"&&(h=!0));continue}}if(p&&p!==o[m]){if(!c&&(m==="width"||m==="inline-size")&&p.endsWith("px")&&p.includes(".")){let g=parseFloat(p);if(Number.isFinite(g)){i.push(`${m}:${(g+Bl).toFixed(3)}px`);continue}}i.push(`${m}:${p}`)}}if(d&&!a&&!r&&!h){let m=t.width;m&&m!=="auto"&&m!==o.width&&i.push(`min-width:${m}`)}return i.sort(),i.join(";")}function Wr(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(n=>e.add(n.tagName.toLowerCase())),Array.from(e))}function Br(t,e=null){let n=new Map;for(let s of t){let a=Or(s);if(!a)continue;let c=(e?Object.entries(a).filter(([d])=>e.has(d)):Object.entries(a)).filter(([d])=>!Si(d,a)).map(([d,h])=>`${d}:${h};`).sort(),u=c.join("");u&&(n.has(u)||n.set(u,{tagList:[],declarations:c}),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 l of i)a.has(l)||i.delete(l)}i??=new Set;let o="";if(i.size&&r.length>1){let s=r.flatMap(a=>a.tagList);o+=`${s.join(",")} { ${[...i].join("")} }
|
|
7
|
+
`}for(let{tagList:s,declarations:a}of r){let l=r.length>1?a.filter(c=>!i.has(c)):a;if(!l.length)continue;let f=l.join("");o+=`${s.join(",")} { ${f} }
|
|
8
|
+
`}return o}function tn(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let i of e)n.set(i,`c${r++}`);return n}function zl(t){try{let e=t?.ownerDocument;if(!e)return typeof window<"u"?window:null;let n=e.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let r=0;r<window.frames.length;r++)try{if(window.frames[r]?.document===e)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function O(t,e=null){let n=()=>{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(t?.nodeType!==1){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(t,e)||n()}catch{return n()}return n()}let r=D.computedStyle.get(t);r||(r=new Map,D.computedStyle.set(t,r));let i=r.get(e);if(!i){let o=zl(t),s=null;try{s=o&&typeof o.getComputedStyle=="function"?o.getComputedStyle(t,e):null}catch{}if(!s&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(s=window.getComputedStyle(t,e))}catch{}i=s||n(),r.set(e,i)}return i}function ke(t,e=null){let n={};for(let r of e||t){let i=t.getPropertyValue(r);i&&(n[r]=i)}for(let r of Hl){let i=n[`border-${r}-style`],o=n[`border-${r}-width`];(i==="none"||i==="hidden"||o==="0px")&&(delete n[`border-${r}-style`],delete n[`border-${r}-width`],delete n[`border-${r}-color`])}return n}function Yt(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,i).trim()),r=i+1)}return e.push(t.slice(r).trim()),e}var Ir,Ze,Pl,$l,Nl,bi,Ll,wi,Il,Ol,Dl,Wl,Bl,Ul,Hl,Me=lt(()=>{"use strict";yt();vn();Mt();Ir=new Set(["meta","script","noscript","title","link","template"]),Ze=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);Pl=/(?:^|-)(animation|transition)(?:-|$)/i,$l=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Nl=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom","stroke-color"]),bi=new Map;Ll=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),wi=new Set(["table","thead","tbody","tfoot","tr","td","th"]),Il=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),Ol=new Set(["width","max-width","inline-size","max-inline-size"]),Dl=new Set(["min-width","min-inline-size"]),Wl=new Map(Object.entries({"block-size":"height","inline-size":"width","min-block-size":"min-height","min-inline-size":"min-width","max-block-size":"max-height","max-inline-size":"max-width","margin-block-start":"margin-top","margin-block-end":"margin-bottom","margin-inline-start":"margin-left","margin-inline-end":"margin-right","padding-block-start":"padding-top","padding-block-end":"padding-bottom","padding-inline-start":"padding-left","padding-inline-end":"padding-right","inset-block-start":"top","inset-block-end":"bottom","inset-inline-start":"left","inset-inline-end":"right","border-block-start-width":"border-top-width","border-block-start-style":"border-top-style","border-block-start-color":"border-top-color","border-block-end-width":"border-bottom-width","border-block-end-style":"border-bottom-style","border-block-end-color":"border-bottom-color","border-inline-start-width":"border-left-width","border-inline-start-style":"border-left-style","border-inline-start-color":"border-left-color","border-inline-end-width":"border-right-width","border-inline-end-style":"border-right-style","border-inline-end-color":"border-right-color","border-start-start-radius":"border-top-left-radius","border-start-end-radius":"border-top-right-radius","border-end-start-radius":"border-bottom-left-radius","border-end-end-radius":"border-bottom-right-radius","overflow-block":"overflow-y","overflow-inline":"overflow-x","overscroll-behavior-block":"overscroll-behavior-y","overscroll-behavior-inline":"overscroll-behavior-x","contain-intrinsic-block-size":"contain-intrinsic-height","contain-intrinsic-inline-size":"contain-intrinsic-width"}));Bl=.001;Ul=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);Hl=["top","right","bottom","left"]});function bt(t=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(e=>{let n=!1,r=()=>{n||(n=!0,e())};try{requestAnimationFrame(r)}catch{r();return}setTimeout(r,t)})}function vi(t){if(t!==!1&&t!=="auto")return null;let e=performance.now()+(t==="auto"?jl:xi),n=null,r={yielded:!1,due:()=>performance.now()>=e,pause:()=>n||(n=new Promise(i=>{let o=()=>{n=null,r.yielded=!0,e=performance.now()+xi,i()},s=new MessageChannel;s.port1.onmessage=o,s.port2.postMessage(0)}))};return r}function en(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let t=navigator.userAgent||"",e=/iPhone|iPad|iPod/.test(t),n=navigator.maxTouchPoints>2&&/Macintosh/.test(t);return e||n}function X(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),r=/applewebkit/i.test(t),i=/mobile/i.test(t),o=!/safari/i.test(t),s=r&&i&&o,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),f=/ipad|iphone|ipod/.test(e)&&r;return n||s||a||l||f}function wt(){return typeof navigator>"u"?!1:(navigator.userAgent||"").toLowerCase().includes("firefox")}var xi,jl,mt=lt(()=>{"use strict";xi=16,jl=40});function H(t,e,n){let r=t&&typeof t=="object"&&(t.options||t);r&&r.debug&&(n!==void 0?console.warn("[SnapDOM]",e,n):console.warn("[SnapDOM]",e))}function At(t,e,n,r){let i=t&&t.warnings;i&&i.length<Vl&&i.push(r===void 0?{code:e,message:n}:{code:e,message:n,detail:r})}var Vl,se=lt(()=>{"use strict";Vl=50});var St=lt(()=>{"use strict";fi();Me();mt();kt();se()});var el={};we(el,{MAX_RASTER_AREA:()=>ne,MAX_RASTER_SIDE:()=>$t,cropSvgText:()=>yr,decodeSvgFromDataURL:()=>he,encodeSvgToDataURL:()=>me,fixSafariShadows:()=>wr,peekSvgHeader:()=>br,toCanvas:()=>zt});function Ad(t,e){try{let n=t.match(/<svg\b[^>]*>/i);if(!n)return t;let r=n[0],i=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(o)||i<=0||o<=0)return t;let s=Math.min(1,$t/i,$t/o,Math.sqrt(ne/(i*o)));if(s>=1)return t;let a=Math.max(1,Math.floor(i*s)),l=Math.max(1,Math.floor(o*s));return At(e,"raster-clamp",`capture ${Math.round(i)}x${Math.round(o)}px exceeds decode limits; downscaled to ${a}x${l}px`),console.warn(`[SnapDOM] ${Math.round(i)}\xD7${Math.round(o)}px is too large for the browser to draw; scaled down to ${a}\xD7${l}px. For full size, export ${typeof CompressionStream=="function"?"a PNG blob, ":""}an SVG, or crop.`),t.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${l}`))}catch{return t}}function yr(t,e){let n=["x","y","width","height"].map(S=>Number(e?.[S]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw new RangeError("[SnapDOM] crop needs finite x/y and a positive width/height.");let r=t.match(/<svg\b[^>]*>/i);if(!r)throw new Error("[SnapDOM] Only SVG captures can be cropped.");let i=r[0],o=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],s=String(o||"").trim().split(/[\s,]+/).map(Number);if(s.length!==4||!s.every(Number.isFinite)||s[2]<=0||s[3]<=0)throw new Error("[SnapDOM] Can't crop: the SVG has no valid viewBox.");let[a,l,f,c]=s,u=Math.max(a,n[0]),d=Math.max(l,n[1]),h=Math.min(a+f,n[0]+n[2]),m=Math.min(l+c,n[1]+n[3]);if(!(h>u)||!(m>d))throw new RangeError("[SnapDOM] The crop area does not intersect the capture.");let p=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(p)&&p>0?p/f:1,b=Number.isFinite(g)&&g>0?g/c:1,w=Math.max(1,(h-u)*y),x=Math.max(1,(m-d)*b),C=i.replace(/(\bwidth=")[^"]*/i,`$1${w}`).replace(/(\bheight=")[^"]*/i,`$1${x}`).replace(/(\bviewBox=")[^"]*/i,`$1${u} ${d} ${h-u} ${m-d}`);return t.replace(i,C)}function jo(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function he(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function br(t){let e=t.indexOf(",");if(e<0)return"";let n=t.slice(e+1,e+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(n)}catch{return""}}function me(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Za(t){let e=[],n="",r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(e.push(n),n=""):n+=o}return n.trim()&&e.push(n),e.map(i=>i.trim()).filter(Boolean)}function _d(t){let e=[],n="",r=0;for(let o=0;o<t.length;o++){let s=t[o];s==="("&&r++,s===")"&&(r=Math.max(0,r-1)),s===","&&r===0?(e.push(n.trim()),n=""):n+=s}n.trim()&&e.push(n.trim());let i=[];for(let o of e){if(/\binset\b/i.test(o))continue;let s=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",l="0px",f="0px"]=s;f=`${parseFloat(f)/2}px`;let c=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),u=!!c&&c!==",";i.push(`drop-shadow(${a} ${l} ${f}${u?` ${c}`:""})`)}return i.join(" ")}function tl(t){let e=Za(t),n=null,r=null,i=null,o=[];for(let a of e){let l=a.indexOf(":");if(l<0)continue;let f=a.slice(0,l).trim().toLowerCase(),c=a.slice(l+1).trim();f==="box-shadow"?i=c:f==="filter"?n=c:f==="-webkit-filter"?r=c:o.push([f,c])}if(i){let a=_d(i);a&&(n=n?`${n} ${a}`:a,r=r?`${r} ${a}`:a)}let s=[...o];return n&&s.push(["filter",n]),r&&s.push(["-webkit-filter",r]),s.map(([a,l])=>`${a}:${l}`).join(";")}function Ed(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${tl(r)}}`)}function Rd(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Ed(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${tl(r)}${n}`),t}function Fd(){return hr||(hr=(async()=>{try{let t='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',e=new Image;e.decoding="sync",e.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await e.decode();let n=document.createElement("canvas");n.width=8,n.height=20;let r=n.getContext("2d",{willReadFrequently:!0});r.drawImage(e,0,0);let i=r.getImageData(2,18,1,1).data[3]>128,o=r.getImageData(2,2,1,1).data[3]>128;return{native:i||o,flippedY:o&&!i}}catch{return{native:!1,flippedY:!1}}})(),hr)}function Td(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("?n++:o===")"?n=Math.max(0,n-1):o===","&&n===0&&(e.push(t.slice(r,i)),r=i+1)}return e.push(t.slice(r)),e.map(i=>{let o=0,s=0,a="",l=0;for(;l<i.length;){let f=i[l];if(f==="("?o++:f===")"&&(o=Math.max(0,o-1)),o===0&&(l===0||i[l-1]===" ")){let c=/^-?\d*\.?\d+px/.exec(i.slice(l));if(c){s++,a+=s===2?`${-parseFloat(c[0])}px`:c[0],l+=c[0].length;continue}}a+=f,l++}return a}).join(",")}function Pd(t,e){let n=r=>Za(r).map(i=>{let o=i.indexOf(":");if(o<0)return i;let s=i.slice(0,o).trim().toLowerCase();return s==="text-shadow"||e&&s==="box-shadow"?`${s}:${Td(i.slice(o+1))}`:i}).join(";");return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(r,i)=>r.replace(i,i.replace(/([^{}]+)\{([^}]*)\}/g,(o,s,a)=>`${s}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(r,i,o)=>`style=${i}${n(o)}${i}`),t}async function wr(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:r}=await Fd();try{let i=t;return n||(i=Rd(i)),r&&(i=Pd(i,n)),{svg:i,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function $d(){let t=document.createElement("canvas");t.width=16,t.height=16;let e=t.getContext("2d",{willReadFrequently:!0});return e?n=>{e.clearRect(0,0,16,16),e.drawImage(n,0,0,16,16);let r=e.getImageData(0,0,16,16).data;for(let i=3;i<r.length;i+=4)if(r[i]>0)return!0;return!1}:null}async function Nd(t,e,n){Z(t),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{if(!n)return await mr(),await mr(),!1;let r=performance.now()+(e?600:150);for(;;){let i;try{i=n(t)}catch{return!1}if(i)return!0;if(performance.now()>r)return!1;await mr()}}finally{try{t.remove()}catch{}}}function Qa(t){if(typeof document>"u"||!document.body)return new Image;if(Et&&!Et.contentDocument){try{Et.remove()}catch{}Et=null}if(Et&&gr>Ld&&yn===0){try{Et.remove()}catch{}Et=null}if(!Et){let n=document.createElement("iframe");Z(n),n.setAttribute("aria-hidden","true"),n.style.cssText="position:absolute;left:-9999px;top:0;width:0;height:0;border:0;visibility:hidden;pointer-events:none";try{document.body.appendChild(n)}catch{}if(n.contentDocument)Et=n,gr=0;else{try{n.remove()}catch{}return new Image}}gr+=t.length,yn+=1;let e=Et.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function qo(t,e=!1){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,yn=Math.max(0,yn-1),e&&(Vo=!0),Vo&&yn===0&&(Et?.remove(),Et=null,gr=0,Vo=!1))}function Ja(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function Bd(t){if(typeof t!="string")return!1;let e=t.indexOf(",")+1,n=Math.max(48,Math.floor((t.length-e)/200)),r=0,i=0;for(let o=e;o+48<=t.length;o+=n){let s=t.slice(o,o+48);r++,Wd.some(a=>s.includes(a))||i++}return i*2>r}function Go(t,e,n,r,i){if(!e.naturalWidth){t.drawImage(e,0,0,n,r);return}let o=n*r,s=o>Id&&!Bd(i)?Math.min(Dd,Math.ceil(o/Od)):1;if(s===1){t.drawImage(e,0,0,n,r);return}let a=e.naturalWidth,l=e.naturalHeight/r;for(let f=0;f<s;f++){let c=Math.round(f*r/s),u=f===s-1?r:Math.round((f+1)*r/s);t.drawImage(e,0,c*l,a,(u-c)*l,0,c,n,u-c)}}async function zt(t,e){let{width:n,height:r,scale:i=1,dpr:o=1,meta:s={},backgroundColor:a,crop:l=null}=e,f=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,c=t,u=!1,d=!1;if(l&&!jo(t))throw new RangeError("[SnapDOM] Only SVG captures can be cropped.");if(jo(t)){let m=(br(t).match(/<svg\b[^>]*>/i)||[])[0]||"",p=parseFloat((m.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((m.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(p)&&Number.isFinite(g)&&p>0&&g>0&&Math.min(1,$t/p,$t/g,Math.sqrt(ne/(p*g)))<1;if(l||y||X())try{let b=he(t);if(l&&(b=yr(b,l)),X()){let w=await wr(b);b=w.svg,u=w.naturalOnly,d=/@font-face|data:image\//i.test(b)}(y||l)&&(b=Ad(b,e.__session)),c=me(b)}catch(b){if(l)throw b;c=t}}let h=f||Qa(c);try{f||await Ja(h,c)}catch(m){if(!h.__snapdomDecodeFrame)throw m;let p=h;h=Qa(c),qo(p);try{await Ja(h,c)}catch(g){throw qo(h,e.__releaseDecodeFrame),g}}try{!f&&!X()&&!wt()&&jo(c)&&/(?:%40|@)font-face/i.test(c)&&await new Promise(P=>{let A=new MessageChannel;A.port1.onmessage=()=>{A.port1.close(),A.port2.close(),P()},A.port2.postMessage(0)});let m=X()&&!f?$d():null,p=!1;m&&(p=await Nd(h,d,m));let g=f?f.width:h.naturalWidth,y=f?f.height:h.naturalHeight,b=l?g:Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:g,w=l?y:Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:y,x,C,S=Number.isFinite(n),M=Number.isFinite(r);if(S&&M)x=Math.max(1,n),C=Math.max(1,r);else if(S){let P=n/Math.max(1,b);x=n,C=w*P}else if(M){let P=r/Math.max(1,w);C=r,x=b*P}else{let P=f&&Number.isFinite(s.vbW)&&Number.isFinite(s.vbH);x=P?s.vbW:g,C=P?s.vbH:y}!S&&!M&&(x=x*i,C=C*i);let _=x*o,E=C*o,v=Math.max(_/$t,E/$t,Math.sqrt(_*E/ne));v>1&&(At(e.__session,"canvas-clamp",`output ${Math.round(_)}x${Math.round(E)}px exceeds canvas limits; downscaled`),console.warn(`[SnapDOM] ${Math.round(_)}\xD7${Math.round(E)}px is larger than a canvas allows; scaled down. For full size, export ${typeof CompressionStream=="function"?"a PNG blob, ":""}an SVG, or crop.`),x/=v,C/=v);let k=Rt(e.canvas)&&it(e.canvas,"canvas")?e.canvas:document.createElement("canvas");k.width=Math.max(1,x*o),k.height=Math.max(1,C*o),k.style.width=`${x}px`,k.style.height=`${C}px`;let R=k.getContext("2d");if(!R)throw new Error("[SnapDOM] The canvas you passed has no 2D context (is it already used for WebGL?).");let F=null,$=e.__layoutZoom||1;if(!f&&$>1&&wt()){let P=$*b/(x*o),A=Math.round(x*o*P),L=Math.round(C*o*P);P>1.01&&A<=$t&&L<=$t&&A*L<=ne&&(F={w:A,h:L})}let I=()=>{if(o!==1&&R.scale(o,o),a&&(R.save(),R.fillStyle=a,R.fillRect(0,0,x,C),R.restore()),u&&(Math.round(x*o)!==g||Math.round(C*o)!==y)){let P=document.createElement("canvas");P.width=g,P.height=y,Go(P.getContext("2d"),h,g,y,c),R.drawImage(P,0,0,x,C)}else{if(R.save(),R.setTransform(1,0,0,1,0,0),F){let P=document.createElement("canvas");for(P.width=F.w,P.height=F.h,Go(P.getContext("2d"),h,F.w,F.h,c);P.width>x*o*2;){let A=document.createElement("canvas");A.width=Math.ceil(P.width/2),A.height=Math.ceil(P.height/2),A.getContext("2d").drawImage(P,0,0,A.width,A.height),P=A}R.imageSmoothingQuality="high",R.drawImage(P,0,0,x*o,C*o)}else Go(R,h,x*o,C*o,c);R.restore()}};if(I(),m&&p&&d){let P=!0;try{P=m(h)}catch{}if(!P){let A=performance.now()+600;do{await mr();try{P=m(h)}catch{break}}while(!P&&performance.now()<A);k.width=k.width,I()}}return k}finally{qo(h,e.__releaseDecodeFrame)}}var $t,ne,hr,mr,Ld,Et,gr,yn,Vo,Id,Od,Dd,Wd,ge=lt(()=>{"use strict";mt();se();kt();Mt();$t=X()?16384:32767,ne=16384*16384;hr=null;mr=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});Ld=24*1024*1024,Et=null,gr=0,yn=0,Vo=!1;Id=4e6,Od=2e6,Dd=8,Wd=["%3C","%3E","%20","%7B","%7D","%3B"]});var bn={};we(bn,{rasterize:()=>Xo});async function Xo(t,e){let n=await zt(t,e),o=n.width*n.height<=2e6?n.toDataURL(`image/${e.format}`,e.quality):await new Promise(a=>{let l=()=>a(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(f=>{if(!f)return l();let c=new FileReader;c.onload=()=>a(String(c.result||"")),c.onerror=l,c.readAsDataURL(f)},`image/${e.format}`,e.quality)}catch{l()}}),s=new Image;return s.src=o,X()?await s.decode():await new Promise((a,l)=>{if(s.complete&&s.naturalWidth)return a();s.onload=a,s.onerror=l}),s.style.width=`${n.width/e.dpr}px`,s.style.height=`${n.height/e.dpr}px`,s}var Ge=lt(()=>{"use strict";ge();mt()});var Yo={};we(Yo,{toImg:()=>Ud,toSvg:()=>Ud});async function Ud(t,e){let{scale:n=1,width:r,height:i,meta:o={}}=e,s=Number.isFinite(r),a=Number.isFinite(i),l=Number.isFinite(n)&&n!==1||s||a;if(X()&&l)try{let{svg:d}=await wr(he(t)),h=(d.match(/<svg\b[^>]*>/i)||[])[0]||"",m=parseFloat((h.match(/\bwidth="([\d.]+)/i)||[])[1]),p=parseFloat((h.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(m)||!Number.isFinite(p))throw new Error("The SVG has no size.");let g=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:m,y=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:p,b,w;s&&a?(b=r,w=i):s?(b=r,w=Math.max(1,Math.round(y*(r/Math.max(1,g))))):a?(w=i,b=Math.max(1,Math.round(g*(i/Math.max(1,y))))):(b=Math.max(1,Math.round(m*n)),w=Math.max(1,Math.round(p*n)));let x=d.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${w}"`),C=new Image;return C.decoding="sync",C.loading="eager",C.src=me(x),await C.decode(),C.style.width=`${b}px`,C.style.height=`${w}px`,C}catch(d){return At(e.__session,"safari-png-fallback","Safari vector toImg failed; using PNG",d),H(e,"Safari couldn't show the SVG; used a PNG.",d),Xo(t,{...e,format:"png",quality:1,meta:o})}let f=t,c=!1;if(!s&&!a&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let d=he(t),h=(d.match(/<svg\b[^>]*>/i)||[])[0]||"",m=Number((h.match(/\bwidth="([\d.]+)"/i)||[])[1]),p=Number((h.match(/\bheight="([\d.]+)"/i)||[])[1]);if(m>0&&p>0){let g=h.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(m*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(p*n))}"`);f=me(d.replace(h,g)),c=!0}}catch{}let u=new Image;u.decoding="sync",u.loading="eager",u.src=f;try{await u.decode()}catch(d){if(!c)throw d;u.src=t,c=!1,await u.decode()}if(s&&a)u.style.width=`${r}px`,u.style.height=`${i}px`;else if(s){let d=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:u.naturalWidth,h=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:u.naturalHeight,m=r/Math.max(1,d);u.style.width=`${r}px`,u.style.height=`${Math.max(1,Math.round(h*m))}px`}else if(a){let d=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:u.naturalWidth,h=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:u.naturalHeight,m=i/Math.max(1,h);u.style.height=`${i}px`,u.style.width=`${Math.max(1,Math.round(d*m))}px`}else{let d=Math.max(1,Math.round(u.naturalWidth*(c?1:n))),h=Math.max(1,Math.round(u.naturalHeight*(c?1:n)));if(u.style.width=`${d}px`,u.style.height=`${h}px`,!c&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let p=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${d}"`).replace(/height="[^"]*"/,`height="${h}"`);u.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,await u.decode()}catch(m){H(e,"Couldn't size the SVG image.",m),u.src!==t&&(u.src=t,await u.decode().catch(()=>{}))}}return u}var Ko=lt(()=>{"use strict";St();se();Ge();ge()});var rl={};we(rl,{encodePng:()=>zd});function Sr(t,e=new Uint8Array(0)){let n=new Uint8Array(e.length+12),r=new DataView(n.buffer);r.setUint32(0,e.length);for(let o=0;o<4;o++)n[o+4]=t.charCodeAt(o);n.set(e,8);let i=4294967295;for(let o=4;o<n.length-4;o++)i=nl[(i^n[o])&255]^i>>>8;return r.setUint32(n.length-4,(i^4294967295)>>>0),n}async function zd(t,e,n){if(![t,e].every(p=>Number.isInteger(p)&&p>0&&p<=2147483647))throw new RangeError("[SnapDOM] PNG dimensions must be integers from 1 to 2147483647");let r=new Uint8Array(13),i=new DataView(r.buffer);i.setUint32(0,t),i.setUint32(4,e),r[8]=8,r[9]=6;let o=[new Uint8Array([137,80,78,71,13,10,26,10]),Sr("IHDR",r),Sr("sRGB",new Uint8Array([0]))],s=t*4,a=Math.max(1,Math.floor(65536/(s+1))),l=new Uint8Array(s),f=0,c=new CompressionStream("deflate"),u=c.writable.getWriter(),d=c.readable.getReader(),h,m=(async()=>{try{for(;;){let{done:p,value:g}=await d.read();if(p)return;o.push(Sr("IDAT",g))}}catch(p){h=p,await u.abort(p).catch(()=>{})}})();try{for await(let p of n){if(!(p instanceof Uint8Array||p instanceof Uint8ClampedArray)||!p.length||p.length%s)throw new RangeError("[SnapDOM] PNG input must contain complete RGBA rows");let g=p.length/s;if(f+g>e)throw new RangeError("[SnapDOM] PNG input exceeds the declared height");for(let y=0;y<g;y+=a){let b=Math.min(g,y+a),w=new Uint8Array((b-y)*(s+1));for(let x=y;x<b;x++){let C=p.subarray(x*s,(x+1)*s),S=(x-y)*(s+1),M=0,_=0;for(let E=0;E<s;E++){let v=C[E]-(E<4?0:C[E-4])&255,k=C[E]-l[E]&255;M+=Math.min(v,256-v),_+=Math.min(k,256-k),w[S+E+1]=k}if(w[S]=_<=M?2:1,M<_)for(let E=0;E<s;E++)w[S+E+1]=C[E]-(E<4?0:C[E-4]);l=C}await u.write(w)}l=l.slice(),f+=g}if(f!==e)throw new RangeError("[SnapDOM] PNG input does not match the declared height");if(await u.close(),await m,h)throw h;return o.push(Sr("IEND")),new Blob(o,{type:"image/png"})}catch(p){throw await Promise.allSettled([u.abort(p),d.cancel(p)]),await m,p}finally{u.releaseLock(),d.releaseLock()}}var nl,ol=lt(()=>{"use strict";nl=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;nl[t]=e}});function xr(t,e){if(typeof t!="string"||!t.startsWith("data:image/svg+xml"))return null;let n=br(t).match(/<svg\b[^>]*>/i)?.[0];if(!n)return null;let r=e.crop?yr(n,e.crop):n,i=parseFloat(r.match(/\bwidth="([^"]+)/i)?.[1]),o=parseFloat(r.match(/\bheight="([^"]+)/i)?.[1]),s=(r.match(/\bviewBox="([^"]+)/i)?.[1]||"").trim().split(/[\s,]+/).map(Number);if(!(i>0&&o>0)||s.length!==4||!s.every(Number.isFinite)||!(s[2]>0&&s[3]>0))return null;let a=Number.isFinite(e.width),l=Number.isFinite(e.height),f=e.meta||{},c=Math.max(1,Math.floor(i)),u=Math.max(1,Math.floor(o)),d=e.crop?c:Number.isFinite(f.vbW)?f.vbW:Number.isFinite(f.w0)?f.w0:c,h=e.crop?u:Number.isFinite(f.vbH)?f.vbH:Number.isFinite(f.h0)?f.h0:u,m=e.dpr??1,p=e.scale??1,g=(a&&l?Math.max(1,e.width):a?e.width:l?e.height*d/Math.max(1,h):c*p)*m,y=(a&&l?Math.max(1,e.height):l?e.height:a?e.width*h/Math.max(1,d):u*p)*m;if(Math.max(i,o,g,y)<=$t&&i*o<=ne&&g*y<=ne||typeof CompressionStream!="function")return null;return b();async function b(){let{encodePng:w}=await Promise.resolve().then(()=>(ol(),rl)),x=Math.max(1,Math.floor(g)),C=Math.max(1,Math.floor(y)),S=he(t),M=S.slice(S.indexOf(n)+n.length,S.lastIndexOf("</svg>")),_=r.match(/\bpreserveAspectRatio="([^"]*)"/i)?.[1]||"xMidYMid meet",E=i/s[2],v=o/s[3],k=0,R=0;/\bnone\b/.test(_)||(E=v=/\bslice\b/.test(_)?Math.max(E,v):Math.min(E,v),k=(i-s[2]*E)*(/xMin/.test(_)?0:/xMax/.test(_)?1:.5),R=(o-s[3]*v)*(/YMin/.test(_)?0:/YMax/.test(_)?1:.5)),k-=s[0]*E,R-=s[1]*v;let F=r.replace(/\s(?:width|height|preserveAspectRatio)="[^"]*"/gi,"").slice(0,-1),$=X()&&/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(S),I=i/g,P=o/y,A=Math.max(1,Math.min(8192,Math.floor(4*1024*1024/x),$?Math.floor(2046/P):8192)),L=Math.max(1,Math.min(8192,x,$?Math.floor(2046/I):8192));async function*N(){for(let T=0;T<C;T+=A){let z=Math.min(A,C-T),q=new Uint8Array(x*z*4);for(let j=0;j<x;j+=L){let J=Math.min(L,x-j),B=$?Math.max(0,Math.floor(j*I)-1):j*I,ut=$?Math.max(0,Math.floor(T*P)-1):T*P,vt=$?Math.min(c,Math.ceil((j+J)*I)+1)-B:J,at=$?Math.min(u,Math.ceil((T+z)*P)+1)-ut:z,st=vt/s[2],nt=at/s[3],pt=$?1:1/I,Ht=$?1:1/P,ye=`matrix(${E*pt/st},0,0,${v*Ht/nt},${(k-B)*pt/st+s[0]},${(R-ut)*Ht/nt+s[1]})`,V=`${F} width="${vt}" height="${at}" preserveAspectRatio="none"><g style="all:unset!important;transform:${ye}!important;transform-origin:0 0!important">${M}</g></svg>`,G=await zt(me(V),{width:vt,height:at,dpr:1,backgroundColor:$?null:e.backgroundColor,__session:e.__session,__releaseDecodeFrame:!0}),U=G;try{if($){U=document.createElement("canvas"),U.width=J,U.height=z;let Y=U.getContext("2d");e.backgroundColor&&(Y.fillStyle=e.backgroundColor,Y.fillRect(0,0,J,z)),Y.drawImage(G,j*I-B,T*P-ut,J*I,z*P,0,0,J,z)}let ht=U.getContext("2d").getImageData(0,0,J,z).data;for(let Y=0;Y<z;Y++)q.set(ht.subarray(Y*J*4,(Y+1)*J*4),(Y*x+j)*4)}finally{G.width=G.height=0,U!==G&&(U.width=U.height=0)}}yield q}}return w(x,C,N())}}var Qo=lt(()=>{"use strict";ge();mt()});var il={};we(il,{toBlob:()=>Jo});async function Jo(t,e){let n=e.format||e.type||"svg";if(n==="svg"){if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)throw new Error("[SnapDOM] html-in-canvas makes a raster capture, not an SVG; ask for png, jpeg or webp.");let o=decodeURIComponent(t.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let r=n==="png"&&xr(t,e);if(r)return r;let i=await zt(t,e);return new Promise(o=>i.toBlob(s=>o(s),`image/${n==="jpg"?"jpeg":n}`,e.quality))}var Zo=lt(()=>{"use strict";ge();Qo()});var al={};we(al,{download:()=>Hd});async function sl(t,e){let n=new File([t],e,{type:t.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:e})}catch(r){if(r.name!=="AbortError")return!1}return!0}async function Hd(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(e?.type||"").toLowerCase(),i=n.has(r)?r:"",o=(e?.format||i||"").toLowerCase(),s=o==="jpg"?"jpeg":o||"png",a=e?.filename||"snapdom",l=/\.(png|jpe?g|webp|svg)$/i.test(a)?a:`${a}.${s}`,f={...e||{},format:s,type:s};f.dpr=1;let c=en(),u=s==="png"&&xr(t,f);if(s==="svg"||u){let m=u?await u:await Jo(t,{...f,type:"svg"});if(c&&await sl(m,l))return;let p=URL.createObjectURL(m),g=document.createElement("a");g.href=p,g.download=l,document.body.appendChild(g),g.click(),setTimeout(()=>URL.revokeObjectURL(p),1e3),g.remove();return}let d=await zt(t,f);if(c){let m=`image/${s}`,p=await new Promise(g=>d.toBlob(g,m,e?.quality));if(p&&await sl(p,l))return}let h=document.createElement("a");h.href=d.toDataURL(`image/${s}`,e?.quality),h.download=l,document.body.appendChild(h),h.click(),h.remove()}var ll=lt(()=>{"use strict";Zo();ge();Qo();mt()});St();St();mt();yt();vn();Mt();var Jt=new WeakMap,Ci=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],Ur=new Map,ql=2e3,_e=0;function Nt(){_e++}function kn(t){let e=t&&(t.nodeType===1?t:t.parentElement);for(;e;){if(Xt(e))return!0;e.parentElement?e=e.parentElement:e=Ft(e)}return!1}function An(t){for(let e of t)if(le(e))return!0;return!1}function le(t){if(kn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!kn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!kn(n)){e=!1;break}}if(e)return!1}return!0}var Ae=new WeakMap;function Ti(t){for(let e of t){if(!le(e))continue;let n=e.target.ownerDocument||document;Ae.set(n,(Ae.get(n)||0)+1);let r=e.target.nodeType===1?e.target:e.target.parentElement||e.target.host;for(;r;r=r.parentElement||Ft(r))Ae.set(r,(Ae.get(r)||0)+1)}}function sn(t){let e=t.ownerDocument||document;return Fe(e),(Ae.get(e)||0)-(Ae.get(t)||0)}var Tt=0;function Ee(t=document){return Fe(t),Tt}function Bt(){return Fe(),_e}function an(t){return t?(Fe(t.ownerDocument||document),_n(t,Xr(t))):0}function Re(){Nt(),Tt++}var ae=new WeakMap,Kt=0,Qt=0;function Gl(t){ae.set(t,++Kt)}function qr(t){if(!t||t.nodeType!==1)return;Kt++,ae.set(t,Kt);let e=t.querySelectorAll("*");for(let n=0;n<e.length;n++)ae.set(e[n],Kt)}function Gr(t){qr(t.parentElement||t);for(let e=t.parentElement;e;e=e.parentElement)Gl(e)}function _n(t,e=null){let n=ae.get(t)||0;if(e)for(let r of e)n=Math.max(n,ae.get(r)||0);return Qt*1e9+n}function Xr(t){let e=t.getRootNode?.();if(!e?.host)return null;let n=[];for(;e?.host;)e.mode==="open"&&Kr(e),n.push(e.host),e=e.host.getRootNode?.();return n}var zr=new WeakMap;function Yr(t){t=t||document;let e=zr.get(t);if(!e||e.env!==Tt){let n=!0;try{n=Zt(t).usesHas}catch{}e={env:Tt,usesHas:n},zr.set(t,e)}return!e.usesHas}function Xl(t){let e=n=>n?.nodeType===1&&(n.matches?.("style,link")||n.querySelector?.("style,link"));for(let n of t){let r=n.target,i=r&&(r.nodeType===1?r:r.parentElement);if(i&&(i.tagName==="STYLE"||i.tagName==="LINK"))return i.ownerDocument||document;for(let o of n.addedNodes)if(e(o))return o.ownerDocument||document;for(let o of n.removedNodes)if(e(o))return o.ownerDocument||r&&r.ownerDocument||document}return null}var Hr=new WeakSet,nn=[];function Pi(t){if(!An(t))return;Ti(t),Nt();let e=new Set;for(let n of t){if(!le(n))continue;let r=n.target.getRootNode&&n.target.getRootNode();if(!r||r.nodeType!==11||e.has(r))continue;e.add(r),r.host?qr(r.host):Kt++;let i=r.querySelectorAll("*");for(let o=0;o<i.length;o++)ae.set(i[o],Kt)}}function Kr(t){if(!(!t||Hr.has(t))){Hr.add(t);try{let e=new MutationObserver(Pi);e.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),nn.push({o:e,root:t})}catch{}}}function $i(t){if(!An(t))return;Ti(t),Nt();let e=Xl(t);if(e){zr.delete(e),Tt++,Qt++;return}let n=new Set;for(let r of t){if(!le(r))continue;let i=r.target.nodeType===1?r.target:r.target.parentElement;if(!i)continue;let o=i.ownerDocument||document;if(!Yr(o)){Qt++;return}if(i===o.documentElement||i===o.body){Qt++;return}let s=i.parentElement||i;n.has(s)||(n.add(s),Gr(i))}}var jr=new WeakSet,rn=null,on=[];function Fe(t=document){if(t===rn||!t||t.nodeType!==9)return;if(jr.has(t)){rn=t;return}jr.add(t),rn=t;let e=t.defaultView,n=i=>{An(i)&&(Nt(),Tt++)},r=()=>{Nt(),Tt++};try{let i=new MutationObserver($i);i.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),on.push({o:i,env:!1,doc:t})}catch{}try{let i=new MutationObserver(n);i.observe(t.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),on.push({o:i,env:!0,doc:t})}catch{}try{e?.addEventListener("resize",r,{passive:!0})}catch{}try{let i=o=>{Nt();let s=o.composedPath?.()[0]||o.target;s&&s.nodeType===1&&!kn(s)&&Yr(s.ownerDocument||t)?Gr(s):Qt++};t.addEventListener("focusin",i,{capture:!0,passive:!0}),t.addEventListener("focusout",i,{capture:!0,passive:!0}),t.addEventListener("change",i,{capture:!0,passive:!0}),t.addEventListener("pointerdown",i,{capture:!0,passive:!0}),t.addEventListener("pointerup",i,{capture:!0,passive:!0}),t.addEventListener("pointercancel",i,{capture:!0,passive:!0}),t.addEventListener("keydown",i,{capture:!0,passive:!0}),t.addEventListener("keyup",i,{capture:!0,passive:!0}),t.addEventListener("beforetoggle",i,{capture:!0,passive:!0}),t.addEventListener("toggle",i,{capture:!0,passive:!0}),e?.addEventListener("hashchange",()=>{Nt(),Qt++},{passive:!0})}catch{}try{let i=t.fonts;i&&(i.addEventListener?.("loadingdone",r),i.status==="loading"&&i.ready?.then(r).catch(()=>{}))}catch{}}var ki=new WeakMap;function Mi(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let r=ki.get(t)||[];if(r.length===n.length&&r.every((o,s)=>o===n[s]))return;if(ki.set(t,n),Nt(),t.nodeType===11){t.host?qr(t.host):Kt++;for(let o of t.querySelectorAll("*"))ae.set(o,Kt);return}let i=r.filter(o=>!n.includes(o)).concat(n.filter(o=>!r.includes(o)));for(let o of i)if(o.isConnected)if(Yr(e))Gr(o);else{Qt++;return}}function En(t,e=null){if(!t)return;Mi(t,t);let n=e||nn.filter(({root:r})=>r.host?.isConnected).map(({root:r})=>r);for(let r of n)Mi(r,t)}function Pt(){Fe();try{for(let t=on.length-1;t>=0;t--){let{o:e,env:n,doc:r}=on[t];if(r!==document&&!r.defaultView){try{e.disconnect()}catch{}jr.delete(r),rn===r&&(rn=null),on.splice(t,1);continue}let i=e.takeRecords();i.length&&(n?An(i)&&(Nt(),Tt++):$i(i))}for(let t=nn.length-1;t>=0;t--){let{o:e,root:n}=nn[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}Hr.delete(n),nn.splice(t,1);continue}let r=e.takeRecords();r.length&&Pi(r)}}catch{}}function ce(t){if(!(!t||t.nodeType!==1)){Jt.delete(t);try{let e=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();)Jt.delete(e.currentNode)}catch{}}}var Yl=["mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"];function Qr(t){let e=Jt.get(t);if(e&&Rn(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function Ni(t){let e=Jt.get(t);if(!e||!Rn(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}var Ai=new WeakMap;function Zt(t){let e=Ai.get(t);if(!e||e.epoch!==_e){let n=e&&e.universe;e={epoch:_e,...gi(t)};let r=e.universe;if(n&&r&&n.size===r.size){let i=!0;for(let o of r)if(!n.has(o)){i=!1;break}i&&(e.universe=n)}Ai.set(t,e)}return e}function Li(t){try{let e=Zt(t.ownerDocument||document).shareGate;if(e===null)return!1;if(!e.length)return!0;let n=new Set,r=s=>{n.add("t"+s.localName),s.id&&n.add("i"+s.id);let a=s.classList;for(let l=0;l<a.length;l++)n.add("c"+a[l])};r(t);for(let s of t.querySelectorAll("*"))r(s);let i=[];for(let{sel:s,key:a}of e)(a===null||n.has(a))&&i.push(s);if(!i.length)return!0;let o=i.join(",");return!t.matches(o)&&t.querySelector(o)===null}catch{return!1}}function Kl(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Zt(e).importantProps}function ln(t,e){let n=t.ownerDocument||document,r=t.getRootNode?t.getRootNode():n;return r===n?Zt(n).universe:e&&Dt(r)?Ql(t,r,n,e):null}var _i=new WeakMap;function Ql(t,e,n,r){let i=r.__shadowUniverse;if(i===null)return null;if(!i){let a=Zt(n).universe;if(!a)return r.__shadowUniverse=null;i=r.__shadowUniverse={universe:new Set(a),roots:new Set}}let o=a=>{for(;Dt(a)&&!i.roots.has(a);a=a.host.getRootNode()){i.roots.add(a);for(let l of[...a.styleSheets,...a.adoptedStyleSheets||[]]){let f=_i.get(l);if((!f||f.epoch!==_e)&&_i.set(l,f={epoch:_e,props:hi(l)}),!f.props)return!1;for(let c of f.props)i.universe.add(c)}Nr(a.getAnimations(),i.universe)}return!0},s=o(e)&&(!t.shadowRoot||o(t.shadowRoot));for(let a=t.assignedSlot;s&&a;a=a.assignedSlot)s=o(a.getRootNode());return s?i.universe:r.__shadowUniverse=null}function Mn(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:Zt(e).pseudoUniverse}var Jl={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function Te(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?Jl:Zt(e).pseudoGates}function Zl(t,e={},n=null,r=null){let i={},o=e.excludeStyleProps,s=h=>{if(i[h]!==void 0||ve(h)||o&&(o instanceof RegExp&&o.test(h)||typeof o=="function"&&o(h)))return;let m=t.getPropertyValue(h);m&&((h==="background-image"||h==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),i[h]=m)};if(r){for(let m of r)s(m);let h=n&&n.style;if(h&&h.length)for(let m=0;m<h.length;m++)s(h[m])}else for(let h=0;h<t.length;h++)s(t[h]);let a=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let h of a)if(!i[h])try{let m=t.getPropertyValue(h);m&&(i[h]=m)}catch{}let l=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let h of l)if(!i[h])try{let m=t.getPropertyValue(h);m&&(i[h]=m)}catch{}if(e.embedFonts){let h=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let m of h)if(!i[m])try{let p=t.getPropertyValue(m);p&&(i[m]=p)}catch{}}try{(i["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(i["content-visibility"]="hidden")}catch{}Object.defineProperty(i,"__needsBgInline",{value:Ii(t),enumerable:!1});let f=parseFloat(t.getPropertyValue("border-top-width")||0)||0,c=parseFloat(t.getPropertyValue("border-right-width")||0)||0,u=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,d=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(f===0&&c===0&&u===0&&d===0){let h=(t.getPropertyValue("border-image-source")||"").trim(),m=h&&h!=="none",p=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color","border-block-start","border-block-start-width","border-block-start-style","border-block-start-color","border-block-end","border-block-end-width","border-block-end-style","border-block-end-color","border-inline-start","border-inline-start-width","border-inline-start-style","border-inline-start-color","border-inline-end","border-inline-end-width","border-inline-end-style","border-inline-end-color"];for(let g of p)delete i[g];m||(i.border="none")}return tc(i),i}function tc(t){if(!wt())return;let e=t["background-clip"]||t["-webkit-background-clip"];if(!e||!e.includes("text"))return;let n=o=>o==="transparent"||o==="rgba(0, 0, 0, 0)",r=t["-webkit-text-fill-color"];if(!n(r!==void 0?r:t.color))return;let i=ec(t["background-image"],t["background-color"]);i&&(n(t.color)&&(t.color=i),r!==void 0&&(t["-webkit-text-fill-color"]=i),t["background-image"]="none",t["background-color"]="transparent",delete t["background-clip"],delete t["-webkit-background-clip"],Object.defineProperty(t,"__bgClipTextFix",{value:i,enumerable:!1}))}function ec(t,e){let n=o=>{let s=[],a=/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)(?:[,\s/]+([\d.]+%?))?\s*\)/g,l;for(;l=a.exec(o||"");){let f=l[4];(f===void 0?1:parseFloat(f)/(f.endsWith("%")?100:1))>.05&&s.push([+l[1],+l[2],+l[3]])}return s},r=n(t);if(r.length||(r=n(e)),!r.length)return null;let i=[0,0,0];for(let[o,s,a]of r)i[0]+=o,i[1]+=s,i[2]+=a;return`rgb(${i.map(o=>Math.round(o/r.length)).join(", ")})`}function Ii(t){let e=t.getPropertyValue("background-image");if(e&&e!=="none")return!0;let n=t.getPropertyValue("background-color");if(n&&n!=="rgba(0, 0, 0, 0)"&&n!=="transparent")return!0;for(let i of Yl){let o=t.getPropertyValue(i);if(o&&o!=="none")return!0}let r=t.getPropertyValue("background");return!!(r&&/url\s*\(/i.test(r))}function nc(t){for(let e=t.firstChild;e;e=e.nextSibling){if(e.nodeType===3&&/\S/.test(e.nodeValue||""))return!0;if(e.nodeType===1){let n=O(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function rc(t,e,n){try{if(typeof t.computedStyleMap=="function"){let i=t.computedStyleMap().get("width");if(i!=null)return!Ei(String(i).trim().toLowerCase())}}catch{}let r=t.style&&(t.style.width||t.style.inlineSize);return r&&!Ei(String(r).trim().toLowerCase())?!0:ic(t,e)?n||sc(t,e):!1}var oc=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function Ei(t){return oc.has(t)||t.startsWith("fit-content")}function ic(t,e){let n=t.getBoundingClientRect().width-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)-(parseFloat(e.borderLeftWidth)||0)-(parseFloat(e.borderRightWidth)||0);if(!(n>0))return!1;let r=1/0,i=-1/0,o=null;for(let s=t.firstChild;s;s=s.nextSibling){let a;if(s.nodeType===3){if(!/\S/.test(s.nodeValue||"")||(o=o||document.createRange(),o.selectNode(s),a=o.getBoundingClientRect(),!a.width&&!a.height))continue}else if(s.nodeType===1){let l=O(s);if(l.display==="none"||l.position==="absolute"||l.position==="fixed")continue;a=s.getBoundingClientRect()}else continue;a.left<r&&(r=a.left),a.right>i&&(i=a.right)}return i===-1/0?!1:i-r<n-.5}function sc(t,e){let n=t.parentElement;if(!n)return!1;let r=O(n),i=n.getBoundingClientRect().width-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0)-(parseFloat(r.borderLeftWidth)||0)-(parseFloat(r.borderRightWidth)||0)-(parseFloat(e.marginLeft)||0)-(parseFloat(e.marginRight)||0);return i>0?Math.abs(t.getBoundingClientRect().width-i)>.5:!1}var Vr=new WeakMap;function ac(t,e){let n=Vr.get(t);if(n)return n;let r=[e];for(let i in t)r.push(i,t[i]);return n=r.join(""),Vr.set(t,n),n}function Rn(t,e){return t.env===Tt&&t.stamp===_n(e,t.hosts)}var lc=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,cc=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,fc=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);function uc(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function dc(t,e){let n=e.ids.get(t);if(n!==void 0)return n;let r=t.parentElement,i;if(!r)i="R";else if(i=e.ids.get(r),i===void 0){if(e.rootSeen)return e.ids.set(t,-1),-1;i="R"}if(e.rootSeen=!0,i===-1)return e.ids.set(t,-1),-1;let o="",s=t.attributes;if(s&&s.length)if(s.length===1)o=s[0].name+"="+s[0].value;else{let l=[];for(let f=0;f<s.length;f++)l.push(s[f].name+"="+s[f].value);l.sort(),o=l.join("")}let a=i+"|"+t.tagName+"|"+o;return n=e.intern.get(a),n===void 0&&(n=e.intern.size,e.intern.set(a,n)),e.ids.set(t,n),n}function Oi(t,e){let n=t.snap,r=t.snap={...n};Object.defineProperty(r,"__needsBgInline",{value:n.__needsBgInline,enumerable:!1}),n.__bgClipTextFix!==void 0&&Object.defineProperty(r,"__bgClipTextFix",{value:n.__bgClipTextFix,enumerable:!1});let i=Zt(e.ownerDocument||document),o=e.getAttribute&&e.getAttribute("style")||"",s=o&&cc.test(o),a=!!i.marginUnstable||s&&/margin/i.test(o),l=!!i.paddingUnstable||s&&/padding/i.test(o),f=r.display!==void 0&&r.display.includes("grid"),c=r.transform!==void 0&&r.transform!=="none",u=[];for(let m in r)(lc.test(m)||f&&(m==="grid-template-columns"||m==="grid-template-rows")||c&&m==="transform"||a&&m.charCodeAt(0)===109&&m.startsWith("margin-")||l&&m.charCodeAt(0)===112&&m.startsWith("padding-"))&&u.push(m);t.h&&!("height"in r)&&u.push("height"),t.b&&!("block-size"in r)&&u.push("block-size");let d=new Set(u),h=[e.tagName.toLowerCase()];for(let m in r)d.has(m)||h.push(m,r[m]);return t.rr=u,t.sig=h.join("")+""+u.join(""),u}function Di(t,e,n,r,i){let o=i&&i.__styleShare?r&&r.__styleShare:null,s=o?o.ids.get(t):void 0;if(s===void 0||s===-1||t.shadowRoot||t.assignedSlot)return ke(n,Mn(t));let a=s+e,l=o.pseudo||(o.pseudo=new Map),f=l.get(a);if(f){let u={...f.snap},d=f.rr||Oi(f,t);for(let h=0;h<d.length;h++){let m=n.getPropertyValue(d[h]);m?u[d[h]]=m:delete u[d[h]]}return u}let c=ke(n,Mn(t));return l.set(a,{snap:c,rr:null,sig:null,h:"height"in c,b:"block-size"in c}),c}function pc(t,e=null,n={},r=null,i=null){let o=Jt.get(t),s=!!(n&&n.embedFonts),a=n&&n.excludeStyleProps||null;if(typeof a!="function"&&o&&Rn(o,t)&&o.embedFonts===s&&o.excludeStyleProps===a)return o.snapshot;let l=e||getComputedStyle(t),f,c=null,u=r&&r.st.snaps.get(r.id);if(u){f={...u.snap};let p=u.rr||Oi(u,t);c=[];for(let g=0;g<p.length;g++){let y=p[g],b=l.getPropertyValue(y);b?f[y]=b:delete f[y],c.push(b)}Object.defineProperty(f,"__needsBgInline",{value:u.snap.__needsBgInline,enumerable:!1}),u.snap.__bgClipTextFix!==void 0&&Object.defineProperty(f,"__bgClipTextFix",{value:u.snap.__bgClipTextFix,enumerable:!1})}else f=Zl(l,n,t,ln(t,i)),r&&r.st.snaps.set(r.id,{snap:f,rr:null,sig:null,h:"height"in f,b:"block-size"in f});let d=!1;if(typeof t.computedStyleMap=="function"){let p;for(let g of Ci)if(f[g]==="0px")try{p||=t.computedStyleMap(),p.get(g)?.toString()==="auto"&&(f[g]="auto",d=!0)}catch{}}Rc(t,l,f);let h=wc(t,l,f);c!==null&&(d&&c.push("",...Ci.map(p=>f[p])),h&&c.push(""+h),Vr.set(f,u.sig+""+c.join("")+("height"in f?"":"")+("block-size"in f?"":"")));let m=Xr(t);return Jt.set(t,{env:Tt,stamp:_n(t,m),hosts:m,snapshot:f,embedFonts:s,excludeStyleProps:a}),f}function hc(t,e){if(t&&t.session&&t.persist)return t;if(t&&(t.styleMap||t.styleCache||t.nodeMap)){let n=t.__ctx;return(!n||t.__ctxOpts!==e)&&(n={session:t,persist:{snapshotKeyCache:Ur,defaultStyle:D.defaultStyle,baseStyle:D.baseStyle,image:D.image,resource:D.resource,background:D.background},options:e||{}},t.__ctx=n,t.__ctxOpts=e),n}return{session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},persist:{snapshotKeyCache:Ur,defaultStyle:D.defaultStyle,baseStyle:D.baseStyle,image:D.image,resource:D.resource,background:D.background},options:t||e||{}}}var mc=/%|[\d.](?:em|rem|ex|ch|cap|ic|lh|rlh|v[whib]|vmin|vmax|cq[whbi]|cqmin|cqmax)\b|\b(?:calc|var|min|max|clamp|env|attr)\(|\b(?:auto|inherit|initial|unset|revert|currentcolor|-webkit-fill-available|fit-content|min-content|max-content)\b/i,gc=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";function yc(t,e,n){if(!t.style||t.style.length===0)return;let r=Kl(t),i=r!=null&&!mc.test(t.getAttribute("style")||""),o;for(let s=0;s<t.style.length;s++){let a=t.style[s],l=a.startsWith("border-")&&a.endsWith("-width");if(i&&l&&o===void 0){let c=t.style.borderWidth,u=Jt.get(t);o=u&&Rn(u,t)&&Wi.every(d=>u.snapshot[d]===c)||n.borderWidth===c}if(i&&!r.has(a)&&(!l||o)&&!(a.startsWith("background")&&gc(t)))continue;let f=n.getPropertyValue(a);f&&(!l||f!==t.style.getPropertyValue(a))&&e.style.setProperty(a,f,t.style.getPropertyPriority(a))}}function dt(t,e,n,r){if(t.tagName==="STYLE")return;let i=hc(n,r),o=i.options&&i.options.cache||"soft";o!=="disabled"&&Fe(t.ownerDocument),o==="disabled"&&!i.session.__bumpedForDisabled&&(Nt(),Ur.clear(),i.session.__bumpedForDisabled=!0);let{session:s,persist:a}=i;if(!s.styleCache.has(t)){let y=null;try{y=getComputedStyle(t)}catch{}s.styleCache.set(t,y||getComputedStyle((t.ownerDocument||document).documentElement))}let l=s.styleCache.get(t);t.getAttribute?.("style")&&yc(t,e,l);let f=l.getPropertyValue("animation-name");e&&e.style&&f&&f!=="none"&&e.style.setProperty("animation","none","important");let c=t.tagName?.toLowerCase()||"div";if(Ze.has(c)){let y={};Object.defineProperty(y,"__needsBgInline",{value:Ii(l),enumerable:!1});let b=Xr(t);Jt.set(t,{env:Tt,stamp:_n(t,b),hosts:b,snapshot:y,embedFonts:!!(i.options&&i.options.embedFonts),excludeStyleProps:i.options&&i.options.excludeStyleProps||null}),s.styleMap.set(e,"");return}let u=null;if(i.options&&i.options.__styleShare&&s.styleMap){let y=uc(s),b=dc(t,y),w=t.ownerDocument||document,x=w.activeElement;b!==-1&&!fc.has(t.tagName)&&!(x&&x!==w.body&&x!==w.documentElement&&x===t)&&(!t.getRootNode||t.getRootNode()===w)&&!t.shadowRoot&&!t.assignedSlot&&(u={st:y,id:b})}let d=pc(t,l,i.options,u,s);if(t.getAttribute?.("style"))for(let y of["top","right","bottom","left"]){let b=`margin-${y}`;d[b]==="auto"&&e.style.setProperty(b,"auto","important")}d.__bgClipTextFix&&e&&e.style&&(e.style.setProperty("background-image","none","important"),e.style.setProperty("background-color","transparent","important"),e.style.setProperty("color",d.__bgClipTextFix,"important"),e.style.setProperty("-webkit-text-fill-color",d.__bgClipTextFix,"important")),bc(t,l,d),e.style?.length&&d["box-sizing"]==="border-box"&&l.getPropertyValue("box-sizing")!=="border-box"&&vc(t,e,d);let h=Hi(t);if(kc(t,e,d,h,s),h){let y=l.getPropertyValue("min-width");if(!y||y==="auto"||y==="0px"){d["min-width"]="0px";let b=l.getPropertyValue("overflow-x"),w=t.parentElement;if(y==="auto"&&(b==="visible"||b==="clip")&&w&&O(w).display.includes("flex")){let x=s.flexOverflow||(s.flexOverflow=new WeakMap),C=x.get(w);if(C===void 0){if(C=w.scrollWidth>w.clientWidth,!C){let S=O(w),M=F=>parseFloat(S.getPropertyValue(F))||0,_=M("width")-(S.boxSizing==="border-box"?M("padding-left")+M("padding-right")+M("border-left-width")+M("border-right-width"):0),v=S.flexDirection.startsWith("row")===(S.writingMode==="horizontal-tb")&&S.flexWrap==="nowrap",k=0,R=0;for(let F of w.children){s.styleCache.has(F)||s.styleCache.set(F,getComputedStyle(F));let $=s.styleCache.get(F);if($.display==="none"||$.position==="absolute"||$.position==="fixed")continue;let I=A=>parseFloat($.getPropertyValue(A))||0,P=I("width")+I("margin-left")+I("margin-right")+($.boxSizing==="border-box"?0:I("padding-left")+I("padding-right")+I("border-left-width")+I("border-right-width"));k=v?k+P:Math.max(k,P),R++}C=k+(v?Math.max(0,R-1)*M("column-gap"):0)>_+R/60}x.set(w,C)}C&&(d["min-width"]=d.width)}}}let m=ac(d,c),p=!0;if(Cn(c,(d.display||"").toLowerCase())){p=nc(t),p&&Dr(c,d,h)&&rc(t,l,h)&&(p=!1),m=`${m}${p?"|c":""}${h?"|f":""}`;let y=d["text-wrap-mode"]||d["white-space"]||"";p&&y!=="nowrap"&&y!=="pre"&&(s.reconcileRisk=(s.reconcileRisk||0)+1)}let g=a.snapshotKeyCache.get(m);g===void 0&&(g=Ce(d,c,p,h),a.snapshotKeyCache.size>=ql&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(m,g)),s.styleMap.set(e,g)}function bc(t,e,n){let r=e.getPropertyValue("overflow-x"),i=e.getPropertyValue("overflow-y");if((r==="visible"||!r)&&(i==="visible"||!i)||e.getPropertyValue("box-sizing")==="border-box"||typeof t.clientWidth!="number"||!t.offsetWidth)return;let o=f=>parseFloat(f)||0,s=t.offsetWidth-t.clientWidth-o(e.getPropertyValue("border-left-width"))-o(e.getPropertyValue("border-right-width")),a=t.offsetHeight-t.clientHeight-o(e.getPropertyValue("border-top-width"))-o(e.getPropertyValue("border-bottom-width")),l=(f,c)=>{let u=n[f];if(!u||!u.endsWith("px"))return;let d=parseFloat(u);Number.isFinite(d)&&(n[f]=`${Math.round((d+c)*1e3)/1e3}px`)};s>=2&&(l("width",s),l("inline-size",s)),a>=2&&(l("height",a),l("block-size",a))}var Wi=["border-top-width","border-right-width","border-bottom-width","border-left-width"],Bi=["width","inline-size","height","block-size"];function wc(t,e,n){if(!Wi.some(l=>n[l]?.includes("."))||e.getPropertyValue("box-sizing")==="border-box"||n.display==="inline")return"";for(let l of["width","height"]){let f=n[`min-${l}`],c=n[`max-${l}`];if(f&&f!=="0px"&&f!=="auto"||c&&c!=="none")return""}let r=l=>parseFloat(n[l])||0,i=r("padding-left")+r("padding-right")+r("border-left-width")+r("border-right-width"),o=r("padding-top")+r("padding-bottom")+r("border-top-width")+r("border-bottom-width"),s=(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb";for(let l of Bi){let f=n[l];if(!f||!f.endsWith("px"))continue;let u=l==="width"||l==="inline-size"&&!s||l==="block-size"&&s?i:o;n[l]=`${Math.round((parseFloat(f)+u)*1e3)/1e3}px`}n["box-sizing"]="border-box";let a="";if(e.getPropertyValue("overflow-x")==="auto"){let l=t.scrollWidth<=t.clientWidth;n["overflow-x"]=l?"hidden":"auto",l&&(a+="x")}if(e.getPropertyValue("overflow-y")==="auto"){let l=t.scrollHeight<=t.clientHeight;n["overflow-y"]=l?"hidden":"auto",l&&(a+="y")}return a}var Sc=["box-sizing",...Bi,"overflow-x","overflow-y"],xc=/(?:box-sizing|width|height|inline-size|block-size|overflow(?:-[xy])?)\s*:/i;function vc(t,e,n){if(xc.test(t.getAttribute("style")))for(let r of Sc)e.style.getPropertyValue(r)&&n[r]&&e.style.setProperty(r,n[r],e.style.getPropertyPriority(r))}function Cc(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}var Ri=typeof CSS<"u"&&CSS.supports?.("text-wrap-mode","nowrap")?"text-wrap-mode":"white-space";function kc(t,e,n,r,i){let o=n.display||"";if(!r&&!o.startsWith("inline-")&&(n.float||"none")==="none"&&n.position!=="absolute"&&n.position!=="fixed")return;let s=n["text-wrap-mode"]||n["white-space"]||"";if(s==="nowrap"||s==="pre"||Ri==="white-space"&&s!=="normal"||(n["writing-mode"]||"horizontal-tb")!=="horizontal-tb"||!e.style)return;let a=i.__oneLine||=new WeakSet;for(let l=t.parentElement;l;l=l.parentElement)if(a.has(l))return;Mc(t,n,i)&&(a.add(t),e.style.setProperty(Ri,"nowrap"))}function Mc(t,e,n){let r=t.clientHeight-(parseFloat(e["padding-top"])||0)-(parseFloat(e["padding-bottom"])||0);if(r>3*(parseFloat(e["font-size"])||16)||e["word-break"]==="normal"&&e["overflow-wrap"]==="normal"&&/^[\w\u00C0-\u024F.,:;!?'"()%]*$/.test(t.textContent.trim()))return!1;let i=t.ownerDocument||document,o=i.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),s=i.createRange(),a=null,l=0,f=0;for(let d=o.nextNode();d;d=o.nextNode()){if(d.nodeType===1){if(d.shadowRoot||d.localName==="br"||d.localName==="textarea")return!1;continue}if(/\S/.test(d.data)){if(++f>64)return!1;s.selectNodeContents(d);for(let h of s.getClientRects())if(h.height){if(a||=h,Math.min(a.bottom,h.bottom)-Math.max(a.top,h.top)<Math.min(a.height,h.height)/2)return!1;l=Math.max(l,h.height)}}}if(!a)return!1;let c=zi(t,n.__axes||=new WeakMap);if(!c)return!1;let u=c===Ui&&t.offsetHeight?t.getBoundingClientRect().height/t.offsetHeight:1;return r*u<=2*l}var Ac=0,Fi=1,Ui=2;function zi(t,e){let n=e.get(t);if(n!==void 0)return n;let r=O(t),i=r.transform,o=i&&i!=="none"?i.slice(i.indexOf("(")+1,-1).split(",").map(parseFloat):null;if(r.rotate&&r.rotate!=="none"||o&&(i.startsWith("matrix3d")?o[1]||o[4]:o[1]||o[2]))n=Ac;else{let s=t.parentElement||Ft(t);n=s?zi(s,e):Fi,n===Fi&&(r.scale&&r.scale!=="none"||r.zoom&&r.zoom!=="1"||o&&(i.startsWith("matrix3d")?o[0]!==1||o[5]!==1:o[0]!==1||o[3]!==1))&&(n=Ui)}return e.set(t,n),n}function Hi(t){let e=t.parentElement;if(!e)return!1;let n=O(e).display||"";return n.includes("flex")||n.includes("grid")}function _c(t){for(let r=t.firstChild;r;r=r.nextSibling)if(r.nodeType===3&&/\S/.test(r.nodeValue))return!0;let e=t.firstElementChild,n=t.lastElementChild;if(e&&e.tagName==="BR"||n&&n.tagName==="BR")return!0;for(let r=t.firstElementChild;r;r=r.nextElementSibling){let i=O(r);if(i.display==="none")continue;let o=i.position;if(o!=="absolute"&&o!=="fixed")return!0}return!1}function Ec(t){let e=t.getBoundingClientRect().top,n=-1/0,r=null;for(let i=t.firstChild;i;i=i.nextSibling){if(i.nodeType===3){if(!/\S/.test(i.nodeValue||""))continue;r=r||document.createRange(),r.selectNode(i);let a=r.getBoundingClientRect();(a.width||a.height)&&(n=Math.max(n,a.bottom));continue}if(i.nodeType!==1)continue;let o=O(i);if(o.display==="none")continue;let s=o.position;s==="absolute"||s==="fixed"||o.float&&o.float!=="none"||(n=Math.max(n,i.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-e}function Rc(t,e,n){if(Rt(t)&&t.style&&t.style.height)return;let r=t.tagName&&t.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r)||e.aspectRatio&&e.aspectRatio!=="none"&&e.aspectRatio!=="auto")return;let o=e.display||"";if(o.includes("flex")||o.includes("grid"))return;let s=e.position;if(s==="absolute"||s==="fixed"||s==="sticky"||e.transform!=="none"||Cc(e)||Hi(t))return;let a=e.overflowX||e.overflow||"visible",l=e.overflowY||e.overflow||"visible";if(a!=="visible"||l!=="visible")return;let f=e.clip;if(f&&f!=="auto"&&f!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||!_c(t))return;let c=parseFloat(e.height),u=Ec(t);Number.isFinite(c)&&Number.isFinite(u)&&Math.abs(c-u)>2||(delete n.height,delete n["block-size"])}Me();var Fc=new Set(["symbol","defs"]),Tc=new Set(["mask","clipPath","linearGradient","radialGradient","pattern","marker","filter"]),Jr=new WeakMap,ji=-1;function Fn(t){let e=Bt();return e!==ji&&(Jr=new WeakMap,ji=e),Vi(t)}function Vi(t){let e=Jr.get(t);if(e!==void 0)return e;let n;if(t.namespaceURI==="http://www.w3.org/2000/svg"&&(Tc.has(t.localName)?n=!1:Fc.has(t.localName)&&(n=!0)),n===void 0){let r=t.parentNode;n=!!(r&&r.nodeType===1)&&Vi(r)}return Jr.set(t,n),n}function qi(t,e){if(t?.nodeType!==1||e?.nodeType!==1||Fn(t))return;let n=t.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(a&&typeof a.value=="string"&&!a.value.startsWith("data:")&&a.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(t)}catch{}if(r){let o=t.style;if(o&&o.length){let s=new Set;for(let a=0;a<o.length;a++){let l=o[a];if(s.has(l))continue;s.add(l);let f=o.getPropertyValue(l);if(!f||!f.includes("var("))continue;let c=i&&i.getPropertyValue(l);if(c)try{e.style.setProperty(l,c.trim(),o.getPropertyPriority(l))}catch{}}}}if(r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(!a||typeof a.value!="string"||a.value.startsWith("data:")||!a.value.includes("var("))continue;let l=a.name,f=i&&i.getPropertyValue(l);if(f)try{e.style.setProperty(l,f.trim())}catch{}}}}St();St();yt();Se();vn();kt();function Pe(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:"))}function $e(t,e){if(!t)return null;let n=0;try{n=e?e.getBoundingClientRect().width||e.width:0}catch{}n||(n=window.innerWidth||1e3);let r=[];for(let o of t.split(",")){let s=o.trim().split(/\s+/);if(!s[0])continue;let a=s[1]||"",l=1;/^\d*\.?\d+x$/i.test(a)?l=parseFloat(a):/^\d+w$/i.test(a)&&(l=parseInt(a,10)/n),r.push({url:s[0],d:l})}if(!r.length)return null;r.sort((o,s)=>o.d-s.d);let i=window.devicePixelRatio||1;return(r.find(o=>o.d>=i)||r[r.length-1]).url}function Gi(t,e){let n=t.currentSrc||"";if(n&&!Pe(n))return n;let r=e.querySelectorAll("source[srcset]"),i=null;for(let o of r){let s=o.getAttribute("srcset");if(!s||Pe(s))continue;let a=o.getAttribute("type");if(a&&!Ar.test(a.trim()))continue;let l=o.getAttribute("media");if(l)try{if(window.matchMedia(l).matches)return $e(s,t)}catch{}i||(i=$e(s,t))}return i}function Xi(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let r of e)if(r&&!Pe(r))return r;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let r=n.split(",")[0].trim().split(/\s+/)[0];if(r&&!Pe(r))return r}return null}Mt();mt();function Pc(t,e){if(t=t.trim(),!t)return t;let n=e?`[data-sd-slotted~="${e}"]`:"[data-sd-slotted]";return t.endsWith(":not([data-sd-slotted])")||t.endsWith(`:not(${n})`)?t:`${t}:not(${n})`}var $c=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,Nc=/^::?(?:before|after|first-letter)$/;function Lc(t,e,n=!0,r){return Lr(t,",").map(i=>i.trim()).filter(Boolean).map(i=>{if(i.startsWith(":where(")&&i.includes("data-sd")||i.startsWith("@"))return i;let o=i.match($c);if(o&&Nc.test(o[0]))return":not(*)";let s=o?i.slice(0,o.index).trim():i,a=n?Pc(s,r):s;return`:where(${e} ${a})${o?o[0]:""}`}).join(", ")}function Qi(t,e,n){return t?(t=t.replace(/:host-context\(([^)]+)\)/g,(r,i)=>`:where(:where(${i.trim()}) ${e})`),t=t.replace(/:host\(([^)]+)\)/g,(r,i)=>`:where(${e}:is(${i.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(r,i)=>`:where(${e} ${i.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(r,i,o,s)=>{let a=Lc(s,e,!0,n);return`${i}${o}${a}{`}),t):""}function Ji(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function fe(t){let e="";for(let n of t)if(n.media&&n.cssRules){let r=!1;try{r=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}r&&(e+=fe(n.cssRules))}else if(n.constructor?.name==="CSSSupportsRule")e+=`@supports ${n.conditionText}{${fe(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let r=n.cssText.slice(0,n.cssText.indexOf("{")+1);e+=r+(n.style?n.style.cssText:"")+fe(n.cssRules)+"}"}else e+=n.cssText+`
|
|
9
|
+
`;return e}function Zi(t){let e="";try{t.querySelectorAll("style").forEach(r=>{let i=null;try{i=r.sheet&&r.sheet.cssRules}catch{}e+=(i?fe(i):r.textContent||"")+`
|
|
10
|
+
`});let n=t.adoptedStyleSheets||[];for(let r of n)try{r&&r.cssRules&&(e+=fe(r.cssRules))}catch{}}catch{}return e}function ts(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function es(t,e,n={}){try{let r=null,i=O(t).content;if(i&&i.includes("url(")){let f=i.match(/url\(["']?([^"')]+)["']?\)/);f&&(r=f[1])}let o=t.closest?.("picture"),s=t.getAttribute("src")||"",a=t.getAttribute("srcset")||"",l=r||(o?Gi(t,o):!a.trim()&&s.startsWith("data:")?s:t.currentSrc)||$e(a,t)||t.src||"";if((!l||Pe(l))&&n.resolvePicturePlaceholders!==!1){let f=Xi(t);f&&(l=f)}if(!l)return;e.getAttribute("src")!==l&&e.setAttribute("src",l),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function ns(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function Ic(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch{}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch{}return""}function rs(t,e,n){let r=[];for(let i of e){let o=Ic(t,i);o&&r.push(`${i}: ${o};`)}return r.length?`${n}{${r.join("")}}
|
|
11
|
+
`:""}function os(t,e){if(!t)return;let n=r=>{let i=r.getAttribute("data-sd-slotted")||"";e?` ${i} `.includes(` ${e} `)||r.setAttribute("data-sd-slotted",i?`${i} ${e}`:e):r.setAttribute("data-sd-slotted",i)};t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll?.("*").forEach(n)}async function Oc(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<e&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function Dc(t){let e=t.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let l=getComputedStyle(t);n=parseFloat(l.borderLeftWidth)||0,r=parseFloat(l.borderRightWidth)||0,i=parseFloat(l.borderTopWidth)||0,o=parseFloat(l.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+r))),a=Math.max(0,Math.round(e.height-(i+o)));return{contentWidth:s,contentHeight:a,rect:e}}function xt(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let r=getComputedStyle(t);if(e===0){let i=parseFloat(r.width);!isNaN(i)&&i>0&&(e=i)}if(n===0){let i=parseFloat(r.height);!isNaN(i)&&i>0&&(n=i)}}catch{}if(e===0||n===0)try{if(e===0){let r=parseFloat(t.getAttribute("width"));!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(t.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}function Wc(t,e,n){let r=t.defaultView,i=r?r.scrollX:0,o=r?r.scrollY:0,s=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,l=t.documentElement?t.documentElement.scrollLeft:0,f=t.documentElement?t.documentElement.scrollTop:0,c=0,u=0,d=0,h=0;try{let p=r&&t.body?r.getComputedStyle(t.body):null;p&&(c=(parseFloat(p.marginTop)||0)+(parseFloat(p.paddingTop)||0),u=(parseFloat(p.marginRight)||0)+(parseFloat(p.paddingRight)||0),d=(parseFloat(p.marginBottom)||0)+(parseFloat(p.paddingBottom)||0),h=(parseFloat(p.marginLeft)||0)+(parseFloat(p.paddingLeft)||0))}catch{}let m=t.createElement("style");if(m.setAttribute("data-sd-iframe-pin",""),Z(m),m.textContent=`html {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${c}px ${u}px ${d}px ${h}px !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(m),ce(t.documentElement),i||o)try{t.body&&(t.body.scrollLeft=i,t.body.scrollTop=o),t.documentElement&&(t.documentElement.scrollLeft||(t.documentElement.scrollLeft=i),t.documentElement.scrollTop||(t.documentElement.scrollTop=o))}catch{}return()=>{try{m.remove()}catch{}try{r&&typeof r.scrollTo=="function"&&r.scrollTo(i,o),t.body&&(t.body.scrollLeft=s,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=l,t.documentElement.scrollTop=f)}catch{}ce(t.documentElement)}}async function Zr(t,e,n){let r=await Oc(t,3);if(!r)throw new Error("The iframe document isn't ready.");let{contentWidth:i,contentHeight:o,rect:s}=Dc(t),a=n?.snap;if(!a||typeof a.toPng!="function")throw new Error("Iframes are only captured through snapdom(el).");let l={...n,scale:1,clip:null,__pinned:!0},f=Wc(r,i,o),c;try{c=await a.toPng(r.documentElement,l)}finally{f()}c.style.display="block",c.style.width=`${i}px`,c.style.height=`${o}px`;let u=document.createElement("div");return e.nodeMap.set(u,t),dt(t,u,e,n),u.style.overflow="hidden",u.style.display="block",u.style.width||(u.style.width=`${Math.round(s.width)}px`),u.style.height||(u.style.height=`${Math.round(s.height)}px`),u.appendChild(c),u}function is(t){try{let e=t&&t.accentColor;if(e&&e!=="auto"&&e!=="none")return e;let n=t&&t.color;if(n)return n}catch{}return"#0a6ed1"}function ss(t){let{width:e,height:n}=xt(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Number.isFinite(o)&&o>0?o:e||r.width||128,l=Number.isFinite(s)&&s>0?s:n||r.height||16,f=Number.parseFloat(t.min)||0,c=Number.isFinite(Number.parseFloat(t.max))?Number.parseFloat(t.max):100,u=Number.parseFloat(t.value),d=c-f,h=d>0&&Number.isFinite(u)?Math.min(1,Math.max(0,(u-f)/d)):.5,m="middle";try{i&&i.verticalAlign&&(m=i.verticalAlign)}catch{}let p=document.createElement("div");p.setAttribute("data-snapdom-input-replacement","range"),p.style.cssText=`display:inline-block;width:${a}px;height:${l}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let g=document.createElementNS("http://www.w3.org/2000/svg","svg");g.setAttribute("width",String(a)),g.setAttribute("height",String(l)),g.setAttribute("viewBox",`0 0 ${a} ${l}`),g.style.cssText=`width:${a}px;height:${l}px;overflow:visible`,p.appendChild(g);function y(){let b=is(i),w=!!t.disabled,x=Math.max(2,Math.min(4,l)),C=(l-x)/2,S=Math.max(10,Math.min(14,Math.max(l,10))),M=S/2,_=M+h*Math.max(0,a-S);g.innerHTML="";let E=(k,R,F,$)=>{let I=document.createElementNS("http://www.w3.org/2000/svg","rect");I.setAttribute("x",String(k)),I.setAttribute("y",String(C)),I.setAttribute("width",String(Math.max(0,R))),I.setAttribute("height",String(x)),I.setAttribute("rx",String(x/2)),I.setAttribute("fill",F),$&&I.setAttribute("fill-opacity",$),g.appendChild(I)};E(0,a,"#808080","0.4"),E(0,_,b);let v=document.createElementNS("http://www.w3.org/2000/svg","circle");v.setAttribute("cx",String(_)),v.setAttribute("cy",String(l/2)),v.setAttribute("r",String(M)),v.setAttribute("fill",b),g.appendChild(v),w&&g.setAttribute("opacity","0.5"),p.style.setProperty("width",`${a}px`,"important"),p.style.setProperty("height",`${l}px`,"important"),p.style.setProperty("min-width",`${a}px`,"important"),p.style.setProperty("min-height",`${l}px`,"important")}return y(),{el:p,applyVisual:y}}function as(t){let{width:e,height:n}=xt(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Math.round(e||r.width||0),l=Math.round(n||r.height||0),f=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,a||16),c=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,l||16),u=(t.type||"text").toLowerCase()==="checkbox",d=!!t.checked,h=!!t.indeterminate,p=Math.max(Math.min(f,c),12),g=Math.max(f,p),y=Math.max(c,p),b="middle";try{i&&i.verticalAlign&&(b=i.verticalAlign)}catch{}let w=document.createElement("div");w.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),w.style.cssText=`display:inline-block;width:${g}px;height:${y}px;vertical-align:${b};flex-shrink:0;line-height:0;`;let x=document.createElementNS("http://www.w3.org/2000/svg","svg");x.setAttribute("width",String(g)),x.setAttribute("height",String(y)),x.setAttribute("viewBox",`0 0 ${p} ${p}`),x.style.cssText=`width:${g}px;height:${y}px`,w.appendChild(x);function C(){let S=is(i),M=2,_=M/2,E=p-M;if(x.innerHTML="",u){let v=document.createElementNS("http://www.w3.org/2000/svg","rect");if(v.setAttribute("x",String(_)),v.setAttribute("y",String(_)),v.setAttribute("width",String(E)),v.setAttribute("height",String(E)),v.setAttribute("rx","2"),v.setAttribute("ry","2"),v.setAttribute("fill",d?S:"none"),v.setAttribute("stroke",S),v.setAttribute("stroke-width",String(M)),x.appendChild(v),d){let k=document.createElementNS("http://www.w3.org/2000/svg","path");k.setAttribute("d",`M ${_+2} ${p/2} L ${p/2-1} ${p-_-2} L ${p-_-2} ${_+2}`),k.setAttribute("stroke","white"),k.setAttribute("stroke-width",String(Math.max(1.5,M))),k.setAttribute("fill","none"),k.setAttribute("stroke-linecap","round"),k.setAttribute("stroke-linejoin","round"),x.appendChild(k)}else if(h){let k=document.createElementNS("http://www.w3.org/2000/svg","rect"),R=Math.max(6,E-4);k.setAttribute("x",String((p-R)/2)),k.setAttribute("y",String((p-M)/2)),k.setAttribute("width",String(R)),k.setAttribute("height",String(M)),k.setAttribute("fill",S),k.setAttribute("rx","1"),x.appendChild(k)}}else{let v=document.createElementNS("http://www.w3.org/2000/svg","circle");if(v.setAttribute("cx",String(p/2)),v.setAttribute("cy",String(p/2)),v.setAttribute("r",String((p-M)/2)),v.setAttribute("fill",d?S:"none"),v.setAttribute("stroke",S),v.setAttribute("stroke-width",String(M)),x.appendChild(v),d){let k=document.createElementNS("http://www.w3.org/2000/svg","circle"),R=Math.max(2,(p-M*2)*.35);k.setAttribute("cx",String(p/2)),k.setAttribute("cy",String(p/2)),k.setAttribute("r",String(R)),k.setAttribute("fill","white"),x.appendChild(k)}}w.style.setProperty("width",`${g}px`,"important"),w.style.setProperty("height",`${y}px`,"important"),w.style.setProperty("min-width",`${g}px`,"important"),w.style.setProperty("min-height",`${y}px`,"important")}return C(),{el:w,applyVisual:C}}var cn=new ct(80);async function Bc(t){if(D.resource?.has(t))return D.resource.get(t);if(cn.has(t))return cn.get(t);let e=(async()=>{let n=await ft(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`Couldn't read ${t}`);return D.resource?.set(t,n.data),n.data})();cn.set(t,e);try{let n=await e;return cn.set(t,n),n}catch(n){throw cn.delete(t),n}}var Yi=/\bblob:[^)"'\s]+/g;function Tn(t){return typeof t=="string"&&t.startsWith("blob:")}function Uc(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function zc(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function fn(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function Pn(t,e=null){if(!t)return;let n=e,r=new Set,i=[],o=new Map,s=(p,g,y,b)=>{r.add(y),i.push(()=>{o.has(y)&&(p.setAttribute(g,o.get(y)),b?.())})},a=(p,g)=>{if(!p||!p.includes("blob:"))return;let y=p.match(Yi)||[];if(y.length){for(let b of y)r.add(b);i.push(()=>{let b=p.replace(Yi,w=>o.get(w)||w);b!==p&&g(b)})}},l=fn(t,"img");for(let p of l)try{let y=p.getAttribute("src")||p.currentSrc||"";Tn(y)&&s(p,"src",y);let b=p.getAttribute("srcset");if(b&&b.includes("blob:")){let w=Uc(b);for(let x of w)Tn(x.url)&&r.add(x.url);i.push(()=>{let x=!1;for(let C of w)o.has(C.url)&&(C.url=o.get(C.url),x=!0);x&&p.setAttribute("srcset",zc(w))})}}catch(g){H(n,"Couldn't inline a blob: image.",g)}let f=fn(t,"image");for(let p of f)try{let g="http://www.w3.org/1999/xlink",y=p.getAttribute("href")||p.getAttributeNS?.(g,"href");Tn(y)&&s(p,"href",y,()=>p.removeAttributeNS?.(g,"href"))}catch(g){H(n,"Couldn't inline a blob: SVG image.",g)}let c=fn(t,"[style*='blob:']");for(let p of c)try{let g=p.getAttribute("style");a(g,y=>p.setAttribute("style",y))}catch(g){H(n,"Couldn't inline blob: URLs in a style attribute.",g)}let u=fn(t,"style");for(let p of u)try{let g=p.textContent||"";a(g,y=>{p.textContent=y})}catch(g){H(n,"Couldn't inline blob: URLs in a <style>.",g)}let d=["poster"];for(let p of d){let g=fn(t,`[${p}^='blob:']`);for(let y of g)try{let b=y.getAttribute(p);Tn(b)&&s(y,p,b)}catch(b){H(n,`Couldn't inline the blob: URL in ${p}.`,b)}}if(!r.size)return;let h=[...r],m=0;await Promise.all(Array.from({length:Math.min(4,h.length)},async()=>{for(;m<h.length;){let p=h[m++];try{o.set(p,await Bc(p))}catch(g){H(n,"Couldn't read a blob: URL; kept it as is.",g)}}}));for(let p of i)try{p()}catch(g){H(n,"Couldn't write an inlined blob: URL.",g)}}var Hc=["font-family","font-size","font-style","font-weight","font-stretch","font-variant","font-feature-settings","font-variation-settings","font-kerning","letter-spacing","text-transform"],jc=new Set(["text","search","email","url","tel","number","submit","reset","button"]),Vc=/[^\s\uD800-\uDFFF]{2,}/;function ls(t,e=document){let n=e.defaultView||window;if(!wt()||!e.body||!(n.visualViewport?.scale<1||n.screen.width<e.documentElement.clientWidth))return;let r=Z(e.createElement("div"));r.style.cssText="position:absolute;left:0;top:0;width:0;height:0;overflow:hidden;visibility:hidden";let i=[];for(let[o,s]of t){if(o.nodeType!==1||s.nodeType!==1)continue;let a=n.getComputedStyle(s),l=s.localName==="textarea"||s.localName==="input"&&jc.has(s.type)?Gc(s,a,e):qc(s,a.textAlign==="justify"||a.textAlignLast==="justify");if(!l)continue;let f=s.getBoundingClientRect(),c=s.offsetWidth&&f.width?f.width/s.offsetWidth:1,u=e.createElement("span");u.style.whiteSpace="pre";for(let d of Hc)u.style.setProperty(d,a.getPropertyValue(d));u.textContent=l.word,r.appendChild(u),i.push({clone:o,cs:a,span:u,live:l.distance/c,centers:l.centers,height:l.height})}if(i.length){e.body.appendChild(r);try{for(let{clone:o,cs:s,span:a,live:l,centers:f,height:c}of i){let u=a.firstChild,d=(parseFloat(s.letterSpacing)||0)*(f?u.length-1:u.length),h=c?e.createRange():null;h&&h.selectNodeContents(a);let m=c?h.getBoundingClientRect().height:f?Math.abs(Ki(u,u.length-1)-Ki(u,0)):a.getBoundingClientRect().width,p=(l-(c?0:d))/(m-(c?0:d));if(p>1.005&&Number.isFinite(p)){if(c){let g=[];for(let y of[!1,!0]){let b=parseFloat(s.fontSize),w=b*(p+1);for(let x=0;x<10;x++){let C=(b+w)/2;a.style.fontSize=`${C}px`;let S=h.getBoundingClientRect().height;(y?S>l:S>=l)?w=C:b=C}g.push((b+w)/2)}p=(g[0]+g[1])/2/parseFloat(s.fontSize)}o.style.setProperty("font-size",`${parseFloat(s.fontSize)*p}px`),s.lineHeight!=="normal"&&o.style.setProperty("line-height",`${parseFloat(s.lineHeight)*p}px`)}}}finally{r.remove()}}}function Ki(t,e){let n=t.ownerDocument.createRange();n.setStart(t,e),n.setEnd(t,e+1);let r=n.getBoundingClientRect();return r.left+r.width/2}function qc(t,e=!1){for(let n=t.firstChild;n;n=n.nextSibling){if(n.nodeType!==3)continue;let r=/\S+/.exec(n.data);if(!r)continue;let i=t.ownerDocument.createRange();i.setStart(n,r.index),i.setEnd(n,r.index+r[0].length);let o=i.getClientRects();return o.length===1?{word:r[0],distance:e?o[0].height:o[0].width,centers:!1,height:e}:null}return null}function Gc(t,e,n){let r=Vc.exec(t.value.split(`
|
|
12
|
+
`)[0]);if(!r||t.scrollLeft||t.scrollTop||!n.caretPositionFromPoint)return null;let i=t.getBoundingClientRect(),o=t.localName==="textarea"?i.top+(parseFloat(e.borderTopWidth)||0)+(parseFloat(e.paddingTop)||0)+3:i.top+i.height/2,s=c=>{let u=n.caretPositionFromPoint(c,o);return u&&u.offsetNode===t?u.offset:-1},a=i.width/16,l=c=>{let u=i.left;for(;u<=i.right&&s(u)<c;)u+=a;if(u>i.right)return NaN;let d=u-a;for(let h=0;h<16;h++){let m=(d+u)/2;s(m)>=c?u=m:d=m}return u},f=Math.abs(l(r.index+r[0].length)-l(r.index+1));return Number.isFinite(f)?{word:r[0],distance:f,centers:!0}:null}mt();var cs=new Set(["rgba(0, 0, 0, 0)","transparent"]),to="Highlight";function fs(t){let n=(t.ownerDocument||document).getSelection?.();if(!n||n.isCollapsed||n.rangeCount===0)return null;let r=[];for(let i=0;i<n.rangeCount;i+=1){let o=n.getRangeAt(i);if(!o.collapsed)try{o.intersectsNode(t)&&r.push(o)}catch{}}return r.length?{ranges:r,styles:new Map}:null}function Xc(t,e){if(e.styles.has(t))return e.styles.get(t);let n;try{let r=getComputedStyle(t);if(r.userSelect==="none"||r.webkitUserSelect==="none"||r.getPropertyValue("-webkit-user-select")==="none")return e.styles.set(t,null),null;let i=getComputedStyle(t,"::selection"),o=[],s=i.backgroundColor,a=s&&!cs.has(s)&&s!==r.backgroundColor;o.push(`background-color:${a?s:to}`),i.color&&i.color!==r.color&&o.push(`color:${i.color}`,`-webkit-text-fill-color:${i.color}`),i.textShadow&&i.textShadow!==r.textShadow&&o.push(`text-shadow:${i.textShadow}`),i.textDecorationLine&&i.textDecorationLine!=="none"&&i.textDecorationLine!==r.textDecorationLine&&o.push(`text-decoration:${i.textDecorationLine} ${i.textDecorationStyle||"solid"} ${i.textDecorationColor||"currentcolor"}`),n=o.join(";")}catch{n=`background-color:${to}`}return e.styles.set(t,n),n}function us(t,e){let n=t.data;if(!n)return null;let r=t.parentElement;if(!r)return null;let i=[];for(let f of e.ranges){let c=!1;try{c=f.intersectsNode(t)}catch{}if(!c)continue;let u=f.startContainer===t?f.startOffset:0,d=f.endContainer===t?f.endOffset:n.length;d>u&&i.push([u,d])}if(i.length===0)return null;let o=Xc(r,e);if(!o)return null;i.sort((f,c)=>f[0]-c[0]);let s=t.ownerDocument||document,a=s.createDocumentFragment(),l=0;for(let[f,c]of i){f>l&&a.append(s.createTextNode(n.slice(l,f)));let u=s.createElement("span");u.setAttribute("data-snapdom-selection",""),u.setAttribute("style",`all:unset;${o}`),u.textContent=n.slice(f,c),a.append(u),l=c}return l<n.length&&a.append(s.createTextNode(n.slice(l))),a}var $n=t=>Number.parseFloat(t)||0,Yc=["font-family","font-size","font-weight","font-style","font-variant","font-stretch","letter-spacing","word-spacing","text-transform","text-indent","text-align","line-height","tab-size","direction"];function Kc(t,e){try{let r=getComputedStyle(t,"::selection").backgroundColor;if(r&&!cs.has(r)&&r!==e.backgroundColor)return r}catch{}return to}function ds(t,e){let n=t.ownerDocument||document;if(n.activeElement!==t)return;let r=null,i=null;try{r=t.selectionStart,i=t.selectionEnd}catch{return}if(r==null||i==null||r===i)return;let o=t.value||"";if(t.localName==="input"&&t.type==="password"&&(o="\u2022".repeat(o.length)),!o)return;let s=getComputedStyle(t),a=t.localName==="textarea",l=$n(s.paddingLeft),f=$n(s.paddingTop),c=t.clientWidth-l-$n(s.paddingRight),u=t.clientHeight-f-$n(s.paddingBottom),d=n.createElement("div");d.style.cssText="position:absolute;top:0;left:-99999px;visibility:hidden;margin:0;border:0;padding:0;box-sizing:content-box;";for(let g of Yc)d.style.setProperty(g,s.getPropertyValue(g));a?(d.style.whiteSpace="pre-wrap",d.style.overflowWrap="break-word",d.style.width=`${Math.max(0,c)}px`):d.style.whiteSpace="pre";let h=n.createElement("span");h.textContent=o.slice(r,i),d.append(n.createTextNode(o.slice(0,r)),h,n.createTextNode(o.slice(i))),n.body.appendChild(d);let m=[];try{let g=d.getBoundingClientRect(),y=-t.scrollLeft,b=-t.scrollTop;if(!a){b+=Math.max(0,(u-g.height)/2);let w=s.direction==="rtl",x=s.textAlign;x==="start"?x=w?"right":"left":x==="end"&&(x=w?"left":"right");let C=c-g.width;C>0&&(x==="right"?y+=C:x==="center"&&(y+=C/2))}for(let w of h.getClientRects())w.width<=0||w.height<=0||m.push({x:l+(w.left-g.left)+y,y:f+(w.top-g.top)+b,width:w.width,height:w.height})}finally{d.remove()}if(m.length===0)return;let p=Kc(t,s);e.__snapdomFieldSelection={images:m.map(()=>`linear-gradient(${p},${p})`),positions:m.map(g=>`${g.x}px ${g.y}px`),sizes:m.map(g=>`${g.width}px ${g.height}px`),repeats:m.map(()=>"no-repeat"),origins:m.map(()=>"padding-box"),clips:m.map(()=>"padding-box"),base:{image:s.backgroundImage,position:s.backgroundPosition,size:s.backgroundSize,repeat:s.backgroundRepeat,origin:s.backgroundOrigin,clip:s.backgroundClip}}}function ps(t){for(let e of t.keys()){let n=e.__snapdomFieldSelection;if(!n)continue;delete e.__snapdomFieldSelection;let{images:r,positions:i,sizes:o,repeats:s,origins:a,clips:l,base:f}=n,c=e.style.backgroundImage||f.image;c&&c!=="none"?(r.push(c),i.push(e.style.backgroundPosition||f.position),o.push(e.style.backgroundSize||f.size),s.push(e.style.backgroundRepeat||f.repeat),a.push(e.style.backgroundOrigin||f.origin),l.push(e.style.backgroundClip||f.clip)):(r.push("linear-gradient(transparent,transparent)"),i.push("0% 0%"),o.push("auto"),s.push("repeat"),a.push(f.origin||"padding-box"),l.push(f.clip||"border-box")),e.style.backgroundImage=r.join(","),e.style.backgroundPosition=i.join(","),e.style.backgroundSize=o.join(","),e.style.backgroundRepeat=s.join(","),e.style.backgroundOrigin=a.join(","),e.style.backgroundClip=l.join(",")}}Mt();var eo=new Map,hs=new Set(["IFRAME"]);function Ne(t,e){eo.set(String(t).toUpperCase(),e)}function Nn(t){let e=O(t),n=e.display;if(n==="none")return null;let r=/^(block|inline-block|flow-root|flex|inline-flex|grid|inline-grid|list-item)$/.test(n),i=h=>parseFloat(h)||0,o=(h,m,p,g,y)=>{if(!r||!h?.endsWith("px"))return null;let b=parseFloat(h);if(!Number.isFinite(b)||b<0)return null;if(e.boxSizing==="border-box")return b;let w=g-y-p;return b+m+p+(w>0&&b+m<y+w/2?w:0)},[s,a,l,f]=/scroll|auto/.test(e.overflow)?[t.offsetWidth,t.clientWidth,t.offsetHeight,t.clientHeight]:[0,0,0,0],c=o(e.width,i(e.paddingLeft)+i(e.paddingRight),i(e.borderLeftWidth)+i(e.borderRightWidth),s,a),u=o(e.height,i(e.paddingTop)+i(e.paddingBottom),i(e.borderTopWidth)+i(e.borderBottomWidth),l,f);if(c===null||u===null){let{width:h,height:m}=xt(t),p=h,g=m;if(c===null&&!p||u===null&&!g){let y=t.getBoundingClientRect();p||=y.width||0,g||=y.height||0}c??=p,u??=g}let d=document.createElement("div");return d.style.cssText=`display:${n==="inline"?"inline-block":n};box-sizing:border-box;width:${c}px;height:${u}px;visibility:hidden;`,d}var Qc=new Set(["style","option","optgroup"]),Ln=200,Jc=new Set(["img","canvas","video","iframe","object","embed"]);function ms(t,e){return t.right>=e.left-Ln&&t.left<=e.right+Ln&&t.bottom>=e.top-Ln&&t.top<=e.bottom+Ln}function Zc(t,e){if(t===e.root)return!1;let n;try{n=t.getBoundingClientRect()}catch{return!1}if(n.width===0&&n.height===0)return!1;let r=O(t);if(r.display==="inline"&&!Jc.has((t.localName||"").toLowerCase()))return!1;let i=e.rect,o=t.scrollWidth||0,s=t.scrollHeight||0,a={left:r.direction==="rtl"?Math.min(n.left,n.right-o):n.left,top:n.top,right:Math.max(n.right,n.left+o),bottom:Math.max(n.bottom,n.top+s)},l=r.writingMode||"";if((l.startsWith("vertical")||l.startsWith("sideways"))&&(a.top=Math.min(n.top,n.bottom-s),a.left=Math.min(a.left,n.right-o)),ms(a,i))return!1;let f=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;f.nextNode();){let c=f.currentNode.getBoundingClientRect();if((c.width>0||c.height>0)&&ms(c,i))return!1}return!0}function tf(t,e,n){let r=t.cloneNode(!1);t.tagName==="IMG"&&(r.removeAttribute("src"),r.removeAttribute("srcset"),r.removeAttribute("sizes")),dt(t,r,e,n);let{width:i,height:o}=xt(t);i>0&&(r.style.width=`${i}px`,r.style.minWidth=`${i}px`,r.style.maxWidth=`${i}px`),o>0&&(r.style.height=`${o}px`,r.style.minHeight=`${o}px`,r.style.maxHeight=`${o}px`),r.style.visibility="hidden";let s=t.parentElement?O(t.parentElement).display:"",a=O(t).position;if(!/flex|grid|table/.test(s)&&(a==="static"||a==="relative")){let l=d=>{let h=O(d);return h.display!=="none"&&h.position!=="absolute"&&h.position!=="fixed"},f=t.getBoundingClientRect(),c=t.previousElementSibling;for(;c&&!l(c);)c=c.previousElementSibling;if(c){let d=f.top-c.getBoundingClientRect().bottom;d>=0&&(r.style.marginTop=`${d}px`)}let u=t.nextElementSibling;for(;u&&!l(u);)u=u.nextElementSibling;if(u){let d=u.getBoundingClientRect().top-f.bottom;d>=0&&(r.style.marginBottom=`${d}px`)}}return r.style.boxSizing="border-box",r}async function te(t,e,n){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.slicer?.due()&&await e.slicer.pause();let r=new Set,i=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let c=(t.localName||t.tagName||"").toLowerCase(),u=Xt(t);if(u&&(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox"))||t!==n.element&&u||Ir.has(c))return null;if(c==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return H(e,"Skipped a nested <foreignObject>; it can't be captured."),null;if(c==="source"&&t.parentElement?.localName==="picture")return null}if(t.nodeType===Node.TEXT_NODE){if(e.selection){let c=us(t,e.selection);if(c)return c}return t.cloneNode(!0)}if(t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide")return Nn(t);if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let c of n.exclude)try{if(t.matches?.(c)){if(n.excludeMode==="hide")return Nn(t);if(n.excludeMode==="remove")return null}}catch{console.warn(`[SnapDOM] Invalid exclude selector "${c}"; ignored.`)}if(n.excludePredicates)for(let c of n.excludePredicates)try{if(c(t))return n.excludeMode==="remove"?null:Nn(t)}catch(u){console.warn("[SnapDOM] Your exclude function threw; the element was kept.",u)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide")return Nn(t);if(n.filterMode==="remove")return null}}catch(c){console.warn("[SnapDOM] Your filter function threw; the element was kept.",c)}if(t!==n.element&&!Qc.has(t.localName)&&!Ot(t)&&O(t).display==="none"){let c=t.cloneNode(!1);t.tagName==="IMG"&&(c.removeAttribute("src"),c.removeAttribute("srcset")),c.style.setProperty("display","none","important");for(let u of t.querySelectorAll("style")){let d=await te(u,e,n);d&&c.appendChild(d)}return c}if(e.clip&&Zc(t,e.clip))return tf(t,e,n);if(n.__resolveNodeHooks)for(let c of n.__resolveNodeHooks){let u;try{u=await c(t,n)}catch(d){H(e,"A plugin's resolveNode hook threw; ignored it.",d)}if(u===null)return null;if(u?.nodeType)return u.nodeType===Node.ELEMENT_NODE&&(e.nodeMap.set(u,t),dt(t,u,e,n)),u}{let c=hs.has(t.tagName)&&eo.get(t.tagName);if(c){let u=await c(t,e,n);if(u!==void 0)return u}}if(t.getAttribute("data-capture")==="placeholder"){let c=t.cloneNode(!1);e.nodeMap.set(c,t),dt(t,c,e,n);let u=document.createElement("div");return u.textContent=t.getAttribute("data-placeholder-text")||"",u.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",c.appendChild(u),c}{let c=!hs.has(t.tagName)&&eo.get(t.tagName);if(c){let u=await c(t,e,n);if(u!==void 0)return u}}let s;try{if(s=t.cloneNode(!1),qi(t,s),e.nodeMap.set(s,t),t.tagName==="IMG"){es(t,s,n);try{let c=window.getComputedStyle(t),u=parseFloat(c.width),d=parseFloat(c.height);if(!(u>0)||!(d>0)){let p=xt(t),g=b=>parseFloat(c.getPropertyValue(b))||0,y=c.getPropertyValue("box-sizing")==="border-box";u>0||(u=p.width-(y?0:g("padding-left")+g("padding-right")+g("border-left-width")+g("border-right-width"))),d>0||(d=p.height-(y?0:g("padding-top")+g("padding-bottom")+g("border-top-width")+g("border-bottom-width")))}let h=Math.round((u||0)*1e3)/1e3,m=Math.round((d||0)*1e3)/1e3;h&&(s.dataset.snapdomWidth=String(h)),m&&(s.dataset.snapdomHeight=String(m))}catch(c){H(e,"Couldn't measure an image; kept its own size.",c)}try{let c=t.getAttribute("style")||"",u=window.getComputedStyle(t),d=w=>{let x=c.match(new RegExp(`${w}\\s*:\\s*([^;]+)`,"i")),C=x?x[1].trim():u.getPropertyValue(w);return/%|auto/i.test(String(C||""))},h=parseFloat(s.dataset.snapdomWidth||"0")||0,m=parseFloat(s.dataset.snapdomHeight||"0")||0,p=d("width")||!(h>0),g=d("height")||!(m>0);p&&h>0&&(s.style.width=`${h}px`),g&&m>0&&(s.style.height=`${m}px`);let y=u.getPropertyValue("object-fit"),b=u.getPropertyValue("object-position");y&&y!=="fill"?(s.style.objectFit=y,b&&(s.style.objectPosition=b)):(h>0&&(s.style.minWidth=`${h}px`),m>0&&(s.style.minHeight=`${m}px`))}catch(c){H(e,"Couldn't fix the size of an image.",c)}}}catch(c){throw console.error("[SnapDOM] Couldn't copy this element:",t,c),c}let a=null;if(it(t,"textarea")){let{width:c,height:u}=xt(t),d=c||t.getBoundingClientRect().width||0,h=u||t.getBoundingClientRect().height||0;d&&(s.style.width=`${d}px`),h&&(s.style.height=`${h}px`)}if(it(t,"input")){let c=(t.type||"text").toLowerCase();if((c==="checkbox"||c==="radio")&&(wt()||t.indeterminate)){let{el:d,applyVisual:h}=as(t);e.nodeMap.set(d,t),a=h,s=d}else if(c==="range"&&(wt()||X())){let{el:d,applyVisual:h}=ss(t);e.nodeMap.set(d,t),a=h,s=d}else if(c==="color"&&X()){let d=s,h=t.value||"#000000";a=()=>{d.style.setProperty("background-color",h,"important"),d.style.setProperty("color","transparent","important"),d.style.setProperty("-webkit-text-fill-color","transparent","important"),d.style.setProperty("appearance","none","important"),d.style.setProperty("-webkit-appearance","none","important")},d.removeAttribute("value")}else if((c==="date"||c==="time"||c==="datetime-local")&&(wt()||X())){s.setAttribute("type","text");let d=t.value;c==="date"&&t.valueAsDate&&(d=t.valueAsDate.toLocaleDateString(void 0,{timeZone:"UTC"})),s.value=d,s.setAttribute("value",d)}else{let d=Je(t)?Rr(t.value):t.value;s.value=d,s.setAttribute("value",d),t.checked!==void 0&&(s.checked=t.checked,t.checked?s.setAttribute("checked",""):s.removeAttribute("checked"),t.indeterminate&&(s.indeterminate=t.indeterminate))}}if((it(t,"input")||it(t,"textarea"))&&!t.value&&t.placeholder)try{let c=window.getComputedStyle(t,"::placeholder"),u=c&&c.color;u&&u!=="rgba(0, 0, 0, 0)"&&(e.__usesPlaceholder=!0,s.setAttribute("data-sd-ph",""),s.style.setProperty("--sd-ph",u),s.style.setProperty("--sd-ph-o",c.opacity||"1"))}catch{}if(it(t,"select")&&(i=new Set(Array.from(t.options).filter(c=>c.selected))),it(t,"textarea")&&(o=t.value),it(t,"input")||it(t,"textarea")||it(t,"select")){t.disabled&&s.setAttribute("disabled",""),t.required&&s.setAttribute("required",""),t.readOnly&&s.setAttribute("readonly","");let c=t;c.min!==void 0&&c.min!==""&&s.setAttribute("min",c.min),c.max!==void 0&&c.max!==""&&s.setAttribute("max",c.max),c.pattern!==void 0&&c.pattern!==""&&s.setAttribute("pattern",c.pattern);let u=t.getAttribute("aria-invalid");u!==null&&s.setAttribute("aria-invalid",u)}if(Fn(t)||dt(t,s,e,n),a&&a(),n.captureSelection&&(it(t,"input")||it(t,"textarea")))try{ds(t,s)}catch(c){H(e,"Couldn't copy the selection of a text field.",c)}if(Ot(t)&&!Fn(t)){let c=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display","color"];try{let u=window.getComputedStyle(t);for(let d of c){let h=u.getPropertyValue(d);h&&s.style.setProperty(d,h)}t.localName==="stop"&&(s.style.setProperty("stop-color",u.getPropertyValue("stop-color")),s.style.setProperty("stop-opacity",u.getPropertyValue("stop-opacity")))}catch{}}if(t.shadowRoot){Kr(t.shadowRoot);try{let b=t.shadowRoot.querySelectorAll("slot");for(let w of b){let x=w.assignedNodes?.()||[];for(let C of x)r.add(C)}}catch{}let c=Ji(e),u=`[data-sd="${c}"]`;e.shadowScopes||=new WeakMap,e.shadowScopes.set(t.shadowRoot,c);try{s.setAttribute("data-sd",c)}catch{}let d=Zi(t.shadowRoot);!e.__shadowPseudo&&/::?(?:before|after|first-l|marker)|counter/.test(d)&&(e.__shadowPseudo=!0);let h=Qi(d,u,c),m=ns(d),p=rs(t,m,u);ts(s,p+h,c);let g=document.createDocumentFragment(),y=await Promise.all(Array.from(t.shadowRoot.childNodes).map(b=>b.nodeType===Node.ELEMENT_NODE&&b.tagName==="STYLE"?null:te(b,e,n).catch(()=>null)));g.append(...y.filter(b=>!!b)),s.appendChild(g)}if(t.tagName==="SLOT"){let c=e.shadowScopes?.get(t.getRootNode()),u=t.assignedNodes?.()||[],d=u.length?t.assignedNodes?.({flatten:!0})||u:[],h=d.length?d:Array.from(t.childNodes),m=document.createDocumentFragment(),p=await Promise.all(h.map(g=>te(g,e,n).then(y=>(y&&u.length&&os(y,c),y||null)).catch(()=>null)));return m.append(...p.filter(g=>!!g)),m}let l=c=>r.has(c)||t.shadowRoot&&!c.assignedSlot,f=await Promise.all(Array.from(t.childNodes).map(c=>l(c)?null:te(c,e,n).catch(()=>null)));if(s.append(...f.filter(c=>!!c)),i&&it(s,"select")){let c=!1;for(let u of s.options){let d=i.has(e.nodeMap.get(u));u.selected=d,d?u.setAttribute("selected",""):u.removeAttribute("selected"),c||=d}if(!c&&!s.multiple){let u=s.ownerDocument.createElement("option");u.hidden=!0,u.style.setProperty("display","none","important"),u.setAttribute("selected",""),u.value="",s.appendChild(u)}}return o!==null&&it(s,"textarea")&&(s.textContent=o),s}async function ef(t,e,n){let r=!1;try{r=!!(t.contentDocument||t.contentWindow?.document)}catch(i){H(e,"Couldn't tell if an iframe is same-origin; treated it as cross-origin.",i)}if(r)try{return await Zr(t,e,n)}catch(i){console.warn("[SnapDOM] Couldn't capture an iframe, so it was left out.",i)}if(r||console.warn(n.placeholders?"[SnapDOM] Can't capture a cross-origin iframe; showing a placeholder. Set placeholders: false to hide it.":"[SnapDOM] Can't capture a cross-origin iframe; left it out.",t),n.placeholders){let{width:i,height:o}=xt(t),s=document.createElement("div");return s.style.cssText=`width:${i}px;height:${o}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,dt(t,s,e,n),s}else{let{width:i,height:o}=xt(t),s=document.createElement("div");return s.style.cssText=`display:inline-block;width:${i}px;height:${o}px;visibility:hidden;`,dt(t,s,e,n),s}}function un(t){try{let e=Math.max(1,Math.min(32,t.width)),n=Math.max(1,Math.min(32,t.height)),r=document.createElement("canvas");r.width=e,r.height=n;let i=r.getContext("2d",{willReadFrequently:!0});if(!i)return!1;i.drawImage(t,0,0,e,n);let o=i.getImageData(0,0,e,n).data;for(let s=3;s<o.length;s+=4)if(o[s]!==0)return!1;return!0}catch{return!1}}var nf=.95;function rf(t,e,n){try{let r=t.getImageData(0,0,e,n).data;for(let i=3;i<r.length;i+=4)if(r[i]!==255)return!1;return!0}catch{return!1}}async function of(t,e,n){let r="";try{let a=un(t);a&&(await bt(),a=un(t));let l=null;if(!a){l=t.getContext("2d",{willReadFrequently:!0});try{l&&l.getImageData(0,0,1,1)}catch{}X()&&await bt()}if(r=t.toDataURL("image/png"),!r||r==="data:,"){try{l&&l.getImageData(0,0,1,1)}catch{}if(await bt(),r=t.toDataURL("image/png"),!r||r==="data:,"){let f=document.createElement("canvas");f.width=t.width,f.height=t.height;let c=f.getContext("2d");c&&(c.drawImage(t,0,0),r=f.toDataURL("image/png"))}}}catch(a){H(e,"Couldn't read the pixels of a canvas; used its fallback content.",a)}n&&n.debug&&r&&un(t)&&H(e,"Empty canvas; capture after its first frame",t);let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch(a){H(e,"Couldn't set image loading hints.",a)}r&&(i.src=r),i.width=t.width,i.height=t.height;let{width:o,height:s}=xt(t);return o>0&&(i.style.width=`${o}px`),s>0&&(i.style.height=`${s}px`),e.nodeMap.set(i,t),dt(t,i,e,n),i}async function sf(t,e,n){let r="",i=t.poster&&t.paused&&!t.currentTime&&!t.played.length,o=document.createElement("img");try{o.decoding="sync",o.loading="eager"}catch{}if(!i)try{let l=document.createElement("canvas");l.width=t.videoWidth||t.offsetWidth||320,l.height=t.videoHeight||t.offsetHeight||240;let f=l.getContext("2d");f&&(f.drawImage(t,0,0,l.width,l.height),r=l.toDataURL(rf(f,l.width,l.height)?"image/jpeg":"image/png",nf),(!r||r==="data:,")&&(r=""))}catch(l){H(e,"Couldn't capture a video frame; used its poster.",l)}r?o.src=r:t.poster&&(o.src=t.poster),o.width=t.videoWidth||t.offsetWidth||0,o.height=t.videoHeight||t.offsetHeight||0;let{width:s,height:a}=xt(t);return s>0&&(o.style.width=`${s}px`),a>0&&(o.style.height=`${a}px`),o.style.objectFit="contain",e.nodeMap.set(o,t),dt(t,o,e,n),o}async function af(t,e,n){if(!t.controls)return;let{width:r,height:i}=xt(t),o=Math.round(r||t.offsetWidth||300),s=Math.round(i||t.offsetHeight||54),a=s/2,l=Math.max(4,s*.16),f=s*.34,c=o-s*.34,u=f+l+s*.55,d=Math.max(0,c-s*.7-u),h=Math.max(9,Math.round(s*.24)),m=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${s}" viewBox="0 0 ${o} ${s}"><rect width="${o}" height="${s}" rx="${Math.min(s/2,10)}" fill="#f1f3f4"/><path d="M ${f} ${a-l} L ${f+l} ${a} L ${f} ${a+l} Z" fill="#5f6368"/><rect x="${u}" y="${a-1.5}" width="${d}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${u}" cy="${a}" r="${Math.max(3,s*.09)}" fill="#5f6368"/><text x="${c}" y="${a}" fill="#5f6368" font-family="sans-serif" font-size="${h}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,p=document.createElement("img");try{p.decoding="sync",p.loading="eager"}catch{}return p.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,p.width=o,p.height=s,p.style.width=`${o}px`,p.style.height=`${s}px`,e.nodeMap.set(p,t),dt(t,p,e,n),p}async function gs(t,e,n){let r=t.getAttribute("data")||t.getAttribute("src")||"",i=(t.getAttribute("type")||"").toLowerCase(),o=/^image\//.test(i)||/\.(png|jpe?g|gif|webp|avif|bmp|ico|svg)(\?|#|$)/i.test(r);if(r&&o){let a=document.createElement("img");try{a.decoding="sync",a.loading="eager"}catch{}a.src=r;let{width:l,height:f}=xt(t);return l>0&&(a.style.width=`${l}px`),f>0&&(a.style.height=`${f}px`),e.nodeMap.set(a,t),dt(t,a,e,n),a}let s=null;try{s=t.contentDocument}catch{}if(s)try{let a=await Zr(t,e,n);if(a)return a}catch{}r&&console.warn(`[SnapDOM] Couldn't capture <${t.localName}>${i?` (${i})`:""}; showing its fallback content.`)}Ne("IFRAME",ef);Ne("CANVAS",of);Ne("VIDEO",sf);Ne("AUDIO",af);Ne("OBJECT",gs);Ne("EMBED",gs);St();kt();Me();yt();Mt();var lf=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],Le=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{});function cf(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ys(t){let e=Array.isArray(t)?t:t?[t]:[],n=[];for(let r of e)r instanceof RegExp?n.push(r):typeof r=="string"?n.push(new RegExp(cf(r),"i")):console.warn("[SnapDOM] Ignored an iconFonts entry: use a string or a RegExp.",r);return n}function Lt(t,e){let n=typeof t=="string"?t:"";for(let r of lf)if(r.test(n))return!0;if(e){for(let r of e)if(r instanceof RegExp&&r.test(n))return!0}return!!(/icon/i.test(n)||/glyph/i.test(n)||/symbols/i.test(n)||/feather/i.test(n)||/fontawesome/i.test(n))}function no(t,e){if(typeof t!="string"||!t)return!1;let n;try{n=new URL(t,typeof location<"u"?location.href:void 0)}catch{return Lt(t,e)}let r=n.searchParams.getAll("family").flatMap(i=>i.split("|")).map(i=>i.split(":")[0].trim()).filter(Boolean);return r.length?r.every(i=>Lt(i,e)):Lt(t,e)}function ff(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var In=new Map;function uf(t=""){let e=Object.create(null),n=String(t||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)e[i[1].toUpperCase()]=Number(i[2]);return e}async function df(t,e,n){let r=String(t||""),i=r.toLowerCase(),o=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),l="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?l="rounded":/\bsharp\b/.test(o)?l="sharp":/\boutlined\b/.test(o)&&(l="outlined");let f=a===1,c=null;if(f&&(l==="outlined"&&Le.materialIconsFilled?c={url:Le.materialIconsFilled,alias:"snapdom-mi-filled"}:l==="rounded"&&Le.materialIconsRound?c={url:Le.materialIconsRound,alias:"snapdom-mi-round"}:l==="sharp"&&Le.materialIconsSharp&&(c={url:Le.materialIconsSharp,alias:"snapdom-mi-sharp"})),!c)return{familyForMeasure:r,familyForCanvas:r};if(!In.has(c.alias))try{let d=new FontFace(c.alias,`url(${c.url})`,{style:"normal",weight:"400"});await d.load(),document.fonts.add(d),In.set(c.alias,!0)}catch{return In.set(c.alias,!1),{familyForMeasure:r,familyForCanvas:r}}if(In.get(c.alias)===!1)return{familyForMeasure:r,familyForCanvas:r};let u=`"${c.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function pf(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function hf(t){let e=t.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(e)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!n&&e.toLowerCase()!=="currentcolor")return e;let r=t.color?.trim();return r&&r!=="inherit"?r:"#000"}async function mf(t,{family:e="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:s=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),l=window.devicePixelRatio||1,f=uf(o),{familyForMeasure:c,familyForCanvas:u}=await df(a,s,f);await pf(u.replace(/^["']+|["']+$/g,""),r);let d=document.createElement("span");Z(d),d.textContent=t,d.style.position="absolute",d.style.visibility="hidden",d.style.left="-99999px",d.style.whiteSpace="nowrap",d.style.fontFamily=c,d.style.fontWeight=String(n||"normal"),d.style.fontSize=`${r}px`,d.style.lineHeight="1",d.style.margin="0",d.style.padding="0",d.style.fontFeatureSettings="'liga' 1",d.style.fontVariantLigatures="normal",d.style.color=i,document.body.appendChild(d);let h=d.getBoundingClientRect(),m=Math.max(1,Math.ceil(h.width)),p=Math.max(1,Math.ceil(h.height));document.body.removeChild(d);let g=document.createElement("canvas");g.width=m*l,g.height=p*l;let y=g.getContext("2d");y.scale(l,l),y.font=`${n?`${n} `:""}${r}px ${u}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(t,0,0),{dataUrl:g.toDataURL(),width:m,height:p}}async function On(t,e,n=new Map){if(t?.nodeType!==1)return 0;let r='.material-icons, [class*="material-symbols"]',i=Array.from(t.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim());if(t.matches?.(r)&&t.textContent&&t.textContent.trim()&&i.unshift(t),i.length===0)return 0;let o=e?.nodeType===1?Array.from(e.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim()):[];e?.nodeType===1&&e.matches?.(r)&&e.textContent&&e.textContent.trim()&&o.unshift(e);let s=0;for(let a=0;a<i.length;a++){let l=i[a],f=n&&n.get(l)||o[a]||null;try{let c=getComputedStyle(f||l),u=c.fontFamily||"Material Icons";if(!ff(u))continue;let d=(f||l).textContent.trim();if(!d)continue;let h=parseInt(c.fontSize,10)||24,m=c.fontWeight&&c.fontWeight!=="normal"?c.fontWeight:"normal",p=hf(c),g=c.fontVariationSettings&&c.fontVariationSettings!=="normal"?c.fontVariationSettings:"",y=(f||l).className||"",{dataUrl:b,width:w,height:x}=await mf(d,{family:u,weight:m,fontSize:h,color:p,variation:g,className:y});l.textContent="";let C=l.ownerDocument.createElement("img");C.src=b,C.alt=d,C.style.height=`${h}px`,C.style.width=`${Math.max(1,Math.round(w/x*h))}px`,C.style.objectFit="contain",C.style.verticalAlign=getComputedStyle(l).verticalAlign||"baseline",l.appendChild(C),s++}catch{}}return s}Se();mt();Mt();async function xs(t,e,n,r=32,i="#000",o="normal"){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");Z(a),a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontStyle=o||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let l=a.getBoundingClientRect(),f=Math.ceil(l.width),c=Math.ceil(l.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,f*s),u.height=Math.max(1,c*s);let d=u.getContext("2d");return d.scale(s,s),d.font=`${o||"normal"} ${n||"normal"} ${r}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=i,d.fillText(t,0,0),{dataUrl:u.toDataURL(),width:f,height:c}}var vs=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),gf=["katex","mathjax","mathml"];function io(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!vs.has(n.toLowerCase()))return n}return""}function yf(t){if(!t)return[];let e=[];for(let n of t.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(vs.has(r.toLowerCase())||e.push(r))}return e}function Dn(t){let e=String(t??"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function Wn(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function bf(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function wf(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let i=Dn(n[1]),o=Dn(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=Dn(e);return{min:r,max:r}}function Sf(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function xf(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),s=parseFloat(n[2]);return{min:Math.min(o,s),max:Math.max(o,s)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function vf(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function Cf(t,e,n=[]){if(!t)return!1;try{let r=new URL(t,location.href);if(r.origin===location.origin)return!0;let o=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(l=>o.endsWith(l))||n.some(l=>o===l.toLowerCase()||o.endsWith("."+l.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||gf.some(l=>a.includes(l)))return!0;for(let l of e){let f=l.toLowerCase().replace(/\s+/g,"+"),c=l.toLowerCase().replace(/\s+/g,"-"),u=vf(l);if(a.includes(f)||a.includes(c)||u&&a.includes(u))return!0}return!1}catch{return!1}}function kf(t){let e=new Set;for(let n of t||[]){let r=String(n).split("__")[0]?.trim();r&&e.add(r)}return e}function bs(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,i)=>{let o=(i||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let s=o;try{s=new URL(o,e||location.href).href}catch{}return`url("${s}")`})}var Cs=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Bn=4;async function Mf(t,e,n){if(!t)return t;let r=new Set;function i(a,l){try{return new URL(a,l||location.href).href}catch{return a}}async function o(a,l,f=0){if(f>Bn)return console.warn(`[SnapDOM] Too many nested @import rules in ${l}; stopped at ${Bn} levels.`),a;let c="",u=0,d,h=new RegExp(Cs.source,"g");for(;d=h.exec(a);){c+=a.slice(u,d.index),u=h.lastIndex;let m=(d[2]||d[4]||"").trim(),p=i(m,l);if(r.has(p)){console.warn(`[SnapDOM] Skipped an @import that loops back: ${p}`);continue}r.add(p);let g="";try{let y=await ft(p,{as:"text",useProxy:n,silent:!0});y.ok&&typeof y.data=="string"&&(g=y.data)}catch{}g?(g=bs(g,p),g=await o(g,p,f+1),c+=`
|
|
13
13
|
/* inlined: ${p} */
|
|
14
14
|
${g}
|
|
15
|
-
`):l+=d[0]}return l+=a.slice(f),l}let s=gs(t,e||location.href);return s=await o(s,e||location.href,0),s}var vs=/url\((["']?)([^"')]+)\1\)/g,Mf=/@font-face[^{}]*\{[^}]*\}/g;function _t(t,e,n=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function Cs(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let i=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let o=i[1],s=i[2],a=c=>{if(!c.includes("?"))return parseInt(c,16);let u=parseInt(c.replace(/\?/g,"0"),16),l=parseInt(c.replace(/\?/g,"F"),16);return[u,l]};if(s){let c=a(o),u=a(s),l=Array.isArray(c)?c[0]:c,f=Array.isArray(u)?u[1]:u;e.push([Math.min(l,f),Math.max(l,f)])}else{let c=a(o);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function ks(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,i]of e)if(n>=r&&n<=i)return!0;return!1}function io(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(vs)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,e||location.href).href}catch{}n.push(i)}}return n}async function no(t,e,n=""){let r=t;for(let i of t.matchAll(vs)){let o=re(i[0]);if(!o)continue;let s=o;if(!s.startsWith("http")&&!s.startsWith("data:"))try{s=new URL(s,e||location.href).href}catch{}if(I.resource?.has(s)){r=r.replace(i[0],`url(${I.resource.get(s)})`);continue}try{let a=await ft(s,{as:"dataURL",useProxy:n,silent:!0});if(a.ok&&typeof a.data=="string"){let c=a.data;I.resource?.set(s,c),r=r.replace(i[0],`url(${c})`)}}catch{console.warn("[SnapDOM] Couldn't load font file:",s)}}return r}function Af(t){if(!t.length)return null;let e=(a,c)=>t.some(([u,l])=>!(l<a||u>c)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),i=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function ys(t={}){let e=new Set((t.families||[]).map(i=>String(i).toLowerCase())),n=new Set((t.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((t.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(e.size&&e.has(i.family.toLowerCase()))return!0;if(n.size)for(let s of i.srcUrls)try{if(n.has(new URL(s).host.toLowerCase()))return!0}catch{}if(r.size){let s=Af(o);if(s&&r.has(s))return!0}return!1}}function _f(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of t.match(e)||[]){let s=_t(o,"font-family"),a=oo(s),c=_t(o,"font-weight","400"),u=_t(o,"font-style","normal"),l=_t(o,"font-stretch","100%"),f=_t(o,"unicode-range"),d=_t(o,"src"),h=io(d,location.href),m=h.length?h.map(g=>String(g).toLowerCase()).sort().join("|"):d.toLowerCase(),p=[String(a||"").toLowerCase(),c,u,l,f.toLowerCase(),m].join("|");n.has(p)||(n.add(p),r.push(o))}if(r.length===0)return t;let i=0;return t.replace(e,()=>r[i++]||"")}var bs=new WeakMap,Ef=0;function Rf(t){let e=bs.get(t);return e===void 0&&(e=Ef++,bs.set(t,e)),e}function Ff(t,e,n,r,i,o,s,a,c){let u=Array.from(t||[]).sort().join("|"),l=0,f=0;for(let b of s||[]){let w=Math.imul(b,2654435761);w^=w>>>15,w=Math.imul(w,2246822507),w^=w>>>13,l=l+w|0,f++}let d=e?JSON.stringify({families:(e.families||[]).map(b=>String(b).toLowerCase()).sort(),domains:(e.domains||[]).map(b=>String(b).toLowerCase()).sort(),subsets:(e.subsets||[]).map(b=>String(b).toLowerCase()).sort()}):"",h=(n||[]).map(b=>`${(b.family||"").toLowerCase()}::${b.weight||"normal"}::${b.style||"normal"}::${b.stretchPct??100}::${b.src||""}`).sort().join("|"),m=r||"",p=(i||[]).map(b=>String(b).toLowerCase()).sort().join("|"),g=Rf(o||document),y=(a||[]).map(b=>String(b)).sort().join("|");return`fonts-embed-css::req=${u}::ex=${d}::lf=${h}::px=${m}::fd=${p}::doc=${g}::cp=${l}::n=${f}::ic=${y}::env=${c}`}async function ro(t,e,n,r){let i=r.doc?.defaultView||window;if(t.disabled||t.media?.mediaText&&!i.matchMedia(t.media.mediaText).matches)return;let o;try{o=t.cssRules||[]}catch{return}let s=(a,c)=>{try{return new URL(a,c||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let c=a.href?s(a.href,e):e;if(r.depth>=Dn){console.warn(`[SnapDOM] Too many nested @import rules in ${c}; stopped at ${Dn} levels.`);continue}if(c&&r.visitedSheets.has(c)){console.warn(`[SnapDOM] Skipped an @import that loops back: ${c}`);continue}c&&r.visitedSheets.add(c);let u={...r,depth:(r.depth||0)+1};await ro(a.styleSheet,c,n,u);continue}if(a.cssRules?.length){if(a.type===CSSRule.MEDIA_RULE&&!i.matchMedia(a.conditionText).matches||a.type===CSSRule.SUPPORTS_RULE&&!i.CSS.supports(a.conditionText))continue;await ro(a,e,n,r);continue}if(a.type===CSSRule.FONT_FACE_RULE){let c=(a.style.getPropertyValue("font-family")||"").trim(),u=oo(c);if(!u||Nt(u,r.iconMatchers))continue;let l=(a.style.getPropertyValue("font-weight")||"").trim(),f=(a.style.getPropertyValue("font-style")||"").trim(),d=(a.style.getPropertyValue("font-stretch")||"").trim(),h=(a.style.getPropertyValue("font-variation-settings")||"").trim(),m=(a.style.getPropertyValue("src")||"").trim(),p=(a.style.getPropertyValue("unicode-range")||"").trim(),g=l||"400",y=f||"normal",b=d||"100%",w=(f?`font-style:${f};`:"")+(l?`font-weight:${l};`:"")+(d?`font-stretch:${d};`:"")+(h?`font-variation-settings:${h};`:"")+(p?`unicode-range:${p};`:""),v=r.faceMatchesRequired(u,y,g,b);if(!v&&!r.requiredIndex.has(u.toLowerCase()))continue;let C=Cs(p);if(!ks(r.usedCodepoints,C))continue;let S={family:u,weightSpec:g,styleSpec:y,stretchSpec:b,unicodeRange:p,srcRaw:m,srcUrls:io(m,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(S,C))continue;if(!v){r.provisionalFaces.push({family:u.toLowerCase(),block:`@font-face{font-family:${u};src:${m};${w}}`,srcRaw:m,baseHref:e||location.href});continue}r.coveredFamilies.add(u.toLowerCase());let M=`"${String(u).replace(/^\s*["']|["']\s*$/g,"").replace(/(["\\])/g,"\\$1")}"`;if(/url\(/i.test(m)){let _=await no(m,e||location.href,r.useProxy);await n(`@font-face{font-family:${M};src:${_};${w}}`)}else await n(`@font-face{font-family:${M};src:${m};${w}}`)}}}async function Ms({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[],iconMatchers:s=[],doc:a=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let c=new Map;for(let S of t){let[M,_,E,x]=String(S).split("__");if(!M)continue;let k=M.toLowerCase(),R=c.get(k)||[];R.push({w:parseInt(_,10),s:E,st:parseInt(x,10)}),c.set(k,R)}function u(S,M,_,E){let x=String(S).toLowerCase();if(!c.has(x))return!1;let k=c.get(x),R=bf(_),T=wf(M),L=Sf(E),W=R.min!==R.max,P=R.min,A=$=>T.kind==="normal"&&$==="normal"||T.kind!=="normal"&&($==="italic"||$==="oblique"),N=!1;for(let $ of k){let F=W?$.w>=R.min&&$.w<=R.max:$.w===P,z=A(On($.s)),q=$.st>=L.min&&$.st<=L.max;if(F&&z&&q){N=!0;break}}if(N)return!0;if(!W)for(let $ of k){let F=A(On($.s)),z=$.st>=L.min&&$.st<=L.max;if(Math.abs(P-$.w)<=300&&F&&z)return!0}if(!W&&T.kind==="normal"&&k.some(F=>On(F.s)!=="normal"))for(let F of k){let z=Math.abs(P-F.w)<=300,q=F.st>=L.min&&F.st<=L.max;if(z&&q)return!0}return!1}let l=ys(n);_e(a),Tt();let f=Ff(t,n,r,i,o,a,e,s,_e(a));if(I.resource?.has(f))return I.resource.get(f);let d=Cf(t),h=[],m=xs;for(let S of a.querySelectorAll("style")){let M=S.textContent||"";for(let _ of M.matchAll(m)){let E=(_[2]||_[4]||"").trim();if(!E||eo(E,s))continue;a.querySelector(`link[rel="stylesheet"][href="${E}"]`)||h.push(E)}}let p=[];h.length&&await Promise.all(h.map(S=>new Promise(M=>{if(a.querySelector(`link[rel="stylesheet"][href="${S}"]`))return M(null);let _=a.createElement("link");_.rel="stylesheet",_.href=S,Z(_),_.setAttribute("data-snapdom","injected-import");let E=setTimeout(()=>M(null),3e3),x=k=>{clearTimeout(E),M(k)};_.onload=()=>x(_),_.onerror=()=>x(null),a.head.appendChild(_),p.push(_)})));let g="",y=new Set,b=[],w=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(S=>!!S.href);for(let S of p)try{S.remove()}catch{}for(let S of w)try{if(eo(S.href,s))continue;let M="",_=!1;try{_=new URL(S.href,location.href).origin===location.origin}catch{}if(!_){let x=Array.isArray(o)?o:[];if(!vf(S.href,d,x))continue}if(_){let x=Array.from(a.styleSheets).find(k=>k.href===S.href);if(x)try{let k=x.cssRules||[];M=Array.from(k).map(R=>R.cssText).join("")}catch{}}if(!M){let x=await ft(S.href,{as:"text",useProxy:i});x?.ok&&typeof x.data=="string"&&(M=x.data)}M=await kf(M,S.href,i);let E="";for(let x of M.match(Mf)||[]){let k=_t(x,"font-family"),R=oo(k);if(!R||Nt(R,s))continue;let T=_t(x,"font-weight","400"),L=_t(x,"font-style","normal"),W=_t(x,"font-stretch","100%"),P=_t(x,"unicode-range"),A=_t(x,"src"),N=io(A,S.href),$=u(R,L,T,W);if(!$&&!c.has(R.toLowerCase()))continue;let F=Cs(P);if(!ks(e,F))continue;let z={family:R,weightSpec:T,styleSpec:L,stretchSpec:W,unicodeRange:P,srcRaw:A,srcUrls:N,href:S.href};if(n&&l(z,F))continue;if(!$){b.push({family:R.toLowerCase(),block:x,srcRaw:A,baseHref:S.href});continue}y.add(R.toLowerCase());let q=/url\(/i.test(A)?await no(x,S.href,i):x;E+=q}E.trim()&&(g+=E)}catch{console.warn("[SnapDOM] Couldn't read stylesheet:",S.href)}let v={doc:a,requiredIndex:c,usedCodepoints:e,faceMatchesRequired:u,coveredFamilies:y,provisionalFaces:b,simpleExcluder:n?ys(n):null,useProxy:i,iconMatchers:s,visitedSheets:new Set,depth:0},C=new Set([...a.styleSheets,...a.adoptedStyleSheets||[]]);for(let S of C)if(!(S.href&&w.some(M=>M.href===S.href)))try{let M=S.href||a.baseURI||location.origin+"/";M&&v.visitedSheets.add(M),await ro(S,M,async _=>{g+=_},v)}catch{}for(let S of b)y.has(S.family)||(g+=/url\(/i.test(S.srcRaw)?await no(S.block,S.baseHref,i):S.block);try{for(let S of a.fonts||[]){if(!S||!S.family||S.status!=="loaded"||!S._snapdomSrc)continue;let M=String(S.family).replace(/^['"]+|['"]+$/g,"");if(Nt(M,s)||!c.has(M.toLowerCase())||n?.families&&n.families.some(E=>String(E).toLowerCase()===M.toLowerCase()))continue;let _=S._snapdomSrc;if(!String(_).startsWith("data:"))if(I.resource?.has(S._snapdomSrc))_=I.resource.get(S._snapdomSrc);else try{let E=await ft(S._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(E.ok&&typeof E.data=="string")_=E.data,I.resource?.set(S._snapdomSrc,_);else continue}catch{console.warn("[SnapDOM] Couldn't load font file:",S._snapdomSrc);continue}g+=`@font-face{font-family:'${M}';src:url(${_});font-style:${S.style||"normal"};font-weight:${S.weight||"normal"};}`}}catch{}for(let S of r){if(!S||typeof S!="object")continue;let M=String(S.family||"").replace(/^['"]+|['"]+$/g,"");if(!M||Nt(M,s)||!c.has(M.toLowerCase())||n?.families&&n.families.some(T=>String(T).toLowerCase()===M.toLowerCase()))continue;let _=S.weight!=null?String(S.weight):"normal",E=S.style!=null?String(S.style):"normal",x=S.stretchPct!=null?`${S.stretchPct}%`:"100%",k=String(S.src||""),R=k;if(!R.startsWith("data:"))if(I.resource?.has(k))R=I.resource.get(k);else try{let T=await ft(k,{as:"dataURL",useProxy:i,silent:!0});if(T.ok&&typeof T.data=="string")R=T.data,I.resource?.set(k,R);else continue}catch{console.warn("[SnapDOM] Couldn't load font file from localFonts:",k);continue}g+=`@font-face{font-family:'${M}';src:url(${R});font-style:${E};font-weight:${_};font-stretch:${x};}`}return g&&(g=_f(g),I.resource?.set(f,g)),g}function Wn(t,e){let n=new Set,r=new Set;if(!t)return{required:n,usedCodepoints:r};let i=l=>{if(l)for(let f of l)r.add(f.codePointAt(0))},o=l=>{let f=gf(l.fontFamily);if(f.length)for(let d of f)n.add(`${d}__${In(l.fontWeight)}__${On(l.fontStyle)}__${yf(l.fontStretch)}`)},s=Fe(t),a=t.getRootNode(),c=l=>{o(O(l));let f=l.getRootNode()===a?s:Fe(l);for(let d of["::before","::after"]){let h=d==="::before"?f.before:f.after;if(h!==null){if(h==="")continue;try{if(!l.matches(h))continue}catch{}}let m=O(l,d),p=m&&m.content;if(!(!p||p==="none"||p==="normal"))if(o(m),/^["']/.test(p))i(p.slice(1,-1));else{let g=p.match(/\\[0-9A-Fa-f]{1,6}/g);if(g)for(let y of g)try{r.add(parseInt(y.slice(1),16))}catch{}}}},u=[t];for(let l=0;l<u.length;l++){let f=u[l];f.nodeType===Node.ELEMENT_NODE&&c(f),f.shadowRoot&&u.push(f.shadowRoot);let d=(t.ownerDocument||document).createTreeWalker(f,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;d.nextNode();){let h=d.currentNode;if(h.nodeType===Node.TEXT_NODE){if(e&&h.parentElement&&!e(h.parentElement))continue;i(h.nodeValue||"")}else{if(e&&!e(h))continue;c(h),h.shadowRoot&&u.push(h.shadowRoot)}}}return{required:n,usedCodepoints:r}}async function Bn(t,e=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(t||[]).filter(Boolean);if(r.length===0)return;let i=()=>{let o=n.createElement("div");Z(o),o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let s of r){let a=n.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${s}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}n.body.appendChild(o),o.offsetWidth,n.body.removeChild(o)};for(let o=0;o<Math.max(1,e);o++)i(),await bt(),await bt()}kt();function Rs(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function As(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function _s(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,t)),i="";for(let[o,s]of n)for(;r>=o;)i+=s,r-=o;return e?i:i.toLowerCase()}function Es(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":case"lower-latin":return As(t,!1);case"upper-alpha":case"upper-latin":return As(t,!0);case"lower-roman":return _s(t,!1);case"upper-roman":return _s(t,!0);default:return String(t)}}function un(t,e){let n=(t||"").trim().split(/[\s,]+/).filter(Boolean),r=[];for(let i=0;i<n.length;i++){let o=n[i];if(o==="none")continue;let s=n[i+1],a=s!==void 0&&Number.isFinite(Number(s));r.push([o,a?Number(s):e]),a&&i++}return r}function Fs(t){let e=new WeakMap,n=Er(t)?t.documentElement:t,r=u=>u&&u.tagName==="LI",i=new WeakMap,o=u=>{let l=new Map;for(let[f,d]of u)l.set(f,d.slice());return l},s=(u,l,f)=>{let d=o(u),h;try{h=getComputedStyle(f)}catch{h=f.style}let m;try{m=h?.counterReset}catch{}if(m&&m!=="none")for(let[y,b]of un(m,0)){let w=l.get(y);if(w&&w.length){let v=w.slice();v.push(b),d.set(y,v)}else d.set(y,[b])}let p;try{p=h?.counterSet}catch{}if(p&&p!=="none")for(let[y,b]of un(p,0)){let w=d.get(y)||[];w.length===0&&w.push(0),w[w.length-1]=b,d.set(y,w)}let g;try{g=h?.counterIncrement}catch{}if(g&&g!=="none")for(let[y,b]of un(g,1)){let w=d.get(y)||[];w.length===0&&w.push(0),w[w.length-1]+=b,d.set(y,w)}try{if(h?.display==="list-item"&&r(f)){let y=f.parentElement,b=y&&i.get(y),w=y?.tagName==="OL"?parseInt(y.getAttribute("start"),10):NaN,v=b===void 0?Number.isFinite(w)?w:1:b+1,C=y?.tagName==="OL"?parseInt(f.getAttribute("value"),10):NaN;Number.isFinite(C)&&(v=C),y&&i.set(y,v);let S=d.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=v,d.set("list-item",S)}}catch{}return d},a=(u,l,f)=>{let d=s(f,l,u);e.set(u,d);let h=d;for(let p of u.children)h=a(p,d,h);let m=new Map;for(let[p,g]of f){let y=g.length,b=h.get(p);m.set(p,b&&b.length?b.slice(0,y):g.slice())}for(let[p,g]of h)!m.has(p)&&g.length&&!l.has(p)&&m.set(p,g.slice(0,1));return m},c=new Map;return a(n,c,c),{get(u,l){let f=e.get(u)?.get(l);return f&&f.length?f[f.length-1]:0},getStack(u,l){let f=e.get(u)?.get(l);return f?f.slice():[]}}}function Ts(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(r,(i,o,s)=>{let a=String(s).split(",").map(c=>c.trim());if(o==="counter"){let c=a[0]?.replace(/^["']|["']$/g,""),u=(a[1]||"decimal").toLowerCase(),l=n.get(e,c);return Es(l,u)}else{let c=a[0]?.replace(/^["']|["']$/g,""),u=a[1]?.replace(/^["']|["']$/g,"")??"",l=(a[2]||"decimal").toLowerCase(),f=n.getStack(e,c);return f.length?f.map(h=>Es(h,l)).join(u):""}})}catch{return"- "}}we();var Le=new WeakMap,Ps=1e3;function Tf(t,e){let n=Is(t);return e?(e.__pseudoPreflightFp!==n&&(Tt(),e.__pseudoPreflight=$s(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):(Tt(),$s(t,n))}function Un(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function Is(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let s=0;s<e.length;s++){let a=e[s];if(a.tagName==="STYLE"){let c=a.textContent?a.textContent.length:0;n+=`S${c}|`;let u=a.sheet,l=u?Un(u):null;l&&(r+=l.length)}else{let c=a.getAttribute("href")||"",u=a.getAttribute("media")||"all";n+=`L${c}|m:${u}|`;let l=a.sheet,f=l?Un(l):null;f&&(r+=f.length)}}let i=t.adoptedStyleSheets,o=0;if(Array.isArray(i))for(let s of i){let a=Un(s);a&&(o+=a.length)}return n+=`ass:${Array.isArray(i)?i.length:0}/${o}|tr:${r}`,n}function so(t,e,n){let r=Un(t);if(!r)return!1;for(let i=0;i<r.length;i++){if(n.budget<=0)return!1;let o=r[i],s=o&&o.cssText?o.cssText:"";n.budget--;for(let a of e)if(s.includes(a))return!0;if(o&&o.styleSheet&&so(o.styleSheet,e,n))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let a=0;a<o.cssRules.length&&n.budget>0;a++){let c=o.cssRules[a],u=c&&c.cssText?c.cssText:"";n.budget--;for(let l of e)if(u.includes(l))return!0}if(n.budget<=0)return!1}return!1}function $s(t=document,e=Is(t)){let n=Le.get(t);if(n&&n.fingerprint===e)return n.result;let r=a=>(a.match(/\|ass:[^|]*/)||[""])[0];n&&r(e)!==r(n.fingerprint)&&Ee();let i=["::before","::after","::first-letter","::marker","::first-line",":before",":after",":first-letter",":first-line","counter(","counters(","counter-increment","counter-reset"],o=t.querySelectorAll("style");for(let a=0;a<o.length;a++){let c=o[a].textContent||"";for(let u of i)if(c.includes(u))return Le.set(t,{fingerprint:e,result:!0}),!0}let s=t.adoptedStyleSheets;if(Array.isArray(s)&&s.length){let a={budget:Ps};try{for(let c of s)if(so(c,i,a))return Le.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let a=t.querySelectorAll('style,link[rel~="stylesheet"]'),c={budget:Ps};for(let u=0;u<a.length&&c.budget>0;u++){let l=a[u],f=null;if(l.tagName,f=l.sheet||null,f&&so(f,i,c))return Le.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Le.set(t,{fingerprint:e,result:!0}),!0):(Le.set(t,{fingerprint:e,result:!1}),!1)}function Ns(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,r=t[`border${e}Style`];if(n>0&&r&&r!=="none"&&r!=="hidden")return!0}return!1}function Pf(t,e){let n=null,r=()=>{if(!n)try{n=Fs(t)}catch(i){H(e,"Couldn't compute CSS counters; list numbers may be off.",i),n={get:()=>0,getStack:()=>[]}}return n};return{get(i,o){return r().get(i,o)},getStack(i,o){return r().getStack(i,o)}}}function $f(t){let e=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r==='"')e=!e;else if(r==="/"&&!e)return t.slice(0,n).trim()}return t}function Nf(t){return t.replace(/\\(?:([0-9a-fA-F]{1,6})[ \t\n]?|([\s\S]))/g,(e,n,r)=>{if(n){let i=parseInt(n,16);return i===0||i>1114111?"\uFFFD":String.fromCodePoint(i)}return r===`
|
|
16
|
-
`?"":r})}function Lf(t){if(!t)return"";let e=[],n=/"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)'/g,r=0,i;for(;i=n.exec(t);){let s=t.slice(r,i.index).trim();s&&e.push(s),e.push(Nf(i[1]!==void 0?i[1]:i[2])),r=n.lastIndex}let o=t.slice(r).trim();return o&&e.push(o),e.join("")}function ao(t,e,n){let r=t.parentElement,i=r&&n?n.get(r):null;return i?{get(o,s){let a=e.get(o,s),c=i.get(s);return typeof c=="number"?Math.max(a,c):a},getStack(o,s){let a=e.getStack(o,s);if(!a.length)return a;let c=i.get(s);if(typeof c=="number"){let u=a.slice();return u[u.length-1]=Math.max(u[u.length-1],c),u}return a}}:e}function co(t,e,n){let r=new Map,i=(u,l)=>un(u,l).map(([f,d])=>({name:f,num:d})),o=i(e?.counterReset,0),s=i(e?.counterSet,0),a=i(e?.counterIncrement,1);function c(u){if(r.has(u))return r.get(u).slice();let l=n.getStack(t,u);l=l.length?l.slice():[];let f=o.find(m=>m.name===u);if(f){let m=Number.isFinite(f.num)?f.num:0;l=l.length?[...l,m]:[m]}let d=s.find(m=>m.name===u);if(d){let m=Number.isFinite(d.num)?d.num:0;l.length===0&&(l=[0]),l[l.length-1]=m}let h=a.find(m=>m.name===u);if(h){let m=Number.isFinite(h.num)?h.num:1;l.length===0&&(l=[0]),l[l.length-1]+=m}return r.set(u,l.slice()),l}return{get(u,l){let f=c(l);return f.length?f[f.length-1]:0},getStack(u,l){return c(l)},__incs:a}}var If=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","letter-spacing","line-height"],Of=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","font-variant","letter-spacing","word-spacing","text-transform","text-decoration-line","text-decoration-color","text-decoration-style","line-height","background-color","vertical-align"];function Ls(t,e,n,r,i,o){try{if(r===null){if(t.getRootNode()!==(t.ownerDocument||document))return;let f=O(t).display||"";if(i==="::marker"?!f.includes("list-item"):!(f==="block"||f==="flow-root"||f==="list-item"||f==="inline-block"||f==="table-cell"||f==="table-caption"))return}else if(!t.matches(r))return;if(i==="::marker"&&!(O(t).display||"").includes("list-item"))return;let s=O(t,i),a=O(t);if(!s)return;let c="";for(let f of o){let d=s.getPropertyValue(f);d&&d!==a.getPropertyValue(f)&&!(f==="background-color"&&d==="rgba(0, 0, 0, 0)")&&!(f==="vertical-align"&&d==="baseline")&&(c+=`${f}:${d};`)}if(i==="::marker"){let f=s.getPropertyValue("content");f&&f!=="normal"&&f!=="none"&&(c+=`content:${f};`)}if(!c)return;let l=`data-sd-p${n.__pseudoRuleSeq=(n.__pseudoRuleSeq||0)+1}`;e.setAttribute(l,""),n.__pseudoCSS=(n.__pseudoCSS||"")+`[${l}]${i}{${c}}`}catch{}}function Df(t,e){if(!/\b(?:no-)?(?:open|close)-quote\b/.test(t))return t;let n="\u201C",r="\u201D";try{let i=O(e).quotes;if(i==="none")n="",r="";else if(i&&i!=="auto"){let o=i.match(/"[^"]*"|'[^']*'/g);o&&o.length>=2&&(n=o[0].slice(1,-1),r=o[1].slice(1,-1))}}catch{}return n=n.replace(/"/g,""),r=r.replace(/"/g,""),t.replace(/"[^"]*"|\b(no-open-quote|no-close-quote|open-quote|close-quote)\b/g,(i,o)=>o?o==="open-quote"?`"${n}"`:o==="close-quote"?`"${r}"`:'""':i)}function Wf(t,e,n,r){let i;try{i=O(t,e)}catch{}let o=i?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};o=$f(o),o=Df(o,t);let s=ao(t,n,r),a=co(t,i,s),c=Rs(o)?Ts(o,t,a):o;return{text:Lf(c),incs:a.__incs||[]}}function Bf(t,e){if(e.__shadowPseudo)return!1;let n=Fe(t),r=[];for(let o of["before","after","firstLetter","marker","firstLine"]){let s=n[o];if(s===null)return!1;s&&r.push(s)}if(!r.length)return!0;let i=r.join(",");try{return!t.matches(i)&&t.querySelector(i)===null}catch{return!1}}async function Ie(t,e,n,r,i=!1){if(t?.nodeType!==1||e?.nodeType!==1||(n.slicer?.due()&&await n.slicer.pause(),t.tagName==="TEXTAREA"))return;let o=t.ownerDocument||document;if(!i&&!Tf(o,n)&&!n.__shadowPseudo||!i&&Bf(t,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=Pf(t.ownerDocument||document,n));let s=n.__counterCtx,a=Fe(t);a.marker!==""&&Ls(t,e,n,a.marker,"::marker",If),a.firstLine!==""&&Ls(t,e,n,a.firstLine,"::first-line",Of);for(let u of["::before","::after","::first-letter"]){let l=a[u==="::before"?"before":u==="::after"?"after":"firstLetter"];if(l!==null){if(l==="")continue;try{if(!t.matches(l))continue}catch{}}try{let f=O(t,u);if(!f||f.content==="none"&&f.backgroundImage==="none"&&(f.backgroundColor==="transparent"||f.backgroundColor==="rgba(0, 0, 0, 0)")&&!Ns(f)&&(!f.transform||f.transform==="none")&&f.display==="inline")continue;if(f.display==="none"||u!=="::first-letter"&&(f.content==="none"||f.content==="normal")){u==="::before"&&(e.dataset.snapdomHasBefore="1"),u==="::after"&&(e.dataset.snapdomHasAfter="1");continue}if(u==="::first-letter"){let V=O(t),G=(V?.display||"").toLowerCase();if(G.includes("flex")||G.includes("grid"))continue;let U=jt=>f[jt]!==V[jt]&&(parseFloat(f[jt])||0)!==0;if(!(f.color!==V.color||f.fontSize!==V.fontSize||f.fontWeight!==V.fontWeight||f.fontFamily!==V.fontFamily||f.fontStyle!==V.fontStyle||f.textTransform!==V.textTransform||f.float!==V.float&&f.float!=="none"||U("paddingTop")||U("paddingRight")||U("paddingBottom")||U("paddingLeft")||U("marginTop")||U("marginRight")||U("marginBottom")||U("marginLeft")))continue;let Y=Array.from(e.childNodes).find(jt=>jt.nodeType===Node.TEXT_NODE&&jt.textContent?.trim().length>0);if(!Y)continue;let Ct=Y.textContent,ye=/^\s*/.exec(Ct)[0],bn=Ct.slice(ye.length),Xe=bn.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],Sr=bn.slice(Xe?.length||0);if(!Xe||/[\uD800-\uDFFF]/.test(Xe))continue;let Ht=document.createElement("span");Ht.textContent=Xe,Ht.dataset.snapdomPseudo="::first-letter";let xr=Ce(f,kn(t)),vr=ve(xr,"span");n.styleMap.set(Ht,vr);let wn=document.createTextNode(Sr);e.replaceChild(wn,Y),e.insertBefore(Ht,wn),ye&&e.insertBefore(document.createTextNode(ye),Ht);continue}let m=f.content??"",p=m===""||m==="none"||m==="normal",{text:g,incs:y}=Wf(t,u,s,n.__siblingCounters),b=f.backgroundImage,w=f.backgroundColor,v=f.fontFamily,C=parseInt(f.fontSize)||32,S=parseInt(f.fontWeight)||!1,M=f.fontStyle||"normal",_=f.color||"#000",E=f.transform,x=Nt(v,r?.__iconMatchers),k=!p&&g!=="",R=b&&b!=="none",T=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",L=Ns(f),W=E&&E!=="none",P=m!=="none"&&m!=="normal",A=/^inline-/.test(f.display||""),N=P&&((parseFloat(f.width)||0)>0||(parseFloat(f.height)||0)>0||A),$=P&&f.boxShadow&&f.boxShadow!=="none",F=P&&f.outlineStyle&&f.outlineStyle!=="none"&&(parseFloat(f.outlineWidth)||0)>0;if(!(k||R||T||L||W||N||$||F)){if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:G}of y){if(!G)continue;let U=ao(t,s,n.__siblingCounters),Y=co(t,O(t,u),U).get(t,G);V.set(G,Y)}n.__siblingCounters.set(t.parentElement,V)}continue}let q=g.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(g),j=f.display==="inline"&&f.cssFloat==="none"&&f.position!=="absolute"&&f.position!=="fixed",J=!1;if(k&&!x&&g.length>1&&!q&&j){let V=O(t),G=parseFloat(V.fontSize)||16,U=parseFloat(V.lineHeight);Number.isFinite(U)||(U=G*1.5),t.getBoundingClientRect().height<U*1.6&&(e.style.whiteSpace="nowrap",J=!0)}let B=document.createElement("span");B.dataset.snapdomPseudo=u,B.style.pointerEvents="none",J&&(B.style.whiteSpace="nowrap");let ut=Oi(t,u,f,n,r),vt=(O(t).display||"").toLowerCase(),at=vt.includes("flex")||vt.includes("grid");if(at){let V=ut["min-width"];(!V||V==="auto"||V==="0px")&&(ut["min-width"]="0px")}let st=k;st&&!j&&parseFloat(f.height)>=1.5*(parseFloat(f.lineHeight)||(parseFloat(f.fontSize)||16)*1.2)&&(st=!1,B.style.whiteSpace=f.whiteSpace);let nt=ve(ut,"span",st,at);if(n.styleMap.set(B,nt),x&&g&&g.length===1){let{dataUrl:V,width:G,height:U}=await ws(g,v,S,C,_,M),ht=document.createElement("img");ht.src=V,ht.style=`height:${C}px;width:${G/U*C}px;object-fit:contain;`,B.appendChild(ht),e.dataset.snapdomHasIcon="true"}else if(g&&q){let V=Ke(g,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??re(g);if(V?.trim())try{let G=await ft(qt(V),{as:"dataURL",useProxy:r.useProxy});if(G?.ok&&typeof G.data=="string"){let U=document.createElement("img");U.src=G.data,U.style=`width:${C}px;height:auto;object-fit:contain;`,B.appendChild(U)}}catch(G){console.warn(`[SnapDOM] Couldn't draw the ${u} icon of`,t,G)}}else!x&&k&&(B.textContent=g);B.style.backgroundImage="none","maskImage"in B.style&&(B.style.maskImage="none"),"webkitMaskImage"in B.style&&(B.style.webkitMaskImage="none");try{B.style.backgroundRepeat=f.backgroundRepeat,B.style.backgroundSize=f.backgroundSize,f.backgroundPositionX&&f.backgroundPositionY?(B.style.backgroundPositionX=f.backgroundPositionX,B.style.backgroundPositionY=f.backgroundPositionY):B.style.backgroundPosition=f.backgroundPosition,B.style.backgroundOrigin=f.backgroundOrigin,B.style.backgroundClip=f.backgroundClip,B.style.backgroundAttachment=f.backgroundAttachment,B.style.backgroundBlendMode=f.backgroundBlendMode}catch{}if(R)try{let V=Xt(b),G=await Promise.all(V.map(U=>Se(U,r)));B.style.backgroundImage=G.join(", ")}catch(V){console.warn(`[SnapDOM] Couldn't load the ${u} background image.`,V)}T&&(B.style.backgroundColor=w);let pt=f.maskImage||f.webkitMaskImage;if(pt&&pt!=="none")try{let G=(await Promise.all(Xt(pt).map(U=>Se(U,r)))).join(", ");B.style.maskImage=G,B.style.webkitMaskImage=G;for(let U of["maskSize","maskRepeat","maskPosition","maskMode","maskComposite","maskOrigin","maskClip"])f[U]&&(B.style[U]=f[U])}catch(V){console.warn(`[SnapDOM] Couldn't load the ${u} mask image.`,V)}let ge=B.childNodes.length>0||B.textContent?.trim()!==""||R||T||L||W||N||$||F;if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map,G=ao(t,s,n.__siblingCounters),U=co(t,O(t,u),G);for(let{name:ht}of y){if(!ht)continue;let Y=U.get(t,ht);V.set(ht,Y)}n.__siblingCounters.set(t.parentElement,V)}if(!ge)continue;u==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(B,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(B))}catch(f){console.warn(`[SnapDOM] Couldn't copy the ${u} of`,t,f)}}let c=Array.from(e.children).filter(u=>!u.dataset.snapdomPseudo);if(n.nodeMap)for(let u of c){let l=n.nodeMap.get(u);l?.nodeType===1&&await Ie(l,u,n,r,!0)}else{let u=Array.from(t.children);for(let l=0;l<Math.min(u.length,c.length);l++)await Ie(u[l],c[l],n,r,!0)}}kt();function Os(t,e,n){if(!t||t?.nodeType!==1)return;let r=t.ownerDocument||document,i=e||r,o=It(t)&&t.localName==="svg"?[t]:Array.from(t.querySelectorAll("svg")),s=/url\(\s*["']?\s*#([^)"']+)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],c=S=>window.CSS&&CSS.escape?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),u="http://www.w3.org/1999/xlink",l=S=>{if(!S||!S.getAttribute)return null;let M=S.getAttribute("href")||S.getAttribute("xlink:href")||(typeof S.getAttributeNS=="function"?S.getAttributeNS(u,"href"):null);if(M)return M;let _=S.attributes;if(!_)return null;for(let E=0;E<_.length;E++){let x=_[E];if(!x||!x.name)continue;if(x.name==="href")return x.value;let k=x.name.indexOf(":");if(k!==-1&&x.name.slice(k+1)==="href")return x.value}return null},f=new Set(Array.from(t.querySelectorAll("[id]")).map(S=>S.id)),d=new Set,h=!1,m=(S,M=null)=>{if(!S)return;s.lastIndex=0;let _;for(;_=s.exec(S);){h=!0;let E=(_[1]||"").trim();E&&(f.has(E)||(d.add(E),M&&!M.has(E)&&M.add(E)))}},p=S=>{let M=S.querySelectorAll("use");for(let x of M){let k=l(x);if(!k||!k.startsWith("#"))continue;h=!0;let R=k.slice(1).trim();R&&!f.has(R)&&d.add(R)}let _='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';m(S.getAttribute("style")||"");for(let x of a)m(S.getAttribute(x));let E=S.querySelectorAll(_);for(let x of E){m(x.getAttribute("style")||"");for(let k of a)m(x.getAttribute(k))}},g=S=>{if(!S||S.nodeType!==1||!S.querySelectorAll)return;let M="filter[id],clipPath[id],mask[id],linearGradient[id],radialGradient[id],pattern[id]",_=!1;try{_=!!(i.querySelector&&i.querySelector(M))}catch{return}if(!_)return;let E=["filter","clipPath","mask","maskImage","webkitMaskImage"],x=k=>{if(It(k))return;let R;try{R=getComputedStyle(k)}catch{return}for(let T of E){let L=R[T];L&&L.includes("url(")&&m(L)}};x(S);for(let k of S.querySelectorAll("*"))x(k)};for(let S of o)p(S);if(g(n),!h)return;let y=t.querySelector("svg.inline-defs-container");y||(y=r.createElementNS("http://www.w3.org/2000/svg","svg"),y.classList.add("inline-defs-container"),y.setAttribute("aria-hidden","true"),y.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(y,t.firstChild||null));let b=y.querySelector("defs")||null,w=S=>{if(!S||f.has(S))return null;let M=c(S),_=E=>{let x=i.querySelector(E);return x&&!t.contains(x)?x:null};return _(`svg defs > *#${M}`)||_(`svg > symbol#${M}`)||_(`*#${M}`)};if(!d.size)return;let v=new Set(d),C=new Set;for(;v.size;){let S=v.values().next().value;if(v.delete(S),!S||f.has(S)||C.has(S))continue;let M=w(S);if(!M){C.add(S);continue}b||(b=r.createElementNS("http://www.w3.org/2000/svg","defs"),y.appendChild(b));let _=M.cloneNode(!0);_.id||_.setAttribute("id",S),b.appendChild(_),C.add(S),f.add(S);let E=[_,..._.querySelectorAll("*")];for(let x of E){let k=l(x);if(k&&k.startsWith("#")){let T=k.slice(1).trim();T&&!f.has(T)&&!C.has(T)&&v.add(T)}let R=x.getAttribute?.("style")||"";R&&m(R,v);for(let T of a){let L=x.getAttribute?.(T);L&&m(L,v)}}}}kt();var lo=new WeakMap,fo=new WeakMap;function zn(t,e,n){let r=n.get(t),i=t.style;if(!r){let s=i.cssText,a=t.hasAttribute("style");r={users:0,saved:e.map(([u,l])=>{let f={property:u,value:i.getPropertyValue(u),priority:i.getPropertyPriority(u)};return i.setProperty(u,l,"important"),f.forcedValue=i.getPropertyValue(u),f}),originalCSS:s,forcedCSS:i.cssText,hadStyle:a},n.set(t,r)}r.users++;let o=!1;return()=>{if(!o&&(o=!0,!--r.users)){if(n.delete(t),i.cssText===r.forcedCSS)i.cssText=r.originalCSS;else for(let s of r.saved)i.getPropertyValue(s.property)!==s.forcedValue||i.getPropertyPriority(s.property)!=="important"||(s.value?i.setProperty(s.property,s.value,s.priority):i.removeProperty(s.property));!r.hadStyle&&!i.length&&(t.getAttribute("style"),t.removeAttribute("style"))}}}function Ds(t){if(lo.has(t))return zn(t,[],lo);let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,i=n!=="none"&&parseFloat(r)>0,o=parseFloat(e.borderTopWidth)===0&&parseFloat(e.borderRightWidth)===0&&parseFloat(e.borderBottomWidth)===0&&parseFloat(e.borderLeftWidth)===0;if(i&&o){let s=[];for(let a of["top","right","bottom","left"])s.push([`border-${a}-width`,r],[`border-${a}-style`,"solid"],[`border-${a}-color`,"transparent"]);return zn(t,s,lo)}return()=>{}}function Hn(t,e=null){let n=[],r=i=>{if(!Rt(i))return;if(fo.has(i)){n.push(zn(i,[],fo));return}let o=getComputedStyle(i);(o.contentVisibility||o.getPropertyValue("content-visibility")||"")==="auto"&&n.push(zn(i,[["content-visibility","visible"]],fo))};try{if(e){let o=s=>{let a;try{a=s.getBoundingClientRect()}catch{return}if(!((a.width>0||a.height>0)&&(a.right<e.left-200||a.left>e.right+200||a.bottom<e.top-200||a.top>e.bottom+200))){r(s);for(let c=s.firstElementChild;c;c=c.nextElementSibling)o(c)}};o(t)}else{for(let i of t.querySelectorAll("*"))r(i);r(t)}}catch{}return()=>{for(let i of n)try{i()}catch{}}}St();yt();Mt();ke();Mt();function po(t){return Bs(t.boxShadow)}function ho(t){return Bs(t.textShadow)}function Bs(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",r=0;for(let c=0;c<t.length;c++){let u=t[c];u==="("?r++:u===")"&&(r=Math.max(0,r-1)),u===","&&r===0?(e.push(n),n=""):n+=u}n.trim()&&e.push(n);let i=0,o=0,s=0,a=0;for(let c of e){if(/\binset\b/i.test(c))continue;let u=c.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(u.length<2)continue;let[l,f,d=0,h=0]=u,m=Math.abs(l)+d+h,p=Math.abs(f)+d+h;o=Math.max(o,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),s=Math.max(s,p+Math.max(f,0)),i=Math.max(i,p+Math.max(-f,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(s),left:Math.ceil(a)}}function mo(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(e);)r+=parseFloat(i[1])||0;let o=Math.ceil(r*2);return{top:o,right:o,bottom:o,left:o}}function go(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function yo(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,s=0,a=!1;for(let c of n){a=!0;let u=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[l=0,f=0,d=0]=u,h=Math.abs(l)+d,m=Math.abs(f)+d;i=Math.max(i,h+Math.max(l,0)),s=Math.max(s,h+Math.max(-l,0)),o=Math.max(o,m+Math.max(f,0)),r=Math.max(r,m+Math.max(-f,0))}return{bleed:{top:D(r),right:D(i),bottom:D(o),left:D(s)},has:a}}function Uf(t){let e=po(t),n=ho(t),r=mo(t),i=go(t),o=yo(t);return{top:Math.max(e.top,n.top)+r.top+i.top+o.bleed.top,right:Math.max(e.right,n.right)+r.right+i.right+o.bleed.right,bottom:Math.max(e.bottom,n.bottom)+r.bottom+i.bottom+o.bleed.bottom,left:Math.max(e.left,n.left)+r.left+i.left+o.bleed.left}}function zf(t){return t.boxShadow&&t.boxShadow!=="none"||t.textShadow&&t.textShadow!=="none"||(t.outlineStyle||"none")!=="none"||t.filter&&t.filter!=="none"?!0:!!t.webkitFilter&&t.webkitFilter!=="none"}function Ws(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",r=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:r||e!=="visible",y:r||n!=="visible"}}function Us(t,e,n,r=1,i=1){let o=0,s=0,a=0,c=0,u=Ws(n.get(t)||O(t));if(u.x&&u.y)return{top:0,right:0,bottom:0,left:0};let l=t.getBoundingClientRect();for(let f of e.values()){if(f===t||f.nodeType!==1||f.ownerDocument!==t.ownerDocument)continue;let d=n.get(f);if(!d||!zf(d))continue;let h=Uf(d);if(!(h.top||h.right||h.bottom||h.left))continue;let m=f.getBoundingClientRect(),p={left:m.left-h.left/r,top:m.top-h.top/i,right:m.right+h.right/r,bottom:m.bottom+h.bottom/i};for(let g=f.parentElement;g;g=g.parentElement){let y=Ws(n.get(g)||O(g));if(y.x||y.y){let b=g.getBoundingClientRect();y.x&&(p.left=Math.max(p.left,b.left),p.right=Math.min(p.right,b.right)),y.y&&(p.top=Math.max(p.top,b.top),p.bottom=Math.min(p.bottom,b.bottom))}if(g===t)break}u.x||(c=Math.max(c,(l.left-p.left)*r),s=Math.max(s,(p.right-l.right)*r)),u.y||(o=Math.max(o,(l.top-p.top)*i),a=Math.max(a,(p.bottom-l.bottom)*i))}return{top:Math.max(0,Math.ceil(o)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(c))}}function zs(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none"){let c=null;try{c=fe(t).scale}catch{}try{e.style.transform="none"}catch{}if(!c)return{a:1,b:0,c:0,d:1};let u=Zt({scale:c});return{a:u.a,b:u.b,c:u.c,d:u.d}}function i(c,u,l,f){let d=Math.sqrt(c*c+u*u)||0,h=0,m=0;if(d>0){let p=c/d,g=u/d;h=p*l+g*f;let y=l-p*h,b=f-g*h;m=Math.sqrt(y*y+b*b)||0,m>0?h=h/m:h=0}return{a:d,b:0,c:h*m,d:m}}let o=c=>{let u=fe(t).scale;if(!u)return c;let l=Zt({scale:u,baseTransform:`matrix(${c.a},${c.b},${c.c},${c.d},0,0)`});return{a:l.a,b:l.b,c:l.c,d:l.d}},s=r.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let c=s[1].split(",").map(u=>parseFloat(u.trim()));if(c.length===6&&c.every(Number.isFinite)){let[u,l,f,d]=c,h=i(u,l,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let c=a[1].split(",").map(u=>parseFloat(u.trim()));if(c.length===16&&c.every(Number.isFinite)){let u=c[0],l=c[1],f=c[4],d=c[5],h=i(u,l,f,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}try{let c=new DOMMatrix(r),u=i(c.a,c.b,c.c,c.d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return o(u)}catch{return null}}function Oe(t,e,n,r,i){let o=n.a,s=n.b,a=n.c,c=n.d,u=n.e||0,l=n.f||0;function f(y,b){let w=y-r,v=b-i,C=o*w+a*v,S=s*w+c*v;return C+=r+u,S+=i+l,[C,S]}let d=[f(0,0),f(t,0),f(0,e),f(t,e)],h=1/0,m=1/0,p=-1/0,g=-1/0;for(let[y,b]of d)y<h&&(h=y),b<m&&(m=b),y>p&&(p=y),b>g&&(g=b);return{minX:h,minY:m,maxX:p,maxY:g,width:p-h,height:g-m}}function dn(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],s=(a,c)=>{let u=a.toLowerCase();return u==="left"||u==="top"?0:u==="center"?c/2:u==="right"||u==="bottom"?c:u.endsWith("px")?parseFloat(u)||0:u.endsWith("%")?(parseFloat(u)||0)*c/100:/^-?\d+(\.\d+)?$/.test(u)&&parseFloat(u)||0};return{ox:s(i,e),oy:s(o,n)}}function fe(t){let e={rotate:"0deg",scale:null,translate:null},n=null;try{n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null}catch{}if(n){let i=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},o=i("rotate");if(o)if(o.angle){let c=o.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit,o.is2D===!1&&o.x&&o.y&&o.z&&(e.rotate=`${o.x.value} ${o.y.value} ${o.z.value} ${e.rotate}`)}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let s=i("scale");if(s){let c=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[c(s.x),c(s.y)??c(s.x),...s.is2D===!1?[c(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(c).join(" "):e.scale=String(s)}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let a=i("translate");if(a){let c=u=>u&&u.value!=null?`${u.value}${u.unit==="percent"?"%":u.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[c(a.x),c(a.y)??"0px",...a.is2D===!1?[c(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(c).join(" "):e.translate=String(a)}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return(!e.rotate||e.rotate==="none")&&(e.rotate="0deg"),(!e.scale||e.scale==="none")&&(e.scale=null),(!e.translate||e.translate==="none")&&(e.translate=null),e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}var uo=null;function Hf(){if(uo?.isConnected)return uo;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Z(t),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),uo=t,t}function Zt(t){let e=o=>{let s=[],a=0,c=0,u=String(o).trim();for(let l=0;l<u.length;l++)u[l]==="("?a++:u[l]===")"?a--:/\s/.test(u[l])&&!a&&(l>c&&s.push(u.slice(c,l)),c=l+1);return c<u.length&&s.push(u.slice(c)),s},n=o=>o&&o!=="none",r=[];if(n(t.translate)){let o=e(t.translate);for(let s=0;s<2&&s<o.length;s++){let a=s===0?t.width:t.height;/^[+-]?(?:\d*\.)?\d+%$/.test(o[s])&&Number.isFinite(a)&&(o[s]=`${parseFloat(o[s])*a/100}px`)}r.push(o.length>2?`translate3d(${o.join(",")})`:`translate(${o.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let o=e(t.rotate);o.length===4?r.push(`rotate3d(${o.join(",")})`):o.length===2&&/^[xyz]$/i.test(o[0])?r.push(`rotate${o[0].toUpperCase()}(${o[1]})`):r.push(`rotate(${o.join(" ")})`)}if(n(t.scale)){let o=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);r.push(o.length>2?`scale3d(${o.join(",")})`:`scale(${o.join(",")})`)}if(n(t.baseTransform)&&r.push(t.baseTransform),!r.length)return new DOMMatrix;let i=r.join(" ");try{if(i.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(i)}catch{let o=Hf(),s=document.createElement("div");if(s.style.cssText="all:initial!important;display:block!important;transform-origin:0 0!important",s.style.setProperty("width",`${Number.isFinite(t.width)?t.width:0}px`,"important"),s.style.setProperty("height",`${Number.isFinite(t.height)?t.height:0}px`,"important"),s.style.setProperty("transform",i,"important"),!s.style.transform)throw new Error("[SnapDOM] Couldn't read the transform of an element.");o.appendChild(s);try{return jf(s)}finally{s.remove()}}}function Hs(t){let e=O(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let i=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",o=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(i||o||s)}function jf(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var Gs=new WeakSet;function jn(t,e){if(!e)return null;let n=t.ownerDocument||document,r=n.defaultView||window,i,o,s,a;if(e==="viewport")i=0,o=0,s=n.documentElement?.clientWidth||r.innerWidth,a=n.documentElement?.clientHeight||r.innerHeight;else if(typeof e=="object")i=(Number(e.x)||0)-(r.scrollX||0),o=(Number(e.y)||0)-(r.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:i,top:o,width:s,height:a,right:i+s,bottom:o+a}:null}function bo(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return Ot(e)?e.host:null}function Vf(t,e){for(let n=e;n;n=bo(n))if(n===t)return!0;return!1}function qf(t,e){for(let n=bo(t);n&&n!==e&&n?.nodeType===1;n=bo(n)){let r=O(n);if(r.position!=="static"||r.transform&&r.transform!=="none"||r.filter&&r.filter!=="none"||r.backdropFilter&&r.backdropFilter!=="none"||r.perspective&&r.perspective!=="none"||/transform|perspective|filter/.test(r.willChange||"")||/layout|paint|strict|content/.test(r.contain||""))return n}return null}function So(t,e){try{return Zt({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function Xs(t,e,n,r,i){let o=t.getBoundingClientRect();Rt(e)&&O(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,c]of n){if(!Rt(a)||c?.nodeType!==1||c===t||!Vf(t,c))continue;let u=r.get(c)||O(c),l=u.position;if(l!=="fixed"&&l!=="sticky"&&l!=="-webkit-sticky"||a.style.position==="absolute")continue;let f=c.getBoundingClientRect();if(!(f.width>0&&f.height>0))continue;Gs.add(a);let d=u.transform&&u.transform!=="none"?u.transform:"",h=fe(c),m=!!(d||h.rotate!=="0deg"||h.scale||h.translate),p=m?So(d,h):null,g=!p||!p.is2D||p.a===1&&p.b===0&&p.c===0&&p.d===1,y=f.width,b=f.height;g||(y=c.offsetWidth||f.width,b=c.offsetHeight||f.height);let w=c.getRootNode&&Ot(c.getRootNode()),v=o,C=t.clientLeft||0,S=t.clientTop||0;if(w){let k=qf(c,t);k&&(v=k.getBoundingClientRect(),C=k.clientLeft||0,S=k.clientTop||0)}let M=f.left-v.left-C,_=f.top-v.top-S;if(m)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",g)a.style.transform="none";else{a.style.transform=`matrix(${p.a},${p.b},${p.c},${p.d},0,0)`;let{ox:k,oy:R}=dn(u,y,b),T=Oe(y,b,{a:p.a,b:p.b,c:p.c,d:p.d,e:0,f:0},k,R);M-=T.minX,_-=T.minY}if(l!=="fixed"){let k=a.cloneNode(!1);k.setAttribute("data-snap-ph","1"),k.style.position="static",k.style.visibility="hidden",k.style.width=`${y}px`,k.style.height=`${b}px`,k.style.boxSizing="border-box",a.parentElement?.insertBefore(k,a)}let E=y+2,x=b;i&&(Math.abs(_-i.y)<.5&&(_-=1,x+=1),Math.abs(M-i.x)<.5&&(M-=1,E+=1)),a.style.position="absolute",a.style.left=`${M}px`,a.style.top=`${_}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${E}px`,a.style.height=`${x}px`,a.style.boxSizing="border-box",w||s.push(a)}for(let a of s)e.appendChild(a)}function Ys(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){H(n,"Couldn't remove the root box-shadow.",s)}try{e.style.textShadow="none"}catch(s){H(n,"Couldn't remove the root text-shadow.",s)}try{e.style.outline="none"}catch(s){H(n,"Couldn't remove the root outline.",s)}let o=(r.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch(s){H(n,"Couldn't remove the root drop-shadow filter.",s)}}function Ks(t,e){if(!t||!e||!e.style)return;let n=1;try{n=parseFloat(getComputedStyle(t).zoom)}catch{return}if(!(!e.style.getPropertyValue("zoom")&&(!Number.isFinite(n)||n===1)))try{e.style.setProperty("zoom","1","important")}catch{}}function js(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",r=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||r!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function Gf(t,e){let n=Array.from(t.childNodes),r=e==="top"?n:n.reverse();for(let i of r){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(i),s=String(o.display||"");if(!(s==="none"||s==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||s.startsWith("inline")?null:i}return null}function Qs(t,e,n){if(!t||!e||!e.style)return;let r=getComputedStyle(t);if(!js(r))for(let i of["top","bottom"]){let o=i==="top"?"Top":"Bottom";if((parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)continue;let s=t,a=e;for(;s&&a;){let c=Gf(s,i);if(!c)break;let u=n?Array.from(a.children).find(d=>n.get(d)===c)||null:a.children[Array.from(s.children).indexOf(c)]||null,l=getComputedStyle(c),f=parseFloat(l[`margin${o}`])||0;if(u&&u.style&&f>0&&(u.style[`margin${o}`]="0px"),js(l)||(parseFloat(l[`border${o}Width`])||0)>0||(parseFloat(l[`padding${o}`])||0)>0)break;s=c,a=u}}}var Xf=new Set(["xml","xlink"]);function Yf(t,e){if(t.startsWith("*")||t==="xmlns"||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!Xf.has(n))return!0}return e?t.startsWith("x-")||t.startsWith("v-")||t.startsWith(":")||t.startsWith("on:")||t.startsWith("bind:")||t.startsWith("let:")||t.startsWith("class:"):!1}var Kf=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,Vs=t=>t.replace(Kf,e=>e.length===2?e:""),Qf=/^data:[^,]{0,120};base64,/;function Vn(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,r=a=>{for(let c of Array.from(a.attributes)){if(Yf(c.name,n)){a.removeAttribute(c.name);continue}if(Qf.test(c.value))continue;let u=Vs(c.value);if(u!==c.value)try{a.setAttribute(c.name,u)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&r(t);let i=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=o.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)r(s);else if(s.nodeType===Node.COMMENT_NODE)i.push(s);else{let a=Vs(s.data);a!==s.data&&(s.data=a)}for(let a of i)a.remove()}function Jf(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}var Zf=new Set(["img","canvas","video","iframe","object","embed"]);function tu(t){return It(t)||Zf.has(t?.localName)}function eu(t,e){if(t?.nodeType!==1||Jf(t)||tu(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function Js(t,e,n=new Map,r=null){function i(o,s){if(o?.nodeType!==1||s?.nodeType!==1)return;let a=o.childElementCount>s.childElementCount,c=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,c),a&&eu(o,c)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let l=c.overflowY||c.overflowBlock||"visible",f=c.overflowX||c.overflowInline||"visible";(l!=="visible"||f!=="visible")&&(s.style.overflow="visible")}let u=Array.from(s.children);if(r)for(let l of u){let f=r.get(l);f&&f.nodeType===1&&i(f,l)}else{let l=Array.from(o.children);for(let f=0;f<Math.min(l.length,u.length);f++)i(l[f],u[f])}}i(t,e)}function nu(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function ru(t,e){if(t?.nodeType!==1)return!1;if(t.getAttribute("data-capture")==="exclude")return e?.excludeMode==="remove";if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch(r){H(e,"Invalid exclude selector; ignored.",r)}if(Array.isArray(e?.excludePredicates))for(let n of e.excludePredicates)try{if(n(t))return e.excludeMode==="remove"}catch(r){H(e,"Your exclude function threw; ignored.",r)}if(typeof e?.filter=="function"&&e.filterMode==="remove")try{if(!e.filter(t))return!0}catch(n){H(e,"Your filter function threw; ignored.",n)}return!1}function xo(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),i=1/0,o=-1/0,s=!1,a=Array.from(t.children);for(let h of a){if(ru(h,e)||!nu(h))continue;let m=h.getBoundingClientRect(),p=m.top-r.top,g=m.bottom-r.top;g<=p||(p<i&&(i=p),g>o&&(o=g),s=!0)}let c=s?Math.max(0,o-i):0,u=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return u+l+f+d+c}var D=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,De=.75;function Zs(t,e,n,r,i,o){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),c=i>0&&a.width>0?a.width/i:1,u=o>0&&a.height>0?a.height/o:1;if(Math.abs(c-u)>.02)return 0;let l=s.createElement("div");Z(l),l.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let f=l.attachShadow({mode:"open"}),d=s.createElement("style");d.textContent=n,f.appendChild(d);let h=e.cloneNode(!0);f.appendChild(h),s.body.appendChild(l);let m=0,p=(g,y,b)=>{let w=O(g),v=w.boxSizing==="border-box",C=(S,M,..._)=>{let E=parseFloat(S);if(!Number.isFinite(E))return M;let x=E+(v?0:_.reduce((k,R)=>k+(parseFloat(R)||0),0));return Math.abs(x-M)<=.51?x:M};return{width:C(w.width,y,w.paddingLeft,w.paddingRight,w.borderLeftWidth,w.borderRightWidth),height:C(w.height,b,w.paddingTop,w.paddingBottom,w.borderTopWidth,w.borderBottomWidth)}};try{let g=h.getBoundingClientRect(),y=h.offsetWidth||i,b=h.offsetHeight||o,w=y>0&&g.width>0?g.width/y:1,v=b>0&&g.height>0?g.height/b:1,C=(S,M,_=!1)=>{let E=S.children,x=M.children,k=Math.min(E.length,x.length);for(let R=0;R<k;R++){let T=E[R],L=x[R],W=r.get(T),P=_||Gs.has(T);if(W?.nodeType===1&&Rt(T)&&T.style&&W.isConnected){let A=W.getBoundingClientRect();if(A.width>0&&A.height>0){let N=L.getBoundingClientRect(),$=A.width/c,F=A.height/u,z=N.width,q=N.height,j=W.offsetWidth||$,J=W.offsetHeight||F,B=L.offsetWidth||z,ut=L.offsetHeight||q,vt=Math.abs($-j)>De||Math.abs(F-J)>De||Math.abs(z-B)>De||Math.abs(q-ut)>De;if(P){let nt=p(L,B,ut);$=z>0?$*w*nt.width/z:$,F=q>0?F*v*nt.height/q:F,z=nt.width,q=nt.height}else if(vt){let nt=p(W,j,J),pt=p(L,B,ut);$=nt.width,F=nt.height,z=pt.width,q=pt.height}let at=z-$,st=q-F;(Math.abs(at)>De||Math.abs(st)>De)&&(T.style.boxSizing="border-box",T.style.width=`${D($)}px`,T.style.height=`${D(F)}px`,m++)}}C(T,L,P)}};C(e,h)}finally{l.remove()}return m}var ou=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;function wo(t,e=new Set){let n="";if(!t)return n;for(let r=0;r<t.length;r++){let i=t[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=wo(i.styleSheet.cssRules,e);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=wo(i.cssRules,e);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(ou.test(o)){let s=i.cssText;s&&!e.has(s)&&(e.add(s),n+=s)}}}catch{}}return n}var qs=new WeakMap;function iu(t){let e="";for(let n of t.styleSheets){let r=-1;try{r=n.cssRules?n.cssRules.length:-1}catch{}e+=(n.href||"inline")+":"+r+"|"}return e}function su(t){if(!t||!t.styleSheets)return"";let e=iu(t),n=qs.get(t);if(n&&n.fp===e)return n.css;let r=new Set,i="";for(let o of Array.from(t.styleSheets))try{let s=o.cssRules;s&&(i+=wo(s,r))}catch{}return qs.set(t,{fp:e,css:i}),i}function ta(t,e){let n=Or(t.clone).sort(),r=n.join(","),i=an(t.element),o=I.baseStyle.get(r),s;o&&o.universe===i?s=o.css:(s=Dr(n,i),I.baseStyle.set(r,{universe:i,css:s}));let a=su(t.element?.ownerDocument||document);return t.fontsCSS=e,t.baseCSS=s,t.scrollbarCSS=a,{baseCSS:s,scrollbarCSS:a,fontsCSS:e}}mt();var qn=new Set,au="[data-sd-ph]::placeholder{color:var(--sd-ph)!important;opacity:var(--sd-ph-o)!important;-webkit-text-fill-color:var(--sd-ph)!important}";async function ea(t,e={}){Tt(),_n(t.ownerDocument||document);let n=e.__session||{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:e,slicer:e.__slicer||null},i=null,o=null;if(e.clip&&(o=jn(t,e.clip),o&&(r.clip={rect:o,root:t})),e.captureSelection)try{r.selection=cs(t)}catch(p){H(r,"Couldn't read the text selection.",p)}let s,a="",c="";if(qn.size){let p=(g,y)=>{for(let b=y;b;b=b.assignedSlot||b.parentElement||b.getRootNode()?.host)if(b===g)return!0;return!1};for(;;){let g=[...qn].filter(({root:y})=>p(y,t)||p(t,y)).map(({promise:y})=>y.catch(()=>{}));if(!g.length)break;await Promise.all(g)}}if(!r.clip&&t.isConnected&&t.ownerDocument?.visibilityState!=="hidden")try{let p=t.getBoundingClientRect(),g=t.ownerDocument?.defaultView||window,y=p.right<=0||p.bottom<=0||p.left>=g.innerWidth||p.top>=g.innerHeight,b=[];if(y&&(()=>{let v=[];t.shadowRoot&&v.push(t.shadowRoot);for(let C of t.querySelectorAll("*"))C.shadowRoot&&v.push(C.shadowRoot);for(;v.length;){let C=v.pop(),S=C.host?.localName==="calcite-icon";for(let M of C.querySelectorAll("*")){if(M.shadowRoot&&v.push(M.shadowRoot),!S||M.localName!=="svg")continue;let _=M.querySelectorAll("path");if(!_.length||[..._].some(x=>x.getAttribute("d")?.trim()))continue;let E=M.getBoundingClientRect();E.width&&E.height&&b.push(M)}}})(),b.length){let v=(async()=>{let S=t.style,M=t.hasAttribute("style"),_=new Map,E=(x,k)=>{_.has(x)||_.set(x,{value:S.getPropertyValue(x),priority:S.getPropertyPriority(x)}),S.setProperty(x,k,"important");let R=_.get(x);R.forcedValue=S.getPropertyValue(x),R.forcedPriority=S.getPropertyPriority(x)};try{E("left","0"),E("top","0"),E("right","auto"),E("bottom","auto"),E("margin-top","0"),E("margin-right","0"),E("margin-bottom","0"),E("margin-left","0"),E("transform","none"),E("translate","none"),E("opacity","0"),E("pointer-events","none");let x=t.getBoundingClientRect();if(x.right<=0||x.bottom<=0||x.left>=g.innerWidth||x.top>=g.innerHeight){let T=t.parentElement?.getBoundingClientRect(),L=T&&T.right>0&&T.left<g.innerWidth?Math.max(0,T.left):0,W=T&&T.bottom>0&&T.top<g.innerHeight?Math.max(0,T.top):0;E("position","fixed"),E("left",`${L}px`),E("top",`${W}px`)}await bt(100);let k=Date.now()+1500,R=()=>b.some(T=>{if([...T.querySelectorAll("path")].some(W=>W.getAttribute("d")?.trim()))return!1;let L=T.getBoundingClientRect();return L.width&&L.height&&L.right>0&&L.bottom>0&&L.left<g.innerWidth&&L.top<g.innerHeight});for(;Date.now()<k&&R();)await new Promise(T=>setTimeout(T,25));await bt(100)}finally{for(let[x,k]of _)S.getPropertyValue(x)!==k.forcedValue||S.getPropertyPriority(x)!==k.forcedPriority||(k.value?S.setProperty(x,k.value,k.priority):S.removeProperty(x));!M&&!S.length&&t.removeAttribute("style"),await bt(100)}})(),C={root:t,promise:v};qn.add(C);try{await v}finally{qn.delete(C)}}}catch{}let u=Ds(t),l=Hn(t,o);if(o){let p=t.getBoundingClientRect(),g=t.offsetWidth||p.width,y=t.offsetHeight||p.height,b=p.width&&Math.abs(g-p.width)>=1?g/p.width:1,w=p.height&&Math.abs(y-p.height)>=1?y/p.height:1;i={x:(o.left-p.left)*b,y:(o.top-p.top)*w,width:o.width*b,height:o.height*w}}try{s=await Jt(t,r,e)}catch(p){throw console.warn("[SnapDOM] Capture failed while copying the element.",p),p}finally{l(),u()}ss(r.nodeMap,t.ownerDocument||document),r.slicer?.due()&&await r.slicer.pause();try{Os(s,void 0,t)}catch(p){console.warn("[SnapDOM] Couldn't copy external SVG icons; some may be missing.",p)}try{await Ie(t,s,r,e)}catch(p){console.warn("[SnapDOM] Couldn't copy ::before/::after content; some decorations may be missing.",p)}await Fn(s,r);for(let[p,g]of r.nodeMap.entries())if(g?.tagName==="STYLE"&&p?.tagName==="STYLE"&&!p.hasAttribute("data-sd"))try{let y=g.sheet&&g.sheet.cssRules;y&&/@media/i.test(p.textContent||"")&&(p.textContent=le(y))}catch{}try{let p=s.querySelectorAll("style[data-sd]");for(let g of p)c+=g.textContent||"",g.remove()}catch(p){H(r,"Couldn't copy shadow DOM styles.",p)}r.slicer?.due()&&await r.slicer.pause();let f=Ze(r.styleMap);a=Array.from(f.entries()).map(([p,g])=>`.${g}{${p}}`).join("");let h=c+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+(r.__usesPlaceholder?au:"")+(r.__pseudoCSS||"");a=h+a;for(let[p,g]of r.styleMap.entries())vo(p,g,f);try{cu(t,s,r.nodeMap)}catch(p){H(r,"Couldn't bring an open dialog or popover into the capture.",p)}if((r.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let p=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};Xs(t,s,r.nodeMap,r.styleCache,p)}catch(p){H(r,"Couldn't keep fixed-position elements in place.",p)}for(let[p,g]of r.nodeMap.entries())r.clip&&g===t&&t===t.ownerDocument.scrollingElement||Co(p,g,r.nodeMap,r.styleCache);let m=t.ownerDocument;if((t===m.body||t===m.documentElement)&&m.documentElement.localName==="html"){let p=r.styleCache.get(m.documentElement)||O(m.documentElement);t===m.documentElement&&(s.style.overflow="visible");let g=t===m.body?s:s.querySelector("body");if(g&&p.overflowX==="visible"&&p.overflowY==="visible"&&p.contain==="none"&&!p.containerType?.includes("size")&&p.contentVisibility!=="auto"&&p.contentVisibility!=="hidden"){let y=r.styleCache.get(m.body)||O(m.body);y.contain==="none"&&!y.containerType?.includes("size")&&y.contentVisibility!=="auto"&&y.contentVisibility!=="hidden"&&y.display!=="none"&&(g.style.overflow="visible")}}if(t===r.nodeMap.get(s)){let p=r.styleCache.get(t)||O(t);r.styleCache.set(t,p);let g=Mr(p.transform);s.style.margin="0",s.style.top="auto",s.style.left="auto",s.style.right="auto",s.style.bottom="auto",s.style.animation="none",s.style.transition="none",s.style.willChange="auto",s.style.float="none",s.style.clear="none",s.style.transform=g||"",s.style.translate="none"}for(let[p,g]of r.nodeMap.entries())g.tagName==="PRE"&&(p.style.marginTop="0",p.style.marginBlockStart="0");return{clone:s,classCSS:a,classPrefixCSS:h,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}function cu(t,e,n){let r=[];for(let s of[":modal",":popover-open"])try{r.push(...t.querySelectorAll(s))}catch{}if(!r.length)return;let i=new Map;for(let[s,a]of n.entries())i.set(a,s);let o=214748e4;for(let s of r){let a=i.get(s);if(!(!a||a===e||a.parentNode==null)){try{let c=getComputedStyle(s,"::backdrop"),u=c.backgroundColor,l=c.backgroundImage;if(u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"||l&&l!=="none"){let d=document.createElement("div");d.setAttribute("data-sd-backdrop",""),d.style.cssText=`position:fixed;inset:0;z-index:${o};background-color:${u};`+(l&&l!=="none"&&l.includes("data:")?`background-image:${l};`:""),e.appendChild(d)}}catch{}o+=1,a.style.zIndex=String(o),e.appendChild(a),o+=1}}}function vo(t,e,n){if(t.tagName==="STYLE")return;if(t.getRootNode&&Ot(t.getRootNode())){t.setAttribute("style",e.replace(/;/g,"; "));return}let r=n.get(e);r&&t.classList.add(r);let i=t.style?.backgroundImage,o=t.dataset?.snapdomHasIcon;i&&i!=="none"&&(t.style.backgroundImage=i),o&&(t.style.verticalAlign="middle",t.style.display="inline")}function Co(t,e,n,r){let i=e.scrollLeft,o=e.scrollTop;if(!(i||o)||t?.nodeType!==1||t.namespaceURI!=="http://www.w3.org/1999/xhtml")return;t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";try{let c=t.querySelectorAll("*");for(let u of c){if(u.nodeType!==1||u.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let l=n?.get(u),f=l&&(r?.get(l)||O(l)),d=u.style.position||f?.position;if(d!=="fixed"&&d!=="absolute")continue;let h=f&&f.position!=="absolute"&&d==="absolute",m=null;if(l&&!h)for(let y=l.parentElement||l.getRootNode()?.host;y;y=y.parentElement||y.getRootNode()?.host){let b=r?.get(y)||O(y);if(d==="absolute"&&b.position!=="static"||b.transform&&b.transform!=="none"||b.translate&&b.translate!=="none"||b.rotate&&b.rotate!=="none"||b.scale&&b.scale!=="none"||b.filter&&b.filter!=="none"||b.backdropFilter&&b.backdropFilter!=="none"||b.perspective&&b.perspective!=="none"||/transform|perspective|filter/.test(b.willChange||"")||/layout|paint|strict|content/.test(b.contain||"")){m=y;break}if(y===e)break}if(m){m===e&&(u.style.top=f.top,u.style.left=f.left,u.style.right=f.right,u.style.bottom=f.bottom);continue}let p=parseFloat(u.style.top||f?.top)||0,g=parseFloat(u.style.left||f?.left)||0;u.style.top=`${p+o}px`,u.style.left=`${g+i}px`,d==="fixed"&&(u.style.position="absolute")}}catch{}let a=document.createElement("div");for(a.style.all="unset",a.style.transform=`translate(${-i}px, ${-o}px)`,a.style.willChange="transform",a.style.display="inline-block",a.style.width="100%";t.firstChild;)a.appendChild(t.firstChild);t.appendChild(a)}we();oe();yt();var na="http://www.w3.org/1999/xlink";function lu(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(na,"href"):null)}function fu(t){let e=parseFloat(t.dataset?.snapdomWidth||"")||0,n=parseFloat(t.dataset?.snapdomHeight||"")||0,r=parseInt(t.getAttribute("width")||"",10)||0,i=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,s=parseFloat(t.style?.height||"")||0,a=e||o||r||t.width||t.naturalWidth||100,c=n||s||i||t.height||t.naturalHeight||100;return{width:a,height:c}}async function Gn(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let r=async a=>{if(!a.getAttribute("src")){let m=a.currentSrc||a.src||Pe(a.getAttribute("srcset"),a)||"";m&&a.setAttribute("src",m)}if(a.removeAttribute("srcset"),a.removeAttribute("sizes"),(a.getAttribute("src")||"").startsWith("data:")){a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let c=a.src||"";if(!c)return;let u=I.image?.get(c);if(u){a.src=u,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let l=await ft(c,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){I.image?.set(c,l.data),a.src=l.data,l.blob&&(a.__snapdomBlob=l.blob),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:f,height:d}=fu(a),{fallbackURL:h}=e||{};if(h)try{let m=typeof h=="function"?await h({width:f,height:d,src:c,element:a}):h;if(m){let p=await ft(m,{as:"dataURL",useProxy:e.useProxy});if(p?.ok&&typeof p.data=="string"){a.src=p.data,a.width||(a.width=f),a.height||(a.height=d);return}}}catch{}if(e.placeholders!==!1){At(e.__session,"image-fallback",`image failed to inline, using placeholder: ${c}`);let m=document.createElement("div");m.style.cssText=[`width:${f}px`,`height:${d}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${d}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),m.textContent="img",a.replaceWith(m)}else{let m=document.createElement("div");m.style.cssText=`display:inline-block;width:${f}px;height:${d}px;visibility:hidden;`,a.replaceWith(m)}},i=6;for(let a=0;a<n.length;a+=i){let c=n.slice(a,a+i).map(r);await Promise.allSettled(c)}let o=Array.from(t.querySelectorAll("image"));t.localName==="image"&&o.unshift(t);let s=async a=>{let c=lu(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let u=await ft(c,{as:"dataURL",useProxy:e.useProxy});u.ok&&typeof u.data=="string"&&u.data.startsWith("data:")&&(a.setAttribute("href",u.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(na,"href"))};for(let a=0;a<o.length;a+=i){let c=o.slice(a,a+i).map(s);await Promise.allSettled(c)}}mt();St();var uu=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],du=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],pu=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],hu=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function mu(t,e,n,r){let i=n.get(t)||O(t);n.has(t)||n.set(t,i);let o=$i(t),s=o?m=>m in o?o[m]:"":m=>i.getPropertyValue(m),a=s("border-image"),c=s("border-image-source"),u=a&&a!=="none"||c&&c!=="none",l=i.getPropertyValue("background-image"),f=s("background-color"),d=l&&l!=="none"||f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""),h=wt()&&(s("background-clip")||s("-webkit-background-clip")||"").includes("text");if(d&&!h)for(let m of pu){let p=s(m);p&&e.style.setProperty(m,p)}for(let m of uu){if(h&&m==="background-image")continue;let p=i.getPropertyValue(m);if(m==="background-image"&&(!p||p==="none")){let b=i.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(p=Xt(b).filter(w=>/url\s*\(/.test(w)).join(", ")||p)}if(!p||p==="none")continue;let g=Xt(p),y=await Promise.all(g.map(b=>Se(b,r)));y.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&e.style.setProperty(m,y.join(", "))}for(let m of du){let p=s(m);!p||p==="initial"||e.style.setProperty(m,p)}if(u)for(let m of hu){let p=s(m);!p||p==="initial"||e.style.setProperty(m,p)}if(d&&/fixed/.test(s("background-attachment")||""))try{await yu(t,e,i)}catch{}}function gu(t,e,n,r,i){let o=(t||"auto").trim();if(o==="cover"||o==="contain"){if(!e||!n)return{w:r,h:i};let d=o==="cover"?Math.max(r/e,i/n):Math.min(r/e,i/n);return{w:e*d,h:n*d}}let s=o.split(/\s+/),a=(d,h)=>{if(d==="auto"||d===void 0)return null;if(d.endsWith("px"))return parseFloat(d);if(d.endsWith("%"))return h*parseFloat(d)/100},c=a(s[0],r),u=a(s[1],i);if(c===void 0||u===void 0)return null;let l=c,f=u;return l==null&&f==null?(l=e||r,f=n||i):l==null?l=e&&n?f*(e/n):r:f==null&&(f=e&&n?l*(n/e):i),!l||!f?null:{w:l,h:f}}async function yu(t,e,n){let r=(n.getPropertyValue("background-attachment")||"").split(",").map(m=>m.trim()),i=tn();if(!i)for(let m=t.parentElement;m&&!i;m=m.parentElement){let p=O(m);(p.transform&&p.transform!=="none"||p.filter&&p.filter!=="none")&&(i=!0)}if(i){e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "));return}let o=t.getBoundingClientRect(),s=t.ownerDocument?.defaultView||window,a=s.innerWidth,c=s.innerHeight,u=Xt(e.style.backgroundImage||n.getPropertyValue("background-image")||""),l=(e.style.backgroundSize||n.getPropertyValue("background-size")||"auto").split(",").map(m=>m.trim()),f=(e.style.backgroundPosition||n.getPropertyValue("background-position")||"0% 0%").split(",").map(m=>m.trim()),d=[],h=[];for(let m=0;m<u.length;m++){let p=r[m%r.length]||"scroll",g=l[m%l.length],y=f[m%f.length];if(p!=="fixed"){d.push(g),h.push(y);continue}let b=0,w=0,v=u[m]&&u[m].match(/url\(["']?([^"')]+)["']?\)/);if(v)try{let x=new Image;x.src=v[1],await x.decode(),b=x.naturalWidth,w=x.naturalHeight}catch{d.push(g),h.push(y);continue}let C=gu(g,b,w,a,c);if(!C){d.push(g),h.push(y);continue}let S=y.split(/\s+/),M=(x,k,R)=>{if(!x)return 0;if(x.endsWith("px"))return parseFloat(x);if(x.endsWith("%"))return(k-R)*parseFloat(x)/100},_=M(S[0]||"0%",a,C.w),E=M(S[1]||S[0]||"0%",c,C.h);if(_===void 0||E===void 0){d.push(g),h.push(y);continue}d.push(`${Xn(C.w)}px ${Xn(C.h)}px`),h.push(`${Xn(_-o.left)}px ${Xn(E-o.top)}px`)}e.style.setProperty("background-size",d.join(", ")),e.style.setProperty("background-position",h.join(", ")),e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "))}var Xn=t=>Math.round(t*100)/100;async function Yn(t,e,n,r={},i=new Map){if(!e)return;let o=[];t&&Yr(t)&&o.push([t,e]);let s=[e];for(;s.length;){let c=s.pop();if(c.children)for(let u of c.children){if(u.tagName==="STYLE")continue;let l=i.get(u);l&&Yr(l)&&o.push([l,u]),s.push(u)}}let a=6;for(let c=0;c<o.length;c+=a)await Promise.allSettled(o.slice(c,c+a).map(([u,l])=>mu(u,l,n,r)))}St();function oa(t,e,n=new Map){let r=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let a=i.currentNode;a;a=i.nextNode()){let c=n.get(a);if(c?.nodeType!==1)continue;let u=O(c),l=u.getPropertyValue("backdrop-filter")||u.getPropertyValue("-webkit-backdrop-filter");l&&l!=="none"&&a!==e&&r.push({cloneEl:a,orig:c,bf:l,path:xu(e,a)})}if(!r.length)return;let o=t.getBoundingClientRect(),s=r.map((a,c)=>{let u=e.cloneNode(!0);Su(u,e,a.orig.getBoundingClientRect(),n),vu(ra(u,a.path));for(let l=0;l<c;l++){let f=ra(u,r[l].path);f&&(f.style.setProperty("backdrop-filter","none","important"),f.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...a,copy:u}});for(let{cloneEl:a,orig:c,bf:u,copy:l}of s)bu.has(a.tagName)||wu(a,c,u,l,o)}var bu=new Set(["IMG","INPUT","TEXTAREA","SELECT","CANVAS","VIDEO","AUDIO","IFRAME","EMBED","OBJECT","PROGRESS","METER","HR","BR"]);function wu(t,e,n,r,i){let o=e.getBoundingClientRect();if(!o.width||!o.height)return;let s=O(e),a=e.offsetWidth?o.width/e.offsetWidth:1,c=Math.abs(a-1)>.001?1/a:1;r.style.position="absolute",r.style.left=`${(i.left-o.left)*c}px`,r.style.top=`${(i.top-o.top)*c}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin="0",r.style.filter=n,c!==1&&(r.style.transform=`scale(${c})`,r.style.transformOrigin="top left");let u=document.createElement("div");u.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",u.appendChild(r);let l=document.createElement("div");l.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",l.style.backgroundColor=s.backgroundColor,l.style.backgroundImage=t.style.backgroundImage||s.backgroundImage;for(let f of["background-size","background-position","background-repeat","background-origin","background-clip"])l.style.setProperty(f,s.getPropertyValue(f));t.style.setProperty("background-color","transparent","important"),t.style.setProperty("background-image","none","important"),t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"),s.position==="static"&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(l),t.prepend(u)}var Kn=128;function Su(t,e,n,r){let i=[[t,e]];for(;i.length;){let[o,s]=i.pop(),a=r.get(s);if(a?.nodeType===1){let l=a.getBoundingClientRect();(l.left>n.right+Kn||l.right<n.left-Kn||l.top>n.bottom+Kn||l.bottom<n.top-Kn)&&(o.tagName==="IMG"&&o.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),o.style&&(o.style.backgroundImage="none"))}let c=o.children,u=s.children;for(let l=0;l<c.length;l++)i.push([c[l],u[l]])}}function xu(t,e){let n=[];for(let r=e;r!==t;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function ra(t,e){if(!e)return null;let n=t;for(let r of e)if(n=n.children[r],!n)return null;return n}function vu(t){if(t)for(let e=t;e&&e.parentNode;){let n=e.parentNode;for(;e.nextSibling;)e.nextSibling.remove();e===t&&e.remove(),e=n}}St();mt();yt();yt();function ko(t){return ri(t),{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map,warnings:[]}}oe();function Jn(t,e){if(!t)return()=>{};let n=[],r=200;function i(o){if(e){let u=o.getBoundingClientRect();if(u.width>0||u.height>0){let l=Math.max(u.right,u.left+(o.scrollWidth||0)),f=Math.max(u.bottom,u.top+(o.scrollHeight||0));if(l<e.left-r||u.left>e.right+r||f<e.top-r||u.top>e.bottom+r)return}}let s=getComputedStyle(o),a=Cu(o,s);a&&n.push(a);let c=ku(o,s);c&&n.push(c);for(let u of o.children||[])i(u)}return i(t),()=>n.forEach(o=>o())}function Cu(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=Mu(e);if(n<=0)return()=>{};if(!aa(t))return()=>{};let r=sa(t),i=r.text,o=_u(e);r.write("X");let s=t.scrollHeight-o;r.restore();let a=s>0?s:Au(e),c=Math.round(a*n+o);if(t.scrollHeight<=c+.5)return()=>{};let u=0,l=i.length,f=-1;for(;u<=l;){let h=u+l>>1;r.write(i.slice(0,Qn(i,h))+"\u2026"),t.scrollHeight<=c+.5?(f=h,u=h+1):l=h-1}let d=(f>=0?i.slice(0,Qn(i,f)):"")+"\u2026";return r.write(d),ia(t,d,r)}function ku(t,e){if(!t)return()=>{};if(e=e||getComputedStyle(t),e.textOverflow!=="ellipsis")return()=>{};if(e.whiteSpace!=="nowrap"&&e.whiteSpace!=="pre")return()=>{};if(e.overflowX!=="hidden"&&e.overflowX!=="clip")return()=>{};if(!aa(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=sa(t),r=n.text,i=0,o=r.length,s=-1;for(;i<=o;){let c=i+o>>1;n.write(r.slice(0,Qn(r,c))+"\u2026"),t.scrollWidth<=t.clientWidth+.5?(s=c,i=c+1):o=c-1}let a=(s>=0?r.slice(0,Qn(r,s)):"")+"\u2026";return n.write(a),ia(t,a,n)}function ia(t,e,n){return()=>{t.textContent===e&&n.restore()}}function sa(t){let e=[];for(let r=t.firstChild;r;r=r.nextSibling)r.nodeType===Node.TEXT_NODE&&e.push(r);let n=e.map(r=>r.data);return{text:n.join(""),write(r){e[0].data=r;for(let i=1;i<e.length;i++)e[i].data=""},restore(){for(let r=0;r<e.length;r++)e[r].data=n[r]}}}function Qn(t,e){if(e<=0||e>=t.length)return e;let n=t.charCodeAt(e-1);return n>=55296&&n<=56319?e-1:e}function Mu(t){let e=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");e=(e||"").trim();let n=parseInt(e,10);return Number.isFinite(n)&&n>0?n:0}function Au(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function _u(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function aa(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var We=["clone","render"],pn={clone:0,render:1},gt="render";function ca(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];if(!e.length)return{stage:gt,loweredBy:[]};let n=-1,r=[];for(let o of e){if(!o||typeof o!="object")continue;let s=o.needs===void 0?gt:o.needs;if(!Object.prototype.hasOwnProperty.call(pn,s))throw new Error(`[SnapDOM] Plugin '${o.name||"(unnamed)"}' declares needs: ${JSON.stringify(s)}, expected one of ${We.join(", ")}.`);r.push({name:o.name||"(unnamed)",needs:s}),n=Math.max(n,pn[s])}if(n<0)return{stage:gt,loweredBy:[]};let i=We[n];return{loweredBy:i===gt?[]:r.filter(o=>o.needs===i).map(o=>o.name),stage:i}}function Be(t,e){return pn[t]>=pn[e]}function la(t,e,n=We){let r=n[n.length-1];if(e==null)return r;if(!Object.prototype.hasOwnProperty.call(pn,e))throw new Error(`[SnapDOM] ${t}: needs must be one of ${We.join(", ")}, got ${JSON.stringify(e)}.`);if(!n.includes(e))throw new Error(`[SnapDOM] ${t} cannot run at stage '${e}'; it supports ${n.join(", ")}.`);return e}function fa(t,e,n){let r=e.length?e.map(i=>`'${i}'`).join(", "):"the attached plugins";return new Error(`[SnapDOM] No ${n}: this capture stopped at '${t}' because ${r} asked for needs: '${t}'. It is not re-captured, since that would be a different instant. Ask the plugin for needs: 'render', or capture without it.`)}var Ue=[];function ze(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function Mo(...t){let e=t.flat();for(let n of e){let r=ze(n);if(r){if(r.needs!==void 0&&r.needs!==gt)throw new Error(`[SnapDOM] '${r.name||"(unnamed)"}' declares needs: ${JSON.stringify(r.needs)}, so it can't be a global plugin (it would stop every capture before '${gt}'). Pass it per capture: snapdom(el, { plugins: [...] }).`);Ue.some(i=>i&&i.name&&r.name&&i.name===r.name)||Ue.push(r)}}}function ua(t){return t&&Array.isArray(t.plugins)?t.plugins:Ue}async function Bt(t,e,n){let r=n,i=ua(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,r);typeof a<"u"&&(r=a)}return r}async function Zn(t,e,n){let r=[],i=ua(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,n);typeof a<"u"&&r.push(a)}return r}function Eu(){Ue.length=0}var Ru=0;function Fu(t){let e=[];if(Array.isArray(t))for(let n of t){let r=ze(n);if(!r)continue;r.name||(r.name=`anonymous-${++Ru}`);let i=e.findIndex(o=>o&&o.name===r.name);i>=0&&e.splice(i,1),e.push(r)}for(let n of Ue)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function da(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Fu(e)),t}function Ao(){return Ue.slice()}var Tu=["resolveNode","beforeSnap","beforeClone","afterClone","beforeRender","afterRender"];function tr(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];for(let n of e){let r=ze(n);if(!(!r||r.pure===!0)){for(let i of Tu)if(typeof r[i]=="function")return!0}}return!1}yt();ke();var de="data-snapdom-asset",ga="http://www.w3.org/1999/xlink",Pu=0;function nr(t,e,n,r,i,o){let s=o.__compressedAssets||=new WeakMap,a=s.get(t);a||(a={token:String(++Pu),properties:[]},s.set(t,a),t.setAttribute(de,a.token));let c=a.properties.find(u=>u.kind===e&&u.name===n);c?(c.compressed!==r&&(c.original=r),c.compressed=i):a.properties.push({kind:e,name:n,original:r,compressed:i})}var ya=(t,e)=>e.kind==="style"?t.style?.getPropertyValue(e.name):t.getAttribute(e.name);function rr(t,e){let n=new Map;if(!t||!e)return n;let r=[t,...t.querySelectorAll(`[${de}]`)];for(let i of r){let o=e.get(i);if(!o||i.getAttribute(de)!==o.token)continue;let s=o.properties.filter(a=>ya(i,a)===a.compressed).map(a=>Object.freeze({...a}));s.length&&n.set(o.token,Object.freeze(s))}return n}function or(t,e){if(!t||!e)return;let n=0;for(let r of[t,...t.querySelectorAll(`[${de}]`)]){let i=e.get(r);i&&(i.token=String(++n),r.setAttribute(de,i.token))}}function ba(t,e){if(!e?.size||typeof t!="string"||!t.startsWith("data:image/svg+xml"))return t;let n=t.indexOf(","),r=new DOMParser().parseFromString(decodeURIComponent(t.slice(n+1)),"image/svg+xml");if(r.querySelector("parsererror"))return t;let i=!1;for(let o of r.querySelectorAll(`[${de}]`))for(let s of e.get(o.getAttribute(de))||[])ya(o,s)===s.compressed&&(s.kind==="style"?o.style.setProperty(s.name,s.original,o.style.getPropertyPriority(s.name)):s.name==="xlink:href"?o.setAttributeNS(ga,s.name,s.original):o.setAttribute(s.name,s.original),i=!0);return i?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`:t}function pa(t){if(t.is2D===!1)return 1/0;let e=t.a*t.a+t.b*t.b+t.c*t.c+t.d*t.d,n=t.a*t.d-t.b*t.c;return Math.sqrt((e+Math.sqrt(Math.max(0,e*e-4*n*n)))/2)}function _o(t,e){let n=e.element||t,r=n.isConnected?O(n):n.style,i=e.__compressionClip,o=(h,m)=>{try{return h[m]?.baseVal?.value||0}catch{return 0}},s=i?.width||n.offsetWidth||parseFloat(r?.width)||o(n,"width"),a=i?.height||n.offsetHeight||parseFloat(r?.height)||o(n,"height"),c=Number.isFinite(e.width),u=Number.isFinite(e.height);if(!i&&(c||u)&&s&&a)try{let h=e.outerTransforms===!1&&e.__compressionRootTransform?e.__compressionRootTransform:Zt({baseTransform:r?.transform,rotate:r?.rotate,scale:r?.scale,width:s,height:a});if(h.is2D===!1)s=0,a=0;else{let m=Math.abs(h.a)*s+Math.abs(h.c)*a,p=Math.abs(h.b)*s+Math.abs(h.d)*a;s=Math.min(s,m),a=Math.min(a,p)}}catch{s=0,a=0}let l=(c||u?Math.max(c?s?e.width/s:1/0:0,u?a?e.height/a:1/0:0):e.scale||1)*(e.dpr||1);e.__compressionDensity=l;let f=new WeakMap,d=h=>{if(!h||h.nodeType!==1)return 1;if(f.has(h))return f.get(h);let m=h.isConnected?O(h):h.style,p=1;try{m?.perspective&&m.perspective!=="none"&&(p=1/0);let g=m?.transform;if(g&&g!=="none")p*=pa(new DOMMatrix(g));else if(h.transform?.baseVal?.numberOfItems){let y=new DOMMatrix;for(let b=0;b<h.transform.baseVal.numberOfItems;b++){let w=h.transform.baseVal.getItem(b).matrix;y=y.multiply(new DOMMatrix([w.a,w.b,w.c,w.d,w.e,w.f]))}p*=pa(y)}if(m?.scale&&m.scale!=="none"){let y=m.scale.trim().split(/\s+/).map(b=>parseFloat(b)/(b.endsWith("%")?100:1));p*=Math.max(...y.map(Math.abs))}if(h!==n&&m?.zoom&&m.zoom!=="normal"&&(p*=parseFloat(m.zoom)||1),h.localName==="svg"&&h.viewBox?.baseVal?.width>0&&h.viewBox.baseVal.height>0){let y=h.viewBox.baseVal,b=C=>/^\d+(?:\.\d+)?px$/.test(m?.[C]||"")?parseFloat(m[C]):o(h,C),w=b("width"),v=b("height");p*=w>0&&v>0?Math.max(w/y.width,v/y.height):1/0}}catch{p=1/0}return Number.isFinite(p)||(p=1/0),h!==n&&(p*=d(h.parentElement||h.getRootNode?.().host)),f.set(h,p),p};return{density:l,stretch:d}}var wa=.92,Sa=1;async function $u(t){let e=new Image;return e.decoding="sync",e.src=t,typeof e.decode=="function"?(await e.decode(),e):(await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=r}),e)}function Nu(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}var Lu=64*1024,ha=32*1024*1024,er=new Map;function Iu(t,e,n,r){if(n.length+(r?.length||0)>ha)return;t.set(e,{source:n,result:r});let i=0;for(let o of t.values())i+=o.source.length+(o.result?.length||0);for(;i>ha;){let o=t.keys().next().value,s=t.get(o);i-=s.source.length+(s.result?.length||0),t.delete(o)}}function Ou(t,e){let n=t.indexOf(",");if(n<0||!/;base64/i.test(t.slice(0,n)))return null;let r=Math.ceil(e/3)*4,i=t.length-n-1,o=Math.min(i,r);try{let s=atob(t.slice(n+1,n+1+o-o%4)),a=new Uint8Array(s.length);for(let c=0;c<s.length;c++)a[c]=s.charCodeAt(c);return a}catch{return null}}function Du(t){let e=Ou(t,4096);if(!e||e.length<16)return null;let n=r=>e[r]<<8|e[r+1];if(e[0]===137&&e[1]===80&&e.length>=24)return{w:(e[16]<<24|e[17]<<16|e[18]<<8|e[19])>>>0,h:(e[20]<<24|e[21]<<16|e[22]<<8|e[23])>>>0};if(e[0]===71&&e[1]===73&&e[2]===70)return{w:e[6]|e[7]<<8,h:e[8]|e[9]<<8};if(e[0]===82&&e[1]===73&&e[8]===87&&e.length>=30){let r=e[15];if(r===32&&e[23]===157)return{w:(e[26]|e[27]<<8)&16383,h:(e[28]|e[29]<<8)&16383};if(r===76)return{w:(e[21]|(e[22]&63)<<8)+1,h:((e[22]>>6|e[23]<<2|(e[24]&15)<<10)&16383)+1};if(r===88)return{w:(e[24]|e[25]<<8|e[26]<<16)+1,h:(e[27]|e[28]<<8|e[29]<<16)+1}}if(e[0]===255&&e[1]===216){let r=2;for(;r+9<e.length;){if(e[r]!==255){r++;continue}let i=e[r+1];if(i===216||i===1||i>=208&&i<=215){r+=2;continue}if(i>=192&&i<=207&&i!==196&&i!==200&&i!==204)return{h:n(r+5),w:n(r+7)};let o=n(r+2);if(o<2)break;r+=2+o}}return null}function ma(t,e,n,r){let i=Math.min(1,Math.max(n/t,r/e));return!(i>0)||i>=.95?0:i}var Wu=`self.onmessage = async (e) => {
|
|
15
|
+
`):c+=d[0]}return c+=a.slice(u),c}let s=bs(t,e||location.href);return s=await o(s,e||location.href,0),s}var ks=/url\((["']?)([^"')]+)\1\)/g,Af=/@font-face[^{}]*\{[^}]*\}/g;function _t(t,e,n=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function Ms(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let i=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let o=i[1],s=i[2],a=l=>{if(!l.includes("?"))return parseInt(l,16);let f=parseInt(l.replace(/\?/g,"0"),16),c=parseInt(l.replace(/\?/g,"F"),16);return[f,c]};if(s){let l=a(o),f=a(s),c=Array.isArray(l)?l[0]:l,u=Array.isArray(f)?f[1]:f;e.push([Math.min(c,u),Math.max(c,u)])}else{let l=a(o);Array.isArray(l)?e.push([l[0],l[1]]):e.push([l,l])}}return e}function As(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,i]of e)if(n>=r&&n<=i)return!0;return!1}function so(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(ks)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,e||location.href).href}catch{}n.push(i)}}return n}async function ro(t,e,n=""){let r=t;for(let i of t.matchAll(ks)){let o=ie(i[0]);if(!o)continue;let s=o;if(!s.startsWith("http")&&!s.startsWith("data:"))try{s=new URL(s,e||location.href).href}catch{}if(D.resource?.has(s)){r=r.replace(i[0],`url(${D.resource.get(s)})`);continue}try{let a=await ft(s,{as:"dataURL",useProxy:n,silent:!0});if(a.ok&&typeof a.data=="string"){let l=a.data;D.resource?.set(s,l),r=r.replace(i[0],`url(${l})`)}}catch{console.warn("[SnapDOM] Couldn't load font file:",s)}}return r}function _f(t){if(!t.length)return null;let e=(a,l)=>t.some(([f,c])=>!(c<a||f>l)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),i=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function ws(t={}){let e=new Set((t.families||[]).map(i=>String(i).toLowerCase())),n=new Set((t.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((t.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(e.size&&e.has(i.family.toLowerCase()))return!0;if(n.size)for(let s of i.srcUrls)try{if(n.has(new URL(s).host.toLowerCase()))return!0}catch{}if(r.size){let s=_f(o);if(s&&r.has(s))return!0}return!1}}function Ef(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of t.match(e)||[]){let s=_t(o,"font-family"),a=io(s),l=_t(o,"font-weight","400"),f=_t(o,"font-style","normal"),c=_t(o,"font-stretch","100%"),u=_t(o,"unicode-range"),d=_t(o,"src"),h=so(d,location.href),m=h.length?h.map(g=>String(g).toLowerCase()).sort().join("|"):d.toLowerCase(),p=[String(a||"").toLowerCase(),l,f,c,u.toLowerCase(),m].join("|");n.has(p)||(n.add(p),r.push(o))}if(r.length===0)return t;let i=0;return t.replace(e,()=>r[i++]||"")}var Ss=new WeakMap,Rf=0;function Ff(t){let e=Ss.get(t);return e===void 0&&(e=Rf++,Ss.set(t,e)),e}function Tf(t,e,n,r,i,o,s,a,l){let f=Array.from(t||[]).sort().join("|"),c=0,u=0;for(let b of s||[]){let w=Math.imul(b,2654435761);w^=w>>>15,w=Math.imul(w,2246822507),w^=w>>>13,c=c+w|0,u++}let d=e?JSON.stringify({families:(e.families||[]).map(b=>String(b).toLowerCase()).sort(),domains:(e.domains||[]).map(b=>String(b).toLowerCase()).sort(),subsets:(e.subsets||[]).map(b=>String(b).toLowerCase()).sort()}):"",h=(n||[]).map(b=>`${(b.family||"").toLowerCase()}::${b.weight||"normal"}::${b.style||"normal"}::${b.stretchPct??100}::${b.src||""}`).sort().join("|"),m=r||"",p=(i||[]).map(b=>String(b).toLowerCase()).sort().join("|"),g=Ff(o||document),y=(a||[]).map(b=>String(b)).sort().join("|");return`fonts-embed-css::req=${f}::ex=${d}::lf=${h}::px=${m}::fd=${p}::doc=${g}::cp=${c}::n=${u}::ic=${y}::env=${l}`}async function oo(t,e,n,r){let i=r.doc?.defaultView||window;if(t.disabled||t.media?.mediaText&&!i.matchMedia(t.media.mediaText).matches)return;let o;try{o=t.cssRules||[]}catch{return}let s=(a,l)=>{try{return new URL(a,l||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let l=a.href?s(a.href,e):e;if(r.depth>=Bn){console.warn(`[SnapDOM] Too many nested @import rules in ${l}; stopped at ${Bn} levels.`);continue}if(l&&r.visitedSheets.has(l)){console.warn(`[SnapDOM] Skipped an @import that loops back: ${l}`);continue}l&&r.visitedSheets.add(l);let f={...r,depth:(r.depth||0)+1};await oo(a.styleSheet,l,n,f);continue}if(a.cssRules?.length){if(a.type===CSSRule.MEDIA_RULE&&!i.matchMedia(a.conditionText).matches||a.type===CSSRule.SUPPORTS_RULE&&!i.CSS.supports(a.conditionText))continue;await oo(a,e,n,r);continue}if(a.type===CSSRule.FONT_FACE_RULE){let l=(a.style.getPropertyValue("font-family")||"").trim(),f=io(l);if(!f||Lt(f,r.iconMatchers))continue;let c=(a.style.getPropertyValue("font-weight")||"").trim(),u=(a.style.getPropertyValue("font-style")||"").trim(),d=(a.style.getPropertyValue("font-stretch")||"").trim(),h=(a.style.getPropertyValue("font-variation-settings")||"").trim(),m=(a.style.getPropertyValue("src")||"").trim(),p=(a.style.getPropertyValue("unicode-range")||"").trim(),g=c||"400",y=u||"normal",b=d||"100%",w=(u?`font-style:${u};`:"")+(c?`font-weight:${c};`:"")+(d?`font-stretch:${d};`:"")+(h?`font-variation-settings:${h};`:"")+(p?`unicode-range:${p};`:""),x=r.faceMatchesRequired(f,y,g,b);if(!x&&!r.requiredIndex.has(f.toLowerCase()))continue;let C=Ms(p);if(!As(r.usedCodepoints,C))continue;let S={family:f,weightSpec:g,styleSpec:y,stretchSpec:b,unicodeRange:p,srcRaw:m,srcUrls:so(m,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(S,C))continue;if(!x){r.provisionalFaces.push({family:f.toLowerCase(),block:`@font-face{font-family:${f};src:${m};${w}}`,srcRaw:m,baseHref:e||location.href});continue}r.coveredFamilies.add(f.toLowerCase());let M=`"${String(f).replace(/^\s*["']|["']\s*$/g,"").replace(/(["\\])/g,"\\$1")}"`;if(/url\(/i.test(m)){let _=await ro(m,e||location.href,r.useProxy);await n(`@font-face{font-family:${M};src:${_};${w}}`)}else await n(`@font-face{font-family:${M};src:${m};${w}}`)}}}async function _s({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[],iconMatchers:s=[],doc:a=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let l=new Map;for(let S of t){let[M,_,E,v]=String(S).split("__");if(!M)continue;let k=M.toLowerCase(),R=l.get(k)||[];R.push({w:parseInt(_,10),s:E,st:parseInt(v,10)}),l.set(k,R)}function f(S,M,_,E){let v=String(S).toLowerCase();if(!l.has(v))return!1;let k=l.get(v),R=wf(_),F=Sf(M),$=xf(E),I=R.min!==R.max,P=R.min,A=N=>F.kind==="normal"&&N==="normal"||F.kind!=="normal"&&(N==="italic"||N==="oblique"),L=!1;for(let N of k){let T=I?N.w>=R.min&&N.w<=R.max:N.w===P,z=A(Wn(N.s)),q=N.st>=$.min&&N.st<=$.max;if(T&&z&&q){L=!0;break}}if(L)return!0;if(!I)for(let N of k){let T=A(Wn(N.s)),z=N.st>=$.min&&N.st<=$.max;if(Math.abs(P-N.w)<=300&&T&&z)return!0}if(!I&&F.kind==="normal"&&k.some(T=>Wn(T.s)!=="normal"))for(let T of k){let z=Math.abs(P-T.w)<=300,q=T.st>=$.min&&T.st<=$.max;if(z&&q)return!0}return!1}let c=ws(n);Ee(a),Pt();let u=Tf(t,n,r,i,o,a,e,s,Ee(a));if(D.resource?.has(u))return D.resource.get(u);let d=kf(t),h=[],m=Cs;for(let S of a.querySelectorAll("style")){let M=S.textContent||"";for(let _ of M.matchAll(m)){let E=(_[2]||_[4]||"").trim();if(!E||no(E,s))continue;a.querySelector(`link[rel="stylesheet"][href="${E}"]`)||h.push(E)}}let p=[];h.length&&await Promise.all(h.map(S=>new Promise(M=>{if(a.querySelector(`link[rel="stylesheet"][href="${S}"]`))return M(null);let _=a.createElement("link");_.rel="stylesheet",_.href=S,Z(_),_.setAttribute("data-snapdom","injected-import");let E=setTimeout(()=>M(null),3e3),v=k=>{clearTimeout(E),M(k)};_.onload=()=>v(_),_.onerror=()=>v(null),a.head.appendChild(_),p.push(_)})));let g="",y=new Set,b=[],w=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(S=>!!S.href);for(let S of p)try{S.remove()}catch{}for(let S of w)try{if(no(S.href,s))continue;let M="",_=!1;try{_=new URL(S.href,location.href).origin===location.origin}catch{}if(!_){let v=Array.isArray(o)?o:[];if(!Cf(S.href,d,v))continue}if(_){let v=Array.from(a.styleSheets).find(k=>k.href===S.href);if(v)try{let k=v.cssRules||[];M=Array.from(k).map(R=>R.cssText).join("")}catch{}}if(!M){let v=await ft(S.href,{as:"text",useProxy:i});v?.ok&&typeof v.data=="string"&&(M=v.data)}M=await Mf(M,S.href,i);let E="";for(let v of M.match(Af)||[]){let k=_t(v,"font-family"),R=io(k);if(!R||Lt(R,s))continue;let F=_t(v,"font-weight","400"),$=_t(v,"font-style","normal"),I=_t(v,"font-stretch","100%"),P=_t(v,"unicode-range"),A=_t(v,"src"),L=so(A,S.href),N=f(R,$,F,I);if(!N&&!l.has(R.toLowerCase()))continue;let T=Ms(P);if(!As(e,T))continue;let z={family:R,weightSpec:F,styleSpec:$,stretchSpec:I,unicodeRange:P,srcRaw:A,srcUrls:L,href:S.href};if(n&&c(z,T))continue;if(!N){b.push({family:R.toLowerCase(),block:v,srcRaw:A,baseHref:S.href});continue}y.add(R.toLowerCase());let q=/url\(/i.test(A)?await ro(v,S.href,i):v;E+=q}E.trim()&&(g+=E)}catch{console.warn("[SnapDOM] Couldn't read stylesheet:",S.href)}let x={doc:a,requiredIndex:l,usedCodepoints:e,faceMatchesRequired:f,coveredFamilies:y,provisionalFaces:b,simpleExcluder:n?ws(n):null,useProxy:i,iconMatchers:s,visitedSheets:new Set,depth:0},C=new Set([...a.styleSheets,...a.adoptedStyleSheets||[]]);for(let S of C)if(!(S.href&&w.some(M=>M.href===S.href)))try{let M=S.href||a.baseURI||location.origin+"/";M&&x.visitedSheets.add(M),await oo(S,M,async _=>{g+=_},x)}catch{}for(let S of b)y.has(S.family)||(g+=/url\(/i.test(S.srcRaw)?await ro(S.block,S.baseHref,i):S.block);try{for(let S of a.fonts||[]){if(!S||!S.family||S.status!=="loaded"||!S._snapdomSrc)continue;let M=String(S.family).replace(/^['"]+|['"]+$/g,"");if(Lt(M,s)||!l.has(M.toLowerCase())||n?.families&&n.families.some(E=>String(E).toLowerCase()===M.toLowerCase()))continue;let _=S._snapdomSrc;if(!String(_).startsWith("data:"))if(D.resource?.has(S._snapdomSrc))_=D.resource.get(S._snapdomSrc);else try{let E=await ft(S._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(E.ok&&typeof E.data=="string")_=E.data,D.resource?.set(S._snapdomSrc,_);else continue}catch{console.warn("[SnapDOM] Couldn't load font file:",S._snapdomSrc);continue}g+=`@font-face{font-family:'${M}';src:url(${_});font-style:${S.style||"normal"};font-weight:${S.weight||"normal"};}`}}catch{}for(let S of r){if(!S||typeof S!="object")continue;let M=String(S.family||"").replace(/^['"]+|['"]+$/g,"");if(!M||Lt(M,s)||!l.has(M.toLowerCase())||n?.families&&n.families.some(F=>String(F).toLowerCase()===M.toLowerCase()))continue;let _=S.weight!=null?String(S.weight):"normal",E=S.style!=null?String(S.style):"normal",v=S.stretchPct!=null?`${S.stretchPct}%`:"100%",k=String(S.src||""),R=k;if(!R.startsWith("data:"))if(D.resource?.has(k))R=D.resource.get(k);else try{let F=await ft(k,{as:"dataURL",useProxy:i,silent:!0});if(F.ok&&typeof F.data=="string")R=F.data,D.resource?.set(k,R);else continue}catch{console.warn("[SnapDOM] Couldn't load font file from localFonts:",k);continue}g+=`@font-face{font-family:'${M}';src:url(${R});font-style:${E};font-weight:${_};font-stretch:${v};}`}return g&&(g=Ef(g),D.resource?.set(u,g)),g}function Un(t,e){let n=new Set,r=new Set;if(!t)return{required:n,usedCodepoints:r};let i=c=>{if(c)for(let u of c)r.add(u.codePointAt(0))},o=c=>{let u=yf(c.fontFamily);if(u.length)for(let d of u)n.add(`${d}__${Dn(c.fontWeight)}__${Wn(c.fontStyle)}__${bf(c.fontStretch)}`)},s=Te(t),a=t.getRootNode(),l=c=>{o(O(c));let u=c.getRootNode()===a?s:Te(c);for(let d of["::before","::after"]){let h=d==="::before"?u.before:u.after;if(h!==null){if(h==="")continue;try{if(!c.matches(h))continue}catch{}}let m=O(c,d),p=m&&m.content;if(!(!p||p==="none"||p==="normal"))if(o(m),/^["']/.test(p))i(p.slice(1,-1));else{let g=p.match(/\\[0-9A-Fa-f]{1,6}/g);if(g)for(let y of g)try{r.add(parseInt(y.slice(1),16))}catch{}}}},f=[t];for(let c=0;c<f.length;c++){let u=f[c];u.nodeType===Node.ELEMENT_NODE&&l(u),u.shadowRoot&&f.push(u.shadowRoot);let d=(t.ownerDocument||document).createTreeWalker(u,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;d.nextNode();){let h=d.currentNode;if(h.nodeType===Node.TEXT_NODE){if(e&&h.parentElement&&!e(h.parentElement))continue;i(h.nodeValue||"")}else{if(e&&!e(h))continue;l(h),h.shadowRoot&&f.push(h.shadowRoot)}}}return{required:n,usedCodepoints:r}}async function zn(t,e=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(t||[]).filter(Boolean);if(r.length===0)return;let i=()=>{let o=n.createElement("div");Z(o),o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let s of r){let a=n.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${s}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}n.body.appendChild(o),o.offsetWidth,n.body.removeChild(o)};for(let o=0;o<Math.max(1,e);o++)i(),await bt(),await bt()}kt();function Ts(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Es(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function Rs(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,t)),i="";for(let[o,s]of n)for(;r>=o;)i+=s,r-=o;return e?i:i.toLowerCase()}function Fs(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":case"lower-latin":return Es(t,!1);case"upper-alpha":case"upper-latin":return Es(t,!0);case"lower-roman":return Rs(t,!1);case"upper-roman":return Rs(t,!0);default:return String(t)}}function dn(t,e){let n=(t||"").trim().split(/[\s,]+/).filter(Boolean),r=[];for(let i=0;i<n.length;i++){let o=n[i];if(o==="none")continue;let s=n[i+1],a=s!==void 0&&Number.isFinite(Number(s));r.push([o,a?Number(s):e]),a&&i++}return r}function Ps(t){let e=new WeakMap,n=Fr(t)?t.documentElement:t,r=f=>f&&f.tagName==="LI",i=new WeakMap,o=f=>{let c=new Map;for(let[u,d]of f)c.set(u,d.slice());return c},s=(f,c,u)=>{let d=o(f),h;try{h=getComputedStyle(u)}catch{h=u.style}let m;try{m=h?.counterReset}catch{}if(m&&m!=="none")for(let[y,b]of dn(m,0)){let w=c.get(y);if(w&&w.length){let x=w.slice();x.push(b),d.set(y,x)}else d.set(y,[b])}let p;try{p=h?.counterSet}catch{}if(p&&p!=="none")for(let[y,b]of dn(p,0)){let w=d.get(y)||[];w.length===0&&w.push(0),w[w.length-1]=b,d.set(y,w)}let g;try{g=h?.counterIncrement}catch{}if(g&&g!=="none")for(let[y,b]of dn(g,1)){let w=d.get(y)||[];w.length===0&&w.push(0),w[w.length-1]+=b,d.set(y,w)}try{if(h?.display==="list-item"&&r(u)){let y=u.parentElement,b=y&&i.get(y),w=y?.tagName==="OL"?parseInt(y.getAttribute("start"),10):NaN,x=b===void 0?Number.isFinite(w)?w:1:b+1,C=y?.tagName==="OL"?parseInt(u.getAttribute("value"),10):NaN;Number.isFinite(C)&&(x=C),y&&i.set(y,x);let S=d.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=x,d.set("list-item",S)}}catch{}return d},a=(f,c,u)=>{let d=s(u,c,f);e.set(f,d);let h=d;for(let p of f.children)h=a(p,d,h);let m=new Map;for(let[p,g]of u){let y=g.length,b=h.get(p);m.set(p,b&&b.length?b.slice(0,y):g.slice())}for(let[p,g]of h)!m.has(p)&&g.length&&!c.has(p)&&m.set(p,g.slice(0,1));return m},l=new Map;return a(n,l,l),{get(f,c){let u=e.get(f)?.get(c);return u&&u.length?u[u.length-1]:0},getStack(f,c){let u=e.get(f)?.get(c);return u?u.slice():[]}}}function $s(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(r,(i,o,s)=>{let a=String(s).split(",").map(l=>l.trim());if(o==="counter"){let l=a[0]?.replace(/^["']|["']$/g,""),f=(a[1]||"decimal").toLowerCase(),c=n.get(e,l);return Fs(c,f)}else{let l=a[0]?.replace(/^["']|["']$/g,""),f=a[1]?.replace(/^["']|["']$/g,"")??"",c=(a[2]||"decimal").toLowerCase(),u=n.getStack(e,l);return u.length?u.map(h=>Fs(h,c)).join(f):""}})}catch{return"- "}}Se();var Ie=new WeakMap,Ns=1e3;function Pf(t,e){let n=Ds(t);return e?(e.__pseudoPreflightFp!==n&&(Pt(),e.__pseudoPreflight=Ls(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):(Pt(),Ls(t,n))}function Hn(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function Ds(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let s=0;s<e.length;s++){let a=e[s];if(a.tagName==="STYLE"){let l=a.textContent?a.textContent.length:0;n+=`S${l}|`;let f=a.sheet,c=f?Hn(f):null;c&&(r+=c.length)}else{let l=a.getAttribute("href")||"",f=a.getAttribute("media")||"all";n+=`L${l}|m:${f}|`;let c=a.sheet,u=c?Hn(c):null;u&&(r+=u.length)}}let i=t.adoptedStyleSheets,o=0;if(Array.isArray(i))for(let s of i){let a=Hn(s);a&&(o+=a.length)}return n+=`ass:${Array.isArray(i)?i.length:0}/${o}|tr:${r}`,n}function ao(t,e,n){let r=Hn(t);if(!r)return!1;for(let i=0;i<r.length;i++){if(n.budget<=0)return!1;let o=r[i],s=o&&o.cssText?o.cssText:"";n.budget--;for(let a of e)if(s.includes(a))return!0;if(o&&o.styleSheet&&ao(o.styleSheet,e,n))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let a=0;a<o.cssRules.length&&n.budget>0;a++){let l=o.cssRules[a],f=l&&l.cssText?l.cssText:"";n.budget--;for(let c of e)if(f.includes(c))return!0}if(n.budget<=0)return!1}return!1}function Ls(t=document,e=Ds(t)){let n=Ie.get(t);if(n&&n.fingerprint===e)return n.result;let r=a=>(a.match(/\|ass:[^|]*/)||[""])[0];n&&r(e)!==r(n.fingerprint)&&Re();let i=["::before","::after","::first-letter","::marker","::first-line",":before",":after",":first-letter",":first-line","counter(","counters(","counter-increment","counter-reset"],o=t.querySelectorAll("style");for(let a=0;a<o.length;a++){let l=o[a].textContent||"";for(let f of i)if(l.includes(f))return Ie.set(t,{fingerprint:e,result:!0}),!0}let s=t.adoptedStyleSheets;if(Array.isArray(s)&&s.length){let a={budget:Ns};try{for(let l of s)if(ao(l,i,a))return Ie.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let a=t.querySelectorAll('style,link[rel~="stylesheet"]'),l={budget:Ns};for(let f=0;f<a.length&&l.budget>0;f++){let c=a[f],u=null;if(c.tagName,u=c.sheet||null,u&&ao(u,i,l))return Ie.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Ie.set(t,{fingerprint:e,result:!0}),!0):(Ie.set(t,{fingerprint:e,result:!1}),!1)}function Is(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,r=t[`border${e}Style`];if(n>0&&r&&r!=="none"&&r!=="hidden")return!0}return!1}function $f(t,e){let n=null,r=()=>{if(!n)try{n=Ps(t)}catch(i){H(e,"Couldn't compute CSS counters; list numbers may be off.",i),n={get:()=>0,getStack:()=>[]}}return n};return{get(i,o){return r().get(i,o)},getStack(i,o){return r().getStack(i,o)}}}function Nf(t){let e=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r==='"')e=!e;else if(r==="/"&&!e)return t.slice(0,n).trim()}return t}function Lf(t){return t.replace(/\\(?:([0-9a-fA-F]{1,6})[ \t\n]?|([\s\S]))/g,(e,n,r)=>{if(n){let i=parseInt(n,16);return i===0||i>1114111?"\uFFFD":String.fromCodePoint(i)}return r===`
|
|
16
|
+
`?"":r})}function If(t){if(!t)return"";let e=[],n=/"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)'/g,r=0,i;for(;i=n.exec(t);){let s=t.slice(r,i.index).trim();s&&e.push(s),e.push(Lf(i[1]!==void 0?i[1]:i[2])),r=n.lastIndex}let o=t.slice(r).trim();return o&&e.push(o),e.join("")}function lo(t,e,n){let r=t.parentElement,i=r&&n?n.get(r):null;return i?{get(o,s){let a=e.get(o,s),l=i.get(s);return typeof l=="number"?Math.max(a,l):a},getStack(o,s){let a=e.getStack(o,s);if(!a.length)return a;let l=i.get(s);if(typeof l=="number"){let f=a.slice();return f[f.length-1]=Math.max(f[f.length-1],l),f}return a}}:e}function co(t,e,n){let r=new Map,i=(f,c)=>dn(f,c).map(([u,d])=>({name:u,num:d})),o=i(e?.counterReset,0),s=i(e?.counterSet,0),a=i(e?.counterIncrement,1);function l(f){if(r.has(f))return r.get(f).slice();let c=n.getStack(t,f);c=c.length?c.slice():[];let u=o.find(m=>m.name===f);if(u){let m=Number.isFinite(u.num)?u.num:0;c=c.length?[...c,m]:[m]}let d=s.find(m=>m.name===f);if(d){let m=Number.isFinite(d.num)?d.num:0;c.length===0&&(c=[0]),c[c.length-1]=m}let h=a.find(m=>m.name===f);if(h){let m=Number.isFinite(h.num)?h.num:1;c.length===0&&(c=[0]),c[c.length-1]+=m}return r.set(f,c.slice()),c}return{get(f,c){let u=l(c);return u.length?u[u.length-1]:0},getStack(f,c){return l(c)},__incs:a}}var Of=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","letter-spacing","line-height"],Df=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","font-variant","letter-spacing","word-spacing","text-transform","text-decoration-line","text-decoration-color","text-decoration-style","line-height","background-color","vertical-align"];function Os(t,e,n,r,i,o){try{if(r===null){if(t.getRootNode()!==(t.ownerDocument||document))return;let u=O(t).display||"";if(i==="::marker"?!u.includes("list-item"):!(u==="block"||u==="flow-root"||u==="list-item"||u==="inline-block"||u==="table-cell"||u==="table-caption"))return}else if(!t.matches(r))return;if(i==="::marker"&&!(O(t).display||"").includes("list-item"))return;let s=O(t,i),a=O(t);if(!s)return;let l="";for(let u of o){let d=s.getPropertyValue(u);d&&d!==a.getPropertyValue(u)&&!(u==="background-color"&&d==="rgba(0, 0, 0, 0)")&&!(u==="vertical-align"&&d==="baseline")&&(l+=`${u}:${d};`)}if(i==="::marker"){let u=s.getPropertyValue("content");u&&u!=="normal"&&u!=="none"&&(l+=`content:${u};`)}if(!l)return;let c=`data-sd-p${n.__pseudoRuleSeq=(n.__pseudoRuleSeq||0)+1}`;e.setAttribute(c,""),n.__pseudoCSS=(n.__pseudoCSS||"")+`[${c}]${i}{${l}}`}catch{}}function Wf(t,e){if(!/\b(?:no-)?(?:open|close)-quote\b/.test(t))return t;let n="\u201C",r="\u201D";try{let i=O(e).quotes;if(i==="none")n="",r="";else if(i&&i!=="auto"){let o=i.match(/"[^"]*"|'[^']*'/g);o&&o.length>=2&&(n=o[0].slice(1,-1),r=o[1].slice(1,-1))}}catch{}return n=n.replace(/"/g,""),r=r.replace(/"/g,""),t.replace(/"[^"]*"|\b(no-open-quote|no-close-quote|open-quote|close-quote)\b/g,(i,o)=>o?o==="open-quote"?`"${n}"`:o==="close-quote"?`"${r}"`:'""':i)}function Bf(t,e,n,r){let i;try{i=O(t,e)}catch{}let o=i?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};o=Nf(o),o=Wf(o,t);let s=lo(t,n,r),a=co(t,i,s),l=Ts(o)?$s(o,t,a):o;return{text:If(l),incs:a.__incs||[]}}function Uf(t,e){if(e.__shadowPseudo)return!1;let n=Te(t),r=[];for(let o of["before","after","firstLetter","marker","firstLine"]){let s=n[o];if(s===null)return!1;s&&r.push(s)}if(!r.length)return!0;let i=r.join(",");try{return!t.matches(i)&&t.querySelector(i)===null}catch{return!1}}async function Oe(t,e,n,r,i=!1){if(t?.nodeType!==1||e?.nodeType!==1||(n.slicer?.due()&&await n.slicer.pause(),t.tagName==="TEXTAREA"))return;let o=t.ownerDocument||document;if(!i&&!Pf(o,n)&&!n.__shadowPseudo||!i&&Uf(t,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=$f(t.ownerDocument||document,n));let s=n.__counterCtx,a=Te(t);a.marker!==""&&Os(t,e,n,a.marker,"::marker",Of),a.firstLine!==""&&Os(t,e,n,a.firstLine,"::first-line",Df);for(let f of["::before","::after","::first-letter"]){let c=a[f==="::before"?"before":f==="::after"?"after":"firstLetter"];if(c!==null){if(c==="")continue;try{if(!t.matches(c))continue}catch{}}try{let u=O(t,f);if(!u||u.content==="none"&&u.backgroundImage==="none"&&(u.backgroundColor==="transparent"||u.backgroundColor==="rgba(0, 0, 0, 0)")&&!Is(u)&&(!u.transform||u.transform==="none")&&u.display==="inline")continue;if(u.display==="none"||f!=="::first-letter"&&(u.content==="none"||u.content==="normal")){f==="::before"&&(e.dataset.snapdomHasBefore="1"),f==="::after"&&(e.dataset.snapdomHasAfter="1");continue}if(f==="::first-letter"){let V=O(t),G=(V?.display||"").toLowerCase();if(G.includes("flex")||G.includes("grid"))continue;let U=Vt=>u[Vt]!==V[Vt]&&(parseFloat(u[Vt])||0)!==0;if(!(u.color!==V.color||u.fontSize!==V.fontSize||u.fontWeight!==V.fontWeight||u.fontFamily!==V.fontFamily||u.fontStyle!==V.fontStyle||u.textTransform!==V.textTransform||u.float!==V.float&&u.float!=="none"||U("paddingTop")||U("paddingRight")||U("paddingBottom")||U("paddingLeft")||U("marginTop")||U("marginRight")||U("marginBottom")||U("marginLeft")))continue;let Y=Array.from(e.childNodes).find(Vt=>Vt.nodeType===Node.TEXT_NODE&&Vt.textContent?.trim().length>0);if(!Y)continue;let Ct=Y.textContent,be=/^\s*/.exec(Ct)[0],wn=Ct.slice(be.length),Ye=wn.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],vr=wn.slice(Ye?.length||0);if(!Ye||/[\uD800-\uDFFF]/.test(Ye))continue;let jt=document.createElement("span");jt.textContent=Ye,jt.dataset.snapdomPseudo="::first-letter";let Cr=ke(u,Mn(t)),kr=Ce(Cr,"span");n.styleMap.set(jt,kr);let Sn=document.createTextNode(vr);e.replaceChild(Sn,Y),e.insertBefore(jt,Sn),be&&e.insertBefore(document.createTextNode(be),jt);continue}let m=u.content??"",p=m===""||m==="none"||m==="normal",{text:g,incs:y}=Bf(t,f,s,n.__siblingCounters),b=u.backgroundImage,w=u.backgroundColor,x=u.fontFamily,C=parseInt(u.fontSize)||32,S=parseInt(u.fontWeight)||!1,M=u.fontStyle||"normal",_=u.color||"#000",E=u.transform,v=Lt(x,r?.__iconMatchers),k=!p&&g!=="",R=b&&b!=="none",F=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",$=Is(u),I=E&&E!=="none",P=m!=="none"&&m!=="normal",A=/^inline-/.test(u.display||""),L=P&&((parseFloat(u.width)||0)>0||(parseFloat(u.height)||0)>0||A),N=P&&u.boxShadow&&u.boxShadow!=="none",T=P&&u.outlineStyle&&u.outlineStyle!=="none"&&(parseFloat(u.outlineWidth)||0)>0;if(!(k||R||F||$||I||L||N||T)){if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:G}of y){if(!G)continue;let U=lo(t,s,n.__siblingCounters),Y=co(t,O(t,f),U).get(t,G);V.set(G,Y)}n.__siblingCounters.set(t.parentElement,V)}continue}let q=g.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(g),j=u.display==="inline"&&u.cssFloat==="none"&&u.position!=="absolute"&&u.position!=="fixed",J=!1;if(k&&!v&&g.length>1&&!q&&j){let V=O(t),G=parseFloat(V.fontSize)||16,U=parseFloat(V.lineHeight);Number.isFinite(U)||(U=G*1.5),t.getBoundingClientRect().height<U*1.6&&(e.style.whiteSpace="nowrap",J=!0)}let B=document.createElement("span");B.dataset.snapdomPseudo=f,B.style.pointerEvents="none",J&&(B.style.whiteSpace="nowrap");let ut=Di(t,f,u,n,r),vt=(O(t).display||"").toLowerCase(),at=vt.includes("flex")||vt.includes("grid");if(at){let V=ut["min-width"];(!V||V==="auto"||V==="0px")&&(ut["min-width"]="0px")}let st=k;st&&!j&&parseFloat(u.height)>=1.5*(parseFloat(u.lineHeight)||(parseFloat(u.fontSize)||16)*1.2)&&(st=!1,B.style.whiteSpace=u.whiteSpace);let nt=Ce(ut,"span",st,at);if(n.styleMap.set(B,nt),v&&g&&g.length===1){let{dataUrl:V,width:G,height:U}=await xs(g,x,S,C,_,M),ht=document.createElement("img");ht.src=V,ht.style=`height:${C}px;width:${G/U*C}px;object-fit:contain;`,B.appendChild(ht),e.dataset.snapdomHasIcon="true"}else if(g&&q){let V=Qe(g,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??ie(g);if(V?.trim())try{let G=await ft(Gt(V),{as:"dataURL",useProxy:r.useProxy});if(G?.ok&&typeof G.data=="string"){let U=document.createElement("img");U.src=G.data,U.style=`width:${C}px;height:auto;object-fit:contain;`,B.appendChild(U)}}catch(G){console.warn(`[SnapDOM] Couldn't draw the ${f} icon of`,t,G)}}else!v&&k&&(B.textContent=g);B.style.backgroundImage="none","maskImage"in B.style&&(B.style.maskImage="none"),"webkitMaskImage"in B.style&&(B.style.webkitMaskImage="none");try{B.style.backgroundRepeat=u.backgroundRepeat,B.style.backgroundSize=u.backgroundSize,u.backgroundPositionX&&u.backgroundPositionY?(B.style.backgroundPositionX=u.backgroundPositionX,B.style.backgroundPositionY=u.backgroundPositionY):B.style.backgroundPosition=u.backgroundPosition,B.style.backgroundOrigin=u.backgroundOrigin,B.style.backgroundClip=u.backgroundClip,B.style.backgroundAttachment=u.backgroundAttachment,B.style.backgroundBlendMode=u.backgroundBlendMode}catch{}if(R)try{let V=Yt(b),G=await Promise.all(V.map(U=>xe(U,r)));B.style.backgroundImage=G.join(", ")}catch(V){console.warn(`[SnapDOM] Couldn't load the ${f} background image.`,V)}F&&(B.style.backgroundColor=w);let pt=u.maskImage||u.webkitMaskImage;if(pt&&pt!=="none")try{let G=(await Promise.all(Yt(pt).map(U=>xe(U,r)))).join(", ");B.style.maskImage=G,B.style.webkitMaskImage=G;for(let U of["maskSize","maskRepeat","maskPosition","maskMode","maskComposite","maskOrigin","maskClip"])u[U]&&(B.style[U]=u[U])}catch(V){console.warn(`[SnapDOM] Couldn't load the ${f} mask image.`,V)}let ye=B.childNodes.length>0||B.textContent?.trim()!==""||R||F||$||I||L||N||T;if(y&&y.length&&t.parentElement){let V=n.__siblingCounters.get(t.parentElement)||new Map,G=lo(t,s,n.__siblingCounters),U=co(t,O(t,f),G);for(let{name:ht}of y){if(!ht)continue;let Y=U.get(t,ht);V.set(ht,Y)}n.__siblingCounters.set(t.parentElement,V)}if(!ye)continue;f==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(B,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(B))}catch(u){console.warn(`[SnapDOM] Couldn't copy the ${f} of`,t,u)}}let l=Array.from(e.children).filter(f=>!f.dataset.snapdomPseudo);if(n.nodeMap)for(let f of l){let c=n.nodeMap.get(f);c?.nodeType===1&&await Oe(c,f,n,r,!0)}else{let f=Array.from(t.children);for(let c=0;c<Math.min(f.length,l.length);c++)await Oe(f[c],l[c],n,r,!0)}}kt();function Ws(t,e,n){if(!t||t?.nodeType!==1)return;let r=t.ownerDocument||document,i=e||r,o=Ot(t)&&t.localName==="svg"?[t]:Array.from(t.querySelectorAll("svg")),s=/url\(\s*["']?\s*#([^)"']+)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],l=S=>window.CSS&&CSS.escape?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),f="http://www.w3.org/1999/xlink",c=S=>{if(!S||!S.getAttribute)return null;let M=S.getAttribute("href")||S.getAttribute("xlink:href")||(typeof S.getAttributeNS=="function"?S.getAttributeNS(f,"href"):null);if(M)return M;let _=S.attributes;if(!_)return null;for(let E=0;E<_.length;E++){let v=_[E];if(!v||!v.name)continue;if(v.name==="href")return v.value;let k=v.name.indexOf(":");if(k!==-1&&v.name.slice(k+1)==="href")return v.value}return null},u=new Set(Array.from(t.querySelectorAll("[id]")).map(S=>S.id)),d=new Set,h=!1,m=(S,M=null)=>{if(!S)return;s.lastIndex=0;let _;for(;_=s.exec(S);){h=!0;let E=(_[1]||"").trim();E&&(u.has(E)||(d.add(E),M&&!M.has(E)&&M.add(E)))}},p=S=>{let M=S.querySelectorAll("use");for(let v of M){let k=c(v);if(!k||!k.startsWith("#"))continue;h=!0;let R=k.slice(1).trim();R&&!u.has(R)&&d.add(R)}let _='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';m(S.getAttribute("style")||"");for(let v of a)m(S.getAttribute(v));let E=S.querySelectorAll(_);for(let v of E){m(v.getAttribute("style")||"");for(let k of a)m(v.getAttribute(k))}},g=S=>{if(!S||S.nodeType!==1||!S.querySelectorAll)return;let M="filter[id],clipPath[id],mask[id],linearGradient[id],radialGradient[id],pattern[id]",_=!1;try{_=!!(i.querySelector&&i.querySelector(M))}catch{return}if(!_)return;let E=["filter","clipPath","mask","maskImage","webkitMaskImage"],v=k=>{if(Ot(k))return;let R;try{R=getComputedStyle(k)}catch{return}for(let F of E){let $=R[F];$&&$.includes("url(")&&m($)}};v(S);for(let k of S.querySelectorAll("*"))v(k)};for(let S of o)p(S);if(g(n),!h)return;let y=t.querySelector("svg.inline-defs-container");y||(y=r.createElementNS("http://www.w3.org/2000/svg","svg"),y.classList.add("inline-defs-container"),y.setAttribute("aria-hidden","true"),y.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(y,t.firstChild||null));let b=y.querySelector("defs")||null,w=S=>{if(!S||u.has(S))return null;let M=l(S),_=E=>{let v=i.querySelector(E);return v&&!t.contains(v)?v:null};return _(`svg defs > *#${M}`)||_(`svg > symbol#${M}`)||_(`*#${M}`)};if(!d.size)return;let x=new Set(d),C=new Set;for(;x.size;){let S=x.values().next().value;if(x.delete(S),!S||u.has(S)||C.has(S))continue;let M=w(S);if(!M){C.add(S);continue}b||(b=r.createElementNS("http://www.w3.org/2000/svg","defs"),y.appendChild(b));let _=M.cloneNode(!0);_.id||_.setAttribute("id",S),b.appendChild(_),C.add(S),u.add(S);let E=[_,..._.querySelectorAll("*")];for(let v of E){let k=c(v);if(k&&k.startsWith("#")){let F=k.slice(1).trim();F&&!u.has(F)&&!C.has(F)&&x.add(F)}let R=v.getAttribute?.("style")||"";R&&m(R,x);for(let F of a){let $=v.getAttribute?.(F);$&&m($,x)}}}}kt();var fo=new WeakMap,uo=new WeakMap;function jn(t,e,n){let r=n.get(t),i=t.style;if(!r){let s=i.cssText,a=t.hasAttribute("style");r={users:0,saved:e.map(([f,c])=>{let u={property:f,value:i.getPropertyValue(f),priority:i.getPropertyPriority(f)};return i.setProperty(f,c,"important"),u.forcedValue=i.getPropertyValue(f),u}),originalCSS:s,forcedCSS:i.cssText,hadStyle:a},n.set(t,r)}r.users++;let o=!1;return()=>{if(!o&&(o=!0,!--r.users)){if(n.delete(t),i.cssText===r.forcedCSS)i.cssText=r.originalCSS;else for(let s of r.saved)i.getPropertyValue(s.property)!==s.forcedValue||i.getPropertyPriority(s.property)!=="important"||(s.value?i.setProperty(s.property,s.value,s.priority):i.removeProperty(s.property));!r.hadStyle&&!i.length&&(t.getAttribute("style"),t.removeAttribute("style"))}}}function Bs(t){if(fo.has(t))return jn(t,[],fo);let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,i=n!=="none"&&parseFloat(r)>0,o=parseFloat(e.borderTopWidth)===0&&parseFloat(e.borderRightWidth)===0&&parseFloat(e.borderBottomWidth)===0&&parseFloat(e.borderLeftWidth)===0;if(i&&o){let s=[];for(let a of["top","right","bottom","left"])s.push([`border-${a}-width`,r],[`border-${a}-style`,"solid"],[`border-${a}-color`,"transparent"]);return jn(t,s,fo)}return()=>{}}function Vn(t,e=null){let n=[],r=i=>{if(!Rt(i))return;if(uo.has(i)){n.push(jn(i,[],uo));return}let o=getComputedStyle(i);(o.contentVisibility||o.getPropertyValue("content-visibility")||"")==="auto"&&n.push(jn(i,[["content-visibility","visible"]],uo))};try{if(e){let o=s=>{let a;try{a=s.getBoundingClientRect()}catch{return}if(!((a.width>0||a.height>0)&&(a.right<e.left-200||a.left>e.right+200||a.bottom<e.top-200||a.top>e.bottom+200))){r(s);for(let l=s.firstElementChild;l;l=l.nextElementSibling)o(l)}};o(t)}else{for(let i of t.querySelectorAll("*"))r(i);r(t)}}catch{}return()=>{for(let i of n)try{i()}catch{}}}St();yt();Mt();Me();Mt();function ho(t){return zs(t.boxShadow)}function mo(t){return zs(t.textShadow)}function zs(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",r=0;for(let l=0;l<t.length;l++){let f=t[l];f==="("?r++:f===")"&&(r=Math.max(0,r-1)),f===","&&r===0?(e.push(n),n=""):n+=f}n.trim()&&e.push(n);let i=0,o=0,s=0,a=0;for(let l of e){if(/\binset\b/i.test(l))continue;let f=l.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(f.length<2)continue;let[c,u,d=0,h=0]=f,m=Math.abs(c)+d+h,p=Math.abs(u)+d+h;o=Math.max(o,m+Math.max(c,0)),a=Math.max(a,m+Math.max(-c,0)),s=Math.max(s,p+Math.max(u,0)),i=Math.max(i,p+Math.max(-u,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(s),left:Math.ceil(a)}}function go(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(e);)r+=parseFloat(i[1])||0;let o=Math.ceil(r*2);return{top:o,right:o,bottom:o,left:o}}function yo(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function bo(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,s=0,a=!1;for(let l of n){a=!0;let f=l.match(/-?\d+(?:\.\d+)?px/gi)?.map(p=>parseFloat(p))||[],[c=0,u=0,d=0]=f,h=Math.abs(c)+d,m=Math.abs(u)+d;i=Math.max(i,h+Math.max(c,0)),s=Math.max(s,h+Math.max(-c,0)),o=Math.max(o,m+Math.max(u,0)),r=Math.max(r,m+Math.max(-u,0))}return{bleed:{top:W(r),right:W(i),bottom:W(o),left:W(s)},has:a}}function zf(t){let e=ho(t),n=mo(t),r=go(t),i=yo(t),o=bo(t);return{top:Math.max(e.top,n.top)+r.top+i.top+o.bleed.top,right:Math.max(e.right,n.right)+r.right+i.right+o.bleed.right,bottom:Math.max(e.bottom,n.bottom)+r.bottom+i.bottom+o.bleed.bottom,left:Math.max(e.left,n.left)+r.left+i.left+o.bleed.left}}function Hf(t){return t.boxShadow&&t.boxShadow!=="none"||t.textShadow&&t.textShadow!=="none"||(t.outlineStyle||"none")!=="none"||t.filter&&t.filter!=="none"?!0:!!t.webkitFilter&&t.webkitFilter!=="none"}function Us(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",r=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:r||e!=="visible",y:r||n!=="visible"}}function Hs(t,e,n,r=1,i=1){let o=0,s=0,a=0,l=0,f=Us(n.get(t)||O(t));if(f.x&&f.y)return{top:0,right:0,bottom:0,left:0};let c=t.getBoundingClientRect();for(let u of e.values()){if(u===t||u.nodeType!==1||u.ownerDocument!==t.ownerDocument)continue;let d=n.get(u);if(!d||!Hf(d))continue;let h=zf(d);if(!(h.top||h.right||h.bottom||h.left))continue;let m=u.getBoundingClientRect(),p={left:m.left-h.left/r,top:m.top-h.top/i,right:m.right+h.right/r,bottom:m.bottom+h.bottom/i};for(let g=u.parentElement;g;g=g.parentElement){let y=Us(n.get(g)||O(g));if(y.x||y.y){let b=g.getBoundingClientRect();y.x&&(p.left=Math.max(p.left,b.left),p.right=Math.min(p.right,b.right)),y.y&&(p.top=Math.max(p.top,b.top),p.bottom=Math.min(p.bottom,b.bottom))}if(g===t)break}f.x||(l=Math.max(l,(c.left-p.left)*r),s=Math.max(s,(p.right-c.right)*r)),f.y||(o=Math.max(o,(c.top-p.top)*i),a=Math.max(a,(p.bottom-c.bottom)*i))}return{top:Math.max(0,Math.ceil(o)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(l))}}function js(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none"){let l=null;try{l=ue(t).scale}catch{}try{e.style.transform="none"}catch{}if(!l)return{a:1,b:0,c:0,d:1};let f=ee({scale:l});return{a:f.a,b:f.b,c:f.c,d:f.d}}function i(l,f,c,u){let d=Math.sqrt(l*l+f*f)||0,h=0,m=0;if(d>0){let p=l/d,g=f/d;h=p*c+g*u;let y=c-p*h,b=u-g*h;m=Math.sqrt(y*y+b*b)||0,m>0?h=h/m:h=0}return{a:d,b:0,c:h*m,d:m}}let o=l=>{let f=ue(t).scale;if(!f)return l;let c=ee({scale:f,baseTransform:`matrix(${l.a},${l.b},${l.c},${l.d},0,0)`});return{a:c.a,b:c.b,c:c.c,d:c.d}},s=r.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let l=s[1].split(",").map(f=>parseFloat(f.trim()));if(l.length===6&&l.every(Number.isFinite)){let[f,c,u,d]=l,h=i(f,c,u,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let l=a[1].split(",").map(f=>parseFloat(f.trim()));if(l.length===16&&l.every(Number.isFinite)){let f=l[0],c=l[1],u=l[4],d=l[5],h=i(f,c,u,d);try{e.style.transform=`matrix(${h.a}, ${h.b}, ${h.c}, ${h.d}, 0, 0)`}catch{}return o(h)}}try{let l=new DOMMatrix(r),f=i(l.a,l.b,l.c,l.d);try{e.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return o(f)}catch{return null}}function De(t,e,n,r,i){let o=n.a,s=n.b,a=n.c,l=n.d,f=n.e||0,c=n.f||0;function u(y,b){let w=y-r,x=b-i,C=o*w+a*x,S=s*w+l*x;return C+=r+f,S+=i+c,[C,S]}let d=[u(0,0),u(t,0),u(0,e),u(t,e)],h=1/0,m=1/0,p=-1/0,g=-1/0;for(let[y,b]of d)y<h&&(h=y),b<m&&(m=b),y>p&&(p=y),b>g&&(g=b);return{minX:h,minY:m,maxX:p,maxY:g,width:p-h,height:g-m}}function pn(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],s=(a,l)=>{let f=a.toLowerCase();return f==="left"||f==="top"?0:f==="center"?l/2:f==="right"||f==="bottom"?l:f.endsWith("px")?parseFloat(f)||0:f.endsWith("%")?(parseFloat(f)||0)*l/100:/^-?\d+(\.\d+)?$/.test(f)&&parseFloat(f)||0};return{ox:s(i,e),oy:s(o,n)}}function ue(t){let e={rotate:"0deg",scale:null,translate:null},n=null;try{n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null}catch{}if(n){let i=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},o=i("rotate");if(o)if(o.angle){let l=o.angle;e.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.unit,o.is2D===!1&&o.x&&o.y&&o.z&&(e.rotate=`${o.x.value} ${o.y.value} ${o.z.value} ${e.rotate}`)}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let l=getComputedStyle(t);e.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let s=i("scale");if(s){let l=f=>f&&f.value!=null?`${f.value}${f.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[l(s.x),l(s.y)??l(s.x),...s.is2D===!1?[l(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(l).join(" "):e.scale=String(s)}else{let l=getComputedStyle(t);e.scale=l.scale&&l.scale!=="none"?l.scale:null}let a=i("translate");if(a){let l=f=>f&&f.value!=null?`${f.value}${f.unit==="percent"?"%":f.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[l(a.x),l(a.y)??"0px",...a.is2D===!1?[l(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(l).join(" "):e.translate=String(a)}else{let l=getComputedStyle(t);e.translate=l.translate&&l.translate!=="none"?l.translate:null}return(!e.rotate||e.rotate==="none")&&(e.rotate="0deg"),(!e.scale||e.scale==="none")&&(e.scale=null),(!e.translate||e.translate==="none")&&(e.translate=null),e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}var po=null;function jf(){if(po?.isConnected)return po;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Z(t),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),po=t,t}function ee(t){let e=o=>{let s=[],a=0,l=0,f=String(o).trim();for(let c=0;c<f.length;c++)f[c]==="("?a++:f[c]===")"?a--:/\s/.test(f[c])&&!a&&(c>l&&s.push(f.slice(l,c)),l=c+1);return l<f.length&&s.push(f.slice(l)),s},n=o=>o&&o!=="none",r=[];if(n(t.translate)){let o=e(t.translate);for(let s=0;s<2&&s<o.length;s++){let a=s===0?t.width:t.height;/^[+-]?(?:\d*\.)?\d+%$/.test(o[s])&&Number.isFinite(a)&&(o[s]=`${parseFloat(o[s])*a/100}px`)}r.push(o.length>2?`translate3d(${o.join(",")})`:`translate(${o.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let o=e(t.rotate);o.length===4?r.push(`rotate3d(${o.join(",")})`):o.length===2&&/^[xyz]$/i.test(o[0])?r.push(`rotate${o[0].toUpperCase()}(${o[1]})`):r.push(`rotate(${o.join(" ")})`)}if(n(t.scale)){let o=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);r.push(o.length>2?`scale3d(${o.join(",")})`:`scale(${o.join(",")})`)}if(n(t.baseTransform)&&r.push(t.baseTransform),!r.length)return new DOMMatrix;let i=r.join(" ");try{if(i.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(i)}catch{let o=jf(),s=document.createElement("div");if(s.style.cssText="all:initial!important;display:block!important;transform-origin:0 0!important",s.style.setProperty("width",`${Number.isFinite(t.width)?t.width:0}px`,"important"),s.style.setProperty("height",`${Number.isFinite(t.height)?t.height:0}px`,"important"),s.style.setProperty("transform",i,"important"),!s.style.transform)throw new Error("[SnapDOM] Couldn't read the transform of an element.");o.appendChild(s);try{return Vf(s)}finally{s.remove()}}}function Vs(t){let e=O(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let i=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",o=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(i||o||s)}function Vf(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var Ys=new WeakSet;function qn(t,e){if(!e)return null;let n=t.ownerDocument||document,r=n.defaultView||window,i,o,s,a;if(e==="viewport")i=0,o=0,s=n.documentElement?.clientWidth||r.innerWidth,a=n.documentElement?.clientHeight||r.innerHeight;else if(typeof e=="object")i=(Number(e.x)||0)-(r.scrollX||0),o=(Number(e.y)||0)-(r.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:i,top:o,width:s,height:a,right:i+s,bottom:o+a}:null}function wo(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return Dt(e)?e.host:null}function qf(t,e){for(let n=e;n;n=wo(n))if(n===t)return!0;return!1}function Gf(t,e){for(let n=wo(t);n&&n!==e&&n?.nodeType===1;n=wo(n)){let r=O(n);if(r.position!=="static"||r.transform&&r.transform!=="none"||r.filter&&r.filter!=="none"||r.backdropFilter&&r.backdropFilter!=="none"||r.perspective&&r.perspective!=="none"||/transform|perspective|filter/.test(r.willChange||"")||/layout|paint|strict|content/.test(r.contain||""))return n}return null}function xo(t,e){try{return ee({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function Ks(t,e,n,r,i){let o=t.getBoundingClientRect();Rt(e)&&O(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,l]of n){if(!Rt(a)||l?.nodeType!==1||l===t||!qf(t,l))continue;let f=r.get(l)||O(l),c=f.position;if(c!=="fixed"&&c!=="sticky"&&c!=="-webkit-sticky"||a.style.position==="absolute")continue;let u=l.getBoundingClientRect();if(!(u.width>0&&u.height>0))continue;Ys.add(a);let d=f.transform&&f.transform!=="none"?f.transform:"",h=ue(l),m=!!(d||h.rotate!=="0deg"||h.scale||h.translate),p=m?xo(d,h):null,g=!p||!p.is2D||p.a===1&&p.b===0&&p.c===0&&p.d===1,y=u.width,b=u.height;g||(y=l.offsetWidth||u.width,b=l.offsetHeight||u.height);let w=l.getRootNode&&Dt(l.getRootNode()),x=o,C=t.clientLeft||0,S=t.clientTop||0;if(w){let k=Gf(l,t);k&&(x=k.getBoundingClientRect(),C=k.clientLeft||0,S=k.clientTop||0)}let M=u.left-x.left-C,_=u.top-x.top-S;if(m)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",g)a.style.transform="none";else{a.style.transform=`matrix(${p.a},${p.b},${p.c},${p.d},0,0)`;let{ox:k,oy:R}=pn(f,y,b),F=De(y,b,{a:p.a,b:p.b,c:p.c,d:p.d,e:0,f:0},k,R);M-=F.minX,_-=F.minY}if(c!=="fixed"){let k=a.cloneNode(!1);k.setAttribute("data-snap-ph","1"),k.style.position="static",k.style.visibility="hidden",k.style.width=`${y}px`,k.style.height=`${b}px`,k.style.boxSizing="border-box",a.parentElement?.insertBefore(k,a)}let E=y+2,v=b;i&&(Math.abs(_-i.y)<.5&&(_-=1,v+=1),Math.abs(M-i.x)<.5&&(M-=1,E+=1)),a.style.position="absolute",a.style.left=`${M}px`,a.style.top=`${_}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${E}px`,a.style.height=`${v}px`,a.style.boxSizing="border-box",w||s.push(a)}for(let a of s)e.appendChild(a)}function Qs(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){H(n,"Couldn't remove the root box-shadow.",s)}try{e.style.textShadow="none"}catch(s){H(n,"Couldn't remove the root text-shadow.",s)}try{e.style.outline="none"}catch(s){H(n,"Couldn't remove the root outline.",s)}let o=(r.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch(s){H(n,"Couldn't remove the root drop-shadow filter.",s)}}function Js(t,e){if(!t||!e||!e.style)return;let n=1;try{n=parseFloat(getComputedStyle(t).zoom)}catch{return}if(!(!e.style.getPropertyValue("zoom")&&(!Number.isFinite(n)||n===1)))try{e.style.setProperty("zoom","1","important")}catch{}}function qs(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",r=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||r!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function Xf(t,e){let n=Array.from(t.childNodes),r=e==="top"?n:n.reverse();for(let i of r){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(i),s=String(o.display||"");if(!(s==="none"||s==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||s.startsWith("inline")?null:i}return null}function Zs(t,e,n){if(!t||!e||!e.style)return;let r=getComputedStyle(t);if(!qs(r))for(let i of["top","bottom"]){let o=i==="top"?"Top":"Bottom";if((parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)continue;let s=t,a=e;for(;s&&a;){let l=Xf(s,i);if(!l)break;let f=n?Array.from(a.children).find(d=>n.get(d)===l)||null:a.children[Array.from(s.children).indexOf(l)]||null,c=getComputedStyle(l),u=parseFloat(c[`margin${o}`])||0;if(f&&f.style&&u>0&&(f.style[`margin${o}`]="0px"),qs(c)||(parseFloat(c[`border${o}Width`])||0)>0||(parseFloat(c[`padding${o}`])||0)>0)break;s=l,a=f}}}var Yf=new Set(["xml","xlink"]);function Kf(t,e){if(t.startsWith("*")||t==="xmlns"||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!Yf.has(n))return!0}return e?t.startsWith("x-")||t.startsWith("v-")||t.startsWith(":")||t.startsWith("on:")||t.startsWith("bind:")||t.startsWith("let:")||t.startsWith("class:"):!1}var Qf=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,Gs=t=>t.replace(Qf,e=>e.length===2?e:""),Jf=/^data:[^,]{0,120};base64,/;function Gn(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,r=a=>{for(let l of Array.from(a.attributes)){if(Kf(l.name,n)){a.removeAttribute(l.name);continue}if(Jf.test(l.value))continue;let f=Gs(l.value);if(f!==l.value)try{a.setAttribute(l.name,f)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&r(t);let i=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=o.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)r(s);else if(s.nodeType===Node.COMMENT_NODE)i.push(s);else{let a=Gs(s.data);a!==s.data&&(s.data=a)}for(let a of i)a.remove()}function Zf(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}var tu=new Set(["img","canvas","video","iframe","object","embed"]);function eu(t){return Ot(t)||tu.has(t?.localName)}function nu(t,e){if(t?.nodeType!==1||Zf(t)||eu(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function ta(t,e,n=new Map,r=null){function i(o,s){if(o?.nodeType!==1||s?.nodeType!==1)return;let a=o.childElementCount>s.childElementCount,l=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,l),a&&nu(o,l)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let c=l.overflowY||l.overflowBlock||"visible",u=l.overflowX||l.overflowInline||"visible";(c!=="visible"||u!=="visible")&&(s.style.overflow="visible")}let f=Array.from(s.children);if(r)for(let c of f){let u=r.get(c);u&&u.nodeType===1&&i(u,c)}else{let c=Array.from(o.children);for(let u=0;u<Math.min(c.length,f.length);u++)i(c[u],f[u])}}i(t,e)}function ru(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function ou(t,e){if(t?.nodeType!==1)return!1;if(t.getAttribute("data-capture")==="exclude")return e?.excludeMode==="remove";if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch(r){H(e,"Invalid exclude selector; ignored.",r)}if(Array.isArray(e?.excludePredicates))for(let n of e.excludePredicates)try{if(n(t))return e.excludeMode==="remove"}catch(r){H(e,"Your exclude function threw; ignored.",r)}if(typeof e?.filter=="function"&&e.filterMode==="remove")try{if(!e.filter(t))return!0}catch(n){H(e,"Your filter function threw; ignored.",n)}return!1}function vo(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),i=1/0,o=-1/0,s=!1,a=Array.from(t.children);for(let h of a){if(ou(h,e)||!ru(h))continue;let m=h.getBoundingClientRect(),p=m.top-r.top,g=m.bottom-r.top;g<=p||(p<i&&(i=p),g>o&&(o=g),s=!0)}let l=s?Math.max(0,o-i):0,f=parseFloat(n.borderTopWidth)||0,c=parseFloat(n.borderBottomWidth)||0,u=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return f+c+u+d+l}var W=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,We=.75;function ea(t,e,n,r,i,o){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),l=i>0&&a.width>0?a.width/i:1,f=o>0&&a.height>0?a.height/o:1;if(Math.abs(l-f)>.02)return 0;let c=s.createElement("div");Z(c),c.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let u=c.attachShadow({mode:"open"}),d=s.createElement("style");d.textContent=n,u.appendChild(d);let h=e.cloneNode(!0);u.appendChild(h),s.body.appendChild(c);let m=0,p=(g,y,b)=>{let w=O(g),x=w.boxSizing==="border-box",C=(S,M,..._)=>{let E=parseFloat(S);if(!Number.isFinite(E))return M;let v=E+(x?0:_.reduce((k,R)=>k+(parseFloat(R)||0),0));return Math.abs(v-M)<=.51?v:M};return{width:C(w.width,y,w.paddingLeft,w.paddingRight,w.borderLeftWidth,w.borderRightWidth),height:C(w.height,b,w.paddingTop,w.paddingBottom,w.borderTopWidth,w.borderBottomWidth)}};try{let g=h.getBoundingClientRect(),y=h.offsetWidth||i,b=h.offsetHeight||o,w=y>0&&g.width>0?g.width/y:1,x=b>0&&g.height>0?g.height/b:1,C=(S,M,_=!1)=>{let E=S.children,v=M.children,k=Math.min(E.length,v.length);for(let R=0;R<k;R++){let F=E[R],$=v[R],I=r.get(F),P=_||Ys.has(F);if(I?.nodeType===1&&Rt(F)&&F.style&&I.isConnected){let A=I.getBoundingClientRect();if(A.width>0&&A.height>0){let L=$.getBoundingClientRect(),N=A.width/l,T=A.height/f,z=L.width,q=L.height,j=I.offsetWidth||N,J=I.offsetHeight||T,B=$.offsetWidth||z,ut=$.offsetHeight||q,vt=Math.abs(N-j)>We||Math.abs(T-J)>We||Math.abs(z-B)>We||Math.abs(q-ut)>We;if(P){let nt=p($,B,ut);N=z>0?N*w*nt.width/z:N,T=q>0?T*x*nt.height/q:T,z=nt.width,q=nt.height}else if(vt){let nt=p(I,j,J),pt=p($,B,ut);N=nt.width,T=nt.height,z=pt.width,q=pt.height}let at=z-N,st=q-T;(Math.abs(at)>We||Math.abs(st)>We)&&(F.style.boxSizing="border-box",F.style.width=`${W(N)}px`,F.style.height=`${W(T)}px`,m++)}}C(F,$,P)}};C(e,h)}finally{c.remove()}return m}var iu=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;function So(t,e=new Set){let n="";if(!t)return n;for(let r=0;r<t.length;r++){let i=t[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=So(i.styleSheet.cssRules,e);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=So(i.cssRules,e);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(iu.test(o)){let s=i.cssText;s&&!e.has(s)&&(e.add(s),n+=s)}}}catch{}}return n}var Xs=new WeakMap;function su(t){let e="";for(let n of t.styleSheets){let r=-1;try{r=n.cssRules?n.cssRules.length:-1}catch{}e+=(n.href||"inline")+":"+r+"|"}return e}function au(t){if(!t||!t.styleSheets)return"";let e=su(t),n=Xs.get(t);if(n&&n.fp===e)return n.css;let r=new Set,i="";for(let o of Array.from(t.styleSheets))try{let s=o.cssRules;s&&(i+=So(s,r))}catch{}return Xs.set(t,{fp:e,css:i}),i}function na(t,e){let n=Wr(t.clone).sort(),r=n.join(","),i=ln(t.element),o=D.baseStyle.get(r),s;o&&o.universe===i?s=o.css:(s=Br(n,i),D.baseStyle.set(r,{universe:i,css:s}));let a=au(t.element?.ownerDocument||document);return t.fontsCSS=e,t.baseCSS=s,t.scrollbarCSS=a,{baseCSS:s,scrollbarCSS:a,fontsCSS:e}}mt();var Xn=new Set,lu="[data-sd-ph]::placeholder{color:var(--sd-ph)!important;opacity:var(--sd-ph-o)!important;-webkit-text-fill-color:var(--sd-ph)!important}";async function ra(t,e={}){Pt(),En(t.ownerDocument||document);let n=e.__session||{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:e,slicer:e.__slicer||null},i=null,o=null;if(e.clip&&(o=qn(t,e.clip),o&&(r.clip={rect:o,root:t})),e.captureSelection)try{r.selection=fs(t)}catch(p){H(r,"Couldn't read the text selection.",p)}let s,a="",l="";if(Xn.size){let p=(g,y)=>{for(let b=y;b;b=b.assignedSlot||b.parentElement||Ft(b))if(b===g)return!0;return!1};for(;;){let g=[...Xn].filter(({root:y})=>p(y,t)||p(t,y)).map(({promise:y})=>y.catch(()=>{}));if(!g.length)break;await Promise.all(g)}}if(!r.clip&&t.isConnected&&t.ownerDocument?.visibilityState!=="hidden")try{let p=t.getBoundingClientRect(),g=t.ownerDocument?.defaultView||window,y=p.right<=0||p.bottom<=0||p.left>=g.innerWidth||p.top>=g.innerHeight,b=[];if(y&&(()=>{let x=[];t.shadowRoot&&x.push(t.shadowRoot);for(let C of t.querySelectorAll("*"))C.shadowRoot&&x.push(C.shadowRoot);for(;x.length;){let C=x.pop(),S=C.host?.localName==="calcite-icon";for(let M of C.querySelectorAll("*")){if(M.shadowRoot&&x.push(M.shadowRoot),!S||M.localName!=="svg")continue;let _=M.querySelectorAll("path");if(!_.length||[..._].some(v=>v.getAttribute("d")?.trim()))continue;let E=M.getBoundingClientRect();E.width&&E.height&&b.push(M)}}})(),b.length){let x=(async()=>{let S=t.style,M=t.hasAttribute("style"),_=new Map,E=(v,k)=>{_.has(v)||_.set(v,{value:S.getPropertyValue(v),priority:S.getPropertyPriority(v)}),S.setProperty(v,k,"important");let R=_.get(v);R.forcedValue=S.getPropertyValue(v),R.forcedPriority=S.getPropertyPriority(v)};try{E("left","0"),E("top","0"),E("right","auto"),E("bottom","auto"),E("margin-top","0"),E("margin-right","0"),E("margin-bottom","0"),E("margin-left","0"),E("transform","none"),E("translate","none"),E("opacity","0"),E("pointer-events","none");let v=t.getBoundingClientRect();if(v.right<=0||v.bottom<=0||v.left>=g.innerWidth||v.top>=g.innerHeight){let F=t.parentElement?.getBoundingClientRect(),$=F&&F.right>0&&F.left<g.innerWidth?Math.max(0,F.left):0,I=F&&F.bottom>0&&F.top<g.innerHeight?Math.max(0,F.top):0;E("position","fixed"),E("left",`${$}px`),E("top",`${I}px`)}await bt(100);let k=Date.now()+1500,R=()=>b.some(F=>{if([...F.querySelectorAll("path")].some(I=>I.getAttribute("d")?.trim()))return!1;let $=F.getBoundingClientRect();return $.width&&$.height&&$.right>0&&$.bottom>0&&$.left<g.innerWidth&&$.top<g.innerHeight});for(;Date.now()<k&&R();)await new Promise(F=>setTimeout(F,25));await bt(100)}finally{for(let[v,k]of _)S.getPropertyValue(v)!==k.forcedValue||S.getPropertyPriority(v)!==k.forcedPriority||(k.value?S.setProperty(v,k.value,k.priority):S.removeProperty(v));!M&&!S.length&&t.removeAttribute("style"),await bt(100)}})(),C={root:t,promise:x};Xn.add(C);try{await x}finally{Xn.delete(C)}}}catch{}let f=Bs(t),c=Vn(t,o);if(o){let p=t.getBoundingClientRect(),g=t.offsetWidth||p.width,y=t.offsetHeight||p.height,b=p.width&&Math.abs(g-p.width)>=1?g/p.width:1,w=p.height&&Math.abs(y-p.height)>=1?y/p.height:1;i={x:(o.left-p.left)*b,y:(o.top-p.top)*w,width:o.width*b,height:o.height*w}}try{s=await te(t,r,e)}catch(p){throw console.warn("[SnapDOM] Capture failed while copying the element.",p),p}finally{c(),f()}ls(r.nodeMap,t.ownerDocument||document),r.slicer?.due()&&await r.slicer.pause();try{Ws(s,void 0,t)}catch(p){console.warn("[SnapDOM] Couldn't copy external SVG icons; some may be missing.",p)}try{await Oe(t,s,r,e)}catch(p){console.warn("[SnapDOM] Couldn't copy ::before/::after content; some decorations may be missing.",p)}await Pn(s,r);for(let[p,g]of r.nodeMap.entries())if(g?.tagName==="STYLE"&&p?.tagName==="STYLE"&&!p.hasAttribute("data-sd"))try{let y=g.sheet&&g.sheet.cssRules;y&&/@media/i.test(p.textContent||"")&&(p.textContent=fe(y))}catch{}try{let p=s.querySelectorAll("style[data-sd]");for(let g of p)l+=g.textContent||"",g.remove()}catch(p){H(r,"Couldn't copy shadow DOM styles.",p)}r.slicer?.due()&&await r.slicer.pause();let u=tn(r.styleMap);a=Array.from(u.entries()).map(([p,g])=>`.${g}{${p}}`).join("");let h=l+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+(r.__usesPlaceholder?lu:"")+(r.__pseudoCSS||"");a=h+a;for(let[p,g]of r.styleMap.entries())Co(p,g,u);try{cu(t,s,r.nodeMap)}catch(p){H(r,"Couldn't bring an open dialog or popover into the capture.",p)}if((r.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let p=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};Ks(t,s,r.nodeMap,r.styleCache,p)}catch(p){H(r,"Couldn't keep fixed-position elements in place.",p)}for(let[p,g]of r.nodeMap.entries())r.clip&&g===t&&t===t.ownerDocument.scrollingElement||ko(p,g,r.nodeMap,r.styleCache);let m=t.ownerDocument;if((t===m.body||t===m.documentElement)&&m.documentElement.localName==="html"){let p=r.styleCache.get(m.documentElement)||O(m.documentElement);t===m.documentElement&&(s.style.overflow="visible");let g=t===m.body?s:s.querySelector("body");if(g&&p.overflowX==="visible"&&p.overflowY==="visible"&&p.contain==="none"&&!p.containerType?.includes("size")&&p.contentVisibility!=="auto"&&p.contentVisibility!=="hidden"){let y=r.styleCache.get(m.body)||O(m.body);y.contain==="none"&&!y.containerType?.includes("size")&&y.contentVisibility!=="auto"&&y.contentVisibility!=="hidden"&&y.display!=="none"&&(g.style.overflow="visible")}}if(t===r.nodeMap.get(s)){let p=r.styleCache.get(t)||O(t);r.styleCache.set(t,p);let g=_r(p.transform);s.style.margin="0",s.style.top="auto",s.style.left="auto",s.style.right="auto",s.style.bottom="auto",s.style.animation="none",s.style.transition="none",s.style.willChange="auto",s.style.float="none",s.style.clear="none",s.style.transform=g||"",s.style.translate="none"}for(let[p,g]of r.nodeMap.entries())g.tagName==="PRE"&&(p.style.marginTop="0",p.style.marginBlockStart="0");return{clone:s,classCSS:a,classPrefixCSS:h,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}function cu(t,e,n){let r=[];for(let s of[":modal",":popover-open"])try{r.push(...t.querySelectorAll(s))}catch{}if(!r.length)return;let i=new Map;for(let[s,a]of n.entries())i.set(a,s);let o=214748e4;for(let s of r){let a=i.get(s);if(!(!a||a===e||a.parentNode==null)){try{let l=getComputedStyle(s,"::backdrop"),f=l.backgroundColor,c=l.backgroundImage;if(f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"||c&&c!=="none"){let d=document.createElement("div");d.setAttribute("data-sd-backdrop",""),d.style.cssText=`position:fixed;inset:0;z-index:${o};background-color:${f};`+(c&&c!=="none"&&c.includes("data:")?`background-image:${c};`:""),e.appendChild(d)}}catch{}o+=1,a.style.zIndex=String(o),e.appendChild(a),o+=1}}}function Co(t,e,n){if(t.tagName==="STYLE")return;if(t.getRootNode&&Dt(t.getRootNode())){t.setAttribute("style",e.replace(/;/g,"; "));return}let r=n.get(e);r&&t.classList.add(r);let i=t.style?.backgroundImage,o=t.dataset?.snapdomHasIcon;i&&i!=="none"&&(t.style.backgroundImage=i),o&&(t.style.verticalAlign="middle",t.style.display="inline")}function ko(t,e,n,r){let i=e.scrollLeft,o=e.scrollTop;if(!(i||o)||t?.nodeType!==1||t.namespaceURI!=="http://www.w3.org/1999/xhtml")return;t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";try{let l=t.querySelectorAll("*");for(let f of l){if(f.nodeType!==1||f.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let c=n?.get(f),u=c&&(r?.get(c)||O(c)),d=f.style.position||u?.position;if(d!=="fixed"&&d!=="absolute")continue;let h=u&&u.position!=="absolute"&&d==="absolute",m=null;if(c&&!h)for(let y=c.parentElement||Ft(c);y;y=y.parentElement||Ft(y)){let b=r?.get(y)||O(y);if(d==="absolute"&&b.position!=="static"||b.transform&&b.transform!=="none"||b.translate&&b.translate!=="none"||b.rotate&&b.rotate!=="none"||b.scale&&b.scale!=="none"||b.filter&&b.filter!=="none"||b.backdropFilter&&b.backdropFilter!=="none"||b.perspective&&b.perspective!=="none"||/transform|perspective|filter/.test(b.willChange||"")||/layout|paint|strict|content/.test(b.contain||"")){m=y;break}if(y===e)break}if(m){m===e&&(f.style.top=u.top,f.style.left=u.left,f.style.right=u.right,f.style.bottom=u.bottom);continue}let p=parseFloat(f.style.top||u?.top)||0,g=parseFloat(f.style.left||u?.left)||0;f.style.top=`${p+o}px`,f.style.left=`${g+i}px`,d==="fixed"&&(f.style.position="absolute")}}catch{}let a=document.createElement("div");for(a.style.all="unset",a.style.transform=`translate(${-i}px, ${-o}px)`,a.style.willChange="transform",a.style.display="inline-block",a.style.width="100%";t.firstChild;)a.appendChild(t.firstChild);t.appendChild(a)}Se();se();yt();var oa="http://www.w3.org/1999/xlink";function fu(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(oa,"href"):null)}function uu(t){let e=parseFloat(t.dataset?.snapdomWidth||"")||0,n=parseFloat(t.dataset?.snapdomHeight||"")||0,r=parseInt(t.getAttribute("width")||"",10)||0,i=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,s=parseFloat(t.style?.height||"")||0,a=e||o||r||t.width||t.naturalWidth||100,l=n||s||i||t.height||t.naturalHeight||100;return{width:a,height:l}}async function Yn(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let r=async a=>{if(!a.getAttribute("src")){let m=a.currentSrc||a.src||$e(a.getAttribute("srcset"),a)||"";m&&a.setAttribute("src",m)}if(a.removeAttribute("srcset"),a.removeAttribute("sizes"),(a.getAttribute("src")||"").startsWith("data:")){a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let l=a.src||"";if(!l)return;let f=D.image?.get(l);if(f){a.src=f,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let c=await ft(l,{as:"dataURL",useProxy:e.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){D.image?.set(l,c.data),a.src=c.data,c.blob&&(a.__snapdomBlob=c.blob),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:u,height:d}=uu(a),{fallbackURL:h}=e||{};if(h)try{let m=typeof h=="function"?await h({width:u,height:d,src:l,element:a}):h;if(m){let p=await ft(m,{as:"dataURL",useProxy:e.useProxy});if(p?.ok&&typeof p.data=="string"){a.src=p.data,a.width||(a.width=u),a.height||(a.height=d);return}}}catch{}if(e.placeholders!==!1){At(e.__session,"image-fallback",`image failed to inline, using placeholder: ${l}`);let m=document.createElement("div");m.style.cssText=[`width:${u}px`,`height:${d}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${d}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),m.textContent="img",a.replaceWith(m)}else{let m=document.createElement("div");m.style.cssText=`display:inline-block;width:${u}px;height:${d}px;visibility:hidden;`,a.replaceWith(m)}},i=6;for(let a=0;a<n.length;a+=i){let l=n.slice(a,a+i).map(r);await Promise.allSettled(l)}let o=Array.from(t.querySelectorAll("image"));t.localName==="image"&&o.unshift(t);let s=async a=>{let l=fu(a);if(!l||l.startsWith("data:")||l.startsWith("blob:"))return;let f=await ft(l,{as:"dataURL",useProxy:e.useProxy});f.ok&&typeof f.data=="string"&&f.data.startsWith("data:")&&(a.setAttribute("href",f.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(oa,"href"))};for(let a=0;a<o.length;a+=i){let l=o.slice(a,a+i).map(s);await Promise.allSettled(l)}}mt();St();var du=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],pu=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],hu=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],mu=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function gu(t,e,n,r){let i=n.get(t)||O(t);n.has(t)||n.set(t,i);let o=Ni(t),s=o?m=>m in o?o[m]:"":m=>i.getPropertyValue(m),a=s("border-image"),l=s("border-image-source"),f=a&&a!=="none"||l&&l!=="none",c=i.getPropertyValue("background-image"),u=s("background-color"),d=c&&c!=="none"||u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""),h=wt()&&(s("background-clip")||s("-webkit-background-clip")||"").includes("text");if(d&&!h)for(let m of hu){let p=s(m);p&&e.style.setProperty(m,p)}for(let m of du){if(h&&m==="background-image")continue;let p=i.getPropertyValue(m);if(m==="background-image"&&(!p||p==="none")){let b=i.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(p=Yt(b).filter(w=>/url\s*\(/.test(w)).join(", ")||p)}if(!p||p==="none")continue;let g=Yt(p),y=await Promise.all(g.map(b=>xe(b,r)));y.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&e.style.setProperty(m,y.join(", "))}for(let m of pu){let p=s(m);!p||p==="initial"||e.style.setProperty(m,p)}if(f)for(let m of mu){let p=s(m);!p||p==="initial"||e.style.setProperty(m,p)}if(d&&/fixed/.test(s("background-attachment")||""))try{await bu(t,e,i)}catch{}}function yu(t,e,n,r,i){let o=(t||"auto").trim();if(o==="cover"||o==="contain"){if(!e||!n)return{w:r,h:i};let d=o==="cover"?Math.max(r/e,i/n):Math.min(r/e,i/n);return{w:e*d,h:n*d}}let s=o.split(/\s+/),a=(d,h)=>{if(d==="auto"||d===void 0)return null;if(d.endsWith("px"))return parseFloat(d);if(d.endsWith("%"))return h*parseFloat(d)/100},l=a(s[0],r),f=a(s[1],i);if(l===void 0||f===void 0)return null;let c=l,u=f;return c==null&&u==null?(c=e||r,u=n||i):c==null?c=e&&n?u*(e/n):r:u==null&&(u=e&&n?c*(n/e):i),!c||!u?null:{w:c,h:u}}async function bu(t,e,n){let r=(n.getPropertyValue("background-attachment")||"").split(",").map(m=>m.trim()),i=en();if(!i)for(let m=t.parentElement;m&&!i;m=m.parentElement){let p=O(m);(p.transform&&p.transform!=="none"||p.filter&&p.filter!=="none")&&(i=!0)}if(i){e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "));return}let o=t.getBoundingClientRect(),s=t.ownerDocument?.defaultView||window,a=s.innerWidth,l=s.innerHeight,f=Yt(e.style.backgroundImage||n.getPropertyValue("background-image")||""),c=(e.style.backgroundSize||n.getPropertyValue("background-size")||"auto").split(",").map(m=>m.trim()),u=(e.style.backgroundPosition||n.getPropertyValue("background-position")||"0% 0%").split(",").map(m=>m.trim()),d=[],h=[];for(let m=0;m<f.length;m++){let p=r[m%r.length]||"scroll",g=c[m%c.length],y=u[m%u.length];if(p!=="fixed"){d.push(g),h.push(y);continue}let b=0,w=0,x=f[m]&&f[m].match(/url\(["']?([^"')]+)["']?\)/);if(x)try{let v=new Image;v.src=x[1],await v.decode(),b=v.naturalWidth,w=v.naturalHeight}catch{d.push(g),h.push(y);continue}let C=yu(g,b,w,a,l);if(!C){d.push(g),h.push(y);continue}let S=y.split(/\s+/),M=(v,k,R)=>{if(!v)return 0;if(v.endsWith("px"))return parseFloat(v);if(v.endsWith("%"))return(k-R)*parseFloat(v)/100},_=M(S[0]||"0%",a,C.w),E=M(S[1]||S[0]||"0%",l,C.h);if(_===void 0||E===void 0){d.push(g),h.push(y);continue}d.push(`${Kn(C.w)}px ${Kn(C.h)}px`),h.push(`${Kn(_-o.left)}px ${Kn(E-o.top)}px`)}e.style.setProperty("background-size",d.join(", ")),e.style.setProperty("background-position",h.join(", ")),e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "))}var Kn=t=>Math.round(t*100)/100;async function Qn(t,e,n,r={},i=new Map){if(!e)return;let o=[];t&&Qr(t)&&o.push([t,e]);let s=[e];for(;s.length;){let l=s.pop();if(l.children)for(let f of l.children){if(f.tagName==="STYLE")continue;let c=i.get(f);c&&Qr(c)&&o.push([c,f]),s.push(f)}}let a=6;for(let l=0;l<o.length;l+=a)await Promise.allSettled(o.slice(l,l+a).map(([f,c])=>gu(f,c,n,r)))}St();function sa(t,e,n=new Map){let r=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let a=i.currentNode;a;a=i.nextNode()){let l=n.get(a);if(l?.nodeType!==1)continue;let f=O(l),c=f.getPropertyValue("backdrop-filter")||f.getPropertyValue("-webkit-backdrop-filter");c&&c!=="none"&&a!==e&&r.push({cloneEl:a,orig:l,bf:c,path:vu(e,a)})}if(!r.length)return;let o=t.getBoundingClientRect(),s=r.map((a,l)=>{let f=e.cloneNode(!0);xu(f,e,a.orig.getBoundingClientRect(),n),Cu(ia(f,a.path));for(let c=0;c<l;c++){let u=ia(f,r[c].path);u&&(u.style.setProperty("backdrop-filter","none","important"),u.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...a,copy:f}});for(let{cloneEl:a,orig:l,bf:f,copy:c}of s)wu.has(a.tagName)||Su(a,l,f,c,o)}var wu=new Set(["IMG","INPUT","TEXTAREA","SELECT","CANVAS","VIDEO","AUDIO","IFRAME","EMBED","OBJECT","PROGRESS","METER","HR","BR"]);function Su(t,e,n,r,i){let o=e.getBoundingClientRect();if(!o.width||!o.height)return;let s=O(e),a=e.offsetWidth?o.width/e.offsetWidth:1,l=Math.abs(a-1)>.001?1/a:1;r.style.position="absolute",r.style.left=`${(i.left-o.left)*l}px`,r.style.top=`${(i.top-o.top)*l}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin="0",r.style.filter=n,l!==1&&(r.style.transform=`scale(${l})`,r.style.transformOrigin="top left");let f=document.createElement("div");f.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",f.appendChild(r);let c=document.createElement("div");c.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",c.style.backgroundColor=s.backgroundColor,c.style.backgroundImage=t.style.backgroundImage||s.backgroundImage;for(let u of["background-size","background-position","background-repeat","background-origin","background-clip"])c.style.setProperty(u,s.getPropertyValue(u));t.style.setProperty("background-color","transparent","important"),t.style.setProperty("background-image","none","important"),t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"),s.position==="static"&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(c),t.prepend(f)}var Jn=128;function xu(t,e,n,r){let i=[[t,e]];for(;i.length;){let[o,s]=i.pop(),a=r.get(s);if(a?.nodeType===1){let c=a.getBoundingClientRect();(c.left>n.right+Jn||c.right<n.left-Jn||c.top>n.bottom+Jn||c.bottom<n.top-Jn)&&(o.tagName==="IMG"&&o.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),o.style&&(o.style.backgroundImage="none"))}let l=o.children,f=s.children;for(let c=0;c<l.length;c++)i.push([l[c],f[c]])}}function vu(t,e){let n=[];for(let r=e;r!==t;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function ia(t,e){if(!e)return null;let n=t;for(let r of e)if(n=n.children[r],!n)return null;return n}function Cu(t){if(t)for(let e=t;e&&e.parentNode;){let n=e.parentNode;for(;e.nextSibling;)e.nextSibling.remove();e===t&&e.remove(),e=n}}St();mt();yt();yt();function Mo(t){return oi(t),{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map,warnings:[]}}se();function tr(t,e){if(!t)return()=>{};let n=[],r=200;function i(o){if(e){let f=o.getBoundingClientRect();if(f.width>0||f.height>0){let c=Math.max(f.right,f.left+(o.scrollWidth||0)),u=Math.max(f.bottom,f.top+(o.scrollHeight||0));if(c<e.left-r||f.left>e.right+r||u<e.top-r||f.top>e.bottom+r)return}}let s=getComputedStyle(o),a=ku(o,s);a&&n.push(a);let l=Mu(o,s);l&&n.push(l);for(let f of o.children||[])i(f)}return i(t),()=>n.forEach(o=>o())}function ku(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=Au(e);if(n<=0)return()=>{};if(!ca(t))return()=>{};let r=la(t),i=r.text,o=Eu(e);r.write("X");let s=t.scrollHeight-o;r.restore();let a=s>0?s:_u(e),l=Math.round(a*n+o);if(t.scrollHeight<=l+.5)return()=>{};let f=0,c=i.length,u=-1;for(;f<=c;){let h=f+c>>1;r.write(i.slice(0,Zn(i,h))+"\u2026"),t.scrollHeight<=l+.5?(u=h,f=h+1):c=h-1}let d=(u>=0?i.slice(0,Zn(i,u)):"")+"\u2026";return r.write(d),aa(t,d,r)}function Mu(t,e){if(!t)return()=>{};if(e=e||getComputedStyle(t),e.textOverflow!=="ellipsis")return()=>{};if(e.whiteSpace!=="nowrap"&&e.whiteSpace!=="pre")return()=>{};if(e.overflowX!=="hidden"&&e.overflowX!=="clip")return()=>{};if(!ca(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=la(t),r=n.text,i=0,o=r.length,s=-1;for(;i<=o;){let l=i+o>>1;n.write(r.slice(0,Zn(r,l))+"\u2026"),t.scrollWidth<=t.clientWidth+.5?(s=l,i=l+1):o=l-1}let a=(s>=0?r.slice(0,Zn(r,s)):"")+"\u2026";return n.write(a),aa(t,a,n)}function aa(t,e,n){return()=>{t.textContent===e&&n.restore()}}function la(t){let e=[];for(let r=t.firstChild;r;r=r.nextSibling)r.nodeType===Node.TEXT_NODE&&e.push(r);let n=e.map(r=>r.data);return{text:n.join(""),write(r){e[0].data=r;for(let i=1;i<e.length;i++)e[i].data=""},restore(){for(let r=0;r<e.length;r++)e[r].data=n[r]}}}function Zn(t,e){if(e<=0||e>=t.length)return e;let n=t.charCodeAt(e-1);return n>=55296&&n<=56319?e-1:e}function Au(t){let e=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");e=(e||"").trim();let n=parseInt(e,10);return Number.isFinite(n)&&n>0?n:0}function _u(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function Eu(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function ca(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var Be=["clone","render"],hn={clone:0,render:1},gt="render";function fa(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];if(!e.length)return{stage:gt,loweredBy:[]};let n=-1,r=[];for(let o of e){if(!o||typeof o!="object")continue;let s=o.needs===void 0?gt:o.needs;if(!Object.prototype.hasOwnProperty.call(hn,s))throw new Error(`[SnapDOM] Plugin '${o.name||"(unnamed)"}' declares needs: ${JSON.stringify(s)}, expected one of ${Be.join(", ")}.`);r.push({name:o.name||"(unnamed)",needs:s}),n=Math.max(n,hn[s])}if(n<0)return{stage:gt,loweredBy:[]};let i=Be[n];return{loweredBy:i===gt?[]:r.filter(o=>o.needs===i).map(o=>o.name),stage:i}}function Ue(t,e){return hn[t]>=hn[e]}function ua(t,e,n=Be){let r=n[n.length-1];if(e==null)return r;if(!Object.prototype.hasOwnProperty.call(hn,e))throw new Error(`[SnapDOM] ${t}: needs must be one of ${Be.join(", ")}, got ${JSON.stringify(e)}.`);if(!n.includes(e))throw new Error(`[SnapDOM] ${t} cannot run at stage '${e}'; it supports ${n.join(", ")}.`);return e}function da(t,e,n){let r=e.length?e.map(i=>`'${i}'`).join(", "):"the attached plugins";return new Error(`[SnapDOM] No ${n}: this capture stopped at '${t}' because ${r} asked for needs: '${t}'. It is not re-captured, since that would be a different instant. Ask the plugin for needs: 'render', or capture without it.`)}var ze=[];function He(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function Ao(...t){let e=t.flat();for(let n of e){let r=He(n);if(r){if(r.needs!==void 0&&r.needs!==gt)throw new Error(`[SnapDOM] '${r.name||"(unnamed)"}' declares needs: ${JSON.stringify(r.needs)}, so it can't be a global plugin (it would stop every capture before '${gt}'). Pass it per capture: snapdom(el, { plugins: [...] }).`);ze.some(i=>i&&i.name&&r.name&&i.name===r.name)||ze.push(r)}}}function pa(t){return t&&Array.isArray(t.plugins)?t.plugins:ze}async function Ut(t,e,n){let r=n,i=pa(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,r);typeof a<"u"&&(r=a)}return r}async function er(t,e,n){let r=[],i=pa(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,n);typeof a<"u"&&r.push(a)}return r}function Ru(){ze.length=0}var Fu=0;function Tu(t){let e=[];if(Array.isArray(t))for(let n of t){let r=He(n);if(!r)continue;r.name||(r.name=`anonymous-${++Fu}`);let i=e.findIndex(o=>o&&o.name===r.name);i>=0&&e.splice(i,1),e.push(r)}for(let n of ze)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function ha(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Tu(e)),t}function _o(){return ze.slice()}var Pu=["resolveNode","beforeSnap","beforeClone","afterClone","beforeRender","afterRender"];function nr(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];for(let n of e){let r=He(n);if(!(!r||r.pure===!0)){for(let i of Pu)if(typeof r[i]=="function")return!0}}return!1}yt();Me();var pe="data-snapdom-asset",ba="http://www.w3.org/1999/xlink",$u=0;function or(t,e,n,r,i,o){let s=o.__compressedAssets||=new WeakMap,a=s.get(t);a||(a={token:String(++$u),properties:[]},s.set(t,a),t.setAttribute(pe,a.token));let l=a.properties.find(f=>f.kind===e&&f.name===n);l?(l.compressed!==r&&(l.original=r),l.compressed=i):a.properties.push({kind:e,name:n,original:r,compressed:i})}var wa=(t,e)=>e.kind==="style"?t.style?.getPropertyValue(e.name):t.getAttribute(e.name);function ir(t,e){let n=new Map;if(!t||!e)return n;let r=[t,...t.querySelectorAll(`[${pe}]`)];for(let i of r){let o=e.get(i);if(!o||i.getAttribute(pe)!==o.token)continue;let s=o.properties.filter(a=>wa(i,a)===a.compressed).map(a=>Object.freeze({...a}));s.length&&n.set(o.token,Object.freeze(s))}return n}function sr(t,e){if(!t||!e)return;let n=0;for(let r of[t,...t.querySelectorAll(`[${pe}]`)]){let i=e.get(r);i&&(i.token=String(++n),r.setAttribute(pe,i.token))}}function Sa(t,e){if(!e?.size||typeof t!="string"||!t.startsWith("data:image/svg+xml"))return t;let n=t.indexOf(","),r=new DOMParser().parseFromString(decodeURIComponent(t.slice(n+1)),"image/svg+xml");if(r.querySelector("parsererror"))return t;let i=!1;for(let o of r.querySelectorAll(`[${pe}]`))for(let s of e.get(o.getAttribute(pe))||[])wa(o,s)===s.compressed&&(s.kind==="style"?o.style.setProperty(s.name,s.original,o.style.getPropertyPriority(s.name)):s.name==="xlink:href"?o.setAttributeNS(ba,s.name,s.original):o.setAttribute(s.name,s.original),i=!0);return i?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`:t}function ma(t){if(t.is2D===!1)return 1/0;let e=t.a*t.a+t.b*t.b+t.c*t.c+t.d*t.d,n=t.a*t.d-t.b*t.c;return Math.sqrt((e+Math.sqrt(Math.max(0,e*e-4*n*n)))/2)}function Eo(t,e){let n=e.element||t,r=n.isConnected?O(n):n.style,i=e.__compressionClip,o=(h,m)=>{try{return h[m]?.baseVal?.value||0}catch{return 0}},s=i?.width||n.offsetWidth||parseFloat(r?.width)||o(n,"width"),a=i?.height||n.offsetHeight||parseFloat(r?.height)||o(n,"height"),l=Number.isFinite(e.width),f=Number.isFinite(e.height);if(!i&&(l||f)&&s&&a)try{let h=e.outerTransforms===!1&&e.__compressionRootTransform?e.__compressionRootTransform:ee({baseTransform:r?.transform,rotate:r?.rotate,scale:r?.scale,width:s,height:a});if(h.is2D===!1)s=0,a=0;else{let m=Math.abs(h.a)*s+Math.abs(h.c)*a,p=Math.abs(h.b)*s+Math.abs(h.d)*a;s=Math.min(s,m),a=Math.min(a,p)}}catch{s=0,a=0}let c=(l||f?Math.max(l?s?e.width/s:1/0:0,f?a?e.height/a:1/0:0):e.scale||1)*(e.dpr||1);e.__compressionDensity=c;let u=new WeakMap,d=h=>{if(!h||h.nodeType!==1)return 1;if(u.has(h))return u.get(h);let m=h.isConnected?O(h):h.style,p=1;try{m?.perspective&&m.perspective!=="none"&&(p=1/0);let g=m?.transform;if(g&&g!=="none")p*=ma(new DOMMatrix(g));else if(h.transform?.baseVal?.numberOfItems){let y=new DOMMatrix;for(let b=0;b<h.transform.baseVal.numberOfItems;b++){let w=h.transform.baseVal.getItem(b).matrix;y=y.multiply(new DOMMatrix([w.a,w.b,w.c,w.d,w.e,w.f]))}p*=ma(y)}if(m?.scale&&m.scale!=="none"){let y=m.scale.trim().split(/\s+/).map(b=>parseFloat(b)/(b.endsWith("%")?100:1));p*=Math.max(...y.map(Math.abs))}if(h!==n&&m?.zoom&&m.zoom!=="normal"&&(p*=parseFloat(m.zoom)||1),h.localName==="svg"&&h.viewBox?.baseVal?.width>0&&h.viewBox.baseVal.height>0){let y=h.viewBox.baseVal,b=C=>/^\d+(?:\.\d+)?px$/.test(m?.[C]||"")?parseFloat(m[C]):o(h,C),w=b("width"),x=b("height");p*=w>0&&x>0?Math.max(w/y.width,x/y.height):1/0}}catch{p=1/0}return Number.isFinite(p)||(p=1/0),h!==n&&(p*=d(h.parentElement||h.getRootNode?.().host)),u.set(h,p),p};return{density:c,stretch:d}}var xa=.92,va=1;async function Nu(t){let e=new Image;return e.decoding="sync",e.src=t,typeof e.decode=="function"?(await e.decode(),e):(await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=r}),e)}function Lu(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}var Iu=64*1024,ga=32*1024*1024,rr=new Map;function Ou(t,e,n,r){if(n.length+(r?.length||0)>ga)return;t.set(e,{source:n,result:r});let i=0;for(let o of t.values())i+=o.source.length+(o.result?.length||0);for(;i>ga;){let o=t.keys().next().value,s=t.get(o);i-=s.source.length+(s.result?.length||0),t.delete(o)}}function Du(t,e){let n=t.indexOf(",");if(n<0||!/;base64/i.test(t.slice(0,n)))return null;let r=Math.ceil(e/3)*4,i=t.length-n-1,o=Math.min(i,r);try{let s=atob(t.slice(n+1,n+1+o-o%4)),a=new Uint8Array(s.length);for(let l=0;l<s.length;l++)a[l]=s.charCodeAt(l);return a}catch{return null}}function Wu(t){let e=Du(t,4096);if(!e||e.length<16)return null;let n=r=>e[r]<<8|e[r+1];if(e[0]===137&&e[1]===80&&e.length>=24)return{w:(e[16]<<24|e[17]<<16|e[18]<<8|e[19])>>>0,h:(e[20]<<24|e[21]<<16|e[22]<<8|e[23])>>>0};if(e[0]===71&&e[1]===73&&e[2]===70)return{w:e[6]|e[7]<<8,h:e[8]|e[9]<<8};if(e[0]===82&&e[1]===73&&e[8]===87&&e.length>=30){let r=e[15];if(r===32&&e[23]===157)return{w:(e[26]|e[27]<<8)&16383,h:(e[28]|e[29]<<8)&16383};if(r===76)return{w:(e[21]|(e[22]&63)<<8)+1,h:((e[22]>>6|e[23]<<2|(e[24]&15)<<10)&16383)+1};if(r===88)return{w:(e[24]|e[25]<<8|e[26]<<16)+1,h:(e[27]|e[28]<<8|e[29]<<16)+1}}if(e[0]===255&&e[1]===216){let r=2;for(;r+9<e.length;){if(e[r]!==255){r++;continue}let i=e[r+1];if(i===216||i===1||i>=208&&i<=215){r+=2;continue}if(i>=192&&i<=207&&i!==196&&i!==200&&i!==204)return{h:n(r+5),w:n(r+7)};let o=n(r+2);if(o<2)break;r+=2+o}}return null}function ya(t,e,n,r){let i=Math.min(1,Math.max(n/t,r/e));return!(i>0)||i>=.95?0:i}var Bu=`self.onmessage = async (e) => {
|
|
17
17
|
const { id, dataURL, blob: given, srcLength, targetW, targetH, resFactor, quality, mime } = e.data
|
|
18
18
|
try {
|
|
19
19
|
const blob = given || await (await fetch(dataURL)).blob()
|
|
@@ -37,4 +37,4 @@ ${g}
|
|
|
37
37
|
} catch (err) {
|
|
38
38
|
self.postMessage({ id, error: String(err) })
|
|
39
39
|
}
|
|
40
|
-
}`,Bu=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),Lt=null,Uu=0,zu=0,ue=new Map;function xa(){for(let t of ue.values())t(void 0);if(ue.clear(),Array.isArray(Lt))for(let t of Lt)try{t?.terminate()}catch{}Lt=!1}function Hu(){let t,e=null;try{t=URL.createObjectURL(new Blob([Wu],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=ue.get(n.data.id);r&&(ue.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=xa}catch{e=null}return t&&URL.revokeObjectURL(t),e}function ju(){if(Lt===!1)return!1;if(Lt===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return Lt=!1;Lt=[]}let t=Uu++%Bu;if(!Lt[t]){let e=Hu();if(!e)return xa(),!1;Lt[t]=e}return Lt[t]}var Vu=5e3;function qu(t,e,n,r,i){let o=ju();return o?new Promise(s=>{let a=++zu,c=setTimeout(()=>{ue.delete(a),s(void 0)},Vu);ue.set(a,u=>{clearTimeout(c),s(u)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:Sa,quality:wa,mime:r})}catch{clearTimeout(c),ue.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function Eo(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=I.compress,s=o.get(i);if(s?.source===t)return s.result;let a=er.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Nu(t),f=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",d=Du(t);if(d&&d.w>0&&d.h>0&&!ma(d.w,d.h,e,n))return null;if(t.length>=Lu){let S=await qu(t,e,n,f,r);if(S!==void 0)return S}let h;try{h=await $u(t)}catch{return null}let m=h.naturalWidth||h.width,p=h.naturalHeight||h.height;if(!m||!p)return null;let g=ma(m,p,e,n);if(!g)return null;let y=g*Sa,b=Math.max(1,Math.round(m*y)),w=Math.max(1,Math.round(p*y)),v=document.createElement("canvas");v.width=b,v.height=w;let C=v.getContext("2d");if(!C)return null;C.imageSmoothingEnabled=!0,C.imageSmoothingQuality="high",C.drawImage(h,0,0,b,w);try{let S=v.toDataURL(f,wa);if(typeof S=="string"&&S.startsWith("data:image")&&S.length<t.length)return S}catch{}return null})(),u={source:t,promise:c,cache:o};er.set(i,u);try{let l=await c;return Iu(o,i,t,l),l}finally{er.get(i)===u&&er.delete(i)}}async function Gu(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 f=l.getAttribute("src")||"";if(!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let d=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,h=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!d||!h)return;let m=r.value||=_o(t,e),p=m.density*m.stretch(n.get(l)||l),g=await Eo(f,d*p,h*p,l.__snapdomBlob);g&&(o++,s+=f.length,a+=g.length,l.setAttribute("src",g),nr(l,"attribute","src",f,g,e))},u=6;for(let l=0;l<i.length;l+=u)await Promise.allSettled(i.slice(l,l+u).map(c));return{count:o,before:s,after:a}}var Xu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function Yu(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function Ku(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=[],o=[t,...t.querySelectorAll("*")];for(let u of o){let l=u.style&&u.style.backgroundImage;l&&l.includes("data:image")&&i.push(u)}let s=0,a=async u=>{let l=n.get(u);if(!l||!l.isConnected)return;let f;try{f=getComputedStyle(l)}catch{return}if((f.backgroundRepeat||"repeat").toLowerCase().split(",").some(_=>_.trim()!=="no-repeat"))return;let h=(u.style.backgroundSize||f.backgroundSize||"auto").toLowerCase();if(h.split(",").some(_=>!Xu.test(_.trim())))return;let{w:m,h:p}=Yu(l);if(!m||!p)return;let g=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(_=>parseFloat(_)/100)),y=r.value||=_o(t,e),b=y.density*y.stretch(l)*g,w=m*b,v=p*b,C=u.style.backgroundImage,S=[...C.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],M=C;for(let _ of S){let E=_[2];if(E.startsWith("data:image/svg"))continue;let x=await Eo(E,w,v);x&&(M=M.split(E).join(x),s++)}M!==C&&(u.style.setProperty("background-image",M,u.style.getPropertyPriority("background-image")),nr(u,"style","background-image",C,u.style.backgroundImage,e))},c=6;for(let u=0;u<i.length;u+=c)await Promise.allSettled(i.slice(u,u+c).map(a));return{count:s}}async function Qu(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 u=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!u||!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",f=c.getAttribute("height")||"";if(l.includes("%")||f.includes("%"))return;let d=n.get(c),h=d?O(d):c.style,m=(v,C)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[v]||""))return parseFloat(h[v]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(C.trim()))return parseFloat(C);try{return d?.[v]?.baseVal?.value||0}catch{return 0}},p=m("width",l),g=m("height",f);if(!p||!g)return;let y=r.value||=_o(t,e),b=y.density*y.stretch(d||c),w=await Eo(u,p*b,g*b);w&&(c.setAttribute("href",w),nr(c,"attribute","href",u,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(ga,"xlink:href",w),nr(c,"attribute","xlink:href",u,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 ir(t,e,n){if(!e.compress)return;let r={};await Gu(t,e,n,r),await Ku(t,e,n,r),await Qu(t,e,n,r)}St();yt();Mt();function Ju(t,e){if(X())return t;let n=t.indexOf("</style>");if(n===-1)return t;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,u;for(let y of i)if(y.intern)for(c.lastIndex=0;u=c.exec(y.text);)a.set(u[1],(a.get(u[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 f=Zu(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(f===null)return t;let d=new Map,h=0,m=[],p=(y,b)=>{if((a.get(b)||0)<2||f.has(b))return y;let w=d.get(b);return w===void 0&&(w="i"+(h++).toString(36),d.set(b,w),m.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,p):y.text;return t.slice(0,n)+m.join("")+g}function Zu(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let u=c.getAttribute("style");u&&r.add(u)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=u=>{for(let l of u){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 u of[...t.querySelectorAll("style")].slice(1)){let l=u.textContent||"";if(/@import\b/i.test(l))return null;let f=new CSSStyleSheet;f.replaceSync(l),c(f.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 u=a.serializeToString(s).match(/ style="([^"]*)"/);u&&o.add(u[1])}return o}async function sr(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:Q,...et}=t;t=Object.assign(a,et),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,u;ta(t,s),await Bt("beforeRender",t);let l=O(t.element),f=t.element.getBoundingClientRect(),d=Math.max(1,D(t.element.offsetWidth||parseFloat(l.width)||f.width||1)),h=Math.max(1,D(t.element.offsetHeight||parseFloat(l.height)||f.height||1)),m=t.element.ownerDocument||document;if(!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned){let Q=Math.max(t.element.scrollHeight||0,m.documentElement?.scrollHeight||0,m.body?.scrollHeight||0),et=Math.max(t.element.scrollWidth||0,m.documentElement?.scrollWidth||0,m.body?.scrollWidth||0);Q>0&&(h=Math.max(h,D(Q))),et>0&&(d=Math.max(d,D(et)));try{let tt=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,rt=I.measureHints.get(t.element);if(rt&&rt.cssLen===tt&&rt.w0===d&&rt.docH===Q&&rt.docW===et)rt.csh>0&&(h=Math.max(h,D(rt.csh))),rt.csw>0&&(d=Math.max(d,D(rt.csw)));else{let ot=m.createElement("div");Z(ot),ot.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+d+"px!important;overflow:visible!important;visibility:hidden!important;";let ee=ot.attachShadow({mode:"open"}),ne=m.createElement("style");ne.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,ee.appendChild(ne),ee.appendChild(t.clone.cloneNode(!0)),m.body.appendChild(ot);let Ye=ot.scrollHeight,Vt=ot.scrollWidth;m.body.removeChild(ot),I.measureHints.set(t.element,{cssLen:tt,w0:d,docH:Q,docW:et,csh:Ye,csw:Vt}),Ye>0&&(h=Math.max(h,D(Ye))),Vt>0&&(d=Math.max(d,D(Vt)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let Q=xo(t.element,t.options),et=1,tt=xo(t.element,{}),rt=Math.max(2,h*.15);Number.isFinite(tt)&&tt>=h-rt&&Number.isFinite(Q)&&Q>0&&(h=Math.max(1,Math.min(h,D(Q+et))))}if(t.options?.reconcile)try{let Q=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Zs(t.element,t.clone,Q,t.nodeMap,d,h)}catch(Q){console.warn("[SnapDOM] reconcile couldn't run; captured without it.",Q)}let g=(Q,et=NaN)=>{let tt=typeof Q=="string"?parseFloat(Q):Q;return Number.isFinite(tt)?tt:et},y=g(t.options.width),b=g(t.options.height),w=n?D(n.width):d,v=n?D(n.height):h,C=w,S=v,M=Number.isFinite(y),_=Number.isFinite(b),E=v>0?w/v:1;M&&_?(C=Math.max(1,D(y)),S=Math.max(1,D(b))):M?(C=Math.max(1,D(y)),S=Math.max(1,D(C/(E||1)))):_&&(S=Math.max(1,D(b)),C=Math.max(1,D(S*(E||1))));let x=0,k=0,R=d,T=h;if(n){let Q=0,et=0;if(Ro(t.element)){let tt=null;if(!r&&o&&Number.isFinite(o.a))tt={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let rt=fe(t.element),ot=So(l.transform&&l.transform!=="none"?l.transform:"",rt);ot&&ot.is2D&&(tt={a:ot.a,b:ot.b,c:ot.c,d:ot.d,e:0,f:0})}if(tt&&!(tt.a===1&&tt.b===0&&tt.c===0&&tt.d===1)){let{ox:rt,oy:ot}=dn(l,d,h),ee=Oe(d,h,tt,rt,ot);Q=ee.minX,et=ee.minY}}x=D(n.x+Q),k=D(n.y+et),R=D(x+n.width),T=D(k+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},et=Oe(d,h,Q,0,0);x=D(et.minX),k=D(et.minY),R=D(et.maxX),T=D(et.maxY)}else if(r&&Ro(t.element)){let et=l.transform&&l.transform!=="none"?l.transform:"",tt=fe(t.element),rt=Zt({baseTransform:et,rotate:tt.rotate||"0deg",scale:tt.scale,translate:tt.translate,width:d,height:h}),{ox:ot,oy:ee}=dn(l,d,h),ne=rt.is2D?rt:new DOMMatrix(rt.toString()),Ye={a:ne.a,b:ne.b,c:ne.c,d:ne.d,e:0,f:0},Vt=Oe(d,h,Ye,ot,ee);x=D(Vt.minX),k=D(Vt.minY),R=D(Vt.maxX),T=D(Vt.maxY)}let L=po(l),W=ho(l),P=mo(l),A=go(l),N=yo(l),$=f.width>0?(R-x)/f.width:1,F=f.height>0?(T-k)/f.height:1,z=i==="subtree"&&!n?Us(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},q=n?{top:0,right:0,bottom:0,left:0}:i?{top:D(Math.max(L.top,W.top,z.top)+P.top+A.top+N.bleed.top),right:D(Math.max(L.right,W.right,z.right)+P.right+A.right+N.bleed.right),bottom:D(Math.max(L.bottom,W.bottom,z.bottom)+P.bottom+A.bottom+N.bleed.bottom),left:D(Math.max(L.left,W.left,z.left)+P.left+A.left+N.bleed.left)}:{top:P.top,right:P.right,bottom:P.bottom,left:P.left};x=D(x-q.left),k=D(k-q.top),R=D(R+q.right),T=D(T+q.bottom);let j=Math.max(1,D(R-x)),J=Math.max(1,D(T-k)),B="http://www.w3.org/2000/svg",ut=Ro(t.element)?2:0,at=D(ut+(r?0:1)),st=Math.ceil(j+at*2),nt=Math.ceil(J+at*2),pt=D(-(D(x)-at)),zt=D(-(D(k)-at)),ge=Math.max(0,pt),V=Math.max(0,zt),G=D(st-Math.min(0,pt)),U=D(nt-Math.min(0,zt)),ht=m.defaultView||window,Y=!X()&&CSS.supports("zoom","2")&&ht.devicePixelRatio||1;a.__layoutZoom=Y;let Ct=document.createElementNS(B,"foreignObject");Ct.setAttribute("x",String(Math.min(0,pt)*Y)),Ct.setAttribute("y",String(Math.min(0,zt)*Y)),Ct.setAttribute("width",String(G*Y)),Ct.setAttribute("height",String(U*Y)),Ct.style.overflow="visible";let ye=document.createElement("style"),bn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";ye.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+bn+t.classCSS,Ct.appendChild(ye);let Ge=document.createElement("div");Ge.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ge.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${G}px;height:${U}px`+(ge!==0||V!==0?`;padding:${V}px 0 0 ${ge}px !important`:"")+(Y!==1?`;zoom:${Y} !important`:""),Ge.appendChild(t.clone),Ct.appendChild(Ge);let Sr=new XMLSerializer().serializeToString(Ct),Ht=M||_,xr=Object.freeze({w0:w,h0:v,vbW:st,vbH:nt,targetW:C,targetH:S,contentX:D(pt+(n?x:0)),contentY:D(zt+(n?k:0)),clip:n?Object.freeze({x:D(x),y:D(k),width:w,height:v}):null});Object.defineProperty(a,"meta",{value:xr,enumerable:!0,writable:!1,configurable:!0});let vr=!Ht||X()?st:M?C:D(st*(S/nt)),wn=!Ht||X()?nt:_?S:D(nt*(C/st)),jt=parseFloat(O(m.documentElement)?.fontSize)||16,ei=Y!==1,lc=`<svg xmlns="${B}" width="${vr}" height="${wn}" viewBox="0 0 ${st} ${nt}" font-size="${jt}px">${ei?`<g transform="scale(${1/Y})">`:""}`,fc=ei?"</g></svg>":"</svg>";u=lc+Ju(Sr,Ct)+fc,c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(u)}`,t.svgString=u,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Bt("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let Cr=[...document.querySelectorAll("#snapdom-sandbox")].find(Gt);return Cr&&Cr.style.position==="absolute"&&Cr.remove(),t.dataURL}function Ro(t){return Hs(t)}function td(t){let e=Array.isArray(t.plugins)?t.plugins:Ao(),n=[];for(let r of e){let i=ze(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function va(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=ko(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=td(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,u,l="",f=null,d=e.needs||gt,h=n.format,m=n.type;await Bt("beforeSnap",n);let p=n.format!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(p||g){let R=String(p?n.format:n.type).toLowerCase();n.format=R==="jpg"?"jpeg":R,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Bt("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?jn(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=Ni(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let v=xi(e.fast);for(;;){e.__slicer=v;let R=Jn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:u}=await ea(n.element,n.options)),c>0&&!e.reconcile&&(At(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),I.warnedReconcile||(I.warnedReconcile=!0,console.warn("[SnapDOM] Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!y&&r&&(f=zs(n.element,r)),!b&&r&&Ys(n.element,r,n.options),r&&(Qs(n.element,r,a),Ks(n.element,r))}finally{R()}if(!v?.yielded||!e.__tornSinceStart?.())break;v=null,e.__session=ko(e.cache)}if(e.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Bt("afterClone",n),!Be(d,"render"))return null;if(v?.due()&&await v.pause(),Vn(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{Js(n.element,n.clone,n.styleCache,n.nodeMap)}catch(R){At(e.__session,"shrink-failed","shrink pass failed",R),console.warn("[SnapDOM] Couldn't close the gaps left by removed elements.",R)}try{await Ln(n.clone,n.element,n.nodeMap)}catch{}let C=R=>Promise.resolve().then(R),S=(async()=>{await Promise.all([C(()=>Gn(n.clone,n.options)),C(()=>Yn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{oa(n.element,n.clone,n.nodeMap)}catch(R){At(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",R),console.warn("[SnapDOM] Couldn't reproduce a backdrop-filter; captured without it.",R)}if(e.compress&&(e.__compressionClip=u,e.__compressionRootTransform=f,await C(()=>ir(n.clone,n.options,n.nodeMap))),e.captureSelection)try{us(n.nodeMap)}catch(R){At(e.__session,"selection-compose-failed","field selection compose failed",R)}})(),M=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(M=C(async()=>{let R=n.element.ownerDocument||document,T=w?P=>{try{let A=P.getBoundingClientRect();return A.right>=w.left-200&&A.left<=w.right+200&&A.bottom>=w.top-200&&A.top<=w.bottom+200}catch{return!0}}:null,{required:L,usedCodepoints:W}=!w&&e.__fontUsage||Wn(n.element,T);if(e.embedFonts==="auto"){let P=new Set;try{for(let N of R.fonts)P.add(String(N.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(P.size>0&&Array.from(L).some(N=>P.has(String(N).split("__")[0].toLowerCase()))))return}if(X()){let P=new Set(Array.from(L).map(A=>String(A).split("__")[0]).filter(Boolean));await Bn(P,1,R)}l=await Ms({required:L,usedCodepoints:W,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:R})})),await Promise.all([S,M]);let E=(n.options.plugins||[]).some(R=>R&&(typeof R.beforeRender=="function"||typeof R.afterRender=="function"));n.options.engine,v?.due()&&await v.pause();let x=n.clone;or(x,e.__compressedAssets);let k=await sr(n,{clipWindow:u,outerTransforms:y,outerShadows:b,rootTransform2D:f,fontsCSS:l});if(e.__compressedSnapshot=rr(x,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:u,outerTransforms:y,outerShadows:b,rootTransform2D:f,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return k}yt();kt();var ed=new Set(["png","jpeg","jpg","webp","svg"]);function Ca(t={}){let e=typeof t.type=="string"&&ed.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=ni(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let f of o)if(typeof f=="string")try{document.createDocumentFragment().querySelector(f),s.push(f)}catch{console.warn(`[SnapDOM] Invalid exclude selector "${f}"; ignored.`)}else typeof f=="function"?a.push(f):f!=null&&console.warn("[SnapDOM] Ignored an exclude entry: use a CSS selector or a function.",f);let c=t.excludeMode??"hide",u=f=>{if(!f||f.nodeType!==1)return!1;if(f.getAttribute("data-capture")==="exclude")return!0;for(let d of Array.isArray(l.exclude)?l.exclude:[])try{if(f.matches(d))return!0}catch{}for(let d of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(d(f))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(f))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:u,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:it(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:ms(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}mt();oe();St();var ka="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function nd(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var rd=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function od(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(rd.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function id(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 Ma=new WeakMap;function sd(t){let e=Wt(),n=Ma.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],u=c.selectorText;if(u&&/[+~]|:has\(/.test(u)){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 Ma.set(t,{epoch:e,leaky:r}),r}var ad=1/16;function cd(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)<=ad}var ar=new Map,ld=["width","height","min-width","min-height"];function fd(t){let e=ar.get(t);if(e===void 0){e=null;for(let n of ld){let r=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));r&&r[1].endsWith("px")&&((e||={})[n]=r[1])}ar.size>5e3&&ar.clear(),ar.set(t,e)}return e}function ud(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function dd(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 Fo={attempts:0,served:0,reconciled:0};async function Aa(t,e,n){Fo.attempts++;try{let r=await pd(t,e,n);return r&&Fo.served++,r}catch{return null}}async function pd(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||nd(t)||od(r)||r.fontsCSS||tr(n))return null;for(let f of n.plugins||[])if(f&&(typeof f.beforeSnap=="function"||typeof f.beforeClone=="function"||typeof f.resolveNode=="function"||typeof f.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=an(t);if(!o||sd(i))return null;let s=[];t:for(let f of e.dirtyRoots){if(!f.isConnected||f===t||!t.contains(f))return null;for(let d of e.dirtyRoots)if(d!==f&&d!==t&&d.contains(f))continue t;s.push(f)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let f of s){if(f.parentElement===t||f.matches?.(ka)||f.querySelector?.(ka)||id(f,o))return null;let d=r.srcToClone.get(f);if(!d||!d.parentNode)return null;let h=new Map,m={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:h,options:n},p=Jn(f,null),g=Hn(f),y;try{y=await Jt(f,m,n)}finally{g(),p()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Ie(f,y,m,n),m.__pseudoCSS)||m.__usesPlaceholder&&!r.classPrefixCSS?.includes("[data-sd-ph]"))return null;await Fn(y,m),Vn(y);try{await Ln(y,f,h)}catch{}if(await Promise.all([Gn(y,n),Yn(f,y,r.styleCache,n,h)]),n.compress)try{await ir(y,n,h)}catch{}for(let[b,w]of h.entries())Co(b,w,h,r.styleCache);d.replaceWith(y),dd(d,r);for(let[b,w]of h.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[f,d]of r.nodeMap.entries()){if(!d||d.nodeType!==1||!d.isConnected)continue;let h=r.styleMap.get(f);if(!h)continue;let m=fd(h);if(!m)continue;let p=null,g=!1;for(let y in m)if(p||=getComputedStyle(d),!cd(p.getPropertyValue(y),m[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(f))return null;Fo.reconciled++,await dt(d,f,a,n)}}let c=Ze(r.styleMap);for(let[f,d]of r.styleMap.entries())ud(f),vo(f,d,c);let u=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([f,d])=>`.${d}{${f}}`).join("");or(r.clone,n.__compressedAssets);let l=await sr({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:u,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=rr(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}kt();var Po=new WeakMap,lr=new WeakMap,Oa=new WeakSet,To=new WeakMap,hd=64,hn=new Map,Da=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],md=["(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 gd(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":md.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function _a(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 Ea(t,e){if(e.disposed||(hn.delete(t),hn.set(t,e),hn.size<=hd))return;let[n,r]=hn.entries().next().value;Wa(n,r)}function Wa(t,e){e.disposed=!0,hn.delete(t),Po.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of Da)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of No)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 Ba(t){if(Oa.has(t))return!1;lr.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 u="";if(c==="img"){r.push(a);try{u=a.currentSrc||a.src||""}catch{}}/^(?:input|textarea|select|option)$/.test(c)&&n.push(a);let l=a.getAttribute?.("style")||"",f=To.get(a);if(u||l){if((!f||f.src!==u||f.style!==l)&&(f={src:u,style:l,animated:Ve(u)||Ve(l)},To.set(a,f)),f.animated)return!1}else f&&To.delete(a)}}return lr.set(t,{roots:e.slice(1),controls:n,images:r}),!0}function $o(t,e){if(!t.querySelectorAll)return!1;let n=lr.get(t);lr.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 No)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 No)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var No=["scroll","change","beforetoggle","toggle"];function fr(t,e){return[t,...e.trackedShadowRoots.keys()]}function Lo(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of fr(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 Ra(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(ae(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 yd=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,je=t=>t&&(typeof t=="object"||typeof t=="function")?cr(t):"-";function bd(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 wd(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=bd(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 Fa(t){let e=String(t||"").trim();return e?yd.test(e)?!0:/^data:/i.test(e)?wd(e):!1:!1}function Ve(t){let e=String(t||"");if(Fa(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(Fa(n[1]??n[2]??n[3]))return!0;return!1}function Ta(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 Ua(i))if(Ve(o.getAttribute?.("src"))||Ve(o.getAttribute?.("href"))||Ve(o.getAttribute?.("style"))||Ve(t.styleMap?.get(o)))return!0;return!1}function Ua(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function Io(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 fr(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function Oo(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 fr(t,e))for(let s of Ua(o))i(s);e.scrollNodes=n}function Pa(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",gd(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(je))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(je))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(je(o)),(s?.contains(t)||t.contains(s))&&i.push(je(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 f=String(l.localName||"").toLowerCase();f==="input"?c.push(l.type,Qe(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):f==="textarea"?c.push(l.value):f==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let u=[];for(let l of e.images){let f="";try{f=l.currentSrc||l.src||""}catch{}u.push(f,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:u,frameDriven:e.retainedFrameDriven}}function He(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 $a(t,e){let n=new Set;for(let r of fr(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 Na(t){return t.map(e=>[je(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Sd(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 xd(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:_e(),styleEpoch:Wt(),styleStamp:sn(t),outsideMutations:on(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)ae(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 Da)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return $o(t,e)||Io(t,e),Oo(t,e),Lo(t,e),e}var vd=0,La=new WeakMap;function cr(t){let e=La.get(t);return e||(e="@"+ ++vd,La.set(t,e)),e}function Do(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(cr(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(cr(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=Do(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(cr(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=Do(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function Ia(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=Do(i,new Set);return o===null?null:`${(e||[]).map(je).join(",")}:${o}`}catch{return null}}function za(t,e,n,r,i=null){let o=Po.get(t);o||(o=xd(t),o.baselineSignature=Ia(e,n.plugins),Po.set(t,o));let s=Ia(e,n.plugins),a=async()=>{if(o.disposed)return r();let u=s===null||s!==o.baselineSignature;u&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,u=!1):o.pendingSig=s:o.pendingSig=null,$o(t,o),Lo(t,o);for(let M of o.observers)M.__flush(M.takeRecords());Tt();let l=on(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let f=t.getRootNode?.(),d=[...o.trackedShadowRoots.keys()];f?.nodeType===11&&!d.includes(f)&&d.push(f),_n(t.ownerDocument||document,d);let h=sn(t);o.styleStamp!==h&&(o.styleStamp=h,o.dirty||o.dirtyAll());let m=Pa(t,o),p=$a(t,o);m.animation=Na(p),o.renderState&&(!He(o.renderState,m,"style")&&(Ee(),o.dirtyAll()),He(o.renderState,m,"scroll")||o.dirtyAll(),He(o.renderState,m,"controls")||(ce(t),o.dirtyAll()),!He(o.renderState,m,"images")&&!o.dirty&&o.dirtyAll());let g=_e();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Wt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let M=_a(t);o.geometry!==null&&M!==o.geometry&&(ce(t),o.dirtyAll()),o.geometry=M}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!He(o.renderState,m,"animation");try{let M=new Set;w&&p.length===0&&(M=null);for(let _ of p){let E=_.playState==="running";if(!E&&!w)continue;E&&(b=!0),w=!0;let x=_.effect?.target;if(Sd(t,o,x)===t)M.add(x);else{M=null;break}}if(w&&M&&M.size&&o.retained){o.dirty=!0;for(let _ of M)o.dirtyRoots&&o.dirtyRoots.add(_),ce(_)}else w&&!M&&o.dirtyAll()}catch{}let v=m.frameDriven,C=b||v;if(C&&(o.last=null),v&&o.dirtyAll(),!u&&!C&&!o.dirty&&o.last)return Ea(t,o),o.last;o.capturing=!0;let S=null;try{let M=null,_=!1,E=null;if(!u&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){E=[...o.dirtyRoots];let x=await Aa(t,o,n);x&&(M=await i(x),_=!0)}if(M||(u||(n.__retain=x=>{let k=new Map;for(let[R,T]of x.nodeMap.entries())k.set(T,R);S={...x,srcToClone:k}}),n.__tornSinceStart=()=>{for(let x of o.observers)for(let k of x.takeRecords())o.pending.push(k);return Tt(),o.torn||Ra(o.pending)||on(t)!==l},M=await r()),!u&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=Ta(S),Io(t,o),Oo(t,o)):_&&(o.retainedFrameDriven||=Ta(o.retained,E),Io(t,o),Oo(t,o));let x=Pa(t,o);x.animation=Na($a(t,o));let k=["style","scroll","controls","images"];b||k.push("animation");let R=k.every(T=>He(m,x,T));o.renderState=x,o.styleEpoch=Wt(),o.styleStamp=sn(t),o.geometry=_a(t),o.renderState.frameDriven?(Oa.add(t),Wa(t,o)):R?!C&&!o.renderState.frameDriven&&(o.last=M,Ea(t,o)):(o.dirtyAll(),o.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let _ of o.observers)for(let E of _.takeRecords())o.pending.push(E);Tt();let M=on(t);(o.torn||Ra(o.pending)||M!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=M,o.styleEpoch=Wt(),o.styleStamp=sn(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||($o(t,o),Lo(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var ur=null;function Va(t){ur=t}var Cd='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Wo=!1,mn=null,Bo=new WeakMap,Ha=!1;function qa(t,e){!Wo||!mn||e&&e.burst===!1||Bo.set(mn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Ga(t){let e={control:t};mn=e,setTimeout(()=>{mn===e&&(mn=null)},0)}function zo(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(Cd):null}function ja(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=zo(t);e&&(Ga(e),Uo(t,!1))}function kd(t){let e=zo(t);e&&Ga(e)}function Uo(t,e=!0){if(!ur||document.visibilityState==="hidden")return;let n=zo(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=Bo.get(n);if(r){if(!r.element.isConnected){Bo.delete(n);return}ur(r.element,r.options).catch(()=>{});return}e&&!Ha&&(Ha=!0,ur(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Xa(){if(Wo||typeof document>"u"||typeof document.addEventListener!="function")return;Wo=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",ja,t),document.addEventListener("keydown",ja,t),document.addEventListener("click",kd,t),document.addEventListener("pointerenter",Uo,t),document.addEventListener("focusin",Uo,t)}Mt();function Hd(...t){return Mo(...t),K}async function jd(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");Z(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await bt();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 ti(i,{...e||{},burst:!1})}finally{n.remove()}}var Vd="3.3.3",K=Object.assign(ti,{plugins:Hd,fromString:jd,version:Vd,preCapture:Xa});Va(ti);var Zo=Symbol("snapdom.internal"),qd=Symbol("snapdom.internal.silent"),ac=new Set(["png","jpeg","jpg","webp","svg"]);async function ti(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=Ca(e);n.element=t,n.invalidate&&Ee(),da(n,e&&e.plugins);let{stage:r,loweredBy:i}=ca(n);n.needs=r,n.__needsLoweredBy=i;let o=Be(r,"render"),s=n.burst===!0||!tr(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",u=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&Ba(t);return u&&qa(t,e),n.snap||(n.snap={toPng:(l,f)=>K.toPng(l,f),toSvg:(l,f)=>K.toSvg(l,f)}),u?za(t,e,n,()=>K.capture(t,n,Zo),l=>cc(l,n)):K.capture(t,n,Zo)}K.capture=async(t,e,n)=>{if(n!==Zo)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(Be(e.needs||gt,"render")&&X()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=Wn(t);e.clip||(e.__fontUsage=a);let c=a.required,u=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(u=new Set([...u].filter(l=>s.has(l.toLowerCase()))),u.size===0))throw null;await Bn(u,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(fn(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){H(e,"Couldn't prepare canvases for Safari.",s)}}let r=await va(t,e);return cc(r,e)};async function cc(t,e){let n=e.needs||gt,r=Be(n,"render"),i=A=>fa(n,e.__needsLoweredBy||[],A),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??=o.toDataURL(),c=o||t;o&&(t="");let u=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let f,d=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!X(),p=m?Number.isFinite(e.width)?d.targetW/d.vbW:d.targetH/d.vbH:1,g=m?Number.isFinite(e.height)?d.targetH/d.vbH:d.targetW/d.vbW:1,y=A=>{if(o||!u?.size)return c;let N=d.vbW,$=d.vbH,F=A.crop;F&&(N=Math.max(1,Math.min(N,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,F.y+F.height)-Math.max(0,F.y)));let z=Number.isFinite(A.width),q=Number.isFinite(A.height);return(z&&q?Math.max(A.width/N,A.height/$):z?A.width/N*(F?Math.max(1,g/p):1):q?A.height/$*(F?Math.max(1,p/g):1):(A.scale||1)*Math.max(p,g))*(A.dpr||1)<=l?c:f??=ba(a(),u)},b=async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn));return $(c,{...A,...N||{},format:"png"})},w=()=>{if(!r)throw i("svgString");if(o)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let A=t.indexOf(",");return A>=0?decodeURIComponent(t.slice(A+1)):""},v=A=>Object.defineProperty({...A||{},svgString:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),C={img:async(A,N)=>{if(o)return b(A,N);let{toImg:$}=await Promise.resolve().then(()=>(Yo(),Xo)),F={...A,...N||{}};return $(y(F),F)},svg:async(A,N)=>{if(o)return b(A,N);let{toSvg:$}=await Promise.resolve().then(()=>(Yo(),Xo)),F={...A,...N||{}};return $(y(F),F)},canvas:async(A,N)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(me(),Za)),F={...A,...N||{}};return $(y(F),F)},blob:async(A,N)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Jo(),rc)),F={...A,...N||{}};return $(y(F),F)},png:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn)),F={...A,...N||{},format:"png"};return $(y(F),F)},jpeg:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn)),F={...A,...N||{},format:"jpeg"};return $(y(F),F)},webp:async(A,N)=>{let{rasterize:$}=await Promise.resolve().then(()=>(qe(),yn)),F={...A,...N||{},format:"webp"};return $(y(F),F)},download:async(A,N)=>{let{download:$}=await Promise.resolve().then(()=>(sc(),ic)),F={...A,...N||{}};return $(y(F),F)}};if(!r)for(let A of Object.keys(C)){let N=A==="download"?"download()":`to${A.charAt(0).toUpperCase()}${A.slice(1)}()`;C[A]=async()=>{throw i(N)}}let S={};for(let A of["img","svg","canvas","blob","png","jpeg","webp"])S[A]=async N=>C[A](e,{...R(A,N||{}),[qd]:!0});S.jpg=S.jpeg;let M=A=>Object.defineProperty({...e,...A},"options",{value:e,configurable:!0}),_=M({artifacts:e.__artifacts||null,export:v(),exports:S}),E=await Zn("defineExports",_),x=Object.assign({},...E.filter(A=>A&&typeof A=="object").reverse()),k={...C,...x};k.jpeg&&!k.jpg&&(k.jpg=(A,N)=>k.jpeg(A,N));function R(A,N){let $=N||{},F={...e,...$},z=typeof $.type=="string"?$.type.toLowerCase():"",q=typeof $.format=="string"?$.format.toLowerCase():ac.has(z)?z:"";q&&(F.format=q==="jpg"?"jpeg":q),F.__explicitFormat=q?F.format:e.__explicitFormat??null,A==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let j=B=>B==="jpeg"||B==="jpg"||B==="webp";return[A,F.format,z].map(B=>typeof B=="string"?B.toLowerCase():"").find(j)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&H(F,"scale ignored: width/height already set the size."),F}let T=!1,L=Promise.resolve();async function W(A,N){let $=Object.freeze(N&&typeof N=="object"?{...N}:{}),F=async()=>{let q=k[A];if(!q)throw new Error(`[SnapDOM] Unknown export type: ${A}`);let j=R(A,$),J=M({artifacts:e.__artifacts||null,export:v({type:A,options:j,requestedOptions:$})}),B=j.format,ut=j.type;await Zn("beforeExport",J,{format:A,options:j});let vt=j.format!==B?j.format:j.type!==ut?j.type:"",at=typeof vt=="string"?vt.toLowerCase():"";ac.has(at)&&(j.format=at==="jpg"?"jpeg":at,j.type=j.format,j.__explicitFormat=j.format,/^(?:jpeg|webp)$/.test(j.format)&&(j.backgroundColor==null||j.backgroundColor==="transparent")&&(j.backgroundColor="#ffffff"));let st=await q(J,j);return await Zn("afterExport",J,{format:A,options:j,result:st}),T||(T=!0,await Bt("afterSnap",e)),st},z=L.then(F);return L=z.catch(()=>{}),z}let P={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(A,N)=>W(A,N),toImg:A=>W("img",A),toSvg:A=>W("svg",A),toCanvas:A=>W("canvas",A),toBlob:A=>W("blob",A),toPng:A=>W("png",A),toJpg:A=>W("jpg",A),toWebp:A=>W("webp",A),download:A=>W("download",A)};r?o&&Object.defineProperty(P,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(P,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(P,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let A of Object.keys(k)){let N="to"+A.charAt(0).toUpperCase()+A.slice(1);P[N]||(P[N]=$=>W(A,$))}return P}K.toRaw=(t,e)=>K(t,e).then(n=>n.toRaw());K.toImg=(t,e)=>K(t,e).then(n=>n.toImg());K.toSvg=(t,e)=>K(t,e).then(n=>n.toSvg());K.toCanvas=(t,e)=>K(t,e).then(n=>n.toCanvas());K.toBlob=(t,e)=>K(t,e).then(n=>n.toBlob());K.toPng=(t,e)=>K(t,{...e,format:"png"}).then(n=>n.toPng());K.toJpg=(t,e)=>K(t,{...e,format:"jpeg"}).then(n=>n.toJpg());K.toWebp=(t,e)=>K(t,{...e,format:"webp"}).then(n=>n.toWebp());K.download=(t,e)=>K(t,e).then(n=>n.download());export{gt as DEFAULT_STAGE,We as STAGES,la as assertNeeds,Eu as clearPlugins,Ao as getGlobalPlugins,ze as normalizePlugin,Mo as registerPlugins,K as snapdom};
|
|
40
|
+
}`,Uu=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),It=null,zu=0,Hu=0,de=new Map;function Ca(){for(let t of de.values())t(void 0);if(de.clear(),Array.isArray(It))for(let t of It)try{t?.terminate()}catch{}It=!1}function ju(){let t,e=null;try{t=URL.createObjectURL(new Blob([Bu],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=de.get(n.data.id);r&&(de.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=Ca}catch{e=null}return t&&URL.revokeObjectURL(t),e}function Vu(){if(It===!1)return!1;if(It===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return It=!1;It=[]}let t=zu++%Uu;if(!It[t]){let e=ju();if(!e)return Ca(),!1;It[t]=e}return It[t]}var qu=5e3;function Gu(t,e,n,r,i){let o=Vu();return o?new Promise(s=>{let a=++Hu,l=setTimeout(()=>{de.delete(a),s(void 0)},qu);de.set(a,f=>{clearTimeout(l),s(f)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:va,quality:xa,mime:r})}catch{clearTimeout(l),de.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function Ro(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=D.compress,s=o.get(i);if(s?.source===t)return s.result;let a=rr.get(i);if(a?.source===t&&a.cache===o)return a.promise;let l=(async()=>{let c=Lu(t),u=c==="image/jpeg"?"image/jpeg":c==="image/webp"?"image/webp":"image/png",d=Wu(t);if(d&&d.w>0&&d.h>0&&!ya(d.w,d.h,e,n))return null;if(t.length>=Iu){let S=await Gu(t,e,n,u,r);if(S!==void 0)return S}let h;try{h=await Nu(t)}catch{return null}let m=h.naturalWidth||h.width,p=h.naturalHeight||h.height;if(!m||!p)return null;let g=ya(m,p,e,n);if(!g)return null;let y=g*va,b=Math.max(1,Math.round(m*y)),w=Math.max(1,Math.round(p*y)),x=document.createElement("canvas");x.width=b,x.height=w;let C=x.getContext("2d");if(!C)return null;C.imageSmoothingEnabled=!0,C.imageSmoothingQuality="high",C.drawImage(h,0,0,b,w);try{let S=x.toDataURL(u,xa);if(typeof S=="string"&&S.startsWith("data:image")&&S.length<t.length)return S}catch{}return null})(),f={source:t,promise:l,cache:o};rr.set(i,f);try{let c=await l;return Ou(o,i,t,c),c}finally{rr.get(i)===f&&rr.delete(i)}}async function Xu(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,l=async c=>{let u=c.getAttribute("src")||"";if(!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let d=parseFloat(c.dataset.snapdomWidth)||parseFloat(c.style.width)||c.width||0,h=parseFloat(c.dataset.snapdomHeight)||parseFloat(c.style.height)||c.height||0;if(!d||!h)return;let m=r.value||=Eo(t,e),p=m.density*m.stretch(n.get(c)||c),g=await Ro(u,d*p,h*p,c.__snapdomBlob);g&&(o++,s+=u.length,a+=g.length,c.setAttribute("src",g),or(c,"attribute","src",u,g,e))},f=6;for(let c=0;c<i.length;c+=f)await Promise.allSettled(i.slice(c,c+f).map(l));return{count:o,before:s,after:a}}var Yu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function Ku(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function Qu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=[],o=[t,...t.querySelectorAll("*")];for(let f of o){let c=f.style&&f.style.backgroundImage;c&&c.includes("data:image")&&i.push(f)}let s=0,a=async f=>{let c=n.get(f);if(!c||!c.isConnected)return;let u;try{u=getComputedStyle(c)}catch{return}if((u.backgroundRepeat||"repeat").toLowerCase().split(",").some(_=>_.trim()!=="no-repeat"))return;let h=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(h.split(",").some(_=>!Yu.test(_.trim())))return;let{w:m,h:p}=Ku(c);if(!m||!p)return;let g=Math.max(1,...(h.match(/\d+(?:\.\d+)?%/g)||[]).map(_=>parseFloat(_)/100)),y=r.value||=Eo(t,e),b=y.density*y.stretch(c)*g,w=m*b,x=p*b,C=f.style.backgroundImage,S=[...C.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],M=C;for(let _ of S){let E=_[2];if(E.startsWith("data:image/svg"))continue;let v=await Ro(E,w,x);v&&(M=M.split(E).join(v),s++)}M!==C&&(f.style.setProperty("background-image",M,f.style.getPropertyPriority("background-image")),or(f,"style","background-image",C,f.style.backgroundImage,e))},l=6;for(let f=0;f<i.length;f+=l)await Promise.allSettled(i.slice(f,f+l).map(a));return{count:s}}async function Ju(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 l=>{let f=l.getAttribute("href")||(typeof l.getAttributeNS=="function"?l.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!f||!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let c=l.getAttribute("width")||"",u=l.getAttribute("height")||"";if(c.includes("%")||u.includes("%"))return;let d=n.get(l),h=d?O(d):l.style,m=(x,C)=>{if(/^\d+(?:\.\d+)?px$/.test(h?.[x]||""))return parseFloat(h[x]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(C.trim()))return parseFloat(C);try{return d?.[x]?.baseVal?.value||0}catch{return 0}},p=m("width",c),g=m("height",u);if(!p||!g)return;let y=r.value||=Eo(t,e),b=y.density*y.stretch(d||l),w=await Ro(f,p*b,g*b);w&&(l.setAttribute("href",w),or(l,"attribute","href",f,w,e),l.hasAttribute("xlink:href")&&(l.setAttributeNS(ba,"xlink:href",w),or(l,"attribute","xlink:href",f,w,e)),o++)},a=6;for(let l=0;l<i.length;l+=a)await Promise.allSettled(i.slice(l,l+a).map(s));return{count:o}}async function ar(t,e,n){if(!e.compress)return;let r={};await Xu(t,e,n,r),await Qu(t,e,n,r),await Ju(t,e,n,r)}St();yt();Mt();function Zu(t,e){if(X())return t;let n=t.indexOf("</style>");if(n===-1)return t;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,l=/ style="([^"]*)"/g,f;for(let y of i)if(y.intern)for(l.lastIndex=0;f=l.exec(y.text);)a.set(f[1],(a.get(f[1])||0)+1);let c=0;for(let[y,b]of a)b>1&&(c+=(b-1)*y.length);if(c<2048||t.includes(" data-sdi="))return t;let u=td(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let d=new Map,h=0,m=[],p=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let w=d.get(b);return w===void 0&&(w="i"+(h++).toString(36),d.set(b,w),m.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(l,p):y.text;return t.slice(0,n)+m.join("")+g}function td(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=l=>{let f=l.getAttribute("style");f&&r.add(f)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let l=f=>{for(let c of f){if(c.type===CSSRule.IMPORT_RULE||c.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(c.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(c.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(c.selectorText).forEach(i)}c.cssRules&&l(c.cssRules)}};for(let f of[...t.querySelectorAll("style")].slice(1)){let c=f.textContent||"";if(/@import\b/i.test(c))return null;let u=new CSSStyleSheet;u.replaceSync(c),l(u.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let l of r){s.setAttribute("style",l);let f=a.serializeToString(s).match(/ style="([^"]*)"/);f&&o.add(f[1])}return o}async function lr(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:Q,...et}=t;t=Object.assign(a,et),Object.defineProperty(t,"options",{value:t,configurable:!0})}let l,f;na(t,s),await Ut("beforeRender",t);let c=O(t.element),u=t.element.getBoundingClientRect(),d=Math.max(1,W(t.element.offsetWidth||parseFloat(c.width)||u.width||1)),h=Math.max(1,W(t.element.offsetHeight||parseFloat(c.height)||u.height||1)),m=t.element.ownerDocument||document;if(!n&&(t.element===m.body||t.element===m.documentElement)&&!t.__pinned){let Q=Math.max(t.element.scrollHeight||0,m.documentElement?.scrollHeight||0,m.body?.scrollHeight||0),et=Math.max(t.element.scrollWidth||0,m.documentElement?.scrollWidth||0,m.body?.scrollWidth||0);Q>0&&(h=Math.max(h,W(Q))),et>0&&(d=Math.max(d,W(et)));try{let tt=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,rt=D.measureHints.get(t.element);if(rt&&rt.cssLen===tt&&rt.w0===d&&rt.docH===Q&&rt.docW===et)rt.csh>0&&(h=Math.max(h,W(rt.csh))),rt.csw>0&&(d=Math.max(d,W(rt.csw)));else{let ot=m.createElement("div");Z(ot),ot.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+d+"px!important;overflow:visible!important;visibility:hidden!important;";let re=ot.attachShadow({mode:"open"}),oe=m.createElement("style");oe.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,re.appendChild(oe),re.appendChild(t.clone.cloneNode(!0)),m.body.appendChild(ot);let Ke=ot.scrollHeight,qt=ot.scrollWidth;m.body.removeChild(ot),D.measureHints.set(t.element,{cssLen:tt,w0:d,docH:Q,docW:et,csh:Ke,csw:qt}),Ke>0&&(h=Math.max(h,W(Ke))),qt>0&&(d=Math.max(d,W(qt)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let Q=vo(t.element,t.options),et=1,tt=vo(t.element,{}),rt=Math.max(2,h*.15);Number.isFinite(tt)&&tt>=h-rt&&Number.isFinite(Q)&&Q>0&&(h=Math.max(1,Math.min(h,W(Q+et))))}if(t.options?.reconcile)try{let Q=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;ea(t.element,t.clone,Q,t.nodeMap,d,h)}catch(Q){console.warn("[SnapDOM] reconcile couldn't run; captured without it.",Q)}let g=(Q,et=NaN)=>{let tt=typeof Q=="string"?parseFloat(Q):Q;return Number.isFinite(tt)?tt:et},y=g(t.options.width),b=g(t.options.height),w=n?W(n.width):d,x=n?W(n.height):h,C=w,S=x,M=Number.isFinite(y),_=Number.isFinite(b),E=x>0?w/x:1;M&&_?(C=Math.max(1,W(y)),S=Math.max(1,W(b))):M?(C=Math.max(1,W(y)),S=Math.max(1,W(C/(E||1)))):_&&(S=Math.max(1,W(b)),C=Math.max(1,W(S*(E||1))));let v=0,k=0,R=d,F=h;if(n){let Q=0,et=0;if(Fo(t.element)){let tt=null;if(!r&&o&&Number.isFinite(o.a))tt={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let rt=ue(t.element),ot=xo(c.transform&&c.transform!=="none"?c.transform:"",rt);ot&&ot.is2D&&(tt={a:ot.a,b:ot.b,c:ot.c,d:ot.d,e:0,f:0})}if(tt&&!(tt.a===1&&tt.b===0&&tt.c===0&&tt.d===1)){let{ox:rt,oy:ot}=pn(c,d,h),re=De(d,h,tt,rt,ot);Q=re.minX,et=re.minY}}v=W(n.x+Q),k=W(n.y+et),R=W(v+n.width),F=W(k+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let Q={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},et=De(d,h,Q,0,0);v=W(et.minX),k=W(et.minY),R=W(et.maxX),F=W(et.maxY)}else if(r&&Fo(t.element)){let et=c.transform&&c.transform!=="none"?c.transform:"",tt=ue(t.element),rt=ee({baseTransform:et,rotate:tt.rotate||"0deg",scale:tt.scale,translate:tt.translate,width:d,height:h}),{ox:ot,oy:re}=pn(c,d,h),oe=rt.is2D?rt:new DOMMatrix(rt.toString()),Ke={a:oe.a,b:oe.b,c:oe.c,d:oe.d,e:0,f:0},qt=De(d,h,Ke,ot,re);v=W(qt.minX),k=W(qt.minY),R=W(qt.maxX),F=W(qt.maxY)}let $=ho(c),I=mo(c),P=go(c),A=yo(c),L=bo(c),N=u.width>0?(R-v)/u.width:1,T=u.height>0?(F-k)/u.height:1,z=i==="subtree"&&!n?Hs(t.element,t.nodeMap,t.styleCache,N,T):{top:0,right:0,bottom:0,left:0},q=n?{top:0,right:0,bottom:0,left:0}:i?{top:W(Math.max($.top,I.top,z.top)+P.top+A.top+L.bleed.top),right:W(Math.max($.right,I.right,z.right)+P.right+A.right+L.bleed.right),bottom:W(Math.max($.bottom,I.bottom,z.bottom)+P.bottom+A.bottom+L.bleed.bottom),left:W(Math.max($.left,I.left,z.left)+P.left+A.left+L.bleed.left)}:{top:P.top,right:P.right,bottom:P.bottom,left:P.left};v=W(v-q.left),k=W(k-q.top),R=W(R+q.right),F=W(F+q.bottom);let j=Math.max(1,W(R-v)),J=Math.max(1,W(F-k)),B="http://www.w3.org/2000/svg",ut=Fo(t.element)?2:0,at=W(ut+(r?0:1)),st=Math.ceil(j+at*2),nt=Math.ceil(J+at*2),pt=W(-(W(v)-at)),Ht=W(-(W(k)-at)),ye=Math.max(0,pt),V=Math.max(0,Ht),G=W(st-Math.min(0,pt)),U=W(nt-Math.min(0,Ht)),ht=m.defaultView||window,Y=!X()&&CSS.supports("zoom","2")&&ht.devicePixelRatio||1;a.__layoutZoom=Y;let Ct=document.createElementNS(B,"foreignObject");Ct.setAttribute("x",String(Math.min(0,pt)*Y)),Ct.setAttribute("y",String(Math.min(0,Ht)*Y)),Ct.setAttribute("width",String(G*Y)),Ct.setAttribute("height",String(U*Y)),Ct.style.overflow="visible";let be=document.createElement("style"),wn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";be.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+wn+t.classCSS,Ct.appendChild(be);let Xe=document.createElement("div");Xe.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Xe.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${G}px;height:${U}px`+(ye!==0||V!==0?`;padding:${V}px 0 0 ${ye}px !important`:"")+(Y!==1?`;zoom:${Y} !important`:""),Xe.appendChild(t.clone),Ct.appendChild(Xe);let vr=new XMLSerializer().serializeToString(Ct),jt=M||_,Cr=Object.freeze({w0:w,h0:x,vbW:st,vbH:nt,targetW:C,targetH:S,contentX:W(pt+(n?v:0)),contentY:W(Ht+(n?k:0)),clip:n?Object.freeze({x:W(v),y:W(k),width:w,height:x}):null});Object.defineProperty(a,"meta",{value:Cr,enumerable:!0,writable:!1,configurable:!0});let kr=!jt||X()?st:M?C:W(st*(S/nt)),Sn=!jt||X()?nt:_?S:W(nt*(C/st)),Vt=parseFloat(O(m.documentElement)?.fontSize)||16,ni=Y!==1,ul=`<svg xmlns="${B}" width="${kr}" height="${Sn}" viewBox="0 0 ${st} ${nt}" font-size="${Vt}px">${ni?`<g transform="scale(${1/Y})">`:""}`,dl=ni?"</g></svg>":"</svg>";f=ul+Zu(vr,Ct)+dl,l=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,t.svgString=f,t.dataURL=l,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await Ut("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let Mr=[...document.querySelectorAll("#snapdom-sandbox")].find(Xt);return Mr&&Mr.style.position==="absolute"&&Mr.remove(),t.dataURL}function Fo(t){return Vs(t)}function ed(t){let e=Array.isArray(t.plugins)?t.plugins:_o(),n=[];for(let r of e){let i=He(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function ka(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");e.__session=Mo(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=ed(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,l,f,c="",u=null,d=e.needs||gt,h=n.format,m=n.type;await Ut("beforeSnap",n);let p=n.format!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(p||g){let R=String(p?n.format:n.type).toLowerCase();n.format=R==="jpg"?"jpeg":R,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await Ut("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?qn(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=Li(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let x=vi(e.fast);for(;;){e.__slicer=x;let R=tr(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:l,clipWindow:f}=await ra(n.element,n.options)),l>0&&!e.reconcile&&(At(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),D.warnedReconcile||(D.warnedReconcile=!0,console.warn("[SnapDOM] Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower)."))),!y&&r&&(u=js(n.element,r)),!b&&r&&Qs(n.element,r,n.options),r&&(Zs(n.element,r,a),Js(n.element,r))}finally{R()}if(!x?.yielded||!e.__tornSinceStart?.())break;x=null,e.__session=Mo(e.cache)}if(e.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await Ut("afterClone",n),!Ue(d,"render"))return null;if(x?.due()&&await x.pause(),Gn(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{ta(n.element,n.clone,n.styleCache,n.nodeMap)}catch(R){At(e.__session,"shrink-failed","shrink pass failed",R),console.warn("[SnapDOM] Couldn't close the gaps left by removed elements.",R)}try{await On(n.clone,n.element,n.nodeMap)}catch{}let C=R=>Promise.resolve().then(R),S=(async()=>{await Promise.all([C(()=>Yn(n.clone,n.options)),C(()=>Qn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{sa(n.element,n.clone,n.nodeMap)}catch(R){At(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",R),console.warn("[SnapDOM] Couldn't reproduce a backdrop-filter; captured without it.",R)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await C(()=>ar(n.clone,n.options,n.nodeMap))),e.captureSelection)try{ps(n.nodeMap)}catch(R){At(e.__session,"selection-compose-failed","field selection compose failed",R)}})(),M=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(M=C(async()=>{let R=n.element.ownerDocument||document,F=w?P=>{try{let A=P.getBoundingClientRect();return A.right>=w.left-200&&A.left<=w.right+200&&A.bottom>=w.top-200&&A.top<=w.bottom+200}catch{return!0}}:null,{required:$,usedCodepoints:I}=!w&&e.__fontUsage||Un(n.element,F);if(e.embedFonts==="auto"){let P=new Set;try{for(let L of R.fonts)P.add(String(L.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(P.size>0&&Array.from($).some(L=>P.has(String(L).split("__")[0].toLowerCase()))))return}if(X()){let P=new Set(Array.from($).map(A=>String(A).split("__")[0]).filter(Boolean));await zn(P,1,R)}c=await _s({required:$,usedCodepoints:I,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:R})})),await Promise.all([S,M]);let E=(n.options.plugins||[]).some(R=>R&&(typeof R.beforeRender=="function"||typeof R.afterRender=="function"));n.options.engine,x?.due()&&await x.pause();let v=n.clone;sr(v,e.__compressedAssets);let k=await lr(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:c});if(e.__compressedSnapshot=ir(v,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:c,clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return k}yt();kt();var nd=new Set(["png","jpeg","jpg","webp","svg"]);function Ma(t={}){let e=typeof t.type=="string"&&nd.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=ri(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let u of o)if(typeof u=="string")try{document.createDocumentFragment().querySelector(u),s.push(u)}catch{console.warn(`[SnapDOM] Invalid exclude selector "${u}"; ignored.`)}else typeof u=="function"?a.push(u):u!=null&&console.warn("[SnapDOM] Ignored an exclude entry: use a CSS selector or a function.",u);let l=t.excludeMode??"hide",f=u=>{if(!u||u.nodeType!==1)return!1;if(u.getAttribute("data-capture")==="exclude")return!0;for(let d of Array.isArray(c.exclude)?c.exclude:[])try{if(u.matches(d))return!0}catch{}for(let d of Array.isArray(c.excludePredicates)?c.excludePredicates:[])try{if(d(u))return!0}catch{}if(typeof c.filter=="function")try{if(!c.filter(u))return!0}catch{}return!1},c={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:l,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:f,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:it(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:ys(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 c}mt();se();St();var Aa="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function rd(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var od=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function id(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(od.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function sd(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 _a=new WeakMap;function ad(t){let e=Bt(),n=_a.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 l=s[a],f=l.selectorText;if(f&&/[+~]|:has\(/.test(f)){r=!0;return}let c=l.style;if(c&&(c.counterReset||c.counterIncrement||c.counterSet||c.content&&c.content.includes("counter"))){r=!0;return}l.cssRules&&l.cssRules.length&&o(l.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 _a.set(t,{epoch:e,leaky:r}),r}var ld=1/16;function cd(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)<=ld}var cr=new Map,fd=["width","height","min-width","min-height"];function ud(t){let e=cr.get(t);if(e===void 0){e=null;for(let n of fd){let r=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));r&&r[1].endsWith("px")&&((e||={})[n]=r[1])}cr.size>5e3&&cr.clear(),cr.set(t,e)}return e}function dd(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function pd(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 To={attempts:0,served:0,reconciled:0};async function Ea(t,e,n){To.attempts++;try{let r=await hd(t,e,n);return r&&To.served++,r}catch{return null}}async function hd(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||rd(t)||id(r)||r.fontsCSS||nr(n))return null;for(let d of n.plugins||[])if(d&&(typeof d.beforeSnap=="function"||typeof d.beforeClone=="function"||typeof d.resolveNode=="function"||typeof d.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=ln(t);if(!o||ad(i))return null;let s=[];t:for(let d of e.dirtyRoots){if(!d.isConnected||d===t||!t.contains(d))return null;for(let h of e.dirtyRoots)if(h!==d&&h!==t&&h.contains(d))continue t;s.push(d)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let d of s){if(d.parentElement===t||d.matches?.(Aa)||d.querySelector?.(Aa)||sd(d,o))return null;let h=r.srcToClone.get(d);if(!h||!h.parentNode)return null;let m=new Map,p={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:m,options:n},g=tr(d,null),y=Vn(d),b;try{b=await te(d,p,n)}finally{y(),g()}if(!b||b.nodeType!==1||b.querySelector?.("style[data-sd]")||(await Oe(d,b,p,n),p.__pseudoCSS)||p.__usesPlaceholder&&!r.classPrefixCSS?.includes("[data-sd-ph]"))return null;await Pn(b,p),Gn(b);try{await On(b,d,m)}catch{}if(await Promise.all([Yn(b,n),Qn(d,b,r.styleCache,n,m)]),n.compress)try{await ar(b,n,m)}catch{}for(let[w,x]of m.entries())ko(w,x,m,r.styleCache);h.replaceWith(b),pd(h,r);for(let[w,x]of m.entries())r.nodeMap.set(w,x),r.srcToClone.set(x,w)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n},l=new WeakSet;for(let[d,h]of r.nodeMap.entries()){if(!h||h.nodeType!==1||!h.isConnected)continue;let m=r.styleMap.get(d);if(!m)continue;let p=ud(m);if(!p)continue;let g=null,y=!1;for(let b in p){g||=getComputedStyle(h);let w=g.getPropertyValue(b);if(b==="min-width"&&w==="auto"&&!l.has(h.parentElement)){let x=parseFloat(g.width);g.boxSizing!=="border-box"&&m.includes("box-sizing:border-box")&&(x+=["padding-left","padding-right","border-left-width","border-right-width"].reduce((C,S)=>C+(parseFloat(g.getPropertyValue(S))||0),0)),w=`${x}px`}if(!cd(w,p[b])){y=!0;break}}if(y){if(n.__compressedAssets?.has(d))return null;l.add(h),To.reconciled++,await dt(h,d,a,n)}}let f=tn(r.styleMap);for(let[d,h]of r.styleMap.entries())dd(d),Co(d,h,f);let c=(r.classPrefixCSS||"")+Array.from(f.entries()).map(([d,h])=>`.${h}{${d}}`).join("");sr(r.clone,n.__compressedAssets);let u=await lr({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:c,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=ir(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,u}kt();var $o=new WeakMap,ur=new WeakMap,Wa=new WeakSet,Po=new WeakMap,md=64,mn=new Map,Ba=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],gd=["(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 yd(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":gd.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function Ra(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=Ft(n)||null}return e.join("|")}function Fa(t,e){if(e.disposed||(mn.delete(t),mn.set(t,e),mn.size<=md))return;let[n,r]=mn.entries().next().value;Ua(n,r)}function Ua(t,e){e.disposed=!0,mn.delete(t),$o.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of Ba)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of Lo)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 za(t){if(Wa.has(t))return!1;ur.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 l=String(a.localName||a.tagName||"").toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(l)||l==="progress"&&!a.hasAttribute("value")||/^(?:animate|animatetransform|animatemotion|set)$/.test(l))return!1;let f="";if(l==="img"){r.push(a);try{f=a.currentSrc||a.src||""}catch{}}/^(?:input|textarea|select|option)$/.test(l)&&n.push(a);let c=a.getAttribute?.("style")||"",u=Po.get(a);if(f||c){if((!u||u.src!==f||u.style!==c)&&(u={src:f,style:c,animated:qe(f)||qe(c)},Po.set(a,u)),u.animated)return!1}else u&&Po.delete(a)}}return ur.set(t,{roots:e.slice(1),controls:n,images:r}),!0}function No(t,e){if(!t.querySelectorAll)return!1;let n=ur.get(t);ur.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 Lo)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 Lo)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var Lo=["scroll","change","beforetoggle","toggle"];function dr(t,e){return[t,...e.trackedShadowRoots.keys()]}function Io(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of dr(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 Ta(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(le(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 bd=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,Ve=t=>t&&(typeof t=="object"||typeof t=="function")?fr(t):"-";function wd(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 Sd(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=wd(t);return e==="image/png"?n.includes("acTL"):e==="image/webp"?n.includes("ANIM")||n.includes("ANMF")||n.includes("VP8X")&&!!(n.charCodeAt(n.indexOf("VP8X")+8)&2):e==="image/avif"?n.includes("avis"):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function Pa(t){let e=String(t||"").trim();return e?bd.test(e)?!0:/^data:/i.test(e)?Sd(e):!1:!1}function qe(t){let e=String(t||"");if(Pa(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(Pa(n[1]??n[2]??n[3]))return!0;return!1}function $a(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 Ha(i))if(qe(o.getAttribute?.("src"))||qe(o.getAttribute?.("href"))||qe(o.getAttribute?.("style"))||qe(t.styleMap?.get(o)))return!0;return!1}function Ha(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function Oo(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 dr(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function Do(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 dr(t,e))for(let s of Ha(o))i(s);e.scrollNodes=n}function Na(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",yd(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(Ve))}catch{}for(let c of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...c.adoptedStyleSheets||[]].map(Ve))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(Ve(o)),(s?.contains(t)||t.contains(s))&&i.push(Ve(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let c of e.scrollNodes)a.push(c.scrollLeft||0,c.scrollTop||0);let l=[];for(let c of e.controls){let u=String(c.localName||"").toLowerCase();u==="input"?l.push(c.type,Je(c)?c.value.length:c.value,c.checked?1:0,c.indeterminate?1:0):u==="textarea"?l.push(c.value):u==="select"?l.push(c.selectedIndex,c.value):l.push(c.selected?1:0)}let f=[];for(let c of e.images){let u="";try{u=c.currentSrc||c.src||""}catch{}f.push(u,c.complete?1:0,c.naturalWidth||0,c.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:l,images:f,frameDriven:e.retainedFrameDriven}}function je(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 La(t,e){let n=new Set;for(let r of dr(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 Ia(t){return t.map(e=>[Ve(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function xd(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 vd(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:Ee(),styleEpoch:Bt(),styleStamp:an(t),outsideMutations:sn(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let l=a&&(a.nodeType===1?a:a.parentElement);if(!l||l===t||!t.contains(l)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(l)},i=a=>{if(e.capturing){for(let l of a)e.pending.push(l);return}for(let l of a)le(l)&&(e.dirty=!0,r(l.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 Ba)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return No(t,e)||Oo(t,e),Do(t,e),Io(t,e),e}var Cd=0,Oa=new WeakMap;function fr(t){let e=Oa.get(t);return e||(e="@"+ ++Cd,Oa.set(t,e)),e}function Wo(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(fr(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(fr(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=Wo(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(fr(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=Wo(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function Da(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=Wo(i,new Set);return o===null?null:`${(e||[]).map(Ve).join(",")}:${o}`}catch{return null}}function ja(t,e,n,r,i=null){let o=$o.get(t);o||(o=vd(t),o.baselineSignature=Da(e,n.plugins),$o.set(t,o));let s=Da(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,No(t,o),Io(t,o);for(let M of o.observers)M.__flush(M.takeRecords());Pt();let c=sn(t);o.dirty&&o.outsideMutations!==c&&o.dirtyAll(),o.outsideMutations=c;let u=t.getRootNode?.(),d=[...o.trackedShadowRoots.keys()];u?.nodeType===11&&!d.includes(u)&&d.push(u),En(t.ownerDocument||document,d);let h=an(t);o.styleStamp!==h&&(o.styleStamp=h,o.dirty||o.dirtyAll());let m=Na(t,o),p=La(t,o);m.animation=Ia(p),o.renderState&&(!je(o.renderState,m,"style")&&(Re(),o.dirtyAll()),je(o.renderState,m,"scroll")||o.dirtyAll(),je(o.renderState,m,"controls")||(ce(t),o.dirtyAll()),!je(o.renderState,m,"images")&&!o.dirty&&o.dirtyAll());let g=Ee();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Bt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let M=Ra(t);o.geometry!==null&&M!==o.geometry&&(ce(t),o.dirtyAll()),o.geometry=M}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!je(o.renderState,m,"animation");try{let M=new Set;w&&p.length===0&&(M=null);for(let _ of p){let E=_.playState==="running";if(!E&&!w)continue;E&&(b=!0),w=!0;let v=_.effect?.target;if(xd(t,o,v)===t)M.add(v);else{M=null;break}}if(w&&M&&M.size&&o.retained){o.dirty=!0;for(let _ of M)o.dirtyRoots&&o.dirtyRoots.add(_),ce(_)}else w&&!M&&o.dirtyAll()}catch{}let x=m.frameDriven,C=b||x;if(C&&(o.last=null),x&&o.dirtyAll(),!f&&!C&&!o.dirty&&o.last)return Fa(t,o),o.last;o.capturing=!0;let S=null;try{let M=null,_=!1,E=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){E=[...o.dirtyRoots];let v=await Ea(t,o,n);v&&(M=await i(v),_=!0)}if(M||(f||(n.__retain=v=>{let k=new Map;for(let[R,F]of v.nodeMap.entries())k.set(F,R);S={...v,srcToClone:k}}),n.__tornSinceStart=()=>{for(let v of o.observers)for(let k of v.takeRecords())o.pending.push(k);return Pt(),o.torn||Ta(o.pending)||sn(t)!==c},M=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=$a(S),Oo(t,o),Do(t,o)):_&&(o.retainedFrameDriven||=$a(o.retained,E),Oo(t,o),Do(t,o));let v=Na(t,o);v.animation=Ia(La(t,o));let k=["style","scroll","controls","images"];b||k.push("animation");let R=k.every(F=>je(m,v,F));o.renderState=v,o.styleEpoch=Bt(),o.styleStamp=an(t),o.geometry=Ra(t),o.renderState.frameDriven?(Wa.add(t),Ua(t,o)):R?!C&&!o.renderState.frameDriven&&(o.last=M,Fa(t,o)):(o.dirtyAll(),o.last=null)}return M}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let _ of o.observers)for(let E of _.takeRecords())o.pending.push(E);Pt();let M=sn(t);(o.torn||Ta(o.pending)||M!==c)&&(o.dirtyAll(),o.last=null),o.outsideMutations=M,o.styleEpoch=Bt(),o.styleStamp=an(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||(No(t,o),Io(t,o))}},l=o.inflight.then(a,a);return o.inflight=l.catch(()=>{}),l}var pr=null;function Ga(t){pr=t}var kd='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Bo=!1,gn=null,Uo=new WeakMap,Va=!1;function Xa(t,e){!Bo||!gn||e&&e.burst===!1||Uo.set(gn.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function Ya(t){let e={control:t};gn=e,setTimeout(()=>{gn===e&&(gn=null)},0)}function Ho(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest(kd):null}function qa(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=Ho(t);e&&(Ya(e),zo(t,!1))}function Md(t){let e=Ho(t);e&&Ya(e)}function zo(t,e=!0){if(!pr||document.visibilityState==="hidden")return;let n=Ho(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=Uo.get(n);if(r){if(!r.element.isConnected){Uo.delete(n);return}pr(r.element,r.options).catch(()=>{});return}e&&!Va&&(Va=!0,pr(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Ka(){if(Bo||typeof document>"u"||typeof document.addEventListener!="function")return;Bo=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",qa,t),document.addEventListener("keydown",qa,t),document.addEventListener("click",Md,t),document.addEventListener("pointerenter",zo,t),document.addEventListener("focusin",zo,t)}Mt();function jd(...t){return Ao(...t),K}async function Vd(t,e){if(typeof t!="string"||!t.trim())throw new Error("[SnapDOM] fromString() needs an HTML string.");let n=document.createElement("div");Z(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await bt();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 ei(i,{...e||{},burst:!1})}finally{n.remove()}}var qd="3.3.4",K=Object.assign(ei,{plugins:jd,fromString:Vd,version:qd,preCapture:Ka});Ga(ei);var ti=Symbol("snapdom.internal"),Gd=Symbol("snapdom.internal.silent"),cl=new Set(["png","jpeg","jpg","webp","svg"]);async function ei(t,e){if(!t)throw new Error("[SnapDOM] The element cannot be null or undefined.");let n=Ma(e);n.element=t,n.invalidate&&Re(),ha(n,e&&e.plugins);let{stage:r,loweredBy:i}=fa(n);n.needs=r,n.__needsLoweredBy=i;let o=Ue(r,"render"),s=n.burst===!0||!nr(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&&za(t);return f&&Xa(t,e),n.snap||(n.snap={toPng:(c,u)=>K.toPng(c,u),toSvg:(c,u)=>K.toSvg(c,u)}),f?ja(t,e,n,()=>K.capture(t,n,ti),c=>fl(c,n)):K.capture(t,n,ti)}K.capture=async(t,e,n)=>{if(n!==ti)throw new Error("[SnapDOM] snapdom.capture() is internal; use snapdom(el).");if(Ue(e.needs||gt,"render")&&X()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let c of o.fonts)s.add(String(c.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=Un(t);e.clip||(e.__fontUsage=a);let l=a.required,f=new Set([...l].map(c=>String(c).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(f=new Set([...f].filter(c=>s.has(c.toLowerCase()))),f.size===0))throw null;await zn(f,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(un(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){H(e,"Couldn't prepare canvases for Safari.",s)}}let r=await ka(t,e);return fl(r,e)};async function fl(t,e){let n=e.needs||gt,r=Ue(n,"render"),i=A=>da(n,e.__needsLoweredBy||[],A),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??=o.toDataURL(),l=o||t;o&&(t="");let f=e.__compressedSnapshot,c=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let u,d=e.meta||{},m=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!X(),p=m?Number.isFinite(e.width)?d.targetW/d.vbW:d.targetH/d.vbH:1,g=m?Number.isFinite(e.height)?d.targetH/d.vbH:d.targetW/d.vbW:1,y=A=>{if(o||!f?.size)return l;let L=d.vbW,N=d.vbH,T=A.crop;T&&(L=Math.max(1,Math.min(L,T.x+T.width)-Math.max(0,T.x)),N=Math.max(1,Math.min(N,T.y+T.height)-Math.max(0,T.y)));let z=Number.isFinite(A.width),q=Number.isFinite(A.height);return(z&&q?Math.max(A.width/L,A.height/N):z?A.width/L*(T?Math.max(1,g/p):1):q?A.height/N*(T?Math.max(1,p/g):1):(A.scale||1)*Math.max(p,g))*(A.dpr||1)<=c?l:u??=Sa(a(),f)},b=async(A,L)=>{let{rasterize:N}=await Promise.resolve().then(()=>(Ge(),bn));return N(l,{...A,...L||{},format:"png"})},w=()=>{if(!r)throw i("svgString");if(o)throw new Error("[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.");let A=t.indexOf(",");return A>=0?decodeURIComponent(t.slice(A+1)):""},x=A=>Object.defineProperty({...A||{},svgString:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),C={img:async(A,L)=>{if(o)return b(A,L);let{toImg:N}=await Promise.resolve().then(()=>(Ko(),Yo)),T={...A,...L||{}};return N(y(T),T)},svg:async(A,L)=>{if(o)return b(A,L);let{toSvg:N}=await Promise.resolve().then(()=>(Ko(),Yo)),T={...A,...L||{}};return N(y(T),T)},canvas:async(A,L)=>{let{toCanvas:N}=await Promise.resolve().then(()=>(ge(),el)),T={...A,...L||{}};return N(y(T),T)},blob:async(A,L)=>{let{toBlob:N}=await Promise.resolve().then(()=>(Zo(),il)),T={...A,...L||{}};return N(y(T),T)},png:async(A,L)=>{let{rasterize:N}=await Promise.resolve().then(()=>(Ge(),bn)),T={...A,...L||{},format:"png"};return N(y(T),T)},jpeg:async(A,L)=>{let{rasterize:N}=await Promise.resolve().then(()=>(Ge(),bn)),T={...A,...L||{},format:"jpeg"};return N(y(T),T)},webp:async(A,L)=>{let{rasterize:N}=await Promise.resolve().then(()=>(Ge(),bn)),T={...A,...L||{},format:"webp"};return N(y(T),T)},download:async(A,L)=>{let{download:N}=await Promise.resolve().then(()=>(ll(),al)),T={...A,...L||{}};return N(y(T),T)}};if(!r)for(let A of Object.keys(C)){let L=A==="download"?"download()":`to${A.charAt(0).toUpperCase()}${A.slice(1)}()`;C[A]=async()=>{throw i(L)}}let S={};for(let A of["img","svg","canvas","blob","png","jpeg","webp"])S[A]=async L=>C[A](e,{...R(A,L||{}),[Gd]:!0});S.jpg=S.jpeg;let M=A=>Object.defineProperty({...e,...A},"options",{value:e,configurable:!0}),_=M({artifacts:e.__artifacts||null,export:x(),exports:S}),E=await er("defineExports",_),v=Object.assign({},...E.filter(A=>A&&typeof A=="object").reverse()),k={...C,...v};k.jpeg&&!k.jpg&&(k.jpg=(A,L)=>k.jpeg(A,L));function R(A,L){let N=L||{},T={...e,...N},z=typeof N.type=="string"?N.type.toLowerCase():"",q=typeof N.format=="string"?N.format.toLowerCase():cl.has(z)?z:"";q&&(T.format=q==="jpg"?"jpeg":q),T.__explicitFormat=q?T.format:e.__explicitFormat??null,A==="blob"&&!T.__explicitFormat&&(T.format=o?"png":"svg"),T.type=T.format;let j=B=>B==="jpeg"||B==="jpg"||B==="webp";return[A,T.format,z].map(B=>typeof B=="string"?B.toLowerCase():"").find(j)&&(T.backgroundColor==null||T.backgroundColor==="transparent")&&(T.backgroundColor="#ffffff"),T.scale!==1&&(Number.isFinite(T.width)||Number.isFinite(T.height))&&H(T,"scale ignored: width/height already set the size."),T}let F=!1,$=Promise.resolve();async function I(A,L){let N=Object.freeze(L&&typeof L=="object"?{...L}:{}),T=async()=>{let q=k[A];if(!q)throw new Error(`[SnapDOM] Unknown export type: ${A}`);let j=R(A,N),J=M({artifacts:e.__artifacts||null,export:x({type:A,options:j,requestedOptions:N})}),B=j.format,ut=j.type;await er("beforeExport",J,{format:A,options:j});let vt=j.format!==B?j.format:j.type!==ut?j.type:"",at=typeof vt=="string"?vt.toLowerCase():"";cl.has(at)&&(j.format=at==="jpg"?"jpeg":at,j.type=j.format,j.__explicitFormat=j.format,/^(?:jpeg|webp)$/.test(j.format)&&(j.backgroundColor==null||j.backgroundColor==="transparent")&&(j.backgroundColor="#ffffff"));let st=await q(J,j);return await er("afterExport",J,{format:A,options:j,result:st}),F||(F=!0,await Ut("afterSnap",e)),st},z=$.then(T);return $=z.catch(()=>{}),z}let P={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(A,L)=>I(A,L),toImg:A=>I("img",A),toSvg:A=>I("svg",A),toCanvas:A=>I("canvas",A),toBlob:A=>I("blob",A),toPng:A=>I("png",A),toJpg:A=>I("jpg",A),toWebp:A=>I("webp",A),download:A=>I("download",A)};r?o&&Object.defineProperty(P,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(P,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(P,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let A of Object.keys(k)){let L="to"+A.charAt(0).toUpperCase()+A.slice(1);P[L]||(P[L]=N=>I(A,N))}return P}K.toRaw=(t,e)=>K(t,e).then(n=>n.toRaw());K.toImg=(t,e)=>K(t,e).then(n=>n.toImg());K.toSvg=(t,e)=>K(t,e).then(n=>n.toSvg());K.toCanvas=(t,e)=>K(t,e).then(n=>n.toCanvas());K.toBlob=(t,e)=>K(t,e).then(n=>n.toBlob());K.toPng=(t,e)=>K(t,{...e,format:"png"}).then(n=>n.toPng());K.toJpg=(t,e)=>K(t,{...e,format:"jpeg"}).then(n=>n.toJpg());K.toWebp=(t,e)=>K(t,{...e,format:"webp"}).then(n=>n.toWebp());K.download=(t,e)=>K(t,e).then(n=>n.download());export{gt as DEFAULT_STAGE,Be as STAGES,ua as assertNeeds,Ru as clearPlugins,_o as getGlobalPlugins,He as normalizePlugin,Ao as registerPlugins,K as snapdom};
|