@zumer/snapdom 1.9.12-dev.3 → 1.9.12-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/snapdom.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /*
3
3
  * snapdom
4
- * v.1.9.12-dev.3
4
+ * v.1.9.12-dev.4
5
5
  * Author Juan Martin Muda
6
6
  * License MIT
7
7
  **/
@@ -664,8 +664,9 @@
664
664
  function isSafari() {
665
665
  const ua = typeof navigator !== "undefined" && navigator.userAgent ? navigator.userAgent : "";
666
666
  const isSafariUA = /^((?!chrome|android).)*safari/i.test(ua);
667
+ const isUIWebView = /AppleWebKit/i.test(ua) && /Mobile/i.test(ua) && !/Safari/i.test(ua);
667
668
  const isWeChatUA = /(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(ua);
668
- return isSafariUA || isWeChatUA;
669
+ return isSafariUA || isUIWebView || isWeChatUA;
669
670
  }
670
671
 
671
672
  // src/modules/styles.js
@@ -2372,7 +2373,7 @@
2372
2373
  const hasBox2 = display !== "inline" && (width > 0 || height > 0);
2373
2374
  const hasBorder = borderStyle && borderStyle !== "none" && borderWidth > 0;
2374
2375
  const hasTransform = transform && transform !== "none";
2375
- const shouldRender = hasExplicitContent || hasBg || hasBgColor || hasBox2 || hasBorder || hasTransform;
2376
+ const shouldRender = hasExplicitContent || hasBg || hasBgColor || hasBorder || hasTransform;
2376
2377
  if (!shouldRender) {
2377
2378
  if (incs && incs.length && source.parentElement) {
2378
2379
  const map = __siblingCounters.get(source.parentElement) || /* @__PURE__ */ new Map();
@@ -2390,6 +2391,7 @@
2390
2391
  const pseudoEl = document.createElement("span");
2391
2392
  pseudoEl.dataset.snapdomPseudo = pseudo;
2392
2393
  pseudoEl.style.verticalAlign = "middle";
2394
+ pseudoEl.style.pointerEvents = "none";
2393
2395
  const snapshot = snapshotComputedStyle(style);
2394
2396
  const key = getStyleKey(snapshot, "span");
2395
2397
  sessionCache.styleMap.set(pseudoEl, key);
@@ -2416,6 +2418,10 @@
2416
2418
  } else if (!isIconFont22 && hasExplicitContent) {
2417
2419
  pseudoEl.textContent = cleanContent;
2418
2420
  }
2421
+ pseudoEl.style.background = "none";
2422
+ if ("mask" in pseudoEl.style) {
2423
+ pseudoEl.style.mask = "none";
2424
+ }
2419
2425
  if (hasBg) {
2420
2426
  try {
2421
2427
  const bgSplits = splitBackgroundImage(bg);
@@ -2427,7 +2433,7 @@
2427
2433
  }
2428
2434
  if (hasBgColor) pseudoEl.style.backgroundColor = bgColor;
2429
2435
  const hasContent2 = pseudoEl.childNodes.length > 0 || ((_a = pseudoEl.textContent) == null ? void 0 : _a.trim()) !== "";
2430
- const hasVisibleBox = hasContent2 || hasBg || hasBgColor || hasBox2 || hasBorder || hasTransform;
2436
+ const hasVisibleBox = hasContent2 || hasBg || hasBgColor || hasBorder || hasTransform;
2431
2437
  if (incs && incs.length && source.parentElement) {
2432
2438
  const map = __siblingCounters.get(source.parentElement) || /* @__PURE__ */ new Map();
2433
2439
  const baseWithSibs = withSiblingOverrides(source, counterCtx);
@@ -2507,6 +2513,103 @@
2507
2513
  });
2508
2514
  }
2509
2515
 
2516
+ // src/modules/changeCSS.js
2517
+ function freezeSticky(originalRoot, cloneRoot) {
2518
+ var _a;
2519
+ if (!originalRoot || !cloneRoot) return;
2520
+ const scrollTop = originalRoot.scrollTop || 0;
2521
+ if (!scrollTop) return;
2522
+ if (getComputedStyle(cloneRoot).position === "static") {
2523
+ cloneRoot.style.position = "relative";
2524
+ }
2525
+ const rootRect = originalRoot.getBoundingClientRect();
2526
+ const viewportH = originalRoot.clientHeight;
2527
+ const PH_ATTR = "data-snap-ph";
2528
+ const walker = document.createTreeWalker(originalRoot, NodeFilter.SHOW_ELEMENT);
2529
+ while (walker.nextNode()) {
2530
+ const el = (
2531
+ /** @type {HTMLElement} */
2532
+ walker.currentNode
2533
+ );
2534
+ const cs = getComputedStyle(el);
2535
+ const pos = cs.position;
2536
+ if (pos !== "sticky" && pos !== "-webkit-sticky") continue;
2537
+ const topInit = _toPx(cs.top);
2538
+ const bottomInit = _toPx(cs.bottom);
2539
+ if (topInit == null && bottomInit == null) continue;
2540
+ const path = _pathOf(el, originalRoot);
2541
+ const cloneEl = _findByPathIgnoringPlaceholders(cloneRoot, path, PH_ATTR);
2542
+ if (!cloneEl) continue;
2543
+ const elRect = el.getBoundingClientRect();
2544
+ const widthPx = elRect.width;
2545
+ const heightPx = elRect.height;
2546
+ const leftPx = elRect.left - rootRect.left;
2547
+ if (!(widthPx > 0 && heightPx > 0)) continue;
2548
+ if (!Number.isFinite(leftPx)) continue;
2549
+ const topAbsPx = topInit != null ? topInit + scrollTop : scrollTop + (viewportH - heightPx - /** bottomInit non-null */
2550
+ bottomInit);
2551
+ if (!Number.isFinite(topAbsPx)) continue;
2552
+ const zParsed = Number.parseInt(cs.zIndex, 10);
2553
+ const hasZ = Number.isFinite(zParsed);
2554
+ const overlayZ = hasZ ? Math.max(zParsed, 1) + 1 : 2;
2555
+ const placeholderZ = hasZ ? zParsed - 1 : 0;
2556
+ const ph = cloneEl.cloneNode(false);
2557
+ ph.setAttribute(PH_ATTR, "1");
2558
+ ph.style.position = "sticky";
2559
+ ph.style.left = `${leftPx}px`;
2560
+ ph.style.top = `${topAbsPx}px`;
2561
+ ph.style.width = `${widthPx}px`;
2562
+ ph.style.height = `${heightPx}px`;
2563
+ ph.style.visibility = "hidden";
2564
+ ph.style.zIndex = String(placeholderZ);
2565
+ ph.style.overflow = "hidden";
2566
+ ph.style.background = "transparent";
2567
+ ph.style.boxShadow = "none";
2568
+ ph.style.filter = "none";
2569
+ (_a = cloneEl.parentElement) == null ? void 0 : _a.insertBefore(ph, cloneEl);
2570
+ cloneEl.style.position = "absolute";
2571
+ cloneEl.style.left = `${leftPx}px`;
2572
+ cloneEl.style.top = `${topAbsPx}px`;
2573
+ cloneEl.style.bottom = "auto";
2574
+ cloneEl.style.zIndex = String(overlayZ);
2575
+ cloneEl.style.pointerEvents = "none";
2576
+ }
2577
+ }
2578
+ function _toPx(v) {
2579
+ if (!v || v === "auto") return null;
2580
+ const n = Number.parseFloat(v);
2581
+ return Number.isFinite(n) ? n : null;
2582
+ }
2583
+ function _pathOf(el, root) {
2584
+ const path = [];
2585
+ for (let cur = el; cur && cur !== root; ) {
2586
+ const p = cur.parentElement;
2587
+ if (!p) break;
2588
+ path.push(Array.prototype.indexOf.call(p.children, cur));
2589
+ cur = p;
2590
+ }
2591
+ return path.reverse();
2592
+ }
2593
+ function _findByPathIgnoringPlaceholders(root, path, phAttr) {
2594
+ let cur = root;
2595
+ for (let i = 0; i < path.length; i++) {
2596
+ const kids = _childrenWithoutPlaceholders(cur, phAttr);
2597
+ cur = /** @type {HTMLElement|undefined} */
2598
+ kids[path[i]];
2599
+ if (!cur) return null;
2600
+ }
2601
+ return cur instanceof HTMLElement ? cur : null;
2602
+ }
2603
+ function _childrenWithoutPlaceholders(el, phAttr) {
2604
+ const out = [];
2605
+ const ch = el.children;
2606
+ for (let i = 0; i < ch.length; i++) {
2607
+ const c = ch[i];
2608
+ if (!c.hasAttribute(phAttr)) out.push(c);
2609
+ }
2610
+ return out;
2611
+ }
2612
+
2510
2613
  // src/core/prepare.js
2511
2614
  function prepareClone(_0) {
2512
2615
  return __async(this, arguments, function* (element, options = {}) {
@@ -2583,6 +2686,8 @@
2583
2686
  cloneNode.appendChild(inner);
2584
2687
  }
2585
2688
  }
2689
+ const contentRoot = clone instanceof HTMLElement && clone.firstElementChild instanceof HTMLElement ? clone.firstElementChild : clone;
2690
+ freezeSticky(element, contentRoot);
2586
2691
  if (element === sessionCache.nodeMap.get(clone)) {
2587
2692
  const computed = sessionCache.styleCache.get(element) || window.getComputedStyle(element);
2588
2693
  sessionCache.styleCache.set(element, computed);
@@ -1,5 +1,5 @@
1
- (()=>{var cn=Object.defineProperty,ln=Object.defineProperties;var fn=Object.getOwnPropertyDescriptors;var Te=Object.getOwnPropertySymbols;var un=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable;var We=(t,e,n)=>e in t?cn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,J=(t,e)=>{for(var n in e||(e={}))un.call(e,n)&&We(t,n,e[n]);if(Te)for(var n of Te(e))dn.call(e,n)&&We(t,n,e[n]);return t},Q=(t,e)=>ln(t,fn(e));var $=(t,e,n)=>new Promise((r,a)=>{var o=i=>{try{l(n.next(i))}catch(c){a(c)}},s=i=>{try{l(n.throw(i))}catch(c){a(c)}},l=i=>i.done?r(i.value):Promise.resolve(i.value).then(o,s);l((n=n.apply(t,e)).next())});var y={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function Yt(t="soft"){switch(t){case"auto":{y.session.styleMap=new Map,y.session.nodeMap=new Map;return}case"soft":{y.session.styleMap=new Map,y.session.nodeMap=new Map,y.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{y.session.styleMap=new Map,y.session.nodeMap=new Map,y.session.styleCache=new WeakMap,y.computedStyle=new WeakMap,y.baseStyle=new Map,y.defaultStyle=new Map,y.image=new Map,y.background=new Map,y.resource=new Map,y.font=new Set;return}default:{y.session.styleMap=new Map,y.session.nodeMap=new Map,y.session.styleCache=new WeakMap;return}}}function Lt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function de(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let a=r.split(",").map(o=>o.trim());return a.length!==6?`matrix(${r})`:(a[4]="0",a[5]="0",`matrix(${a.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let a=r.split(",").map(o=>o.trim());return a.length!==16?`matrix3d(${r})`:(a[12]="0",a[13]="0",`matrix3d(${a.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function At(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch(e){return t}}function mn(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,a=0;function o(s,l,i){if(a>=n)return;let c=Date.now();(r.get(l)||0)>c||(r.set(l,c+e),a++,s==="warn"&&console&&console.warn?console.warn(`${t} ${i}`):console&&console.error&&console.error(`${t} ${i}`))}return{warnOnce(s,l){o("warn",s,l)},errorOnce(s,l){o("error",s,l)},reset(){r.clear(),a=0}}}var _e=mn("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),me=new Map,Gt=new Map;function hn(t){return/^data:|^blob:|^about:blank$/i.test(t)}function pn(t,e){try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",r=e.includes("{url}")?e.split("{url}")[0]:e,a=new URL(r||".",n),o=new URL(t,n);if(o.origin===a.origin)return!0;let s=o.searchParams;if(s&&(s.has("url")||s.has("target")))return!0}catch(n){}return!1}function gn(t,e){if(!e||hn(t)||pn(t,e))return!1;try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location!="undefined"?r.origin!==location.origin:!0}catch(n){return!!e}}function yn(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",At(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}${At(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Pe(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 wn(t,e){var n,r;return[e.as||"blob",(n=e.timeout)!=null?n:3e3,e.useProxy||"",(r=e.errorTTL)!=null?r:8e3,t].join("|")}function Z(n){return $(this,arguments,function*(t,e={}){var S,M,I;let r=(S=e.as)!=null?S:"blob",a=(M=e.timeout)!=null?M:3e3,o=e.useProxy||"",s=(I=e.errorTTL)!=null?I:8e3,l=e.headers||{},i=!!e.silent;if(/^data:/i.test(t))try{if(r==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(r==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,E="",F=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],W=/;base64/i.test(E)?atob(F):decodeURIComponent(F),N=new Uint8Array([...W].map(V=>V.charCodeAt(0))),P=new Blob([N],{type:(E||"").split(";")[0]||""});return{ok:!0,data:P,status:200,url:t,fromCache:!1,mime:P.type||""}}catch(E){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let E=yield fetch(t);if(!E.ok)return{ok:!1,data:null,status:E.status,url:t,fromCache:!1,reason:"http_error"};let F=yield E.blob(),k=F.type||E.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:yield Pe(F),status:E.status,url:t,fromCache:!1,mime:k}:r==="text"?{ok:!0,data:yield F.text(),status:E.status,url:t,fromCache:!1,mime:k}:{ok:!0,data:F,status:E.status,url:t,fromCache:!1,mime:k}}catch(E){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return r==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:r==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let c=wn(t,{as:r,timeout:a,useProxy:o,errorTTL:s}),f=Gt.get(c);if(f&&f.until>Date.now())return Q(J({},f.result),{fromCache:!0});f&&Gt.delete(c);let d=me.get(c);if(d)return d;let m=gn(t,o)?yn(t,o):t,g=e.credentials;if(!g)try{let E=typeof location!="undefined"&&location.href?location.href:"http://localhost/",F=new URL(t,E);g=typeof location!="undefined"&&F.origin===location.origin?"include":"omit"}catch(E){g="omit"}let b=new AbortController,u=setTimeout(()=>b.abort("timeout"),a),h=$(null,null,function*(){var E,F;try{let k=yield fetch(m,{signal:b.signal,credentials:g,headers:l});if(!k.ok){let P={ok:!1,data:null,status:k.status,url:m,fromCache:!1,reason:"http_error"};if(s>0&&Gt.set(c,{until:Date.now()+s,result:P}),!i){let V=`${k.status} ${k.statusText||""}`.trim();_e.warnOnce(`http:${k.status}:${r}:${new URL(t,(E=location==null?void 0:location.href)!=null?E:"http://localhost/").origin}`,`HTTP error ${V} while fetching ${r} ${t}`)}return e.onError&&e.onError(P),P}if(r==="text")return{ok:!0,data:yield k.text(),status:k.status,url:m,fromCache:!1};let W=yield k.blob(),N=W.type||k.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:yield Pe(W),status:k.status,url:m,fromCache:!1,mime:N}:{ok:!0,data:W,status:k.status,url:m,fromCache:!1,mime:N}}catch(k){let W=k&&typeof k=="object"&&"name"in k&&k.name==="AbortError"?String(k.message||"").includes("timeout")?"timeout":"abort":"network",N={ok:!1,data:null,status:0,url:m,fromCache:!1,reason:W};if(!/^blob:/i.test(t)&&s>0&&Gt.set(c,{until:Date.now()+s,result:N}),!i){let P=`${W}:${r}:${new URL(t,(F=location==null?void 0:location.href)!=null?F:"http://localhost/").origin}`,V=W==="timeout"?`Timeout after ${a}ms. Consider increasing timeout or using a proxy for ${t}`:W==="abort"?`Request aborted while fetching ${r} ${t}`:`Network/CORS issue while fetching ${r} ${t}. A proxy may be required`;_e.errorOnce(P,V)}return e.onError&&e.onError(N),N}finally{clearTimeout(u),me.delete(c)}});return me.set(c,h),h})}function Nt(t,e){if(!e||!t.width||!t.height)return t;let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let r=n.getContext("2d");return r.fillStyle=e,r.fillRect(0,0,n.width,n.height),r.drawImage(t,0,0),n}function Rt(n){return $(this,arguments,function*(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let a=Lt(t);if(!a)return t;let o=At(a);if(y.background.has(o)){let s=y.background.get(o);return s?`url("${s}")`:"none"}try{let s=yield Z(o,{as:"dataURL",useProxy:e.useProxy});return s.ok?(y.background.set(o,s.data),`url("${s.data}")`):(y.background.set(o,null),"none")}catch(s){return y.background.set(o,null),"none"}})}var Kt=new Set(["meta","script","noscript","title","link","template"]),Ot=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),bn=["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"];function he(){for(let t of bn){let e=String(t).toLowerCase();Kt.has(e)||Ot.has(e)||pe(e)}}function pe(t){if(t=String(t).toLowerCase(),Ot.has(t)){let o={};return y.defaultStyle.set(t,o),o}if(y.defaultStyle.has(t))return y.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 r=getComputedStyle(n),a={};for(let o of r){if(Ue(o))continue;let s=r.getPropertyValue(o);a[o]=s}return e.removeChild(n),y.defaultStyle.set(t,a),a}var xn=/(?:^|-)(animation|transition)(?:-|$)/i,Sn=/^(--|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,Cn=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"]);function Ue(t){let e=String(t).toLowerCase();return!!(Cn.has(e)||Sn.test(e)||xn.test(e))}function Dt(t,e){if(e=String(e||"").toLowerCase(),Ot.has(e))return"";let n=[],r=pe(e);for(let[a,o]of Object.entries(t)){if(Ue(a))continue;let s=r[a];o&&o!==s&&n.push(`${a}:${o}`)}return n.sort(),n.join(";")}function ge(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 ye(t){let e=new Map;for(let r of t){let a=y.defaultStyle.get(r);if(!a)continue;let o=Object.entries(a).map(([s,l])=>`${s}:${l};`).sort().join("");o&&(e.has(o)||e.set(o,[]),e.get(o).push(r))}let n="";for(let[r,a]of e.entries())n+=`${a.join(",")} { ${r} }
2
- `;return n}function we(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let a of e)n.set(a,`c${r++}`);return n}function It(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=y.computedStyle.get(t);if(n||(n=new Map,y.computedStyle.set(t,n)),!n.has(e)){let r=window.getComputedStyle(t,e);n.set(e,r)}return n.get(e)}function Jt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function Tt(t){let e=[],n=0,r=0;for(let a=0;a<t.length;a++){let o=t[a];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,a).trim()),r=a+1)}return e.push(t.slice(r).trim()),e}function xt(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function tt(){let t=typeof navigator!="undefined"&&navigator.userAgent?navigator.userAgent:"",e=/^((?!chrome|android).)*safari/i.test(t),n=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(t);return e||n}var Be=new WeakMap,be=new Map,xe=0;function Ht(){xe++}var Oe=!1;function kn(t=document.documentElement){var e,n;if(!Oe){Oe=!0;try{new MutationObserver(()=>Ht()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(r){}try{new MutationObserver(()=>Ht()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(r){}try{let r=document.fonts;r&&((e=r.addEventListener)==null||e.call(r,"loadingdone",Ht),(n=r.ready)==null||n.then(()=>Ht()).catch(()=>{}))}catch(r){}}}function Mn(t,e={}){let n={},r=t.getPropertyValue("visibility");for(let a=0;a<t.length;a++){let o=t[a],s=t.getPropertyValue(o);(o==="background-image"||o==="content")&&s.includes("url(")&&!s.includes("data:")&&(s="none"),n[o]=s}if(e.embedFonts){let a=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let o of a)if(!n[o])try{let s=t.getPropertyValue(o);s&&(n[o]=s)}catch(s){}}return r==="hidden"&&(n.opacity="0"),n}var De=new WeakMap;function An(t){let e=De.get(t);return e||(e=Object.entries(t).sort((r,a)=>r[0]<a[0]?-1:r[0]>a[0]?1:0).map(([r,a])=>`${r}:${a}`).join(";"),De.set(t,e),e)}function $n(t,e=null,n={}){let r=Be.get(t);if(r&&r.epoch===xe)return r.snapshot;let a=e||getComputedStyle(t),o=Mn(a,n);return Rn(t,a,o),Be.set(t,{epoch:xe,snapshot:o}),o}function En(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:be,defaultStyle:y.defaultStyle,baseStyle:y.baseStyle,image:y.image,resource:y.resource,background:y.background,font:y.font},options:e||{}}:{session:y.session,persist:{snapshotKeyCache:be,defaultStyle:y.defaultStyle,baseStyle:y.baseStyle,image:y.image,resource:y.resource,background:y.background,font:y.font},options:t||e||{}}}function Wt(t,e,n,r){return $(this,null,function*(){var m,g,b;if(t.tagName==="STYLE")return;let a=En(n,r),o=a.options&&a.options.cache||"auto";if(o!=="disabled"&&kn(document.documentElement),o==="disabled"&&!a.session.__bumpedForDisabled&&(Ht(),be.clear(),a.session.__bumpedForDisabled=!0),Ot.has((m=t.tagName)==null?void 0:m.toLowerCase())){let u=(g=t.getAttribute)==null?void 0:g.call(t,"style");u&&e.setAttribute("style",u)}let{session:s,persist:l}=a;s.styleCache.has(t)||s.styleCache.set(t,getComputedStyle(t));let i=s.styleCache.get(t),c=$n(t,i,a.options),f=An(c),d=l.snapshotKeyCache.get(f);if(!d){let u=((b=t.tagName)==null?void 0:b.toLowerCase())||"div";d=Dt(c,u),l.snapshotKeyCache.set(f,d)}s.styleMap.set(e,d)})}function Fn(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function vn(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 Ln(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function Nn(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,r=t.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let a=t.scrollHeight;if(a===0)return!1;let o=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingBottom)||0;return a>o+s}function Rn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let r=e.display||"";if(r.includes("flex")||r.includes("grid")||Fn(t))return;let a=e.position;a==="absolute"||a==="fixed"||a==="sticky"||e.transform==="none"&&(vn(e)||Ln(t)||Nn(t,e)&&(delete n.height,delete n["block-size"]))}function Se(t,e,n){return Promise.all(t.map(r=>new Promise(a=>{function o(){xt(s=>{(s&&typeof s.timeRemaining=="function"?s.timeRemaining()>0:!0)?e(r,a):o()},{fast:n})}o()})))}function In(t){return t=t.trim(),!t||/\:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function Tn(t,e,n=!0){return t.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let a=n?In(r):r;return`:where(${e} ${a})`}).join(", ")}function Wn(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,a,o)=>{let s=Tn(o,e,!0);return`${r}${a}${s}{`}),t):""}function _n(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Pn(t){let e="";try{t.querySelectorAll("style").forEach(r=>{e+=(r.textContent||"")+`
3
- `});let n=t.adoptedStyleSheets||[];for(let r of n)try{if(r&&r.cssRules)for(let a of r.cssRules)e+=a.cssText+`
4
- `}catch(a){}}catch(n){}return e}function Un(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 Bn(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch(n){}}function On(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 Dn(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch(n){}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch(n){}return""}function Hn(t,e,n){let r=[];for(let a of e){let o=Dn(t,a);o&&r.push(`${a}: ${o};`)}return r.length?`${n}{${r.join("")}}
5
- `:""}function qn(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}function jn(t,e=3){return $(this,null,function*(){let n=()=>{var o;try{return t.contentDocument||((o=t.contentWindow)==null?void 0:o.document)||null}catch(s){return null}},r=n(),a=0;for(;a<e&&(!r||!r.body&&!r.documentElement);)yield new Promise(o=>setTimeout(o,0)),r=n(),a++;return r&&(r.body||r.documentElement)?r:null})}function Vn(t){let e=t.getBoundingClientRect(),n=0,r=0,a=0,o=0;try{let i=getComputedStyle(t);n=parseFloat(i.borderLeftWidth)||0,r=parseFloat(i.borderRightWidth)||0,a=parseFloat(i.borderTopWidth)||0,o=parseFloat(i.borderBottomWidth)||0}catch(i){}let s=Math.max(0,Math.round(e.width-(n+r))),l=Math.max(0,Math.round(e.height-(a+o)));return{contentWidth:s,contentHeight:l,rect:e}}function zn(t,e,n){let r=t.createElement("style");return r.setAttribute("data-sd-iframe-pin",""),r.textContent=`html, body {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;}`,(t.head||t.documentElement).appendChild(r),()=>{try{r.remove()}catch(a){}}}function Xn(t,e,n){return $(this,null,function*(){let r=yield jn(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:a,contentHeight:o,rect:s}=Vn(t),l=n==null?void 0:n.snap;if(!l||typeof l.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let i=Q(J({},n),{scale:1}),c=zn(r,a,o),f;try{f=yield l.toPng(r.documentElement,i)}finally{c()}f.style.display="block",f.style.width=`${a}px`,f.style.height=`${o}px`;let d=document.createElement("div");return e.nodeMap.set(d,t),Wt(t,d,e,n),d.style.overflow="hidden",d.style.display="block",d.style.width||(d.style.width=`${Math.round(s.width)}px`),d.style.height||(d.style.height=`${Math.round(s.height)}px`),d.appendChild(f),d})}function qt(t,e,n){return $(this,null,function*(){var c,f,d,m,g,b;if(!t)throw new Error("Invalid node");let r=new Set,a=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let u=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Kt.has(u))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"){let u=document.createElement("div"),h=t.getBoundingClientRect();return u.style.cssText=`display:inline-block;width:${h.width}px;height:${h.height}px;visibility:hidden;`,u}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let u of n.exclude)try{if((c=t.matches)!=null&&c.call(t,u)){if(n.excludeMode==="hide"){let h=document.createElement("div"),S=t.getBoundingClientRect();return h.style.cssText=`display:inline-block;width:${S.width}px;height:${S.height}px;visibility:hidden;`,h}else if(n.excludeMode==="remove")return null}}catch(h){console.warn(`Invalid selector in exclude option: ${u}`,h)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let u=document.createElement("div"),h=t.getBoundingClientRect();return u.style.cssText=`display:inline-block;width:${h.width}px;height:${h.height}px;visibility:hidden;`,u}else if(n.filterMode==="remove")return null}}catch(u){console.warn("Error in filter function:",u)}if(t.tagName==="IFRAME"){let u=!1;try{u=!!(t.contentDocument||(f=t.contentWindow)!=null&&f.document)}catch(h){u=!1}if(u)try{return yield Xn(t,e,n)}catch(h){console.warn("[SnapDOM] iframe rasterization failed, fallback:",h)}if(n.placeholders){let h=document.createElement("div");return h.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}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;`,Wt(t,h,e,n),h}else{let h=t.getBoundingClientRect(),S=document.createElement("div");return S.style.cssText=`display:inline-block;width:${h.width}px;height:${h.height}px;visibility:hidden;`,Wt(t,S,e,n),S}}if(t.getAttribute("data-capture")==="placeholder"){let u=t.cloneNode(!1);e.nodeMap.set(u,t),Wt(t,u,e,n);let h=document.createElement("div");return h.textContent=t.getAttribute("data-placeholder-text")||"",h.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",u.appendChild(h),u}if(t.tagName==="CANVAS"){let u=t.toDataURL(),h=document.createElement("img");return h.src=u,h.width=t.width,h.height=t.height,e.nodeMap.set(h,t),Wt(t,h,e,n),h}let s;try{if(s=t.cloneNode(!1),e.nodeMap.set(s,t),t.tagName==="IMG"){Bn(t,s);try{let u=t.getBoundingClientRect(),h=Math.round(u.width||0),S=Math.round(u.height||0);if(!h||!S){let M=window.getComputedStyle(t),I=parseFloat(M.width)||0,E=parseFloat(M.height)||0,F=parseInt(t.getAttribute("width")||"",10)||0,k=parseInt(t.getAttribute("height")||"",10)||0,W=t.width||t.naturalWidth||0,N=t.height||t.naturalHeight||0;h=Math.round(h||I||F||W||0),S=Math.round(S||E||k||N||0)}h&&(s.dataset.snapdomWidth=String(h)),S&&(s.dataset.snapdomHeight=String(S))}catch(u){}}}catch(u){throw console.error("[Snapdom] Failed to clone node:",t,u),u}if(t instanceof HTMLTextAreaElement){let u=t.getBoundingClientRect();s.style.width=`${u.width}px`,s.style.height=`${u.height}px`}if(t instanceof HTMLInputElement&&(s.value=t.value,s.setAttribute("value",t.value),t.checked!==void 0&&(s.checked=t.checked,t.checked&&s.setAttribute("checked",""),t.indeterminate&&(s.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(a=t.value),t instanceof HTMLTextAreaElement&&(o=t.value),Wt(t,s,e,n),t.shadowRoot){let k=function(N,P){if(N.nodeType===Node.ELEMENT_NODE&&N.tagName==="STYLE")return P(null);qt(N,e,n).then(V=>{P(V||null)}).catch(V=>{P(null)})};try{let N=t.shadowRoot.querySelectorAll("slot");for(let P of N){let V=[];try{V=((d=P.assignedNodes)==null?void 0:d.call(P,{flatten:!0}))||((m=P.assignedNodes)==null?void 0:m.call(P))||[]}catch(ot){V=((g=P.assignedNodes)==null?void 0:g.call(P))||[]}for(let ot of V)r.add(ot)}}catch(N){}let u=_n(e),h=`[data-sd="${u}"]`;try{s.setAttribute("data-sd",u)}catch(N){}let S=Pn(t.shadowRoot),M=Wn(S,h),I=On(S),E=Hn(t,I,h);Un(s,E+M,u);let F=document.createDocumentFragment(),W=yield Se(Array.from(t.shadowRoot.childNodes),k,n.fast);F.append(...W.filter(N=>!!N)),s.appendChild(F)}if(t.tagName==="SLOT"){let M=function(E,F){qt(E,e,n).then(k=>{k&&qn(k),F(k||null)}).catch(k=>{F(null)})},u=((b=t.assignedNodes)==null?void 0:b.call(t,{flatten:!0}))||[],h=u.length>0?u:Array.from(t.childNodes),S=document.createDocumentFragment(),I=yield Se(Array.from(h),M,n.fast);return S.append(...I.filter(E=>!!E)),S}function l(u,h){if(r.has(u))return h(null);qt(u,e,n).then(S=>{h(S||null)}).catch(S=>{h(null)})}let i=yield Se(Array.from(t.childNodes),l,n.fast);if(s.append(...i.filter(u=>!!u)),a!==null&&s instanceof HTMLSelectElement){s.value=a;for(let u of s.options)u.value===a?u.setAttribute("selected",""):u.removeAttribute("selected")}return o!==null&&s instanceof HTMLTextAreaElement&&(s.textContent=o),s})}var Yn=[/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=[];function He(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?Ce.push(n):typeof n=="string"?Ce.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function mt(t){let e=typeof t=="string"?t:"",n=[...Yn,...Ce];for(let r of n)if(r instanceof RegExp&&r.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 qe(t,e,n,r=32,a="#000"){return $(this,null,function*(){e=e.replace(/^['"]+|['"]+$/g,"");let o=window.devicePixelRatio||1;yield document.fonts.ready;let s=document.createElement("span");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 l=s.getBoundingClientRect(),i=Math.ceil(l.width),c=Math.ceil(l.height);document.body.removeChild(s);let f=document.createElement("canvas");f.width=i*o,f.height=c*o;let d=f.getContext("2d");return d.scale(o,o),d.font=n?`${n} ${r}px "${e}"`:`${r}px "${e}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=a,d.fillText(t,0,0),{dataUrl:f.toDataURL(),width:i,height:c}})}var Gn=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Qt(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Gn.has(n.toLowerCase()))return n}return""}function Zt(t){let e=String(t!=null?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 ke(t){let e=String(t!=null?t:"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function Kn(t){let e=String(t!=null?t:"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Jn(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let a=Zt(n[1]),o=Zt(n[2]);return{min:Math.min(a,o),max:Math.max(a,o)}}let r=Zt(e);return{min:r,max:r}}function Qn(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Zn(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*%/),a=r?parseFloat(r[1]):100;return{min:a,max:a}}function tr(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let a=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(l=>a.endsWith(l)))return!0;let s=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(s)||/\.woff2?(\b|$)/.test(s))return!0;for(let l of e){let i=l.toLowerCase().replace(/\s+/g,"+"),c=l.toLowerCase().replace(/\s+/g,"-");if(s.includes(i)||s.includes(c))return!0}return!1}catch(n){return!1}}function er(t){var n;let e=new Set;for(let r of t||[]){let a=(n=String(r).split("__")[0])==null?void 0:n.trim();a&&e.add(a)}return e}function te(){return $(this,arguments,function*({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:a=""}={}){var N,P,V,ot,et,at,lt,ft,_t,Y,yt,St,Et,wt,B,q,K,G;t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let o=new Map;for(let p of t){let[w,C,v,x]=String(p).split("__");if(!w)continue;let A=o.get(w)||[];A.push({w:parseInt(C,10),s:v,st:parseInt(x,10)}),o.set(w,A)}let s=/@import\s+url\(["']?([^"')]+)["']?\)/g,l=/url\((["']?)([^"')]+)\1\)/g,i=/@font-face[^{}]*\{[^}]*\}/g;function c(p,w,C,v){if(!o.has(p))return!1;let x=o.get(p),A=Jn(C),L=Qn(w),_=Zn(v),R=A.min!==A.max,U=A.min,T=H=>L.kind==="normal"&&H==="normal"||L.kind!=="normal"&&(H==="italic"||H==="oblique"),O=!1;for(let H of x){let nt=R?H.w>=A.min&&H.w<=A.max:H.w===U,ut=T(ke(H.s)),bt=H.st>=_.min&&H.st<=_.max;if(nt&&ut&&bt){O=!0;break}}if(O)return!0;if(!R)for(let H of x){let nt=T(ke(H.s)),ut=H.st>=_.min&&H.st<=_.max;if(Math.abs(U-H.w)<=300&&nt&&ut)return!0}return!1}function f(p){if(!p)return[];let w=[],C=p.split(",").map(v=>v.trim()).filter(Boolean);for(let v of C){let x=v.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!x)continue;let A=x[1],L=x[2],_=R=>{if(!R.includes("?"))return parseInt(R,16);let U=parseInt(R.replace(/\?/g,"0"),16),T=parseInt(R.replace(/\?/g,"F"),16);return[U,T]};if(L){let R=_(A),U=_(L),T=Array.isArray(R)?R[0]:R,O=Array.isArray(U)?U[1]:U;w.push([Math.min(T,O),Math.max(T,O)])}else{let R=_(A);Array.isArray(R)?w.push([R[0],R[1]]):w.push([R,R])}}return w}function d(p,w){if(!w.length||!p||p.size===0)return!0;for(let C of p)for(let[v,x]of w)if(C>=v&&C<=x)return!0;return!1}function m(p,w){let C=[];if(!p)return C;for(let v of p.matchAll(l)){let x=(v[2]||"").trim();if(!(!x||x.startsWith("data:"))){if(!/^https?:/i.test(x))try{x=new URL(x,w||location.href).href}catch(A){}C.push(x)}}return C}function g(p,w){return $(this,null,function*(){var v,x,A,L,_;let C=p;for(let R of p.matchAll(l)){let U=Lt(R[0]);if(!U)continue;let T=U;if(!T.startsWith("http")&&!T.startsWith("data:"))try{T=new URL(T,w||location.href).href}catch(O){}if(!mt(T)){if((v=y.resource)!=null&&v.has(T)){(x=y.font)==null||x.add(T),C=C.replace(R[0],`url(${y.resource.get(T)})`);continue}if(!((A=y.font)!=null&&A.has(T)))try{let O=yield Z(T,{as:"dataURL",useProxy:a,silent:!0});if(O.ok&&typeof O.data=="string"){let H=O.data;(L=y.resource)==null||L.set(T,H),(_=y.font)==null||_.add(T),C=C.replace(R[0],`url(${H})`)}}catch(O){console.warn("[snapDOM] Failed to fetch font resource:",T)}}}return C})}function b(p){if(!p.length)return null;let w=(_,R)=>p.some(([U,T])=>!(T<_||U>R)),C=w(0,255)||w(305,305),v=w(256,591)||w(7680,7935),x=w(880,1023),A=w(1024,1279);return w(7840,7929)||w(258,259)||w(416,417)||w(431,432)?"vietnamese":A?"cyrillic":x?"greek":v?"latin-ext":C?"latin":null}function u(p={}){let w=new Set((p.families||[]).map(x=>String(x).toLowerCase())),C=new Set((p.domains||[]).map(x=>String(x).toLowerCase())),v=new Set((p.subsets||[]).map(x=>String(x).toLowerCase()));return(x,A)=>{if(w.size&&w.has(x.family.toLowerCase()))return!0;if(C.size)for(let L of x.srcUrls)try{if(C.has(new URL(L).host.toLowerCase()))return!0}catch(_){}if(v.size){let L=b(A);if(L&&v.has(L))return!0}return!1}}let h=u(n);function S(p){var A,L,_,R,U,T;if(!p)return p;let w=/@font-face[^{}]*\{[^}]*\}/gi,C=new Set,v=[];for(let O of p.match(w)||[]){let H=((A=O.match(/font-family:\s*([^;]+);/i))==null?void 0:A[1])||"",nt=Qt(H),ut=(((L=O.match(/font-weight:\s*([^;]+);/i))==null?void 0:L[1])||"400").trim(),bt=(((_=O.match(/font-style:\s*([^;]+);/i))==null?void 0:_[1])||"normal").trim(),ce=(((R=O.match(/font-stretch:\s*([^;]+);/i))==null?void 0:R[1])||"100%").trim(),le=(((U=O.match(/unicode-range:\s*([^;]+);/i))==null?void 0:U[1])||"").trim(),fe=(((T=O.match(/src\s*:\s*([^;]+);/i))==null?void 0:T[1])||"").trim(),ue=m(fe,location.href),z=ue.length?ue.map(j=>String(j).toLowerCase()).sort().join("|"):fe.toLowerCase(),D=[String(nt||"").toLowerCase(),ut,bt,ce,le.toLowerCase(),z].join("|");C.has(D)||(C.add(D),v.push(O))}if(v.length===0)return p;let x=0;return p.replace(w,()=>v[x++]||"")}function M(){let p=Array.from(t||[]).sort().join("|"),w=n?JSON.stringify({families:(n.families||[]).map(x=>String(x).toLowerCase()).sort(),domains:(n.domains||[]).map(x=>String(x).toLowerCase()).sort(),subsets:(n.subsets||[]).map(x=>String(x).toLowerCase()).sort()}):"",C=(r||[]).map(x=>`${(x.family||"").toLowerCase()}::${x.weight||"normal"}::${x.style||"normal"}::${x.src||""}`).sort().join("|");return`fonts-embed-css::req=${p}::ex=${w}::lf=${C}::px=${a||""}`}let I=M();if((N=y.resource)!=null&&N.has(I))return y.resource.get(I);let E=er(t),F=[];for(let p of document.querySelectorAll("style")){let w=p.textContent||"";for(let C of w.matchAll(s)){let v=C[1];if(!v||mt(v))continue;!!document.querySelector(`link[rel="stylesheet"][href="${v}"]`)||F.push(v)}}F.length&&(yield Promise.all(F.map(p=>new Promise(w=>{if(document.querySelector(`link[rel="stylesheet"][href="${p}"]`))return w(null);let C=document.createElement("link");C.rel="stylesheet",C.href=p,C.setAttribute("data-snapdom","injected-import"),C.onload=()=>w(C),C.onerror=()=>w(null),document.head.appendChild(C)}))));let k="",W=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(p=>!!p.href);for(let p of W)try{if(mt(p.href))continue;let w="",C=!1;try{C=new URL(p.href,location.href).origin===location.origin}catch(x){}if(!C&&!tr(p.href,E))continue;if(C){let x=Array.from(document.styleSheets).find(A=>A.href===p.href);if(x)try{let A=x.cssRules||[];w=Array.from(A).map(L=>L.cssText).join("")}catch(A){}}if(!w&&(w=(yield Z(p.href,{as:"text",useProxy:a})).data,mt(p.href)))continue;let v="";for(let x of w.match(i)||[]){let A=(((P=x.match(/font-family:\s*([^;]+);/i))==null?void 0:P[1])||"").trim(),L=Qt(A);if(!L||mt(L))continue;let _=(((V=x.match(/font-weight:\s*([^;]+);/i))==null?void 0:V[1])||"400").trim(),R=(((ot=x.match(/font-style:\s*([^;]+);/i))==null?void 0:ot[1])||"normal").trim(),U=(((et=x.match(/font-stretch:\s*([^;]+);/i))==null?void 0:et[1])||"100%").trim(),T=(((at=x.match(/unicode-range:\s*([^;]+);/i))==null?void 0:at[1])||"").trim(),O=(((lt=x.match(/src\s*:\s*([^;]+);/i))==null?void 0:lt[1])||"").trim(),H=m(O,p.href);if(!c(L,R,_,U))continue;let nt=f(T);if(!d(e,nt))continue;let ut={family:L,weightSpec:_,styleSpec:R,stretchSpec:U,unicodeRange:T,srcRaw:O,srcUrls:H,href:p.href};if(n&&h(ut,nt))continue;let bt=/url\(/i.test(O)?yield g(x,p.href):x;v+=bt+""}v.trim()&&(k+=v+"")}catch(w){console.warn("[snapdom] Failed to process stylesheet:",p.href)}for(let p of document.styleSheets)try{if(p.href&&W.some(C=>C.href===p.href))continue;let w=p.cssRules||[];for(let C of w){if(C.type!==CSSRule.FONT_FACE_RULE)continue;let v=(C.style.getPropertyValue("font-family")||"").trim(),x=Qt(v);if(!x||mt(x))continue;let A=(C.style.getPropertyValue("font-weight")||"400").trim(),L=(C.style.getPropertyValue("font-style")||"normal").trim(),_=(C.style.getPropertyValue("font-stretch")||"100%").trim(),R=(C.style.getPropertyValue("src")||"").trim(),U=(C.style.getPropertyValue("unicode-range")||"").trim(),T=m(R,p.href||location.href);if(!c(x,L,A,_))continue;let O=f(U);if(!d(e,O))continue;let H={family:x,weightSpec:A,styleSpec:L,stretchSpec:_,unicodeRange:U,srcRaw:R,srcUrls:T,href:p.href||location.href};if(!(n&&h(H,O)))if(/url\(/i.test(R)){let nt=yield g(R,p.href||location.href);k+=`@font-face{font-family:${x};src:${nt};font-style:${L};font-weight:${A};font-stretch:${_};${U?`unicode-range:${U};`:""}}`}else k+=`@font-face{font-family:${x};src:${R};font-style:${L};font-weight:${A};font-stretch:${_};${U?`unicode-range:${U};`:""}}`}}catch(w){}try{for(let p of document.fonts||[]){if(!p||!p.family||p.status!=="loaded"||!p._snapdomSrc)continue;let w=String(p.family).replace(/^['"]+|['"]+$/g,"");if(mt(w)||!o.has(w)||n!=null&&n.families&&n.families.some(v=>String(v).toLowerCase()===w.toLowerCase()))continue;let C=p._snapdomSrc;if(!String(C).startsWith("data:")){if((ft=y.resource)!=null&&ft.has(p._snapdomSrc))C=y.resource.get(p._snapdomSrc),(_t=y.font)==null||_t.add(p._snapdomSrc);else if(!((Y=y.font)!=null&&Y.has(p._snapdomSrc)))try{let v=yield Z(p._snapdomSrc,{as:"dataURL",useProxy:a,silent:!0});if(v.ok&&typeof v.data=="string")C=v.data,(yt=y.resource)==null||yt.set(p._snapdomSrc,C),(St=y.font)==null||St.add(p._snapdomSrc);else continue}catch(v){console.warn("[snapdom] Failed to fetch dynamic font src:",p._snapdomSrc);continue}}k+=`@font-face{font-family:'${w}';src:url(${C});font-style:${p.style||"normal"};font-weight:${p.weight||"normal"};}`}}catch(p){}for(let p of r){if(!p||typeof p!="object")continue;let w=String(p.family||"").replace(/^['"]+|['"]+$/g,"");if(!w||mt(w)||!o.has(w)||n!=null&&n.families&&n.families.some(_=>String(_).toLowerCase()===w.toLowerCase()))continue;let C=p.weight!=null?String(p.weight):"normal",v=p.style!=null?String(p.style):"normal",x=p.stretchPct!=null?`${p.stretchPct}%`:"100%",A=String(p.src||""),L=A;if(!L.startsWith("data:")){if((Et=y.resource)!=null&&Et.has(A))L=y.resource.get(A),(wt=y.font)==null||wt.add(A);else if(!((B=y.font)!=null&&B.has(A)))try{let _=yield Z(A,{as:"dataURL",useProxy:a,silent:!0});if(_.ok&&typeof _.data=="string")L=_.data,(q=y.resource)==null||q.set(A,L),(K=y.font)==null||K.add(A);else continue}catch(_){console.warn("[snapdom] Failed to fetch localFonts src:",A);continue}}k+=`@font-face{font-family:'${w}';src:url(${L});font-style:${v};font-weight:${C};font-stretch:${x};}`}return k&&(k=S(k),(G=y.resource)==null||G.set(I,k)),k})}function ee(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),r=s=>{let l=Qt(s.fontFamily);if(!l)return;let i=(c,f,d)=>`${l}__${Zt(c)}__${ke(f)}__${Kn(d)}`;e.add(i(s.fontWeight,s.fontStyle,s.fontStretch))};r(getComputedStyle(t));let a=getComputedStyle(t,"::before");a&&a.content&&a.content!=="none"&&r(a);let o=getComputedStyle(t,"::after");for(o&&o.content&&o.content!=="none"&&r(o);n.nextNode();){let s=n.currentNode,l=getComputedStyle(s);r(l);let i=getComputedStyle(s,"::before");i&&i.content&&i.content!=="none"&&r(i);let c=getComputedStyle(s,"::after");c&&c.content&&c.content!=="none"&&r(c)}return e}function ne(t){let e=new Set,n=a=>{if(a)for(let o of a)e.add(o.codePointAt(0))},r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let a=r.currentNode;if(a.nodeType===Node.TEXT_NODE)n(a.nodeValue||"");else if(a.nodeType===Node.ELEMENT_NODE){let o=a;for(let s of["::before","::after"]){let l=getComputedStyle(o,s),i=l==null?void 0:l.getPropertyValue("content");if(!(!i||i==="none"))if(/^"/.test(i)||/^'/.test(i))n(i.slice(1,-1));else{let c=i.match(/\\[0-9A-Fa-f]{1,6}/g);if(c)for(let f of c)try{e.add(parseInt(f.slice(1),16))}catch(d){}}}}}return e}function re(t,e=2){return $(this,null,function*(){try{yield document.fonts.ready}catch(a){}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let a=document.createElement("div");a.style.cssText="position: absolute !important;left: -9999px !important;top: 0 !important;opacity: 0 !important;pointer-events: none !important;contain: layout size style;";for(let o of n){let s=document.createElement("span");s.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",s.style.fontFamily=`"${o}"`,s.style.fontWeight="700",s.style.fontStyle="italic",s.style.fontSize="32px",s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.margin="0",s.style.padding="0",a.appendChild(s)}document.body.appendChild(a),a.offsetWidth,document.body.removeChild(a)};for(let a=0;a<Math.max(1,e);a++)r(),yield new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o)))})}function Xe(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function nr(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function je(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 Ve(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)),a="";for(let[o,s]of n)for(;r>=o;)a+=s,r-=o;return e?a:a.toLowerCase()}function ze(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return je(t,!1);case"upper-alpha":return je(t,!0);case"lower-roman":return Ve(t,!1);case"upper-roman":return Ve(t,!0);default:return String(Math.max(0,t))}}function Ye(t){let e=new WeakMap,n=t instanceof Document?t.documentElement:t,r=c=>c&&c.tagName==="LI",a=c=>{let f=0,d=c==null?void 0:c.parentElement;if(!d)return 0;for(let m of d.children){if(m===c)break;m.tagName==="LI"&&f++}return f},o=c=>{let f=new Map;for(let[d,m]of c)f.set(d,m.slice());return f},s=(c,f,d)=>{var u,h;let m=o(c),g;try{g=((u=d.style)==null?void 0:u.counterReset)||getComputedStyle(d).counterReset}catch(S){}if(g&&g!=="none")for(let S of g.split(",")){let M=S.trim().split(/\s+/),I=M[0],E=Number.isFinite(Number(M[1]))?Number(M[1]):0;if(!I)continue;let F=f.get(I);if(F&&F.length){let k=F.slice();k.push(E),m.set(I,k)}else m.set(I,[E])}let b;try{b=((h=d.style)==null?void 0:h.counterIncrement)||getComputedStyle(d).counterIncrement}catch(S){}if(b&&b!=="none")for(let S of b.split(",")){let M=S.trim().split(/\s+/),I=M[0],E=Number.isFinite(Number(M[1]))?Number(M[1]):1;if(!I)continue;let F=m.get(I)||[];F.length===0&&F.push(0),F[F.length-1]+=E,m.set(I,F)}try{if(getComputedStyle(d).display==="list-item"&&r(d)){let M=d.parentElement,I=1;if(M&&M.tagName==="OL"){let F=M.getAttribute("start"),k=Number.isFinite(Number(F))?Number(F):1,W=a(d),N=d.getAttribute("value");I=Number.isFinite(Number(N))?Number(N):k+W}else I=1+a(d);let E=m.get("list-item")||[];E.length===0&&E.push(0),E[E.length-1]=I,m.set("list-item",E)}}catch(S){}return m},l=(c,f,d)=>{let m=s(d,f,c);e.set(c,m);let g=m;for(let b of c.children)g=l(b,m,g);return m},i=new Map;return l(n,i,i),{get(c,f){var m;let d=(m=e.get(c))==null?void 0:m.get(f);return d&&d.length?d[d.length-1]:0},getStack(c,f){var m;let d=(m=e.get(c))==null?void 0:m.get(f);return d?d.slice():[]}}}function Ge(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,a=t.replace(r,(o,s,l)=>{var c,f,d,m;let i=String(l).split(",").map(g=>g.trim());if(s==="counter"){let g=(c=i[0])==null?void 0:c.replace(/^["']|["']$/g,""),b=(i[1]||"decimal").toLowerCase(),u=n.get(e,g);return ze(u,b)}else{let g=(f=i[0])==null?void 0:f.replace(/^["']|["']$/g,""),b=(m=(d=i[1])==null?void 0:d.replace(/^["']|["']$/g,""))!=null?m:"",u=(i[2]||"decimal").toLowerCase(),h=n.getStack(e,g);return h.length?h.map(M=>ze(M,u)).join(b):""}});return nr(a)}catch(r){return"- "}}var jt=null,Vt=new WeakMap;function rr(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function or(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,r;for(;r=n.exec(t);)e.push(r[1]);return e.length?e.join(""):rr(t)}function Me(t,e){let n=t.parentElement,r=n?Vt.get(n):null;return r?{get(a,o){let s=e.get(a,o),l=r.get(o);return typeof l=="number"?Math.max(s,l):s},getStack(a,o){let s=e.getStack(a,o);if(!s.length)return s;let l=r.get(o);if(typeof l=="number"){let i=s.slice();return i[i.length-1]=Math.max(i[i.length-1],l),i}return s}}:e}function Ae(t,e,n){let r=new Map;function a(i){let c=[];if(!i||i==="none")return c;for(let f of String(i).split(",")){let d=f.trim().split(/\s+/),m=d[0],g=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;m&&c.push({name:m,num:g})}return c}let o=a(e==null?void 0:e.counterReset),s=a(e==null?void 0:e.counterIncrement);function l(i){if(r.has(i))return r.get(i).slice();let c=n.getStack(t,i);c=c.length?c.slice():[];let f=o.find(m=>m.name===i);if(f){let m=Number.isFinite(f.num)?f.num:0;c=c.length?[...c,m]:[m]}let d=s.find(m=>m.name===i);if(d){let m=Number.isFinite(d.num)?d.num:1;c.length===0&&(c=[0]),c[c.length-1]+=m}return r.set(i,c.slice()),c}return{get(i,c){let f=l(c);return f.length?f[f.length-1]:0},getStack(i,c){return l(c)},__incs:s}}function ar(t,e,n){let r;try{r=getComputedStyle(t,e)}catch(c){}let a=r==null?void 0:r.content;if(!a||a==="none"||a==="normal")return{text:"",incs:[]};let o=Me(t,n),s=Ae(t,r,o),l=Xe(a)?Ge(a,t,s):a;return{text:or(l),incs:s.__incs||[]}}function $e(t,e,n,r){return $(this,null,function*(){var s;if(!(t instanceof Element)||!(e instanceof Element))return;if(!jt)try{jt=Ye(t.ownerDocument||document)}catch(l){}for(let l of["::before","::after","::first-letter"])try{let i=It(t,l);if(!i||typeof i[Symbol.iterator]!="function"||i.content==="none"&&i.backgroundImage==="none"&&i.backgroundColor==="transparent"&&(i.borderStyle==="none"||parseFloat(i.borderWidth)===0)&&(!i.transform||i.transform==="none")&&i.display==="inline")continue;if(l==="::first-letter"){let B=getComputedStyle(t);if(!(i.color!==B.color||i.fontSize!==B.fontSize||i.fontWeight!==B.fontWeight))continue;let K=Array.from(e.childNodes).find(_=>{var R;return _.nodeType===Node.TEXT_NODE&&((R=_.textContent)==null?void 0:R.trim().length)>0});if(!K)continue;let G=K.textContent,p=G.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u),w=p==null?void 0:p[0],C=G.slice((w==null?void 0:w.length)||0);if(!w||/[\uD800-\uDFFF]/.test(w))continue;let v=document.createElement("span");v.textContent=w,v.dataset.snapdomPseudo="::first-letter";let x=Jt(i),A=Dt(x,"span");n.styleMap.set(v,A);let L=document.createTextNode(C);e.replaceChild(L,K),e.insertBefore(v,L);continue}let f=i.content,{text:d,incs:m}=ar(t,l,jt),g=i.backgroundImage,b=i.backgroundColor,u=i.fontFamily,h=parseInt(i.fontSize)||32,S=parseInt(i.fontWeight)||!1,M=i.color||"#000",I=i.display,E=parseFloat(i.width),F=parseFloat(i.height),k=i.borderStyle,W=parseFloat(i.borderWidth),N=i.transform,P=mt(u),V=f!=="none"&&d!=="",ot=g&&g!=="none",et=b&&b!=="transparent"&&b!=="rgba(0, 0, 0, 0)",at=I!=="inline"&&(E>0||F>0),lt=k&&k!=="none"&&W>0,ft=N&&N!=="none";if(!(V||ot||et||at||lt||ft)){if(m&&m.length&&t.parentElement){let B=Vt.get(t.parentElement)||new Map;for(let{name:q,num:K}of m){if(!q)continue;let G=Me(t,jt),w=Ae(t,getComputedStyle(t,l),G).get(t,q);B.set(q,w)}Vt.set(t.parentElement,B)}continue}let Y=document.createElement("span");Y.dataset.snapdomPseudo=l,Y.style.verticalAlign="middle";let yt=Jt(i),St=Dt(yt,"span");if(n.styleMap.set(Y,St),P&&d&&d.length===1){let{dataUrl:B,width:q,height:K}=yield qe(d,u,S,h,M),G=document.createElement("img");G.src=B,G.style=`height:${h}px;width:${q/K*h}px;object-fit:contain;`,Y.appendChild(G),e.dataset.snapdomHasIcon="true"}else if(d&&d.startsWith("url(")){let B=Lt(d);if(B!=null&&B.trim())try{let q=document.createElement("img"),K=yield Z(At(B),{as:"dataURL",useProxy:r.useProxy});q.src=K.data,q.style=`width:${h}px;height:auto;object-fit:contain;`,Y.appendChild(q)}catch(q){console.error(`[snapdom] Error in pseudo ${l} for`,t,q)}}else!P&&V&&(Y.textContent=d);if(ot)try{let B=Tt(g),q=yield Promise.all(B.map(Rt));Y.style.backgroundImage=q.join(", ")}catch(B){console.warn(`[snapdom] Failed to inline background-image for ${l}`,B)}et&&(Y.style.backgroundColor=b);let wt=Y.childNodes.length>0||((s=Y.textContent)==null?void 0:s.trim())!==""||ot||et||at||lt||ft;if(m&&m.length&&t.parentElement){let B=Vt.get(t.parentElement)||new Map,q=Me(t,jt),K=Ae(t,getComputedStyle(t,l),q);for(let{name:G}of m){if(!G)continue;let p=K.get(t,G);B.set(G,p)}Vt.set(t.parentElement,B)}if(!wt)continue;l==="::before"?e.insertBefore(Y,e.firstChild):e.appendChild(Y)}catch(i){console.warn(`[snapdom] Failed to capture ${l} for`,t,i)}let a=Array.from(t.children),o=Array.from(e.children).filter(l=>!l.dataset.snapdomPseudo);for(let l=0;l<Math.min(a.length,o.length);l++)yield $e(a[l],o[l],n,r)})}function Ke(t){if(!t)return;let e=new Set;if(t.querySelectorAll("use").forEach(l=>{let i=l.getAttribute("xlink:href")||l.getAttribute("href");i&&i.startsWith("#")&&e.add(i.slice(1))}),!e.size)return;let n=Array.from(document.querySelectorAll("svg > symbol, svg > defs")),r=n.filter(l=>l.tagName.toLowerCase()==="symbol"),a=n.filter(l=>l.tagName.toLowerCase()==="defs"),o=t.querySelector("svg.inline-defs-container");o||(o=document.createElementNS("http://www.w3.org/2000/svg","svg"),o.setAttribute("aria-hidden","true"),o.setAttribute("style","position: absolute; width: 0; height: 0; overflow: hidden;"),o.classList.add("inline-defs-container"),t.insertBefore(o,t.firstChild));let s=new Set;t.querySelectorAll("symbol[id], defs > *[id]").forEach(l=>{s.add(l.id)}),e.forEach(l=>{if(s.has(l))return;let i=r.find(c=>c.id===l);if(i){o.appendChild(i.cloneNode(!0)),s.add(l);return}for(let c of a){let f=c.querySelector(`#${CSS.escape(l)}`);if(f){let d=o.querySelector("defs");d||(d=document.createElementNS("http://www.w3.org/2000/svg","defs"),o.appendChild(d)),d.appendChild(f.cloneNode(!0)),s.add(l);break}}})}function Qe(n){return $(this,arguments,function*(t,e={}){var i,c;let r={styleMap:y.session.styleMap,styleCache:y.session.styleCache,nodeMap:y.session.nodeMap},a,o="",s="";sr(t);try{Ke(t)}catch(f){console.warn("inlineExternal defs or symbol failed:",f)}try{a=yield qt(t,r,e,t)}catch(f){throw console.warn("deepClone failed:",f),f}try{yield $e(t,a,r,e)}catch(f){console.warn("inlinePseudoElements failed:",f)}yield fr(a);try{let f=a.querySelectorAll("style[data-sd]");for(let d of f)s+=d.textContent||"",d.remove()}catch(f){}let l=we(r.styleMap);o=Array.from(l.entries()).map(([f,d])=>`.${d}{${f}}`).join(""),o=s+o;for(let[f,d]of r.styleMap.entries()){if(f.tagName==="STYLE")continue;if(f.getRootNode&&f.getRootNode()instanceof ShadowRoot){f.setAttribute("style",d.replace(/;/g,"; "));continue}let m=l.get(d);m&&f.classList.add(m);let g=(i=f.style)==null?void 0:i.backgroundImage,b=(c=f.dataset)==null?void 0:c.snapdomHasIcon;g&&g!=="none"&&(f.style.backgroundImage=g),b&&(f.style.verticalAlign="middle",f.style.display="inline")}for(let[f,d]of r.nodeMap.entries()){let m=d.scrollLeft,g=d.scrollTop;if((m||g)&&f instanceof HTMLElement){f.style.overflow="hidden",f.style.scrollbarWidth="none",f.style.msOverflowStyle="none";let u=document.createElement("div");for(u.style.transform=`translate(${-m}px, ${-g}px)`,u.style.willChange="transform",u.style.display="inline-block",u.style.width="100%";f.firstChild;)u.appendChild(f.firstChild);f.appendChild(u)}}if(t===r.nodeMap.get(a)){let f=r.styleCache.get(t)||window.getComputedStyle(t);r.styleCache.set(t,f);let d=de(f.transform);a.style.margin="0",a.style.top="auto",a.style.left="auto",a.style.right="auto",a.style.bottom="auto",a.style.animation="none",a.style.transition="none",a.style.willChange="auto",a.style.float="none",a.style.clear="none",a.style.transform=d||""}for(let[f,d]of r.nodeMap.entries())d.tagName==="PRE"&&(f.style.marginTop="0",f.style.marginBlockStart="0");return{clone:a,classCSS:o,styleCache:r.styleCache}})}function sr(t){let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,a=e.borderStyle,o=e.borderWidth,s=n!=="none"&&parseFloat(r)>0,l=a==="none"||parseFloat(o)===0;s&&l&&(t.style.border=`${r} solid transparent`)}var zt=new Map;function Xt(t){return $(this,null,function*(){var n;if((n=y.resource)!=null&&n.has(t))return y.resource.get(t);if(zt.has(t))return zt.get(t);let e=$(null,null,function*(){var a;let r=yield Z(t,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return(a=y.resource)==null||a.set(t,r.data),r.data});zt.set(t,e);try{let r=yield e;return zt.set(t,r),r}catch(r){throw zt.delete(t),r}})}var ir=/\bblob:[^)"'\s]+/g;function Je(t){return $(this,null,function*(){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(ir)||[]));if(e.length===0)return t;let n=t;for(let r of e)try{let a=yield Xt(r);n=n.split(r).join(a)}catch(a){}return n})}function oe(t){return typeof t=="string"&&t.startsWith("blob:")}function cr(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 lr(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function fr(t){return $(this,null,function*(){var s,l;if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let i of e)try{let f=i.getAttribute("src")||i.currentSrc||"";if(oe(f)){let m=yield Xt(f);i.setAttribute("src",m)}let d=i.getAttribute("srcset");if(d&&d.includes("blob:")){let m=cr(d),g=!1;for(let b of m)if(oe(b.url))try{b.url=yield Xt(b.url),g=!0}catch(u){}g&&i.setAttribute("srcset",lr(m))}}catch(c){}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let i of n)try{let c="http://www.w3.org/1999/xlink",f=i.getAttribute("href")||((s=i.getAttributeNS)==null?void 0:s.call(i,c,"href"));if(oe(f)){let d=yield Xt(f);i.setAttribute("href",d),(l=i.removeAttributeNS)==null||l.call(i,c,"href")}}catch(c){}let r=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let i of r)try{let c=i.getAttribute("style");if(c&&c.includes("blob:")){let f=yield Je(c);i.setAttribute("style",f)}}catch(c){}let a=t.querySelectorAll?t.querySelectorAll("style"):[];for(let i of a)try{let c=i.textContent||"";c.includes("blob:")&&(i.textContent=yield Je(c))}catch(c){}let o=["poster"];for(let i of o){let c=t.querySelectorAll?t.querySelectorAll(`[${i}^='blob:']`):[];for(let f of c)try{let d=f.getAttribute(i);oe(d)&&f.setAttribute(i,yield Xt(d))}catch(d){}}})}function Ze(n){return $(this,arguments,function*(t,e={}){let r=Array.from(t.querySelectorAll("img")),a=o=>$(null,null,function*(){var d,m,g,b;if(!o.getAttribute("src")){let u=o.currentSrc||o.src||"";u&&o.setAttribute("src",u)}o.removeAttribute("srcset"),o.removeAttribute("sizes");let s=o.src||"";if(!s)return;let l=yield Z(s,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){o.src=l.data,o.width||(o.width=o.naturalWidth||100),o.height||(o.height=o.naturalHeight||100);return}let{fallbackURL:i}=e||{};if(i)try{let u=parseInt(((d=o.dataset)==null?void 0:d.snapdomWidth)||"",10)||0,h=parseInt(((m=o.dataset)==null?void 0:m.snapdomHeight)||"",10)||0,S=parseInt(o.getAttribute("width")||"",10)||0,M=parseInt(o.getAttribute("height")||"",10)||0,I=parseFloat(((g=o.style)==null?void 0:g.width)||"")||0,E=parseFloat(((b=o.style)==null?void 0:b.height)||"")||0,F=u||I||S||o.width||void 0,k=h||E||M||o.height||void 0,W=typeof i=="function"?yield i({width:F,height:k,src:s,element:o}):i;if(W){let N=yield Z(W,{as:"dataURL",useProxy:e.useProxy});o.src=N.data,!o.width&&F&&(o.width=F),!o.height&&k&&(o.height=k),o.width||(o.width=o.naturalWidth||100),o.height||(o.height=o.naturalHeight||100);return}}catch(u){}let c=o.width||o.naturalWidth||100,f=o.height||o.naturalHeight||100;if(e.placeholders!==!1){let u=document.createElement("div");u.style.cssText=[`width:${c}px`,`height:${f}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${f}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),u.textContent="img",o.replaceWith(u)}else{let u=document.createElement("div");u.style.cssText=`display:inline-block;width:${c}px;height:${f}px;visibility:hidden;`,o.replaceWith(u)}});for(let o=0;o<r.length;o+=4){let s=r.slice(o,o+4).map(a);yield Promise.allSettled(s)}})}function ae(a,o,s){return $(this,arguments,function*(t,e,n,r={}){let l=[[t,e]],i=["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"],c=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],f=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;l.length;){let[d,m]=l.shift(),g=n.get(d)||It(d);n.has(d)||n.set(d,g);let b=(()=>{let S=g.getPropertyValue("border-image"),M=g.getPropertyValue("border-image-source");return S&&S!=="none"||M&&M!=="none"})();for(let S of i){let M=g.getPropertyValue(S);if(!M||M==="none")continue;let I=Tt(M),E=yield Promise.all(I.map(F=>Rt(F,r)));E.some(F=>F&&F!=="none"&&!/^url\(undefined/.test(F))&&m.style.setProperty(S,E.join(", "))}for(let S of c){let M=g.getPropertyValue(S);!M||M==="initial"||m.style.setProperty(S,M)}if(b)for(let S of f){let M=g.getPropertyValue(S);!M||M==="initial"||m.style.setProperty(S,M)}let u=Array.from(d.children),h=Array.from(m.children);for(let S=0;S<Math.min(u.length,h.length);S++)l.push([u[S],h[S]])}})}function tn(t){var c;if(!t)return()=>{};let e=ur(t);if(e<=0)return()=>{};if(!hr(t))return()=>{};let n=getComputedStyle(t),r=Math.round(dr(n)*e+mr(n)),a=(c=t.textContent)!=null?c:"",o=a;if(t.scrollHeight<=r+.5)return()=>{};let s=0,l=a.length,i=-1;for(;s<=l;){let f=s+l>>1;t.textContent=a.slice(0,f)+"\u2026",t.scrollHeight<=r+.5?(i=f,s=f+1):l=f-1}return t.textContent=(i>=0?a.slice(0,i):"")+"\u2026",()=>{t.textContent=o}}function ur(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function dr(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 mr(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function hr(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}function Fe(t,e){return $(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");Yt(e.cache);let n=e.fast,r,a,o,s="",l="",i,c,f=tn(t);try{({clone:r,classCSS:a,styleCache:o}=yield Qe(t,e))}finally{f()}yield new Promise(b=>{xt(()=>$(null,null,function*(){yield Ze(r,e),b()}),{fast:n})}),yield new Promise(b=>{xt(()=>$(null,null,function*(){yield ae(t,r,o,e),b()}),{fast:n})}),e.embedFonts&&(yield new Promise(b=>{xt(()=>$(null,null,function*(){let u=ee(t),h=ne(t);if(tt()){let S=new Set(Array.from(u).map(M=>String(M).split("__")[0]).filter(Boolean));yield re(S,2)}s=yield te({required:u,usedCodepoints:h,preCached:!1,exclude:e.excludeFonts,useProxy:e.useProxy}),b()}),{fast:n})}));let d=ge(r).sort(),m=d.join(",");y.baseStyle.has(m)?l=y.baseStyle.get(m):yield new Promise(b=>{xt(()=>{l=ye(d),y.baseStyle.set(m,l),b()},{fast:n})}),yield new Promise(b=>{xt(()=>{let u=getComputedStyle(t);function h(z){var Ct;let D=`${z.filter||""} ${z.webkitFilter||""}`.trim();if(!D||D==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let j=D.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],st=0,it=0,dt=0,rt=0,Ft=!1;for(let Pt of j){Ft=!0;let vt=((Ct=Pt.match(/-?\d+(?:\.\d+)?px/gi))==null?void 0:Ct.map(Mt=>parseFloat(Mt)))||[],[ct=0,kt=0,ht=0]=vt,pt=Math.abs(ct)+ht,gt=Math.abs(kt)+ht;it=Math.max(it,pt+Math.max(ct,0)),rt=Math.max(rt,pt+Math.max(-ct,0)),dt=Math.max(dt,gt+Math.max(kt,0)),st=Math.max(st,gt+Math.max(-kt,0))}return{bleed:{top:Math.ceil(st),right:Math.ceil(it),bottom:Math.ceil(dt),left:Math.ceil(rt)},has:Ft}}function S(z){var Ft;let D=z.boxShadow||"";if(!D||D==="none")return{top:0,right:0,bottom:0,left:0};let j=D.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(Ct=>Ct.trim()),st=0,it=0,dt=0,rt=0;for(let Ct of j){let Pt=((Ft=Ct.match(/-?\d+(\.\d+)?px/g))==null?void 0:Ft.map(Mt=>parseFloat(Mt)))||[];if(Pt.length<2)continue;let[vt,ct,kt=0,ht=0]=Pt,pt=Math.abs(vt)+kt+ht,gt=Math.abs(ct)+kt+ht;it=Math.max(it,pt+Math.max(vt,0)),rt=Math.max(rt,pt+Math.max(-vt,0)),dt=Math.max(dt,gt+Math.max(ct,0)),st=Math.max(st,gt+Math.max(-ct,0))}return{top:Math.ceil(st),right:Math.ceil(it),bottom:Math.ceil(dt),left:Math.ceil(rt)}}function M(z){let D=(z.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),j=D?Math.ceil(parseFloat(D[1])||0):0;return{top:j,right:j,bottom:j,left:j}}function I(z){if((z.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let D=Math.ceil(parseFloat(z.outlineWidth||"0")||0);return{top:D,right:D,bottom:D,left:D}}function E(z,D,j,st,it){let dt=j.a,rt=j.b,Ft=j.c,Ct=j.d,Pt=j.e||0,vt=j.f||0;function ct(Ut,Bt){let Le=Ut-st,Ne=Bt-it,Re=dt*Le+Ft*Ne,Ie=rt*Le+Ct*Ne;return Re+=st+Pt,Ie+=it+vt,[Re,Ie]}let kt=[ct(0,0),ct(z,0),ct(0,D),ct(z,D)],ht=1/0,pt=1/0,gt=-1/0,Mt=-1/0;for(let[Ut,Bt]of kt)Ut<ht&&(ht=Ut),Bt<pt&&(pt=Bt),Ut>gt&&(gt=Ut),Bt>Mt&&(Mt=Bt);return{minX:ht,minY:pt,maxX:gt,maxY:Mt,width:gt-ht,height:Mt-pt}}function F(z){return yr(z)}let k=t.getBoundingClientRect(),W=Math.max(1,Math.ceil(t.offsetWidth||parseFloat(u.width)||k.width||1)),N=Math.max(1,Math.ceil(t.offsetHeight||parseFloat(u.height)||k.height||1)),P=(z,D=NaN)=>{let j=typeof z=="string"?parseFloat(z):z;return Number.isFinite(j)?j:D},V=P(e.width),ot=P(e.height),et=W,at=N,lt=Number.isFinite(V),ft=Number.isFinite(ot),_t=N>0?W/N:1;lt&&ft?(et=Math.max(1,Math.ceil(V)),at=Math.max(1,Math.ceil(ot))):lt?(et=Math.max(1,Math.ceil(V)),at=Math.max(1,Math.ceil(et/(_t||1)))):ft?(at=Math.max(1,Math.ceil(ot)),et=Math.max(1,Math.ceil(at*(_t||1)))):(et=W,at=N);let Y=0,yt=0,St=W,Et=N;if(F(t)){let z=u.transform&&u.transform!=="none"?u.transform:"",D=gr(t),j=xr({baseTransform:z,rotate:D.rotate||"0deg",scale:D.scale,translate:D.translate}),{ox:st,oy:it}=wr(u,W,N),dt=j.is2D?j:new DOMMatrix(j.toString()),rt=E(W,N,dt,st,it);Y=rt.minX,yt=rt.minY,St=rt.maxX,Et=rt.maxY}let wt=S(u),B=M(u),q=I(u),K=h(u),G={top:wt.top+B.top+q.top+K.bleed.top,right:wt.right+B.right+q.right+K.bleed.right,bottom:wt.bottom+B.bottom+q.bottom+K.bleed.bottom,left:wt.left+B.left+q.left+K.bleed.left};Y-=G.left,yt-=G.top,St+=G.right,Et+=G.bottom;let p=Math.max(1,Math.ceil(St-Y)),w=Math.max(1,Math.ceil(Et-yt)),C=Math.max(1,Math.round(p*(lt||ft?et/W:1))),v=Math.max(1,Math.round(w*(ft||lt?at/N:1))),x="http://www.w3.org/2000/svg",A=tt()?1:0,L=document.createElementNS(x,"foreignObject"),_=Math.floor(Y),R=Math.floor(yt);L.setAttribute("x",String(-(_-A))),L.setAttribute("y",String(-(R-A))),L.setAttribute("width",String(Math.ceil(W+A*2))),L.setAttribute("height",String(Math.ceil(N+A*2))),L.style.overflow="visible";let U=document.createElement("style");U.textContent=l+s+"svg{overflow:visible;} foreignObject{overflow:visible;}"+a,L.appendChild(U);let T=document.createElement("div");T.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),T.style.width=`${W}px`,T.style.height=`${N}px`,T.style.overflow="visible",r.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),T.appendChild(r),L.appendChild(T);let H=new XMLSerializer().serializeToString(L),nt=p+A*2,ut=w+A*2,bt=lt||ft;e.meta={w0:W,h0:N,vbW:nt,vbH:ut,targetW:et,targetH:at};let ce=tt()&&bt?nt:C+A*2,le=tt()&&bt?ut:v+A*2;c=`<svg xmlns="${x}" width="${ce}" height="${le}" viewBox="0 0 ${nt} ${ut}">`+H+"</svg>",i=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,b()},{fast:n})});let g=document.getElementById("snapdom-sandbox");return g&&g.style.position==="absolute"&&g.remove(),i})}function pr(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch(n){return new WebKitCSSMatrix(e)}}function gr(t){var a,o,s,l,i,c,f,d;let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let m=h=>{try{return typeof n.has=="function"&&!n.has(h)||typeof n.get!="function"?null:n.get(h)}catch(S){return null}},g=m("rotate");if(g)if(g.angle){let h=g.angle;e.rotate=h.unit==="rad"?h.value*180/Math.PI+"deg":h.value+h.unit}else g.unit?e.rotate=g.unit==="rad"?g.value*180/Math.PI+"deg":g.value+g.unit:e.rotate=String(g);else{let h=getComputedStyle(t);e.rotate=h.rotate&&h.rotate!=="none"?h.rotate:"0deg"}let b=m("scale");if(b){let h="x"in b&&((a=b.x)==null?void 0:a.value)!=null?b.x.value:Array.isArray(b)?(o=b[0])==null?void 0:o.value:Number(b)||1,S="y"in b&&((s=b.y)==null?void 0:s.value)!=null?b.y.value:Array.isArray(b)?(l=b[1])==null?void 0:l.value:h;e.scale=`${h} ${S}`}else{let h=getComputedStyle(t);e.scale=h.scale&&h.scale!=="none"?h.scale:null}let u=m("translate");if(u){let h="x"in u&&"value"in u.x?u.x.value:Array.isArray(u)?(i=u[0])==null?void 0:i.value:0,S="y"in u&&"value"in u.y?u.y.value:Array.isArray(u)?(c=u[1])==null?void 0:c.value:0,M="x"in u&&((f=u.x)!=null&&f.unit)?u.x.unit:"px",I="y"in u&&((d=u.y)!=null&&d.unit)?u.y.unit:"px";e.translate=`${h}${M} ${S}${I}`}else{let h=getComputedStyle(t);e.translate=h.translate&&h.translate!=="none"?h.translate:null}return 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}function yr(t){let e=getComputedStyle(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 a=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!!(a||o||s)}function wr(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[a,o]=[r[0]||"0",r[1]||"0"],s=(l,i)=>{let c=l.toLowerCase();return c==="left"||c==="top"?0:c==="center"?i/2:c==="right"||c==="bottom"?i:c.endsWith("px")?parseFloat(c)||0:c.endsWith("%")?(parseFloat(c)||0)*i/100:/^-?\d+(\.\d+)?$/.test(c)&&parseFloat(c)||0};return{ox:s(a,e),oy:s(o,n)}}var Ee=null;function br(){if(Ee)return Ee;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),Ee=t,t}function xr(t){let e=br(),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 r=pr(n);return e.removeChild(n),r}function Sr(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function en(t={}){var r,a,o,s,l,i,c,f,d,m,g,b,u,h,S,M,I,E;let e=(r=t.format)!=null?r:"png",n=Sr(t.cache);return{debug:(a=t.debug)!=null?a:!1,fast:(o=t.fast)!=null?o:!0,scale:(s=t.scale)!=null?s:1,exclude:(l=t.exclude)!=null?l:[],excludeMode:(i=t.excludeMode)!=null?i:"hide",filter:(c=t.filter)!=null?c:null,filterMode:(f=t.filterMode)!=null?f:"hide",placeholders:t.placeholders!==!1,embedFonts:(d=t.embedFonts)!=null?d:!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:(m=t.excludeFonts)!=null?m:void 0,fallbackURL:(g=t.fallbackURL)!=null?g:void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:(b=t.width)!=null?b:null,height:(u=t.height)!=null?u:null,format:e,type:(h=t.type)!=null?h:"svg",quality:(S=t.quality)!=null?S:.92,dpr:(M=t.dpr)!=null?M:window.devicePixelRatio||1,backgroundColor:(I=t.backgroundColor)!=null?I:["jpg","jpeg","webp"].includes(e)?"#ffffff":null,filename:(E=t.filename)!=null?E:"snapDOM"}}function Cr(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function kr(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function Mr(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Ar(t){let e=[],n="",r=0;for(let a=0;a<t.length;a++){let o=t[a];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(a=>a.trim()).filter(Boolean)}function $r(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 a=[];for(let o of e){if(/\binset\b/i.test(o))continue;let s=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[l="0px",i="0px",c="0px"]=s,f=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!f&&f!==",";a.push(`drop-shadow(${l} ${i} ${c}${d?` ${f}`:""})`)}return a.join(" ")}function nn(t){let e=Ar(t),n=null,r=null,a=null,o=[];for(let l of e){let i=l.indexOf(":");if(i<0)continue;let c=l.slice(0,i).trim().toLowerCase(),f=l.slice(i+1).trim();c==="box-shadow"?a=f:c==="filter"?n=f:c==="-webkit-filter"?r=f:o.push([c,f])}if(a){let l=$r(a);l&&(n=n?`${n} ${l}`:l,r=r?`${r} ${l}`:l)}let s=[...o];return n&&s.push(["filter",n]),r&&s.push(["-webkit-filter",r]),s.map(([l,i])=>`${l}:${i}`).join(";")}function Er(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${nn(r)}}`)}function Fr(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Er(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${nn(r)}${n}`),t}function vr(t){if(!tt()||!Cr(t))return t;try{let e=kr(t),n=Fr(e);return Mr(n)}catch(e){return t}}function $t(t,e){return $(this,null,function*(){let{width:n,height:r,scale:a=1,dpr:o=1,meta:s={}}=e;t=vr(t);let l=new Image;l.loading="eager",l.decoding="sync",l.crossOrigin="anonymous",l.src=t,yield l.decode();let i=l.naturalWidth,c=l.naturalHeight,f=Number.isFinite(s.w0)?s.w0:i,d=Number.isFinite(s.h0)?s.h0:c,m,g,b=Number.isFinite(n),u=Number.isFinite(r);if(b&&u)m=Math.max(1,n),g=Math.max(1,r);else if(b){let M=n/Math.max(1,f);m=n,g=Math.round(d*M)}else if(u){let M=r/Math.max(1,d);g=r,m=Math.round(f*M)}else m=i,g=c;m=Math.round(m*a),g=Math.round(g*a);let h=document.createElement("canvas");h.width=Math.ceil(m*o),h.height=Math.ceil(g*o),h.style.width=`${m}px`,h.style.height=`${g}px`;let S=h.getContext("2d");return o!==1&&S.scale(o,o),S.drawImage(l,0,0,m,g),h})}function se(t,e){return $(this,null,function*(){let n=yield $t(t,e),r=e.backgroundColor?Nt(n,e.backgroundColor):n,a=new Image;return a.src=r.toDataURL(`image/${e.format}`,e.quality),yield a.decode(),a.style.width=`${r.width/e.dpr}px`,a.style.height=`${r.height/e.dpr}px`,a})}function rn(t,e){return $(this,null,function*(){let{scale:n=1,width:r,height:a,meta:o={}}=e,s=Number.isFinite(r),l=Number.isFinite(a),i=Number.isFinite(n)&&n!==1||s||l;if(tt()&&i)return yield se(t,Q(J({},e),{format:"png",quality:1,meta:o}));let c=new Image;if(c.decoding="sync",c.loading="eager",c.src=t,yield c.decode(),s&&l)c.style.width=`${r}px`,c.style.height=`${a}px`;else if(s){let f=Number.isFinite(o.w0)?o.w0:c.naturalWidth,d=Number.isFinite(o.h0)?o.h0:c.naturalHeight,m=r/Math.max(1,f);c.style.width=`${r}px`,c.style.height=`${Math.round(d*m)}px`}else if(l){let f=Number.isFinite(o.w0)?o.w0:c.naturalWidth,d=Number.isFinite(o.h0)?o.h0:c.naturalHeight,m=a/Math.max(1,d);c.style.height=`${a}px`,c.style.width=`${Math.round(f*m)}px`}else n!==1&&(c.style.width=`${Math.round(c.naturalWidth*n)}px`,c.style.height=`${Math.round(c.naturalHeight*n)}px`);return c})}function ie(t,e){return $(this,null,function*(){let n=e.type;if(n==="svg"){let o=decodeURIComponent(t.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let r=yield $t(t,e),a=e.backgroundColor?Nt(r,e.backgroundColor):r;return new Promise(o=>a.toBlob(s=>o(s),`image/${n}`,e.quality))})}function on(t,e){return $(this,null,function*(){if(e.dpr=1,e.format==="svg"){let o=yield ie(t,Q(J({},e),{type:"svg"})),s=URL.createObjectURL(o),l=document.createElement("a");l.href=s,l.download=e.filename,l.click(),URL.revokeObjectURL(s);return}let n=yield $t(t,e),r=e.backgroundColor?Nt(n,e.backgroundColor):n,a=document.createElement("a");a.href=r.toDataURL(`image/${e.format}`,e.quality),a.download=e.filename,a.click()})}var an=Symbol("snapdom.internal"),ve=!1;function X(t,e){return $(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");let n=en(e);if(tt()&&(n.embedFonts===!0||Nr(t)))for(let r=0;r<3;r++)try{yield Lr(t,e),console.log("Iteraci\xF3n n\xFAmero:",r),ve=!1}catch(a){}return n.iconFonts&&n.iconFonts.length>0&&He(n.iconFonts),n.snap||(n.snap={toPng:(r,a)=>X.toPng(r,a),toImg:(r,a)=>X.toImg(r,a)}),X.capture(t,n,an)})}X.capture=(t,e,n)=>$(null,null,function*(){if(n!==an)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=yield Fe(t,e),a=s=>J(J({},e),s||{}),o=s=>l=>{let i=a(Q(J({},l||{}),{format:s})),c=s==="jpeg"||s==="jpg",f=i.backgroundColor==null||i.backgroundColor==="transparent";return c&&f&&(i.backgroundColor="#ffffff"),se(r,i)};return{url:r,toRaw:()=>r,toImg:s=>rn(r,a(s)),toCanvas:s=>$t(r,a(s)),toBlob:s=>ie(r,a(s)),toPng:o("png"),toJpg:o("jpeg"),toWebp:o("webp"),download:s=>on(r,a(s))}});X.toRaw=(t,e)=>X(t,e).then(n=>n.toRaw());X.toImg=(t,e)=>X(t,e).then(n=>n.toImg());X.toCanvas=(t,e)=>X(t,e).then(n=>n.toCanvas());X.toBlob=(t,e)=>X(t,e).then(n=>n.toBlob());X.toPng=(t,e)=>X(t,Q(J({},e),{format:"png"})).then(n=>n.toPng());X.toJpg=(t,e)=>X(t,Q(J({},e),{format:"jpeg"})).then(n=>n.toJpg());X.toWebp=(t,e)=>X(t,Q(J({},e),{format:"webp"})).then(n=>n.toWebp());X.download=(t,e)=>X(t,e).then(n=>n.download());function Lr(t,e){return $(this,null,function*(){if(ve)return;let n=Q(J({},e),{fast:!0,embedFonts:!0,scale:.2}),r;try{r=yield Fe(t,n)}catch(a){return}yield new Promise(a=>{let o=new Image;o.decoding="sync",o.loading="eager",o.style.position="fixed",o.style.left=0,o.style.top=0,o.style.width="10px",o.style.height="10px",o.style.opacity="0.01",o.style.transform="translateZ(10px)",o.style.willChange="transform,opacity;",o.src=r;let s=()=>$(null,null,function*(){yield new Promise(l=>setTimeout(l,100)),o&&o.parentNode&&o.parentNode.removeChild(o),ve=!0,a()});document.body.appendChild(o),s()})})}function Nr(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,r=getComputedStyle(n),a=r.backgroundImage&&r.backgroundImage!=="none",o=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(a||o)return!0}return!1}function sn(){return $(this,arguments,function*(t=document,e={}){var i,c,f,d;let{embedFonts:n=!0,useProxy:r=""}=e,a=(c=(i=e.cache)!=null?i:e.cacheOpt)!=null?c:"full";Yt(a);try{yield(f=document.fonts)==null?void 0:f.ready}catch(m){}try{he()}catch(m){}y.session=y.session||{},y.session.styleCache||(y.session.styleCache=new WeakMap),y.image=y.image||new Map;try{yield ae(t,void 0,y.session.styleCache,{useProxy:r})}catch(m){}let o=[],s=[];try{t!=null&&t.querySelectorAll&&(o=Array.from(t.querySelectorAll("img[src]")),s=Array.from(t.querySelectorAll("*")))}catch(m){}let l=[];for(let m of o){let g=(m==null?void 0:m.currentSrc)||(m==null?void 0:m.src);if(g&&!y.image.has(g)){let b=Promise.resolve().then(()=>$(null,null,function*(){let u=yield Z(g,{as:"dataURL",useProxy:r});u!=null&&u.ok&&typeof u.data=="string"&&y.image.set(g,u.data)})).catch(()=>{});l.push(b)}}for(let m of s){let g="";try{g=It(m).backgroundImage}catch(b){}if(g&&g!=="none"){let b=Tt(g);for(let u of b)if(u.startsWith("url(")){let h=Promise.resolve().then(()=>Rt(u,Q(J({},e),{useProxy:r}))).catch(()=>{});l.push(h)}}}if(n)try{let m=ee(t),g=ne(t);if(typeof tt=="function"?tt():!!tt){let u=new Set(Array.from(m).map(h=>String(h).split("__")[0]).filter(Boolean));yield re(u,2)}yield te({required:m,usedCodepoints:g,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:(d=e.useProxy)!=null?d:r})}catch(m){}yield Promise.allSettled(l)})}typeof window!="undefined"&&(window.snapdom=X,window.preCache=sn);})();
1
+ (()=>{var fn=Object.defineProperty,un=Object.defineProperties;var dn=Object.getOwnPropertyDescriptors;var Te=Object.getOwnPropertySymbols;var mn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable;var We=(t,e,n)=>e in t?fn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,J=(t,e)=>{for(var n in e||(e={}))mn.call(e,n)&&We(t,n,e[n]);if(Te)for(var n of Te(e))hn.call(e,n)&&We(t,n,e[n]);return t},Q=(t,e)=>un(t,dn(e));var v=(t,e,n)=>new Promise((o,r)=>{var s=i=>{try{l(n.next(i))}catch(c){r(c)}},a=i=>{try{l(n.throw(i))}catch(c){r(c)}},l=i=>i.done?o(i.value):Promise.resolve(i.value).then(s,a);l((n=n.apply(t,e)).next())});var y={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function Yt(t="soft"){switch(t){case"auto":{y.session.styleMap=new Map,y.session.nodeMap=new Map;return}case"soft":{y.session.styleMap=new Map,y.session.nodeMap=new Map,y.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{y.session.styleMap=new Map,y.session.nodeMap=new Map,y.session.styleCache=new WeakMap,y.computedStyle=new WeakMap,y.baseStyle=new Map,y.defaultStyle=new Map,y.image=new Map,y.background=new Map,y.resource=new Map,y.font=new Set;return}default:{y.session.styleMap=new Map,y.session.nodeMap=new Map,y.session.styleCache=new WeakMap;return}}}function Nt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}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 At(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch(e){return t}}function pn(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function s(a,l,i){if(r>=n)return;let c=Date.now();(o.get(l)||0)>c||(o.set(l,c+e),r++,a==="warn"&&console&&console.warn?console.warn(`${t} ${i}`):console&&console.error&&console.error(`${t} ${i}`))}return{warnOnce(a,l){s("warn",a,l)},errorOnce(a,l){s("error",a,l)},reset(){o.clear(),r=0}}}var _e=pn("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),me=new Map,Gt=new Map;function gn(t){return/^data:|^blob:|^about:blank$/i.test(t)}function yn(t,e){try{let n=typeof location!="undefined"&&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 a=s.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch(n){}return!1}function wn(t,e){if(!e||gn(t)||yn(t,e))return!1;try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",o=new URL(t,n);return typeof location!="undefined"?o.origin!==location.origin:!0}catch(n){return!!e}}function bn(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",At(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}${At(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Pe(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 xn(t,e){var n,o;return[e.as||"blob",(n=e.timeout)!=null?n:3e3,e.useProxy||"",(o=e.errorTTL)!=null?o:8e3,t].join("|")}function Z(n){return v(this,arguments,function*(t,e={}){var b,k,R;let o=(b=e.as)!=null?b:"blob",r=(k=e.timeout)!=null?k:3e3,s=e.useProxy||"",a=(R=e.errorTTL)!=null?R:8e3,l=e.headers||{},i=!!e.silent;if(/^data:/i.test(t))try{if(o==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(o==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,$="",F=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],T=/;base64/i.test($)?atob(F):decodeURIComponent(F),A=new Uint8Array([...T].map(V=>V.charCodeAt(0))),P=new Blob([A],{type:($||"").split(";")[0]||""});return{ok:!0,data:P,status:200,url:t,fromCache:!1,mime:P.type||""}}catch($){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let $=yield fetch(t);if(!$.ok)return{ok:!1,data:null,status:$.status,url:t,fromCache:!1,reason:"http_error"};let F=yield $.blob(),M=F.type||$.headers.get("content-type")||"";return o==="dataURL"?{ok:!0,data:yield Pe(F),status:$.status,url:t,fromCache:!1,mime:M}:o==="text"?{ok:!0,data:yield F.text(),status:$.status,url:t,fromCache:!1,mime:M}:{ok:!0,data:F,status:$.status,url:t,fromCache:!1,mime:M}}catch($){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return o==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:o==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let c=xn(t,{as:o,timeout:r,useProxy:s,errorTTL:a}),h=Gt.get(c);if(h&&h.until>Date.now())return Q(J({},h.result),{fromCache:!0});h&&Gt.delete(c);let f=me.get(c);if(f)return f;let d=wn(t,s)?bn(t,s):t,g=e.credentials;if(!g)try{let $=typeof location!="undefined"&&location.href?location.href:"http://localhost/",F=new URL(t,$);g=typeof location!="undefined"&&F.origin===location.origin?"include":"omit"}catch($){g="omit"}let w=new AbortController,u=setTimeout(()=>w.abort("timeout"),r),m=v(null,null,function*(){var $,F;try{let M=yield fetch(d,{signal:w.signal,credentials:g,headers:l});if(!M.ok){let P={ok:!1,data:null,status:M.status,url:d,fromCache:!1,reason:"http_error"};if(a>0&&Gt.set(c,{until:Date.now()+a,result:P}),!i){let V=`${M.status} ${M.statusText||""}`.trim();_e.warnOnce(`http:${M.status}:${o}:${new URL(t,($=location==null?void 0:location.href)!=null?$:"http://localhost/").origin}`,`HTTP error ${V} while fetching ${o} ${t}`)}return e.onError&&e.onError(P),P}if(o==="text")return{ok:!0,data:yield M.text(),status:M.status,url:d,fromCache:!1};let T=yield M.blob(),A=T.type||M.headers.get("content-type")||"";return o==="dataURL"?{ok:!0,data:yield Pe(T),status:M.status,url:d,fromCache:!1,mime:A}:{ok:!0,data:T,status:M.status,url:d,fromCache:!1,mime:A}}catch(M){let T=M&&typeof M=="object"&&"name"in M&&M.name==="AbortError"?String(M.message||"").includes("timeout")?"timeout":"abort":"network",A={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:T};if(!/^blob:/i.test(t)&&a>0&&Gt.set(c,{until:Date.now()+a,result:A}),!i){let P=`${T}:${o}:${new URL(t,(F=location==null?void 0:location.href)!=null?F:"http://localhost/").origin}`,V=T==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${t}`:T==="abort"?`Request aborted while fetching ${o} ${t}`:`Network/CORS issue while fetching ${o} ${t}. A proxy may be required`;_e.errorOnce(P,V)}return e.onError&&e.onError(A),A}finally{clearTimeout(u),me.delete(c)}});return me.set(c,m),m})}function Lt(t,e){if(!e||!t.width||!t.height)return t;let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let o=n.getContext("2d");return o.fillStyle=e,o.fillRect(0,0,n.width,n.height),o.drawImage(t,0,0),n}function Rt(n){return v(this,arguments,function*(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let r=Nt(t);if(!r)return t;let s=At(r);if(y.background.has(s)){let a=y.background.get(s);return a?`url("${a}")`:"none"}try{let a=yield Z(s,{as:"dataURL",useProxy:e.useProxy});return a.ok?(y.background.set(s,a.data),`url("${a.data}")`):(y.background.set(s,null),"none")}catch(a){return y.background.set(s,null),"none"}})}var Kt=new Set(["meta","script","noscript","title","link","template"]),Ot=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Sn=["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"];function he(){for(let t of Sn){let e=String(t).toLowerCase();Kt.has(e)||Ot.has(e)||pe(e)}}function pe(t){if(t=String(t).toLowerCase(),Ot.has(t)){let s={};return y.defaultStyle.set(t,s),s}if(y.defaultStyle.has(t))return y.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(Ue(s))continue;let a=o.getPropertyValue(s);r[s]=a}return e.removeChild(n),y.defaultStyle.set(t,r),r}var Cn=/(?:^|-)(animation|transition)(?:-|$)/i,kn=/^(--|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,Mn=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"]);function Ue(t){let e=String(t).toLowerCase();return!!(Mn.has(e)||kn.test(e)||Cn.test(e))}function Ht(t,e){if(e=String(e||"").toLowerCase(),Ot.has(e))return"";let n=[],o=pe(e);for(let[r,s]of Object.entries(t)){if(Ue(r))continue;let a=o[r];s&&s!==a&&n.push(`${r}:${s}`)}return n.sort(),n.join(";")}function ge(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 ye(t){let e=new Map;for(let o of t){let r=y.defaultStyle.get(o);if(!r)continue;let s=Object.entries(r).map(([a,l])=>`${a}:${l};`).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} }
2
+ `;return n}function we(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 It(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=y.computedStyle.get(t);if(n||(n=new Map,y.computedStyle.set(t,n)),!n.has(e)){let o=window.getComputedStyle(t,e);n.set(e,o)}return n.get(e)}function Jt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function Tt(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}function xt(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function tt(){let t=typeof navigator!="undefined"&&navigator.userAgent?navigator.userAgent:"",e=/^((?!chrome|android).)*safari/i.test(t),n=/AppleWebKit/i.test(t)&&/Mobile/i.test(t)&&!/Safari/i.test(t),o=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(t);return e||n||o}var Be=new WeakMap,be=new Map,xe=0;function Dt(){xe++}var Oe=!1;function An(t=document.documentElement){var e,n;if(!Oe){Oe=!0;try{new MutationObserver(()=>Dt()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(o){}try{new MutationObserver(()=>Dt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(o){}try{let o=document.fonts;o&&((e=o.addEventListener)==null||e.call(o,"loadingdone",Dt),(n=o.ready)==null||n.then(()=>Dt()).catch(()=>{}))}catch(o){}}}function $n(t,e={}){let n={},o=t.getPropertyValue("visibility");for(let r=0;r<t.length;r++){let s=t[r],a=t.getPropertyValue(s);(s==="background-image"||s==="content")&&a.includes("url(")&&!a.includes("data:")&&(a="none"),n[s]=a}if(e.embedFonts){let r=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let s of r)if(!n[s])try{let a=t.getPropertyValue(s);a&&(n[s]=a)}catch(a){}}return o==="hidden"&&(n.opacity="0"),n}var He=new WeakMap;function En(t){let e=He.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(";"),He.set(t,e),e)}function Fn(t,e=null,n={}){let o=Be.get(t);if(o&&o.epoch===xe)return o.snapshot;let r=e||getComputedStyle(t),s=$n(r,n);return Tn(t,r,s),Be.set(t,{epoch:xe,snapshot:s}),s}function vn(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:be,defaultStyle:y.defaultStyle,baseStyle:y.baseStyle,image:y.image,resource:y.resource,background:y.background,font:y.font},options:e||{}}:{session:y.session,persist:{snapshotKeyCache:be,defaultStyle:y.defaultStyle,baseStyle:y.baseStyle,image:y.image,resource:y.resource,background:y.background,font:y.font},options:t||e||{}}}function Wt(t,e,n,o){return v(this,null,function*(){var d,g,w;if(t.tagName==="STYLE")return;let r=vn(n,o),s=r.options&&r.options.cache||"auto";if(s!=="disabled"&&An(document.documentElement),s==="disabled"&&!r.session.__bumpedForDisabled&&(Dt(),be.clear(),r.session.__bumpedForDisabled=!0),Ot.has((d=t.tagName)==null?void 0:d.toLowerCase())){let u=(g=t.getAttribute)==null?void 0:g.call(t,"style");u&&e.setAttribute("style",u)}let{session:a,persist:l}=r;a.styleCache.has(t)||a.styleCache.set(t,getComputedStyle(t));let i=a.styleCache.get(t),c=Fn(t,i,r.options),h=En(c),f=l.snapshotKeyCache.get(h);if(!f){let u=((w=t.tagName)==null?void 0:w.toLowerCase())||"div";f=Ht(c,u),l.snapshotKeyCache.set(h,f)}a.styleMap.set(e,f)})}function Nn(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Ln(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 Rn(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function In(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,o=t.lastElementChild;if(n&&n.tagName==="BR"||o&&o.tagName==="BR")return!0;let r=t.scrollHeight;if(r===0)return!1;let s=parseFloat(e.paddingTop)||0,a=parseFloat(e.paddingBottom)||0;return r>s+a}function Tn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let o=e.display||"";if(o.includes("flex")||o.includes("grid")||Nn(t))return;let r=e.position;r==="absolute"||r==="fixed"||r==="sticky"||e.transform==="none"&&(Ln(e)||Rn(t)||In(t,e)&&(delete n.height,delete n["block-size"]))}function Se(t,e,n){return Promise.all(t.map(o=>new Promise(r=>{function s(){xt(a=>{(a&&typeof a.timeRemaining=="function"?a.timeRemaining()>0:!0)?e(o,r):s()},{fast:n})}s()})))}function Wn(t){return t=t.trim(),!t||/\:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function _n(t,e,n=!0){return t.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let r=n?Wn(o):o;return`:where(${e} ${r})`}).join(", ")}function Pn(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${e}:is(${o.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${e} ${o.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,r,s)=>{let a=_n(s,e,!0);return`${o}${r}${a}{`}),t):""}function Un(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Bn(t){let e="";try{t.querySelectorAll("style").forEach(o=>{e+=(o.textContent||"")+`
3
+ `});let n=t.adoptedStyleSheets||[];for(let o of n)try{if(o&&o.cssRules)for(let r of o.cssRules)e+=r.cssText+`
4
+ `}catch(r){}}catch(n){}return e}function On(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function Hn(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch(n){}}function Dn(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function qn(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch(n){}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch(n){}return""}function jn(t,e,n){let o=[];for(let r of e){let s=qn(t,r);s&&o.push(`${r}: ${s};`)}return o.length?`${n}{${o.join("")}}
5
+ `:""}function zn(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}function Vn(t,e=3){return v(this,null,function*(){let n=()=>{var s;try{return t.contentDocument||((s=t.contentWindow)==null?void 0:s.document)||null}catch(a){return null}},o=n(),r=0;for(;r<e&&(!o||!o.body&&!o.documentElement);)yield new Promise(s=>setTimeout(s,0)),o=n(),r++;return o&&(o.body||o.documentElement)?o:null})}function Xn(t){let e=t.getBoundingClientRect(),n=0,o=0,r=0,s=0;try{let i=getComputedStyle(t);n=parseFloat(i.borderLeftWidth)||0,o=parseFloat(i.borderRightWidth)||0,r=parseFloat(i.borderTopWidth)||0,s=parseFloat(i.borderBottomWidth)||0}catch(i){}let a=Math.max(0,Math.round(e.width-(n+o))),l=Math.max(0,Math.round(e.height-(r+s)));return{contentWidth:a,contentHeight:l,rect:e}}function Yn(t,e,n){let o=t.createElement("style");return o.setAttribute("data-sd-iframe-pin",""),o.textContent=`html, body {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;}`,(t.head||t.documentElement).appendChild(o),()=>{try{o.remove()}catch(r){}}}function Gn(t,e,n){return v(this,null,function*(){let o=yield Vn(t,3);if(!o)throw new Error("iframe document not accessible/ready");let{contentWidth:r,contentHeight:s,rect:a}=Xn(t),l=n==null?void 0:n.snap;if(!l||typeof l.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let i=Q(J({},n),{scale:1}),c=Yn(o,r,s),h;try{h=yield l.toPng(o.documentElement,i)}finally{c()}h.style.display="block",h.style.width=`${r}px`,h.style.height=`${s}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),Wt(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(a.width)}px`),f.style.height||(f.style.height=`${Math.round(a.height)}px`),f.appendChild(h),f})}function qt(t,e,n){return v(this,null,function*(){var c,h,f,d,g,w;if(!t)throw new Error("Invalid node");let o=new Set,r=null,s=null;if(t.nodeType===Node.ELEMENT_NODE){let u=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Kt.has(u))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"){let u=document.createElement("div"),m=t.getBoundingClientRect();return u.style.cssText=`display:inline-block;width:${m.width}px;height:${m.height}px;visibility:hidden;`,u}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let u of n.exclude)try{if((c=t.matches)!=null&&c.call(t,u)){if(n.excludeMode==="hide"){let m=document.createElement("div"),b=t.getBoundingClientRect();return m.style.cssText=`display:inline-block;width:${b.width}px;height:${b.height}px;visibility:hidden;`,m}else if(n.excludeMode==="remove")return null}}catch(m){console.warn(`Invalid selector in exclude option: ${u}`,m)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let u=document.createElement("div"),m=t.getBoundingClientRect();return u.style.cssText=`display:inline-block;width:${m.width}px;height:${m.height}px;visibility:hidden;`,u}else if(n.filterMode==="remove")return null}}catch(u){console.warn("Error in filter function:",u)}if(t.tagName==="IFRAME"){let u=!1;try{u=!!(t.contentDocument||(h=t.contentWindow)!=null&&h.document)}catch(m){u=!1}if(u)try{return yield Gn(t,e,n)}catch(m){console.warn("[SnapDOM] iframe rasterization failed, fallback:",m)}if(n.placeholders){let m=document.createElement("div");return m.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}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;`,Wt(t,m,e,n),m}else{let m=t.getBoundingClientRect(),b=document.createElement("div");return b.style.cssText=`display:inline-block;width:${m.width}px;height:${m.height}px;visibility:hidden;`,Wt(t,b,e,n),b}}if(t.getAttribute("data-capture")==="placeholder"){let u=t.cloneNode(!1);e.nodeMap.set(u,t),Wt(t,u,e,n);let m=document.createElement("div");return m.textContent=t.getAttribute("data-placeholder-text")||"",m.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",u.appendChild(m),u}if(t.tagName==="CANVAS"){let u=t.toDataURL(),m=document.createElement("img");return m.src=u,m.width=t.width,m.height=t.height,e.nodeMap.set(m,t),Wt(t,m,e,n),m}let a;try{if(a=t.cloneNode(!1),e.nodeMap.set(a,t),t.tagName==="IMG"){Hn(t,a);try{let u=t.getBoundingClientRect(),m=Math.round(u.width||0),b=Math.round(u.height||0);if(!m||!b){let k=window.getComputedStyle(t),R=parseFloat(k.width)||0,$=parseFloat(k.height)||0,F=parseInt(t.getAttribute("width")||"",10)||0,M=parseInt(t.getAttribute("height")||"",10)||0,T=t.width||t.naturalWidth||0,A=t.height||t.naturalHeight||0;m=Math.round(m||R||F||T||0),b=Math.round(b||$||M||A||0)}m&&(a.dataset.snapdomWidth=String(m)),b&&(a.dataset.snapdomHeight=String(b))}catch(u){}}}catch(u){throw console.error("[Snapdom] Failed to clone node:",t,u),u}if(t instanceof HTMLTextAreaElement){let u=t.getBoundingClientRect();a.style.width=`${u.width}px`,a.style.height=`${u.height}px`}if(t instanceof HTMLInputElement&&(a.value=t.value,a.setAttribute("value",t.value),t.checked!==void 0&&(a.checked=t.checked,t.checked&&a.setAttribute("checked",""),t.indeterminate&&(a.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(r=t.value),t instanceof HTMLTextAreaElement&&(s=t.value),Wt(t,a,e,n),t.shadowRoot){let M=function(A,P){if(A.nodeType===Node.ELEMENT_NODE&&A.tagName==="STYLE")return P(null);qt(A,e,n).then(V=>{P(V||null)}).catch(V=>{P(null)})};try{let A=t.shadowRoot.querySelectorAll("slot");for(let P of A){let V=[];try{V=((f=P.assignedNodes)==null?void 0:f.call(P,{flatten:!0}))||((d=P.assignedNodes)==null?void 0:d.call(P))||[]}catch(rt){V=((g=P.assignedNodes)==null?void 0:g.call(P))||[]}for(let rt of V)o.add(rt)}}catch(A){}let u=Un(e),m=`[data-sd="${u}"]`;try{a.setAttribute("data-sd",u)}catch(A){}let b=Bn(t.shadowRoot),k=Pn(b,m),R=Dn(b),$=jn(t,R,m);On(a,$+k,u);let F=document.createDocumentFragment(),T=yield Se(Array.from(t.shadowRoot.childNodes),M,n.fast);F.append(...T.filter(A=>!!A)),a.appendChild(F)}if(t.tagName==="SLOT"){let k=function($,F){qt($,e,n).then(M=>{M&&zn(M),F(M||null)}).catch(M=>{F(null)})},u=((w=t.assignedNodes)==null?void 0:w.call(t,{flatten:!0}))||[],m=u.length>0?u:Array.from(t.childNodes),b=document.createDocumentFragment(),R=yield Se(Array.from(m),k,n.fast);return b.append(...R.filter($=>!!$)),b}function l(u,m){if(o.has(u))return m(null);qt(u,e,n).then(b=>{m(b||null)}).catch(b=>{m(null)})}let i=yield Se(Array.from(t.childNodes),l,n.fast);if(a.append(...i.filter(u=>!!u)),r!==null&&a instanceof HTMLSelectElement){a.value=r;for(let u of a.options)u.value===r?u.setAttribute("selected",""):u.removeAttribute("selected")}return s!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=s),a})}var Kn=[/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=[];function De(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?Ce.push(n):typeof n=="string"?Ce.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function mt(t){let e=typeof t=="string"?t:"",n=[...Kn,...Ce];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 qe(t,e,n,o=32,r="#000"){return v(this,null,function*(){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;yield document.fonts.ready;let a=document.createElement("span");a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${o}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let l=a.getBoundingClientRect(),i=Math.ceil(l.width),c=Math.ceil(l.height);document.body.removeChild(a);let h=document.createElement("canvas");h.width=i*s,h.height=c*s;let f=h.getContext("2d");return f.scale(s,s),f.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=r,f.fillText(t,0,0),{dataUrl:h.toDataURL(),width:i,height:c}})}var Jn=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Qt(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Jn.has(n.toLowerCase()))return n}return""}function Zt(t){let e=String(t!=null?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 ke(t){let e=String(t!=null?t:"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function Qn(t){let e=String(t!=null?t:"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Zn(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let r=Zt(n[1]),s=Zt(n[2]);return{min:Math.min(r,s),max:Math.max(r,s)}}let o=Zt(e);return{min:o,max:o}}function to(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function eo(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let s=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(s,a),max:Math.max(s,a)}}let o=e.match(/(\d+(?:\.\d+)?)\s*%/),r=o?parseFloat(o[1]):100;return{min:r,max:r}}function no(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let r=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(l=>r.endsWith(l)))return!0;let a=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a))return!0;for(let l of e){let i=l.toLowerCase().replace(/\s+/g,"+"),c=l.toLowerCase().replace(/\s+/g,"-");if(a.includes(i)||a.includes(c))return!0}return!1}catch(n){return!1}}function oo(t){var n;let e=new Set;for(let o of t||[]){let r=(n=String(o).split("__")[0])==null?void 0:n.trim();r&&e.add(r)}return e}function te(){return v(this,arguments,function*({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:o=[],useProxy:r=""}={}){var A,P,V,rt,et,ct,lt,ft,_t,q,yt,St,Et,wt,B,j,K,G;t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let s=new Map;for(let p of t){let[x,C,N,S]=String(p).split("__");if(!x)continue;let E=s.get(x)||[];E.push({w:parseInt(C,10),s:N,st:parseInt(S,10)}),s.set(x,E)}let a=/@import\s+url\(["']?([^"')]+)["']?\)/g,l=/url\((["']?)([^"')]+)\1\)/g,i=/@font-face[^{}]*\{[^}]*\}/g;function c(p,x,C,N){if(!s.has(p))return!1;let S=s.get(p),E=Zn(C),L=to(x),_=eo(N),I=E.min!==E.max,U=E.min,W=D=>L.kind==="normal"&&D==="normal"||L.kind!=="normal"&&(D==="italic"||D==="oblique"),O=!1;for(let D of S){let nt=I?D.w>=E.min&&D.w<=E.max:D.w===U,ut=W(ke(D.s)),bt=D.st>=_.min&&D.st<=_.max;if(nt&&ut&&bt){O=!0;break}}if(O)return!0;if(!I)for(let D of S){let nt=W(ke(D.s)),ut=D.st>=_.min&&D.st<=_.max;if(Math.abs(U-D.w)<=300&&nt&&ut)return!0}return!1}function h(p){if(!p)return[];let x=[],C=p.split(",").map(N=>N.trim()).filter(Boolean);for(let N of C){let S=N.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!S)continue;let E=S[1],L=S[2],_=I=>{if(!I.includes("?"))return parseInt(I,16);let U=parseInt(I.replace(/\?/g,"0"),16),W=parseInt(I.replace(/\?/g,"F"),16);return[U,W]};if(L){let I=_(E),U=_(L),W=Array.isArray(I)?I[0]:I,O=Array.isArray(U)?U[1]:U;x.push([Math.min(W,O),Math.max(W,O)])}else{let I=_(E);Array.isArray(I)?x.push([I[0],I[1]]):x.push([I,I])}}return x}function f(p,x){if(!x.length||!p||p.size===0)return!0;for(let C of p)for(let[N,S]of x)if(C>=N&&C<=S)return!0;return!1}function d(p,x){let C=[];if(!p)return C;for(let N of p.matchAll(l)){let S=(N[2]||"").trim();if(!(!S||S.startsWith("data:"))){if(!/^https?:/i.test(S))try{S=new URL(S,x||location.href).href}catch(E){}C.push(S)}}return C}function g(p,x){return v(this,null,function*(){var N,S,E,L,_;let C=p;for(let I of p.matchAll(l)){let U=Nt(I[0]);if(!U)continue;let W=U;if(!W.startsWith("http")&&!W.startsWith("data:"))try{W=new URL(W,x||location.href).href}catch(O){}if(!mt(W)){if((N=y.resource)!=null&&N.has(W)){(S=y.font)==null||S.add(W),C=C.replace(I[0],`url(${y.resource.get(W)})`);continue}if(!((E=y.font)!=null&&E.has(W)))try{let O=yield Z(W,{as:"dataURL",useProxy:r,silent:!0});if(O.ok&&typeof O.data=="string"){let D=O.data;(L=y.resource)==null||L.set(W,D),(_=y.font)==null||_.add(W),C=C.replace(I[0],`url(${D})`)}}catch(O){console.warn("[snapDOM] Failed to fetch font resource:",W)}}}return C})}function w(p){if(!p.length)return null;let x=(_,I)=>p.some(([U,W])=>!(W<_||U>I)),C=x(0,255)||x(305,305),N=x(256,591)||x(7680,7935),S=x(880,1023),E=x(1024,1279);return x(7840,7929)||x(258,259)||x(416,417)||x(431,432)?"vietnamese":E?"cyrillic":S?"greek":N?"latin-ext":C?"latin":null}function u(p={}){let x=new Set((p.families||[]).map(S=>String(S).toLowerCase())),C=new Set((p.domains||[]).map(S=>String(S).toLowerCase())),N=new Set((p.subsets||[]).map(S=>String(S).toLowerCase()));return(S,E)=>{if(x.size&&x.has(S.family.toLowerCase()))return!0;if(C.size)for(let L of S.srcUrls)try{if(C.has(new URL(L).host.toLowerCase()))return!0}catch(_){}if(N.size){let L=w(E);if(L&&N.has(L))return!0}return!1}}let m=u(n);function b(p){var E,L,_,I,U,W;if(!p)return p;let x=/@font-face[^{}]*\{[^}]*\}/gi,C=new Set,N=[];for(let O of p.match(x)||[]){let D=((E=O.match(/font-family:\s*([^;]+);/i))==null?void 0:E[1])||"",nt=Qt(D),ut=(((L=O.match(/font-weight:\s*([^;]+);/i))==null?void 0:L[1])||"400").trim(),bt=(((_=O.match(/font-style:\s*([^;]+);/i))==null?void 0:_[1])||"normal").trim(),ce=(((I=O.match(/font-stretch:\s*([^;]+);/i))==null?void 0:I[1])||"100%").trim(),le=(((U=O.match(/unicode-range:\s*([^;]+);/i))==null?void 0:U[1])||"").trim(),fe=(((W=O.match(/src\s*:\s*([^;]+);/i))==null?void 0:W[1])||"").trim(),ue=d(fe,location.href),X=ue.length?ue.map(z=>String(z).toLowerCase()).sort().join("|"):fe.toLowerCase(),H=[String(nt||"").toLowerCase(),ut,bt,ce,le.toLowerCase(),X].join("|");C.has(H)||(C.add(H),N.push(O))}if(N.length===0)return p;let S=0;return p.replace(x,()=>N[S++]||"")}function k(){let p=Array.from(t||[]).sort().join("|"),x=n?JSON.stringify({families:(n.families||[]).map(S=>String(S).toLowerCase()).sort(),domains:(n.domains||[]).map(S=>String(S).toLowerCase()).sort(),subsets:(n.subsets||[]).map(S=>String(S).toLowerCase()).sort()}):"",C=(o||[]).map(S=>`${(S.family||"").toLowerCase()}::${S.weight||"normal"}::${S.style||"normal"}::${S.src||""}`).sort().join("|");return`fonts-embed-css::req=${p}::ex=${x}::lf=${C}::px=${r||""}`}let R=k();if((A=y.resource)!=null&&A.has(R))return y.resource.get(R);let $=oo(t),F=[];for(let p of document.querySelectorAll("style")){let x=p.textContent||"";for(let C of x.matchAll(a)){let N=C[1];if(!N||mt(N))continue;!!document.querySelector(`link[rel="stylesheet"][href="${N}"]`)||F.push(N)}}F.length&&(yield Promise.all(F.map(p=>new Promise(x=>{if(document.querySelector(`link[rel="stylesheet"][href="${p}"]`))return x(null);let C=document.createElement("link");C.rel="stylesheet",C.href=p,C.setAttribute("data-snapdom","injected-import"),C.onload=()=>x(C),C.onerror=()=>x(null),document.head.appendChild(C)}))));let M="",T=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(p=>!!p.href);for(let p of T)try{if(mt(p.href))continue;let x="",C=!1;try{C=new URL(p.href,location.href).origin===location.origin}catch(S){}if(!C&&!no(p.href,$))continue;if(C){let S=Array.from(document.styleSheets).find(E=>E.href===p.href);if(S)try{let E=S.cssRules||[];x=Array.from(E).map(L=>L.cssText).join("")}catch(E){}}if(!x&&(x=(yield Z(p.href,{as:"text",useProxy:r})).data,mt(p.href)))continue;let N="";for(let S of x.match(i)||[]){let E=(((P=S.match(/font-family:\s*([^;]+);/i))==null?void 0:P[1])||"").trim(),L=Qt(E);if(!L||mt(L))continue;let _=(((V=S.match(/font-weight:\s*([^;]+);/i))==null?void 0:V[1])||"400").trim(),I=(((rt=S.match(/font-style:\s*([^;]+);/i))==null?void 0:rt[1])||"normal").trim(),U=(((et=S.match(/font-stretch:\s*([^;]+);/i))==null?void 0:et[1])||"100%").trim(),W=(((ct=S.match(/unicode-range:\s*([^;]+);/i))==null?void 0:ct[1])||"").trim(),O=(((lt=S.match(/src\s*:\s*([^;]+);/i))==null?void 0:lt[1])||"").trim(),D=d(O,p.href);if(!c(L,I,_,U))continue;let nt=h(W);if(!f(e,nt))continue;let ut={family:L,weightSpec:_,styleSpec:I,stretchSpec:U,unicodeRange:W,srcRaw:O,srcUrls:D,href:p.href};if(n&&m(ut,nt))continue;let bt=/url\(/i.test(O)?yield g(S,p.href):S;N+=bt+""}N.trim()&&(M+=N+"")}catch(x){console.warn("[snapdom] Failed to process stylesheet:",p.href)}for(let p of document.styleSheets)try{if(p.href&&T.some(C=>C.href===p.href))continue;let x=p.cssRules||[];for(let C of x){if(C.type!==CSSRule.FONT_FACE_RULE)continue;let N=(C.style.getPropertyValue("font-family")||"").trim(),S=Qt(N);if(!S||mt(S))continue;let E=(C.style.getPropertyValue("font-weight")||"400").trim(),L=(C.style.getPropertyValue("font-style")||"normal").trim(),_=(C.style.getPropertyValue("font-stretch")||"100%").trim(),I=(C.style.getPropertyValue("src")||"").trim(),U=(C.style.getPropertyValue("unicode-range")||"").trim(),W=d(I,p.href||location.href);if(!c(S,L,E,_))continue;let O=h(U);if(!f(e,O))continue;let D={family:S,weightSpec:E,styleSpec:L,stretchSpec:_,unicodeRange:U,srcRaw:I,srcUrls:W,href:p.href||location.href};if(!(n&&m(D,O)))if(/url\(/i.test(I)){let nt=yield g(I,p.href||location.href);M+=`@font-face{font-family:${S};src:${nt};font-style:${L};font-weight:${E};font-stretch:${_};${U?`unicode-range:${U};`:""}}`}else M+=`@font-face{font-family:${S};src:${I};font-style:${L};font-weight:${E};font-stretch:${_};${U?`unicode-range:${U};`:""}}`}}catch(x){}try{for(let p of document.fonts||[]){if(!p||!p.family||p.status!=="loaded"||!p._snapdomSrc)continue;let x=String(p.family).replace(/^['"]+|['"]+$/g,"");if(mt(x)||!s.has(x)||n!=null&&n.families&&n.families.some(N=>String(N).toLowerCase()===x.toLowerCase()))continue;let C=p._snapdomSrc;if(!String(C).startsWith("data:")){if((ft=y.resource)!=null&&ft.has(p._snapdomSrc))C=y.resource.get(p._snapdomSrc),(_t=y.font)==null||_t.add(p._snapdomSrc);else if(!((q=y.font)!=null&&q.has(p._snapdomSrc)))try{let N=yield Z(p._snapdomSrc,{as:"dataURL",useProxy:r,silent:!0});if(N.ok&&typeof N.data=="string")C=N.data,(yt=y.resource)==null||yt.set(p._snapdomSrc,C),(St=y.font)==null||St.add(p._snapdomSrc);else continue}catch(N){console.warn("[snapdom] Failed to fetch dynamic font src:",p._snapdomSrc);continue}}M+=`@font-face{font-family:'${x}';src:url(${C});font-style:${p.style||"normal"};font-weight:${p.weight||"normal"};}`}}catch(p){}for(let p of o){if(!p||typeof p!="object")continue;let x=String(p.family||"").replace(/^['"]+|['"]+$/g,"");if(!x||mt(x)||!s.has(x)||n!=null&&n.families&&n.families.some(_=>String(_).toLowerCase()===x.toLowerCase()))continue;let C=p.weight!=null?String(p.weight):"normal",N=p.style!=null?String(p.style):"normal",S=p.stretchPct!=null?`${p.stretchPct}%`:"100%",E=String(p.src||""),L=E;if(!L.startsWith("data:")){if((Et=y.resource)!=null&&Et.has(E))L=y.resource.get(E),(wt=y.font)==null||wt.add(E);else if(!((B=y.font)!=null&&B.has(E)))try{let _=yield Z(E,{as:"dataURL",useProxy:r,silent:!0});if(_.ok&&typeof _.data=="string")L=_.data,(j=y.resource)==null||j.set(E,L),(K=y.font)==null||K.add(E);else continue}catch(_){console.warn("[snapdom] Failed to fetch localFonts src:",E);continue}}M+=`@font-face{font-family:'${x}';src:url(${L});font-style:${N};font-weight:${C};font-stretch:${S};}`}return M&&(M=b(M),(G=y.resource)==null||G.set(R,M)),M})}function ee(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),o=a=>{let l=Qt(a.fontFamily);if(!l)return;let i=(c,h,f)=>`${l}__${Zt(c)}__${ke(h)}__${Qn(f)}`;e.add(i(a.fontWeight,a.fontStyle,a.fontStretch))};o(getComputedStyle(t));let r=getComputedStyle(t,"::before");r&&r.content&&r.content!=="none"&&o(r);let s=getComputedStyle(t,"::after");for(s&&s.content&&s.content!=="none"&&o(s);n.nextNode();){let a=n.currentNode,l=getComputedStyle(a);o(l);let i=getComputedStyle(a,"::before");i&&i.content&&i.content!=="none"&&o(i);let c=getComputedStyle(a,"::after");c&&c.content&&c.content!=="none"&&o(c)}return e}function ne(t){let e=new Set,n=r=>{if(r)for(let s of r)e.add(s.codePointAt(0))},o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){let r=o.currentNode;if(r.nodeType===Node.TEXT_NODE)n(r.nodeValue||"");else if(r.nodeType===Node.ELEMENT_NODE){let s=r;for(let a of["::before","::after"]){let l=getComputedStyle(s,a),i=l==null?void 0:l.getPropertyValue("content");if(!(!i||i==="none"))if(/^"/.test(i)||/^'/.test(i))n(i.slice(1,-1));else{let c=i.match(/\\[0-9A-Fa-f]{1,6}/g);if(c)for(let h of c)try{e.add(parseInt(h.slice(1),16))}catch(f){}}}}}return e}function oe(t,e=2){return v(this,null,function*(){try{yield document.fonts.ready}catch(r){}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let o=()=>{let r=document.createElement("div");r.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 n){let a=document.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",r.appendChild(a)}document.body.appendChild(r),r.offsetWidth,document.body.removeChild(r)};for(let r=0;r<Math.max(1,e);r++)o(),yield new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s)))})}function Xe(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function ro(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function je(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 ze(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,a]of n)for(;o>=s;)r+=a,o-=s;return e?r:r.toLowerCase()}function Ve(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return je(t,!1);case"upper-alpha":return je(t,!0);case"lower-roman":return ze(t,!1);case"upper-roman":return ze(t,!0);default:return String(Math.max(0,t))}}function Ye(t){let e=new WeakMap,n=t instanceof Document?t.documentElement:t,o=c=>c&&c.tagName==="LI",r=c=>{let h=0,f=c==null?void 0:c.parentElement;if(!f)return 0;for(let d of f.children){if(d===c)break;d.tagName==="LI"&&h++}return h},s=c=>{let h=new Map;for(let[f,d]of c)h.set(f,d.slice());return h},a=(c,h,f)=>{var u,m;let d=s(c),g;try{g=((u=f.style)==null?void 0:u.counterReset)||getComputedStyle(f).counterReset}catch(b){}if(g&&g!=="none")for(let b of g.split(",")){let k=b.trim().split(/\s+/),R=k[0],$=Number.isFinite(Number(k[1]))?Number(k[1]):0;if(!R)continue;let F=h.get(R);if(F&&F.length){let M=F.slice();M.push($),d.set(R,M)}else d.set(R,[$])}let w;try{w=((m=f.style)==null?void 0:m.counterIncrement)||getComputedStyle(f).counterIncrement}catch(b){}if(w&&w!=="none")for(let b of w.split(",")){let k=b.trim().split(/\s+/),R=k[0],$=Number.isFinite(Number(k[1]))?Number(k[1]):1;if(!R)continue;let F=d.get(R)||[];F.length===0&&F.push(0),F[F.length-1]+=$,d.set(R,F)}try{if(getComputedStyle(f).display==="list-item"&&o(f)){let k=f.parentElement,R=1;if(k&&k.tagName==="OL"){let F=k.getAttribute("start"),M=Number.isFinite(Number(F))?Number(F):1,T=r(f),A=f.getAttribute("value");R=Number.isFinite(Number(A))?Number(A):M+T}else R=1+r(f);let $=d.get("list-item")||[];$.length===0&&$.push(0),$[$.length-1]=R,d.set("list-item",$)}}catch(b){}return d},l=(c,h,f)=>{let d=a(f,h,c);e.set(c,d);let g=d;for(let w of c.children)g=l(w,d,g);return d},i=new Map;return l(n,i,i),{get(c,h){var d;let f=(d=e.get(c))==null?void 0:d.get(h);return f&&f.length?f[f.length-1]:0},getStack(c,h){var d;let f=(d=e.get(c))==null?void 0:d.get(h);return f?f.slice():[]}}}function Ge(t,e,n){if(!t||t==="none")return t;try{let o=/\b(counter|counters)\s*\(([^)]+)\)/g,r=t.replace(o,(s,a,l)=>{var c,h,f,d;let i=String(l).split(",").map(g=>g.trim());if(a==="counter"){let g=(c=i[0])==null?void 0:c.replace(/^["']|["']$/g,""),w=(i[1]||"decimal").toLowerCase(),u=n.get(e,g);return Ve(u,w)}else{let g=(h=i[0])==null?void 0:h.replace(/^["']|["']$/g,""),w=(d=(f=i[1])==null?void 0:f.replace(/^["']|["']$/g,""))!=null?d:"",u=(i[2]||"decimal").toLowerCase(),m=n.getStack(e,g);return m.length?m.map(k=>Ve(k,u)).join(w):""}});return ro(r)}catch(o){return"- "}}var jt=null,zt=new WeakMap;function so(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function ao(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,o;for(;o=n.exec(t);)e.push(o[1]);return e.length?e.join(""):so(t)}function Me(t,e){let n=t.parentElement,o=n?zt.get(n):null;return o?{get(r,s){let a=e.get(r,s),l=o.get(s);return typeof l=="number"?Math.max(a,l):a},getStack(r,s){let a=e.getStack(r,s);if(!a.length)return a;let l=o.get(s);if(typeof l=="number"){let i=a.slice();return i[i.length-1]=Math.max(i[i.length-1],l),i}return a}}:e}function Ae(t,e,n){let o=new Map;function r(i){let c=[];if(!i||i==="none")return c;for(let h of String(i).split(",")){let f=h.trim().split(/\s+/),d=f[0],g=Number.isFinite(Number(f[1]))?Number(f[1]):void 0;d&&c.push({name:d,num:g})}return c}let s=r(e==null?void 0:e.counterReset),a=r(e==null?void 0:e.counterIncrement);function l(i){if(o.has(i))return o.get(i).slice();let c=n.getStack(t,i);c=c.length?c.slice():[];let h=s.find(d=>d.name===i);if(h){let d=Number.isFinite(h.num)?h.num:0;c=c.length?[...c,d]:[d]}let f=a.find(d=>d.name===i);if(f){let d=Number.isFinite(f.num)?f.num:1;c.length===0&&(c=[0]),c[c.length-1]+=d}return o.set(i,c.slice()),c}return{get(i,c){let h=l(c);return h.length?h[h.length-1]:0},getStack(i,c){return l(c)},__incs:a}}function io(t,e,n){let o;try{o=getComputedStyle(t,e)}catch(c){}let r=o==null?void 0:o.content;if(!r||r==="none"||r==="normal")return{text:"",incs:[]};let s=Me(t,n),a=Ae(t,o,s),l=Xe(r)?Ge(r,t,a):r;return{text:ao(l),incs:a.__incs||[]}}function $e(t,e,n,o){return v(this,null,function*(){var a;if(!(t instanceof Element)||!(e instanceof Element))return;if(!jt)try{jt=Ye(t.ownerDocument||document)}catch(l){}for(let l of["::before","::after","::first-letter"])try{let i=It(t,l);if(!i||typeof i[Symbol.iterator]!="function"||i.content==="none"&&i.backgroundImage==="none"&&i.backgroundColor==="transparent"&&(i.borderStyle==="none"||parseFloat(i.borderWidth)===0)&&(!i.transform||i.transform==="none")&&i.display==="inline")continue;if(l==="::first-letter"){let B=getComputedStyle(t);if(!(i.color!==B.color||i.fontSize!==B.fontSize||i.fontWeight!==B.fontWeight))continue;let K=Array.from(e.childNodes).find(_=>{var I;return _.nodeType===Node.TEXT_NODE&&((I=_.textContent)==null?void 0:I.trim().length)>0});if(!K)continue;let G=K.textContent,p=G.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u),x=p==null?void 0:p[0],C=G.slice((x==null?void 0:x.length)||0);if(!x||/[\uD800-\uDFFF]/.test(x))continue;let N=document.createElement("span");N.textContent=x,N.dataset.snapdomPseudo="::first-letter";let S=Jt(i),E=Ht(S,"span");n.styleMap.set(N,E);let L=document.createTextNode(C);e.replaceChild(L,K),e.insertBefore(N,L);continue}let h=i.content,{text:f,incs:d}=io(t,l,jt),g=i.backgroundImage,w=i.backgroundColor,u=i.fontFamily,m=parseInt(i.fontSize)||32,b=parseInt(i.fontWeight)||!1,k=i.color||"#000",R=i.display,$=parseFloat(i.width),F=parseFloat(i.height),M=i.borderStyle,T=parseFloat(i.borderWidth),A=i.transform,P=mt(u),V=h!=="none"&&f!=="",rt=g&&g!=="none",et=w&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)",ct=R!=="inline"&&($>0||F>0),lt=M&&M!=="none"&&T>0,ft=A&&A!=="none";if(!(V||rt||et||lt||ft)){if(d&&d.length&&t.parentElement){let B=zt.get(t.parentElement)||new Map;for(let{name:j,num:K}of d){if(!j)continue;let G=Me(t,jt),x=Ae(t,getComputedStyle(t,l),G).get(t,j);B.set(j,x)}zt.set(t.parentElement,B)}continue}let q=document.createElement("span");q.dataset.snapdomPseudo=l,q.style.verticalAlign="middle",q.style.pointerEvents="none";let yt=Jt(i),St=Ht(yt,"span");if(n.styleMap.set(q,St),P&&f&&f.length===1){let{dataUrl:B,width:j,height:K}=yield qe(f,u,b,m,k),G=document.createElement("img");G.src=B,G.style=`height:${m}px;width:${j/K*m}px;object-fit:contain;`,q.appendChild(G),e.dataset.snapdomHasIcon="true"}else if(f&&f.startsWith("url(")){let B=Nt(f);if(B!=null&&B.trim())try{let j=document.createElement("img"),K=yield Z(At(B),{as:"dataURL",useProxy:o.useProxy});j.src=K.data,j.style=`width:${m}px;height:auto;object-fit:contain;`,q.appendChild(j)}catch(j){console.error(`[snapdom] Error in pseudo ${l} for`,t,j)}}else!P&&V&&(q.textContent=f);if(q.style.background="none","mask"in q.style&&(q.style.mask="none"),rt)try{let B=Tt(g),j=yield Promise.all(B.map(Rt));q.style.backgroundImage=j.join(", ")}catch(B){console.warn(`[snapdom] Failed to inline background-image for ${l}`,B)}et&&(q.style.backgroundColor=w);let wt=q.childNodes.length>0||((a=q.textContent)==null?void 0:a.trim())!==""||rt||et||lt||ft;if(d&&d.length&&t.parentElement){let B=zt.get(t.parentElement)||new Map,j=Me(t,jt),K=Ae(t,getComputedStyle(t,l),j);for(let{name:G}of d){if(!G)continue;let p=K.get(t,G);B.set(G,p)}zt.set(t.parentElement,B)}if(!wt)continue;l==="::before"?e.insertBefore(q,e.firstChild):e.appendChild(q)}catch(i){console.warn(`[snapdom] Failed to capture ${l} for`,t,i)}let r=Array.from(t.children),s=Array.from(e.children).filter(l=>!l.dataset.snapdomPseudo);for(let l=0;l<Math.min(r.length,s.length);l++)yield $e(r[l],s[l],n,o)})}function Ke(t){if(!t)return;let e=new Set;if(t.querySelectorAll("use").forEach(l=>{let i=l.getAttribute("xlink:href")||l.getAttribute("href");i&&i.startsWith("#")&&e.add(i.slice(1))}),!e.size)return;let n=Array.from(document.querySelectorAll("svg > symbol, svg > defs")),o=n.filter(l=>l.tagName.toLowerCase()==="symbol"),r=n.filter(l=>l.tagName.toLowerCase()==="defs"),s=t.querySelector("svg.inline-defs-container");s||(s=document.createElementNS("http://www.w3.org/2000/svg","svg"),s.setAttribute("aria-hidden","true"),s.setAttribute("style","position: absolute; width: 0; height: 0; overflow: hidden;"),s.classList.add("inline-defs-container"),t.insertBefore(s,t.firstChild));let a=new Set;t.querySelectorAll("symbol[id], defs > *[id]").forEach(l=>{a.add(l.id)}),e.forEach(l=>{if(a.has(l))return;let i=o.find(c=>c.id===l);if(i){s.appendChild(i.cloneNode(!0)),a.add(l);return}for(let c of r){let h=c.querySelector(`#${CSS.escape(l)}`);if(h){let f=s.querySelector("defs");f||(f=document.createElementNS("http://www.w3.org/2000/svg","defs"),s.appendChild(f)),f.appendChild(h.cloneNode(!0)),a.add(l);break}}})}function Qe(t,e){var l;if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let o=t.getBoundingClientRect(),r=t.clientHeight,s="data-snap-ph",a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let i=a.currentNode,c=getComputedStyle(i),h=c.position;if(h!=="sticky"&&h!=="-webkit-sticky")continue;let f=Je(c.top),d=Je(c.bottom);if(f==null&&d==null)continue;let g=co(i,t),w=lo(e,g,s);if(!w)continue;let u=i.getBoundingClientRect(),m=u.width,b=u.height,k=u.left-o.left;if(!(m>0&&b>0)||!Number.isFinite(k))continue;let R=f!=null?f+n:n+(r-b-d);if(!Number.isFinite(R))continue;let $=Number.parseInt(c.zIndex,10),F=Number.isFinite($),M=F?Math.max($,1)+1:2,T=F?$-1:0,A=w.cloneNode(!1);A.setAttribute(s,"1"),A.style.position="sticky",A.style.left=`${k}px`,A.style.top=`${R}px`,A.style.width=`${m}px`,A.style.height=`${b}px`,A.style.visibility="hidden",A.style.zIndex=String(T),A.style.overflow="hidden",A.style.background="transparent",A.style.boxShadow="none",A.style.filter="none",(l=w.parentElement)==null||l.insertBefore(A,w),w.style.position="absolute",w.style.left=`${k}px`,w.style.top=`${R}px`,w.style.bottom="auto",w.style.zIndex=String(M),w.style.pointerEvents="none"}}function Je(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function co(t,e){let n=[];for(let o=t;o&&o!==e;){let r=o.parentElement;if(!r)break;n.push(Array.prototype.indexOf.call(r.children,o)),o=r}return n.reverse()}function lo(t,e,n){let o=t;for(let r=0;r<e.length;r++)if(o=fo(o,n)[e[r]],!o)return null;return o instanceof HTMLElement?o:null}function fo(t,e){let n=[],o=t.children;for(let r=0;r<o.length;r++){let s=o[r];s.hasAttribute(e)||n.push(s)}return n}function tn(n){return v(this,arguments,function*(t,e={}){var c,h;let o={styleMap:y.session.styleMap,styleCache:y.session.styleCache,nodeMap:y.session.nodeMap},r,s="",a="";uo(t);try{Ke(t)}catch(f){console.warn("inlineExternal defs or symbol failed:",f)}try{r=yield qt(t,o,e,t)}catch(f){throw console.warn("deepClone failed:",f),f}try{yield $e(t,r,o,e)}catch(f){console.warn("inlinePseudoElements failed:",f)}yield go(r);try{let f=r.querySelectorAll("style[data-sd]");for(let d of f)a+=d.textContent||"",d.remove()}catch(f){}let l=we(o.styleMap);s=Array.from(l.entries()).map(([f,d])=>`.${d}{${f}}`).join(""),s=a+s;for(let[f,d]of o.styleMap.entries()){if(f.tagName==="STYLE")continue;if(f.getRootNode&&f.getRootNode()instanceof ShadowRoot){f.setAttribute("style",d.replace(/;/g,"; "));continue}let g=l.get(d);g&&f.classList.add(g);let w=(c=f.style)==null?void 0:c.backgroundImage,u=(h=f.dataset)==null?void 0:h.snapdomHasIcon;w&&w!=="none"&&(f.style.backgroundImage=w),u&&(f.style.verticalAlign="middle",f.style.display="inline")}for(let[f,d]of o.nodeMap.entries()){let g=d.scrollLeft,w=d.scrollTop;if((g||w)&&f instanceof HTMLElement){f.style.overflow="hidden",f.style.scrollbarWidth="none",f.style.msOverflowStyle="none";let m=document.createElement("div");for(m.style.transform=`translate(${-g}px, ${-w}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";f.firstChild;)m.appendChild(f.firstChild);f.appendChild(m)}}let i=r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r;if(Qe(t,i),t===o.nodeMap.get(r)){let f=o.styleCache.get(t)||window.getComputedStyle(t);o.styleCache.set(t,f);let d=de(f.transform);r.style.margin="0",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.animation="none",r.style.transition="none",r.style.willChange="auto",r.style.float="none",r.style.clear="none",r.style.transform=d||""}for(let[f,d]of o.nodeMap.entries())d.tagName==="PRE"&&(f.style.marginTop="0",f.style.marginBlockStart="0");return{clone:r,classCSS:s,styleCache:o.styleCache}})}function uo(t){let e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,r=e.borderStyle,s=e.borderWidth,a=n!=="none"&&parseFloat(o)>0,l=r==="none"||parseFloat(s)===0;a&&l&&(t.style.border=`${o} solid transparent`)}var Vt=new Map;function Xt(t){return v(this,null,function*(){var n;if((n=y.resource)!=null&&n.has(t))return y.resource.get(t);if(Vt.has(t))return Vt.get(t);let e=v(null,null,function*(){var r;let o=yield Z(t,{as:"dataURL",silent:!0});if(!o.ok||typeof o.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return(r=y.resource)==null||r.set(t,o.data),o.data});Vt.set(t,e);try{let o=yield e;return Vt.set(t,o),o}catch(o){throw Vt.delete(t),o}})}var mo=/\bblob:[^)"'\s]+/g;function Ze(t){return v(this,null,function*(){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(mo)||[]));if(e.length===0)return t;let n=t;for(let o of e)try{let r=yield Xt(o);n=n.split(o).join(r)}catch(r){}return n})}function re(t){return typeof t=="string"&&t.startsWith("blob:")}function ho(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 po(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function go(t){return v(this,null,function*(){var a,l;if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let i of e)try{let h=i.getAttribute("src")||i.currentSrc||"";if(re(h)){let d=yield Xt(h);i.setAttribute("src",d)}let f=i.getAttribute("srcset");if(f&&f.includes("blob:")){let d=ho(f),g=!1;for(let w of d)if(re(w.url))try{w.url=yield Xt(w.url),g=!0}catch(u){}g&&i.setAttribute("srcset",po(d))}}catch(c){}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let i of n)try{let c="http://www.w3.org/1999/xlink",h=i.getAttribute("href")||((a=i.getAttributeNS)==null?void 0:a.call(i,c,"href"));if(re(h)){let f=yield Xt(h);i.setAttribute("href",f),(l=i.removeAttributeNS)==null||l.call(i,c,"href")}}catch(c){}let o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let i of o)try{let c=i.getAttribute("style");if(c&&c.includes("blob:")){let h=yield Ze(c);i.setAttribute("style",h)}}catch(c){}let r=t.querySelectorAll?t.querySelectorAll("style"):[];for(let i of r)try{let c=i.textContent||"";c.includes("blob:")&&(i.textContent=yield Ze(c))}catch(c){}let s=["poster"];for(let i of s){let c=t.querySelectorAll?t.querySelectorAll(`[${i}^='blob:']`):[];for(let h of c)try{let f=h.getAttribute(i);re(f)&&h.setAttribute(i,yield Xt(f))}catch(f){}}})}function en(n){return v(this,arguments,function*(t,e={}){let o=Array.from(t.querySelectorAll("img")),r=s=>v(null,null,function*(){var f,d,g,w;if(!s.getAttribute("src")){let u=s.currentSrc||s.src||"";u&&s.setAttribute("src",u)}s.removeAttribute("srcset"),s.removeAttribute("sizes");let a=s.src||"";if(!a)return;let l=yield Z(a,{as:"dataURL",useProxy:e.useProxy});if(l.ok&&typeof l.data=="string"&&l.data.startsWith("data:")){s.src=l.data,s.width||(s.width=s.naturalWidth||100),s.height||(s.height=s.naturalHeight||100);return}let{fallbackURL:i}=e||{};if(i)try{let u=parseInt(((f=s.dataset)==null?void 0:f.snapdomWidth)||"",10)||0,m=parseInt(((d=s.dataset)==null?void 0:d.snapdomHeight)||"",10)||0,b=parseInt(s.getAttribute("width")||"",10)||0,k=parseInt(s.getAttribute("height")||"",10)||0,R=parseFloat(((g=s.style)==null?void 0:g.width)||"")||0,$=parseFloat(((w=s.style)==null?void 0:w.height)||"")||0,F=u||R||b||s.width||void 0,M=m||$||k||s.height||void 0,T=typeof i=="function"?yield i({width:F,height:M,src:a,element:s}):i;if(T){let A=yield Z(T,{as:"dataURL",useProxy:e.useProxy});s.src=A.data,!s.width&&F&&(s.width=F),!s.height&&M&&(s.height=M),s.width||(s.width=s.naturalWidth||100),s.height||(s.height=s.naturalHeight||100);return}}catch(u){}let c=s.width||s.naturalWidth||100,h=s.height||s.naturalHeight||100;if(e.placeholders!==!1){let u=document.createElement("div");u.style.cssText=[`width:${c}px`,`height:${h}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${h}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),u.textContent="img",s.replaceWith(u)}else{let u=document.createElement("div");u.style.cssText=`display:inline-block;width:${c}px;height:${h}px;visibility:hidden;`,s.replaceWith(u)}});for(let s=0;s<o.length;s+=4){let a=o.slice(s,s+4).map(r);yield Promise.allSettled(a)}})}function se(r,s,a){return v(this,arguments,function*(t,e,n,o={}){let l=[[t,e]],i=["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"],c=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],h=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;l.length;){let[f,d]=l.shift(),g=n.get(f)||It(f);n.has(f)||n.set(f,g);let w=(()=>{let b=g.getPropertyValue("border-image"),k=g.getPropertyValue("border-image-source");return b&&b!=="none"||k&&k!=="none"})();for(let b of i){let k=g.getPropertyValue(b);if(!k||k==="none")continue;let R=Tt(k),$=yield Promise.all(R.map(F=>Rt(F,o)));$.some(F=>F&&F!=="none"&&!/^url\(undefined/.test(F))&&d.style.setProperty(b,$.join(", "))}for(let b of c){let k=g.getPropertyValue(b);!k||k==="initial"||d.style.setProperty(b,k)}if(w)for(let b of h){let k=g.getPropertyValue(b);!k||k==="initial"||d.style.setProperty(b,k)}let u=Array.from(f.children),m=Array.from(d.children);for(let b=0;b<Math.min(u.length,m.length);b++)l.push([u[b],m[b]])}})}function nn(t){var c;if(!t)return()=>{};let e=yo(t);if(e<=0)return()=>{};if(!xo(t))return()=>{};let n=getComputedStyle(t),o=Math.round(wo(n)*e+bo(n)),r=(c=t.textContent)!=null?c:"",s=r;if(t.scrollHeight<=o+.5)return()=>{};let a=0,l=r.length,i=-1;for(;a<=l;){let h=a+l>>1;t.textContent=r.slice(0,h)+"\u2026",t.scrollHeight<=o+.5?(i=h,a=h+1):l=h-1}return t.textContent=(i>=0?r.slice(0,i):"")+"\u2026",()=>{t.textContent=s}}function yo(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let o=parseInt(n,10);return Number.isFinite(o)&&o>0?o:0}function wo(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 bo(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function xo(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}function Fe(t,e){return v(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");Yt(e.cache);let n=e.fast,o,r,s,a="",l="",i,c,h=nn(t);try{({clone:o,classCSS:r,styleCache:s}=yield tn(t,e))}finally{h()}yield new Promise(w=>{xt(()=>v(null,null,function*(){yield en(o,e),w()}),{fast:n})}),yield new Promise(w=>{xt(()=>v(null,null,function*(){yield se(t,o,s,e),w()}),{fast:n})}),e.embedFonts&&(yield new Promise(w=>{xt(()=>v(null,null,function*(){let u=ee(t),m=ne(t);if(tt()){let b=new Set(Array.from(u).map(k=>String(k).split("__")[0]).filter(Boolean));yield oe(b,2)}a=yield te({required:u,usedCodepoints:m,preCached:!1,exclude:e.excludeFonts,useProxy:e.useProxy}),w()}),{fast:n})}));let f=ge(o).sort(),d=f.join(",");y.baseStyle.has(d)?l=y.baseStyle.get(d):yield new Promise(w=>{xt(()=>{l=ye(f),y.baseStyle.set(d,l),w()},{fast:n})}),yield new Promise(w=>{xt(()=>{let u=getComputedStyle(t);function m(X){var Ct;let H=`${X.filter||""} ${X.webkitFilter||""}`.trim();if(!H||H==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let z=H.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],st=0,at=0,dt=0,ot=0,Ft=!1;for(let Pt of z){Ft=!0;let vt=((Ct=Pt.match(/-?\d+(?:\.\d+)?px/gi))==null?void 0:Ct.map(Mt=>parseFloat(Mt)))||[],[it=0,kt=0,ht=0]=vt,pt=Math.abs(it)+ht,gt=Math.abs(kt)+ht;at=Math.max(at,pt+Math.max(it,0)),ot=Math.max(ot,pt+Math.max(-it,0)),dt=Math.max(dt,gt+Math.max(kt,0)),st=Math.max(st,gt+Math.max(-kt,0))}return{bleed:{top:Math.ceil(st),right:Math.ceil(at),bottom:Math.ceil(dt),left:Math.ceil(ot)},has:Ft}}function b(X){var Ft;let H=X.boxShadow||"";if(!H||H==="none")return{top:0,right:0,bottom:0,left:0};let z=H.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(Ct=>Ct.trim()),st=0,at=0,dt=0,ot=0;for(let Ct of z){let Pt=((Ft=Ct.match(/-?\d+(\.\d+)?px/g))==null?void 0:Ft.map(Mt=>parseFloat(Mt)))||[];if(Pt.length<2)continue;let[vt,it,kt=0,ht=0]=Pt,pt=Math.abs(vt)+kt+ht,gt=Math.abs(it)+kt+ht;at=Math.max(at,pt+Math.max(vt,0)),ot=Math.max(ot,pt+Math.max(-vt,0)),dt=Math.max(dt,gt+Math.max(it,0)),st=Math.max(st,gt+Math.max(-it,0))}return{top:Math.ceil(st),right:Math.ceil(at),bottom:Math.ceil(dt),left:Math.ceil(ot)}}function k(X){let H=(X.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),z=H?Math.ceil(parseFloat(H[1])||0):0;return{top:z,right:z,bottom:z,left:z}}function R(X){if((X.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let H=Math.ceil(parseFloat(X.outlineWidth||"0")||0);return{top:H,right:H,bottom:H,left:H}}function $(X,H,z,st,at){let dt=z.a,ot=z.b,Ft=z.c,Ct=z.d,Pt=z.e||0,vt=z.f||0;function it(Ut,Bt){let Ne=Ut-st,Le=Bt-at,Re=dt*Ne+Ft*Le,Ie=ot*Ne+Ct*Le;return Re+=st+Pt,Ie+=at+vt,[Re,Ie]}let kt=[it(0,0),it(X,0),it(0,H),it(X,H)],ht=1/0,pt=1/0,gt=-1/0,Mt=-1/0;for(let[Ut,Bt]of kt)Ut<ht&&(ht=Ut),Bt<pt&&(pt=Bt),Ut>gt&&(gt=Ut),Bt>Mt&&(Mt=Bt);return{minX:ht,minY:pt,maxX:gt,maxY:Mt,width:gt-ht,height:Mt-pt}}function F(X){return ko(X)}let M=t.getBoundingClientRect(),T=Math.max(1,Math.ceil(t.offsetWidth||parseFloat(u.width)||M.width||1)),A=Math.max(1,Math.ceil(t.offsetHeight||parseFloat(u.height)||M.height||1)),P=(X,H=NaN)=>{let z=typeof X=="string"?parseFloat(X):X;return Number.isFinite(z)?z:H},V=P(e.width),rt=P(e.height),et=T,ct=A,lt=Number.isFinite(V),ft=Number.isFinite(rt),_t=A>0?T/A:1;lt&&ft?(et=Math.max(1,Math.ceil(V)),ct=Math.max(1,Math.ceil(rt))):lt?(et=Math.max(1,Math.ceil(V)),ct=Math.max(1,Math.ceil(et/(_t||1)))):ft?(ct=Math.max(1,Math.ceil(rt)),et=Math.max(1,Math.ceil(ct*(_t||1)))):(et=T,ct=A);let q=0,yt=0,St=T,Et=A;if(F(t)){let X=u.transform&&u.transform!=="none"?u.transform:"",H=Co(t),z=$o({baseTransform:X,rotate:H.rotate||"0deg",scale:H.scale,translate:H.translate}),{ox:st,oy:at}=Mo(u,T,A),dt=z.is2D?z:new DOMMatrix(z.toString()),ot=$(T,A,dt,st,at);q=ot.minX,yt=ot.minY,St=ot.maxX,Et=ot.maxY}let wt=b(u),B=k(u),j=R(u),K=m(u),G={top:wt.top+B.top+j.top+K.bleed.top,right:wt.right+B.right+j.right+K.bleed.right,bottom:wt.bottom+B.bottom+j.bottom+K.bleed.bottom,left:wt.left+B.left+j.left+K.bleed.left};q-=G.left,yt-=G.top,St+=G.right,Et+=G.bottom;let p=Math.max(1,Math.ceil(St-q)),x=Math.max(1,Math.ceil(Et-yt)),C=Math.max(1,Math.round(p*(lt||ft?et/T:1))),N=Math.max(1,Math.round(x*(ft||lt?ct/A:1))),S="http://www.w3.org/2000/svg",E=tt()?1:0,L=document.createElementNS(S,"foreignObject"),_=Math.floor(q),I=Math.floor(yt);L.setAttribute("x",String(-(_-E))),L.setAttribute("y",String(-(I-E))),L.setAttribute("width",String(Math.ceil(T+E*2))),L.setAttribute("height",String(Math.ceil(A+E*2))),L.style.overflow="visible";let U=document.createElement("style");U.textContent=l+a+"svg{overflow:visible;} foreignObject{overflow:visible;}"+r,L.appendChild(U);let W=document.createElement("div");W.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),W.style.width=`${T}px`,W.style.height=`${A}px`,W.style.overflow="visible",o.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),W.appendChild(o),L.appendChild(W);let D=new XMLSerializer().serializeToString(L),nt=p+E*2,ut=x+E*2,bt=lt||ft;e.meta={w0:T,h0:A,vbW:nt,vbH:ut,targetW:et,targetH:ct};let ce=tt()&&bt?nt:C+E*2,le=tt()&&bt?ut:N+E*2;c=`<svg xmlns="${S}" width="${ce}" height="${le}" viewBox="0 0 ${nt} ${ut}">`+D+"</svg>",i=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,w()},{fast:n})});let g=document.getElementById("snapdom-sandbox");return g&&g.style.position==="absolute"&&g.remove(),i})}function So(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch(n){return new WebKitCSSMatrix(e)}}function Co(t){var r,s,a,l,i,c,h,f;let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let d=m=>{try{return typeof n.has=="function"&&!n.has(m)||typeof n.get!="function"?null:n.get(m)}catch(b){return null}},g=d("rotate");if(g)if(g.angle){let m=g.angle;e.rotate=m.unit==="rad"?m.value*180/Math.PI+"deg":m.value+m.unit}else g.unit?e.rotate=g.unit==="rad"?g.value*180/Math.PI+"deg":g.value+g.unit:e.rotate=String(g);else{let m=getComputedStyle(t);e.rotate=m.rotate&&m.rotate!=="none"?m.rotate:"0deg"}let w=d("scale");if(w){let m="x"in w&&((r=w.x)==null?void 0:r.value)!=null?w.x.value:Array.isArray(w)?(s=w[0])==null?void 0:s.value:Number(w)||1,b="y"in w&&((a=w.y)==null?void 0:a.value)!=null?w.y.value:Array.isArray(w)?(l=w[1])==null?void 0:l.value:m;e.scale=`${m} ${b}`}else{let m=getComputedStyle(t);e.scale=m.scale&&m.scale!=="none"?m.scale:null}let u=d("translate");if(u){let m="x"in u&&"value"in u.x?u.x.value:Array.isArray(u)?(i=u[0])==null?void 0:i.value:0,b="y"in u&&"value"in u.y?u.y.value:Array.isArray(u)?(c=u[1])==null?void 0:c.value:0,k="x"in u&&((h=u.x)!=null&&h.unit)?u.x.unit:"px",R="y"in u&&((f=u.y)!=null&&f.unit)?u.y.unit:"px";e.translate=`${m}${k} ${b}${R}`}else{let m=getComputedStyle(t);e.translate=m.translate&&m.translate!=="none"?m.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}function ko(t){let e=getComputedStyle(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",a=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(r||s||a)}function Mo(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[r,s]=[o[0]||"0",o[1]||"0"],a=(l,i)=>{let c=l.toLowerCase();return c==="left"||c==="top"?0:c==="center"?i/2:c==="right"||c==="bottom"?i:c.endsWith("px")?parseFloat(c)||0:c.endsWith("%")?(parseFloat(c)||0)*i/100:/^-?\d+(\.\d+)?$/.test(c)&&parseFloat(c)||0};return{ox:a(r,e),oy:a(s,n)}}var Ee=null;function Ao(){if(Ee)return Ee;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),Ee=t,t}function $o(t){let e=Ao(),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=So(n);return e.removeChild(n),o}function Eo(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function on(t={}){var o,r,s,a,l,i,c,h,f,d,g,w,u,m,b,k,R,$;let e=(o=t.format)!=null?o:"png",n=Eo(t.cache);return{debug:(r=t.debug)!=null?r:!1,fast:(s=t.fast)!=null?s:!0,scale:(a=t.scale)!=null?a:1,exclude:(l=t.exclude)!=null?l:[],excludeMode:(i=t.excludeMode)!=null?i:"hide",filter:(c=t.filter)!=null?c:null,filterMode:(h=t.filterMode)!=null?h:"hide",placeholders:t.placeholders!==!1,embedFonts:(f=t.embedFonts)!=null?f:!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:(d=t.excludeFonts)!=null?d:void 0,fallbackURL:(g=t.fallbackURL)!=null?g:void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:(w=t.width)!=null?w:null,height:(u=t.height)!=null?u:null,format:e,type:(m=t.type)!=null?m:"svg",quality:(b=t.quality)!=null?b:.92,dpr:(k=t.dpr)!=null?k:window.devicePixelRatio||1,backgroundColor:(R=t.backgroundColor)!=null?R:["jpg","jpeg","webp"].includes(e)?"#ffffff":null,filename:($=t.filename)!=null?$:"snapDOM"}}function Fo(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function vo(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function No(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Lo(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 Ro(t){let e=[],n="",o=0;for(let s=0;s<t.length;s++){let a=t[s];a==="("&&o++,a===")"&&(o=Math.max(0,o-1)),a===","&&o===0?(e.push(n.trim()),n=""):n+=a}n.trim()&&e.push(n.trim());let r=[];for(let s of e){if(/\binset\b/i.test(s))continue;let a=s.match(/-?\d+(?:\.\d+)?px/gi)||[],[l="0px",i="0px",c="0px"]=a,h=s.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!h&&h!==",";r.push(`drop-shadow(${l} ${i} ${c}${f?` ${h}`:""})`)}return r.join(" ")}function rn(t){let e=Lo(t),n=null,o=null,r=null,s=[];for(let l of e){let i=l.indexOf(":");if(i<0)continue;let c=l.slice(0,i).trim().toLowerCase(),h=l.slice(i+1).trim();c==="box-shadow"?r=h:c==="filter"?n=h:c==="-webkit-filter"?o=h:s.push([c,h])}if(r){let l=Ro(r);l&&(n=n?`${n} ${l}`:l,o=o?`${o} ${l}`:l)}let a=[...s];return n&&a.push(["filter",n]),o&&a.push(["-webkit-filter",o]),a.map(([l,i])=>`${l}:${i}`).join(";")}function Io(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${rn(o)}}`)}function To(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,Io(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${rn(o)}${n}`),t}function Wo(t){if(!tt()||!Fo(t))return t;try{let e=vo(t),n=To(e);return No(n)}catch(e){return t}}function $t(t,e){return v(this,null,function*(){let{width:n,height:o,scale:r=1,dpr:s=1,meta:a={}}=e;t=Wo(t);let l=new Image;l.loading="eager",l.decoding="sync",l.crossOrigin="anonymous",l.src=t,yield l.decode();let i=l.naturalWidth,c=l.naturalHeight,h=Number.isFinite(a.w0)?a.w0:i,f=Number.isFinite(a.h0)?a.h0:c,d,g,w=Number.isFinite(n),u=Number.isFinite(o);if(w&&u)d=Math.max(1,n),g=Math.max(1,o);else if(w){let k=n/Math.max(1,h);d=n,g=Math.round(f*k)}else if(u){let k=o/Math.max(1,f);g=o,d=Math.round(h*k)}else d=i,g=c;d=Math.round(d*r),g=Math.round(g*r);let m=document.createElement("canvas");m.width=Math.ceil(d*s),m.height=Math.ceil(g*s),m.style.width=`${d}px`,m.style.height=`${g}px`;let b=m.getContext("2d");return s!==1&&b.scale(s,s),b.drawImage(l,0,0,d,g),m})}function ae(t,e){return v(this,null,function*(){let n=yield $t(t,e),o=e.backgroundColor?Lt(n,e.backgroundColor):n,r=new Image;return r.src=o.toDataURL(`image/${e.format}`,e.quality),yield r.decode(),r.style.width=`${o.width/e.dpr}px`,r.style.height=`${o.height/e.dpr}px`,r})}function sn(t,e){return v(this,null,function*(){let{scale:n=1,width:o,height:r,meta:s={}}=e,a=Number.isFinite(o),l=Number.isFinite(r),i=Number.isFinite(n)&&n!==1||a||l;if(tt()&&i)return yield ae(t,Q(J({},e),{format:"png",quality:1,meta:s}));let c=new Image;if(c.decoding="sync",c.loading="eager",c.src=t,yield c.decode(),a&&l)c.style.width=`${o}px`,c.style.height=`${r}px`;else if(a){let h=Number.isFinite(s.w0)?s.w0:c.naturalWidth,f=Number.isFinite(s.h0)?s.h0:c.naturalHeight,d=o/Math.max(1,h);c.style.width=`${o}px`,c.style.height=`${Math.round(f*d)}px`}else if(l){let h=Number.isFinite(s.w0)?s.w0:c.naturalWidth,f=Number.isFinite(s.h0)?s.h0:c.naturalHeight,d=r/Math.max(1,f);c.style.height=`${r}px`,c.style.width=`${Math.round(h*d)}px`}else n!==1&&(c.style.width=`${Math.round(c.naturalWidth*n)}px`,c.style.height=`${Math.round(c.naturalHeight*n)}px`);return c})}function ie(t,e){return v(this,null,function*(){let n=e.type;if(n==="svg"){let s=decodeURIComponent(t.split(",")[1]);return new Blob([s],{type:"image/svg+xml"})}let o=yield $t(t,e),r=e.backgroundColor?Lt(o,e.backgroundColor):o;return new Promise(s=>r.toBlob(a=>s(a),`image/${n}`,e.quality))})}function an(t,e){return v(this,null,function*(){if(e.dpr=1,e.format==="svg"){let s=yield ie(t,Q(J({},e),{type:"svg"})),a=URL.createObjectURL(s),l=document.createElement("a");l.href=a,l.download=e.filename,l.click(),URL.revokeObjectURL(a);return}let n=yield $t(t,e),o=e.backgroundColor?Lt(n,e.backgroundColor):n,r=document.createElement("a");r.href=o.toDataURL(`image/${e.format}`,e.quality),r.download=e.filename,r.click()})}var cn=Symbol("snapdom.internal"),ve=!1;function Y(t,e){return v(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");let n=on(e);if(tt()&&(n.embedFonts===!0||Po(t)))for(let o=0;o<3;o++)try{yield _o(t,e),console.log("Iteraci\xF3n n\xFAmero:",o),ve=!1}catch(r){}return n.iconFonts&&n.iconFonts.length>0&&De(n.iconFonts),n.snap||(n.snap={toPng:(o,r)=>Y.toPng(o,r),toImg:(o,r)=>Y.toImg(o,r)}),Y.capture(t,n,cn)})}Y.capture=(t,e,n)=>v(null,null,function*(){if(n!==cn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let o=yield Fe(t,e),r=a=>J(J({},e),a||{}),s=a=>l=>{let i=r(Q(J({},l||{}),{format:a})),c=a==="jpeg"||a==="jpg",h=i.backgroundColor==null||i.backgroundColor==="transparent";return c&&h&&(i.backgroundColor="#ffffff"),ae(o,i)};return{url:o,toRaw:()=>o,toImg:a=>sn(o,r(a)),toCanvas:a=>$t(o,r(a)),toBlob:a=>ie(o,r(a)),toPng:s("png"),toJpg:s("jpeg"),toWebp:s("webp"),download:a=>an(o,r(a))}});Y.toRaw=(t,e)=>Y(t,e).then(n=>n.toRaw());Y.toImg=(t,e)=>Y(t,e).then(n=>n.toImg());Y.toCanvas=(t,e)=>Y(t,e).then(n=>n.toCanvas());Y.toBlob=(t,e)=>Y(t,e).then(n=>n.toBlob());Y.toPng=(t,e)=>Y(t,Q(J({},e),{format:"png"})).then(n=>n.toPng());Y.toJpg=(t,e)=>Y(t,Q(J({},e),{format:"jpeg"})).then(n=>n.toJpg());Y.toWebp=(t,e)=>Y(t,Q(J({},e),{format:"webp"})).then(n=>n.toWebp());Y.download=(t,e)=>Y(t,e).then(n=>n.download());function _o(t,e){return v(this,null,function*(){if(ve)return;let n=Q(J({},e),{fast:!0,embedFonts:!0,scale:.2}),o;try{o=yield Fe(t,n)}catch(r){return}yield new Promise(r=>{let s=new Image;s.decoding="sync",s.loading="eager",s.style.position="fixed",s.style.left=0,s.style.top=0,s.style.width="10px",s.style.height="10px",s.style.opacity="0.01",s.style.transform="translateZ(10px)",s.style.willChange="transform,opacity;",s.src=o;let a=()=>v(null,null,function*(){yield new Promise(l=>setTimeout(l,100)),s&&s.parentNode&&s.parentNode.removeChild(s),ve=!0,r()});document.body.appendChild(s),a()})})}function Po(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,o=getComputedStyle(n),r=o.backgroundImage&&o.backgroundImage!=="none",s=o.maskImage&&o.maskImage!=="none"||o.webkitMaskImage&&o.webkitMaskImage!=="none";if(r||s)return!0}return!1}function ln(){return v(this,arguments,function*(t=document,e={}){var i,c,h,f;let{embedFonts:n=!0,useProxy:o=""}=e,r=(c=(i=e.cache)!=null?i:e.cacheOpt)!=null?c:"full";Yt(r);try{yield(h=document.fonts)==null?void 0:h.ready}catch(d){}try{he()}catch(d){}y.session=y.session||{},y.session.styleCache||(y.session.styleCache=new WeakMap),y.image=y.image||new Map;try{yield se(t,void 0,y.session.styleCache,{useProxy:o})}catch(d){}let s=[],a=[];try{t!=null&&t.querySelectorAll&&(s=Array.from(t.querySelectorAll("img[src]")),a=Array.from(t.querySelectorAll("*")))}catch(d){}let l=[];for(let d of s){let g=(d==null?void 0:d.currentSrc)||(d==null?void 0:d.src);if(g&&!y.image.has(g)){let w=Promise.resolve().then(()=>v(null,null,function*(){let u=yield Z(g,{as:"dataURL",useProxy:o});u!=null&&u.ok&&typeof u.data=="string"&&y.image.set(g,u.data)})).catch(()=>{});l.push(w)}}for(let d of a){let g="";try{g=It(d).backgroundImage}catch(w){}if(g&&g!=="none"){let w=Tt(g);for(let u of w)if(u.startsWith("url(")){let m=Promise.resolve().then(()=>Rt(u,Q(J({},e),{useProxy:o}))).catch(()=>{});l.push(m)}}}if(n)try{let d=ee(t),g=ne(t);if(typeof tt=="function"?tt():!!tt){let u=new Set(Array.from(d).map(m=>String(m).split("__")[0]).filter(Boolean));yield oe(u,2)}yield te({required:d,usedCodepoints:g,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:(f=e.useProxy)!=null?f:o})}catch(d){}yield Promise.allSettled(l)})}typeof window!="undefined"&&(window.snapdom=Y,window.preCache=ln);})();
@@ -1,5 +1,5 @@
1
- var h={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function _t(t="soft"){switch(t){case"auto":{h.session.styleMap=new Map,h.session.nodeMap=new Map;return}case"soft":{h.session.styleMap=new Map,h.session.nodeMap=new Map,h.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{h.session.styleMap=new Map,h.session.nodeMap=new Map,h.session.styleCache=new WeakMap,h.computedStyle=new WeakMap,h.baseStyle=new Map,h.defaultStyle=new Map,h.image=new Map,h.background=new Map,h.resource=new Map,h.font=new Set;return}default:{h.session.styleMap=new Map,h.session.nodeMap=new Map,h.session.styleCache=new WeakMap;return}}}function ht(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Zt(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 ut(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function Qe(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function s(a,i,l){if(r>=n)return;let c=Date.now();(o.get(i)||0)>c||(o.set(i,c+e),r++,a==="warn"&&console&&console.warn?console.warn(`${t} ${l}`):console&&console.error&&console.error(`${t} ${l}`))}return{warnOnce(a,i){s("warn",a,i)},errorOnce(a,i){s("error",a,i)},reset(){o.clear(),r=0}}}var ke=Qe("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),te=new Map,Pt=new Map;function Ze(t){return/^data:|^blob:|^about:blank$/i.test(t)}function tn(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 a=s.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function en(t,e){if(!e||Ze(t)||tn(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 nn(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",ut(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${ut(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Me(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 on(t,e){return[e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,t].join("|")}async function V(t,e={}){let n=e.as??"blob",o=e.timeout??3e3,r=e.useProxy||"",s=e.errorTTL??8e3,a=e.headers||{},i=!!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="",k=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],F=/;base64/i.test(g)?atob(k):decodeURIComponent(k),W=new Uint8Array([...F].map(O=>O.charCodeAt(0))),X=new Blob([W],{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 k=await g.blob(),C=k.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Me(k),status:g.status,url:t,fromCache:!1,mime:C}:n==="text"?{ok:!0,data:await k.text(),status:g.status,url:t,fromCache:!1,mime:C}:{ok:!0,data:k,status:g.status,url:t,fromCache:!1,mime:C}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let l=on(t,{as:n,timeout:o,useProxy:r,errorTTL:s}),c=Pt.get(l);if(c&&c.until>Date.now())return{...c.result,fromCache:!0};c&&Pt.delete(l);let u=te.get(l);if(u)return u;let f=en(t,r)?nn(t,r):t,m=e.credentials;if(!m)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",k=new URL(t,g);m=typeof location<"u"&&k.origin===location.origin?"include":"omit"}catch{m="omit"}let A=new AbortController,S=setTimeout(()=>A.abort("timeout"),o),x=(async()=>{try{let g=await fetch(f,{signal:A.signal,credentials:m,headers:a});if(!g.ok){let F={ok:!1,data:null,status:g.status,url:f,fromCache:!1,reason:"http_error"};if(s>0&&Pt.set(l,{until:Date.now()+s,result:F}),!i){let W=`${g.status} ${g.statusText||""}`.trim();ke.warnOnce(`http:${g.status}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,`HTTP error ${W} while fetching ${n} ${t}`)}return e.onError&&e.onError(F),F}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:f,fromCache:!1};let k=await g.blob(),C=k.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Me(k),status:g.status,url:f,fromCache:!1,mime:C}:{ok:!0,data:k,status:g.status,url:f,fromCache:!1,mime:C}}catch(g){let k=g&&typeof g=="object"&&"name"in g&&g.name==="AbortError"?String(g.message||"").includes("timeout")?"timeout":"abort":"network",C={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:k};if(!/^blob:/i.test(t)&&s>0&&Pt.set(l,{until:Date.now()+s,result:C}),!i){let F=`${k}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,W=k==="timeout"?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:k==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;ke.errorOnce(F,W)}return e.onError&&e.onError(C),C}finally{clearTimeout(S),te.delete(l)}})();return te.set(l,x),x}function pt(t,e){if(!e||!t.width||!t.height)return t;let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let o=n.getContext("2d");return o.fillStyle=e,o.fillRect(0,0,n.width,n.height),o.drawImage(t,0,0),n}async function gt(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=ht(t);if(!o)return t;let r=ut(o);if(h.background.has(r)){let s=h.background.get(r);return s?`url("${s}")`:"none"}try{let s=await V(r,{as:"dataURL",useProxy:e.useProxy});return s.ok?(h.background.set(r,s.data),`url("${s.data}")`):(h.background.set(r,null),"none")}catch{return h.background.set(r,null),"none"}}var Ut=new Set(["meta","script","noscript","title","link","template"]),At=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),rn=["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"];function ee(){for(let t of rn){let e=String(t).toLowerCase();Ut.has(e)||At.has(e)||ne(e)}}function ne(t){if(t=String(t).toLowerCase(),At.has(t)){let s={};return h.defaultStyle.set(t,s),s}if(h.defaultStyle.has(t))return h.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(Ae(s))continue;let a=o.getPropertyValue(s);r[s]=a}return e.removeChild(n),h.defaultStyle.set(t,r),r}var an=/(?:^|-)(animation|transition)(?:-|$)/i,sn=/^(--|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,cn=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"]);function Ae(t){let e=String(t).toLowerCase();return!!(cn.has(e)||sn.test(e)||an.test(e))}function $t(t,e){if(e=String(e||"").toLowerCase(),At.has(e))return"";let n=[],o=ne(e);for(let[r,s]of Object.entries(t)){if(Ae(r))continue;let a=o[r];s&&s!==a&&n.push(`${r}:${s}`)}return n.sort(),n.join(";")}function oe(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 re(t){let e=new Map;for(let o of t){let r=h.defaultStyle.get(o);if(!r)continue;let s=Object.entries(r).map(([a,i])=>`${a}:${i};`).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} }
2
- `;return n}function ae(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 yt(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=h.computedStyle.get(t);if(n||(n=new Map,h.computedStyle.set(t,n)),!n.has(e)){let o=window.getComputedStyle(t,e);n.set(e,o)}return n.get(e)}function Bt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function wt(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}function st(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function z(){let t=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent:"",e=/^((?!chrome|android).)*safari/i.test(t),n=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(t);return e||n}var $e=new WeakMap,se=new Map,ie=0;function Et(){ie++}var Ee=!1;function ln(t=document.documentElement){if(!Ee){Ee=!0;try{new MutationObserver(()=>Et()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>Et()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let e=document.fonts;e&&(e.addEventListener?.("loadingdone",Et),e.ready?.then(()=>Et()).catch(()=>{}))}catch{}}}function un(t,e={}){let n={},o=t.getPropertyValue("visibility");for(let r=0;r<t.length;r++){let s=t[r],a=t.getPropertyValue(s);(s==="background-image"||s==="content")&&a.includes("url(")&&!a.includes("data:")&&(a="none"),n[s]=a}if(e.embedFonts){let r=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let s of r)if(!n[s])try{let a=t.getPropertyValue(s);a&&(n[s]=a)}catch{}}return o==="hidden"&&(n.opacity="0"),n}var Fe=new WeakMap;function fn(t){let e=Fe.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(";"),Fe.set(t,e),e)}function dn(t,e=null,n={}){let o=$e.get(t);if(o&&o.epoch===ie)return o.snapshot;let r=e||getComputedStyle(t),s=un(r,n);return wn(t,r,s),$e.set(t,{epoch:ie,snapshot:s}),s}function mn(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:se,defaultStyle:h.defaultStyle,baseStyle:h.baseStyle,image:h.image,resource:h.resource,background:h.background,font:h.font},options:e||{}}:{session:h.session,persist:{snapshotKeyCache:se,defaultStyle:h.defaultStyle,baseStyle:h.baseStyle,image:h.image,resource:h.resource,background:h.background,font:h.font},options:t||e||{}}}async function bt(t,e,n,o){if(t.tagName==="STYLE")return;let r=mn(n,o),s=r.options&&r.options.cache||"auto";if(s!=="disabled"&&ln(document.documentElement),s==="disabled"&&!r.session.__bumpedForDisabled&&(Et(),se.clear(),r.session.__bumpedForDisabled=!0),At.has(t.tagName?.toLowerCase())){let m=t.getAttribute?.("style");m&&e.setAttribute("style",m)}let{session:a,persist:i}=r;a.styleCache.has(t)||a.styleCache.set(t,getComputedStyle(t));let l=a.styleCache.get(t),c=dn(t,l,r.options),u=fn(c),f=i.snapshotKeyCache.get(u);if(!f){let m=t.tagName?.toLowerCase()||"div";f=$t(c,m),i.snapshotKeyCache.set(u,f)}a.styleMap.set(e,f)}function hn(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function pn(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 gn(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function yn(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,o=t.lastElementChild;if(n&&n.tagName==="BR"||o&&o.tagName==="BR")return!0;let r=t.scrollHeight;if(r===0)return!1;let s=parseFloat(e.paddingTop)||0,a=parseFloat(e.paddingBottom)||0;return r>s+a}function wn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let o=e.display||"";if(o.includes("flex")||o.includes("grid")||hn(t))return;let r=e.position;r==="absolute"||r==="fixed"||r==="sticky"||e.transform==="none"&&(pn(e)||gn(t)||yn(t,e)&&(delete n.height,delete n["block-size"]))}function ce(t,e,n){return Promise.all(t.map(o=>new Promise(r=>{function s(){st(a=>{(a&&typeof a.timeRemaining=="function"?a.timeRemaining()>0:!0)?e(o,r):s()},{fast:n})}s()})))}function bn(t){return t=t.trim(),!t||/\:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function xn(t,e,n=!0){return t.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let r=n?bn(o):o;return`:where(${e} ${r})`}).join(", ")}function Sn(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${e}:is(${o.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${e} ${o.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,r,s)=>{let a=xn(s,e,!0);return`${o}${r}${a}{`}),t):""}function Cn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function kn(t){let e="";try{t.querySelectorAll("style").forEach(o=>{e+=(o.textContent||"")+`
1
+ var h={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function _t(t="soft"){switch(t){case"auto":{h.session.styleMap=new Map,h.session.nodeMap=new Map;return}case"soft":{h.session.styleMap=new Map,h.session.nodeMap=new Map,h.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{h.session.styleMap=new Map,h.session.nodeMap=new Map,h.session.styleCache=new WeakMap,h.computedStyle=new WeakMap,h.baseStyle=new Map,h.defaultStyle=new Map,h.image=new Map,h.background=new Map,h.resource=new Map,h.font=new Set;return}default:{h.session.styleMap=new Map,h.session.nodeMap=new Map,h.session.styleCache=new WeakMap;return}}}function ht(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Zt(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(a=>a.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(a=>a.trim());return r.length!==16?`matrix3d(${o})`:(r[12]="0",r[13]="0",`matrix3d(${r.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function ut(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch{return t}}function tn(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let o=new Map,r=0;function a(s,l,c){if(r>=n)return;let i=Date.now();(o.get(l)||0)>i||(o.set(l,i+e),r++,s==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(s,l){a("warn",s,l)},errorOnce(s,l){a("error",s,l)},reset(){o.clear(),r=0}}}var ke=tn("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),te=new Map,Pt=new Map;function en(t){return/^data:|^blob:|^about:blank$/i.test(t)}function nn(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),a=new URL(t,n);if(a.origin===r.origin)return!0;let s=a.searchParams;if(s&&(s.has("url")||s.has("target")))return!0}catch{}return!1}function on(t,e){if(!e||en(t)||nn(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 rn(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",ut(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${ut(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function Me(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 sn(t,e){return[e.as||"blob",e.timeout??3e3,e.useProxy||"",e.errorTTL??8e3,t].join("|")}async function V(t,e={}){let n=e.as??"blob",o=e.timeout??3e3,r=e.useProxy||"",a=e.errorTTL??8e3,s=e.headers||{},l=!!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[,p="",M=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],E=/;base64/i.test(p)?atob(M):decodeURIComponent(M),W=new Uint8Array([...E].map(B=>B.charCodeAt(0))),z=new Blob([W],{type:(p||"").split(";")[0]||""});return{ok:!0,data:z,status:200,url:t,fromCache:!1,mime:z.type||""}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let p=await fetch(t);if(!p.ok)return{ok:!1,data:null,status:p.status,url:t,fromCache:!1,reason:"http_error"};let M=await p.blob(),k=M.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Me(M),status:p.status,url:t,fromCache:!1,mime:k}:n==="text"?{ok:!0,data:await M.text(),status:p.status,url:t,fromCache:!1,mime:k}:{ok:!0,data:M,status:p.status,url:t,fromCache:!1,mime:k}}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=sn(t,{as:n,timeout:o,useProxy:r,errorTTL:a}),i=Pt.get(c);if(i&&i.until>Date.now())return{...i.result,fromCache:!0};i&&Pt.delete(c);let u=te.get(c);if(u)return u;let f=on(t,r)?rn(t,r):t,m=e.credentials;if(!m)try{let p=typeof location<"u"&&location.href?location.href:"http://localhost/",M=new URL(t,p);m=typeof location<"u"&&M.origin===location.origin?"include":"omit"}catch{m="omit"}let x=new AbortController,C=setTimeout(()=>x.abort("timeout"),o),S=(async()=>{try{let p=await fetch(f,{signal:x.signal,credentials:m,headers:s});if(!p.ok){let E={ok:!1,data:null,status:p.status,url:f,fromCache:!1,reason:"http_error"};if(a>0&&Pt.set(c,{until:Date.now()+a,result:E}),!l){let W=`${p.status} ${p.statusText||""}`.trim();ke.warnOnce(`http:${p.status}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,`HTTP error ${W} while fetching ${n} ${t}`)}return e.onError&&e.onError(E),E}if(n==="text")return{ok:!0,data:await p.text(),status:p.status,url:f,fromCache:!1};let M=await p.blob(),k=M.type||p.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await Me(M),status:p.status,url:f,fromCache:!1,mime:k}:{ok:!0,data:M,status:p.status,url:f,fromCache:!1,mime:k}}catch(p){let M=p&&typeof p=="object"&&"name"in p&&p.name==="AbortError"?String(p.message||"").includes("timeout")?"timeout":"abort":"network",k={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:M};if(!/^blob:/i.test(t)&&a>0&&Pt.set(c,{until:Date.now()+a,result:k}),!l){let E=`${M}:${n}:${new URL(t,location?.href??"http://localhost/").origin}`,W=M==="timeout"?`Timeout after ${o}ms. Consider increasing timeout or using a proxy for ${t}`:M==="abort"?`Request aborted while fetching ${n} ${t}`:`Network/CORS issue while fetching ${n} ${t}. A proxy may be required`;ke.errorOnce(E,W)}return e.onError&&e.onError(k),k}finally{clearTimeout(C),te.delete(c)}})();return te.set(c,S),S}function pt(t,e){if(!e||!t.width||!t.height)return t;let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let o=n.getContext("2d");return o.fillStyle=e,o.fillRect(0,0,n.width,n.height),o.drawImage(t,0,0),n}async function gt(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let o=ht(t);if(!o)return t;let r=ut(o);if(h.background.has(r)){let a=h.background.get(r);return a?`url("${a}")`:"none"}try{let a=await V(r,{as:"dataURL",useProxy:e.useProxy});return a.ok?(h.background.set(r,a.data),`url("${a.data}")`):(h.background.set(r,null),"none")}catch{return h.background.set(r,null),"none"}}var Ut=new Set(["meta","script","noscript","title","link","template"]),At=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),an=["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"];function ee(){for(let t of an){let e=String(t).toLowerCase();Ut.has(e)||At.has(e)||ne(e)}}function ne(t){if(t=String(t).toLowerCase(),At.has(t)){let a={};return h.defaultStyle.set(t,a),a}if(h.defaultStyle.has(t))return h.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 a of o){if(Ae(a))continue;let s=o.getPropertyValue(a);r[a]=s}return e.removeChild(n),h.defaultStyle.set(t,r),r}var cn=/(?:^|-)(animation|transition)(?:-|$)/i,ln=/^(--|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,un=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"]);function Ae(t){let e=String(t).toLowerCase();return!!(un.has(e)||ln.test(e)||cn.test(e))}function $t(t,e){if(e=String(e||"").toLowerCase(),At.has(e))return"";let n=[],o=ne(e);for(let[r,a]of Object.entries(t)){if(Ae(r))continue;let s=o[r];a&&a!==s&&n.push(`${r}:${a}`)}return n.sort(),n.join(";")}function oe(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 re(t){let e=new Map;for(let o of t){let r=h.defaultStyle.get(o);if(!r)continue;let a=Object.entries(r).map(([s,l])=>`${s}:${l};`).sort().join("");a&&(e.has(a)||e.set(a,[]),e.get(a).push(o))}let n="";for(let[o,r]of e.entries())n+=`${r.join(",")} { ${o} }
2
+ `;return n}function se(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 yt(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=h.computedStyle.get(t);if(n||(n=new Map,h.computedStyle.set(t,n)),!n.has(e)){let o=window.getComputedStyle(t,e);n.set(e,o)}return n.get(e)}function Bt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function wt(t){let e=[],n=0,o=0;for(let r=0;r<t.length;r++){let a=t[r];a==="("&&n++,a===")"&&n--,a===","&&n===0&&(e.push(t.slice(o,r).trim()),o=r+1)}return e.push(t.slice(o).trim()),e}function at(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function X(){let t=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent:"",e=/^((?!chrome|android).)*safari/i.test(t),n=/AppleWebKit/i.test(t)&&/Mobile/i.test(t)&&!/Safari/i.test(t),o=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(t);return e||n||o}var $e=new WeakMap,ae=new Map,ie=0;function Et(){ie++}var Ee=!1;function fn(t=document.documentElement){if(!Ee){Ee=!0;try{new MutationObserver(()=>Et()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>Et()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let e=document.fonts;e&&(e.addEventListener?.("loadingdone",Et),e.ready?.then(()=>Et()).catch(()=>{}))}catch{}}}function dn(t,e={}){let n={},o=t.getPropertyValue("visibility");for(let r=0;r<t.length;r++){let a=t[r],s=t.getPropertyValue(a);(a==="background-image"||a==="content")&&s.includes("url(")&&!s.includes("data:")&&(s="none"),n[a]=s}if(e.embedFonts){let r=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let a of r)if(!n[a])try{let s=t.getPropertyValue(a);s&&(n[a]=s)}catch{}}return o==="hidden"&&(n.opacity="0"),n}var Fe=new WeakMap;function mn(t){let e=Fe.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(";"),Fe.set(t,e),e)}function hn(t,e=null,n={}){let o=$e.get(t);if(o&&o.epoch===ie)return o.snapshot;let r=e||getComputedStyle(t),a=dn(r,n);return xn(t,r,a),$e.set(t,{epoch:ie,snapshot:a}),a}function pn(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:ae,defaultStyle:h.defaultStyle,baseStyle:h.baseStyle,image:h.image,resource:h.resource,background:h.background,font:h.font},options:e||{}}:{session:h.session,persist:{snapshotKeyCache:ae,defaultStyle:h.defaultStyle,baseStyle:h.baseStyle,image:h.image,resource:h.resource,background:h.background,font:h.font},options:t||e||{}}}async function bt(t,e,n,o){if(t.tagName==="STYLE")return;let r=pn(n,o),a=r.options&&r.options.cache||"auto";if(a!=="disabled"&&fn(document.documentElement),a==="disabled"&&!r.session.__bumpedForDisabled&&(Et(),ae.clear(),r.session.__bumpedForDisabled=!0),At.has(t.tagName?.toLowerCase())){let m=t.getAttribute?.("style");m&&e.setAttribute("style",m)}let{session:s,persist:l}=r;s.styleCache.has(t)||s.styleCache.set(t,getComputedStyle(t));let c=s.styleCache.get(t),i=hn(t,c,r.options),u=mn(i),f=l.snapshotKeyCache.get(u);if(!f){let m=t.tagName?.toLowerCase()||"div";f=$t(i,m),l.snapshotKeyCache.set(u,f)}s.styleMap.set(e,f)}function gn(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function yn(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 wn(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function bn(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,o=t.lastElementChild;if(n&&n.tagName==="BR"||o&&o.tagName==="BR")return!0;let r=t.scrollHeight;if(r===0)return!1;let a=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingBottom)||0;return r>a+s}function xn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let o=e.display||"";if(o.includes("flex")||o.includes("grid")||gn(t))return;let r=e.position;r==="absolute"||r==="fixed"||r==="sticky"||e.transform==="none"&&(yn(e)||wn(t)||bn(t,e)&&(delete n.height,delete n["block-size"]))}function ce(t,e,n){return Promise.all(t.map(o=>new Promise(r=>{function a(){at(s=>{(s&&typeof s.timeRemaining=="function"?s.timeRemaining()>0:!0)?e(o,r):a()},{fast:n})}a()})))}function Sn(t){return t=t.trim(),!t||/\:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function Cn(t,e,n=!0){return t.split(",").map(o=>o.trim()).filter(Boolean).map(o=>{if(o.startsWith(":where(")||o.startsWith("@"))return o;let r=n?Sn(o):o;return`:where(${e} ${r})`}).join(", ")}function kn(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,o)=>`:where(${e}:is(${o.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,o)=>`:where(:where(${o.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,o)=>`:where(${e} ${o.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,o,r,a)=>{let s=Cn(a,e,!0);return`${o}${r}${s}{`}),t):""}function Mn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function An(t){let e="";try{t.querySelectorAll("style").forEach(o=>{e+=(o.textContent||"")+`
3
3
  `});let n=t.adoptedStyleSheets||[];for(let o of n)try{if(o&&o.cssRules)for(let r of o.cssRules)e+=r.cssText+`
4
- `}catch{}}catch{}return e}function Mn(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function An(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function $n(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function En(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch{}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch{}return""}function Fn(t,e,n){let o=[];for(let r of e){let s=En(t,r);s&&o.push(`${r}: ${s};`)}return o.length?`${n}{${o.join("")}}
5
- `:""}function vn(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}async function Ln(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 Nn(t){let e=t.getBoundingClientRect(),n=0,o=0,r=0,s=0;try{let l=getComputedStyle(t);n=parseFloat(l.borderLeftWidth)||0,o=parseFloat(l.borderRightWidth)||0,r=parseFloat(l.borderTopWidth)||0,s=parseFloat(l.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(e.width-(n+o))),i=Math.max(0,Math.round(e.height-(r+s)));return{contentWidth:a,contentHeight:i,rect:e}}function Rn(t,e,n){let o=t.createElement("style");return o.setAttribute("data-sd-iframe-pin",""),o.textContent=`html, body {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;}`,(t.head||t.documentElement).appendChild(o),()=>{try{o.remove()}catch{}}}async function In(t,e,n){let o=await Ln(t,3);if(!o)throw new Error("iframe document not accessible/ready");let{contentWidth:r,contentHeight:s,rect:a}=Nn(t),i=n?.snap;if(!i||typeof i.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let l={...n,scale:1},c=Rn(o,r,s),u;try{u=await i.toPng(o.documentElement,l)}finally{c()}u.style.display="block",u.style.width=`${r}px`,u.style.height=`${s}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),bt(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(a.width)}px`),f.style.height||(f.style.height=`${Math.round(a.height)}px`),f.appendChild(u),f}async function Ft(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 c=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Ut.has(c))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"){let c=document.createElement("div"),u=t.getBoundingClientRect();return c.style.cssText=`display:inline-block;width:${u.width}px;height:${u.height}px;visibility:hidden;`,c}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let c of n.exclude)try{if(t.matches?.(c)){if(n.excludeMode==="hide"){let u=document.createElement("div"),f=t.getBoundingClientRect();return u.style.cssText=`display:inline-block;width:${f.width}px;height:${f.height}px;visibility:hidden;`,u}else if(n.excludeMode==="remove")return null}}catch(u){console.warn(`Invalid selector in exclude option: ${c}`,u)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let c=document.createElement("div"),u=t.getBoundingClientRect();return c.style.cssText=`display:inline-block;width:${u.width}px;height:${u.height}px;visibility:hidden;`,c}else if(n.filterMode==="remove")return null}}catch(c){console.warn("Error in filter function:",c)}if(t.tagName==="IFRAME"){let c=!1;try{c=!!(t.contentDocument||t.contentWindow?.document)}catch{c=!1}if(c)try{return await In(t,e,n)}catch(u){console.warn("[SnapDOM] iframe rasterization failed, fallback:",u)}if(n.placeholders){let u=document.createElement("div");return u.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}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;`,bt(t,u,e,n),u}else{let u=t.getBoundingClientRect(),f=document.createElement("div");return f.style.cssText=`display:inline-block;width:${u.width}px;height:${u.height}px;visibility:hidden;`,bt(t,f,e,n),f}}if(t.getAttribute("data-capture")==="placeholder"){let c=t.cloneNode(!1);e.nodeMap.set(c,t),bt(t,c,e,n);let u=document.createElement("div");return u.textContent=t.getAttribute("data-placeholder-text")||"",u.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",c.appendChild(u),c}if(t.tagName==="CANVAS"){let c=t.toDataURL(),u=document.createElement("img");return u.src=c,u.width=t.width,u.height=t.height,e.nodeMap.set(u,t),bt(t,u,e,n),u}let a;try{if(a=t.cloneNode(!1),e.nodeMap.set(a,t),t.tagName==="IMG"){An(t,a);try{let c=t.getBoundingClientRect(),u=Math.round(c.width||0),f=Math.round(c.height||0);if(!u||!f){let m=window.getComputedStyle(t),A=parseFloat(m.width)||0,S=parseFloat(m.height)||0,x=parseInt(t.getAttribute("width")||"",10)||0,g=parseInt(t.getAttribute("height")||"",10)||0,k=t.width||t.naturalWidth||0,C=t.height||t.naturalHeight||0;u=Math.round(u||A||x||k||0),f=Math.round(f||S||g||C||0)}u&&(a.dataset.snapdomWidth=String(u)),f&&(a.dataset.snapdomHeight=String(f))}catch{}}}catch(c){throw console.error("[Snapdom] Failed to clone node:",t,c),c}if(t instanceof HTMLTextAreaElement){let c=t.getBoundingClientRect();a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}if(t instanceof HTMLInputElement&&(a.value=t.value,a.setAttribute("value",t.value),t.checked!==void 0&&(a.checked=t.checked,t.checked&&a.setAttribute("checked",""),t.indeterminate&&(a.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(r=t.value),t instanceof HTMLTextAreaElement&&(s=t.value),bt(t,a,e,n),t.shadowRoot){let g=function(C,F){if(C.nodeType===Node.ELEMENT_NODE&&C.tagName==="STYLE")return F(null);Ft(C,e,n).then(W=>{F(W||null)}).catch(W=>{F(null)})};try{let C=t.shadowRoot.querySelectorAll("slot");for(let F of C){let W=[];try{W=F.assignedNodes?.({flatten:!0})||F.assignedNodes?.()||[]}catch{W=F.assignedNodes?.()||[]}for(let X of W)o.add(X)}}catch{}let c=Cn(e),u=`[data-sd="${c}"]`;try{a.setAttribute("data-sd",c)}catch{}let f=kn(t.shadowRoot),m=Sn(f,u),A=$n(f),S=Fn(t,A,u);Mn(a,S+m,c);let x=document.createDocumentFragment(),k=await ce(Array.from(t.shadowRoot.childNodes),g,n.fast);x.append(...k.filter(C=>!!C)),a.appendChild(x)}if(t.tagName==="SLOT"){let m=function(S,x){Ft(S,e,n).then(g=>{g&&vn(g),x(g||null)}).catch(g=>{x(null)})},c=t.assignedNodes?.({flatten:!0})||[],u=c.length>0?c:Array.from(t.childNodes),f=document.createDocumentFragment(),A=await ce(Array.from(u),m,n.fast);return f.append(...A.filter(S=>!!S)),f}function i(c,u){if(o.has(c))return u(null);Ft(c,e,n).then(f=>{u(f||null)}).catch(f=>{u(null)})}let l=await ce(Array.from(t.childNodes),i,n.fast);if(a.append(...l.filter(c=>!!c)),r!==null&&a instanceof HTMLSelectElement){a.value=r;for(let c of a.options)c.value===r?c.setAttribute("selected",""):c.removeAttribute("selected")}return s!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=s),a}var Tn=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],le=[];function ve(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?le.push(n):typeof n=="string"?le.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function et(t){let e=typeof t=="string"?t:"",n=[...Tn,...le];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))}async function Le(t,e,n,o=32,r="#000"){e=e.replace(/^['"]+|['"]+$/g,"");let s=window.devicePixelRatio||1;await document.fonts.ready;let a=document.createElement("span");a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${o}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let i=a.getBoundingClientRect(),l=Math.ceil(i.width),c=Math.ceil(i.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=l*s,u.height=c*s;let f=u.getContext("2d");return f.scale(s,s),f.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=r,f.fillText(t,0,0),{dataUrl:u.toDataURL(),width:l,height:c}}var Wn=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Ot(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Wn.has(n.toLowerCase()))return n}return""}function Dt(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 ue(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function _n(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Pn(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let r=Dt(n[1]),s=Dt(n[2]);return{min:Math.min(r,s),max:Math.max(r,s)}}let o=Dt(e);return{min:o,max:o}}function Un(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Bn(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let s=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(s,a),max:Math.max(s,a)}}let o=e.match(/(\d+(?:\.\d+)?)\s*%/),r=o?parseFloat(o[1]):100;return{min:r,max:r}}function On(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let r=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(i=>r.endsWith(i)))return!0;let a=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a))return!0;for(let i of e){let l=i.toLowerCase().replace(/\s+/g,"+"),c=i.toLowerCase().replace(/\s+/g,"-");if(a.includes(l)||a.includes(c))return!0}return!1}catch{return!1}}function Dn(t){let e=new Set;for(let n of t||[]){let o=String(n).split("__")[0]?.trim();o&&e.add(o)}return e}async function Ht({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:o=[],useProxy:r=""}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let s=new Map;for(let d of t){let[b,w,M,p]=String(d).split("__");if(!b)continue;let y=s.get(b)||[];y.push({w:parseInt(w,10),s:M,st:parseInt(p,10)}),s.set(b,y)}let a=/@import\s+url\(["']?([^"')]+)["']?\)/g,i=/url\((["']?)([^"')]+)\1\)/g,l=/@font-face[^{}]*\{[^}]*\}/g;function c(d,b,w,M){if(!s.has(d))return!1;let p=s.get(d),y=Pn(w),E=Un(b),v=Bn(M),$=y.min!==y.max,N=y.min,_=I=>E.kind==="normal"&&I==="normal"||E.kind!=="normal"&&(I==="italic"||I==="oblique"),H=!1;for(let I of p){let L=$?I.w>=y.min&&I.w<=y.max:I.w===N,R=_(ue(I.s)),P=I.st>=v.min&&I.st<=v.max;if(L&&R&&P){H=!0;break}}if(H)return!0;if(!$)for(let I of p){let L=_(ue(I.s)),R=I.st>=v.min&&I.st<=v.max;if(Math.abs(N-I.w)<=300&&L&&R)return!0}return!1}function u(d){if(!d)return[];let b=[],w=d.split(",").map(M=>M.trim()).filter(Boolean);for(let M of w){let p=M.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!p)continue;let y=p[1],E=p[2],v=$=>{if(!$.includes("?"))return parseInt($,16);let N=parseInt($.replace(/\?/g,"0"),16),_=parseInt($.replace(/\?/g,"F"),16);return[N,_]};if(E){let $=v(y),N=v(E),_=Array.isArray($)?$[0]:$,H=Array.isArray(N)?N[1]:N;b.push([Math.min(_,H),Math.max(_,H)])}else{let $=v(y);Array.isArray($)?b.push([$[0],$[1]]):b.push([$,$])}}return b}function f(d,b){if(!b.length||!d||d.size===0)return!0;for(let w of d)for(let[M,p]of b)if(w>=M&&w<=p)return!0;return!1}function m(d,b){let w=[];if(!d)return w;for(let M of d.matchAll(i)){let p=(M[2]||"").trim();if(!(!p||p.startsWith("data:"))){if(!/^https?:/i.test(p))try{p=new URL(p,b||location.href).href}catch{}w.push(p)}}return w}async function A(d,b){let w=d;for(let M of d.matchAll(i)){let p=ht(M[0]);if(!p)continue;let y=p;if(!y.startsWith("http")&&!y.startsWith("data:"))try{y=new URL(y,b||location.href).href}catch{}if(!et(y)){if(h.resource?.has(y)){h.font?.add(y),w=w.replace(M[0],`url(${h.resource.get(y)})`);continue}if(!h.font?.has(y))try{let E=await V(y,{as:"dataURL",useProxy:r,silent:!0});if(E.ok&&typeof E.data=="string"){let v=E.data;h.resource?.set(y,v),h.font?.add(y),w=w.replace(M[0],`url(${v})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",y)}}}return w}function S(d){if(!d.length)return null;let b=(v,$)=>d.some(([N,_])=>!(_<v||N>$)),w=b(0,255)||b(305,305),M=b(256,591)||b(7680,7935),p=b(880,1023),y=b(1024,1279);return b(7840,7929)||b(258,259)||b(416,417)||b(431,432)?"vietnamese":y?"cyrillic":p?"greek":M?"latin-ext":w?"latin":null}function x(d={}){let b=new Set((d.families||[]).map(p=>String(p).toLowerCase())),w=new Set((d.domains||[]).map(p=>String(p).toLowerCase())),M=new Set((d.subsets||[]).map(p=>String(p).toLowerCase()));return(p,y)=>{if(b.size&&b.has(p.family.toLowerCase()))return!0;if(w.size)for(let E of p.srcUrls)try{if(w.has(new URL(E).host.toLowerCase()))return!0}catch{}if(M.size){let E=S(y);if(E&&M.has(E))return!0}return!1}}let g=x(n);function k(d){if(!d)return d;let b=/@font-face[^{}]*\{[^}]*\}/gi,w=new Set,M=[];for(let y of d.match(b)||[]){let E=y.match(/font-family:\s*([^;]+);/i)?.[1]||"",v=Ot(E),$=(y.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),N=(y.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),_=(y.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),H=(y.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),I=(y.match(/src\s*:\s*([^;]+);/i)?.[1]||"").trim(),L=m(I,location.href),R=L.length?L.map(q=>String(q).toLowerCase()).sort().join("|"):I.toLowerCase(),P=[String(v||"").toLowerCase(),$,N,_,H.toLowerCase(),R].join("|");w.has(P)||(w.add(P),M.push(y))}if(M.length===0)return d;let p=0;return d.replace(b,()=>M[p++]||"")}function C(){let d=Array.from(t||[]).sort().join("|"),b=n?JSON.stringify({families:(n.families||[]).map(p=>String(p).toLowerCase()).sort(),domains:(n.domains||[]).map(p=>String(p).toLowerCase()).sort(),subsets:(n.subsets||[]).map(p=>String(p).toLowerCase()).sort()}):"",w=(o||[]).map(p=>`${(p.family||"").toLowerCase()}::${p.weight||"normal"}::${p.style||"normal"}::${p.src||""}`).sort().join("|");return`fonts-embed-css::req=${d}::ex=${b}::lf=${w}::px=${r||""}`}let F=C();if(h.resource?.has(F))return h.resource.get(F);let W=Dn(t),X=[];for(let d of document.querySelectorAll("style")){let b=d.textContent||"";for(let w of b.matchAll(a)){let M=w[1];if(!M||et(M))continue;!!document.querySelector(`link[rel="stylesheet"][href="${M}"]`)||X.push(M)}}X.length&&await Promise.all(X.map(d=>new Promise(b=>{if(document.querySelector(`link[rel="stylesheet"][href="${d}"]`))return b(null);let w=document.createElement("link");w.rel="stylesheet",w.href=d,w.setAttribute("data-snapdom","injected-import"),w.onload=()=>b(w),w.onerror=()=>b(null),document.head.appendChild(w)})));let O="",j=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(d=>!!d.href);for(let d of j)try{if(et(d.href))continue;let b="",w=!1;try{w=new URL(d.href,location.href).origin===location.origin}catch{}if(!w&&!On(d.href,W))continue;if(w){let p=Array.from(document.styleSheets).find(y=>y.href===d.href);if(p)try{let y=p.cssRules||[];b=Array.from(y).map(E=>E.cssText).join("")}catch{}}if(!b&&(b=(await V(d.href,{as:"text",useProxy:r})).data,et(d.href)))continue;let M="";for(let p of b.match(l)||[]){let y=(p.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),E=Ot(y);if(!E||et(E))continue;let v=(p.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),$=(p.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),N=(p.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),_=(p.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),H=(p.match(/src\s*:\s*([^;]+);/i)?.[1]||"").trim(),I=m(H,d.href);if(!c(E,$,v,N))continue;let L=u(_);if(!f(e,L))continue;let R={family:E,weightSpec:v,styleSpec:$,stretchSpec:N,unicodeRange:_,srcRaw:H,srcUrls:I,href:d.href};if(n&&g(R,L))continue;let P=/url\(/i.test(H)?await A(p,d.href):p;M+=P+""}M.trim()&&(O+=M+"")}catch{console.warn("[snapdom] Failed to process stylesheet:",d.href)}for(let d of document.styleSheets)try{if(d.href&&j.some(w=>w.href===d.href))continue;let b=d.cssRules||[];for(let w of b){if(w.type!==CSSRule.FONT_FACE_RULE)continue;let M=(w.style.getPropertyValue("font-family")||"").trim(),p=Ot(M);if(!p||et(p))continue;let y=(w.style.getPropertyValue("font-weight")||"400").trim(),E=(w.style.getPropertyValue("font-style")||"normal").trim(),v=(w.style.getPropertyValue("font-stretch")||"100%").trim(),$=(w.style.getPropertyValue("src")||"").trim(),N=(w.style.getPropertyValue("unicode-range")||"").trim(),_=m($,d.href||location.href);if(!c(p,E,y,v))continue;let H=u(N);if(!f(e,H))continue;let I={family:p,weightSpec:y,styleSpec:E,stretchSpec:v,unicodeRange:N,srcRaw:$,srcUrls:_,href:d.href||location.href};if(!(n&&g(I,H)))if(/url\(/i.test($)){let L=await A($,d.href||location.href);O+=`@font-face{font-family:${p};src:${L};font-style:${E};font-weight:${y};font-stretch:${v};${N?`unicode-range:${N};`:""}}`}else O+=`@font-face{font-family:${p};src:${$};font-style:${E};font-weight:${y};font-stretch:${v};${N?`unicode-range:${N};`:""}}`}}catch{}try{for(let d of document.fonts||[]){if(!d||!d.family||d.status!=="loaded"||!d._snapdomSrc)continue;let b=String(d.family).replace(/^['"]+|['"]+$/g,"");if(et(b)||!s.has(b)||n?.families&&n.families.some(M=>String(M).toLowerCase()===b.toLowerCase()))continue;let w=d._snapdomSrc;if(!String(w).startsWith("data:")){if(h.resource?.has(d._snapdomSrc))w=h.resource.get(d._snapdomSrc),h.font?.add(d._snapdomSrc);else if(!h.font?.has(d._snapdomSrc))try{let M=await V(d._snapdomSrc,{as:"dataURL",useProxy:r,silent:!0});if(M.ok&&typeof M.data=="string")w=M.data,h.resource?.set(d._snapdomSrc,w),h.font?.add(d._snapdomSrc);else continue}catch{console.warn("[snapdom] Failed to fetch dynamic font src:",d._snapdomSrc);continue}}O+=`@font-face{font-family:'${b}';src:url(${w});font-style:${d.style||"normal"};font-weight:${d.weight||"normal"};}`}}catch{}for(let d of o){if(!d||typeof d!="object")continue;let b=String(d.family||"").replace(/^['"]+|['"]+$/g,"");if(!b||et(b)||!s.has(b)||n?.families&&n.families.some(v=>String(v).toLowerCase()===b.toLowerCase()))continue;let w=d.weight!=null?String(d.weight):"normal",M=d.style!=null?String(d.style):"normal",p=d.stretchPct!=null?`${d.stretchPct}%`:"100%",y=String(d.src||""),E=y;if(!E.startsWith("data:")){if(h.resource?.has(y))E=h.resource.get(y),h.font?.add(y);else if(!h.font?.has(y))try{let v=await V(y,{as:"dataURL",useProxy:r,silent:!0});if(v.ok&&typeof v.data=="string")E=v.data,h.resource?.set(y,E),h.font?.add(y);else continue}catch{console.warn("[snapdom] Failed to fetch localFonts src:",y);continue}}O+=`@font-face{font-family:'${b}';src:url(${E});font-style:${M};font-weight:${w};font-stretch:${p};}`}return O&&(O=k(O),h.resource?.set(F,O)),O}function qt(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),o=a=>{let i=Ot(a.fontFamily);if(!i)return;let l=(c,u,f)=>`${i}__${Dt(c)}__${ue(u)}__${_n(f)}`;e.add(l(a.fontWeight,a.fontStyle,a.fontStretch))};o(getComputedStyle(t));let r=getComputedStyle(t,"::before");r&&r.content&&r.content!=="none"&&o(r);let s=getComputedStyle(t,"::after");for(s&&s.content&&s.content!=="none"&&o(s);n.nextNode();){let a=n.currentNode,i=getComputedStyle(a);o(i);let l=getComputedStyle(a,"::before");l&&l.content&&l.content!=="none"&&o(l);let c=getComputedStyle(a,"::after");c&&c.content&&c.content!=="none"&&o(c)}return e}function jt(t){let e=new Set,n=r=>{if(r)for(let s of r)e.add(s.codePointAt(0))},o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){let r=o.currentNode;if(r.nodeType===Node.TEXT_NODE)n(r.nodeValue||"");else if(r.nodeType===Node.ELEMENT_NODE){let s=r;for(let a of["::before","::after"]){let l=getComputedStyle(s,a)?.getPropertyValue("content");if(!(!l||l==="none"))if(/^"/.test(l)||/^'/.test(l))n(l.slice(1,-1));else{let c=l.match(/\\[0-9A-Fa-f]{1,6}/g);if(c)for(let u of c)try{e.add(parseInt(u.slice(1),16))}catch{}}}}}return e}async function Vt(t,e=2){try{await document.fonts.ready}catch{}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let o=()=>{let r=document.createElement("div");r.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 n){let a=document.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",r.appendChild(a)}document.body.appendChild(r),r.offsetWidth,document.body.removeChild(r)};for(let r=0;r<Math.max(1,e);r++)o(),await new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s)))}function Te(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Hn(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function Ne(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 Re(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,a]of n)for(;o>=s;)r+=a,o-=s;return e?r:r.toLowerCase()}function Ie(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return Ne(t,!1);case"upper-alpha":return Ne(t,!0);case"lower-roman":return Re(t,!1);case"upper-roman":return Re(t,!0);default:return String(Math.max(0,t))}}function We(t){let e=new WeakMap,n=t instanceof Document?t.documentElement:t,o=c=>c&&c.tagName==="LI",r=c=>{let u=0,f=c?.parentElement;if(!f)return 0;for(let m of f.children){if(m===c)break;m.tagName==="LI"&&u++}return u},s=c=>{let u=new Map;for(let[f,m]of c)u.set(f,m.slice());return u},a=(c,u,f)=>{let m=s(c),A;try{A=f.style?.counterReset||getComputedStyle(f).counterReset}catch{}if(A&&A!=="none")for(let x of A.split(",")){let g=x.trim().split(/\s+/),k=g[0],C=Number.isFinite(Number(g[1]))?Number(g[1]):0;if(!k)continue;let F=u.get(k);if(F&&F.length){let W=F.slice();W.push(C),m.set(k,W)}else m.set(k,[C])}let S;try{S=f.style?.counterIncrement||getComputedStyle(f).counterIncrement}catch{}if(S&&S!=="none")for(let x of S.split(",")){let g=x.trim().split(/\s+/),k=g[0],C=Number.isFinite(Number(g[1]))?Number(g[1]):1;if(!k)continue;let F=m.get(k)||[];F.length===0&&F.push(0),F[F.length-1]+=C,m.set(k,F)}try{if(getComputedStyle(f).display==="list-item"&&o(f)){let g=f.parentElement,k=1;if(g&&g.tagName==="OL"){let F=g.getAttribute("start"),W=Number.isFinite(Number(F))?Number(F):1,X=r(f),O=f.getAttribute("value");k=Number.isFinite(Number(O))?Number(O):W+X}else k=1+r(f);let C=m.get("list-item")||[];C.length===0&&C.push(0),C[C.length-1]=k,m.set("list-item",C)}}catch{}return m},i=(c,u,f)=>{let m=a(f,u,c);e.set(c,m);let A=m;for(let S of c.children)A=i(S,m,A);return m},l=new Map;return i(n,l,l),{get(c,u){let f=e.get(c)?.get(u);return f&&f.length?f[f.length-1]:0},getStack(c,u){let f=e.get(c)?.get(u);return f?f.slice():[]}}}function _e(t,e,n){if(!t||t==="none")return t;try{let o=/\b(counter|counters)\s*\(([^)]+)\)/g,r=t.replace(o,(s,a,i)=>{let l=String(i).split(",").map(c=>c.trim());if(a==="counter"){let c=l[0]?.replace(/^["']|["']$/g,""),u=(l[1]||"decimal").toLowerCase(),f=n.get(e,c);return Ie(f,u)}else{let c=l[0]?.replace(/^["']|["']$/g,""),u=l[1]?.replace(/^["']|["']$/g,"")??"",f=(l[2]||"decimal").toLowerCase(),m=n.getStack(e,c);return m.length?m.map(S=>Ie(S,f)).join(u):""}});return Hn(r)}catch{return"- "}}var vt=null,Lt=new WeakMap;function qn(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function jn(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,o;for(;o=n.exec(t);)e.push(o[1]);return e.length?e.join(""):qn(t)}function fe(t,e){let n=t.parentElement,o=n?Lt.get(n):null;return o?{get(r,s){let a=e.get(r,s),i=o.get(s);return typeof i=="number"?Math.max(a,i):a},getStack(r,s){let a=e.getStack(r,s);if(!a.length)return a;let i=o.get(s);if(typeof i=="number"){let l=a.slice();return l[l.length-1]=Math.max(l[l.length-1],i),l}return a}}:e}function de(t,e,n){let o=new Map;function r(l){let c=[];if(!l||l==="none")return c;for(let u of String(l).split(",")){let f=u.trim().split(/\s+/),m=f[0],A=Number.isFinite(Number(f[1]))?Number(f[1]):void 0;m&&c.push({name:m,num:A})}return c}let s=r(e?.counterReset),a=r(e?.counterIncrement);function i(l){if(o.has(l))return o.get(l).slice();let c=n.getStack(t,l);c=c.length?c.slice():[];let u=s.find(m=>m.name===l);if(u){let m=Number.isFinite(u.num)?u.num:0;c=c.length?[...c,m]:[m]}let f=a.find(m=>m.name===l);if(f){let m=Number.isFinite(f.num)?f.num:1;c.length===0&&(c=[0]),c[c.length-1]+=m}return o.set(l,c.slice()),c}return{get(l,c){let u=i(c);return u.length?u[u.length-1]:0},getStack(l,c){return i(c)},__incs:a}}function Vn(t,e,n){let o;try{o=getComputedStyle(t,e)}catch{}let r=o?.content;if(!r||r==="none"||r==="normal")return{text:"",incs:[]};let s=fe(t,n),a=de(t,o,s),i=Te(r)?_e(r,t,a):r;return{text:jn(i),incs:a.__incs||[]}}async function me(t,e,n,o){if(!(t instanceof Element)||!(e instanceof Element))return;if(!vt)try{vt=We(t.ownerDocument||document)}catch{}for(let a of["::before","::after","::first-letter"])try{let i=yt(t,a);if(!i||typeof i[Symbol.iterator]!="function"||i.content==="none"&&i.backgroundImage==="none"&&i.backgroundColor==="transparent"&&(i.borderStyle==="none"||parseFloat(i.borderWidth)===0)&&(!i.transform||i.transform==="none")&&i.display==="inline")continue;if(a==="::first-letter"){let L=getComputedStyle(t);if(!(i.color!==L.color||i.fontSize!==L.fontSize||i.fontWeight!==L.fontWeight))continue;let P=Array.from(e.childNodes).find(Q=>Q.nodeType===Node.TEXT_NODE&&Q.textContent?.trim().length>0);if(!P)continue;let q=P.textContent,rt=q.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],It=q.slice(rt?.length||0);if(!rt||/[\uD800-\uDFFF]/.test(rt))continue;let xt=document.createElement("span");xt.textContent=rt,xt.dataset.snapdomPseudo="::first-letter";let Kt=Bt(i),Tt=$t(Kt,"span");n.styleMap.set(xt,Tt);let J=document.createTextNode(It);e.replaceChild(J,P),e.insertBefore(xt,J);continue}let c=i.content,{text:u,incs:f}=Vn(t,a,vt),m=i.backgroundImage,A=i.backgroundColor,S=i.fontFamily,x=parseInt(i.fontSize)||32,g=parseInt(i.fontWeight)||!1,k=i.color||"#000",C=i.display,F=parseFloat(i.width),W=parseFloat(i.height),X=i.borderStyle,O=parseFloat(i.borderWidth),j=i.transform,d=et(S),b=c!=="none"&&u!=="",w=m&&m!=="none",M=A&&A!=="transparent"&&A!=="rgba(0, 0, 0, 0)",p=C!=="inline"&&(F>0||W>0),y=X&&X!=="none"&&O>0,E=j&&j!=="none";if(!(b||w||M||p||y||E)){if(f&&f.length&&t.parentElement){let L=Lt.get(t.parentElement)||new Map;for(let{name:R,num:P}of f){if(!R)continue;let q=fe(t,vt),rt=de(t,getComputedStyle(t,a),q).get(t,R);L.set(R,rt)}Lt.set(t.parentElement,L)}continue}let $=document.createElement("span");$.dataset.snapdomPseudo=a,$.style.verticalAlign="middle";let N=Bt(i),_=$t(N,"span");if(n.styleMap.set($,_),d&&u&&u.length===1){let{dataUrl:L,width:R,height:P}=await Le(u,S,g,x,k),q=document.createElement("img");q.src=L,q.style=`height:${x}px;width:${R/P*x}px;object-fit:contain;`,$.appendChild(q),e.dataset.snapdomHasIcon="true"}else if(u&&u.startsWith("url(")){let L=ht(u);if(L?.trim())try{let R=document.createElement("img"),P=await V(ut(L),{as:"dataURL",useProxy:o.useProxy});R.src=P.data,R.style=`width:${x}px;height:auto;object-fit:contain;`,$.appendChild(R)}catch(R){console.error(`[snapdom] Error in pseudo ${a} for`,t,R)}}else!d&&b&&($.textContent=u);if(w)try{let L=wt(m),R=await Promise.all(L.map(gt));$.style.backgroundImage=R.join(", ")}catch(L){console.warn(`[snapdom] Failed to inline background-image for ${a}`,L)}M&&($.style.backgroundColor=A);let I=$.childNodes.length>0||$.textContent?.trim()!==""||w||M||p||y||E;if(f&&f.length&&t.parentElement){let L=Lt.get(t.parentElement)||new Map,R=fe(t,vt),P=de(t,getComputedStyle(t,a),R);for(let{name:q}of f){if(!q)continue;let it=P.get(t,q);L.set(q,it)}Lt.set(t.parentElement,L)}if(!I)continue;a==="::before"?e.insertBefore($,e.firstChild):e.appendChild($)}catch(i){console.warn(`[snapdom] Failed to capture ${a} for`,t,i)}let r=Array.from(t.children),s=Array.from(e.children).filter(a=>!a.dataset.snapdomPseudo);for(let a=0;a<Math.min(r.length,s.length);a++)await me(r[a],s[a],n,o)}function Pe(t){if(!t)return;let e=new Set;if(t.querySelectorAll("use").forEach(i=>{let l=i.getAttribute("xlink:href")||i.getAttribute("href");l&&l.startsWith("#")&&e.add(l.slice(1))}),!e.size)return;let n=Array.from(document.querySelectorAll("svg > symbol, svg > defs")),o=n.filter(i=>i.tagName.toLowerCase()==="symbol"),r=n.filter(i=>i.tagName.toLowerCase()==="defs"),s=t.querySelector("svg.inline-defs-container");s||(s=document.createElementNS("http://www.w3.org/2000/svg","svg"),s.setAttribute("aria-hidden","true"),s.setAttribute("style","position: absolute; width: 0; height: 0; overflow: hidden;"),s.classList.add("inline-defs-container"),t.insertBefore(s,t.firstChild));let a=new Set;t.querySelectorAll("symbol[id], defs > *[id]").forEach(i=>{a.add(i.id)}),e.forEach(i=>{if(a.has(i))return;let l=o.find(c=>c.id===i);if(l){s.appendChild(l.cloneNode(!0)),a.add(i);return}for(let c of r){let u=c.querySelector(`#${CSS.escape(i)}`);if(u){let f=s.querySelector("defs");f||(f=document.createElementNS("http://www.w3.org/2000/svg","defs"),s.appendChild(f)),f.appendChild(u.cloneNode(!0)),a.add(i);break}}})}async function Be(t,e={}){let n={styleMap:h.session.styleMap,styleCache:h.session.styleCache,nodeMap:h.session.nodeMap},o,r="",s="";zn(t);try{Pe(t)}catch(i){console.warn("inlineExternal defs or symbol failed:",i)}try{o=await Ft(t,n,e,t)}catch(i){throw console.warn("deepClone failed:",i),i}try{await me(t,o,n,e)}catch(i){console.warn("inlinePseudoElements failed:",i)}await Kn(o);try{let i=o.querySelectorAll("style[data-sd]");for(let l of i)s+=l.textContent||"",l.remove()}catch{}let a=ae(n.styleMap);r=Array.from(a.entries()).map(([i,l])=>`.${l}{${i}}`).join(""),r=s+r;for(let[i,l]of n.styleMap.entries()){if(i.tagName==="STYLE")continue;if(i.getRootNode&&i.getRootNode()instanceof ShadowRoot){i.setAttribute("style",l.replace(/;/g,"; "));continue}let c=a.get(l);c&&i.classList.add(c);let u=i.style?.backgroundImage,f=i.dataset?.snapdomHasIcon;u&&u!=="none"&&(i.style.backgroundImage=u),f&&(i.style.verticalAlign="middle",i.style.display="inline")}for(let[i,l]of n.nodeMap.entries()){let c=l.scrollLeft,u=l.scrollTop;if((c||u)&&i instanceof HTMLElement){i.style.overflow="hidden",i.style.scrollbarWidth="none",i.style.msOverflowStyle="none";let m=document.createElement("div");for(m.style.transform=`translate(${-c}px, ${-u}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";i.firstChild;)m.appendChild(i.firstChild);i.appendChild(m)}}if(t===n.nodeMap.get(o)){let i=n.styleCache.get(t)||window.getComputedStyle(t);n.styleCache.set(t,i);let l=Zt(i.transform);o.style.margin="0",o.style.top="auto",o.style.left="auto",o.style.right="auto",o.style.bottom="auto",o.style.animation="none",o.style.transition="none",o.style.willChange="auto",o.style.float="none",o.style.clear="none",o.style.transform=l||""}for(let[i,l]of n.nodeMap.entries())l.tagName==="PRE"&&(i.style.marginTop="0",i.style.marginBlockStart="0");return{clone:o,classCSS:r,styleCache:n.styleCache}}function zn(t){let e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,r=e.borderStyle,s=e.borderWidth,a=n!=="none"&&parseFloat(o)>0,i=r==="none"||parseFloat(s)===0;a&&i&&(t.style.border=`${o} solid transparent`)}var Nt=new Map;async function Rt(t){if(h.resource?.has(t))return h.resource.get(t);if(Nt.has(t))return Nt.get(t);let e=(async()=>{let n=await V(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return h.resource?.set(t,n.data),n.data})();Nt.set(t,e);try{let n=await e;return Nt.set(t,n),n}catch(n){throw Nt.delete(t),n}}var Xn=/\bblob:[^)"'\s]+/g;async function Ue(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(Xn)||[]));if(e.length===0)return t;let n=t;for(let o of e)try{let r=await Rt(o);n=n.split(o).join(r)}catch{}return n}function zt(t){return typeof t=="string"&&t.startsWith("blob:")}function Yn(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 Gn(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}async function Kn(t){if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let a of e)try{let l=a.getAttribute("src")||a.currentSrc||"";if(zt(l)){let u=await Rt(l);a.setAttribute("src",u)}let c=a.getAttribute("srcset");if(c&&c.includes("blob:")){let u=Yn(c),f=!1;for(let m of u)if(zt(m.url))try{m.url=await Rt(m.url),f=!0}catch{}f&&a.setAttribute("srcset",Gn(u))}}catch{}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let a of n)try{let i="http://www.w3.org/1999/xlink",l=a.getAttribute("href")||a.getAttributeNS?.(i,"href");if(zt(l)){let c=await Rt(l);a.setAttribute("href",c),a.removeAttributeNS?.(i,"href")}}catch{}let o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let a of o)try{let i=a.getAttribute("style");if(i&&i.includes("blob:")){let l=await Ue(i);a.setAttribute("style",l)}}catch{}let r=t.querySelectorAll?t.querySelectorAll("style"):[];for(let a of r)try{let i=a.textContent||"";i.includes("blob:")&&(a.textContent=await Ue(i))}catch{}let s=["poster"];for(let a of s){let i=t.querySelectorAll?t.querySelectorAll(`[${a}^='blob:']`):[];for(let l of i)try{let c=l.getAttribute(a);zt(c)&&l.setAttribute(a,await Rt(c))}catch{}}}async function Oe(t,e={}){let n=Array.from(t.querySelectorAll("img")),o=async r=>{if(!r.getAttribute("src")){let u=r.currentSrc||r.src||"";u&&r.setAttribute("src",u)}r.removeAttribute("srcset"),r.removeAttribute("sizes");let s=r.src||"";if(!s)return;let a=await V(s,{as:"dataURL",useProxy:e.useProxy});if(a.ok&&typeof a.data=="string"&&a.data.startsWith("data:")){r.src=a.data,r.width||(r.width=r.naturalWidth||100),r.height||(r.height=r.naturalHeight||100);return}let{fallbackURL:i}=e||{};if(i)try{let u=parseInt(r.dataset?.snapdomWidth||"",10)||0,f=parseInt(r.dataset?.snapdomHeight||"",10)||0,m=parseInt(r.getAttribute("width")||"",10)||0,A=parseInt(r.getAttribute("height")||"",10)||0,S=parseFloat(r.style?.width||"")||0,x=parseFloat(r.style?.height||"")||0,g=u||S||m||r.width||void 0,k=f||x||A||r.height||void 0,C=typeof i=="function"?await i({width:g,height:k,src:s,element:r}):i;if(C){let F=await V(C,{as:"dataURL",useProxy:e.useProxy});r.src=F.data,!r.width&&g&&(r.width=g),!r.height&&k&&(r.height=k),r.width||(r.width=r.naturalWidth||100),r.height||(r.height=r.naturalHeight||100);return}}catch{}let l=r.width||r.naturalWidth||100,c=r.height||r.naturalHeight||100;if(e.placeholders!==!1){let u=document.createElement("div");u.style.cssText=[`width:${l}px`,`height:${c}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${c}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),u.textContent="img",r.replaceWith(u)}else{let u=document.createElement("div");u.style.cssText=`display:inline-block;width:${l}px;height:${c}px;visibility:hidden;`,r.replaceWith(u)}};for(let r=0;r<n.length;r+=4){let s=n.slice(r,r+4).map(o);await Promise.allSettled(s)}}async function Xt(t,e,n,o={}){let r=[[t,e]],s=["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"],a=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],i=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;r.length;){let[l,c]=r.shift(),u=n.get(l)||yt(l);n.has(l)||n.set(l,u);let f=(()=>{let S=u.getPropertyValue("border-image"),x=u.getPropertyValue("border-image-source");return S&&S!=="none"||x&&x!=="none"})();for(let S of s){let x=u.getPropertyValue(S);if(!x||x==="none")continue;let g=wt(x),k=await Promise.all(g.map(C=>gt(C,o)));k.some(C=>C&&C!=="none"&&!/^url\(undefined/.test(C))&&c.style.setProperty(S,k.join(", "))}for(let S of a){let x=u.getPropertyValue(S);!x||x==="initial"||c.style.setProperty(S,x)}if(f)for(let S of i){let x=u.getPropertyValue(S);!x||x==="initial"||c.style.setProperty(S,x)}let m=Array.from(l.children),A=Array.from(c.children);for(let S=0;S<Math.min(m.length,A.length);S++)r.push([m[S],A[S]])}}function De(t){if(!t)return()=>{};let e=Jn(t);if(e<=0)return()=>{};if(!to(t))return()=>{};let n=getComputedStyle(t),o=Math.round(Qn(n)*e+Zn(n)),r=t.textContent??"",s=r;if(t.scrollHeight<=o+.5)return()=>{};let a=0,i=r.length,l=-1;for(;a<=i;){let c=a+i>>1;t.textContent=r.slice(0,c)+"\u2026",t.scrollHeight<=o+.5?(l=c,a=c+1):i=c-1}return t.textContent=(l>=0?r.slice(0,l):"")+"\u2026",()=>{t.textContent=s}}function Jn(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let o=parseInt(n,10);return Number.isFinite(o)&&o>0?o:0}function Qn(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 Zn(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function to(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}async function pe(t,e){if(!t)throw new Error("Element cannot be null or undefined");_t(e.cache);let n=e.fast,o,r,s,a="",i="",l,c,u=De(t);try{({clone:o,classCSS:r,styleCache:s}=await Be(t,e))}finally{u()}await new Promise(S=>{st(async()=>{await Oe(o,e),S()},{fast:n})}),await new Promise(S=>{st(async()=>{await Xt(t,o,s,e),S()},{fast:n})}),e.embedFonts&&await new Promise(S=>{st(async()=>{let x=qt(t),g=jt(t);if(z()){let k=new Set(Array.from(x).map(C=>String(C).split("__")[0]).filter(Boolean));await Vt(k,2)}a=await Ht({required:x,usedCodepoints:g,preCached:!1,exclude:e.excludeFonts,useProxy:e.useProxy}),S()},{fast:n})});let f=oe(o).sort(),m=f.join(",");h.baseStyle.has(m)?i=h.baseStyle.get(m):await new Promise(S=>{st(()=>{i=re(f),h.baseStyle.set(m,i),S()},{fast:n})}),await new Promise(S=>{st(()=>{let x=getComputedStyle(t);function g(D){let T=`${D.filter||""} ${D.webkitFilter||""}`.trim();if(!T||T==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let U=T.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],G=0,K=0,Z=0,Y=0,ct=!1;for(let Ct of U){ct=!0;let dt=Ct.match(/-?\d+(?:\.\d+)?px/gi)?.map(lt=>parseFloat(lt))||[],[at=0,tt=0,mt=0]=dt,nt=Math.abs(at)+mt,ot=Math.abs(tt)+mt;K=Math.max(K,nt+Math.max(at,0)),Y=Math.max(Y,nt+Math.max(-at,0)),Z=Math.max(Z,ot+Math.max(tt,0)),G=Math.max(G,ot+Math.max(-tt,0))}return{bleed:{top:Math.ceil(G),right:Math.ceil(K),bottom:Math.ceil(Z),left:Math.ceil(Y)},has:ct}}function k(D){let T=D.boxShadow||"";if(!T||T==="none")return{top:0,right:0,bottom:0,left:0};let U=T.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(ct=>ct.trim()),G=0,K=0,Z=0,Y=0;for(let ct of U){let Ct=ct.match(/-?\d+(\.\d+)?px/g)?.map(lt=>parseFloat(lt))||[];if(Ct.length<2)continue;let[dt,at,tt=0,mt=0]=Ct,nt=Math.abs(dt)+tt+mt,ot=Math.abs(at)+tt+mt;K=Math.max(K,nt+Math.max(dt,0)),Y=Math.max(Y,nt+Math.max(-dt,0)),Z=Math.max(Z,ot+Math.max(at,0)),G=Math.max(G,ot+Math.max(-at,0))}return{top:Math.ceil(G),right:Math.ceil(K),bottom:Math.ceil(Z),left:Math.ceil(Y)}}function C(D){let T=(D.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),U=T?Math.ceil(parseFloat(T[1])||0):0;return{top:U,right:U,bottom:U,left:U}}function F(D){if((D.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let T=Math.ceil(parseFloat(D.outlineWidth||"0")||0);return{top:T,right:T,bottom:T,left:T}}function W(D,T,U,G,K){let Z=U.a,Y=U.b,ct=U.c,Ct=U.d,dt=U.e||0,at=U.f||0;function tt(kt,Mt){let be=kt-G,xe=Mt-K,Se=Z*be+ct*xe,Ce=Y*be+Ct*xe;return Se+=G+dt,Ce+=K+at,[Se,Ce]}let mt=[tt(0,0),tt(D,0),tt(0,T),tt(D,T)],nt=1/0,ot=1/0,lt=-1/0,Wt=-1/0;for(let[kt,Mt]of mt)kt<nt&&(nt=kt),Mt<ot&&(ot=Mt),kt>lt&&(lt=kt),Mt>Wt&&(Wt=Mt);return{minX:nt,minY:ot,maxX:lt,maxY:Wt,width:lt-nt,height:Wt-ot}}function X(D){return oo(D)}let O=t.getBoundingClientRect(),j=Math.max(1,Math.ceil(t.offsetWidth||parseFloat(x.width)||O.width||1)),d=Math.max(1,Math.ceil(t.offsetHeight||parseFloat(x.height)||O.height||1)),b=(D,T=NaN)=>{let U=typeof D=="string"?parseFloat(D):D;return Number.isFinite(U)?U:T},w=b(e.width),M=b(e.height),p=j,y=d,E=Number.isFinite(w),v=Number.isFinite(M),$=d>0?j/d:1;E&&v?(p=Math.max(1,Math.ceil(w)),y=Math.max(1,Math.ceil(M))):E?(p=Math.max(1,Math.ceil(w)),y=Math.max(1,Math.ceil(p/($||1)))):v?(y=Math.max(1,Math.ceil(M)),p=Math.max(1,Math.ceil(y*($||1)))):(p=j,y=d);let N=0,_=0,H=j,I=d;if(X(t)){let D=x.transform&&x.transform!=="none"?x.transform:"",T=no(t),U=so({baseTransform:D,rotate:T.rotate||"0deg",scale:T.scale,translate:T.translate}),{ox:G,oy:K}=ro(x,j,d),Z=U.is2D?U:new DOMMatrix(U.toString()),Y=W(j,d,Z,G,K);N=Y.minX,_=Y.minY,H=Y.maxX,I=Y.maxY}let L=k(x),R=C(x),P=F(x),q=g(x),it={top:L.top+R.top+P.top+q.bleed.top,right:L.right+R.right+P.right+q.bleed.right,bottom:L.bottom+R.bottom+P.bottom+q.bleed.bottom,left:L.left+R.left+P.left+q.bleed.left};N-=it.left,_-=it.top,H+=it.right,I+=it.bottom;let rt=Math.max(1,Math.ceil(H-N)),It=Math.max(1,Math.ceil(I-_)),xt=Math.max(1,Math.round(rt*(E||v?p/j:1))),Kt=Math.max(1,Math.round(It*(v||E?y/d:1))),Tt="http://www.w3.org/2000/svg",J=z()?1:0,Q=document.createElementNS(Tt,"foreignObject"),Xe=Math.floor(N),Ye=Math.floor(_);Q.setAttribute("x",String(-(Xe-J))),Q.setAttribute("y",String(-(Ye-J))),Q.setAttribute("width",String(Math.ceil(j+J*2))),Q.setAttribute("height",String(Math.ceil(d+J*2))),Q.style.overflow="visible";let ye=document.createElement("style");ye.textContent=i+a+"svg{overflow:visible;} foreignObject{overflow:visible;}"+r,Q.appendChild(ye);let St=document.createElement("div");St.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),St.style.width=`${j}px`,St.style.height=`${d}px`,St.style.overflow="visible",o.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),St.appendChild(o),Q.appendChild(St);let Ge=new XMLSerializer().serializeToString(Q),Jt=rt+J*2,Qt=It+J*2,we=E||v;e.meta={w0:j,h0:d,vbW:Jt,vbH:Qt,targetW:p,targetH:y};let Ke=z()&&we?Jt:xt+J*2,Je=z()&&we?Qt:Kt+J*2;c=`<svg xmlns="${Tt}" width="${Ke}" height="${Je}" viewBox="0 0 ${Jt} ${Qt}">`+Ge+"</svg>",l=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,S()},{fast:n})});let A=document.getElementById("snapdom-sandbox");return A&&A.style.position==="absolute"&&A.remove(),l}function eo(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}function no(t){let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let r=l=>{try{return typeof n.has=="function"&&!n.has(l)||typeof n.get!="function"?null:n.get(l)}catch{return null}},s=r("rotate");if(s)if(s.angle){let l=s.angle;e.rotate=l.unit==="rad"?l.value*180/Math.PI+"deg":l.value+l.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 l=getComputedStyle(t);e.rotate=l.rotate&&l.rotate!=="none"?l.rotate:"0deg"}let a=r("scale");if(a){let l="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,c="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:l;e.scale=`${l} ${c}`}else{let l=getComputedStyle(t);e.scale=l.scale&&l.scale!=="none"?l.scale:null}let i=r("translate");if(i){let l="x"in i&&"value"in i.x?i.x.value:Array.isArray(i)?i[0]?.value:0,c="y"in i&&"value"in i.y?i.y.value:Array.isArray(i)?i[1]?.value:0,u="x"in i&&i.x?.unit?i.x.unit:"px",f="y"in i&&i.y?.unit?i.y.unit:"px";e.translate=`${l}${u} ${c}${f}`}else{let l=getComputedStyle(t);e.translate=l.translate&&l.translate!=="none"?l.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}function oo(t){let e=getComputedStyle(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",a=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(r||s||a)}function ro(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[r,s]=[o[0]||"0",o[1]||"0"],a=(i,l)=>{let c=i.toLowerCase();return c==="left"||c==="top"?0:c==="center"?l/2:c==="right"||c==="bottom"?l:c.endsWith("px")?parseFloat(c)||0:c.endsWith("%")?(parseFloat(c)||0)*l/100:/^-?\d+(\.\d+)?$/.test(c)&&parseFloat(c)||0};return{ox:a(r,e),oy:a(s,n)}}var he=null;function ao(){if(he)return he;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),he=t,t}function so(t){let e=ao(),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=eo(n);return e.removeChild(n),o}function io(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function He(t={}){let e=t.format??"png",n=io(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,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??(["jpg","jpeg","webp"].includes(e)?"#ffffff":null),filename:t.filename??"snapDOM"}}function co(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function lo(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function uo(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function fo(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 mo(t){let e=[],n="",o=0;for(let s=0;s<t.length;s++){let a=t[s];a==="("&&o++,a===")"&&(o=Math.max(0,o-1)),a===","&&o===0?(e.push(n.trim()),n=""):n+=a}n.trim()&&e.push(n.trim());let r=[];for(let s of e){if(/\binset\b/i.test(s))continue;let a=s.match(/-?\d+(?:\.\d+)?px/gi)||[],[i="0px",l="0px",c="0px"]=a,u=s.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!u&&u!==",";r.push(`drop-shadow(${i} ${l} ${c}${f?` ${u}`:""})`)}return r.join(" ")}function qe(t){let e=fo(t),n=null,o=null,r=null,s=[];for(let i of e){let l=i.indexOf(":");if(l<0)continue;let c=i.slice(0,l).trim().toLowerCase(),u=i.slice(l+1).trim();c==="box-shadow"?r=u:c==="filter"?n=u:c==="-webkit-filter"?o=u:s.push([c,u])}if(r){let i=mo(r);i&&(n=n?`${n} ${i}`:i,o=o?`${o} ${i}`:i)}let a=[...s];return n&&a.push(["filter",n]),o&&a.push(["-webkit-filter",o]),a.map(([i,l])=>`${i}:${l}`).join(";")}function ho(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${qe(o)}}`)}function po(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,ho(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${qe(o)}${n}`),t}function go(t){if(!z()||!co(t))return t;try{let e=lo(t),n=po(e);return uo(n)}catch{return t}}async function ft(t,e){let{width:n,height:o,scale:r=1,dpr:s=1,meta:a={}}=e;t=go(t);let i=new Image;i.loading="eager",i.decoding="sync",i.crossOrigin="anonymous",i.src=t,await i.decode();let l=i.naturalWidth,c=i.naturalHeight,u=Number.isFinite(a.w0)?a.w0:l,f=Number.isFinite(a.h0)?a.h0:c,m,A,S=Number.isFinite(n),x=Number.isFinite(o);if(S&&x)m=Math.max(1,n),A=Math.max(1,o);else if(S){let C=n/Math.max(1,u);m=n,A=Math.round(f*C)}else if(x){let C=o/Math.max(1,f);A=o,m=Math.round(u*C)}else m=l,A=c;m=Math.round(m*r),A=Math.round(A*r);let g=document.createElement("canvas");g.width=Math.ceil(m*s),g.height=Math.ceil(A*s),g.style.width=`${m}px`,g.style.height=`${A}px`;let k=g.getContext("2d");return s!==1&&k.scale(s,s),k.drawImage(i,0,0,m,A),g}async function Yt(t,e){let n=await ft(t,e),o=e.backgroundColor?pt(n,e.backgroundColor):n,r=new Image;return r.src=o.toDataURL(`image/${e.format}`,e.quality),await r.decode(),r.style.width=`${o.width/e.dpr}px`,r.style.height=`${o.height/e.dpr}px`,r}async function je(t,e){let{scale:n=1,width:o,height:r,meta:s={}}=e,a=Number.isFinite(o),i=Number.isFinite(r),l=Number.isFinite(n)&&n!==1||a||i;if(z()&&l)return await Yt(t,{...e,format:"png",quality:1,meta:s});let c=new Image;if(c.decoding="sync",c.loading="eager",c.src=t,await c.decode(),a&&i)c.style.width=`${o}px`,c.style.height=`${r}px`;else if(a){let u=Number.isFinite(s.w0)?s.w0:c.naturalWidth,f=Number.isFinite(s.h0)?s.h0:c.naturalHeight,m=o/Math.max(1,u);c.style.width=`${o}px`,c.style.height=`${Math.round(f*m)}px`}else if(i){let u=Number.isFinite(s.w0)?s.w0:c.naturalWidth,f=Number.isFinite(s.h0)?s.h0:c.naturalHeight,m=r/Math.max(1,f);c.style.height=`${r}px`,c.style.width=`${Math.round(u*m)}px`}else n!==1&&(c.style.width=`${Math.round(c.naturalWidth*n)}px`,c.style.height=`${Math.round(c.naturalHeight*n)}px`);return c}async function Gt(t,e){let n=e.type;if(n==="svg"){let s=decodeURIComponent(t.split(",")[1]);return new Blob([s],{type:"image/svg+xml"})}let o=await ft(t,e),r=e.backgroundColor?pt(o,e.backgroundColor):o;return new Promise(s=>r.toBlob(a=>s(a),`image/${n}`,e.quality))}async function Ve(t,e){if(e.dpr=1,e.format==="svg"){let s=await Gt(t,{...e,type:"svg"}),a=URL.createObjectURL(s),i=document.createElement("a");i.href=a,i.download=e.filename,i.click(),URL.revokeObjectURL(a);return}let n=await ft(t,e),o=e.backgroundColor?pt(n,e.backgroundColor):n,r=document.createElement("a");r.href=o.toDataURL(`image/${e.format}`,e.quality),r.download=e.filename,r.click()}var ze=Symbol("snapdom.internal"),ge=!1;async function B(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=He(e);if(z()&&(n.embedFonts===!0||wo(t)))for(let o=0;o<3;o++)try{await yo(t,e),console.log("Iteraci\xF3n n\xFAmero:",o),ge=!1}catch{}return n.iconFonts&&n.iconFonts.length>0&&ve(n.iconFonts),n.snap||(n.snap={toPng:(o,r)=>B.toPng(o,r),toImg:(o,r)=>B.toImg(o,r)}),B.capture(t,n,ze)}B.capture=async(t,e,n)=>{if(n!==ze)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let o=await pe(t,e),r=a=>({...e,...a||{}}),s=a=>i=>{let l=r({...i||{},format:a}),c=a==="jpeg"||a==="jpg",u=l.backgroundColor==null||l.backgroundColor==="transparent";return c&&u&&(l.backgroundColor="#ffffff"),Yt(o,l)};return{url:o,toRaw:()=>o,toImg:a=>je(o,r(a)),toCanvas:a=>ft(o,r(a)),toBlob:a=>Gt(o,r(a)),toPng:s("png"),toJpg:s("jpeg"),toWebp:s("webp"),download:a=>Ve(o,r(a))}};B.toRaw=(t,e)=>B(t,e).then(n=>n.toRaw());B.toImg=(t,e)=>B(t,e).then(n=>n.toImg());B.toCanvas=(t,e)=>B(t,e).then(n=>n.toCanvas());B.toBlob=(t,e)=>B(t,e).then(n=>n.toBlob());B.toPng=(t,e)=>B(t,{...e,format:"png"}).then(n=>n.toPng());B.toJpg=(t,e)=>B(t,{...e,format:"jpeg"}).then(n=>n.toJpg());B.toWebp=(t,e)=>B(t,{...e,format:"webp"}).then(n=>n.toWebp());B.download=(t,e)=>B(t,e).then(n=>n.download());async function yo(t,e){if(ge)return;let n={...e,fast:!0,embedFonts:!0,scale:.2},o;try{o=await pe(t,n)}catch{return}await new Promise(r=>{let s=new Image;s.decoding="sync",s.loading="eager",s.style.position="fixed",s.style.left=0,s.style.top=0,s.style.width="10px",s.style.height="10px",s.style.opacity="0.01",s.style.transform="translateZ(10px)",s.style.willChange="transform,opacity;",s.src=o;let a=async()=>{await new Promise(i=>setTimeout(i,100)),s&&s.parentNode&&s.parentNode.removeChild(s),ge=!0,r()};document.body.appendChild(s),a()})}function wo(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,o=getComputedStyle(n),r=o.backgroundImage&&o.backgroundImage!=="none",s=o.maskImage&&o.maskImage!=="none"||o.webkitMaskImage&&o.webkitMaskImage!=="none";if(r||s)return!0}return!1}async function bo(t=document,e={}){let{embedFonts:n=!0,useProxy:o=""}=e,r=e.cache??e.cacheOpt??"full";_t(r);try{await document.fonts?.ready}catch{}try{ee()}catch{}h.session=h.session||{},h.session.styleCache||(h.session.styleCache=new WeakMap),h.image=h.image||new Map;try{await Xt(t,void 0,h.session.styleCache,{useProxy:o})}catch{}let s=[],a=[];try{t?.querySelectorAll&&(s=Array.from(t.querySelectorAll("img[src]")),a=Array.from(t.querySelectorAll("*")))}catch{}let i=[];for(let l of s){let c=l?.currentSrc||l?.src;if(c&&!h.image.has(c)){let u=Promise.resolve().then(async()=>{let f=await V(c,{as:"dataURL",useProxy:o});f?.ok&&typeof f.data=="string"&&h.image.set(c,f.data)}).catch(()=>{});i.push(u)}}for(let l of a){let c="";try{c=yt(l).backgroundImage}catch{}if(c&&c!=="none"){let u=wt(c);for(let f of u)if(f.startsWith("url(")){let m=Promise.resolve().then(()=>gt(f,{...e,useProxy:o})).catch(()=>{});i.push(m)}}}if(n)try{let l=qt(t),c=jt(t);if(typeof z=="function"?z():!!z){let f=new Set(Array.from(l).map(m=>String(m).split("__")[0]).filter(Boolean));await Vt(f,2)}await Ht({required:l,usedCodepoints:c,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:e.useProxy??o})}catch{}await Promise.allSettled(i)}export{bo as preCache,B as snapdom};
4
+ `}catch{}}catch{}return e}function $n(t,e,n){if(!e)return;let o=document.createElement("style");o.setAttribute("data-sd",n),o.textContent=e,t.insertBefore(o,t.firstChild||null)}function En(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch{}}function Fn(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,o;for(;o=n.exec(t);)e.add(o[1]);return e}function vn(t,e){try{let o=getComputedStyle(t).getPropertyValue(e).trim();if(o)return o}catch{}try{let o=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(o)return o}catch{}return""}function Nn(t,e,n){let o=[];for(let r of e){let a=vn(t,r);a&&o.push(`${r}: ${a};`)}return o.length?`${n}{${o.join("")}}
5
+ `:""}function Ln(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}async function Rn(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(a=>setTimeout(a,0)),o=n(),r++;return o&&(o.body||o.documentElement)?o:null}function In(t){let e=t.getBoundingClientRect(),n=0,o=0,r=0,a=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,o=parseFloat(c.borderRightWidth)||0,r=parseFloat(c.borderTopWidth)||0,a=parseFloat(c.borderBottomWidth)||0}catch{}let s=Math.max(0,Math.round(e.width-(n+o))),l=Math.max(0,Math.round(e.height-(r+a)));return{contentWidth:s,contentHeight:l,rect:e}}function Tn(t,e,n){let o=t.createElement("style");return o.setAttribute("data-sd-iframe-pin",""),o.textContent=`html, body {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;}`,(t.head||t.documentElement).appendChild(o),()=>{try{o.remove()}catch{}}}async function Wn(t,e,n){let o=await Rn(t,3);if(!o)throw new Error("iframe document not accessible/ready");let{contentWidth:r,contentHeight:a,rect:s}=In(t),l=n?.snap;if(!l||typeof l.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let c={...n,scale:1},i=Tn(o,r,a),u;try{u=await l.toPng(o.documentElement,c)}finally{i()}u.style.display="block",u.style.width=`${r}px`,u.style.height=`${a}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),bt(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(s.width)}px`),f.style.height||(f.style.height=`${Math.round(s.height)}px`),f.appendChild(u),f}async function Ft(t,e,n){if(!t)throw new Error("Invalid node");let o=new Set,r=null,a=null;if(t.nodeType===Node.ELEMENT_NODE){let i=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Ut.has(i))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"){let i=document.createElement("div"),u=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${u.width}px;height:${u.height}px;visibility:hidden;`,i}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let i of n.exclude)try{if(t.matches?.(i)){if(n.excludeMode==="hide"){let u=document.createElement("div"),f=t.getBoundingClientRect();return u.style.cssText=`display:inline-block;width:${f.width}px;height:${f.height}px;visibility:hidden;`,u}else if(n.excludeMode==="remove")return null}}catch(u){console.warn(`Invalid selector in exclude option: ${i}`,u)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let i=document.createElement("div"),u=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${u.width}px;height:${u.height}px;visibility:hidden;`,i}else if(n.filterMode==="remove")return null}}catch(i){console.warn("Error in filter function:",i)}if(t.tagName==="IFRAME"){let i=!1;try{i=!!(t.contentDocument||t.contentWindow?.document)}catch{i=!1}if(i)try{return await Wn(t,e,n)}catch(u){console.warn("[SnapDOM] iframe rasterization failed, fallback:",u)}if(n.placeholders){let u=document.createElement("div");return u.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}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;`,bt(t,u,e,n),u}else{let u=t.getBoundingClientRect(),f=document.createElement("div");return f.style.cssText=`display:inline-block;width:${u.width}px;height:${u.height}px;visibility:hidden;`,bt(t,f,e,n),f}}if(t.getAttribute("data-capture")==="placeholder"){let i=t.cloneNode(!1);e.nodeMap.set(i,t),bt(t,i,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;",i.appendChild(u),i}if(t.tagName==="CANVAS"){let i=t.toDataURL(),u=document.createElement("img");return u.src=i,u.width=t.width,u.height=t.height,e.nodeMap.set(u,t),bt(t,u,e,n),u}let s;try{if(s=t.cloneNode(!1),e.nodeMap.set(s,t),t.tagName==="IMG"){En(t,s);try{let i=t.getBoundingClientRect(),u=Math.round(i.width||0),f=Math.round(i.height||0);if(!u||!f){let m=window.getComputedStyle(t),x=parseFloat(m.width)||0,C=parseFloat(m.height)||0,S=parseInt(t.getAttribute("width")||"",10)||0,p=parseInt(t.getAttribute("height")||"",10)||0,M=t.width||t.naturalWidth||0,k=t.height||t.naturalHeight||0;u=Math.round(u||x||S||M||0),f=Math.round(f||C||p||k||0)}u&&(s.dataset.snapdomWidth=String(u)),f&&(s.dataset.snapdomHeight=String(f))}catch{}}}catch(i){throw console.error("[Snapdom] Failed to clone node:",t,i),i}if(t instanceof HTMLTextAreaElement){let i=t.getBoundingClientRect();s.style.width=`${i.width}px`,s.style.height=`${i.height}px`}if(t instanceof HTMLInputElement&&(s.value=t.value,s.setAttribute("value",t.value),t.checked!==void 0&&(s.checked=t.checked,t.checked&&s.setAttribute("checked",""),t.indeterminate&&(s.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(r=t.value),t instanceof HTMLTextAreaElement&&(a=t.value),bt(t,s,e,n),t.shadowRoot){let p=function(k,E){if(k.nodeType===Node.ELEMENT_NODE&&k.tagName==="STYLE")return E(null);Ft(k,e,n).then(W=>{E(W||null)}).catch(W=>{E(null)})};try{let k=t.shadowRoot.querySelectorAll("slot");for(let E of k){let W=[];try{W=E.assignedNodes?.({flatten:!0})||E.assignedNodes?.()||[]}catch{W=E.assignedNodes?.()||[]}for(let z of W)o.add(z)}}catch{}let i=Mn(e),u=`[data-sd="${i}"]`;try{s.setAttribute("data-sd",i)}catch{}let f=An(t.shadowRoot),m=kn(f,u),x=Fn(f),C=Nn(t,x,u);$n(s,C+m,i);let S=document.createDocumentFragment(),M=await ce(Array.from(t.shadowRoot.childNodes),p,n.fast);S.append(...M.filter(k=>!!k)),s.appendChild(S)}if(t.tagName==="SLOT"){let m=function(C,S){Ft(C,e,n).then(p=>{p&&Ln(p),S(p||null)}).catch(p=>{S(null)})},i=t.assignedNodes?.({flatten:!0})||[],u=i.length>0?i:Array.from(t.childNodes),f=document.createDocumentFragment(),x=await ce(Array.from(u),m,n.fast);return f.append(...x.filter(C=>!!C)),f}function l(i,u){if(o.has(i))return u(null);Ft(i,e,n).then(f=>{u(f||null)}).catch(f=>{u(null)})}let c=await ce(Array.from(t.childNodes),l,n.fast);if(s.append(...c.filter(i=>!!i)),r!==null&&s instanceof HTMLSelectElement){s.value=r;for(let i of s.options)i.value===r?i.setAttribute("selected",""):i.removeAttribute("selected")}return a!==null&&s instanceof HTMLTextAreaElement&&(s.textContent=a),s}var _n=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],le=[];function ve(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?le.push(n):typeof n=="string"?le.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function et(t){let e=typeof t=="string"?t:"",n=[..._n,...le];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))}async function Ne(t,e,n,o=32,r="#000"){e=e.replace(/^['"]+|['"]+$/g,"");let a=window.devicePixelRatio||1;await document.fonts.ready;let s=document.createElement("span");s.textContent=t,s.style.position="absolute",s.style.visibility="hidden",s.style.fontFamily=`"${e}"`,s.style.fontWeight=n||"normal",s.style.fontSize=`${o}px`,s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.padding="0",s.style.margin="0",document.body.appendChild(s);let l=s.getBoundingClientRect(),c=Math.ceil(l.width),i=Math.ceil(l.height);document.body.removeChild(s);let u=document.createElement("canvas");u.width=c*a,u.height=i*a;let f=u.getContext("2d");return f.scale(a,a),f.font=n?`${n} ${o}px "${e}"`:`${o}px "${e}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=r,f.fillText(t,0,0),{dataUrl:u.toDataURL(),width:c,height:i}}var Pn=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Ot(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!Pn.has(n.toLowerCase()))return n}return""}function Ht(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 ue(t){let e=String(t??"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function Un(t){let e=String(t??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function Bn(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let r=Ht(n[1]),a=Ht(n[2]);return{min:Math.min(r,a),max:Math.max(r,a)}}let o=Ht(e);return{min:o,max:o}}function On(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Hn(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let a=parseFloat(n[1]),s=parseFloat(n[2]);return{min:Math.min(a,s),max:Math.max(a,s)}}let o=e.match(/(\d+(?:\.\d+)?)\s*%/),r=o?parseFloat(o[1]):100;return{min:r,max:r}}function Dn(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let r=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(l=>r.endsWith(l)))return!0;let s=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(s)||/\.woff2?(\b|$)/.test(s))return!0;for(let l of e){let c=l.toLowerCase().replace(/\s+/g,"+"),i=l.toLowerCase().replace(/\s+/g,"-");if(s.includes(c)||s.includes(i))return!0}return!1}catch{return!1}}function qn(t){let e=new Set;for(let n of t||[]){let o=String(n).split("__")[0]?.trim();o&&e.add(o)}return e}async function Dt({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:o=[],useProxy:r=""}={}){t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let a=new Map;for(let d of t){let[b,w,A,g]=String(d).split("__");if(!b)continue;let y=a.get(b)||[];y.push({w:parseInt(w,10),s:A,st:parseInt(g,10)}),a.set(b,y)}let s=/@import\s+url\(["']?([^"')]+)["']?\)/g,l=/url\((["']?)([^"')]+)\1\)/g,c=/@font-face[^{}]*\{[^}]*\}/g;function i(d,b,w,A){if(!a.has(d))return!1;let g=a.get(d),y=Bn(w),F=On(b),v=Hn(A),$=y.min!==y.max,R=y.min,P=T=>F.kind==="normal"&&T==="normal"||F.kind!=="normal"&&(T==="italic"||T==="oblique"),q=!1;for(let T of g){let N=$?T.w>=y.min&&T.w<=y.max:T.w===R,I=P(ue(T.s)),U=T.st>=v.min&&T.st<=v.max;if(N&&I&&U){q=!0;break}}if(q)return!0;if(!$)for(let T of g){let N=P(ue(T.s)),I=T.st>=v.min&&T.st<=v.max;if(Math.abs(R-T.w)<=300&&N&&I)return!0}return!1}function u(d){if(!d)return[];let b=[],w=d.split(",").map(A=>A.trim()).filter(Boolean);for(let A of w){let g=A.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!g)continue;let y=g[1],F=g[2],v=$=>{if(!$.includes("?"))return parseInt($,16);let R=parseInt($.replace(/\?/g,"0"),16),P=parseInt($.replace(/\?/g,"F"),16);return[R,P]};if(F){let $=v(y),R=v(F),P=Array.isArray($)?$[0]:$,q=Array.isArray(R)?R[1]:R;b.push([Math.min(P,q),Math.max(P,q)])}else{let $=v(y);Array.isArray($)?b.push([$[0],$[1]]):b.push([$,$])}}return b}function f(d,b){if(!b.length||!d||d.size===0)return!0;for(let w of d)for(let[A,g]of b)if(w>=A&&w<=g)return!0;return!1}function m(d,b){let w=[];if(!d)return w;for(let A of d.matchAll(l)){let g=(A[2]||"").trim();if(!(!g||g.startsWith("data:"))){if(!/^https?:/i.test(g))try{g=new URL(g,b||location.href).href}catch{}w.push(g)}}return w}async function x(d,b){let w=d;for(let A of d.matchAll(l)){let g=ht(A[0]);if(!g)continue;let y=g;if(!y.startsWith("http")&&!y.startsWith("data:"))try{y=new URL(y,b||location.href).href}catch{}if(!et(y)){if(h.resource?.has(y)){h.font?.add(y),w=w.replace(A[0],`url(${h.resource.get(y)})`);continue}if(!h.font?.has(y))try{let F=await V(y,{as:"dataURL",useProxy:r,silent:!0});if(F.ok&&typeof F.data=="string"){let v=F.data;h.resource?.set(y,v),h.font?.add(y),w=w.replace(A[0],`url(${v})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",y)}}}return w}function C(d){if(!d.length)return null;let b=(v,$)=>d.some(([R,P])=>!(P<v||R>$)),w=b(0,255)||b(305,305),A=b(256,591)||b(7680,7935),g=b(880,1023),y=b(1024,1279);return b(7840,7929)||b(258,259)||b(416,417)||b(431,432)?"vietnamese":y?"cyrillic":g?"greek":A?"latin-ext":w?"latin":null}function S(d={}){let b=new Set((d.families||[]).map(g=>String(g).toLowerCase())),w=new Set((d.domains||[]).map(g=>String(g).toLowerCase())),A=new Set((d.subsets||[]).map(g=>String(g).toLowerCase()));return(g,y)=>{if(b.size&&b.has(g.family.toLowerCase()))return!0;if(w.size)for(let F of g.srcUrls)try{if(w.has(new URL(F).host.toLowerCase()))return!0}catch{}if(A.size){let F=C(y);if(F&&A.has(F))return!0}return!1}}let p=S(n);function M(d){if(!d)return d;let b=/@font-face[^{}]*\{[^}]*\}/gi,w=new Set,A=[];for(let y of d.match(b)||[]){let F=y.match(/font-family:\s*([^;]+);/i)?.[1]||"",v=Ot(F),$=(y.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),R=(y.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),P=(y.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),q=(y.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),T=(y.match(/src\s*:\s*([^;]+);/i)?.[1]||"").trim(),N=m(T,location.href),I=N.length?N.map(j=>String(j).toLowerCase()).sort().join("|"):T.toLowerCase(),U=[String(v||"").toLowerCase(),$,R,P,q.toLowerCase(),I].join("|");w.has(U)||(w.add(U),A.push(y))}if(A.length===0)return d;let g=0;return d.replace(b,()=>A[g++]||"")}function k(){let d=Array.from(t||[]).sort().join("|"),b=n?JSON.stringify({families:(n.families||[]).map(g=>String(g).toLowerCase()).sort(),domains:(n.domains||[]).map(g=>String(g).toLowerCase()).sort(),subsets:(n.subsets||[]).map(g=>String(g).toLowerCase()).sort()}):"",w=(o||[]).map(g=>`${(g.family||"").toLowerCase()}::${g.weight||"normal"}::${g.style||"normal"}::${g.src||""}`).sort().join("|");return`fonts-embed-css::req=${d}::ex=${b}::lf=${w}::px=${r||""}`}let E=k();if(h.resource?.has(E))return h.resource.get(E);let W=qn(t),z=[];for(let d of document.querySelectorAll("style")){let b=d.textContent||"";for(let w of b.matchAll(s)){let A=w[1];if(!A||et(A))continue;!!document.querySelector(`link[rel="stylesheet"][href="${A}"]`)||z.push(A)}}z.length&&await Promise.all(z.map(d=>new Promise(b=>{if(document.querySelector(`link[rel="stylesheet"][href="${d}"]`))return b(null);let w=document.createElement("link");w.rel="stylesheet",w.href=d,w.setAttribute("data-snapdom","injected-import"),w.onload=()=>b(w),w.onerror=()=>b(null),document.head.appendChild(w)})));let B="",L=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(d=>!!d.href);for(let d of L)try{if(et(d.href))continue;let b="",w=!1;try{w=new URL(d.href,location.href).origin===location.origin}catch{}if(!w&&!Dn(d.href,W))continue;if(w){let g=Array.from(document.styleSheets).find(y=>y.href===d.href);if(g)try{let y=g.cssRules||[];b=Array.from(y).map(F=>F.cssText).join("")}catch{}}if(!b&&(b=(await V(d.href,{as:"text",useProxy:r})).data,et(d.href)))continue;let A="";for(let g of b.match(c)||[]){let y=(g.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),F=Ot(y);if(!F||et(F))continue;let v=(g.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),$=(g.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),R=(g.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),P=(g.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),q=(g.match(/src\s*:\s*([^;]+);/i)?.[1]||"").trim(),T=m(q,d.href);if(!i(F,$,v,R))continue;let N=u(P);if(!f(e,N))continue;let I={family:F,weightSpec:v,styleSpec:$,stretchSpec:R,unicodeRange:P,srcRaw:q,srcUrls:T,href:d.href};if(n&&p(I,N))continue;let U=/url\(/i.test(q)?await x(g,d.href):g;A+=U+""}A.trim()&&(B+=A+"")}catch{console.warn("[snapdom] Failed to process stylesheet:",d.href)}for(let d of document.styleSheets)try{if(d.href&&L.some(w=>w.href===d.href))continue;let b=d.cssRules||[];for(let w of b){if(w.type!==CSSRule.FONT_FACE_RULE)continue;let A=(w.style.getPropertyValue("font-family")||"").trim(),g=Ot(A);if(!g||et(g))continue;let y=(w.style.getPropertyValue("font-weight")||"400").trim(),F=(w.style.getPropertyValue("font-style")||"normal").trim(),v=(w.style.getPropertyValue("font-stretch")||"100%").trim(),$=(w.style.getPropertyValue("src")||"").trim(),R=(w.style.getPropertyValue("unicode-range")||"").trim(),P=m($,d.href||location.href);if(!i(g,F,y,v))continue;let q=u(R);if(!f(e,q))continue;let T={family:g,weightSpec:y,styleSpec:F,stretchSpec:v,unicodeRange:R,srcRaw:$,srcUrls:P,href:d.href||location.href};if(!(n&&p(T,q)))if(/url\(/i.test($)){let N=await x($,d.href||location.href);B+=`@font-face{font-family:${g};src:${N};font-style:${F};font-weight:${y};font-stretch:${v};${R?`unicode-range:${R};`:""}}`}else B+=`@font-face{font-family:${g};src:${$};font-style:${F};font-weight:${y};font-stretch:${v};${R?`unicode-range:${R};`:""}}`}}catch{}try{for(let d of document.fonts||[]){if(!d||!d.family||d.status!=="loaded"||!d._snapdomSrc)continue;let b=String(d.family).replace(/^['"]+|['"]+$/g,"");if(et(b)||!a.has(b)||n?.families&&n.families.some(A=>String(A).toLowerCase()===b.toLowerCase()))continue;let w=d._snapdomSrc;if(!String(w).startsWith("data:")){if(h.resource?.has(d._snapdomSrc))w=h.resource.get(d._snapdomSrc),h.font?.add(d._snapdomSrc);else if(!h.font?.has(d._snapdomSrc))try{let A=await V(d._snapdomSrc,{as:"dataURL",useProxy:r,silent:!0});if(A.ok&&typeof A.data=="string")w=A.data,h.resource?.set(d._snapdomSrc,w),h.font?.add(d._snapdomSrc);else continue}catch{console.warn("[snapdom] Failed to fetch dynamic font src:",d._snapdomSrc);continue}}B+=`@font-face{font-family:'${b}';src:url(${w});font-style:${d.style||"normal"};font-weight:${d.weight||"normal"};}`}}catch{}for(let d of o){if(!d||typeof d!="object")continue;let b=String(d.family||"").replace(/^['"]+|['"]+$/g,"");if(!b||et(b)||!a.has(b)||n?.families&&n.families.some(v=>String(v).toLowerCase()===b.toLowerCase()))continue;let w=d.weight!=null?String(d.weight):"normal",A=d.style!=null?String(d.style):"normal",g=d.stretchPct!=null?`${d.stretchPct}%`:"100%",y=String(d.src||""),F=y;if(!F.startsWith("data:")){if(h.resource?.has(y))F=h.resource.get(y),h.font?.add(y);else if(!h.font?.has(y))try{let v=await V(y,{as:"dataURL",useProxy:r,silent:!0});if(v.ok&&typeof v.data=="string")F=v.data,h.resource?.set(y,F),h.font?.add(y);else continue}catch{console.warn("[snapdom] Failed to fetch localFonts src:",y);continue}}B+=`@font-face{font-family:'${b}';src:url(${F});font-style:${A};font-weight:${w};font-stretch:${g};}`}return B&&(B=M(B),h.resource?.set(E,B)),B}function qt(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),o=s=>{let l=Ot(s.fontFamily);if(!l)return;let c=(i,u,f)=>`${l}__${Ht(i)}__${ue(u)}__${Un(f)}`;e.add(c(s.fontWeight,s.fontStyle,s.fontStretch))};o(getComputedStyle(t));let r=getComputedStyle(t,"::before");r&&r.content&&r.content!=="none"&&o(r);let a=getComputedStyle(t,"::after");for(a&&a.content&&a.content!=="none"&&o(a);n.nextNode();){let s=n.currentNode,l=getComputedStyle(s);o(l);let c=getComputedStyle(s,"::before");c&&c.content&&c.content!=="none"&&o(c);let i=getComputedStyle(s,"::after");i&&i.content&&i.content!=="none"&&o(i)}return e}function jt(t){let e=new Set,n=r=>{if(r)for(let a of r)e.add(a.codePointAt(0))},o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){let r=o.currentNode;if(r.nodeType===Node.TEXT_NODE)n(r.nodeValue||"");else if(r.nodeType===Node.ELEMENT_NODE){let a=r;for(let s of["::before","::after"]){let c=getComputedStyle(a,s)?.getPropertyValue("content");if(!(!c||c==="none"))if(/^"/.test(c)||/^'/.test(c))n(c.slice(1,-1));else{let i=c.match(/\\[0-9A-Fa-f]{1,6}/g);if(i)for(let u of i)try{e.add(parseInt(u.slice(1),16))}catch{}}}}}return e}async function zt(t,e=2){try{await document.fonts.ready}catch{}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let o=()=>{let r=document.createElement("div");r.style.cssText="position: absolute !important;left: -9999px !important;top: 0 !important;opacity: 0 !important;pointer-events: none !important;contain: layout size style;";for(let a of n){let s=document.createElement("span");s.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",s.style.fontFamily=`"${a}"`,s.style.fontWeight="700",s.style.fontStyle="italic",s.style.fontSize="32px",s.style.lineHeight="1",s.style.whiteSpace="nowrap",s.style.margin="0",s.style.padding="0",r.appendChild(s)}document.body.appendChild(r),r.offsetWidth,document.body.removeChild(r)};for(let r=0;r<Math.max(1,e);r++)o(),await new Promise(a=>requestAnimationFrame(()=>requestAnimationFrame(a)))}function Te(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function jn(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function Le(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 Re(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[a,s]of n)for(;o>=a;)r+=s,o-=a;return e?r:r.toLowerCase()}function Ie(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return Le(t,!1);case"upper-alpha":return Le(t,!0);case"lower-roman":return Re(t,!1);case"upper-roman":return Re(t,!0);default:return String(Math.max(0,t))}}function We(t){let e=new WeakMap,n=t instanceof Document?t.documentElement:t,o=i=>i&&i.tagName==="LI",r=i=>{let u=0,f=i?.parentElement;if(!f)return 0;for(let m of f.children){if(m===i)break;m.tagName==="LI"&&u++}return u},a=i=>{let u=new Map;for(let[f,m]of i)u.set(f,m.slice());return u},s=(i,u,f)=>{let m=a(i),x;try{x=f.style?.counterReset||getComputedStyle(f).counterReset}catch{}if(x&&x!=="none")for(let S of x.split(",")){let p=S.trim().split(/\s+/),M=p[0],k=Number.isFinite(Number(p[1]))?Number(p[1]):0;if(!M)continue;let E=u.get(M);if(E&&E.length){let W=E.slice();W.push(k),m.set(M,W)}else m.set(M,[k])}let C;try{C=f.style?.counterIncrement||getComputedStyle(f).counterIncrement}catch{}if(C&&C!=="none")for(let S of C.split(",")){let p=S.trim().split(/\s+/),M=p[0],k=Number.isFinite(Number(p[1]))?Number(p[1]):1;if(!M)continue;let E=m.get(M)||[];E.length===0&&E.push(0),E[E.length-1]+=k,m.set(M,E)}try{if(getComputedStyle(f).display==="list-item"&&o(f)){let p=f.parentElement,M=1;if(p&&p.tagName==="OL"){let E=p.getAttribute("start"),W=Number.isFinite(Number(E))?Number(E):1,z=r(f),B=f.getAttribute("value");M=Number.isFinite(Number(B))?Number(B):W+z}else M=1+r(f);let k=m.get("list-item")||[];k.length===0&&k.push(0),k[k.length-1]=M,m.set("list-item",k)}}catch{}return m},l=(i,u,f)=>{let m=s(f,u,i);e.set(i,m);let x=m;for(let C of i.children)x=l(C,m,x);return m},c=new Map;return l(n,c,c),{get(i,u){let f=e.get(i)?.get(u);return f&&f.length?f[f.length-1]:0},getStack(i,u){let f=e.get(i)?.get(u);return f?f.slice():[]}}}function _e(t,e,n){if(!t||t==="none")return t;try{let o=/\b(counter|counters)\s*\(([^)]+)\)/g,r=t.replace(o,(a,s,l)=>{let c=String(l).split(",").map(i=>i.trim());if(s==="counter"){let i=c[0]?.replace(/^["']|["']$/g,""),u=(c[1]||"decimal").toLowerCase(),f=n.get(e,i);return Ie(f,u)}else{let i=c[0]?.replace(/^["']|["']$/g,""),u=c[1]?.replace(/^["']|["']$/g,"")??"",f=(c[2]||"decimal").toLowerCase(),m=n.getStack(e,i);return m.length?m.map(C=>Ie(C,f)).join(u):""}});return jn(r)}catch{return"- "}}var vt=null,Nt=new WeakMap;function zn(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function Vn(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,o;for(;o=n.exec(t);)e.push(o[1]);return e.length?e.join(""):zn(t)}function fe(t,e){let n=t.parentElement,o=n?Nt.get(n):null;return o?{get(r,a){let s=e.get(r,a),l=o.get(a);return typeof l=="number"?Math.max(s,l):s},getStack(r,a){let s=e.getStack(r,a);if(!s.length)return s;let l=o.get(a);if(typeof l=="number"){let c=s.slice();return c[c.length-1]=Math.max(c[c.length-1],l),c}return s}}:e}function de(t,e,n){let o=new Map;function r(c){let i=[];if(!c||c==="none")return i;for(let u of String(c).split(",")){let f=u.trim().split(/\s+/),m=f[0],x=Number.isFinite(Number(f[1]))?Number(f[1]):void 0;m&&i.push({name:m,num:x})}return i}let a=r(e?.counterReset),s=r(e?.counterIncrement);function l(c){if(o.has(c))return o.get(c).slice();let i=n.getStack(t,c);i=i.length?i.slice():[];let u=a.find(m=>m.name===c);if(u){let m=Number.isFinite(u.num)?u.num:0;i=i.length?[...i,m]:[m]}let f=s.find(m=>m.name===c);if(f){let m=Number.isFinite(f.num)?f.num:1;i.length===0&&(i=[0]),i[i.length-1]+=m}return o.set(c,i.slice()),i}return{get(c,i){let u=l(i);return u.length?u[u.length-1]:0},getStack(c,i){return l(i)},__incs:s}}function Xn(t,e,n){let o;try{o=getComputedStyle(t,e)}catch{}let r=o?.content;if(!r||r==="none"||r==="normal")return{text:"",incs:[]};let a=fe(t,n),s=de(t,o,a),l=Te(r)?_e(r,t,s):r;return{text:Vn(l),incs:s.__incs||[]}}async function me(t,e,n,o){if(!(t instanceof Element)||!(e instanceof Element))return;if(!vt)try{vt=We(t.ownerDocument||document)}catch{}for(let s of["::before","::after","::first-letter"])try{let l=yt(t,s);if(!l||typeof l[Symbol.iterator]!="function"||l.content==="none"&&l.backgroundImage==="none"&&l.backgroundColor==="transparent"&&(l.borderStyle==="none"||parseFloat(l.borderWidth)===0)&&(!l.transform||l.transform==="none")&&l.display==="inline")continue;if(s==="::first-letter"){let N=getComputedStyle(t);if(!(l.color!==N.color||l.fontSize!==N.fontSize||l.fontWeight!==N.fontWeight))continue;let U=Array.from(e.childNodes).find(Q=>Q.nodeType===Node.TEXT_NODE&&Q.textContent?.trim().length>0);if(!U)continue;let j=U.textContent,rt=j.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],It=j.slice(rt?.length||0);if(!rt||/[\uD800-\uDFFF]/.test(rt))continue;let xt=document.createElement("span");xt.textContent=rt,xt.dataset.snapdomPseudo="::first-letter";let Kt=Bt(l),Tt=$t(Kt,"span");n.styleMap.set(xt,Tt);let J=document.createTextNode(It);e.replaceChild(J,U),e.insertBefore(xt,J);continue}let i=l.content,{text:u,incs:f}=Xn(t,s,vt),m=l.backgroundImage,x=l.backgroundColor,C=l.fontFamily,S=parseInt(l.fontSize)||32,p=parseInt(l.fontWeight)||!1,M=l.color||"#000",k=l.display,E=parseFloat(l.width),W=parseFloat(l.height),z=l.borderStyle,B=parseFloat(l.borderWidth),L=l.transform,d=et(C),b=i!=="none"&&u!=="",w=m&&m!=="none",A=x&&x!=="transparent"&&x!=="rgba(0, 0, 0, 0)",g=k!=="inline"&&(E>0||W>0),y=z&&z!=="none"&&B>0,F=L&&L!=="none";if(!(b||w||A||y||F)){if(f&&f.length&&t.parentElement){let N=Nt.get(t.parentElement)||new Map;for(let{name:I,num:U}of f){if(!I)continue;let j=fe(t,vt),rt=de(t,getComputedStyle(t,s),j).get(t,I);N.set(I,rt)}Nt.set(t.parentElement,N)}continue}let $=document.createElement("span");$.dataset.snapdomPseudo=s,$.style.verticalAlign="middle",$.style.pointerEvents="none";let R=Bt(l),P=$t(R,"span");if(n.styleMap.set($,P),d&&u&&u.length===1){let{dataUrl:N,width:I,height:U}=await Ne(u,C,p,S,M),j=document.createElement("img");j.src=N,j.style=`height:${S}px;width:${I/U*S}px;object-fit:contain;`,$.appendChild(j),e.dataset.snapdomHasIcon="true"}else if(u&&u.startsWith("url(")){let N=ht(u);if(N?.trim())try{let I=document.createElement("img"),U=await V(ut(N),{as:"dataURL",useProxy:o.useProxy});I.src=U.data,I.style=`width:${S}px;height:auto;object-fit:contain;`,$.appendChild(I)}catch(I){console.error(`[snapdom] Error in pseudo ${s} for`,t,I)}}else!d&&b&&($.textContent=u);if($.style.background="none","mask"in $.style&&($.style.mask="none"),w)try{let N=wt(m),I=await Promise.all(N.map(gt));$.style.backgroundImage=I.join(", ")}catch(N){console.warn(`[snapdom] Failed to inline background-image for ${s}`,N)}A&&($.style.backgroundColor=x);let T=$.childNodes.length>0||$.textContent?.trim()!==""||w||A||y||F;if(f&&f.length&&t.parentElement){let N=Nt.get(t.parentElement)||new Map,I=fe(t,vt),U=de(t,getComputedStyle(t,s),I);for(let{name:j}of f){if(!j)continue;let it=U.get(t,j);N.set(j,it)}Nt.set(t.parentElement,N)}if(!T)continue;s==="::before"?e.insertBefore($,e.firstChild):e.appendChild($)}catch(l){console.warn(`[snapdom] Failed to capture ${s} for`,t,l)}let r=Array.from(t.children),a=Array.from(e.children).filter(s=>!s.dataset.snapdomPseudo);for(let s=0;s<Math.min(r.length,a.length);s++)await me(r[s],a[s],n,o)}function Pe(t){if(!t)return;let e=new Set;if(t.querySelectorAll("use").forEach(l=>{let c=l.getAttribute("xlink:href")||l.getAttribute("href");c&&c.startsWith("#")&&e.add(c.slice(1))}),!e.size)return;let n=Array.from(document.querySelectorAll("svg > symbol, svg > defs")),o=n.filter(l=>l.tagName.toLowerCase()==="symbol"),r=n.filter(l=>l.tagName.toLowerCase()==="defs"),a=t.querySelector("svg.inline-defs-container");a||(a=document.createElementNS("http://www.w3.org/2000/svg","svg"),a.setAttribute("aria-hidden","true"),a.setAttribute("style","position: absolute; width: 0; height: 0; overflow: hidden;"),a.classList.add("inline-defs-container"),t.insertBefore(a,t.firstChild));let s=new Set;t.querySelectorAll("symbol[id], defs > *[id]").forEach(l=>{s.add(l.id)}),e.forEach(l=>{if(s.has(l))return;let c=o.find(i=>i.id===l);if(c){a.appendChild(c.cloneNode(!0)),s.add(l);return}for(let i of r){let u=i.querySelector(`#${CSS.escape(l)}`);if(u){let f=a.querySelector("defs");f||(f=document.createElementNS("http://www.w3.org/2000/svg","defs"),a.appendChild(f)),f.appendChild(u.cloneNode(!0)),s.add(l);break}}})}function Be(t,e){if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let o=t.getBoundingClientRect(),r=t.clientHeight,a="data-snap-ph",s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;s.nextNode();){let l=s.currentNode,c=getComputedStyle(l),i=c.position;if(i!=="sticky"&&i!=="-webkit-sticky")continue;let u=Ue(c.top),f=Ue(c.bottom);if(u==null&&f==null)continue;let m=Yn(l,t),x=Gn(e,m,a);if(!x)continue;let C=l.getBoundingClientRect(),S=C.width,p=C.height,M=C.left-o.left;if(!(S>0&&p>0)||!Number.isFinite(M))continue;let k=u!=null?u+n:n+(r-p-f);if(!Number.isFinite(k))continue;let E=Number.parseInt(c.zIndex,10),W=Number.isFinite(E),z=W?Math.max(E,1)+1:2,B=W?E-1:0,L=x.cloneNode(!1);L.setAttribute(a,"1"),L.style.position="sticky",L.style.left=`${M}px`,L.style.top=`${k}px`,L.style.width=`${S}px`,L.style.height=`${p}px`,L.style.visibility="hidden",L.style.zIndex=String(B),L.style.overflow="hidden",L.style.background="transparent",L.style.boxShadow="none",L.style.filter="none",x.parentElement?.insertBefore(L,x),x.style.position="absolute",x.style.left=`${M}px`,x.style.top=`${k}px`,x.style.bottom="auto",x.style.zIndex=String(z),x.style.pointerEvents="none"}}function Ue(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function Yn(t,e){let n=[];for(let o=t;o&&o!==e;){let r=o.parentElement;if(!r)break;n.push(Array.prototype.indexOf.call(r.children,o)),o=r}return n.reverse()}function Gn(t,e,n){let o=t;for(let r=0;r<e.length;r++)if(o=Kn(o,n)[e[r]],!o)return null;return o instanceof HTMLElement?o:null}function Kn(t,e){let n=[],o=t.children;for(let r=0;r<o.length;r++){let a=o[r];a.hasAttribute(e)||n.push(a)}return n}async function He(t,e={}){let n={styleMap:h.session.styleMap,styleCache:h.session.styleCache,nodeMap:h.session.nodeMap},o,r="",a="";Jn(t);try{Pe(t)}catch(c){console.warn("inlineExternal defs or symbol failed:",c)}try{o=await Ft(t,n,e,t)}catch(c){throw console.warn("deepClone failed:",c),c}try{await me(t,o,n,e)}catch(c){console.warn("inlinePseudoElements failed:",c)}await eo(o);try{let c=o.querySelectorAll("style[data-sd]");for(let i of c)a+=i.textContent||"",i.remove()}catch{}let s=se(n.styleMap);r=Array.from(s.entries()).map(([c,i])=>`.${i}{${c}}`).join(""),r=a+r;for(let[c,i]of n.styleMap.entries()){if(c.tagName==="STYLE")continue;if(c.getRootNode&&c.getRootNode()instanceof ShadowRoot){c.setAttribute("style",i.replace(/;/g,"; "));continue}let u=s.get(i);u&&c.classList.add(u);let f=c.style?.backgroundImage,m=c.dataset?.snapdomHasIcon;f&&f!=="none"&&(c.style.backgroundImage=f),m&&(c.style.verticalAlign="middle",c.style.display="inline")}for(let[c,i]of n.nodeMap.entries()){let u=i.scrollLeft,f=i.scrollTop;if((u||f)&&c instanceof HTMLElement){c.style.overflow="hidden",c.style.scrollbarWidth="none",c.style.msOverflowStyle="none";let x=document.createElement("div");for(x.style.transform=`translate(${-u}px, ${-f}px)`,x.style.willChange="transform",x.style.display="inline-block",x.style.width="100%";c.firstChild;)x.appendChild(c.firstChild);c.appendChild(x)}}let l=o instanceof HTMLElement&&o.firstElementChild instanceof HTMLElement?o.firstElementChild:o;if(Be(t,l),t===n.nodeMap.get(o)){let c=n.styleCache.get(t)||window.getComputedStyle(t);n.styleCache.set(t,c);let i=Zt(c.transform);o.style.margin="0",o.style.top="auto",o.style.left="auto",o.style.right="auto",o.style.bottom="auto",o.style.animation="none",o.style.transition="none",o.style.willChange="auto",o.style.float="none",o.style.clear="none",o.style.transform=i||""}for(let[c,i]of n.nodeMap.entries())i.tagName==="PRE"&&(c.style.marginTop="0",c.style.marginBlockStart="0");return{clone:o,classCSS:r,styleCache:n.styleCache}}function Jn(t){let e=getComputedStyle(t),n=e.outlineStyle,o=e.outlineWidth,r=e.borderStyle,a=e.borderWidth,s=n!=="none"&&parseFloat(o)>0,l=r==="none"||parseFloat(a)===0;s&&l&&(t.style.border=`${o} solid transparent`)}var Lt=new Map;async function Rt(t){if(h.resource?.has(t))return h.resource.get(t);if(Lt.has(t))return Lt.get(t);let e=(async()=>{let n=await V(t,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return h.resource?.set(t,n.data),n.data})();Lt.set(t,e);try{let n=await e;return Lt.set(t,n),n}catch(n){throw Lt.delete(t),n}}var Qn=/\bblob:[^)"'\s]+/g;async function Oe(t){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(Qn)||[]));if(e.length===0)return t;let n=t;for(let o of e)try{let r=await Rt(o);n=n.split(o).join(r)}catch{}return n}function Vt(t){return typeof t=="string"&&t.startsWith("blob:")}function Zn(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 to(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}async function eo(t){if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let s of e)try{let c=s.getAttribute("src")||s.currentSrc||"";if(Vt(c)){let u=await Rt(c);s.setAttribute("src",u)}let i=s.getAttribute("srcset");if(i&&i.includes("blob:")){let u=Zn(i),f=!1;for(let m of u)if(Vt(m.url))try{m.url=await Rt(m.url),f=!0}catch{}f&&s.setAttribute("srcset",to(u))}}catch{}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let s of n)try{let l="http://www.w3.org/1999/xlink",c=s.getAttribute("href")||s.getAttributeNS?.(l,"href");if(Vt(c)){let i=await Rt(c);s.setAttribute("href",i),s.removeAttributeNS?.(l,"href")}}catch{}let o=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let s of o)try{let l=s.getAttribute("style");if(l&&l.includes("blob:")){let c=await Oe(l);s.setAttribute("style",c)}}catch{}let r=t.querySelectorAll?t.querySelectorAll("style"):[];for(let s of r)try{let l=s.textContent||"";l.includes("blob:")&&(s.textContent=await Oe(l))}catch{}let a=["poster"];for(let s of a){let l=t.querySelectorAll?t.querySelectorAll(`[${s}^='blob:']`):[];for(let c of l)try{let i=c.getAttribute(s);Vt(i)&&c.setAttribute(s,await Rt(i))}catch{}}}async function De(t,e={}){let n=Array.from(t.querySelectorAll("img")),o=async r=>{if(!r.getAttribute("src")){let u=r.currentSrc||r.src||"";u&&r.setAttribute("src",u)}r.removeAttribute("srcset"),r.removeAttribute("sizes");let a=r.src||"";if(!a)return;let s=await V(a,{as:"dataURL",useProxy:e.useProxy});if(s.ok&&typeof s.data=="string"&&s.data.startsWith("data:")){r.src=s.data,r.width||(r.width=r.naturalWidth||100),r.height||(r.height=r.naturalHeight||100);return}let{fallbackURL:l}=e||{};if(l)try{let u=parseInt(r.dataset?.snapdomWidth||"",10)||0,f=parseInt(r.dataset?.snapdomHeight||"",10)||0,m=parseInt(r.getAttribute("width")||"",10)||0,x=parseInt(r.getAttribute("height")||"",10)||0,C=parseFloat(r.style?.width||"")||0,S=parseFloat(r.style?.height||"")||0,p=u||C||m||r.width||void 0,M=f||S||x||r.height||void 0,k=typeof l=="function"?await l({width:p,height:M,src:a,element:r}):l;if(k){let E=await V(k,{as:"dataURL",useProxy:e.useProxy});r.src=E.data,!r.width&&p&&(r.width=p),!r.height&&M&&(r.height=M),r.width||(r.width=r.naturalWidth||100),r.height||(r.height=r.naturalHeight||100);return}}catch{}let c=r.width||r.naturalWidth||100,i=r.height||r.naturalHeight||100;if(e.placeholders!==!1){let u=document.createElement("div");u.style.cssText=[`width:${c}px`,`height:${i}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${i}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),u.textContent="img",r.replaceWith(u)}else{let u=document.createElement("div");u.style.cssText=`display:inline-block;width:${c}px;height:${i}px;visibility:hidden;`,r.replaceWith(u)}};for(let r=0;r<n.length;r+=4){let a=n.slice(r,r+4).map(o);await Promise.allSettled(a)}}async function Xt(t,e,n,o={}){let r=[[t,e]],a=["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"],s=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],l=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;r.length;){let[c,i]=r.shift(),u=n.get(c)||yt(c);n.has(c)||n.set(c,u);let f=(()=>{let C=u.getPropertyValue("border-image"),S=u.getPropertyValue("border-image-source");return C&&C!=="none"||S&&S!=="none"})();for(let C of a){let S=u.getPropertyValue(C);if(!S||S==="none")continue;let p=wt(S),M=await Promise.all(p.map(k=>gt(k,o)));M.some(k=>k&&k!=="none"&&!/^url\(undefined/.test(k))&&i.style.setProperty(C,M.join(", "))}for(let C of s){let S=u.getPropertyValue(C);!S||S==="initial"||i.style.setProperty(C,S)}if(f)for(let C of l){let S=u.getPropertyValue(C);!S||S==="initial"||i.style.setProperty(C,S)}let m=Array.from(c.children),x=Array.from(i.children);for(let C=0;C<Math.min(m.length,x.length);C++)r.push([m[C],x[C]])}}function qe(t){if(!t)return()=>{};let e=no(t);if(e<=0)return()=>{};if(!so(t))return()=>{};let n=getComputedStyle(t),o=Math.round(oo(n)*e+ro(n)),r=t.textContent??"",a=r;if(t.scrollHeight<=o+.5)return()=>{};let s=0,l=r.length,c=-1;for(;s<=l;){let i=s+l>>1;t.textContent=r.slice(0,i)+"\u2026",t.scrollHeight<=o+.5?(c=i,s=i+1):l=i-1}return t.textContent=(c>=0?r.slice(0,c):"")+"\u2026",()=>{t.textContent=a}}function no(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let o=parseInt(n,10);return Number.isFinite(o)&&o>0?o:0}function oo(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 ro(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function so(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}async function pe(t,e){if(!t)throw new Error("Element cannot be null or undefined");_t(e.cache);let n=e.fast,o,r,a,s="",l="",c,i,u=qe(t);try{({clone:o,classCSS:r,styleCache:a}=await He(t,e))}finally{u()}await new Promise(C=>{at(async()=>{await De(o,e),C()},{fast:n})}),await new Promise(C=>{at(async()=>{await Xt(t,o,a,e),C()},{fast:n})}),e.embedFonts&&await new Promise(C=>{at(async()=>{let S=qt(t),p=jt(t);if(X()){let M=new Set(Array.from(S).map(k=>String(k).split("__")[0]).filter(Boolean));await zt(M,2)}s=await Dt({required:S,usedCodepoints:p,preCached:!1,exclude:e.excludeFonts,useProxy:e.useProxy}),C()},{fast:n})});let f=oe(o).sort(),m=f.join(",");h.baseStyle.has(m)?l=h.baseStyle.get(m):await new Promise(C=>{at(()=>{l=re(f),h.baseStyle.set(m,l),C()},{fast:n})}),await new Promise(C=>{at(()=>{let S=getComputedStyle(t);function p(D){let _=`${D.filter||""} ${D.webkitFilter||""}`.trim();if(!_||_==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let O=_.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],G=0,K=0,Z=0,Y=0,ct=!1;for(let Ct of O){ct=!0;let dt=Ct.match(/-?\d+(?:\.\d+)?px/gi)?.map(lt=>parseFloat(lt))||[],[st=0,tt=0,mt=0]=dt,nt=Math.abs(st)+mt,ot=Math.abs(tt)+mt;K=Math.max(K,nt+Math.max(st,0)),Y=Math.max(Y,nt+Math.max(-st,0)),Z=Math.max(Z,ot+Math.max(tt,0)),G=Math.max(G,ot+Math.max(-tt,0))}return{bleed:{top:Math.ceil(G),right:Math.ceil(K),bottom:Math.ceil(Z),left:Math.ceil(Y)},has:ct}}function M(D){let _=D.boxShadow||"";if(!_||_==="none")return{top:0,right:0,bottom:0,left:0};let O=_.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(ct=>ct.trim()),G=0,K=0,Z=0,Y=0;for(let ct of O){let Ct=ct.match(/-?\d+(\.\d+)?px/g)?.map(lt=>parseFloat(lt))||[];if(Ct.length<2)continue;let[dt,st,tt=0,mt=0]=Ct,nt=Math.abs(dt)+tt+mt,ot=Math.abs(st)+tt+mt;K=Math.max(K,nt+Math.max(dt,0)),Y=Math.max(Y,nt+Math.max(-dt,0)),Z=Math.max(Z,ot+Math.max(st,0)),G=Math.max(G,ot+Math.max(-st,0))}return{top:Math.ceil(G),right:Math.ceil(K),bottom:Math.ceil(Z),left:Math.ceil(Y)}}function k(D){let _=(D.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),O=_?Math.ceil(parseFloat(_[1])||0):0;return{top:O,right:O,bottom:O,left:O}}function E(D){if((D.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let _=Math.ceil(parseFloat(D.outlineWidth||"0")||0);return{top:_,right:_,bottom:_,left:_}}function W(D,_,O,G,K){let Z=O.a,Y=O.b,ct=O.c,Ct=O.d,dt=O.e||0,st=O.f||0;function tt(kt,Mt){let be=kt-G,xe=Mt-K,Se=Z*be+ct*xe,Ce=Y*be+Ct*xe;return Se+=G+dt,Ce+=K+st,[Se,Ce]}let mt=[tt(0,0),tt(D,0),tt(0,_),tt(D,_)],nt=1/0,ot=1/0,lt=-1/0,Wt=-1/0;for(let[kt,Mt]of mt)kt<nt&&(nt=kt),Mt<ot&&(ot=Mt),kt>lt&&(lt=kt),Mt>Wt&&(Wt=Mt);return{minX:nt,minY:ot,maxX:lt,maxY:Wt,width:lt-nt,height:Wt-ot}}function z(D){return co(D)}let B=t.getBoundingClientRect(),L=Math.max(1,Math.ceil(t.offsetWidth||parseFloat(S.width)||B.width||1)),d=Math.max(1,Math.ceil(t.offsetHeight||parseFloat(S.height)||B.height||1)),b=(D,_=NaN)=>{let O=typeof D=="string"?parseFloat(D):D;return Number.isFinite(O)?O:_},w=b(e.width),A=b(e.height),g=L,y=d,F=Number.isFinite(w),v=Number.isFinite(A),$=d>0?L/d:1;F&&v?(g=Math.max(1,Math.ceil(w)),y=Math.max(1,Math.ceil(A))):F?(g=Math.max(1,Math.ceil(w)),y=Math.max(1,Math.ceil(g/($||1)))):v?(y=Math.max(1,Math.ceil(A)),g=Math.max(1,Math.ceil(y*($||1)))):(g=L,y=d);let R=0,P=0,q=L,T=d;if(z(t)){let D=S.transform&&S.transform!=="none"?S.transform:"",_=io(t),O=fo({baseTransform:D,rotate:_.rotate||"0deg",scale:_.scale,translate:_.translate}),{ox:G,oy:K}=lo(S,L,d),Z=O.is2D?O:new DOMMatrix(O.toString()),Y=W(L,d,Z,G,K);R=Y.minX,P=Y.minY,q=Y.maxX,T=Y.maxY}let N=M(S),I=k(S),U=E(S),j=p(S),it={top:N.top+I.top+U.top+j.bleed.top,right:N.right+I.right+U.right+j.bleed.right,bottom:N.bottom+I.bottom+U.bottom+j.bleed.bottom,left:N.left+I.left+U.left+j.bleed.left};R-=it.left,P-=it.top,q+=it.right,T+=it.bottom;let rt=Math.max(1,Math.ceil(q-R)),It=Math.max(1,Math.ceil(T-P)),xt=Math.max(1,Math.round(rt*(F||v?g/L:1))),Kt=Math.max(1,Math.round(It*(v||F?y/d:1))),Tt="http://www.w3.org/2000/svg",J=X()?1:0,Q=document.createElementNS(Tt,"foreignObject"),Ge=Math.floor(R),Ke=Math.floor(P);Q.setAttribute("x",String(-(Ge-J))),Q.setAttribute("y",String(-(Ke-J))),Q.setAttribute("width",String(Math.ceil(L+J*2))),Q.setAttribute("height",String(Math.ceil(d+J*2))),Q.style.overflow="visible";let ye=document.createElement("style");ye.textContent=l+s+"svg{overflow:visible;} foreignObject{overflow:visible;}"+r,Q.appendChild(ye);let St=document.createElement("div");St.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),St.style.width=`${L}px`,St.style.height=`${d}px`,St.style.overflow="visible",o.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),St.appendChild(o),Q.appendChild(St);let Je=new XMLSerializer().serializeToString(Q),Jt=rt+J*2,Qt=It+J*2,we=F||v;e.meta={w0:L,h0:d,vbW:Jt,vbH:Qt,targetW:g,targetH:y};let Qe=X()&&we?Jt:xt+J*2,Ze=X()&&we?Qt:Kt+J*2;i=`<svg xmlns="${Tt}" width="${Qe}" height="${Ze}" viewBox="0 0 ${Jt} ${Qt}">`+Je+"</svg>",c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`,C()},{fast:n})});let x=document.getElementById("snapdom-sandbox");return x&&x.style.position==="absolute"&&x.remove(),c}function ao(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch{return new WebKitCSSMatrix(e)}}function io(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}},a=r("rotate");if(a)if(a.angle){let c=a.angle;e.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else a.unit?e.rotate=a.unit==="rad"?a.value*180/Math.PI+"deg":a.value+a.unit:e.rotate=String(a);else{let c=getComputedStyle(t);e.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let s=r("scale");if(s){let c="x"in s&&s.x?.value!=null?s.x.value:Array.isArray(s)?s[0]?.value:Number(s)||1,i="y"in s&&s.y?.value!=null?s.y.value:Array.isArray(s)?s[1]?.value:c;e.scale=`${c} ${i}`}else{let c=getComputedStyle(t);e.scale=c.scale&&c.scale!=="none"?c.scale:null}let l=r("translate");if(l){let c="x"in l&&"value"in l.x?l.x.value:Array.isArray(l)?l[0]?.value:0,i="y"in l&&"value"in l.y?l.y.value:Array.isArray(l)?l[1]?.value:0,u="x"in l&&l.x?.unit?l.x.unit:"px",f="y"in l&&l.y?.unit?l.y.unit:"px";e.translate=`${c}${u} ${i}${f}`}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}function co(t){let e=getComputedStyle(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",a=e.scale&&e.scale!=="none"&&e.scale!=="1",s=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(r||a||s)}function lo(t,e,n){let o=(t.transformOrigin||"0 0").trim().split(/\s+/),[r,a]=[o[0]||"0",o[1]||"0"],s=(l,c)=>{let i=l.toLowerCase();return i==="left"||i==="top"?0:i==="center"?c/2:i==="right"||i==="bottom"?c:i.endsWith("px")?parseFloat(i)||0:i.endsWith("%")?(parseFloat(i)||0)*c/100:/^-?\d+(\.\d+)?$/.test(i)&&parseFloat(i)||0};return{ox:s(r,e),oy:s(a,n)}}var he=null;function uo(){if(he)return he;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),he=t,t}function fo(t){let e=uo(),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=ao(n);return e.removeChild(n),o}function mo(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function je(t={}){let e=t.format??"png",n=mo(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,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??(["jpg","jpeg","webp"].includes(e)?"#ffffff":null),filename:t.filename??"snapDOM"}}function ho(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function po(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function go(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function yo(t){let e=[],n="",o=0;for(let r=0;r<t.length;r++){let a=t[r];a==="("&&o++,a===")"&&(o=Math.max(0,o-1)),a===";"&&o===0?(e.push(n),n=""):n+=a}return n.trim()&&e.push(n),e.map(r=>r.trim()).filter(Boolean)}function wo(t){let e=[],n="",o=0;for(let a=0;a<t.length;a++){let s=t[a];s==="("&&o++,s===")"&&(o=Math.max(0,o-1)),s===","&&o===0?(e.push(n.trim()),n=""):n+=s}n.trim()&&e.push(n.trim());let r=[];for(let a of e){if(/\binset\b/i.test(a))continue;let s=a.match(/-?\d+(?:\.\d+)?px/gi)||[],[l="0px",c="0px",i="0px"]=s,u=a.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!u&&u!==",";r.push(`drop-shadow(${l} ${c} ${i}${f?` ${u}`:""})`)}return r.join(" ")}function ze(t){let e=yo(t),n=null,o=null,r=null,a=[];for(let l of e){let c=l.indexOf(":");if(c<0)continue;let i=l.slice(0,c).trim().toLowerCase(),u=l.slice(c+1).trim();i==="box-shadow"?r=u:i==="filter"?n=u:i==="-webkit-filter"?o=u:a.push([i,u])}if(r){let l=wo(r);l&&(n=n?`${n} ${l}`:l,o=o?`${o} ${l}`:l)}let s=[...a];return n&&s.push(["filter",n]),o&&s.push(["-webkit-filter",o]),s.map(([l,c])=>`${l}:${c}`).join(";")}function bo(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,o)=>`${n}{${ze(o)}}`)}function xo(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,bo(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,o)=>`style=${n}${ze(o)}${n}`),t}function So(t){if(!X()||!ho(t))return t;try{let e=po(t),n=xo(e);return go(n)}catch{return t}}async function ft(t,e){let{width:n,height:o,scale:r=1,dpr:a=1,meta:s={}}=e;t=So(t);let l=new Image;l.loading="eager",l.decoding="sync",l.crossOrigin="anonymous",l.src=t,await l.decode();let c=l.naturalWidth,i=l.naturalHeight,u=Number.isFinite(s.w0)?s.w0:c,f=Number.isFinite(s.h0)?s.h0:i,m,x,C=Number.isFinite(n),S=Number.isFinite(o);if(C&&S)m=Math.max(1,n),x=Math.max(1,o);else if(C){let k=n/Math.max(1,u);m=n,x=Math.round(f*k)}else if(S){let k=o/Math.max(1,f);x=o,m=Math.round(u*k)}else m=c,x=i;m=Math.round(m*r),x=Math.round(x*r);let p=document.createElement("canvas");p.width=Math.ceil(m*a),p.height=Math.ceil(x*a),p.style.width=`${m}px`,p.style.height=`${x}px`;let M=p.getContext("2d");return a!==1&&M.scale(a,a),M.drawImage(l,0,0,m,x),p}async function Yt(t,e){let n=await ft(t,e),o=e.backgroundColor?pt(n,e.backgroundColor):n,r=new Image;return r.src=o.toDataURL(`image/${e.format}`,e.quality),await r.decode(),r.style.width=`${o.width/e.dpr}px`,r.style.height=`${o.height/e.dpr}px`,r}async function Ve(t,e){let{scale:n=1,width:o,height:r,meta:a={}}=e,s=Number.isFinite(o),l=Number.isFinite(r),c=Number.isFinite(n)&&n!==1||s||l;if(X()&&c)return await Yt(t,{...e,format:"png",quality:1,meta:a});let i=new Image;if(i.decoding="sync",i.loading="eager",i.src=t,await i.decode(),s&&l)i.style.width=`${o}px`,i.style.height=`${r}px`;else if(s){let u=Number.isFinite(a.w0)?a.w0:i.naturalWidth,f=Number.isFinite(a.h0)?a.h0:i.naturalHeight,m=o/Math.max(1,u);i.style.width=`${o}px`,i.style.height=`${Math.round(f*m)}px`}else if(l){let u=Number.isFinite(a.w0)?a.w0:i.naturalWidth,f=Number.isFinite(a.h0)?a.h0:i.naturalHeight,m=r/Math.max(1,f);i.style.height=`${r}px`,i.style.width=`${Math.round(u*m)}px`}else n!==1&&(i.style.width=`${Math.round(i.naturalWidth*n)}px`,i.style.height=`${Math.round(i.naturalHeight*n)}px`);return i}async function Gt(t,e){let n=e.type;if(n==="svg"){let a=decodeURIComponent(t.split(",")[1]);return new Blob([a],{type:"image/svg+xml"})}let o=await ft(t,e),r=e.backgroundColor?pt(o,e.backgroundColor):o;return new Promise(a=>r.toBlob(s=>a(s),`image/${n}`,e.quality))}async function Xe(t,e){if(e.dpr=1,e.format==="svg"){let a=await Gt(t,{...e,type:"svg"}),s=URL.createObjectURL(a),l=document.createElement("a");l.href=s,l.download=e.filename,l.click(),URL.revokeObjectURL(s);return}let n=await ft(t,e),o=e.backgroundColor?pt(n,e.backgroundColor):n,r=document.createElement("a");r.href=o.toDataURL(`image/${e.format}`,e.quality),r.download=e.filename,r.click()}var Ye=Symbol("snapdom.internal"),ge=!1;async function H(t,e){if(!t)throw new Error("Element cannot be null or undefined");let n=je(e);if(X()&&(n.embedFonts===!0||ko(t)))for(let o=0;o<3;o++)try{await Co(t,e),console.log("Iteraci\xF3n n\xFAmero:",o),ge=!1}catch{}return n.iconFonts&&n.iconFonts.length>0&&ve(n.iconFonts),n.snap||(n.snap={toPng:(o,r)=>H.toPng(o,r),toImg:(o,r)=>H.toImg(o,r)}),H.capture(t,n,Ye)}H.capture=async(t,e,n)=>{if(n!==Ye)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let o=await pe(t,e),r=s=>({...e,...s||{}}),a=s=>l=>{let c=r({...l||{},format:s}),i=s==="jpeg"||s==="jpg",u=c.backgroundColor==null||c.backgroundColor==="transparent";return i&&u&&(c.backgroundColor="#ffffff"),Yt(o,c)};return{url:o,toRaw:()=>o,toImg:s=>Ve(o,r(s)),toCanvas:s=>ft(o,r(s)),toBlob:s=>Gt(o,r(s)),toPng:a("png"),toJpg:a("jpeg"),toWebp:a("webp"),download:s=>Xe(o,r(s))}};H.toRaw=(t,e)=>H(t,e).then(n=>n.toRaw());H.toImg=(t,e)=>H(t,e).then(n=>n.toImg());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());async function Co(t,e){if(ge)return;let n={...e,fast:!0,embedFonts:!0,scale:.2},o;try{o=await pe(t,n)}catch{return}await new Promise(r=>{let a=new Image;a.decoding="sync",a.loading="eager",a.style.position="fixed",a.style.left=0,a.style.top=0,a.style.width="10px",a.style.height="10px",a.style.opacity="0.01",a.style.transform="translateZ(10px)",a.style.willChange="transform,opacity;",a.src=o;let s=async()=>{await new Promise(l=>setTimeout(l,100)),a&&a.parentNode&&a.parentNode.removeChild(a),ge=!0,r()};document.body.appendChild(a),s()})}function ko(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,o=getComputedStyle(n),r=o.backgroundImage&&o.backgroundImage!=="none",a=o.maskImage&&o.maskImage!=="none"||o.webkitMaskImage&&o.webkitMaskImage!=="none";if(r||a)return!0}return!1}async function Mo(t=document,e={}){let{embedFonts:n=!0,useProxy:o=""}=e,r=e.cache??e.cacheOpt??"full";_t(r);try{await document.fonts?.ready}catch{}try{ee()}catch{}h.session=h.session||{},h.session.styleCache||(h.session.styleCache=new WeakMap),h.image=h.image||new Map;try{await Xt(t,void 0,h.session.styleCache,{useProxy:o})}catch{}let a=[],s=[];try{t?.querySelectorAll&&(a=Array.from(t.querySelectorAll("img[src]")),s=Array.from(t.querySelectorAll("*")))}catch{}let l=[];for(let c of a){let i=c?.currentSrc||c?.src;if(i&&!h.image.has(i)){let u=Promise.resolve().then(async()=>{let f=await V(i,{as:"dataURL",useProxy:o});f?.ok&&typeof f.data=="string"&&h.image.set(i,f.data)}).catch(()=>{});l.push(u)}}for(let c of s){let i="";try{i=yt(c).backgroundImage}catch{}if(i&&i!=="none"){let u=wt(i);for(let f of u)if(f.startsWith("url(")){let m=Promise.resolve().then(()=>gt(f,{...e,useProxy:o})).catch(()=>{});l.push(m)}}}if(n)try{let c=qt(t),i=jt(t);if(typeof X=="function"?X():!!X){let f=new Set(Array.from(c).map(m=>String(m).split("__")[0]).filter(Boolean));await zt(f,2)}await Dt({required:c,usedCodepoints:i,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:e.useProxy??o})}catch{}await Promise.allSettled(l)}export{Mo as preCache,H as snapdom};
package/dist/snapdom.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /*
3
3
  * snapdom
4
- * v.1.9.12-dev.3
4
+ * v.1.9.12-dev.4
5
5
  * Author Juan Martin Muda
6
6
  * License MIT
7
7
  **/
@@ -617,8 +617,9 @@ function idle(fn, { fast = false } = {}) {
617
617
  function isSafari() {
618
618
  const ua = typeof navigator !== "undefined" && navigator.userAgent ? navigator.userAgent : "";
619
619
  const isSafariUA = /^((?!chrome|android).)*safari/i.test(ua);
620
+ const isUIWebView = /AppleWebKit/i.test(ua) && /Mobile/i.test(ua) && !/Safari/i.test(ua);
620
621
  const isWeChatUA = /(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(ua);
621
- return isSafariUA || isWeChatUA;
622
+ return isSafariUA || isUIWebView || isWeChatUA;
622
623
  }
623
624
 
624
625
  // src/modules/styles.js
@@ -2292,7 +2293,7 @@ async function inlinePseudoElements(source, clone, sessionCache, options) {
2292
2293
  const hasBox2 = display !== "inline" && (width > 0 || height > 0);
2293
2294
  const hasBorder = borderStyle && borderStyle !== "none" && borderWidth > 0;
2294
2295
  const hasTransform = transform && transform !== "none";
2295
- const shouldRender = hasExplicitContent || hasBg || hasBgColor || hasBox2 || hasBorder || hasTransform;
2296
+ const shouldRender = hasExplicitContent || hasBg || hasBgColor || hasBorder || hasTransform;
2296
2297
  if (!shouldRender) {
2297
2298
  if (incs && incs.length && source.parentElement) {
2298
2299
  const map = __siblingCounters.get(source.parentElement) || /* @__PURE__ */ new Map();
@@ -2310,6 +2311,7 @@ async function inlinePseudoElements(source, clone, sessionCache, options) {
2310
2311
  const pseudoEl = document.createElement("span");
2311
2312
  pseudoEl.dataset.snapdomPseudo = pseudo;
2312
2313
  pseudoEl.style.verticalAlign = "middle";
2314
+ pseudoEl.style.pointerEvents = "none";
2313
2315
  const snapshot = snapshotComputedStyle(style);
2314
2316
  const key = getStyleKey(snapshot, "span");
2315
2317
  sessionCache.styleMap.set(pseudoEl, key);
@@ -2336,6 +2338,10 @@ async function inlinePseudoElements(source, clone, sessionCache, options) {
2336
2338
  } else if (!isIconFont22 && hasExplicitContent) {
2337
2339
  pseudoEl.textContent = cleanContent;
2338
2340
  }
2341
+ pseudoEl.style.background = "none";
2342
+ if ("mask" in pseudoEl.style) {
2343
+ pseudoEl.style.mask = "none";
2344
+ }
2339
2345
  if (hasBg) {
2340
2346
  try {
2341
2347
  const bgSplits = splitBackgroundImage(bg);
@@ -2347,7 +2353,7 @@ async function inlinePseudoElements(source, clone, sessionCache, options) {
2347
2353
  }
2348
2354
  if (hasBgColor) pseudoEl.style.backgroundColor = bgColor;
2349
2355
  const hasContent2 = pseudoEl.childNodes.length > 0 || pseudoEl.textContent?.trim() !== "";
2350
- const hasVisibleBox = hasContent2 || hasBg || hasBgColor || hasBox2 || hasBorder || hasTransform;
2356
+ const hasVisibleBox = hasContent2 || hasBg || hasBgColor || hasBorder || hasTransform;
2351
2357
  if (incs && incs.length && source.parentElement) {
2352
2358
  const map = __siblingCounters.get(source.parentElement) || /* @__PURE__ */ new Map();
2353
2359
  const baseWithSibs = withSiblingOverrides(source, counterCtx);
@@ -2426,6 +2432,102 @@ function inlineExternalDefsAndSymbols(rootElement) {
2426
2432
  });
2427
2433
  }
2428
2434
 
2435
+ // src/modules/changeCSS.js
2436
+ function freezeSticky(originalRoot, cloneRoot) {
2437
+ if (!originalRoot || !cloneRoot) return;
2438
+ const scrollTop = originalRoot.scrollTop || 0;
2439
+ if (!scrollTop) return;
2440
+ if (getComputedStyle(cloneRoot).position === "static") {
2441
+ cloneRoot.style.position = "relative";
2442
+ }
2443
+ const rootRect = originalRoot.getBoundingClientRect();
2444
+ const viewportH = originalRoot.clientHeight;
2445
+ const PH_ATTR = "data-snap-ph";
2446
+ const walker = document.createTreeWalker(originalRoot, NodeFilter.SHOW_ELEMENT);
2447
+ while (walker.nextNode()) {
2448
+ const el = (
2449
+ /** @type {HTMLElement} */
2450
+ walker.currentNode
2451
+ );
2452
+ const cs = getComputedStyle(el);
2453
+ const pos = cs.position;
2454
+ if (pos !== "sticky" && pos !== "-webkit-sticky") continue;
2455
+ const topInit = _toPx(cs.top);
2456
+ const bottomInit = _toPx(cs.bottom);
2457
+ if (topInit == null && bottomInit == null) continue;
2458
+ const path = _pathOf(el, originalRoot);
2459
+ const cloneEl = _findByPathIgnoringPlaceholders(cloneRoot, path, PH_ATTR);
2460
+ if (!cloneEl) continue;
2461
+ const elRect = el.getBoundingClientRect();
2462
+ const widthPx = elRect.width;
2463
+ const heightPx = elRect.height;
2464
+ const leftPx = elRect.left - rootRect.left;
2465
+ if (!(widthPx > 0 && heightPx > 0)) continue;
2466
+ if (!Number.isFinite(leftPx)) continue;
2467
+ const topAbsPx = topInit != null ? topInit + scrollTop : scrollTop + (viewportH - heightPx - /** bottomInit non-null */
2468
+ bottomInit);
2469
+ if (!Number.isFinite(topAbsPx)) continue;
2470
+ const zParsed = Number.parseInt(cs.zIndex, 10);
2471
+ const hasZ = Number.isFinite(zParsed);
2472
+ const overlayZ = hasZ ? Math.max(zParsed, 1) + 1 : 2;
2473
+ const placeholderZ = hasZ ? zParsed - 1 : 0;
2474
+ const ph = cloneEl.cloneNode(false);
2475
+ ph.setAttribute(PH_ATTR, "1");
2476
+ ph.style.position = "sticky";
2477
+ ph.style.left = `${leftPx}px`;
2478
+ ph.style.top = `${topAbsPx}px`;
2479
+ ph.style.width = `${widthPx}px`;
2480
+ ph.style.height = `${heightPx}px`;
2481
+ ph.style.visibility = "hidden";
2482
+ ph.style.zIndex = String(placeholderZ);
2483
+ ph.style.overflow = "hidden";
2484
+ ph.style.background = "transparent";
2485
+ ph.style.boxShadow = "none";
2486
+ ph.style.filter = "none";
2487
+ cloneEl.parentElement?.insertBefore(ph, cloneEl);
2488
+ cloneEl.style.position = "absolute";
2489
+ cloneEl.style.left = `${leftPx}px`;
2490
+ cloneEl.style.top = `${topAbsPx}px`;
2491
+ cloneEl.style.bottom = "auto";
2492
+ cloneEl.style.zIndex = String(overlayZ);
2493
+ cloneEl.style.pointerEvents = "none";
2494
+ }
2495
+ }
2496
+ function _toPx(v) {
2497
+ if (!v || v === "auto") return null;
2498
+ const n = Number.parseFloat(v);
2499
+ return Number.isFinite(n) ? n : null;
2500
+ }
2501
+ function _pathOf(el, root) {
2502
+ const path = [];
2503
+ for (let cur = el; cur && cur !== root; ) {
2504
+ const p = cur.parentElement;
2505
+ if (!p) break;
2506
+ path.push(Array.prototype.indexOf.call(p.children, cur));
2507
+ cur = p;
2508
+ }
2509
+ return path.reverse();
2510
+ }
2511
+ function _findByPathIgnoringPlaceholders(root, path, phAttr) {
2512
+ let cur = root;
2513
+ for (let i = 0; i < path.length; i++) {
2514
+ const kids = _childrenWithoutPlaceholders(cur, phAttr);
2515
+ cur = /** @type {HTMLElement|undefined} */
2516
+ kids[path[i]];
2517
+ if (!cur) return null;
2518
+ }
2519
+ return cur instanceof HTMLElement ? cur : null;
2520
+ }
2521
+ function _childrenWithoutPlaceholders(el, phAttr) {
2522
+ const out = [];
2523
+ const ch = el.children;
2524
+ for (let i = 0; i < ch.length; i++) {
2525
+ const c = ch[i];
2526
+ if (!c.hasAttribute(phAttr)) out.push(c);
2527
+ }
2528
+ return out;
2529
+ }
2530
+
2429
2531
  // src/core/prepare.js
2430
2532
  async function prepareClone(element, options = {}) {
2431
2533
  const sessionCache = {
@@ -2500,6 +2602,8 @@ async function prepareClone(element, options = {}) {
2500
2602
  cloneNode.appendChild(inner);
2501
2603
  }
2502
2604
  }
2605
+ const contentRoot = clone instanceof HTMLElement && clone.firstElementChild instanceof HTMLElement ? clone.firstElementChild : clone;
2606
+ freezeSticky(element, contentRoot);
2503
2607
  if (element === sessionCache.nodeMap.get(clone)) {
2504
2608
  const computed = sessionCache.styleCache.get(element) || window.getComputedStyle(element);
2505
2609
  sessionCache.styleCache.set(element, computed);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zumer/snapdom",
3
- "version": "1.9.12-dev.3",
3
+ "version": "1.9.12-dev.4",
4
4
  "description": "snapDOM captures HTML elements to images with exceptional speed and accuracy.",
5
5
  "main": "dist/snapdom.js",
6
6
  "module": "dist/snapdom.mjs",
@@ -85,7 +85,7 @@ export interface CaptureOptions {
85
85
  * Preferred export format used by convenience methods / download.
86
86
  * Default: "png"
87
87
  */
88
- format?: "svg" | RasterMime;
88
+ format?: BlobType;
89
89
 
90
90
  /** CSS selectors removed from the cloned subtree before processing. */
91
91
  exclude?: string[];