@zumer/snapdom 2.24.15 → 3.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +221 -246
- package/dist/snapdom.js +35 -10
- package/dist/snapdom.mjs +35 -10
- package/package.json +20 -14
- package/types/snapdom.d.ts +339 -165
- package/dist/plugins.mjs +0 -7
- package/dist/preCache.mjs +0 -10
package/dist/snapdom.mjs
CHANGED
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* SnapDOM
|
|
3
|
-
*
|
|
4
|
-
* Author: Juan Martin Muda
|
|
3
|
+
* v3.0.0-beta.0
|
|
5
4
|
* License: MIT
|
|
6
5
|
*/
|
|
7
|
-
var Yr=Object.defineProperty;var st=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var Gt=(t,e)=>{for(var n in e)Yr(t,n,{get:e[n],enumerable:!0})};function _n(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 pe(t="soft"){switch(t){case"auto":{C.session.styleMap=new Map,C.session.nodeMap=new Map;return}case"soft":{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap,C.computedStyle=new WeakMap,C.measureHints=new WeakMap,C.baseStyle=new Y(50),C.defaultStyle=new Y(30),C.image=new Y(100),C.background=new Y(100),C.resource=new Y(150),C.compress=new Y(50),C.font=new Set;return}default:{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap;return}}}var Y,C,rt=st(()=>{"use strict";Y=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)}},C={image:new Y(100),background:new Y(100),resource:new Y(150),defaultStyle:new Y(30),baseStyle:new Y(50),compress:new Y(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 Et(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Yt(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&&!Kr.test(a[1].trim()))continue;let c=s.match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)/i),u=1;if(c){let l=parseFloat(c[1]);u=/dpi/i.test(c[2])?l/96:l}o.push({url:i[2].trim(),dppx:u})}return o.length?(o.sort((s,i)=>s.dppx-i.dppx),(o.find(s=>s.dppx>=e)||o[o.length-1]).url):null}function De(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 St(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function He(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 Kr,Kt=st(()=>{"use strict";Kr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i});function Qr(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 u=Date.now();(o.get(a)||0)>u||(o.set(a,u+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 Zr(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 ti(t,e){if(!e||Zr(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 ei(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",St(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}${St(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function On(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 ni(t,e){return[e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,t].join("|")}async function G(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[,b="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],S=/;base64/i.test(b)?atob(y):decodeURIComponent(y),g=new Uint8Array([...S].map(v=>v.charCodeAt(0))),x=new Blob([g],{type:(b||"").split(";")[0]||""});return{ok:!0,data:x,status:200,url:t,fromCache:!1,mime:x.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let b=await fetch(t);if(!b.ok)return{ok:!1,data:null,status:b.status,url:t,fromCache:!1,reason:"http_error"};let y=await b.blob(),w=y.type||b.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await On(y),status:b.status,url:t,fromCache:!1,mime:w}:n==="text"?{ok:!0,data:await y.text(),status:b.status,url:t,fromCache:!1,mime:w}:{ok:!0,data:y,status:b.status,url:t,fromCache:!1,mime:w}}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=ni(t,{as:n,timeout:o,useProxy:r,errorTTL:s}),u=he.get(c);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&he.delete(c);let l=ze.get(c);if(l)return l;let d=ti(t,r)?ei(t,r):t,f=e.credentials;if(!f)try{let b=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,b);f=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{f="omit"}let p=new AbortController,m=setTimeout(()=>p.abort("timeout"),o),h=(async()=>{try{let b=await fetch(d,{signal:p.signal,credentials:f,headers:i});if(!b.ok){let S={ok:!1,data:null,status:b.status,url:d,fromCache:!1,reason:"http_error"};if(s>0&&he.set(c,{until:Date.now()+s,result:S}),!a){let g=`${b.status} ${b.statusText||""}`.trim();Wn.warnOnce(`http:${b.status}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,`HTTP error ${g} while fetching ${n} ${t}`)}return e.onError&&e.onError(S),S}if(n==="text")return{ok:!0,data:await b.text(),status:b.status,url:d,fromCache:!1};let y=await b.blob(),w=y.type||b.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await On(y),status:b.status,url:d,fromCache:!1,mime:w}:{ok:!0,data:y,status:b.status,url:d,fromCache:!1,mime:w}}catch(b){let y=b&&typeof b=="object"&&"name"in b&&b.name==="AbortError"?String(b.message||"").includes("timeout")?"timeout":"abort":"network",w={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:y};if(!/^blob:/i.test(t)&&s>0&&he.set(c,{until:Date.now()+s,result:w}),!a){let S=`${y}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,g=y==="timeout"?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:y==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;Wn.errorOnce(S,g)}return e.onError&&e.onError(w),w}finally{clearTimeout(m),ze.delete(c)}})();return ze.set(c,h),h}var Wn,ze,he,vt=st(()=>{"use strict";Kt();Wn=Qr("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),ze=new Map,he=new Map});async function Rt(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=Yt(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Et(t);if(!o)return t;let r=He(o),s=St(r),i=(e.useProxy||"")+"|"+s;if(C.background.has(i)){let a=C.background.get(i);return a?`url("${a}")`:"none"}try{let a=await G(s,{as:"dataURL",useProxy:e.useProxy});return a.ok?(C.background.set(i,a.data),`url("${a.data}")`):(C.background.set(i,null),"none")}catch{return C.background.set(i,null),"none"}}var Bn=st(()=>{"use strict";rt();Kt();vt()});function Ve(){for(let t of oi){let e=String(t).toLowerCase();me.has(e)||ge.has(e)||ye(e)}}function ye(t){if(t=String(t).toLowerCase(),ge.has(t)){let s={};return C.defaultStyle.set(t,s),s}if(C.defaultStyle.has(t))return C.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(Qt(s))continue;let i=o.getPropertyValue(s);r[s]=i}return e.removeChild(n),C.defaultStyle.set(t,r),r}function Qt(t){let e=Un.get(t);if(e===void 0){let n=String(t).toLowerCase();e=si.has(n)||ii.test(n)||ri.test(n),Un.set(t,e)}return e}function be(t,e){return!ci.has(t)&&(e==="inline"||ai.has(t)||Dn.has(t))}function je(t,e,n){let o=(e.display||"").toLowerCase();if(o==="inline"||Dn.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:!di.has(o)}function Wt(t,e,n=!0,o=!1){if(e=String(e||"").toLowerCase(),ge.has(e))return"";let r=[],s=ye(e),i=(t.display||"").toLowerCase(),a=i==="inline",c=be(e,i),u=t["text-wrap-mode"]||t["white-space"]||"",l=u==="nowrap"||u==="pre",f=c&&n&&!(c&&n&&!a&&l),p=!1;for(let m in t){if(Qt(m))continue;let h=t[m];if(f){if(li.has(m))continue;if(fi.has(m)){h&&h!==s[m]&&(r.push(`${m}:${h}`),h!=="auto"&&(p=!0));continue}}if(h&&h!==s[m]){if(!l&&(m==="width"||m==="inline-size")&&h.endsWith("px")&&h.includes(".")){let b=parseFloat(h);if(Number.isFinite(b)){r.push(`${m}:${(b+ui).toFixed(3)}px`);continue}}r.push(`${m}:${h}`)}}if(f&&!a&&!o&&!p){let m=t.width;m&&m!=="auto"&&m!==s.width&&r.push(`min-width:${m}`)}return r.sort(),r.join(";")}function qe(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 Xe(t){let e=new Map;for(let o of t){let r=ye(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 Ge(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 pi(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 N(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=C.computedStyle.get(t);o||(o=new Map,C.computedStyle.set(t,o));let r=o.get(e);if(!r){let s=pi(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 we(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);for(let n of hi){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 Ot(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 me,ge,oi,ri,ii,si,Un,ai,Dn,ci,li,fi,ui,di,hi,Zt=st(()=>{"use strict";rt();me=new Set(["meta","script","noscript","title","link","template"]),ge=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),oi=["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"];ri=/(?:^|-)(animation|transition)(?:-|$)/i,ii=/^(--.+|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,si=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"]),Un=new Map;ai=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),Dn=new Set(["table","thead","tbody","tfoot","tr","td","th"]),ci=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),li=new Set(["width","max-width","inline-size","max-inline-size"]),fi=new Set(["min-width","min-inline-size"]),ui=.001;di=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);hi=["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 mt(t=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(e=>{let n=!1,o=()=>{n||(n=!0,e())};try{requestAnimationFrame(o)}catch{o();return}setTimeout(o,t)})}function Ye(){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 K(){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),u=/ipad|iphone|ipod/.test(e)&&o;return n||i||a||c||u}function Hn(){if(typeof navigator>"u")return!1;let t=(navigator.userAgent||"").toLowerCase();return t.includes("firefox")||t.includes("fxios")}var Ct=st(()=>{"use strict"});function _(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 Ke=st(()=>{"use strict"});var at=st(()=>{"use strict";Bn();Zt();Ct();Kt();Ke()});var Nr={};Gt(Nr,{decodeSvgFromDataURL:()=>We,encodeSvgToDataURL:()=>Oe,fixSafariShadows:()=>Be,toCanvas:()=>Pt});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,At/o,At/r,Math.sqrt(Sn/(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 (${At}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 Aa(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,u,l]=i,d=Math.max(a,n[0]),f=Math.max(c,n[1]),p=Math.min(a+u,n[0]+n[2]),m=Math.min(c+l,n[1]+n[3]);if(!(p>d)||!(m>f))throw new RangeError("[snapdom] canvas crop does not intersect the SVG viewBox");let h=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),b=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(h)&&h>0?h/u:1,w=Number.isFinite(b)&&b>0?b/l:1,S=Math.max(1,(p-d)*y),g=Math.max(1,(m-f)*w),x=r.replace(/(\bwidth=")[^"]*/i,`$1${S}`).replace(/(\bheight=")[^"]*/i,`$1${g}`).replace(/(\bviewBox=")[^"]*/i,`$1${d} ${f} ${p-d} ${m-f}`);return t.replace(r,x)}function $r(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function We(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function ka(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 Oe(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Tr(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 Ma(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",u="0px"]=i;u=`${parseFloat(u)/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} ${u}${d?` ${l}`:""})`)}return r.join(" ")}function Pr(t){let e=Tr(t),n=null,o=null,r=null,s=[];for(let a of e){let c=a.indexOf(":");if(c<0)continue;let u=a.slice(0,c).trim().toLowerCase(),l=a.slice(c+1).trim();u==="box-shadow"?r=l:u==="filter"?n=l:u==="-webkit-filter"?o=l:s.push([u,l])}if(r){let a=Ma(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 Fa(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${Pr(o)}}`)}function Ea(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Fa(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${Pr(o)}${n}`),t}function Ra(){return _e||(_e=(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}}})(),_e)}function $a(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 u=r[c];if(u==="("?s++:u===")"&&(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+=u,c++}return a}).join(",")}function Ta(t,e){let n=o=>Tr(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}:${$a(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 Be(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:o}=await Ra();try{let r=t;return n||(r=Ea(r)),o&&(r=Ta(r,n)),{svg:r,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}async function Pa(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 Pt(t,e){let{width:n,height:o,scale:r=1,dpr:s=1,meta:i={},backgroundColor:a,crop:c=null}=e,u=t,l=!1,d=!1;if(c&&!$r(t))throw new RangeError("[snapdom] canvas crop requires an SVG capture payload");if($r(t)){let F=(ka(t).match(/<svg\b[^>]*>/i)||[])[0]||"",E=parseFloat((F.match(/\bwidth="([\d.]+)/i)||[])[1]),$=parseFloat((F.match(/\bheight="([\d.]+)/i)||[])[1]),W=Number.isFinite(E)&&Number.isFinite($)&&E>0&&$>0&&Math.min(1,At/E,At/$,Math.sqrt(Sn/(E*$)))<1;if(c||W||K())try{let T=We(t);if(c&&(T=Aa(T,c)),K()){let I=await Be(T);T=I.svg,l=I.naturalOnly,d=/@font-face|data:image\//i.test(T)}(W||c)&&(T=Ca(T)),u=Oe(T)}catch(T){if(c)throw T;u=t}}let f=new Image;f.loading="eager",f.decoding="sync",f.crossOrigin="anonymous",f.src=u,await f.decode(),K()&&await Pa(f,d);let p=f.naturalWidth,m=f.naturalHeight,h=c?p:Number.isFinite(i.vbW)?i.vbW:Number.isFinite(i.w0)?i.w0:p,b=c?m:Number.isFinite(i.vbH)?i.vbH:Number.isFinite(i.h0)?i.h0:m,y,w,S=Number.isFinite(n),g=Number.isFinite(o);if(S&&g)y=Math.max(1,n),w=Math.max(1,o);else if(S){let F=n/Math.max(1,h);y=n,w=b*F}else if(g){let F=o/Math.max(1,b);w=o,y=h*F}else y=p,w=m;y=y*r,w=w*r;let x=y*s,v=w*s,k=Math.max(x/At,v/At,Math.sqrt(x*v/Sn));k>1&&(console.warn(`[snapDOM] Output ${Math.round(x)}\xD7${Math.round(v)}px exceeds the browser canvas limit (${At}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),y/=k,w/=k);let A=document.createElement("canvas");A.width=y*s,A.height=w*s,A.style.width=`${y}px`,A.style.height=`${w}px`;let M=A.getContext("2d");if(s!==1&&M.scale(s,s),a&&(M.save(),M.fillStyle=a,M.fillRect(0,0,y,w),M.restore()),l&&(Math.round(y*s)!==p||Math.round(w*s)!==m)){let F=document.createElement("canvas");F.width=p,F.height=m,F.getContext("2d").drawImage(f,0,0),M.drawImage(F,0,0,y,w)}else M.drawImage(f,0,0,y,w);return A}var At,Sn,_e,qt=st(()=>{"use strict";Ct();At=16384,Sn=16384*16384;_e=null});var Ue={};Gt(Ue,{rasterize:()=>vn});async function vn(t,e){let n=await Pt(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 ae=st(()=>{"use strict";qt()});var Cn={};Gt(Cn,{toImg:()=>Na,toSvg:()=>Na});async function Na(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(K()&&c)try{let{svg:l}=await Be(We(t)),d=(l.match(/<svg\b[^>]*>/i)||[])[0]||"",f=parseFloat((d.match(/\bwidth="([\d.]+)/i)||[])[1]),p=parseFloat((d.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(f)||!Number.isFinite(p))throw new Error("svg without dimensions");let m=Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:f,h=Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:p,b,y;i&&a?(b=o,y=r):i?(b=o,y=Math.round(h*(o/Math.max(1,m)))):a?(y=r,b=Math.round(m*(r/Math.max(1,h)))):(b=Math.round(f*n),y=Math.round(p*n));let w=l.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${y}"`),S=new Image;return S.decoding="sync",S.loading="eager",S.src=Oe(w),await S.decode(),S.style.width=`${b}px`,S.style.height=`${y}px`,S}catch(l){return _(e,"safari vector toImg failed, falling back to PNG",l),vn(t,{...e,format:"png",quality:1,meta:s})}let u=new Image;if(u.decoding="sync",u.loading="eager",u.src=t,await u.decode(),i&&a)u.style.width=`${o}px`,u.style.height=`${r}px`;else if(i){let l=Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:u.naturalWidth,d=Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:u.naturalHeight,f=o/Math.max(1,l);u.style.width=`${o}px`,u.style.height=`${Math.round(d*f)}px`}else if(a){let l=Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:u.naturalWidth,d=Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:u.naturalHeight,f=r/Math.max(1,d);u.style.height=`${r}px`,u.style.width=`${Math.round(l*f)}px`}else{let l=Math.round(u.naturalWidth*n),d=Math.round(u.naturalHeight*n);if(u.style.width=`${l}px`,u.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)}`,u.src=t}catch(f){_(e,"SVG width/height patch in toImg failed",f)}}return u}var An=st(()=>{"use strict";at();ae();qt()});var Lr={};Gt(Lr,{toBlob:()=>kn});async function kn(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 Pt(t,e);return new Promise(r=>o.toBlob(s=>r(s),`image/${n}`,e.quality))}var Mn=st(()=>{"use strict";qt()});var _r={};Gt(_r,{download:()=>La});async function Ir(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 La(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 u=Ye();if(i==="svg"){let f=await kn(t,{...c,type:"svg"});if(u&&await Ir(f,a))return;let p=URL.createObjectURL(f),m=document.createElement("a");m.href=p,m.download=a,document.body.appendChild(m),m.click(),URL.revokeObjectURL(p),m.remove();return}let l=await Pt(t,c);if(u){let f=`image/${i}`,p=await new Promise(m=>l.toBlob(m,f,e?.quality));if(p&&await Ir(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 Wr=st(()=>{"use strict";Mn();qt();Ct()});at();at();rt();var Ze=new WeakMap,Jt=new Map,mi=2e3,Se=0;function xe(){Se++,Jt.size>mi&&Jt.clear()}var gi="[data-snapdom-sandbox],[data-snapdom-internal],[data-snapdom]";function Qe(t){let e=t&&(t.nodeType===1?t:t.parentElement);return!!(e&&e.closest&&e.closest(gi))}function Je(t){for(let e of t)if(!Qe(e.target)){if(e.type==="childList"){let n=!0;for(let o of e.addedNodes)if(!Qe(o)){n=!1;break}if(n){for(let o of e.removedNodes)if(!Qe(o)){n=!1;break}}if(n)continue}return!0}return!1}var zn=!1;function yi(t=document.documentElement){if(zn)return;zn=!0;let e=n=>{Je(n)&&xe()};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",xe),n.ready?.then(()=>xe()).catch(()=>{}))}catch{}}var bi=["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 tn(t){let e=Ze.get(t);if(e&&e.epoch===Se){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function wi(t,e={}){let n={},o=e.excludeStyleProps;for(let d=0;d<t.length;d++){let f=t[d];if(Qt(f)||o&&(o instanceof RegExp&&o.test(f)||typeof o=="function"&&o(f)))continue;let p=t.getPropertyValue(f);(f==="background-image"||f==="content")&&p.includes("url(")&&!p.includes("data:")&&(p="none"),n[f]=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 f=t.getPropertyValue(d);f&&(n[d]=f)}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 f=t.getPropertyValue(d);f&&(n[d]=f)}catch{}if(e.embedFonts){let d=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let f of d)if(!n[f])try{let p=t.getPropertyValue(f);p&&(n[f]=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 f=t.getPropertyValue("background-color");f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"&&(i=!0)}if(!i)for(let f of bi){let p=t.getPropertyValue(f);if(p&&p!=="none"){i=!0;break}}if(!i){let f=t.getPropertyValue("background");f&&/url\s*\(/i.test(f)&&(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,u=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,l=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(a===0&&c===0&&u===0&&l===0){let d=(t.getPropertyValue("border-image-source")||"").trim(),f=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 m of p)delete n[m];f||(n.border="none")}return n}function xi(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=N(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function Si(t,e,n){try{if(typeof t.computedStyleMap=="function"){let r=t.computedStyleMap().get("width");if(r!=null)return!Vn(String(r).trim().toLowerCase())}}catch{}let o=t.style&&(t.style.width||t.style.inlineSize);return o&&!Vn(String(o).trim().toLowerCase())?!0:Ci(t,e)?n||Ai(t,e):!1}var vi=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function Vn(t){return vi.has(t)||t.startsWith("fit-content")}function Ci(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=N(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 Ai(t,e){let n=t.parentElement;if(!n)return!1;let o=N(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 jn=new WeakMap;function ki(t){let e=jn.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(";"),jn.set(t,e),e)}function Mi(t,e=null,n={}){let o=Ze.get(t),r=!!(n&&n.embedFonts),s=n&&n.excludeStyleProps||null;if(o&&o.epoch===Se&&o.embedFonts===r&&o.excludeStyleProps===s)return o.snapshot;let i=e||getComputedStyle(t),a=wi(i,n);return Pi(t,i,a),Ze.set(t,{epoch:Se,snapshot:a,embedFonts:r,excludeStyleProps:s}),a}function Fi(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:Jt,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:e||{}}:{session:C.session,persist:{snapshotKeyCache:Jt,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:t||e||{}}}function Ei(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 ct(t,e,n,o){if(t.tagName==="STYLE")return;let r=Fi(n,o),s=r.options&&r.options.cache||"auto";s!=="disabled"&&yi(document.documentElement),s==="disabled"&&!r.session.__bumpedForDisabled&&(xe(),Jt.clear(),r.session.__bumpedForDisabled=!0);let{session:i,persist:a}=r;if(!i.styleCache.has(t)){let b=null;try{b=getComputedStyle(t)}catch{}i.styleCache.set(t,b||getComputedStyle(document.documentElement))}let c=i.styleCache.get(t);t.getAttribute?.("style")&&Ei(t,e,c);let u=c.getPropertyValue("animation-name");e&&e.style&&u&&u!=="none"&&e.style.setProperty("animation","none","important");let l=Mi(t,c,r.options),d=qn(t);if(d){let b=c.getPropertyValue("min-width");(!b||b==="auto"||b==="0px")&&(l["min-width"]="0px")}let f=t.tagName?.toLowerCase()||"div",p=ki(l),m=!0;if(be(f,(l.display||"").toLowerCase())){m=xi(t),m&&je(f,l,d)&&Si(t,c,d)&&(m=!1),p=`${p}|${f}${m?"|c":""}${d?"|f":""}`;let b=l["text-wrap-mode"]||l["white-space"]||"";m&&b!=="nowrap"&&b!=="pre"&&(i.reconcileRisk=(i.reconcileRisk||0)+1)}let h=a.snapshotKeyCache.get(p);h===void 0&&(h=Wt(l,f,m,d),a.snapshotKeyCache.set(p,h)),i.styleMap.set(e,h)}function Ri(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 qn(t){let e=t.parentElement;if(!e)return!1;let n=N(e).display||"";return n.includes("flex")||n.includes("grid")}function $i(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=N(o);if(r.display==="none")continue;let s=r.position;if(s!=="absolute"&&s!=="fixed")return!0}return!1}function Ti(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=N(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 Pi(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"||Ri(e)||qn(t))return;let a=e.overflowX||e.overflow||"visible",c=e.overflowY||e.overflow||"visible";if(a!=="visible"||c!=="visible")return;let u=e.clip;if(u&&u!=="auto"&&u!=="rect(auto, auto, auto, auto)"||e.visibility==="hidden"||e.opacity==="0"||!$i(t))return;let l=parseFloat(e.height),d=Ti(t);Number.isFinite(l)&&Number.isFinite(d)&&Math.abs(l-d)>2||(delete n.height,delete n["block-size"])}Zt();var Gn=["fill","stroke","color","background-color","stop-color"],Ni=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]);function ve(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(Ni.has(e.localName))return!0}e=e.parentNode}return!1}var Xn=new Map;function Li(t,e){let n=e+"::"+t.toLowerCase(),o=Xn.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 u of Gn)c[u]=a.getPropertyValue(u)||"";return i.remove(),Xn.set(n,c),c}function Yn(t,e){if(t?.nodeType!==1||e?.nodeType!==1||ve(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 u=s.getPropertyValue(c);if(!u||!u.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,u=r&&r.getPropertyValue(c);if(u)try{e.style.setProperty(c,u.trim())}catch{}}}if(!o){if(!r)try{r=getComputedStyle(t)}catch{r=null}if(!r)return;let s=t.namespaceURI||"html",i=Li(t.tagName,s);for(let a of Gn){let c=r.getPropertyValue(a)||"",u=i[a]||"";if(c&&c!==u)try{e.style.setProperty(a,c.trim())}catch{}}}}at();at();rt();vt();vt();function Tt(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(t)&&t.length<200)}var Kn="img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]";function Ii(t,e){return!t||t?.nodeType!==1?!1:t.matches?.("picture")||t.querySelector("picture")?!0:e?!!(t.matches?.(Kn)||t.querySelector(Kn)):!1}var _i=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i;function Bt(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 en(t,e){let n=t.currentSrc||"";if(n&&!Tt(n))return n;let o=e.querySelectorAll("source[srcset]"),r=null;for(let s of o){let i=s.getAttribute("srcset");if(!i||Tt(i))continue;let a=s.getAttribute("type");if(a&&!_i.test(a.trim()))continue;let c=s.getAttribute("media");if(c)try{if(window.matchMedia(c).matches)return Bt(i,t)}catch{}r||(r=Bt(i,t))}return r}function Wi(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&&!Tt(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&&!Tt(o))return o}return null}function Oi(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 Qn(t,e={}){if(!t||t?.nodeType!==1||e.resolvePicturePlaceholders===!1)return null;let{timeout:n,concurrency:o,resolveLazySrc:r,silent:s,useProxy:i}=Oi(e);if(!Ii(t,r))return null;let a=[],c=[];async function u(f){let p=await G(f,{as:"dataURL",timeout:n,useProxy:i,silent:!0});return p.ok?p.data:null}async function l(f){for(let p=0;p<f.length;p+=o){let m=f.slice(p,p+o);await Promise.allSettled(m.map(h=>h()))}}let d=Array.from(t.querySelectorAll("picture"));t.matches?.("picture")&&d.unshift(t);for(let f of d){let p=f.querySelector("img");if(!p)continue;let m=p.getAttribute("src")||"";if(!Tt(m))continue;let h=en(p,f);h&&c.push(async()=>{let b=await u(h);if(!b){s||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${h.slice(0,60)}`);return}let y=p.getAttribute("src"),w=p.getAttribute("srcset"),S=p.getAttribute("sizes"),g=[];p.src=b,p.setAttribute("src",b),p.removeAttribute("srcset"),p.removeAttribute("sizes");let x=f.querySelectorAll("source");for(let v of x)g.push({el:v,parent:v.parentElement,next:v.nextSibling}),v.remove();a.push(()=>{y!==null?p.setAttribute("src",y):p.removeAttribute("src"),w!==null&&p.setAttribute("srcset",w),S!==null&&p.setAttribute("sizes",S);for(let{el:v,parent:k,next:A}of g)k&&k.insertBefore(v,A)})})}if(r){let f=Array.from(t.querySelectorAll("img"));t.localName==="img"&&f.unshift(t);for(let p of f){if(p.closest("picture")&&Tt(p.getAttribute("src")||""))continue;let m=p.getAttribute("src")||"",h=Wi(p);h&&Tt(m)&&c.push(async()=>{let b=await u(h);if(!b)return;let y=p.getAttribute("src");p.src=b,p.setAttribute("src",b),p.removeAttribute("srcset"),p.removeAttribute("sizes"),a.push(()=>{y!==null?p.setAttribute("src",y):p.removeAttribute("src")})})}}return c.length===0?null:(await l(c),async function(){for(let p of a)try{p()}catch{}})}function ke(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 Bi(t,e){if(t=t.trim(),!t)return t;let n=e?`[data-sd-slotted~="${e}"]`:"[data-sd-slotted]";return t.endsWith(":not([data-sd-slotted])")||t.endsWith(`:not(${n})`)?t:`${t}:not(${n})`}function Ui(t,e,n=!0,o){return t.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let s=n?Bi(r,o):r;return`:where(${e} ${s})`}).join(", ")}function Jn(t,e,n){return t?(t=t.replace(/:host\(([^)]+)\)/g,(o,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(o,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(o,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(o,r,s,i)=>{let a=Ui(i,e,!0,n);return`${r}${s}${a}{`}),t):""}function to(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function eo(t){let e="";try{t.querySelectorAll("style").forEach(o=>{e+=(o.textContent||"")+`
|
|
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
|
-
|
|
11
|
-
`:""}function so(t,e){if(!t)return;let n=o=>{let r=o.getAttribute("data-sd-slotted")||"";e?` ${r} `.includes(` ${e} `)||o.setAttribute("data-sd-slotted",r?`${r} ${e}`:e):o.setAttribute("data-sd-slotted",r)};t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll?.("*").forEach(n)}async function Hi(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 zi(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 ut(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 Vi(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,u=t.documentElement?t.documentElement.scrollTop:0,l=0,d=0,f=0,p=0;try{let h=o&&t.body?o.getComputedStyle(t.body):null;h&&(l=(parseFloat(h.marginTop)||0)+(parseFloat(h.paddingTop)||0),d=(parseFloat(h.marginRight)||0)+(parseFloat(h.paddingRight)||0),f=(parseFloat(h.marginBottom)||0)+(parseFloat(h.paddingBottom)||0),p=(parseFloat(h.marginLeft)||0)+(parseFloat(h.paddingLeft)||0))}catch{}try{t.documentElement.setAttribute("data-sd-pinned","")}catch{}let m=t.createElement("style");return m.setAttribute("data-sd-iframe-pin",""),m.textContent=`html {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${l}px ${d}px ${f}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(m),()=>{try{m.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=u)}catch{}}}async function ao(t,e,n){let o=await Hi(t,3);if(!o)throw new Error("iframe document not accessible/ready");let{contentWidth:r,contentHeight:s,rect:i}=zi(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},u=Vi(o,r,s),l=C.session.nodeMap,d=C.session.styleMap,f=C.session.styleCache,p;try{p=await a.toPng(o.documentElement,c)}finally{u(),C.session.nodeMap=l,C.session.styleMap=d,C.session.styleCache=f}p.style.display="block",p.style.width=`${r}px`,p.style.height=`${s}px`;let m=document.createElement("div");return e.nodeMap.set(m,t),ct(t,m,e,n),m.style.overflow="hidden",m.style.display="block",m.style.width||(m.style.width=`${Math.round(i.width)}px`),m.style.height||(m.style.height=`${Math.round(i.height)}px`),m.appendChild(p),m}function co(t){let{width:e,height:n}=ut(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),u=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",f=!!t.checked,p=!!t.indeterminate,h=Math.max(Math.min(u,l),12),b="middle";try{r&&r.verticalAlign&&(b=r.verticalAlign)}catch{}let y=document.createElement("div");y.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),y.style.cssText=`display:inline-block;width:${h}px;height:${h}px;vertical-align:${b};flex-shrink:0;line-height:0;`;let w=document.createElementNS("http://www.w3.org/2000/svg","svg");w.setAttribute("width",String(h)),w.setAttribute("height",String(h)),w.setAttribute("viewBox",`0 0 ${h} ${h}`),y.appendChild(w);function S(){let g="#0a6ed1";try{r&&(g=r.accentColor||r.color||g)}catch{}let x=2,v=x/2,k=h-x;if(w.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(k)),A.setAttribute("height",String(k)),A.setAttribute("rx","2"),A.setAttribute("ry","2"),A.setAttribute("fill",f?g:"none"),A.setAttribute("stroke",g),A.setAttribute("stroke-width",String(x)),w.appendChild(A),f){let M=document.createElementNS("http://www.w3.org/2000/svg","path");M.setAttribute("d",`M ${v+2} ${h/2} L ${h/2-1} ${h-v-2} L ${h-v-2} ${v+2}`),M.setAttribute("stroke","white"),M.setAttribute("stroke-width",String(Math.max(1.5,x))),M.setAttribute("fill","none"),M.setAttribute("stroke-linecap","round"),M.setAttribute("stroke-linejoin","round"),w.appendChild(M)}else if(p){let M=document.createElementNS("http://www.w3.org/2000/svg","rect"),F=Math.max(6,k-4);M.setAttribute("x",String((h-F)/2)),M.setAttribute("y",String((h-x)/2)),M.setAttribute("width",String(F)),M.setAttribute("height",String(x)),M.setAttribute("fill",g),M.setAttribute("rx","1"),w.appendChild(M)}}else{let A=document.createElementNS("http://www.w3.org/2000/svg","circle");if(A.setAttribute("cx",String(h/2)),A.setAttribute("cy",String(h/2)),A.setAttribute("r",String((h-x)/2)),A.setAttribute("fill",f?g:"none"),A.setAttribute("stroke",g),A.setAttribute("stroke-width",String(x)),w.appendChild(A),f){let M=document.createElementNS("http://www.w3.org/2000/svg","circle"),F=Math.max(2,(h-x*2)*.35);M.setAttribute("cx",String(h/2)),M.setAttribute("cy",String(h/2)),M.setAttribute("r",String(F)),M.setAttribute("fill","white"),w.appendChild(M)}}y.style.setProperty("width",`${h}px`,"important"),y.style.setProperty("height",`${h}px`,"important"),y.style.setProperty("min-width",`${h}px`,"important"),y.style.setProperty("min-height",`${h}px`,"important")}return S(),{el:y,applyVisual:S}}var te=new Y(80);async function ee(t){if(C.resource?.has(t))return C.resource.get(t);if(te.has(t))return te.get(t);let e=(async()=>{let n=await G(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return C.resource?.set(t,n.data),n.data})();te.set(t,e);try{let n=await e;return te.set(t,n),n}catch(n){throw te.delete(t),n}}var ji=/\bblob:[^)"'\s]+/g;async function Zn(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(ji)||[]));if(e.length===0)return t;let n=t;for(let o of e)try{let r=await ee(o);n=n.split(o).join(r)}catch{}return n}function Ce(t){return typeof t=="string"&&t.startsWith("blob:")}function qi(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 Xi(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function Ae(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function lo(t,e=null){if(!t)return;let n=e,o=Ae(t,"img");for(let c of o)try{let l=c.getAttribute("src")||c.currentSrc||"";if(Ce(l)){let f=await ee(l);c.setAttribute("src",f)}let d=c.getAttribute("srcset");if(d&&d.includes("blob:")){let f=qi(d),p=!1;for(let m of f)if(Ce(m.url))try{m.url=await ee(m.url),p=!0}catch(h){_(n,"blobUrlToDataUrl for srcset item failed",h)}p&&c.setAttribute("srcset",Xi(f))}}catch(u){_(n,"resolveBlobUrls for img failed",u)}let r=Ae(t,"image");for(let c of r)try{let u="http://www.w3.org/1999/xlink",l=c.getAttribute("href")||c.getAttributeNS?.(u,"href");if(Ce(l)){let d=await ee(l);c.setAttribute("href",d),c.removeAttributeNS?.(u,"href")}}catch(u){_(n,"resolveBlobUrls for SVG image href failed",u)}let s=Ae(t,"[style*='blob:']");for(let c of s)try{let u=c.getAttribute("style");if(u&&u.includes("blob:")){let l=await Zn(u);c.setAttribute("style",l)}}catch(u){_(n,"replaceBlobUrls in inline style failed",u)}let i=t.querySelectorAll?t.querySelectorAll("style"):[];for(let c of i)try{let u=c.textContent||"";u.includes("blob:")&&(c.textContent=await Zn(u))}catch(u){_(n,"replaceBlobUrls in style tag failed",u)}let a=["poster"];for(let c of a){let u=Ae(t,`[${c}^='blob:']`);for(let l of u)try{let d=l.getAttribute(c);Ce(d)&&l.setAttribute(c,await ee(d))}catch(d){_(n,`resolveBlobUrls for ${c} failed`,d)}}}Ct();var on=new Map,fo=new Set(["IFRAME"]);function Fe(t,e){on.set(String(t).toUpperCase(),e)}function nn(t){let{width:e,height:n}=ut(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 Me=200,Gi=new Set(["img","canvas","video","iframe","object","embed"]);function uo(t,e){return t.right>=e.left-Me&&t.left<=e.right+Me&&t.bottom>=e.top-Me&&t.top<=e.bottom+Me}function Yi(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=N(t);if(o.display==="inline"&&!Gi.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)),uo(a,r))return!1;let u=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;u.nextNode();){let l=u.currentNode.getBoundingClientRect();if((l.width>0||l.height>0)&&uo(l,r))return!1}return!0}function Ki(t,e,n){let o=t.cloneNode(!1);t.tagName==="IMG"&&(o.removeAttribute("src"),o.removeAttribute("srcset"),o.removeAttribute("sizes")),ct(t,o,e,n);let{width:r,height:s}=ut(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 ne(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")||me.has(l))return null;if(l==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return _(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 nn(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 nn(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 nn(t);if(n.filterMode==="remove")return null}}catch(l){console.warn("Error in filter function:",l)}if(e.clip&&Yi(t,e.clip))return Ki(t,e,n);if(n.__resolveNodeHooks)for(let l of n.__resolveNodeHooks){let d;try{d=await l(t,n)}catch(f){_(e,"resolveNode plugin hook failed",f)}if(d===null)return null;if(d instanceof Node)return d.nodeType===Node.ELEMENT_NODE&&(e.nodeMap.set(d,t),ct(t,d,e,n)),d}{let l=fo.has(t.tagName)&&on.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),ct(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=!fo.has(t.tagName)&&on.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(Yn(t,i),e.nodeMap.set(i,t),t.tagName==="IMG"){oo(t,i);try{let{width:l,height:d}=ut(t),f=Math.round(l||0),p=Math.round(d||0);f&&(i.dataset.snapdomWidth=String(f)),p&&(i.dataset.snapdomHeight=String(p))}catch(l){_(e,"getUnscaledDimensions for IMG failed",l)}try{let l=t.getAttribute("style")||"",d=window.getComputedStyle(t),f=S=>{let g=l.match(new RegExp(`${S}\\s*:\\s*([^;]+)`,"i")),x=g?g[1].trim():d.getPropertyValue(S);return/%|auto/i.test(String(x||""))},p=parseInt(i.dataset.snapdomWidth||"0",10),m=parseInt(i.dataset.snapdomHeight||"0",10),h=f("width")||!p,b=f("height")||!m;h&&p&&(i.style.width=`${p}px`),b&&m&&(i.style.height=`${m}px`);let y=d.getPropertyValue("object-fit"),w=d.getPropertyValue("object-position");y&&y!=="fill"?(i.style.objectFit=y,w&&(i.style.objectPosition=w)):(p&&(i.style.minWidth=`${p}px`),m&&(i.style.minHeight=`${m}px`))}catch(l){_(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}=ut(t),f=l||t.getBoundingClientRect().width||0,p=d||t.getBoundingClientRect().height||0;f&&(i.style.width=`${f}px`),p&&(i.style.height=`${p}px`)}if(t instanceof HTMLInputElement){let l=(t.type||"text").toLowerCase();if((l==="checkbox"||l==="radio")&&Hn()){let{el:f,applyVisual:p}=co(t);e.nodeMap.set(f,t),a=p,i=f}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 f="snapdom-ph-"+(Math.random()*1e6|0);i.classList.add(f);let p=document.createElement("style");p.textContent=`.${f}::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(ve(t)||ct(t,i,e,n),a&&a(),t instanceof SVGElement&&!ve(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 f of l){let p=d.getPropertyValue(f);p&&i.style.setProperty(f,p)}}catch{}}if(t.shadowRoot){try{let S=t.shadowRoot.querySelectorAll("slot");for(let g of S){let x=g.assignedNodes?.()||[];for(let v of x)o.add(v)}}catch{}let l=to(e),d=`[data-sd="${l}"]`;e.shadowScopes||=new WeakMap,e.shadowScopes.set(t.shadowRoot,l);try{i.setAttribute("data-sd",l)}catch{}let f=eo(t.shadowRoot),p=Jn(f,d,l),m=ro(f),h=io(t,m,d);no(i,h+p,l);let b=document.createDocumentFragment(),y=(S,g)=>{if(S.nodeType===Node.ELEMENT_NODE&&S.tagName==="STYLE")return g(null);ne(S,e,n).then(x=>{g(x||null)}).catch(()=>{g(null)})},w=await ke(Array.from(t.shadowRoot.childNodes),y,n.fast);b.append(...w.filter(S=>!!S)),i.appendChild(b)}if(t.tagName==="SLOT"){let l=e.shadowScopes?.get(t.getRootNode()),d=t.assignedNodes?.()||[],f=d.length?t.assignedNodes?.({flatten:!0})||d:[],p=f.length?f:Array.from(t.childNodes),m=document.createDocumentFragment(),h=(y,w)=>{ne(y,e,n).then(S=>{S&&d.length&&so(S,l),w(S||null)}).catch(()=>{w(null)})},b=await ke(Array.from(p),h,n.fast);return m.append(...b.filter(y=>!!y)),m}function c(l,d){if(o.has(l)||t.shadowRoot&&!l.assignedSlot)return d(null);ne(l,e,n).then(f=>{d(f||null)}).catch(()=>{d(null)})}let u=await ke(Array.from(t.childNodes),c,n.fast);if(i.append(...u.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){_(e,"iframe same-origin probe failed",r)}if(o)try{return await ao(t,e,n)}catch(r){console.warn("[SnapDOM] iframe rasterization failed, fallback:",r)}if(o||console.warn("[snapdom] cross-origin <iframe> skipped (its document cannot be read). Captured as a placeholder that keeps the frame's box; pass { placeholders: false } for an invisible spacer.",t),n.placeholders){let{width:r,height:s}=ut(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;`,ct(t,i,e,n),i}else{let{width:r,height:s}=ut(t),i=document.createElement("div");return i.style.cssText=`display:inline-block;width:${r}px;height:${s}px;visibility:hidden;`,ct(t,i,e,n),i}}function Zi(t){try{let e=Math.max(1,Math.min(32,t.width)),n=Math.max(1,Math.min(32,t.height)),o=document.createElement("canvas");o.width=e,o.height=n;let r=o.getContext("2d",{willReadFrequently:!0});if(!r)return!1;r.drawImage(t,0,0,e,n);let s=r.getImageData(0,0,e,n).data;for(let i=3;i<s.length;i+=4)if(s[i]!==0)return!1;return!0}catch{return!1}}async function Ji(t,e,n){let o="";try{let a=t.getContext("2d",{willReadFrequently:!0});try{a&&a.getImageData(0,0,1,1)}catch{}if((K()||!a)&&await mt(),o=t.toDataURL("image/png"),!o||o==="data:,"){try{a&&a.getImageData(0,0,1,1)}catch{}if(await mt(),o=t.toDataURL("image/png"),!o||o==="data:,"){let c=document.createElement("canvas");c.width=t.width,c.height=t.height;let u=c.getContext("2d");u&&(u.drawImage(t,0,0),o=c.toDataURL("image/png"))}}}catch(a){_(e,"Canvas toDataURL failed, using empty/fallback",a)}n&&n.debug&&o&&Zi(t)&&_(e,"canvas is empty at capture time \u2014 capture it after its first frame is drawn",t);let r=document.createElement("img");try{r.decoding="sync",r.loading="eager"}catch(a){_(e,"img decoding/loading hints failed",a)}o&&(r.src=o),r.width=t.width,r.height=t.height;let{width:s,height:i}=ut(t);return s>0&&(r.style.width=`${s}px`),i>0&&(r.style.height=`${i}px`),e.nodeMap.set(r,t),ct(t,r,e,n),r}async function ts(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){_(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}=ut(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),ct(t,r,e,n),r}async function es(t,e,n){if(!t.controls)return;let{width:o,height:r}=ut(t),s=Math.round(o||t.offsetWidth||300),i=Math.round(r||t.offsetHeight||54),a=i/2,c=Math.max(4,i*.16),u=i*.34,l=s-i*.34,d=u+c+i*.55,f=Math.max(0,l-i*.7-d),p=Math.max(9,Math.round(i*.24)),m=`<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 ${u} ${a-c} L ${u+c} ${a} L ${u} ${a+c} Z" fill="#5f6368"/><rect x="${d}" y="${a-1.5}" width="${f}" 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>`,h=document.createElement("img");try{h.decoding="sync",h.loading="eager"}catch{}return h.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,h.width=s,h.height=i,h.style.width=`${s}px`,h.style.height=`${i}px`,e.nodeMap.set(h,t),ct(t,h,e,n),h}Fe("IFRAME",Qi);Fe("CANVAS",Ji);Fe("VIDEO",ts);Fe("AUDIO",es);at();Kt();Zt();rt();rt();var ns=[/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],Ut=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__||{}),mo=[],po=new Set;function os(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function go(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(os(n),"i");else{console.warn("[snapdom] Ignored invalid iconFont value:",n);continue}let r=`${o.source}/${o.flags}`;po.has(r)||(po.add(r),mo.push(o))}}function dt(t){let e=typeof t=="string"?t:"",n=[...ns,...mo];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 rs(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var ho=new Map;function is(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 ss(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 u=a===1,l=null;if(u&&(c==="outlined"&&Ut.materialIconsFilled?l={url:Ut.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&Ut.materialIconsRound?l={url:Ut.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&Ut.materialIconsSharp&&(l={url:Ut.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:o,familyForCanvas:o};if(!ho.has(l.alias))try{let f=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(f),await f.load(),ho.set(l.alias,!0)}catch{return{familyForMeasure:o,familyForCanvas:o}}let d=`"${l.alias}"`;return{familyForMeasure:d,familyForCanvas:d}}async function as(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function cs(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 ls(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,u=is(s),{familyForMeasure:l,familyForCanvas:d}=await ss(a,i,u);await as(d.replace(/^["']+|["']+$/g,""),o);let f=document.createElement("span");f.setAttribute("data-snapdom-internal",""),f.textContent=t,f.style.position="absolute",f.style.visibility="hidden",f.style.left="-99999px",f.style.whiteSpace="nowrap",f.style.fontFamily=l,f.style.fontWeight=String(n||"normal"),f.style.fontSize=`${o}px`,f.style.lineHeight="1",f.style.margin="0",f.style.padding="0",f.style.fontFeatureSettings="'liga' 1",f.style.fontVariantLigatures="normal",f.style.color=r,document.body.appendChild(f);let p=f.getBoundingClientRect(),m=Math.max(1,Math.ceil(p.width)),h=Math.max(1,Math.ceil(p.height));document.body.removeChild(f);let b=document.createElement("canvas");b.width=m*c,b.height=h*c;let y=b.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${o}px ${d}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=r;try{y.fontKerning="normal"}catch{}return y.fillText(t,0,0),{dataUrl:b.toDataURL(),width:m,height:h}}async function yo(t,e,n=C.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],u=n&&n.get(c)||s[a]||null;try{let l=getComputedStyle(u||c),d=l.fontFamily||"Material Icons";if(!rs(d))continue;let f=(u||c).textContent.trim();if(!f)continue;let p=parseInt(l.fontSize,10)||24,m=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",h=cs(l),b=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",y=(u||c).className||"",{dataUrl:w,width:S,height:g}=await ls(f,{family:d,weight:m,fontSize:p,color:h,variation:b,className:y});c.textContent="";let x=c.ownerDocument.createElement("img");x.src=w,x.alt=f,x.style.height=`${p}px`,x.style.width=`${Math.max(1,Math.round(S/g*p))}px`,x.style.objectFit="contain",x.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(x),i++}catch{}}return i}vt();Ct();async function So(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),u=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,u*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:u}}var vo=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),fs=["katex","mathjax","mathml"];function an(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!vo.has(n.toLowerCase()))return n}return""}function us(t){if(!t)return[];let e=[];for(let n of t.split(",")){let o=n.trim().replace(/^['"]+|['"]+$/g,"");o&&(vo.has(o.toLowerCase())||e.push(o))}return e}function Ee(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 Re(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function ds(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function ps(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let r=Ee(n[1]),s=Ee(n[2]);return{min:Math.min(r,s),max:Math.max(r,s)}}let o=Ee(e);return{min:o,max:o}}function hs(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function ms(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 gs(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function ys(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)||fs.some(c=>a.includes(c)))return!0;for(let c of e){let u=c.toLowerCase().replace(/\s+/g,"+"),l=c.toLowerCase().replace(/\s+/g,"-"),d=gs(c);if(a.includes(u)||a.includes(l)||d&&a.includes(d))return!0}return!1}catch{return!1}}function bs(t){let e=new Set;for(let n of t||[]){let o=String(n).split("__")[0]?.trim();o&&e.add(o)}return e}function bo(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 rn=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,$e=4;async function ws(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,u=0){if(u>$e)return console.warn(`[snapDOM] @import depth exceeded (${$e}) at ${c}`),a;let l="",d=0,f;for(;f=rn.exec(a);){l+=a.slice(d,f.index),d=rn.lastIndex;let p=(f[2]||f[4]||"").trim(),m=r(p,c);if(o.has(m)){console.warn(`[snapDOM] Skipping circular @import: ${m}`);continue}o.add(m);let h="";try{let b=await G(m,{as:"text",useProxy:n,silent:!0});b.ok&&typeof b.data=="string"&&(h=b.data)}catch{}h?(h=bo(h,m),h=await s(h,m,u+1),l+=`
|
|
12
|
-
/* inlined: ${m} */
|
|
13
|
-
${h}
|
|
14
|
-
`):l+=f[0]}return l+=a.slice(d),l}let i=bo(t,e||location.href);return i=await s(i,e||location.href,0),i}var Co=/url\((["']?)([^"')]+)\1\)/g,xs=/@font-face[^{}]*\{[^}]*\}/g;function lt(t,e,n=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function Ao(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 u=parseInt(c.replace(/\?/g,"0"),16),l=parseInt(c.replace(/\?/g,"F"),16);return[u,l]};if(i){let c=a(s),u=a(i),l=Array.isArray(c)?c[0]:c,d=Array.isArray(u)?u[1]:u;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 ko(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 cn(t,e){let n=[];if(!t)return n;for(let o of t.matchAll(Co)){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 sn(t,e,n=""){let o=t;for(let r of t.matchAll(Co)){let s=Et(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(!dt(i)){if(C.resource?.has(i)){C.font?.add(i),o=o.replace(r[0],`url(${C.resource.get(i)})`);continue}try{let a=await G(i,{as:"dataURL",useProxy:n,silent:!0});if(a.ok&&typeof a.data=="string"){let c=a.data;C.resource?.set(i,c),C.font?.add(i),o=o.replace(r[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",i)}}}return o}function Ss(t){if(!t.length)return null;let e=(a,c)=>t.some(([u,l])=>!(l<a||u>c)),n=e(0,255)||e(305,305),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 wo(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=Ss(s);if(i&&o.has(i))return!0}return!1}}function vs(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,o=[];for(let s of t.match(e)||[]){let i=lt(s,"font-family"),a=an(i),c=lt(s,"font-weight","400"),u=lt(s,"font-style","normal"),l=lt(s,"font-stretch","100%"),d=lt(s,"unicode-range"),f=lt(s,"src"),p=cn(f,location.href),m=p.length?p.map(b=>String(b).toLowerCase()).sort().join("|"):f.toLowerCase(),h=[String(a||"").toLowerCase(),c,u,l,d.toLowerCase(),m].join("|");n.has(h)||(n.add(h),o.push(s))}if(o.length===0)return t;let r=0;return t.replace(e,()=>o[r++]||"")}var xo=new WeakMap,Cs=0;function As(t){let e=xo.get(t);return e===void 0&&(e=Cs++,xo.set(t,e)),e}function ks(t,e,n,o,r,s){let i=Array.from(t||[]).sort().join("|"),a=e?JSON.stringify({families:(e.families||[]).map(f=>String(f).toLowerCase()).sort(),domains:(e.domains||[]).map(f=>String(f).toLowerCase()).sort(),subsets:(e.subsets||[]).map(f=>String(f).toLowerCase()).sort()}):"",c=(n||[]).map(f=>`${(f.family||"").toLowerCase()}::${f.weight||"normal"}::${f.style||"normal"}::${f.src||""}`).sort().join("|"),u=o||"",l=(r||[]).map(f=>String(f).toLowerCase()).sort().join("|"),d=As(s||document);return`fonts-embed-css::req=${i}::ex=${a}::lf=${c}::px=${u}::fd=${l}::doc=${d}`}async function Mo(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 Mo(i.styleSheet,a,n,c);continue}if(i.type===CSSRule.FONT_FACE_RULE){let a=(i.style.getPropertyValue("font-family")||"").trim(),c=an(a);if(!c||dt(c))continue;let u=(i.style.getPropertyValue("font-weight")||"").trim(),l=(i.style.getPropertyValue("font-style")||"").trim(),d=(i.style.getPropertyValue("font-stretch")||"").trim(),f=(i.style.getPropertyValue("font-variation-settings")||"").trim(),p=(i.style.getPropertyValue("src")||"").trim(),m=(i.style.getPropertyValue("unicode-range")||"").trim(),h=u||"400",b=l||"normal",y=d||"100%",w=(l?`font-style:${l};`:"")+(u?`font-weight:${u};`:"")+(d?`font-stretch:${d};`:"")+(f?`font-variation-settings:${f};`:"")+(m?`unicode-range:${m};`:""),S=o.faceMatchesRequired(c,b,h,y);if(!S&&!o.requiredIndex.has(c.toLowerCase()))continue;let g=Ao(m);if(!ko(o.usedCodepoints,g))continue;let x={family:c,weightSpec:h,styleSpec:b,stretchSpec:y,unicodeRange:m,srcRaw:p,srcUrls:cn(p,e||location.href),href:e||location.href};if(o.simpleExcluder&&o.simpleExcluder(x,g))continue;if(!S){o.provisionalFaces.push({family:c.toLowerCase(),block:`@font-face{font-family:${c};src:${p};${w}}`,srcRaw:p,baseHref:e||location.href});continue}if(o.coveredFamilies.add(c.toLowerCase()),/url\(/i.test(p)){let v=await sn(p,e||location.href,o.useProxy);await n(`@font-face{font-family:${c};src:${v};${w}}`)}else await n(`@font-face{font-family:${c};src:${p};${w}}`)}}}async function Te({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[x,v,k,A]=String(g).split("__");if(!x)continue;let M=x.toLowerCase(),F=a.get(M)||[];F.push({w:parseInt(v,10),s:k,st:parseInt(A,10)}),a.set(M,F)}function c(g,x,v,k){let A=String(g).toLowerCase();if(!a.has(A))return!1;let M=a.get(A),F=ps(v),E=hs(x),$=ms(k),W=F.min!==F.max,T=F.min,I=U=>E.kind==="normal"&&U==="normal"||E.kind!=="normal"&&(U==="italic"||U==="oblique"),O=!1;for(let U of M){let P=W?U.w>=F.min&&U.w<=F.max:U.w===T,z=I(Re(U.s)),j=U.st>=$.min&&U.st<=$.max;if(P&&z&&j){O=!0;break}}if(O)return!0;if(!W)for(let U of M){let P=I(Re(U.s)),z=U.st>=$.min&&U.st<=$.max;if(Math.abs(T-U.w)<=300&&P&&z)return!0}if(!W&&E.kind==="normal"&&M.some(P=>Re(P.s)!=="normal"))for(let P of M){let z=Math.abs(T-P.w)<=300,j=P.st>=$.min&&P.st<=$.max;if(z&&j)return!0}return!1}let u=wo(n),l=ks(t,n,o,r,s,i);if(C.resource?.has(l))return C.resource.get(l);let d=bs(t),f=[],p=rn;for(let g of i.querySelectorAll("style")){let x=g.textContent||"";for(let v of x.matchAll(p)){let k=(v[2]||v[4]||"").trim();if(!k||dt(k))continue;i.querySelector(`link[rel="stylesheet"][href="${k}"]`)||f.push(k)}}let m=[];f.length&&await Promise.all(f.map(g=>new Promise(x=>{if(i.querySelector(`link[rel="stylesheet"][href="${g}"]`))return x(null);let v=i.createElement("link");v.rel="stylesheet",v.href=g,v.setAttribute("data-snapdom","injected-import"),v.onload=()=>x(v),v.onerror=()=>x(null),i.head.appendChild(v),m.push(v)})));let h="",b=new Set,y=[],w=Array.from(i.querySelectorAll('link[rel="stylesheet"]')).filter(g=>!!g.href);for(let g of m)try{g.remove()}catch{}for(let g of w)try{if(dt(g.href))continue;let x="",v=!1;try{v=new URL(g.href,location.href).origin===location.origin}catch{}if(!v){let A=Array.isArray(s)?s:[];if(!ys(g.href,d,A))continue}if(v){let A=Array.from(i.styleSheets).find(M=>M.href===g.href);if(A)try{let M=A.cssRules||[];x=Array.from(M).map(F=>F.cssText).join("")}catch{}}if(!x){let A=await G(g.href,{as:"text",useProxy:r});if(A?.ok&&typeof A.data=="string"&&(x=A.data),dt(g.href))continue}x=await ws(x,g.href,r);let k="";for(let A of x.match(xs)||[]){let M=lt(A,"font-family"),F=an(M);if(!F||dt(F))continue;let E=lt(A,"font-weight","400"),$=lt(A,"font-style","normal"),W=lt(A,"font-stretch","100%"),T=lt(A,"unicode-range"),I=lt(A,"src"),O=cn(I,g.href),U=c(F,$,E,W);if(!U&&!a.has(F.toLowerCase()))continue;let P=Ao(T);if(!ko(e,P))continue;let z={family:F,weightSpec:E,styleSpec:$,stretchSpec:W,unicodeRange:T,srcRaw:I,srcUrls:O,href:g.href};if(n&&u(z,P))continue;if(!U){y.push({family:F.toLowerCase(),block:A,srcRaw:I,baseHref:g.href});continue}b.add(F.toLowerCase());let j=/url\(/i.test(I)?await sn(A,g.href,r):A;k+=j}k.trim()&&(h+=k)}catch{console.warn("[snapDOM] Failed to process stylesheet:",g.href)}let S={requiredIndex:a,usedCodepoints:e,faceMatchesRequired:c,coveredFamilies:b,provisionalFaces:y,simpleExcluder:n?wo(n):null,useProxy:r,visitedSheets:new Set,depth:0};for(let g of i.styleSheets)if(!(g.href&&w.some(x=>x.href===g.href)))try{let x=g.href||location.origin+"/";x&&S.visitedSheets.add(x),await Mo(g,x,async v=>{h+=v},S)}catch{}for(let g of y)b.has(g.family)||(h+=/url\(/i.test(g.srcRaw)?await sn(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 x=String(g.family).replace(/^['"]+|['"]+$/g,"");if(dt(x)||!a.has(x.toLowerCase())||n?.families&&n.families.some(k=>String(k).toLowerCase()===x.toLowerCase()))continue;let v=g._snapdomSrc;if(!String(v).startsWith("data:")){if(C.resource?.has(g._snapdomSrc))v=C.resource.get(g._snapdomSrc),C.font?.add(g._snapdomSrc);else if(!C.font?.has(g._snapdomSrc))try{let k=await G(g._snapdomSrc,{as:"dataURL",useProxy:r,silent:!0});if(k.ok&&typeof k.data=="string")v=k.data,C.resource?.set(g._snapdomSrc,v),C.font?.add(g._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",g._snapdomSrc);continue}}h+=`@font-face{font-family:'${x}';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 x=String(g.family||"").replace(/^['"]+|['"]+$/g,"");if(!x||dt(x)||!a.has(x.toLowerCase())||n?.families&&n.families.some(E=>String(E).toLowerCase()===x.toLowerCase()))continue;let v=g.weight!=null?String(g.weight):"normal",k=g.style!=null?String(g.style):"normal",A=g.stretchPct!=null?`${g.stretchPct}%`:"100%",M=String(g.src||""),F=M;if(!F.startsWith("data:")){if(C.resource?.has(M))F=C.resource.get(M),C.font?.add(M);else if(!C.font?.has(M))try{let E=await G(M,{as:"dataURL",useProxy:r,silent:!0});if(E.ok&&typeof E.data=="string")F=E.data,C.resource?.set(M,F),C.font?.add(M);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",M);continue}}h+=`@font-face{font-family:'${x}';src:url(${F});font-style:${k};font-weight:${v};font-stretch:${A};}`}return h&&(h=vs(h),C.resource?.set(l,h)),h}function oe(t,e){let n=new Set,o=new Set;if(!t)return{required:n,usedCodepoints:o};let r=c=>{if(c)for(let u of c)o.add(u.codePointAt(0))},s=c=>{let u=us(c.fontFamily);if(u.length)for(let l of u)n.add(`${l}__${Ee(c.fontWeight)}__${Re(c.fontStyle)}__${ds(c.fontStretch)}`)},i=c=>{s(N(c));for(let u of["::before","::after"]){let l=N(c,u),d=l&&l.content;if(!(!d||d==="none"||d==="normal"))if(s(l),/^["']/.test(d))r(d.slice(1,-1));else{let f=d.match(/\\[0-9A-Fa-f]{1,6}/g);if(f)for(let p of f)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 Fo(t,e){return oe(t,e).required}async function Dt(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 mt(),await mt()}function To(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Eo(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 Ro(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 $o(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 Eo(t,!1);case"upper-alpha":return Eo(t,!0);case"lower-roman":return Ro(t,!1);case"upper-roman":return Ro(t,!0);default:return String(t)}}function Po(t){let e=new WeakMap,n=t instanceof Document?t.documentElement:t,o=u=>u&&u.tagName==="LI",r=u=>{let l=0,d=u?.parentElement;if(!d)return 0;for(let f of d.children){if(f===u)break;f.tagName==="LI"&&l++}return l},s=u=>{let l=new Map;for(let[d,f]of u)l.set(d,f.slice());return l},i=(u,l,d)=>{let f=s(u),p;try{p=d.style?.counterReset||getComputedStyle(d).counterReset}catch{}if(p&&p!=="none")for(let b of p.split(",")){let y=b.trim().split(/\s+/),w=y[0],S=Number.isFinite(Number(y[1]))?Number(y[1]):0;if(!w)continue;let g=l.get(w);if(g&&g.length){let x=g.slice();x.push(S),f.set(w,x)}else f.set(w,[S])}let m;try{m=d.style?.counterSet||getComputedStyle(d).counterSet}catch{}if(m&&m!=="none")for(let b of m.split(",")){let y=b.trim().split(/\s+/),w=y[0],S=Number.isFinite(Number(y[1]))?Number(y[1]):0;if(!w)continue;let g=f.get(w)||[];g.length===0&&g.push(0),g[g.length-1]=S,f.set(w,g)}let h;try{h=d.style?.counterIncrement||getComputedStyle(d).counterIncrement}catch{}if(h&&h!=="none")for(let b of h.split(",")){let y=b.trim().split(/\s+/),w=y[0],S=Number.isFinite(Number(y[1]))?Number(y[1]):1;if(!w)continue;let g=f.get(w)||[];g.length===0&&g.push(0),g[g.length-1]+=S,f.set(w,g)}try{if(getComputedStyle(d).display==="list-item"&&o(d)){let y=d.parentElement,w=1;if(y&&y.tagName==="OL"){let g=y.getAttribute("start"),x=Number.isFinite(Number(g))?Number(g):1,v=r(d),k=d.getAttribute("value");w=Number.isFinite(Number(k))?Number(k):x+v}else w=1+r(d);let S=f.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=w,f.set("list-item",S)}}catch{}return f},a=(u,l,d)=>{let f=i(d,l,u);e.set(u,f);let p=f;for(let h of u.children)p=a(h,f,p);let m=new Map;for(let[h,b]of d){let y=b.length,w=p.get(h);m.set(h,w&&w.length?w.slice(0,y):b.slice())}for(let[h,b]of p)!m.has(h)&&b.length&&!l.has(h)&&m.set(h,b.slice(0,1));return m},c=new Map;return a(n,c,c),{get(u,l){let d=e.get(u)?.get(l);return d&&d.length?d[d.length-1]:0},getStack(u,l){let d=e.get(u)?.get(l);return d?d.slice():[]}}}function No(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,""),u=(a[1]||"decimal").toLowerCase(),l=n.get(e,c);return $o(l,u)}else{let c=a[0]?.replace(/^["']|["']$/g,""),u=a[1]?.replace(/^["']|["']$/g,"")??"",l=(a[2]||"decimal").toLowerCase(),d=n.getStack(e,c);return d.length?d.map(p=>$o(p,l)).join(u):""}})}catch{return"- "}}vt();var Ht=new WeakMap,Lo=1e3;function Ms(t,e){let n=Oo(t);return e?(e.__pseudoPreflightFp!==n&&(e.__pseudoPreflight=_o(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):_o(t,n)}function ln(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function Oo(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,u=c?ln(c):null;u&&(o+=u.length)}else{let a=i.getAttribute("href")||"",c=i.getAttribute("media")||"all";n+=`L${a}|m:${c}|`;let u=i.sheet,l=u?ln(u):null;l&&(o+=l.length)}}let r=t.adoptedStyleSheets;return n+=`ass:${Array.isArray(r)?r.length:0}|tr:${o}`,n}function Io(t,e,n){let o=ln(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],u=c&&c.cssText?c.cssText:"";n.budget--;for(let l of e)if(u.includes(l))return!0}if(n.budget<=0)return!1}return!1}function _o(t=document,e=Oo(t)){let n=Ht.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 Ht.set(t,{fingerprint:e,result:!0}),!0}let s=t.adoptedStyleSheets;if(Array.isArray(s)&&s.length){let i={budget:Lo};try{for(let a of s)if(Io(a,o,i))return Ht.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let i=t.querySelectorAll('style,link[rel~="stylesheet"]'),a={budget:Lo};for(let c=0;c<i.length&&a.budget>0;c++){let u=i[c],l=null;if(u.tagName,l=u.sheet||null,l&&Io(l,o,a))return Ht.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Ht.set(t,{fingerprint:e,result:!0}),!0):(Ht.set(t,{fingerprint:e,result:!1}),!1)}function Wo(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 Fs(t,e){let n=null,o=()=>{if(!n)try{n=Po(t)}catch(r){_(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 Es(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 Rs(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 fn(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 u=a.slice();return u[u.length-1]=Math.max(u[u.length-1],c),u}return a}}:e}function un(t,e,n){let o=new Map;function r(u){let l=[];if(!u||u==="none")return l;for(let d of String(u).split(",")){let f=d.trim().split(/\s+/),p=f[0],m=Number.isFinite(Number(f[1]))?Number(f[1]):void 0;p&&l.push({name:p,num:m})}return l}let s=r(e?.counterReset),i=r(e?.counterSet),a=r(e?.counterIncrement);function c(u){if(o.has(u))return o.get(u).slice();let l=n.getStack(t,u);l=l.length?l.slice():[];let d=s.find(m=>m.name===u);if(d){let m=Number.isFinite(d.num)?d.num:0;l=l.length?[...l,m]:[m]}let f=i.find(m=>m.name===u);if(f){let m=Number.isFinite(f.num)?f.num:0;l.length===0&&(l=[0]),l[l.length-1]=m}let p=a.find(m=>m.name===u);if(p){let m=Number.isFinite(p.num)?p.num:1;l.length===0&&(l=[0]),l[l.length-1]+=m}return o.set(u,l.slice()),l}return{get(u,l){let d=c(l);return d.length?d[d.length-1]:0},getStack(u,l){return c(l)},__incs:a}}function $s(t,e,n,o){let r;try{r=N(t,e)}catch{}let s=r?.content;if(!s||s==="none"||s==="normal")return{text:"",incs:[]};s=Es(s);let i=fn(t,n,o),a=un(t,r,i),c=To(s)?No(s,t,a):s;return{text:Rs(c),incs:a.__incs||[]}}async function Pe(t,e,n,o){if(t?.nodeType!==1||e?.nodeType!==1||t.tagName==="TEXTAREA")return;let r=t.ownerDocument||document;if(!Ms(r,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=Fs(t.ownerDocument||document,n));let s=n.__counterCtx;for(let a of["::before","::after","::first-letter"])try{let c=N(t,a);if(!c||c.content==="none"&&c.backgroundImage==="none"&&c.backgroundColor==="transparent"&&!Wo(c)&&(!c.transform||c.transform==="none")&&c.display==="inline")continue;if(a==="::first-letter"){let L=N(t),B=(L?.display||"").toLowerCase();if(B.includes("flex")||B.includes("grid"))continue;let D=bt=>c[bt]!==L[bt]&&(parseFloat(c[bt])||0)!==0;if(!(c.color!==L.color||c.fontSize!==L.fontSize||c.fontWeight!==L.fontWeight||c.fontFamily!==L.fontFamily||c.fontStyle!==L.fontStyle||c.textTransform!==L.textTransform||c.float!==L.float&&c.float!=="none"||D("paddingTop")||D("paddingRight")||D("paddingBottom")||D("paddingLeft")||D("marginTop")||D("marginRight")||D("marginBottom")||D("marginLeft")))continue;let q=Array.from(e.childNodes).find(bt=>bt.nodeType===Node.TEXT_NODE&&bt.textContent?.trim().length>0);if(!q)continue;let J=q.textContent,yt=J.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],Nt=J.slice(yt?.length||0);if(!yt||/[\uD800-\uDFFF]/.test(yt))continue;let it=document.createElement("span");it.textContent=yt,it.dataset.snapdomPseudo="::first-letter";let Lt=we(c),It=Wt(Lt,"span");n.styleMap.set(it,It);let kt=document.createTextNode(Nt);e.replaceChild(kt,q),e.insertBefore(it,kt);continue}let l=c.content??"",d=l===""||l==="none"||l==="normal",{text:f,incs:p}=$s(t,a,s,n.__siblingCounters),m=c.backgroundImage,h=c.backgroundColor,b=c.fontFamily,y=parseInt(c.fontSize)||32,w=parseInt(c.fontWeight)||!1,S=c.color||"#000",g=c.transform,x=dt(b),v=!d&&f!=="",k=m&&m!=="none",A=h&&h!=="transparent"&&h!=="rgba(0, 0, 0, 0)",M=Wo(c),F=g&&g!=="none",E=l!=="none"&&l!=="normal",$=E&&((parseFloat(c.width)||0)>0||(parseFloat(c.height)||0)>0),W=E&&c.boxShadow&&c.boxShadow!=="none",T=E&&c.outlineStyle&&c.outlineStyle!=="none"&&(parseFloat(c.outlineWidth)||0)>0;if(!(v||k||A||M||F||$||W||T)){if(p&&p.length&&t.parentElement){let L=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:B}of p){if(!B)continue;let D=fn(t,s,n.__siblingCounters),q=un(t,N(t,a),D).get(t,B);L.set(B,q)}n.__siblingCounters.set(t.parentElement,L)}continue}let O=f.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(f),U=!1;if(v&&!x&&f.length>1&&!O){let L=N(t),B=parseFloat(L.fontSize)||16,D=parseFloat(L.lineHeight);Number.isFinite(D)||(D=B*1.5),t.getBoundingClientRect().height<D*1.6&&(e.style.whiteSpace="nowrap",U=!0)}let P=document.createElement("span");P.dataset.snapdomPseudo=a,P.style.pointerEvents="none",U&&(P.style.whiteSpace="nowrap");let z=we(c),j=(N(t).display||"").toLowerCase(),tt=j.includes("flex")||j.includes("grid");if(tt){let L=z["min-width"];(!L||L==="auto"||L==="0px")&&(z["min-width"]="0px")}let et=Wt(z,"span",v,tt);if(n.styleMap.set(P,et),x&&f&&f.length===1){let{dataUrl:L,width:B,height:D}=await So(f,b,w,y,S),V=document.createElement("img");V.src=L,V.style=`height:${y}px;width:${B/D*y}px;object-fit:contain;`,P.appendChild(V),e.dataset.snapdomHasIcon="true"}else if(f&&O){let L=Yt(f,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Et(f);if(L?.trim())try{let B=await G(St(L),{as:"dataURL",useProxy:o.useProxy});if(B?.ok&&typeof B.data=="string"){let D=document.createElement("img");D.src=B.data,D.style=`width:${y}px;height:auto;object-fit:contain;`,P.appendChild(D)}}catch(B){console.error(`[snapdom] Error in pseudo ${a} for`,t,B)}}else!x&&v&&(P.textContent=f);P.style.backgroundImage="none","maskImage"in P.style&&(P.style.maskImage="none"),"webkitMaskImage"in P.style&&(P.style.webkitMaskImage="none");try{P.style.backgroundRepeat=c.backgroundRepeat,P.style.backgroundSize=c.backgroundSize,c.backgroundPositionX&&c.backgroundPositionY?(P.style.backgroundPositionX=c.backgroundPositionX,P.style.backgroundPositionY=c.backgroundPositionY):P.style.backgroundPosition=c.backgroundPosition,P.style.backgroundOrigin=c.backgroundOrigin,P.style.backgroundClip=c.backgroundClip,P.style.backgroundAttachment=c.backgroundAttachment,P.style.backgroundBlendMode=c.backgroundBlendMode}catch{}if(k)try{let L=Ot(m),B=await Promise.all(L.map(Rt));P.style.backgroundImage=B.join(", ")}catch(L){console.warn(`[snapdom] Failed to inline background-image for ${a}`,L)}A&&(P.style.backgroundColor=h);let ft=P.childNodes.length>0||P.textContent?.trim()!==""||k||A||M||F||$||W||T;if(p&&p.length&&t.parentElement){let L=n.__siblingCounters.get(t.parentElement)||new Map,B=fn(t,s,n.__siblingCounters),D=un(t,N(t,a),B);for(let{name:V}of p){if(!V)continue;let q=D.get(t,V);L.set(V,q)}n.__siblingCounters.set(t.parentElement,L)}if(!ft)continue;a==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(P,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(P))}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 Pe(c,a,n,o)}else{let a=Array.from(t.children);for(let c=0;c<Math.min(a.length,i.length);c++)await Pe(a[c],i[c],n,o)}}function Bo(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",u=g=>{if(!g||!g.getAttribute)return null;let x=g.getAttribute("href")||g.getAttribute("xlink:href")||(typeof g.getAttributeNS=="function"?g.getAttributeNS(c,"href"):null);if(x)return x;let v=g.attributes;if(!v)return null;for(let k=0;k<v.length;k++){let A=v[k];if(!A||!A.name)continue;if(A.name==="href")return A.value;let M=A.name.indexOf(":");if(M!==-1&&A.name.slice(M+1)==="href")return A.value}return null},l=new Set(Array.from(t.querySelectorAll("[id]")).map(g=>g.id)),d=new Set,f=!1,p=(g,x=null)=>{if(!g)return;s.lastIndex=0;let v;for(;v=s.exec(g);){f=!0;let k=(v[1]||"").trim();k&&(l.has(k)||(d.add(k),x&&!x.has(k)&&x.add(k)))}},m=g=>{let x=g.querySelectorAll("use");for(let A of x){let M=u(A);if(!M||!M.startsWith("#"))continue;f=!0;let F=M.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 k=g.querySelectorAll(v);for(let A of k){p(A.getAttribute("style")||"");for(let M of i)p(A.getAttribute(M))}};for(let g of r)m(g);if(!f)return;let h=t.querySelector("svg.inline-defs-container");h||(h=n.createElementNS("http://www.w3.org/2000/svg","svg"),h.classList.add("inline-defs-container"),h.setAttribute("aria-hidden","true"),h.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(h,t.firstChild||null));let b=h.querySelector("defs")||null,y=g=>{if(!g||l.has(g))return null;let x=a(g),v=k=>{let A=o.querySelector(k);return A&&!t.contains(A)?A:null};return v(`svg defs > *#${x}`)||v(`svg > symbol#${x}`)||v(`*#${x}`)};if(!d.size)return;let w=new Set(d),S=new Set;for(;w.size;){let g=w.values().next().value;if(w.delete(g),!g||l.has(g)||S.has(g))continue;let x=y(g);if(!x){S.add(g);continue}b||(b=n.createElementNS("http://www.w3.org/2000/svg","defs"),h.appendChild(b));let v=x.cloneNode(!0);v.id||v.setAttribute("id",g),b.appendChild(v),S.add(g),l.add(g);let k=[v,...v.querySelectorAll("*")];for(let A of k){let M=u(A);if(M&&M.startsWith("#")){let E=M.slice(1).trim();E&&!l.has(E)&&!S.has(E)&&w.add(E)}let F=A.getAttribute?.("style")||"";F&&p(F,w);for(let E of i){let $=A.getAttribute?.(E);$&&p($,w)}}}}rt();function Uo(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 Do(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{}}}at();Zt();function Ho(t){return Vo(t.boxShadow)}function zo(t){return Vo(t.textShadow)}function Vo(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 u=t[c];u==="("?o++:u===")"&&(o=Math.max(0,o-1)),u===","&&o===0?(e.push(n),n=""):n+=u}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 u=c.match(/-?\d+(\.\d+)?px/g)?.map(b=>parseFloat(b))||[];if(u.length<2)continue;let[l,d,f=0,p=0]=u,m=Math.abs(l)+f+p,h=Math.abs(d)+f+p;s=Math.max(s,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),i=Math.max(i,h+Math.max(d,0)),r=Math.max(r,h+Math.max(-d,0))}return{top:Math.ceil(r),right:Math.ceil(s),bottom:Math.ceil(i),left:Math.ceil(a)}}function jo(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 qo(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 Xo(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 u=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(h=>parseFloat(h))||[],[l=0,d=0,f=0]=u,p=Math.abs(l)+f,m=Math.abs(d)+f;r=Math.max(r,p+Math.max(l,0)),i=Math.max(i,p+Math.max(-l,0)),s=Math.max(s,m+Math.max(d,0)),o=Math.max(o,m+Math.max(-d,0))}return{bleed:{top:R(o),right:R(r),bottom:R(s),left:R(i)},has:a}}function Go(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=Vt(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),u=Number.isFinite(c[0])?c[0]:1,l=Number.isFinite(c[1])?c[1]:u;return{a:u,b:0,c:0,d:l}}function r(a,c,u,l){let d=Math.sqrt(a*a+c*c)||0,f=0,p=0;if(d>0){let m=a/d,h=c/d;f=m*u+h*l;let b=u-m*f,y=l-h*f;p=Math.sqrt(b*b+y*y)||0,p>0?f=f/p:f=0}return{a:d,b:0,c:f*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,u,l,d]=a,f=r(c,u,l,d);try{e.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}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],u=a[1],l=a[4],d=a[5],f=r(c,u,l,d);try{e.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}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 zt(t,e,n,o,r){let s=n.a,i=n.b,a=n.c,c=n.d,u=n.e||0,l=n.f||0;function d(y,w){let S=y-o,g=w-r,x=s*S+a*g,v=i*S+c*g;return x+=o+u,v+=r+l,[x,v]}let f=[d(0,0),d(t,0),d(0,e),d(t,e)],p=1/0,m=1/0,h=-1/0,b=-1/0;for(let[y,w]of f)y<p&&(p=y),w<m&&(m=w),y>h&&(h=y),w>b&&(b=w);return{minX:p,minY:m,maxX:h,maxY:b,width:h-p,height:b-m}}function re(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[r,s]=[o[0]||"0",o[1]||"0"],i=(a,c)=>{let u=a.toLowerCase();return u==="left"||u==="top"?0:u==="center"?c/2:u==="right"||u==="bottom"?c:u.endsWith("px")?parseFloat(u)||0:u.endsWith("%")?(parseFloat(u)||0)*c/100:/^-?\d+(\.\d+)?$/.test(u)&&parseFloat(u)||0};return{ox:i(r,e),oy:i(s,n)}}function Vt(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,u="y"in i&&i.y?.value!=null?i.y.value:Array.isArray(i)?i[1]?.value:c;e.scale=`${c} ${u}`}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,u="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} ${u}${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 dn=null;function Ts(){if(dn)return dn;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),dn=t,t}function Yo(t){let e=Ts(),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=Ps(n);return e.removeChild(n),o}function Ko(t){let e=N(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 Ps(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var pn="http://www.w3.org/1999/xhtml",tr=new WeakSet;function Ne(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 hn(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return e instanceof ShadowRoot?e.host:null}function Ns(t,e){for(let n=e;n;n=hn(n))if(n===t)return!0;return!1}function Ls(t,e){for(let n=hn(t);n&&n!==e&&n?.nodeType===1;n=hn(n)){let o=N(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 gn(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 er(t,e,n,o,r){let s=t.getBoundingClientRect();e?.nodeType===1&&e.namespaceURI===pn&&N(t).position==="static"&&(e.style.position="relative");let i=[];for(let[a,c]of n){if(a?.nodeType!==1||a.namespaceURI!==pn||c?.nodeType!==1||c===t||!Ns(t,c))continue;let u=o.get(c)||N(c),l=u.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;tr.add(a);let f=u.transform&&u.transform!=="none"?u.transform:"",p=Vt(c),m=!!(f||p.rotate!=="0deg"||p.scale||p.translate),h=m?gn(f,p):null,b=!h||!h.is2D||h.a===1&&h.b===0&&h.c===0&&h.d===1,y=d.width,w=d.height;b||(y=c.offsetWidth||d.width,w=c.offsetHeight||d.height);let S=c.getRootNode&&c.getRootNode()instanceof ShadowRoot,g=s,x=t.clientLeft||0,v=t.clientTop||0;if(S){let E=Ls(c,t);E&&(g=E.getBoundingClientRect(),x=E.clientLeft||0,v=E.clientTop||0)}let k=d.left-g.left-x,A=d.top-g.top-v;if(m)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",b)a.style.transform="none";else{a.style.transform=`matrix(${h.a},${h.b},${h.c},${h.d},0,0)`;let{ox:E,oy:$}=re(u,y,w),W=zt(y,w,{a:h.a,b:h.b,c:h.c,d:h.d,e:0,f:0},E,$);k-=W.minX,A-=W.minY}if(l!=="fixed"){let E=a.cloneNode(!1);E.setAttribute("data-snap-ph","1"),E.style.position="static",E.style.visibility="hidden",E.style.width=`${y}px`,E.style.height=`${w}px`,E.style.boxSizing="border-box",a.parentElement?.insertBefore(E,a)}let M=y+2,F=w;r&&(Math.abs(A-r.y)<.5&&(A-=1,F+=1),Math.abs(k-r.x)<.5&&(k-=1,M+=1)),a.style.position="absolute",a.style.left=`${k}px`,a.style.top=`${A}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${M}px`,a.style.height=`${F}px`,a.style.boxSizing="border-box",S||i.push(a)}for(let a of i)e.appendChild(a)}function nr(t,e,n={}){if(!t||!e||!e.style)return;let o=getComputedStyle(t);try{e.style.boxShadow="none"}catch(i){_(n,"stripRootShadows boxShadow",i)}try{e.style.textShadow="none"}catch(i){_(n,"stripRootShadows textShadow",i)}try{e.style.outline="none"}catch(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){_(n,"stripRootShadows filter",i)}}function or(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 Qo(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 Is(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 rr(t,e,n){if(!t||!e||!e.style)return;let o=getComputedStyle(t);if(!Qo(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=Is(i,r);if(!c)break;let u=n?Array.from(a.children).find(f=>n.get(f)===c)||null:a.children[Array.from(i.children).indexOf(c)]||null,l=getComputedStyle(c),d=parseFloat(l[`margin${s}`])||0;if(u&&u.style&&d>0&&(u.style[`margin${s}`]="0px"),Qo(l)||(parseFloat(l[`border${s}Width`])||0)>0||(parseFloat(l[`padding${s}`])||0)>0)break;i=c,a=u}}}function _s(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 Ws(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 Zo=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function Os(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(Zo,"");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(Zo,"");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 ir(t,e={}){t&&(Ws(t,e),_s(t),Os(t))}function Bs(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}function Us(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Ds(t,e){if(t?.nodeType!==1||Bs(t)||Us(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 sr(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&&Ds(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),u=Array.from(s.children);for(let l=0;l<Math.min(c.length,u.length);l++)o(c[l],u[l])}o(t,e)}function Hs(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function zs(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){_(e,"exclude selector match failed",o)}if(typeof e?.filter=="function"&&e.filterMode==="remove")try{if(!e.filter(t))return!0}catch(n){_(e,"filter function failed",n)}return!1}function ar(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(zs(p,e)||!Hs(p))continue;let m=p.getBoundingClientRect(),h=m.top-o.top,b=m.bottom-o.top;b<=h||(h<r&&(r=h),b>s&&(s=b),i=!0)}let c=i?Math.max(0,s-r):0,u=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,f=parseFloat(n.paddingBottom)||0;return u+l+d+f+c}var R=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,jt=.75;function cr(t,e,n,o,r,s){let i=t.ownerDocument||document,a=t.getBoundingClientRect(),c=r>0&&a.width>0?a.width/r:1,u=s>0&&a.height>0?a.height/s:1;if(Math.abs(c-u)>.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"}),f=i.createElement("style");f.textContent=n,d.appendChild(f);let p=e.cloneNode(!0);d.appendChild(p),i.body.appendChild(l);let m=0,h=(b,y,w)=>{let S=N(b),g=S.boxSizing==="border-box",x=(v,k,...A)=>{let M=parseFloat(v);if(!Number.isFinite(M))return k;let F=M+(g?0:A.reduce((E,$)=>E+(parseFloat($)||0),0));return Math.abs(F-k)<=.51?F:k};return{width:x(S.width,y,S.paddingLeft,S.paddingRight,S.borderLeftWidth,S.borderRightWidth),height:x(S.height,w,S.paddingTop,S.paddingBottom,S.borderTopWidth,S.borderBottomWidth)}};try{let b=p.getBoundingClientRect(),y=p.offsetWidth||r,w=p.offsetHeight||s,S=y>0&&b.width>0?b.width/y:1,g=w>0&&b.height>0?b.height/w:1,x=(v,k,A=!1)=>{let M=v.children,F=k.children,E=Math.min(M.length,F.length);for(let $=0;$<E;$++){let W=M[$],T=F[$],I=o.get(W),O=A||tr.has(W);if(I?.nodeType===1&&W?.namespaceURI===pn&&W.style&&I.isConnected){let U=I.getBoundingClientRect();if(U.width>0&&U.height>0){let P=T.getBoundingClientRect(),z=U.width/c,j=U.height/u,tt=P.width,et=P.height,pt=I.offsetWidth||z,ft=I.offsetHeight||j,L=T.offsetWidth||tt,B=T.offsetHeight||et,D=Math.abs(z-pt)>jt||Math.abs(j-ft)>jt||Math.abs(tt-L)>jt||Math.abs(et-B)>jt;if(O){let J=h(T,L,B);z=tt>0?z*S*J.width/tt:z,j=et>0?j*g*J.height/et:j,tt=J.width,et=J.height}else if(D){let J=h(I,pt,ft),ht=h(T,L,B);z=J.width,j=J.height,tt=ht.width,et=ht.height}let V=tt-z,q=et-j;(Math.abs(V)>jt||Math.abs(q)>jt)&&(W.style.boxSizing="border-box",W.style.width=`${R(z)}px`,W.style.height=`${R(j)}px`,m++)}}x(W,T,O)}};x(e,p)}finally{l.remove()}return m}var Vs=/::-webkit-scrollbar(-[a-z]+)?\b/i;function mn(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+=mn(r.styleSheet.cssRules,e);continue}if(r.type===CSSRule.MEDIA_RULE&&r.cssRules){let s=mn(r.cssRules,e);s&&(n+=`@media ${r.conditionText}{${s}}`);continue}if(r.type===CSSRule.STYLE_RULE){let s=r.selectorText||"";if(Vs.test(s)){let i=r.cssText;i&&!e.has(i)&&(e.add(i),n+=i)}}}catch{}}return n}var Jo=new WeakMap;function js(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 lr(t){if(!t||!t.styleSheets)return"";let e=js(t),n=Jo.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+=mn(i,o))}catch{}return Jo.set(t,{fp:e,css:r}),r}Ct();var Le=new Set;async function fr(t,e={}){let n=e.__session||C.session,o={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:e},r=null;if(e.clip){let f=Ne(t,e.clip);if(f){o.clip={rect:f,root:t};let p=t.getBoundingClientRect();r={x:f.left-p.left,y:f.top-p.top,width:f.width,height:f.height}}}let s,i="",a="";if(Le.size){let f=(p,m)=>{for(let h=m;h;h=h.assignedSlot||h.parentElement||h.getRootNode()?.host)if(h===p)return!0;return!1};for(;;){let p=[...Le].filter(({root:m})=>f(m,t)||f(t,m)).map(({promise:m})=>m.catch(()=>{}));if(!p.length)break;await Promise.all(p)}}if(!o.clip&&t.isConnected&&t.ownerDocument?.visibilityState!=="hidden")try{let f=t.getBoundingClientRect(),p=t.ownerDocument?.defaultView||window,m=f.right<=0||f.bottom<=0||f.left>=p.innerWidth||f.top>=p.innerHeight,h=[];if(m&&(()=>{let y=[];t.shadowRoot&&y.push(t.shadowRoot);for(let w of t.querySelectorAll("*"))w.shadowRoot&&y.push(w.shadowRoot);for(;y.length;){let w=y.pop(),S=w.host?.localName==="calcite-icon";for(let g of w.querySelectorAll("*")){if(g.shadowRoot&&y.push(g.shadowRoot),!S||g.localName!=="svg")continue;let x=g.querySelectorAll("path");if(!x.length||[...x].some(k=>k.getAttribute("d")?.trim()))continue;let v=g.getBoundingClientRect();v.width&&v.height&&h.push(g)}}})(),h.length){let y=(async()=>{let S=t.style,g=t.hasAttribute("style"),x=new Map,v=(k,A)=>{x.has(k)||x.set(k,{value:S.getPropertyValue(k),priority:S.getPropertyPriority(k)}),S.setProperty(k,A,"important");let M=x.get(k);M.forcedValue=S.getPropertyValue(k),M.forcedPriority=S.getPropertyPriority(k)};try{v("left","0"),v("top","0"),v("right","auto"),v("bottom","auto"),v("margin-top","0"),v("margin-right","0"),v("margin-bottom","0"),v("margin-left","0"),v("transform","none"),v("translate","none"),v("opacity","0"),v("pointer-events","none");let k=t.getBoundingClientRect();if(k.right<=0||k.bottom<=0||k.left>=p.innerWidth||k.top>=p.innerHeight){let F=t.parentElement?.getBoundingClientRect(),E=F&&F.right>0&&F.left<p.innerWidth?Math.max(0,F.left):0,$=F&&F.bottom>0&&F.top<p.innerHeight?Math.max(0,F.top):0;v("position","fixed"),v("left",`${E}px`),v("top",`${$}px`)}await mt(100);let A=Date.now()+1500,M=()=>h.some(F=>{if([...F.querySelectorAll("path")].some($=>$.getAttribute("d")?.trim()))return!1;let E=F.getBoundingClientRect();return E.width&&E.height&&E.right>0&&E.bottom>0&&E.left<p.innerWidth&&E.top<p.innerHeight});for(;Date.now()<A&&M();)await new Promise(F=>setTimeout(F,25));await mt(100)}finally{for(let[k,A]of x)S.getPropertyValue(k)!==A.forcedValue||S.getPropertyPriority(k)!==A.forcedPriority||(A.value?S.setProperty(k,A.value,A.priority):S.removeProperty(k));!g&&!S.length&&t.removeAttribute("style"),await mt(100)}})(),w={root:t,promise:y};Le.add(w);try{await y}finally{Le.delete(w)}}}catch{}let c=Uo(t),u=o.clip?()=>{}:Do(t);try{s=await ne(t,o,e)}catch(f){throw console.warn("deepClone failed:",f),f}finally{u(),c()}try{Bo(s)}catch(f){console.warn("inlineExternal defs or symbol failed:",f)}try{await Pe(t,s,o,e)}catch(f){console.warn("inlinePseudoElements failed:",f)}await lo(s,o);try{let f=s.querySelectorAll("style[data-sd]");for(let p of f)a+=p.textContent||"",p.remove()}catch(f){_(o,"Failed to extract shadow CSS from style[data-sd]",f)}let l=Ge(o.styleMap);i=Array.from(l.entries()).map(([f,p])=>`.${p}{${f}}`).join(""),i=a+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+i;for(let[f,p]of o.styleMap.entries()){if(f.tagName==="STYLE")continue;if(f.getRootNode&&f.getRootNode()instanceof ShadowRoot){f.setAttribute("style",p.replace(/;/g,"; "));continue}let m=l.get(p);m&&f.classList.add(m);let h=f.style?.backgroundImage,b=f.dataset?.snapdomHasIcon;h&&h!=="none"&&(f.style.backgroundImage=h),b&&(f.style.verticalAlign="middle",f.style.display="inline")}if((o.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let f=o.clip&&r?{x:r.x,y:r.y}:{x:0,y:0};er(t,s,o.nodeMap,o.styleCache,f)}catch(f){_(o,"freezeViewportPositioned failed",f)}for(let[f,p]of o.nodeMap.entries()){if(o.clip&&p===t)continue;let m=p.scrollLeft,h=p.scrollTop;if((m||h)&&f?.nodeType===1&&f.namespaceURI==="http://www.w3.org/1999/xhtml"){f.style.overflow="hidden",f.style.scrollbarWidth="none",f.style.msOverflowStyle="none";try{let w=f.querySelectorAll("*");for(let S of w){if(S.nodeType!==1||S.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let g=S.style.position;if(g==="fixed"||g==="absolute"){let x=parseFloat(S.style.top)||0,v=parseFloat(S.style.left)||0;S.style.top=`${x+h}px`,S.style.left=`${v+m}px`,g==="fixed"&&(S.style.position="absolute")}}}catch{}let y=document.createElement("div");for(y.style.all="unset",y.style.transform=`translate(${-m}px, ${-h}px)`,y.style.willChange="transform",y.style.display="inline-block",y.style.width="100%";f.firstChild;)y.appendChild(f.firstChild);f.appendChild(y)}}if(t===o.nodeMap.get(s)){let f=o.styleCache.get(t)||N(t);o.styleCache.set(t,f);let p=De(f.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[f,p]of o.nodeMap.entries())p.tagName==="PRE"&&(f.style.marginTop="0",f.style.marginBlockStart="0");return{clone:s,classCSS:i,styleCache:o.styleCache,nodeMap:o.nodeMap,reconcileRisk:o.reconcileRisk||0,clipWindow:r}}vt();rt();var ur="http://www.w3.org/1999/xlink";function qs(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(ur,"href"):null)}function Xs(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 dr(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let o=async a=>{if(!a.getAttribute("src")){let m=a.currentSrc||a.src||Bt(a.getAttribute("srcset"),a)||"";m&&a.setAttribute("src",m)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let c=a.src||"";if(!c)return;let u=C.image?.get(c);if(u){a.src=u,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let l=await G(c,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){C.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:f}=Xs(a),{fallbackURL:p}=e||{};if(p)try{let m=typeof p=="function"?await p({width:d,height:f,src:c,element:a}):p;if(m){let h=await G(m,{as:"dataURL",useProxy:e.useProxy});if(h?.ok&&typeof h.data=="string"){a.src=h.data,a.width||(a.width=d),a.height||(a.height=f);return}}}catch{}if(e.placeholders!==!1){let m=document.createElement("div");m.style.cssText=[`width:${d}px`,`height:${f}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${f}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),m.textContent="img",a.replaceWith(m)}else{let m=document.createElement("div");m.style.cssText=`display:inline-block;width:${d}px;height:${f}px;visibility:hidden;`,a.replaceWith(m)}},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=qs(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let u=await G(c,{as:"dataURL",useProxy:e.useProxy});u.ok&&typeof u.data=="string"&&u.data.startsWith("data:")&&(a.setAttribute("href",u.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(ur,"href"))};for(let a=0;a<s.length;a+=r){let c=s.slice(a,a+r).map(i);await Promise.allSettled(c)}}at();rt();var yn=["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"],Gs=["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"],Ys=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],Ks=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function Qs(t,e,n,o){let r=n.get(t)||N(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"),u=r.getPropertyValue("background-color");if(c&&c!=="none"||u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"||/url\s*\(|gradient\s*\(/i.test(r.getPropertyValue("background")||""))for(let d of Ys){let f=r.getPropertyValue(d);f&&e.style.setProperty(d,f)}for(let d of yn){let f=r.getPropertyValue(d);if(d==="background-image"&&(!f||f==="none")){let h=r.getPropertyValue("background");h&&/url\s*\(/.test(h)&&(f=Ot(h).filter(b=>/url\s*\(/.test(b)).join(", ")||f)}if(!f||f==="none")continue;let p=Ot(f),m=await Promise.all(p.map(h=>Rt(h,o)));m.some(h=>h&&h!=="none"&&!/^url\(undefined/.test(h))&&e.style.setProperty(d,m.join(", "))}for(let d of Gs){let f=r.getPropertyValue(d);!f||f==="initial"||e.style.setProperty(d,f)}if(a)for(let d of Ks){let f=r.getPropertyValue(d);!f||f==="initial"||e.style.setProperty(d,f)}}async function pr(t,e,n,o={},r=C.session.nodeMap){if(!e)return;let s=[];t&&tn(t)&&s.push([t,e]);let i=[e];for(;i.length;){let c=i.pop();if(c.children)for(let u of c.children){if(u.tagName==="STYLE")continue;let l=r.get(u);l&&tn(l)&&s.push([l,u]),i.push(u)}}let a=6;for(let c=0;c<s.length;c+=a)await Promise.allSettled(s.slice(c,c+a).map(([u,l])=>Qs(u,l,n,o)))}rt();at();function mr(t,e,n=C.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 u=N(c),l=u.getPropertyValue("backdrop-filter")||u.getPropertyValue("-webkit-backdrop-filter");l&&l!=="none"&&a!==e&&o.push({cloneEl:a,orig:c,bf:l,path:ta(e,a)})}if(!o.length)return;let s=t.getBoundingClientRect(),i=o.map((a,c)=>{let u=e.cloneNode(!0);Js(u,e,a.orig.getBoundingClientRect(),n),ea(hr(u,a.path));for(let l=0;l<c;l++){let d=hr(u,o[l].path);d&&(d.style.setProperty("backdrop-filter","none","important"),d.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...a,copy:u}});for(let{cloneEl:a,orig:c,bf:u,copy:l}of i)Zs(a,c,u,l,s)}function Zs(t,e,n,o,r){let s=e.getBoundingClientRect();if(!s.width||!s.height)return;let i=N(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 u=document.createElement("div");u.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",u.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(u)}var Ie=128;function Js(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+Ie||l.right<n.left-Ie||l.top>n.bottom+Ie||l.bottom<n.top-Ie)&&(s.tagName==="IMG"&&s.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),s.style&&(s.style.backgroundImage="none"))}let c=s.children,u=i.children;for(let l=0;l<c.length;l++)r.push([c[l],u[l]])}}function ta(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 hr(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 ea(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}}at();rt();function gr(t,e){if(!t)return()=>{};let n=[],o=200;function r(s){if(e){let u=s.getBoundingClientRect();if(u.width>0||u.height>0){let l=Math.max(u.right,u.left+(s.scrollWidth||0)),d=Math.max(u.bottom,u.top+(s.scrollHeight||0));if(l<e.left-o||u.left>e.right+o||d<e.top-o||u.top>e.bottom+o)return}}let i=getComputedStyle(s),a=na(s,i);a&&n.push(a);let c=oa(s,i);c&&n.push(c);for(let u of s.children||[])r(u)}return r(t),()=>n.forEach(s=>s())}function na(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=ra(e);if(n<=0)return()=>{};if(!br(t))return()=>{};let o=yr(t),r=o.text,s=sa(e);o.write("X");let i=t.scrollHeight-s;o.restore();let a=i>0?i:ia(e),c=Math.round(a*n+s);if(t.scrollHeight<=c+.5)return()=>{};let u=0,l=r.length,d=-1;for(;u<=l;){let f=u+l>>1;o.write(r.slice(0,f)+"\u2026"),t.scrollHeight<=c+.5?(d=f,u=f+1):l=f-1}return o.write((d>=0?r.slice(0,d):"")+"\u2026"),()=>{o.restore()}}function oa(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(!br(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=yr(t),o=n.text,r=0,s=o.length,i=-1;for(;r<=s;){let a=r+s>>1;n.write(o.slice(0,a)+"\u2026"),t.scrollWidth<=t.clientWidth+.5?(i=a,r=a+1):s=a-1}return n.write((i>=0?o.slice(0,i):"")+"\u2026"),()=>{n.restore()}}function yr(t){let e=[];for(let o=t.firstChild;o;o=o.nextSibling)o.nodeType===Node.TEXT_NODE&&e.push(o);let n=e.map(o=>o.data);return{text:n.join(""),write(o){e[0].data=o;for(let r=1;r<e.length;r++)e[r].data=""},restore(){for(let o=0;o<e.length;o++)e[o].data=n[o]}}}function ra(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 ia(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 sa(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function br(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var ie=[];function se(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 wr(...t){let e=t.flat();for(let n of e){let o=se(n);o&&(ie.some(r=>r&&r.name&&o.name&&r.name===o.name)||ie.push(o))}}function xr(t){return t&&Array.isArray(t.plugins)?t.plugins:ie}async function gt(t,e,n){let o=n,r=xr(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 Sr(t,e,n){let o=[],r=xr(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 aa(t){let e=[];if(Array.isArray(t))for(let n of t){let o=se(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 ie)n&&n.name&&!e.some(o=>o.name===n.name)&&e.push(n);return Object.freeze(e)}function vr(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=aa(e)),t}function bn(){return ie.slice()}rt();var ca=.92,la=.95;async function fa(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 ua(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}async function wn(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(C.compress.has(o))return C.compress.get(o);let r=await(async()=>{let s;try{s=await fa(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 u=c*la,l=Math.max(1,Math.round(i*u)),d=Math.max(1,Math.round(a*u)),f=document.createElement("canvas");f.width=l,f.height=d;let p=f.getContext("2d");if(!p)return null;p.imageSmoothingEnabled=!0,p.imageSmoothingQuality="high",p.drawImage(s,0,0,l,d);let m=ua(t),h=m==="image/jpeg"?"image/jpeg":m==="image/webp"?"image/webp":"image/png";try{let b=f.toDataURL(h,ca);if(typeof b=="string"&&b.startsWith("data:image")&&b.length<t.length)return b}catch{}return null})();return C.compress.set(o,r),r}async function da(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 u=>{let l=u.getAttribute("src")||"";if(!l.startsWith("data:image")||l.startsWith("data:image/svg"))return;let d=parseFloat(u.dataset.snapdomWidth)||parseFloat(u.style.width)||u.width||0,f=parseFloat(u.dataset.snapdomHeight)||parseFloat(u.style.height)||u.height||0;if(!d||!f)return;let p=await wn(l,d*n,f*n);p&&(r++,s+=l.length,i+=p.length,u.setAttribute("src",p))},c=6;for(let u=0;u<o.length;u+=c)await Promise.allSettled(o.slice(u,u+c).map(a));return{count:r,before:s,after:i}}function pa(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function ha(t,e,n=C.session.nodeMap){if(!e.compress)return{count:0};let o=(e.scale||1)*(e.dpr||1),r=[],s=[t,...t.querySelectorAll("*")];for(let u of s){let l=u.style&&u.style.backgroundImage;l&&l.includes("data:image")&&r.push(u)}let i=0,a=async u=>{let l=n.get(u);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:m}=pa(l);if(!p||!m)return;let h=p*o,b=m*o,y=u.style.backgroundImage,w=[...y.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],S=y;for(let g of w){let x=g[2];if(x.startsWith("data:image/svg"))continue;let v=await wn(x,h,b);v&&(S=S.split(x).join(v),i++)}S!==y&&(u.style.backgroundImage=S)},c=6;for(let u=0;u<r.length;u+=c)await Promise.allSettled(r.slice(u,u+c).map(a));return{count:i}}async function ma(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 u=parseFloat(a.getAttribute("width"))||0,l=parseFloat(a.getAttribute("height"))||0;if(!u||!l)return;let d=await wn(c,u*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 Cr(t,e,n){e.compress&&(await da(t,e),await ha(t,e,n),await ma(t,e))}function ga(t){if(Array.isArray(t.plugins)){for(let e of t.plugins)if(se(e)?.name==="picture-resolver")return!0}return bn().some(e=>e?.name==="picture-resolver")}function ya(t){let e=Array.isArray(t.plugins)?t.plugins:bn(),n=[];for(let o of e){let r=se(o);r&&typeof r.resolveNode=="function"&&n.push(r.resolveNode.bind(r))}return n.length?n:null}var ba=2e3,wa=3;function xa(t){let e=Date.now(),n=C.burstAdvice.get(t);if(!n||e-n.firstTs>ba){C.burstAdvice.set(t,{count:1,firstTs:e,warned:!1});return}n.count++,n.count>=wa&&!n.warned&&(n.warned=!0,console.warn("[snapdom] Captured this element multiple times. Pass { burst: true } to increase the speed."))}async function Ar(t,e){if(!t)throw new Error("Element cannot be null or undefined");pe(e.cache),e.__session={styleMap:C.session.styleMap,styleCache:C.session.styleCache,nodeMap:C.session.nodeMap},e.burst||xa(t),e.__resolveNodeHooks=ya(e);let n=e.fast,o=e.outerTransforms!==!1,r=!!e.outerShadows,s=e.clip?Ne(t,e.clip):null,i={element:t,options:e,plugins:e.plugins},a,c,u,l,d,f,p="",m="",h,b,y=null;await gt("beforeSnap",i);let w=null;e.resolvePicturePlaceholders!==!1&&!ga(e)&&(w=await Qn(i.element,i.options)),await gt("beforeClone",i);let S=gr(i.element,s);try{({clone:a,classCSS:c,styleCache:u,nodeMap:l,reconcileRisk:d,clipWindow:f}=await fr(i.element,i.options)),d>0&&!e.reconcile&&!C.warnedReconcile&&(C.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&&(y=Go(i.element,a)),!r&&a&&nr(i.element,a,i.options),a&&(rr(i.element,a,l),or(i.element,a))}finally{S()}if(i={clone:a,classCSS:c,styleCache:u,nodeMap:l,...i},await gt("afterClone",i),w&&await w(),ir(i.clone),i.options?.excludeMode==="remove"||i.options?.filterMode==="remove")try{sr(i.element,i.clone,i.styleCache)}catch(E){console.warn("[snapdom] shrink pass failed:",E)}try{await yo(i.clone,i.element,i.nodeMap)}catch{}let g=E=>new Promise(($,W)=>{$t(()=>{Promise.resolve().then(E).then($,W)},{fast:n})}),x=(async()=>{await Promise.all([g(()=>dr(i.clone,i.options)),g(()=>pr(i.element,i.clone,i.styleCache,i.options,i.nodeMap))]);try{mr(i.element,i.clone,i.nodeMap)}catch(E){console.warn("[snapdom] backdrop-filter emulation failed:",E)}e.compress&&await g(()=>Cr(i.clone,i.options,i.nodeMap))})(),v=Promise.resolve();e.embedFonts&&(v=g(async()=>{let E=i.element.ownerDocument||document,$=s?I=>{try{let O=I.getBoundingClientRect();return O.right>=s.left-200&&O.left<=s.right+200&&O.bottom>=s.top-200&&O.top<=s.bottom+200}catch{return!0}}:null,{required:W,usedCodepoints:T}=oe(i.element,$);if(K()){let I=new Set(Array.from(W).map(O=>String(O).split("__")[0]).filter(Boolean));await Dt(I,1,E)}p=await Te({required:W,usedCodepoints:T,preCached:!1,exclude:i.options.excludeFonts,localFonts:i.options.localFonts,useProxy:i.options.useProxy,fontStylesheetDomains:i.options.fontStylesheetDomains,doc:E})})),await Promise.all([x,v]);let k=qe(i.clone).sort(),A=k.join(",");C.baseStyle.has(A)?m=C.baseStyle.get(A):await new Promise(E=>{$t(()=>{m=Xe(k),C.baseStyle.set(A,m),E()},{fast:n})});let M=lr(i.element?.ownerDocument||document);i={fontsCSS:p,baseCSS:m,scrollbarCSS:M,...i},await gt("beforeRender",i),await new Promise(E=>{$t(()=>{let $=N(i.element),W=i.element.getBoundingClientRect(),T=Math.max(1,R(i.element.offsetWidth||parseFloat($.width)||W.width||1)),I=Math.max(1,R(i.element.offsetHeight||parseFloat($.height)||W.height||1)),O=i.element.ownerDocument||document;if(!f&&(i.element===O.body||i.element===O.documentElement)&&!O.documentElement.hasAttribute("data-sd-pinned")){let X=Math.max(i.element.scrollHeight||0,O.documentElement?.scrollHeight||0,O.body?.scrollHeight||0),nt=Math.max(i.element.scrollWidth||0,O.documentElement?.scrollWidth||0,O.body?.scrollWidth||0);X>0&&(I=Math.max(I,R(X))),nt>0&&(T=Math.max(T,R(nt)));try{let Q=(i.scrollbarCSS||"").length+(i.baseCSS||"").length+(i.fontsCSS||"").length+(i.classCSS||"").length,ot=C.measureHints.get(i.element);if(ot&&ot.cssLen===Q&&ot.w0===T)ot.csh>0&&(I=Math.max(I,R(ot.csh))),ot.csw>0&&(T=Math.max(T,R(ot.csw)));else{let Z=O.createElement("div");Z.setAttribute("data-snapdom-internal",""),Z.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+T+"px!important;overflow:visible!important;visibility:hidden!important;";let Mt=Z.attachShadow({mode:"open"}),Ft=O.createElement("style");Ft.textContent=(i.scrollbarCSS||"")+i.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS,Mt.appendChild(Ft),Mt.appendChild(i.clone.cloneNode(!0)),O.body.appendChild(Z);let Xt=Z.scrollHeight,xt=Z.scrollWidth;O.body.removeChild(Z),C.measureHints.set(i.element,{cssLen:Q,w0:T,csh:Xt,csw:xt}),Xt>0&&(I=Math.max(I,R(Xt))),xt>0&&(T=Math.max(T,R(xt)))}}catch{}}if(i.options?.excludeMode==="remove"||i.options?.filterMode==="remove"){let X=ar(i.element,i.options);Number.isFinite(X)&&X>0&&(I=Math.max(1,Math.min(I,R(X+1))))}if(i.options?.reconcile)try{let X=(i.scrollbarCSS||"")+i.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS;cr(i.element,i.clone,X,i.nodeMap,T,I)}catch(X){console.warn("[snapdom] reconcile pass failed:",X)}let P=(X,nt=NaN)=>{let Q=typeof X=="string"?parseFloat(X):X;return Number.isFinite(Q)?Q:nt},z=P(i.options.width),j=P(i.options.height),tt=f?R(f.width):T,et=f?R(f.height):I,pt=tt,ft=et,L=Number.isFinite(z),B=Number.isFinite(j),D=et>0?tt/et:1;L&&B?(pt=Math.max(1,R(z)),ft=Math.max(1,R(j))):L?(pt=Math.max(1,R(z)),ft=Math.max(1,R(pt/(D||1)))):B&&(ft=Math.max(1,R(j)),pt=Math.max(1,R(ft*(D||1))));let V=0,q=0,J=T,ht=I;if(f){let X=0,nt=0;if(xn(i.element)){let Q=null;if(!o&&y&&Number.isFinite(y.a))Q={a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0};else{let ot=Vt(i.element),Z=gn($.transform&&$.transform!=="none"?$.transform:"",ot);Z&&Z.is2D&&(Q={a:Z.a,b:Z.b,c:Z.c,d:Z.d,e:0,f:0})}if(Q&&!(Q.a===1&&Q.b===0&&Q.c===0&&Q.d===1)){let{ox:ot,oy:Z}=re($,T,I),Mt=zt(T,I,Q,ot,Z);X=Mt.minX,nt=Mt.minY}}V=R(f.x+X),q=R(f.y+nt),J=R(V+f.width),ht=R(q+f.height)}else if(!o&&y&&Number.isFinite(y.a)){let X={a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0},nt=zt(T,I,X,0,0);V=R(nt.minX),q=R(nt.minY),J=R(nt.maxX),ht=R(nt.maxY)}else if(o&&xn(i.element)){let nt=$.transform&&$.transform!=="none"?$.transform:"",Q=Vt(i.element),ot=Yo({baseTransform:nt,rotate:Q.rotate||"0deg",scale:Q.scale,translate:Q.translate}),{ox:Z,oy:Mt}=re($,T,I),Ft=ot.is2D?ot:new DOMMatrix(ot.toString()),Xt={a:Ft.a,b:Ft.b,c:Ft.c,d:Ft.d,e:0,f:0},xt=zt(T,I,Xt,Z,Mt);V=R(xt.minX),q=R(xt.minY),J=R(xt.maxX),ht=R(xt.maxY)}let yt=Ho($),Nt=zo($),it=jo($),Lt=qo($),It=Xo($),kt=f?{top:0,right:0,bottom:0,left:0}:r?{top:R(Math.max(yt.top,Nt.top)+it.top+Lt.top+It.bleed.top),right:R(Math.max(yt.right,Nt.right)+it.right+Lt.right+It.bleed.right),bottom:R(Math.max(yt.bottom,Nt.bottom)+it.bottom+Lt.bottom+It.bleed.bottom),left:R(Math.max(yt.left,Nt.left)+it.left+Lt.left+It.bleed.left)}:{top:it.top,right:it.right,bottom:it.bottom,left:it.left};V=R(V-kt.left),q=R(q-kt.top),J=R(J+kt.right),ht=R(ht+kt.bottom);let bt=Math.max(1,R(J-V)),En=Math.max(1,R(ht-q)),Or=L||B?R(pt/tt):1,Br=B||L?R(ft/et):1,Ur=Math.max(1,R(bt*Or)),Dr=Math.max(1,R(En*Br)),Rn="http://www.w3.org/2000/svg",Hr=xn(i.element)?2:0,_t=R(Hr+(o?0:1)),ce=Math.ceil(bt+_t*2),le=Math.ceil(En+_t*2),fe=R(-(R(V)-_t)),ue=R(-(R(q)-_t)),$n=Math.max(0,fe),Tn=Math.max(0,ue),Pn=R(ce-Math.min(0,fe)),Nn=R(le-Math.min(0,ue)),wt=document.createElementNS(Rn,"foreignObject");wt.setAttribute("x",String(Math.min(0,fe))),wt.setAttribute("y",String(Math.min(0,ue))),wt.setAttribute("width",String(Pn)),wt.setAttribute("height",String(Nn)),wt.style.overflow="visible";let Ln=document.createElement("style"),zr="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";Ln.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+zr+i.classCSS,wt.appendChild(Ln);let de=document.createElement("div");de.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),de.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${Pn}px;height:${Nn}px`+($n!==0||Tn!==0?`;padding:${Tn}px 0 0 ${$n}px !important`:""),de.appendChild(i.clone),wt.appendChild(de);let Vr=new XMLSerializer().serializeToString(wt),In=L||B,jr=Object.freeze({w0:tt,h0:et,vbW:ce,vbH:le,targetW:pt,targetH:ft,contentX:R(fe+(f?V:0)),contentY:R(ue+(f?q:0)),clip:f?Object.freeze({x:R(V),y:R(q),width:tt,height:et}):null});Object.defineProperty(e,"meta",{value:jr,enumerable:!0,writable:!1,configurable:!0});let qr=!In||K()?ce:R(Ur+_t*2),Xr=!In||K()?le:R(Dr+_t*2),Gr=parseFloat(N(O.documentElement)?.fontSize)||16;b=`<svg xmlns="${Rn}" width="${qr}" height="${Xr}" viewBox="0 0 ${ce} ${le}" font-size="${Gr}px">`+Vr+"</svg>",h=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(b)}`,i={svgString:b,dataURL:h,...i},E()},{fast:n})}),await gt("afterRender",i);let F=document.getElementById("snapdom-sandbox");return F&&F.style.position==="absolute"&&F.remove(),i.dataURL}function xn(t){return Ko(t)}rt();function kr(t={}){let e=t.format??"png";e==="jpg"&&(e="jpeg");let n=_n(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:{}}}Ct();Ke();var Mr=new WeakMap;function Er(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 Sa(t){let e={dirty:!0,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedVideos:new Set},n=s=>{e.capturing||Je(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,Er(t,e,o),e}function Fr(t){let{burst:e,invalidate:n,...o}=t||{};try{return JSON.stringify(o,Object.keys(o).sort())}catch{return null}}function Rr(t,e,n,o){let r=Mr.get(t);r||(r=Sa(t),r.baselineSignature=Fr(e),Mr.set(t,r));let s=Fr(e),i=s===null||s!==r.baselineSignature,a=async()=>{for(let u of r.observers)r.markDirty(u.takeRecords());if(n.invalidate&&(r.dirty=!0),!i&&!r.dirty&&r.last)return r.last;r.capturing=!0,i||(r.dirty=!1);try{let u=await o();return i||(r.last=u),u}finally{for(let u of r.observers)u.takeRecords();r.capturing=!1,Er(t,r,r.onMediaDirty)}},c=r.inflight.then(a,a);return r.inflight=c.catch(()=>{}),c}at();vt();rt();async function va(t=document,e={}){let{embedFonts:n=!0,useProxy:o=""}=e,r=e.cache??e.cacheOpt??"full";pe(r);try{await document.fonts?.ready}catch{}try{Ve()}catch{}C.session=C.session||{},C.session.styleCache||(C.session.styleCache=new WeakMap),C.image=C.image||new Y(100),C.background=C.background||new Y(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 u=c?.currentSrc||c?.src;if(u&&!C.image.has(u)){let l=Promise.resolve().then(async()=>{let d=await G(u,{as:"dataURL",useProxy:o});d?.ok&&typeof d.data=="string"&&C.image.set(u,d.data)}).catch(()=>{});a.push(l)}}for(let c of i){let u=new Set;for(let l of yn){let d="";try{d=l==="background-image"&&c?.style?.backgroundImage||N(c).getPropertyValue(l)||""}catch{}if(!d||d==="none")continue;let f=d.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let p of f){if(u.has(p))continue;u.add(p);let m=Promise.resolve().then(()=>Rt(p,{...e,useProxy:o})).catch(()=>{});a.push(m)}}}if(n)try{let{required:c,usedCodepoints:u}=oe(t);if(typeof K=="function"?K():!!K){let d=new Set(Array.from(c).map(f=>String(f).split("__")[0]).filter(Boolean));await Dt(d,3)}await Te({required:c,usedCodepoints:u,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:e.useProxy??o,fontStylesheetDomains:e.fontStylesheetDomains})}catch{}await Promise.allSettled(a)}function Ia(...t){return wr(...t),H}var H=Object.assign(Wa,{plugins:Ia}),Fn=Symbol("snapdom.internal"),_a=Symbol("snapdom.internal.silent");async function Wa(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=kr(e);if(vr(n,e&&e.plugins),K()){if(n.embedFonts===!0)try{let r=Fo(t),s=new Set([...r].map(i=>String(i).split("__")[0]).filter(Boolean));await Dt(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){_(e,"safari canvas poke failed",s)}}return n.iconFonts&&n.iconFonts.length>0&&go(n.iconFonts),n.snap||(n.snap={toPng:(o,r)=>H.toPng(o,r),toSvg:(o,r)=>H.toSvg(o,r)}),n.burst?Rr(t,e,n,()=>H.capture(t,n,Fn)):H.capture(t,n,Fn)}H.capture=async(t,e,n)=>{if(n!==Fn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");e.element=t;let o=await Ar(t,e),r={img:async(h,b)=>{let{toImg:y}=await Promise.resolve().then(()=>(An(),Cn));return y(o,{...h,...b||{}})},svg:async(h,b)=>{let{toSvg:y}=await Promise.resolve().then(()=>(An(),Cn));return y(o,{...h,...b||{}})},canvas:async(h,b)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(qt(),Nr));return y(o,{...h,...b||{}})},blob:async(h,b)=>{let{toBlob:y}=await Promise.resolve().then(()=>(Mn(),Lr));return y(o,{...h,...b||{}})},png:async(h,b)=>{let{rasterize:y}=await Promise.resolve().then(()=>(ae(),Ue));return y(o,{...h,...b||{},format:"png"})},jpeg:async(h,b)=>{let{rasterize:y}=await Promise.resolve().then(()=>(ae(),Ue));return y(o,{...h,...b||{},format:"jpeg"})},webp:async(h,b)=>{let{rasterize:y}=await Promise.resolve().then(()=>(ae(),Ue));return y(o,{...h,...b||{},format:"webp"})},download:async(h,b)=>{let{download:y}=await Promise.resolve().then(()=>(Wr(),_r));return y(o,{...h,...b||{}})}},s={};for(let h of["img","svg","canvas","blob","png","jpeg","webp"])s[h]=async b=>r[h](e,{...b||{},[_a]:!0});s.jpg=s.jpeg;let i={...e,export:{url:o},exports:s},a=await Sr("defineExports",i),c=Object.assign({},...a.filter(h=>h&&typeof h=="object").reverse()),u={...r,...c};u.jpeg&&!u.jpg&&(u.jpg=(h,b)=>u.jpeg(h,b));function l(h,b){let y={...e,...b||{}},w=g=>g==="jpeg"||g==="jpg"||g==="webp";return[h,y.format,y.type].map(g=>typeof g=="string"?g.toLowerCase():"").find(w)&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,f=Promise.resolve();async function p(h,b){let y=Object.freeze(b&&typeof b=="object"?{...b}:{}),w=async()=>{let g=u[h];if(!g)throw new Error(`[snapdom] Unknown export type: ${h}`);let x=l(h,y),v={...e,export:{type:h,options:x,requestedOptions:y,url:o}};await gt("beforeExport",v,{format:h,options:x});let k=await g(v,x);return await gt("afterExport",v,{format:h,options:x,result:k}),d||(d=!0,await gt("afterSnap",e)),k},S=f.then(w);return f=S.catch(()=>{}),S}let m={url:o,toRaw:()=>o,to:(h,b)=>p(h,b),toImg:h=>p("img",h),toSvg:h=>p("svg",h),toCanvas:h=>p("canvas",h),toBlob:h=>p("blob",h),toPng:h=>p("png",h),toJpg:h=>p("jpg",h),toWebp:h=>p("webp",h),download:h=>p("download",h)};Object.defineProperty(m,"meta",{value:e.meta,enumerable:!0,writable:!1,configurable:!1});for(let h of Object.keys(u)){let b="to"+h.charAt(0).toUpperCase()+h.slice(1);m[b]||(m[b]=y=>p(h,y))}return m};H.toRaw=(t,e)=>H(t,e).then(n=>n.toRaw());H.toImg=(t,e)=>H(t,e).then(n=>n.toImg());H.toSvg=(t,e)=>H(t,e).then(n=>n.toSvg());H.toCanvas=(t,e)=>H(t,e).then(n=>n.toCanvas());H.toBlob=(t,e)=>H(t,e).then(n=>n.toBlob());H.toPng=(t,e)=>H(t,{...e,format:"png"}).then(n=>n.toPng());H.toJpg=(t,e)=>H(t,{...e,format:"jpeg"}).then(n=>n.toJpg());H.toWebp=(t,e)=>H(t,{...e,format:"webp"}).then(n=>n.toWebp());H.download=(t,e)=>H(t,e).then(n=>n.download());export{va as preCache,H as snapdom};
|
|
6
|
+
var Wa=Object.defineProperty;var st=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var He=(t,e)=>{for(var n in e)Wa(t,n,{get:e[n],enumerable:!0})};function Bo(t){return t===!1||typeof t=="string"&&t.toLowerCase().trim()==="disabled"?"disabled":"soft"}function Uo(t="soft"){t==="disabled"&&(P.computedStyle=new WeakMap,P.measureHints=new WeakMap,P.baseStyle=new rt(50),P.defaultStyle=new rt(64),P.image=new rt(100),P.background=new rt(100),P.resource=new rt(150),P.compress=new rt(50))}var rt,P,lt=st(()=>{"use strict";rt=class extends Map{constructor(e=100,...n){super(...n),this._maxSize=e}set(e,n){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,n)}},P={image:new rt(100),background:new rt(100),resource:new rt(150),defaultStyle:new rt(64),baseStyle:new rt(50),compress:new rt(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function Gt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Da(t){let e=[],n=0,r=0,i="";for(let o=0;o<t.length;o++){let s=t[o];if(s==="\\"){o++;continue}i?s===i&&(i=""):s==='"'||s==="'"?i=s:s==="("?r++:s===")"?r--:s===","&&r===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e}function ze(t,e=1){let n=t.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let o of Da(n[1])){let s=o.match(/url\((['"]?)(.*?)(\1)\)/);if(!s)continue;let a=o.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(a&&!Oa.test(a[1].trim()))continue;let c=o.replace(/url\((['"]?)[\s\S]*?\1\)/," ").match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)\b/i),f=1;if(c){let l=parseFloat(c[1]);f=/dpi/i.test(c[2])?l/96:l}r.push({url:s[2].trim(),dppx:f})}return r.length?(r.sort((o,s)=>o.dppx-s.dppx),(r.find(o=>o.dppx>=e)||r[r.length-1]).url):null}function ur(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let i=r.split(",").map(o=>o.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function Lt(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function dr(t,e){if(!t||/^(data|blob|about|#)/i.test(t.trim()))return t;try{let n=e||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(t,n).href}catch{return t}}function je(t){return!!t&&t.tagName==="INPUT"&&(t.getAttribute("type")||"").toLowerCase()==="password"}function pr(t){return"\u2022".repeat(String(t??"").length)}function nt(t,e){return t?.nodeType===1&&t.localName===e}function Ft(t){return t?.nodeType===1&&t.namespaceURI===Ba}function It(t){return t?.nodeType===1&&t.namespaceURI===Ua}function le(t){return t?.nodeType===11&&!!t.host}function hr(t){return t?.nodeType===9}var fr,Oa,Ba,Ua,wt=st(()=>{"use strict";fr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,Oa=fr;Ba="http://www.w3.org/1999/xhtml",Ua="http://www.w3.org/2000/svg"});function Ha(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,i=0;function o(s,a,c){if(i>=n)return;let f=Date.now();(r.get(a)||0)>f||(r.set(a,f+e),i++,s==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(s,a){o("warn",s,a)},errorOnce(s,a){o("error",s,a)},reset(){r.clear(),i=0}}}function jo(t,e,n){if(Tt.size>=zo){let r=Date.now();for(let[i,o]of Tt)o.until<=r&&Tt.delete(i);for(;Tt.size>=zo;)Tt.delete(Tt.keys().next().value)}Tt.set(t,{until:Date.now()+n,result:e})}function za(t){return/^data:|^blob:|^about:blank$/i.test(t)}function ja(t,e){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=e.split(/\{url(?:Raw)?\}/)[0],i=new URL(r||".",n);if(new URL(t,n).origin===i.origin)return!0}catch{}return!1}function Va(t,e){if(!e||za(t)||ja(t,e))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!e}}function qa(t,e){if(!e)return t;if(/\{url(?:Raw)?\}/.test(e))return e.replace("{urlRaw}",()=>Lt(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}${Lt(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Vo(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function Ga(t,e){return new Headers(e.headers||{}).keys().next().done?JSON.stringify([e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,e.credentials||"",t]):null}function qo(t){try{return new URL(t,globalThis.location?.href||"http://localhost/").origin}catch{return"invalid-url"}}function gr(t,e){try{t.onError?.(e)}catch{}}async function ot(t,e={}){let n=e.as??"blob",r=e.timeout??3e3,i=e.useProxy||"",o=e.errorTTL??8e3,s=e.headers||{},a=!!e.silent;if(/^data:/i.test(t))try{if(n==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,g="",y=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(g)?atob(y):decodeURIComponent(y),C=new Uint8Array([...w].map(S=>S.charCodeAt(0))),x=new Blob([C],{type:(g||"").split(";")[0]||""});return{ok:!0,data:x,status:200,url:t,fromCache:!1,mime:x.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let g=await fetch(t);if(!g.ok)return{ok:!1,data:null,status:g.status,url:t,fromCache:!1,reason:"http_error"};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Vo(y),blob:y,status:g.status,url:t,fromCache:!1,mime:b}:n==="text"?{ok:!0,data:await y.text(),status:g.status,url:t,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:t,fromCache:!1,mime:b}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let c;try{c=Ga(t,{as:n,timeout:r,useProxy:i,errorTTL:o,credentials:e.credentials,headers:s})}catch{let g={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"};return gr(e,g),g}let f=Tt.get(c);if(f&&f.until>Date.now())return{...f.result,fromCache:!0};f&&Tt.delete(c);let l=mr.get(c);if(l)return l;let u=Va(t,i)?qa(t,i):t,p=e.credentials;if(!p)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(t,g);p=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{p="omit"}let m=new AbortController,d=setTimeout(()=>m.abort("timeout"),r),h=(async()=>{try{let g=await fetch(u,{signal:m.signal,credentials:p,headers:s});if(!g.ok){let w={ok:!1,data:null,status:g.status,url:u,fromCache:!1,reason:"http_error"};if(c!==null&&o>0&&jo(c,w,o),!a){let C=`${g.status} ${g.statusText||""}`.trim();Ho.warnOnce(`http:${g.status}:${n}:${qo(t)}`,`HTTP error ${C} while fetching ${n} ${t}`)}return gr(e,w),w}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:u,fromCache:!1};let y=await g.blob(),b=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Vo(y),blob:y,status:g.status,url:u,fromCache:!1,mime:b}:{ok:!0,data:y,status:g.status,url:u,fromCache:!1,mime:b}}catch(g){let y=m.signal.aborted?m.signal.reason==="timeout"?"timeout":"abort":g&&typeof g=="object"&&g.name==="AbortError"?"abort":"network",b={ok:!1,data:null,status:0,url:u,fromCache:!1,reason:y};if(c!==null&&!/^blob:/i.test(t)&&o>0&&jo(c,b,o),!a){let w=`${y}:${n}:${qo(t)}`,C=y==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${t}`:y==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;Ho.errorOnce(w,C)}return gr(e,b),b}finally{clearTimeout(d),mr.delete(c)}})();return c!==null&&mr.set(c,h),h}var Ho,mr,zo,Tt,fe=st(()=>{"use strict";wt();Ho=Ha("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),mr=new Map,zo=50,Tt=new Map});async function ue(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=ze(t,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Gt(t);if(!r)return t;let i=dr(r),o=Lt(i),s=(e.useProxy||"")+"|"+o;if(P.background.has(s)){let a=P.background.get(s);return a?`url("${a}")`:"none"}try{let a=await ot(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(P.background.set(s,a.data),`url("${a.data}")`):(P.background.set(s,null),"none")}catch{return P.background.set(s,null),"none"}}var Go=st(()=>{"use strict";lt();wt();fe()});function Za(t){let e=t.replace(Ja,"").trim();return e?e.replace(/(^|,)(\s*)(?=,|$)/g,"$1$2*"):"*"}function Ko(t,e,n,r){for(let i=0;i<t.length;i++){if(--r.budget<0)return!1;let o=t[i],s=o.style;if(s){let c=!!o.selectorText&&Ka.test(o.selectorText);for(let f=0;f<s.length;f++){let l=s[f];if(e.add(l),c&&r.pseudoProps.add(l),s.getPropertyPriority(l)&&r.importantProps.add(l),l.length>5&&(l[0]==="m"||l[0]==="p")){let u=l.startsWith("margin")?"marginUnstable":l.startsWith("padding")?"paddingUnstable":null;u&&!r[u]&&Qa.test(s.getPropertyValue(l))&&(r[u]=!0)}}}let a=o.selectorText;if(a&&a.includes(":has(")&&(r.usesHas=!0),a&&a.includes("&"))for(let c=o.parentRule;c&&a.includes("&");c=c.parentRule)c.selectorText&&(a=a.replace(/&/g,`:is(${c.selectorText})`));if(a&&(r.inContainer||Yo.test(a)||a.includes("+")||a.includes("~")))for(let c of tc(a,",")){let f=c.trim();f&&(r.inContainer||Yo.test(f)||f.includes("+")||f.includes("~"))&&r.shareUnsafeSels.add(f)}if(a&&a.includes(":"))for(let c in Xo)Xo[c].test(a)&&n[c].push(Za(a));if(o.styleSheet){if(!yr(o.styleSheet,e,n,r))return!1}else if(o.cssRules&&o.cssRules.length){let c=o.constructor?.name==="CSSContainerRule";c&&r.inContainer++;let f=Ko(o.cssRules,e,n,r);if(c&&r.inContainer--,!f)return!1}}return!0}function yr(t,e,n,r){let i;try{i=t.cssRules}catch{return!1}return i?Ko(i,e,n,r):!1}function tc(t,e){let n=[],r=0,i=null,o=0;for(let s=0;s<t.length;s++){let a=t[s];if(i){a===i&&t[s-1]!=="\\"&&(i=null);continue}a==='"'||a==="'"?i=a:a==="("||a==="["?r++:a===")"||a==="]"?r--:r===0&&a===e&&(n.push(t.slice(o,s)),o=s+1)}return n.push(t.slice(o)),n}function ec(t){let e=0,n=null,r=0;for(let l=0;l<t.length;l++){let u=t[l];if(n){u===n&&t[l-1]!=="\\"&&(n=null);continue}u==='"'||u==="'"?n=u:u==="("||u==="["?e++:u===")"||u==="]"?e--:e===0&&(u===" "||u===">"||u==="+"||u==="~")&&(r=l+1)}let i="",o=0;for(let l of t.slice(r))l==="("||l==="["?o++:l===")"||l==="]"?o--:o===0&&(i+=l);let s=l=>!l||/\\[0-9a-fA-F]/.test(l)?null:l.replace(/\\(.)/g,"$1"),a=s((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(a)return"c"+a;let c=s((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(c)return"i"+c;let f=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return f?"t"+f.toLowerCase():null}function Qo(t,e){if(!e.length)return"";if(e.some(r=>r.includes("&")))return null;let n=e.join(",");try{return t.matches(n),n}catch{return null}}function nc(t,e){let n=t.createElement("div"),r={};for(let i in e){let o=e[i];(i==="before"||i==="after")&&o.push("q"),r[i]=Qo(n,o)}return r}function Jo(t){let e={universe:null,pseudoUniverse:null,usesHas:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let n=new Set(br),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:2e4,usesHas:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set};for(let f of t.styleSheets)if(!yr(f,n,r,i))return e;let o=t.adoptedStyleSheets;if(Array.isArray(o)){for(let f of o)if(!yr(f,n,r,i))return e}if(typeof t.getAnimations=="function")for(let f of t.getAnimations()){let l=f.effect?.getKeyframes?.()||[];for(let u of l)for(let p of Object.keys(u))p==="offset"||p==="easing"||p==="composite"||p==="computedOffset"||n.add(p.replace(/[A-Z]/g,m=>"-"+m.toLowerCase()))}let s=Array.from(i.shareUnsafeSels),a=Qo(t.createElement("div"),s)===null?null:s.map(f=>({sel:f,key:ec(f)})),c=new Set(Ya);for(let f of Xa)n.has(f)&&c.add(f);for(let f of i.pseudoProps)c.add(f);return{universe:n,pseudoUniverse:c,pseudoGates:nc(t,r),usesHas:i.usesHas,shareGate:a,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return e}}var br,Xa,Ya,Ka,Qa,Xo,Ja,Yo,wr=st(()=>{"use strict";br=["display","position","top","right","bottom","left","float","clear","z-index","box-sizing","width","height","min-width","min-height","max-width","max-height","margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left","overflow-x","overflow-y","visibility","opacity","content-visibility","vertical-align","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","order","align-items","align-self","align-content","justify-content","justify-items","justify-self","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-auto-flow","grid-auto-columns","grid-auto-rows","grid-column-start","grid-column-end","grid-row-start","grid-row-end","color","font-family","font-size","font-weight","font-style","font-stretch","line-height","letter-spacing","word-spacing","white-space","text-align","text-transform","text-indent","text-overflow","text-shadow","direction","unicode-bidi","writing-mode","text-orientation","word-break","overflow-wrap","tab-size","list-style-type","list-style-position","list-style-image","counter-reset","counter-increment","counter-set","background-color","background-image","background-size","background-position","background-repeat","background-clip","background-origin","background-attachment","box-shadow","outline-width","outline-style","outline-color","outline-offset","transform","transform-origin","rotate","scale","translate","filter","mix-blend-mode","clip-path","object-fit","object-position","border-collapse","border-spacing","table-layout","caption-side","empty-cells"],Xa=["color","font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-kerning","font-feature-settings","font-variation-settings","line-height","letter-spacing","word-spacing","white-space","text-align","text-align-last","text-indent","text-transform","text-shadow","text-rendering","direction","unicode-bidi","word-break","overflow-wrap","writing-mode","text-orientation","hyphens","tab-size","visibility","list-style-type","list-style-position","list-style-image","border-collapse","border-spacing","caption-side","empty-cells","quotes","color-scheme","-webkit-text-fill-color","-webkit-font-smoothing","image-rendering"],Ya=["display","width","height","min-width","min-height"],Ka=/::?(?:before|after|first-letter|first-line|marker)/,Qa=/%|\bauto\b|calc\(|var\(/i,Xo={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Ja=/::?(?:before|after|first-letter|first-line|marker)\b/g;Yo=/:(nth-|first-child|last-child|only-|first-of-type|last-of-type|empty|hover|focus|active|target|checked|indeterminate|disabled|enabled|read-only|read-write|placeholder-shown|autofill|valid|invalid|user-valid|user-invalid|in-range|out-of-range|required|optional|default|link|any-link|scope|defined|modal|fullscreen|picture-in-picture|playing|paused|dir\(|lang\(|has\()/});function Q(t){return Zo.add(t),t.setAttribute("data-snapdom-internal",""),t}function Wt(t){return Zo.has(t)}var Zo,mt=st(()=>{"use strict";Zo=new WeakSet});function xr(t){if(t=String(t).toLowerCase(),Ve.has(t)){let o={};return P.defaultStyle.set(t,o),o}if(P.defaultStyle.has(t))return P.defaultStyle.get(t);let e=[...document.querySelectorAll("#snapdom-sandbox")].find(Wt);e||(e=document.createElement("div"),Q(e),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t);n.style.all="initial",e.appendChild(n);let r=getComputedStyle(n),i={};for(let o of r){if(de(o))continue;let s=r.getPropertyValue(o);i[o]=s}for(let o of br)!(o in i)&&!de(o)&&(i[o]=r.getPropertyValue(o));return e.removeChild(n),P.defaultStyle.set(t,i),i}function de(t){let e=ti.get(t);if(e===void 0){let n=String(t).toLowerCase();e=ic.has(n)||oc.test(n)||rc.test(n),ti.set(t,e)}return e}function ni(t,e){let n=fc.get(t);if(n===void 0||e[n]!==e[t])return!1;let r=e["writing-mode"];if(r&&r!=="horizontal-tb")return!1;let i=e.direction;return!(i&&i!=="ltr")}function un(t,e){return!ac.has(t)&&(e==="inline"||sc.has(t)||ei.has(t))}function vr(t,e,n){let r=(e.display||"").toLowerCase();if(r==="inline"||ei.has(t))return!1;if(n)return!0;if((e.float||"none").toLowerCase()!=="none")return!1;let o=(e.position||"static").toLowerCase();return o==="absolute"||o==="fixed"?!1:!dc.has(r)}function pe(t,e,n=!0,r=!1){if(e=String(e||"").toLowerCase(),Ve.has(e))return"";let i=[],o=xr(e),s=(t.display||"").toLowerCase(),a=s==="inline",c=un(e,s),f=t["text-wrap-mode"]||t["white-space"]||"",l=f==="nowrap"||f==="pre",p=c&&n&&!(c&&n&&!a&&l),m=!1;for(let d in t){if(de(d)||ni(d,t))continue;let h=t[d];if(p){if(cc.has(d))continue;if(lc.has(d)){h&&h!==o[d]&&(i.push(`${d}:${h}`),h!=="auto"&&(m=!0));continue}}if(h&&h!==o[d]){if(!l&&(d==="width"||d==="inline-size")&&h.endsWith("px")&&h.includes(".")){let g=parseFloat(h);if(Number.isFinite(g)){i.push(`${d}:${(g+uc).toFixed(3)}px`);continue}}i.push(`${d}:${h}`)}}if(p&&!a&&!r&&!m){let d=t.width;d&&d!=="auto"&&d!==o.width&&i.push(`min-width:${d}`)}return i.sort(),i.join(";")}function kr(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 Cr(t,e=null){let n=new Map;for(let s of t){let a=xr(s);if(!a)continue;let l=(e?Object.entries(a).filter(([p])=>e.has(p)):Object.entries(a)).filter(([p])=>!ni(p,a)).map(([p,m])=>`${p}:${m};`).sort(),u=l.join("");u&&(n.has(u)||n.set(u,{tagList:[],declarations:l}),n.get(u).tagList.push(s))}let r=[...n.values()],i=null;for(let{declarations:s}of r){let a=new Set(s);if(!i){i=a;continue}for(let c of i)a.has(c)||i.delete(c)}i??=new Set;let o="";if(i.size&&r.length>1){let s=r.flatMap(a=>a.tagList);o+=`${s.join(",")} { ${[...i].join("")} }
|
|
7
|
+
`}for(let{tagList:s,declarations:a}of r){let c=r.length>1?a.filter(l=>!i.has(l)):a;if(!c.length)continue;let f=c.join("");o+=`${s.join(",")} { ${f} }
|
|
8
|
+
`}return o}function qe(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let i of e)n.set(i,`c${r++}`);return n}function pc(t){try{let e=t?.ownerDocument;if(!e)return typeof window<"u"?window:null;let n=e.defaultView;if(n&&typeof n.getComputedStyle=="function")return n;if(typeof window<"u"&&window.frames)for(let r=0;r<window.frames.length;r++)try{if(window.frames[r]?.document===e)return window.frames[r]}catch{}}catch{}return typeof window<"u"?window:null}function O(t,e=null){let n=()=>{let o={length:0,getPropertyValue:()=>"",item:()=>""};return o[Symbol.iterator]=function*(){},o};if(t?.nodeType!==1){let o=typeof window<"u"?window:null;if(o&&typeof o.getComputedStyle=="function")try{return o.getComputedStyle(t,e)||n()}catch{return n()}return n()}let r=P.computedStyle.get(t);r||(r=new Map,P.computedStyle.set(t,r));let i=r.get(e);if(!i){let o=pc(t),s=null;try{s=o&&typeof o.getComputedStyle=="function"?o.getComputedStyle(t,e):null}catch{}if(!s&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{t.ownerDocument===document&&(s=window.getComputedStyle(t,e))}catch{}i=s||n(),r.set(e,i)}return i}function he(t,e=null){let n={};for(let r of e||t){let i=t.getPropertyValue(r);i&&(n[r]=i)}for(let r of hc){let i=n[`border-${r}-style`],o=n[`border-${r}-width`];(i==="none"||i==="hidden"||o==="0px")&&(delete n[`border-${r}-style`],delete n[`border-${r}-width`],delete n[`border-${r}-color`])}return n}function Ot(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,i).trim()),r=i+1)}return e.push(t.slice(r).trim()),e}var Sr,Ve,rc,oc,ic,ti,sc,ei,ac,cc,lc,fc,uc,dc,hc,me=st(()=>{"use strict";lt();wr();mt();Sr=new Set(["meta","script","noscript","title","link","template"]),Ve=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);rc=/(?:^|-)(animation|transition)(?:-|$)/i,oc=/^(--.+|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,ic=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"]),ti=new Map;sc=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),ei=new Set(["table","thead","tbody","tfoot","tr","td","th"]),ac=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),cc=new Set(["width","max-width","inline-size","max-inline-size"]),lc=new Set(["min-width","min-inline-size"]),fc=new Map(Object.entries({"block-size":"height","inline-size":"width","min-block-size":"min-height","min-inline-size":"min-width","max-block-size":"max-height","max-inline-size":"max-width","margin-block-start":"margin-top","margin-block-end":"margin-bottom","margin-inline-start":"margin-left","margin-inline-end":"margin-right","padding-block-start":"padding-top","padding-block-end":"padding-bottom","padding-inline-start":"padding-left","padding-inline-end":"padding-right","inset-block-start":"top","inset-block-end":"bottom","inset-inline-start":"left","inset-inline-end":"right","border-block-start-width":"border-top-width","border-block-start-style":"border-top-style","border-block-start-color":"border-top-color","border-block-end-width":"border-bottom-width","border-block-end-style":"border-bottom-style","border-block-end-color":"border-bottom-color","border-inline-start-width":"border-left-width","border-inline-start-style":"border-left-style","border-inline-start-color":"border-left-color","border-inline-end-width":"border-right-width","border-inline-end-style":"border-right-style","border-inline-end-color":"border-right-color","border-start-start-radius":"border-top-left-radius","border-start-end-radius":"border-top-right-radius","border-end-start-radius":"border-bottom-left-radius","border-end-end-radius":"border-bottom-right-radius","overflow-block":"overflow-y","overflow-inline":"overflow-x","overscroll-behavior-block":"overscroll-behavior-y","overscroll-behavior-inline":"overscroll-behavior-x","contain-intrinsic-block-size":"contain-intrinsic-height","contain-intrinsic-inline-size":"contain-intrinsic-width"}));uc=.001;dc=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]);hc=["top","right","bottom","left"]});function ft(t=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(e=>{let n=!1,r=()=>{n||(n=!0,e())};try{requestAnimationFrame(r)}catch{r();return}setTimeout(r,t)})}function Ge(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let t=navigator.userAgent||"",e=/iPhone|iPad|iPod/.test(t),n=navigator.maxTouchPoints>2&&/Macintosh/.test(t);return e||n}function X(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=t.toLowerCase(),n=e.includes("safari")&&!e.includes("chrome")&&!e.includes("crios")&&!e.includes("fxios")&&!e.includes("android"),r=/applewebkit/i.test(t),i=/mobile/i.test(t),o=!/safari/i.test(t),s=r&&i&&o,a=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(t),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(e),f=/ipad|iphone|ipod/.test(e)&&r;return n||s||a||c||f}function Dt(){return typeof navigator>"u"?!1:(navigator.userAgent||"").toLowerCase().includes("firefox")}var St=st(()=>{"use strict"});function U(t,e,n){let r=t&&typeof t=="object"&&(t.options||t);r&&r.debug&&(n!==void 0?console.warn("[snapdom]",e,n):console.warn("[snapdom]",e))}function gt(t,e,n,r){let i=t&&t.warnings;i&&i.length<mc&&i.push(r===void 0?{code:e,message:n}:{code:e,message:n,detail:r})}var mc,Xt=st(()=>{"use strict";mc=50});var ut=st(()=>{"use strict";Go();me();St();wt();Xt()});var Ea={};He(Ea,{decodeSvgFromDataURL:()=>cn,encodeSvgToDataURL:()=>ln,fixSafariShadows:()=>sr,toCanvas:()=>se});function Nu(t,e){try{let n=t.match(/<svg\b[^>]*>/i);if(!n)return t;let r=n[0],i=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(o)||i<=0||o<=0)return t;let s=Math.min(1,zt/i,zt/o,Math.sqrt(To/(i*o)));if(s>=1)return t;let a=Math.max(1,Math.floor(i*s)),c=Math.max(1,Math.floor(o*s));return gt(e,"raster-clamp",`capture ${Math.round(i)}x${Math.round(o)}px exceeds decode limits; downscaled to ${a}x${c}px`),console.warn(`[snapDOM] Capture ${Math.round(i)}\xD7${Math.round(o)}px exceeds the browser image-decode limit (${zt}px/side); downscaling to ${a}\xD7${c}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),t.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${c}`))}catch{return t}}function Lu(t,e){let n=["x","y","width","height"].map(S=>Number(e?.[S]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw new RangeError("[snapdom] canvas crop requires finite x/y and positive width/height");let r=t.match(/<svg\b[^>]*>/i);if(!r)throw new Error("[snapdom] cannot crop a non-SVG capture");let i=r[0],o=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],s=String(o||"").trim().split(/[\s,]+/).map(Number);if(s.length!==4||!s.every(Number.isFinite)||s[2]<=0||s[3]<=0)throw new Error("[snapdom] cannot crop an SVG without a finite viewBox");let[a,c,f,l]=s,u=Math.max(a,n[0]),p=Math.max(c,n[1]),m=Math.min(a+f,n[0]+n[2]),d=Math.min(c+l,n[1]+n[3]);if(!(m>u)||!(d>p))throw new RangeError("[snapdom] canvas crop does not intersect the SVG viewBox");let h=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(h)&&h>0?h/f:1,b=Number.isFinite(g)&&g>0?g/l:1,w=Math.max(1,(m-u)*y),C=Math.max(1,(d-p)*b),x=i.replace(/(\bwidth=")[^"]*/i,`$1${w}`).replace(/(\bheight=")[^"]*/i,`$1${C}`).replace(/(\bviewBox=")[^"]*/i,`$1${u} ${p} ${m-u} ${d-p}`);return t.replace(i,x)}function xa(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function cn(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function Iu(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 ln(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Aa(t){let e=[],n="",r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(e.push(n),n=""):n+=o}return n.trim()&&e.push(n),e.map(i=>i.trim()).filter(Boolean)}function Wu(t){let e=[],n="",r=0;for(let o=0;o<t.length;o++){let s=t[o];s==="("&&r++,s===")"&&(r=Math.max(0,r-1)),s===","&&r===0?(e.push(n.trim()),n=""):n+=s}n.trim()&&e.push(n.trim());let i=[];for(let o of e){if(/\binset\b/i.test(o))continue;let s=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[a="0px",c="0px",f="0px"]=s;f=`${parseFloat(f)/2}px`;let l=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),u=!!l&&l!==",";i.push(`drop-shadow(${a} ${c} ${f}${u?` ${l}`:""})`)}return i.join(" ")}function Ma(t){let e=Aa(t),n=null,r=null,i=null,o=[];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"?i=l:f==="filter"?n=l:f==="-webkit-filter"?r=l:o.push([f,l])}if(i){let a=Wu(i);a&&(n=n?`${n} ${a}`:a,r=r?`${r} ${a}`:a)}let s=[...o];return n&&s.push(["filter",n]),r&&s.push(["-webkit-filter",r]),s.map(([a,c])=>`${a}:${c}`).join(";")}function Ou(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${Ma(r)}}`)}function Du(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Ou(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${Ma(r)}${n}`),t}function Bu(){return rr||(rr=(async()=>{try{let t='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',e=new Image;e.decoding="sync",e.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await e.decode();let n=document.createElement("canvas");n.width=8,n.height=20;let r=n.getContext("2d",{willReadFrequently:!0});r.drawImage(e,0,0);let i=r.getImageData(2,18,1,1).data[3]>128,o=r.getImageData(2,2,1,1).data[3]>128;return{native:i||o,flippedY:o&&!i}}catch{return{native:!1,flippedY:!1}}})(),rr)}function Uu(t){let e=[],n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];o==="("?n++:o===")"?n=Math.max(0,n-1):o===","&&n===0&&(e.push(t.slice(r,i)),r=i+1)}return e.push(t.slice(r)),e.map(i=>{let o=0,s=0,a="",c=0;for(;c<i.length;){let f=i[c];if(f==="("?o++:f===")"&&(o=Math.max(0,o-1)),o===0&&(c===0||i[c-1]===" ")){let l=/^-?\d*\.?\d+px/.exec(i.slice(c));if(l){s++,a+=s===2?`${-parseFloat(l[0])}px`:l[0],c+=l[0].length;continue}}a+=f,c++}return a}).join(",")}function Hu(t,e){let n=r=>Aa(r).map(i=>{let o=i.indexOf(":");if(o<0)return i;let s=i.slice(0,o).trim().toLowerCase();return s==="text-shadow"||e&&s==="box-shadow"?`${s}:${Uu(i.slice(o+1))}`:i}).join(";");return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(r,i)=>r.replace(i,i.replace(/([^{}]+)\{([^}]*)\}/g,(o,s,a)=>`${s}{${n(a)}}`))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(r,i,o)=>`style=${i}${n(o)}${i}`),t}async function sr(t){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(t))return{svg:t,naturalOnly:!1};let{native:n,flippedY:r}=await Bu();try{let i=t;return n||(i=Du(i)),r&&(i=Hu(i,n)),{svg:i,naturalOnly:!0}}catch{return{svg:t,naturalOnly:!0}}}function zu(){let t=document.createElement("canvas");t.width=16,t.height=16;let e=t.getContext("2d",{willReadFrequently:!0});return e?n=>{e.clearRect(0,0,16,16),e.drawImage(n,0,0,16,16);let r=e.getImageData(0,0,16,16).data;for(let i=3;i<r.length;i+=4)if(r[i]>0)return!0;return!1}:null}async function ju(t,e,n){Q(t),t.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(t);try{if(!n)return await or(),await or(),!1;let r=performance.now()+(e?600:150);for(;;){let i;try{i=n(t)}catch{return!1}if(i)return!0;if(performance.now()>r)return!1;await or()}}finally{try{t.remove()}catch{}}}function va(t){if(typeof document>"u"||!document.body)return new Image;if(Rt&&!Rt.contentDocument){try{Rt.remove()}catch{}Rt=null}if(Rt&&Ro>Vu&&ir===0){try{Rt.remove()}catch{}Rt=null}if(!Rt){let n=document.createElement("iframe");Q(n),n.setAttribute("aria-hidden","true"),n.style.cssText="position:absolute;left:-9999px;top:0;width:0;height:0;border:0;visibility:hidden;pointer-events:none";try{document.body.appendChild(n)}catch{}if(n.contentDocument)Rt=n,Ro=0;else{try{n.remove()}catch{}return new Image}}Ro+=t.length,ir+=1;let e=Rt.contentDocument.createElement("img");return e.__snapdomDecodeFrame=!0,e}function Fo(t){!t||!t.__snapdomDecodeFrame||(t.__snapdomDecodeFrame=!1,ir=Math.max(0,ir-1))}function ka(t,e){return t.loading="eager",t.decoding="sync",t.crossOrigin="anonymous",t.src=e,t.decode()}function Ku(t){if(typeof t!="string")return!1;let e=t.indexOf(",")+1,n=Math.max(48,Math.floor((t.length-e)/200)),r=0,i=0;for(let o=e;o+48<=t.length;o+=n){let s=t.slice(o,o+48);r++,Yu.some(a=>s.includes(a))||i++}return i*2>r}function Ca(t,e,n,r,i){if(!e.naturalWidth){t.drawImage(e,0,0,n,r);return}let o=n*r,s=o>qu&&!Ku(i)?Math.min(Xu,Math.ceil(o/Gu)):1;if(s===1){t.drawImage(e,0,0,n,r);return}let a=e.naturalWidth,c=e.naturalHeight/r;for(let f=0;f<s;f++){let l=Math.round(f*r/s),u=f===s-1?r:Math.round((f+1)*r/s);t.drawImage(e,0,l*c,a,(u-l)*c,0,l,n,u-l)}}async function se(t,e){let{width:n,height:r,scale:i=1,dpr:o=1,meta:s={},backgroundColor:a,crop:c=null}=e,f=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,l=t,u=!1,p=!1;if(c&&!xa(t))throw new RangeError("[snapdom] canvas crop requires an SVG capture payload");if(xa(t)){let d=(Iu(t).match(/<svg\b[^>]*>/i)||[])[0]||"",h=parseFloat((d.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((d.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(h)&&Number.isFinite(g)&&h>0&&g>0&&Math.min(1,zt/h,zt/g,Math.sqrt(To/(h*g)))<1;if(c||y||X())try{let b=cn(t);if(c&&(b=Lu(b,c)),X()){let w=await sr(b);b=w.svg,u=w.naturalOnly,p=/@font-face|data:image\//i.test(b)}(y||c)&&(b=Nu(b,e.__session)),l=ln(b)}catch(b){if(c)throw b;l=t}}let m=f||va(l);try{f||await ka(m,l)}catch(d){if(!m.__snapdomDecodeFrame)throw d;Fo(m),m=va(l);try{await ka(m,l)}catch(h){throw Fo(m),h}}try{let d=X()&&!f?zu():null,h=!1;d&&(h=await ju(m,p,d));let g=f?f.width:m.naturalWidth,y=f?f.height:m.naturalHeight,b=c?g:Number.isFinite(s.vbW)?s.vbW:Number.isFinite(s.w0)?s.w0:g,w=c?y:Number.isFinite(s.vbH)?s.vbH:Number.isFinite(s.h0)?s.h0:y,C,x,S=Number.isFinite(n),A=Number.isFinite(r);if(S&&A)C=Math.max(1,n),x=Math.max(1,r);else if(S){let N=n/Math.max(1,b);C=n,x=w*N}else if(A){let N=r/Math.max(1,w);x=r,C=b*N}else{let N=f&&Number.isFinite(s.vbW)&&Number.isFinite(s.vbH);C=N?s.vbW:g,x=N?s.vbH:y}!S&&!A&&(C=C*i,x=x*i);let v=C*o,M=x*o,k=Math.max(v/zt,M/zt,Math.sqrt(v*M/To));k>1&&(gt(e.__session,"canvas-clamp",`output ${Math.round(v)}x${Math.round(M)}px exceeds canvas limits; downscaled`),console.warn(`[snapDOM] Output ${Math.round(v)}\xD7${Math.round(M)}px exceeds the browser canvas limit (${zt}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),C/=k,x/=k);let R=typeof HTMLCanvasElement<"u"&&e.canvas instanceof HTMLCanvasElement?e.canvas:document.createElement("canvas");R.width=Math.max(1,C*o),R.height=Math.max(1,x*o),R.style.width=`${C}px`,R.style.height=`${x}px`;let E=R.getContext("2d");if(!E)throw new Error("[snapdom] toCanvas: the target canvas has no 2d context");let T=()=>{if(o!==1&&E.scale(o,o),a&&(E.save(),E.fillStyle=a,E.fillRect(0,0,C,x),E.restore()),u&&(Math.round(C*o)!==g||Math.round(x*o)!==y)){let N=document.createElement("canvas");N.width=g,N.height=y,Ca(N.getContext("2d"),m,g,y,l),E.drawImage(N,0,0,C,x)}else E.save(),E.setTransform(1,0,0,1,0,0),Ca(E,m,C*o,x*o,l),E.restore()};if(T(),d&&h&&p){let N=!0;try{N=d(m)}catch{}if(!N){let B=performance.now()+600;do{await or();try{N=d(m)}catch{break}}while(!N&&performance.now()<B);R.width=R.width,T()}}return R}finally{Fo(m)}}var zt,To,rr,or,Vu,Rt,Ro,ir,qu,Gu,Xu,Yu,Ie=st(()=>{"use strict";St();Xt();mt();zt=X()?16384:32767,To=16384*16384;rr=null;or=()=>new Promise(t=>{requestAnimationFrame(t),setTimeout(t,50)});Vu=24*1024*1024,Rt=null,Ro=0,ir=0;qu=4e6,Gu=2e6,Xu=8,Yu=["%3C","%3E","%20","%7B","%7D","%3B"]});var fn={};He(fn,{rasterize:()=>$o});async function $o(t,e){let n=await se(t,e),o=n.width*n.height<=2e6?n.toDataURL(`image/${e.format}`,e.quality):await new Promise(a=>{let c=()=>a(n.toDataURL(`image/${e.format}`,e.quality));try{n.toBlob(f=>{if(!f)return c();let l=new FileReader;l.onload=()=>a(String(l.result||"")),l.onerror=c,l.readAsDataURL(f)},`image/${e.format}`,e.quality)}catch{c()}}),s=new Image;return s.src=o,X()?await s.decode():await new Promise((a,c)=>{if(s.complete&&s.naturalWidth)return a();s.onload=a,s.onerror=c}),s.style.width=`${n.width/e.dpr}px`,s.style.height=`${n.height/e.dpr}px`,s}var We=st(()=>{"use strict";Ie();St()});var Po={};He(Po,{toImg:()=>Qu,toSvg:()=>Qu});async function Qu(t,e){let{scale:n=1,width:r,height:i,meta:o={}}=e,s=Number.isFinite(r),a=Number.isFinite(i),c=Number.isFinite(n)&&n!==1||s||a;if(X()&&c)try{let{svg:p}=await sr(cn(t)),m=(p.match(/<svg\b[^>]*>/i)||[])[0]||"",d=parseFloat((m.match(/\bwidth="([\d.]+)/i)||[])[1]),h=parseFloat((m.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(d)||!Number.isFinite(h))throw new Error("svg without dimensions");let g=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:d,y=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:h,b,w;s&&a?(b=r,w=i):s?(b=r,w=Math.max(1,Math.round(y*(r/Math.max(1,g))))):a?(w=i,b=Math.max(1,Math.round(g*(i/Math.max(1,y))))):(b=Math.max(1,Math.round(d*n)),w=Math.max(1,Math.round(h*n)));let C=p.replace(/width="[^"]*"/,`width="${b}"`).replace(/height="[^"]*"/,`height="${w}"`),x=new Image;return x.decoding="sync",x.loading="eager",x.src=ln(C),await x.decode(),x.style.width=`${b}px`,x.style.height=`${w}px`,x}catch(p){return gt(e.__session,"safari-png-fallback","safari vector toImg failed, falling back to PNG raster",p),U(e,"safari vector toImg failed, falling back to PNG",p),$o(t,{...e,format:"png",quality:1,meta:o})}let f=t,l=!1;if(!s&&!a&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let p=cn(t),m=(p.match(/<svg\b[^>]*>/i)||[])[0]||"",d=Number((m.match(/\bwidth="([\d.]+)"/i)||[])[1]),h=Number((m.match(/\bheight="([\d.]+)"/i)||[])[1]);if(d>0&&h>0){let g=m.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(d*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(h*n))}"`);f=ln(p.replace(m,g)),l=!0}}catch{}let u=new Image;u.decoding="sync",u.loading="eager",u.src=f;try{await u.decode()}catch(p){if(!l)throw p;u.src=t,l=!1,await u.decode()}if(s&&a)u.style.width=`${r}px`,u.style.height=`${i}px`;else if(s){let p=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:u.naturalWidth,m=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:u.naturalHeight,d=r/Math.max(1,p);u.style.width=`${r}px`,u.style.height=`${Math.max(1,Math.round(m*d))}px`}else if(a){let p=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:u.naturalWidth,m=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:u.naturalHeight,d=i/Math.max(1,m);u.style.height=`${i}px`,u.style.width=`${Math.max(1,Math.round(p*d))}px`}else{let p=Math.max(1,Math.round(u.naturalWidth*(l?1:n))),m=Math.max(1,Math.round(u.naturalHeight*(l?1:n)));if(u.style.width=`${p}px`,u.style.height=`${m}px`,!l&&n!==1&&typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let h=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${p}"`).replace(/height="[^"]*"/,`height="${m}"`);u.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h)}`,await u.decode()}catch(d){U(e,"SVG width/height patch in toImg failed",d),u.src!==t&&(u.src=t,await u.decode().catch(()=>{}))}}return u}var No=st(()=>{"use strict";ut();Xt();We();Ie()});var _a={};He(_a,{toBlob:()=>Lo});async function Lo(t,e){let n=e.format||e.type||"svg";if(n==="svg"){if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)throw new Error("[snapdom] toBlob: engine:'html-in-canvas' produces a raster capture; ask for png/jpeg/webp");let i=decodeURIComponent(t.split(",")[1]);return new Blob([i],{type:"image/svg+xml"})}let r=await se(t,e);return new Promise(i=>r.toBlob(o=>i(o),`image/${n==="jpg"?"jpeg":n}`,e.quality))}var Io=st(()=>{"use strict";Ie()});var Fa={};He(Fa,{download:()=>Ju});async function Ra(t,e){let n=new File([t],e,{type:t.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:e})}catch(r){if(r.name!=="AbortError")return!1}return!0}async function Ju(t,e){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(e?.type||"").toLowerCase(),i=n.has(r)?r:"",o=(e?.format||i||"").toLowerCase(),s=o==="jpg"?"jpeg":o||"png",a=e?.filename||"snapdom",c=/\.(png|jpe?g|webp|svg)$/i.test(a)?a:`${a}.${s}`,f={...e||{},format:s,type:s};f.dpr=1;let l=Ge();if(s==="svg"){let m=await Lo(t,{...f,type:"svg"});if(l&&await Ra(m,c))return;let d=URL.createObjectURL(m),h=document.createElement("a");h.href=d,h.download=c,document.body.appendChild(h),h.click(),URL.revokeObjectURL(d),h.remove();return}let u=await se(t,f);if(l){let m=`image/${s}`,d=await new Promise(h=>u.toBlob(h,m,e?.quality));if(d&&await Ra(d,c))return}let p=document.createElement("a");p.href=u.toDataURL(`image/${s}`,e?.quality),p.download=c,document.body.appendChild(p),p.click(),p.remove()}var Ta=st(()=>{"use strict";Io();Ie();St()});ut();ut();St();lt();wr();mt();var Yt=new WeakMap,ri=["margin-top","margin-right","margin-bottom","margin-left","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end"],Ar=new Map,gc=2e3,pn=0;function Mt(){pn++}function dn(t){let e=t&&(t.nodeType===1?t:t.parentElement);for(;e;){if(Wt(e))return!0;if(e.parentElement)e=e.parentElement;else{let n=e.getRootNode?.();e=n&&n.host?n.host:null}}return!1}function mn(t){for(let e of t)if(Qt(e))return!0;return!1}function Qt(t){if(dn(t.target))return!1;if(t.type==="childList"){let e=!0;for(let n of t.addedNodes)if(!dn(n)){e=!1;break}if(e){for(let n of t.removedNodes)if(!dn(n)){e=!1;break}}if(e)return!1}return!0}var ge=new WeakMap;function ci(t){for(let e of t){if(!Qt(e))continue;let n=e.target.ownerDocument||document;ge.set(n,(ge.get(n)||0)+1);let r=e.target.nodeType===1?e.target:e.target.parentElement||e.target.host;for(;r;r=r.parentElement||r.getRootNode?.()?.host)ge.set(r,(ge.get(r)||0)+1)}}function gn(t){let e=t.ownerDocument||document;return we(e),(ge.get(e)||0)-(ge.get(t)||0)}var xt=0;function ye(t=document){return we(t),xt}function Jt(){return we(),pn}function Qe(t){return t?(we(t.ownerDocument||document),yn(t,$r(t))):0}function be(){Mt(),xt++}var Kt=new WeakMap,Bt=0,Ut=0;function yc(t){Kt.set(t,++Bt)}function Fr(t){if(!t||t.nodeType!==1)return;Bt++,Kt.set(t,Bt);let e=t.querySelectorAll("*");for(let n=0;n<e.length;n++)Kt.set(e[n],Bt)}function Tr(t){Fr(t.parentElement||t);for(let e=t.parentElement;e;e=e.parentElement)yc(e)}function yn(t,e=null){let n=Kt.get(t)||0;if(e)for(let r of e)n=Math.max(n,Kt.get(r)||0);return Ut*1e9+n}function $r(t){let e=t.getRootNode?.();if(!e?.host)return null;let n=[];for(;e?.host;)e.mode==="open"&&Nr(e),n.push(e.host),e=e.host.getRootNode?.();return n}var Mr=new WeakMap;function Pr(t){t=t||document;let e=Mr.get(t);if(!e||e.env!==xt){let n=!0;try{n=te(t).usesHas}catch{}e={env:xt,usesHas:n},Mr.set(t,e)}return!e.usesHas}function bc(t){let e=n=>n?.nodeType===1&&(n.matches?.("style,link")||n.querySelector?.("style,link"));for(let n of t){let r=n.target,i=r&&(r.nodeType===1?r:r.parentElement);if(i&&(i.tagName==="STYLE"||i.tagName==="LINK"))return i.ownerDocument||document;for(let o of n.addedNodes)if(e(o))return o.ownerDocument||document;for(let o of n.removedNodes)if(e(o))return o.ownerDocument||r&&r.ownerDocument||document}return null}var Er=new WeakSet,Xe=[];function li(t){if(!mn(t))return;ci(t),Mt();let e=new Set;for(let n of t){if(!Qt(n))continue;let r=n.target.getRootNode&&n.target.getRootNode();if(!r||r.nodeType!==11||e.has(r))continue;e.add(r),r.host?Fr(r.host):Bt++;let i=r.querySelectorAll("*");for(let o=0;o<i.length;o++)Kt.set(i[o],Bt)}}function Nr(t){if(!(!t||Er.has(t))){Er.add(t);try{let e=new MutationObserver(li);e.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Xe.push({o:e,root:t})}catch{}}}function fi(t){if(!mn(t))return;ci(t),Mt();let e=bc(t);if(e){Mr.delete(e),xt++,Ut++;return}let n=new Set;for(let r of t){if(!Qt(r))continue;let i=r.target.nodeType===1?r.target:r.target.parentElement;if(!i)continue;let o=i.ownerDocument||document;if(!Pr(o)){Ut++;return}if(i===o.documentElement||i===o.body){Ut++;return}let s=i.parentElement||i;n.has(s)||(n.add(s),Tr(i))}}var _r=new WeakSet,Ye=null,Ke=[];function we(t=document){if(t===Ye||!t||t.nodeType!==9)return;if(_r.has(t)){Ye=t;return}_r.add(t),Ye=t;let e=t.defaultView,n=i=>{mn(i)&&(Mt(),xt++)},r=()=>{Mt(),xt++};try{let i=new MutationObserver(fi);i.observe(t.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Ke.push({o:i,env:!1,doc:t})}catch{}try{let i=new MutationObserver(n);i.observe(t.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Ke.push({o:i,env:!0,doc:t})}catch{}try{e?.addEventListener("resize",r,{passive:!0})}catch{}try{let i=o=>{Mt();let s=o.composedPath?.()[0]||o.target;s&&s.nodeType===1&&!dn(s)&&Pr(s.ownerDocument||t)?Tr(s):Ut++};t.addEventListener("focusin",i,{capture:!0,passive:!0}),t.addEventListener("focusout",i,{capture:!0,passive:!0}),t.addEventListener("change",i,{capture:!0,passive:!0}),t.addEventListener("pointerdown",i,{capture:!0,passive:!0}),t.addEventListener("pointerup",i,{capture:!0,passive:!0}),t.addEventListener("pointercancel",i,{capture:!0,passive:!0}),t.addEventListener("keydown",i,{capture:!0,passive:!0}),t.addEventListener("keyup",i,{capture:!0,passive:!0}),t.addEventListener("beforetoggle",i,{capture:!0,passive:!0}),t.addEventListener("toggle",i,{capture:!0,passive:!0}),e?.addEventListener("hashchange",()=>{Mt(),Ut++},{passive:!0})}catch{}try{let i=t.fonts;i&&(i.addEventListener?.("loadingdone",r),i.status==="loading"&&i.ready?.then(r).catch(()=>{}))}catch{}}var oi=new WeakMap;function ii(t,e){if(!t?.querySelectorAll)return;let n;try{n=Array.from(t.querySelectorAll(":hover"))}catch{return}let r=oi.get(t)||[];if(r.length===n.length&&r.every((o,s)=>o===n[s]))return;if(oi.set(t,n),Mt(),t.nodeType===11){t.host?Fr(t.host):Bt++;for(let o of t.querySelectorAll("*"))Kt.set(o,Bt);return}let i=r.filter(o=>!n.includes(o)).concat(n.filter(o=>!r.includes(o)));for(let o of i)if(o.isConnected)if(Pr(e))Tr(o);else{Ut++;return}}function bn(t,e=null){if(!t)return;ii(t,t);let n=e||Xe.filter(({root:r})=>r.host?.isConnected).map(({root:r})=>r);for(let r of n)ii(r,t)}function Et(){we();try{for(let t=Ke.length-1;t>=0;t--){let{o:e,env:n,doc:r}=Ke[t];if(r!==document&&!r.defaultView){try{e.disconnect()}catch{}_r.delete(r),Ye===r&&(Ye=null),Ke.splice(t,1);continue}let i=e.takeRecords();i.length&&(n?mn(i)&&(Mt(),xt++):fi(i))}for(let t=Xe.length-1;t>=0;t--){let{o:e,root:n}=Xe[t];if(!n.host||!n.host.isConnected){try{e.disconnect()}catch{}Er.delete(n),Xe.splice(t,1);continue}let r=e.takeRecords();r.length&&li(r)}}catch{}}function Zt(t){if(!(!t||t.nodeType!==1)){Yt.delete(t);try{let e=(t.ownerDocument||document).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();)Yt.delete(e.currentNode)}catch{}}}var wc=["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 Lr(t){let e=Yt.get(t);if(e&&Ir(e,t)){let n=e.snapshot&&e.snapshot.__needsBgInline;if(n!==void 0)return n}return!0}function ui(t){let e=Yt.get(t);if(!e||!Ir(e,t))return null;let n=e.snapshot;return!n||n.__bgClipTextFix?null:n}var si=new WeakMap;function te(t){let e=si.get(t);return(!e||e.epoch!==pn)&&(e={epoch:pn,...Jo(t)},si.set(t,e)),e}function di(t){try{let e=te(t.ownerDocument||document).shareGate;if(e===null)return!1;if(!e.length)return!0;let n=new Set,r=s=>{n.add("t"+s.localName),s.id&&n.add("i"+s.id);let a=s.classList;for(let c=0;c<a.length;c++)n.add("c"+a[c])};r(t);for(let s of t.querySelectorAll("*"))r(s);let i=[];for(let{sel:s,key:a}of e)(a===null||n.has(a))&&i.push(s);if(!i.length)return!0;let o=i.join(",");return!t.matches(o)&&t.querySelector(o)===null}catch{return!1}}function Sc(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:te(e).importantProps}function Je(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:te(e).universe}function hn(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?null:te(e).pseudoUniverse}var xc={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function Se(t){let e=t.ownerDocument||document;return t.getRootNode&&t.getRootNode()!==e?xc:te(e).pseudoGates}function vc(t,e={},n=null,r=null){let i={},o=e.excludeStyleProps,s=m=>{if(i[m]!==void 0||de(m)||o&&(o instanceof RegExp&&o.test(m)||typeof o=="function"&&o(m)))return;let d=t.getPropertyValue(m);d&&((m==="background-image"||m==="content")&&d.includes("url(")&&!d.includes("data:")&&(d="none"),i[m]=d)};if(r){for(let d of r)s(d);let m=n&&n.style;if(m&&m.length)for(let d=0;d<m.length;d++)s(m[d])}else for(let m=0;m<t.length;m++)s(t[m]);let a=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let m of a)if(!i[m])try{let d=t.getPropertyValue(m);d&&(i[m]=d)}catch{}let c=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let m of c)if(!i[m])try{let d=t.getPropertyValue(m);d&&(i[m]=d)}catch{}if(e.embedFonts){let m=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let d of m)if(!i[d])try{let h=t.getPropertyValue(d);h&&(i[d]=h)}catch{}}try{(i["content-visibility"]||t.getPropertyValue("content-visibility"))==="hidden"&&(i["content-visibility"]="hidden")}catch{}Object.defineProperty(i,"__needsBgInline",{value:pi(t),enumerable:!1});let f=parseFloat(t.getPropertyValue("border-top-width")||0)||0,l=parseFloat(t.getPropertyValue("border-right-width")||0)||0,u=parseFloat(t.getPropertyValue("border-bottom-width")||0)||0,p=parseFloat(t.getPropertyValue("border-left-width")||0)||0;if(f===0&&l===0&&u===0&&p===0){let m=(t.getPropertyValue("border-image-source")||"").trim(),d=m&&m!=="none",h=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color","border-block-start","border-block-start-width","border-block-start-style","border-block-start-color","border-block-end","border-block-end-width","border-block-end-style","border-block-end-color","border-inline-start","border-inline-start-width","border-inline-start-style","border-inline-start-color","border-inline-end","border-inline-end-width","border-inline-end-style","border-inline-end-color"];for(let g of h)delete i[g];d||(i.border="none")}return kc(i),i}function kc(t){if(!Dt())return;let e=t["background-clip"]||t["-webkit-background-clip"];if(!e||!e.includes("text"))return;let n=o=>o==="transparent"||o==="rgba(0, 0, 0, 0)",r=t["-webkit-text-fill-color"];if(!n(r!==void 0?r:t.color))return;let i=Cc(t["background-image"],t["background-color"]);i&&(n(t.color)&&(t.color=i),r!==void 0&&(t["-webkit-text-fill-color"]=i),t["background-image"]="none",t["background-color"]="transparent",delete t["background-clip"],delete t["-webkit-background-clip"],Object.defineProperty(t,"__bgClipTextFix",{value:i,enumerable:!1}))}function Cc(t,e){let n=o=>{let s=[],a=/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)(?:[,\s/]+([\d.]+%?))?\s*\)/g,c;for(;c=a.exec(o||"");){let f=c[4];(f===void 0?1:parseFloat(f)/(f.endsWith("%")?100:1))>.05&&s.push([+c[1],+c[2],+c[3]])}return s},r=n(t);if(r.length||(r=n(e)),!r.length)return null;let i=[0,0,0];for(let[o,s,a]of r)i[0]+=o,i[1]+=s,i[2]+=a;return`rgb(${i.map(o=>Math.round(o/r.length)).join(", ")})`}function pi(t){let e=t.getPropertyValue("background-image");if(e&&e!=="none")return!0;let n=t.getPropertyValue("background-color");if(n&&n!=="rgba(0, 0, 0, 0)"&&n!=="transparent")return!0;for(let i of wc){let o=t.getPropertyValue(i);if(o&&o!=="none")return!0}let r=t.getPropertyValue("background");return!!(r&&/url\s*\(/i.test(r))}function Ac(t){for(let e=t.firstChild;e;e=e.nextSibling){if(e.nodeType===3&&/\S/.test(e.nodeValue||""))return!0;if(e.nodeType===1){let n=O(e).position;if(n!=="absolute"&&n!=="fixed")return!0}}return!1}function Mc(t,e,n){try{if(typeof t.computedStyleMap=="function"){let i=t.computedStyleMap().get("width");if(i!=null)return!ai(String(i).trim().toLowerCase())}}catch{}let r=t.style&&(t.style.width||t.style.inlineSize);return r&&!ai(String(r).trim().toLowerCase())?!0:_c(t,e)?n||Rc(t,e):!1}var Ec=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function ai(t){return Ec.has(t)||t.startsWith("fit-content")}function _c(t,e){let n=t.getBoundingClientRect().width-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)-(parseFloat(e.borderLeftWidth)||0)-(parseFloat(e.borderRightWidth)||0);if(!(n>0))return!1;let r=1/0,i=-1/0,o=null;for(let s=t.firstChild;s;s=s.nextSibling){let a;if(s.nodeType===3){if(!/\S/.test(s.nodeValue||"")||(o=o||document.createRange(),o.selectNode(s),a=o.getBoundingClientRect(),!a.width&&!a.height))continue}else if(s.nodeType===1){let c=O(s);if(c.display==="none"||c.position==="absolute"||c.position==="fixed")continue;a=s.getBoundingClientRect()}else continue;a.left<r&&(r=a.left),a.right>i&&(i=a.right)}return i===-1/0?!1:i-r<n-.5}function Rc(t,e){let n=t.parentElement;if(!n)return!1;let r=O(n),i=n.getBoundingClientRect().width-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0)-(parseFloat(r.borderLeftWidth)||0)-(parseFloat(r.borderRightWidth)||0)-(parseFloat(e.marginLeft)||0)-(parseFloat(e.marginRight)||0);return i>0?Math.abs(t.getBoundingClientRect().width-i)>.5:!1}var Rr=new WeakMap;function Fc(t){let e=Rr.get(t);if(e)return e;let n=[];for(let r in t)n.push(r,t[r]);return e=n.join(""),Rr.set(t,e),e}function Ir(t,e){return t.env===xt&&t.stamp===yn(e,t.hosts)}var Tc=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,$c=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,Pc=new Set(["INPUT","TEXTAREA","SELECT","OPTION","OPTGROUP","PROGRESS","METER","BUTTON","DATALIST"]);function Nc(t){let e=t.__styleShare;return e||(e=t.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1}),e}function Lc(t,e){let n=e.ids.get(t);if(n!==void 0)return n;let r=t.parentElement,i;if(!r)i="R";else if(i=e.ids.get(r),i===void 0){if(e.rootSeen)return e.ids.set(t,-1),-1;i="R"}if(e.rootSeen=!0,i===-1)return e.ids.set(t,-1),-1;let o="",s=t.attributes;if(s&&s.length)if(s.length===1)o=s[0].name+"="+s[0].value;else{let c=[];for(let f=0;f<s.length;f++)c.push(s[f].name+"="+s[f].value);c.sort(),o=c.join("")}let a=i+"|"+t.tagName+"|"+o;return n=e.intern.get(a),n===void 0&&(n=e.intern.size,e.intern.set(a,n)),e.ids.set(t,n),n}function hi(t,e){let n=t.snap,r=t.snap={...n};Object.defineProperty(r,"__needsBgInline",{value:n.__needsBgInline,enumerable:!1}),n.__bgClipTextFix!==void 0&&Object.defineProperty(r,"__bgClipTextFix",{value:n.__bgClipTextFix,enumerable:!1});let i=te(e.ownerDocument||document),o=e.getAttribute&&e.getAttribute("style")||"",s=o&&$c.test(o),a=!!i.marginUnstable||s&&/margin/i.test(o),c=!!i.paddingUnstable||s&&/padding/i.test(o),f=r.display!==void 0&&r.display.includes("grid"),l=r.transform!==void 0&&r.transform!=="none",u=[];for(let d in r)(Tc.test(d)||f&&(d==="grid-template-columns"||d==="grid-template-rows")||l&&d==="transform"||a&&d.charCodeAt(0)===109&&d.startsWith("margin-")||c&&d.charCodeAt(0)===112&&d.startsWith("padding-"))&&u.push(d);t.h&&!("height"in r)&&u.push("height"),t.b&&!("block-size"in r)&&u.push("block-size");let p=new Set(u),m=[];for(let d in r)p.has(d)||m.push(d,r[d]);return t.rr=u,t.sig=m.join("")+""+u.join(""),u}function mi(t,e,n,r,i){let o=i&&i.__styleShare?r&&r.__styleShare:null,s=o?o.ids.get(t):void 0;if(s===void 0||s===-1||t.shadowRoot||t.assignedSlot)return he(n,hn(t));let a=s+e,c=o.pseudo||(o.pseudo=new Map),f=c.get(a);if(f){let u={...f.snap},p=f.rr||hi(f,t);for(let m=0;m<p.length;m++){let d=n.getPropertyValue(p[m]);d?u[p[m]]=d:delete u[p[m]]}return u}let l=he(n,hn(t));return c.set(a,{snap:l,rr:null,sig:null,h:"height"in l,b:"block-size"in l}),l}function Ic(t,e=null,n={},r=null){let i=Yt.get(t),o=!!(n&&n.embedFonts),s=n&&n.excludeStyleProps||null;if(typeof s!="function"&&i&&Ir(i,t)&&i.embedFonts===o&&i.excludeStyleProps===s)return i.snapshot;let a=e||getComputedStyle(t),c,f=null,l=r&&r.st.snaps.get(r.id);if(l){c={...l.snap};let m=l.rr||hi(l,t);f=[];for(let d=0;d<m.length;d++){let h=m[d],g=a.getPropertyValue(h);g?c[h]=g:delete c[h],f.push(g)}Object.defineProperty(c,"__needsBgInline",{value:l.snap.__needsBgInline,enumerable:!1}),l.snap.__bgClipTextFix!==void 0&&Object.defineProperty(c,"__bgClipTextFix",{value:l.snap.__bgClipTextFix,enumerable:!1})}else c=vc(a,n,t,Je(t)),r&&r.st.snaps.set(r.id,{snap:c,rr:null,sig:null,h:"height"in c,b:"block-size"in c});let u=!1;if(typeof t.computedStyleMap=="function"){let m;for(let d of ri)if(c[d]==="0px")try{m||=t.computedStyleMap(),m.get(d)?.toString()==="auto"&&(c[d]="auto",u=!0)}catch{}}jc(t,a,c),f!==null&&(u&&f.push("",...ri.map(m=>c[m])),Rr.set(c,l.sig+""+f.join("")+("height"in c?"":"")+("block-size"in c?"":"")));let p=$r(t);return Yt.set(t,{env:xt,stamp:yn(t,p),hosts:p,snapshot:c,embedFonts:o,excludeStyleProps:s}),c}function Wc(t,e){if(t&&t.session&&t.persist)return t;if(t&&(t.styleMap||t.styleCache||t.nodeMap)){let n=t.__ctx;return(!n||t.__ctxOpts!==e)&&(n={session:t,persist:{snapshotKeyCache:Ar,defaultStyle:P.defaultStyle,baseStyle:P.baseStyle,image:P.image,resource:P.resource,background:P.background},options:e||{}},t.__ctx=n,t.__ctxOpts=e),n}return{session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},persist:{snapshotKeyCache:Ar,defaultStyle:P.defaultStyle,baseStyle:P.baseStyle,image:P.image,resource:P.resource,background:P.background},options:t||e||{}}}var Oc=/%|[\d.](?:em|rem|ex|ch|cap|ic|lh|rlh|v[whib]|vmin|vmax|cq[whbi]|cqmin|cqmax)\b|\b(?:calc|var|min|max|clamp|env|attr)\(|\b(?:auto|inherit|initial|unset|revert|currentcolor|-webkit-fill-available|fit-content|min-content|max-content)\b/i,Dc=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA";function Bc(t,e,n){if(!t.style||t.style.length===0)return;let r=Sc(t),i=r!=null&&!Oc.test(t.getAttribute("style")||"");for(let o=0;o<t.style.length;o++){let s=t.style[o];if(i&&!r.has(s)&&!(s.startsWith("background")&&Dc(t)))continue;let a=n.getPropertyValue(s);a&&e.style.setProperty(s,a,t.style.getPropertyPriority(s))}}function at(t,e,n,r){if(t.tagName==="STYLE")return;let i=Wc(n,r),o=i.options&&i.options.cache||"soft";o!=="disabled"&&we(t.ownerDocument),o==="disabled"&&!i.session.__bumpedForDisabled&&(Mt(),Ar.clear(),i.session.__bumpedForDisabled=!0);let{session:s,persist:a}=i;if(!s.styleCache.has(t)){let y=null;try{y=getComputedStyle(t)}catch{}s.styleCache.set(t,y||getComputedStyle((t.ownerDocument||document).documentElement))}let c=s.styleCache.get(t);t.getAttribute?.("style")&&Bc(t,e,c);let f=c.getPropertyValue("animation-name");e&&e.style&&f&&f!=="none"&&e.style.setProperty("animation","none","important");let l=t.tagName?.toLowerCase()||"div";if(Ve.has(l)){let y={};Object.defineProperty(y,"__needsBgInline",{value:pi(c),enumerable:!1});let b=$r(t);Yt.set(t,{env:xt,stamp:yn(t,b),hosts:b,snapshot:y,embedFonts:!!(i.options&&i.options.embedFonts),excludeStyleProps:i.options&&i.options.excludeStyleProps||null}),s.styleMap.set(e,"");return}let u=null;if(i.options&&i.options.__styleShare&&s.styleMap){let y=Nc(s),b=Lc(t,y),w=t.ownerDocument||document,C=w.activeElement;b!==-1&&!Pc.has(t.tagName)&&!(C&&C!==w.body&&C!==w.documentElement&&C===t)&&(!t.getRootNode||t.getRootNode()===w)&&!t.shadowRoot&&!t.assignedSlot&&(u={st:y,id:b})}let p=Ic(t,c,i.options,u);if(t.getAttribute?.("style"))for(let y of["top","right","bottom","left"]){let b=`margin-${y}`;p[b]==="auto"&&e.style.setProperty(b,"auto","important")}p.__bgClipTextFix&&e&&e.style&&(e.style.setProperty("background-image","none","important"),e.style.setProperty("background-color","transparent","important"),e.style.setProperty("color",p.__bgClipTextFix,"important"),e.style.setProperty("-webkit-text-fill-color",p.__bgClipTextFix,"important"));let m=gi(t);if(m){let y=c.getPropertyValue("min-width");(!y||y==="auto"||y==="0px")&&(p["min-width"]="0px")}let d=Fc(p),h=!0;if(un(l,(p.display||"").toLowerCase())){h=Ac(t),h&&vr(l,p,m)&&Mc(t,c,m)&&(h=!1),d=`${d}|${l}${h?"|c":""}${m?"|f":""}`;let y=p["text-wrap-mode"]||p["white-space"]||"";h&&y!=="nowrap"&&y!=="pre"&&(s.reconcileRisk=(s.reconcileRisk||0)+1)}let g=a.snapshotKeyCache.get(d);g===void 0&&(g=pe(p,l,h,m),a.snapshotKeyCache.size>=gc&&a.snapshotKeyCache.delete(a.snapshotKeyCache.keys().next().value),a.snapshotKeyCache.set(d,g)),s.styleMap.set(e,g)}function Uc(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 gi(t){let e=t.parentElement;if(!e)return!1;let n=O(e).display||"";return n.includes("flex")||n.includes("grid")}function Hc(t){for(let r=t.firstChild;r;r=r.nextSibling)if(r.nodeType===3&&/\S/.test(r.nodeValue))return!0;let e=t.firstElementChild,n=t.lastElementChild;if(e&&e.tagName==="BR"||n&&n.tagName==="BR")return!0;for(let r=t.firstElementChild;r;r=r.nextElementSibling){let i=O(r);if(i.display==="none")continue;let o=i.position;if(o!=="absolute"&&o!=="fixed")return!0}return!1}function zc(t){let e=t.getBoundingClientRect().top,n=-1/0,r=null;for(let i=t.firstChild;i;i=i.nextSibling){if(i.nodeType===3){if(!/\S/.test(i.nodeValue||""))continue;r=r||document.createRange(),r.selectNode(i);let a=r.getBoundingClientRect();(a.width||a.height)&&(n=Math.max(n,a.bottom));continue}if(i.nodeType!==1)continue;let o=O(i);if(o.display==="none")continue;let s=o.position;s==="absolute"||s==="fixed"||o.float&&o.float!=="none"||(n=Math.max(n,i.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-e}function jc(t,e,n){if(Ft(t)&&t.style&&t.style.height)return;let r=t.tagName&&t.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r)||e.aspectRatio&&e.aspectRatio!=="none"&&e.aspectRatio!=="auto")return;let o=e.display||"";if(o.includes("flex")||o.includes("grid"))return;let s=e.position;if(s==="absolute"||s==="fixed"||s==="sticky"||e.transform!=="none"||Uc(e)||gi(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"||!Hc(t))return;let l=parseFloat(e.height),u=zc(t);Number.isFinite(l)&&Number.isFinite(u)&&Math.abs(l-u)>2||(delete n.height,delete n["block-size"])}me();var Vc=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]),Wr=new WeakMap,yi=-1;function wn(t){let e=Jt();return e!==yi&&(Wr=new WeakMap,yi=e),bi(t)}function bi(t){let e=Wr.get(t);if(e!==void 0)return e;let n;if(t.namespaceURI==="http://www.w3.org/2000/svg"&&(t.localName==="mask"||t.localName==="clipPath"?n=!1:Vc.has(t.localName)&&(n=!0)),n===void 0){let r=t.parentNode;n=!!(r&&r.nodeType===1)&&bi(r)}return Wr.set(t,n),n}function wi(t,e){if(t?.nodeType!==1||e?.nodeType!==1||wn(t))return;let n=t.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(a&&typeof a.value=="string"&&!a.value.startsWith("data:")&&a.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(t)}catch{}if(r){let o=t.style;if(o&&o.length){let s=new Set;for(let a=0;a<o.length;a++){let c=o[a];if(s.has(c))continue;s.add(c);let f=o.getPropertyValue(c);if(!f||!f.includes("var("))continue;let l=i&&i.getPropertyValue(c);if(l)try{e.style.setProperty(c,l.trim(),o.getPropertyPriority(c))}catch{}}}}if(r&&t.attributes?.length){let o=t.attributes;for(let s=0;s<o.length;s++){let a=o[s];if(!a||typeof a.value!="string"||a.value.startsWith("data:")||!a.value.includes("var("))continue;let c=a.name,f=i&&i.getPropertyValue(c);if(f)try{e.style.setProperty(c,f.trim())}catch{}}}}ut();ut();lt();fe();wt();function xe(t){return!!(!t||t.startsWith("data:")||t.startsWith("blob:"))}function ve(t,e){if(!t)return null;let n=0;try{n=e?e.getBoundingClientRect().width||e.width:0}catch{}n||(n=window.innerWidth||1e3);let r=[];for(let o of t.split(",")){let s=o.trim().split(/\s+/);if(!s[0])continue;let a=s[1]||"",c=1;/^\d*\.?\d+x$/i.test(a)?c=parseFloat(a):/^\d+w$/i.test(a)&&(c=parseInt(a,10)/n),r.push({url:s[0],d:c})}if(!r.length)return null;r.sort((o,s)=>o.d-s.d);let i=window.devicePixelRatio||1;return(r.find(o=>o.d>=i)||r[r.length-1]).url}function Si(t,e){let n=t.currentSrc||"";if(n&&!xe(n))return n;let r=e.querySelectorAll("source[srcset]"),i=null;for(let o of r){let s=o.getAttribute("srcset");if(!s||xe(s))continue;let a=o.getAttribute("type");if(a&&!fr.test(a.trim()))continue;let c=o.getAttribute("media");if(c)try{if(window.matchMedia(c).matches)return ve(s,t)}catch{}i||(i=ve(s,t))}return i}function xi(t){let e=[t.getAttribute("data-src"),t.getAttribute("data-lazy-src"),t.getAttribute("data-original"),t.getAttribute("data-hi-res-src")];for(let r of e)if(r&&!xe(r))return r;let n=t.getAttribute("data-srcset")||t.getAttribute("data-lazy-srcset");if(n){let r=n.split(",")[0].trim().split(/\s+/)[0];if(r&&!xe(r))return r}return null}mt();function qc(t,e){if(t=t.trim(),!t)return t;let n=e?`[data-sd-slotted~="${e}"]`:"[data-sd-slotted]";return t.endsWith(":not([data-sd-slotted])")||t.endsWith(`:not(${n})`)?t:`${t}:not(${n})`}var Gc=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,Xc=/^::?(?:before|after|first-letter)$/;function Yc(t,e,n=!0,r){return t.split(",").map(i=>i.trim()).filter(Boolean).map(i=>{if(i.startsWith(":where(")&&i.includes("data-sd")||i.startsWith("@"))return i;let o=i.match(Gc);if(o&&Xc.test(o[0]))return":not(*)";let s=o?i.slice(0,o.index).trim():i,a=n?qc(s,r):s;return`:where(${e} ${a})${o?o[0]:""}`}).join(", ")}function ki(t,e,n){return t?(t=t.replace(/:host-context\(([^)]+)\)/g,(r,i)=>`:where(:where(${i.trim()}) ${e})`),t=t.replace(/:host\(([^)]+)\)/g,(r,i)=>`:where(${e}:is(${i.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(r,i)=>`:where(${e} ${i.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(r,i,o,s)=>{let a=Yc(s,e,!0,n);return`${i}${o}${a}{`}),t):""}function Ci(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function ee(t){let e="";for(let n of t)if(n.media&&n.cssRules){let r=!1;try{r=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}r&&(e+=ee(n.cssRules))}else if(n.constructor?.name==="CSSSupportsRule")e+=`@supports ${n.conditionText}{${ee(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let r=n.cssText.slice(0,n.cssText.indexOf("{")+1);e+=r+(n.style?n.style.cssText:"")+ee(n.cssRules)+"}"}else e+=n.cssText+`
|
|
9
|
+
`;return e}function Ai(t){let e="";try{t.querySelectorAll("style").forEach(r=>{let i=null;try{i=r.sheet&&r.sheet.cssRules}catch{}e+=(i?ee(i):r.textContent||"")+`
|
|
10
|
+
`});let n=t.adoptedStyleSheets||[];for(let r of n)try{r&&r.cssRules&&(e+=ee(r.cssRules))}catch{}}catch{}return e}function Mi(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function Ei(t,e,n={}){try{let r=null,i=O(t).content;if(i&&i.includes("url(")){let f=i.match(/url\(["']?([^"')]+)["']?\)/);f&&(r=f[1])}let o=t.closest?.("picture"),s=t.getAttribute("src")||"",a=t.getAttribute("srcset")||"",c=r||(o?Si(t,o):!a.trim()&&s.startsWith("data:")?s:t.currentSrc)||ve(a,t)||t.src||"";if((!c||xe(c))&&n.resolvePicturePlaceholders!==!1){let f=xi(t);f&&(c=f)}if(!c)return;e.getAttribute("src")!==c&&e.setAttribute("src",c),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function _i(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function Kc(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch{}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch{}return""}function Ri(t,e,n){let r=[];for(let i of e){let o=Kc(t,i);o&&r.push(`${i}: ${o};`)}return r.length?`${n}{${r.join("")}}
|
|
11
|
+
`:""}function Fi(t,e){if(!t)return;let n=r=>{let i=r.getAttribute("data-sd-slotted")||"";e?` ${i} `.includes(` ${e} `)||r.setAttribute("data-sd-slotted",i?`${i} ${e}`:e):r.setAttribute("data-sd-slotted",i)};t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll?.("*").forEach(n)}async function Qc(t,e=3){let n=()=>{try{return t.contentDocument||t.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<e&&(!r||!r.body&&!r.documentElement);)await new Promise(o=>setTimeout(o,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function Jc(t){let e=t.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,r=parseFloat(c.borderRightWidth)||0,i=parseFloat(c.borderTopWidth)||0,o=parseFloat(c.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+r))),a=Math.max(0,Math.round(e.height-(i+o)));return{contentWidth:s,contentHeight:a,rect:e}}function dt(t){let e=0,n=0;if(t.offsetWidth>0&&(e=t.offsetWidth),t.offsetHeight>0&&(n=t.offsetHeight),e===0||n===0)try{let r=getComputedStyle(t);if(e===0){let i=parseFloat(r.width);!isNaN(i)&&i>0&&(e=i)}if(n===0){let i=parseFloat(r.height);!isNaN(i)&&i>0&&(n=i)}}catch{}if(e===0||n===0)try{if(e===0){let r=parseFloat(t.getAttribute("width"));!isNaN(r)&&r>0&&(e=r)}if(n===0){let r=parseFloat(t.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((e===0||n===0)&&(t.naturalWidth||t.naturalHeight))try{e===0&&t.naturalWidth>0&&(e=t.naturalWidth),n===0&&t.naturalHeight>0&&(n=t.naturalHeight)}catch{}return{width:e,height:n}}function Zc(t,e,n){let r=t.defaultView,i=r?r.scrollX:0,o=r?r.scrollY:0,s=t.body?t.body.scrollLeft:0,a=t.body?t.body.scrollTop:0,c=t.documentElement?t.documentElement.scrollLeft:0,f=t.documentElement?t.documentElement.scrollTop:0,l=0,u=0,p=0,m=0;try{let h=r&&t.body?r.getComputedStyle(t.body):null;h&&(l=(parseFloat(h.marginTop)||0)+(parseFloat(h.paddingTop)||0),u=(parseFloat(h.marginRight)||0)+(parseFloat(h.paddingRight)||0),p=(parseFloat(h.marginBottom)||0)+(parseFloat(h.paddingBottom)||0),m=(parseFloat(h.marginLeft)||0)+(parseFloat(h.paddingLeft)||0))}catch{}let d=t.createElement("style");if(d.setAttribute("data-sd-iframe-pin",""),Q(d),d.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 ${u}px ${p}px ${m}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(d),Zt(t.documentElement),i||o)try{t.body&&(t.body.scrollLeft=i,t.body.scrollTop=o),t.documentElement&&(t.documentElement.scrollLeft||(t.documentElement.scrollLeft=i),t.documentElement.scrollTop||(t.documentElement.scrollTop=o))}catch{}return()=>{try{d.remove()}catch{}try{r&&typeof r.scrollTo=="function"&&r.scrollTo(i,o),t.body&&(t.body.scrollLeft=s,t.body.scrollTop=a),t.documentElement&&(t.documentElement.scrollLeft=c,t.documentElement.scrollTop=f)}catch{}Zt(t.documentElement)}}async function Or(t,e,n){let r=await Qc(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:s}=Jc(t),a=n?.snap;if(!a||typeof a.toPng!="function")throw new Error("[snapdom] iframe capture requires the snapdom entrypoints on options.snap \u2014 capture through snapdom(el) (set automatically) or pass options.snap.");let c={...n,scale:1,clip:null,__pinned:!0},f=Zc(r,i,o),l;try{l=await a.toPng(r.documentElement,c)}finally{f()}l.style.display="block",l.style.width=`${i}px`,l.style.height=`${o}px`;let u=document.createElement("div");return e.nodeMap.set(u,t),at(t,u,e,n),u.style.overflow="hidden",u.style.display="block",u.style.width||(u.style.width=`${Math.round(s.width)}px`),u.style.height||(u.style.height=`${Math.round(s.height)}px`),u.appendChild(l),u}function Ti(t){try{let e=t&&t.accentColor;if(e&&e!=="auto"&&e!=="none")return e;let n=t&&t.color;if(n)return n}catch{}return"#0a6ed1"}function $i(t){let{width:e,height:n}=dt(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Number.isFinite(o)&&o>0?o:e||r.width||128,c=Number.isFinite(s)&&s>0?s:n||r.height||16,f=Number.parseFloat(t.min)||0,l=Number.isFinite(Number.parseFloat(t.max))?Number.parseFloat(t.max):100,u=Number.parseFloat(t.value),p=l-f,m=p>0&&Number.isFinite(u)?Math.min(1,Math.max(0,(u-f)/p)):.5,d="middle";try{i&&i.verticalAlign&&(d=i.verticalAlign)}catch{}let h=document.createElement("div");h.setAttribute("data-snapdom-input-replacement","range"),h.style.cssText=`display:inline-block;width:${a}px;height:${c}px;vertical-align:${d};flex-shrink:0;line-height:0;`;let g=document.createElementNS("http://www.w3.org/2000/svg","svg");g.setAttribute("width",String(a)),g.setAttribute("height",String(c)),g.setAttribute("viewBox",`0 0 ${a} ${c}`),g.style.overflow="visible",h.appendChild(g);function y(){let b=Ti(i),w=!!t.disabled,C=Math.max(2,Math.min(4,c)),x=(c-C)/2,S=Math.max(10,Math.min(14,Math.max(c,10))),A=S/2,v=A+m*Math.max(0,a-S);g.innerHTML="";let M=(R,E,T,N)=>{let B=document.createElementNS("http://www.w3.org/2000/svg","rect");B.setAttribute("x",String(R)),B.setAttribute("y",String(x)),B.setAttribute("width",String(Math.max(0,E))),B.setAttribute("height",String(C)),B.setAttribute("rx",String(C/2)),B.setAttribute("fill",T),N&&B.setAttribute("fill-opacity",N),g.appendChild(B)};M(0,a,"#808080","0.4"),M(0,v,b);let k=document.createElementNS("http://www.w3.org/2000/svg","circle");k.setAttribute("cx",String(v)),k.setAttribute("cy",String(c/2)),k.setAttribute("r",String(A)),k.setAttribute("fill",b),g.appendChild(k),w&&g.setAttribute("opacity","0.5"),h.style.setProperty("width",`${a}px`,"important"),h.style.setProperty("height",`${c}px`,"important"),h.style.setProperty("min-width",`${a}px`,"important"),h.style.setProperty("min-height",`${c}px`,"important")}return y(),{el:h,applyVisual:y}}function Pi(t){let{width:e,height:n}=dt(t),r=t.getBoundingClientRect(),i;try{i=window.getComputedStyle(t)}catch{}let o=i?parseFloat(i.width):NaN,s=i?parseFloat(i.height):NaN,a=Math.round(e||r.width||0),c=Math.round(n||r.height||0),f=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,a||16),l=Number.isFinite(s)&&s>0?Math.round(s):Math.max(12,c||16),u=(t.type||"text").toLowerCase()==="checkbox",p=!!t.checked,m=!!t.indeterminate,h=Math.max(Math.min(f,l),12),g="middle";try{i&&i.verticalAlign&&(g=i.verticalAlign)}catch{}let y=document.createElement("div");y.setAttribute("data-snapdom-input-replacement",t.type||"checkbox"),y.style.cssText=`display:inline-block;width:${h}px;height:${h}px;vertical-align:${g};flex-shrink:0;line-height:0;`;let b=document.createElementNS("http://www.w3.org/2000/svg","svg");b.setAttribute("width",String(h)),b.setAttribute("height",String(h)),b.setAttribute("viewBox",`0 0 ${h} ${h}`),y.appendChild(b);function w(){let C=Ti(i),x=2,S=x/2,A=h-x;if(b.innerHTML="",u){let v=document.createElementNS("http://www.w3.org/2000/svg","rect");if(v.setAttribute("x",String(S)),v.setAttribute("y",String(S)),v.setAttribute("width",String(A)),v.setAttribute("height",String(A)),v.setAttribute("rx","2"),v.setAttribute("ry","2"),v.setAttribute("fill",p?C:"none"),v.setAttribute("stroke",C),v.setAttribute("stroke-width",String(x)),b.appendChild(v),p){let M=document.createElementNS("http://www.w3.org/2000/svg","path");M.setAttribute("d",`M ${S+2} ${h/2} L ${h/2-1} ${h-S-2} L ${h-S-2} ${S+2}`),M.setAttribute("stroke","white"),M.setAttribute("stroke-width",String(Math.max(1.5,x))),M.setAttribute("fill","none"),M.setAttribute("stroke-linecap","round"),M.setAttribute("stroke-linejoin","round"),b.appendChild(M)}else if(m){let M=document.createElementNS("http://www.w3.org/2000/svg","rect"),k=Math.max(6,A-4);M.setAttribute("x",String((h-k)/2)),M.setAttribute("y",String((h-x)/2)),M.setAttribute("width",String(k)),M.setAttribute("height",String(x)),M.setAttribute("fill",C),M.setAttribute("rx","1"),b.appendChild(M)}}else{let v=document.createElementNS("http://www.w3.org/2000/svg","circle");if(v.setAttribute("cx",String(h/2)),v.setAttribute("cy",String(h/2)),v.setAttribute("r",String((h-x)/2)),v.setAttribute("fill",p?C:"none"),v.setAttribute("stroke",C),v.setAttribute("stroke-width",String(x)),b.appendChild(v),p){let M=document.createElementNS("http://www.w3.org/2000/svg","circle"),k=Math.max(2,(h-x*2)*.35);M.setAttribute("cx",String(h/2)),M.setAttribute("cy",String(h/2)),M.setAttribute("r",String(k)),M.setAttribute("fill","white"),b.appendChild(M)}}y.style.setProperty("width",`${h}px`,"important"),y.style.setProperty("height",`${h}px`,"important"),y.style.setProperty("min-width",`${h}px`,"important"),y.style.setProperty("min-height",`${h}px`,"important")}return w(),{el:y,applyVisual:w}}var Ze=new rt(80);async function tl(t){if(P.resource?.has(t))return P.resource.get(t);if(Ze.has(t))return Ze.get(t);let e=(async()=>{let n=await ot(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return P.resource?.set(t,n.data),n.data})();Ze.set(t,e);try{let n=await e;return Ze.set(t,n),n}catch(n){throw Ze.delete(t),n}}var vi=/\bblob:[^)"'\s]+/g;function Sn(t){return typeof t=="string"&&t.startsWith("blob:")}function el(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 nl(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function tn(t,e){let n=t.querySelectorAll?Array.from(t.querySelectorAll(e)):[];return t.matches?.(e)&&n.unshift(t),n}async function xn(t,e=null){if(!t)return;let n=e,r=new Set,i=[],o=new Map,s=(h,g,y,b)=>{r.add(y),i.push(()=>{o.has(y)&&(h.setAttribute(g,o.get(y)),b?.())})},a=(h,g)=>{if(!h||!h.includes("blob:"))return;let y=h.match(vi)||[];if(y.length){for(let b of y)r.add(b);i.push(()=>{let b=h.replace(vi,w=>o.get(w)||w);b!==h&&g(b)})}},c=tn(t,"img");for(let h of c)try{let y=h.getAttribute("src")||h.currentSrc||"";Sn(y)&&s(h,"src",y);let b=h.getAttribute("srcset");if(b&&b.includes("blob:")){let w=el(b);for(let C of w)Sn(C.url)&&r.add(C.url);i.push(()=>{let C=!1;for(let x of w)o.has(x.url)&&(x.url=o.get(x.url),C=!0);C&&h.setAttribute("srcset",nl(w))})}}catch(g){U(n,"resolveBlobUrls for img failed",g)}let f=tn(t,"image");for(let h of f)try{let g="http://www.w3.org/1999/xlink",y=h.getAttribute("href")||h.getAttributeNS?.(g,"href");Sn(y)&&s(h,"href",y,()=>h.removeAttributeNS?.(g,"href"))}catch(g){U(n,"resolveBlobUrls for SVG image href failed",g)}let l=tn(t,"[style*='blob:']");for(let h of l)try{let g=h.getAttribute("style");a(g,y=>h.setAttribute("style",y))}catch(g){U(n,"replaceBlobUrls in inline style failed",g)}let u=tn(t,"style");for(let h of u)try{let g=h.textContent||"";a(g,y=>{h.textContent=y})}catch(g){U(n,"replaceBlobUrls in style tag failed",g)}let p=["poster"];for(let h of p){let g=tn(t,`[${h}^='blob:']`);for(let y of g)try{let b=y.getAttribute(h);Sn(b)&&s(y,h,b)}catch(b){U(n,`resolveBlobUrls for ${h} failed`,b)}}if(!r.size)return;let m=[...r],d=0;await Promise.all(Array.from({length:Math.min(4,m.length)},async()=>{for(;d<m.length;){let h=m[d++];try{o.set(h,await tl(h))}catch(g){U(n,"blobUrlToDataUrl failed; keeping original URL",g)}}}));for(let h of i)try{h()}catch(g){U(n,"resolved blob URL write failed",g)}}St();var Ni=new Set(["rgba(0, 0, 0, 0)","transparent"]),Dr="Highlight";function Li(t){let n=(t.ownerDocument||document).getSelection?.();if(!n||n.isCollapsed||n.rangeCount===0)return null;let r=[];for(let i=0;i<n.rangeCount;i+=1){let o=n.getRangeAt(i);if(!o.collapsed)try{o.intersectsNode(t)&&r.push(o)}catch{}}return r.length?{ranges:r,styles:new Map}:null}function rl(t,e){if(e.styles.has(t))return e.styles.get(t);let n;try{let r=getComputedStyle(t);if(r.userSelect==="none"||r.webkitUserSelect==="none"||r.getPropertyValue("-webkit-user-select")==="none")return e.styles.set(t,null),null;let i=getComputedStyle(t,"::selection"),o=[],s=i.backgroundColor,a=s&&!Ni.has(s)&&s!==r.backgroundColor;o.push(`background-color:${a?s:Dr}`),i.color&&i.color!==r.color&&o.push(`color:${i.color}`,`-webkit-text-fill-color:${i.color}`),i.textShadow&&i.textShadow!==r.textShadow&&o.push(`text-shadow:${i.textShadow}`),i.textDecorationLine&&i.textDecorationLine!=="none"&&i.textDecorationLine!==r.textDecorationLine&&o.push(`text-decoration:${i.textDecorationLine} ${i.textDecorationStyle||"solid"} ${i.textDecorationColor||"currentcolor"}`),n=o.join(";")}catch{n=`background-color:${Dr}`}return e.styles.set(t,n),n}function Ii(t,e){let n=t.data;if(!n)return null;let r=t.parentElement;if(!r)return null;let i=[];for(let f of e.ranges){let l=!1;try{l=f.intersectsNode(t)}catch{}if(!l)continue;let u=f.startContainer===t?f.startOffset:0,p=f.endContainer===t?f.endOffset:n.length;p>u&&i.push([u,p])}if(i.length===0)return null;let o=rl(r,e);if(!o)return null;i.sort((f,l)=>f[0]-l[0]);let s=t.ownerDocument||document,a=s.createDocumentFragment(),c=0;for(let[f,l]of i){f>c&&a.append(s.createTextNode(n.slice(c,f)));let u=s.createElement("span");u.setAttribute("data-snapdom-selection",""),u.setAttribute("style",`all:unset;${o}`),u.textContent=n.slice(f,l),a.append(u),c=l}return c<n.length&&a.append(s.createTextNode(n.slice(c))),a}var vn=t=>Number.parseFloat(t)||0,ol=["font-family","font-size","font-weight","font-style","font-variant","font-stretch","letter-spacing","word-spacing","text-transform","text-indent","text-align","line-height","tab-size","direction"];function il(t,e){try{let r=getComputedStyle(t,"::selection").backgroundColor;if(r&&!Ni.has(r)&&r!==e.backgroundColor)return r}catch{}return Dr}function Wi(t,e){let n=t.ownerDocument||document;if(n.activeElement!==t)return;let r=null,i=null;try{r=t.selectionStart,i=t.selectionEnd}catch{return}if(r==null||i==null||r===i)return;let o=t.value||"";if(t.localName==="input"&&t.type==="password"&&(o="\u2022".repeat(o.length)),!o)return;let s=getComputedStyle(t),a=t.localName==="textarea",c=vn(s.paddingLeft),f=vn(s.paddingTop),l=t.clientWidth-c-vn(s.paddingRight),u=t.clientHeight-f-vn(s.paddingBottom),p=n.createElement("div");p.style.cssText="position:absolute;top:0;left:-99999px;visibility:hidden;margin:0;border:0;padding:0;box-sizing:content-box;";for(let g of ol)p.style.setProperty(g,s.getPropertyValue(g));a?(p.style.whiteSpace="pre-wrap",p.style.overflowWrap="break-word",p.style.width=`${Math.max(0,l)}px`):p.style.whiteSpace="pre";let m=n.createElement("span");m.textContent=o.slice(r,i),p.append(n.createTextNode(o.slice(0,r)),m,n.createTextNode(o.slice(i))),n.body.appendChild(p);let d=[];try{let g=p.getBoundingClientRect(),y=-t.scrollLeft,b=-t.scrollTop;if(!a){b+=Math.max(0,(u-g.height)/2);let w=s.direction==="rtl",C=s.textAlign;C==="start"?C=w?"right":"left":C==="end"&&(C=w?"left":"right");let x=l-g.width;x>0&&(C==="right"?y+=x:C==="center"&&(y+=x/2))}for(let w of m.getClientRects())w.width<=0||w.height<=0||d.push({x:c+(w.left-g.left)+y,y:f+(w.top-g.top)+b,width:w.width,height:w.height})}finally{p.remove()}if(d.length===0)return;let h=il(t,s);e.__snapdomFieldSelection={images:d.map(()=>`linear-gradient(${h},${h})`),positions:d.map(g=>`${g.x}px ${g.y}px`),sizes:d.map(g=>`${g.width}px ${g.height}px`),repeats:d.map(()=>"no-repeat"),origins:d.map(()=>"padding-box"),clips:d.map(()=>"padding-box"),base:{image:s.backgroundImage,position:s.backgroundPosition,size:s.backgroundSize,repeat:s.backgroundRepeat,origin:s.backgroundOrigin,clip:s.backgroundClip}}}function Oi(t){for(let e of t.keys()){let n=e.__snapdomFieldSelection;if(!n)continue;delete e.__snapdomFieldSelection;let{images:r,positions:i,sizes:o,repeats:s,origins:a,clips:c,base:f}=n,l=e.style.backgroundImage||f.image;l&&l!=="none"?(r.push(l),i.push(e.style.backgroundPosition||f.position),o.push(e.style.backgroundSize||f.size),s.push(e.style.backgroundRepeat||f.repeat),a.push(e.style.backgroundOrigin||f.origin),c.push(e.style.backgroundClip||f.clip)):(r.push("linear-gradient(transparent,transparent)"),i.push("0% 0%"),o.push("auto"),s.push("repeat"),a.push(f.origin||"padding-box"),c.push(f.clip||"border-box")),e.style.backgroundImage=r.join(","),e.style.backgroundPosition=i.join(","),e.style.backgroundSize=o.join(","),e.style.backgroundRepeat=s.join(","),e.style.backgroundOrigin=a.join(","),e.style.backgroundClip=c.join(",")}}mt();var Br=new Map,Di=new Set(["IFRAME"]);function ke(t,e){Br.set(String(t).toUpperCase(),e)}function kn(t){let e=O(t),n=e.display;if(n==="none")return null;let r=/^(block|inline-block|flow-root|flex|inline-flex|grid|inline-grid|list-item)$/.test(n),i=m=>parseFloat(m)||0,o=(m,d,h,g,y)=>{if(!r||!m?.endsWith("px"))return null;let b=parseFloat(m);if(!Number.isFinite(b)||b<0)return null;if(e.boxSizing==="border-box")return b;let w=g-y-h;return b+d+h+(w>0&&b+d<y+w/2?w:0)},[s,a,c,f]=/scroll|auto/.test(e.overflow)?[t.offsetWidth,t.clientWidth,t.offsetHeight,t.clientHeight]:[0,0,0,0],l=o(e.width,i(e.paddingLeft)+i(e.paddingRight),i(e.borderLeftWidth)+i(e.borderRightWidth),s,a),u=o(e.height,i(e.paddingTop)+i(e.paddingBottom),i(e.borderTopWidth)+i(e.borderBottomWidth),c,f);if(l===null||u===null){let{width:m,height:d}=dt(t),h=m,g=d;if(l===null&&!h||u===null&&!g){let y=t.getBoundingClientRect();h||=y.width||0,g||=y.height||0}l??=h,u??=g}let p=document.createElement("div");return p.style.cssText=`display:${n==="inline"?"inline-block":n};box-sizing:border-box;width:${l}px;height:${u}px;visibility:hidden;`,p}var Cn=200,sl=new Set(["img","canvas","video","iframe","object","embed"]);function Bi(t,e){return t.right>=e.left-Cn&&t.left<=e.right+Cn&&t.bottom>=e.top-Cn&&t.top<=e.bottom+Cn}function al(t,e){if(t===e.root)return!1;let n;try{n=t.getBoundingClientRect()}catch{return!1}if(n.width===0&&n.height===0)return!1;let r=O(t);if(r.display==="inline"&&!sl.has((t.localName||"").toLowerCase()))return!1;let i=e.rect,o=t.scrollWidth||0,s=t.scrollHeight||0,a={left:r.direction==="rtl"?Math.min(n.left,n.right-o):n.left,top:n.top,right:Math.max(n.right,n.left+o),bottom:Math.max(n.bottom,n.top+s)},c=r.writingMode||"";if((c.startsWith("vertical")||c.startsWith("sideways"))&&(a.top=Math.min(n.top,n.bottom-s),a.left=Math.min(a.left,n.right-o)),Bi(a,i))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)&&Bi(l,i))return!1}return!0}function cl(t,e,n){let r=t.cloneNode(!1);t.tagName==="IMG"&&(r.removeAttribute("src"),r.removeAttribute("srcset"),r.removeAttribute("sizes")),at(t,r,e,n);let{width:i,height:o}=dt(t);i>0&&(r.style.width=`${i}px`,r.style.minWidth=`${i}px`,r.style.maxWidth=`${i}px`),o>0&&(r.style.height=`${o}px`,r.style.minHeight=`${o}px`,r.style.maxHeight=`${o}px`),r.style.visibility="hidden";let s=t.parentElement?O(t.parentElement).display:"",a=O(t).position;if(!/flex|grid|table/.test(s)&&(a==="static"||a==="relative")){let c=p=>{let m=O(p);return m.display!=="none"&&m.position!=="absolute"&&m.position!=="fixed"},f=t.getBoundingClientRect(),l=t.previousElementSibling;for(;l&&!c(l);)l=l.previousElementSibling;if(l){let p=f.top-l.getBoundingClientRect().bottom;p>=0&&(r.style.marginTop=`${p}px`)}let u=t.nextElementSibling;for(;u&&!c(u);)u=u.nextElementSibling;if(u){let p=u.getBoundingClientRect().top-f.bottom;p>=0&&(r.style.marginBottom=`${p}px`)}}return r.style.boxSizing="border-box",r}async function ne(t,e,n){if(!t)throw new Error("Invalid node");let r=new Set,i=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let l=(t.localName||t.tagName||"").toLowerCase(),u=Wt(t);if(u&&(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox"))||t!==n.element&&u||Sr.has(l))return null;if(l==="foreignobject"&&t.parentElement?.closest?.("foreignObject"))return U(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){if(e.selection){let l=Ii(t,e.selection);if(l)return l}return t.cloneNode(!0)}if(t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide")return kn(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 kn(t);if(n.excludeMode==="remove")return null}}catch(u){console.warn(`Invalid selector in exclude option: ${l}`,u)}if(n.excludePredicates)for(let l of n.excludePredicates)try{if(l(t))return n.excludeMode==="remove"?null:kn(t)}catch(u){console.warn("Error in exclude predicate:",u)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide")return kn(t);if(n.filterMode==="remove")return null}}catch(l){console.warn("Error in filter function:",l)}if(e.clip&&al(t,e.clip))return cl(t,e,n);if(n.__resolveNodeHooks)for(let l of n.__resolveNodeHooks){let u;try{u=await l(t,n)}catch(p){U(e,"resolveNode plugin hook failed",p)}if(u===null)return null;if(u?.nodeType)return u.nodeType===Node.ELEMENT_NODE&&(e.nodeMap.set(u,t),at(t,u,e,n)),u}{let l=Di.has(t.tagName)&&Br.get(t.tagName);if(l){let u=await l(t,e,n);if(u!==void 0)return u}}if(t.getAttribute("data-capture")==="placeholder"){let l=t.cloneNode(!1);e.nodeMap.set(l,t),at(t,l,e,n);let u=document.createElement("div");return u.textContent=t.getAttribute("data-placeholder-text")||"",u.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",l.appendChild(u),l}{let l=!Di.has(t.tagName)&&Br.get(t.tagName);if(l){let u=await l(t,e,n);if(u!==void 0)return u}}let s;try{if(s=t.cloneNode(!1),wi(t,s),e.nodeMap.set(s,t),t.tagName==="IMG"){Ei(t,s,n);try{let{width:l,height:u}=dt(t),p=Math.round(l||0),m=Math.round(u||0);p&&(s.dataset.snapdomWidth=String(p)),m&&(s.dataset.snapdomHeight=String(m))}catch(l){U(e,"getUnscaledDimensions for IMG failed",l)}try{let l=t.getAttribute("style")||"",u=window.getComputedStyle(t),p=x=>{let S=l.match(new RegExp(`${x}\\s*:\\s*([^;]+)`,"i")),A=S?S[1].trim():u.getPropertyValue(x);return/%|auto/i.test(String(A||""))},m=x=>parseFloat(u.getPropertyValue(x))||0,d=u.getPropertyValue("box-sizing")==="border-box",h=parseInt(s.dataset.snapdomWidth||"0",10)-(d?0:m("padding-left")+m("padding-right")+m("border-left-width")+m("border-right-width")),g=parseInt(s.dataset.snapdomHeight||"0",10)-(d?0:m("padding-top")+m("padding-bottom")+m("border-top-width")+m("border-bottom-width")),y=p("width")||!(h>0),b=p("height")||!(g>0);y&&h>0&&(s.style.width=`${h}px`),b&&g>0&&(s.style.height=`${g}px`);let w=u.getPropertyValue("object-fit"),C=u.getPropertyValue("object-position");w&&w!=="fill"?(s.style.objectFit=w,C&&(s.style.objectPosition=C)):(h>0&&(s.style.minWidth=`${h}px`),g>0&&(s.style.minHeight=`${g}px`))}catch(l){U(e,"IMG dimension freeze failed",l)}}}catch(l){throw console.error("[Snapdom] Failed to clone node:",t,l),l}let a=null;if(nt(t,"textarea")){let{width:l,height:u}=dt(t),p=l||t.getBoundingClientRect().width||0,m=u||t.getBoundingClientRect().height||0;p&&(s.style.width=`${p}px`),m&&(s.style.height=`${m}px`)}if(nt(t,"input")){let l=(t.type||"text").toLowerCase();if((l==="checkbox"||l==="radio")&&(Dt()||t.indeterminate)){let{el:p,applyVisual:m}=Pi(t);e.nodeMap.set(p,t),a=m,s=p}else if(l==="range"&&(Dt()||X())){let{el:p,applyVisual:m}=$i(t);e.nodeMap.set(p,t),a=m,s=p}else if(l==="color"&&X()){let p=s,m=t.value||"#000000";a=()=>{p.style.setProperty("background-color",m,"important"),p.style.setProperty("color","transparent","important"),p.style.setProperty("-webkit-text-fill-color","transparent","important"),p.style.setProperty("appearance","none","important"),p.style.setProperty("-webkit-appearance","none","important")},p.removeAttribute("value")}else if((l==="date"||l==="time"||l==="datetime-local")&&(Dt()||X())){s.setAttribute("type","text");let p=t.value;l==="date"&&t.valueAsDate&&(p=t.valueAsDate.toLocaleDateString(void 0,{timeZone:"UTC"})),s.value=p,s.setAttribute("value",p)}else{let p=je(t)?pr(t.value):t.value;s.value=p,s.setAttribute("value",p),t.checked!==void 0&&(s.checked=t.checked,t.checked?s.setAttribute("checked",""):s.removeAttribute("checked"),t.indeterminate&&(s.indeterminate=t.indeterminate))}}if((nt(t,"input")||nt(t,"textarea"))&&!t.value&&t.placeholder)try{let l=window.getComputedStyle(t,"::placeholder"),u=l&&l.color;if(u&&u!=="rgba(0, 0, 0, 0)"){let p="snapdom-ph-"+(Math.random()*1e6|0);s.classList.add(p);let m=document.createElement("style");m.textContent=`.${p}::placeholder{color:${u}!important;opacity:${l.opacity||"1"}!important;-webkit-text-fill-color:${u}!important;}`,s.prepend(m)}}catch{}if(nt(t,"select")&&(i=new Set(Array.from(t.options).filter(l=>l.selected))),nt(t,"textarea")&&(o=t.value),nt(t,"input")||nt(t,"textarea")||nt(t,"select")){t.disabled&&s.setAttribute("disabled",""),t.required&&s.setAttribute("required",""),t.readOnly&&s.setAttribute("readonly","");let l=t;l.min!==void 0&&l.min!==""&&s.setAttribute("min",l.min),l.max!==void 0&&l.max!==""&&s.setAttribute("max",l.max),l.pattern!==void 0&&l.pattern!==""&&s.setAttribute("pattern",l.pattern);let u=t.getAttribute("aria-invalid");u!==null&&s.setAttribute("aria-invalid",u)}if(wn(t)||at(t,s,e,n),a&&a(),n.captureSelection&&(nt(t,"input")||nt(t,"textarea")))try{Wi(t,s)}catch(l){U(e,"inlineTextFieldSelection failed",l)}if(It(t)&&!wn(t)){let l=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display","color"];try{let u=window.getComputedStyle(t);for(let p of l){let m=u.getPropertyValue(p);m&&s.style.setProperty(p,m)}}catch{}}if(t.shadowRoot){Nr(t.shadowRoot);try{let b=t.shadowRoot.querySelectorAll("slot");for(let w of b){let C=w.assignedNodes?.()||[];for(let x of C)r.add(x)}}catch{}let l=Ci(e),u=`[data-sd="${l}"]`;e.shadowScopes||=new WeakMap,e.shadowScopes.set(t.shadowRoot,l);try{s.setAttribute("data-sd",l)}catch{}let p=Ai(t.shadowRoot);!e.__shadowPseudo&&/::?(?:before|after|first-l|marker)|counter/.test(p)&&(e.__shadowPseudo=!0);let m=ki(p,u,l),d=_i(p),h=Ri(t,d,u);Mi(s,h+m,l);let g=document.createDocumentFragment(),y=await Promise.all(Array.from(t.shadowRoot.childNodes).map(b=>b.nodeType===Node.ELEMENT_NODE&&b.tagName==="STYLE"?null:ne(b,e,n).catch(()=>null)));g.append(...y.filter(b=>!!b)),s.appendChild(g)}if(t.tagName==="SLOT"){let l=e.shadowScopes?.get(t.getRootNode()),u=t.assignedNodes?.()||[],p=u.length?t.assignedNodes?.({flatten:!0})||u:[],m=p.length?p:Array.from(t.childNodes),d=document.createDocumentFragment(),h=await Promise.all(m.map(g=>ne(g,e,n).then(y=>(y&&u.length&&Fi(y,l),y||null)).catch(()=>null)));return d.append(...h.filter(g=>!!g)),d}let c=l=>r.has(l)||t.shadowRoot&&!l.assignedSlot,f=await Promise.all(Array.from(t.childNodes).map(l=>c(l)?null:ne(l,e,n).catch(()=>null)));if(s.append(...f.filter(l=>!!l)),i&&nt(s,"select")){let l=!1;for(let u of s.options){let p=i.has(e.nodeMap.get(u));u.selected=p,p?u.setAttribute("selected",""):u.removeAttribute("selected"),l||=p}if(!l&&!s.multiple){let u=s.ownerDocument.createElement("option");u.hidden=!0,u.style.setProperty("display","none","important"),u.setAttribute("selected",""),u.value="",s.appendChild(u)}}return o!==null&&nt(s,"textarea")&&(s.textContent=o),s}async function ll(t,e,n){let r=!1;try{r=!!(t.contentDocument||t.contentWindow?.document)}catch(i){U(e,"iframe same-origin probe failed",i)}if(r)try{return await Or(t,e,n)}catch(i){console.warn("[SnapDOM] iframe rasterization failed, fallback:",i)}if(r||console.warn("[snapdom] cross-origin <iframe> skipped (its document cannot be read). Captured as a placeholder that keeps the frame's box; pass { placeholders: false } for an invisible spacer.",t),n.placeholders){let{width:i,height:o}=dt(t),s=document.createElement("div");return s.style.cssText=`width:${i}px;height:${o}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,at(t,s,e,n),s}else{let{width:i,height:o}=dt(t),s=document.createElement("div");return s.style.cssText=`display:inline-block;width:${i}px;height:${o}px;visibility:hidden;`,at(t,s,e,n),s}}function en(t){try{let e=Math.max(1,Math.min(32,t.width)),n=Math.max(1,Math.min(32,t.height)),r=document.createElement("canvas");r.width=e,r.height=n;let i=r.getContext("2d",{willReadFrequently:!0});if(!i)return!1;i.drawImage(t,0,0,e,n);let o=i.getImageData(0,0,e,n).data;for(let s=3;s<o.length;s+=4)if(o[s]!==0)return!1;return!0}catch{return!1}}var fl=.95;function ul(t,e,n){try{let r=t.getImageData(0,0,e,n).data;for(let i=3;i<r.length;i+=4)if(r[i]!==255)return!1;return!0}catch{return!1}}async function dl(t,e,n){let r="";try{let a=en(t);a&&(await ft(),a=en(t));let c=null;if(!a){c=t.getContext("2d",{willReadFrequently:!0});try{c&&c.getImageData(0,0,1,1)}catch{}X()&&await ft()}if(r=t.toDataURL("image/png"),!r||r==="data:,"){try{c&&c.getImageData(0,0,1,1)}catch{}if(await ft(),r=t.toDataURL("image/png"),!r||r==="data:,"){let f=document.createElement("canvas");f.width=t.width,f.height=t.height;let l=f.getContext("2d");l&&(l.drawImage(t,0,0),r=f.toDataURL("image/png"))}}}catch(a){U(e,"Canvas toDataURL failed, using empty/fallback",a)}n&&n.debug&&r&&en(t)&&U(e,"canvas is empty at capture time \u2014 capture it after its first frame is drawn",t);let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch(a){U(e,"img decoding/loading hints failed",a)}r&&(i.src=r),i.width=t.width,i.height=t.height;let{width:o,height:s}=dt(t);return o>0&&(i.style.width=`${o}px`),s>0&&(i.style.height=`${s}px`),e.nodeMap.set(i,t),at(t,i,e,n),i}async function pl(t,e,n){let r="",i=t.poster&&t.paused&&!t.currentTime&&!t.played.length,o=document.createElement("img");try{o.decoding="sync",o.loading="eager"}catch{}if(!i)try{let c=document.createElement("canvas");c.width=t.videoWidth||t.offsetWidth||320,c.height=t.videoHeight||t.offsetHeight||240;let f=c.getContext("2d");f&&(f.drawImage(t,0,0,c.width,c.height),r=c.toDataURL(ul(f,c.width,c.height)?"image/jpeg":"image/png",fl),(!r||r==="data:,")&&(r=""))}catch(c){U(e,"Video frame capture failed, using poster fallback",c)}r?o.src=r:t.poster&&(o.src=t.poster),o.width=t.videoWidth||t.offsetWidth||0,o.height=t.videoHeight||t.offsetHeight||0;let{width:s,height:a}=dt(t);return s>0&&(o.style.width=`${s}px`),a>0&&(o.style.height=`${a}px`),o.style.objectFit="contain",e.nodeMap.set(o,t),at(t,o,e,n),o}async function hl(t,e,n){if(!t.controls)return;let{width:r,height:i}=dt(t),o=Math.round(r||t.offsetWidth||300),s=Math.round(i||t.offsetHeight||54),a=s/2,c=Math.max(4,s*.16),f=s*.34,l=o-s*.34,u=f+c+s*.55,p=Math.max(0,l-s*.7-u),m=Math.max(9,Math.round(s*.24)),d=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${s}" viewBox="0 0 ${o} ${s}"><rect width="${o}" height="${s}" rx="${Math.min(s/2,10)}" fill="#f1f3f4"/><path d="M ${f} ${a-c} L ${f+c} ${a} L ${f} ${a+c} Z" fill="#5f6368"/><rect x="${u}" y="${a-1.5}" width="${p}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${u}" cy="${a}" r="${Math.max(3,s*.09)}" fill="#5f6368"/><text x="${l}" y="${a}" fill="#5f6368" font-family="sans-serif" font-size="${m}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,h=document.createElement("img");try{h.decoding="sync",h.loading="eager"}catch{}return h.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,h.width=o,h.height=s,h.style.width=`${o}px`,h.style.height=`${s}px`,e.nodeMap.set(h,t),at(t,h,e,n),h}async function Ui(t,e,n){let r=t.getAttribute("data")||t.getAttribute("src")||"",i=(t.getAttribute("type")||"").toLowerCase(),o=/^image\//.test(i)||/\.(png|jpe?g|gif|webp|avif|bmp|ico|svg)(\?|#|$)/i.test(r);if(r&&o){let a=document.createElement("img");try{a.decoding="sync",a.loading="eager"}catch{}a.src=r;let{width:c,height:f}=dt(t);return c>0&&(a.style.width=`${c}px`),f>0&&(a.style.height=`${f}px`),e.nodeMap.set(a,t),at(t,a,e,n),a}let s=null;try{s=t.contentDocument}catch{}if(s)try{let a=await Or(t,e,n);if(a)return a}catch{}r&&console.warn(`[snapdom] <${t.localName}> content could not be captured (${i||"unknown type"}): rendering its fallback children`)}ke("IFRAME",ll);ke("CANVAS",dl);ke("VIDEO",pl);ke("AUDIO",hl);ke("OBJECT",Ui);ke("EMBED",Ui);ut();wt();me();lt();mt();var ml=[/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],Ce=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{});function gl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hi(t){let e=Array.isArray(t)?t:t?[t]:[],n=[];for(let r of e)r instanceof RegExp?n.push(r):typeof r=="string"?n.push(new RegExp(gl(r),"i")):console.warn("[snapdom] Ignored invalid iconFont value:",r);return n}function vt(t,e){let n=typeof t=="string"?t:"";for(let r of ml)if(r.test(n))return!0;if(e){for(let r of e)if(r instanceof RegExp&&r.test(n))return!0}return!!(/icon/i.test(n)||/glyph/i.test(n)||/symbols/i.test(n)||/feather/i.test(n)||/fontawesome/i.test(n))}function Ur(t,e){if(typeof t!="string"||!t)return!1;let n;try{n=new URL(t,typeof location<"u"?location.href:void 0)}catch{return vt(t,e)}let r=n.searchParams.getAll("family").flatMap(i=>i.split("|")).map(i=>i.split(":")[0].trim()).filter(Boolean);return r.length?r.every(i=>vt(i,e)):vt(t,e)}function yl(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}var An=new Map;function bl(t=""){let e=Object.create(null),n=String(t||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)e[i[1].toUpperCase()]=Number(i[2]);return e}async function wl(t,e,n){let r=String(t||""),i=r.toLowerCase(),o=String(e||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),c="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?c="rounded":/\bsharp\b/.test(o)?c="sharp":/\boutlined\b/.test(o)&&(c="outlined");let f=a===1,l=null;if(f&&(c==="outlined"&&Ce.materialIconsFilled?l={url:Ce.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&Ce.materialIconsRound?l={url:Ce.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&Ce.materialIconsSharp&&(l={url:Ce.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!An.has(l.alias))try{let p=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});await p.load(),document.fonts.add(p),An.set(l.alias,!0)}catch{return An.set(l.alias,!1),{familyForMeasure:r,familyForCanvas:r}}if(An.get(l.alias)===!1)return{familyForMeasure:r,familyForCanvas:r};let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function Sl(t="Material Icons",e=24){try{await Promise.all([document.fonts.load(`400 ${e}px "${String(t).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function xl(t){let e=t.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(e)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!n&&e.toLowerCase()!=="currentcolor")return e;let r=t.color?.trim();return r&&r!=="inherit"?r:"#000"}async function vl(t,{family:e="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:s=""}={}){let a=String(e||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,f=bl(o),{familyForMeasure:l,familyForCanvas:u}=await wl(a,s,f);await Sl(u.replace(/^["']+|["']+$/g,""),r);let p=document.createElement("span");Q(p),p.textContent=t,p.style.position="absolute",p.style.visibility="hidden",p.style.left="-99999px",p.style.whiteSpace="nowrap",p.style.fontFamily=l,p.style.fontWeight=String(n||"normal"),p.style.fontSize=`${r}px`,p.style.lineHeight="1",p.style.margin="0",p.style.padding="0",p.style.fontFeatureSettings="'liga' 1",p.style.fontVariantLigatures="normal",p.style.color=i,document.body.appendChild(p);let m=p.getBoundingClientRect(),d=Math.max(1,Math.ceil(m.width)),h=Math.max(1,Math.ceil(m.height));document.body.removeChild(p);let g=document.createElement("canvas");g.width=d*c,g.height=h*c;let y=g.getContext("2d");y.scale(c,c),y.font=`${n?`${n} `:""}${r}px ${u}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(t,0,0),{dataUrl:g.toDataURL(),width:d,height:h}}async function Mn(t,e,n=new Map){if(t?.nodeType!==1)return 0;let r='.material-icons, [class*="material-symbols"]',i=Array.from(t.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim());if(t.matches?.(r)&&t.textContent&&t.textContent.trim()&&i.unshift(t),i.length===0)return 0;let o=e?.nodeType===1?Array.from(e.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim()):[];e?.nodeType===1&&e.matches?.(r)&&e.textContent&&e.textContent.trim()&&o.unshift(e);let s=0;for(let a=0;a<i.length;a++){let c=i[a],f=n&&n.get(c)||o[a]||null;try{let l=getComputedStyle(f||c),u=l.fontFamily||"Material Icons";if(!yl(u))continue;let p=(f||c).textContent.trim();if(!p)continue;let m=parseInt(l.fontSize,10)||24,d=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",h=xl(l),g=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",y=(f||c).className||"",{dataUrl:b,width:w,height:C}=await vl(p,{family:u,weight:d,fontSize:m,color:h,variation:g,className:y});c.textContent="";let x=c.ownerDocument.createElement("img");x.src=b,x.alt=p,x.style.height=`${m}px`,x.style.width=`${Math.max(1,Math.round(w/C*m))}px`,x.style.objectFit="contain",x.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(x),s++}catch{}}return s}fe();St();mt();async function qi(t,e,n,r=32,i="#000"){e=e.replace(/^['"]+|['"]+$/g,"");let o=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let s=document.createElement("span");Q(s),s.textContent=t,s.style.position="absolute",s.style.visibility="hidden",s.style.fontFamily=`"${e}"`,s.style.fontWeight=n||"normal",s.style.fontSize=`${r}px`,s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.padding="0",s.style.margin="0",document.body.appendChild(s);let a=s.getBoundingClientRect(),c=Math.ceil(a.width),f=Math.ceil(a.height);document.body.removeChild(s);let l=document.createElement("canvas");l.width=Math.max(1,c*o),l.height=Math.max(1,f*o);let u=l.getContext("2d");return u.scale(o,o),u.font=n?`${n} ${r}px "${e}"`:`${r}px "${e}"`,u.textAlign="left",u.textBaseline="top",u.fillStyle=i,u.fillText(t,0,0),{dataUrl:l.toDataURL(),width:c,height:f}}var Gi=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),kl=["katex","mathjax","mathml"];function jr(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Gi.has(n.toLowerCase()))return n}return""}function Cl(t){if(!t)return[];let e=[];for(let n of t.split(",")){let r=n.trim().replace(/^['"]+|['"]+$/g,"");r&&(Gi.has(r.toLowerCase())||e.push(r))}return e}function En(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 _n(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function Al(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Ml(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let i=En(n[1]),o=En(n[2]);return{min:Math.min(i,o),max:Math.max(i,o)}}let r=En(e);return{min:r,max:r}}function El(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function _l(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),s=parseFloat(n[2]);return{min:Math.min(o,s),max:Math.max(o,s)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function Rl(t){return!t||typeof t!="string"?"":t.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function Fl(t,e,n=[]){if(!t)return!1;try{let r=new URL(t,location.href);if(r.origin===location.origin)return!0;let o=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(c=>o.endsWith(c))||n.some(c=>o===c.toLowerCase()||o.endsWith("."+c.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||kl.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,"-"),u=Rl(c);if(a.includes(f)||a.includes(l)||u&&a.includes(u))return!0}return!1}catch{return!1}}function Tl(t){let e=new Set;for(let n of t||[]){let r=String(n).split("__")[0]?.trim();r&&e.add(r)}return e}function zi(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,i)=>{let o=(i||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let s=o;try{s=new URL(o,e||location.href).href}catch{}return`url("${s}")`})}var Xi=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Rn=4;async function $l(t,e,n){if(!t)return t;let r=new Set;function i(a,c){try{return new URL(a,c||location.href).href}catch{return a}}async function o(a,c,f=0){if(f>Rn)return console.warn(`[snapDOM] @import depth exceeded (${Rn}) at ${c}`),a;let l="",u=0,p,m=new RegExp(Xi.source,"g");for(;p=m.exec(a);){l+=a.slice(u,p.index),u=m.lastIndex;let d=(p[2]||p[4]||"").trim(),h=i(d,c);if(r.has(h)){console.warn(`[snapDOM] Skipping circular @import: ${h}`);continue}r.add(h);let g="";try{let y=await ot(h,{as:"text",useProxy:n,silent:!0});y.ok&&typeof y.data=="string"&&(g=y.data)}catch{}g?(g=zi(g,h),g=await o(g,h,f+1),l+=`
|
|
12
|
+
/* inlined: ${h} */
|
|
13
|
+
${g}
|
|
14
|
+
`):l+=p[0]}return l+=a.slice(u),l}let s=zi(t,e||location.href);return s=await o(s,e||location.href,0),s}var Yi=/url\((["']?)([^"')]+)\1\)/g,Pl=/@font-face[^{}]*\{[^}]*\}/g;function yt(t,e,n=""){return(t.match(new RegExp(`${e}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function Ki(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let i=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let o=i[1],s=i[2],a=c=>{if(!c.includes("?"))return parseInt(c,16);let f=parseInt(c.replace(/\?/g,"0"),16),l=parseInt(c.replace(/\?/g,"F"),16);return[f,l]};if(s){let c=a(o),f=a(s),l=Array.isArray(c)?c[0]:c,u=Array.isArray(f)?f[1]:f;e.push([Math.min(l,u),Math.max(l,u)])}else{let c=a(o);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function Qi(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,i]of e)if(n>=r&&n<=i)return!0;return!1}function Vr(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(Yi)){let i=(r[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,e||location.href).href}catch{}n.push(i)}}return n}async function Hr(t,e,n="",r){let i=t;for(let o of t.matchAll(Yi)){let s=Gt(o[0]);if(!s)continue;let a=s;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,e||location.href).href}catch{}if(!vt(a,r)){if(P.resource?.has(a)){i=i.replace(o[0],`url(${P.resource.get(a)})`);continue}try{let c=await ot(a,{as:"dataURL",useProxy:n,silent:!0});if(c.ok&&typeof c.data=="string"){let f=c.data;P.resource?.set(a,f),i=i.replace(o[0],`url(${f})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return i}function Nl(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),r=e(256,591)||e(7680,7935),i=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}function ji(t={}){let e=new Set((t.families||[]).map(i=>String(i).toLowerCase())),n=new Set((t.domains||[]).map(i=>String(i).toLowerCase())),r=new Set((t.subsets||[]).map(i=>String(i).toLowerCase()));return(i,o)=>{if(e.size&&e.has(i.family.toLowerCase()))return!0;if(n.size)for(let s of i.srcUrls)try{if(n.has(new URL(s).host.toLowerCase()))return!0}catch{}if(r.size){let s=Nl(o);if(s&&r.has(s))return!0}return!1}}function Ll(t){if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let o of t.match(e)||[]){let s=yt(o,"font-family"),a=jr(s),c=yt(o,"font-weight","400"),f=yt(o,"font-style","normal"),l=yt(o,"font-stretch","100%"),u=yt(o,"unicode-range"),p=yt(o,"src"),m=Vr(p,location.href),d=m.length?m.map(g=>String(g).toLowerCase()).sort().join("|"):p.toLowerCase(),h=[String(a||"").toLowerCase(),c,f,l,u.toLowerCase(),d].join("|");n.has(h)||(n.add(h),r.push(o))}if(r.length===0)return t;let i=0;return t.replace(e,()=>r[i++]||"")}var Vi=new WeakMap,Il=0;function Wl(t){let e=Vi.get(t);return e===void 0&&(e=Il++,Vi.set(t,e)),e}function Ol(t,e,n,r,i,o,s,a,c){let f=Array.from(t||[]).sort().join("|"),l=0,u=0;for(let b of s||[]){let w=Math.imul(b,2654435761);w^=w>>>15,w=Math.imul(w,2246822507),w^=w>>>13,l=l+w|0,u++}let p=e?JSON.stringify({families:(e.families||[]).map(b=>String(b).toLowerCase()).sort(),domains:(e.domains||[]).map(b=>String(b).toLowerCase()).sort(),subsets:(e.subsets||[]).map(b=>String(b).toLowerCase()).sort()}):"",m=(n||[]).map(b=>`${(b.family||"").toLowerCase()}::${b.weight||"normal"}::${b.style||"normal"}::${b.stretchPct??100}::${b.src||""}`).sort().join("|"),d=r||"",h=(i||[]).map(b=>String(b).toLowerCase()).sort().join("|"),g=Wl(o||document),y=(a||[]).map(b=>String(b)).sort().join("|");return`fonts-embed-css::req=${f}::ex=${p}::lf=${m}::px=${d}::fd=${h}::doc=${g}::cp=${l}::n=${u}::ic=${y}::env=${c}`}async function zr(t,e,n,r){let i=r.doc?.defaultView||window;if(t.disabled||t.media?.mediaText&&!i.matchMedia(t.media.mediaText).matches)return;let o;try{o=t.cssRules||[]}catch{return}let s=(a,c)=>{try{return new URL(a,c||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let c=a.href?s(a.href,e):e;if(r.depth>=Rn){console.warn(`[snapDOM] CSSOM import depth exceeded (${Rn}) at ${c}`);continue}if(c&&r.visitedSheets.has(c)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${c}`);continue}c&&r.visitedSheets.add(c);let f={...r,depth:(r.depth||0)+1};await zr(a.styleSheet,c,n,f);continue}if(a.cssRules?.length){if(a.type===CSSRule.MEDIA_RULE&&!i.matchMedia(a.conditionText).matches||a.type===CSSRule.SUPPORTS_RULE&&!i.CSS.supports(a.conditionText))continue;await zr(a,e,n,r);continue}if(a.type===CSSRule.FONT_FACE_RULE){let c=(a.style.getPropertyValue("font-family")||"").trim(),f=jr(c);if(!f||vt(f,r.iconMatchers))continue;let l=(a.style.getPropertyValue("font-weight")||"").trim(),u=(a.style.getPropertyValue("font-style")||"").trim(),p=(a.style.getPropertyValue("font-stretch")||"").trim(),m=(a.style.getPropertyValue("font-variation-settings")||"").trim(),d=(a.style.getPropertyValue("src")||"").trim(),h=(a.style.getPropertyValue("unicode-range")||"").trim(),g=l||"400",y=u||"normal",b=p||"100%",w=(u?`font-style:${u};`:"")+(l?`font-weight:${l};`:"")+(p?`font-stretch:${p};`:"")+(m?`font-variation-settings:${m};`:"")+(h?`unicode-range:${h};`:""),C=r.faceMatchesRequired(f,y,g,b);if(!C&&!r.requiredIndex.has(f.toLowerCase()))continue;let x=Ki(h);if(!Qi(r.usedCodepoints,x))continue;let S={family:f,weightSpec:g,styleSpec:y,stretchSpec:b,unicodeRange:h,srcRaw:d,srcUrls:Vr(d,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(S,x))continue;if(!C){r.provisionalFaces.push({family:f.toLowerCase(),block:`@font-face{font-family:${f};src:${d};${w}}`,srcRaw:d,baseHref:e||location.href});continue}r.coveredFamilies.add(f.toLowerCase());let A=`"${String(f).replace(/^\s*["']|["']\s*$/g,"").replace(/(["\\])/g,"\\$1")}"`;if(/url\(/i.test(d)){let v=await Hr(d,e||location.href,r.useProxy,r.iconMatchers);await n(`@font-face{font-family:${A};src:${v};${w}}`)}else await n(`@font-face{font-family:${A};src:${d};${w}}`)}}}async function Ji({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[],iconMatchers:s=[],doc:a=document}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let c=new Map;for(let S of t){let[A,v,M,k]=String(S).split("__");if(!A)continue;let R=A.toLowerCase(),E=c.get(R)||[];E.push({w:parseInt(v,10),s:M,st:parseInt(k,10)}),c.set(R,E)}function f(S,A,v,M){let k=String(S).toLowerCase();if(!c.has(k))return!1;let R=c.get(k),E=Ml(v),T=El(A),N=_l(M),B=E.min!==E.max,j=E.min,_=$=>T.kind==="normal"&&$==="normal"||T.kind!=="normal"&&($==="italic"||$==="oblique"),W=!1;for(let $ of R){let F=B?$.w>=E.min&&$.w<=E.max:$.w===j,L=_(_n($.s)),V=$.st>=N.min&&$.st<=N.max;if(F&&L&&V){W=!0;break}}if(W)return!0;if(!B)for(let $ of R){let F=_(_n($.s)),L=$.st>=N.min&&$.st<=N.max;if(Math.abs(j-$.w)<=300&&F&&L)return!0}if(!B&&T.kind==="normal"&&R.some(F=>_n(F.s)!=="normal"))for(let F of R){let L=Math.abs(j-F.w)<=300,V=F.st>=N.min&&F.st<=N.max;if(L&&V)return!0}return!1}let l=ji(n);ye(a),Et();let u=Ol(t,n,r,i,o,a,e,s,ye(a));if(P.resource?.has(u))return P.resource.get(u);let p=Tl(t),m=[],d=Xi;for(let S of a.querySelectorAll("style")){let A=S.textContent||"";for(let v of A.matchAll(d)){let M=(v[2]||v[4]||"").trim();if(!M||Ur(M,s))continue;a.querySelector(`link[rel="stylesheet"][href="${M}"]`)||m.push(M)}}let h=[];m.length&&await Promise.all(m.map(S=>new Promise(A=>{if(a.querySelector(`link[rel="stylesheet"][href="${S}"]`))return A(null);let v=a.createElement("link");v.rel="stylesheet",v.href=S,Q(v),v.setAttribute("data-snapdom","injected-import");let M=setTimeout(()=>A(null),3e3),k=R=>{clearTimeout(M),A(R)};v.onload=()=>k(v),v.onerror=()=>k(null),a.head.appendChild(v),h.push(v)})));let g="",y=new Set,b=[],w=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(S=>!!S.href);for(let S of h)try{S.remove()}catch{}for(let S of w)try{if(Ur(S.href,s))continue;let A="",v=!1;try{v=new URL(S.href,location.href).origin===location.origin}catch{}if(!v){let k=Array.isArray(o)?o:[];if(!Fl(S.href,p,k))continue}if(v){let k=Array.from(a.styleSheets).find(R=>R.href===S.href);if(k)try{let R=k.cssRules||[];A=Array.from(R).map(E=>E.cssText).join("")}catch{}}if(!A){let k=await ot(S.href,{as:"text",useProxy:i});k?.ok&&typeof k.data=="string"&&(A=k.data)}A=await $l(A,S.href,i);let M="";for(let k of A.match(Pl)||[]){let R=yt(k,"font-family"),E=jr(R);if(!E||vt(E,s))continue;let T=yt(k,"font-weight","400"),N=yt(k,"font-style","normal"),B=yt(k,"font-stretch","100%"),j=yt(k,"unicode-range"),_=yt(k,"src"),W=Vr(_,S.href),$=f(E,N,T,B);if(!$&&!c.has(E.toLowerCase()))continue;let F=Ki(j);if(!Qi(e,F))continue;let L={family:E,weightSpec:T,styleSpec:N,stretchSpec:B,unicodeRange:j,srcRaw:_,srcUrls:W,href:S.href};if(n&&l(L,F))continue;if(!$){b.push({family:E.toLowerCase(),block:k,srcRaw:_,baseHref:S.href});continue}y.add(E.toLowerCase());let V=/url\(/i.test(_)?await Hr(k,S.href,i,s):k;M+=V}M.trim()&&(g+=M)}catch{console.warn("[snapDOM] Failed to process stylesheet:",S.href)}let C={doc:a,requiredIndex:c,usedCodepoints:e,faceMatchesRequired:f,coveredFamilies:y,provisionalFaces:b,simpleExcluder:n?ji(n):null,useProxy:i,iconMatchers:s,visitedSheets:new Set,depth:0},x=new Set([...a.styleSheets,...a.adoptedStyleSheets||[]]);for(let S of x)if(!(S.href&&w.some(A=>A.href===S.href)))try{let A=S.href||a.baseURI||location.origin+"/";A&&C.visitedSheets.add(A),await zr(S,A,async v=>{g+=v},C)}catch{}for(let S of b)y.has(S.family)||(g+=/url\(/i.test(S.srcRaw)?await Hr(S.block,S.baseHref,i,s):S.block);try{for(let S of a.fonts||[]){if(!S||!S.family||S.status!=="loaded"||!S._snapdomSrc)continue;let A=String(S.family).replace(/^['"]+|['"]+$/g,"");if(vt(A,s)||!c.has(A.toLowerCase())||n?.families&&n.families.some(M=>String(M).toLowerCase()===A.toLowerCase()))continue;let v=S._snapdomSrc;if(!String(v).startsWith("data:"))if(P.resource?.has(S._snapdomSrc))v=P.resource.get(S._snapdomSrc);else try{let M=await ot(S._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(M.ok&&typeof M.data=="string")v=M.data,P.resource?.set(S._snapdomSrc,v);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",S._snapdomSrc);continue}g+=`@font-face{font-family:'${A}';src:url(${v});font-style:${S.style||"normal"};font-weight:${S.weight||"normal"};}`}}catch{}for(let S of r){if(!S||typeof S!="object")continue;let A=String(S.family||"").replace(/^['"]+|['"]+$/g,"");if(!A||vt(A,s)||!c.has(A.toLowerCase())||n?.families&&n.families.some(T=>String(T).toLowerCase()===A.toLowerCase()))continue;let v=S.weight!=null?String(S.weight):"normal",M=S.style!=null?String(S.style):"normal",k=S.stretchPct!=null?`${S.stretchPct}%`:"100%",R=String(S.src||""),E=R;if(!E.startsWith("data:"))if(P.resource?.has(R))E=P.resource.get(R);else try{let T=await ot(R,{as:"dataURL",useProxy:i,silent:!0});if(T.ok&&typeof T.data=="string")E=T.data,P.resource?.set(R,E);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",R);continue}g+=`@font-face{font-family:'${A}';src:url(${E});font-style:${M};font-weight:${v};font-stretch:${k};}`}return g&&(g=Ll(g),P.resource?.set(u,g)),g}function Fn(t,e){let n=new Set,r=new Set;if(!t)return{required:n,usedCodepoints:r};let i=l=>{if(l)for(let u of l)r.add(u.codePointAt(0))},o=l=>{let u=Cl(l.fontFamily);if(u.length)for(let p of u)n.add(`${p}__${En(l.fontWeight)}__${_n(l.fontStyle)}__${Al(l.fontStretch)}`)},s=Se(t),a=t.getRootNode(),c=l=>{o(O(l));let u=l.getRootNode()===a?s:Se(l);for(let p of["::before","::after"]){let m=p==="::before"?u.before:u.after;if(m!==null){if(m==="")continue;try{if(!l.matches(m))continue}catch{}}let d=O(l,p),h=d&&d.content;if(!(!h||h==="none"||h==="normal"))if(o(d),/^["']/.test(h))i(h.slice(1,-1));else{let g=h.match(/\\[0-9A-Fa-f]{1,6}/g);if(g)for(let y of g)try{r.add(parseInt(y.slice(1),16))}catch{}}}},f=[t];for(let l=0;l<f.length;l++){let u=f[l];u.nodeType===Node.ELEMENT_NODE&&c(u),u.shadowRoot&&f.push(u.shadowRoot);let p=(t.ownerDocument||document).createTreeWalker(u,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;p.nextNode();){let m=p.currentNode;if(m.nodeType===Node.TEXT_NODE){if(e&&m.parentElement&&!e(m.parentElement))continue;i(m.nodeValue||"")}else{if(e&&!e(m))continue;c(m),m.shadowRoot&&f.push(m.shadowRoot)}}}return{required:n,usedCodepoints:r}}async function Tn(t,e=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(t||[]).filter(Boolean);if(r.length===0)return;let i=()=>{let o=n.createElement("div");Q(o),o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let s of r){let a=n.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${s}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}n.body.appendChild(o),o.offsetWidth,n.body.removeChild(o)};for(let o=0;o<Math.max(1,e);o++)i(),await ft(),await ft()}wt();function ns(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Zi(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function ts(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,t)),i="";for(let[o,s]of n)for(;r>=o;)i+=s,r-=o;return e?i:i.toLowerCase()}function es(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(t);case"decimal-leading-zero":{let n=Math.abs(t);return(t<0?"-":"")+(n<10?"0":"")+String(n)}case"lower-alpha":case"lower-latin":return Zi(t,!1);case"upper-alpha":case"upper-latin":return Zi(t,!0);case"lower-roman":return ts(t,!1);case"upper-roman":return ts(t,!0);default:return String(t)}}function nn(t,e){let n=(t||"").trim().split(/[\s,]+/).filter(Boolean),r=[];for(let i=0;i<n.length;i++){let o=n[i];if(o==="none")continue;let s=n[i+1],a=s!==void 0&&Number.isFinite(Number(s));r.push([o,a?Number(s):e]),a&&i++}return r}function rs(t){let e=new WeakMap,n=hr(t)?t.documentElement:t,r=f=>f&&f.tagName==="LI",i=new WeakMap,o=f=>{let l=new Map;for(let[u,p]of f)l.set(u,p.slice());return l},s=(f,l,u)=>{let p=o(f),m;try{m=getComputedStyle(u)}catch{m=u.style}let d;try{d=m?.counterReset}catch{}if(d&&d!=="none")for(let[y,b]of nn(d,0)){let w=l.get(y);if(w&&w.length){let C=w.slice();C.push(b),p.set(y,C)}else p.set(y,[b])}let h;try{h=m?.counterSet}catch{}if(h&&h!=="none")for(let[y,b]of nn(h,0)){let w=p.get(y)||[];w.length===0&&w.push(0),w[w.length-1]=b,p.set(y,w)}let g;try{g=m?.counterIncrement}catch{}if(g&&g!=="none")for(let[y,b]of nn(g,1)){let w=p.get(y)||[];w.length===0&&w.push(0),w[w.length-1]+=b,p.set(y,w)}try{if(m?.display==="list-item"&&r(u)){let y=u.parentElement,b=y&&i.get(y),w=y?.tagName==="OL"?parseInt(y.getAttribute("start"),10):NaN,C=b===void 0?Number.isFinite(w)?w:1:b+1,x=y?.tagName==="OL"?parseInt(u.getAttribute("value"),10):NaN;Number.isFinite(x)&&(C=x),y&&i.set(y,C);let S=p.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=C,p.set("list-item",S)}}catch{}return p},a=(f,l,u)=>{let p=s(u,l,f);e.set(f,p);let m=p;for(let h of f.children)m=a(h,p,m);let d=new Map;for(let[h,g]of u){let y=g.length,b=m.get(h);d.set(h,b&&b.length?b.slice(0,y):g.slice())}for(let[h,g]of m)!d.has(h)&&g.length&&!l.has(h)&&d.set(h,g.slice(0,1));return d},c=new Map;return a(n,c,c),{get(f,l){let u=e.get(f)?.get(l);return u&&u.length?u[u.length-1]:0},getStack(f,l){let u=e.get(f)?.get(l);return u?u.slice():[]}}}function os(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return t.replace(r,(i,o,s)=>{let a=String(s).split(",").map(c=>c.trim());if(o==="counter"){let c=a[0]?.replace(/^["']|["']$/g,""),f=(a[1]||"decimal").toLowerCase(),l=n.get(e,c);return es(l,f)}else{let c=a[0]?.replace(/^["']|["']$/g,""),f=a[1]?.replace(/^["']|["']$/g,"")??"",l=(a[2]||"decimal").toLowerCase(),u=n.getStack(e,c);return u.length?u.map(m=>es(m,l)).join(f):""}})}catch{return"- "}}fe();var Ae=new WeakMap,is=1e3;function Dl(t,e){let n=ls(t);return e?(e.__pseudoPreflightFp!==n&&(Et(),e.__pseudoPreflight=ss(t,n),e.__pseudoPreflightFp=n),!!e.__pseudoPreflight):(Et(),ss(t,n))}function $n(t){try{return t&&t.cssRules?t.cssRules:null}catch{return null}}function ls(t){let e=t.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${e.length}|`,r=0;for(let s=0;s<e.length;s++){let a=e[s];if(a.tagName==="STYLE"){let c=a.textContent?a.textContent.length:0;n+=`S${c}|`;let f=a.sheet,l=f?$n(f):null;l&&(r+=l.length)}else{let c=a.getAttribute("href")||"",f=a.getAttribute("media")||"all";n+=`L${c}|m:${f}|`;let l=a.sheet,u=l?$n(l):null;u&&(r+=u.length)}}let i=t.adoptedStyleSheets,o=0;if(Array.isArray(i))for(let s of i){let a=$n(s);a&&(o+=a.length)}return n+=`ass:${Array.isArray(i)?i.length:0}/${o}|tr:${r}`,n}function qr(t,e,n){let r=$n(t);if(!r)return!1;for(let i=0;i<r.length;i++){if(n.budget<=0)return!1;let o=r[i],s=o&&o.cssText?o.cssText:"";n.budget--;for(let a of e)if(s.includes(a))return!0;if(o&&o.styleSheet&&qr(o.styleSheet,e,n))return!0;if(o&&o.cssRules&&o.cssRules.length)for(let a=0;a<o.cssRules.length&&n.budget>0;a++){let c=o.cssRules[a],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 ss(t=document,e=ls(t)){let n=Ae.get(t);if(n&&n.fingerprint===e)return n.result;let r=a=>(a.match(/\|ass:[^|]*/)||[""])[0];n&&r(e)!==r(n.fingerprint)&&be();let i=["::before","::after","::first-letter","::marker","::first-line",":before",":after",":first-letter",":first-line","counter(","counters(","counter-increment","counter-reset"],o=t.querySelectorAll("style");for(let a=0;a<o.length;a++){let c=o[a].textContent||"";for(let f of i)if(c.includes(f))return Ae.set(t,{fingerprint:e,result:!0}),!0}let s=t.adoptedStyleSheets;if(Array.isArray(s)&&s.length){let a={budget:is};try{for(let c of s)if(qr(c,i,a))return Ae.set(t,{fingerprint:e,result:!0}),!0}catch{}}{let a=t.querySelectorAll('style,link[rel~="stylesheet"]'),c={budget:is};for(let f=0;f<a.length&&c.budget>0;f++){let l=a[f],u=null;if(l.tagName,u=l.sheet||null,u&&qr(u,i,c))return Ae.set(t,{fingerprint:e,result:!0}),!0}}return t.querySelector('[style*="counter("], [style*="counters("]')?(Ae.set(t,{fingerprint:e,result:!0}),!0):(Ae.set(t,{fingerprint:e,result:!1}),!1)}function as(t){for(let e of["Top","Right","Bottom","Left"]){let n=parseFloat(t[`border${e}Width`])||0,r=t[`border${e}Style`];if(n>0&&r&&r!=="none"&&r!=="hidden")return!0}return!1}function Bl(t,e){let n=null,r=()=>{if(!n)try{n=rs(t)}catch(i){U(e,"buildCounterContext failed",i),n={get:()=>0,getStack:()=>[]}}return n};return{get(i,o){return r().get(i,o)},getStack(i,o){return r().getStack(i,o)}}}function Ul(t){let e=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r==='"')e=!e;else if(r==="/"&&!e)return t.slice(0,n).trim()}return t}function Hl(t){return t.replace(/\\(?:([0-9a-fA-F]{1,6})[ \t\n]?|([\s\S]))/g,(e,n,r)=>{if(n){let i=parseInt(n,16);return i===0||i>1114111?"\uFFFD":String.fromCodePoint(i)}return r===`
|
|
15
|
+
`?"":r})}function zl(t){if(!t)return"";let e=[],n=/"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)'/g,r=0,i;for(;i=n.exec(t);){let s=t.slice(r,i.index).trim();s&&e.push(s),e.push(Hl(i[1]!==void 0?i[1]:i[2])),r=n.lastIndex}let o=t.slice(r).trim();return o&&e.push(o),e.join("")}function Gr(t,e,n){let r=t.parentElement,i=r&&n?n.get(r):null;return i?{get(o,s){let a=e.get(o,s),c=i.get(s);return typeof c=="number"?Math.max(a,c):a},getStack(o,s){let a=e.getStack(o,s);if(!a.length)return a;let c=i.get(s);if(typeof c=="number"){let f=a.slice();return f[f.length-1]=Math.max(f[f.length-1],c),f}return a}}:e}function Xr(t,e,n){let r=new Map,i=(f,l)=>nn(f,l).map(([u,p])=>({name:u,num:p})),o=i(e?.counterReset,0),s=i(e?.counterSet,0),a=i(e?.counterIncrement,1);function c(f){if(r.has(f))return r.get(f).slice();let l=n.getStack(t,f);l=l.length?l.slice():[];let u=o.find(d=>d.name===f);if(u){let d=Number.isFinite(u.num)?u.num:0;l=l.length?[...l,d]:[d]}let p=s.find(d=>d.name===f);if(p){let d=Number.isFinite(p.num)?p.num:0;l.length===0&&(l=[0]),l[l.length-1]=d}let m=a.find(d=>d.name===f);if(m){let d=Number.isFinite(m.num)?m.num:1;l.length===0&&(l=[0]),l[l.length-1]+=d}return r.set(f,l.slice()),l}return{get(f,l){let u=c(l);return u.length?u[u.length-1]:0},getStack(f,l){return c(l)},__incs:a}}var jl=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","letter-spacing","line-height"],Vl=["color","-webkit-text-fill-color","font-family","font-size","font-weight","font-style","font-variant","letter-spacing","word-spacing","text-transform","text-decoration-line","text-decoration-color","text-decoration-style","line-height","background-color","vertical-align"];function cs(t,e,n,r,i,o){try{if(r===null){if(t.getRootNode()!==(t.ownerDocument||document))return;let u=O(t).display||"";if(i==="::marker"?!u.includes("list-item"):!(u==="block"||u==="flow-root"||u==="list-item"||u==="inline-block"||u==="table-cell"||u==="table-caption"))return}else if(!t.matches(r))return;if(i==="::marker"&&!(O(t).display||"").includes("list-item"))return;let s=O(t,i),a=O(t);if(!s)return;let c="";for(let u of o){let p=s.getPropertyValue(u);p&&p!==a.getPropertyValue(u)&&!(u==="background-color"&&p==="rgba(0, 0, 0, 0)")&&!(u==="vertical-align"&&p==="baseline")&&(c+=`${u}:${p};`)}if(i==="::marker"){let u=s.getPropertyValue("content");u&&u!=="normal"&&u!=="none"&&(c+=`content:${u};`)}if(!c)return;let l=`data-sd-p${n.__pseudoRuleSeq=(n.__pseudoRuleSeq||0)+1}`;e.setAttribute(l,""),n.__pseudoCSS=(n.__pseudoCSS||"")+`[${l}]${i}{${c}}`}catch{}}function ql(t,e){if(!/\b(?:no-)?(?:open|close)-quote\b/.test(t))return t;let n="\u201C",r="\u201D";try{let i=O(e).quotes;if(i==="none")n="",r="";else if(i&&i!=="auto"){let o=i.match(/"[^"]*"|'[^']*'/g);o&&o.length>=2&&(n=o[0].slice(1,-1),r=o[1].slice(1,-1))}}catch{}return n=n.replace(/"/g,""),r=r.replace(/"/g,""),t.replace(/"[^"]*"|\b(no-open-quote|no-close-quote|open-quote|close-quote)\b/g,(i,o)=>o?o==="open-quote"?`"${n}"`:o==="close-quote"?`"${r}"`:'""':i)}function Gl(t,e,n,r){let i;try{i=O(t,e)}catch{}let o=i?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};o=Ul(o),o=ql(o,t);let s=Gr(t,n,r),a=Xr(t,i,s),c=ns(o)?os(o,t,a):o;return{text:zl(c),incs:a.__incs||[]}}function Xl(t,e){if(e.__shadowPseudo)return!1;let n=Se(t),r=[];for(let o of["before","after","firstLetter","marker","firstLine"]){let s=n[o];if(s===null)return!1;s&&r.push(s)}if(!r.length)return!0;let i=r.join(",");try{return!t.matches(i)&&t.querySelector(i)===null}catch{return!1}}async function Me(t,e,n,r,i=!1){if(t?.nodeType!==1||e?.nodeType!==1||t.tagName==="TEXTAREA")return;let o=t.ownerDocument||document;if(!i&&!Dl(o,n)&&!n.__shadowPseudo||!i&&Xl(t,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=Bl(t.ownerDocument||document,n));let s=n.__counterCtx,a=Se(t);a.marker!==""&&cs(t,e,n,a.marker,"::marker",jl),a.firstLine!==""&&cs(t,e,n,a.firstLine,"::first-line",Vl);for(let f of["::before","::after","::first-letter"]){let l=a[f==="::before"?"before":f==="::after"?"after":"firstLetter"];if(l!==null){if(l==="")continue;try{if(!t.matches(l))continue}catch{}}try{let u=O(t,f);if(!u||u.content==="none"&&u.backgroundImage==="none"&&u.backgroundColor==="transparent"&&!as(u)&&(!u.transform||u.transform==="none")&&u.display==="inline")continue;if(f==="::first-letter"){let D=O(t),H=(D?.display||"").toLowerCase();if(H.includes("flex")||H.includes("grid"))continue;let z=Pt=>u[Pt]!==D[Pt]&&(parseFloat(u[Pt])||0)!==0;if(!(u.color!==D.color||u.fontSize!==D.fontSize||u.fontWeight!==D.fontWeight||u.fontFamily!==D.fontFamily||u.fontStyle!==D.fontStyle||u.textTransform!==D.textTransform||u.float!==D.float&&u.float!=="none"||z("paddingTop")||z("paddingRight")||z("paddingBottom")||z("paddingLeft")||z("marginTop")||z("marginRight")||z("marginBottom")||z("marginLeft")))continue;let kt=Array.from(e.childNodes).find(Pt=>Pt.nodeType===Node.TEXT_NODE&&Pt.textContent?.trim().length>0);if(!kt)continue;let Oe=kt.textContent,ce=/^\s*/.exec(Oe)[0],De=Oe.slice(ce.length),jt=De.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],ar=De.slice(jt?.length||0);if(!jt||/[\uD800-\uDFFF]/.test(jt))continue;let At=document.createElement("span");At.textContent=jt,At.dataset.snapdomPseudo="::first-letter";let Do=he(u,hn(t)),cr=pe(Do,"span");n.styleMap.set(At,cr);let Be=document.createTextNode(ar);e.replaceChild(Be,kt),e.insertBefore(At,Be),ce&&e.insertBefore(document.createTextNode(ce),At);continue}let m=u.content??"",d=m===""||m==="none"||m==="normal",{text:h,incs:g}=Gl(t,f,s,n.__siblingCounters),y=u.backgroundImage,b=u.backgroundColor,w=u.fontFamily,C=parseInt(u.fontSize)||32,x=parseInt(u.fontWeight)||!1,S=u.color||"#000",A=u.transform,v=vt(w,r?.__iconMatchers),M=!d&&h!=="",k=y&&y!=="none",R=b&&b!=="transparent"&&b!=="rgba(0, 0, 0, 0)",E=as(u),T=A&&A!=="none",N=m!=="none"&&m!=="normal",B=N&&((parseFloat(u.width)||0)>0||(parseFloat(u.height)||0)>0),j=N&&u.boxShadow&&u.boxShadow!=="none",_=N&&u.outlineStyle&&u.outlineStyle!=="none"&&(parseFloat(u.outlineWidth)||0)>0;if(!(M||k||R||E||T||B||j||_)){if(g&&g.length&&t.parentElement){let D=n.__siblingCounters.get(t.parentElement)||new Map;for(let{name:H}of g){if(!H)continue;let z=Gr(t,s,n.__siblingCounters),kt=Xr(t,O(t,f),z).get(t,H);D.set(H,kt)}n.__siblingCounters.set(t.parentElement,D)}continue}let $=h.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(h),F=!1;if(M&&!v&&h.length>1&&!$){let D=O(t),H=parseFloat(D.fontSize)||16,z=parseFloat(D.lineHeight);Number.isFinite(z)||(z=H*1.5),t.getBoundingClientRect().height<z*1.6&&(e.style.whiteSpace="nowrap",F=!0)}let L=document.createElement("span");L.dataset.snapdomPseudo=f,L.style.pointerEvents="none",F&&(L.style.whiteSpace="nowrap");let V=mi(t,f,u,n,r),q=(O(t).display||"").toLowerCase(),pt=q.includes("flex")||q.includes("grid");if(pt){let D=V["min-width"];(!D||D==="auto"||D==="0px")&&(V["min-width"]="0px")}let et=pe(V,"span",M,pt);if(n.styleMap.set(L,et),v&&h&&h.length===1){let{dataUrl:D,width:H,height:z}=await qi(h,w,x,C,S),it=document.createElement("img");it.src=D,it.style=`height:${C}px;width:${H/z*C}px;object-fit:contain;`,L.appendChild(it),e.dataset.snapdomHasIcon="true"}else if(h&&$){let D=ze(h,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Gt(h);if(D?.trim())try{let H=await ot(Lt(D),{as:"dataURL",useProxy:r.useProxy});if(H?.ok&&typeof H.data=="string"){let z=document.createElement("img");z.src=H.data,z.style=`width:${C}px;height:auto;object-fit:contain;`,L.appendChild(z)}}catch(H){console.error(`[snapdom] Error in pseudo ${f} for`,t,H)}}else!v&&M&&(L.textContent=h);L.style.backgroundImage="none","maskImage"in L.style&&(L.style.maskImage="none"),"webkitMaskImage"in L.style&&(L.style.webkitMaskImage="none");try{L.style.backgroundRepeat=u.backgroundRepeat,L.style.backgroundSize=u.backgroundSize,u.backgroundPositionX&&u.backgroundPositionY?(L.style.backgroundPositionX=u.backgroundPositionX,L.style.backgroundPositionY=u.backgroundPositionY):L.style.backgroundPosition=u.backgroundPosition,L.style.backgroundOrigin=u.backgroundOrigin,L.style.backgroundClip=u.backgroundClip,L.style.backgroundAttachment=u.backgroundAttachment,L.style.backgroundBlendMode=u.backgroundBlendMode}catch{}if(k)try{let D=Ot(y),H=await Promise.all(D.map(z=>ue(z,r)));L.style.backgroundImage=H.join(", ")}catch(D){console.warn(`[snapdom] Failed to inline background-image for ${f}`,D)}R&&(L.style.backgroundColor=b);let bt=u.maskImage||u.webkitMaskImage;if(bt&&bt!=="none")try{let H=(await Promise.all(Ot(bt).map(z=>ue(z,r)))).join(", ");L.style.maskImage=H,L.style.webkitMaskImage=H;for(let z of["maskSize","maskRepeat","maskPosition","maskMode","maskComposite","maskOrigin","maskClip"])u[z]&&(L.style[z]=u[z])}catch(D){console.warn(`[snapdom] Failed to inline mask-image for ${f}`,D)}let ht=L.childNodes.length>0||L.textContent?.trim()!==""||k||R||E||T||B||j||_;if(g&&g.length&&t.parentElement){let D=n.__siblingCounters.get(t.parentElement)||new Map,H=Gr(t,s,n.__siblingCounters),z=Xr(t,O(t,f),H);for(let{name:it}of g){if(!it)continue;let kt=z.get(t,it);D.set(it,kt)}n.__siblingCounters.set(t.parentElement,D)}if(!ht)continue;f==="::before"?(e.dataset.snapdomHasBefore="1",e.insertBefore(L,e.firstChild)):(e.dataset.snapdomHasAfter="1",e.appendChild(L))}catch(u){console.warn(`[snapdom] Failed to capture ${f} for`,t,u)}}let c=Array.from(e.children).filter(f=>!f.dataset.snapdomPseudo);if(n.nodeMap)for(let f of c){let l=n.nodeMap.get(f);l?.nodeType===1&&await Me(l,f,n,r,!0)}else{let f=Array.from(t.children);for(let l=0;l<Math.min(f.length,c.length);l++)await Me(f[l],c[l],n,r,!0)}}wt();function fs(t,e,n){if(!t||t?.nodeType!==1)return;let r=t.ownerDocument||document,i=e||r,o=It(t)&&t.localName==="svg"?[t]:Array.from(t.querySelectorAll("svg")),s=/url\(\s*["']?\s*#([^)"']+)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],c=S=>window.CSS&&CSS.escape?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),f="http://www.w3.org/1999/xlink",l=S=>{if(!S||!S.getAttribute)return null;let A=S.getAttribute("href")||S.getAttribute("xlink:href")||(typeof S.getAttributeNS=="function"?S.getAttributeNS(f,"href"):null);if(A)return A;let v=S.attributes;if(!v)return null;for(let M=0;M<v.length;M++){let k=v[M];if(!k||!k.name)continue;if(k.name==="href")return k.value;let R=k.name.indexOf(":");if(R!==-1&&k.name.slice(R+1)==="href")return k.value}return null},u=new Set(Array.from(t.querySelectorAll("[id]")).map(S=>S.id)),p=new Set,m=!1,d=(S,A=null)=>{if(!S)return;s.lastIndex=0;let v;for(;v=s.exec(S);){m=!0;let M=(v[1]||"").trim();M&&(u.has(M)||(p.add(M),A&&!A.has(M)&&A.add(M)))}},h=S=>{let A=S.querySelectorAll("use");for(let k of A){let R=l(k);if(!R||!R.startsWith("#"))continue;m=!0;let E=R.slice(1).trim();E&&!u.has(E)&&p.add(E)}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("]';d(S.getAttribute("style")||"");for(let k of a)d(S.getAttribute(k));let M=S.querySelectorAll(v);for(let k of M){d(k.getAttribute("style")||"");for(let R of a)d(k.getAttribute(R))}},g=S=>{if(!S||S.nodeType!==1||!S.querySelectorAll)return;let A="filter[id],clipPath[id],mask[id],linearGradient[id],radialGradient[id],pattern[id]",v=!1;try{v=!!(i.querySelector&&i.querySelector(A))}catch{return}if(!v)return;let M=["filter","clipPath","mask","maskImage","webkitMaskImage"],k=R=>{if(It(R))return;let E;try{E=getComputedStyle(R)}catch{return}for(let T of M){let N=E[T];N&&N.includes("url(")&&d(N)}};k(S);for(let R of S.querySelectorAll("*"))k(R)};for(let S of o)h(S);if(g(n),!m)return;let y=t.querySelector("svg.inline-defs-container");y||(y=r.createElementNS("http://www.w3.org/2000/svg","svg"),y.classList.add("inline-defs-container"),y.setAttribute("aria-hidden","true"),y.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(y,t.firstChild||null));let b=y.querySelector("defs")||null,w=S=>{if(!S||u.has(S))return null;let A=c(S),v=M=>{let k=i.querySelector(M);return k&&!t.contains(k)?k:null};return v(`svg defs > *#${A}`)||v(`svg > symbol#${A}`)||v(`*#${A}`)};if(!p.size)return;let C=new Set(p),x=new Set;for(;C.size;){let S=C.values().next().value;if(C.delete(S),!S||u.has(S)||x.has(S))continue;let A=w(S);if(!A){x.add(S);continue}b||(b=r.createElementNS("http://www.w3.org/2000/svg","defs"),y.appendChild(b));let v=A.cloneNode(!0);v.id||v.setAttribute("id",S),b.appendChild(v),x.add(S),u.add(S);let M=[v,...v.querySelectorAll("*")];for(let k of M){let R=l(k);if(R&&R.startsWith("#")){let T=R.slice(1).trim();T&&!u.has(T)&&!x.has(T)&&C.add(T)}let E=k.getAttribute?.("style")||"";E&&d(E,C);for(let T of a){let N=k.getAttribute?.(T);N&&d(N,C)}}}}wt();var Yr=new WeakMap,Kr=new WeakMap;function Pn(t,e,n){let r=n.get(t),i=t.style;if(!r){let s=i.cssText,a=t.hasAttribute("style");r={users:0,saved:e.map(([f,l])=>{let u={property:f,value:i.getPropertyValue(f),priority:i.getPropertyPriority(f)};return i.setProperty(f,l,"important"),u.forcedValue=i.getPropertyValue(f),u}),originalCSS:s,forcedCSS:i.cssText,hadStyle:a},n.set(t,r)}r.users++;let o=!1;return()=>{if(!o&&(o=!0,!--r.users)){if(n.delete(t),i.cssText===r.forcedCSS)i.cssText=r.originalCSS;else for(let s of r.saved)i.getPropertyValue(s.property)!==s.forcedValue||i.getPropertyPriority(s.property)!=="important"||(s.value?i.setProperty(s.property,s.value,s.priority):i.removeProperty(s.property));!r.hadStyle&&!i.length&&(t.getAttribute("style"),t.removeAttribute("style"))}}}function us(t){if(Yr.has(t))return Pn(t,[],Yr);let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,i=n!=="none"&&parseFloat(r)>0,o=parseFloat(e.borderTopWidth)===0&&parseFloat(e.borderRightWidth)===0&&parseFloat(e.borderBottomWidth)===0&&parseFloat(e.borderLeftWidth)===0;if(i&&o){let s=[];for(let a of["top","right","bottom","left"])s.push([`border-${a}-width`,r],[`border-${a}-style`,"solid"],[`border-${a}-color`,"transparent"]);return Pn(t,s,Yr)}return()=>{}}function Nn(t,e=null){let n=[],r=i=>{if(!Ft(i))return;if(Kr.has(i)){n.push(Pn(i,[],Kr));return}let o=getComputedStyle(i);(o.contentVisibility||o.getPropertyValue("content-visibility")||"")==="auto"&&n.push(Pn(i,[["content-visibility","visible"]],Kr))};try{if(e){let o=s=>{let a;try{a=s.getBoundingClientRect()}catch{return}if(!((a.width>0||a.height>0)&&(a.right<e.left-200||a.left>e.right+200||a.bottom<e.top-200||a.top>e.bottom+200))){r(s);for(let c=s.firstElementChild;c;c=c.nextElementSibling)o(c)}};o(t)}else{for(let i of t.querySelectorAll("*"))r(i);r(t)}}catch{}return()=>{for(let i of n)try{i()}catch{}}}ut();lt();mt();me();mt();function Jr(t){return ps(t.boxShadow)}function Zr(t){return ps(t.textShadow)}function ps(t){if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let e=[],n="",r=0;for(let c=0;c<t.length;c++){let f=t[c];f==="("?r++:f===")"&&(r=Math.max(0,r-1)),f===","&&r===0?(e.push(n),n=""):n+=f}n.trim()&&e.push(n);let i=0,o=0,s=0,a=0;for(let c of e){if(/\binset\b/i.test(c))continue;let f=c.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(f.length<2)continue;let[l,u,p=0,m=0]=f,d=Math.abs(l)+p+m,h=Math.abs(u)+p+m;o=Math.max(o,d+Math.max(l,0)),a=Math.max(a,d+Math.max(-l,0)),s=Math.max(s,h+Math.max(u,0)),i=Math.max(i,h+Math.max(-u,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(s),left:Math.ceil(a)}}function to(t){let e=t.filter&&t.filter!=="none"?t.filter:t.webkitFilter||"",n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(e);)r+=parseFloat(i[1])||0;let o=Math.ceil(r*2);return{top:o,right:o,bottom:o,left:o}}function eo(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0),n=parseFloat(t.outlineOffset||"0")||0,r=e+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function no(t){let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,s=0,a=!1;for(let c of n){a=!0;let f=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(h=>parseFloat(h))||[],[l=0,u=0,p=0]=f,m=Math.abs(l)+p,d=Math.abs(u)+p;i=Math.max(i,m+Math.max(l,0)),s=Math.max(s,m+Math.max(-l,0)),o=Math.max(o,d+Math.max(u,0)),r=Math.max(r,d+Math.max(-u,0))}return{bleed:{top:I(r),right:I(i),bottom:I(o),left:I(s)},has:a}}function Yl(t){let e=Jr(t),n=Zr(t),r=to(t),i=eo(t),o=no(t);return{top:Math.max(e.top,n.top)+r.top+i.top+o.bleed.top,right:Math.max(e.right,n.right)+r.right+i.right+o.bleed.right,bottom:Math.max(e.bottom,n.bottom)+r.bottom+i.bottom+o.bleed.bottom,left:Math.max(e.left,n.left)+r.left+i.left+o.bleed.left}}function Kl(t){return t.boxShadow&&t.boxShadow!=="none"||t.textShadow&&t.textShadow!=="none"||(t.outlineStyle||"none")!=="none"||t.filter&&t.filter!=="none"?!0:!!t.webkitFilter&&t.webkitFilter!=="none"}function ds(t){let e=t.overflowX||t.overflow||"visible",n=t.overflowY||t.overflow||"visible",r=!!t.contain&&/\b(paint|content|strict)\b/.test(t.contain)||!!t.clipPath&&t.clipPath!=="none";return{x:r||e!=="visible",y:r||n!=="visible"}}function hs(t,e,n,r=1,i=1){let o=0,s=0,a=0,c=0,f=ds(n.get(t)||O(t));if(f.x&&f.y)return{top:0,right:0,bottom:0,left:0};let l=t.getBoundingClientRect();for(let u of e.values()){if(u===t||u.nodeType!==1||u.ownerDocument!==t.ownerDocument)continue;let p=n.get(u);if(!p||!Kl(p))continue;let m=Yl(p);if(!(m.top||m.right||m.bottom||m.left))continue;let d=u.getBoundingClientRect(),h={left:d.left-m.left/r,top:d.top-m.top/i,right:d.right+m.right/r,bottom:d.bottom+m.bottom/i};for(let g=u.parentElement;g;g=g.parentElement){let y=ds(n.get(g)||O(g));if(y.x||y.y){let b=g.getBoundingClientRect();y.x&&(h.left=Math.max(h.left,b.left),h.right=Math.min(h.right,b.right)),y.y&&(h.top=Math.max(h.top,b.top),h.bottom=Math.min(h.bottom,b.bottom))}if(g===t)break}f.x||(c=Math.max(c,(l.left-h.left)*r),s=Math.max(s,(h.right-l.right)*r)),f.y||(o=Math.max(o,(l.top-h.top)*i),a=Math.max(a,(h.bottom-l.bottom)*i))}return{top:Math.max(0,Math.ceil(o)),right:Math.max(0,Math.ceil(s)),bottom:Math.max(0,Math.ceil(a)),left:Math.max(0,Math.ceil(c))}}function ms(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch{}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none"){let c=null;try{c=re(t).scale}catch{}try{e.style.transform="none"}catch{}if(!c)return{a:1,b:0,c:0,d:1};let f=Ht({scale:c});return{a:f.a,b:f.b,c:f.c,d:f.d}}function i(c,f,l,u){let p=Math.sqrt(c*c+f*f)||0,m=0,d=0;if(p>0){let h=c/p,g=f/p;m=h*l+g*u;let y=l-h*m,b=u-g*m;d=Math.sqrt(y*y+b*b)||0,d>0?m=m/d:m=0}return{a:p,b:0,c:m*d,d}}let o=c=>{let f=re(t).scale;if(!f)return c;let l=Ht({scale:f,baseTransform:`matrix(${c.a},${c.b},${c.c},${c.d},0,0)`});return{a:l.a,b:l.b,c:l.c,d:l.d}},s=r.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let c=s[1].split(",").map(f=>parseFloat(f.trim()));if(c.length===6&&c.every(Number.isFinite)){let[f,l,u,p]=c,m=i(f,l,u,p);try{e.style.transform=`matrix(${m.a}, ${m.b}, ${m.c}, ${m.d}, 0, 0)`}catch{}return o(m)}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let c=a[1].split(",").map(f=>parseFloat(f.trim()));if(c.length===16&&c.every(Number.isFinite)){let f=c[0],l=c[1],u=c[4],p=c[5],m=i(f,l,u,p);try{e.style.transform=`matrix(${m.a}, ${m.b}, ${m.c}, ${m.d}, 0, 0)`}catch{}return o(m)}}try{let c=new DOMMatrix(r),f=i(c.a,c.b,c.c,c.d);try{e.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return o(f)}catch{return null}}function Ee(t,e,n,r,i){let o=n.a,s=n.b,a=n.c,c=n.d,f=n.e||0,l=n.f||0;function u(y,b){let w=y-r,C=b-i,x=o*w+a*C,S=s*w+c*C;return x+=r+f,S+=i+l,[x,S]}let p=[u(0,0),u(t,0),u(0,e),u(t,e)],m=1/0,d=1/0,h=-1/0,g=-1/0;for(let[y,b]of p)y<m&&(m=y),b<d&&(d=b),y>h&&(h=y),b>g&&(g=b);return{minX:m,minY:d,maxX:h,maxY:g,width:h-m,height:g-d}}function rn(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],s=(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:s(i,e),oy:s(o,n)}}function re(t){let e={rotate:"0deg",scale:null,translate:null},n=null;try{n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null}catch{}if(n){let i=c=>{try{return typeof n.has=="function"&&!n.has(c)||typeof n.get!="function"?null:n.get(c)}catch{return null}},o=i("rotate");if(o)if(o.angle){let c=o.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit,o.is2D===!1&&o.x&&o.y&&o.z&&(e.rotate=`${o.x.value} ${o.y.value} ${o.z.value} ${e.rotate}`)}else o.unit?e.rotate=o.unit==="rad"?o.value*180/Math.PI+"deg":o.value+o.unit:e.rotate=String(o);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let s=i("scale");if(s){let c=f=>f&&f.value!=null?`${f.value}${f.unit==="percent"?"%":""}`:null;"x"in s&&s.x?.value!=null?e.scale=[c(s.x),c(s.y)??c(s.x),...s.is2D===!1?[c(s.z)??"1"]:[]].join(" "):Array.isArray(s)?e.scale=s.map(c).join(" "):e.scale=String(s)}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let a=i("translate");if(a){let c=f=>f&&f.value!=null?`${f.value}${f.unit==="percent"?"%":f.unit||"px"}`:null;"x"in a&&a.x?.value!=null?e.translate=[c(a.x),c(a.y)??"0px",...a.is2D===!1?[c(a.z)??"0px"]:[]].join(" "):Array.isArray(a)?e.translate=a.map(c).join(" "):e.translate=String(a)}else{let c=getComputedStyle(t);e.translate=c.translate&&c.translate!=="none"?c.translate:null}return(!e.rotate||e.rotate==="none")&&(e.rotate="0deg"),(!e.scale||e.scale==="none")&&(e.scale=null),(!e.translate||e.translate==="none")&&(e.translate=null),e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}var Qr=null;function Ql(){if(Qr?.isConnected)return Qr;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Q(t),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),Qr=t,t}function Ht(t){let e=o=>{let s=[],a=0,c=0,f=String(o).trim();for(let l=0;l<f.length;l++)f[l]==="("?a++:f[l]===")"?a--:/\s/.test(f[l])&&!a&&(l>c&&s.push(f.slice(c,l)),c=l+1);return c<f.length&&s.push(f.slice(c)),s},n=o=>o&&o!=="none",r=[];if(n(t.translate)){let o=e(t.translate);for(let s=0;s<2&&s<o.length;s++){let a=s===0?t.width:t.height;/^[+-]?(?:\d*\.)?\d+%$/.test(o[s])&&Number.isFinite(a)&&(o[s]=`${parseFloat(o[s])*a/100}px`)}r.push(o.length>2?`translate3d(${o.join(",")})`:`translate(${o.join(",")})`)}if(n(t.rotate)&&t.rotate!=="0deg"){let o=e(t.rotate);o.length===4?r.push(`rotate3d(${o.join(",")})`):o.length===2&&/^[xyz]$/i.test(o[0])?r.push(`rotate${o[0].toUpperCase()}(${o[1]})`):r.push(`rotate(${o.join(" ")})`)}if(n(t.scale)){let o=e(t.scale).map(s=>/%$/.test(s)?String(parseFloat(s)/100):s);r.push(o.length>2?`scale3d(${o.join(",")})`:`scale(${o.join(",")})`)}if(n(t.baseTransform)&&r.push(t.baseTransform),!r.length)return new DOMMatrix;let i=r.join(" ");try{if(i.includes("%"))throw new Error("Transform needs a reference box");return new DOMMatrix(i)}catch{let o=Ql(),s=document.createElement("div");if(s.style.cssText="all:initial!important;display:block!important;transform-origin:0 0!important",s.style.setProperty("width",`${Number.isFinite(t.width)?t.width:0}px`,"important"),s.style.setProperty("height",`${Number.isFinite(t.height)?t.height:0}px`,"important"),s.style.setProperty("transform",i,"important"),!s.style.transform)throw new Error("Invalid transform composition");o.appendChild(s);try{return Jl(s)}finally{s.remove()}}}function gs(t){let e=O(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let i=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",o=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(i||o||s)}function Jl(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}var Ss=new WeakSet;function Ln(t,e){if(!e)return null;let n=t.ownerDocument||document,r=n.defaultView||window,i,o,s,a;if(e==="viewport")i=0,o=0,s=n.documentElement?.clientWidth||r.innerWidth,a=n.documentElement?.clientHeight||r.innerHeight;else if(typeof e=="object")i=(Number(e.x)||0)-(r.scrollX||0),o=(Number(e.y)||0)-(r.scrollY||0),s=Number(e.width),a=Number(e.height);else return null;return s>0&&a>0?{left:i,top:o,width:s,height:a,right:i+s,bottom:o+a}:null}function ro(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode&&t.getRootNode();return le(e)?e.host:null}function Zl(t,e){for(let n=e;n;n=ro(n))if(n===t)return!0;return!1}function tf(t,e){for(let n=ro(t);n&&n!==e&&n?.nodeType===1;n=ro(n)){let r=O(n);if(r.position!=="static"||r.transform&&r.transform!=="none"||r.filter&&r.filter!=="none"||r.backdropFilter&&r.backdropFilter!=="none"||r.perspective&&r.perspective!=="none"||/transform|perspective|filter/.test(r.willChange||"")||/layout|paint|strict|content/.test(r.contain||""))return n}return null}function io(t,e){try{return Ht({baseTransform:t,rotate:e?.rotate,scale:e?.scale})}catch{return null}}function xs(t,e,n,r,i){let o=t.getBoundingClientRect();Ft(e)&&O(t).position==="static"&&(e.style.position="relative");let s=[];for(let[a,c]of n){if(!Ft(a)||c?.nodeType!==1||c===t||!Zl(t,c))continue;let f=r.get(c)||O(c),l=f.position;if(l!=="fixed"&&l!=="sticky"&&l!=="-webkit-sticky"||a.style.position==="absolute")continue;let u=c.getBoundingClientRect();if(!(u.width>0&&u.height>0))continue;Ss.add(a);let p=f.transform&&f.transform!=="none"?f.transform:"",m=re(c),d=!!(p||m.rotate!=="0deg"||m.scale||m.translate),h=d?io(p,m):null,g=!h||!h.is2D||h.a===1&&h.b===0&&h.c===0&&h.d===1,y=u.width,b=u.height;g||(y=c.offsetWidth||u.width,b=c.offsetHeight||u.height);let w=c.getRootNode&&le(c.getRootNode()),C=o,x=t.clientLeft||0,S=t.clientTop||0;if(w){let R=tf(c,t);R&&(C=R.getBoundingClientRect(),x=R.clientLeft||0,S=R.clientTop||0)}let A=u.left-C.left-x,v=u.top-C.top-S;if(d)if(a.style.translate="none",a.style.rotate="none",a.style.scale="none",g)a.style.transform="none";else{a.style.transform=`matrix(${h.a},${h.b},${h.c},${h.d},0,0)`;let{ox:R,oy:E}=rn(f,y,b),T=Ee(y,b,{a:h.a,b:h.b,c:h.c,d:h.d,e:0,f:0},R,E);A-=T.minX,v-=T.minY}if(l!=="fixed"){let R=a.cloneNode(!1);R.setAttribute("data-snap-ph","1"),R.style.position="static",R.style.visibility="hidden",R.style.width=`${y}px`,R.style.height=`${b}px`,R.style.boxSizing="border-box",a.parentElement?.insertBefore(R,a)}let M=y+2,k=b;i&&(Math.abs(v-i.y)<.5&&(v-=1,k+=1),Math.abs(A-i.x)<.5&&(A-=1,M+=1)),a.style.position="absolute",a.style.left=`${A}px`,a.style.top=`${v}px`,a.style.right="auto",a.style.bottom="auto",a.style.margin="0",a.style.width=`${M}px`,a.style.height=`${k}px`,a.style.boxSizing="border-box",w||s.push(a)}for(let a of s)e.appendChild(a)}function vs(t,e,n={}){if(!t||!e||!e.style)return;let r=getComputedStyle(t);try{e.style.boxShadow="none"}catch(s){U(n,"stripRootShadows boxShadow",s)}try{e.style.textShadow="none"}catch(s){U(n,"stripRootShadows textShadow",s)}try{e.style.outline="none"}catch(s){U(n,"stripRootShadows outline",s)}let o=(r.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=o.length?o:"none"}catch(s){U(n,"stripRootShadows filter",s)}}function ks(t,e){if(!t||!e||!e.style)return;let n=1;try{n=parseFloat(getComputedStyle(t).zoom)}catch{return}if(!(!e.style.getPropertyValue("zoom")&&(!Number.isFinite(n)||n===1)))try{e.style.setProperty("zoom","1","important")}catch{}}function ys(t){let e=t.display||"";if(e.includes("flex")||e.includes("grid")||e.startsWith("table")||e==="inline-block"||e==="flow-root"||t.position==="absolute"||t.position==="fixed"||t.float&&t.float!=="none")return!0;let n=t.overflowX||t.overflow||"visible",r=t.overflowY||t.overflow||"visible";return!!(n!=="visible"||r!=="visible"||t.contain&&/\b(layout|content|paint|strict)\b/.test(t.contain))}function ef(t,e){let n=Array.from(t.childNodes),r=e==="top"?n:n.reverse();for(let i of r){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let o=getComputedStyle(i),s=String(o.display||"");if(!(s==="none"||s==="contents")&&!(o.position==="absolute"||o.position==="fixed"))return o.float&&o.float!=="none"||s.startsWith("inline")?null:i}return null}function Cs(t,e,n){if(!t||!e||!e.style)return;let r=getComputedStyle(t);if(!ys(r))for(let i of["top","bottom"]){let o=i==="top"?"Top":"Bottom";if((parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)continue;let s=t,a=e;for(;s&&a;){let c=ef(s,i);if(!c)break;let f=n?Array.from(a.children).find(p=>n.get(p)===c)||null:a.children[Array.from(s.children).indexOf(c)]||null,l=getComputedStyle(c),u=parseFloat(l[`margin${o}`])||0;if(f&&f.style&&u>0&&(f.style[`margin${o}`]="0px"),ys(l)||(parseFloat(l[`border${o}Width`])||0)>0||(parseFloat(l[`padding${o}`])||0)>0)break;s=c,a=f}}}var nf=new Set(["xml","xlink"]);function rf(t,e){if(t.startsWith("*")||t.includes("@"))return!0;if(t.includes(":")){let n=t.split(":",1)[0];if(!nf.has(n))return!0}return e?t.startsWith("x-")||t.startsWith("v-")||t.startsWith(":")||t.startsWith("on:")||t.startsWith("bind:")||t.startsWith("let:")||t.startsWith("class:"):!1}var of=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,bs=t=>t.replace(of,e=>e.length===2?e:""),sf=/^data:[^,]{0,120};base64,/;function In(t,e={}){if(!t)return;let{stripFrameworkDirectives:n=!0}=e,r=a=>{for(let c of Array.from(a.attributes)){if(rf(c.name,n)){a.removeAttribute(c.name);continue}if(sf.test(c.value))continue;let f=bs(c.value);if(f!==c.value)try{a.setAttribute(c.name,f)}catch{}}};t.nodeType===Node.ELEMENT_NODE&&r(t);let i=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s;for(;s=o.nextNode();)if(s.nodeType===Node.ELEMENT_NODE)r(s);else if(s.nodeType===Node.COMMENT_NODE)i.push(s);else{let a=bs(s.data);a!==s.data&&(s.data=a)}for(let a of i)a.remove()}function af(t){try{let e=t.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(e)}catch{return!1}}var cf=new Set(["img","canvas","video","iframe","object","embed"]);function lf(t){return It(t)||cf.has(t?.localName)}function ff(t,e){if(t?.nodeType!==1||af(t)||lf(t))return!1;let n=e.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=e.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||e.transform&&e.transform!=="none")}function As(t,e,n=new Map,r=null){function i(o,s){if(o?.nodeType!==1||s?.nodeType!==1)return;let a=o.childElementCount>s.childElementCount,c=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,c),a&&ff(o,c)){s.style.height||(s.style.height="auto"),s.style.width||(s.style.width="auto"),s.style.removeProperty("block-size"),s.style.removeProperty("inline-size"),s.style.minHeight||(s.style.minHeight="0"),s.style.minWidth||(s.style.minWidth="0"),s.style.maxHeight||(s.style.maxHeight="none"),s.style.maxWidth||(s.style.maxWidth="none");let l=c.overflowY||c.overflowBlock||"visible",u=c.overflowX||c.overflowInline||"visible";(l!=="visible"||u!=="visible")&&(s.style.overflow="visible")}let f=Array.from(s.children);if(r)for(let l of f){let u=r.get(l);u&&u.nodeType===1&&i(u,l)}else{let l=Array.from(o.children);for(let u=0;u<Math.min(l.length,f.length);u++)i(l[u],f[u])}}i(t,e)}function uf(t){let e=getComputedStyle(t);return!(e.display==="none"||e.position==="absolute"||e.position==="fixed")}function df(t,e){if(t?.nodeType!==1)return!1;if(t.getAttribute("data-capture")==="exclude")return e?.excludeMode==="remove";if(Array.isArray(e?.exclude))for(let n of e.exclude)try{if(t.matches(n))return e.excludeMode==="remove"}catch(r){U(e,"exclude selector match failed",r)}if(Array.isArray(e?.excludePredicates))for(let n of e.excludePredicates)try{if(n(t))return e.excludeMode==="remove"}catch(r){U(e,"exclude predicate failed",r)}if(typeof e?.filter=="function"&&e.filterMode==="remove")try{if(!e.filter(t))return!0}catch(n){U(e,"filter function failed",n)}return!1}function so(t,e){let n=getComputedStyle(t),r=t.getBoundingClientRect(),i=1/0,o=-1/0,s=!1,a=Array.from(t.children);for(let m of a){if(df(m,e)||!uf(m))continue;let d=m.getBoundingClientRect(),h=d.top-r.top,g=d.bottom-r.top;g<=h||(h<i&&(i=h),g>o&&(o=g),s=!0)}let c=s?Math.max(0,o-i):0,f=parseFloat(n.borderTopWidth)||0,l=parseFloat(n.borderBottomWidth)||0,u=parseFloat(n.paddingTop)||0,p=parseFloat(n.paddingBottom)||0;return f+l+u+p+c}var I=(t,e=3)=>Number.isFinite(t)?Math.round(t*10**e)/10**e:t,_e=.75;function Ms(t,e,n,r,i,o){let s=t.ownerDocument||document,a=t.getBoundingClientRect(),c=i>0&&a.width>0?a.width/i:1,f=o>0&&a.height>0?a.height/o:1;if(Math.abs(c-f)>.02)return 0;let l=s.createElement("div");Q(l),l.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let u=l.attachShadow({mode:"open"}),p=s.createElement("style");p.textContent=n,u.appendChild(p);let m=e.cloneNode(!0);u.appendChild(m),s.body.appendChild(l);let d=0,h=(g,y,b)=>{let w=O(g),C=w.boxSizing==="border-box",x=(S,A,...v)=>{let M=parseFloat(S);if(!Number.isFinite(M))return A;let k=M+(C?0:v.reduce((R,E)=>R+(parseFloat(E)||0),0));return Math.abs(k-A)<=.51?k:A};return{width:x(w.width,y,w.paddingLeft,w.paddingRight,w.borderLeftWidth,w.borderRightWidth),height:x(w.height,b,w.paddingTop,w.paddingBottom,w.borderTopWidth,w.borderBottomWidth)}};try{let g=m.getBoundingClientRect(),y=m.offsetWidth||i,b=m.offsetHeight||o,w=y>0&&g.width>0?g.width/y:1,C=b>0&&g.height>0?g.height/b:1,x=(S,A,v=!1)=>{let M=S.children,k=A.children,R=Math.min(M.length,k.length);for(let E=0;E<R;E++){let T=M[E],N=k[E],B=r.get(T),j=v||Ss.has(T);if(B?.nodeType===1&&Ft(T)&&T.style&&B.isConnected){let _=B.getBoundingClientRect();if(_.width>0&&_.height>0){let W=N.getBoundingClientRect(),$=_.width/c,F=_.height/f,L=W.width,V=W.height,q=B.offsetWidth||$,pt=B.offsetHeight||F,et=N.offsetWidth||L,bt=N.offsetHeight||V,ae=Math.abs($-q)>_e||Math.abs(F-pt)>_e||Math.abs(L-et)>_e||Math.abs(V-bt)>_e;if(j){let H=h(N,et,bt);$=L>0?$*w*H.width/L:$,F=V>0?F*C*H.height/V:F,L=H.width,V=H.height}else if(ae){let H=h(B,q,pt),z=h(N,et,bt);$=H.width,F=H.height,L=z.width,V=z.height}let ht=L-$,D=V-F;(Math.abs(ht)>_e||Math.abs(D)>_e)&&(T.style.boxSizing="border-box",T.style.width=`${I($)}px`,T.style.height=`${I(F)}px`,d++)}}x(T,N,j)}};x(e,m)}finally{l.remove()}return d}var pf=/::-webkit-scrollbar(-[a-z]+)?\b/i;function oo(t,e=new Set){let n="";if(!t)return n;for(let r=0;r<t.length;r++){let i=t[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=oo(i.styleSheet.cssRules,e);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let o=oo(i.cssRules,e);o&&(n+=`@media ${i.conditionText}{${o}}`);continue}if(i.type===CSSRule.STYLE_RULE){let o=i.selectorText||"";if(pf.test(o)){let s=i.cssText;s&&!e.has(s)&&(e.add(s),n+=s)}}}catch{}}return n}var ws=new WeakMap;function hf(t){let e="";for(let n of t.styleSheets){let r=-1;try{r=n.cssRules?n.cssRules.length:-1}catch{}e+=(n.href||"inline")+":"+r+"|"}return e}function mf(t){if(!t||!t.styleSheets)return"";let e=hf(t),n=ws.get(t);if(n&&n.fp===e)return n.css;let r=new Set,i="";for(let o of Array.from(t.styleSheets))try{let s=o.cssRules;s&&(i+=oo(s,r))}catch{}return ws.set(t,{fp:e,css:i}),i}function Es(t,e){let n=kr(t.clone).sort(),r=n.join(","),i;P.baseStyle.has(r)?i=P.baseStyle.get(r):(i=Cr(n,Je(t.element)),P.baseStyle.set(r,i));let o=mf(t.element?.ownerDocument||document);return t.fontsCSS=e,t.baseCSS=i,t.scrollbarCSS=o,{baseCSS:i,scrollbarCSS:o,fontsCSS:e}}St();var Wn=new Set;async function _s(t,e={}){Et(),bn(t.ownerDocument||document);let n=e.__session||{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:e},i=null,o=null;if(e.clip&&(o=Ln(t,e.clip),o&&(r.clip={rect:o,root:t})),e.captureSelection)try{r.selection=Li(t)}catch(d){U(r,"prepareSelectionContext failed",d)}let s,a="",c="";if(Wn.size){let d=(h,g)=>{for(let y=g;y;y=y.assignedSlot||y.parentElement||y.getRootNode()?.host)if(y===h)return!0;return!1};for(;;){let h=[...Wn].filter(({root:g})=>d(g,t)||d(t,g)).map(({promise:g})=>g.catch(()=>{}));if(!h.length)break;await Promise.all(h)}}if(!r.clip&&t.isConnected&&t.ownerDocument?.visibilityState!=="hidden")try{let d=t.getBoundingClientRect(),h=t.ownerDocument?.defaultView||window,g=d.right<=0||d.bottom<=0||d.left>=h.innerWidth||d.top>=h.innerHeight,y=[];if(g&&(()=>{let w=[];t.shadowRoot&&w.push(t.shadowRoot);for(let C of t.querySelectorAll("*"))C.shadowRoot&&w.push(C.shadowRoot);for(;w.length;){let C=w.pop(),x=C.host?.localName==="calcite-icon";for(let S of C.querySelectorAll("*")){if(S.shadowRoot&&w.push(S.shadowRoot),!x||S.localName!=="svg")continue;let A=S.querySelectorAll("path");if(!A.length||[...A].some(M=>M.getAttribute("d")?.trim()))continue;let v=S.getBoundingClientRect();v.width&&v.height&&y.push(S)}}})(),y.length){let w=(async()=>{let x=t.style,S=t.hasAttribute("style"),A=new Map,v=(M,k)=>{A.has(M)||A.set(M,{value:x.getPropertyValue(M),priority:x.getPropertyPriority(M)}),x.setProperty(M,k,"important");let R=A.get(M);R.forcedValue=x.getPropertyValue(M),R.forcedPriority=x.getPropertyPriority(M)};try{v("left","0"),v("top","0"),v("right","auto"),v("bottom","auto"),v("margin-top","0"),v("margin-right","0"),v("margin-bottom","0"),v("margin-left","0"),v("transform","none"),v("translate","none"),v("opacity","0"),v("pointer-events","none");let M=t.getBoundingClientRect();if(M.right<=0||M.bottom<=0||M.left>=h.innerWidth||M.top>=h.innerHeight){let E=t.parentElement?.getBoundingClientRect(),T=E&&E.right>0&&E.left<h.innerWidth?Math.max(0,E.left):0,N=E&&E.bottom>0&&E.top<h.innerHeight?Math.max(0,E.top):0;v("position","fixed"),v("left",`${T}px`),v("top",`${N}px`)}await ft(100);let k=Date.now()+1500,R=()=>y.some(E=>{if([...E.querySelectorAll("path")].some(N=>N.getAttribute("d")?.trim()))return!1;let T=E.getBoundingClientRect();return T.width&&T.height&&T.right>0&&T.bottom>0&&T.left<h.innerWidth&&T.top<h.innerHeight});for(;Date.now()<k&&R();)await new Promise(E=>setTimeout(E,25));await ft(100)}finally{for(let[M,k]of A)x.getPropertyValue(M)!==k.forcedValue||x.getPropertyPriority(M)!==k.forcedPriority||(k.value?x.setProperty(M,k.value,k.priority):x.removeProperty(M));!S&&!x.length&&t.removeAttribute("style"),await ft(100)}})(),C={root:t,promise:w};Wn.add(C);try{await w}finally{Wn.delete(C)}}}catch{}let f=us(t),l=Nn(t,o);if(o){let d=t.getBoundingClientRect(),h=t.offsetWidth||d.width,g=t.offsetHeight||d.height,y=d.width&&Math.abs(h-d.width)>=1?h/d.width:1,b=d.height&&Math.abs(g-d.height)>=1?g/d.height:1;i={x:(o.left-d.left)*y,y:(o.top-d.top)*b,width:o.width*y,height:o.height*b}}try{s=await ne(t,r,e)}catch(d){throw console.warn("deepClone failed:",d),d}finally{l(),f()}try{fs(s,void 0,t)}catch(d){console.warn("inlineExternal defs or symbol failed:",d)}try{await Me(t,s,r,e)}catch(d){console.warn("inlinePseudoElements failed:",d)}await xn(s,r);for(let[d,h]of r.nodeMap.entries())if(h?.tagName==="STYLE"&&d?.tagName==="STYLE"&&!d.hasAttribute("data-sd"))try{let g=h.sheet&&h.sheet.cssRules;g&&/@media/i.test(d.textContent||"")&&(d.textContent=ee(g))}catch{}try{let d=s.querySelectorAll("style[data-sd]");for(let h of d)c+=h.textContent||"",h.remove()}catch(d){U(r,"Failed to extract shadow CSS from style[data-sd]",d)}let u=qe(r.styleMap);a=Array.from(u.entries()).map(([d,h])=>`.${h}{${d}}`).join("");let m=c+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+(r.__pseudoCSS||"");a=m+a;for(let[d,h]of r.styleMap.entries())ao(d,h,u);try{gf(t,s,r.nodeMap)}catch(d){U(r,"top-layer lift failed",d)}if((r.clip||t.scrollTop||t.scrollLeft)&&s?.nodeType===1)try{let d=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};xs(t,s,r.nodeMap,r.styleCache,d)}catch(d){U(r,"freezeViewportPositioned failed",d)}for(let[d,h]of r.nodeMap.entries())r.clip&&h===t||co(d,h);if(t===r.nodeMap.get(s)){let d=r.styleCache.get(t)||O(t);r.styleCache.set(t,d);let h=ur(d.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=h||"",s.style.translate="none"}for(let[d,h]of r.nodeMap.entries())h.tagName==="PRE"&&(d.style.marginTop="0",d.style.marginBlockStart="0");return{clone:s,classCSS:a,classPrefixCSS:m,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}function gf(t,e,n){let r=[];for(let s of[":modal",":popover-open"])try{r.push(...t.querySelectorAll(s))}catch{}if(!r.length)return;let i=new Map;for(let[s,a]of n.entries())i.set(a,s);let o=214748e4;for(let s of r){let a=i.get(s);if(!(!a||a===e||a.parentNode==null)){try{let c=getComputedStyle(s,"::backdrop"),f=c.backgroundColor,l=c.backgroundImage;if(f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"||l&&l!=="none"){let p=document.createElement("div");p.setAttribute("data-sd-backdrop",""),p.style.cssText=`position:fixed;inset:0;z-index:${o};background-color:${f};`+(l&&l!=="none"&&l.includes("data:")?`background-image:${l};`:""),e.appendChild(p)}}catch{}o+=1,a.style.zIndex=String(o),e.appendChild(a),o+=1}}}function ao(t,e,n){if(t.tagName==="STYLE")return;if(t.getRootNode&&le(t.getRootNode())){t.setAttribute("style",e.replace(/;/g,"; "));return}let r=n.get(e);r&&t.classList.add(r);let i=t.style?.backgroundImage,o=t.dataset?.snapdomHasIcon;i&&i!=="none"&&(t.style.backgroundImage=i),o&&(t.style.verticalAlign="middle",t.style.display="inline")}function co(t,e){let n=e.scrollLeft,r=e.scrollTop;if(!(n||r)||t?.nodeType!==1||t.namespaceURI!=="http://www.w3.org/1999/xhtml")return;t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";try{let s=t.querySelectorAll("*");for(let a of s){if(a.nodeType!==1||a.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let c=a.style.position;if(c==="fixed"||c==="absolute"){let f=parseFloat(a.style.top)||0,l=parseFloat(a.style.left)||0;a.style.top=`${f+r}px`,a.style.left=`${l+n}px`,c==="fixed"&&(a.style.position="absolute")}}}catch{}let o=document.createElement("div");for(o.style.all="unset",o.style.transform=`translate(${-n}px, ${-r}px)`,o.style.willChange="transform",o.style.display="inline-block",o.style.width="100%";t.firstChild;)o.appendChild(t.firstChild);t.appendChild(o)}fe();Xt();lt();var Rs="http://www.w3.org/1999/xlink";function yf(t){return t.getAttribute("href")||t.getAttribute("xlink:href")||(typeof t.getAttributeNS=="function"?t.getAttributeNS(Rs,"href"):null)}function bf(t){let e=parseInt(t.dataset?.snapdomWidth||"",10)||0,n=parseInt(t.dataset?.snapdomHeight||"",10)||0,r=parseInt(t.getAttribute("width")||"",10)||0,i=parseInt(t.getAttribute("height")||"",10)||0,o=parseFloat(t.style?.width||"")||0,s=parseFloat(t.style?.height||"")||0,a=e||o||r||t.width||t.naturalWidth||100,c=n||s||i||t.height||t.naturalHeight||100;return{width:a,height:c}}async function On(t,e={}){let n=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&n.unshift(t);let r=async a=>{if(!a.getAttribute("src")){let d=a.currentSrc||a.src||ve(a.getAttribute("srcset"),a)||"";d&&a.setAttribute("src",d)}if(a.removeAttribute("srcset"),a.removeAttribute("sizes"),(a.getAttribute("src")||"").startsWith("data:")){a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let c=a.src||"";if(!c)return;let f=P.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 ot(c,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){P.image?.set(c,l.data),a.src=l.data,l.blob&&(a.__snapdomBlob=l.blob),a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:u,height:p}=bf(a),{fallbackURL:m}=e||{};if(m)try{let d=typeof m=="function"?await m({width:u,height:p,src:c,element:a}):m;if(d){let h=await ot(d,{as:"dataURL",useProxy:e.useProxy});if(h?.ok&&typeof h.data=="string"){a.src=h.data,a.width||(a.width=u),a.height||(a.height=p);return}}}catch{}if(e.placeholders!==!1){gt(e.__session,"image-fallback",`image failed to inline, using placeholder: ${c}`);let d=document.createElement("div");d.style.cssText=[`width:${u}px`,`height:${p}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${p}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),d.textContent="img",a.replaceWith(d)}else{let d=document.createElement("div");d.style.cssText=`display:inline-block;width:${u}px;height:${p}px;visibility:hidden;`,a.replaceWith(d)}},i=6;for(let a=0;a<n.length;a+=i){let c=n.slice(a,a+i).map(r);await Promise.allSettled(c)}let o=Array.from(t.querySelectorAll("image"));t.localName==="image"&&o.unshift(t);let s=async a=>{let c=yf(a);if(!c||c.startsWith("data:")||c.startsWith("blob:"))return;let f=await ot(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(Rs,"href"))};for(let a=0;a<o.length;a+=i){let c=o.slice(a,a+i).map(s);await Promise.allSettled(c)}}St();ut();var wf=["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"],Sf=["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"],xf=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],vf=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function kf(t,e,n,r){let i=n.get(t)||O(t);n.has(t)||n.set(t,i);let o=ui(t),s=o?d=>d in o?o[d]:"":d=>i.getPropertyValue(d),a=s("border-image"),c=s("border-image-source"),f=a&&a!=="none"||c&&c!=="none",l=i.getPropertyValue("background-image"),u=s("background-color"),p=l&&l!=="none"||u&&u!=="rgba(0, 0, 0, 0)"&&u!=="transparent"||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""),m=Dt()&&(s("background-clip")||s("-webkit-background-clip")||"").includes("text");if(p&&!m)for(let d of xf){let h=s(d);h&&e.style.setProperty(d,h)}for(let d of wf){if(m&&d==="background-image")continue;let h=i.getPropertyValue(d);if(d==="background-image"&&(!h||h==="none")){let b=i.getPropertyValue("background");b&&/url\s*\(/.test(b)&&(h=Ot(b).filter(w=>/url\s*\(/.test(w)).join(", ")||h)}if(!h||h==="none")continue;let g=Ot(h),y=await Promise.all(g.map(b=>ue(b,r)));y.some(b=>b&&b!=="none"&&!/^url\(undefined/.test(b))&&e.style.setProperty(d,y.join(", "))}for(let d of Sf){let h=s(d);!h||h==="initial"||e.style.setProperty(d,h)}if(f)for(let d of vf){let h=s(d);!h||h==="initial"||e.style.setProperty(d,h)}if(p&&/fixed/.test(s("background-attachment")||""))try{await Af(t,e,i)}catch{}}function Cf(t,e,n,r,i){let o=(t||"auto").trim();if(o==="cover"||o==="contain"){if(!e||!n)return{w:r,h:i};let p=o==="cover"?Math.max(r/e,i/n):Math.min(r/e,i/n);return{w:e*p,h:n*p}}let s=o.split(/\s+/),a=(p,m)=>{if(p==="auto"||p===void 0)return null;if(p.endsWith("px"))return parseFloat(p);if(p.endsWith("%"))return m*parseFloat(p)/100},c=a(s[0],r),f=a(s[1],i);if(c===void 0||f===void 0)return null;let l=c,u=f;return l==null&&u==null?(l=e||r,u=n||i):l==null?l=e&&n?u*(e/n):r:u==null&&(u=e&&n?l*(n/e):i),!l||!u?null:{w:l,h:u}}async function Af(t,e,n){let r=(n.getPropertyValue("background-attachment")||"").split(",").map(d=>d.trim()),i=Ge();if(!i)for(let d=t.parentElement;d&&!i;d=d.parentElement){let h=O(d);(h.transform&&h.transform!=="none"||h.filter&&h.filter!=="none")&&(i=!0)}if(i){e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "));return}let o=t.getBoundingClientRect(),s=t.ownerDocument?.defaultView||window,a=s.innerWidth,c=s.innerHeight,f=Ot(e.style.backgroundImage||n.getPropertyValue("background-image")||""),l=(e.style.backgroundSize||n.getPropertyValue("background-size")||"auto").split(",").map(d=>d.trim()),u=(e.style.backgroundPosition||n.getPropertyValue("background-position")||"0% 0%").split(",").map(d=>d.trim()),p=[],m=[];for(let d=0;d<f.length;d++){let h=r[d%r.length]||"scroll",g=l[d%l.length],y=u[d%u.length];if(h!=="fixed"){p.push(g),m.push(y);continue}let b=0,w=0,C=f[d]&&f[d].match(/url\(["']?([^"')]+)["']?\)/);if(C)try{let k=new Image;k.src=C[1],await k.decode(),b=k.naturalWidth,w=k.naturalHeight}catch{p.push(g),m.push(y);continue}let x=Cf(g,b,w,a,c);if(!x){p.push(g),m.push(y);continue}let S=y.split(/\s+/),A=(k,R,E)=>{if(!k)return 0;if(k.endsWith("px"))return parseFloat(k);if(k.endsWith("%"))return(R-E)*parseFloat(k)/100},v=A(S[0]||"0%",a,x.w),M=A(S[1]||S[0]||"0%",c,x.h);if(v===void 0||M===void 0){p.push(g),m.push(y);continue}p.push(`${Dn(x.w)}px ${Dn(x.h)}px`),m.push(`${Dn(v-o.left)}px ${Dn(M-o.top)}px`)}e.style.setProperty("background-size",p.join(", ")),e.style.setProperty("background-position",m.join(", ")),e.style.setProperty("background-attachment",r.map(()=>"scroll").join(", "))}var Dn=t=>Math.round(t*100)/100;async function Bn(t,e,n,r={},i=new Map){if(!e)return;let o=[];t&&Lr(t)&&o.push([t,e]);let s=[e];for(;s.length;){let c=s.pop();if(c.children)for(let f of c.children){if(f.tagName==="STYLE")continue;let l=i.get(f);l&&Lr(l)&&o.push([l,f]),s.push(f)}}let a=6;for(let c=0;c<o.length;c+=a)await Promise.allSettled(o.slice(c,c+a).map(([f,l])=>kf(f,l,n,r)))}ut();function Ts(t,e,n=new Map){let r=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let a=i.currentNode;a;a=i.nextNode()){let c=n.get(a);if(c?.nodeType!==1)continue;let f=O(c),l=f.getPropertyValue("backdrop-filter")||f.getPropertyValue("-webkit-backdrop-filter");l&&l!=="none"&&a!==e&&r.push({cloneEl:a,orig:c,bf:l,path:Rf(e,a)})}if(!r.length)return;let o=t.getBoundingClientRect(),s=r.map((a,c)=>{let f=e.cloneNode(!0);_f(f,e,a.orig.getBoundingClientRect(),n),Ff(Fs(f,a.path));for(let l=0;l<c;l++){let u=Fs(f,r[l].path);u&&(u.style.setProperty("backdrop-filter","none","important"),u.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...a,copy:f}});for(let{cloneEl:a,orig:c,bf:f,copy:l}of s)Mf.has(a.tagName)||Ef(a,c,f,l,o)}var Mf=new Set(["IMG","INPUT","TEXTAREA","SELECT","CANVAS","VIDEO","AUDIO","IFRAME","EMBED","OBJECT","PROGRESS","METER","HR","BR"]);function Ef(t,e,n,r,i){let o=e.getBoundingClientRect();if(!o.width||!o.height)return;let s=O(e),a=e.offsetWidth?o.width/e.offsetWidth:1,c=Math.abs(a-1)>.001?1/a:1;r.style.position="absolute",r.style.left=`${(i.left-o.left)*c}px`,r.style.top=`${(i.top-o.top)*c}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin="0",r.style.filter=n,c!==1&&(r.style.transform=`scale(${c})`,r.style.transformOrigin="top left");let f=document.createElement("div");f.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",f.appendChild(r);let l=document.createElement("div");l.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",l.style.backgroundColor=s.backgroundColor,l.style.backgroundImage=t.style.backgroundImage||s.backgroundImage;for(let u of["background-size","background-position","background-repeat","background-origin","background-clip"])l.style.setProperty(u,s.getPropertyValue(u));t.style.setProperty("background-color","transparent","important"),t.style.setProperty("background-image","none","important"),t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"),s.position==="static"&&(t.style.position="relative"),t.style.isolation="isolate",t.prepend(l),t.prepend(f)}var Un=128;function _f(t,e,n,r){let i=[[t,e]];for(;i.length;){let[o,s]=i.pop(),a=r.get(s);if(a?.nodeType===1){let l=a.getBoundingClientRect();(l.left>n.right+Un||l.right<n.left-Un||l.top>n.bottom+Un||l.bottom<n.top-Un)&&(o.tagName==="IMG"&&o.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),o.style&&(o.style.backgroundImage="none"))}let c=o.children,f=s.children;for(let l=0;l<c.length;l++)i.push([c[l],f[l]])}}function Rf(t,e){let n=[];for(let r=e;r!==t;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function Fs(t,e){if(!e)return null;let n=t;for(let r of e)if(n=n.children[r],!n)return null;return n}function Ff(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}}ut();lt();lt();function $s(t){return Uo(t),{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map,warnings:[]}}Xt();function zn(t,e){if(!t)return()=>{};let n=[],r=200;function i(o){if(e){let f=o.getBoundingClientRect();if(f.width>0||f.height>0){let l=Math.max(f.right,f.left+(o.scrollWidth||0)),u=Math.max(f.bottom,f.top+(o.scrollHeight||0));if(l<e.left-r||f.left>e.right+r||u<e.top-r||f.top>e.bottom+r)return}}let s=getComputedStyle(o),a=Tf(o,s);a&&n.push(a);let c=$f(o,s);c&&n.push(c);for(let f of o.children||[])i(f)}return i(t),()=>n.forEach(o=>o())}function Tf(t,e){if(!t)return()=>{};e=e||getComputedStyle(t);let n=Pf(e);if(n<=0)return()=>{};if(!Ls(t))return()=>{};let r=Ns(t),i=r.text,o=Lf(e);r.write("X");let s=t.scrollHeight-o;r.restore();let a=s>0?s:Nf(e),c=Math.round(a*n+o);if(t.scrollHeight<=c+.5)return()=>{};let f=0,l=i.length,u=-1;for(;f<=l;){let m=f+l>>1;r.write(i.slice(0,Hn(i,m))+"\u2026"),t.scrollHeight<=c+.5?(u=m,f=m+1):l=m-1}let p=(u>=0?i.slice(0,Hn(i,u)):"")+"\u2026";return r.write(p),Ps(t,p,r)}function $f(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(!Ls(t))return()=>{};if(t.scrollWidth<=t.clientWidth+.5)return()=>{};let n=Ns(t),r=n.text,i=0,o=r.length,s=-1;for(;i<=o;){let c=i+o>>1;n.write(r.slice(0,Hn(r,c))+"\u2026"),t.scrollWidth<=t.clientWidth+.5?(s=c,i=c+1):o=c-1}let a=(s>=0?r.slice(0,Hn(r,s)):"")+"\u2026";return n.write(a),Ps(t,a,n)}function Ps(t,e,n){return()=>{t.textContent===e&&n.restore()}}function Ns(t){let e=[];for(let r=t.firstChild;r;r=r.nextSibling)r.nodeType===Node.TEXT_NODE&&e.push(r);let n=e.map(r=>r.data);return{text:n.join(""),write(r){e[0].data=r;for(let i=1;i<e.length;i++)e[i].data=""},restore(){for(let r=0;r<e.length;r++)e[r].data=n[r]}}}function Hn(t,e){if(e<=0||e>=t.length)return e;let n=t.charCodeAt(e-1);return n>=55296&&n<=56319?e-1:e}function Pf(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 Nf(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 Lf(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function Ls(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var Re=["clone","render"],on={clone:0,render:1},ct="render";function Is(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];if(!e.length)return{stage:ct,loweredBy:[]};let n=-1,r=[];for(let o of e){if(!o||typeof o!="object")continue;let s=o.needs===void 0?ct:o.needs;if(!Object.prototype.hasOwnProperty.call(on,s))throw new Error(`[snapdom] plugin '${o.name||"(unnamed)"}' declares needs: ${JSON.stringify(s)}, expected one of ${Re.join(", ")}`);r.push({name:o.name||"(unnamed)",needs:s}),n=Math.max(n,on[s])}if(n<0)return{stage:ct,loweredBy:[]};let i=Re[n];return{loweredBy:i===ct?[]:r.filter(o=>o.needs===i).map(o=>o.name),stage:i}}function Fe(t,e){return on[t]>=on[e]}function Ws(t,e,n=Re){let r=n[n.length-1];if(e==null)return r;if(!Object.prototype.hasOwnProperty.call(on,e))throw new Error(`[snapdom] ${t}: needs must be one of ${Re.join(", ")}, got ${JSON.stringify(e)}`);if(!n.includes(e))throw new Error(`[snapdom] ${t} cannot run at stage '${e}': it supports ${n.join(", ")}`);return e}function Os(t,e,n){let r=e.length?e.map(i=>`'${i}'`).join(", "):"the attached plugins";return new Error(`[snapdom] no ${n}: this capture stopped at '${t}' because ${r} declared needs: '${t}' (result.needs says so too). It is not re-captured on demand \u2014 that would be a different instant. Ask the plugin for needs: 'render', or capture without it.`)}var Te=[];function $e(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 lo(...t){let e=t.flat();for(let n of e){let r=$e(n);if(r){if(r.needs!==void 0&&r.needs!==ct)throw new Error(`[snapdom] global plugin '${r.name||"(unnamed)"}' declares needs: ${JSON.stringify(r.needs)}. A global plugin must run to '${ct}': lowering it here would stop EVERY capture in the app short of pixels. Pass it per capture instead: snapdom(el, { plugins: [<plugin>] }).`);Te.some(i=>i&&i.name&&r.name&&i.name===r.name)||Te.push(r)}}}function Ds(t){return t&&Array.isArray(t.plugins)?t.plugins:Te}async function $t(t,e,n){let r=n,i=Ds(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,r);typeof a<"u"&&(r=a)}return r}async function jn(t,e,n){let r=[],i=Ds(e);for(let o of i){let s=o&&typeof o[t]=="function"?o[t]:null;if(!s)continue;let a=await s(e,n);typeof a<"u"&&r.push(a)}return r}function If(){Te.length=0}var Wf=0;function Of(t){let e=[];if(Array.isArray(t))for(let n of t){let r=$e(n);if(!r)continue;r.name||(r.name=`anonymous-${++Wf}`);let i=e.findIndex(o=>o&&o.name===r.name);i>=0&&e.splice(i,1),e.push(r)}for(let n of Te)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function Bs(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Of(e)),t}function fo(){return Te.slice()}var Df=["resolveNode","beforeSnap","beforeClone","afterClone","beforeRender","afterRender"];function Vn(t){let e=Array.isArray(t&&t.plugins)?t.plugins:[];for(let n of e){let r=$e(n);if(!(!r||r.pure===!0)){for(let i of Df)if(typeof r[i]=="function")return!0}}return!1}lt();me();var ie="data-snapdom-asset",js="http://www.w3.org/1999/xlink",Bf=0;function Gn(t,e,n,r,i,o){let s=o.__compressedAssets||=new WeakMap,a=s.get(t);a||(a={token:String(++Bf),properties:[]},s.set(t,a),t.setAttribute(ie,a.token));let c=a.properties.find(f=>f.kind===e&&f.name===n);c?(c.compressed!==r&&(c.original=r),c.compressed=i):a.properties.push({kind:e,name:n,original:r,compressed:i})}var Vs=(t,e)=>e.kind==="style"?t.style?.getPropertyValue(e.name):t.getAttribute(e.name);function Xn(t,e){let n=new Map;if(!t||!e)return n;let r=[t,...t.querySelectorAll(`[${ie}]`)];for(let i of r){let o=e.get(i);if(!o||i.getAttribute(ie)!==o.token)continue;let s=o.properties.filter(a=>Vs(i,a)===a.compressed).map(a=>Object.freeze({...a}));s.length&&n.set(o.token,Object.freeze(s))}return n}function Yn(t,e){if(!t||!e)return;let n=0;for(let r of[t,...t.querySelectorAll(`[${ie}]`)]){let i=e.get(r);i&&(i.token=String(++n),r.setAttribute(ie,i.token))}}function qs(t,e){if(!e?.size||typeof t!="string"||!t.startsWith("data:image/svg+xml"))return t;let n=t.indexOf(","),r=new DOMParser().parseFromString(decodeURIComponent(t.slice(n+1)),"image/svg+xml");if(r.querySelector("parsererror"))return t;let i=!1;for(let o of r.querySelectorAll(`[${ie}]`))for(let s of e.get(o.getAttribute(ie))||[])Vs(o,s)===s.compressed&&(s.kind==="style"?o.style.setProperty(s.name,s.original,o.style.getPropertyPriority(s.name)):s.name==="xlink:href"?o.setAttributeNS(js,s.name,s.original):o.setAttribute(s.name,s.original),i=!0);return i?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`:t}function Us(t){if(t.is2D===!1)return 1/0;let e=t.a*t.a+t.b*t.b+t.c*t.c+t.d*t.d,n=t.a*t.d-t.b*t.c;return Math.sqrt((e+Math.sqrt(Math.max(0,e*e-4*n*n)))/2)}function uo(t,e){let n=e.element||t,r=n.isConnected?O(n):n.style,i=e.__compressionClip,o=(m,d)=>{try{return m[d]?.baseVal?.value||0}catch{return 0}},s=i?.width||n.offsetWidth||parseFloat(r?.width)||o(n,"width"),a=i?.height||n.offsetHeight||parseFloat(r?.height)||o(n,"height"),c=Number.isFinite(e.width),f=Number.isFinite(e.height);if(!i&&(c||f)&&s&&a)try{let m=e.outerTransforms===!1&&e.__compressionRootTransform?e.__compressionRootTransform:Ht({baseTransform:r?.transform,rotate:r?.rotate,scale:r?.scale,width:s,height:a});if(m.is2D===!1)s=0,a=0;else{let d=Math.abs(m.a)*s+Math.abs(m.c)*a,h=Math.abs(m.b)*s+Math.abs(m.d)*a;s=Math.min(s,d),a=Math.min(a,h)}}catch{s=0,a=0}let l=(c||f?Math.max(c?s?e.width/s:1/0:0,f?a?e.height/a:1/0:0):e.scale||1)*(e.dpr||1);e.__compressionDensity=l;let u=new WeakMap,p=m=>{if(!m||m.nodeType!==1)return 1;if(u.has(m))return u.get(m);let d=m.isConnected?O(m):m.style,h=1;try{d?.perspective&&d.perspective!=="none"&&(h=1/0);let g=d?.transform;if(g&&g!=="none")h*=Us(new DOMMatrix(g));else if(m.transform?.baseVal?.numberOfItems){let y=new DOMMatrix;for(let b=0;b<m.transform.baseVal.numberOfItems;b++){let w=m.transform.baseVal.getItem(b).matrix;y=y.multiply(new DOMMatrix([w.a,w.b,w.c,w.d,w.e,w.f]))}h*=Us(y)}if(d?.scale&&d.scale!=="none"){let y=d.scale.trim().split(/\s+/).map(b=>parseFloat(b)/(b.endsWith("%")?100:1));h*=Math.max(...y.map(Math.abs))}if(m!==n&&d?.zoom&&d.zoom!=="normal"&&(h*=parseFloat(d.zoom)||1),m.localName==="svg"&&m.viewBox?.baseVal?.width>0&&m.viewBox.baseVal.height>0){let y=m.viewBox.baseVal,b=x=>/^\d+(?:\.\d+)?px$/.test(d?.[x]||"")?parseFloat(d[x]):o(m,x),w=b("width"),C=b("height");h*=w>0&&C>0?Math.max(w/y.width,C/y.height):1/0}}catch{h=1/0}return Number.isFinite(h)||(h=1/0),m!==n&&(h*=p(m.parentElement||m.getRootNode?.().host)),u.set(m,h),h};return{density:l,stretch:p}}var Gs=.92,Xs=1;async function Uf(t){let e=new Image;return e.decoding="sync",e.src=t,typeof e.decode=="function"?(await e.decode(),e):(await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=r}),e)}function Hf(t){let e=/^data:([^;,]+)/.exec(t);return e?e[1]:""}var zf=64*1024,Hs=32*1024*1024,qn=new Map;function jf(t,e,n,r){if(n.length+(r?.length||0)>Hs)return;t.set(e,{source:n,result:r});let i=0;for(let o of t.values())i+=o.source.length+(o.result?.length||0);for(;i>Hs;){let o=t.keys().next().value,s=t.get(o);i-=s.source.length+(s.result?.length||0),t.delete(o)}}function Vf(t,e){let n=t.indexOf(",");if(n<0||!/;base64/i.test(t.slice(0,n)))return null;let r=Math.ceil(e/3)*4,i=t.length-n-1,o=Math.min(i,r);try{let s=atob(t.slice(n+1,n+1+o-o%4)),a=new Uint8Array(s.length);for(let c=0;c<s.length;c++)a[c]=s.charCodeAt(c);return a}catch{return null}}function qf(t){let e=Vf(t,4096);if(!e||e.length<16)return null;let n=r=>e[r]<<8|e[r+1];if(e[0]===137&&e[1]===80&&e.length>=24)return{w:(e[16]<<24|e[17]<<16|e[18]<<8|e[19])>>>0,h:(e[20]<<24|e[21]<<16|e[22]<<8|e[23])>>>0};if(e[0]===71&&e[1]===73&&e[2]===70)return{w:e[6]|e[7]<<8,h:e[8]|e[9]<<8};if(e[0]===82&&e[1]===73&&e[8]===87&&e.length>=30){let r=e[15];if(r===32&&e[23]===157)return{w:(e[26]|e[27]<<8)&16383,h:(e[28]|e[29]<<8)&16383};if(r===76)return{w:(e[21]|(e[22]&63)<<8)+1,h:((e[22]>>6|e[23]<<2|(e[24]&15)<<10)&16383)+1};if(r===88)return{w:(e[24]|e[25]<<8|e[26]<<16)+1,h:(e[27]|e[28]<<8|e[29]<<16)+1}}if(e[0]===255&&e[1]===216){let r=2;for(;r+9<e.length;){if(e[r]!==255){r++;continue}let i=e[r+1];if(i===216||i===1||i>=208&&i<=215){r+=2;continue}if(i>=192&&i<=207&&i!==196&&i!==200&&i!==204)return{h:n(r+5),w:n(r+7)};let o=n(r+2);if(o<2)break;r+=2+o}}return null}function zs(t,e,n,r){let i=Math.min(1,Math.max(n/t,r/e));return!(i>0)||i>=.95?0:i}var Gf=`self.onmessage = async (e) => {
|
|
16
|
+
const { id, dataURL, blob: given, srcLength, targetW, targetH, resFactor, quality, mime } = e.data
|
|
17
|
+
try {
|
|
18
|
+
const blob = given || await (await fetch(dataURL)).blob()
|
|
19
|
+
const bmp = await createImageBitmap(blob)
|
|
20
|
+
const nw = bmp.width, nh = bmp.height
|
|
21
|
+
if (!nw || !nh) { bmp.close(); self.postMessage({ id, url: null }); return }
|
|
22
|
+
const raw = Math.min(1, Math.max(targetW / nw, targetH / nh))
|
|
23
|
+
if (!(raw > 0) || raw >= 0.95) { bmp.close(); self.postMessage({ id, url: null }); return }
|
|
24
|
+
const factor = raw * resFactor
|
|
25
|
+
const ow = Math.max(1, Math.round(nw * factor))
|
|
26
|
+
const oh = Math.max(1, Math.round(nh * factor))
|
|
27
|
+
const canvas = new OffscreenCanvas(ow, oh)
|
|
28
|
+
const ctx = canvas.getContext('2d')
|
|
29
|
+
ctx.imageSmoothingEnabled = true
|
|
30
|
+
ctx.imageSmoothingQuality = 'high'
|
|
31
|
+
ctx.drawImage(bmp, 0, 0, ow, oh)
|
|
32
|
+
bmp.close()
|
|
33
|
+
const out = await canvas.convertToBlob({ type: mime, quality })
|
|
34
|
+
const url = new FileReaderSync().readAsDataURL(out)
|
|
35
|
+
self.postMessage({ id, url: (url && url.length < srcLength) ? url : null })
|
|
36
|
+
} catch (err) {
|
|
37
|
+
self.postMessage({ id, error: String(err) })
|
|
38
|
+
}
|
|
39
|
+
}`,Xf=Math.max(1,Math.min(4,(typeof navigator<"u"&&navigator.hardwareConcurrency||2)-1)),_t=null,Yf=0,Kf=0,oe=new Map;function Ys(){for(let t of oe.values())t(void 0);if(oe.clear(),Array.isArray(_t))for(let t of _t)try{t?.terminate()}catch{}_t=!1}function Qf(){let t,e=null;try{t=URL.createObjectURL(new Blob([Gf],{type:"text/javascript"})),e=new Worker(t),e.onmessage=n=>{let r=oe.get(n.data.id);r&&(oe.delete(n.data.id),r(n.data.error?void 0:n.data.url??null))},e.onerror=Ys}catch{e=null}return t&&URL.revokeObjectURL(t),e}function Jf(){if(_t===!1)return!1;if(_t===null){if(typeof Worker>"u"||typeof OffscreenCanvas>"u")return _t=!1;_t=[]}let t=Yf++%Xf;if(!_t[t]){let e=Qf();if(!e)return Ys(),!1;_t[t]=e}return _t[t]}var Zf=5e3;function tu(t,e,n,r,i){let o=Jf();return o?new Promise(s=>{let a=++Kf,c=setTimeout(()=>{oe.delete(a),s(void 0)},Zf);oe.set(a,f=>{clearTimeout(c),s(f)});try{o.postMessage({id:a,dataURL:i?"":t,blob:i,srcLength:t.length,targetW:e,targetH:n,resFactor:Xs,quality:Gs,mime:r})}catch{clearTimeout(c),oe.delete(a),s(void 0)}}):Promise.resolve(void 0)}async function po(t,e,n,r){if(typeof t!="string"||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return null;e=Math.ceil(e),n=Math.ceil(n);let i=t.length+":"+t.slice(0,64)+t.slice(-64)+":"+e+"x"+n,o=P.compress,s=o.get(i);if(s?.source===t)return s.result;let a=qn.get(i);if(a?.source===t&&a.cache===o)return a.promise;let c=(async()=>{let l=Hf(t),u=l==="image/jpeg"?"image/jpeg":l==="image/webp"?"image/webp":"image/png",p=qf(t);if(p&&p.w>0&&p.h>0&&!zs(p.w,p.h,e,n))return null;if(t.length>=zf){let S=await tu(t,e,n,u,r);if(S!==void 0)return S}let m;try{m=await Uf(t)}catch{return null}let d=m.naturalWidth||m.width,h=m.naturalHeight||m.height;if(!d||!h)return null;let g=zs(d,h,e,n);if(!g)return null;let y=g*Xs,b=Math.max(1,Math.round(d*y)),w=Math.max(1,Math.round(h*y)),C=document.createElement("canvas");C.width=b,C.height=w;let x=C.getContext("2d");if(!x)return null;x.imageSmoothingEnabled=!0,x.imageSmoothingQuality="high",x.drawImage(m,0,0,b,w);try{let S=C.toDataURL(u,Gs);if(typeof S=="string"&&S.startsWith("data:image")&&S.length<t.length)return S}catch{}return null})(),f={source:t,promise:c,cache:o};qn.set(i,f);try{let l=await c;return jf(o,i,t,l),l}finally{qn.get(i)===f&&qn.delete(i)}}async function eu(t,e,n=new Map,r={}){if(!e.compress)return{count:0,before:0,after:0};let i=Array.from(t.querySelectorAll("img"));t.tagName==="IMG"&&i.unshift(t);let o=0,s=0,a=0,c=async l=>{let u=l.getAttribute("src")||"";if(!u.startsWith("data:image")||u.startsWith("data:image/svg"))return;let p=parseFloat(l.dataset.snapdomWidth)||parseFloat(l.style.width)||l.width||0,m=parseFloat(l.dataset.snapdomHeight)||parseFloat(l.style.height)||l.height||0;if(!p||!m)return;let d=r.value||=uo(t,e),h=d.density*d.stretch(n.get(l)||l),g=await po(u,p*h,m*h,l.__snapdomBlob);g&&(o++,s+=u.length,a+=g.length,l.setAttribute("src",g),Gn(l,"attribute","src",u,g,e))},f=6;for(let l=0;l<i.length;l+=f)await Promise.allSettled(i.slice(l,l+f).map(c));return{count:o,before:s,after:a}}var nu=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function ru(t){let e=t.offsetWidth||t.getBoundingClientRect().width||0,n=t.offsetHeight||t.getBoundingClientRect().height||0;return{w:e,h:n}}async function ou(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=[],o=[t,...t.querySelectorAll("*")];for(let f of o){let l=f.style&&f.style.backgroundImage;l&&l.includes("data:image")&&i.push(f)}let s=0,a=async f=>{let l=n.get(f);if(!l||!l.isConnected)return;let u;try{u=getComputedStyle(l)}catch{return}if((u.backgroundRepeat||"repeat").toLowerCase().split(",").some(v=>v.trim()!=="no-repeat"))return;let m=(f.style.backgroundSize||u.backgroundSize||"auto").toLowerCase();if(m.split(",").some(v=>!nu.test(v.trim())))return;let{w:d,h}=ru(l);if(!d||!h)return;let g=Math.max(1,...(m.match(/\d+(?:\.\d+)?%/g)||[]).map(v=>parseFloat(v)/100)),y=r.value||=uo(t,e),b=y.density*y.stretch(l)*g,w=d*b,C=h*b,x=f.style.backgroundImage,S=[...x.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],A=x;for(let v of S){let M=v[2];if(M.startsWith("data:image/svg"))continue;let k=await po(M,w,C);k&&(A=A.split(M).join(k),s++)}A!==x&&(f.style.setProperty("background-image",A,f.style.getPropertyPriority("background-image")),Gn(f,"style","background-image",x,f.style.backgroundImage,e))},c=6;for(let f=0;f<i.length;f+=c)await Promise.allSettled(i.slice(f,f+c).map(a));return{count:s}}async function iu(t,e,n=new Map,r={}){if(!e.compress)return{count:0};let i=Array.from(t.querySelectorAll("image"));t.localName==="image"&&i.unshift(t);let o=0,s=async c=>{let f=c.getAttribute("href")||(typeof c.getAttributeNS=="function"?c.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!f||!f.startsWith("data:image")||f.startsWith("data:image/svg"))return;let l=c.getAttribute("width")||"",u=c.getAttribute("height")||"";if(l.includes("%")||u.includes("%"))return;let p=n.get(c),m=p?O(p):c.style,d=(C,x)=>{if(/^\d+(?:\.\d+)?px$/.test(m?.[C]||""))return parseFloat(m[C]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(x.trim()))return parseFloat(x);try{return p?.[C]?.baseVal?.value||0}catch{return 0}},h=d("width",l),g=d("height",u);if(!h||!g)return;let y=r.value||=uo(t,e),b=y.density*y.stretch(p||c),w=await po(f,h*b,g*b);w&&(c.setAttribute("href",w),Gn(c,"attribute","href",f,w,e),c.hasAttribute("xlink:href")&&(c.setAttributeNS(js,"xlink:href",w),Gn(c,"attribute","xlink:href",f,w,e)),o++)},a=6;for(let c=0;c<i.length;c+=a)await Promise.allSettled(i.slice(c,c+a).map(s));return{count:o}}async function Kn(t,e,n){if(!e.compress)return;let r={};await eu(t,e,n,r),await ou(t,e,n,r),await iu(t,e,n,r)}ut();lt();mt();function su(t,e){if(X())return t;let n=t.indexOf("</style>");if(n===-1)return t;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],o=n,s;for(r.lastIndex=n;s=r.exec(t);)i.push({text:t.slice(o,s.index),intern:!0}),i.push({text:s[0],intern:!1}),o=r.lastIndex;i.push({text:t.slice(o),intern:!0});let a=new Map,c=/ style="([^"]*)"/g,f;for(let y of i)if(y.intern)for(c.lastIndex=0;f=c.exec(y.text);)a.set(f[1],(a.get(f[1])||0)+1);let l=0;for(let[y,b]of a)b>1&&(l+=(b-1)*y.length);if(l<2048||t.includes(" data-sdi="))return t;let u=au(e,i.some(y=>!y.intern),t.includes("data-snapdom-asset"));if(u===null)return t;let p=new Map,m=0,d=[],h=(y,b)=>{if((a.get(b)||0)<2||u.has(b))return y;let w=p.get(b);return w===void 0&&(w="i"+(m++).toString(36),p.set(b,w),d.push(`[data-sdi="${w}"]{${b}}`)),` data-sdi="${w}"`},g="";for(let y of i)g+=y.intern?y.text.replace(c,h):y.text;return t.slice(0,n)+d.join("")+g}function au(t,e,n){let r=new Set;if(!e&&!n)return r;if(!t||t.querySelector("[data-sdi]"))return null;let i=c=>{let f=c.getAttribute("style");f&&r.add(f)};if(n&&t.querySelectorAll("[data-snapdom-asset][style]").forEach(i),e)try{let c=f=>{for(let l of f){if(l.type===CSSRule.IMPORT_RULE||l.type===CSSRule.NAMESPACE_RULE)throw new Error("External or namespaced CSS");if(l.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(l.selectorText))throw new Error("Attribute-dependent or nested CSS");t.querySelectorAll(l.selectorText).forEach(i)}l.cssRules&&c(l.cssRules)}};for(let f of[...t.querySelectorAll("style")].slice(1)){let l=f.textContent||"";if(/@import\b/i.test(l))return null;let u=new CSSStyleSheet;u.replaceSync(l),c(u.cssRules)}}catch{return null}let o=new Set,s=document.createElement("div"),a=new XMLSerializer;for(let c of r){s.setAttribute("style",c);let f=a.serializeToString(s).match(/ style="([^"]*)"/);f&&o.add(f[1])}return o}async function Qn(t,e){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:o,fontsCSS:s}=e,a=t.options;if(t!==a){let{options:Y,...J}=t;t=Object.assign(a,J),Object.defineProperty(t,"options",{value:t,configurable:!0})}let c,f;Es(t,s),await $t("beforeRender",t);let l=O(t.element),u=t.element.getBoundingClientRect(),p=Math.max(1,I(t.element.offsetWidth||parseFloat(l.width)||u.width||1)),m=Math.max(1,I(t.element.offsetHeight||parseFloat(l.height)||u.height||1)),d=t.element.ownerDocument||document;if(!n&&(t.element===d.body||t.element===d.documentElement)&&!t.__pinned){let Y=Math.max(t.element.scrollHeight||0,d.documentElement?.scrollHeight||0,d.body?.scrollHeight||0),J=Math.max(t.element.scrollWidth||0,d.documentElement?.scrollWidth||0,d.body?.scrollWidth||0);Y>0&&(m=Math.max(m,I(Y))),J>0&&(p=Math.max(p,I(J)));try{let K=(t.scrollbarCSS||"").length+(t.baseCSS||"").length+(t.fontsCSS||"").length+(t.classCSS||"").length,Z=P.measureHints.get(t.element);if(Z&&Z.cssLen===K&&Z.w0===p&&Z.docH===Y&&Z.docW===J)Z.csh>0&&(m=Math.max(m,I(Z.csh))),Z.csw>0&&(p=Math.max(p,I(Z.csw)));else{let tt=d.createElement("div");Q(tt),tt.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+p+"px!important;overflow:visible!important;visibility:hidden!important;";let Vt=tt.attachShadow({mode:"open"}),qt=d.createElement("style");qt.textContent=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS,Vt.appendChild(qt),Vt.appendChild(t.clone.cloneNode(!0)),d.body.appendChild(tt);let Ue=tt.scrollHeight,Nt=tt.scrollWidth;d.body.removeChild(tt),P.measureHints.set(t.element,{cssLen:K,w0:p,docH:Y,docW:J,csh:Ue,csw:Nt}),Ue>0&&(m=Math.max(m,I(Ue))),Nt>0&&(p=Math.max(p,I(Nt)))}}catch{}}if(t.options?.excludeMode==="remove"||typeof t.options?.filter=="function"&&t.options.filterMode==="remove"){let Y=so(t.element,t.options),J=1,K=so(t.element,{}),Z=Math.max(2,m*.15);Number.isFinite(K)&&K>=m-Z&&Number.isFinite(Y)&&Y>0&&(m=Math.max(1,Math.min(m,I(Y+J))))}if(t.options?.reconcile)try{let Y=(t.scrollbarCSS||"")+t.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+t.classCSS;Ms(t.element,t.clone,Y,t.nodeMap,p,m)}catch(Y){console.warn("[snapdom] reconcile pass failed:",Y)}let g=(Y,J=NaN)=>{let K=typeof Y=="string"?parseFloat(Y):Y;return Number.isFinite(K)?K:J},y=g(t.options.width),b=g(t.options.height),w=n?I(n.width):p,C=n?I(n.height):m,x=w,S=C,A=Number.isFinite(y),v=Number.isFinite(b),M=C>0?w/C:1;A&&v?(x=Math.max(1,I(y)),S=Math.max(1,I(b))):A?(x=Math.max(1,I(y)),S=Math.max(1,I(x/(M||1)))):v&&(S=Math.max(1,I(b)),x=Math.max(1,I(S*(M||1))));let k=0,R=0,E=p,T=m;if(n){let Y=0,J=0;if(ho(t.element)){let K=null;if(!r&&o&&Number.isFinite(o.a))K={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0};else{let Z=re(t.element),tt=io(l.transform&&l.transform!=="none"?l.transform:"",Z);tt&&tt.is2D&&(K={a:tt.a,b:tt.b,c:tt.c,d:tt.d,e:0,f:0})}if(K&&!(K.a===1&&K.b===0&&K.c===0&&K.d===1)){let{ox:Z,oy:tt}=rn(l,p,m),Vt=Ee(p,m,K,Z,tt);Y=Vt.minX,J=Vt.minY}}k=I(n.x+Y),R=I(n.y+J),E=I(k+n.width),T=I(R+n.height)}else if(!r&&o&&Number.isFinite(o.a)){let Y={a:o.a,b:o.b||0,c:o.c||0,d:o.d||1,e:0,f:0},J=Ee(p,m,Y,0,0);k=I(J.minX),R=I(J.minY),E=I(J.maxX),T=I(J.maxY)}else if(r&&ho(t.element)){let J=l.transform&&l.transform!=="none"?l.transform:"",K=re(t.element),Z=Ht({baseTransform:J,rotate:K.rotate||"0deg",scale:K.scale,translate:K.translate,width:p,height:m}),{ox:tt,oy:Vt}=rn(l,p,m),qt=Z.is2D?Z:new DOMMatrix(Z.toString()),Ue={a:qt.a,b:qt.b,c:qt.c,d:qt.d,e:0,f:0},Nt=Ee(p,m,Ue,tt,Vt);k=I(Nt.minX),R=I(Nt.minY),E=I(Nt.maxX),T=I(Nt.maxY)}let N=Jr(l),B=Zr(l),j=to(l),_=eo(l),W=no(l),$=u.width>0?(E-k)/u.width:1,F=u.height>0?(T-R)/u.height:1,L=i==="subtree"&&!n?hs(t.element,t.nodeMap,t.styleCache,$,F):{top:0,right:0,bottom:0,left:0},V=n?{top:0,right:0,bottom:0,left:0}:i?{top:I(Math.max(N.top,B.top,L.top)+j.top+_.top+W.bleed.top),right:I(Math.max(N.right,B.right,L.right)+j.right+_.right+W.bleed.right),bottom:I(Math.max(N.bottom,B.bottom,L.bottom)+j.bottom+_.bottom+W.bleed.bottom),left:I(Math.max(N.left,B.left,L.left)+j.left+_.left+W.bleed.left)}:{top:j.top,right:j.right,bottom:j.bottom,left:j.left};k=I(k-V.left),R=I(R-V.top),E=I(E+V.right),T=I(T+V.bottom);let q=Math.max(1,I(E-k)),pt=Math.max(1,I(T-R)),et="http://www.w3.org/2000/svg",bt=ho(t.element)?2:0,ht=I(bt+(r?0:1)),D=Math.ceil(q+ht*2),H=Math.ceil(pt+ht*2),z=I(-(I(k)-ht)),it=I(-(I(R)-ht)),kt=Math.max(0,z),Oe=Math.max(0,it),ce=I(D-Math.min(0,z)),De=I(H-Math.min(0,it)),Ct=document.createElementNS(et,"foreignObject");Ct.setAttribute("x",String(Math.min(0,z))),Ct.setAttribute("y",String(Math.min(0,it))),Ct.setAttribute("width",String(ce)),Ct.setAttribute("height",String(De)),Ct.style.overflow="visible";let jt=document.createElement("style"),ar="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";jt.textContent=(t.scrollbarCSS||"")+t.baseCSS+t.fontsCSS+ar+t.classCSS,Ct.appendChild(jt);let At=document.createElement("div");At.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),At.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${ce}px;height:${De}px`+(kt!==0||Oe!==0?`;padding:${Oe}px 0 0 ${kt}px !important`:""),At.appendChild(t.clone),Ct.appendChild(At);let cr=new XMLSerializer().serializeToString(Ct),Be=A||v,Pt=Object.freeze({w0:w,h0:C,vbW:D,vbH:H,targetW:x,targetH:S,contentX:I(z+(n?k:0)),contentY:I(it+(n?R:0)),clip:n?Object.freeze({x:I(k),y:I(R),width:w,height:C}):null});Object.defineProperty(a,"meta",{value:Pt,enumerable:!0,writable:!1,configurable:!0});let Na=!Be||X()?D:A?x:I(D*(S/H)),La=!Be||X()?H:v?S:I(H*(x/D)),Ia=parseFloat(O(d.documentElement)?.fontSize)||16;f=`<svg xmlns="${et}" width="${Na}" height="${La}" viewBox="0 0 ${D} ${H}" font-size="${Ia}px">`+su(cr,Ct)+"</svg>",c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,t.svgString=f,t.dataURL=c,a.__artifacts={classCSS:t.classCSS||"",fontsCSS:t.fontsCSS||"",baseCSS:t.baseCSS||"",scrollbarCSS:t.scrollbarCSS||""},await $t("afterRender",t),t.clone=t.nodeMap=t.styleCache=t.svgString=null;let lr=[...document.querySelectorAll("#snapdom-sandbox")].find(Wt);return lr&&lr.style.position==="absolute"&&lr.remove(),t.dataURL}function ho(t){return gs(t)}function cu(t){let e=Array.isArray(t.plugins)?t.plugins:fo(),n=[];for(let r of e){let i=$e(r);i&&typeof i.resolveNode=="function"&&n.push(i.resolveNode.bind(i))}return n.length?n:null}async function Ks(t,e){if(!t)throw new Error("Element cannot be null or undefined");e.__session=$s(e.cache),delete e.__compressedAssets,delete e.__compressedSnapshot,delete e.__compressionDensity,e.__resolveNodeHooks=cu(e);let n=e;n.element=t,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,o,s,a,c,f,l="",u=null,p=e.needs||ct,m=n.format,d=n.type;await $t("beforeSnap",n);let h=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),g=n.type!==d&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(h||g){let E=String(h?n.format:n.type).toLowerCase();n.format=E==="jpg"?"jpeg":E,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor==="transparent")&&(n.backgroundColor="#ffffff")}await $t("beforeClone",n);let y=n.outerTransforms!==!1,b=n.outerShadows==="subtree"?"subtree":!!n.outerShadows,w=n.clip?Ln(n.element,n.clip):null;if(e.__styleShare===void 0)try{e.__styleShare=di(n.element)&&(typeof n.element.getAnimations!="function"||n.element.getAnimations({subtree:!0}).length===0)}catch{e.__styleShare=!1}let C=zn(n.element,w);try{({clone:r,classCSS:i,classPrefixCSS:o,styleCache:s,nodeMap:a,reconcileRisk:c,clipWindow:f}=await _s(n.element,n.options)),c>0&&!e.reconcile&&(gt(e.__session,"reconcile-risk","text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout"),P.warnedReconcile||(P.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time)."))),!y&&r&&(u=ms(n.element,r)),!b&&r&&vs(n.element,r,n.options),r&&(Cs(n.element,r,a),ks(n.element,r))}finally{C()}if(n.clone=r,n.classCSS=i,n.styleCache=s,n.nodeMap=a,await $t("afterClone",n),!Fe(p,"render"))return null;if(In(n.clone),n.options?.excludeMode==="remove"||typeof n.options?.filter=="function"&&n.options.filterMode==="remove")try{As(n.element,n.clone,n.styleCache,n.nodeMap)}catch(E){gt(e.__session,"shrink-failed","shrink pass failed",E),console.warn("[snapdom] shrink pass failed:",E)}try{await Mn(n.clone,n.element,n.nodeMap)}catch{}let x=E=>Promise.resolve().then(E),S=(async()=>{await Promise.all([x(()=>On(n.clone,n.options)),x(()=>Bn(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Ts(n.element,n.clone,n.nodeMap)}catch(E){gt(e.__session,"backdrop-filter-failed","backdrop-filter emulation failed",E),console.warn("[snapdom] backdrop-filter emulation failed:",E)}if(e.compress&&(e.__compressionClip=f,e.__compressionRootTransform=u,await x(()=>Kn(n.clone,n.options,n.nodeMap))),e.captureSelection)try{Oi(n.nodeMap)}catch(E){gt(e.__session,"selection-compose-failed","field selection compose failed",E)}})(),A=Promise.resolve();(e.embedFonts==="auto"?((n.element.ownerDocument||document).fonts?.size||0)>0:e.embedFonts)&&(A=x(async()=>{let E=n.element.ownerDocument||document,T=w?j=>{try{let _=j.getBoundingClientRect();return _.right>=w.left-200&&_.left<=w.right+200&&_.bottom>=w.top-200&&_.top<=w.bottom+200}catch{return!0}}:null,{required:N,usedCodepoints:B}=!w&&e.__fontUsage||Fn(n.element,T);if(e.embedFonts==="auto"){let j=new Set;try{for(let W of E.fonts)j.add(String(W.family).replace(/["']/g,"").toLowerCase())}catch{}if(!(j.size>0&&Array.from(N).some(W=>j.has(String(W).split("__")[0].toLowerCase()))))return}if(X()){let j=new Set(Array.from(N).map(_=>String(_).split("__")[0]).filter(Boolean));await Tn(j,1,E)}l=await Ji({required:N,usedCodepoints:B,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:E})})),await Promise.all([S,A]);let M=(n.options.plugins||[]).some(E=>E&&(typeof E.beforeRender=="function"||typeof E.afterRender=="function"));n.options.engine;let k=n.clone;Yn(k,e.__compressedAssets);let R=await Qn(n,{clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,fontsCSS:l});if(e.__compressedSnapshot=Xn(k,e.__compressedAssets),typeof e.__retain=="function")try{e.__retain({clone:r,nodeMap:a,styleCache:s,styleMap:e.__session.styleMap,classPrefixCSS:o,fontsCSS:l,clipWindow:f,outerTransforms:y,outerShadows:b,rootTransform2D:u,__compressedAssets:e.__compressedAssets,__compressionDensity:e.__compressionDensity})}catch{}return R}lt();wt();var lu=new Set(["png","jpeg","jpg","webp","svg"]);function Qs(t={}){let e=typeof t.type=="string"&&lu.has(t.type.toLowerCase())?t.type.toLowerCase():null,n=t.format??e??"png";n==="jpg"&&(n="jpeg");let r=t.format!=null?n:e==="jpg"?"jpeg":e,i=Bo(t.cache),o=t.exclude==null?[]:Array.isArray(t.exclude)?t.exclude:[t.exclude],s=[],a=[];for(let u of o)typeof u=="string"?s.push(u):typeof u=="function"?a.push(u):u!=null&&console.warn("[snapdom] Ignored invalid exclude entry (expected selector string or predicate):",u);let c=t.excludeMode??"hide",f=u=>{if(!u||u.nodeType!==1)return!1;if(u.getAttribute("data-capture")==="exclude")return!0;for(let p of Array.isArray(l.exclude)?l.exclude:[])try{if(u.matches(p))return!0}catch{}for(let p of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(p(u))return!0}catch{}if(typeof l.filter=="function")try{if(!l.filter(u))return!0}catch{}return!1},l={debug:t.debug??!1,scale:t.scale??1,exclude:s,excludePredicates:a.length?a:null,excludeMode:c,filter:t.filter??null,filterMode:t.filterMode??"hide",shouldExclude:f,placeholders:t.placeholders!==!1,captureSelection:t.captureSelection??!1,canvas:nt(t.canvas,"canvas")?t.canvas:null,embedFonts:t.embedFonts??"auto",iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],__iconMatchers:Hi(t.iconFonts),localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:t.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(t.fontStylesheetDomains)?t.fontStylesheetDomains:[],fallbackURL:t.fallbackURL??void 0,cache:i,__styleShare:t.__styleShare,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:t.width??null,height:t.height??null,format:n,__explicitFormat:r,type:n,quality:t.quality??.92,dpr:t.dpr??(window.devicePixelRatio||1),backgroundColor:t.backgroundColor??(["jpeg","webp"].includes(n)?"#ffffff":null),filename:t.filename??"snapDOM",outerTransforms:t.outerTransforms??!0,outerShadows:t.outerShadows??!1,reconcile:t.reconcile??!1,burst:t.burst,engine:t.engine,invalidate:t.invalidate??!1,__pinned:t.__pinned===!0,clip:t.clip??null,compress:t.compress!==!1,excludeStyleProps:t.excludeStyleProps??null,resolvePicturePlaceholders:t.resolvePicturePlaceholders!==!1};return l}St();Xt();ut();var Js="svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre";function fu(t){try{return t.matches?.("dialog,[popover]")||!!t.querySelector?.("dialog,[popover]")}catch{return!0}}var uu=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function du(t){if(t.__usesBackdropFilter!==void 0)return t.__usesBackdropFilter;let e=!1;for(let n of t.styleMap.values())if(uu.test(n)){e=!0;break}return t.__usesBackdropFilter=e,e}function pu(t,e){let n=e.has("backdrop-filter")||e.has("-webkit-backdrop-filter");if(!n&&(n=(o=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(o.getAttribute?.("style")||""))(t),!n))try{n=!!t.querySelector?.('[style*="backdrop-filter" i]')}catch{n=!0}if(!n)return!1;let r=[t];t.querySelectorAll&&r.push(...t.querySelectorAll("*"));for(let i of r){let o=getComputedStyle(i),s=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");if(s&&s!=="none")return!0}return!1}var mo=new WeakMap;function hu(t,e){if(mo.has(e))return mo.get(e);let n=!1,r={budget:2e4},i=o=>{for(let s=0;s<o.length&&!n;s++){if(--r.budget<0){n=!0;return}let a=o[s],c=a.selectorText;if(c&&/[+~]|:has\(/.test(c)){n=!0;return}let f=a.style;if(f&&(f.counterReset||f.counterIncrement||f.counterSet||f.content&&f.content.includes("counter"))){n=!0;return}a.cssRules&&a.cssRules.length&&i(a.cssRules)}};try{for(let o of t.styleSheets){let s=null;try{s=o.cssRules}catch{n=!0}if(n)break;s&&i(s)}if(!n){let o=t.adoptedStyleSheets;if(Array.isArray(o))for(let s of o){if(n)break;try{i(s.cssRules)}catch{n=!0}}}}catch{n=!0}return mo.set(e,n),n}var mu=1/16;function gu(t,e){if(t===e)return!0;if(!t.endsWith("px")||!e.endsWith("px"))return!1;let n=parseFloat(t),r=parseFloat(e);return Number.isFinite(n)&&Number.isFinite(r)&&Math.abs(n-r)<=mu}var Jn=new Map,yu=["width","height","min-width","min-height"];function bu(t){let e=Jn.get(t);if(e===void 0){e=null;for(let n of yu){let r=t.match(new RegExp("(?:^|;)"+n+":([^;]+)"));r&&r[1].endsWith("px")&&((e||={})[n]=r[1])}Jn.size>5e3&&Jn.clear(),Jn.set(t,e)}return e}function wu(t){if(!(!t.classList||!t.classList.length))for(let e of Array.from(t.classList))/^c\d+$/.test(e)&&t.classList.remove(e)}function Su(t,e){let n=[t];for(;n.length;){let r=n.pop();if(r.nodeType===1){let i=e.nodeMap.get(r);i!==void 0&&(e.nodeMap.delete(r),e.srcToClone.get(i)===r&&e.srcToClone.delete(i)),e.styleMap.delete(r)}for(let i=r.firstChild;i;i=i.nextSibling)n.push(i)}}var go={attempts:0,served:0,reconciled:0};async function Zs(t,e,n){go.attempts++;try{let r=await xu(t,e,n);return r&&go.served++,r}catch{return null}}async function xu(t,e,n){let r=e.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||t.scrollTop||t.scrollLeft||fu(t)||du(r)||r.fontsCSS||Vn(n))return null;for(let u of n.plugins||[])if(u&&(typeof u.beforeSnap=="function"||typeof u.beforeClone=="function"||typeof u.resolveNode=="function"||typeof u.afterClone=="function"))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes("::marker")||r.classPrefixCSS.includes("::first-line"))||n.excludeMode==="remove")return null;let i=t.ownerDocument||document,o=Je(t);if(!o||hu(i,o))return null;let s=[];t:for(let u of e.dirtyRoots){if(!u.isConnected||u===t||!t.contains(u))return null;for(let p of e.dirtyRoots)if(p!==u&&p!==t&&p.contains(u))continue t;s.push(u)}if(!s.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let u of s){if(u.parentElement===t||u.matches?.(Js)||u.querySelector?.(Js)||pu(u,o))return null;let p=r.srcToClone.get(u);if(!p||!p.parentNode)return null;let m=new Map,d={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:m,options:n},h=zn(u,null),g=Nn(u),y;try{y=await ne(u,d,n)}finally{g(),h()}if(!y||y.nodeType!==1||y.querySelector?.("style[data-sd]")||(await Me(u,y,d,n),d.__pseudoCSS))return null;await xn(y,d),In(y);try{await Mn(y,u,m)}catch{}if(await Promise.all([On(y,n),Bn(u,y,r.styleCache,n,m)]),n.compress)try{await Kn(y,n,m)}catch{}for(let[b,w]of m.entries())co(b,w);p.replaceWith(y),Su(p,r);for(let[b,w]of m.entries())r.nodeMap.set(b,w),r.srcToClone.set(w,b)}let a={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n};for(let[u,p]of r.nodeMap.entries()){if(!p||p.nodeType!==1||!p.isConnected)continue;let m=r.styleMap.get(u);if(!m)continue;let d=bu(m);if(!d)continue;let h=null,g=!1;for(let y in d)if(h||=getComputedStyle(p),!gu(h.getPropertyValue(y),d[y])){g=!0;break}if(g){if(n.__compressedAssets?.has(u))return null;go.reconciled++,await at(p,u,a,n)}}let c=qe(r.styleMap);for(let[u,p]of r.styleMap.entries())wu(u),ao(u,p,c);let f=(r.classPrefixCSS||"")+Array.from(c.entries()).map(([u,p])=>`.${p}{${u}}`).join("");Yn(r.clone,n.__compressedAssets);let l=await Qn({element:t,options:n,plugins:n.plugins,clone:r.clone,classCSS:f,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||""});return n.__compressedSnapshot=Xn(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,l}wt();var bo=new WeakMap,tr=new WeakMap,la=new WeakSet,yo=new WeakMap,vu=64,sn=new Map,fa=["scroll","input","change","focusin","focusout","pointerdown","pointerup","pointercancel","keydown","keyup","beforetoggle","toggle"],ku=["(prefers-color-scheme: dark)","(prefers-reduced-motion: reduce)","(prefers-contrast: more)","(forced-colors: active)","(inverted-colors: inverted)","(prefers-reduced-transparency: reduce)","(hover: hover)","(any-hover: hover)","(pointer: coarse)","(any-pointer: coarse)","(color-gamut: p3)","(dynamic-range: high)"];function Cu(t){let e=t?.defaultView;return typeof e?.matchMedia!="function"?"":ku.map(n=>{try{return e.matchMedia(n).matches?"1":"0"}catch{return"?"}}).join("")}function ta(t){let e=[];for(let n=t;n;){try{let r=n.getBoundingClientRect();e.push(r.x,r.y,r.width,r.height)}catch{e.push("?")}n.parentElement?n=n.parentElement:n=n.getRootNode?.()?.host||null}return e.join("|")}function ea(t,e){if(e.disposed||(sn.delete(t),sn.set(t,e),sn.size<=vu))return;let[n,r]=sn.entries().next().value;ua(n,r)}function ua(t,e){e.disposed=!0,sn.delete(t),bo.delete(t);for(let n of e.observers)try{n.disconnect()}catch{}for(let n of fa)t.removeEventListener(n,e.onMediaDirty,!0);for(let n of e.trackedShadowRoots.keys())for(let r of So)n.removeEventListener(r,e.onMediaDirty,!0);for(let[n,r]of e.trackedImages)n.removeEventListener("load",r),n.removeEventListener("error",r);e.trackedImages.clear(),e.trackedShadowRoots.clear(),e.images.length=0,e.controls.length=0,e.scrollNodes.length=0,e.observers.length=0,e.last=null,e.retained=null,e.retainedFrameDriven=!1}function da(t){if(la.has(t))return!1;tr.delete(t);let e=[t],n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i],s=[];o?.nodeType===1&&s.push(o);try{s.push(...o.querySelectorAll("*"))}catch{return!1}for(let a of s){a.shadowRoot&&e.push(a.shadowRoot);let c=String(a.localName||a.tagName||"").toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(c)||c==="progress"&&!a.hasAttribute("value")||/^(?:animate|animatetransform|animatemotion|set)$/.test(c))return!1;let f="";if(c==="img"){r.push(a);try{f=a.currentSrc||a.src||""}catch{}}/^(?:input|textarea|select|option)$/.test(c)&&n.push(a);let l=a.getAttribute?.("style")||"",u=yo.get(a);if(f||l){if((!u||u.src!==f||u.style!==l)&&(u={src:f,style:l,animated:Le(f)||Le(l)},yo.set(a,u)),u.animated)return!1}else u&&yo.delete(a)}}return tr.set(t,{roots:e.slice(1),controls:n,images:r}),!0}function wo(t,e){if(!t.querySelectorAll)return!1;let n=tr.get(t);tr.delete(t);let r=new Set(n?.roots||[]);if(n&&(e.controls=n.controls,e.scannedImages=n.images),!n){let i=[t];for(let o=0;o<i.length;o++){let s=i[o];s.shadowRoot&&!r.has(s.shadowRoot)&&(r.add(s.shadowRoot),i.push(s.shadowRoot));for(let a of s.querySelectorAll("*"))a.shadowRoot&&!r.has(a.shadowRoot)&&(r.add(a.shadowRoot),i.push(a.shadowRoot))}}for(let[i,o]of e.trackedShadowRoots)if(!r.has(i)){try{o.disconnect()}catch{}for(let a of So)i.removeEventListener(a,e.onMediaDirty,!0);e.trackedShadowRoots.delete(i);let s=e.observers.indexOf(o);s>=0&&e.observers.splice(s,1)}for(let i of r)if(!e.trackedShadowRoots.has(i))try{let o=new MutationObserver(e.markDirty);o.observe(i,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),o.__flush=e.markDirty,e.observers.push(o),e.trackedShadowRoots.set(i,o);for(let s of So)i.addEventListener(s,e.onMediaDirty,{capture:!0,passive:!0});e.retained&&e.dirtyAll()}catch{}return!!n}var So=["scroll","change","beforetoggle","toggle"];function er(t,e){return[t,...e.trackedShadowRoots.keys()]}function xo(t,e){let n=e.scannedImages;if(e.scannedImages=null,!n){n=[],t.tagName==="IMG"&&n.push(t);for(let r of er(t,e))r.querySelectorAll&&n.push(...r.querySelectorAll("img"))}if(e.images=n,e.trackedImages.size){let r=new Set(n);for(let[i,o]of e.trackedImages)r.has(i)||(i.removeEventListener("load",o),i.removeEventListener("error",o),e.trackedImages.delete(i))}for(let r of n){if(r.complete||e.trackedImages.has(r))continue;let i=()=>{e.capturing&&(e.torn=!0),e.dirty=!0,e.dirtyRoots=null,r.removeEventListener("load",i),r.removeEventListener("error",i),e.trackedImages.delete(r)};e.trackedImages.set(r,i),r.addEventListener("load",i),r.addEventListener("error",i)}}function Au(t){let e=new Map,n=new Map,r=new Map;for(let i of t)if(Qt(i))if(i.type==="attributes"){let o=e.get(i.target);o||e.set(i.target,o=new Map),o.has(i.attributeName)||o.set(i.attributeName,i.oldValue)}else if(i.type==="characterData")n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type==="childList"){let o=r.get(i.target);o||r.set(i.target,o=new Map);for(let s of i.addedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)+1)}for(let s of i.removedNodes){if(s.nodeType!==3)return!0;o.set(s.data,(o.get(s.data)||0)-1)}}else return!0;for(let[i,o]of e)for(let[s,a]of o)if(i.getAttribute(s)!==a)return!0;for(let[i,o]of n)if(i.data!==o)return!0;for(let i of r.values())for(let o of i.values())if(o!==0)return!0;return!1}var Mu=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,Ne=t=>t&&(typeof t=="object"||typeof t=="function")?Zn(t):"-";function Eu(t,e=131072){if(t=String(t||"").trim(),!/^data:/i.test(t))return"";let n=t.indexOf(",");if(n<0)return"";let r=t.slice(0,n),i=t.slice(n+1);try{if(/;base64/i.test(r)){let o=Math.ceil(e/3)*4;return atob(i.slice(0,o-o%4))}return i.slice(0,e*3).replace(/%([0-9a-f]{2})/gi,(o,s)=>String.fromCharCode(parseInt(s,16))).slice(0,e)}catch{return""}}function _u(t){let e=(t.match(/^data:([^;,]+)/i)?.[1]||"").toLowerCase();if(e==="image/gif"||e==="image/apng")return!0;if(!/image\/(?:png|webp|avif|svg\+xml)/.test(e))return!1;let n=Eu(t);return e==="image/png"?n.includes("acTL"):e==="image/webp"?n.includes("ANIM")||n.includes("ANMF")||n.includes("VP8X")&&!!(n.charCodeAt(n.indexOf("VP8X")+8)&2):e==="image/avif"?n.includes("avis"):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function na(t){let e=String(t||"").trim();return e?Mu.test(e)?!0:/^data:/i.test(e)?_u(e):!1:!1}function Le(t){let e=String(t||"");if(na(e))return!0;for(let n of e.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(na(n[1]??n[2]??n[3]))return!0;return!1}function ra(t,e=null){let n=t&&t.clone;if(!n)return!1;let r=e?e.map(i=>t.srcToClone?.get(i)).filter(Boolean):[n];for(let i of r)for(let o of pa(i))if(Le(o.getAttribute?.("src"))||Le(o.getAttribute?.("href"))||Le(o.getAttribute?.("style"))||Le(t.styleMap?.get(o)))return!0;return!1}function pa(t){let e=[];t&&t.nodeType===1&&e.push(t);try{e.push(...t.querySelectorAll("*"))}catch{}return e}function vo(t,e){let n=[],r=new Set,i=o=>{o&&!r.has(o)&&(r.add(o),n.push(o))};t.matches?.("input,textarea,select,option")&&i(t);for(let o of er(t,e))try{for(let s of o.querySelectorAll("input,textarea,select,option"))i(s)}catch{}e.controls=n}function ko(t,e){let n=[],r=new Set,i=(o,s=!1)=>{if(!(!o||r.has(o))){r.add(o);try{(s||o.scrollLeft||o.scrollTop||o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)&&n.push(o)}catch{}}};for(let o=t;o;o=o.parentElement)i(o,!0);for(let o of er(t,e))for(let s of pa(o))i(s);e.scrollNodes=n}function oa(t,e){let n=t.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||"",Cu(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||""];try{i.push(...[...n.adoptedStyleSheets||[]].map(Ne))}catch{}for(let l of e.trackedShadowRoots.keys())try{i.push("#shadow",...[...l.adoptedStyleSheets||[]].map(Ne))}catch{}let o=n.activeElement,s=n.fullscreenElement;(o?.contains(t)||t.contains(o))&&i.push(Ne(o)),(s?.contains(t)||t.contains(s))&&i.push(Ne(s));let a=[r?.scrollX||0,r?.scrollY||0];for(let l of e.scrollNodes)a.push(l.scrollLeft||0,l.scrollTop||0);let c=[];for(let l of e.controls){let u=String(l.localName||"").toLowerCase();u==="input"?c.push(l.type,je(l)?l.value.length:l.value,l.checked?1:0,l.indeterminate?1:0):u==="textarea"?c.push(l.value):u==="select"?c.push(l.selectedIndex,l.value):c.push(l.selected?1:0)}let f=[];for(let l of e.images){let u="";try{u=l.currentSrc||l.src||""}catch{}f.push(u,l.complete?1:0,l.naturalWidth||0,l.naturalHeight||0)}return{style:i.join("|"),scroll:a.join("|"),controls:c,images:f,frameDriven:e.retainedFrameDriven}}function Pe(t,e,n){if(!t)return!1;let r=t[n],i=e[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function ia(t,e){let n=new Set;for(let r of er(t,e))try{let i=r.getAnimations?.(r.nodeType===1?{subtree:!0}:void 0)||[];for(let o of i)n.add(o)}catch{}return[...n]}function sa(t){return t.map(e=>[Ne(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(":")).join("|")}function Ru(t,e,n){if(!n||n.nodeType!==1)return null;if(n===t||t.contains(n))return t;for(let r of e.trackedShadowRoots.keys())if(r.contains(n))return r;return null}function Fu(t){let e={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:ye(),styleEpoch:Jt(),styleStamp:Qe(t),outsideMutations:gn(t),geometry:null,renderState:null},n=()=>{e.dirty=!0,e.dirtyRoots=null},r=a=>{if(!e.dirtyRoots)return;let c=a&&(a.nodeType===1?a:a.parentElement);if(!c||c===t||!t.contains(c)||e.dirtyRoots.size>=12){e.dirtyRoots=null;return}e.dirtyRoots.add(c)},i=a=>{if(e.capturing){for(let c of a)e.pending.push(c);return}for(let c of a)Qt(c)&&(e.dirty=!0,r(c.target))},o=()=>{if(e.capturing){e.torn=!0;return}n()};e.dirtyAll=n;try{let a=new MutationObserver(i);a.observe(t,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),a.__flush=i,e.observers.push(a)}catch{}e.markDirty=i,e.onMediaDirty=o;try{for(let a of fa)t.addEventListener(a,o,{capture:!0,passive:!0})}catch{}return wo(t,e)||vo(t,e),ko(t,e),xo(t,e),e}var Tu=0,aa=new WeakMap;function Zn(t){let e=aa.get(t);return e||(e="@"+ ++Tu,aa.set(t,e)),e}function Co(t,e){let n=typeof t;if(n==="undefined")return null;if(t===null||n==="boolean"||n==="number"||n==="string")return JSON.stringify(t);if(n==="function"||n==="symbol")return n==="symbol"?null:JSON.stringify(Zn(t));if(n!=="object")return null;if(typeof t.nodeType=="number")return JSON.stringify(Zn(t));if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=Co(s,e);if(a===null)return null;o.push(a)}return"["+o.join(",")+"]"}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return JSON.stringify(Zn(t));let i=[];for(let o of Object.keys(t).sort()){let s=t[o];if(s===void 0)continue;let a=Co(s,e);if(a===null)return null;i.push(JSON.stringify(o)+":"+a)}return"{"+i.join(",")+"}"}finally{e.delete(t)}}function ca(t,e){let{burst:n,invalidate:r,...i}=t||{};try{let o=Co(i,new Set);return o===null?null:`${(e||[]).map(Ne).join(",")}:${o}`}catch{return null}}function ha(t,e,n,r,i=null){let o=bo.get(t);o||(o=Fu(t),o.baselineSignature=ca(e,n.plugins),bo.set(t,o));let s=ca(e,n.plugins),a=async()=>{if(o.disposed)return r();let f=s===null||s!==o.baselineSignature;f&&s!==null?o.pendingSig===s?(o.baselineSignature=s,o.last=null,o.dirty=!0,o.dirtyRoots=null,o.pendingSig=null,f=!1):o.pendingSig=s:o.pendingSig=null,wo(t,o),xo(t,o);for(let A of o.observers)A.__flush(A.takeRecords());Et();let l=gn(t);o.dirty&&o.outsideMutations!==l&&o.dirtyAll(),o.outsideMutations=l;let u=t.getRootNode?.(),p=[...o.trackedShadowRoots.keys()];u?.nodeType===11&&!p.includes(u)&&p.push(u),bn(t.ownerDocument||document,p);let m=Qe(t);o.styleStamp!==m&&(o.styleStamp=m,o.dirty||o.dirtyAll());let d=oa(t,o),h=ia(t,o);d.animation=sa(h),o.renderState&&(!Pe(o.renderState,d,"style")&&(be(),o.dirtyAll()),Pe(o.renderState,d,"scroll")||o.dirtyAll(),Pe(o.renderState,d,"controls")||(Zt(t),o.dirtyAll()),!Pe(o.renderState,d,"images")&&!o.dirty&&o.dirtyAll());let g=ye();o.envEpoch!==g&&(o.dirtyAll(),o.envEpoch=g);let y=Jt();if(o.styleEpoch!==y&&(o.styleEpoch=y,!o.dirty)){let A=ta(t);o.geometry!==null&&A!==o.geometry&&(Zt(t),o.dirtyAll()),o.geometry=A}n.invalidate&&o.dirtyAll();let b=!1,w=!!o.renderState&&!Pe(o.renderState,d,"animation");try{let A=new Set;w&&h.length===0&&(A=null);for(let v of h){let M=v.playState==="running";if(!M&&!w)continue;M&&(b=!0),w=!0;let k=v.effect?.target;if(Ru(t,o,k)===t)A.add(k);else{A=null;break}}if(w&&A&&A.size&&o.retained){o.dirty=!0;for(let v of A)o.dirtyRoots&&o.dirtyRoots.add(v),Zt(v)}else w&&!A&&o.dirtyAll()}catch{}let C=d.frameDriven,x=b||C;if(x&&(o.last=null),C&&o.dirtyAll(),!f&&!x&&!o.dirty&&o.last)return ea(t,o),o.last;o.capturing=!0;let S=null;try{let A=null,v=!1,M=null;if(!f&&o.dirty&&o.retained&&o.dirtyRoots&&o.dirtyRoots.size&&i){M=[...o.dirtyRoots];let k=await Zs(t,o,n);k&&(A=await i(k),v=!0)}if(A||(f||(n.__retain=k=>{let R=new Map;for(let[E,T]of k.nodeMap.entries())R.set(T,E);S={...k,srcToClone:R}}),A=await r()),!f&&!o.disposed){o.dirty=!1,o.dirtyRoots=new Set,S?(o.retained=S,o.retainedFrameDriven=ra(S),vo(t,o),ko(t,o)):v&&(o.retainedFrameDriven||=ra(o.retained,M),vo(t,o),ko(t,o));let k=oa(t,o);k.animation=sa(ia(t,o));let R=["style","scroll","controls","images"];b||R.push("animation");let E=R.every(T=>Pe(d,k,T));o.renderState=k,o.styleEpoch=Jt(),o.styleStamp=Qe(t),o.geometry=ta(t),o.renderState.frameDriven?(la.add(t),ua(t,o)):E?!x&&!o.renderState.frameDriven&&(o.last=A,ea(t,o)):(o.dirtyAll(),o.last=null)}return A}finally{n.__retain=void 0;for(let v of o.observers)for(let M of v.takeRecords())o.pending.push(M);Et();let A=gn(t);(o.torn||Au(o.pending)||A!==l)&&(o.dirtyAll(),o.last=null),o.outsideMutations=A,o.styleEpoch=Jt(),o.styleStamp=Qe(t),o.pending.length=0,o.torn=!1,o.capturing=!1,o.disposed||(wo(t,o),xo(t,o))}},c=o.inflight.then(a,a);return o.inflight=c.catch(()=>{}),c}var nr=null;function ya(t){nr=t}var $u='button, a[href], [role="button"], input, select, summary, label, [tabindex]',Ao=!1,an=null,Mo=new WeakMap,ma=!1;function ba(t,e){!Ao||!an||e&&e.burst===!1||Mo.set(an.control,{element:t,options:e&&typeof e=="object"?{...e}:e})}function wa(t){let e={control:t};an=e,setTimeout(()=>{an===e&&(an=null)},0)}function _o(t){let e=t.target,n=e&&(e.nodeType===1?e:e.parentElement);return n&&n.closest?n.closest($u):null}function ga(t){if(t.type==="keydown"&&t.key!=="Enter"&&t.key!==" ")return;let e=_o(t);e&&(wa(e),Eo(t,!1))}function Pu(t){let e=_o(t);e&&wa(e)}function Eo(t,e=!0){if(!nr||document.visibilityState==="hidden")return;let n=_o(t);if(!n||t.type==="pointerenter"&&t.target!==n)return;let r=Mo.get(n);if(r){if(!r.element.isConnected){Mo.delete(n);return}nr(r.element,r.options).catch(()=>{});return}e&&!ma&&(ma=!0,nr(document.body,{clip:"viewport",burst:!1}).catch(()=>{}))}function Sa(){if(Ao||typeof document>"u"||typeof document.addEventListener!="function")return;Ao=!0;let t={capture:!0,passive:!0};document.addEventListener("pointerdown",ga,t),document.addEventListener("keydown",ga,t),document.addEventListener("click",Pu,t),document.addEventListener("pointerenter",Eo,t),document.addEventListener("focusin",Eo,t)}mt();function Zu(...t){return lo(...t),G}async function td(t,e){if(typeof t!="string"||!t.trim())throw new Error("[snapdom.fromString] html string required");let n=document.createElement("div");Q(n),n.style.cssText="position:fixed;left:-99999px;top:0;pointer-events:none;",n.innerHTML=t,document.body.appendChild(n);try{await ft();let r=Array.from(n.childNodes).some(o=>o.nodeType===3&&o.textContent.trim()),i=n.children.length===1&&!r?n.firstElementChild:n;return await Oo(i,{...e||{},burst:!1})}finally{n.remove()}}var ed="3.0.0-beta.0",G=Object.assign(Oo,{plugins:Zu,fromString:td,version:ed,preCapture:Sa});ya(Oo);var Wo=Symbol("snapdom.internal"),nd=Symbol("snapdom.internal.silent"),$a=new Set(["png","jpeg","jpg","webp","svg"]);async function Oo(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=Qs(e);n.element=t,n.invalidate&&be(),Bs(n,e&&e.plugins);let{stage:r,loweredBy:i}=Is(n);n.needs=r,n.__needsLoweredBy=i;let o=Fe(r,"render"),s=n.burst===!0||!Vn(n),a=typeof n.filter=="function"||!!n.excludePredicates||typeof n.excludeStyleProps=="function"||typeof n.fallbackURL=="function",f=o&&!n.captureSelection&&n.burst!==!1&&s&&!a&&da(t);return f&&ba(t,e),n.snap||(n.snap={toPng:(l,u)=>G.toPng(l,u),toSvg:(l,u)=>G.toSvg(l,u)}),f?ha(t,e,n,()=>G.capture(t,n,Wo),l=>Pa(l,n)):G.capture(t,n,Wo)}G.capture=async(t,e,n)=>{if(n!==Wo)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");if(Fe(e.needs||ct,"render")&&X()){if(e.embedFonts)try{let o=t.ownerDocument||document,s=new Set;if(e.embedFonts==="auto"){try{for(let l of o.fonts)s.add(String(l.family).replace(/["']/g,"").toLowerCase())}catch{}if(s.size===0)throw null}let a=Fn(t);e.clip||(e.__fontUsage=a);let c=a.required,f=new Set([...c].map(l=>String(l).split("__")[0]).filter(Boolean));if(e.embedFonts==="auto"&&(f=new Set([...f].filter(l=>s.has(l.toLowerCase()))),f.size===0))throw null;await Tn(f,1,o)}catch{}let i=Array.from(t.querySelectorAll("canvas"));t.tagName==="CANVAS"&&i.unshift(t);for(let o of i)try{if(en(o))continue;let s=o.getContext("2d",{willReadFrequently:!0});s&&s.getImageData(0,0,1,1)}catch(s){U(e,"safari canvas poke failed",s)}}let r=await Ks(t,e);return Pa(r,e)};async function Pa(t,e){let n=e.needs||ct,r=Fe(n,"render"),i=_=>Os(n,e.__needsLoweredBy||[],_),o=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement?t:null,s=o?null:t,a=()=>s??=o.toDataURL(),c=o||t;o&&(t="");let f=e.__compressedSnapshot,l=e.__compressionDensity;delete e.__compressedSnapshot,delete e.__compressedAssets;let u,p=e.meta||{},d=(Number.isFinite(e.width)||Number.isFinite(e.height))&&!X(),h=d?Number.isFinite(e.width)?p.targetW/p.vbW:p.targetH/p.vbH:1,g=d?Number.isFinite(e.height)?p.targetH/p.vbH:p.targetW/p.vbW:1,y=_=>{if(o||!f?.size)return c;let W=p.vbW,$=p.vbH,F=_.crop;F&&(W=Math.max(1,Math.min(W,F.x+F.width)-Math.max(0,F.x)),$=Math.max(1,Math.min($,F.y+F.height)-Math.max(0,F.y)));let L=Number.isFinite(_.width),V=Number.isFinite(_.height);return(L&&V?Math.max(_.width/W,_.height/$):L?_.width/W*(F?Math.max(1,g/h):1):V?_.height/$*(F?Math.max(1,h/g):1):(_.scale||1)*Math.max(h,g))*(_.dpr||1)<=l?c:u??=qs(a(),f)},b=async(_,W)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),fn));return $(c,{..._,...W||{},format:"png"})},w=()=>{if(!r)throw i("svgString");if(o)throw new Error("[snapdom] svgString: engine:'html-in-canvas' produces a raster capture; there is no serialized SVG");let _=t.indexOf(",");return _>=0?decodeURIComponent(t.slice(_+1)):""},C=_=>Object.defineProperty({..._||{},svgString:w},"url",r?{get:a,enumerable:!0}:{get(){throw i("export.url")},enumerable:!1,configurable:!0}),x={img:async(_,W)=>{if(o)return b(_,W);let{toImg:$}=await Promise.resolve().then(()=>(No(),Po)),F={..._,...W||{}};return $(y(F),F)},svg:async(_,W)=>{if(o)return b(_,W);let{toSvg:$}=await Promise.resolve().then(()=>(No(),Po)),F={..._,...W||{}};return $(y(F),F)},canvas:async(_,W)=>{let{toCanvas:$}=await Promise.resolve().then(()=>(Ie(),Ea)),F={..._,...W||{}};return $(y(F),F)},blob:async(_,W)=>{let{toBlob:$}=await Promise.resolve().then(()=>(Io(),_a)),F={..._,...W||{}};return $(y(F),F)},png:async(_,W)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),fn)),F={..._,...W||{},format:"png"};return $(y(F),F)},jpeg:async(_,W)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),fn)),F={..._,...W||{},format:"jpeg"};return $(y(F),F)},webp:async(_,W)=>{let{rasterize:$}=await Promise.resolve().then(()=>(We(),fn)),F={..._,...W||{},format:"webp"};return $(y(F),F)},download:async(_,W)=>{let{download:$}=await Promise.resolve().then(()=>(Ta(),Fa)),F={..._,...W||{}};return $(y(F),F)}};if(!r)for(let _ of Object.keys(x)){let W=_==="download"?"download()":`to${_.charAt(0).toUpperCase()}${_.slice(1)}()`;x[_]=async()=>{throw i(W)}}let S={};for(let _ of["img","svg","canvas","blob","png","jpeg","webp"])S[_]=async W=>x[_](e,{...E(_,W||{}),[nd]:!0});S.jpg=S.jpeg;let A=_=>Object.defineProperty({...e,..._},"options",{value:e,configurable:!0}),v=A({artifacts:e.__artifacts||null,export:C(),exports:S}),M=await jn("defineExports",v),k=Object.assign({},...M.filter(_=>_&&typeof _=="object").reverse()),R={...x,...k};R.jpeg&&!R.jpg&&(R.jpg=(_,W)=>R.jpeg(_,W));function E(_,W){let $=W||{},F={...e,...$},L=typeof $.type=="string"?$.type.toLowerCase():"",V=typeof $.format=="string"?$.format.toLowerCase():$a.has(L)?L:"";V&&(F.format=V==="jpg"?"jpeg":V),F.__explicitFormat=V?F.format:e.__explicitFormat??null,_==="blob"&&!F.__explicitFormat&&(F.format=o?"png":"svg"),F.type=F.format;let q=et=>et==="jpeg"||et==="jpg"||et==="webp";return[_,F.format,L].map(et=>typeof et=="string"?et.toLowerCase():"").find(q)&&(F.backgroundColor==null||F.backgroundColor==="transparent")&&(F.backgroundColor="#ffffff"),F.scale!==1&&(Number.isFinite(F.width)||Number.isFinite(F.height))&&U(F,"width/height define the output size \u2014 scale is ignored when either is set"),F}let T=!1,N=Promise.resolve();async function B(_,W){let $=Object.freeze(W&&typeof W=="object"?{...W}:{}),F=async()=>{let V=R[_];if(!V)throw new Error(`[snapdom] Unknown export type: ${_}`);let q=E(_,$),pt=A({artifacts:e.__artifacts||null,export:C({type:_,options:q,requestedOptions:$})}),et=q.format,bt=q.type;await jn("beforeExport",pt,{format:_,options:q});let ae=q.format!==et?q.format:q.type!==bt?q.type:"",ht=typeof ae=="string"?ae.toLowerCase():"";$a.has(ht)&&(q.format=ht==="jpg"?"jpeg":ht,q.type=q.format,q.__explicitFormat=q.format,/^(?:jpeg|webp)$/.test(q.format)&&(q.backgroundColor==null||q.backgroundColor==="transparent")&&(q.backgroundColor="#ffffff"));let D=await V(pt,q);return await jn("afterExport",pt,{format:_,options:q,result:D}),T||(T=!0,await $t("afterSnap",e)),D},L=N.then(F);return N=L.catch(()=>{}),L}let j={url:t,needs:n,warnings:e.__session&&e.__session.warnings||[],toRaw:()=>{if(!r)throw i("toRaw()");return a()},to:(_,W)=>B(_,W),toImg:_=>B("img",_),toSvg:_=>B("svg",_),toCanvas:_=>B("canvas",_),toBlob:_=>B("blob",_),toPng:_=>B("png",_),toJpg:_=>B("jpg",_),toWebp:_=>B("webp",_),download:_=>B("download",_)};r?o&&Object.defineProperty(j,"url",{get:a,enumerable:!0,configurable:!0}):Object.defineProperty(j,"url",{get(){throw i("url")},enumerable:!1,configurable:!0}),Object.defineProperty(j,"meta",r?{value:e.meta,enumerable:!0}:{get(){throw i("meta")},enumerable:!1,configurable:!0});for(let _ of Object.keys(R)){let W="to"+_.charAt(0).toUpperCase()+_.slice(1);j[W]||(j[W]=$=>B(_,$))}return j}G.toRaw=(t,e)=>G(t,e).then(n=>n.toRaw());G.toImg=(t,e)=>G(t,e).then(n=>n.toImg());G.toSvg=(t,e)=>G(t,e).then(n=>n.toSvg());G.toCanvas=(t,e)=>G(t,e).then(n=>n.toCanvas());G.toBlob=(t,e)=>G(t,e).then(n=>n.toBlob());G.toPng=(t,e)=>G(t,{...e,format:"png"}).then(n=>n.toPng());G.toJpg=(t,e)=>G(t,{...e,format:"jpeg"}).then(n=>n.toJpg());G.toWebp=(t,e)=>G(t,{...e,format:"webp"}).then(n=>n.toWebp());G.download=(t,e)=>G(t,e).then(n=>n.download());export{ct as DEFAULT_STAGE,Re as STAGES,Ws as assertNeeds,If as clearPlugins,fo as getGlobalPlugins,$e as normalizePlugin,lo as registerPlugins,G as snapdom};
|