@zumer/snapdom 2.24.1 → 2.24.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/snapdom.js CHANGED
@@ -1,14 +1,14 @@
1
1
  /*
2
2
  * SnapDOM
3
- * v2.24.1
3
+ * v2.24.3
4
4
  * Author: Juan Martin Muda
5
5
  * License: MIT
6
6
  */
7
- var Dr=Object.defineProperty;var ot=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var qt=(t,e)=>{for(var n in e)Dr(t,n,{get:e[n],enumerable:!0})};function Tn(t){if(t===!0)return"soft";if(t===!1)return"disabled";if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="auto")return"auto";if(e==="full")return"full";if(e==="soft"||e==="disabled")return e}return"soft"}function ue(t="soft"){switch(t){case"auto":{x.session.styleMap=new Map,x.session.nodeMap=new Map;return}case"soft":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap,x.computedStyle=new WeakMap,x.measureHints=new WeakMap,x.baseStyle=new q(50),x.defaultStyle=new q(30),x.image=new q(100),x.background=new q(100),x.resource=new q(150),x.compress=new q(50),x.font=new Set;return}default:{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}}}var q,x,tt=ot(()=>{"use strict";q=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let o=this.keys().next().value;o!==void 0&&this.delete(o)}return super.set(e,n)}},x={image:new q(100),background:new q(100),resource:new q(150),defaultStyle:new q(30),baseStyle:new q(50),compress:new q(50),computedStyle:new WeakMap,measureHints:new WeakMap,burstAdvice:new WeakMap,warnedReconcile:!1,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function Mt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Xt(t,e=1){let n=t.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let o=[];for(let s of n[1].split(",")){let i=s.match(/url\((['"]?)(.*?)(\1)\)/);if(!i)continue;let a=s.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!Hr.test(a[1].trim()))continue;let c=s.match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)/i),f=1;if(c){let l=parseFloat(c[1]);f=/dpi/i.test(c[2])?l/96:l}o.push({url:i[2].trim(),dppx:f})}return o.length?(o.sort((s,i)=>s.dppx-i.dppx),(o.find(s=>s.dppx>=e)||o[o.length-1]).url):null}function Oe(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(s=>s.trim());return r.length!==6?`matrix(${o})`:(r[4]="0",r[5]="0",`matrix(${r.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(s=>s.trim());return r.length!==16?`matrix3d(${o})`:(r[12]="0",r[13]="0",`matrix3d(${r.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function bt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function Be(t,e){if(!t||/^(data|blob|about|#)/i.test(t.trim()))return t;try{let n=e||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(t,n).href}catch{return t}}var Hr,Gt=ot(()=>{"use strict";Hr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i});function zr(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function s(i,a,c){if(r>=n)return;let f=Date.now();(o.get(a)||0)>f||(o.set(a,f+e),r++,i==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(i,a){s("warn",i,a)},errorOnce(i,a){s("error",i,a)},reset(){o.clear(),r=0}}}function Vr(t){return/^data:|^blob:|^about:blank$/i.test(t)}function jr(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=e.includes("{url}")?e.split("{url}")[0]:e,r=new URL(o||".",n),s=new URL(t,n);if(s.origin===r.origin)return!0;let i=s.searchParams;if(i&&(i.has("url")||i.has("target")))return!0}catch{}return!1}function qr(t,e){if(!e||Vr(t)||jr(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location<"u"?o.origin!==location.origin:!0}catch{return!!e}}function Xr(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",bt(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}${bt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Pn(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"")),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function Gr(t,e){return[e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,t].join("|")}async function j(t,e={}){let n=e.as??"blob",o=e.timeout??3e3,r=e.useProxy||"",s=e.errorTTL??8e3,i=e.headers||{},a=!!e.silent;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,y="",b=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],C=/;base64/i.test(y)?atob(b):decodeURIComponent(b),g=new Uint8Array([...C].map(v=>v.charCodeAt(0))),w=new Blob([g],{type:(y||"").split(";")[0]||""});return{ok:!0,data:w,status:200,url:t,fromCache:!1,mime:w.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let y=await fetch(t);if(!y.ok)return{ok:!1,data:null,status:y.status,url:t,fromCache:!1,reason:"http_error"};let b=await y.blob(),S=b.type||y.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Pn(b),status:y.status,url:t,fromCache:!1,mime:S}:n==="text"?{ok:!0,data:await b.text(),status:y.status,url:t,fromCache:!1,mime:S}:{ok:!0,data:b,status:y.status,url:t,fromCache:!1,mime:S}}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=Gr(t,{as:n,timeout:o,useProxy:r,errorTTL:s}),f=de.get(c);if(f&&f.until>Date.now())return{...f.result,fromCache:!0};f&&de.delete(c);let l=Ue.get(c);if(l)return l;let d=qr(t,r)?Xr(t,r):t,u=e.credentials;if(!u)try{let y=typeof location<"u"&&location.href?location.href:"http://localhost/",b=new URL(t,y);u=typeof location<"u"&&b.origin===location.origin?"include":"omit"}catch{u="omit"}let p=new AbortController,h=setTimeout(()=>p.abort("timeout"),o),m=(async()=>{try{let y=await fetch(d,{signal:p.signal,credentials:u,headers:i});if(!y.ok){let C={ok:!1,data:null,status:y.status,url:d,fromCache:!1,reason:"http_error"};if(s>0&&de.set(c,{until:Date.now()+s,result:C}),!a){let g=`${y.status} ${y.statusText||""}`.trim();Ln.warnOnce(`http:${y.status}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,`HTTP error ${g} while fetching ${n} ${t}`)}return e.onError&&e.onError(C),C}if(n==="text")return{ok:!0,data:await y.text(),status:y.status,url:d,fromCache:!1};let b=await y.blob(),S=b.type||y.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Pn(b),status:y.status,url:d,fromCache:!1,mime:S}:{ok:!0,data:b,status:y.status,url:d,fromCache:!1,mime:S}}catch(y){let b=y&&typeof y=="object"&&"name"in y&&y.name==="AbortError"?String(y.message||"").includes("timeout")?"timeout":"abort":"network",S={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:b};if(!/^blob:/i.test(t)&&s>0&&de.set(c,{until:Date.now()+s,result:S}),!a){let C=`${b}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,g=b==="timeout"?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:b==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;Ln.errorOnce(C,g)}return e.onError&&e.onError(S),S}finally{clearTimeout(h),Ue.delete(c)}})();return Ue.set(c,m),m}var Ln,Ue,de,wt=ot(()=>{"use strict";Gt();Ln=zr("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Ue=new Map,de=new Map});async function Et(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=Xt(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Mt(t);if(!o)return t;let r=Be(o),s=bt(r),i=(e.useProxy||"")+"|"+s;if(x.background.has(i)){let a=x.background.get(i);return a?`url("${a}")`:"none"}try{let a=await j(s,{as:"dataURL",useProxy:e.useProxy});return a.ok?(x.background.set(i,a.data),`url("${a.data}")`):(x.background.set(i,null),"none")}catch{return x.background.set(i,null),"none"}}var Nn=ot(()=>{"use strict";tt();Gt();wt()});function De(){for(let t of Yr){let e=String(t).toLowerCase();pe.has(e)||me.has(e)||he(e)}}function he(t){if(t=String(t).toLowerCase(),me.has(t)){let s={};return x.defaultStyle.set(t,s),s}if(x.defaultStyle.has(t))return x.defaultStyle.get(t);let e=document.getElementById("snapdom-sandbox");e||(e=document.createElement("div"),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t);n.style.all="initial",e.appendChild(n);let o=getComputedStyle(n),r={};for(let s of o){if(Yt(s))continue;let i=o.getPropertyValue(s);r[s]=i}return e.removeChild(n),x.defaultStyle.set(t,r),r}function Yt(t){let e=In.get(t);if(e===void 0){let n=String(t).toLowerCase();e=Jr.has(n)||Qr.test(n)||Kr.test(n),In.set(t,e)}return e}function ge(t,e){return!ei.has(t)&&(e==="inline"||Zr.has(t)||ti.has(t))}function It(t,e,n=!0,o=!1){if(e=String(e||"").toLowerCase(),me.has(e))return"";let r=[],s=he(e),i=(t.display||"").toLowerCase(),a=i==="inline",c=ge(e,i),f=t["text-wrap-mode"]||t["white-space"]||"",l=c&&n&&!a&&(f==="nowrap"||f==="pre"),d=c&&n&&!l,u=!1;for(let p in t){if(Yt(p))continue;let h=t[p];if(d){if(ni.has(p))continue;if(oi.has(p)){h&&h!==s[p]&&(r.push(`${p}:${h}`),h!=="auto"&&(u=!0));continue}}if(h&&h!==s[p]){if(!l&&(p==="width"||p==="inline-size")&&h.endsWith("px")&&h.includes(".")){let m=parseFloat(h);if(Number.isFinite(m)){r.push(`${p}:${Math.ceil(m*16)/16}px`);continue}}r.push(`${p}:${h}`)}}if(d&&!a&&!o&&!u){let p=t.width;p&&p!=="auto"&&p!==s.width&&r.push(`min-width:${p}`)}return r.sort(),r.join(";")}function He(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 ze(t){let e=new Map;for(let o of t){let r=he(o);if(!r)continue;let s=Object.entries(r).map(([i,a])=>`${i}:${a};`).sort().join("");s&&(e.has(s)||e.set(s,[]),e.get(s).push(o))}let n="";for(let[o,r]of e.entries())n+=`${r.join(",")} { ${o} }
8
- `;return n}function Ve(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,o=1;for(let r of e)n.set(r,`c${o++}`);return n}function ri(t){try{let e=t?.ownerDocument;if(!e)return typeof window<"u"?window:null;let n=e.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let o=0;o<window.frames.length;o++)try{if(window.frames[o]?.document===e)return window.frames[o]}catch{}}catch{}return typeof window<"u"?window:null}function P(t,e=null){let n=()=>{let s={length:0,getPropertyValue:()=>"",item:()=>""};return s[Symbol.iterator]=function*(){},s};if(t?.nodeType!==1){let s=typeof window<"u"?window:null;if(s&&typeof s.getComputedStyle=="function")try{return s.getComputedStyle(t,e)||n()}catch{return n()}return n()}let o=x.computedStyle.get(t);o||(o=new Map,x.computedStyle.set(t,o));let r=o.get(e);if(!r){let s=ri(t),i=null;try{i=s&&typeof s.getComputedStyle=="function"?s.getComputedStyle(t,e):null}catch{}if(!i&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(i=window.getComputedStyle(t,e))}catch{}r=i||n(),o.set(e,r)}return r}function ye(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);for(let n of ii){let o=e[`border-${n}-style`],r=e[`border-${n}-width`];(o==="none"||o==="hidden"||r==="0px")&&(delete e[`border-${n}-style`],delete e[`border-${n}-width`],delete e[`border-${n}-color`])}return e}function _t(t){let e=[],n=0,o=0;for(let r=0;r<t.length;r++){let s=t[r];s==="("&&n++,s===")"&&n--,s===","&&n===0&&(e.push(t.slice(o,r).trim()),o=r+1)}return e.push(t.slice(o).trim()),e}var pe,me,Yr,Kr,Qr,Jr,In,Zr,ti,ei,ni,oi,ii,Kt=ot(()=>{"use strict";tt();pe=new Set(["meta","script","noscript","title","link","template"]),me=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Yr=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"];Kr=/(?:^|-)(animation|transition)(?:-|$)/i,Qr=/^(--.+|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,Jr=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"]),In=new Map;Zr=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),ti=new Set(["table","thead","tbody","tfoot","tr","td","th"]),ei=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),ni=new Set(["width","max-width","inline-size","max-inline-size"]),oi=new Set(["min-width","min-inline-size"]);ii=["top","right","bottom","left"]});function $t(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function je(){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"),o=/applewebkit/i.test(t),r=/mobile/i.test(t),s=!/safari/i.test(t),i=o&&r&&s,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),f=/ipad|iphone|ipod/.test(e)&&o;return n||i||a||c||f}function _n(){if(typeof navigator>"u")return!1;let t=(navigator.userAgent||"").toLowerCase();return t.includes("firefox")||t.includes("fxios")}var Wt=ot(()=>{"use strict"});function I(t,e,n){let o=t&&typeof t=="object"&&(t.options||t);o&&o.debug&&(n!==void 0?console.warn("[snapdom]",e,n):console.warn("[snapdom]",e))}var qe=ot(()=>{"use strict"});var rt=ot(()=>{"use strict";Nn();Kt();Wt();Gt();qe()});var kr={};qt(kr,{decodeSvgFromDataURL:()=>Ne,encodeSvgToDataURL:()=>Ie,fixSafariShadows:()=>_e,toCanvas:()=>Rt});function ca(t){try{let e=t.match(/<svg\b[^>]*>/i);if(!e)return t;let n=e[0],o=parseFloat((n.match(/\bwidth="([\d.]+)/i)||[])[1]),r=parseFloat((n.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(o)||!Number.isFinite(r)||o<=0||r<=0)return t;let s=Math.min(1,xt/o,xt/r,Math.sqrt(gn/(o*r)));if(s>=1)return t;let i=Math.max(1,Math.floor(o*s)),a=Math.max(1,Math.floor(r*s));return console.warn(`[snapDOM] Capture ${Math.round(o)}\xD7${Math.round(r)}px exceeds the browser image-decode limit (${xt}px/side); downscaling to ${i}\xD7${a}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),t.replace(n,n.replace(/(\bwidth=")[\d.]+/i,`$1${i}`).replace(/(\bheight=")[\d.]+/i,`$1${a}`))}catch{return t}}function la(t,e){let n=["x","y","width","height"].map(v=>Number(e?.[v]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw new RangeError("[snapdom] canvas crop requires finite x/y and positive width/height");let o=t.match(/<svg\b[^>]*>/i);if(!o)throw new Error("[snapdom] cannot crop a non-SVG capture");let r=o[0],s=(r.match(/\bviewBox="([^"]+)"/i)||[])[1],i=String(s||"").trim().split(/[\s,]+/).map(Number);if(i.length!==4||!i.every(Number.isFinite)||i[2]<=0||i[3]<=0)throw new Error("[snapdom] cannot crop an SVG without a finite viewBox");let[a,c,f,l]=i,d=Math.max(a,n[0]),u=Math.max(c,n[1]),p=Math.min(a+f,n[0]+n[2]),h=Math.min(c+l,n[1]+n[3]);if(!(p>d)||!(h>u))throw new RangeError("[snapdom] canvas crop does not intersect the SVG viewBox");let m=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),y=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]),b=Number.isFinite(m)&&m>0?m/f:1,S=Number.isFinite(y)&&y>0?y/l:1,C=Math.max(1,(p-d)*b),g=Math.max(1,(h-u)*S),w=r.replace(/(\bwidth=")[^"]*/i,`$1${C}`).replace(/(\bheight=")[^"]*/i,`$1${g}`).replace(/(\bviewBox=")[^"]*/i,`$1${d} ${u} ${p-d} ${h-u}`);return t.replace(r,w)}function vr(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function Ne(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function fa(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 Ie(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Cr(t){let e=[],n="",o=0;for(let r=0;r<t.length;r++){let s=t[r];s==="("&&o++,s===")"&&(o=Math.max(0,o-1)),s===";"&&o===0?(e.push(n),n=""):n+=s}return n.trim()&&e.push(n),e.map(r=>r.trim()).filter(Boolean)}function ua(t){let e=[],n="",o=0;for(let s=0;s<t.length;s++){let i=t[s];i==="("&&o++,i===")"&&(o=Math.max(0,o-1)),i===","&&o===0?(e.push(n.trim()),n=""):n+=i}n.trim()&&e.push(n.trim());let r=[];for(let s of e){if(/\binset\b/i.test(s))continue;let i=s.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",c="0px",f="0px"]=i;f=`${parseFloat(f)/2}px`;let l=s.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!l&&l!==",";r.push(`drop-shadow(${a} ${c} ${f}${d?` ${l}`:""})`)}return r.join(" ")}function Ar(t){let e=Cr(t),n=null,o=null,r=null,s=[];for(let a of e){let c=a.indexOf(":");if(c<0)continue;let f=a.slice(0,c).trim().toLowerCase(),l=a.slice(c+1).trim();f==="box-shadow"?r=l:f==="filter"?n=l:f==="-webkit-filter"?o=l:s.push([f,l])}if(r){let a=ua(r);a&&(n=n?`${n} ${a}`:a,o=o?`${o} ${a}`:a)}let i=[...s];return n&&i.push(["filter",n]),o&&i.push(["-webkit-filter",o]),i.map(([a,c])=>`${a}:${c}`).join(";")}function da(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${Ar(o)}}`)}function pa(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,da(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${Ar(o)}${n}`),t}function ma(){return Pe||(Pe=(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 o=n.getContext("2d",{willReadFrequently:!0});o.drawImage(e,0,0);let r=o.getImageData(2,18,1,1).data[3]>128,s=o.getImageData(2,2,1,1).data[3]>128;return{native:r||s,flippedY:s&&!r}}catch{return{native:!1,flippedY:!1}}})(),Pe)}function ha(t){let e=[],n=0,o=0;for(let r=0;r<t.length;r++){let s=t[r];s==="("?n++:s===")"?n=Math.max(0,n-1):s===","&&n===0&&(e.push(t.slice(o,r)),o=r+1)}return e.push(t.slice(o)),e.map(r=>{let s=0,i=0,a="",c=0;for(;c<r.length;){let f=r[c];if(f==="("?s++:f===")"&&(s=Math.max(0,s-1)),s===0&&(c===0||r[c-1]===" ")){let l=/^-?\d*\.?\d+px/.exec(r.slice(c));if(l){i++,a+=i===2?`${-parseFloat(l[0])}px`:l[0],c+=l[0].length;continue}}a+=f,c++}return a}).join(",")}function ga(t,e){let n=o=>Cr(o).map(r=>{let s=r.indexOf(":");if(s<0)return r;let i=r.slice(0,s).trim().toLowerCase();return i==="text-shadow"||e&&i==="box-shadow"?`${i}:${ha(r.slice(s+1))}`:r}).join(";");return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(o,r)=>o.replace(r,r.replace(/([^{}]+)\{([^}]*)\}/g,(s,i,a)=>`${i}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(o,r,s)=>`style=${r}${n(s)}${r}`),t}async function _e(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:o}=await ma();try{let r=t;return n||(r=pa(r)),o&&(r=ga(r,n)),{svg:r,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}async function ya(t,e){t.setAttribute("data-snapdom-internal",""),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{let n=document.createElement("canvas");n.width=16,n.height=16;let o=()=>new Promise(i=>{requestAnimationFrame(i),setTimeout(i,50)}),r=n.getContext("2d",{willReadFrequently:!0});if(!r){await o(),await o();return}let s=performance.now()+(e?600:150);for(;;){r.clearRect(0,0,16,16);try{r.drawImage(t,0,0,16,16)}catch{return}let i=r.getImageData(0,0,16,16).data,a=!1;for(let c=3;c<i.length;c+=4)if(i[c]>0){a=!0;break}if(a||performance.now()>s)return;await o()}}finally{try{t.remove()}catch{}}}async function Rt(t,e){let{width:n,height:o,scale:r=1,dpr:s=1,meta:i={},backgroundColor:a,crop:c=null}=e,f=t,l=!1,d=!1;if(c&&!vr(t))throw new RangeError("[snapdom] canvas crop requires an SVG capture payload");if(vr(t)){let $=(fa(t).match(/<svg\b[^>]*>/i)||[])[0]||"",F=parseFloat(($.match(/\bwidth="([\d.]+)/i)||[])[1]),R=parseFloat(($.match(/\bheight="([\d.]+)/i)||[])[1]),D=Number.isFinite(F)&&Number.isFinite(R)&&F>0&&R>0&&Math.min(1,xt/F,xt/R,Math.sqrt(gn/(F*R)))<1;if(c||D||X())try{let L=Ne(t);if(c&&(L=la(L,c)),X()){let _=await _e(L);L=_.svg,l=_.naturalOnly,d=/@font-face|data:image\//i.test(L)}(D||c)&&(L=ca(L)),f=Ie(L)}catch(L){if(c)throw L;f=t}}let u=new Image;u.loading="eager",u.decoding="sync",u.crossOrigin="anonymous",u.src=f,await u.decode(),X()&&await ya(u,d);let p=u.naturalWidth,h=u.naturalHeight,m=c?p:Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:p,y=c?h:Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:h,b,S,C=Number.isFinite(n),g=Number.isFinite(o);if(C&&g)b=Math.max(1,n),S=Math.max(1,o);else if(C){let $=n/Math.max(1,m);b=n,S=y*$}else if(g){let $=o/Math.max(1,y);S=o,b=m*$}else b=p,S=h;b=b*r,S=S*r;let w=b*s,v=S*s,M=Math.max(w/xt,v/xt,Math.sqrt(w*v/gn));M>1&&(console.warn(`[snapDOM] Output ${Math.round(w)}\xD7${Math.round(v)}px exceeds the browser canvas limit (${xt}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),b/=M,S/=M);let A=document.createElement("canvas");A.width=b*s,A.height=S*s,A.style.width=`${b}px`,A.style.height=`${S}px`;let k=A.getContext("2d");if(s!==1&&k.scale(s,s),a&&(k.save(),k.fillStyle=a,k.fillRect(0,0,b,S),k.restore()),l&&(Math.round(b*s)!==p||Math.round(S*s)!==h)){let $=document.createElement("canvas");$.width=p,$.height=h,$.getContext("2d").drawImage(u,0,0),k.drawImage($,0,0,b,S)}else k.drawImage(u,0,0,b,S);return A}var xt,gn,Pe,Vt=ot(()=>{"use strict";Wt();xt=16384,gn=16384*16384;Pe=null});var We={};qt(We,{rasterize:()=>yn});async function yn(t,e){let n=await Rt(t,e),o=await new Promise(s=>{let i=()=>s(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(a=>{if(!a)return i();let c=new FileReader;c.onload=()=>s(String(c.result||"")),c.onerror=i,c.readAsDataURL(a)},`image/${e.format}`,e.quality)}catch{i()}}),r=new Image;return r.src=o,await r.decode(),r.style.width=`${n.width/e.dpr}px`,r.style.height=`${n.height/e.dpr}px`,r}var ie=ot(()=>{"use strict";Vt()});var bn={};qt(bn,{toImg:()=>ba,toSvg:()=>ba});async function ba(t,e){let{scale:n=1,width:o,height:r,meta:s={}}=e,i=Number.isFinite(o),a=Number.isFinite(r),c=Number.isFinite(n)&&n!==1||i||a;if(X()&&c)try{let{svg:l}=await _e(Ne(t)),d=(l.match(/<svg\b[^>]*>/i)||[])[0]||"",u=parseFloat((d.match(/\bwidth="([\d.]+)/i)||[])[1]),p=parseFloat((d.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(u)||!Number.isFinite(p))throw new Error("svg without dimensions");let h=Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:u,m=Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:p,y,b;i&&a?(y=o,b=r):i?(y=o,b=Math.round(m*(o/Math.max(1,h)))):a?(b=r,y=Math.round(h*(r/Math.max(1,m)))):(y=Math.round(u*n),b=Math.round(p*n));let S=l.replace(/width="[^"]*"/,`width="${y}"`).replace(/height="[^"]*"/,`height="${b}"`),C=new Image;return C.decoding="sync",C.loading="eager",C.src=Ie(S),await C.decode(),C.style.width=`${y}px`,C.style.height=`${b}px`,C}catch(l){return I(e,"safari vector toImg failed, falling back to PNG",l),yn(t,{...e,format:"png",quality:1,meta:s})}let f=new Image;if(f.decoding="sync",f.loading="eager",f.src=t,await f.decode(),i&&a)f.style.width=`${o}px`,f.style.height=`${r}px`;else if(i){let l=Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:f.naturalWidth,d=Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:f.naturalHeight,u=o/Math.max(1,l);f.style.width=`${o}px`,f.style.height=`${Math.round(d*u)}px`}else if(a){let l=Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:f.naturalWidth,d=Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:f.naturalHeight,u=r/Math.max(1,d);f.style.height=`${r}px`,f.style.width=`${Math.round(l*u)}px`}else{let l=Math.round(f.naturalWidth*n),d=Math.round(f.naturalHeight*n);if(f.style.width=`${l}px`,f.style.height=`${d}px`,typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let p=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${l}"`).replace(/height="[^"]*"/,`height="${d}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,f.src=t}catch(u){I(e,"SVG width/height patch in toImg failed",u)}}return f}var wn=ot(()=>{"use strict";rt();ie();Vt()});var Mr={};qt(Mr,{toBlob:()=>xn});async function xn(t,e){let n=e.type;if(n==="svg"){let r=decodeURIComponent(t.split(",")[1]);return new Blob([r],{type:"image/svg+xml"})}let o=await Rt(t,e);return new Promise(r=>o.toBlob(s=>r(s),`image/${n}`,e.quality))}var Sn=ot(()=>{"use strict";Vt()});var $r={};qt($r,{download:()=>wa});async function Er(t,e){let n=new File([t],e,{type:t.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:e})}catch(o){if(o.name!=="AbortError")return!1}return!0}async function wa(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),o=(e?.type||"").toLowerCase(),r=n.has(o)?o:"",s=(e?.format||r||"").toLowerCase(),i=s==="jpg"?"jpeg":s||"png",a=e?.filename||`snapdom.${i}`,c={...e||{},format:i,type:i};c.dpr=1;let f=je();if(i==="svg"){let u=await xn(t,{...c,type:"svg"});if(f&&await Er(u,a))return;let p=URL.createObjectURL(u),h=document.createElement("a");h.href=p,h.download=a,document.body.appendChild(h),h.click(),URL.revokeObjectURL(p),h.remove();return}let l=await Rt(t,c);if(f){let u=`image/${i}`,p=await new Promise(h=>l.toBlob(h,u,e?.quality));if(p&&await Er(p,a))return}let d=document.createElement("a");d.href=l.toDataURL(`image/${i}`,e?.quality),d.download=a,document.body.appendChild(d),d.click(),d.remove()}var Fr=ot(()=>{"use strict";Sn();Vt();Wt()});rt();rt();tt();var Ge=new WeakMap,Qt=new Map,si=2e3,we=0;function be(){we++,Qt.size>si&&Qt.clear()}var ai="[data-snapdom-sandbox],[data-snapdom-internal],[data-snapdom]";function Xe(t){let e=t&&(t.nodeType===1?t:t.parentElement);return!!(e&&e.closest&&e.closest(ai))}function Ye(t){for(let e of t)if(!Xe(e.target)){if(e.type==="childList"){let n=!0;for(let o of e.addedNodes)if(!Xe(o)){n=!1;break}if(n){for(let o of e.removedNodes)if(!Xe(o)){n=!1;break}}if(n)continue}return!0}return!1}var Wn=!1;function ci(t=document.documentElement){if(Wn)return;Wn=!0;let e=n=>{Ye(n)&&be()};try{new MutationObserver(e).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(e).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let n=document.fonts;n&&(n.addEventListener?.("loadingdone",be),n.ready?.then(()=>be()).catch(()=>{}))}catch{}}var li=["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 Ke(t){let e=Ge.get(t);if(e&&e.epoch===we){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function fi(t,e={}){let n={},o=e.excludeStyleProps;for(let d=0;d<t.length;d++){let u=t[d];if(Yt(u)||o&&(o instanceof RegExp&&o.test(u)||typeof o=="function"&&o(u)))continue;let p=t.getPropertyValue(u);(u==="background-image"||u==="content")&&p.includes("url(")&&!p.includes("data:")&&(p="none"),n[u]=p}let r=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let d of r)if(!n[d])try{let u=t.getPropertyValue(d);u&&(n[d]=u)}catch{}let s=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let d of s)if(!n[d])try{let u=t.getPropertyValue(d);u&&(n[d]=u)}catch{}if(e.embedFonts){let d=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let u of d)if(!n[u])try{let p=t.getPropertyValue(u);p&&(n[u]=p)}catch{}}try{(n["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(n["content-visibility"]="hidden")}catch{}let i=!1;{let d=t.getPropertyValue("background-image");if(d&&d!=="none"&&(i=!0),!i){let u=t.getPropertyValue("background-color");u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"&&(i=!0)}if(!i)for(let u of li){let p=t.getPropertyValue(u);if(p&&p!=="none"){i=!0;break}}if(!i){let u=t.getPropertyValue("background");u&&/url\s*\(/i.test(u)&&(i=!0)}}Object.defineProperty(n,"__needsBgInline",{value:i,enumerable:!1});let a=parseFloat(t.getPropertyValue("border-top-width")||0)||0,c=parseFloat(t.getPropertyValue("border-right-width")||0)||0,f=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,l=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(a===0&&c===0&&f===0&&l===0){let d=(t.getPropertyValue("border-image-source")||"").trim(),u=d&&d!=="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"];for(let h of p)delete n[h];u||(n.border="none")}return n}function ui(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=P(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}var On=new WeakMap;function di(t){let e=On.get(t);return e||(e=Object.entries(t).sort((o,r)=>o[0]<r[0]?-1:o[0]>r[0]?1:0).map(([o,r])=>`${o}:${r}`).join(";"),On.set(t,e),e)}function pi(t,e=null,n={}){let o=Ge.get(t),r=!!(n&&n.embedFonts),s=n&&n.excludeStyleProps||null;if(o&&o.epoch===we&&o.embedFonts===r&&o.excludeStyleProps===s)return o.snapshot;let i=e||getComputedStyle(t),a=fi(i,n);return wi(t,i,a),Ge.set(t,{epoch:we,snapshot:a,embedFonts:r,excludeStyleProps:s}),a}function mi(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Qt,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:e||{}}:{session:x.session,persist:{snapshotKeyCache:Qt,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:t||e||{}}}function hi(t,e,n){if(!(!t.style||t.style.length===0))for(let o=0;o<t.style.length;o++){let r=t.style[o],s=n.getPropertyValue(r);s&&e.style.setProperty(r,s)}}async function it(t,e,n,o){if(t.tagName==="STYLE")return;let r=mi(n,o),s=r.options&&r.options.cache||"auto";s!=="disabled"&&ci(document.documentElement),s==="disabled"&&!r.session.__bumpedForDisabled&&(be(),Qt.clear(),r.session.__bumpedForDisabled=!0);let{session:i,persist:a}=r;if(!i.styleCache.has(t)){let y=null;try{y=getComputedStyle(t)}catch{}i.styleCache.set(t,y||getComputedStyle(document.documentElement))}let c=i.styleCache.get(t);t.getAttribute?.("style")&&hi(t,e,c);let f=c.getPropertyValue("animation-name");e&&e.style&&f&&f!=="none"&&e.style.setProperty("animation","none","important");let l=pi(t,c,r.options),d=Bn(t);if(d){let y=c.getPropertyValue("min-width");(!y||y==="auto"||y==="0px")&&(l["min-width"]="0px")}let u=t.tagName?.toLowerCase()||"div",p=di(l),h=!0;if(ge(u,(l.display||"").toLowerCase())){h=ui(t),p=`${p}|${u}${h?"|c":""}${d?"|f":""}`;let y=l["text-wrap-mode"]||l["white-space"]||"";h&&y!=="nowrap"&&y!=="pre"&&(i.reconcileRisk=(i.reconcileRisk||0)+1)}let m=a.snapshotKeyCache.get(p);m===void 0&&(m=It(l,u,h,d),a.snapshotKeyCache.set(p,m)),i.styleMap.set(e,m)}function gi(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}function Bn(t){let e=t.parentElement;if(!e)return!1;let n=P(e).display||"";return n.includes("flex")||n.includes("grid")}function yi(t){for(let o=t.firstChild;o;o=o.nextSibling)if(o.nodeType===3&&/\S/.test(o.nodeValue))return!0;let e=t.firstElementChild,n=t.lastElementChild;if(e&&e.tagName==="BR"||n&&n.tagName==="BR")return!0;for(let o=t.firstElementChild;o;o=o.nextElementSibling){let r=P(o);if(r.display==="none")continue;let s=r.position;if(s!=="absolute"&&s!=="fixed")return!0}return!1}function bi(t){let e=t.getBoundingClientRect().top,n=-1/0,o=null;for(let r=t.firstChild;r;r=r.nextSibling){if(r.nodeType===3){if(!/\S/.test(r.nodeValue||""))continue;o=o||document.createRange(),o.selectNode(r);let a=o.getBoundingClientRect();(a.width||a.height)&&(n=Math.max(n,a.bottom));continue}if(r.nodeType!==1)continue;let s=P(r);if(s.display==="none")continue;let i=s.position;i==="absolute"||i==="fixed"||s.float&&s.float!=="none"||(n=Math.max(n,r.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-e}function wi(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let o=t.tagName&&t.tagName.toLowerCase();if(!o||!["div","section","article","main","aside","header","footer","nav"].includes(o)||e.aspectRatio&&e.aspectRatio!=="none"&&e.aspectRatio!=="auto")return;let s=e.display||"";if(s.includes("flex")||s.includes("grid"))return;let i=e.position;if(i==="absolute"||i==="fixed"||i==="sticky"||e.transform!=="none"||gi(e)||Bn(t))return;let a=e.overflowX||e.overflow||"visible",c=e.overflowY||e.overflow||"visible";if(a!=="visible"||c!=="visible")return;let f=e.clip;if(f&&f!=="auto"&&f!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||!yi(t))return;let l=parseFloat(e.height),d=bi(t);Number.isFinite(l)&&Number.isFinite(d)&&Math.abs(l-d)>2||(delete n.height,delete n["block-size"])}Kt();var Dn=["fill","stroke","color","background-color","stop-color"],xi=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]);function xe(t){let e=t;for(;e&&e.nodeType===1;){if(e.namespaceURI==="http://www.w3.org/2000/svg"){if(e.localName==="mask"||e.localName==="clipPath")return!1;if(xi.has(e.localName))return!0}e=e.parentNode}return!1}var Un=new Map;function Si(t,e){let n=e+"::"+t.toLowerCase(),o=Un.get(n);if(o)return o;let r=document,s=e==="http://www.w3.org/2000/svg"?r.createElementNS(e,t):r.createElement(t),i=r.createElement("div");i.setAttribute("data-snapdom-internal",""),i.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",i.appendChild(s),r.documentElement.appendChild(i);let a=getComputedStyle(s),c={};for(let f of Dn)c[f]=a.getPropertyValue(f)||"";return i.remove(),Un.set(n,c),c}function Hn(t,e){if(t?.nodeType!==1||e?.nodeType!==1||xe(t))return;let n=t.getAttribute?.("style"),o=!!(n&&n.includes("var("));if(!o&&t.attributes?.length){let s=t.attributes;for(let i=0;i<s.length;i++){let a=s[i];if(a&&typeof a.value=="string"&&a.value.includes("var(")){o=!0;break}}}let r=null;if(o)try{r=getComputedStyle(t)}catch{}if(o){let s=t.style;if(s&&s.length){let i=new Set;for(let a=0;a<s.length;a++){let c=s[a];if(i.has(c))continue;i.add(c);let f=s.getPropertyValue(c);if(!f||!f.includes("var("))continue;let l=r&&r.getPropertyValue(c);if(l)try{e.style.setProperty(c,l.trim(),s.getPropertyPriority(c))}catch{}}}}if(o&&t.attributes?.length){let s=t.attributes;for(let i=0;i<s.length;i++){let a=s[i];if(!a||typeof a.value!="string"||!a.value.includes("var("))continue;let c=a.name,f=r&&r.getPropertyValue(c);if(f)try{e.style.setProperty(c,f.trim())}catch{}}}if(!o){if(!r)try{r=getComputedStyle(t)}catch{r=null}if(!r)return;let s=t.namespaceURI||"html",i=Si(t.tagName,s);for(let a of Dn){let c=r.getPropertyValue(a)||"",f=i[a]||"";if(c&&c!==f)try{e.style.setProperty(a,c.trim())}catch{}}}}rt();rt();tt();wt();wt();function Ft(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(t)&&t.length<200)}var zn="img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]";function vi(t,e){return!t||t?.nodeType!==1?!1:t.matches?.("picture")||t.querySelector("picture")?!0:e?!!(t.matches?.(zn)||t.querySelector(zn)):!1}var Ci=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i;function Ot(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 o=[];for(let s of t.split(",")){let i=s.trim().split(/\s+/);if(!i[0])continue;let a=i[1]||"",c=1;/^\d*\.?\d+x$/i.test(a)?c=parseFloat(a):/^\d+w$/i.test(a)&&(c=parseInt(a,10)/n),o.push({url:i[0],d:c})}if(!o.length)return null;o.sort((s,i)=>s.d-i.d);let r=window.devicePixelRatio||1;return(o.find(s=>s.d>=r)||o[o.length-1]).url}function Qe(t,e){let n=t.currentSrc||"";if(n&&!Ft(n))return n;let o=e.querySelectorAll("source[srcset]"),r=null;for(let s of o){let i=s.getAttribute("srcset");if(!i||Ft(i))continue;let a=s.getAttribute("type");if(a&&!Ci.test(a.trim()))continue;let c=s.getAttribute("media");if(c)try{if(window.matchMedia(c).matches)return Ot(i,t)}catch{}r||(r=Ot(i,t))}return r}function Ai(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let o of e)if(o&&!Ft(o))return o;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let o=n.split(",")[0].trim().split(/\s+/)[0];if(o&&!Ft(o))return o}return null}function ki(t={}){let e=t.pictureResolver&&typeof t.pictureResolver=="object"?t.pictureResolver:{};return{timeout:e.timeout??5e3,concurrency:e.concurrency??4,resolveLazySrc:e.resolveLazySrc!==!1,silent:e.silent??!1,useProxy:typeof t.useProxy=="string"?t.useProxy:""}}async function Vn(t,e={}){if(!t||t?.nodeType!==1||e.resolvePicturePlaceholders===!1)return null;let{timeout:n,concurrency:o,resolveLazySrc:r,silent:s,useProxy:i}=ki(e);if(!vi(t,r))return null;let a=[],c=[];async function f(u){let p=await j(u,{as:"dataURL",timeout:n,useProxy:i,silent:!0});return p.ok?p.data:null}async function l(u){for(let p=0;p<u.length;p+=o){let h=u.slice(p,p+o);await Promise.allSettled(h.map(m=>m()))}}let d=Array.from(t.querySelectorAll("picture"));t.matches?.("picture")&&d.unshift(t);for(let u of d){let p=u.querySelector("img");if(!p)continue;let h=p.getAttribute("src")||"";if(!Ft(h))continue;let m=Qe(p,u);m&&c.push(async()=>{let y=await f(m);if(!y){s||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${m.slice(0,60)}`);return}let b=p.getAttribute("src"),S=p.getAttribute("srcset"),C=p.getAttribute("sizes"),g=[];p.src=y,p.setAttribute("src",y),p.removeAttribute("srcset"),p.removeAttribute("sizes");let w=u.querySelectorAll("source");for(let v of w)g.push({el:v,parent:v.parentElement,next:v.nextSibling}),v.remove();a.push(()=>{b!==null?p.setAttribute("src",b):p.removeAttribute("src"),S!==null&&p.setAttribute("srcset",S),C!==null&&p.setAttribute("sizes",C);for(let{el:v,parent:M,next:A}of g)M&&M.insertBefore(v,A)})})}if(r){let u=Array.from(t.querySelectorAll("img"));t.localName==="img"&&u.unshift(t);for(let p of u){if(p.closest("picture")&&Ft(p.getAttribute("src")||""))continue;let h=p.getAttribute("src")||"",m=Ai(p);m&&Ft(h)&&c.push(async()=>{let y=await f(m);if(!y)return;let b=p.getAttribute("src");p.src=y,p.setAttribute("src",y),p.removeAttribute("srcset"),p.removeAttribute("sizes"),a.push(()=>{b!==null?p.setAttribute("src",b):p.removeAttribute("src")})})}}return c.length===0?null:(await l(c),async function(){for(let p of a)try{p()}catch{}})}function Ce(t,e,n){return n?Promise.all(t.map(o=>new Promise(r=>e(o,r)))):Promise.all(t.map(o=>new Promise(r=>{function s(){$t(i=>{(i&&typeof i.timeRemaining=="function"?i.timeRemaining()>0:!0)?e(o,r):s()},{fast:n})}s()})))}function Mi(t){return t=t.trim(),!t||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function Ei(t,e,n=!0){return t.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let r=n?Mi(o):o;return`:where(${e} ${r})`}).join(", ")}function qn(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${e}:is(${o.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${e} ${o.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,r,s)=>{let i=Ei(s,e,!0);return`${o}${r}${i}{`}),t):""}function Xn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Gn(t){let e="";try{t.querySelectorAll("style").forEach(o=>{e+=(o.textContent||"")+`
7
+ var jr=Object.defineProperty;var ot=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var qt=(t,e)=>{for(var n in e)jr(t,n,{get:e[n],enumerable:!0})};function Ln(t){if(t===!0)return"soft";if(t===!1)return"disabled";if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="auto")return"auto";if(e==="full")return"full";if(e==="soft"||e==="disabled")return e}return"soft"}function ue(t="soft"){switch(t){case"auto":{x.session.styleMap=new Map,x.session.nodeMap=new Map;return}case"soft":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap,x.computedStyle=new WeakMap,x.measureHints=new WeakMap,x.baseStyle=new q(50),x.defaultStyle=new q(30),x.image=new q(100),x.background=new q(100),x.resource=new q(150),x.compress=new q(50),x.font=new Set;return}default:{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}}}var q,x,tt=ot(()=>{"use strict";q=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let o=this.keys().next().value;o!==void 0&&this.delete(o)}return super.set(e,n)}},x={image:new q(100),background:new q(100),resource:new q(150),defaultStyle:new q(30),baseStyle:new q(50),compress:new q(50),computedStyle:new WeakMap,measureHints:new WeakMap,burstAdvice:new WeakMap,warnedReconcile:!1,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function Mt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Xt(t,e=1){let n=t.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let o=[];for(let s of n[1].split(",")){let i=s.match(/url\((['"]?)(.*?)(\1)\)/);if(!i)continue;let a=s.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!qr.test(a[1].trim()))continue;let c=s.match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)/i),f=1;if(c){let l=parseFloat(c[1]);f=/dpi/i.test(c[2])?l/96:l}o.push({url:i[2].trim(),dppx:f})}return o.length?(o.sort((s,i)=>s.dppx-i.dppx),(o.find(s=>s.dppx>=e)||o[o.length-1]).url):null}function Oe(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(s=>s.trim());return r.length!==6?`matrix(${o})`:(r[4]="0",r[5]="0",`matrix(${r.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,o)=>{let r=o.split(",").map(s=>s.trim());return r.length!==16?`matrix3d(${o})`:(r[12]="0",r[13]="0",`matrix3d(${r.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function bt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function Be(t,e){if(!t||/^(data|blob|about|#)/i.test(t.trim()))return t;try{let n=e||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(t,n).href}catch{return t}}var qr,Gt=ot(()=>{"use strict";qr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i});function Xr(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function s(i,a,c){if(r>=n)return;let f=Date.now();(o.get(a)||0)>f||(o.set(a,f+e),r++,i==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(i,a){s("warn",i,a)},errorOnce(i,a){s("error",i,a)},reset(){o.clear(),r=0}}}function Gr(t){return/^data:|^blob:|^about:blank$/i.test(t)}function Yr(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=e.includes("{url}")?e.split("{url}")[0]:e,r=new URL(o||".",n),s=new URL(t,n);if(s.origin===r.origin)return!0;let i=s.searchParams;if(i&&(i.has("url")||i.has("target")))return!0}catch{}return!1}function Kr(t,e){if(!e||Gr(t)||Yr(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location<"u"?o.origin!==location.origin:!0}catch{return!!e}}function Qr(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",bt(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}${bt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Pn(t){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>e(String(o.result||"")),o.onerror=()=>n(new Error("read_failed")),o.readAsDataURL(t)})}function Zr(t,e){return[e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,t].join("|")}async function j(t,e={}){let n=e.as??"blob",o=e.timeout??3e3,r=e.useProxy||"",s=e.errorTTL??8e3,i=e.headers||{},a=!!e.silent;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,y="",b=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],C=/;base64/i.test(y)?atob(b):decodeURIComponent(b),g=new Uint8Array([...C].map(v=>v.charCodeAt(0))),w=new Blob([g],{type:(y||"").split(";")[0]||""});return{ok:!0,data:w,status:200,url:t,fromCache:!1,mime:w.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let y=await fetch(t);if(!y.ok)return{ok:!1,data:null,status:y.status,url:t,fromCache:!1,reason:"http_error"};let b=await y.blob(),S=b.type||y.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Pn(b),status:y.status,url:t,fromCache:!1,mime:S}:n==="text"?{ok:!0,data:await b.text(),status:y.status,url:t,fromCache:!1,mime:S}:{ok:!0,data:b,status:y.status,url:t,fromCache:!1,mime:S}}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=Zr(t,{as:n,timeout:o,useProxy:r,errorTTL:s}),f=de.get(c);if(f&&f.until>Date.now())return{...f.result,fromCache:!0};f&&de.delete(c);let l=Ue.get(c);if(l)return l;let d=Kr(t,r)?Qr(t,r):t,u=e.credentials;if(!u)try{let y=typeof location<"u"&&location.href?location.href:"http://localhost/",b=new URL(t,y);u=typeof location<"u"&&b.origin===location.origin?"include":"omit"}catch{u="omit"}let p=new AbortController,h=setTimeout(()=>p.abort("timeout"),o),m=(async()=>{try{let y=await fetch(d,{signal:p.signal,credentials:u,headers:i});if(!y.ok){let C={ok:!1,data:null,status:y.status,url:d,fromCache:!1,reason:"http_error"};if(s>0&&de.set(c,{until:Date.now()+s,result:C}),!a){let g=`${y.status} ${y.statusText||""}`.trim();Nn.warnOnce(`http:${y.status}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,`HTTP error ${g} while fetching ${n} ${t}`)}return e.onError&&e.onError(C),C}if(n==="text")return{ok:!0,data:await y.text(),status:y.status,url:d,fromCache:!1};let b=await y.blob(),S=b.type||y.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Pn(b),status:y.status,url:d,fromCache:!1,mime:S}:{ok:!0,data:b,status:y.status,url:d,fromCache:!1,mime:S}}catch(y){let b=y&&typeof y=="object"&&"name"in y&&y.name==="AbortError"?String(y.message||"").includes("timeout")?"timeout":"abort":"network",S={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:b};if(!/^blob:/i.test(t)&&s>0&&de.set(c,{until:Date.now()+s,result:S}),!a){let C=`${b}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,g=b==="timeout"?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:b==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;Nn.errorOnce(C,g)}return e.onError&&e.onError(S),S}finally{clearTimeout(h),Ue.delete(c)}})();return Ue.set(c,m),m}var Nn,Ue,de,wt=ot(()=>{"use strict";Gt();Nn=Xr("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Ue=new Map,de=new Map});async function Et(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=Xt(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Mt(t);if(!o)return t;let r=Be(o),s=bt(r),i=(e.useProxy||"")+"|"+s;if(x.background.has(i)){let a=x.background.get(i);return a?`url("${a}")`:"none"}try{let a=await j(s,{as:"dataURL",useProxy:e.useProxy});return a.ok?(x.background.set(i,a.data),`url("${a.data}")`):(x.background.set(i,null),"none")}catch{return x.background.set(i,null),"none"}}var In=ot(()=>{"use strict";tt();Gt();wt()});function De(){for(let t of Jr){let e=String(t).toLowerCase();pe.has(e)||me.has(e)||he(e)}}function he(t){if(t=String(t).toLowerCase(),me.has(t)){let s={};return x.defaultStyle.set(t,s),s}if(x.defaultStyle.has(t))return x.defaultStyle.get(t);let e=document.getElementById("snapdom-sandbox");e||(e=document.createElement("div"),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t);n.style.all="initial",e.appendChild(n);let o=getComputedStyle(n),r={};for(let s of o){if(Yt(s))continue;let i=o.getPropertyValue(s);r[s]=i}return e.removeChild(n),x.defaultStyle.set(t,r),r}function Yt(t){let e=_n.get(t);if(e===void 0){let n=String(t).toLowerCase();e=ni.has(n)||ei.test(n)||ti.test(n),_n.set(t,e)}return e}function ge(t,e){return!ri.has(t)&&(e==="inline"||oi.has(t)||Wn.has(t))}function He(t,e,n){let o=(e.display||"").toLowerCase();if(o==="inline"||Wn.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let s=(e.position||"static").toLowerCase();return s==="absolute"||s==="fixed"?!1:!ai.has(o)}function It(t,e,n=!0,o=!1){if(e=String(e||"").toLowerCase(),me.has(e))return"";let r=[],s=he(e),i=(t.display||"").toLowerCase(),a=i==="inline",c=ge(e,i),f=t["text-wrap-mode"]||t["white-space"]||"",l=c&&n&&!a&&(f==="nowrap"||f==="pre"),d=c&&n&&!l,u=!1;for(let p in t){if(Yt(p))continue;let h=t[p];if(d){if(ii.has(p))continue;if(si.has(p)){h&&h!==s[p]&&(r.push(`${p}:${h}`),h!=="auto"&&(u=!0));continue}}if(h&&h!==s[p]){if(!l&&(p==="width"||p==="inline-size")&&h.endsWith("px")&&h.includes(".")){let m=parseFloat(h);if(Number.isFinite(m)){r.push(`${p}:${Math.ceil(m*16)/16}px`);continue}}r.push(`${p}:${h}`)}}if(d&&!a&&!o&&!u){let p=t.width;p&&p!=="auto"&&p!==s.width&&r.push(`min-width:${p}`)}return r.sort(),r.join(";")}function ze(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 Ve(t){let e=new Map;for(let o of t){let r=he(o);if(!r)continue;let s=Object.entries(r).map(([i,a])=>`${i}:${a};`).sort().join("");s&&(e.has(s)||e.set(s,[]),e.get(s).push(o))}let n="";for(let[o,r]of e.entries())n+=`${r.join(",")} { ${o} }
8
+ `;return n}function je(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,o=1;for(let r of e)n.set(r,`c${o++}`);return n}function ci(t){try{let e=t?.ownerDocument;if(!e)return typeof window<"u"?window:null;let n=e.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let o=0;o<window.frames.length;o++)try{if(window.frames[o]?.document===e)return window.frames[o]}catch{}}catch{}return typeof window<"u"?window:null}function L(t,e=null){let n=()=>{let s={length:0,getPropertyValue:()=>"",item:()=>""};return s[Symbol.iterator]=function*(){},s};if(t?.nodeType!==1){let s=typeof window<"u"?window:null;if(s&&typeof s.getComputedStyle=="function")try{return s.getComputedStyle(t,e)||n()}catch{return n()}return n()}let o=x.computedStyle.get(t);o||(o=new Map,x.computedStyle.set(t,o));let r=o.get(e);if(!r){let s=ci(t),i=null;try{i=s&&typeof s.getComputedStyle=="function"?s.getComputedStyle(t,e):null}catch{}if(!i&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(i=window.getComputedStyle(t,e))}catch{}r=i||n(),o.set(e,r)}return r}function ye(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);for(let n of li){let o=e[`border-${n}-style`],r=e[`border-${n}-width`];(o==="none"||o==="hidden"||r==="0px")&&(delete e[`border-${n}-style`],delete e[`border-${n}-width`],delete e[`border-${n}-color`])}return e}function _t(t){let e=[],n=0,o=0;for(let r=0;r<t.length;r++){let s=t[r];s==="("&&n++,s===")"&&n--,s===","&&n===0&&(e.push(t.slice(o,r).trim()),o=r+1)}return e.push(t.slice(o).trim()),e}var pe,me,Jr,ti,ei,ni,_n,oi,Wn,ri,ii,si,ai,li,Kt=ot(()=>{"use strict";tt();pe=new Set(["meta","script","noscript","title","link","template"]),me=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Jr=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"];ti=/(?:^|-)(animation|transition)(?:-|$)/i,ei=/^(--.+|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,ni=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"]),_n=new Map;oi=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),Wn=new Set(["table","thead","tbody","tfoot","tr","td","th"]),ri=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),ii=new Set(["width","max-width","inline-size","max-inline-size"]),si=new Set(["min-width","min-inline-size"]);ai=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);li=["top","right","bottom","left"]});function Ft(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function qe(){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"),o=/applewebkit/i.test(t),r=/mobile/i.test(t),s=!/safari/i.test(t),i=o&&r&&s,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),f=/ipad|iphone|ipod/.test(e)&&o;return n||i||a||c||f}function On(){if(typeof navigator>"u")return!1;let t=(navigator.userAgent||"").toLowerCase();return t.includes("firefox")||t.includes("fxios")}var Wt=ot(()=>{"use strict"});function I(t,e,n){let o=t&&typeof t=="object"&&(t.options||t);o&&o.debug&&(n!==void 0?console.warn("[snapdom]",e,n):console.warn("[snapdom]",e))}var Xe=ot(()=>{"use strict"});var rt=ot(()=>{"use strict";In();Kt();Wt();Gt();Xe()});var $r={};qt($r,{decodeSvgFromDataURL:()=>Pe,encodeSvgToDataURL:()=>Ie,fixSafariShadows:()=>_e,toCanvas:()=>Rt});function ga(t){try{let e=t.match(/<svg\b[^>]*>/i);if(!e)return t;let n=e[0],o=parseFloat((n.match(/\bwidth="([\d.]+)/i)||[])[1]),r=parseFloat((n.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(o)||!Number.isFinite(r)||o<=0||r<=0)return t;let s=Math.min(1,xt/o,xt/r,Math.sqrt(yn/(o*r)));if(s>=1)return t;let i=Math.max(1,Math.floor(o*s)),a=Math.max(1,Math.floor(r*s));return console.warn(`[snapDOM] Capture ${Math.round(o)}\xD7${Math.round(r)}px exceeds the browser image-decode limit (${xt}px/side); downscaling to ${i}\xD7${a}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),t.replace(n,n.replace(/(\bwidth=")[\d.]+/i,`$1${i}`).replace(/(\bheight=")[\d.]+/i,`$1${a}`))}catch{return t}}function ya(t,e){let n=["x","y","width","height"].map(v=>Number(e?.[v]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw new RangeError("[snapdom] canvas crop requires finite x/y and positive width/height");let o=t.match(/<svg\b[^>]*>/i);if(!o)throw new Error("[snapdom] cannot crop a non-SVG capture");let r=o[0],s=(r.match(/\bviewBox="([^"]+)"/i)||[])[1],i=String(s||"").trim().split(/[\s,]+/).map(Number);if(i.length!==4||!i.every(Number.isFinite)||i[2]<=0||i[3]<=0)throw new Error("[snapdom] cannot crop an SVG without a finite viewBox");let[a,c,f,l]=i,d=Math.max(a,n[0]),u=Math.max(c,n[1]),p=Math.min(a+f,n[0]+n[2]),h=Math.min(c+l,n[1]+n[3]);if(!(p>d)||!(h>u))throw new RangeError("[snapdom] canvas crop does not intersect the SVG viewBox");let m=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),y=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]),b=Number.isFinite(m)&&m>0?m/f:1,S=Number.isFinite(y)&&y>0?y/l:1,C=Math.max(1,(p-d)*b),g=Math.max(1,(h-u)*S),w=r.replace(/(\bwidth=")[^"]*/i,`$1${C}`).replace(/(\bheight=")[^"]*/i,`$1${g}`).replace(/(\bviewBox=")[^"]*/i,`$1${d} ${u} ${p-d} ${h-u}`);return t.replace(r,w)}function Mr(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 ba(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 Ie(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Er(t){let e=[],n="",o=0;for(let r=0;r<t.length;r++){let s=t[r];s==="("&&o++,s===")"&&(o=Math.max(0,o-1)),s===";"&&o===0?(e.push(n),n=""):n+=s}return n.trim()&&e.push(n),e.map(r=>r.trim()).filter(Boolean)}function wa(t){let e=[],n="",o=0;for(let s=0;s<t.length;s++){let i=t[s];i==="("&&o++,i===")"&&(o=Math.max(0,o-1)),i===","&&o===0?(e.push(n.trim()),n=""):n+=i}n.trim()&&e.push(n.trim());let r=[];for(let s of e){if(/\binset\b/i.test(s))continue;let i=s.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",c="0px",f="0px"]=i;f=`${parseFloat(f)/2}px`;let l=s.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!l&&l!==",";r.push(`drop-shadow(${a} ${c} ${f}${d?` ${l}`:""})`)}return r.join(" ")}function Fr(t){let e=Er(t),n=null,o=null,r=null,s=[];for(let a of e){let c=a.indexOf(":");if(c<0)continue;let f=a.slice(0,c).trim().toLowerCase(),l=a.slice(c+1).trim();f==="box-shadow"?r=l:f==="filter"?n=l:f==="-webkit-filter"?o=l:s.push([f,l])}if(r){let a=wa(r);a&&(n=n?`${n} ${a}`:a,o=o?`${o} ${a}`:a)}let i=[...s];return n&&i.push(["filter",n]),o&&i.push(["-webkit-filter",o]),i.map(([a,c])=>`${a}:${c}`).join(";")}function xa(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${Fr(o)}}`)}function Sa(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,xa(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${Fr(o)}${n}`),t}function va(){return Ne||(Ne=(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 o=n.getContext("2d",{willReadFrequently:!0});o.drawImage(e,0,0);let r=o.getImageData(2,18,1,1).data[3]>128,s=o.getImageData(2,2,1,1).data[3]>128;return{native:r||s,flippedY:s&&!r}}catch{return{native:!1,flippedY:!1}}})(),Ne)}function Ca(t){let e=[],n=0,o=0;for(let r=0;r<t.length;r++){let s=t[r];s==="("?n++:s===")"?n=Math.max(0,n-1):s===","&&n===0&&(e.push(t.slice(o,r)),o=r+1)}return e.push(t.slice(o)),e.map(r=>{let s=0,i=0,a="",c=0;for(;c<r.length;){let f=r[c];if(f==="("?s++:f===")"&&(s=Math.max(0,s-1)),s===0&&(c===0||r[c-1]===" ")){let l=/^-?\d*\.?\d+px/.exec(r.slice(c));if(l){i++,a+=i===2?`${-parseFloat(l[0])}px`:l[0],c+=l[0].length;continue}}a+=f,c++}return a}).join(",")}function Aa(t,e){let n=o=>Er(o).map(r=>{let s=r.indexOf(":");if(s<0)return r;let i=r.slice(0,s).trim().toLowerCase();return i==="text-shadow"||e&&i==="box-shadow"?`${i}:${Ca(r.slice(s+1))}`:r}).join(";");return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(o,r)=>o.replace(r,r.replace(/([^{}]+)\{([^}]*)\}/g,(s,i,a)=>`${i}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(o,r,s)=>`style=${r}${n(s)}${r}`),t}async function _e(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:o}=await va();try{let r=t;return n||(r=Sa(r)),o&&(r=Aa(r,n)),{svg:r,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}async function ka(t,e){t.setAttribute("data-snapdom-internal",""),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{let n=document.createElement("canvas");n.width=16,n.height=16;let o=()=>new Promise(i=>{requestAnimationFrame(i),setTimeout(i,50)}),r=n.getContext("2d",{willReadFrequently:!0});if(!r){await o(),await o();return}let s=performance.now()+(e?600:150);for(;;){r.clearRect(0,0,16,16);try{r.drawImage(t,0,0,16,16)}catch{return}let i=r.getImageData(0,0,16,16).data,a=!1;for(let c=3;c<i.length;c+=4)if(i[c]>0){a=!0;break}if(a||performance.now()>s)return;await o()}}finally{try{t.remove()}catch{}}}async function Rt(t,e){let{width:n,height:o,scale:r=1,dpr:s=1,meta:i={},backgroundColor:a,crop:c=null}=e,f=t,l=!1,d=!1;if(c&&!Mr(t))throw new RangeError("[snapdom] canvas crop requires an SVG capture payload");if(Mr(t)){let F=(ba(t).match(/<svg\b[^>]*>/i)||[])[0]||"",$=parseFloat((F.match(/\bwidth="([\d.]+)/i)||[])[1]),R=parseFloat((F.match(/\bheight="([\d.]+)/i)||[])[1]),D=Number.isFinite($)&&Number.isFinite(R)&&$>0&&R>0&&Math.min(1,xt/$,xt/R,Math.sqrt(yn/($*R)))<1;if(c||D||X())try{let N=Pe(t);if(c&&(N=ya(N,c)),X()){let _=await _e(N);N=_.svg,l=_.naturalOnly,d=/@font-face|data:image\//i.test(N)}(D||c)&&(N=ga(N)),f=Ie(N)}catch(N){if(c)throw N;f=t}}let u=new Image;u.loading="eager",u.decoding="sync",u.crossOrigin="anonymous",u.src=f,await u.decode(),X()&&await ka(u,d);let p=u.naturalWidth,h=u.naturalHeight,m=c?p:Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:p,y=c?h:Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:h,b,S,C=Number.isFinite(n),g=Number.isFinite(o);if(C&&g)b=Math.max(1,n),S=Math.max(1,o);else if(C){let F=n/Math.max(1,m);b=n,S=y*F}else if(g){let F=o/Math.max(1,y);S=o,b=m*F}else b=p,S=h;b=b*r,S=S*r;let w=b*s,v=S*s,M=Math.max(w/xt,v/xt,Math.sqrt(w*v/yn));M>1&&(console.warn(`[snapDOM] Output ${Math.round(w)}\xD7${Math.round(v)}px exceeds the browser canvas limit (${xt}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),b/=M,S/=M);let A=document.createElement("canvas");A.width=b*s,A.height=S*s,A.style.width=`${b}px`,A.style.height=`${S}px`;let k=A.getContext("2d");if(s!==1&&k.scale(s,s),a&&(k.save(),k.fillStyle=a,k.fillRect(0,0,b,S),k.restore()),l&&(Math.round(b*s)!==p||Math.round(S*s)!==h)){let F=document.createElement("canvas");F.width=p,F.height=h,F.getContext("2d").drawImage(u,0,0),k.drawImage(F,0,0,b,S)}else k.drawImage(u,0,0,b,S);return A}var xt,yn,Ne,Vt=ot(()=>{"use strict";Wt();xt=16384,yn=16384*16384;Ne=null});var We={};qt(We,{rasterize:()=>bn});async function bn(t,e){let n=await Rt(t,e),o=await new Promise(s=>{let i=()=>s(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(a=>{if(!a)return i();let c=new FileReader;c.onload=()=>s(String(c.result||"")),c.onerror=i,c.readAsDataURL(a)},`image/${e.format}`,e.quality)}catch{i()}}),r=new Image;return r.src=o,await r.decode(),r.style.width=`${n.width/e.dpr}px`,r.style.height=`${n.height/e.dpr}px`,r}var ie=ot(()=>{"use strict";Vt()});var wn={};qt(wn,{toImg:()=>Ma,toSvg:()=>Ma});async function Ma(t,e){let{scale:n=1,width:o,height:r,meta:s={}}=e,i=Number.isFinite(o),a=Number.isFinite(r),c=Number.isFinite(n)&&n!==1||i||a;if(X()&&c)try{let{svg:l}=await _e(Pe(t)),d=(l.match(/<svg\b[^>]*>/i)||[])[0]||"",u=parseFloat((d.match(/\bwidth="([\d.]+)/i)||[])[1]),p=parseFloat((d.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(u)||!Number.isFinite(p))throw new Error("svg without dimensions");let h=Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:u,m=Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:p,y,b;i&&a?(y=o,b=r):i?(y=o,b=Math.round(m*(o/Math.max(1,h)))):a?(b=r,y=Math.round(h*(r/Math.max(1,m)))):(y=Math.round(u*n),b=Math.round(p*n));let S=l.replace(/width="[^"]*"/,`width="${y}"`).replace(/height="[^"]*"/,`height="${b}"`),C=new Image;return C.decoding="sync",C.loading="eager",C.src=Ie(S),await C.decode(),C.style.width=`${y}px`,C.style.height=`${b}px`,C}catch(l){return I(e,"safari vector toImg failed, falling back to PNG",l),bn(t,{...e,format:"png",quality:1,meta:s})}let f=new Image;if(f.decoding="sync",f.loading="eager",f.src=t,await f.decode(),i&&a)f.style.width=`${o}px`,f.style.height=`${r}px`;else if(i){let l=Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:f.naturalWidth,d=Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:f.naturalHeight,u=o/Math.max(1,l);f.style.width=`${o}px`,f.style.height=`${Math.round(d*u)}px`}else if(a){let l=Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:f.naturalWidth,d=Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:f.naturalHeight,u=r/Math.max(1,d);f.style.height=`${r}px`,f.style.width=`${Math.round(l*u)}px`}else{let l=Math.round(f.naturalWidth*n),d=Math.round(f.naturalHeight*n);if(f.style.width=`${l}px`,f.style.height=`${d}px`,typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let p=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${l}"`).replace(/height="[^"]*"/,`height="${d}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,f.src=t}catch(u){I(e,"SVG width/height patch in toImg failed",u)}}return f}var xn=ot(()=>{"use strict";rt();ie();Vt()});var Rr={};qt(Rr,{toBlob:()=>Sn});async function Sn(t,e){let n=e.type;if(n==="svg"){let r=decodeURIComponent(t.split(",")[1]);return new Blob([r],{type:"image/svg+xml"})}let o=await Rt(t,e);return new Promise(r=>o.toBlob(s=>r(s),`image/${n}`,e.quality))}var vn=ot(()=>{"use strict";Vt()});var Lr={};qt(Lr,{download:()=>Ea});async function Tr(t,e){let n=new File([t],e,{type:t.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:e})}catch(o){if(o.name!=="AbortError")return!1}return!0}async function Ea(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),o=(e?.type||"").toLowerCase(),r=n.has(o)?o:"",s=(e?.format||r||"").toLowerCase(),i=s==="jpg"?"jpeg":s||"png",a=e?.filename||`snapdom.${i}`,c={...e||{},format:i,type:i};c.dpr=1;let f=qe();if(i==="svg"){let u=await Sn(t,{...c,type:"svg"});if(f&&await Tr(u,a))return;let p=URL.createObjectURL(u),h=document.createElement("a");h.href=p,h.download=a,document.body.appendChild(h),h.click(),URL.revokeObjectURL(p),h.remove();return}let l=await Rt(t,c);if(f){let u=`image/${i}`,p=await new Promise(h=>l.toBlob(h,u,e?.quality));if(p&&await Tr(p,a))return}let d=document.createElement("a");d.href=l.toDataURL(`image/${i}`,e?.quality),d.download=a,document.body.appendChild(d),d.click(),d.remove()}var Nr=ot(()=>{"use strict";vn();Vt();Wt()});rt();rt();tt();var Ye=new WeakMap,Qt=new Map,fi=2e3,we=0;function be(){we++,Qt.size>fi&&Qt.clear()}var ui="[data-snapdom-sandbox],[data-snapdom-internal],[data-snapdom]";function Ge(t){let e=t&&(t.nodeType===1?t:t.parentElement);return!!(e&&e.closest&&e.closest(ui))}function Ke(t){for(let e of t)if(!Ge(e.target)){if(e.type==="childList"){let n=!0;for(let o of e.addedNodes)if(!Ge(o)){n=!1;break}if(n){for(let o of e.removedNodes)if(!Ge(o)){n=!1;break}}if(n)continue}return!0}return!1}var Bn=!1;function di(t=document.documentElement){if(Bn)return;Bn=!0;let e=n=>{Ke(n)&&be()};try{new MutationObserver(e).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(e).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let n=document.fonts;n&&(n.addEventListener?.("loadingdone",be),n.ready?.then(()=>be()).catch(()=>{}))}catch{}}var pi=["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 Qe(t){let e=Ye.get(t);if(e&&e.epoch===we){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function mi(t,e={}){let n={},o=e.excludeStyleProps;for(let d=0;d<t.length;d++){let u=t[d];if(Yt(u)||o&&(o instanceof RegExp&&o.test(u)||typeof o=="function"&&o(u)))continue;let p=t.getPropertyValue(u);(u==="background-image"||u==="content")&&p.includes("url(")&&!p.includes("data:")&&(p="none"),n[u]=p}let r=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let d of r)if(!n[d])try{let u=t.getPropertyValue(d);u&&(n[d]=u)}catch{}let s=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let d of s)if(!n[d])try{let u=t.getPropertyValue(d);u&&(n[d]=u)}catch{}if(e.embedFonts){let d=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let u of d)if(!n[u])try{let p=t.getPropertyValue(u);p&&(n[u]=p)}catch{}}try{(n["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(n["content-visibility"]="hidden")}catch{}let i=!1;{let d=t.getPropertyValue("background-image");if(d&&d!=="none"&&(i=!0),!i){let u=t.getPropertyValue("background-color");u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"&&(i=!0)}if(!i)for(let u of pi){let p=t.getPropertyValue(u);if(p&&p!=="none"){i=!0;break}}if(!i){let u=t.getPropertyValue("background");u&&/url\s*\(/i.test(u)&&(i=!0)}}Object.defineProperty(n,"__needsBgInline",{value:i,enumerable:!1});let a=parseFloat(t.getPropertyValue("border-top-width")||0)||0,c=parseFloat(t.getPropertyValue("border-right-width")||0)||0,f=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,l=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(a===0&&c===0&&f===0&&l===0){let d=(t.getPropertyValue("border-image-source")||"").trim(),u=d&&d!=="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"];for(let h of p)delete n[h];u||(n.border="none")}return n}function hi(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=L(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function gi(t,e,n){try{if(typeof t.computedStyleMap=="function"){let r=t.computedStyleMap().get("width");if(r!=null)return!Un(String(r).trim().toLowerCase())}}catch{}let o=t.style&&(t.style.width||t.style.inlineSize);return o&&!Un(String(o).trim().toLowerCase())?!0:bi(t,e)?n||wi(t,e):!1}var yi=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function Un(t){return yi.has(t)||t.startsWith("fit-content")}function bi(t,e){let n=t.getBoundingClientRect().width-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)-(parseFloat(e.borderLeftWidth)||0)-(parseFloat(e.borderRightWidth)||0);if(!(n>0))return!1;let o=1/0,r=-1/0,s=null;for(let i=t.firstChild;i;i=i.nextSibling){let a;if(i.nodeType===3){if(!/\S/.test(i.nodeValue||"")||(s=s||document.createRange(),s.selectNode(i),a=s.getBoundingClientRect(),!a.width&&!a.height))continue}else if(i.nodeType===1){let c=L(i);if(c.display==="none"||c.position==="absolute"||c.position==="fixed")continue;a=i.getBoundingClientRect()}else continue;a.left<o&&(o=a.left),a.right>r&&(r=a.right)}return r===-1/0?!1:r-o<n-.5}function wi(t,e){let n=t.parentElement;if(!n)return!1;let o=L(n),r=n.getBoundingClientRect().width-(parseFloat(o.paddingLeft)||0)-(parseFloat(o.paddingRight)||0)-(parseFloat(o.borderLeftWidth)||0)-(parseFloat(o.borderRightWidth)||0)-(parseFloat(e.marginLeft)||0)-(parseFloat(e.marginRight)||0);return r>0?Math.abs(t.getBoundingClientRect().width-r)>.5:!1}var Dn=new WeakMap;function xi(t){let e=Dn.get(t);return e||(e=Object.entries(t).sort((o,r)=>o[0]<r[0]?-1:o[0]>r[0]?1:0).map(([o,r])=>`${o}:${r}`).join(";"),Dn.set(t,e),e)}function Si(t,e=null,n={}){let o=Ye.get(t),r=!!(n&&n.embedFonts),s=n&&n.excludeStyleProps||null;if(o&&o.epoch===we&&o.embedFonts===r&&o.excludeStyleProps===s)return o.snapshot;let i=e||getComputedStyle(t),a=mi(i,n);return Ei(t,i,a),Ye.set(t,{epoch:we,snapshot:a,embedFonts:r,excludeStyleProps:s}),a}function vi(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Qt,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:e||{}}:{session:x.session,persist:{snapshotKeyCache:Qt,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:t||e||{}}}function Ci(t,e,n){if(!(!t.style||t.style.length===0))for(let o=0;o<t.style.length;o++){let r=t.style[o],s=n.getPropertyValue(r);s&&e.style.setProperty(r,s)}}async function it(t,e,n,o){if(t.tagName==="STYLE")return;let r=vi(n,o),s=r.options&&r.options.cache||"auto";s!=="disabled"&&di(document.documentElement),s==="disabled"&&!r.session.__bumpedForDisabled&&(be(),Qt.clear(),r.session.__bumpedForDisabled=!0);let{session:i,persist:a}=r;if(!i.styleCache.has(t)){let y=null;try{y=getComputedStyle(t)}catch{}i.styleCache.set(t,y||getComputedStyle(document.documentElement))}let c=i.styleCache.get(t);t.getAttribute?.("style")&&Ci(t,e,c);let f=c.getPropertyValue("animation-name");e&&e.style&&f&&f!=="none"&&e.style.setProperty("animation","none","important");let l=Si(t,c,r.options),d=Hn(t);if(d){let y=c.getPropertyValue("min-width");(!y||y==="auto"||y==="0px")&&(l["min-width"]="0px")}let u=t.tagName?.toLowerCase()||"div",p=xi(l),h=!0;if(ge(u,(l.display||"").toLowerCase())){h=hi(t),h&&He(u,l,d)&&gi(t,c,d)&&(h=!1),p=`${p}|${u}${h?"|c":""}${d?"|f":""}`;let y=l["text-wrap-mode"]||l["white-space"]||"";h&&y!=="nowrap"&&y!=="pre"&&(i.reconcileRisk=(i.reconcileRisk||0)+1)}let m=a.snapshotKeyCache.get(p);m===void 0&&(m=It(l,u,h,d),a.snapshotKeyCache.set(p,m)),i.styleMap.set(e,m)}function Ai(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}function Hn(t){let e=t.parentElement;if(!e)return!1;let n=L(e).display||"";return n.includes("flex")||n.includes("grid")}function ki(t){for(let o=t.firstChild;o;o=o.nextSibling)if(o.nodeType===3&&/\S/.test(o.nodeValue))return!0;let e=t.firstElementChild,n=t.lastElementChild;if(e&&e.tagName==="BR"||n&&n.tagName==="BR")return!0;for(let o=t.firstElementChild;o;o=o.nextElementSibling){let r=L(o);if(r.display==="none")continue;let s=r.position;if(s!=="absolute"&&s!=="fixed")return!0}return!1}function Mi(t){let e=t.getBoundingClientRect().top,n=-1/0,o=null;for(let r=t.firstChild;r;r=r.nextSibling){if(r.nodeType===3){if(!/\S/.test(r.nodeValue||""))continue;o=o||document.createRange(),o.selectNode(r);let a=o.getBoundingClientRect();(a.width||a.height)&&(n=Math.max(n,a.bottom));continue}if(r.nodeType!==1)continue;let s=L(r);if(s.display==="none")continue;let i=s.position;i==="absolute"||i==="fixed"||s.float&&s.float!=="none"||(n=Math.max(n,r.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-e}function Ei(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let o=t.tagName&&t.tagName.toLowerCase();if(!o||!["div","section","article","main","aside","header","footer","nav"].includes(o)||e.aspectRatio&&e.aspectRatio!=="none"&&e.aspectRatio!=="auto")return;let s=e.display||"";if(s.includes("flex")||s.includes("grid"))return;let i=e.position;if(i==="absolute"||i==="fixed"||i==="sticky"||e.transform!=="none"||Ai(e)||Hn(t))return;let a=e.overflowX||e.overflow||"visible",c=e.overflowY||e.overflow||"visible";if(a!=="visible"||c!=="visible")return;let f=e.clip;if(f&&f!=="auto"&&f!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||!ki(t))return;let l=parseFloat(e.height),d=Mi(t);Number.isFinite(l)&&Number.isFinite(d)&&Math.abs(l-d)>2||(delete n.height,delete n["block-size"])}Kt();var Vn=["fill","stroke","color","background-color","stop-color"],Fi=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]);function xe(t){let e=t;for(;e&&e.nodeType===1;){if(e.namespaceURI==="http://www.w3.org/2000/svg"){if(e.localName==="mask"||e.localName==="clipPath")return!1;if(Fi.has(e.localName))return!0}e=e.parentNode}return!1}var zn=new Map;function $i(t,e){let n=e+"::"+t.toLowerCase(),o=zn.get(n);if(o)return o;let r=document,s=e==="http://www.w3.org/2000/svg"?r.createElementNS(e,t):r.createElement(t),i=r.createElement("div");i.setAttribute("data-snapdom-internal",""),i.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",i.appendChild(s),r.documentElement.appendChild(i);let a=getComputedStyle(s),c={};for(let f of Vn)c[f]=a.getPropertyValue(f)||"";return i.remove(),zn.set(n,c),c}function jn(t,e){if(t?.nodeType!==1||e?.nodeType!==1||xe(t))return;let n=t.getAttribute?.("style"),o=!!(n&&n.includes("var("));if(!o&&t.attributes?.length){let s=t.attributes;for(let i=0;i<s.length;i++){let a=s[i];if(a&&typeof a.value=="string"&&a.value.includes("var(")){o=!0;break}}}let r=null;if(o)try{r=getComputedStyle(t)}catch{}if(o){let s=t.style;if(s&&s.length){let i=new Set;for(let a=0;a<s.length;a++){let c=s[a];if(i.has(c))continue;i.add(c);let f=s.getPropertyValue(c);if(!f||!f.includes("var("))continue;let l=r&&r.getPropertyValue(c);if(l)try{e.style.setProperty(c,l.trim(),s.getPropertyPriority(c))}catch{}}}}if(o&&t.attributes?.length){let s=t.attributes;for(let i=0;i<s.length;i++){let a=s[i];if(!a||typeof a.value!="string"||!a.value.includes("var("))continue;let c=a.name,f=r&&r.getPropertyValue(c);if(f)try{e.style.setProperty(c,f.trim())}catch{}}}if(!o){if(!r)try{r=getComputedStyle(t)}catch{r=null}if(!r)return;let s=t.namespaceURI||"html",i=$i(t.tagName,s);for(let a of Vn){let c=r.getPropertyValue(a)||"",f=i[a]||"";if(c&&c!==f)try{e.style.setProperty(a,c.trim())}catch{}}}}rt();rt();tt();wt();wt();function $t(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(t)&&t.length<200)}var qn="img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]";function Ri(t,e){return!t||t?.nodeType!==1?!1:t.matches?.("picture")||t.querySelector("picture")?!0:e?!!(t.matches?.(qn)||t.querySelector(qn)):!1}var Ti=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i;function Ot(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 o=[];for(let s of t.split(",")){let i=s.trim().split(/\s+/);if(!i[0])continue;let a=i[1]||"",c=1;/^\d*\.?\d+x$/i.test(a)?c=parseFloat(a):/^\d+w$/i.test(a)&&(c=parseInt(a,10)/n),o.push({url:i[0],d:c})}if(!o.length)return null;o.sort((s,i)=>s.d-i.d);let r=window.devicePixelRatio||1;return(o.find(s=>s.d>=r)||o[o.length-1]).url}function Ze(t,e){let n=t.currentSrc||"";if(n&&!$t(n))return n;let o=e.querySelectorAll("source[srcset]"),r=null;for(let s of o){let i=s.getAttribute("srcset");if(!i||$t(i))continue;let a=s.getAttribute("type");if(a&&!Ti.test(a.trim()))continue;let c=s.getAttribute("media");if(c)try{if(window.matchMedia(c).matches)return Ot(i,t)}catch{}r||(r=Ot(i,t))}return r}function Li(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let o of e)if(o&&!$t(o))return o;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let o=n.split(",")[0].trim().split(/\s+/)[0];if(o&&!$t(o))return o}return null}function Ni(t={}){let e=t.pictureResolver&&typeof t.pictureResolver=="object"?t.pictureResolver:{};return{timeout:e.timeout??5e3,concurrency:e.concurrency??4,resolveLazySrc:e.resolveLazySrc!==!1,silent:e.silent??!1,useProxy:typeof t.useProxy=="string"?t.useProxy:""}}async function Xn(t,e={}){if(!t||t?.nodeType!==1||e.resolvePicturePlaceholders===!1)return null;let{timeout:n,concurrency:o,resolveLazySrc:r,silent:s,useProxy:i}=Ni(e);if(!Ri(t,r))return null;let a=[],c=[];async function f(u){let p=await j(u,{as:"dataURL",timeout:n,useProxy:i,silent:!0});return p.ok?p.data:null}async function l(u){for(let p=0;p<u.length;p+=o){let h=u.slice(p,p+o);await Promise.allSettled(h.map(m=>m()))}}let d=Array.from(t.querySelectorAll("picture"));t.matches?.("picture")&&d.unshift(t);for(let u of d){let p=u.querySelector("img");if(!p)continue;let h=p.getAttribute("src")||"";if(!$t(h))continue;let m=Ze(p,u);m&&c.push(async()=>{let y=await f(m);if(!y){s||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${m.slice(0,60)}`);return}let b=p.getAttribute("src"),S=p.getAttribute("srcset"),C=p.getAttribute("sizes"),g=[];p.src=y,p.setAttribute("src",y),p.removeAttribute("srcset"),p.removeAttribute("sizes");let w=u.querySelectorAll("source");for(let v of w)g.push({el:v,parent:v.parentElement,next:v.nextSibling}),v.remove();a.push(()=>{b!==null?p.setAttribute("src",b):p.removeAttribute("src"),S!==null&&p.setAttribute("srcset",S),C!==null&&p.setAttribute("sizes",C);for(let{el:v,parent:M,next:A}of g)M&&M.insertBefore(v,A)})})}if(r){let u=Array.from(t.querySelectorAll("img"));t.localName==="img"&&u.unshift(t);for(let p of u){if(p.closest("picture")&&$t(p.getAttribute("src")||""))continue;let h=p.getAttribute("src")||"",m=Li(p);m&&$t(h)&&c.push(async()=>{let y=await f(m);if(!y)return;let b=p.getAttribute("src");p.src=y,p.setAttribute("src",y),p.removeAttribute("srcset"),p.removeAttribute("sizes"),a.push(()=>{b!==null?p.setAttribute("src",b):p.removeAttribute("src")})})}}return c.length===0?null:(await l(c),async function(){for(let p of a)try{p()}catch{}})}function Ce(t,e,n){return n?Promise.all(t.map(o=>new Promise(r=>e(o,r)))):Promise.all(t.map(o=>new Promise(r=>{function s(){Ft(i=>{(i&&typeof i.timeRemaining=="function"?i.timeRemaining()>0:!0)?e(o,r):s()},{fast:n})}s()})))}function Pi(t){return t=t.trim(),!t||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function Ii(t,e,n=!0){return t.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let r=n?Pi(o):o;return`:where(${e} ${r})`}).join(", ")}function Yn(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${e}:is(${o.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${e} ${o.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,r,s)=>{let i=Ii(s,e,!0);return`${o}${r}${i}{`}),t):""}function Kn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Qn(t){let e="";try{t.querySelectorAll("style").forEach(o=>{e+=(o.textContent||"")+`
9
9
  `});let n=t.adoptedStyleSheets||[];for(let o of n)try{if(o&&o.cssRules)for(let r of o.cssRules)e+=r.cssText+`
10
- `}catch{}}catch{}return e}function Yn(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function Kn(t,e){try{let n=null,o=P(t).content;if(o&&o.includes("url(")){let i=o.match(/url\(["']?([^"')]+)["']?\)/);i&&(n=i[1])}let r=t.closest?.("picture"),s=n||(r?Qe(t,r):t.currentSrc)||t.src||Ot(t.getAttribute("srcset"),t)||"";if(!s)return;e.setAttribute("src",s),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function Qn(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function $i(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch{}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch{}return""}function Jn(t,e,n){let o=[];for(let r of e){let s=$i(t,r);s&&o.push(`${r}: ${s};`)}return o.length?`${n}{${o.join("")}}
11
- `:""}function Zn(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}async function Fi(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},o=n(),r=0;for(;r<e&&(!o||!o.body&&!o.documentElement);)await new Promise(s=>setTimeout(s,0)),o=n(),r++;return o&&(o.body||o.documentElement)?o:null}function Ri(t){let e=t.getBoundingClientRect(),n=0,o=0,r=0,s=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,o=parseFloat(c.borderRightWidth)||0,r=parseFloat(c.borderTopWidth)||0,s=parseFloat(c.borderBottomWidth)||0}catch{}let i=Math.max(0,Math.round(e.width-(n+o))),a=Math.max(0,Math.round(e.height-(r+s)));return{contentWidth:i,contentHeight:a,rect:e}}function at(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let o=getComputedStyle(t);if(e===0){let r=parseFloat(o.width);!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(o.height);!isNaN(r)&&r>0&&(n=r)}}catch{}if(e===0||n===0)try{if(e===0){let o=parseFloat(t.getAttribute("width"));!isNaN(o)&&o>0&&(e=o)}if(n===0){let o=parseFloat(t.getAttribute("height"));!isNaN(o)&&o>0&&(n=o)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}function Ti(t,e,n){let o=t.defaultView,r=o?o.scrollX:0,s=o?o.scrollY:0,i=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,c=t.documentElement?t.documentElement.scrollLeft:0,f=t.documentElement?t.documentElement.scrollTop:0,l=0,d=0,u=0,p=0;try{let m=o&&t.body?o.getComputedStyle(t.body):null;m&&(l=(parseFloat(m.marginTop)||0)+(parseFloat(m.paddingTop)||0),d=(parseFloat(m.marginRight)||0)+(parseFloat(m.paddingRight)||0),u=(parseFloat(m.marginBottom)||0)+(parseFloat(m.paddingBottom)||0),p=(parseFloat(m.marginLeft)||0)+(parseFloat(m.paddingLeft)||0))}catch{}try{t.documentElement.setAttribute("data-sd-pinned","")}catch{}let h=t.createElement("style");return h.setAttribute("data-sd-iframe-pin",""),h.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 ${d}px ${u}px ${p}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(h),()=>{try{h.remove()}catch{}try{t.documentElement.removeAttribute("data-sd-pinned")}catch{}try{o&&typeof o.scrollTo=="function"&&o.scrollTo(r,s),t.body&&(t.body.scrollLeft=i,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=c,t.documentElement.scrollTop=f)}catch{}}}async function to(t,e,n){let o=await Fi(t,3);if(!o)throw new Error("iframe document not accessible/ready");let{contentWidth:r,contentHeight:s,rect:i}=Ri(t),a=n?.snap;if(!a&&typeof window<"u"&&window.snapdom&&(a=window.snapdom),!a||typeof a.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let c={...n,scale:1,clip:null},f=Ti(o,r,s),l=x.session.nodeMap,d=x.session.styleMap,u=x.session.styleCache,p;try{p=await a.toPng(o.documentElement,c)}finally{f(),x.session.nodeMap=l,x.session.styleMap=d,x.session.styleCache=u}p.style.display="block",p.style.width=`${r}px`,p.style.height=`${s}px`;let h=document.createElement("div");return e.nodeMap.set(h,t),it(t,h,e,n),h.style.overflow="hidden",h.style.display="block",h.style.width||(h.style.width=`${Math.round(i.width)}px`),h.style.height||(h.style.height=`${Math.round(i.height)}px`),h.appendChild(p),h}function eo(t){let{width:e,height:n}=at(t),o=t.getBoundingClientRect(),r;try{r=window.getComputedStyle(t)}catch{}let s=r?parseFloat(r.width):NaN,i=r?parseFloat(r.height):NaN,a=Math.round(e||o.width||0),c=Math.round(n||o.height||0),f=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,a||16),l=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,c||16),d=(t.type||"text").toLowerCase()==="checkbox",u=!!t.checked,p=!!t.indeterminate,m=Math.max(Math.min(f,l),12),y="middle";try{r&&r.verticalAlign&&(y=r.verticalAlign)}catch{}let b=document.createElement("div");b.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),b.style.cssText=`display:inline-block;width:${m}px;height:${m}px;vertical-align:${y};flex-shrink:0;line-height:0;`;let S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("width",String(m)),S.setAttribute("height",String(m)),S.setAttribute("viewBox",`0 0 ${m} ${m}`),b.appendChild(S);function C(){let g="#0a6ed1";try{r&&(g=r.accentColor||r.color||g)}catch{}let w=2,v=w/2,M=m-w;if(S.innerHTML="",d){let A=document.createElementNS("http://www.w3.org/2000/svg","rect");if(A.setAttribute("x",String(v)),A.setAttribute("y",String(v)),A.setAttribute("width",String(M)),A.setAttribute("height",String(M)),A.setAttribute("rx","2"),A.setAttribute("ry","2"),A.setAttribute("fill",u?g:"none"),A.setAttribute("stroke",g),A.setAttribute("stroke-width",String(w)),S.appendChild(A),u){let k=document.createElementNS("http://www.w3.org/2000/svg","path");k.setAttribute("d",`M ${v+2} ${m/2} L ${m/2-1} ${m-v-2} L ${m-v-2} ${v+2}`),k.setAttribute("stroke","white"),k.setAttribute("stroke-width",String(Math.max(1.5,w))),k.setAttribute("fill","none"),k.setAttribute("stroke-linecap","round"),k.setAttribute("stroke-linejoin","round"),S.appendChild(k)}else if(p){let k=document.createElementNS("http://www.w3.org/2000/svg","rect"),$=Math.max(6,M-4);k.setAttribute("x",String((m-$)/2)),k.setAttribute("y",String((m-w)/2)),k.setAttribute("width",String($)),k.setAttribute("height",String(w)),k.setAttribute("fill",g),k.setAttribute("rx","1"),S.appendChild(k)}}else{let A=document.createElementNS("http://www.w3.org/2000/svg","circle");if(A.setAttribute("cx",String(m/2)),A.setAttribute("cy",String(m/2)),A.setAttribute("r",String((m-w)/2)),A.setAttribute("fill",u?g:"none"),A.setAttribute("stroke",g),A.setAttribute("stroke-width",String(w)),S.appendChild(A),u){let k=document.createElementNS("http://www.w3.org/2000/svg","circle"),$=Math.max(2,(m-w*2)*.35);k.setAttribute("cx",String(m/2)),k.setAttribute("cy",String(m/2)),k.setAttribute("r",String($)),k.setAttribute("fill","white"),S.appendChild(k)}}b.style.setProperty("width",`${m}px`,"important"),b.style.setProperty("height",`${m}px`,"important"),b.style.setProperty("min-width",`${m}px`,"important"),b.style.setProperty("min-height",`${m}px`,"important")}return C(),{el:b,applyVisual:C}}var Jt=new q(80);async function Zt(t){if(x.resource?.has(t))return x.resource.get(t);if(Jt.has(t))return Jt.get(t);let e=(async()=>{let n=await j(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return x.resource?.set(t,n.data),n.data})();Jt.set(t,e);try{let n=await e;return Jt.set(t,n),n}catch(n){throw Jt.delete(t),n}}var Li=/\bblob:[^)"'\s]+/g;async function jn(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(Li)||[]));if(e.length===0)return t;let n=t;for(let o of e)try{let r=await Zt(o);n=n.split(o).join(r)}catch{}return n}function Se(t){return typeof t=="string"&&t.startsWith("blob:")}function Pi(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 Ni(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function ve(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function no(t,e=null){if(!t)return;let n=e,o=ve(t,"img");for(let c of o)try{let l=c.getAttribute("src")||c.currentSrc||"";if(Se(l)){let u=await Zt(l);c.setAttribute("src",u)}let d=c.getAttribute("srcset");if(d&&d.includes("blob:")){let u=Pi(d),p=!1;for(let h of u)if(Se(h.url))try{h.url=await Zt(h.url),p=!0}catch(m){I(n,"blobUrlToDataUrl for srcset item failed",m)}p&&c.setAttribute("srcset",Ni(u))}}catch(f){I(n,"resolveBlobUrls for img failed",f)}let r=ve(t,"image");for(let c of r)try{let f="http://www.w3.org/1999/xlink",l=c.getAttribute("href")||c.getAttributeNS?.(f,"href");if(Se(l)){let d=await Zt(l);c.setAttribute("href",d),c.removeAttributeNS?.(f,"href")}}catch(f){I(n,"resolveBlobUrls for SVG image href failed",f)}let s=ve(t,"[style*='blob:']");for(let c of s)try{let f=c.getAttribute("style");if(f&&f.includes("blob:")){let l=await jn(f);c.setAttribute("style",l)}}catch(f){I(n,"replaceBlobUrls in inline style failed",f)}let i=t.querySelectorAll?t.querySelectorAll("style"):[];for(let c of i)try{let f=c.textContent||"";f.includes("blob:")&&(c.textContent=await jn(f))}catch(f){I(n,"replaceBlobUrls in style tag failed",f)}let a=["poster"];for(let c of a){let f=ve(t,`[${c}^='blob:']`);for(let l of f)try{let d=l.getAttribute(c);Se(d)&&l.setAttribute(c,await Zt(d))}catch(d){I(n,`resolveBlobUrls for ${c} failed`,d)}}}Wt();var Ze=new Map,oo=new Set(["IFRAME"]);function ke(t,e){Ze.set(String(t).toUpperCase(),e)}function Je(t){let{width:e,height:n}=at(t),o=e,r=n;if(!o||!r){let i=t.getBoundingClientRect();o=o||i.width||0,r=r||i.height||0}let s=document.createElement("div");return s.style.cssText=`display:inline-block;width:${o}px;height:${r}px;visibility:hidden;`,s}var Ae=200,Ii=new Set(["img","canvas","video","iframe","object","embed"]);function ro(t,e){return t.right>=e.left-Ae&&t.left<=e.right+Ae&&t.bottom>=e.top-Ae&&t.top<=e.bottom+Ae}function _i(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 o=P(t);if(o.display==="inline"&&!Ii.has((t.localName||"").toLowerCase()))return!1;let r=e.rect,s=t.scrollWidth||0,i=t.scrollHeight||0,a={left:o.direction==="rtl"?Math.min(n.left,n.right-s):n.left,top:n.top,right:Math.max(n.right,n.left+s),bottom:Math.max(n.bottom,n.top+i)},c=o.writingMode||"";if((c.startsWith("vertical")||c.startsWith("sideways"))&&(a.top=Math.min(n.top,n.bottom-i),a.left=Math.min(a.left,n.right-s)),ro(a,r))return!1;let f=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;f.nextNode();){let l=f.currentNode.getBoundingClientRect();if((l.width>0||l.height>0)&&ro(l,r))return!1}return!0}function Wi(t,e,n){let o=t.cloneNode(!1);t.tagName==="IMG"&&(o.removeAttribute("src"),o.removeAttribute("srcset"),o.removeAttribute("sizes")),it(t,o,e,n);let{width:r,height:s}=at(t);return r>0&&(o.style.width=`${r}px`,o.style.minWidth=`${r}px`,o.style.maxWidth=`${r}px`),s>0&&(o.style.height=`${s}px`,o.style.minHeight=`${s}px`,o.style.maxHeight=`${s}px`),o.style.visibility="hidden",o.style.overflow="hidden",o.style.boxSizing="border-box",o}async function te(t,e,n){if(!t)throw new Error("Invalid node");let o=new Set,r=null,s=null;if(t.nodeType===Node.ELEMENT_NODE){let l=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||pe.has(l))return null;if(l==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return I(e,"Nested <foreignObject> skipped (SVG spec limitation \u2014 not rendered by browsers)"),null;if(l==="source"&&t.parentElement?.localName==="picture")return null}if(t.nodeType===Node.TEXT_NODE||t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide")return Je(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 Je(t);if(n.excludeMode==="remove")return null}}catch(d){console.warn(`Invalid selector in exclude option: ${l}`,d)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide")return Je(t);if(n.filterMode==="remove")return null}}catch(l){console.warn("Error in filter function:",l)}if(e.clip&&_i(t,e.clip))return Wi(t,e,n);if(n.__resolveNodeHooks)for(let l of n.__resolveNodeHooks){let d;try{d=await l(t,n)}catch(u){I(e,"resolveNode plugin hook failed",u)}if(d===null)return null;if(d instanceof Node)return d.nodeType===Node.ELEMENT_NODE&&(e.nodeMap.set(d,t),it(t,d,e,n)),d}{let l=oo.has(t.tagName)&&Ze.get(t.tagName);if(l){let d=await l(t,e,n);if(d!==void 0)return d}}if(t.getAttribute("data-capture")==="placeholder"){let l=t.cloneNode(!1);e.nodeMap.set(l,t),it(t,l,e,n);let d=document.createElement("div");return d.textContent=t.getAttribute("data-placeholder-text")||"",d.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",l.appendChild(d),l}{let l=!oo.has(t.tagName)&&Ze.get(t.tagName);if(l){let d=await l(t,e,n);if(d!==void 0)return d}}let i;try{if(i=t.cloneNode(!1),i.attributes?.length)try{for(let l of i.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(l.value)&&i.setAttribute(l.name,l.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(Hn(t,i),e.nodeMap.set(i,t),t.tagName==="IMG"){Kn(t,i);try{let{width:l,height:d}=at(t),u=Math.round(l||0),p=Math.round(d||0);u&&(i.dataset.snapdomWidth=String(u)),p&&(i.dataset.snapdomHeight=String(p))}catch(l){I(e,"getUnscaledDimensions for IMG failed",l)}try{let l=t.getAttribute("style")||"",d=window.getComputedStyle(t),u=C=>{let g=l.match(new RegExp(`${C}\\s*:\\s*([^;]+)`,"i")),w=g?g[1].trim():d.getPropertyValue(C);return/%|auto/i.test(String(w||""))},p=parseInt(i.dataset.snapdomWidth||"0",10),h=parseInt(i.dataset.snapdomHeight||"0",10),m=u("width")||!p,y=u("height")||!h;m&&p&&(i.style.width=`${p}px`),y&&h&&(i.style.height=`${h}px`);let b=d.getPropertyValue("object-fit"),S=d.getPropertyValue("object-position");b&&b!=="fill"?(i.style.objectFit=b,S&&(i.style.objectPosition=S)):(p&&(i.style.minWidth=`${p}px`),h&&(i.style.minHeight=`${h}px`))}catch(l){I(e,"IMG dimension freeze failed",l)}}}catch(l){throw console.error("[Snapdom] Failed to clone node:",t,l),l}let a=null;if(t instanceof HTMLTextAreaElement){let{width:l,height:d}=at(t),u=l||t.getBoundingClientRect().width||0,p=d||t.getBoundingClientRect().height||0;u&&(i.style.width=`${u}px`),p&&(i.style.height=`${p}px`)}if(t instanceof HTMLInputElement){let l=(t.type||"text").toLowerCase();if((l==="checkbox"||l==="radio")&&_n()){let{el:u,applyVisual:p}=eo(t);e.nodeMap.set(u,t),a=p,i=u}else i.value=t.value,i.setAttribute("value",t.value),t.checked!==void 0&&(i.checked=t.checked,t.checked&&i.setAttribute("checked",""),t.indeterminate&&(i.indeterminate=t.indeterminate))}if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!t.value&&t.placeholder)try{let l=window.getComputedStyle(t,"::placeholder"),d=l&&l.color;if(d&&d!=="rgba(0, 0, 0, 0)"){let u="snapdom-ph-"+(Math.random()*1e6|0);i.classList.add(u);let p=document.createElement("style");p.textContent=`.${u}::placeholder{color:${d}!important;opacity:${l.opacity||"1"}!important;-webkit-text-fill-color:${d}!important;}`,i.prepend(p)}}catch{}if(t instanceof HTMLSelectElement&&(r=t.value),t instanceof HTMLTextAreaElement&&(s=t.value),t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement){t.disabled&&i.setAttribute("disabled",""),t.required&&i.setAttribute("required",""),t.readOnly&&i.setAttribute("readonly","");let l=t;l.min!==void 0&&l.min!==""&&i.setAttribute("min",l.min),l.max!==void 0&&l.max!==""&&i.setAttribute("max",l.max),l.pattern!==void 0&&l.pattern!==""&&i.setAttribute("pattern",l.pattern);let d=t.getAttribute("aria-invalid");d!==null&&i.setAttribute("aria-invalid",d)}if(xe(t)||it(t,i,e,n),a&&a(),t instanceof SVGElement&&!xe(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"];try{let d=window.getComputedStyle(t);for(let u of l){let p=d.getPropertyValue(u);p&&i.style.setProperty(u,p)}}catch{}}if(t.shadowRoot){try{let C=t.shadowRoot.querySelectorAll("slot");for(let g of C){let w=g.assignedNodes?.()||[];for(let v of w)o.add(v)}}catch{}let l=Xn(e),d=`[data-sd="${l}"]`;try{i.setAttribute("data-sd",l)}catch{}let u=Gn(t.shadowRoot),p=qn(u,d),h=Qn(u),m=Jn(t,h,d);Yn(i,m+p,l);let y=document.createDocumentFragment(),b=(C,g)=>{if(C.nodeType===Node.ELEMENT_NODE&&C.tagName==="STYLE")return g(null);te(C,e,n).then(w=>{g(w||null)}).catch(()=>{g(null)})},S=await Ce(Array.from(t.shadowRoot.childNodes),b,n.fast);y.append(...S.filter(C=>!!C)),i.appendChild(y)}if(t.tagName==="SLOT"){let l=t.assignedNodes?.({flatten:!0})||[],d=l.length>0?l:Array.from(t.childNodes),u=document.createDocumentFragment(),p=(m,y)=>{te(m,e,n).then(b=>{b&&Zn(b),y(b||null)}).catch(()=>{y(null)})},h=await Ce(Array.from(d),p,n.fast);return u.append(...h.filter(m=>!!m)),u}function c(l,d){if(o.has(l))return d(null);te(l,e,n).then(u=>{d(u||null)}).catch(()=>{d(null)})}let f=await Ce(Array.from(t.childNodes),c,n.fast);if(i.append(...f.filter(l=>!!l)),r!==null&&i instanceof HTMLSelectElement){i.value=r;for(let l of i.options)l.value===r?l.setAttribute("selected",""):l.removeAttribute("selected")}return s!==null&&i instanceof HTMLTextAreaElement&&(i.textContent=s),i}async function Oi(t,e,n){let o=!1;try{o=!!(t.contentDocument||t.contentWindow?.document)}catch(r){I(e,"iframe same-origin probe failed",r)}if(o)try{return await to(t,e,n)}catch(r){console.warn("[SnapDOM] iframe rasterization failed, fallback:",r)}if(o||console.warn("[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.",t),n.placeholders){let{width:r,height:s}=at(t),i=document.createElement("div");return i.style.cssText=`width:${r}px;height:${s}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,it(t,i,e,n),i}else{let{width:r,height:s}=at(t),i=document.createElement("div");return i.style.cssText=`display:inline-block;width:${r}px;height:${s}px;visibility:hidden;`,it(t,i,e,n),i}}async function Bi(t,e,n){let o="";try{let a=t.getContext("2d",{willReadFrequently:!0});try{a&&a.getImageData(0,0,1,1)}catch{}if((X()||!a)&&await new Promise(c=>requestAnimationFrame(c)),o=t.toDataURL("image/png"),!o||o==="data:,"){try{a&&a.getImageData(0,0,1,1)}catch{}if(await new Promise(c=>requestAnimationFrame(c)),o=t.toDataURL("image/png"),!o||o==="data:,"){let c=document.createElement("canvas");c.width=t.width,c.height=t.height;let f=c.getContext("2d");f&&(f.drawImage(t,0,0),o=c.toDataURL("image/png"))}}}catch(a){I(e,"Canvas toDataURL failed, using empty/fallback",a)}let r=document.createElement("img");try{r.decoding="sync",r.loading="eager"}catch(a){I(e,"img decoding/loading hints failed",a)}o&&(r.src=o),r.width=t.width,r.height=t.height;let{width:s,height:i}=at(t);return s>0&&(r.style.width=`${s}px`),i>0&&(r.style.height=`${i}px`),e.nodeMap.set(r,t),it(t,r,e,n),r}async function Ui(t,e,n){let o="";try{let a=document.createElement("canvas");a.width=t.videoWidth||t.offsetWidth||320,a.height=t.videoHeight||t.offsetHeight||240;let c=a.getContext("2d");c&&(c.drawImage(t,0,0,a.width,a.height),o=a.toDataURL("image/png"),(!o||o==="data:,")&&(o=""))}catch(a){I(e,"Video frame capture failed, using poster fallback",a)}let r=document.createElement("img");try{r.decoding="sync",r.loading="eager"}catch{}o?r.src=o:t.poster&&(r.src=t.poster),r.width=t.videoWidth||t.offsetWidth||0,r.height=t.videoHeight||t.offsetHeight||0;let{width:s,height:i}=at(t);return s>0&&(r.style.width=`${s}px`),i>0&&(r.style.height=`${i}px`),r.style.objectFit="contain",e.nodeMap.set(r,t),it(t,r,e,n),r}async function Di(t,e,n){if(!t.controls)return;let{width:o,height:r}=at(t),s=Math.round(o||t.offsetWidth||300),i=Math.round(r||t.offsetHeight||54),a=i/2,c=Math.max(4,i*.16),f=i*.34,l=s-i*.34,d=f+c+i*.55,u=Math.max(0,l-i*.7-d),p=Math.max(9,Math.round(i*.24)),h=`<svg xmlns="http://www.w3.org/2000/svg" width="${s}" height="${i}" viewBox="0 0 ${s} ${i}"><rect width="${s}" height="${i}" rx="${Math.min(i/2,10)}" fill="#f1f3f4"/><path d="M ${f} ${a-c} L ${f+c} ${a} L ${f} ${a+c} Z" fill="#5f6368"/><rect x="${d}" y="${a-1.5}" width="${u}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${d}" cy="${a}" r="${Math.max(3,i*.09)}" fill="#5f6368"/><text x="${l}" y="${a}" fill="#5f6368" font-family="sans-serif" font-size="${p}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,m=document.createElement("img");try{m.decoding="sync",m.loading="eager"}catch{}return m.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h)}`,m.width=s,m.height=i,m.style.width=`${s}px`,m.style.height=`${i}px`,e.nodeMap.set(m,t),it(t,m,e,n),m}ke("IFRAME",Oi);ke("CANVAS",Bi);ke("VIDEO",Ui);ke("AUDIO",Di);rt();Gt();Kt();tt();tt();var Hi=[/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],Bt=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__||{}),ao=[],io=new Set;function zi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function co(t){let e=Array.isArray(t)?t:[t];for(let n of e){let o;if(n instanceof RegExp)o=n;else if(typeof n=="string")o=new RegExp(zi(n),"i");else{console.warn("[snapdom] Ignored invalid iconFont value:",n);continue}let r=`${o.source}/${o.flags}`;io.has(r)||(io.add(r),ao.push(o))}}function ct(t){let e=typeof t=="string"?t:"",n=[...Hi,...ao];for(let o of n)if(o instanceof RegExp&&o.test(e))return!0;return!!(/icon/i.test(e)||/glyph/i.test(e)||/symbols/i.test(e)||/feather/i.test(e)||/fontawesome/i.test(e))}function Vi(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var so=new Map;function ji(t=""){let e=Object.create(null),n=String(t||""),o=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,r;for(;r=o.exec(n);)e[r[1].toUpperCase()]=Number(r[2]);return e}async function qi(t,e,n){let o=String(t||""),r=o.toLowerCase(),s=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(r)&&!/\bsymbols\b/.test(r))return{familyForMeasure:o,familyForCanvas:o};if(!/\bmaterial\s*symbols\b/.test(r))return{familyForMeasure:o,familyForCanvas:o};let a=n&&(n.FILL??n.fill),c="outlined";/\brounded\b/.test(s)||/\bround\b/.test(s)?c="rounded":/\bsharp\b/.test(s)?c="sharp":/\boutlined\b/.test(s)&&(c="outlined");let f=a===1,l=null;if(f&&(c==="outlined"&&Bt.materialIconsFilled?l={url:Bt.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&Bt.materialIconsRound?l={url:Bt.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&Bt.materialIconsSharp&&(l={url:Bt.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:o,familyForCanvas:o};if(!so.has(l.alias))try{let u=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(u),await u.load(),so.set(l.alias,!0)}catch{return{familyForMeasure:o,familyForCanvas:o}}let d=`"${l.alias}"`;return{familyForMeasure:d,familyForCanvas:d}}async function Xi(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function Gi(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 o=t.color?.trim();return o&&o!=="inherit"?o:"#000"}async function Yi(t,{family:e="Material Icons",weight:n="normal",fontSize:o=32,color:r="#000",variation:s="",className:i=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,f=ji(s),{familyForMeasure:l,familyForCanvas:d}=await qi(a,i,f);await Xi(d.replace(/^["']+|["']+$/g,""),o);let u=document.createElement("span");u.setAttribute("data-snapdom-internal",""),u.textContent=t,u.style.position="absolute",u.style.visibility="hidden",u.style.left="-99999px",u.style.whiteSpace="nowrap",u.style.fontFamily=l,u.style.fontWeight=String(n||"normal"),u.style.fontSize=`${o}px`,u.style.lineHeight="1",u.style.margin="0",u.style.padding="0",u.style.fontFeatureSettings="'liga' 1",u.style.fontVariantLigatures="normal",u.style.color=r,document.body.appendChild(u);let p=u.getBoundingClientRect(),h=Math.max(1,Math.ceil(p.width)),m=Math.max(1,Math.ceil(p.height));document.body.removeChild(u);let y=document.createElement("canvas");y.width=h*c,y.height=m*c;let b=y.getContext("2d");b.scale(c,c),b.font=`${n?`${n} `:""}${o}px ${d}`,b.textAlign="left",b.textBaseline="top",b.fillStyle=r;try{b.fontKerning="normal"}catch{}return b.fillText(t,0,0),{dataUrl:y.toDataURL(),width:h,height:m}}async function lo(t,e,n=x.session.nodeMap){if(t?.nodeType!==1)return 0;let o='.material-icons, [class*="material-symbols"]',r=Array.from(t.querySelectorAll(o)).filter(a=>a&&a.textContent&&a.textContent.trim());if(t.matches?.(o)&&t.textContent&&t.textContent.trim()&&r.unshift(t),r.length===0)return 0;let s=e?.nodeType===1?Array.from(e.querySelectorAll(o)).filter(a=>a&&a.textContent&&a.textContent.trim()):[];e?.nodeType===1&&e.matches?.(o)&&e.textContent&&e.textContent.trim()&&s.unshift(e);let i=0;for(let a=0;a<r.length;a++){let c=r[a],f=n&&n.get(c)||s[a]||null;try{let l=getComputedStyle(f||c),d=l.fontFamily||"Material Icons";if(!Vi(d))continue;let u=(f||c).textContent.trim();if(!u)continue;let p=parseInt(l.fontSize,10)||24,h=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",m=Gi(l),y=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",b=(f||c).className||"",{dataUrl:S,width:C,height:g}=await Yi(u,{family:d,weight:h,fontSize:p,color:m,variation:y,className:b});c.textContent="";let w=c.ownerDocument.createElement("img");w.src=S,w.alt=u,w.style.height=`${p}px`,w.style.width=`${Math.max(1,Math.round(C/g*p))}px`,w.style.objectFit="contain",w.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(w),i++}catch{}}return i}wt();async function mo(t,e,n,o=32,r="#000"){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let i=document.createElement("span");i.setAttribute("data-snapdom-internal",""),i.textContent=t,i.style.position="absolute",i.style.visibility="hidden",i.style.fontFamily=`"${e}"`,i.style.fontWeight=n||"normal",i.style.fontSize=`${o}px`,i.style.lineHeight="1",i.style.whiteSpace="nowrap",i.style.padding="0",i.style.margin="0",document.body.appendChild(i);let a=i.getBoundingClientRect(),c=Math.ceil(a.width),f=Math.ceil(a.height);document.body.removeChild(i);let l=document.createElement("canvas");l.width=Math.max(1,c*s),l.height=Math.max(1,f*s);let d=l.getContext("2d");return d.scale(s,s),d.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=r,d.fillText(t,0,0),{dataUrl:l.toDataURL(),width:c,height:f}}var ho=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Ki=["katex","mathjax","mathml"];function nn(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!ho.has(n.toLowerCase()))return n}return""}function Qi(t){if(!t)return[];let e=[];for(let n of t.split(",")){let o=n.trim().replace(/^['"]+|['"]+$/g,"");o&&(ho.has(o.toLowerCase())||e.push(o))}return e}function Me(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 Ee(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function Ji(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Zi(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let r=Me(n[1]),s=Me(n[2]);return{min:Math.min(r,s),max:Math.max(r,s)}}let o=Me(e);return{min:o,max:o}}function ts(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function es(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let s=parseFloat(n[1]),i=parseFloat(n[2]);return{min:Math.min(s,i),max:Math.max(s,i)}}let o=e.match(/(\d+(?:\.\d+)?)\s*%/),r=o?parseFloat(o[1]):100;return{min:r,max:r}}function ns(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function os(t,e,n=[]){if(!t)return!1;try{let o=new URL(t,location.href);if(o.origin===location.origin)return!0;let s=o.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=>s.endsWith(c))||n.some(c=>s===c.toLowerCase()||s.endsWith("."+c.toLowerCase())))return!0;let a=(o.pathname+o.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||Ki.some(c=>a.includes(c)))return!0;for(let c of e){let f=c.toLowerCase().replace(/\s+/g,"+"),l=c.toLowerCase().replace(/\s+/g,"-"),d=ns(c);if(a.includes(f)||a.includes(l)||d&&a.includes(d))return!0}return!1}catch{return!1}}function rs(t){let e=new Set;for(let n of t||[]){let o=String(n).split("__")[0]?.trim();o&&e.add(o)}return e}function fo(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,o,r)=>{let s=(r||"").trim();if(!s||/^data:|^blob:|^https?:|^file:|^about:/i.test(s))return n;let i=s;try{i=new URL(s,e||location.href).href}catch{}return`url("${i}")`})}var tn=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,$e=4;async function is(t,e,n){if(!t)return t;let o=new Set;function r(a,c){try{return new URL(a,c||location.href).href}catch{return a}}async function s(a,c,f=0){if(f>$e)return console.warn(`[snapDOM] @import depth exceeded (${$e}) at ${c}`),a;let l="",d=0,u;for(;u=tn.exec(a);){l+=a.slice(d,u.index),d=tn.lastIndex;let p=(u[2]||u[4]||"").trim(),h=r(p,c);if(o.has(h)){console.warn(`[snapDOM] Skipping circular @import: ${h}`);continue}o.add(h);let m="";try{let y=await j(h,{as:"text",useProxy:n,silent:!0});y.ok&&typeof y.data=="string"&&(m=y.data)}catch{}m?(m=fo(m,h),m=await s(m,h,f+1),l+=`
10
+ `}catch{}}catch{}return e}function Zn(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function Jn(t,e){try{let n=null,o=L(t).content;if(o&&o.includes("url(")){let i=o.match(/url\(["']?([^"')]+)["']?\)/);i&&(n=i[1])}let r=t.closest?.("picture"),s=n||(r?Ze(t,r):t.currentSrc)||t.src||Ot(t.getAttribute("srcset"),t)||"";if(!s)return;e.setAttribute("src",s),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function to(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function _i(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch{}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch{}return""}function eo(t,e,n){let o=[];for(let r of e){let s=_i(t,r);s&&o.push(`${r}: ${s};`)}return o.length?`${n}{${o.join("")}}
11
+ `:""}function no(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}async function Wi(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},o=n(),r=0;for(;r<e&&(!o||!o.body&&!o.documentElement);)await new Promise(s=>setTimeout(s,0)),o=n(),r++;return o&&(o.body||o.documentElement)?o:null}function Oi(t){let e=t.getBoundingClientRect(),n=0,o=0,r=0,s=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,o=parseFloat(c.borderRightWidth)||0,r=parseFloat(c.borderTopWidth)||0,s=parseFloat(c.borderBottomWidth)||0}catch{}let i=Math.max(0,Math.round(e.width-(n+o))),a=Math.max(0,Math.round(e.height-(r+s)));return{contentWidth:i,contentHeight:a,rect:e}}function at(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let o=getComputedStyle(t);if(e===0){let r=parseFloat(o.width);!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(o.height);!isNaN(r)&&r>0&&(n=r)}}catch{}if(e===0||n===0)try{if(e===0){let o=parseFloat(t.getAttribute("width"));!isNaN(o)&&o>0&&(e=o)}if(n===0){let o=parseFloat(t.getAttribute("height"));!isNaN(o)&&o>0&&(n=o)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}function Bi(t,e,n){let o=t.defaultView,r=o?o.scrollX:0,s=o?o.scrollY:0,i=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,c=t.documentElement?t.documentElement.scrollLeft:0,f=t.documentElement?t.documentElement.scrollTop:0,l=0,d=0,u=0,p=0;try{let m=o&&t.body?o.getComputedStyle(t.body):null;m&&(l=(parseFloat(m.marginTop)||0)+(parseFloat(m.paddingTop)||0),d=(parseFloat(m.marginRight)||0)+(parseFloat(m.paddingRight)||0),u=(parseFloat(m.marginBottom)||0)+(parseFloat(m.paddingBottom)||0),p=(parseFloat(m.marginLeft)||0)+(parseFloat(m.paddingLeft)||0))}catch{}try{t.documentElement.setAttribute("data-sd-pinned","")}catch{}let h=t.createElement("style");return h.setAttribute("data-sd-iframe-pin",""),h.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 ${d}px ${u}px ${p}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(h),()=>{try{h.remove()}catch{}try{t.documentElement.removeAttribute("data-sd-pinned")}catch{}try{o&&typeof o.scrollTo=="function"&&o.scrollTo(r,s),t.body&&(t.body.scrollLeft=i,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=c,t.documentElement.scrollTop=f)}catch{}}}async function oo(t,e,n){let o=await Wi(t,3);if(!o)throw new Error("iframe document not accessible/ready");let{contentWidth:r,contentHeight:s,rect:i}=Oi(t),a=n?.snap;if(!a&&typeof window<"u"&&window.snapdom&&(a=window.snapdom),!a||typeof a.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let c={...n,scale:1,clip:null},f=Bi(o,r,s),l=x.session.nodeMap,d=x.session.styleMap,u=x.session.styleCache,p;try{p=await a.toPng(o.documentElement,c)}finally{f(),x.session.nodeMap=l,x.session.styleMap=d,x.session.styleCache=u}p.style.display="block",p.style.width=`${r}px`,p.style.height=`${s}px`;let h=document.createElement("div");return e.nodeMap.set(h,t),it(t,h,e,n),h.style.overflow="hidden",h.style.display="block",h.style.width||(h.style.width=`${Math.round(i.width)}px`),h.style.height||(h.style.height=`${Math.round(i.height)}px`),h.appendChild(p),h}function ro(t){let{width:e,height:n}=at(t),o=t.getBoundingClientRect(),r;try{r=window.getComputedStyle(t)}catch{}let s=r?parseFloat(r.width):NaN,i=r?parseFloat(r.height):NaN,a=Math.round(e||o.width||0),c=Math.round(n||o.height||0),f=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,a||16),l=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,c||16),d=(t.type||"text").toLowerCase()==="checkbox",u=!!t.checked,p=!!t.indeterminate,m=Math.max(Math.min(f,l),12),y="middle";try{r&&r.verticalAlign&&(y=r.verticalAlign)}catch{}let b=document.createElement("div");b.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),b.style.cssText=`display:inline-block;width:${m}px;height:${m}px;vertical-align:${y};flex-shrink:0;line-height:0;`;let S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("width",String(m)),S.setAttribute("height",String(m)),S.setAttribute("viewBox",`0 0 ${m} ${m}`),b.appendChild(S);function C(){let g="#0a6ed1";try{r&&(g=r.accentColor||r.color||g)}catch{}let w=2,v=w/2,M=m-w;if(S.innerHTML="",d){let A=document.createElementNS("http://www.w3.org/2000/svg","rect");if(A.setAttribute("x",String(v)),A.setAttribute("y",String(v)),A.setAttribute("width",String(M)),A.setAttribute("height",String(M)),A.setAttribute("rx","2"),A.setAttribute("ry","2"),A.setAttribute("fill",u?g:"none"),A.setAttribute("stroke",g),A.setAttribute("stroke-width",String(w)),S.appendChild(A),u){let k=document.createElementNS("http://www.w3.org/2000/svg","path");k.setAttribute("d",`M ${v+2} ${m/2} L ${m/2-1} ${m-v-2} L ${m-v-2} ${v+2}`),k.setAttribute("stroke","white"),k.setAttribute("stroke-width",String(Math.max(1.5,w))),k.setAttribute("fill","none"),k.setAttribute("stroke-linecap","round"),k.setAttribute("stroke-linejoin","round"),S.appendChild(k)}else if(p){let k=document.createElementNS("http://www.w3.org/2000/svg","rect"),F=Math.max(6,M-4);k.setAttribute("x",String((m-F)/2)),k.setAttribute("y",String((m-w)/2)),k.setAttribute("width",String(F)),k.setAttribute("height",String(w)),k.setAttribute("fill",g),k.setAttribute("rx","1"),S.appendChild(k)}}else{let A=document.createElementNS("http://www.w3.org/2000/svg","circle");if(A.setAttribute("cx",String(m/2)),A.setAttribute("cy",String(m/2)),A.setAttribute("r",String((m-w)/2)),A.setAttribute("fill",u?g:"none"),A.setAttribute("stroke",g),A.setAttribute("stroke-width",String(w)),S.appendChild(A),u){let k=document.createElementNS("http://www.w3.org/2000/svg","circle"),F=Math.max(2,(m-w*2)*.35);k.setAttribute("cx",String(m/2)),k.setAttribute("cy",String(m/2)),k.setAttribute("r",String(F)),k.setAttribute("fill","white"),S.appendChild(k)}}b.style.setProperty("width",`${m}px`,"important"),b.style.setProperty("height",`${m}px`,"important"),b.style.setProperty("min-width",`${m}px`,"important"),b.style.setProperty("min-height",`${m}px`,"important")}return C(),{el:b,applyVisual:C}}var Zt=new q(80);async function Jt(t){if(x.resource?.has(t))return x.resource.get(t);if(Zt.has(t))return Zt.get(t);let e=(async()=>{let n=await j(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return x.resource?.set(t,n.data),n.data})();Zt.set(t,e);try{let n=await e;return Zt.set(t,n),n}catch(n){throw Zt.delete(t),n}}var Ui=/\bblob:[^)"'\s]+/g;async function Gn(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(Ui)||[]));if(e.length===0)return t;let n=t;for(let o of e)try{let r=await Jt(o);n=n.split(o).join(r)}catch{}return n}function Se(t){return typeof t=="string"&&t.startsWith("blob:")}function Di(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 Hi(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function ve(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function io(t,e=null){if(!t)return;let n=e,o=ve(t,"img");for(let c of o)try{let l=c.getAttribute("src")||c.currentSrc||"";if(Se(l)){let u=await Jt(l);c.setAttribute("src",u)}let d=c.getAttribute("srcset");if(d&&d.includes("blob:")){let u=Di(d),p=!1;for(let h of u)if(Se(h.url))try{h.url=await Jt(h.url),p=!0}catch(m){I(n,"blobUrlToDataUrl for srcset item failed",m)}p&&c.setAttribute("srcset",Hi(u))}}catch(f){I(n,"resolveBlobUrls for img failed",f)}let r=ve(t,"image");for(let c of r)try{let f="http://www.w3.org/1999/xlink",l=c.getAttribute("href")||c.getAttributeNS?.(f,"href");if(Se(l)){let d=await Jt(l);c.setAttribute("href",d),c.removeAttributeNS?.(f,"href")}}catch(f){I(n,"resolveBlobUrls for SVG image href failed",f)}let s=ve(t,"[style*='blob:']");for(let c of s)try{let f=c.getAttribute("style");if(f&&f.includes("blob:")){let l=await Gn(f);c.setAttribute("style",l)}}catch(f){I(n,"replaceBlobUrls in inline style failed",f)}let i=t.querySelectorAll?t.querySelectorAll("style"):[];for(let c of i)try{let f=c.textContent||"";f.includes("blob:")&&(c.textContent=await Gn(f))}catch(f){I(n,"replaceBlobUrls in style tag failed",f)}let a=["poster"];for(let c of a){let f=ve(t,`[${c}^='blob:']`);for(let l of f)try{let d=l.getAttribute(c);Se(d)&&l.setAttribute(c,await Jt(d))}catch(d){I(n,`resolveBlobUrls for ${c} failed`,d)}}}Wt();var tn=new Map,so=new Set(["IFRAME"]);function ke(t,e){tn.set(String(t).toUpperCase(),e)}function Je(t){let{width:e,height:n}=at(t),o=e,r=n;if(!o||!r){let i=t.getBoundingClientRect();o=o||i.width||0,r=r||i.height||0}let s=document.createElement("div");return s.style.cssText=`display:inline-block;width:${o}px;height:${r}px;visibility:hidden;`,s}var Ae=200,zi=new Set(["img","canvas","video","iframe","object","embed"]);function ao(t,e){return t.right>=e.left-Ae&&t.left<=e.right+Ae&&t.bottom>=e.top-Ae&&t.top<=e.bottom+Ae}function Vi(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 o=L(t);if(o.display==="inline"&&!zi.has((t.localName||"").toLowerCase()))return!1;let r=e.rect,s=t.scrollWidth||0,i=t.scrollHeight||0,a={left:o.direction==="rtl"?Math.min(n.left,n.right-s):n.left,top:n.top,right:Math.max(n.right,n.left+s),bottom:Math.max(n.bottom,n.top+i)},c=o.writingMode||"";if((c.startsWith("vertical")||c.startsWith("sideways"))&&(a.top=Math.min(n.top,n.bottom-i),a.left=Math.min(a.left,n.right-s)),ao(a,r))return!1;let f=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;f.nextNode();){let l=f.currentNode.getBoundingClientRect();if((l.width>0||l.height>0)&&ao(l,r))return!1}return!0}function ji(t,e,n){let o=t.cloneNode(!1);t.tagName==="IMG"&&(o.removeAttribute("src"),o.removeAttribute("srcset"),o.removeAttribute("sizes")),it(t,o,e,n);let{width:r,height:s}=at(t);return r>0&&(o.style.width=`${r}px`,o.style.minWidth=`${r}px`,o.style.maxWidth=`${r}px`),s>0&&(o.style.height=`${s}px`,o.style.minHeight=`${s}px`,o.style.maxHeight=`${s}px`),o.style.visibility="hidden",o.style.overflow="hidden",o.style.boxSizing="border-box",o}async function te(t,e,n){if(!t)throw new Error("Invalid node");let o=new Set,r=null,s=null;if(t.nodeType===Node.ELEMENT_NODE){let l=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||pe.has(l))return null;if(l==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return I(e,"Nested <foreignObject> skipped (SVG spec limitation \u2014 not rendered by browsers)"),null;if(l==="source"&&t.parentElement?.localName==="picture")return null}if(t.nodeType===Node.TEXT_NODE||t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide")return Je(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 Je(t);if(n.excludeMode==="remove")return null}}catch(d){console.warn(`Invalid selector in exclude option: ${l}`,d)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide")return Je(t);if(n.filterMode==="remove")return null}}catch(l){console.warn("Error in filter function:",l)}if(e.clip&&Vi(t,e.clip))return ji(t,e,n);if(n.__resolveNodeHooks)for(let l of n.__resolveNodeHooks){let d;try{d=await l(t,n)}catch(u){I(e,"resolveNode plugin hook failed",u)}if(d===null)return null;if(d instanceof Node)return d.nodeType===Node.ELEMENT_NODE&&(e.nodeMap.set(d,t),it(t,d,e,n)),d}{let l=so.has(t.tagName)&&tn.get(t.tagName);if(l){let d=await l(t,e,n);if(d!==void 0)return d}}if(t.getAttribute("data-capture")==="placeholder"){let l=t.cloneNode(!1);e.nodeMap.set(l,t),it(t,l,e,n);let d=document.createElement("div");return d.textContent=t.getAttribute("data-placeholder-text")||"",d.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",l.appendChild(d),l}{let l=!so.has(t.tagName)&&tn.get(t.tagName);if(l){let d=await l(t,e,n);if(d!==void 0)return d}}let i;try{if(i=t.cloneNode(!1),i.attributes?.length)try{for(let l of i.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(l.value)&&i.setAttribute(l.name,l.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(jn(t,i),e.nodeMap.set(i,t),t.tagName==="IMG"){Jn(t,i);try{let{width:l,height:d}=at(t),u=Math.round(l||0),p=Math.round(d||0);u&&(i.dataset.snapdomWidth=String(u)),p&&(i.dataset.snapdomHeight=String(p))}catch(l){I(e,"getUnscaledDimensions for IMG failed",l)}try{let l=t.getAttribute("style")||"",d=window.getComputedStyle(t),u=C=>{let g=l.match(new RegExp(`${C}\\s*:\\s*([^;]+)`,"i")),w=g?g[1].trim():d.getPropertyValue(C);return/%|auto/i.test(String(w||""))},p=parseInt(i.dataset.snapdomWidth||"0",10),h=parseInt(i.dataset.snapdomHeight||"0",10),m=u("width")||!p,y=u("height")||!h;m&&p&&(i.style.width=`${p}px`),y&&h&&(i.style.height=`${h}px`);let b=d.getPropertyValue("object-fit"),S=d.getPropertyValue("object-position");b&&b!=="fill"?(i.style.objectFit=b,S&&(i.style.objectPosition=S)):(p&&(i.style.minWidth=`${p}px`),h&&(i.style.minHeight=`${h}px`))}catch(l){I(e,"IMG dimension freeze failed",l)}}}catch(l){throw console.error("[Snapdom] Failed to clone node:",t,l),l}let a=null;if(t instanceof HTMLTextAreaElement){let{width:l,height:d}=at(t),u=l||t.getBoundingClientRect().width||0,p=d||t.getBoundingClientRect().height||0;u&&(i.style.width=`${u}px`),p&&(i.style.height=`${p}px`)}if(t instanceof HTMLInputElement){let l=(t.type||"text").toLowerCase();if((l==="checkbox"||l==="radio")&&On()){let{el:u,applyVisual:p}=ro(t);e.nodeMap.set(u,t),a=p,i=u}else i.value=t.value,i.setAttribute("value",t.value),t.checked!==void 0&&(i.checked=t.checked,t.checked&&i.setAttribute("checked",""),t.indeterminate&&(i.indeterminate=t.indeterminate))}if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!t.value&&t.placeholder)try{let l=window.getComputedStyle(t,"::placeholder"),d=l&&l.color;if(d&&d!=="rgba(0, 0, 0, 0)"){let u="snapdom-ph-"+(Math.random()*1e6|0);i.classList.add(u);let p=document.createElement("style");p.textContent=`.${u}::placeholder{color:${d}!important;opacity:${l.opacity||"1"}!important;-webkit-text-fill-color:${d}!important;}`,i.prepend(p)}}catch{}if(t instanceof HTMLSelectElement&&(r=t.value),t instanceof HTMLTextAreaElement&&(s=t.value),t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement){t.disabled&&i.setAttribute("disabled",""),t.required&&i.setAttribute("required",""),t.readOnly&&i.setAttribute("readonly","");let l=t;l.min!==void 0&&l.min!==""&&i.setAttribute("min",l.min),l.max!==void 0&&l.max!==""&&i.setAttribute("max",l.max),l.pattern!==void 0&&l.pattern!==""&&i.setAttribute("pattern",l.pattern);let d=t.getAttribute("aria-invalid");d!==null&&i.setAttribute("aria-invalid",d)}if(xe(t)||it(t,i,e,n),a&&a(),t instanceof SVGElement&&!xe(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"];try{let d=window.getComputedStyle(t);for(let u of l){let p=d.getPropertyValue(u);p&&i.style.setProperty(u,p)}}catch{}}if(t.shadowRoot){try{let C=t.shadowRoot.querySelectorAll("slot");for(let g of C){let w=g.assignedNodes?.()||[];for(let v of w)o.add(v)}}catch{}let l=Kn(e),d=`[data-sd="${l}"]`;try{i.setAttribute("data-sd",l)}catch{}let u=Qn(t.shadowRoot),p=Yn(u,d),h=to(u),m=eo(t,h,d);Zn(i,m+p,l);let y=document.createDocumentFragment(),b=(C,g)=>{if(C.nodeType===Node.ELEMENT_NODE&&C.tagName==="STYLE")return g(null);te(C,e,n).then(w=>{g(w||null)}).catch(()=>{g(null)})},S=await Ce(Array.from(t.shadowRoot.childNodes),b,n.fast);y.append(...S.filter(C=>!!C)),i.appendChild(y)}if(t.tagName==="SLOT"){let l=t.assignedNodes?.({flatten:!0})||[],d=l.length>0?l:Array.from(t.childNodes),u=document.createDocumentFragment(),p=(m,y)=>{te(m,e,n).then(b=>{b&&no(b),y(b||null)}).catch(()=>{y(null)})},h=await Ce(Array.from(d),p,n.fast);return u.append(...h.filter(m=>!!m)),u}function c(l,d){if(o.has(l))return d(null);te(l,e,n).then(u=>{d(u||null)}).catch(()=>{d(null)})}let f=await Ce(Array.from(t.childNodes),c,n.fast);if(i.append(...f.filter(l=>!!l)),r!==null&&i instanceof HTMLSelectElement){i.value=r;for(let l of i.options)l.value===r?l.setAttribute("selected",""):l.removeAttribute("selected")}return s!==null&&i instanceof HTMLTextAreaElement&&(i.textContent=s),i}async function qi(t,e,n){let o=!1;try{o=!!(t.contentDocument||t.contentWindow?.document)}catch(r){I(e,"iframe same-origin probe failed",r)}if(o)try{return await oo(t,e,n)}catch(r){console.warn("[SnapDOM] iframe rasterization failed, fallback:",r)}if(o||console.warn("[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.",t),n.placeholders){let{width:r,height:s}=at(t),i=document.createElement("div");return i.style.cssText=`width:${r}px;height:${s}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,it(t,i,e,n),i}else{let{width:r,height:s}=at(t),i=document.createElement("div");return i.style.cssText=`display:inline-block;width:${r}px;height:${s}px;visibility:hidden;`,it(t,i,e,n),i}}async function Xi(t,e,n){let o="";try{let a=t.getContext("2d",{willReadFrequently:!0});try{a&&a.getImageData(0,0,1,1)}catch{}if((X()||!a)&&await new Promise(c=>requestAnimationFrame(c)),o=t.toDataURL("image/png"),!o||o==="data:,"){try{a&&a.getImageData(0,0,1,1)}catch{}if(await new Promise(c=>requestAnimationFrame(c)),o=t.toDataURL("image/png"),!o||o==="data:,"){let c=document.createElement("canvas");c.width=t.width,c.height=t.height;let f=c.getContext("2d");f&&(f.drawImage(t,0,0),o=c.toDataURL("image/png"))}}}catch(a){I(e,"Canvas toDataURL failed, using empty/fallback",a)}let r=document.createElement("img");try{r.decoding="sync",r.loading="eager"}catch(a){I(e,"img decoding/loading hints failed",a)}o&&(r.src=o),r.width=t.width,r.height=t.height;let{width:s,height:i}=at(t);return s>0&&(r.style.width=`${s}px`),i>0&&(r.style.height=`${i}px`),e.nodeMap.set(r,t),it(t,r,e,n),r}async function Gi(t,e,n){let o="";try{let a=document.createElement("canvas");a.width=t.videoWidth||t.offsetWidth||320,a.height=t.videoHeight||t.offsetHeight||240;let c=a.getContext("2d");c&&(c.drawImage(t,0,0,a.width,a.height),o=a.toDataURL("image/png"),(!o||o==="data:,")&&(o=""))}catch(a){I(e,"Video frame capture failed, using poster fallback",a)}let r=document.createElement("img");try{r.decoding="sync",r.loading="eager"}catch{}o?r.src=o:t.poster&&(r.src=t.poster),r.width=t.videoWidth||t.offsetWidth||0,r.height=t.videoHeight||t.offsetHeight||0;let{width:s,height:i}=at(t);return s>0&&(r.style.width=`${s}px`),i>0&&(r.style.height=`${i}px`),r.style.objectFit="contain",e.nodeMap.set(r,t),it(t,r,e,n),r}async function Yi(t,e,n){if(!t.controls)return;let{width:o,height:r}=at(t),s=Math.round(o||t.offsetWidth||300),i=Math.round(r||t.offsetHeight||54),a=i/2,c=Math.max(4,i*.16),f=i*.34,l=s-i*.34,d=f+c+i*.55,u=Math.max(0,l-i*.7-d),p=Math.max(9,Math.round(i*.24)),h=`<svg xmlns="http://www.w3.org/2000/svg" width="${s}" height="${i}" viewBox="0 0 ${s} ${i}"><rect width="${s}" height="${i}" rx="${Math.min(i/2,10)}" fill="#f1f3f4"/><path d="M ${f} ${a-c} L ${f+c} ${a} L ${f} ${a+c} Z" fill="#5f6368"/><rect x="${d}" y="${a-1.5}" width="${u}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${d}" cy="${a}" r="${Math.max(3,i*.09)}" fill="#5f6368"/><text x="${l}" y="${a}" fill="#5f6368" font-family="sans-serif" font-size="${p}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,m=document.createElement("img");try{m.decoding="sync",m.loading="eager"}catch{}return m.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h)}`,m.width=s,m.height=i,m.style.width=`${s}px`,m.style.height=`${i}px`,e.nodeMap.set(m,t),it(t,m,e,n),m}ke("IFRAME",qi);ke("CANVAS",Xi);ke("VIDEO",Gi);ke("AUDIO",Yi);rt();Gt();Kt();tt();tt();var Ki=[/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],Bt=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__||{}),fo=[],co=new Set;function Qi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uo(t){let e=Array.isArray(t)?t:[t];for(let n of e){let o;if(n instanceof RegExp)o=n;else if(typeof n=="string")o=new RegExp(Qi(n),"i");else{console.warn("[snapdom] Ignored invalid iconFont value:",n);continue}let r=`${o.source}/${o.flags}`;co.has(r)||(co.add(r),fo.push(o))}}function ct(t){let e=typeof t=="string"?t:"",n=[...Ki,...fo];for(let o of n)if(o instanceof RegExp&&o.test(e))return!0;return!!(/icon/i.test(e)||/glyph/i.test(e)||/symbols/i.test(e)||/feather/i.test(e)||/fontawesome/i.test(e))}function Zi(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var lo=new Map;function Ji(t=""){let e=Object.create(null),n=String(t||""),o=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,r;for(;r=o.exec(n);)e[r[1].toUpperCase()]=Number(r[2]);return e}async function ts(t,e,n){let o=String(t||""),r=o.toLowerCase(),s=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(r)&&!/\bsymbols\b/.test(r))return{familyForMeasure:o,familyForCanvas:o};if(!/\bmaterial\s*symbols\b/.test(r))return{familyForMeasure:o,familyForCanvas:o};let a=n&&(n.FILL??n.fill),c="outlined";/\brounded\b/.test(s)||/\bround\b/.test(s)?c="rounded":/\bsharp\b/.test(s)?c="sharp":/\boutlined\b/.test(s)&&(c="outlined");let f=a===1,l=null;if(f&&(c==="outlined"&&Bt.materialIconsFilled?l={url:Bt.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&Bt.materialIconsRound?l={url:Bt.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&Bt.materialIconsSharp&&(l={url:Bt.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:o,familyForCanvas:o};if(!lo.has(l.alias))try{let u=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(u),await u.load(),lo.set(l.alias,!0)}catch{return{familyForMeasure:o,familyForCanvas:o}}let d=`"${l.alias}"`;return{familyForMeasure:d,familyForCanvas:d}}async function es(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function ns(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 o=t.color?.trim();return o&&o!=="inherit"?o:"#000"}async function os(t,{family:e="Material Icons",weight:n="normal",fontSize:o=32,color:r="#000",variation:s="",className:i=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,f=Ji(s),{familyForMeasure:l,familyForCanvas:d}=await ts(a,i,f);await es(d.replace(/^["']+|["']+$/g,""),o);let u=document.createElement("span");u.setAttribute("data-snapdom-internal",""),u.textContent=t,u.style.position="absolute",u.style.visibility="hidden",u.style.left="-99999px",u.style.whiteSpace="nowrap",u.style.fontFamily=l,u.style.fontWeight=String(n||"normal"),u.style.fontSize=`${o}px`,u.style.lineHeight="1",u.style.margin="0",u.style.padding="0",u.style.fontFeatureSettings="'liga' 1",u.style.fontVariantLigatures="normal",u.style.color=r,document.body.appendChild(u);let p=u.getBoundingClientRect(),h=Math.max(1,Math.ceil(p.width)),m=Math.max(1,Math.ceil(p.height));document.body.removeChild(u);let y=document.createElement("canvas");y.width=h*c,y.height=m*c;let b=y.getContext("2d");b.scale(c,c),b.font=`${n?`${n} `:""}${o}px ${d}`,b.textAlign="left",b.textBaseline="top",b.fillStyle=r;try{b.fontKerning="normal"}catch{}return b.fillText(t,0,0),{dataUrl:y.toDataURL(),width:h,height:m}}async function po(t,e,n=x.session.nodeMap){if(t?.nodeType!==1)return 0;let o='.material-icons, [class*="material-symbols"]',r=Array.from(t.querySelectorAll(o)).filter(a=>a&&a.textContent&&a.textContent.trim());if(t.matches?.(o)&&t.textContent&&t.textContent.trim()&&r.unshift(t),r.length===0)return 0;let s=e?.nodeType===1?Array.from(e.querySelectorAll(o)).filter(a=>a&&a.textContent&&a.textContent.trim()):[];e?.nodeType===1&&e.matches?.(o)&&e.textContent&&e.textContent.trim()&&s.unshift(e);let i=0;for(let a=0;a<r.length;a++){let c=r[a],f=n&&n.get(c)||s[a]||null;try{let l=getComputedStyle(f||c),d=l.fontFamily||"Material Icons";if(!Zi(d))continue;let u=(f||c).textContent.trim();if(!u)continue;let p=parseInt(l.fontSize,10)||24,h=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",m=ns(l),y=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",b=(f||c).className||"",{dataUrl:S,width:C,height:g}=await os(u,{family:d,weight:h,fontSize:p,color:m,variation:y,className:b});c.textContent="";let w=c.ownerDocument.createElement("img");w.src=S,w.alt=u,w.style.height=`${p}px`,w.style.width=`${Math.max(1,Math.round(C/g*p))}px`,w.style.objectFit="contain",w.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(w),i++}catch{}}return i}wt();async function yo(t,e,n,o=32,r="#000"){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let i=document.createElement("span");i.setAttribute("data-snapdom-internal",""),i.textContent=t,i.style.position="absolute",i.style.visibility="hidden",i.style.fontFamily=`"${e}"`,i.style.fontWeight=n||"normal",i.style.fontSize=`${o}px`,i.style.lineHeight="1",i.style.whiteSpace="nowrap",i.style.padding="0",i.style.margin="0",document.body.appendChild(i);let a=i.getBoundingClientRect(),c=Math.ceil(a.width),f=Math.ceil(a.height);document.body.removeChild(i);let l=document.createElement("canvas");l.width=Math.max(1,c*s),l.height=Math.max(1,f*s);let d=l.getContext("2d");return d.scale(s,s),d.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=r,d.fillText(t,0,0),{dataUrl:l.toDataURL(),width:c,height:f}}var bo=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),rs=["katex","mathjax","mathml"];function on(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!bo.has(n.toLowerCase()))return n}return""}function is(t){if(!t)return[];let e=[];for(let n of t.split(",")){let o=n.trim().replace(/^['"]+|['"]+$/g,"");o&&(bo.has(o.toLowerCase())||e.push(o))}return e}function Me(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 Ee(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function ss(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function as(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let r=Me(n[1]),s=Me(n[2]);return{min:Math.min(r,s),max:Math.max(r,s)}}let o=Me(e);return{min:o,max:o}}function cs(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function ls(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let s=parseFloat(n[1]),i=parseFloat(n[2]);return{min:Math.min(s,i),max:Math.max(s,i)}}let o=e.match(/(\d+(?:\.\d+)?)\s*%/),r=o?parseFloat(o[1]):100;return{min:r,max:r}}function fs(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function us(t,e,n=[]){if(!t)return!1;try{let o=new URL(t,location.href);if(o.origin===location.origin)return!0;let s=o.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=>s.endsWith(c))||n.some(c=>s===c.toLowerCase()||s.endsWith("."+c.toLowerCase())))return!0;let a=(o.pathname+o.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||rs.some(c=>a.includes(c)))return!0;for(let c of e){let f=c.toLowerCase().replace(/\s+/g,"+"),l=c.toLowerCase().replace(/\s+/g,"-"),d=fs(c);if(a.includes(f)||a.includes(l)||d&&a.includes(d))return!0}return!1}catch{return!1}}function ds(t){let e=new Set;for(let n of t||[]){let o=String(n).split("__")[0]?.trim();o&&e.add(o)}return e}function mo(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,o,r)=>{let s=(r||"").trim();if(!s||/^data:|^blob:|^https?:|^file:|^about:/i.test(s))return n;let i=s;try{i=new URL(s,e||location.href).href}catch{}return`url("${i}")`})}var en=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Fe=4;async function ps(t,e,n){if(!t)return t;let o=new Set;function r(a,c){try{return new URL(a,c||location.href).href}catch{return a}}async function s(a,c,f=0){if(f>Fe)return console.warn(`[snapDOM] @import depth exceeded (${Fe}) at ${c}`),a;let l="",d=0,u;for(;u=en.exec(a);){l+=a.slice(d,u.index),d=en.lastIndex;let p=(u[2]||u[4]||"").trim(),h=r(p,c);if(o.has(h)){console.warn(`[snapDOM] Skipping circular @import: ${h}`);continue}o.add(h);let m="";try{let y=await j(h,{as:"text",useProxy:n,silent:!0});y.ok&&typeof y.data=="string"&&(m=y.data)}catch{}m?(m=mo(m,h),m=await s(m,h,f+1),l+=`
12
12
  /* inlined: ${h} */
13
13
  ${m}
14
- `):l+=u[0]}return l+=a.slice(d),l}let i=fo(t,e||location.href);return i=await s(i,e||location.href,0),i}var go=/url\((["']?)([^"')]+)\1\)/g,ss=/@font-face[^{}]*\{[^}]*\}/g;function st(t,e,n=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function yo(t){if(!t)return[];let e=[],n=t.split(",").map(o=>o.trim()).filter(Boolean);for(let o of n){let r=o.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!r)continue;let s=r[1],i=r[2],a=c=>{if(!c.includes("?"))return parseInt(c,16);let f=parseInt(c.replace(/\?/g,"0"),16),l=parseInt(c.replace(/\?/g,"F"),16);return[f,l]};if(i){let c=a(s),f=a(i),l=Array.isArray(c)?c[0]:c,d=Array.isArray(f)?f[1]:f;e.push([Math.min(l,d),Math.max(l,d)])}else{let c=a(s);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function bo(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[o,r]of e)if(n>=o&&n<=r)return!0;return!1}function on(t,e){let n=[];if(!t)return n;for(let o of t.matchAll(go)){let r=(o[2]||"").trim();if(!(!r||r.startsWith("data:"))){if(!/^https?:/i.test(r))try{r=new URL(r,e||location.href).href}catch{}n.push(r)}}return n}async function en(t,e,n=""){let o=t;for(let r of t.matchAll(go)){let s=Mt(r[0]);if(!s)continue;let i=s;if(!i.startsWith("http")&&!i.startsWith("data:"))try{i=new URL(i,e||location.href).href}catch{}if(!ct(i)){if(x.resource?.has(i)){x.font?.add(i),o=o.replace(r[0],`url(${x.resource.get(i)})`);continue}try{let a=await j(i,{as:"dataURL",useProxy:n,silent:!0});if(a.ok&&typeof a.data=="string"){let c=a.data;x.resource?.set(i,c),x.font?.add(i),o=o.replace(r[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",i)}}}return o}function as(t){if(!t.length)return null;let e=(a,c)=>t.some(([f,l])=>!(l<a||f>c)),n=e(0,255)||e(305,305),o=e(256,591)||e(7680,7935),r=e(880,1023),s=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":s?"cyrillic":r?"greek":o?"latin-ext":n?"latin":null}function uo(t={}){let e=new Set((t.families||[]).map(r=>String(r).toLowerCase())),n=new Set((t.domains||[]).map(r=>String(r).toLowerCase())),o=new Set((t.subsets||[]).map(r=>String(r).toLowerCase()));return(r,s)=>{if(e.size&&e.has(r.family.toLowerCase()))return!0;if(n.size)for(let i of r.srcUrls)try{if(n.has(new URL(i).host.toLowerCase()))return!0}catch{}if(o.size){let i=as(s);if(i&&o.has(i))return!0}return!1}}function cs(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,o=[];for(let s of t.match(e)||[]){let i=st(s,"font-family"),a=nn(i),c=st(s,"font-weight","400"),f=st(s,"font-style","normal"),l=st(s,"font-stretch","100%"),d=st(s,"unicode-range"),u=st(s,"src"),p=on(u,location.href),h=p.length?p.map(y=>String(y).toLowerCase()).sort().join("|"):u.toLowerCase(),m=[String(a||"").toLowerCase(),c,f,l,d.toLowerCase(),h].join("|");n.has(m)||(n.add(m),o.push(s))}if(o.length===0)return t;let r=0;return t.replace(e,()=>o[r++]||"")}var po=new WeakMap,ls=0;function fs(t){let e=po.get(t);return e===void 0&&(e=ls++,po.set(t,e)),e}function us(t,e,n,o,r,s){let i=Array.from(t||[]).sort().join("|"),a=e?JSON.stringify({families:(e.families||[]).map(u=>String(u).toLowerCase()).sort(),domains:(e.domains||[]).map(u=>String(u).toLowerCase()).sort(),subsets:(e.subsets||[]).map(u=>String(u).toLowerCase()).sort()}):"",c=(n||[]).map(u=>`${(u.family||"").toLowerCase()}::${u.weight||"normal"}::${u.style||"normal"}::${u.src||""}`).sort().join("|"),f=o||"",l=(r||[]).map(u=>String(u).toLowerCase()).sort().join("|"),d=fs(s||document);return`fonts-embed-css::req=${i}::ex=${a}::lf=${c}::px=${f}::fd=${l}::doc=${d}`}async function wo(t,e,n,o){let r;try{r=t.cssRules||[]}catch{return}let s=(i,a)=>{try{return new URL(i,a||location.href).href}catch{return i}};for(let i of r){if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){let a=i.href?s(i.href,e):e;if(o.depth>=$e){console.warn(`[snapDOM] CSSOM import depth exceeded (${$e}) at ${a}`);continue}if(a&&o.visitedSheets.has(a)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${a}`);continue}a&&o.visitedSheets.add(a);let c={...o,depth:(o.depth||0)+1};await wo(i.styleSheet,a,n,c);continue}if(i.type===CSSRule.FONT_FACE_RULE){let a=(i.style.getPropertyValue("font-family")||"").trim(),c=nn(a);if(!c||ct(c))continue;let f=(i.style.getPropertyValue("font-weight")||"").trim(),l=(i.style.getPropertyValue("font-style")||"").trim(),d=(i.style.getPropertyValue("font-stretch")||"").trim(),u=(i.style.getPropertyValue("font-variation-settings")||"").trim(),p=(i.style.getPropertyValue("src")||"").trim(),h=(i.style.getPropertyValue("unicode-range")||"").trim(),m=f||"400",y=l||"normal",b=d||"100%",S=(l?`font-style:${l};`:"")+(f?`font-weight:${f};`:"")+(d?`font-stretch:${d};`:"")+(u?`font-variation-settings:${u};`:"")+(h?`unicode-range:${h};`:""),C=o.faceMatchesRequired(c,y,m,b);if(!C&&!o.requiredIndex.has(c.toLowerCase()))continue;let g=yo(h);if(!bo(o.usedCodepoints,g))continue;let w={family:c,weightSpec:m,styleSpec:y,stretchSpec:b,unicodeRange:h,srcRaw:p,srcUrls:on(p,e||location.href),href:e||location.href};if(o.simpleExcluder&&o.simpleExcluder(w,g))continue;if(!C){o.provisionalFaces.push({family:c.toLowerCase(),block:`@font-face{font-family:${c};src:${p};${S}}`,srcRaw:p,baseHref:e||location.href});continue}if(o.coveredFamilies.add(c.toLowerCase()),/url\(/i.test(p)){let v=await en(p,e||location.href,o.useProxy);await n(`@font-face{font-family:${c};src:${v};${S}}`)}else await n(`@font-face{font-family:${c};src:${p};${S}}`)}}}async function Fe({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:o=[],useProxy:r="",fontStylesheetDomains:s=[],doc:i=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let a=new Map;for(let g of t){let[w,v,M,A]=String(g).split("__");if(!w)continue;let k=w.toLowerCase(),$=a.get(k)||[];$.push({w:parseInt(v,10),s:M,st:parseInt(A,10)}),a.set(k,$)}function c(g,w,v,M){let A=String(g).toLowerCase();if(!a.has(A))return!1;let k=a.get(A),$=Zi(v),F=ts(w),R=es(M),D=$.min!==$.max,L=$.min,_=H=>F.kind==="normal"&&H==="normal"||F.kind!=="normal"&&(H==="italic"||H==="oblique"),W=!1;for(let H of k){let T=D?H.w>=$.min&&H.w<=$.max:H.w===L,Q=_(Ee(H.s)),et=H.st>=R.min&&H.st<=R.max;if(T&&Q&&et){W=!0;break}}if(W)return!0;if(!D)for(let H of k){let T=_(Ee(H.s)),Q=H.st>=R.min&&H.st<=R.max;if(Math.abs(L-H.w)<=300&&T&&Q)return!0}if(!D&&F.kind==="normal"&&k.some(T=>Ee(T.s)!=="normal"))for(let T of k){let Q=Math.abs(L-T.w)<=300,et=T.st>=R.min&&T.st<=R.max;if(Q&&et)return!0}return!1}let f=uo(n),l=us(t,n,o,r,s,i);if(x.resource?.has(l))return x.resource.get(l);let d=rs(t),u=[],p=tn;for(let g of i.querySelectorAll("style")){let w=g.textContent||"";for(let v of w.matchAll(p)){let M=(v[2]||v[4]||"").trim();if(!M||ct(M))continue;i.querySelector(`link[rel="stylesheet"][href="${M}"]`)||u.push(M)}}let h=[];u.length&&await Promise.all(u.map(g=>new Promise(w=>{if(i.querySelector(`link[rel="stylesheet"][href="${g}"]`))return w(null);let v=i.createElement("link");v.rel="stylesheet",v.href=g,v.setAttribute("data-snapdom","injected-import"),v.onload=()=>w(v),v.onerror=()=>w(null),i.head.appendChild(v),h.push(v)})));let m="",y=new Set,b=[],S=Array.from(i.querySelectorAll('link[rel="stylesheet"]')).filter(g=>!!g.href);for(let g of h)try{g.remove()}catch{}for(let g of S)try{if(ct(g.href))continue;let w="",v=!1;try{v=new URL(g.href,location.href).origin===location.origin}catch{}if(!v){let A=Array.isArray(s)?s:[];if(!os(g.href,d,A))continue}if(v){let A=Array.from(i.styleSheets).find(k=>k.href===g.href);if(A)try{let k=A.cssRules||[];w=Array.from(k).map($=>$.cssText).join("")}catch{}}if(!w){let A=await j(g.href,{as:"text",useProxy:r});if(A?.ok&&typeof A.data=="string"&&(w=A.data),ct(g.href))continue}w=await is(w,g.href,r);let M="";for(let A of w.match(ss)||[]){let k=st(A,"font-family"),$=nn(k);if(!$||ct($))continue;let F=st(A,"font-weight","400"),R=st(A,"font-style","normal"),D=st(A,"font-stretch","100%"),L=st(A,"unicode-range"),_=st(A,"src"),W=on(_,g.href),H=c($,R,F,D);if(!H&&!a.has($.toLowerCase()))continue;let T=yo(L);if(!bo(e,T))continue;let Q={family:$,weightSpec:F,styleSpec:R,stretchSpec:D,unicodeRange:L,srcRaw:_,srcUrls:W,href:g.href};if(n&&f(Q,T))continue;if(!H){b.push({family:$.toLowerCase(),block:A,srcRaw:_,baseHref:g.href});continue}y.add($.toLowerCase());let et=/url\(/i.test(_)?await en(A,g.href,r):A;M+=et}M.trim()&&(m+=M)}catch{console.warn("[snapDOM] Failed to process stylesheet:",g.href)}let C={requiredIndex:a,usedCodepoints:e,faceMatchesRequired:c,coveredFamilies:y,provisionalFaces:b,simpleExcluder:n?uo(n):null,useProxy:r,visitedSheets:new Set,depth:0};for(let g of i.styleSheets)if(!(g.href&&S.some(w=>w.href===g.href)))try{let w=g.href||location.origin+"/";w&&C.visitedSheets.add(w),await wo(g,w,async v=>{m+=v},C)}catch{}for(let g of b)y.has(g.family)||(m+=/url\(/i.test(g.srcRaw)?await en(g.block,g.baseHref,r):g.block);try{for(let g of i.fonts||[]){if(!g||!g.family||g.status!=="loaded"||!g._snapdomSrc)continue;let w=String(g.family).replace(/^['"]+|['"]+$/g,"");if(ct(w)||!a.has(w.toLowerCase())||n?.families&&n.families.some(M=>String(M).toLowerCase()===w.toLowerCase()))continue;let v=g._snapdomSrc;if(!String(v).startsWith("data:")){if(x.resource?.has(g._snapdomSrc))v=x.resource.get(g._snapdomSrc),x.font?.add(g._snapdomSrc);else if(!x.font?.has(g._snapdomSrc))try{let M=await j(g._snapdomSrc,{as:"dataURL",useProxy:r,silent:!0});if(M.ok&&typeof M.data=="string")v=M.data,x.resource?.set(g._snapdomSrc,v),x.font?.add(g._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",g._snapdomSrc);continue}}m+=`@font-face{font-family:'${w}';src:url(${v});font-style:${g.style||"normal"};font-weight:${g.weight||"normal"};}`}}catch{}for(let g of o){if(!g||typeof g!="object")continue;let w=String(g.family||"").replace(/^['"]+|['"]+$/g,"");if(!w||ct(w)||!a.has(w.toLowerCase())||n?.families&&n.families.some(F=>String(F).toLowerCase()===w.toLowerCase()))continue;let v=g.weight!=null?String(g.weight):"normal",M=g.style!=null?String(g.style):"normal",A=g.stretchPct!=null?`${g.stretchPct}%`:"100%",k=String(g.src||""),$=k;if(!$.startsWith("data:")){if(x.resource?.has(k))$=x.resource.get(k),x.font?.add(k);else if(!x.font?.has(k))try{let F=await j(k,{as:"dataURL",useProxy:r,silent:!0});if(F.ok&&typeof F.data=="string")$=F.data,x.resource?.set(k,$),x.font?.add(k);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",k);continue}}m+=`@font-face{font-family:'${w}';src:url(${$});font-style:${M};font-weight:${v};font-stretch:${A};}`}return m&&(m=cs(m),x.resource?.set(l,m)),m}function ee(t,e){let n=new Set,o=new Set;if(!t)return{required:n,usedCodepoints:o};let r=c=>{if(c)for(let f of c)o.add(f.codePointAt(0))},s=c=>{let f=Qi(c.fontFamily);if(f.length)for(let l of f)n.add(`${l}__${Me(c.fontWeight)}__${Ee(c.fontStyle)}__${Ji(c.fontStretch)}`)},i=c=>{s(P(c));for(let f of["::before","::after"]){let l=P(c,f),d=l&&l.content;if(!(!d||d==="none"||d==="normal"))if(s(l),/^["']/.test(d))r(d.slice(1,-1));else{let u=d.match(/\\[0-9A-Fa-f]{1,6}/g);if(u)for(let p of u)try{o.add(parseInt(p.slice(1),16))}catch{}}}};i(t);let a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;a.nextNode();){let c=a.currentNode;if(c.nodeType===Node.TEXT_NODE){if(e&&c.parentElement&&!e(c.parentElement))continue;r(c.nodeValue||"")}else{if(e&&!e(c))continue;i(c)}}return{required:n,usedCodepoints:o}}function xo(t,e){return ee(t,e).required}async function Ut(t,e=2,n=document){try{await n.fonts.ready}catch{}let o=Array.from(t||[]).filter(Boolean);if(o.length===0)return;let r=()=>{let s=n.createElement("div");s.setAttribute("data-snapdom-internal",""),s.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let i of o){let a=n.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${i}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",s.appendChild(a)}n.body.appendChild(s),s.offsetWidth,n.body.removeChild(s)};for(let s=0;s<Math.max(1,e);s++)r(),await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i)))}function Ao(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function So(t,e=!1){let n="",o=Math.max(1,t);for(;o>0;)o--,n=String.fromCharCode(97+o%26)+n,o=Math.floor(o/26);return e?n.toUpperCase():n}function vo(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"]],o=Math.max(1,Math.min(3999,t)),r="";for(let[s,i]of n)for(;o>=s;)r+=i,o-=s;return e?r:r.toLowerCase()}function Co(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":return So(t,!1);case"upper-alpha":return So(t,!0);case"lower-roman":return vo(t,!1);case"upper-roman":return vo(t,!0);default:return String(t)}}function ko(t){let e=new WeakMap,n=t instanceof Document?t.documentElement:t,o=f=>f&&f.tagName==="LI",r=f=>{let l=0,d=f?.parentElement;if(!d)return 0;for(let u of d.children){if(u===f)break;u.tagName==="LI"&&l++}return l},s=f=>{let l=new Map;for(let[d,u]of f)l.set(d,u.slice());return l},i=(f,l,d)=>{let u=s(f),p;try{p=d.style?.counterReset||getComputedStyle(d).counterReset}catch{}if(p&&p!=="none")for(let y of p.split(",")){let b=y.trim().split(/\s+/),S=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!S)continue;let g=l.get(S);if(g&&g.length){let w=g.slice();w.push(C),u.set(S,w)}else u.set(S,[C])}let h;try{h=d.style?.counterSet||getComputedStyle(d).counterSet}catch{}if(h&&h!=="none")for(let y of h.split(",")){let b=y.trim().split(/\s+/),S=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!S)continue;let g=u.get(S)||[];g.length===0&&g.push(0),g[g.length-1]=C,u.set(S,g)}let m;try{m=d.style?.counterIncrement||getComputedStyle(d).counterIncrement}catch{}if(m&&m!=="none")for(let y of m.split(",")){let b=y.trim().split(/\s+/),S=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):1;if(!S)continue;let g=u.get(S)||[];g.length===0&&g.push(0),g[g.length-1]+=C,u.set(S,g)}try{if(getComputedStyle(d).display==="list-item"&&o(d)){let b=d.parentElement,S=1;if(b&&b.tagName==="OL"){let g=b.getAttribute("start"),w=Number.isFinite(Number(g))?Number(g):1,v=r(d),M=d.getAttribute("value");S=Number.isFinite(Number(M))?Number(M):w+v}else S=1+r(d);let C=u.get("list-item")||[];C.length===0&&C.push(0),C[C.length-1]=S,u.set("list-item",C)}}catch{}return u},a=(f,l,d)=>{let u=i(d,l,f);e.set(f,u);let p=u;for(let m of f.children)p=a(m,u,p);let h=new Map;for(let[m,y]of d){let b=y.length,S=p.get(m);h.set(m,S&&S.length?S.slice(0,b):y.slice())}for(let[m,y]of p)!h.has(m)&&y.length&&!l.has(m)&&h.set(m,y.slice(0,1));return h},c=new Map;return a(n,c,c),{get(f,l){let d=e.get(f)?.get(l);return d&&d.length?d[d.length-1]:0},getStack(f,l){let d=e.get(f)?.get(l);return d?d.slice():[]}}}function Mo(t,e,n){if(!t||t==="none")return t;try{let o=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(o,(r,s,i)=>{let a=String(i).split(",").map(c=>c.trim());if(s==="counter"){let c=a[0]?.replace(/^["']|["']$/g,""),f=(a[1]||"decimal").toLowerCase(),l=n.get(e,c);return Co(l,f)}else{let c=a[0]?.replace(/^["']|["']$/g,""),f=a[1]?.replace(/^["']|["']$/g,"")??"",l=(a[2]||"decimal").toLowerCase(),d=n.getStack(e,c);return d.length?d.map(p=>Co(p,l)).join(f):""}})}catch{return"- "}}wt();var Dt=new WeakMap,Eo=1e3;function ds(t,e){let n=To(t);return e?(e.__pseudoPreflightFp!==n&&(e.__pseudoPreflight=Fo(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):Fo(t,n)}function rn(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function To(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,o=0;for(let s=0;s<e.length;s++){let i=e[s];if(i.tagName==="STYLE"){let a=i.textContent?i.textContent.length:0;n+=`S${a}|`;let c=i.sheet,f=c?rn(c):null;f&&(o+=f.length)}else{let a=i.getAttribute("href")||"",c=i.getAttribute("media")||"all";n+=`L${a}|m:${c}|`;let f=i.sheet,l=f?rn(f):null;l&&(o+=l.length)}}let r=t.adoptedStyleSheets;return n+=`ass:${Array.isArray(r)?r.length:0}|tr:${o}`,n}function $o(t,e,n){let o=rn(t);if(!o)return!1;for(let r=0;r<o.length;r++){if(n.budget<=0)return!1;let s=o[r],i=s&&s.cssText?s.cssText:"";n.budget--;for(let a of e)if(i.includes(a))return!0;if(s&&s.cssRules&&s.cssRules.length)for(let a=0;a<s.cssRules.length&&n.budget>0;a++){let c=s.cssRules[a],f=c&&c.cssText?c.cssText:"";n.budget--;for(let l of e)if(f.includes(l))return!0}if(n.budget<=0)return!1}return!1}function Fo(t=document,e=To(t)){let n=Dt.get(t);if(n&&n.fingerprint===e)return n.result;let o=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],r=t.querySelectorAll("style");for(let i=0;i<r.length;i++){let a=r[i].textContent||"";for(let c of o)if(a.includes(c))return Dt.set(t,{fingerprint:e,result:!0}),!0}let s=t.adoptedStyleSheets;if(Array.isArray(s)&&s.length){let i={budget:Eo};try{for(let a of s)if($o(a,o,i))return Dt.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let i=t.querySelectorAll('style,link[rel~="stylesheet"]'),a={budget:Eo};for(let c=0;c<i.length&&a.budget>0;c++){let f=i[c],l=null;if(f.tagName,l=f.sheet||null,l&&$o(l,o,a))return Dt.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Dt.set(t,{fingerprint:e,result:!0}),!0):(Dt.set(t,{fingerprint:e,result:!1}),!1)}function Ro(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,o=t[`border${e}Style`];if(n>0&&o&&o!=="none"&&o!=="hidden")return!0}return!1}function ps(t,e){let n=null,o=()=>{if(!n)try{n=ko(t)}catch(r){I(e,"buildCounterContext failed",r),n={get:()=>0,getStack:()=>[]}}return n};return{get(r,s){return o().get(r,s)},getStack(r,s){return o().getStack(r,s)}}}function ms(t){let e=!1;for(let n=0;n<t.length;n++){let o=t[n];if(o==='"')e=!e;else if(o==="/"&&!e)return t.slice(0,n).trim()}return t}function hs(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,o=0,r;for(;r=n.exec(t);){let i=t.slice(o,r.index).trim();i&&e.push(i),e.push(r[1]),o=n.lastIndex}let s=t.slice(o).trim();return s&&e.push(s),e.join("")}function sn(t,e,n){let o=t.parentElement,r=o&&n?n.get(o):null;return r?{get(s,i){let a=e.get(s,i),c=r.get(i);return typeof c=="number"?Math.max(a,c):a},getStack(s,i){let a=e.getStack(s,i);if(!a.length)return a;let c=r.get(i);if(typeof c=="number"){let f=a.slice();return f[f.length-1]=Math.max(f[f.length-1],c),f}return a}}:e}function an(t,e,n){let o=new Map;function r(f){let l=[];if(!f||f==="none")return l;for(let d of String(f).split(",")){let u=d.trim().split(/\s+/),p=u[0],h=Number.isFinite(Number(u[1]))?Number(u[1]):void 0;p&&l.push({name:p,num:h})}return l}let s=r(e?.counterReset),i=r(e?.counterSet),a=r(e?.counterIncrement);function c(f){if(o.has(f))return o.get(f).slice();let l=n.getStack(t,f);l=l.length?l.slice():[];let d=s.find(h=>h.name===f);if(d){let h=Number.isFinite(d.num)?d.num:0;l=l.length?[...l,h]:[h]}let u=i.find(h=>h.name===f);if(u){let h=Number.isFinite(u.num)?u.num:0;l.length===0&&(l=[0]),l[l.length-1]=h}let p=a.find(h=>h.name===f);if(p){let h=Number.isFinite(p.num)?p.num:1;l.length===0&&(l=[0]),l[l.length-1]+=h}return o.set(f,l.slice()),l}return{get(f,l){let d=c(l);return d.length?d[d.length-1]:0},getStack(f,l){return c(l)},__incs:a}}function gs(t,e,n,o){let r;try{r=P(t,e)}catch{}let s=r?.content;if(!s||s==="none"||s==="normal")return{text:"",incs:[]};s=ms(s);let i=sn(t,n,o),a=an(t,r,i),c=Ao(s)?Mo(s,t,a):s;return{text:hs(c),incs:a.__incs||[]}}async function Re(t,e,n,o){if(t?.nodeType!==1||e?.nodeType!==1||t.tagName==="TEXTAREA")return;let r=t.ownerDocument||document;if(!ds(r,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=ps(t.ownerDocument||document,n));let s=n.__counterCtx;for(let a of["::before","::after","::first-letter"])try{let c=P(t,a);if(!c||c.content==="none"&&c.backgroundImage==="none"&&c.backgroundColor==="transparent"&&!Ro(c)&&(!c.transform||c.transform==="none")&&c.display==="inline")continue;if(a==="::first-letter"){let N=P(t),O=(N?.display||"").toLowerCase();if(O.includes("flex")||O.includes("grid"))continue;let U=dt=>c[dt]!==N[dt]&&(parseFloat(c[dt])||0)!==0;if(!(c.color!==N.color||c.fontSize!==N.fontSize||c.fontWeight!==N.fontWeight||c.fontFamily!==N.fontFamily||c.fontStyle!==N.fontStyle||c.textTransform!==N.textTransform||c.float!==N.float&&c.float!=="none"||U("paddingTop")||U("paddingRight")||U("paddingBottom")||U("paddingLeft")||U("marginTop")||U("marginRight")||U("marginBottom")||U("marginLeft")))continue;let G=Array.from(e.childNodes).find(dt=>dt.nodeType===Node.TEXT_NODE&&dt.textContent?.trim().length>0);if(!G)continue;let ft=G.textContent,ut=ft.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],Tt=ft.slice(ut?.length||0);if(!ut||/[\uD800-\uDFFF]/.test(ut))continue;let nt=document.createElement("span");nt.textContent=ut,nt.dataset.snapdomPseudo="::first-letter";let Lt=ye(c),Pt=It(Lt,"span");n.styleMap.set(nt,Pt);let Ct=document.createTextNode(Tt);e.replaceChild(Ct,G),e.insertBefore(nt,Ct);continue}let l=c.content??"",d=l===""||l==="none"||l==="normal",{text:u,incs:p}=gs(t,a,s,n.__siblingCounters),h=c.backgroundImage,m=c.backgroundColor,y=c.fontFamily,b=parseInt(c.fontSize)||32,S=parseInt(c.fontWeight)||!1,C=c.color||"#000",g=c.transform,w=ct(y),v=!d&&u!=="",M=h&&h!=="none",A=m&&m!=="transparent"&&m!=="rgba(0, 0, 0, 0)",k=Ro(c),$=g&&g!=="none",F=l!=="none"&&l!=="normal",R=F&&((parseFloat(c.width)||0)>0||(parseFloat(c.height)||0)>0),D=F&&c.boxShadow&&c.boxShadow!=="none",L=F&&c.outlineStyle&&c.outlineStyle!=="none"&&(parseFloat(c.outlineWidth)||0)>0;if(!(v||M||A||k||$||R||D||L)){if(p&&p.length&&t.parentElement){let N=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:O}of p){if(!O)continue;let U=sn(t,s,n.__siblingCounters),G=an(t,P(t,a),U).get(t,O);N.set(O,G)}n.__siblingCounters.set(t.parentElement,N)}continue}let W=u.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(u),H=!1;if(v&&!w&&u.length>1&&!W){let N=P(t),O=parseFloat(N.fontSize)||16,U=parseFloat(N.lineHeight);Number.isFinite(U)||(U=O*1.5),t.getBoundingClientRect().height<U*1.6&&(e.style.whiteSpace="nowrap",H=!0)}let T=document.createElement("span");T.dataset.snapdomPseudo=a,T.style.pointerEvents="none",H&&(T.style.whiteSpace="nowrap");let Q=ye(c),et=(P(t).display||"").toLowerCase(),pt=et.includes("flex")||et.includes("grid");if(pt){let N=Q["min-width"];(!N||N==="auto"||N==="0px")&&(Q["min-width"]="0px")}let mt=It(Q,"span",v,pt);if(n.styleMap.set(T,mt),w&&u&&u.length===1){let{dataUrl:N,width:O,height:U}=await mo(u,y,S,b,C),z=document.createElement("img");z.src=N,z.style=`height:${b}px;width:${O/U*b}px;object-fit:contain;`,T.appendChild(z),e.dataset.snapdomHasIcon="true"}else if(u&&W){let N=Xt(u,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Mt(u);if(N?.trim())try{let O=await j(bt(N),{as:"dataURL",useProxy:o.useProxy});if(O?.ok&&typeof O.data=="string"){let U=document.createElement("img");U.src=O.data,U.style=`width:${b}px;height:auto;object-fit:contain;`,T.appendChild(U)}}catch(O){console.error(`[snapdom] Error in pseudo ${a} for`,t,O)}}else!w&&v&&(T.textContent=u);T.style.backgroundImage="none","maskImage"in T.style&&(T.style.maskImage="none"),"webkitMaskImage"in T.style&&(T.style.webkitMaskImage="none");try{T.style.backgroundRepeat=c.backgroundRepeat,T.style.backgroundSize=c.backgroundSize,c.backgroundPositionX&&c.backgroundPositionY?(T.style.backgroundPositionX=c.backgroundPositionX,T.style.backgroundPositionY=c.backgroundPositionY):T.style.backgroundPosition=c.backgroundPosition,T.style.backgroundOrigin=c.backgroundOrigin,T.style.backgroundClip=c.backgroundClip,T.style.backgroundAttachment=c.backgroundAttachment,T.style.backgroundBlendMode=c.backgroundBlendMode}catch{}if(M)try{let N=_t(h),O=await Promise.all(N.map(Et));T.style.backgroundImage=O.join(", ")}catch(N){console.warn(`[snapdom] Failed to inline background-image for ${a}`,N)}A&&(T.style.backgroundColor=m);let ht=T.childNodes.length>0||T.textContent?.trim()!==""||M||A||k||$||R||D||L;if(p&&p.length&&t.parentElement){let N=n.__siblingCounters.get(t.parentElement)||new Map,O=sn(t,s,n.__siblingCounters),U=an(t,P(t,a),O);for(let{name:z}of p){if(!z)continue;let G=U.get(t,z);N.set(z,G)}n.__siblingCounters.set(t.parentElement,N)}if(!ht)continue;a==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(T,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(T))}catch(c){console.warn(`[snapdom] Failed to capture ${a} for`,t,c)}let i=Array.from(e.children).filter(a=>!a.dataset.snapdomPseudo);if(n.nodeMap)for(let a of i){let c=n.nodeMap.get(a);c?.nodeType===1&&await Re(c,a,n,o)}else{let a=Array.from(t.children);for(let c=0;c<Math.min(a.length,i.length);c++)await Re(a[c],i[c],n,o)}}function Lo(t,e){if(!t||t?.nodeType!==1)return;let n=t.ownerDocument||document,o=e||n,r=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(r.length===0)return;let s=/url\(\s*#([^)]+)\)/g,i=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],a=g=>window.CSS&&CSS.escape?CSS.escape(g):g.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c="http://www.w3.org/1999/xlink",f=g=>{if(!g||!g.getAttribute)return null;let w=g.getAttribute("href")||g.getAttribute("xlink:href")||(typeof g.getAttributeNS=="function"?g.getAttributeNS(c,"href"):null);if(w)return w;let v=g.attributes;if(!v)return null;for(let M=0;M<v.length;M++){let A=v[M];if(!A||!A.name)continue;if(A.name==="href")return A.value;let k=A.name.indexOf(":");if(k!==-1&&A.name.slice(k+1)==="href")return A.value}return null},l=new Set(Array.from(t.querySelectorAll("[id]")).map(g=>g.id)),d=new Set,u=!1,p=(g,w=null)=>{if(!g)return;s.lastIndex=0;let v;for(;v=s.exec(g);){u=!0;let M=(v[1]||"").trim();M&&(l.has(M)||(d.add(M),w&&!w.has(M)&&w.add(M)))}},h=g=>{let w=g.querySelectorAll("use");for(let A of w){let k=f(A);if(!k||!k.startsWith("#"))continue;u=!0;let $=k.slice(1).trim();$&&!l.has($)&&d.add($)}let v='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';p(g.getAttribute("style")||"");for(let A of i)p(g.getAttribute(A));let M=g.querySelectorAll(v);for(let A of M){p(A.getAttribute("style")||"");for(let k of i)p(A.getAttribute(k))}};for(let g of r)h(g);if(!u)return;let m=t.querySelector("svg.inline-defs-container");m||(m=n.createElementNS("http://www.w3.org/2000/svg","svg"),m.classList.add("inline-defs-container"),m.setAttribute("aria-hidden","true"),m.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(m,t.firstChild||null));let y=m.querySelector("defs")||null,b=g=>{if(!g||l.has(g))return null;let w=a(g),v=M=>{let A=o.querySelector(M);return A&&!t.contains(A)?A:null};return v(`svg defs > *#${w}`)||v(`svg > symbol#${w}`)||v(`*#${w}`)};if(!d.size)return;let S=new Set(d),C=new Set;for(;S.size;){let g=S.values().next().value;if(S.delete(g),!g||l.has(g)||C.has(g))continue;let w=b(g);if(!w){C.add(g);continue}y||(y=n.createElementNS("http://www.w3.org/2000/svg","defs"),m.appendChild(y));let v=w.cloneNode(!0);v.id||v.setAttribute("id",g),y.appendChild(v),C.add(g),l.add(g);let M=[v,...v.querySelectorAll("*")];for(let A of M){let k=f(A);if(k&&k.startsWith("#")){let F=k.slice(1).trim();F&&!l.has(F)&&!C.has(F)&&S.add(F)}let $=A.getAttribute?.("style")||"";$&&p($,S);for(let F of i){let R=A.getAttribute?.(F);R&&p(R,S)}}}}tt();function Po(t){let e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,r=e.borderStyle,s=e.borderWidth,i=n!=="none"&&parseFloat(o)>0,a=r==="none"||parseFloat(s)===0;if(i&&a){let c=t.style.border;return t.style.border=`${o} solid transparent`,()=>{t.style.border=c}}return()=>{}}function No(t){let e=[];try{let n=t.querySelectorAll("*");for(let o of n){if(!(o instanceof HTMLElement))continue;let r=o.style.contentVisibility||"",s=getComputedStyle(o);(s.contentVisibility||s.getPropertyValue("content-visibility")||"")==="auto"&&(e.push({el:o,original:r}),o.style.contentVisibility="visible")}if(t instanceof HTMLElement){let o=getComputedStyle(t);(o.contentVisibility||o.getPropertyValue("content-visibility")||"")==="auto"&&(e.push({el:t,original:t.style.contentVisibility||""}),t.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:n,original:o}of e)try{n.style.contentVisibility=o}catch{}}}rt();Kt();function Io(t){return Wo(t.boxShadow)}function _o(t){return Wo(t.textShadow)}function Wo(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",o=0;for(let c=0;c<t.length;c++){let f=t[c];f==="("?o++:f===")"&&(o=Math.max(0,o-1)),f===","&&o===0?(e.push(n),n=""):n+=f}n.trim()&&e.push(n);let r=0,s=0,i=0,a=0;for(let c of e){if(/\binset\b/i.test(c))continue;let f=c.match(/-?\d+(\.\d+)?px/g)?.map(y=>parseFloat(y))||[];if(f.length<2)continue;let[l,d,u=0,p=0]=f,h=Math.abs(l)+u+p,m=Math.abs(d)+u+p;s=Math.max(s,h+Math.max(l,0)),a=Math.max(a,h+Math.max(-l,0)),i=Math.max(i,m+Math.max(d,0)),r=Math.max(r,m+Math.max(-d,0))}return{top:Math.ceil(r),right:Math.ceil(s),bottom:Math.ceil(i),left:Math.ceil(a)}}function Oo(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,o=0,r;for(;r=n.exec(e);)o+=parseFloat(r[1])||0;let s=Math.ceil(o);return{top:s,right:s,bottom:s,left:s}}function Bo(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,o=e+Math.max(0,Math.ceil(n));return{top:o,right:o,bottom:o,left:o}}function Uo(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],o=0,r=0,s=0,i=0,a=!1;for(let c of n){a=!0;let f=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(m=>parseFloat(m))||[],[l=0,d=0,u=0]=f,p=Math.abs(l)+u,h=Math.abs(d)+u;r=Math.max(r,p+Math.max(l,0)),i=Math.max(i,p+Math.max(-l,0)),s=Math.max(s,h+Math.max(d,0)),o=Math.max(o,h+Math.max(-d,0))}return{bleed:{top:E(o),right:E(r),bottom:E(s),left:E(i)},has:a}}function Do(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let o=n.transform||"none";if(!o||o==="none"){let a=null;try{a=zt(t).scale}catch{}try{e.style.transform="none"}catch{}if(!a)return{a:1,b:0,c:0,d:1};let c=a.trim().split(/\s+/).map(parseFloat),f=Number.isFinite(c[0])?c[0]:1,l=Number.isFinite(c[1])?c[1]:f;return{a:f,b:0,c:0,d:l}}function r(a,c,f,l){let d=Math.sqrt(a*a+c*c)||0,u=0,p=0;if(d>0){let h=a/d,m=c/d;u=h*f+m*l;let y=f-h*u,b=l-m*u;p=Math.sqrt(y*y+b*b)||0,p>0?u=u/p:u=0}return{a:d,b:0,c:u*p,d:p}}let s=o.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let a=s[1].split(",").map(c=>parseFloat(c.trim()));if(a.length===6&&a.every(Number.isFinite)){let[c,f,l,d]=a,u=r(c,f,l,d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return u}}let i=o.match(/^matrix3d\(\s*([^)]+)\)$/i);if(i){let a=i[1].split(",").map(c=>parseFloat(c.trim()));if(a.length===16&&a.every(Number.isFinite)){let c=a[0],f=a[1],l=a[4],d=a[5],u=r(c,f,l,d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return u}}try{let a=new DOMMatrix(o),c=r(a.a,a.b,a.c,a.d);try{e.style.transform=`matrix(${c.a}, ${c.b}, ${c.c}, ${c.d}, 0, 0)`}catch{}return c}catch{return null}}function Ht(t,e,n,o,r){let s=n.a,i=n.b,a=n.c,c=n.d,f=n.e||0,l=n.f||0;function d(b,S){let C=b-o,g=S-r,w=s*C+a*g,v=i*C+c*g;return w+=o+f,v+=r+l,[w,v]}let u=[d(0,0),d(t,0),d(0,e),d(t,e)],p=1/0,h=1/0,m=-1/0,y=-1/0;for(let[b,S]of u)b<p&&(p=b),S<h&&(h=S),b>m&&(m=b),S>y&&(y=S);return{minX:p,minY:h,maxX:m,maxY:y,width:m-p,height:y-h}}function ne(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[r,s]=[o[0]||"0",o[1]||"0"],i=(a,c)=>{let f=a.toLowerCase();return f==="left"||f==="top"?0:f==="center"?c/2:f==="right"||f==="bottom"?c:f.endsWith("px")?parseFloat(f)||0:f.endsWith("%")?(parseFloat(f)||0)*c/100:/^-?\d+(\.\d+)?$/.test(f)&&parseFloat(f)||0};return{ox:i(r,e),oy:i(s,n)}}function zt(t){let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let r=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},s=r("rotate");if(s)if(s.angle){let c=s.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else s.unit?e.rotate=s.unit==="rad"?s.value*180/Math.PI+"deg":s.value+s.unit:e.rotate=String(s);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let i=r("scale");if(i){let c="x"in i&&i.x?.value!=null?i.x.value:Array.isArray(i)?i[0]?.value:Number(i)||1,f="y"in i&&i.y?.value!=null?i.y.value:Array.isArray(i)?i[1]?.value:c;e.scale=`${c} ${f}`}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let a=r("translate");if(a){let c="x"in a&&"value"in a.x?a.x.value:Array.isArray(a)?a[0]?.value:0,f="y"in a&&"value"in a.y?a.y.value:Array.isArray(a)?a[1]?.value:0,l="x"in a&&a.x?.unit?a.x.unit:"px",d="y"in a&&a.y?.unit?a.y.unit:"px";e.translate=`${c}${l} ${f}${d}`}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return e}let o=getComputedStyle(t);return e.rotate=o.rotate&&o.rotate!=="none"?o.rotate:"0deg",e.scale=o.scale&&o.scale!=="none"?o.scale:null,e.translate=o.translate&&o.translate!=="none"?o.translate:null,e}var cn=null;function ys(){if(cn)return cn;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),cn=t,t}function Ho(t){let e=ys(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform),t.rotate&&(n.style.rotate=t.rotate),t.scale&&(n.style.scale=t.scale),t.translate&&(n.style.translate=t.translate),e.appendChild(n);let o=bs(n);return e.removeChild(n),o}function zo(t){let e=P(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",s=e.scale&&e.scale!=="none"&&e.scale!=="1",i=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(r||s||i)}function bs(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}function Te(t,e){if(!e)return null;let n=t.ownerDocument||document,o=n.defaultView||window,r,s,i,a;if(e==="viewport")r=0,s=0,i=n.documentElement?.clientWidth||o.innerWidth,a=n.documentElement?.clientHeight||o.innerHeight;else if(typeof e=="object")r=(Number(e.x)||0)-(o.scrollX||0),s=(Number(e.y)||0)-(o.scrollY||0),i=Number(e.width),a=Number(e.height);else return null;return i>0&&a>0?{left:r,top:s,width:i,height:a,right:r+i,bottom:s+a}:null}function ln(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return e instanceof ShadowRoot?e.host:null}function ws(t,e){for(let n=e;n;n=ln(n))if(n===t)return!0;return!1}function xs(t,e){for(let n=ln(t);n&&n!==e&&n?.nodeType===1;n=ln(n)){let o=P(n);if(o.position!=="static"||o.transform&&o.transform!=="none"||o.filter&&o.filter!=="none"||o.backdropFilter&&o.backdropFilter!=="none"||o.perspective&&o.perspective!=="none"||/transform|perspective|filter/.test(o.willChange||"")||/layout|paint|strict|content/.test(o.contain||""))return n}return null}function un(t,e){try{let n=new DOMMatrix;if(e&&e.rotate&&e.rotate!=="0deg"&&(n=n.multiply(new DOMMatrix(`rotate(${e.rotate})`))),e&&e.scale){let o=String(e.scale).trim().split(/\s+/).filter(Boolean);o.length&&o.every(r=>Number.isFinite(Number(r)))&&(n=n.multiply(new DOMMatrix(`scale(${o.join(",")})`)))}return t&&(n=n.multiply(new DOMMatrix(t))),n}catch{return null}}function Go(t,e,n,o,r){let s=t.getBoundingClientRect();e instanceof HTMLElement&&P(t).position==="static"&&(e.style.position="relative");let i=[];for(let[a,c]of n){if(!(a instanceof HTMLElement)||c?.nodeType!==1||c===t||!ws(t,c))continue;let f=o.get(c)||P(c),l=f.position;if(l!=="fixed"&&l!=="sticky"&&l!=="-webkit-sticky"||a.style.position==="absolute")continue;let d=c.getBoundingClientRect();if(!(d.width>0&&d.height>0))continue;let u=f.transform&&f.transform!=="none"?f.transform:"",p=zt(c),h=!!(u||p.rotate!=="0deg"||p.scale||p.translate),m=h?un(u,p):null,y=!m||!m.is2D||m.a===1&&m.b===0&&m.c===0&&m.d===1,b=d.width,S=d.height;y||(b=c.offsetWidth||d.width,S=c.offsetHeight||d.height);let C=c.getRootNode&&c.getRootNode()instanceof ShadowRoot,g=s,w=t.clientLeft||0,v=t.clientTop||0;if(C){let F=xs(c,t);F&&(g=F.getBoundingClientRect(),w=F.clientLeft||0,v=F.clientTop||0)}let M=d.left-g.left-w,A=d.top-g.top-v;if(h)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",y)a.style.transform="none";else{a.style.transform=`matrix(${m.a},${m.b},${m.c},${m.d},0,0)`;let{ox:F,oy:R}=ne(f,b,S),D=Ht(b,S,{a:m.a,b:m.b,c:m.c,d:m.d,e:0,f:0},F,R);M-=D.minX,A-=D.minY}if(l!=="fixed"){let F=a.cloneNode(!1);F.setAttribute("data-snap-ph","1"),F.style.position="static",F.style.visibility="hidden",F.style.width=`${b}px`,F.style.height=`${S}px`,F.style.boxSizing="border-box",a.parentElement?.insertBefore(F,a)}let k=b+2,$=S;r&&(Math.abs(A-r.y)<.5&&(A-=1,$+=1),Math.abs(M-r.x)<.5&&(M-=1,k+=1)),a.style.position="absolute",a.style.left=`${M}px`,a.style.top=`${A}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${k}px`,a.style.height=`${$}px`,a.style.boxSizing="border-box",C||i.push(a)}for(let a of i)e.appendChild(a)}function Yo(t,e,n={}){if(!t||!e||!e.style)return;let o=getComputedStyle(t);try{e.style.boxShadow="none"}catch(i){I(n,"stripRootShadows boxShadow",i)}try{e.style.textShadow="none"}catch(i){I(n,"stripRootShadows textShadow",i)}try{e.style.outline="none"}catch(i){I(n,"stripRootShadows outline",i)}let s=(o.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=s.length?s:"none"}catch(i){I(n,"stripRootShadows filter",i)}}function Vo(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",o=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||o!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function Ss(t,e){let n=Array.from(t.childNodes),o=e==="top"?n:n.reverse();for(let r of o){if(r.nodeType===Node.TEXT_NODE){if(/\S/.test(r.textContent||""))return null;continue}if(r.nodeType!==Node.ELEMENT_NODE)continue;let s=getComputedStyle(r),i=String(s.display||"");if(!(i==="none"||i==="contents")&&!(s.position==="absolute"||s.position==="fixed"))return s.float&&s.float!=="none"||i.startsWith("inline")?null:r}return null}function Ko(t,e,n){if(!t||!e||!e.style)return;let o=getComputedStyle(t);if(!Vo(o))for(let r of["top","bottom"]){let s=r==="top"?"Top":"Bottom";if((parseFloat(o[`border${s}Width`])||0)>0||(parseFloat(o[`padding${s}`])||0)>0)continue;let i=t,a=e;for(;i&&a;){let c=Ss(i,r);if(!c)break;let f=n?Array.from(a.children).find(u=>n.get(u)===c)||null:a.children[Array.from(i.children).indexOf(c)]||null,l=getComputedStyle(c),d=parseFloat(l[`margin${s}`])||0;if(f&&f.style&&d>0&&(f.style[`margin${s}`]="0px"),Vo(l)||(parseFloat(l[`border${s}Width`])||0)>0||(parseFloat(l[`padding${s}`])||0)>0)break;i=c,a=f}}}function vs(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),n=[];for(;e.nextNode();)n.push(e.currentNode);for(let o of n)o.remove()}function Cs(t,e={}){let{stripFrameworkDirectives:n=!0}=e,o=new Set(["xml","xlink"]),r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;r.nextNode();){let s=r.currentNode;for(let i of Array.from(s.attributes)){let a=i.name;if(a.startsWith("*")){s.removeAttribute(a);continue}if(a.includes("@")){s.removeAttribute(a);continue}if(a.includes(":")){let c=a.split(":",1)[0];if(!o.has(c)){s.removeAttribute(a);continue}}if(n&&(a.startsWith("x-")||a.startsWith("v-")||a.startsWith(":")||a.startsWith("on:")||a.startsWith("bind:")||a.startsWith("let:")||a.startsWith("class:"))){s.removeAttribute(a);continue}}}}var jo=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function As(t){if(!t)return;let e=r=>{if(r.nodeType===Node.ELEMENT_NODE){if(r.attributes)for(let s of Array.from(r.attributes)){let i=s.value.replace(jo,"");if(i!==s.value)try{r.setAttribute(s.name,i)}catch{}}}else if(r.nodeType===Node.TEXT_NODE||r.nodeType===Node.CDATA_SECTION_NODE){let s=r.data.replace(jo,"");s!==r.data&&(r.data=s)}};e(t);let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),o;for(;o=n.nextNode();)e(o)}function Qo(t,e={}){t&&(Cs(t,e),vs(t),As(t))}function ks(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function Ms(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Es(t,e){if(t?.nodeType!==1||ks(t)||Ms(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let o=e.display||"";return!(o.includes("flex")||o.includes("grid")||o.startsWith("table")||e.transform&&e.transform!=="none")}function Jo(t,e,n=new Map){function o(r,s){if(r?.nodeType!==1||s?.nodeType!==1)return;let i=r.childElementCount>s.childElementCount,a=n.get(r)||getComputedStyle(r);if(n.has(r)||n.set(r,a),i&&Es(r,a)){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=a.overflowY||a.overflowBlock||"visible",d=a.overflowX||a.overflowInline||"visible";(l!=="visible"||d!=="visible")&&(s.style.overflow="visible")}let c=Array.from(r.children),f=Array.from(s.children);for(let l=0;l<Math.min(c.length,f.length);l++)o(c[l],f[l])}o(t,e)}function $s(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function Fs(t,e){if(t?.nodeType!==1)return!1;if(t.getAttribute("data-capture")==="exclude"&&e?.excludeMode==="remove")return!0;if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch(o){I(e,"exclude selector match failed",o)}if(typeof e?.filter=="function"&&e.filterMode==="remove")try{if(!e.filter(t))return!0}catch(n){I(e,"filter function failed",n)}return!1}function Zo(t,e){let n=getComputedStyle(t),o=t.getBoundingClientRect(),r=1/0,s=-1/0,i=!1,a=Array.from(t.children);for(let p of a){if(Fs(p,e)||!$s(p))continue;let h=p.getBoundingClientRect(),m=h.top-o.top,y=h.bottom-o.top;y<=m||(m<r&&(r=m),y>s&&(s=y),i=!0)}let c=i?Math.max(0,s-r):0,f=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,u=parseFloat(n.paddingBottom)||0;return f+l+d+u+c}var E=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,qo=.75;function tr(t,e,n,o,r,s){let i=t.ownerDocument||document,a=t.getBoundingClientRect(),c=r>0&&a.width>0?a.width/r:1,f=s>0&&a.height>0?a.height/s:1;if(Math.abs(c-f)>.02)return 0;let l=i.createElement("div");l.setAttribute("data-snapdom-internal",""),l.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+r+"px!important;overflow:visible!important;visibility:hidden!important;";let d=l.attachShadow({mode:"open"}),u=i.createElement("style");u.textContent=n,d.appendChild(u);let p=e.cloneNode(!0);d.appendChild(p),i.body.appendChild(l);let h=0;try{let m=(y,b)=>{let S=y.children,C=b.children,g=Math.min(S.length,C.length);for(let w=0;w<g;w++){let v=S[w],M=C[w],A=o.get(v);if(A?.nodeType===1&&v instanceof HTMLElement&&A.isConnected){let k=A.getBoundingClientRect();if(k.width>0&&k.height>0){let $=M.getBoundingClientRect(),F=$.width-k.width/c,R=$.height-k.height/f;(Math.abs(F)>qo||Math.abs(R)>qo)&&(v.style.boxSizing="border-box",v.style.width=`${E(k.width/c)}px`,v.style.height=`${E(k.height/f)}px`,h++)}}m(v,M)}};m(e,p)}finally{l.remove()}return h}var Rs=/::-webkit-scrollbar(-[a-z]+)?\b/i;function fn(t,e=new Set){let n="";if(!t)return n;for(let o=0;o<t.length;o++){let r=t[o];try{if(r.type===CSSRule.IMPORT_RULE&&r.styleSheet){n+=fn(r.styleSheet.cssRules,e);continue}if(r.type===CSSRule.MEDIA_RULE&&r.cssRules){let s=fn(r.cssRules,e);s&&(n+=`@media ${r.conditionText}{${s}}`);continue}if(r.type===CSSRule.STYLE_RULE){let s=r.selectorText||"";if(Rs.test(s)){let i=r.cssText;i&&!e.has(i)&&(e.add(i),n+=i)}}}catch{}}return n}var Xo=new WeakMap;function Ts(t){let e="";for(let n of t.styleSheets){let o=-1;try{o=n.cssRules?n.cssRules.length:-1}catch{}e+=(n.href||"inline")+":"+o+"|"}return e}function er(t){if(!t||!t.styleSheets)return"";let e=Ts(t),n=Xo.get(t);if(n&&n.fp===e)return n.css;let o=new Set,r="";for(let s of Array.from(t.styleSheets))try{let i=s.cssRules;i&&(r+=fn(i,o))}catch{}return Xo.set(t,{fp:e,css:r}),r}async function nr(t,e={}){let n=e.__session||x.session,o={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:e},r=null;if(e.clip){let u=Te(t,e.clip);if(u){o.clip={rect:u,root:t};let p=t.getBoundingClientRect();r={x:u.left-p.left,y:u.top-p.top,width:u.width,height:u.height}}}let s,i="",a="",c=Po(t),f=o.clip?()=>{}:No(t);try{s=await te(t,o,e)}catch(u){throw console.warn("deepClone failed:",u),u}finally{f(),c()}try{Lo(s)}catch(u){console.warn("inlineExternal defs or symbol failed:",u)}try{await Re(t,s,o,e)}catch(u){console.warn("inlinePseudoElements failed:",u)}await no(s,o);try{let u=s.querySelectorAll("style[data-sd]");for(let p of u)a+=p.textContent||"",p.remove()}catch(u){I(o,"Failed to extract shadow CSS from style[data-sd]",u)}let l=Ve(o.styleMap);i=Array.from(l.entries()).map(([u,p])=>`.${p}{${u}}`).join(""),i=a+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+i;for(let[u,p]of o.styleMap.entries()){if(u.tagName==="STYLE")continue;if(u.getRootNode&&u.getRootNode()instanceof ShadowRoot){u.setAttribute("style",p.replace(/;/g,"; "));continue}let h=l.get(p);h&&u.classList.add(h);let m=u.style?.backgroundImage,y=u.dataset?.snapdomHasIcon;m&&m!=="none"&&(u.style.backgroundImage=m),y&&(u.style.verticalAlign="middle",u.style.display="inline")}if((o.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let u=o.clip&&r?{x:r.x,y:r.y}:{x:0,y:0};Go(t,s,o.nodeMap,o.styleCache,u)}catch(u){I(o,"freezeViewportPositioned failed",u)}for(let[u,p]of o.nodeMap.entries()){if(o.clip&&p===t)continue;let h=p.scrollLeft,m=p.scrollTop;if((h||m)&&u?.nodeType===1&&u.namespaceURI==="http://www.w3.org/1999/xhtml"){u.style.overflow="hidden",u.style.scrollbarWidth="none",u.style.msOverflowStyle="none";try{let S=u.querySelectorAll("*");for(let C of S){if(C.nodeType!==1||C.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let g=C.style.position;if(g==="fixed"||g==="absolute"){let w=parseFloat(C.style.top)||0,v=parseFloat(C.style.left)||0;C.style.top=`${w+m}px`,C.style.left=`${v+h}px`,g==="fixed"&&(C.style.position="absolute")}}}catch{}let b=document.createElement("div");for(b.style.all="unset",b.style.transform=`translate(${-h}px, ${-m}px)`,b.style.willChange="transform",b.style.display="inline-block",b.style.width="100%";u.firstChild;)b.appendChild(u.firstChild);u.appendChild(b)}}if(t===o.nodeMap.get(s)){let u=o.styleCache.get(t)||P(t);o.styleCache.set(t,u);let p=Oe(u.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=p||""}for(let[u,p]of o.nodeMap.entries())p.tagName==="PRE"&&(u.style.marginTop="0",u.style.marginBlockStart="0");return{clone:s,classCSS:i,styleCache:o.styleCache,nodeMap:o.nodeMap,reconcileRisk:o.reconcileRisk||0,clipWindow:r}}wt();tt();var or="http://www.w3.org/1999/xlink";function Ls(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(or,"href"):null)}function Ps(t){let e=parseInt(t.dataset?.snapdomWidth||"",10)||0,n=parseInt(t.dataset?.snapdomHeight||"",10)||0,o=parseInt(t.getAttribute("width")||"",10)||0,r=parseInt(t.getAttribute("height")||"",10)||0,s=parseFloat(t.style?.width||"")||0,i=parseFloat(t.style?.height||"")||0,a=e||s||o||t.width||t.naturalWidth||100,c=n||i||r||t.height||t.naturalHeight||100;return{width:a,height:c}}async function rr(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let o=async a=>{if(!a.getAttribute("src")){let h=a.currentSrc||a.src||Ot(a.getAttribute("srcset"),a)||"";h&&a.setAttribute("src",h)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let c=a.src||"";if(!c)return;let f=x.image?.get(c);if(f){a.src=f,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let l=await j(c,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){x.image?.set(c,l.data),a.src=l.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:d,height:u}=Ps(a),{fallbackURL:p}=e||{};if(p)try{let h=typeof p=="function"?await p({width:d,height:u,src:c,element:a}):p;if(h){let m=await j(h,{as:"dataURL",useProxy:e.useProxy});if(m?.ok&&typeof m.data=="string"){a.src=m.data,a.width||(a.width=d),a.height||(a.height=u);return}}}catch{}if(e.placeholders!==!1){let h=document.createElement("div");h.style.cssText=[`width:${d}px`,`height:${u}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${u}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),h.textContent="img",a.replaceWith(h)}else{let h=document.createElement("div");h.style.cssText=`display:inline-block;width:${d}px;height:${u}px;visibility:hidden;`,a.replaceWith(h)}},r=6;for(let a=0;a<n.length;a+=r){let c=n.slice(a,a+r).map(o);await Promise.allSettled(c)}let s=Array.from(t.querySelectorAll("image"));t.localName==="image"&&s.unshift(t);let i=async a=>{let c=Ls(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let f=await j(c,{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(or,"href"))};for(let a=0;a<s.length;a+=r){let c=s.slice(a,a+r).map(i);await Promise.allSettled(c)}}rt();tt();var dn=["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"],Ns=["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"],Is=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],_s=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function Ws(t,e,n,o){let r=n.get(t)||P(t);n.has(t)||n.set(t,r);let s=r.getPropertyValue("border-image"),i=r.getPropertyValue("border-image-source"),a=s&&s!=="none"||i&&i!=="none",c=r.getPropertyValue("background-image"),f=r.getPropertyValue("background-color");if(c&&c!=="none"||f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"||/url\s*\(|gradient\s*\(/i.test(r.getPropertyValue("background")||""))for(let d of Is){let u=r.getPropertyValue(d);u&&e.style.setProperty(d,u)}for(let d of dn){let u=r.getPropertyValue(d);if(d==="background-image"&&(!u||u==="none")){let m=r.getPropertyValue("background");m&&/url\s*\(/.test(m)&&(u=_t(m).filter(y=>/url\s*\(/.test(y)).join(", ")||u)}if(!u||u==="none")continue;let p=_t(u),h=await Promise.all(p.map(m=>Et(m,o)));h.some(m=>m&&m!=="none"&&!/^url\(undefined/.test(m))&&e.style.setProperty(d,h.join(", "))}for(let d of Ns){let u=r.getPropertyValue(d);!u||u==="initial"||e.style.setProperty(d,u)}if(a)for(let d of _s){let u=r.getPropertyValue(d);!u||u==="initial"||e.style.setProperty(d,u)}}async function ir(t,e,n,o={},r=x.session.nodeMap){if(!e)return;let s=[];t&&Ke(t)&&s.push([t,e]);let i=[e];for(;i.length;){let c=i.pop();if(c.children)for(let f of c.children){if(f.tagName==="STYLE")continue;let l=r.get(f);l&&Ke(l)&&s.push([l,f]),i.push(f)}}let a=6;for(let c=0;c<s.length;c+=a)await Promise.allSettled(s.slice(c,c+a).map(([f,l])=>Ws(f,l,n,o)))}tt();rt();function ar(t,e,n=x.session.nodeMap){let o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let a=r.currentNode;a;a=r.nextNode()){let c=n.get(a);if(c?.nodeType!==1)continue;let f=P(c),l=f.getPropertyValue("backdrop-filter")||f.getPropertyValue("-webkit-backdrop-filter");l&&l!=="none"&&a!==e&&o.push({cloneEl:a,orig:c,bf:l,path:Us(e,a)})}if(!o.length)return;let s=t.getBoundingClientRect(),i=o.map((a,c)=>{let f=e.cloneNode(!0);Bs(f,e,a.orig.getBoundingClientRect(),n),Ds(sr(f,a.path));for(let l=0;l<c;l++){let d=sr(f,o[l].path);d&&(d.style.setProperty("backdrop-filter","none","important"),d.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...a,copy:f}});for(let{cloneEl:a,orig:c,bf:f,copy:l}of i)Os(a,c,f,l,s)}function Os(t,e,n,o,r){let s=e.getBoundingClientRect();if(!s.width||!s.height)return;let i=P(e),a=e.offsetWidth?s.width/e.offsetWidth:1,c=Math.abs(a-1)>.001?1/a:1;o.style.position="absolute",o.style.left=`${(r.left-s.left)*c}px`,o.style.top=`${(r.top-s.top)*c}px`,o.style.width=`${r.width}px`,o.style.height=`${r.height}px`,o.style.margin="0",o.style.filter=n,c!==1&&(o.style.transform=`scale(${c})`,o.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(o);let l=document.createElement("div");l.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",l.style.backgroundColor=i.backgroundColor,l.style.backgroundImage=t.style.backgroundImage||i.backgroundImage;for(let d of["background-size","background-position","background-repeat","background-origin","background-clip"])l.style.setProperty(d,i.getPropertyValue(d));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"),i.position==="static"&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(l),t.prepend(f)}var Le=128;function Bs(t,e,n,o){let r=[[t,e]];for(;r.length;){let[s,i]=r.pop(),a=o.get(i);if(a?.nodeType===1){let l=a.getBoundingClientRect();(l.left>n.right+Le||l.right<n.left-Le||l.top>n.bottom+Le||l.bottom<n.top-Le)&&(s.tagName==="IMG"&&s.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),s.style&&(s.style.backgroundImage="none"))}let c=s.children,f=i.children;for(let l=0;l<c.length;l++)r.push([c[l],f[l]])}}function Us(t,e){let n=[];for(let o=e;o!==t;o=o.parentElement){if(!o?.parentElement)return null;n.push([...o.parentElement.children].indexOf(o))}return n.reverse()}function sr(t,e){if(!e)return null;let n=t;for(let o of e)if(n=n.children[o],!n)return null;return n}function Ds(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}}rt();tt();function cr(t,e){if(!t)return()=>{};let n=[],o=200;function r(s){if(e){let f=s.getBoundingClientRect();if(f.width>0||f.height>0){let l=Math.max(f.right,f.left+(s.scrollWidth||0)),d=Math.max(f.bottom,f.top+(s.scrollHeight||0));if(l<e.left-o||f.left>e.right+o||d<e.top-o||f.top>e.bottom+o)return}}let i=getComputedStyle(s),a=Hs(s,i);a&&n.push(a);let c=zs(s,i);c&&n.push(c);for(let f of s.children||[])r(f)}return r(t),()=>n.forEach(s=>s())}function Hs(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=Vs(e);if(n<=0)return()=>{};if(!lr(t))return()=>{};let o=t.textContent??"",r=o,s=qs(e);t.textContent="X";let i=t.scrollHeight-s;t.textContent=o;let a=i>0?i:js(e),c=Math.round(a*n+s);if(t.scrollHeight<=c+.5)return()=>{};let f=0,l=o.length,d=-1;for(;f<=l;){let u=f+l>>1;t.textContent=o.slice(0,u)+"\u2026",t.scrollHeight<=c+.5?(d=u,f=u+1):l=u-1}return t.textContent=(d>=0?o.slice(0,d):"")+"\u2026",()=>{t.textContent=r}}function zs(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(!lr(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=t.textContent??"",o=n,r=0,s=n.length,i=-1;for(;r<=s;){let a=r+s>>1;t.textContent=n.slice(0,a)+"\u2026",t.scrollWidth<=t.clientWidth+.5?(i=a,r=a+1):s=a-1}return t.textContent=(i>=0?n.slice(0,i):"")+"\u2026",()=>{t.textContent=o}}function Vs(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 js(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 qs(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function lr(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var oe=[];function re(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 fr(...t){let e=t.flat();for(let n of e){let o=re(n);o&&(oe.some(r=>r&&r.name&&o.name&&r.name===o.name)||oe.push(o))}}function ur(t){return t&&Array.isArray(t.plugins)?t.plugins:oe}async function lt(t,e,n){let o=n,r=ur(e);for(let s of r){let i=s&&typeof s[t]=="function"?s[t]:null;if(!i)continue;let a=await i(e,o);typeof a<"u"&&(o=a)}return o}async function dr(t,e,n){let o=[],r=ur(e);for(let s of r){let i=s&&typeof s[t]=="function"?s[t]:null;if(!i)continue;let a=await i(e,n);typeof a<"u"&&o.push(a)}return o}function Xs(t){let e=[];if(Array.isArray(t))for(let n of t){let o=re(n);if(!o||!o.name)continue;let r=e.findIndex(s=>s&&s.name===o.name);r>=0&&e.splice(r,1),e.push(o)}for(let n of oe)n&&n.name&&!e.some(o=>o.name===n.name)&&e.push(n);return Object.freeze(e)}function pr(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Xs(e)),t}function pn(){return oe.slice()}tt();var Gs=.92,Ys=.95;async function Ks(t){let e=new Image;if(e.decoding="sync",e.src=t,typeof e.decode=="function")try{return await e.decode(),e}catch{}return await new Promise((n,o)=>{e.onload=()=>n(),e.onerror=o}),e}function Qs(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}async function mn(t,e,n){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;let o=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+Math.round(e)+"x"+Math.round(n);if(x.compress.has(o))return x.compress.get(o);let r=await(async()=>{let s;try{s=await Ks(t)}catch{return null}let i=s.naturalWidth||s.width,a=s.naturalHeight||s.height;if(!i||!a)return null;let c=Math.min(1,Math.max(e/i,n/a));if(!(c>0)||c>=.95)return null;let f=c*Ys,l=Math.max(1,Math.round(i*f)),d=Math.max(1,Math.round(a*f)),u=document.createElement("canvas");u.width=l,u.height=d;let p=u.getContext("2d");if(!p)return null;p.imageSmoothingEnabled=!0,p.imageSmoothingQuality="high",p.drawImage(s,0,0,l,d);let h=Qs(t),m=h==="image/jpeg"?"image/jpeg":h==="image/webp"?"image/webp":"image/png";try{let y=u.toDataURL(m,Gs);if(typeof y=="string"&&y.startsWith("data:image")&&y.length<t.length)return y}catch{}return null})();return x.compress.set(o,r),r}async function Js(t,e){if(!e.compress)return{count:0,before:0,after:0};let n=(e.scale||1)*(e.dpr||1),o=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&o.unshift(t);let r=0,s=0,i=0,a=async f=>{let l=f.getAttribute("src")||"";if(!l.startsWith("data:image")||l.startsWith("data:image/svg"))return;let d=parseFloat(f.dataset.snapdomWidth)||parseFloat(f.style.width)||f.width||0,u=parseFloat(f.dataset.snapdomHeight)||parseFloat(f.style.height)||f.height||0;if(!d||!u)return;let p=await mn(l,d*n,u*n);p&&(r++,s+=l.length,i+=p.length,f.setAttribute("src",p))},c=6;for(let f=0;f<o.length;f+=c)await Promise.allSettled(o.slice(f,f+c).map(a));return{count:r,before:s,after:i}}function Zs(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function ta(t,e,n=x.session.nodeMap){if(!e.compress)return{count:0};let o=(e.scale||1)*(e.dpr||1),r=[],s=[t,...t.querySelectorAll("*")];for(let f of s){let l=f.style&&f.style.backgroundImage;l&&l.includes("data:image")&&r.push(f)}let i=0,a=async f=>{let l=n.get(f);if(!l||!l.isConnected)return;let d;try{d=getComputedStyle(l)}catch{return}if((d.backgroundRepeat||"repeat").toLowerCase().split(",").some(g=>g.trim()!=="no-repeat"))return;let{w:p,h}=Zs(l);if(!p||!h)return;let m=p*o,y=h*o,b=f.style.backgroundImage,S=[...b.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],C=b;for(let g of S){let w=g[2];if(w.startsWith("data:image/svg"))continue;let v=await mn(w,m,y);v&&(C=C.split(w).join(v),i++)}C!==b&&(f.style.backgroundImage=C)},c=6;for(let f=0;f<r.length;f+=c)await Promise.allSettled(r.slice(f,f+c).map(a));return{count:i}}async function ea(t,e){if(!e.compress)return{count:0};let n=(e.scale||1)*(e.dpr||1),o=Array.from(t.querySelectorAll("image"));t.localName==="image"&&o.unshift(t);let r=0,s=async a=>{let c=a.getAttribute("href")||(typeof a.getAttributeNS=="function"?a.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!c||!c.startsWith("data:image")||c.startsWith("data:image/svg"))return;let f=parseFloat(a.getAttribute("width"))||0,l=parseFloat(a.getAttribute("height"))||0;if(!f||!l)return;let d=await mn(c,f*n,l*n);d&&(a.setAttribute("href",d),a.hasAttribute("xlink:href")&&a.setAttribute("xlink:href",d),r++)},i=6;for(let a=0;a<o.length;a+=i)await Promise.allSettled(o.slice(a,a+i).map(s));return{count:r}}async function mr(t,e,n){e.compress&&(await Js(t,e),await ta(t,e,n),await ea(t,e))}function na(t){if(Array.isArray(t.plugins)){for(let e of t.plugins)if(re(e)?.name==="picture-resolver")return!0}return pn().some(e=>e?.name==="picture-resolver")}function oa(t){let e=Array.isArray(t.plugins)?t.plugins:pn(),n=[];for(let o of e){let r=re(o);r&&typeof r.resolveNode=="function"&&n.push(r.resolveNode.bind(r))}return n.length?n:null}var ra=2e3,ia=3;function sa(t){let e=Date.now(),n=x.burstAdvice.get(t);if(!n||e-n.firstTs>ra){x.burstAdvice.set(t,{count:1,firstTs:e,warned:!1});return}n.count++,n.count>=ia&&!n.warned&&(n.warned=!0,console.warn("[snapdom] Captured this element multiple times. Pass { burst: true } to increase the speed."))}async function hr(t,e){if(!t)throw new Error("Element cannot be null or undefined");ue(e.cache),e.__session={styleMap:x.session.styleMap,styleCache:x.session.styleCache,nodeMap:x.session.nodeMap},e.burst||sa(t),e.__resolveNodeHooks=oa(e);let n=e.fast,o=e.outerTransforms!==!1,r=!!e.outerShadows,s=e.clip?Te(t,e.clip):null,i={element:t,options:e,plugins:e.plugins},a,c,f,l,d,u,p="",h="",m,y,b=null;await lt("beforeSnap",i);let S=null;e.resolvePicturePlaceholders!==!1&&!na(e)&&(S=await Vn(i.element,i.options)),await lt("beforeClone",i);let C=cr(i.element,s);try{({clone:a,classCSS:c,styleCache:f,nodeMap:l,reconcileRisk:d,clipWindow:u}=await nr(i.element,i.options)),d>0&&!e.reconcile&&!x.warnedReconcile&&(x.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time).")),!o&&a&&(b=Do(i.element,a)),!r&&a&&Yo(i.element,a,i.options),a&&Ko(i.element,a,l)}finally{C()}if(i={clone:a,classCSS:c,styleCache:f,nodeMap:l,...i},await lt("afterClone",i),S&&await S(),Qo(i.clone),i.options?.excludeMode==="remove"||i.options?.filterMode==="remove")try{Jo(i.element,i.clone,i.styleCache)}catch(F){console.warn("[snapdom] shrink pass failed:",F)}try{await lo(i.clone,i.element,i.nodeMap)}catch{}let g=F=>new Promise((R,D)=>{$t(()=>{Promise.resolve().then(F).then(R,D)},{fast:n})}),w=(async()=>{await Promise.all([g(()=>rr(i.clone,i.options)),g(()=>ir(i.element,i.clone,i.styleCache,i.options,i.nodeMap))]);try{ar(i.element,i.clone,i.nodeMap)}catch(F){console.warn("[snapdom] backdrop-filter emulation failed:",F)}e.compress&&await g(()=>mr(i.clone,i.options,i.nodeMap))})(),v=Promise.resolve();e.embedFonts&&(v=g(async()=>{let F=i.element.ownerDocument||document,R=s?_=>{try{let W=_.getBoundingClientRect();return W.right>=s.left-200&&W.left<=s.right+200&&W.bottom>=s.top-200&&W.top<=s.bottom+200}catch{return!0}}:null,{required:D,usedCodepoints:L}=ee(i.element,R);if(X()){let _=new Set(Array.from(D).map(W=>String(W).split("__")[0]).filter(Boolean));await Ut(_,1,F)}p=await Fe({required:D,usedCodepoints:L,preCached:!1,exclude:i.options.excludeFonts,localFonts:i.options.localFonts,useProxy:i.options.useProxy,fontStylesheetDomains:i.options.fontStylesheetDomains,doc:F})})),await Promise.all([w,v]);let M=He(i.clone).sort(),A=M.join(",");x.baseStyle.has(A)?h=x.baseStyle.get(A):await new Promise(F=>{$t(()=>{h=ze(M),x.baseStyle.set(A,h),F()},{fast:n})});let k=er(i.element?.ownerDocument||document);i={fontsCSS:p,baseCSS:h,scrollbarCSS:k,...i},await lt("beforeRender",i),await new Promise(F=>{$t(()=>{let R=P(i.element),D=i.element.getBoundingClientRect(),L=Math.max(1,E(i.element.offsetWidth||parseFloat(R.width)||D.width||1)),_=Math.max(1,E(i.element.offsetHeight||parseFloat(R.height)||D.height||1)),W=i.element.ownerDocument||document;if(!u&&(i.element===W.body||i.element===W.documentElement)&&!W.documentElement.hasAttribute("data-sd-pinned")){let V=Math.max(i.element.scrollHeight||0,W.documentElement?.scrollHeight||0,W.body?.scrollHeight||0),J=Math.max(i.element.scrollWidth||0,W.documentElement?.scrollWidth||0,W.body?.scrollWidth||0);V>0&&(_=Math.max(_,E(V))),J>0&&(L=Math.max(L,E(J)));try{let Y=(i.scrollbarCSS||"").length+(i.baseCSS||"").length+(i.fontsCSS||"").length+(i.classCSS||"").length,Z=x.measureHints.get(i.element);if(Z&&Z.cssLen===Y&&Z.w0===L)Z.csh>0&&(_=Math.max(_,E(Z.csh))),Z.csw>0&&(L=Math.max(L,E(Z.csw)));else{let K=W.createElement("div");K.setAttribute("data-snapdom-internal",""),K.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+L+"px!important;overflow:visible!important;visibility:hidden!important;";let At=K.attachShadow({mode:"open"}),kt=W.createElement("style");kt.textContent=(i.scrollbarCSS||"")+i.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS,At.appendChild(kt),At.appendChild(i.clone.cloneNode(!0)),W.body.appendChild(K);let jt=K.scrollHeight,yt=K.scrollWidth;W.body.removeChild(K),x.measureHints.set(i.element,{cssLen:Y,w0:L,csh:jt,csw:yt}),jt>0&&(_=Math.max(_,E(jt))),yt>0&&(L=Math.max(L,E(yt)))}}catch{}}if(i.options?.excludeMode==="remove"||i.options?.filterMode==="remove"){let V=Zo(i.element,i.options);Number.isFinite(V)&&V>0&&(_=Math.max(1,Math.min(_,E(V+1))))}if(i.options?.reconcile)try{let V=(i.scrollbarCSS||"")+i.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS;tr(i.element,i.clone,V,i.nodeMap,L,_)}catch(V){console.warn("[snapdom] reconcile pass failed:",V)}let T=(V,J=NaN)=>{let Y=typeof V=="string"?parseFloat(V):V;return Number.isFinite(Y)?Y:J},Q=T(i.options.width),et=T(i.options.height),pt=u?E(u.width):L,mt=u?E(u.height):_,St=pt,ht=mt,N=Number.isFinite(Q),O=Number.isFinite(et),U=mt>0?pt/mt:1;N&&O?(St=Math.max(1,E(Q)),ht=Math.max(1,E(et))):N?(St=Math.max(1,E(Q)),ht=Math.max(1,E(St/(U||1)))):O&&(ht=Math.max(1,E(et)),St=Math.max(1,E(ht*(U||1))));let z=0,G=0,ft=L,vt=_;if(u){let V=0,J=0;if(hn(i.element)){let Y=null;if(!o&&b&&Number.isFinite(b.a))Y={a:b.a,b:b.b||0,c:b.c||0,d:b.d||1,e:0,f:0};else{let Z=zt(i.element),K=un(R.transform&&R.transform!=="none"?R.transform:"",Z);K&&K.is2D&&(Y={a:K.a,b:K.b,c:K.c,d:K.d,e:0,f:0})}if(Y&&!(Y.a===1&&Y.b===0&&Y.c===0&&Y.d===1)){let{ox:Z,oy:K}=ne(R,L,_),At=Ht(L,_,Y,Z,K);V=At.minX,J=At.minY}}z=E(u.x+V),G=E(u.y+J),ft=E(z+u.width),vt=E(G+u.height)}else if(!o&&b&&Number.isFinite(b.a)){let V={a:b.a,b:b.b||0,c:b.c||0,d:b.d||1,e:0,f:0},J=Ht(L,_,V,0,0);z=E(J.minX),G=E(J.minY),ft=E(J.maxX),vt=E(J.maxY)}else if(o&&hn(i.element)){let J=R.transform&&R.transform!=="none"?R.transform:"",Y=zt(i.element),Z=Ho({baseTransform:J,rotate:Y.rotate||"0deg",scale:Y.scale,translate:Y.translate}),{ox:K,oy:At}=ne(R,L,_),kt=Z.is2D?Z:new DOMMatrix(Z.toString()),jt={a:kt.a,b:kt.b,c:kt.c,d:kt.d,e:0,f:0},yt=Ht(L,_,jt,K,At);z=E(yt.minX),G=E(yt.minY),ft=E(yt.maxX),vt=E(yt.maxY)}let ut=Io(R),Tt=_o(R),nt=Oo(R),Lt=Bo(R),Pt=Uo(R),Ct=u?{top:0,right:0,bottom:0,left:0}:r?{top:E(Math.max(ut.top,Tt.top)+nt.top+Lt.top+Pt.bleed.top),right:E(Math.max(ut.right,Tt.right)+nt.right+Lt.right+Pt.bleed.right),bottom:E(Math.max(ut.bottom,Tt.bottom)+nt.bottom+Lt.bottom+Pt.bleed.bottom),left:E(Math.max(ut.left,Tt.left)+nt.left+Lt.left+Pt.bleed.left)}:{top:nt.top,right:nt.right,bottom:nt.bottom,left:nt.left};z=E(z-Ct.left),G=E(G-Ct.top),ft=E(ft+Ct.right),vt=E(vt+Ct.bottom);let dt=Math.max(1,E(ft-z)),Cn=Math.max(1,E(vt-G)),Rr=N||O?E(St/pt):1,Tr=O||N?E(ht/mt):1,Lr=Math.max(1,E(dt*Rr)),Pr=Math.max(1,E(Cn*Tr)),An="http://www.w3.org/2000/svg",Nr=hn(i.element)?2:0,Nt=E(Nr+(o?0:1)),se=Math.ceil(dt+Nt*2),ae=Math.ceil(Cn+Nt*2),ce=E(-(E(z)-Nt)),le=E(-(E(G)-Nt)),kn=Math.max(0,ce),Mn=Math.max(0,le),En=E(se-Math.min(0,ce)),$n=E(ae-Math.min(0,le)),gt=document.createElementNS(An,"foreignObject");gt.setAttribute("x",String(Math.min(0,ce))),gt.setAttribute("y",String(Math.min(0,le))),gt.setAttribute("width",String(En)),gt.setAttribute("height",String($n)),gt.style.overflow="visible";let Fn=document.createElement("style"),Ir="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";Fn.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+Ir+i.classCSS,gt.appendChild(Fn);let fe=document.createElement("div");fe.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),fe.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${En}px;height:${$n}px`+(kn!==0||Mn!==0?`;padding:${Mn}px 0 0 ${kn}px !important`:""),fe.appendChild(i.clone),gt.appendChild(fe);let _r=new XMLSerializer().serializeToString(gt),Rn=N||O,Wr=Object.freeze({w0:pt,h0:mt,vbW:se,vbH:ae,targetW:St,targetH:ht,contentX:E(ce+(u?z:0)),contentY:E(le+(u?G:0)),clip:u?Object.freeze({x:E(z),y:E(G),width:pt,height:mt}):null});Object.defineProperty(e,"meta",{value:Wr,enumerable:!0,writable:!1,configurable:!0});let Or=!Rn||X()?se:E(Lr+Nt*2),Br=!Rn||X()?ae:E(Pr+Nt*2),Ur=parseFloat(P(W.documentElement)?.fontSize)||16;y=`<svg xmlns="${An}" width="${Or}" height="${Br}" viewBox="0 0 ${se} ${ae}" font-size="${Ur}px">`+_r+"</svg>",m=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(y)}`,i={svgString:y,dataURL:m,...i},F()},{fast:n})}),await lt("afterRender",i);let $=document.getElementById("snapdom-sandbox");return $&&$.style.position==="absolute"&&$.remove(),i.dataURL}function hn(t){return zo(t)}tt();function gr(t={}){let e=t.format??"png";e==="jpg"&&(e="jpeg");let n=Tn(t.cache);return{debug:t.debug??!1,fast:t.fast??!0,scale:t.scale??1,exclude:t.exclude??[],excludeMode:t.excludeMode??"hide",filter:t.filter??null,filterMode:t.filterMode??"hide",placeholders:t.placeholders!==!1,embedFonts:t.embedFonts??!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:e,type:t.type??"svg",quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(e)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst??!1,invalidate:t.invalidate??!1,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1,pictureResolver:t.pictureResolver&&typeof t.pictureResolver=="object"?t.pictureResolver:{}}}Wt();qe();var yr=new WeakMap;function wr(t,e,n){let o=new Set;if(t instanceof HTMLVideoElement&&o.add(t),t.querySelectorAll)for(let r of t.querySelectorAll("video"))o.add(r);for(let r of e.trackedVideos)o.has(r)||(r.removeEventListener("timeupdate",n),r.removeEventListener("seeked",n),e.trackedVideos.delete(r));for(let r of o)e.trackedVideos.has(r)||(r.addEventListener("timeupdate",n),r.addEventListener("seeked",n),e.trackedVideos.add(r))}function aa(t){let e={dirty:!0,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedVideos:new Set},n=s=>{e.capturing||Ye(s)&&(e.dirty=!0)},o=()=>{e.capturing||(e.dirty=!0)},r=t.ownerDocument||document;try{let s=new MutationObserver(n);s.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),e.observers.push(s)}catch{}try{if(r.head){let s=new MutationObserver(n);s.observe(r.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),e.observers.push(s)}}catch{}return e.markDirty=n,e.onMediaDirty=o,wr(t,e,o),e}function br(t){let{burst:e,invalidate:n,...o}=t||{};try{return JSON.stringify(o,Object.keys(o).sort())}catch{return null}}function xr(t,e,n,o){let r=yr.get(t);r||(r=aa(t),r.baselineSignature=br(e),yr.set(t,r));let s=br(e),i=s===null||s!==r.baselineSignature,a=async()=>{for(let f of r.observers)r.markDirty(f.takeRecords());if(n.invalidate&&(r.dirty=!0),!i&&!r.dirty&&r.last)return r.last;r.capturing=!0,i||(r.dirty=!1);try{let f=await o();return i||(r.last=f),f}finally{for(let f of r.observers)f.takeRecords();r.capturing=!1,wr(t,r,r.onMediaDirty)}},c=r.inflight.then(a,a);return r.inflight=c.catch(()=>{}),c}rt();wt();tt();async function Sr(t=document,e={}){let{embedFonts:n=!0,useProxy:o=""}=e,r=e.cache??e.cacheOpt??"full";ue(r);try{await document.fonts?.ready}catch{}try{De()}catch{}x.session=x.session||{},x.session.styleCache||(x.session.styleCache=new WeakMap),x.image=x.image||new q(100),x.background=x.background||new q(100);let s=[],i=[];try{if(t&&t.nodeType===1){let c=t.querySelectorAll?Array.from(t.querySelectorAll("*")):[];i=[t,...c],s=[],t.tagName==="IMG"&&t.getAttribute("src")&&s.push(t),s.push(...Array.from(t.querySelectorAll?.("img[src]")||[]))}else t?.querySelectorAll&&(s=Array.from(t.querySelectorAll("img[src]")),i=Array.from(t.querySelectorAll("*")))}catch{}let a=[];for(let c of s){let f=c?.currentSrc||c?.src;if(f&&!x.image.has(f)){let l=Promise.resolve().then(async()=>{let d=await j(f,{as:"dataURL",useProxy:o});d?.ok&&typeof d.data=="string"&&x.image.set(f,d.data)}).catch(()=>{});a.push(l)}}for(let c of i){let f=new Set;for(let l of dn){let d="";try{d=l==="background-image"&&c?.style?.backgroundImage||P(c).getPropertyValue(l)||""}catch{}if(!d||d==="none")continue;let u=d.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let p of u){if(f.has(p))continue;f.add(p);let h=Promise.resolve().then(()=>Et(p,{...e,useProxy:o})).catch(()=>{});a.push(h)}}}if(n)try{let{required:c,usedCodepoints:f}=ee(t);if(typeof X=="function"?X():!!X){let d=new Set(Array.from(c).map(u=>String(u).split("__")[0]).filter(Boolean));await Ut(d,3)}await Fe({required:c,usedCodepoints:f,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:e.useProxy??o,fontStylesheetDomains:e.fontStylesheetDomains})}catch{}await Promise.allSettled(a)}function xa(...t){return fr(...t),B}var B=Object.assign(va,{plugins:xa}),vn=Symbol("snapdom.internal"),Sa=Symbol("snapdom.internal.silent");async function va(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=gr(e);if(pr(n,e&&e.plugins),X()){if(n.embedFonts===!0)try{let r=xo(t),s=new Set([...r].map(i=>String(i).split("__")[0]).filter(Boolean));await Ut(s,1)}catch{}let o=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&o.unshift(t);for(let r of o)try{let s=r.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){I(e,"safari canvas poke failed",s)}}return n.iconFonts&&n.iconFonts.length>0&&co(n.iconFonts),n.snap||(n.snap={toPng:(o,r)=>B.toPng(o,r),toSvg:(o,r)=>B.toSvg(o,r)}),n.burst?xr(t,e,n,()=>B.capture(t,n,vn)):B.capture(t,n,vn)}B.capture=async(t,e,n)=>{if(n!==vn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");e.element=t;let o=await hr(t,e),r={img:async(m,y)=>{let{toImg:b}=await Promise.resolve().then(()=>(wn(),bn));return b(o,{...m,...y||{}})},svg:async(m,y)=>{let{toSvg:b}=await Promise.resolve().then(()=>(wn(),bn));return b(o,{...m,...y||{}})},canvas:async(m,y)=>{let{toCanvas:b}=await Promise.resolve().then(()=>(Vt(),kr));return b(o,{...m,...y||{}})},blob:async(m,y)=>{let{toBlob:b}=await Promise.resolve().then(()=>(Sn(),Mr));return b(o,{...m,...y||{}})},png:async(m,y)=>{let{rasterize:b}=await Promise.resolve().then(()=>(ie(),We));return b(o,{...m,...y||{},format:"png"})},jpeg:async(m,y)=>{let{rasterize:b}=await Promise.resolve().then(()=>(ie(),We));return b(o,{...m,...y||{},format:"jpeg"})},webp:async(m,y)=>{let{rasterize:b}=await Promise.resolve().then(()=>(ie(),We));return b(o,{...m,...y||{},format:"webp"})},download:async(m,y)=>{let{download:b}=await Promise.resolve().then(()=>(Fr(),$r));return b(o,{...m,...y||{}})}},s={};for(let m of["img","svg","canvas","blob","png","jpeg","webp"])s[m]=async y=>r[m](e,{...y||{},[Sa]:!0});s.jpg=s.jpeg;let i={...e,export:{url:o},exports:s},a=await dr("defineExports",i),c=Object.assign({},...a.filter(m=>m&&typeof m=="object").reverse()),f={...r,...c};f.jpeg&&!f.jpg&&(f.jpg=(m,y)=>f.jpeg(m,y));function l(m,y){let b={...e,...y||{}},S=g=>g==="jpeg"||g==="jpg"||g==="webp";return[m,b.format,b.type].map(g=>typeof g=="string"?g.toLowerCase():"").find(S)&&(b.backgroundColor==null||b.backgroundColor==="transparent")&&(b.backgroundColor="#ffffff"),b}let d=!1,u=Promise.resolve();async function p(m,y){let b=Object.freeze(y&&typeof y=="object"?{...y}:{}),S=async()=>{let g=f[m];if(!g)throw new Error(`[snapdom] Unknown export type: ${m}`);let w=l(m,b),v={...e,export:{type:m,options:w,requestedOptions:b,url:o}};await lt("beforeExport",v,{format:m,options:w});let M=await g(v,w);return await lt("afterExport",v,{format:m,options:w,result:M}),d||(d=!0,await lt("afterSnap",e)),M},C=u.then(S);return u=C.catch(()=>{}),C}let h={url:o,toRaw:()=>o,to:(m,y)=>p(m,y),toImg:m=>p("img",m),toSvg:m=>p("svg",m),toCanvas:m=>p("canvas",m),toBlob:m=>p("blob",m),toPng:m=>p("png",m),toJpg:m=>p("jpg",m),toWebp:m=>p("webp",m),download:m=>p("download",m)};Object.defineProperty(h,"meta",{value:e.meta,enumerable:!0,writable:!1,configurable:!1});for(let m of Object.keys(f)){let y="to"+m.charAt(0).toUpperCase()+m.slice(1);h[y]||(h[y]=b=>p(m,b))}return h};B.toRaw=(t,e)=>B(t,e).then(n=>n.toRaw());B.toImg=(t,e)=>B(t,e).then(n=>n.toImg());B.toSvg=(t,e)=>B(t,e).then(n=>n.toSvg());B.toCanvas=(t,e)=>B(t,e).then(n=>n.toCanvas());B.toBlob=(t,e)=>B(t,e).then(n=>n.toBlob());B.toPng=(t,e)=>B(t,{...e,format:"png"}).then(n=>n.toPng());B.toJpg=(t,e)=>B(t,{...e,format:"jpeg"}).then(n=>n.toJpg());B.toWebp=(t,e)=>B(t,{...e,format:"webp"}).then(n=>n.toWebp());B.download=(t,e)=>B(t,e).then(n=>n.download());typeof window<"u"&&(window.snapdom=B,window.preCache=Sr);
14
+ `):l+=u[0]}return l+=a.slice(d),l}let i=mo(t,e||location.href);return i=await s(i,e||location.href,0),i}var wo=/url\((["']?)([^"')]+)\1\)/g,ms=/@font-face[^{}]*\{[^}]*\}/g;function st(t,e,n=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function xo(t){if(!t)return[];let e=[],n=t.split(",").map(o=>o.trim()).filter(Boolean);for(let o of n){let r=o.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!r)continue;let s=r[1],i=r[2],a=c=>{if(!c.includes("?"))return parseInt(c,16);let f=parseInt(c.replace(/\?/g,"0"),16),l=parseInt(c.replace(/\?/g,"F"),16);return[f,l]};if(i){let c=a(s),f=a(i),l=Array.isArray(c)?c[0]:c,d=Array.isArray(f)?f[1]:f;e.push([Math.min(l,d),Math.max(l,d)])}else{let c=a(s);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function So(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[o,r]of e)if(n>=o&&n<=r)return!0;return!1}function rn(t,e){let n=[];if(!t)return n;for(let o of t.matchAll(wo)){let r=(o[2]||"").trim();if(!(!r||r.startsWith("data:"))){if(!/^https?:/i.test(r))try{r=new URL(r,e||location.href).href}catch{}n.push(r)}}return n}async function nn(t,e,n=""){let o=t;for(let r of t.matchAll(wo)){let s=Mt(r[0]);if(!s)continue;let i=s;if(!i.startsWith("http")&&!i.startsWith("data:"))try{i=new URL(i,e||location.href).href}catch{}if(!ct(i)){if(x.resource?.has(i)){x.font?.add(i),o=o.replace(r[0],`url(${x.resource.get(i)})`);continue}try{let a=await j(i,{as:"dataURL",useProxy:n,silent:!0});if(a.ok&&typeof a.data=="string"){let c=a.data;x.resource?.set(i,c),x.font?.add(i),o=o.replace(r[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",i)}}}return o}function hs(t){if(!t.length)return null;let e=(a,c)=>t.some(([f,l])=>!(l<a||f>c)),n=e(0,255)||e(305,305),o=e(256,591)||e(7680,7935),r=e(880,1023),s=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":s?"cyrillic":r?"greek":o?"latin-ext":n?"latin":null}function ho(t={}){let e=new Set((t.families||[]).map(r=>String(r).toLowerCase())),n=new Set((t.domains||[]).map(r=>String(r).toLowerCase())),o=new Set((t.subsets||[]).map(r=>String(r).toLowerCase()));return(r,s)=>{if(e.size&&e.has(r.family.toLowerCase()))return!0;if(n.size)for(let i of r.srcUrls)try{if(n.has(new URL(i).host.toLowerCase()))return!0}catch{}if(o.size){let i=hs(s);if(i&&o.has(i))return!0}return!1}}function gs(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,o=[];for(let s of t.match(e)||[]){let i=st(s,"font-family"),a=on(i),c=st(s,"font-weight","400"),f=st(s,"font-style","normal"),l=st(s,"font-stretch","100%"),d=st(s,"unicode-range"),u=st(s,"src"),p=rn(u,location.href),h=p.length?p.map(y=>String(y).toLowerCase()).sort().join("|"):u.toLowerCase(),m=[String(a||"").toLowerCase(),c,f,l,d.toLowerCase(),h].join("|");n.has(m)||(n.add(m),o.push(s))}if(o.length===0)return t;let r=0;return t.replace(e,()=>o[r++]||"")}var go=new WeakMap,ys=0;function bs(t){let e=go.get(t);return e===void 0&&(e=ys++,go.set(t,e)),e}function ws(t,e,n,o,r,s){let i=Array.from(t||[]).sort().join("|"),a=e?JSON.stringify({families:(e.families||[]).map(u=>String(u).toLowerCase()).sort(),domains:(e.domains||[]).map(u=>String(u).toLowerCase()).sort(),subsets:(e.subsets||[]).map(u=>String(u).toLowerCase()).sort()}):"",c=(n||[]).map(u=>`${(u.family||"").toLowerCase()}::${u.weight||"normal"}::${u.style||"normal"}::${u.src||""}`).sort().join("|"),f=o||"",l=(r||[]).map(u=>String(u).toLowerCase()).sort().join("|"),d=bs(s||document);return`fonts-embed-css::req=${i}::ex=${a}::lf=${c}::px=${f}::fd=${l}::doc=${d}`}async function vo(t,e,n,o){let r;try{r=t.cssRules||[]}catch{return}let s=(i,a)=>{try{return new URL(i,a||location.href).href}catch{return i}};for(let i of r){if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){let a=i.href?s(i.href,e):e;if(o.depth>=Fe){console.warn(`[snapDOM] CSSOM import depth exceeded (${Fe}) at ${a}`);continue}if(a&&o.visitedSheets.has(a)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${a}`);continue}a&&o.visitedSheets.add(a);let c={...o,depth:(o.depth||0)+1};await vo(i.styleSheet,a,n,c);continue}if(i.type===CSSRule.FONT_FACE_RULE){let a=(i.style.getPropertyValue("font-family")||"").trim(),c=on(a);if(!c||ct(c))continue;let f=(i.style.getPropertyValue("font-weight")||"").trim(),l=(i.style.getPropertyValue("font-style")||"").trim(),d=(i.style.getPropertyValue("font-stretch")||"").trim(),u=(i.style.getPropertyValue("font-variation-settings")||"").trim(),p=(i.style.getPropertyValue("src")||"").trim(),h=(i.style.getPropertyValue("unicode-range")||"").trim(),m=f||"400",y=l||"normal",b=d||"100%",S=(l?`font-style:${l};`:"")+(f?`font-weight:${f};`:"")+(d?`font-stretch:${d};`:"")+(u?`font-variation-settings:${u};`:"")+(h?`unicode-range:${h};`:""),C=o.faceMatchesRequired(c,y,m,b);if(!C&&!o.requiredIndex.has(c.toLowerCase()))continue;let g=xo(h);if(!So(o.usedCodepoints,g))continue;let w={family:c,weightSpec:m,styleSpec:y,stretchSpec:b,unicodeRange:h,srcRaw:p,srcUrls:rn(p,e||location.href),href:e||location.href};if(o.simpleExcluder&&o.simpleExcluder(w,g))continue;if(!C){o.provisionalFaces.push({family:c.toLowerCase(),block:`@font-face{font-family:${c};src:${p};${S}}`,srcRaw:p,baseHref:e||location.href});continue}if(o.coveredFamilies.add(c.toLowerCase()),/url\(/i.test(p)){let v=await nn(p,e||location.href,o.useProxy);await n(`@font-face{font-family:${c};src:${v};${S}}`)}else await n(`@font-face{font-family:${c};src:${p};${S}}`)}}}async function $e({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:o=[],useProxy:r="",fontStylesheetDomains:s=[],doc:i=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let a=new Map;for(let g of t){let[w,v,M,A]=String(g).split("__");if(!w)continue;let k=w.toLowerCase(),F=a.get(k)||[];F.push({w:parseInt(v,10),s:M,st:parseInt(A,10)}),a.set(k,F)}function c(g,w,v,M){let A=String(g).toLowerCase();if(!a.has(A))return!1;let k=a.get(A),F=as(v),$=cs(w),R=ls(M),D=F.min!==F.max,N=F.min,_=H=>$.kind==="normal"&&H==="normal"||$.kind!=="normal"&&(H==="italic"||H==="oblique"),W=!1;for(let H of k){let T=D?H.w>=F.min&&H.w<=F.max:H.w===N,Q=_(Ee(H.s)),et=H.st>=R.min&&H.st<=R.max;if(T&&Q&&et){W=!0;break}}if(W)return!0;if(!D)for(let H of k){let T=_(Ee(H.s)),Q=H.st>=R.min&&H.st<=R.max;if(Math.abs(N-H.w)<=300&&T&&Q)return!0}if(!D&&$.kind==="normal"&&k.some(T=>Ee(T.s)!=="normal"))for(let T of k){let Q=Math.abs(N-T.w)<=300,et=T.st>=R.min&&T.st<=R.max;if(Q&&et)return!0}return!1}let f=ho(n),l=ws(t,n,o,r,s,i);if(x.resource?.has(l))return x.resource.get(l);let d=ds(t),u=[],p=en;for(let g of i.querySelectorAll("style")){let w=g.textContent||"";for(let v of w.matchAll(p)){let M=(v[2]||v[4]||"").trim();if(!M||ct(M))continue;i.querySelector(`link[rel="stylesheet"][href="${M}"]`)||u.push(M)}}let h=[];u.length&&await Promise.all(u.map(g=>new Promise(w=>{if(i.querySelector(`link[rel="stylesheet"][href="${g}"]`))return w(null);let v=i.createElement("link");v.rel="stylesheet",v.href=g,v.setAttribute("data-snapdom","injected-import"),v.onload=()=>w(v),v.onerror=()=>w(null),i.head.appendChild(v),h.push(v)})));let m="",y=new Set,b=[],S=Array.from(i.querySelectorAll('link[rel="stylesheet"]')).filter(g=>!!g.href);for(let g of h)try{g.remove()}catch{}for(let g of S)try{if(ct(g.href))continue;let w="",v=!1;try{v=new URL(g.href,location.href).origin===location.origin}catch{}if(!v){let A=Array.isArray(s)?s:[];if(!us(g.href,d,A))continue}if(v){let A=Array.from(i.styleSheets).find(k=>k.href===g.href);if(A)try{let k=A.cssRules||[];w=Array.from(k).map(F=>F.cssText).join("")}catch{}}if(!w){let A=await j(g.href,{as:"text",useProxy:r});if(A?.ok&&typeof A.data=="string"&&(w=A.data),ct(g.href))continue}w=await ps(w,g.href,r);let M="";for(let A of w.match(ms)||[]){let k=st(A,"font-family"),F=on(k);if(!F||ct(F))continue;let $=st(A,"font-weight","400"),R=st(A,"font-style","normal"),D=st(A,"font-stretch","100%"),N=st(A,"unicode-range"),_=st(A,"src"),W=rn(_,g.href),H=c(F,R,$,D);if(!H&&!a.has(F.toLowerCase()))continue;let T=xo(N);if(!So(e,T))continue;let Q={family:F,weightSpec:$,styleSpec:R,stretchSpec:D,unicodeRange:N,srcRaw:_,srcUrls:W,href:g.href};if(n&&f(Q,T))continue;if(!H){b.push({family:F.toLowerCase(),block:A,srcRaw:_,baseHref:g.href});continue}y.add(F.toLowerCase());let et=/url\(/i.test(_)?await nn(A,g.href,r):A;M+=et}M.trim()&&(m+=M)}catch{console.warn("[snapDOM] Failed to process stylesheet:",g.href)}let C={requiredIndex:a,usedCodepoints:e,faceMatchesRequired:c,coveredFamilies:y,provisionalFaces:b,simpleExcluder:n?ho(n):null,useProxy:r,visitedSheets:new Set,depth:0};for(let g of i.styleSheets)if(!(g.href&&S.some(w=>w.href===g.href)))try{let w=g.href||location.origin+"/";w&&C.visitedSheets.add(w),await vo(g,w,async v=>{m+=v},C)}catch{}for(let g of b)y.has(g.family)||(m+=/url\(/i.test(g.srcRaw)?await nn(g.block,g.baseHref,r):g.block);try{for(let g of i.fonts||[]){if(!g||!g.family||g.status!=="loaded"||!g._snapdomSrc)continue;let w=String(g.family).replace(/^['"]+|['"]+$/g,"");if(ct(w)||!a.has(w.toLowerCase())||n?.families&&n.families.some(M=>String(M).toLowerCase()===w.toLowerCase()))continue;let v=g._snapdomSrc;if(!String(v).startsWith("data:")){if(x.resource?.has(g._snapdomSrc))v=x.resource.get(g._snapdomSrc),x.font?.add(g._snapdomSrc);else if(!x.font?.has(g._snapdomSrc))try{let M=await j(g._snapdomSrc,{as:"dataURL",useProxy:r,silent:!0});if(M.ok&&typeof M.data=="string")v=M.data,x.resource?.set(g._snapdomSrc,v),x.font?.add(g._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",g._snapdomSrc);continue}}m+=`@font-face{font-family:'${w}';src:url(${v});font-style:${g.style||"normal"};font-weight:${g.weight||"normal"};}`}}catch{}for(let g of o){if(!g||typeof g!="object")continue;let w=String(g.family||"").replace(/^['"]+|['"]+$/g,"");if(!w||ct(w)||!a.has(w.toLowerCase())||n?.families&&n.families.some($=>String($).toLowerCase()===w.toLowerCase()))continue;let v=g.weight!=null?String(g.weight):"normal",M=g.style!=null?String(g.style):"normal",A=g.stretchPct!=null?`${g.stretchPct}%`:"100%",k=String(g.src||""),F=k;if(!F.startsWith("data:")){if(x.resource?.has(k))F=x.resource.get(k),x.font?.add(k);else if(!x.font?.has(k))try{let $=await j(k,{as:"dataURL",useProxy:r,silent:!0});if($.ok&&typeof $.data=="string")F=$.data,x.resource?.set(k,F),x.font?.add(k);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",k);continue}}m+=`@font-face{font-family:'${w}';src:url(${F});font-style:${M};font-weight:${v};font-stretch:${A};}`}return m&&(m=gs(m),x.resource?.set(l,m)),m}function ee(t,e){let n=new Set,o=new Set;if(!t)return{required:n,usedCodepoints:o};let r=c=>{if(c)for(let f of c)o.add(f.codePointAt(0))},s=c=>{let f=is(c.fontFamily);if(f.length)for(let l of f)n.add(`${l}__${Me(c.fontWeight)}__${Ee(c.fontStyle)}__${ss(c.fontStretch)}`)},i=c=>{s(L(c));for(let f of["::before","::after"]){let l=L(c,f),d=l&&l.content;if(!(!d||d==="none"||d==="normal"))if(s(l),/^["']/.test(d))r(d.slice(1,-1));else{let u=d.match(/\\[0-9A-Fa-f]{1,6}/g);if(u)for(let p of u)try{o.add(parseInt(p.slice(1),16))}catch{}}}};i(t);let a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;a.nextNode();){let c=a.currentNode;if(c.nodeType===Node.TEXT_NODE){if(e&&c.parentElement&&!e(c.parentElement))continue;r(c.nodeValue||"")}else{if(e&&!e(c))continue;i(c)}}return{required:n,usedCodepoints:o}}function Co(t,e){return ee(t,e).required}async function Ut(t,e=2,n=document){try{await n.fonts.ready}catch{}let o=Array.from(t||[]).filter(Boolean);if(o.length===0)return;let r=()=>{let s=n.createElement("div");s.setAttribute("data-snapdom-internal",""),s.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let i of o){let a=n.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${i}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",s.appendChild(a)}n.body.appendChild(s),s.offsetWidth,n.body.removeChild(s)};for(let s=0;s<Math.max(1,e);s++)r(),await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i)))}function Eo(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Ao(t,e=!1){let n="",o=Math.max(1,t);for(;o>0;)o--,n=String.fromCharCode(97+o%26)+n,o=Math.floor(o/26);return e?n.toUpperCase():n}function ko(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"]],o=Math.max(1,Math.min(3999,t)),r="";for(let[s,i]of n)for(;o>=s;)r+=i,o-=s;return e?r:r.toLowerCase()}function Mo(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":return Ao(t,!1);case"upper-alpha":return Ao(t,!0);case"lower-roman":return ko(t,!1);case"upper-roman":return ko(t,!0);default:return String(t)}}function Fo(t){let e=new WeakMap,n=t instanceof Document?t.documentElement:t,o=f=>f&&f.tagName==="LI",r=f=>{let l=0,d=f?.parentElement;if(!d)return 0;for(let u of d.children){if(u===f)break;u.tagName==="LI"&&l++}return l},s=f=>{let l=new Map;for(let[d,u]of f)l.set(d,u.slice());return l},i=(f,l,d)=>{let u=s(f),p;try{p=d.style?.counterReset||getComputedStyle(d).counterReset}catch{}if(p&&p!=="none")for(let y of p.split(",")){let b=y.trim().split(/\s+/),S=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!S)continue;let g=l.get(S);if(g&&g.length){let w=g.slice();w.push(C),u.set(S,w)}else u.set(S,[C])}let h;try{h=d.style?.counterSet||getComputedStyle(d).counterSet}catch{}if(h&&h!=="none")for(let y of h.split(",")){let b=y.trim().split(/\s+/),S=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!S)continue;let g=u.get(S)||[];g.length===0&&g.push(0),g[g.length-1]=C,u.set(S,g)}let m;try{m=d.style?.counterIncrement||getComputedStyle(d).counterIncrement}catch{}if(m&&m!=="none")for(let y of m.split(",")){let b=y.trim().split(/\s+/),S=b[0],C=Number.isFinite(Number(b[1]))?Number(b[1]):1;if(!S)continue;let g=u.get(S)||[];g.length===0&&g.push(0),g[g.length-1]+=C,u.set(S,g)}try{if(getComputedStyle(d).display==="list-item"&&o(d)){let b=d.parentElement,S=1;if(b&&b.tagName==="OL"){let g=b.getAttribute("start"),w=Number.isFinite(Number(g))?Number(g):1,v=r(d),M=d.getAttribute("value");S=Number.isFinite(Number(M))?Number(M):w+v}else S=1+r(d);let C=u.get("list-item")||[];C.length===0&&C.push(0),C[C.length-1]=S,u.set("list-item",C)}}catch{}return u},a=(f,l,d)=>{let u=i(d,l,f);e.set(f,u);let p=u;for(let m of f.children)p=a(m,u,p);let h=new Map;for(let[m,y]of d){let b=y.length,S=p.get(m);h.set(m,S&&S.length?S.slice(0,b):y.slice())}for(let[m,y]of p)!h.has(m)&&y.length&&!l.has(m)&&h.set(m,y.slice(0,1));return h},c=new Map;return a(n,c,c),{get(f,l){let d=e.get(f)?.get(l);return d&&d.length?d[d.length-1]:0},getStack(f,l){let d=e.get(f)?.get(l);return d?d.slice():[]}}}function $o(t,e,n){if(!t||t==="none")return t;try{let o=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(o,(r,s,i)=>{let a=String(i).split(",").map(c=>c.trim());if(s==="counter"){let c=a[0]?.replace(/^["']|["']$/g,""),f=(a[1]||"decimal").toLowerCase(),l=n.get(e,c);return Mo(l,f)}else{let c=a[0]?.replace(/^["']|["']$/g,""),f=a[1]?.replace(/^["']|["']$/g,"")??"",l=(a[2]||"decimal").toLowerCase(),d=n.getStack(e,c);return d.length?d.map(p=>Mo(p,l)).join(f):""}})}catch{return"- "}}wt();var Dt=new WeakMap,Ro=1e3;function xs(t,e){let n=Po(t);return e?(e.__pseudoPreflightFp!==n&&(e.__pseudoPreflight=Lo(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):Lo(t,n)}function sn(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function Po(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,o=0;for(let s=0;s<e.length;s++){let i=e[s];if(i.tagName==="STYLE"){let a=i.textContent?i.textContent.length:0;n+=`S${a}|`;let c=i.sheet,f=c?sn(c):null;f&&(o+=f.length)}else{let a=i.getAttribute("href")||"",c=i.getAttribute("media")||"all";n+=`L${a}|m:${c}|`;let f=i.sheet,l=f?sn(f):null;l&&(o+=l.length)}}let r=t.adoptedStyleSheets;return n+=`ass:${Array.isArray(r)?r.length:0}|tr:${o}`,n}function To(t,e,n){let o=sn(t);if(!o)return!1;for(let r=0;r<o.length;r++){if(n.budget<=0)return!1;let s=o[r],i=s&&s.cssText?s.cssText:"";n.budget--;for(let a of e)if(i.includes(a))return!0;if(s&&s.cssRules&&s.cssRules.length)for(let a=0;a<s.cssRules.length&&n.budget>0;a++){let c=s.cssRules[a],f=c&&c.cssText?c.cssText:"";n.budget--;for(let l of e)if(f.includes(l))return!0}if(n.budget<=0)return!1}return!1}function Lo(t=document,e=Po(t)){let n=Dt.get(t);if(n&&n.fingerprint===e)return n.result;let o=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],r=t.querySelectorAll("style");for(let i=0;i<r.length;i++){let a=r[i].textContent||"";for(let c of o)if(a.includes(c))return Dt.set(t,{fingerprint:e,result:!0}),!0}let s=t.adoptedStyleSheets;if(Array.isArray(s)&&s.length){let i={budget:Ro};try{for(let a of s)if(To(a,o,i))return Dt.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let i=t.querySelectorAll('style,link[rel~="stylesheet"]'),a={budget:Ro};for(let c=0;c<i.length&&a.budget>0;c++){let f=i[c],l=null;if(f.tagName,l=f.sheet||null,l&&To(l,o,a))return Dt.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Dt.set(t,{fingerprint:e,result:!0}),!0):(Dt.set(t,{fingerprint:e,result:!1}),!1)}function No(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,o=t[`border${e}Style`];if(n>0&&o&&o!=="none"&&o!=="hidden")return!0}return!1}function Ss(t,e){let n=null,o=()=>{if(!n)try{n=Fo(t)}catch(r){I(e,"buildCounterContext failed",r),n={get:()=>0,getStack:()=>[]}}return n};return{get(r,s){return o().get(r,s)},getStack(r,s){return o().getStack(r,s)}}}function vs(t){let e=!1;for(let n=0;n<t.length;n++){let o=t[n];if(o==='"')e=!e;else if(o==="/"&&!e)return t.slice(0,n).trim()}return t}function Cs(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,o=0,r;for(;r=n.exec(t);){let i=t.slice(o,r.index).trim();i&&e.push(i),e.push(r[1]),o=n.lastIndex}let s=t.slice(o).trim();return s&&e.push(s),e.join("")}function an(t,e,n){let o=t.parentElement,r=o&&n?n.get(o):null;return r?{get(s,i){let a=e.get(s,i),c=r.get(i);return typeof c=="number"?Math.max(a,c):a},getStack(s,i){let a=e.getStack(s,i);if(!a.length)return a;let c=r.get(i);if(typeof c=="number"){let f=a.slice();return f[f.length-1]=Math.max(f[f.length-1],c),f}return a}}:e}function cn(t,e,n){let o=new Map;function r(f){let l=[];if(!f||f==="none")return l;for(let d of String(f).split(",")){let u=d.trim().split(/\s+/),p=u[0],h=Number.isFinite(Number(u[1]))?Number(u[1]):void 0;p&&l.push({name:p,num:h})}return l}let s=r(e?.counterReset),i=r(e?.counterSet),a=r(e?.counterIncrement);function c(f){if(o.has(f))return o.get(f).slice();let l=n.getStack(t,f);l=l.length?l.slice():[];let d=s.find(h=>h.name===f);if(d){let h=Number.isFinite(d.num)?d.num:0;l=l.length?[...l,h]:[h]}let u=i.find(h=>h.name===f);if(u){let h=Number.isFinite(u.num)?u.num:0;l.length===0&&(l=[0]),l[l.length-1]=h}let p=a.find(h=>h.name===f);if(p){let h=Number.isFinite(p.num)?p.num:1;l.length===0&&(l=[0]),l[l.length-1]+=h}return o.set(f,l.slice()),l}return{get(f,l){let d=c(l);return d.length?d[d.length-1]:0},getStack(f,l){return c(l)},__incs:a}}function As(t,e,n,o){let r;try{r=L(t,e)}catch{}let s=r?.content;if(!s||s==="none"||s==="normal")return{text:"",incs:[]};s=vs(s);let i=an(t,n,o),a=cn(t,r,i),c=Eo(s)?$o(s,t,a):s;return{text:Cs(c),incs:a.__incs||[]}}async function Re(t,e,n,o){if(t?.nodeType!==1||e?.nodeType!==1||t.tagName==="TEXTAREA")return;let r=t.ownerDocument||document;if(!xs(r,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=Ss(t.ownerDocument||document,n));let s=n.__counterCtx;for(let a of["::before","::after","::first-letter"])try{let c=L(t,a);if(!c||c.content==="none"&&c.backgroundImage==="none"&&c.backgroundColor==="transparent"&&!No(c)&&(!c.transform||c.transform==="none")&&c.display==="inline")continue;if(a==="::first-letter"){let P=L(t),O=(P?.display||"").toLowerCase();if(O.includes("flex")||O.includes("grid"))continue;let U=dt=>c[dt]!==P[dt]&&(parseFloat(c[dt])||0)!==0;if(!(c.color!==P.color||c.fontSize!==P.fontSize||c.fontWeight!==P.fontWeight||c.fontFamily!==P.fontFamily||c.fontStyle!==P.fontStyle||c.textTransform!==P.textTransform||c.float!==P.float&&c.float!=="none"||U("paddingTop")||U("paddingRight")||U("paddingBottom")||U("paddingLeft")||U("marginTop")||U("marginRight")||U("marginBottom")||U("marginLeft")))continue;let G=Array.from(e.childNodes).find(dt=>dt.nodeType===Node.TEXT_NODE&&dt.textContent?.trim().length>0);if(!G)continue;let ft=G.textContent,ut=ft.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],Tt=ft.slice(ut?.length||0);if(!ut||/[\uD800-\uDFFF]/.test(ut))continue;let nt=document.createElement("span");nt.textContent=ut,nt.dataset.snapdomPseudo="::first-letter";let Lt=ye(c),Nt=It(Lt,"span");n.styleMap.set(nt,Nt);let Ct=document.createTextNode(Tt);e.replaceChild(Ct,G),e.insertBefore(nt,Ct);continue}let l=c.content??"",d=l===""||l==="none"||l==="normal",{text:u,incs:p}=As(t,a,s,n.__siblingCounters),h=c.backgroundImage,m=c.backgroundColor,y=c.fontFamily,b=parseInt(c.fontSize)||32,S=parseInt(c.fontWeight)||!1,C=c.color||"#000",g=c.transform,w=ct(y),v=!d&&u!=="",M=h&&h!=="none",A=m&&m!=="transparent"&&m!=="rgba(0, 0, 0, 0)",k=No(c),F=g&&g!=="none",$=l!=="none"&&l!=="normal",R=$&&((parseFloat(c.width)||0)>0||(parseFloat(c.height)||0)>0),D=$&&c.boxShadow&&c.boxShadow!=="none",N=$&&c.outlineStyle&&c.outlineStyle!=="none"&&(parseFloat(c.outlineWidth)||0)>0;if(!(v||M||A||k||F||R||D||N)){if(p&&p.length&&t.parentElement){let P=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:O}of p){if(!O)continue;let U=an(t,s,n.__siblingCounters),G=cn(t,L(t,a),U).get(t,O);P.set(O,G)}n.__siblingCounters.set(t.parentElement,P)}continue}let W=u.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(u),H=!1;if(v&&!w&&u.length>1&&!W){let P=L(t),O=parseFloat(P.fontSize)||16,U=parseFloat(P.lineHeight);Number.isFinite(U)||(U=O*1.5),t.getBoundingClientRect().height<U*1.6&&(e.style.whiteSpace="nowrap",H=!0)}let T=document.createElement("span");T.dataset.snapdomPseudo=a,T.style.pointerEvents="none",H&&(T.style.whiteSpace="nowrap");let Q=ye(c),et=(L(t).display||"").toLowerCase(),pt=et.includes("flex")||et.includes("grid");if(pt){let P=Q["min-width"];(!P||P==="auto"||P==="0px")&&(Q["min-width"]="0px")}let mt=It(Q,"span",v,pt);if(n.styleMap.set(T,mt),w&&u&&u.length===1){let{dataUrl:P,width:O,height:U}=await yo(u,y,S,b,C),z=document.createElement("img");z.src=P,z.style=`height:${b}px;width:${O/U*b}px;object-fit:contain;`,T.appendChild(z),e.dataset.snapdomHasIcon="true"}else if(u&&W){let P=Xt(u,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Mt(u);if(P?.trim())try{let O=await j(bt(P),{as:"dataURL",useProxy:o.useProxy});if(O?.ok&&typeof O.data=="string"){let U=document.createElement("img");U.src=O.data,U.style=`width:${b}px;height:auto;object-fit:contain;`,T.appendChild(U)}}catch(O){console.error(`[snapdom] Error in pseudo ${a} for`,t,O)}}else!w&&v&&(T.textContent=u);T.style.backgroundImage="none","maskImage"in T.style&&(T.style.maskImage="none"),"webkitMaskImage"in T.style&&(T.style.webkitMaskImage="none");try{T.style.backgroundRepeat=c.backgroundRepeat,T.style.backgroundSize=c.backgroundSize,c.backgroundPositionX&&c.backgroundPositionY?(T.style.backgroundPositionX=c.backgroundPositionX,T.style.backgroundPositionY=c.backgroundPositionY):T.style.backgroundPosition=c.backgroundPosition,T.style.backgroundOrigin=c.backgroundOrigin,T.style.backgroundClip=c.backgroundClip,T.style.backgroundAttachment=c.backgroundAttachment,T.style.backgroundBlendMode=c.backgroundBlendMode}catch{}if(M)try{let P=_t(h),O=await Promise.all(P.map(Et));T.style.backgroundImage=O.join(", ")}catch(P){console.warn(`[snapdom] Failed to inline background-image for ${a}`,P)}A&&(T.style.backgroundColor=m);let ht=T.childNodes.length>0||T.textContent?.trim()!==""||M||A||k||F||R||D||N;if(p&&p.length&&t.parentElement){let P=n.__siblingCounters.get(t.parentElement)||new Map,O=an(t,s,n.__siblingCounters),U=cn(t,L(t,a),O);for(let{name:z}of p){if(!z)continue;let G=U.get(t,z);P.set(z,G)}n.__siblingCounters.set(t.parentElement,P)}if(!ht)continue;a==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(T,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(T))}catch(c){console.warn(`[snapdom] Failed to capture ${a} for`,t,c)}let i=Array.from(e.children).filter(a=>!a.dataset.snapdomPseudo);if(n.nodeMap)for(let a of i){let c=n.nodeMap.get(a);c?.nodeType===1&&await Re(c,a,n,o)}else{let a=Array.from(t.children);for(let c=0;c<Math.min(a.length,i.length);c++)await Re(a[c],i[c],n,o)}}function Io(t,e){if(!t||t?.nodeType!==1)return;let n=t.ownerDocument||document,o=e||n,r=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(r.length===0)return;let s=/url\(\s*#([^)]+)\)/g,i=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],a=g=>window.CSS&&CSS.escape?CSS.escape(g):g.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c="http://www.w3.org/1999/xlink",f=g=>{if(!g||!g.getAttribute)return null;let w=g.getAttribute("href")||g.getAttribute("xlink:href")||(typeof g.getAttributeNS=="function"?g.getAttributeNS(c,"href"):null);if(w)return w;let v=g.attributes;if(!v)return null;for(let M=0;M<v.length;M++){let A=v[M];if(!A||!A.name)continue;if(A.name==="href")return A.value;let k=A.name.indexOf(":");if(k!==-1&&A.name.slice(k+1)==="href")return A.value}return null},l=new Set(Array.from(t.querySelectorAll("[id]")).map(g=>g.id)),d=new Set,u=!1,p=(g,w=null)=>{if(!g)return;s.lastIndex=0;let v;for(;v=s.exec(g);){u=!0;let M=(v[1]||"").trim();M&&(l.has(M)||(d.add(M),w&&!w.has(M)&&w.add(M)))}},h=g=>{let w=g.querySelectorAll("use");for(let A of w){let k=f(A);if(!k||!k.startsWith("#"))continue;u=!0;let F=k.slice(1).trim();F&&!l.has(F)&&d.add(F)}let v='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';p(g.getAttribute("style")||"");for(let A of i)p(g.getAttribute(A));let M=g.querySelectorAll(v);for(let A of M){p(A.getAttribute("style")||"");for(let k of i)p(A.getAttribute(k))}};for(let g of r)h(g);if(!u)return;let m=t.querySelector("svg.inline-defs-container");m||(m=n.createElementNS("http://www.w3.org/2000/svg","svg"),m.classList.add("inline-defs-container"),m.setAttribute("aria-hidden","true"),m.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(m,t.firstChild||null));let y=m.querySelector("defs")||null,b=g=>{if(!g||l.has(g))return null;let w=a(g),v=M=>{let A=o.querySelector(M);return A&&!t.contains(A)?A:null};return v(`svg defs > *#${w}`)||v(`svg > symbol#${w}`)||v(`*#${w}`)};if(!d.size)return;let S=new Set(d),C=new Set;for(;S.size;){let g=S.values().next().value;if(S.delete(g),!g||l.has(g)||C.has(g))continue;let w=b(g);if(!w){C.add(g);continue}y||(y=n.createElementNS("http://www.w3.org/2000/svg","defs"),m.appendChild(y));let v=w.cloneNode(!0);v.id||v.setAttribute("id",g),y.appendChild(v),C.add(g),l.add(g);let M=[v,...v.querySelectorAll("*")];for(let A of M){let k=f(A);if(k&&k.startsWith("#")){let $=k.slice(1).trim();$&&!l.has($)&&!C.has($)&&S.add($)}let F=A.getAttribute?.("style")||"";F&&p(F,S);for(let $ of i){let R=A.getAttribute?.($);R&&p(R,S)}}}}tt();function _o(t){let e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,r=e.borderStyle,s=e.borderWidth,i=n!=="none"&&parseFloat(o)>0,a=r==="none"||parseFloat(s)===0;if(i&&a){let c=t.style.border;return t.style.border=`${o} solid transparent`,()=>{t.style.border=c}}return()=>{}}function Wo(t){let e=[];try{let n=t.querySelectorAll("*");for(let o of n){if(!(o instanceof HTMLElement))continue;let r=o.style.contentVisibility||"",s=getComputedStyle(o);(s.contentVisibility||s.getPropertyValue("content-visibility")||"")==="auto"&&(e.push({el:o,original:r}),o.style.contentVisibility="visible")}if(t instanceof HTMLElement){let o=getComputedStyle(t);(o.contentVisibility||o.getPropertyValue("content-visibility")||"")==="auto"&&(e.push({el:t,original:t.style.contentVisibility||""}),t.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:n,original:o}of e)try{n.style.contentVisibility=o}catch{}}}rt();Kt();function Oo(t){return Uo(t.boxShadow)}function Bo(t){return Uo(t.textShadow)}function Uo(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",o=0;for(let c=0;c<t.length;c++){let f=t[c];f==="("?o++:f===")"&&(o=Math.max(0,o-1)),f===","&&o===0?(e.push(n),n=""):n+=f}n.trim()&&e.push(n);let r=0,s=0,i=0,a=0;for(let c of e){if(/\binset\b/i.test(c))continue;let f=c.match(/-?\d+(\.\d+)?px/g)?.map(y=>parseFloat(y))||[];if(f.length<2)continue;let[l,d,u=0,p=0]=f,h=Math.abs(l)+u+p,m=Math.abs(d)+u+p;s=Math.max(s,h+Math.max(l,0)),a=Math.max(a,h+Math.max(-l,0)),i=Math.max(i,m+Math.max(d,0)),r=Math.max(r,m+Math.max(-d,0))}return{top:Math.ceil(r),right:Math.ceil(s),bottom:Math.ceil(i),left:Math.ceil(a)}}function Do(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,o=0,r;for(;r=n.exec(e);)o+=parseFloat(r[1])||0;let s=Math.ceil(o);return{top:s,right:s,bottom:s,left:s}}function Ho(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,o=e+Math.max(0,Math.ceil(n));return{top:o,right:o,bottom:o,left:o}}function zo(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],o=0,r=0,s=0,i=0,a=!1;for(let c of n){a=!0;let f=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(m=>parseFloat(m))||[],[l=0,d=0,u=0]=f,p=Math.abs(l)+u,h=Math.abs(d)+u;r=Math.max(r,p+Math.max(l,0)),i=Math.max(i,p+Math.max(-l,0)),s=Math.max(s,h+Math.max(d,0)),o=Math.max(o,h+Math.max(-d,0))}return{bleed:{top:E(o),right:E(r),bottom:E(s),left:E(i)},has:a}}function Vo(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let o=n.transform||"none";if(!o||o==="none"){let a=null;try{a=zt(t).scale}catch{}try{e.style.transform="none"}catch{}if(!a)return{a:1,b:0,c:0,d:1};let c=a.trim().split(/\s+/).map(parseFloat),f=Number.isFinite(c[0])?c[0]:1,l=Number.isFinite(c[1])?c[1]:f;return{a:f,b:0,c:0,d:l}}function r(a,c,f,l){let d=Math.sqrt(a*a+c*c)||0,u=0,p=0;if(d>0){let h=a/d,m=c/d;u=h*f+m*l;let y=f-h*u,b=l-m*u;p=Math.sqrt(y*y+b*b)||0,p>0?u=u/p:u=0}return{a:d,b:0,c:u*p,d:p}}let s=o.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let a=s[1].split(",").map(c=>parseFloat(c.trim()));if(a.length===6&&a.every(Number.isFinite)){let[c,f,l,d]=a,u=r(c,f,l,d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return u}}let i=o.match(/^matrix3d\(\s*([^)]+)\)$/i);if(i){let a=i[1].split(",").map(c=>parseFloat(c.trim()));if(a.length===16&&a.every(Number.isFinite)){let c=a[0],f=a[1],l=a[4],d=a[5],u=r(c,f,l,d);try{e.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, 0, 0)`}catch{}return u}}try{let a=new DOMMatrix(o),c=r(a.a,a.b,a.c,a.d);try{e.style.transform=`matrix(${c.a}, ${c.b}, ${c.c}, ${c.d}, 0, 0)`}catch{}return c}catch{return null}}function Ht(t,e,n,o,r){let s=n.a,i=n.b,a=n.c,c=n.d,f=n.e||0,l=n.f||0;function d(b,S){let C=b-o,g=S-r,w=s*C+a*g,v=i*C+c*g;return w+=o+f,v+=r+l,[w,v]}let u=[d(0,0),d(t,0),d(0,e),d(t,e)],p=1/0,h=1/0,m=-1/0,y=-1/0;for(let[b,S]of u)b<p&&(p=b),S<h&&(h=S),b>m&&(m=b),S>y&&(y=S);return{minX:p,minY:h,maxX:m,maxY:y,width:m-p,height:y-h}}function ne(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[r,s]=[o[0]||"0",o[1]||"0"],i=(a,c)=>{let f=a.toLowerCase();return f==="left"||f==="top"?0:f==="center"?c/2:f==="right"||f==="bottom"?c:f.endsWith("px")?parseFloat(f)||0:f.endsWith("%")?(parseFloat(f)||0)*c/100:/^-?\d+(\.\d+)?$/.test(f)&&parseFloat(f)||0};return{ox:i(r,e),oy:i(s,n)}}function zt(t){let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let r=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},s=r("rotate");if(s)if(s.angle){let c=s.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else s.unit?e.rotate=s.unit==="rad"?s.value*180/Math.PI+"deg":s.value+s.unit:e.rotate=String(s);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let i=r("scale");if(i){let c="x"in i&&i.x?.value!=null?i.x.value:Array.isArray(i)?i[0]?.value:Number(i)||1,f="y"in i&&i.y?.value!=null?i.y.value:Array.isArray(i)?i[1]?.value:c;e.scale=`${c} ${f}`}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let a=r("translate");if(a){let c="x"in a&&"value"in a.x?a.x.value:Array.isArray(a)?a[0]?.value:0,f="y"in a&&"value"in a.y?a.y.value:Array.isArray(a)?a[1]?.value:0,l="x"in a&&a.x?.unit?a.x.unit:"px",d="y"in a&&a.y?.unit?a.y.unit:"px";e.translate=`${c}${l} ${f}${d}`}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return e}let o=getComputedStyle(t);return e.rotate=o.rotate&&o.rotate!=="none"?o.rotate:"0deg",e.scale=o.scale&&o.scale!=="none"?o.scale:null,e.translate=o.translate&&o.translate!=="none"?o.translate:null,e}var ln=null;function ks(){if(ln)return ln;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),ln=t,t}function jo(t){let e=ks(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform),t.rotate&&(n.style.rotate=t.rotate),t.scale&&(n.style.scale=t.scale),t.translate&&(n.style.translate=t.translate),e.appendChild(n);let o=Ms(n);return e.removeChild(n),o}function qo(t){let e=L(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",s=e.scale&&e.scale!=="none"&&e.scale!=="1",i=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(r||s||i)}function Ms(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}function Te(t,e){if(!e)return null;let n=t.ownerDocument||document,o=n.defaultView||window,r,s,i,a;if(e==="viewport")r=0,s=0,i=n.documentElement?.clientWidth||o.innerWidth,a=n.documentElement?.clientHeight||o.innerHeight;else if(typeof e=="object")r=(Number(e.x)||0)-(o.scrollX||0),s=(Number(e.y)||0)-(o.scrollY||0),i=Number(e.width),a=Number(e.height);else return null;return i>0&&a>0?{left:r,top:s,width:i,height:a,right:r+i,bottom:s+a}:null}function fn(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return e instanceof ShadowRoot?e.host:null}function Es(t,e){for(let n=e;n;n=fn(n))if(n===t)return!0;return!1}function Fs(t,e){for(let n=fn(t);n&&n!==e&&n?.nodeType===1;n=fn(n)){let o=L(n);if(o.position!=="static"||o.transform&&o.transform!=="none"||o.filter&&o.filter!=="none"||o.backdropFilter&&o.backdropFilter!=="none"||o.perspective&&o.perspective!=="none"||/transform|perspective|filter/.test(o.willChange||"")||/layout|paint|strict|content/.test(o.contain||""))return n}return null}function dn(t,e){try{let n=new DOMMatrix;if(e&&e.rotate&&e.rotate!=="0deg"&&(n=n.multiply(new DOMMatrix(`rotate(${e.rotate})`))),e&&e.scale){let o=String(e.scale).trim().split(/\s+/).filter(Boolean);o.length&&o.every(r=>Number.isFinite(Number(r)))&&(n=n.multiply(new DOMMatrix(`scale(${o.join(",")})`)))}return t&&(n=n.multiply(new DOMMatrix(t))),n}catch{return null}}function Qo(t,e,n,o,r){let s=t.getBoundingClientRect();e instanceof HTMLElement&&L(t).position==="static"&&(e.style.position="relative");let i=[];for(let[a,c]of n){if(!(a instanceof HTMLElement)||c?.nodeType!==1||c===t||!Es(t,c))continue;let f=o.get(c)||L(c),l=f.position;if(l!=="fixed"&&l!=="sticky"&&l!=="-webkit-sticky"||a.style.position==="absolute")continue;let d=c.getBoundingClientRect();if(!(d.width>0&&d.height>0))continue;let u=f.transform&&f.transform!=="none"?f.transform:"",p=zt(c),h=!!(u||p.rotate!=="0deg"||p.scale||p.translate),m=h?dn(u,p):null,y=!m||!m.is2D||m.a===1&&m.b===0&&m.c===0&&m.d===1,b=d.width,S=d.height;y||(b=c.offsetWidth||d.width,S=c.offsetHeight||d.height);let C=c.getRootNode&&c.getRootNode()instanceof ShadowRoot,g=s,w=t.clientLeft||0,v=t.clientTop||0;if(C){let $=Fs(c,t);$&&(g=$.getBoundingClientRect(),w=$.clientLeft||0,v=$.clientTop||0)}let M=d.left-g.left-w,A=d.top-g.top-v;if(h)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",y)a.style.transform="none";else{a.style.transform=`matrix(${m.a},${m.b},${m.c},${m.d},0,0)`;let{ox:$,oy:R}=ne(f,b,S),D=Ht(b,S,{a:m.a,b:m.b,c:m.c,d:m.d,e:0,f:0},$,R);M-=D.minX,A-=D.minY}if(l!=="fixed"){let $=a.cloneNode(!1);$.setAttribute("data-snap-ph","1"),$.style.position="static",$.style.visibility="hidden",$.style.width=`${b}px`,$.style.height=`${S}px`,$.style.boxSizing="border-box",a.parentElement?.insertBefore($,a)}let k=b+2,F=S;r&&(Math.abs(A-r.y)<.5&&(A-=1,F+=1),Math.abs(M-r.x)<.5&&(M-=1,k+=1)),a.style.position="absolute",a.style.left=`${M}px`,a.style.top=`${A}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${k}px`,a.style.height=`${F}px`,a.style.boxSizing="border-box",C||i.push(a)}for(let a of i)e.appendChild(a)}function Zo(t,e,n={}){if(!t||!e||!e.style)return;let o=getComputedStyle(t);try{e.style.boxShadow="none"}catch(i){I(n,"stripRootShadows boxShadow",i)}try{e.style.textShadow="none"}catch(i){I(n,"stripRootShadows textShadow",i)}try{e.style.outline="none"}catch(i){I(n,"stripRootShadows outline",i)}let s=(o.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=s.length?s:"none"}catch(i){I(n,"stripRootShadows filter",i)}}function Jo(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 Xo(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",o=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||o!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function $s(t,e){let n=Array.from(t.childNodes),o=e==="top"?n:n.reverse();for(let r of o){if(r.nodeType===Node.TEXT_NODE){if(/\S/.test(r.textContent||""))return null;continue}if(r.nodeType!==Node.ELEMENT_NODE)continue;let s=getComputedStyle(r),i=String(s.display||"");if(!(i==="none"||i==="contents")&&!(s.position==="absolute"||s.position==="fixed"))return s.float&&s.float!=="none"||i.startsWith("inline")?null:r}return null}function tr(t,e,n){if(!t||!e||!e.style)return;let o=getComputedStyle(t);if(!Xo(o))for(let r of["top","bottom"]){let s=r==="top"?"Top":"Bottom";if((parseFloat(o[`border${s}Width`])||0)>0||(parseFloat(o[`padding${s}`])||0)>0)continue;let i=t,a=e;for(;i&&a;){let c=$s(i,r);if(!c)break;let f=n?Array.from(a.children).find(u=>n.get(u)===c)||null:a.children[Array.from(i.children).indexOf(c)]||null,l=getComputedStyle(c),d=parseFloat(l[`margin${s}`])||0;if(f&&f.style&&d>0&&(f.style[`margin${s}`]="0px"),Xo(l)||(parseFloat(l[`border${s}Width`])||0)>0||(parseFloat(l[`padding${s}`])||0)>0)break;i=c,a=f}}}function Rs(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),n=[];for(;e.nextNode();)n.push(e.currentNode);for(let o of n)o.remove()}function Ts(t,e={}){let{stripFrameworkDirectives:n=!0}=e,o=new Set(["xml","xlink"]),r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;r.nextNode();){let s=r.currentNode;for(let i of Array.from(s.attributes)){let a=i.name;if(a.startsWith("*")){s.removeAttribute(a);continue}if(a.includes("@")){s.removeAttribute(a);continue}if(a.includes(":")){let c=a.split(":",1)[0];if(!o.has(c)){s.removeAttribute(a);continue}}if(n&&(a.startsWith("x-")||a.startsWith("v-")||a.startsWith(":")||a.startsWith("on:")||a.startsWith("bind:")||a.startsWith("let:")||a.startsWith("class:"))){s.removeAttribute(a);continue}}}}var Go=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function Ls(t){if(!t)return;let e=r=>{if(r.nodeType===Node.ELEMENT_NODE){if(r.attributes)for(let s of Array.from(r.attributes)){let i=s.value.replace(Go,"");if(i!==s.value)try{r.setAttribute(s.name,i)}catch{}}}else if(r.nodeType===Node.TEXT_NODE||r.nodeType===Node.CDATA_SECTION_NODE){let s=r.data.replace(Go,"");s!==r.data&&(r.data=s)}};e(t);let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),o;for(;o=n.nextNode();)e(o)}function er(t,e={}){t&&(Ts(t,e),Rs(t),Ls(t))}function Ns(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function Ps(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Is(t,e){if(t?.nodeType!==1||Ns(t)||Ps(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let o=e.display||"";return!(o.includes("flex")||o.includes("grid")||o.startsWith("table")||e.transform&&e.transform!=="none")}function nr(t,e,n=new Map){function o(r,s){if(r?.nodeType!==1||s?.nodeType!==1)return;let i=r.childElementCount>s.childElementCount,a=n.get(r)||getComputedStyle(r);if(n.has(r)||n.set(r,a),i&&Is(r,a)){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=a.overflowY||a.overflowBlock||"visible",d=a.overflowX||a.overflowInline||"visible";(l!=="visible"||d!=="visible")&&(s.style.overflow="visible")}let c=Array.from(r.children),f=Array.from(s.children);for(let l=0;l<Math.min(c.length,f.length);l++)o(c[l],f[l])}o(t,e)}function _s(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function Ws(t,e){if(t?.nodeType!==1)return!1;if(t.getAttribute("data-capture")==="exclude"&&e?.excludeMode==="remove")return!0;if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch(o){I(e,"exclude selector match failed",o)}if(typeof e?.filter=="function"&&e.filterMode==="remove")try{if(!e.filter(t))return!0}catch(n){I(e,"filter function failed",n)}return!1}function or(t,e){let n=getComputedStyle(t),o=t.getBoundingClientRect(),r=1/0,s=-1/0,i=!1,a=Array.from(t.children);for(let p of a){if(Ws(p,e)||!_s(p))continue;let h=p.getBoundingClientRect(),m=h.top-o.top,y=h.bottom-o.top;y<=m||(m<r&&(r=m),y>s&&(s=y),i=!0)}let c=i?Math.max(0,s-r):0,f=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,u=parseFloat(n.paddingBottom)||0;return f+l+d+u+c}var E=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,Yo=.75;function rr(t,e,n,o,r,s){let i=t.ownerDocument||document,a=t.getBoundingClientRect(),c=r>0&&a.width>0?a.width/r:1,f=s>0&&a.height>0?a.height/s:1;if(Math.abs(c-f)>.02)return 0;let l=i.createElement("div");l.setAttribute("data-snapdom-internal",""),l.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+r+"px!important;overflow:visible!important;visibility:hidden!important;";let d=l.attachShadow({mode:"open"}),u=i.createElement("style");u.textContent=n,d.appendChild(u);let p=e.cloneNode(!0);d.appendChild(p),i.body.appendChild(l);let h=0;try{let m=(y,b)=>{let S=y.children,C=b.children,g=Math.min(S.length,C.length);for(let w=0;w<g;w++){let v=S[w],M=C[w],A=o.get(v);if(A?.nodeType===1&&v instanceof HTMLElement&&A.isConnected){let k=A.getBoundingClientRect();if(k.width>0&&k.height>0){let F=M.getBoundingClientRect(),$=F.width-k.width/c,R=F.height-k.height/f;(Math.abs($)>Yo||Math.abs(R)>Yo)&&(v.style.boxSizing="border-box",v.style.width=`${E(k.width/c)}px`,v.style.height=`${E(k.height/f)}px`,h++)}}m(v,M)}};m(e,p)}finally{l.remove()}return h}var Os=/::-webkit-scrollbar(-[a-z]+)?\b/i;function un(t,e=new Set){let n="";if(!t)return n;for(let o=0;o<t.length;o++){let r=t[o];try{if(r.type===CSSRule.IMPORT_RULE&&r.styleSheet){n+=un(r.styleSheet.cssRules,e);continue}if(r.type===CSSRule.MEDIA_RULE&&r.cssRules){let s=un(r.cssRules,e);s&&(n+=`@media ${r.conditionText}{${s}}`);continue}if(r.type===CSSRule.STYLE_RULE){let s=r.selectorText||"";if(Os.test(s)){let i=r.cssText;i&&!e.has(i)&&(e.add(i),n+=i)}}}catch{}}return n}var Ko=new WeakMap;function Bs(t){let e="";for(let n of t.styleSheets){let o=-1;try{o=n.cssRules?n.cssRules.length:-1}catch{}e+=(n.href||"inline")+":"+o+"|"}return e}function ir(t){if(!t||!t.styleSheets)return"";let e=Bs(t),n=Ko.get(t);if(n&&n.fp===e)return n.css;let o=new Set,r="";for(let s of Array.from(t.styleSheets))try{let i=s.cssRules;i&&(r+=un(i,o))}catch{}return Ko.set(t,{fp:e,css:r}),r}async function sr(t,e={}){let n=e.__session||x.session,o={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:e},r=null;if(e.clip){let u=Te(t,e.clip);if(u){o.clip={rect:u,root:t};let p=t.getBoundingClientRect();r={x:u.left-p.left,y:u.top-p.top,width:u.width,height:u.height}}}let s,i="",a="",c=_o(t),f=o.clip?()=>{}:Wo(t);try{s=await te(t,o,e)}catch(u){throw console.warn("deepClone failed:",u),u}finally{f(),c()}try{Io(s)}catch(u){console.warn("inlineExternal defs or symbol failed:",u)}try{await Re(t,s,o,e)}catch(u){console.warn("inlinePseudoElements failed:",u)}await io(s,o);try{let u=s.querySelectorAll("style[data-sd]");for(let p of u)a+=p.textContent||"",p.remove()}catch(u){I(o,"Failed to extract shadow CSS from style[data-sd]",u)}let l=je(o.styleMap);i=Array.from(l.entries()).map(([u,p])=>`.${p}{${u}}`).join(""),i=a+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+i;for(let[u,p]of o.styleMap.entries()){if(u.tagName==="STYLE")continue;if(u.getRootNode&&u.getRootNode()instanceof ShadowRoot){u.setAttribute("style",p.replace(/;/g,"; "));continue}let h=l.get(p);h&&u.classList.add(h);let m=u.style?.backgroundImage,y=u.dataset?.snapdomHasIcon;m&&m!=="none"&&(u.style.backgroundImage=m),y&&(u.style.verticalAlign="middle",u.style.display="inline")}if((o.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let u=o.clip&&r?{x:r.x,y:r.y}:{x:0,y:0};Qo(t,s,o.nodeMap,o.styleCache,u)}catch(u){I(o,"freezeViewportPositioned failed",u)}for(let[u,p]of o.nodeMap.entries()){if(o.clip&&p===t)continue;let h=p.scrollLeft,m=p.scrollTop;if((h||m)&&u?.nodeType===1&&u.namespaceURI==="http://www.w3.org/1999/xhtml"){u.style.overflow="hidden",u.style.scrollbarWidth="none",u.style.msOverflowStyle="none";try{let S=u.querySelectorAll("*");for(let C of S){if(C.nodeType!==1||C.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let g=C.style.position;if(g==="fixed"||g==="absolute"){let w=parseFloat(C.style.top)||0,v=parseFloat(C.style.left)||0;C.style.top=`${w+m}px`,C.style.left=`${v+h}px`,g==="fixed"&&(C.style.position="absolute")}}}catch{}let b=document.createElement("div");for(b.style.all="unset",b.style.transform=`translate(${-h}px, ${-m}px)`,b.style.willChange="transform",b.style.display="inline-block",b.style.width="100%";u.firstChild;)b.appendChild(u.firstChild);u.appendChild(b)}}if(t===o.nodeMap.get(s)){let u=o.styleCache.get(t)||L(t);o.styleCache.set(t,u);let p=Oe(u.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=p||""}for(let[u,p]of o.nodeMap.entries())p.tagName==="PRE"&&(u.style.marginTop="0",u.style.marginBlockStart="0");return{clone:s,classCSS:i,styleCache:o.styleCache,nodeMap:o.nodeMap,reconcileRisk:o.reconcileRisk||0,clipWindow:r}}wt();tt();var ar="http://www.w3.org/1999/xlink";function Us(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(ar,"href"):null)}function Ds(t){let e=parseInt(t.dataset?.snapdomWidth||"",10)||0,n=parseInt(t.dataset?.snapdomHeight||"",10)||0,o=parseInt(t.getAttribute("width")||"",10)||0,r=parseInt(t.getAttribute("height")||"",10)||0,s=parseFloat(t.style?.width||"")||0,i=parseFloat(t.style?.height||"")||0,a=e||s||o||t.width||t.naturalWidth||100,c=n||i||r||t.height||t.naturalHeight||100;return{width:a,height:c}}async function cr(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let o=async a=>{if(!a.getAttribute("src")){let h=a.currentSrc||a.src||Ot(a.getAttribute("srcset"),a)||"";h&&a.setAttribute("src",h)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let c=a.src||"";if(!c)return;let f=x.image?.get(c);if(f){a.src=f,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let l=await j(c,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){x.image?.set(c,l.data),a.src=l.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:d,height:u}=Ds(a),{fallbackURL:p}=e||{};if(p)try{let h=typeof p=="function"?await p({width:d,height:u,src:c,element:a}):p;if(h){let m=await j(h,{as:"dataURL",useProxy:e.useProxy});if(m?.ok&&typeof m.data=="string"){a.src=m.data,a.width||(a.width=d),a.height||(a.height=u);return}}}catch{}if(e.placeholders!==!1){let h=document.createElement("div");h.style.cssText=[`width:${d}px`,`height:${u}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${u}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),h.textContent="img",a.replaceWith(h)}else{let h=document.createElement("div");h.style.cssText=`display:inline-block;width:${d}px;height:${u}px;visibility:hidden;`,a.replaceWith(h)}},r=6;for(let a=0;a<n.length;a+=r){let c=n.slice(a,a+r).map(o);await Promise.allSettled(c)}let s=Array.from(t.querySelectorAll("image"));t.localName==="image"&&s.unshift(t);let i=async a=>{let c=Us(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let f=await j(c,{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(ar,"href"))};for(let a=0;a<s.length;a+=r){let c=s.slice(a,a+r).map(i);await Promise.allSettled(c)}}rt();tt();var pn=["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"],Hs=["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"],zs=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],Vs=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function js(t,e,n,o){let r=n.get(t)||L(t);n.has(t)||n.set(t,r);let s=r.getPropertyValue("border-image"),i=r.getPropertyValue("border-image-source"),a=s&&s!=="none"||i&&i!=="none",c=r.getPropertyValue("background-image"),f=r.getPropertyValue("background-color");if(c&&c!=="none"||f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"||/url\s*\(|gradient\s*\(/i.test(r.getPropertyValue("background")||""))for(let d of zs){let u=r.getPropertyValue(d);u&&e.style.setProperty(d,u)}for(let d of pn){let u=r.getPropertyValue(d);if(d==="background-image"&&(!u||u==="none")){let m=r.getPropertyValue("background");m&&/url\s*\(/.test(m)&&(u=_t(m).filter(y=>/url\s*\(/.test(y)).join(", ")||u)}if(!u||u==="none")continue;let p=_t(u),h=await Promise.all(p.map(m=>Et(m,o)));h.some(m=>m&&m!=="none"&&!/^url\(undefined/.test(m))&&e.style.setProperty(d,h.join(", "))}for(let d of Hs){let u=r.getPropertyValue(d);!u||u==="initial"||e.style.setProperty(d,u)}if(a)for(let d of Vs){let u=r.getPropertyValue(d);!u||u==="initial"||e.style.setProperty(d,u)}}async function lr(t,e,n,o={},r=x.session.nodeMap){if(!e)return;let s=[];t&&Qe(t)&&s.push([t,e]);let i=[e];for(;i.length;){let c=i.pop();if(c.children)for(let f of c.children){if(f.tagName==="STYLE")continue;let l=r.get(f);l&&Qe(l)&&s.push([l,f]),i.push(f)}}let a=6;for(let c=0;c<s.length;c+=a)await Promise.allSettled(s.slice(c,c+a).map(([f,l])=>js(f,l,n,o)))}tt();rt();function ur(t,e,n=x.session.nodeMap){let o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let a=r.currentNode;a;a=r.nextNode()){let c=n.get(a);if(c?.nodeType!==1)continue;let f=L(c),l=f.getPropertyValue("backdrop-filter")||f.getPropertyValue("-webkit-backdrop-filter");l&&l!=="none"&&a!==e&&o.push({cloneEl:a,orig:c,bf:l,path:Gs(e,a)})}if(!o.length)return;let s=t.getBoundingClientRect(),i=o.map((a,c)=>{let f=e.cloneNode(!0);Xs(f,e,a.orig.getBoundingClientRect(),n),Ys(fr(f,a.path));for(let l=0;l<c;l++){let d=fr(f,o[l].path);d&&(d.style.setProperty("backdrop-filter","none","important"),d.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...a,copy:f}});for(let{cloneEl:a,orig:c,bf:f,copy:l}of i)qs(a,c,f,l,s)}function qs(t,e,n,o,r){let s=e.getBoundingClientRect();if(!s.width||!s.height)return;let i=L(e),a=e.offsetWidth?s.width/e.offsetWidth:1,c=Math.abs(a-1)>.001?1/a:1;o.style.position="absolute",o.style.left=`${(r.left-s.left)*c}px`,o.style.top=`${(r.top-s.top)*c}px`,o.style.width=`${r.width}px`,o.style.height=`${r.height}px`,o.style.margin="0",o.style.filter=n,c!==1&&(o.style.transform=`scale(${c})`,o.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(o);let l=document.createElement("div");l.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",l.style.backgroundColor=i.backgroundColor,l.style.backgroundImage=t.style.backgroundImage||i.backgroundImage;for(let d of["background-size","background-position","background-repeat","background-origin","background-clip"])l.style.setProperty(d,i.getPropertyValue(d));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"),i.position==="static"&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(l),t.prepend(f)}var Le=128;function Xs(t,e,n,o){let r=[[t,e]];for(;r.length;){let[s,i]=r.pop(),a=o.get(i);if(a?.nodeType===1){let l=a.getBoundingClientRect();(l.left>n.right+Le||l.right<n.left-Le||l.top>n.bottom+Le||l.bottom<n.top-Le)&&(s.tagName==="IMG"&&s.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),s.style&&(s.style.backgroundImage="none"))}let c=s.children,f=i.children;for(let l=0;l<c.length;l++)r.push([c[l],f[l]])}}function Gs(t,e){let n=[];for(let o=e;o!==t;o=o.parentElement){if(!o?.parentElement)return null;n.push([...o.parentElement.children].indexOf(o))}return n.reverse()}function fr(t,e){if(!e)return null;let n=t;for(let o of e)if(n=n.children[o],!n)return null;return n}function Ys(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}}rt();tt();function dr(t,e){if(!t)return()=>{};let n=[],o=200;function r(s){if(e){let f=s.getBoundingClientRect();if(f.width>0||f.height>0){let l=Math.max(f.right,f.left+(s.scrollWidth||0)),d=Math.max(f.bottom,f.top+(s.scrollHeight||0));if(l<e.left-o||f.left>e.right+o||d<e.top-o||f.top>e.bottom+o)return}}let i=getComputedStyle(s),a=Ks(s,i);a&&n.push(a);let c=Qs(s,i);c&&n.push(c);for(let f of s.children||[])r(f)}return r(t),()=>n.forEach(s=>s())}function Ks(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=Zs(e);if(n<=0)return()=>{};if(!pr(t))return()=>{};let o=t.textContent??"",r=o,s=ta(e);t.textContent="X";let i=t.scrollHeight-s;t.textContent=o;let a=i>0?i:Js(e),c=Math.round(a*n+s);if(t.scrollHeight<=c+.5)return()=>{};let f=0,l=o.length,d=-1;for(;f<=l;){let u=f+l>>1;t.textContent=o.slice(0,u)+"\u2026",t.scrollHeight<=c+.5?(d=u,f=u+1):l=u-1}return t.textContent=(d>=0?o.slice(0,d):"")+"\u2026",()=>{t.textContent=r}}function Qs(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(!pr(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=t.textContent??"",o=n,r=0,s=n.length,i=-1;for(;r<=s;){let a=r+s>>1;t.textContent=n.slice(0,a)+"\u2026",t.scrollWidth<=t.clientWidth+.5?(i=a,r=a+1):s=a-1}return t.textContent=(i>=0?n.slice(0,i):"")+"\u2026",()=>{t.textContent=o}}function Zs(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 Js(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 ta(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function pr(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var oe=[];function re(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 mr(...t){let e=t.flat();for(let n of e){let o=re(n);o&&(oe.some(r=>r&&r.name&&o.name&&r.name===o.name)||oe.push(o))}}function hr(t){return t&&Array.isArray(t.plugins)?t.plugins:oe}async function lt(t,e,n){let o=n,r=hr(e);for(let s of r){let i=s&&typeof s[t]=="function"?s[t]:null;if(!i)continue;let a=await i(e,o);typeof a<"u"&&(o=a)}return o}async function gr(t,e,n){let o=[],r=hr(e);for(let s of r){let i=s&&typeof s[t]=="function"?s[t]:null;if(!i)continue;let a=await i(e,n);typeof a<"u"&&o.push(a)}return o}function ea(t){let e=[];if(Array.isArray(t))for(let n of t){let o=re(n);if(!o||!o.name)continue;let r=e.findIndex(s=>s&&s.name===o.name);r>=0&&e.splice(r,1),e.push(o)}for(let n of oe)n&&n.name&&!e.some(o=>o.name===n.name)&&e.push(n);return Object.freeze(e)}function yr(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=ea(e)),t}function mn(){return oe.slice()}tt();var na=.92,oa=.95;async function ra(t){let e=new Image;if(e.decoding="sync",e.src=t,typeof e.decode=="function")try{return await e.decode(),e}catch{}return await new Promise((n,o)=>{e.onload=()=>n(),e.onerror=o}),e}function ia(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}async function hn(t,e,n){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;let o=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+Math.round(e)+"x"+Math.round(n);if(x.compress.has(o))return x.compress.get(o);let r=await(async()=>{let s;try{s=await ra(t)}catch{return null}let i=s.naturalWidth||s.width,a=s.naturalHeight||s.height;if(!i||!a)return null;let c=Math.min(1,Math.max(e/i,n/a));if(!(c>0)||c>=.95)return null;let f=c*oa,l=Math.max(1,Math.round(i*f)),d=Math.max(1,Math.round(a*f)),u=document.createElement("canvas");u.width=l,u.height=d;let p=u.getContext("2d");if(!p)return null;p.imageSmoothingEnabled=!0,p.imageSmoothingQuality="high",p.drawImage(s,0,0,l,d);let h=ia(t),m=h==="image/jpeg"?"image/jpeg":h==="image/webp"?"image/webp":"image/png";try{let y=u.toDataURL(m,na);if(typeof y=="string"&&y.startsWith("data:image")&&y.length<t.length)return y}catch{}return null})();return x.compress.set(o,r),r}async function sa(t,e){if(!e.compress)return{count:0,before:0,after:0};let n=(e.scale||1)*(e.dpr||1),o=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&o.unshift(t);let r=0,s=0,i=0,a=async f=>{let l=f.getAttribute("src")||"";if(!l.startsWith("data:image")||l.startsWith("data:image/svg"))return;let d=parseFloat(f.dataset.snapdomWidth)||parseFloat(f.style.width)||f.width||0,u=parseFloat(f.dataset.snapdomHeight)||parseFloat(f.style.height)||f.height||0;if(!d||!u)return;let p=await hn(l,d*n,u*n);p&&(r++,s+=l.length,i+=p.length,f.setAttribute("src",p))},c=6;for(let f=0;f<o.length;f+=c)await Promise.allSettled(o.slice(f,f+c).map(a));return{count:r,before:s,after:i}}function aa(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function ca(t,e,n=x.session.nodeMap){if(!e.compress)return{count:0};let o=(e.scale||1)*(e.dpr||1),r=[],s=[t,...t.querySelectorAll("*")];for(let f of s){let l=f.style&&f.style.backgroundImage;l&&l.includes("data:image")&&r.push(f)}let i=0,a=async f=>{let l=n.get(f);if(!l||!l.isConnected)return;let d;try{d=getComputedStyle(l)}catch{return}if((d.backgroundRepeat||"repeat").toLowerCase().split(",").some(g=>g.trim()!=="no-repeat"))return;let{w:p,h}=aa(l);if(!p||!h)return;let m=p*o,y=h*o,b=f.style.backgroundImage,S=[...b.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],C=b;for(let g of S){let w=g[2];if(w.startsWith("data:image/svg"))continue;let v=await hn(w,m,y);v&&(C=C.split(w).join(v),i++)}C!==b&&(f.style.backgroundImage=C)},c=6;for(let f=0;f<r.length;f+=c)await Promise.allSettled(r.slice(f,f+c).map(a));return{count:i}}async function la(t,e){if(!e.compress)return{count:0};let n=(e.scale||1)*(e.dpr||1),o=Array.from(t.querySelectorAll("image"));t.localName==="image"&&o.unshift(t);let r=0,s=async a=>{let c=a.getAttribute("href")||(typeof a.getAttributeNS=="function"?a.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!c||!c.startsWith("data:image")||c.startsWith("data:image/svg"))return;let f=parseFloat(a.getAttribute("width"))||0,l=parseFloat(a.getAttribute("height"))||0;if(!f||!l)return;let d=await hn(c,f*n,l*n);d&&(a.setAttribute("href",d),a.hasAttribute("xlink:href")&&a.setAttribute("xlink:href",d),r++)},i=6;for(let a=0;a<o.length;a+=i)await Promise.allSettled(o.slice(a,a+i).map(s));return{count:r}}async function br(t,e,n){e.compress&&(await sa(t,e),await ca(t,e,n),await la(t,e))}function fa(t){if(Array.isArray(t.plugins)){for(let e of t.plugins)if(re(e)?.name==="picture-resolver")return!0}return mn().some(e=>e?.name==="picture-resolver")}function ua(t){let e=Array.isArray(t.plugins)?t.plugins:mn(),n=[];for(let o of e){let r=re(o);r&&typeof r.resolveNode=="function"&&n.push(r.resolveNode.bind(r))}return n.length?n:null}var da=2e3,pa=3;function ma(t){let e=Date.now(),n=x.burstAdvice.get(t);if(!n||e-n.firstTs>da){x.burstAdvice.set(t,{count:1,firstTs:e,warned:!1});return}n.count++,n.count>=pa&&!n.warned&&(n.warned=!0,console.warn("[snapdom] Captured this element multiple times. Pass { burst: true } to increase the speed."))}async function wr(t,e){if(!t)throw new Error("Element cannot be null or undefined");ue(e.cache),e.__session={styleMap:x.session.styleMap,styleCache:x.session.styleCache,nodeMap:x.session.nodeMap},e.burst||ma(t),e.__resolveNodeHooks=ua(e);let n=e.fast,o=e.outerTransforms!==!1,r=!!e.outerShadows,s=e.clip?Te(t,e.clip):null,i={element:t,options:e,plugins:e.plugins},a,c,f,l,d,u,p="",h="",m,y,b=null;await lt("beforeSnap",i);let S=null;e.resolvePicturePlaceholders!==!1&&!fa(e)&&(S=await Xn(i.element,i.options)),await lt("beforeClone",i);let C=dr(i.element,s);try{({clone:a,classCSS:c,styleCache:f,nodeMap:l,reconcileRisk:d,clipWindow:u}=await sr(i.element,i.options)),d>0&&!e.reconcile&&!x.warnedReconcile&&(x.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time).")),!o&&a&&(b=Vo(i.element,a)),!r&&a&&Zo(i.element,a,i.options),a&&(tr(i.element,a,l),Jo(i.element,a))}finally{C()}if(i={clone:a,classCSS:c,styleCache:f,nodeMap:l,...i},await lt("afterClone",i),S&&await S(),er(i.clone),i.options?.excludeMode==="remove"||i.options?.filterMode==="remove")try{nr(i.element,i.clone,i.styleCache)}catch($){console.warn("[snapdom] shrink pass failed:",$)}try{await po(i.clone,i.element,i.nodeMap)}catch{}let g=$=>new Promise((R,D)=>{Ft(()=>{Promise.resolve().then($).then(R,D)},{fast:n})}),w=(async()=>{await Promise.all([g(()=>cr(i.clone,i.options)),g(()=>lr(i.element,i.clone,i.styleCache,i.options,i.nodeMap))]);try{ur(i.element,i.clone,i.nodeMap)}catch($){console.warn("[snapdom] backdrop-filter emulation failed:",$)}e.compress&&await g(()=>br(i.clone,i.options,i.nodeMap))})(),v=Promise.resolve();e.embedFonts&&(v=g(async()=>{let $=i.element.ownerDocument||document,R=s?_=>{try{let W=_.getBoundingClientRect();return W.right>=s.left-200&&W.left<=s.right+200&&W.bottom>=s.top-200&&W.top<=s.bottom+200}catch{return!0}}:null,{required:D,usedCodepoints:N}=ee(i.element,R);if(X()){let _=new Set(Array.from(D).map(W=>String(W).split("__")[0]).filter(Boolean));await Ut(_,1,$)}p=await $e({required:D,usedCodepoints:N,preCached:!1,exclude:i.options.excludeFonts,localFonts:i.options.localFonts,useProxy:i.options.useProxy,fontStylesheetDomains:i.options.fontStylesheetDomains,doc:$})})),await Promise.all([w,v]);let M=ze(i.clone).sort(),A=M.join(",");x.baseStyle.has(A)?h=x.baseStyle.get(A):await new Promise($=>{Ft(()=>{h=Ve(M),x.baseStyle.set(A,h),$()},{fast:n})});let k=ir(i.element?.ownerDocument||document);i={fontsCSS:p,baseCSS:h,scrollbarCSS:k,...i},await lt("beforeRender",i),await new Promise($=>{Ft(()=>{let R=L(i.element),D=i.element.getBoundingClientRect(),N=Math.max(1,E(i.element.offsetWidth||parseFloat(R.width)||D.width||1)),_=Math.max(1,E(i.element.offsetHeight||parseFloat(R.height)||D.height||1)),W=i.element.ownerDocument||document;if(!u&&(i.element===W.body||i.element===W.documentElement)&&!W.documentElement.hasAttribute("data-sd-pinned")){let V=Math.max(i.element.scrollHeight||0,W.documentElement?.scrollHeight||0,W.body?.scrollHeight||0),Z=Math.max(i.element.scrollWidth||0,W.documentElement?.scrollWidth||0,W.body?.scrollWidth||0);V>0&&(_=Math.max(_,E(V))),Z>0&&(N=Math.max(N,E(Z)));try{let Y=(i.scrollbarCSS||"").length+(i.baseCSS||"").length+(i.fontsCSS||"").length+(i.classCSS||"").length,J=x.measureHints.get(i.element);if(J&&J.cssLen===Y&&J.w0===N)J.csh>0&&(_=Math.max(_,E(J.csh))),J.csw>0&&(N=Math.max(N,E(J.csw)));else{let K=W.createElement("div");K.setAttribute("data-snapdom-internal",""),K.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+N+"px!important;overflow:visible!important;visibility:hidden!important;";let At=K.attachShadow({mode:"open"}),kt=W.createElement("style");kt.textContent=(i.scrollbarCSS||"")+i.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS,At.appendChild(kt),At.appendChild(i.clone.cloneNode(!0)),W.body.appendChild(K);let jt=K.scrollHeight,yt=K.scrollWidth;W.body.removeChild(K),x.measureHints.set(i.element,{cssLen:Y,w0:N,csh:jt,csw:yt}),jt>0&&(_=Math.max(_,E(jt))),yt>0&&(N=Math.max(N,E(yt)))}}catch{}}if(i.options?.excludeMode==="remove"||i.options?.filterMode==="remove"){let V=or(i.element,i.options);Number.isFinite(V)&&V>0&&(_=Math.max(1,Math.min(_,E(V+1))))}if(i.options?.reconcile)try{let V=(i.scrollbarCSS||"")+i.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS;rr(i.element,i.clone,V,i.nodeMap,N,_)}catch(V){console.warn("[snapdom] reconcile pass failed:",V)}let T=(V,Z=NaN)=>{let Y=typeof V=="string"?parseFloat(V):V;return Number.isFinite(Y)?Y:Z},Q=T(i.options.width),et=T(i.options.height),pt=u?E(u.width):N,mt=u?E(u.height):_,St=pt,ht=mt,P=Number.isFinite(Q),O=Number.isFinite(et),U=mt>0?pt/mt:1;P&&O?(St=Math.max(1,E(Q)),ht=Math.max(1,E(et))):P?(St=Math.max(1,E(Q)),ht=Math.max(1,E(St/(U||1)))):O&&(ht=Math.max(1,E(et)),St=Math.max(1,E(ht*(U||1))));let z=0,G=0,ft=N,vt=_;if(u){let V=0,Z=0;if(gn(i.element)){let Y=null;if(!o&&b&&Number.isFinite(b.a))Y={a:b.a,b:b.b||0,c:b.c||0,d:b.d||1,e:0,f:0};else{let J=zt(i.element),K=dn(R.transform&&R.transform!=="none"?R.transform:"",J);K&&K.is2D&&(Y={a:K.a,b:K.b,c:K.c,d:K.d,e:0,f:0})}if(Y&&!(Y.a===1&&Y.b===0&&Y.c===0&&Y.d===1)){let{ox:J,oy:K}=ne(R,N,_),At=Ht(N,_,Y,J,K);V=At.minX,Z=At.minY}}z=E(u.x+V),G=E(u.y+Z),ft=E(z+u.width),vt=E(G+u.height)}else if(!o&&b&&Number.isFinite(b.a)){let V={a:b.a,b:b.b||0,c:b.c||0,d:b.d||1,e:0,f:0},Z=Ht(N,_,V,0,0);z=E(Z.minX),G=E(Z.minY),ft=E(Z.maxX),vt=E(Z.maxY)}else if(o&&gn(i.element)){let Z=R.transform&&R.transform!=="none"?R.transform:"",Y=zt(i.element),J=jo({baseTransform:Z,rotate:Y.rotate||"0deg",scale:Y.scale,translate:Y.translate}),{ox:K,oy:At}=ne(R,N,_),kt=J.is2D?J:new DOMMatrix(J.toString()),jt={a:kt.a,b:kt.b,c:kt.c,d:kt.d,e:0,f:0},yt=Ht(N,_,jt,K,At);z=E(yt.minX),G=E(yt.minY),ft=E(yt.maxX),vt=E(yt.maxY)}let ut=Oo(R),Tt=Bo(R),nt=Do(R),Lt=Ho(R),Nt=zo(R),Ct=u?{top:0,right:0,bottom:0,left:0}:r?{top:E(Math.max(ut.top,Tt.top)+nt.top+Lt.top+Nt.bleed.top),right:E(Math.max(ut.right,Tt.right)+nt.right+Lt.right+Nt.bleed.right),bottom:E(Math.max(ut.bottom,Tt.bottom)+nt.bottom+Lt.bottom+Nt.bleed.bottom),left:E(Math.max(ut.left,Tt.left)+nt.left+Lt.left+Nt.bleed.left)}:{top:nt.top,right:nt.right,bottom:nt.bottom,left:nt.left};z=E(z-Ct.left),G=E(G-Ct.top),ft=E(ft+Ct.right),vt=E(vt+Ct.bottom);let dt=Math.max(1,E(ft-z)),An=Math.max(1,E(vt-G)),Pr=P||O?E(St/pt):1,Ir=O||P?E(ht/mt):1,_r=Math.max(1,E(dt*Pr)),Wr=Math.max(1,E(An*Ir)),kn="http://www.w3.org/2000/svg",Or=gn(i.element)?2:0,Pt=E(Or+(o?0:1)),se=Math.ceil(dt+Pt*2),ae=Math.ceil(An+Pt*2),ce=E(-(E(z)-Pt)),le=E(-(E(G)-Pt)),Mn=Math.max(0,ce),En=Math.max(0,le),Fn=E(se-Math.min(0,ce)),$n=E(ae-Math.min(0,le)),gt=document.createElementNS(kn,"foreignObject");gt.setAttribute("x",String(Math.min(0,ce))),gt.setAttribute("y",String(Math.min(0,le))),gt.setAttribute("width",String(Fn)),gt.setAttribute("height",String($n)),gt.style.overflow="visible";let Rn=document.createElement("style"),Br="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";Rn.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+Br+i.classCSS,gt.appendChild(Rn);let fe=document.createElement("div");fe.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),fe.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${Fn}px;height:${$n}px`+(Mn!==0||En!==0?`;padding:${En}px 0 0 ${Mn}px !important`:""),fe.appendChild(i.clone),gt.appendChild(fe);let Ur=new XMLSerializer().serializeToString(gt),Tn=P||O,Dr=Object.freeze({w0:pt,h0:mt,vbW:se,vbH:ae,targetW:St,targetH:ht,contentX:E(ce+(u?z:0)),contentY:E(le+(u?G:0)),clip:u?Object.freeze({x:E(z),y:E(G),width:pt,height:mt}):null});Object.defineProperty(e,"meta",{value:Dr,enumerable:!0,writable:!1,configurable:!0});let Hr=!Tn||X()?se:E(_r+Pt*2),zr=!Tn||X()?ae:E(Wr+Pt*2),Vr=parseFloat(L(W.documentElement)?.fontSize)||16;y=`<svg xmlns="${kn}" width="${Hr}" height="${zr}" viewBox="0 0 ${se} ${ae}" font-size="${Vr}px">`+Ur+"</svg>",m=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(y)}`,i={svgString:y,dataURL:m,...i},$()},{fast:n})}),await lt("afterRender",i);let F=document.getElementById("snapdom-sandbox");return F&&F.style.position==="absolute"&&F.remove(),i.dataURL}function gn(t){return qo(t)}tt();function xr(t={}){let e=t.format??"png";e==="jpg"&&(e="jpeg");let n=Ln(t.cache);return{debug:t.debug??!1,fast:t.fast??!0,scale:t.scale??1,exclude:t.exclude??[],excludeMode:t.excludeMode??"hide",filter:t.filter??null,filterMode:t.filterMode??"hide",placeholders:t.placeholders!==!1,embedFonts:t.embedFonts??!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:e,type:t.type??"svg",quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(e)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst??!1,invalidate:t.invalidate??!1,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1,pictureResolver:t.pictureResolver&&typeof t.pictureResolver=="object"?t.pictureResolver:{}}}Wt();Xe();var Sr=new WeakMap;function Cr(t,e,n){let o=new Set;if(t instanceof HTMLVideoElement&&o.add(t),t.querySelectorAll)for(let r of t.querySelectorAll("video"))o.add(r);for(let r of e.trackedVideos)o.has(r)||(r.removeEventListener("timeupdate",n),r.removeEventListener("seeked",n),e.trackedVideos.delete(r));for(let r of o)e.trackedVideos.has(r)||(r.addEventListener("timeupdate",n),r.addEventListener("seeked",n),e.trackedVideos.add(r))}function ha(t){let e={dirty:!0,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedVideos:new Set},n=s=>{e.capturing||Ke(s)&&(e.dirty=!0)},o=()=>{e.capturing||(e.dirty=!0)},r=t.ownerDocument||document;try{let s=new MutationObserver(n);s.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),e.observers.push(s)}catch{}try{if(r.head){let s=new MutationObserver(n);s.observe(r.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),e.observers.push(s)}}catch{}return e.markDirty=n,e.onMediaDirty=o,Cr(t,e,o),e}function vr(t){let{burst:e,invalidate:n,...o}=t||{};try{return JSON.stringify(o,Object.keys(o).sort())}catch{return null}}function Ar(t,e,n,o){let r=Sr.get(t);r||(r=ha(t),r.baselineSignature=vr(e),Sr.set(t,r));let s=vr(e),i=s===null||s!==r.baselineSignature,a=async()=>{for(let f of r.observers)r.markDirty(f.takeRecords());if(n.invalidate&&(r.dirty=!0),!i&&!r.dirty&&r.last)return r.last;r.capturing=!0,i||(r.dirty=!1);try{let f=await o();return i||(r.last=f),f}finally{for(let f of r.observers)f.takeRecords();r.capturing=!1,Cr(t,r,r.onMediaDirty)}},c=r.inflight.then(a,a);return r.inflight=c.catch(()=>{}),c}rt();wt();tt();async function kr(t=document,e={}){let{embedFonts:n=!0,useProxy:o=""}=e,r=e.cache??e.cacheOpt??"full";ue(r);try{await document.fonts?.ready}catch{}try{De()}catch{}x.session=x.session||{},x.session.styleCache||(x.session.styleCache=new WeakMap),x.image=x.image||new q(100),x.background=x.background||new q(100);let s=[],i=[];try{if(t&&t.nodeType===1){let c=t.querySelectorAll?Array.from(t.querySelectorAll("*")):[];i=[t,...c],s=[],t.tagName==="IMG"&&t.getAttribute("src")&&s.push(t),s.push(...Array.from(t.querySelectorAll?.("img[src]")||[]))}else t?.querySelectorAll&&(s=Array.from(t.querySelectorAll("img[src]")),i=Array.from(t.querySelectorAll("*")))}catch{}let a=[];for(let c of s){let f=c?.currentSrc||c?.src;if(f&&!x.image.has(f)){let l=Promise.resolve().then(async()=>{let d=await j(f,{as:"dataURL",useProxy:o});d?.ok&&typeof d.data=="string"&&x.image.set(f,d.data)}).catch(()=>{});a.push(l)}}for(let c of i){let f=new Set;for(let l of pn){let d="";try{d=l==="background-image"&&c?.style?.backgroundImage||L(c).getPropertyValue(l)||""}catch{}if(!d||d==="none")continue;let u=d.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let p of u){if(f.has(p))continue;f.add(p);let h=Promise.resolve().then(()=>Et(p,{...e,useProxy:o})).catch(()=>{});a.push(h)}}}if(n)try{let{required:c,usedCodepoints:f}=ee(t);if(typeof X=="function"?X():!!X){let d=new Set(Array.from(c).map(u=>String(u).split("__")[0]).filter(Boolean));await Ut(d,3)}await $e({required:c,usedCodepoints:f,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:e.useProxy??o,fontStylesheetDomains:e.fontStylesheetDomains})}catch{}await Promise.allSettled(a)}function Fa(...t){return mr(...t),B}var B=Object.assign(Ra,{plugins:Fa}),Cn=Symbol("snapdom.internal"),$a=Symbol("snapdom.internal.silent");async function Ra(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=xr(e);if(yr(n,e&&e.plugins),X()){if(n.embedFonts===!0)try{let r=Co(t),s=new Set([...r].map(i=>String(i).split("__")[0]).filter(Boolean));await Ut(s,1)}catch{}let o=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&o.unshift(t);for(let r of o)try{let s=r.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){I(e,"safari canvas poke failed",s)}}return n.iconFonts&&n.iconFonts.length>0&&uo(n.iconFonts),n.snap||(n.snap={toPng:(o,r)=>B.toPng(o,r),toSvg:(o,r)=>B.toSvg(o,r)}),n.burst?Ar(t,e,n,()=>B.capture(t,n,Cn)):B.capture(t,n,Cn)}B.capture=async(t,e,n)=>{if(n!==Cn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");e.element=t;let o=await wr(t,e),r={img:async(m,y)=>{let{toImg:b}=await Promise.resolve().then(()=>(xn(),wn));return b(o,{...m,...y||{}})},svg:async(m,y)=>{let{toSvg:b}=await Promise.resolve().then(()=>(xn(),wn));return b(o,{...m,...y||{}})},canvas:async(m,y)=>{let{toCanvas:b}=await Promise.resolve().then(()=>(Vt(),$r));return b(o,{...m,...y||{}})},blob:async(m,y)=>{let{toBlob:b}=await Promise.resolve().then(()=>(vn(),Rr));return b(o,{...m,...y||{}})},png:async(m,y)=>{let{rasterize:b}=await Promise.resolve().then(()=>(ie(),We));return b(o,{...m,...y||{},format:"png"})},jpeg:async(m,y)=>{let{rasterize:b}=await Promise.resolve().then(()=>(ie(),We));return b(o,{...m,...y||{},format:"jpeg"})},webp:async(m,y)=>{let{rasterize:b}=await Promise.resolve().then(()=>(ie(),We));return b(o,{...m,...y||{},format:"webp"})},download:async(m,y)=>{let{download:b}=await Promise.resolve().then(()=>(Nr(),Lr));return b(o,{...m,...y||{}})}},s={};for(let m of["img","svg","canvas","blob","png","jpeg","webp"])s[m]=async y=>r[m](e,{...y||{},[$a]:!0});s.jpg=s.jpeg;let i={...e,export:{url:o},exports:s},a=await gr("defineExports",i),c=Object.assign({},...a.filter(m=>m&&typeof m=="object").reverse()),f={...r,...c};f.jpeg&&!f.jpg&&(f.jpg=(m,y)=>f.jpeg(m,y));function l(m,y){let b={...e,...y||{}},S=g=>g==="jpeg"||g==="jpg"||g==="webp";return[m,b.format,b.type].map(g=>typeof g=="string"?g.toLowerCase():"").find(S)&&(b.backgroundColor==null||b.backgroundColor==="transparent")&&(b.backgroundColor="#ffffff"),b}let d=!1,u=Promise.resolve();async function p(m,y){let b=Object.freeze(y&&typeof y=="object"?{...y}:{}),S=async()=>{let g=f[m];if(!g)throw new Error(`[snapdom] Unknown export type: ${m}`);let w=l(m,b),v={...e,export:{type:m,options:w,requestedOptions:b,url:o}};await lt("beforeExport",v,{format:m,options:w});let M=await g(v,w);return await lt("afterExport",v,{format:m,options:w,result:M}),d||(d=!0,await lt("afterSnap",e)),M},C=u.then(S);return u=C.catch(()=>{}),C}let h={url:o,toRaw:()=>o,to:(m,y)=>p(m,y),toImg:m=>p("img",m),toSvg:m=>p("svg",m),toCanvas:m=>p("canvas",m),toBlob:m=>p("blob",m),toPng:m=>p("png",m),toJpg:m=>p("jpg",m),toWebp:m=>p("webp",m),download:m=>p("download",m)};Object.defineProperty(h,"meta",{value:e.meta,enumerable:!0,writable:!1,configurable:!1});for(let m of Object.keys(f)){let y="to"+m.charAt(0).toUpperCase()+m.slice(1);h[y]||(h[y]=b=>p(m,b))}return h};B.toRaw=(t,e)=>B(t,e).then(n=>n.toRaw());B.toImg=(t,e)=>B(t,e).then(n=>n.toImg());B.toSvg=(t,e)=>B(t,e).then(n=>n.toSvg());B.toCanvas=(t,e)=>B(t,e).then(n=>n.toCanvas());B.toBlob=(t,e)=>B(t,e).then(n=>n.toBlob());B.toPng=(t,e)=>B(t,{...e,format:"png"}).then(n=>n.toPng());B.toJpg=(t,e)=>B(t,{...e,format:"jpeg"}).then(n=>n.toJpg());B.toWebp=(t,e)=>B(t,{...e,format:"webp"}).then(n=>n.toWebp());B.download=(t,e)=>B(t,e).then(n=>n.download());typeof window<"u"&&(window.snapdom=B,window.preCache=kr);