@loomweaver/frame-kit 0.9.5 → 0.9.6
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/lw-elements.global.js +44 -44
- package/dist/lw-frame.css +1 -1
- package/dist/lw-frame.d.ts +55 -1
- package/dist/penpal.global.js +1 -1
- package/dist/snapdom.global.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* @loomweaver/frame-kit 0.9.6 — snapdom.global.js. Generated by build.mjs; do not edit. Serve the dist/ files same-origin under /frame-kit/. */
|
|
2
|
+
var LwSnapdom=(()=>{var St=Object.defineProperty;var ri=Object.getOwnPropertyDescriptor;var ni=Object.getOwnPropertyNames;var ii=Object.prototype.hasOwnProperty;var oi=(e,t)=>{for(var r in t)St(e,r,{get:t[r],enumerable:!0})},ai=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ni(t))!ii.call(e,i)&&i!==r&&St(e,i,{get:()=>t[i],enumerable:!(n=ri(t,i))||n.enumerable});return e};var li=e=>ai(St({},"__esModule",{value:!0}),e);var es={};oi(es,{preCache:()=>Ql,snapdom:()=>V});var si=Object.defineProperty,oe=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}},Oe=(e,t)=>{for(var r in t)si(e,r,{get:t[r],enumerable:!0})};function ci(e){if(e===!0)return"soft";if(e===!1)return"disabled";if(typeof e=="string"){let t=e.toLowerCase().trim();if(t==="auto")return"auto";if(t==="full")return"full";if(t==="soft"||t==="disabled")return t}return"soft"}function Jr(e="soft"){switch(e){case"auto":{C.session.styleMap=new Map,C.session.nodeMap=new Map;return}case"soft":{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap,C.computedStyle=new WeakMap,C.measureHints=new WeakMap,C.baseStyle=new ee(50),C.defaultStyle=new ee(30),C.image=new ee(100),C.background=new ee(100),C.resource=new ee(150),C.compress=new ee(50),C.font=new Set;return}default:{C.session.styleMap=new Map,C.session.nodeMap=new Map,C.session.styleCache=new WeakMap;return}}}var ee,C,te=oe(()=>{"use strict";ee=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,t)}},C={image:new ee(100),background:new ee(100),resource:new ee(150),defaultStyle:new ee(30),baseStyle:new ee(50),compress:new ee(50),computedStyle:new WeakMap,measureHints:new WeakMap,burstAdvice:new WeakMap,warnedReconcile:!1,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function Ht(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let r=t[2].trim();return r.startsWith("#")?null:r}function Kr(e,t=1){let r=e.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!r)return null;let n=[];for(let i of r[1].split(",")){let a=i.match(/url\((['"]?)(.*?)(\1)\)/);if(!a)continue;let o=i.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(o&&!Zr.test(o[1].trim()))continue;let l=i.match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)/i),s=1;if(l){let d=parseFloat(l[1]);s=/dpi/i.test(l[2])?d/96:d}n.push({url:a[2].trim(),dppx:s})}return n.length?(n.sort((i,a)=>i.dppx-a.dppx),(n.find(i=>i.dppx>=t)||n[n.length-1]).url):null}function ui(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(r,n)=>{let i=n.split(",").map(a=>a.trim());return i.length!==6?`matrix(${n})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(r,n)=>{let i=n.split(",").map(a=>a.trim());return i.length!==16?`matrix3d(${n})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function lt(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function di(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let r=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,r).href}catch{return e}}var Zr,mt=oe(()=>{"use strict";Zr=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i});function fi(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:r=12}={}){let n=new Map,i=0;function a(o,l,s){if(i>=r)return;let d=Date.now();(n.get(l)||0)>d||(n.set(l,d+t),i++,o==="warn"&&console&&console.warn?console.warn(`${e} ${s}`):console&&console.error&&console.error(`${e} ${s}`))}return{warnOnce(o,l){a("warn",o,l)},errorOnce(o,l){a("error",o,l)},reset(){n.clear(),i=0}}}function hi(e){return/^data:|^blob:|^about:blank$/i.test(e)}function pi(e,t){try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=t.includes("{url}")?t.split("{url}")[0]:t,i=new URL(n||".",r),a=new URL(e,r);if(a.origin===i.origin)return!0;let o=a.searchParams;if(o&&(o.has("url")||o.has("target")))return!0}catch{}return!1}function mi(e,t){if(!t||hi(e)||pi(e,t))return!1;try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=new URL(e,r);return typeof location<"u"?n.origin!==location.origin:!0}catch{return!!t}}function gi(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",lt(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${lt(e)}`;let r=t.includes("?")?"&":"?";return`${t}${r}url=${encodeURIComponent(e)}`}function yr(e){return new Promise((t,r)=>{let n=new FileReader;n.onload=()=>t(String(n.result||"")),n.onerror=()=>r(new Error("read_failed")),n.readAsDataURL(e)})}function yi(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function ie(e,t={}){let r=t.as??"blob",n=t.timeout??3e3,i=t.useProxy||"",a=t.errorTTL??8e3,o=t.headers||{},l=!!t.silent;if(/^data:/i.test(e))try{if(r==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(r==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,y="",b=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],x=/;base64/i.test(y)?atob(b):decodeURIComponent(b),v=new Uint8Array([...x].map(w=>w.charCodeAt(0))),g=new Blob([v],{type:(y||"").split(";")[0]||""});return{ok:!0,data:g,status:200,url:e,fromCache:!1,mime:g.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let y=await fetch(e);if(!y.ok)return{ok:!1,data:null,status:y.status,url:e,fromCache:!1,reason:"http_error"};let b=await y.blob(),x=b.type||y.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await yr(b),status:y.status,url:e,fromCache:!1,mime:x}:r==="text"?{ok:!0,data:await b.text(),status:y.status,url:e,fromCache:!1,mime:x}:{ok:!0,data:b,status:y.status,url:e,fromCache:!1,mime:x}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return r==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:r==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let s=yi(e,{as:r,timeout:n,useProxy:i,errorTTL:a}),d=Le.get(s);if(d&&d.until>Date.now())return{...d.result,fromCache:!0};d&&Le.delete(s);let c=Je.get(s);if(c)return c;let u=mi(e,i)?gi(e,i):e,f=t.credentials;if(!f)try{let y=typeof location<"u"&&location.href?location.href:"http://localhost/",b=new URL(e,y);f=typeof location<"u"&&b.origin===location.origin?"include":"omit"}catch{f="omit"}let h=new AbortController,p=setTimeout(()=>h.abort("timeout"),n),m=(async()=>{try{let y=await fetch(u,{signal:h.signal,credentials:f,headers:o});if(!y.ok){let v={ok:!1,data:null,status:y.status,url:u,fromCache:!1,reason:"http_error"};if(a>0&&Le.set(s,{until:Date.now()+a,result:v}),!l){let g=`${y.status} ${y.statusText||""}`.trim();Ft.warnOnce(`http:${y.status}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${g} while fetching ${r} ${e}`)}return t.onError&&t.onError(v),v}if(r==="text")return{ok:!0,data:await y.text(),status:y.status,url:u,fromCache:!1};let b=await y.blob(),x=b.type||y.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await yr(b),status:y.status,url:u,fromCache:!1,mime:x}:{ok:!0,data:b,status:y.status,url:u,fromCache:!1,mime:x}}catch(y){let b=y&&typeof y=="object"&&"name"in y&&y.name==="AbortError"?String(y.message||"").includes("timeout")?"timeout":"abort":"network",x={ok:!1,data:null,status:0,url:u,fromCache:!1,reason:b};if(!/^blob:/i.test(e)&&a>0&&Le.set(s,{until:Date.now()+a,result:x}),!l){let v=`${b}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,g=b==="timeout"?`Timeout after ${n}ms. Consider increasing timeout or using a proxy for ${e}`:b==="abort"?`Request aborted while fetching ${r} ${e}`:`Network/CORS issue while fetching ${r} ${e}. A proxy may be required`;Ft.errorOnce(v,g)}return t.onError&&t.onError(x),x}finally{clearTimeout(p),Je.delete(s)}})();return Je.set(s,m),m}var Ft,Je,Le,Ae=oe(()=>{"use strict";mt(),Ft=fi("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Je=new Map,Le=new Map});async function Xt(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let r=Kr(e,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Ht(e);if(!r)return e;let n=di(r),i=lt(n),a=(t.useProxy||"")+"|"+i;if(C.background.has(a)){let o=C.background.get(a);return o?`url("${o}")`:"none"}try{let o=await ie(i,{as:"dataURL",useProxy:t.useProxy});return o.ok?(C.background.set(a,o.data),`url("${o.data}")`):(C.background.set(a,null),"none")}catch{return C.background.set(a,null),"none"}}var bi=oe(()=>{"use strict";te(),mt(),Ae()});function wi(){for(let e of tn){let t=String(e).toLowerCase();Qt.has(t)||gt.has(t)||Gt(t)}}function Gt(e){if(e=String(e).toLowerCase(),gt.has(e)){let a={};return C.defaultStyle.set(e,a),a}if(C.defaultStyle.has(e))return C.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let r=document.createElement(e);r.style.all="initial",t.appendChild(r);let n=getComputedStyle(r),i={};for(let a of n){if(Yt(a))continue;let o=n.getPropertyValue(a);i[a]=o}return t.removeChild(r),C.defaultStyle.set(e,i),i}function Yt(e){let t=Et.get(e);if(t===void 0){let r=String(e).toLowerCase();t=on.has(r)||nn.test(r)||rn.test(r),Et.set(e,t)}return t}function en(e,t){return!ln.has(e)&&(t==="inline"||an.has(e)||Jt.has(e))}function xi(e,t,r){let n=(t.display||"").toLowerCase();if(n==="inline"||Jt.has(e))return!1;if(r)return!0;if((t.float||"none").toLowerCase()!=="none")return!1;let i=(t.position||"static").toLowerCase();return i==="absolute"||i==="fixed"?!1:!dn.has(n)}function Nt(e,t,r=!0,n=!1){if(t=String(t||"").toLowerCase(),gt.has(t))return"";let i=[],a=Gt(t),o=(e.display||"").toLowerCase(),l=o==="inline",s=en(t,o),d=e["text-wrap-mode"]||e["white-space"]||"",c=d==="nowrap"||d==="pre",u=s&&r&&!(s&&r&&!l&&c),f=!1;for(let h in e){if(Yt(h))continue;let p=e[h];if(u){if(sn.has(h))continue;if(cn.has(h)){p&&p!==a[h]&&(i.push(`${h}:${p}`),p!=="auto"&&(f=!0));continue}}if(p&&p!==a[h]){if(!c&&(h==="width"||h==="inline-size")&&p.endsWith("px")&&p.includes(".")){let m=parseFloat(p);if(Number.isFinite(m)){i.push(`${h}:${(m+un).toFixed(3)}px`);continue}}i.push(`${h}:${p}`)}}if(u&&!l&&!n&&!f){let h=e.width;h&&h!=="auto"&&h!==a.width&&i.push(`min-width:${h}`)}return i.sort(),i.join(";")}function vi(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(r=>t.add(r.tagName.toLowerCase())),Array.from(t))}function Si(e){let t=new Map;for(let n of e){let i=Gt(n);if(!i)continue;let a=Object.entries(i).map(([o,l])=>`${o}:${l};`).sort().join("");a&&(t.has(a)||t.set(a,[]),t.get(a).push(n))}let r="";for(let[n,i]of t.entries())r+=`${i.join(",")} { ${n} }
|
|
3
|
+
`;return r}function Ci(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),r=new Map,n=1;for(let i of t)r.set(i,`c${n++}`);return r}function Mi(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let r=t.defaultView;if(r&&typeof r.getComputedStyle=="function")return r;if(typeof window<"u"&&window.frames)for(let n=0;n<window.frames.length;n++)try{if(window.frames[n]?.document===t)return window.frames[n]}catch{}}catch{}return typeof window<"u"?window:null}function B(e,t=null){let r=()=>{let a={length:0,getPropertyValue:()=>"",item:()=>""};return a[Symbol.iterator]=function*(){},a};if(e?.nodeType!==1){let a=typeof window<"u"?window:null;if(a&&typeof a.getComputedStyle=="function")try{return a.getComputedStyle(e,t)||r()}catch{return r()}return r()}let n=C.computedStyle.get(e);n||(n=new Map,C.computedStyle.set(e,n));let i=n.get(t);if(!i){let a=Mi(e),o=null;try{o=a&&typeof a.getComputedStyle=="function"?a.getComputedStyle(e,t):null}catch{}if(!o&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{e.ownerDocument===document&&(o=window.getComputedStyle(e,t))}catch{}i=o||r(),n.set(t,i)}return i}function br(e){let t={};for(let r of e)t[r]=e.getPropertyValue(r);for(let r of fn){let n=t[`border-${r}-style`],i=t[`border-${r}-width`];(n==="none"||n==="hidden"||i==="0px")&&(delete t[`border-${r}-style`],delete t[`border-${r}-width`],delete t[`border-${r}-color`])}return t}function Rt(e){let t=[],r=0,n=0;for(let i=0;i<e.length;i++){let a=e[i];a==="("&&r++,a===")"&&r--,a===","&&r===0&&(t.push(e.slice(n,i).trim()),n=i+1)}return t.push(e.slice(n).trim()),t}var Qt,gt,tn,rn,nn,on,Et,an,Jt,ln,sn,cn,un,dn,fn,yt=oe(()=>{"use strict";te(),Qt=new Set(["meta","script","noscript","title","link","template"]),gt=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),tn=["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"],rn=/(?:^|-)(animation|transition)(?:-|$)/i,nn=/^(--.+|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,on=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom","stroke-color"]),Et=new Map,an=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),Jt=new Set(["table","thead","tbody","tfoot","tr","td","th"]),ln=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),sn=new Set(["width","max-width","inline-size","max-inline-size"]),cn=new Set(["min-width","min-inline-size"]),un=.001,dn=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]),fn=["top","right","bottom","left"]});function Ke(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Ce(e=1e3){return typeof requestAnimationFrame!="function"||typeof document<"u"&&document.visibilityState==="hidden"?Promise.resolve():new Promise(t=>{let r=!1,n=()=>{r||(r=!0,t())};try{requestAnimationFrame(n)}catch{n();return}setTimeout(n,e)})}function Ai(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),r=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||r}function se(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),r=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),n=/applewebkit/i.test(e),i=/mobile/i.test(e),a=!/safari/i.test(e),o=n&&i&&a,l=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),s=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),d=/ipad|iphone|ipod/.test(t)&&n;return r||o||l||s||d}function $i(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var $e=oe(()=>{"use strict"});function U(e,t,r){let n=e&&typeof e=="object"&&(e.options||e);n&&n.debug&&(r!==void 0?console.warn("[snapdom]",t,r):console.warn("[snapdom]",t))}var hn=oe(()=>{"use strict"}),de=oe(()=>{"use strict";bi(),yt(),$e(),mt(),hn()}),pn={};Oe(pn,{decodeSvgFromDataURL:()=>Kt,encodeSvgToDataURL:()=>Zt,fixSafariShadows:()=>er,toCanvas:()=>bt});function ki(e){try{let t=e.match(/<svg\b[^>]*>/i);if(!t)return e;let r=t[0],n=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),i=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(n)||!Number.isFinite(i)||n<=0||i<=0)return e;let a=Math.min(1,ye/n,ye/i,Math.sqrt(st/(n*i)));if(a>=1)return e;let o=Math.max(1,Math.floor(n*a)),l=Math.max(1,Math.floor(i*a));return console.warn(`[snapDOM] Capture ${Math.round(n)}\xD7${Math.round(i)}px exceeds the browser image-decode limit (${ye}px/side); downscaling to ${o}\xD7${l}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),e.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${o}`).replace(/(\bheight=")[\d.]+/i,`$1${l}`))}catch{return e}}function Fi(e,t){let r=["x","y","width","height"].map(M=>Number(t?.[M]));if(!r.every(Number.isFinite)||r[2]<=0||r[3]<=0)throw new RangeError("[snapdom] canvas crop requires finite x/y and positive width/height");let n=e.match(/<svg\b[^>]*>/i);if(!n)throw new Error("[snapdom] cannot crop a non-SVG capture");let i=n[0],a=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],o=String(a||"").trim().split(/[\s,]+/).map(Number);if(o.length!==4||!o.every(Number.isFinite)||o[2]<=0||o[3]<=0)throw new Error("[snapdom] cannot crop an SVG without a finite viewBox");let[l,s,d,c]=o,u=Math.max(l,r[0]),f=Math.max(s,r[1]),h=Math.min(l+d,r[0]+r[2]),p=Math.min(s+c,r[1]+r[3]);if(!(h>u)||!(p>f))throw new RangeError("[snapdom] canvas crop does not intersect the SVG viewBox");let m=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),y=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),b=Number.isFinite(m)&&m>0?m/d:1,x=Number.isFinite(y)&&y>0?y/c:1,v=Math.max(1,(h-u)*b),g=Math.max(1,(p-f)*x),w=i.replace(/(\bwidth=")[^"]*/i,`$1${v}`).replace(/(\bheight=")[^"]*/i,`$1${g}`).replace(/(\bviewBox=")[^"]*/i,`$1${u} ${f} ${h-u} ${p-f}`);return e.replace(i,w)}function wr(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function Kt(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function Ni(e){let t=e.indexOf(",");if(t<0)return"";let r=e.slice(t+1,t+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(r)}catch{return""}}function Zt(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function mn(e){let t=[],r="",n=0;for(let i=0;i<e.length;i++){let a=e[i];a==="("&&n++,a===")"&&(n=Math.max(0,n-1)),a===";"&&n===0?(t.push(r),r=""):r+=a}return r.trim()&&t.push(r),t.map(i=>i.trim()).filter(Boolean)}function Ri(e){let t=[],r="",n=0;for(let a=0;a<e.length;a++){let o=e[a];o==="("&&n++,o===")"&&(n=Math.max(0,n-1)),o===","&&n===0?(t.push(r.trim()),r=""):r+=o}r.trim()&&t.push(r.trim());let i=[];for(let a of t){if(/\binset\b/i.test(a))continue;let o=a.match(/-?\d+(?:\.\d+)?px/gi)||[],[l="0px",s="0px",d="0px"]=o;d=`${parseFloat(d)/2}px`;let c=a.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),u=!!c&&c!==",";i.push(`drop-shadow(${l} ${s} ${d}${u?` ${c}`:""})`)}return i.join(" ")}function gn(e){let t=mn(e),r=null,n=null,i=null,a=[];for(let l of t){let s=l.indexOf(":");if(s<0)continue;let d=l.slice(0,s).trim().toLowerCase(),c=l.slice(s+1).trim();d==="box-shadow"?i=c:d==="filter"?r=c:d==="-webkit-filter"?n=c:a.push([d,c])}if(i){let l=Ri(i);l&&(r=r?`${r} ${l}`:l,n=n?`${n} ${l}`:l)}let o=[...a];return r&&o.push(["filter",r]),n&&o.push(["-webkit-filter",n]),o.map(([l,s])=>`${l}:${s}`).join(";")}function Ei(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,r,n)=>`${r}{${gn(n)}}`)}function Pi(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,r)=>t.replace(r,Ei(r))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,r,n)=>`style=${r}${gn(n)}${r}`),e}function Li(){return Ze||(Ze=(async()=>{try{let e='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',t=new Image;t.decoding="sync",t.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,await t.decode();let r=document.createElement("canvas");r.width=8,r.height=20;let n=r.getContext("2d",{willReadFrequently:!0});n.drawImage(t,0,0);let i=n.getImageData(2,18,1,1).data[3]>128,a=n.getImageData(2,2,1,1).data[3]>128;return{native:i||a,flippedY:a&&!i}}catch{return{native:!1,flippedY:!1}}})(),Ze)}function Wi(e){let t=[],r=0,n=0;for(let i=0;i<e.length;i++){let a=e[i];a==="("?r++:a===")"?r=Math.max(0,r-1):a===","&&r===0&&(t.push(e.slice(n,i)),n=i+1)}return t.push(e.slice(n)),t.map(i=>{let a=0,o=0,l="",s=0;for(;s<i.length;){let d=i[s];if(d==="("?a++:d===")"&&(a=Math.max(0,a-1)),a===0&&(s===0||i[s-1]===" ")){let c=/^-?\d*\.?\d+px/.exec(i.slice(s));if(c){o++,l+=o===2?`${-parseFloat(c[0])}px`:c[0],s+=c[0].length;continue}}l+=d,s++}return l}).join(",")}function Ti(e,t){let r=n=>mn(n).map(i=>{let a=i.indexOf(":");if(a<0)return i;let o=i.slice(0,a).trim().toLowerCase();return o==="text-shadow"||t&&o==="box-shadow"?`${o}:${Wi(i.slice(a+1))}`:i}).join(";");return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(n,i)=>n.replace(i,i.replace(/([^{}]+)\{([^}]*)\}/g,(a,o,l)=>`${o}{${r(l)}}`))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(n,i,a)=>`style=${i}${r(a)}${i}`),e}async function er(e){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(e))return{svg:e,naturalOnly:!1};let{native:t,flippedY:r}=await Li();try{let n=e;return t||(n=Pi(n)),r&&(n=Ti(n,t)),{svg:n,naturalOnly:!0}}catch{return{svg:e,naturalOnly:!0}}}async function Ii(e,t){e.setAttribute("data-snapdom-internal",""),e.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(e);try{let r=document.createElement("canvas");r.width=16,r.height=16;let n=()=>new Promise(o=>{requestAnimationFrame(o),setTimeout(o,50)}),i=r.getContext("2d",{willReadFrequently:!0});if(!i){await n(),await n();return}let a=performance.now()+(t?600:150);for(;;){i.clearRect(0,0,16,16);try{i.drawImage(e,0,0,16,16)}catch{return}let o=i.getImageData(0,0,16,16).data,l=!1;for(let s=3;s<o.length;s+=4)if(o[s]>0){l=!0;break}if(l||performance.now()>a)return;await n()}}finally{try{e.remove()}catch{}}}async function bt(e,t){let{width:r,height:n,scale:i=1,dpr:a=1,meta:o={},backgroundColor:l,crop:s=null}=t,d=e,c=!1,u=!1;if(s&&!wr(e))throw new RangeError("[snapdom] canvas crop requires an SVG capture payload");if(wr(e)){let k=(Ni(e).match(/<svg\b[^>]*>/i)||[])[0]||"",N=parseFloat((k.match(/\bwidth="([\d.]+)/i)||[])[1]),R=parseFloat((k.match(/\bheight="([\d.]+)/i)||[])[1]),I=Number.isFinite(N)&&Number.isFinite(R)&&N>0&&R>0&&Math.min(1,ye/N,ye/R,Math.sqrt(st/(N*R)))<1;if(s||I||se())try{let E=Kt(e);if(s&&(E=Fi(E,s)),se()){let L=await er(E);E=L.svg,c=L.naturalOnly,u=/@font-face|data:image\//i.test(E)}(I||s)&&(E=ki(E)),d=Zt(E)}catch(E){if(s)throw E;d=e}}let f=new Image;f.loading="eager",f.decoding="sync",f.crossOrigin="anonymous",f.src=d,await f.decode(),se()&&await Ii(f,u);let h=f.naturalWidth,p=f.naturalHeight,m=s?h:Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:h,y=s?p:Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:p,b,x,v=Number.isFinite(r),g=Number.isFinite(n);if(v&&g)b=Math.max(1,r),x=Math.max(1,n);else if(v){let k=r/Math.max(1,m);b=r,x=y*k}else if(g){let k=n/Math.max(1,y);x=n,b=m*k}else b=h,x=p;b=b*i,x=x*i;let w=b*a,M=x*a,A=Math.max(w/ye,M/ye,Math.sqrt(w*M/st));A>1&&(console.warn(`[snapDOM] Output ${Math.round(w)}\xD7${Math.round(M)}px exceeds the browser canvas limit (${ye}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),b/=A,x/=A);let S=document.createElement("canvas");S.width=b*a,S.height=x*a,S.style.width=`${b}px`,S.style.height=`${x}px`;let $=S.getContext("2d");if(a!==1&&$.scale(a,a),l&&($.save(),$.fillStyle=l,$.fillRect(0,0,b,x),$.restore()),c&&(Math.round(b*a)!==h||Math.round(x*a)!==p)){let k=document.createElement("canvas");k.width=h,k.height=p,k.getContext("2d").drawImage(f,0,0),$.drawImage(k,0,0,b,x)}else $.drawImage(f,0,0,b,x);return S}var ye,st,Ze,_e=oe(()=>{"use strict";$e(),ye=16384,st=16384*16384,Ze=null}),et={};Oe(et,{rasterize:()=>yn});async function yn(e,t){let r=await bt(e,t),n=await new Promise(a=>{let o=()=>a(r.toDataURL(`image/${t.format}`,t.quality));try{r.toBlob(l=>{if(!l)return o();let s=new FileReader;s.onload=()=>a(String(s.result||"")),s.onerror=o,s.readAsDataURL(l)},`image/${t.format}`,t.quality)}catch{o()}}),i=new Image;return i.src=n,await i.decode(),i.style.width=`${r.width/t.dpr}px`,i.style.height=`${r.height/t.dpr}px`,i}var tt=oe(()=>{"use strict";_e()}),Pt={};Oe(Pt,{toImg:()=>xr,toSvg:()=>xr});async function xr(e,t){let{scale:r=1,width:n,height:i,meta:a={}}=t,o=Number.isFinite(n),l=Number.isFinite(i),s=Number.isFinite(r)&&r!==1||o||l;if(se()&&s)try{let{svg:c}=await er(Kt(e)),u=(c.match(/<svg\b[^>]*>/i)||[])[0]||"",f=parseFloat((u.match(/\bwidth="([\d.]+)/i)||[])[1]),h=parseFloat((u.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(f)||!Number.isFinite(h))throw new Error("svg without dimensions");let p=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:f,m=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:h,y,b;o&&l?(y=n,b=i):o?(y=n,b=Math.round(m*(n/Math.max(1,p)))):l?(b=i,y=Math.round(p*(i/Math.max(1,m)))):(y=Math.round(f*r),b=Math.round(h*r));let x=c.replace(/width="[^"]*"/,`width="${y}"`).replace(/height="[^"]*"/,`height="${b}"`),v=new Image;return v.decoding="sync",v.loading="eager",v.src=Zt(x),await v.decode(),v.style.width=`${y}px`,v.style.height=`${b}px`,v}catch(c){return U(t,"safari vector toImg failed, falling back to PNG",c),yn(e,{...t,format:"png",quality:1,meta:a})}let d=new Image;if(d.decoding="sync",d.loading="eager",d.src=e,await d.decode(),o&&l)d.style.width=`${n}px`,d.style.height=`${i}px`;else if(o){let c=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:d.naturalWidth,u=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:d.naturalHeight,f=n/Math.max(1,c);d.style.width=`${n}px`,d.style.height=`${Math.round(u*f)}px`}else if(l){let c=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:d.naturalWidth,u=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:d.naturalHeight,f=i/Math.max(1,u);d.style.height=`${i}px`,d.style.width=`${Math.round(c*f)}px`}else{let c=Math.round(d.naturalWidth*r),u=Math.round(d.naturalHeight*r);if(d.style.width=`${c}px`,d.style.height=`${u}px`,typeof e=="string"&&e.startsWith("data:image/svg+xml"))try{let f=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${c}"`).replace(/height="[^"]*"/,`height="${u}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,d.src=e}catch(f){U(t,"SVG width/height patch in toImg failed",f)}}return d}var vr=oe(()=>{"use strict";de(),tt(),_e()}),bn={};Oe(bn,{toBlob:()=>wn});async function wn(e,t){let r=t.type;if(r==="svg"){let i=decodeURIComponent(e.split(",")[1]);return new Blob([i],{type:"image/svg+xml"})}let n=await bt(e,t);return new Promise(i=>n.toBlob(a=>i(a),`image/${r}`,t.quality))}var xn=oe(()=>{"use strict";_e()}),vn={};Oe(vn,{download:()=>Oi});async function Sr(e,t){let r=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[r]}))return!1;try{await navigator.share({files:[r],title:t})}catch(n){if(n.name!=="AbortError")return!1}return!0}async function Oi(e,t){let r=new Set(["png","jpeg","jpg","webp","svg"]),n=(t?.type||"").toLowerCase(),i=r.has(n)?n:"",a=(t?.format||i||"").toLowerCase(),o=a==="jpg"?"jpeg":a||"png",l=t?.filename||`snapdom.${o}`,s={...t||{},format:o,type:o};s.dpr=1;let d=Ai();if(o==="svg"){let f=await wn(e,{...s,type:"svg"});if(d&&await Sr(f,l))return;let h=URL.createObjectURL(f),p=document.createElement("a");p.href=h,p.download=l,document.body.appendChild(p),p.click(),URL.revokeObjectURL(h),p.remove();return}let c=await bt(e,s);if(d){let f=`image/${o}`,h=await new Promise(p=>c.toBlob(p,f,t?.quality));if(h&&await Sr(h,l))return}let u=document.createElement("a");u.href=c.toDataURL(`image/${o}`,t?.quality),u.download=l,document.body.appendChild(u),u.click(),u.remove()}var _i=oe(()=>{"use strict";xn(),_e(),$e()});de();de();te();var ct="http://www.w3.org/1999/xhtml",Di="http://www.w3.org/2000/svg";function ut(e){return!!e&&e.nodeType===1&&e.namespaceURI===ct}function pe(e,...t){return ut(e)&&t.includes(e.localName)}function tr(e){return!!e&&e.nodeType===1&&e.namespaceURI===Di}function Bi(e){return tr(e)&&e.localName==="svg"}function rr(e){return!!e&&e.nodeType===11&&!!e.host}function Ui(e){return!!e&&e.nodeType===9}function ji(e){return!!e&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"}var Lt=new WeakMap,Te=new Map,Vi=2e3,dt=0;function rt(){dt++,Te.size>Vi&&Te.clear()}var qi="[data-snapdom-sandbox],[data-snapdom-internal],[data-snapdom]";function Ct(e){let t=e&&(e.nodeType===1?e:e.parentElement);return!!(t&&t.closest&&t.closest(qi))}function Sn(e){for(let t of e)if(!Ct(t.target)){if(t.type==="childList"){let r=!0;for(let n of t.addedNodes)if(!Ct(n)){r=!1;break}if(r){for(let n of t.removedNodes)if(!Ct(n)){r=!1;break}}if(r)continue}return!0}return!1}var Cr=!1;function zi(e=document.documentElement){if(Cr)return;Cr=!0;let t=r=>{Sn(r)&&rt()};try{new MutationObserver(t).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(t).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let r=document.fonts;r&&(r.addEventListener?.("loadingdone",rt),r.ready?.then(()=>rt()).catch(()=>{}))}catch{}}var Hi=["mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"];function Mr(e){let t=Lt.get(e);if(t&&t.epoch===dt){let r=t.snapshot&&t.snapshot.__needsBgInline;if(r!==void 0)return r}return!0}function Xi(e,t={}){let r={},n=t.excludeStyleProps;for(let u=0;u<e.length;u++){let f=e[u];if(Yt(f)||n&&(n instanceof RegExp&&n.test(f)||typeof n=="function"&&n(f)))continue;let h=e.getPropertyValue(f);(f==="background-image"||f==="content")&&h.includes("url(")&&!h.includes("data:")&&(h="none"),r[f]=h}let i=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let u of i)if(!r[u])try{let f=e.getPropertyValue(u);f&&(r[u]=f)}catch{}let a=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let u of a)if(!r[u])try{let f=e.getPropertyValue(u);f&&(r[u]=f)}catch{}if(t.embedFonts){let u=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let f of u)if(!r[f])try{let h=e.getPropertyValue(f);h&&(r[f]=h)}catch{}}try{(r["content-visibility"]||e.getPropertyValue("content-visibility"))==="hidden"&&(r["content-visibility"]="hidden")}catch{}let o=!1;{let u=e.getPropertyValue("background-image");if(u&&u!=="none"&&(o=!0),!o){let f=e.getPropertyValue("background-color");f&&f!=="rgba(0, 0, 0, 0)"&&f!=="transparent"&&(o=!0)}if(!o)for(let f of Hi){let h=e.getPropertyValue(f);if(h&&h!=="none"){o=!0;break}}if(!o){let f=e.getPropertyValue("background");f&&/url\s*\(/i.test(f)&&(o=!0)}}Object.defineProperty(r,"__needsBgInline",{value:o,enumerable:!1});let l=parseFloat(e.getPropertyValue("border-top-width")||0)||0,s=parseFloat(e.getPropertyValue("border-right-width")||0)||0,d=parseFloat(e.getPropertyValue("border-bottom-width")||0)||0,c=parseFloat(e.getPropertyValue("border-left-width")||0)||0;if(l===0&&s===0&&d===0&&c===0){let u=(e.getPropertyValue("border-image-source")||"").trim(),f=u&&u!=="none",h=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let p of h)delete r[p];f||(r.border="none")}return r}function Gi(e){for(let t=e.firstChild;t;t=t.nextSibling){if(t.nodeType===3&&/\S/.test(t.nodeValue||""))return!0;if(t.nodeType===1){let r=B(t).position;if(r!=="absolute"&&r!=="fixed")return!0}}return!1}function Yi(e,t,r){try{if(typeof e.computedStyleMap=="function"){let i=e.computedStyleMap().get("width");if(i!=null)return!Ar(String(i).trim().toLowerCase())}}catch{}let n=e.style&&(e.style.width||e.style.inlineSize);return n&&!Ar(String(n).trim().toLowerCase())?!0:Ji(e,t)?r||Ki(e,t):!1}var Qi=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function Ar(e){return Qi.has(e)||e.startsWith("fit-content")}function Ji(e,t){let r=e.getBoundingClientRect().width-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)-(parseFloat(t.borderLeftWidth)||0)-(parseFloat(t.borderRightWidth)||0);if(!(r>0))return!1;let n=1/0,i=-1/0,a=null;for(let o=e.firstChild;o;o=o.nextSibling){let l;if(o.nodeType===3){if(!/\S/.test(o.nodeValue||"")||(a=a||document.createRange(),a.selectNode(o),l=a.getBoundingClientRect(),!l.width&&!l.height))continue}else if(o.nodeType===1){let s=B(o);if(s.display==="none"||s.position==="absolute"||s.position==="fixed")continue;l=o.getBoundingClientRect()}else continue;l.left<n&&(n=l.left),l.right>i&&(i=l.right)}return i===-1/0?!1:i-n<r-.5}function Ki(e,t){let r=e.parentElement;if(!r)return!1;let n=B(r),i=r.getBoundingClientRect().width-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0)-(parseFloat(n.borderLeftWidth)||0)-(parseFloat(n.borderRightWidth)||0)-(parseFloat(t.marginLeft)||0)-(parseFloat(t.marginRight)||0);return i>0?Math.abs(e.getBoundingClientRect().width-i)>.5:!1}var $r=new WeakMap;function Zi(e){let t=$r.get(e);return t||(t=Object.entries(e).sort((r,n)=>r[0]<n[0]?-1:r[0]>n[0]?1:0).map(([r,n])=>`${r}:${n}`).join(";"),$r.set(e,t),t)}function eo(e,t=null,r={}){let n=Lt.get(e),i=!!(r&&r.embedFonts),a=r&&r.excludeStyleProps||null;if(n&&n.epoch===dt&&n.embedFonts===i&&n.excludeStyleProps===a)return n.snapshot;let o=t||getComputedStyle(e),l=Xi(o,r);return lo(e,o,l),Lt.set(e,{epoch:dt,snapshot:l,embedFonts:i,excludeStyleProps:a}),l}function to(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:Te,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:t||{}}:{session:C.session,persist:{snapshotKeyCache:Te,defaultStyle:C.defaultStyle,baseStyle:C.baseStyle,image:C.image,resource:C.resource,background:C.background,font:C.font},options:e||t||{}}}function ro(e,t,r){if(!(!e.style||e.style.length===0))for(let n=0;n<e.style.length;n++){let i=e.style[n],a=r.getPropertyValue(i);a&&t.style.setProperty(i,a)}}async function me(e,t,r,n){if(e.tagName==="STYLE")return;let i=to(r,n),a=i.options&&i.options.cache||"auto";a!=="disabled"&&zi(document.documentElement),a==="disabled"&&!i.session.__bumpedForDisabled&&(rt(),Te.clear(),i.session.__bumpedForDisabled=!0);let{session:o,persist:l}=i;if(!o.styleCache.has(e)){let y=null;try{y=getComputedStyle(e)}catch{}o.styleCache.set(e,y||getComputedStyle(document.documentElement))}let s=o.styleCache.get(e);e.getAttribute?.("style")&&ro(e,t,s);let d=s.getPropertyValue("animation-name");t&&t.style&&d&&d!=="none"&&t.style.setProperty("animation","none","important");let c=eo(e,s,i.options);no(e,s,c);let u=Cn(e);if(u){let y=s.getPropertyValue("min-width");(!y||y==="auto"||y==="0px")&&(c["min-width"]="0px")}let f=e.tagName?.toLowerCase()||"div",h=Zi(c),p=!0;if(en(f,(c.display||"").toLowerCase())){p=Gi(e),p&&xi(f,c,u)&&Yi(e,s,u)&&(p=!1),h=`${h}|${f}${p?"|c":""}${u?"|f":""}`;let y=c["text-wrap-mode"]||c["white-space"]||"";p&&y!=="nowrap"&&y!=="pre"&&(o.reconcileRisk=(o.reconcileRisk||0)+1)}let m=l.snapshotKeyCache.get(h);m===void 0&&(m=Nt(c,f,p,u),l.snapshotKeyCache.set(h,m)),o.styleMap.set(t,m)}function no(e,t,r){let n=t.getPropertyValue("overflow-x"),i=t.getPropertyValue("overflow-y");if((n==="visible"||!n)&&(i==="visible"||!i)||t.getPropertyValue("box-sizing")==="border-box"||typeof e.clientWidth!="number"||!e.offsetWidth)return;let a=d=>parseFloat(d)||0,o=e.offsetWidth-e.clientWidth-a(t.getPropertyValue("border-left-width"))-a(t.getPropertyValue("border-right-width")),l=e.offsetHeight-e.clientHeight-a(t.getPropertyValue("border-top-width"))-a(t.getPropertyValue("border-bottom-width")),s=(d,c)=>{let u=r[d];if(!u||!u.endsWith("px"))return;let f=parseFloat(u);Number.isFinite(f)&&(r[d]=`${Math.round((f+c)*1e3)/1e3}px`)};o>.5&&(s("width",o),s("inline-size",o)),l>.5&&(s("height",l),s("block-size",l))}function io(e){return e.backgroundImage&&e.backgroundImage!=="none"||e.backgroundColor&&e.backgroundColor!=="rgba(0, 0, 0, 0)"&&e.backgroundColor!=="transparent"||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||"visible")!=="visible"}function Cn(e){let t=e.parentElement;if(!t)return!1;let r=B(t).display||"";return r.includes("flex")||r.includes("grid")}function oo(e){for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType===3&&/\S/.test(n.nodeValue))return!0;let t=e.firstElementChild,r=e.lastElementChild;if(t&&t.tagName==="BR"||r&&r.tagName==="BR")return!0;for(let n=e.firstElementChild;n;n=n.nextElementSibling){let i=B(n);if(i.display==="none")continue;let a=i.position;if(a!=="absolute"&&a!=="fixed")return!0}return!1}function ao(e){let t=e.getBoundingClientRect().top,r=-1/0,n=null;for(let i=e.firstChild;i;i=i.nextSibling){if(i.nodeType===3){if(!/\S/.test(i.nodeValue||""))continue;n=n||document.createRange(),n.selectNode(i);let l=n.getBoundingClientRect();(l.width||l.height)&&(r=Math.max(r,l.bottom));continue}if(i.nodeType!==1)continue;let a=B(i);if(a.display==="none")continue;let o=a.position;o==="absolute"||o==="fixed"||a.float&&a.float!=="none"||(r=Math.max(r,i.getBoundingClientRect().bottom))}return r===-1/0?NaN:r-t}function lo(e,t,r){if(ut(e)&&e.style&&e.style.height)return;let n=e.tagName&&e.tagName.toLowerCase();if(!n||!["div","section","article","main","aside","header","footer","nav"].includes(n)||t.aspectRatio&&t.aspectRatio!=="none"&&t.aspectRatio!=="auto")return;let i=t.display||"";if(i.includes("flex")||i.includes("grid"))return;let a=t.position;if(a==="absolute"||a==="fixed"||a==="sticky"||t.transform!=="none"||io(t)||Cn(e))return;let o=t.overflowX||t.overflow||"visible",l=t.overflowY||t.overflow||"visible";if(o!=="visible"||l!=="visible")return;let s=t.clip;if(s&&s!=="auto"&&s!=="rect(auto, auto, auto, auto)"||t.visibility==="hidden"||t.opacity==="0"||!oo(e))return;let d=parseFloat(t.height),c=ao(e);Number.isFinite(d)&&Number.isFinite(c)&&Math.abs(d-c)>2||(delete r.height,delete r["block-size"])}yt();var Mn=["fill","stroke","color","background-color","stop-color"],so=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]);function Wt(e){let t=e;for(;t&&t.nodeType===1;){if(t.namespaceURI==="http://www.w3.org/2000/svg"){if(t.localName==="mask"||t.localName==="clipPath")return!1;if(so.has(t.localName))return!0}t=t.parentNode}return!1}var kr=new Map;function co(e,t){let r=t+"::"+e.toLowerCase(),n=kr.get(r);if(n)return n;let i=document,a=t==="http://www.w3.org/2000/svg"?i.createElementNS(t,e):i.createElement(e),o=i.createElement("div");o.setAttribute("data-snapdom-internal",""),o.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",o.appendChild(a),i.documentElement.appendChild(o);let l=getComputedStyle(a),s={};for(let d of Mn)s[d]=l.getPropertyValue(d)||"";return o.remove(),kr.set(r,s),s}function uo(e,t){if(e?.nodeType!==1||t?.nodeType!==1||Wt(e))return;let r=e.getAttribute?.("style"),n=!!(r&&r.includes("var("));if(!n&&e.attributes?.length){let a=e.attributes;for(let o=0;o<a.length;o++){let l=a[o];if(l&&typeof l.value=="string"&&l.value.includes("var(")){n=!0;break}}}let i=null;if(n)try{i=getComputedStyle(e)}catch{}if(n){let a=e.style;if(a&&a.length){let o=new Set;for(let l=0;l<a.length;l++){let s=a[l];if(o.has(s))continue;o.add(s);let d=a.getPropertyValue(s);if(!d||!d.includes("var("))continue;let c=i&&i.getPropertyValue(s);if(c)try{t.style.setProperty(s,c.trim(),a.getPropertyPriority(s))}catch{}}}}if(n&&e.attributes?.length){let a=e.attributes;for(let o=0;o<a.length;o++){let l=a[o];if(!l||typeof l.value!="string"||!l.value.includes("var("))continue;let s=l.name,d=i&&i.getPropertyValue(s);if(d)try{t.style.setProperty(s,d.trim())}catch{}}}if(!n){if(!i)try{i=getComputedStyle(e)}catch{i=null}if(!i)return;let a=e.namespaceURI||"html",o=co(e.tagName,a);for(let l of Mn){let s=i.getPropertyValue(l)||"",d=o[l]||"";if(s&&s!==d)try{t.style.setProperty(l,s.trim())}catch{}}}}de();de();te();Ae();Ae();function Me(e){return!!(!e||e.startsWith("data:")||e.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(e)&&e.length<200)}var Fr="img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]";function fo(e,t){return!e||e?.nodeType!==1?!1:e.matches?.("picture")||e.querySelector("picture")?!0:t?!!(e.matches?.(Fr)||e.querySelector(Fr)):!1}var ho=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i;function ft(e,t){if(!e)return null;let r=0;try{r=t?t.getBoundingClientRect().width||t.width:0}catch{}r||(r=window.innerWidth||1e3);let n=[];for(let a of e.split(",")){let o=a.trim().split(/\s+/);if(!o[0])continue;let l=o[1]||"",s=1;/^\d*\.?\d+x$/i.test(l)?s=parseFloat(l):/^\d+w$/i.test(l)&&(s=parseInt(l,10)/r),n.push({url:o[0],d:s})}if(!n.length)return null;n.sort((a,o)=>a.d-o.d);let i=window.devicePixelRatio||1;return(n.find(a=>a.d>=i)||n[n.length-1]).url}function An(e,t){let r=e.currentSrc||"";if(r&&!Me(r))return r;let n=t.querySelectorAll("source[srcset]"),i=null;for(let a of n){let o=a.getAttribute("srcset");if(!o||Me(o))continue;let l=a.getAttribute("type");if(l&&!ho.test(l.trim()))continue;let s=a.getAttribute("media");if(s)try{if(window.matchMedia(s).matches)return ft(o,e)}catch{}i||(i=ft(o,e))}return i}function po(e){let t=[e.getAttribute("data-src"),e.getAttribute("data-lazy-src"),e.getAttribute("data-original"),e.getAttribute("data-hi-res-src")];for(let n of t)if(n&&!Me(n))return n;let r=e.getAttribute("data-srcset")||e.getAttribute("data-lazy-srcset");if(r){let n=r.split(",")[0].trim().split(/\s+/)[0];if(n&&!Me(n))return n}return null}function mo(e={}){let t=e.pictureResolver&&typeof e.pictureResolver=="object"?e.pictureResolver:{};return{timeout:t.timeout??5e3,concurrency:t.concurrency??4,resolveLazySrc:t.resolveLazySrc!==!1,silent:t.silent??!1,useProxy:typeof e.useProxy=="string"?e.useProxy:""}}async function go(e,t={}){if(!e||e?.nodeType!==1||t.resolvePicturePlaceholders===!1)return null;let{timeout:r,concurrency:n,resolveLazySrc:i,silent:a,useProxy:o}=mo(t);if(!fo(e,i))return null;let l=[],s=[];async function d(f){let h=await ie(f,{as:"dataURL",timeout:r,useProxy:o,silent:!0});return h.ok?h.data:null}async function c(f){for(let h=0;h<f.length;h+=n){let p=f.slice(h,h+n);await Promise.allSettled(p.map(m=>m()))}}let u=Array.from(e.querySelectorAll("picture"));e.matches?.("picture")&&u.unshift(e);for(let f of u){let h=f.querySelector("img");if(!h)continue;let p=h.getAttribute("src")||"";if(!Me(p))continue;let m=An(h,f);m&&s.push(async()=>{let y=await d(m);if(!y){a||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${m.slice(0,60)}`);return}let b=h.getAttribute("src"),x=h.getAttribute("srcset"),v=h.getAttribute("sizes"),g=[];h.src=y,h.setAttribute("src",y),h.removeAttribute("srcset"),h.removeAttribute("sizes");let w=f.querySelectorAll("source");for(let M of w)g.push({el:M,parent:M.parentElement,next:M.nextSibling}),M.remove();l.push(()=>{b!==null?h.setAttribute("src",b):h.removeAttribute("src"),x!==null&&h.setAttribute("srcset",x),v!==null&&h.setAttribute("sizes",v);for(let{el:M,parent:A,next:S}of g)A&&A.insertBefore(M,S)})})}if(i){let f=Array.from(e.querySelectorAll("img"));e.localName==="img"&&f.unshift(e);for(let h of f){if(h.closest("picture")&&Me(h.getAttribute("src")||""))continue;let p=h.getAttribute("src")||"",m=po(h);m&&Me(p)&&s.push(async()=>{let y=await d(m);if(!y)return;let b=h.getAttribute("src");h.src=y,h.setAttribute("src",y),h.removeAttribute("srcset"),h.removeAttribute("sizes"),l.push(()=>{b!==null?h.setAttribute("src",b):h.removeAttribute("src")})})}}return s.length===0?null:(await c(s),async function(){for(let f of l)try{f()}catch{}})}function Mt(e,t,r){return r?Promise.all(e.map(n=>new Promise(i=>t(n,i)))):Promise.all(e.map(n=>new Promise(i=>{function a(){Ke(o=>{!(o&&typeof o.timeRemaining=="function")||o.timeRemaining()>0?t(n,i):a()},{fast:r})}a()})))}function yo(e,t){if(e=e.trim(),!e)return e;let r=t?`[data-sd-slotted~="${t}"]`:"[data-sd-slotted]";return e.endsWith(":not([data-sd-slotted])")||e.endsWith(`:not(${r})`)?e:`${e}:not(${r})`}function bo(e,t,r=!0,n){return e.split(",").map(i=>i.trim()).filter(Boolean).map(i=>{if(i.startsWith(":where(")||i.startsWith("@"))return i;let a=r?yo(i,n):i;return`:where(${t} ${a})`}).join(", ")}function wo(e,t,r){return e?(e=e.replace(/:host\(([^)]+)\)/g,(n,i)=>`:where(${t}:is(${i.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(n,i)=>`:where(:where(${i.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(n,i)=>`:where(${t} ${i.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(n,i,a,o)=>{let l=bo(o,t,!0,r);return`${i}${a}${l}{`}),e):""}function xo(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function vo(e){let t="";try{e.querySelectorAll("style").forEach(n=>{t+=(n.textContent||"")+`
|
|
4
|
+
`});let r=e.adoptedStyleSheets||[];for(let n of r)try{if(n&&n.cssRules)for(let i of n.cssRules)t+=i.cssText+`
|
|
5
|
+
`}catch{}}catch{}return t}function So(e,t,r){if(!t)return;let n=document.createElement("style");n.setAttribute("data-sd",r),n.textContent=t,e.insertBefore(n,e.firstChild||null)}function Co(e,t){try{let r=null,n=B(e).content;if(n&&n.includes("url(")){let o=n.match(/url\(["']?([^"')]+)["']?\)/);o&&(r=o[1])}let i=e.closest?.("picture"),a=r||(i?An(e,i):e.currentSrc)||e.src||ft(e.getAttribute("srcset"),e)||"";if(!a)return;t.setAttribute("src",a),t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.loading="eager",t.decoding="sync"}catch{}}function Mo(e){let t=new Set;if(!e)return t;let r=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,n;for(;n=r.exec(e);)t.add(n[1]);return t}function Ao(e,t){try{let r=getComputedStyle(e).getPropertyValue(t).trim();if(r)return r}catch{}try{let r=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(r)return r}catch{}return""}function $o(e,t,r){let n=[];for(let i of t){let a=Ao(e,i);a&&n.push(`${i}: ${a};`)}return n.length?`${r}{${n.join("")}}
|
|
6
|
+
`:""}function ko(e,t){if(!e)return;let r=n=>{let i=n.getAttribute("data-sd-slotted")||"";t?` ${i} `.includes(` ${t} `)||n.setAttribute("data-sd-slotted",i?`${i} ${t}`:t):n.setAttribute("data-sd-slotted",i)};e.nodeType===Node.ELEMENT_NODE&&r(e),e.querySelectorAll?.("*").forEach(r)}async function Fo(e,t=3){let r=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},n=r(),i=0;for(;i<t&&(!n||!n.body&&!n.documentElement);)await new Promise(a=>setTimeout(a,0)),n=r(),i++;return n&&(n.body||n.documentElement)?n:null}function No(e){let t=e.getBoundingClientRect(),r=0,n=0,i=0,a=0;try{let s=getComputedStyle(e);r=parseFloat(s.borderLeftWidth)||0,n=parseFloat(s.borderRightWidth)||0,i=parseFloat(s.borderTopWidth)||0,a=parseFloat(s.borderBottomWidth)||0}catch{}let o=Math.max(0,Math.round(t.width-(r+n))),l=Math.max(0,Math.round(t.height-(i+a)));return{contentWidth:o,contentHeight:l,rect:t}}function ge(e){let t=0,r=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(r=e.offsetHeight),t===0||r===0)try{let n=getComputedStyle(e);if(t===0){let i=parseFloat(n.width);!isNaN(i)&&i>0&&(t=i)}if(r===0){let i=parseFloat(n.height);!isNaN(i)&&i>0&&(r=i)}}catch{}if(t===0||r===0)try{if(t===0){let n=parseFloat(e.getAttribute("width"));!isNaN(n)&&n>0&&(t=n)}if(r===0){let n=parseFloat(e.getAttribute("height"));!isNaN(n)&&n>0&&(r=n)}}catch{}if((t===0||r===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),r===0&&e.naturalHeight>0&&(r=e.naturalHeight)}catch{}return{width:t,height:r}}function Ro(e,t,r){let n=e.defaultView,i=n?n.scrollX:0,a=n?n.scrollY:0,o=e.body?e.body.scrollLeft:0,l=e.body?e.body.scrollTop:0,s=e.documentElement?e.documentElement.scrollLeft:0,d=e.documentElement?e.documentElement.scrollTop:0,c=0,u=0,f=0,h=0;try{let m=n&&e.body?n.getComputedStyle(e.body):null;m&&(c=(parseFloat(m.marginTop)||0)+(parseFloat(m.paddingTop)||0),u=(parseFloat(m.marginRight)||0)+(parseFloat(m.paddingRight)||0),f=(parseFloat(m.marginBottom)||0)+(parseFloat(m.paddingBottom)||0),h=(parseFloat(m.marginLeft)||0)+(parseFloat(m.paddingLeft)||0))}catch{}try{e.documentElement.setAttribute("data-sd-pinned","")}catch{}let p=e.createElement("style");return p.setAttribute("data-sd-iframe-pin",""),p.textContent=`html {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${r}px !important;min-width: ${t}px !important;min-height: ${r}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${c}px ${u}px ${f}px ${h}px !important;width: ${t}px !important;height: ${r}px !important;min-width: ${t}px !important;min-height: ${r}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(p),()=>{try{p.remove()}catch{}try{e.documentElement.removeAttribute("data-sd-pinned")}catch{}try{n&&typeof n.scrollTo=="function"&&n.scrollTo(i,a),e.body&&(e.body.scrollLeft=o,e.body.scrollTop=l),e.documentElement&&(e.documentElement.scrollLeft=s,e.documentElement.scrollTop=d)}catch{}}}async function Eo(e,t,r){let n=await Fo(e,3);if(!n)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:a,rect:o}=No(e),l=r?.snap;if(!l&&typeof window<"u"&&window.snapdom&&(l=window.snapdom),!l||typeof l.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let s={...r,scale:1,clip:null},d=Ro(n,i,a),c=C.session.nodeMap,u=C.session.styleMap,f=C.session.styleCache,h;try{h=await l.toPng(n.documentElement,s)}finally{d(),C.session.nodeMap=c,C.session.styleMap=u,C.session.styleCache=f}h.style.display="block",h.style.width=`${i}px`,h.style.height=`${a}px`;let p=document.createElement("div");return t.nodeMap.set(p,e),me(e,p,t,r),p.style.overflow="hidden",p.style.display="block",p.style.width||(p.style.width=`${Math.round(o.width)}px`),p.style.height||(p.style.height=`${Math.round(o.height)}px`),p.appendChild(h),p}function Po(e){let{width:t,height:r}=ge(e),n=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let a=i?parseFloat(i.width):NaN,o=i?parseFloat(i.height):NaN,l=Math.round(t||n.width||0),s=Math.round(r||n.height||0),d=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,l||16),c=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,s||16),u=(e.type||"text").toLowerCase()==="checkbox",f=!!e.checked,h=!!e.indeterminate,p=Math.max(Math.min(d,c),12),m="middle";try{i&&i.verticalAlign&&(m=i.verticalAlign)}catch{}let y=document.createElement("div");y.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),y.style.cssText=`display:inline-block;width:${p}px;height:${p}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let b=document.createElementNS("http://www.w3.org/2000/svg","svg");b.setAttribute("width",String(p)),b.setAttribute("height",String(p)),b.setAttribute("viewBox",`0 0 ${p} ${p}`),y.appendChild(b);function x(){let v="#0a6ed1";try{i&&(v=i.accentColor||i.color||v)}catch{}let g=2,w=g/2,M=p-g;if(b.innerHTML="",u){let A=document.createElementNS("http://www.w3.org/2000/svg","rect");if(A.setAttribute("x",String(w)),A.setAttribute("y",String(w)),A.setAttribute("width",String(M)),A.setAttribute("height",String(M)),A.setAttribute("rx","2"),A.setAttribute("ry","2"),A.setAttribute("fill",f?v:"none"),A.setAttribute("stroke",v),A.setAttribute("stroke-width",String(g)),b.appendChild(A),f){let S=document.createElementNS("http://www.w3.org/2000/svg","path");S.setAttribute("d",`M ${w+2} ${p/2} L ${p/2-1} ${p-w-2} L ${p-w-2} ${w+2}`),S.setAttribute("stroke","white"),S.setAttribute("stroke-width",String(Math.max(1.5,g))),S.setAttribute("fill","none"),S.setAttribute("stroke-linecap","round"),S.setAttribute("stroke-linejoin","round"),b.appendChild(S)}else if(h){let S=document.createElementNS("http://www.w3.org/2000/svg","rect"),$=Math.max(6,M-4);S.setAttribute("x",String((p-$)/2)),S.setAttribute("y",String((p-g)/2)),S.setAttribute("width",String($)),S.setAttribute("height",String(g)),S.setAttribute("fill",v),S.setAttribute("rx","1"),b.appendChild(S)}}else{let A=document.createElementNS("http://www.w3.org/2000/svg","circle");if(A.setAttribute("cx",String(p/2)),A.setAttribute("cy",String(p/2)),A.setAttribute("r",String((p-g)/2)),A.setAttribute("fill",f?v:"none"),A.setAttribute("stroke",v),A.setAttribute("stroke-width",String(g)),b.appendChild(A),f){let S=document.createElementNS("http://www.w3.org/2000/svg","circle"),$=Math.max(2,(p-g*2)*.35);S.setAttribute("cx",String(p/2)),S.setAttribute("cy",String(p/2)),S.setAttribute("r",String($)),S.setAttribute("fill","white"),b.appendChild(S)}}y.style.setProperty("width",`${p}px`,"important"),y.style.setProperty("height",`${p}px`,"important"),y.style.setProperty("min-width",`${p}px`,"important"),y.style.setProperty("min-height",`${p}px`,"important")}return x(),{el:y,applyVisual:x}}var Pe=new ee(80);async function We(e){if(C.resource?.has(e))return C.resource.get(e);if(Pe.has(e))return Pe.get(e);let t=(async()=>{let r=await ie(e,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return C.resource?.set(e,r.data),r.data})();Pe.set(e,t);try{let r=await t;return Pe.set(e,r),r}catch(r){throw Pe.delete(e),r}}var Lo=/\bblob:[^)"'\s]+/g;async function Nr(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(Lo)||[]));if(t.length===0)return e;let r=e;for(let n of t)try{let i=await We(n);r=r.split(n).join(i)}catch{}return r}function He(e){return typeof e=="string"&&e.startsWith("blob:")}function Wo(e){return(e||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{let r=t.match(/^(\S+)(\s+.+)?$/);return r?{url:r[1],desc:r[2]||""}:null}).filter(Boolean)}function To(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}function Xe(e,t){let r=e.querySelectorAll?Array.from(e.querySelectorAll(t)):[];return e.matches?.(t)&&r.unshift(e),r}async function Io(e,t=null){if(!e)return;let r=t,n=Xe(e,"img");for(let s of n)try{let d=s.getAttribute("src")||s.currentSrc||"";if(He(d)){let u=await We(d);s.setAttribute("src",u)}let c=s.getAttribute("srcset");if(c&&c.includes("blob:")){let u=Wo(c),f=!1;for(let h of u)if(He(h.url))try{h.url=await We(h.url),f=!0}catch(p){U(r,"blobUrlToDataUrl for srcset item failed",p)}f&&s.setAttribute("srcset",To(u))}}catch(d){U(r,"resolveBlobUrls for img failed",d)}let i=Xe(e,"image");for(let s of i)try{let d="http://www.w3.org/1999/xlink",c=s.getAttribute("href")||s.getAttributeNS?.(d,"href");if(He(c)){let u=await We(c);s.setAttribute("href",u),s.removeAttributeNS?.(d,"href")}}catch(d){U(r,"resolveBlobUrls for SVG image href failed",d)}let a=Xe(e,"[style*='blob:']");for(let s of a)try{let d=s.getAttribute("style");if(d&&d.includes("blob:")){let c=await Nr(d);s.setAttribute("style",c)}}catch(d){U(r,"replaceBlobUrls in inline style failed",d)}let o=e.querySelectorAll?e.querySelectorAll("style"):[];for(let s of o)try{let d=s.textContent||"";d.includes("blob:")&&(s.textContent=await Nr(d))}catch(d){U(r,"replaceBlobUrls in style tag failed",d)}let l=["poster"];for(let s of l){let d=Xe(e,`[${s}^='blob:']`);for(let c of d)try{let u=c.getAttribute(s);He(u)&&c.setAttribute(s,await We(u))}catch(u){U(r,`resolveBlobUrls for ${s} failed`,u)}}}$e();var Tt=new Map,Rr=new Set(["IFRAME"]);function wt(e,t){Tt.set(String(e).toUpperCase(),t)}function At(e){let{width:t,height:r}=ge(e),n=t,i=r;if(!n||!i){let o=e.getBoundingClientRect();n=n||o.width||0,i=i||o.height||0}let a=document.createElement("div");return a.style.cssText=`display:inline-block;width:${n}px;height:${i}px;visibility:hidden;`,a}var Ge=200,Oo=new Set(["img","canvas","video","iframe","object","embed"]);function Er(e,t){return e.right>=t.left-Ge&&e.left<=t.right+Ge&&e.bottom>=t.top-Ge&&e.top<=t.bottom+Ge}function _o(e,t){if(e===t.root)return!1;let r;try{r=e.getBoundingClientRect()}catch{return!1}if(r.width===0&&r.height===0)return!1;let n=B(e);if(n.display==="inline"&&!Oo.has((e.localName||"").toLowerCase()))return!1;let i=t.rect,a=e.scrollWidth||0,o=e.scrollHeight||0,l={left:n.direction==="rtl"?Math.min(r.left,r.right-a):r.left,top:r.top,right:Math.max(r.right,r.left+a),bottom:Math.max(r.bottom,r.top+o)},s=n.writingMode||"";if((s.startsWith("vertical")||s.startsWith("sideways"))&&(l.top=Math.min(r.top,r.bottom-o),l.left=Math.min(l.left,r.right-a)),Er(l,i))return!1;let d=(e.ownerDocument||document).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;d.nextNode();){let c=d.currentNode.getBoundingClientRect();if((c.width>0||c.height>0)&&Er(c,i))return!1}return!0}function Do(e,t,r){let n=e.cloneNode(!1);e.tagName==="IMG"&&(n.removeAttribute("src"),n.removeAttribute("srcset"),n.removeAttribute("sizes")),me(e,n,t,r);let{width:i,height:a}=ge(e);return i>0&&(n.style.width=`${i}px`,n.style.minWidth=`${i}px`,n.style.maxWidth=`${i}px`),a>0&&(n.style.height=`${a}px`,n.style.minHeight=`${a}px`,n.style.maxHeight=`${a}px`),n.style.visibility="hidden",n.style.overflow="hidden",n.style.boxSizing="border-box",n}async function nt(e,t,r){if(!e)throw new Error("Invalid node");let n=new Set,i=null,a=null;if(e.nodeType===Node.ELEMENT_NODE){let c=(e.localName||e.tagName||"").toLowerCase();if(e.id==="snapdom-sandbox"||e.hasAttribute("data-snapdom-sandbox")||Qt.has(c))return null;if(c==="foreignobject"&&e.parentElement?.closest?.("foreignObject"))return U(t,"Nested <foreignObject> skipped (SVG spec limitation \u2014 not rendered by browsers)"),null;if(c==="source"&&e.parentElement?.localName==="picture")return null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute("data-capture")==="exclude"){if(r.excludeMode==="hide")return At(e);if(r.excludeMode==="remove")return null}if(r.exclude&&Array.isArray(r.exclude))for(let c of r.exclude)try{if(e.matches?.(c)){if(r.excludeMode==="hide")return At(e);if(r.excludeMode==="remove")return null}}catch(u){console.warn(`Invalid selector in exclude option: ${c}`,u)}if(typeof r.filter=="function")try{if(!r.filter(e)){if(r.filterMode==="hide")return At(e);if(r.filterMode==="remove")return null}}catch(c){console.warn("Error in filter function:",c)}if(t.clip&&_o(e,t.clip))return Do(e,t,r);if(r.__resolveNodeHooks)for(let c of r.__resolveNodeHooks){let u;try{u=await c(e,r)}catch(f){U(t,"resolveNode plugin hook failed",f)}if(u===null)return null;if(ji(u))return u.nodeType===Node.ELEMENT_NODE&&(t.nodeMap.set(u,e),me(e,u,t,r)),u}{let c=Rr.has(e.tagName)&&Tt.get(e.tagName);if(c){let u=await c(e,t,r);if(u!==void 0)return u}}if(e.getAttribute("data-capture")==="placeholder"){let c=e.cloneNode(!1);t.nodeMap.set(c,e),me(e,c,t,r);let u=document.createElement("div");return u.textContent=e.getAttribute("data-placeholder-text")||"",u.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",c.appendChild(u),c}{let c=!Rr.has(e.tagName)&&Tt.get(e.tagName);if(c){let u=await c(e,t,r);if(u!==void 0)return u}}let o;try{if(o=e.cloneNode(!1),o.attributes?.length)try{for(let c of o.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(c.value)&&o.setAttribute(c.name,c.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(uo(e,o),t.nodeMap.set(o,e),e.tagName==="IMG"){Co(e,o);try{let c=window.getComputedStyle(e),u=parseFloat(c.width),f=parseFloat(c.height);if(!(u>0)||!(f>0)){let m=ge(e);u>0||(u=m.width),f>0||(f=m.height)}let h=Math.round((u||0)*1e3)/1e3,p=Math.round((f||0)*1e3)/1e3;h&&(o.dataset.snapdomWidth=String(h)),p&&(o.dataset.snapdomHeight=String(p))}catch(c){U(t,"getUnscaledDimensions for IMG failed",c)}try{let c=e.getAttribute("style")||"",u=window.getComputedStyle(e),f=v=>{let g=c.match(new RegExp(`${v}\\s*:\\s*([^;]+)`,"i")),w=g?g[1].trim():u.getPropertyValue(v);return/%|auto/i.test(String(w||""))},h=parseFloat(o.dataset.snapdomWidth||"0")||0,p=parseFloat(o.dataset.snapdomHeight||"0")||0,m=f("width")||!h,y=f("height")||!p;m&&h&&(o.style.width=`${h}px`),y&&p&&(o.style.height=`${p}px`);let b=u.getPropertyValue("object-fit"),x=u.getPropertyValue("object-position");b&&b!=="fill"?(o.style.objectFit=b,x&&(o.style.objectPosition=x)):(h&&(o.style.minWidth=`${h}px`),p&&(o.style.minHeight=`${p}px`))}catch(c){U(t,"IMG dimension freeze failed",c)}}}catch(c){throw console.error("[Snapdom] Failed to clone node:",e,c),c}let l=null;if(pe(e,"textarea")){let{width:c,height:u}=ge(e),f=c||e.getBoundingClientRect().width||0,h=u||e.getBoundingClientRect().height||0;f&&(o.style.width=`${f}px`),h&&(o.style.height=`${h}px`)}if(pe(e,"input")){let c=(e.type||"text").toLowerCase();if((c==="checkbox"||c==="radio")&&$i()){let{el:u,applyVisual:f}=Po(e);t.nodeMap.set(u,e),l=f,o=u}else o.value=e.value,o.setAttribute("value",e.value),e.checked!==void 0&&(o.checked=e.checked,e.checked&&o.setAttribute("checked",""),e.indeterminate&&(o.indeterminate=e.indeterminate))}if(pe(e,"input","textarea")&&!e.value&&e.placeholder)try{let c=window.getComputedStyle(e,"::placeholder"),u=c&&c.color;if(u&&u!=="rgba(0, 0, 0, 0)"){let f="snapdom-ph-"+(Math.random()*1e6|0);o.classList.add(f);let h=document.createElement("style");h.textContent=`.${f}::placeholder{color:${u}!important;opacity:${c.opacity||"1"}!important;-webkit-text-fill-color:${u}!important;}`,o.prepend(h)}}catch{}if(pe(e,"select")&&(i=e.value),pe(e,"textarea")&&(a=e.value),pe(e,"input","textarea","select")){e.disabled&&o.setAttribute("disabled",""),e.required&&o.setAttribute("required",""),e.readOnly&&o.setAttribute("readonly","");let c=e;c.min!==void 0&&c.min!==""&&o.setAttribute("min",c.min),c.max!==void 0&&c.max!==""&&o.setAttribute("max",c.max),c.pattern!==void 0&&c.pattern!==""&&o.setAttribute("pattern",c.pattern);let u=e.getAttribute("aria-invalid");u!==null&&o.setAttribute("aria-invalid",u)}if(Wt(e)||me(e,o,t,r),l&&l(),tr(e)&&!Wt(e)){let c=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let u=window.getComputedStyle(e);for(let f of c){let h=u.getPropertyValue(f);h&&o.style.setProperty(f,h)}}catch{}}if(e.shadowRoot){try{let v=e.shadowRoot.querySelectorAll("slot");for(let g of v){let w=g.assignedNodes?.()||[];for(let M of w)n.add(M)}}catch{}let c=xo(t),u=`[data-sd="${c}"]`;t.shadowScopes||=new WeakMap,t.shadowScopes.set(e.shadowRoot,c);try{o.setAttribute("data-sd",c)}catch{}let f=vo(e.shadowRoot),h=wo(f,u,c),p=Mo(f),m=$o(e,p,u);So(o,m+h,c);let y=document.createDocumentFragment(),b=(v,g)=>{if(v.nodeType===Node.ELEMENT_NODE&&v.tagName==="STYLE")return g(null);nt(v,t,r).then(w=>{g(w||null)}).catch(()=>{g(null)})},x=await Mt(Array.from(e.shadowRoot.childNodes),b,r.fast);y.append(...x.filter(v=>!!v)),o.appendChild(y)}if(e.tagName==="SLOT"){let c=t.shadowScopes?.get(e.getRootNode()),u=e.assignedNodes?.()||[],f=u.length?e.assignedNodes?.({flatten:!0})||u:[],h=f.length?f:Array.from(e.childNodes),p=document.createDocumentFragment(),m=(b,x)=>{nt(b,t,r).then(v=>{v&&u.length&&ko(v,c),x(v||null)}).catch(()=>{x(null)})},y=await Mt(Array.from(h),m,r.fast);return p.append(...y.filter(b=>!!b)),p}function s(c,u){if(n.has(c)||e.shadowRoot&&!c.assignedSlot)return u(null);nt(c,t,r).then(f=>{u(f||null)}).catch(()=>{u(null)})}let d=await Mt(Array.from(e.childNodes),s,r.fast);if(o.append(...d.filter(c=>!!c)),i!==null&&pe(o,"select")){o.value=i;for(let c of o.options)c.value===i?c.setAttribute("selected",""):c.removeAttribute("selected")}return a!==null&&pe(o,"textarea")&&(o.textContent=a),o}async function Bo(e,t,r){let n=!1;try{n=!!(e.contentDocument||e.contentWindow?.document)}catch(i){U(t,"iframe same-origin probe failed",i)}if(n)try{return await Eo(e,t,r)}catch(i){console.warn("[SnapDOM] iframe rasterization failed, fallback:",i)}if(n||console.warn("[snapdom] cross-origin <iframe> skipped (its document cannot be read). Captured as a placeholder that keeps the frame's box; pass { placeholders: false } for an invisible spacer.",e),r.placeholders){let{width:i,height:a}=ge(e),o=document.createElement("div");return o.style.cssText=`width:${i}px;height:${a}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;`,me(e,o,t,r),o}else{let{width:i,height:a}=ge(e),o=document.createElement("div");return o.style.cssText=`display:inline-block;width:${i}px;height:${a}px;visibility:hidden;`,me(e,o,t,r),o}}function Uo(e){try{let t=Math.max(1,Math.min(32,e.width)),r=Math.max(1,Math.min(32,e.height)),n=document.createElement("canvas");n.width=t,n.height=r;let i=n.getContext("2d",{willReadFrequently:!0});if(!i)return!1;i.drawImage(e,0,0,t,r);let a=i.getImageData(0,0,t,r).data;for(let o=3;o<a.length;o+=4)if(a[o]!==0)return!1;return!0}catch{return!1}}async function jo(e,t,r){let n="";try{let l=e.getContext("2d",{willReadFrequently:!0});try{l&&l.getImageData(0,0,1,1)}catch{}if((se()||!l)&&await Ce(),n=e.toDataURL("image/png"),!n||n==="data:,"){try{l&&l.getImageData(0,0,1,1)}catch{}if(await Ce(),n=e.toDataURL("image/png"),!n||n==="data:,"){let s=document.createElement("canvas");s.width=e.width,s.height=e.height;let d=s.getContext("2d");d&&(d.drawImage(e,0,0),n=s.toDataURL("image/png"))}}}catch(l){U(t,"Canvas toDataURL failed, using empty/fallback",l)}r&&r.debug&&n&&Uo(e)&&U(t,"canvas is empty at capture time \u2014 capture it after its first frame is drawn",e);let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch(l){U(t,"img decoding/loading hints failed",l)}n&&(i.src=n),i.width=e.width,i.height=e.height;let{width:a,height:o}=ge(e);return a>0&&(i.style.width=`${a}px`),o>0&&(i.style.height=`${o}px`),t.nodeMap.set(i,e),me(e,i,t,r),i}async function Vo(e,t,r){let n="";try{let l=document.createElement("canvas");l.width=e.videoWidth||e.offsetWidth||320,l.height=e.videoHeight||e.offsetHeight||240;let s=l.getContext("2d");s&&(s.drawImage(e,0,0,l.width,l.height),n=l.toDataURL("image/png"),(!n||n==="data:,")&&(n=""))}catch(l){U(t,"Video frame capture failed, using poster fallback",l)}let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch{}n?i.src=n:e.poster&&(i.src=e.poster),i.width=e.videoWidth||e.offsetWidth||0,i.height=e.videoHeight||e.offsetHeight||0;let{width:a,height:o}=ge(e);return a>0&&(i.style.width=`${a}px`),o>0&&(i.style.height=`${o}px`),i.style.objectFit="contain",t.nodeMap.set(i,e),me(e,i,t,r),i}async function qo(e,t,r){if(!e.controls)return;let{width:n,height:i}=ge(e),a=Math.round(n||e.offsetWidth||300),o=Math.round(i||e.offsetHeight||54),l=o/2,s=Math.max(4,o*.16),d=o*.34,c=a-o*.34,u=d+s+o*.55,f=Math.max(0,c-o*.7-u),h=Math.max(9,Math.round(o*.24)),p=`<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}" viewBox="0 0 ${a} ${o}"><rect width="${a}" height="${o}" rx="${Math.min(o/2,10)}" fill="#f1f3f4"/><path d="M ${d} ${l-s} L ${d+s} ${l} L ${d} ${l+s} Z" fill="#5f6368"/><rect x="${u}" y="${l-1.5}" width="${f}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${u}" cy="${l}" r="${Math.max(3,o*.09)}" fill="#5f6368"/><text x="${c}" y="${l}" fill="#5f6368" font-family="sans-serif" font-size="${h}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,m=document.createElement("img");try{m.decoding="sync",m.loading="eager"}catch{}return m.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,m.width=a,m.height=o,m.style.width=`${a}px`,m.style.height=`${o}px`,t.nodeMap.set(m,e),me(e,m,t,r),m}wt("IFRAME",Bo);wt("CANVAS",jo);wt("VIDEO",Vo);wt("AUDIO",qo);de();mt();yt();te();te();var zo=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],Ne=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),$n=[],Pr=new Set;function Ho(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xo(e){let t=Array.isArray(e)?e:[e];for(let r of t){let n;if(r instanceof RegExp)n=r;else if(typeof r=="string")n=new RegExp(Ho(r),"i");else{console.warn("[snapdom] Ignored invalid iconFont value:",r);continue}let i=`${n.source}/${n.flags}`;Pr.has(i)||(Pr.add(i),$n.push(n))}}function be(e){let t=typeof e=="string"?e:"",r=[...zo,...$n];for(let n of r)if(n instanceof RegExp&&n.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function Lr(e){if(typeof e!="string"||!e)return!1;let t;try{t=new URL(e,typeof location<"u"?location.href:void 0)}catch{return be(e)}let r=t.searchParams.getAll("family").flatMap(n=>n.split("|")).map(n=>n.split(":")[0].trim()).filter(Boolean);return r.length?r.every(n=>be(n)):be(e)}function Go(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var Wr=new Map;function Yo(e=""){let t=Object.create(null),r=String(e||""),n=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=n.exec(r);)t[i[1].toUpperCase()]=Number(i[2]);return t}async function Qo(e,t,r){let n=String(e||""),i=n.toLowerCase(),a=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:n,familyForCanvas:n};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:n,familyForCanvas:n};let o=r&&(r.FILL??r.fill),l="outlined";/\brounded\b/.test(a)||/\bround\b/.test(a)?l="rounded":/\bsharp\b/.test(a)?l="sharp":/\boutlined\b/.test(a)&&(l="outlined");let s=o===1,d=null;if(s&&(l==="outlined"&&Ne.materialIconsFilled?d={url:Ne.materialIconsFilled,alias:"snapdom-mi-filled"}:l==="rounded"&&Ne.materialIconsRound?d={url:Ne.materialIconsRound,alias:"snapdom-mi-round"}:l==="sharp"&&Ne.materialIconsSharp&&(d={url:Ne.materialIconsSharp,alias:"snapdom-mi-sharp"})),!d)return{familyForMeasure:n,familyForCanvas:n};if(!Wr.has(d.alias))try{let u=new FontFace(d.alias,`url(${d.url})`,{style:"normal",weight:"400"});document.fonts.add(u),await u.load(),Wr.set(d.alias,!0)}catch{return{familyForMeasure:n,familyForCanvas:n}}let c=`"${d.alias}"`;return{familyForMeasure:c,familyForCanvas:c}}async function Jo(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function Ko(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",r=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!r&&t.toLowerCase()!=="currentcolor")return t;let n=e.color?.trim();return n&&n!=="inherit"?n:"#000"}async function Zo(e,{family:t="Material Icons",weight:r="normal",fontSize:n=32,color:i="#000",variation:a="",className:o=""}={}){let l=String(t||"").replace(/^['"]+|['"]+$/g,""),s=window.devicePixelRatio||1,d=Yo(a),{familyForMeasure:c,familyForCanvas:u}=await Qo(l,o,d);await Jo(u.replace(/^["']+|["']+$/g,""),n);let f=document.createElement("span");f.setAttribute("data-snapdom-internal",""),f.textContent=e,f.style.position="absolute",f.style.visibility="hidden",f.style.left="-99999px",f.style.whiteSpace="nowrap",f.style.fontFamily=c,f.style.fontWeight=String(r||"normal"),f.style.fontSize=`${n}px`,f.style.lineHeight="1",f.style.margin="0",f.style.padding="0",f.style.fontFeatureSettings="'liga' 1",f.style.fontVariantLigatures="normal",f.style.color=i,document.body.appendChild(f);let h=f.getBoundingClientRect(),p=Math.max(1,Math.ceil(h.width)),m=Math.max(1,Math.ceil(h.height));document.body.removeChild(f);let y=document.createElement("canvas");y.width=p*s,y.height=m*s;let b=y.getContext("2d");b.scale(s,s),b.font=`${r?`${r} `:""}${n}px ${u}`,b.textAlign="left",b.textBaseline="top",b.fillStyle=i;try{b.fontKerning="normal"}catch{}return b.fillText(e,0,0),{dataUrl:y.toDataURL(),width:p,height:m}}async function ea(e,t,r=C.session.nodeMap){if(e?.nodeType!==1)return 0;let n='.material-icons, [class*="material-symbols"]',i=Array.from(e.querySelectorAll(n)).filter(l=>l&&l.textContent&&l.textContent.trim());if(e.matches?.(n)&&e.textContent&&e.textContent.trim()&&i.unshift(e),i.length===0)return 0;let a=t?.nodeType===1?Array.from(t.querySelectorAll(n)).filter(l=>l&&l.textContent&&l.textContent.trim()):[];t?.nodeType===1&&t.matches?.(n)&&t.textContent&&t.textContent.trim()&&a.unshift(t);let o=0;for(let l=0;l<i.length;l++){let s=i[l],d=r&&r.get(s)||a[l]||null;try{let c=getComputedStyle(d||s),u=c.fontFamily||"Material Icons";if(!Go(u))continue;let f=(d||s).textContent.trim();if(!f)continue;let h=parseInt(c.fontSize,10)||24,p=c.fontWeight&&c.fontWeight!=="normal"?c.fontWeight:"normal",m=Ko(c),y=c.fontVariationSettings&&c.fontVariationSettings!=="normal"?c.fontVariationSettings:"",b=(d||s).className||"",{dataUrl:x,width:v,height:g}=await Zo(f,{family:u,weight:p,fontSize:h,color:m,variation:y,className:b});s.textContent="";let w=s.ownerDocument.createElement("img");w.src=x,w.alt=f,w.style.height=`${h}px`,w.style.width=`${Math.max(1,Math.round(v/g*h))}px`,w.style.objectFit="contain",w.style.verticalAlign=getComputedStyle(s).verticalAlign||"baseline",s.appendChild(w),o++}catch{}}return o}Ae();$e();async function ta(e,t,r,n=32,i="#000",a="normal"){t=t.replace(/^['"]+|['"]+$/g,"");let o=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let l=document.createElement("span");l.setAttribute("data-snapdom-internal",""),l.textContent=e,l.style.position="absolute",l.style.visibility="hidden",l.style.fontFamily=`"${t}"`,l.style.fontWeight=r||"normal",l.style.fontStyle=a||"normal",l.style.fontSize=`${n}px`,l.style.lineHeight="1",l.style.whiteSpace="nowrap",l.style.padding="0",l.style.margin="0",document.body.appendChild(l);let s=l.getBoundingClientRect(),d=Math.ceil(s.width),c=Math.ceil(s.height);document.body.removeChild(l);let u=document.createElement("canvas");u.width=Math.max(1,d*o),u.height=Math.max(1,c*o);let f=u.getContext("2d");return f.scale(o,o),f.font=`${a||"normal"} ${r||"normal"} ${n}px "${t}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=i,f.fillText(e,0,0),{dataUrl:u.toDataURL(),width:d,height:c}}var kn=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),ra=["katex","mathjax","mathml"];function nr(e){if(!e)return"";for(let t of e.split(",")){let r=t.trim().replace(/^['"]+|['"]+$/g,"");if(r&&!kn.has(r.toLowerCase()))return r}return""}function na(e){if(!e)return[];let t=[];for(let r of e.split(",")){let n=r.trim().replace(/^['"]+|['"]+$/g,"");n&&(kn.has(n.toLowerCase())||t.push(n))}return t}function it(e){let t=String(e??"400").trim().toLowerCase();if(t==="normal")return 400;if(t==="bold")return 700;let r=parseInt(t,10);return Number.isFinite(r)?Math.min(900,Math.max(100,r)):400}function ot(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function ia(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function oa(e){let t=String(e||"400").trim(),r=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(r){let i=it(r[1]),a=it(r[2]);return{min:Math.min(i,a),max:Math.max(i,a)}}let n=it(t);return{min:n,max:n}}function aa(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function la(e){let t=String(e||"100%").trim(),r=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(r){let a=parseFloat(r[1]),o=parseFloat(r[2]);return{min:Math.min(a,o),max:Math.max(a,o)}}let n=t.match(/(\d+(?:\.\d+)?)\s*%/),i=n?parseFloat(n[1]):100;return{min:i,max:i}}function sa(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function ca(e,t,r=[]){if(!e)return!1;try{let n=new URL(e,location.href);if(n.origin===location.origin)return!0;let i=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(o=>i.endsWith(o))||r.some(o=>i===o.toLowerCase()||i.endsWith("."+o.toLowerCase())))return!0;let a=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||ra.some(o=>a.includes(o)))return!0;for(let o of t){let l=o.toLowerCase().replace(/\s+/g,"+"),s=o.toLowerCase().replace(/\s+/g,"-"),d=sa(o);if(a.includes(l)||a.includes(s)||d&&a.includes(d))return!0}return!1}catch{return!1}}function ua(e){let t=new Set;for(let r of e||[]){let n=String(r).split("__")[0]?.trim();n&&t.add(n)}return t}function Tr(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(r,n,i)=>{let a=(i||"").trim();if(!a||/^data:|^blob:|^https?:|^file:|^about:/i.test(a))return r;let o=a;try{o=new URL(a,t||location.href).href}catch{}return`url("${o}")`})}var It=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,ht=4;async function da(e,t,r){if(!e)return e;let n=new Set;function i(l,s){try{return new URL(l,s||location.href).href}catch{return l}}async function a(l,s,d=0){if(d>ht)return console.warn(`[snapDOM] @import depth exceeded (${ht}) at ${s}`),l;let c="",u=0,f;for(;f=It.exec(l);){c+=l.slice(u,f.index),u=It.lastIndex;let h=(f[2]||f[4]||"").trim(),p=i(h,s);if(n.has(p)){console.warn(`[snapDOM] Skipping circular @import: ${p}`);continue}n.add(p);let m="";try{let y=await ie(p,{as:"text",useProxy:r,silent:!0});y.ok&&typeof y.data=="string"&&(m=y.data)}catch{}m?(m=Tr(m,p),m=await a(m,p,d+1),c+=`
|
|
7
|
+
/* inlined: ${p} */
|
|
8
|
+
${m}
|
|
9
|
+
`):c+=f[0]}return c+=l.slice(u),c}let o=Tr(e,t||location.href);return o=await a(o,t||location.href,0),o}var Fn=/url\((["']?)([^"')]+)\1\)/g,fa=/@font-face[^{}]*\{[^}]*\}/g;function le(e,t,r=""){return(e.match(new RegExp(`${t}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||r).trim()}function Nn(e){if(!e)return[];let t=[],r=e.split(",").map(n=>n.trim()).filter(Boolean);for(let n of r){let i=n.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!i)continue;let a=i[1],o=i[2],l=s=>{if(!s.includes("?"))return parseInt(s,16);let d=parseInt(s.replace(/\?/g,"0"),16),c=parseInt(s.replace(/\?/g,"F"),16);return[d,c]};if(o){let s=l(a),d=l(o),c=Array.isArray(s)?s[0]:s,u=Array.isArray(d)?d[1]:d;t.push([Math.min(c,u),Math.max(c,u)])}else{let s=l(a);Array.isArray(s)?t.push([s[0],s[1]]):t.push([s,s])}}return t}function Rn(e,t){if(!t.length||!e||e.size===0)return!0;for(let r of e)for(let[n,i]of t)if(r>=n&&r<=i)return!0;return!1}function ir(e,t){let r=[];if(!e)return r;for(let n of e.matchAll(Fn)){let i=(n[2]||"").trim();if(!(!i||i.startsWith("data:"))){if(!/^https?:/i.test(i))try{i=new URL(i,t||location.href).href}catch{}r.push(i)}}return r}async function Ot(e,t,r=""){let n=e;for(let i of e.matchAll(Fn)){let a=Ht(i[0]);if(!a)continue;let o=a;if(!o.startsWith("http")&&!o.startsWith("data:"))try{o=new URL(o,t||location.href).href}catch{}if(!be(o)){if(C.resource?.has(o)){C.font?.add(o),n=n.replace(i[0],`url(${C.resource.get(o)})`);continue}try{let l=await ie(o,{as:"dataURL",useProxy:r,silent:!0});if(l.ok&&typeof l.data=="string"){let s=l.data;C.resource?.set(o,s),C.font?.add(o),n=n.replace(i[0],`url(${s})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",o)}}}return n}function ha(e){if(!e.length)return null;let t=(o,l)=>e.some(([s,d])=>!(d<o||s>l)),r=t(0,255)||t(305,305),n=t(256,591)||t(7680,7935),i=t(880,1023),a=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":a?"cyrillic":i?"greek":n?"latin-ext":r?"latin":null}function Ir(e={}){let t=new Set((e.families||[]).map(i=>String(i).toLowerCase())),r=new Set((e.domains||[]).map(i=>String(i).toLowerCase())),n=new Set((e.subsets||[]).map(i=>String(i).toLowerCase()));return(i,a)=>{if(t.size&&t.has(i.family.toLowerCase()))return!0;if(r.size)for(let o of i.srcUrls)try{if(r.has(new URL(o).host.toLowerCase()))return!0}catch{}if(n.size){let o=ha(a);if(o&&n.has(o))return!0}return!1}}function pa(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,r=new Set,n=[];for(let a of e.match(t)||[]){let o=le(a,"font-family"),l=nr(o),s=le(a,"font-weight","400"),d=le(a,"font-style","normal"),c=le(a,"font-stretch","100%"),u=le(a,"unicode-range"),f=le(a,"src"),h=ir(f,location.href),p=h.length?h.map(y=>String(y).toLowerCase()).sort().join("|"):f.toLowerCase(),m=[String(l||"").toLowerCase(),s,d,c,u.toLowerCase(),p].join("|");r.has(m)||(r.add(m),n.push(a))}if(n.length===0)return e;let i=0;return e.replace(t,()=>n[i++]||"")}var Or=new WeakMap,ma=0;function ga(e){let t=Or.get(e);return t===void 0&&(t=ma++,Or.set(e,t)),t}function ya(e,t,r,n,i,a){let o=Array.from(e||[]).sort().join("|"),l=t?JSON.stringify({families:(t.families||[]).map(f=>String(f).toLowerCase()).sort(),domains:(t.domains||[]).map(f=>String(f).toLowerCase()).sort(),subsets:(t.subsets||[]).map(f=>String(f).toLowerCase()).sort()}):"",s=(r||[]).map(f=>`${(f.family||"").toLowerCase()}::${f.weight||"normal"}::${f.style||"normal"}::${f.src||""}`).sort().join("|"),d=n||"",c=(i||[]).map(f=>String(f).toLowerCase()).sort().join("|"),u=ga(a||document);return`fonts-embed-css::req=${o}::ex=${l}::lf=${s}::px=${d}::fd=${c}::doc=${u}`}async function En(e,t,r,n){let i;try{i=e.cssRules||[]}catch{return}let a=(o,l)=>{try{return new URL(o,l||location.href).href}catch{return o}};for(let o of i){if(o.type===CSSRule.IMPORT_RULE&&o.styleSheet){let l=o.href?a(o.href,t):t;if(n.depth>=ht){console.warn(`[snapDOM] CSSOM import depth exceeded (${ht}) at ${l}`);continue}if(l&&n.visitedSheets.has(l)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${l}`);continue}l&&n.visitedSheets.add(l);let s={...n,depth:(n.depth||0)+1};await En(o.styleSheet,l,r,s);continue}if(o.type===CSSRule.FONT_FACE_RULE){let l=(o.style.getPropertyValue("font-family")||"").trim(),s=nr(l);if(!s||be(s))continue;let d=(o.style.getPropertyValue("font-weight")||"").trim(),c=(o.style.getPropertyValue("font-style")||"").trim(),u=(o.style.getPropertyValue("font-stretch")||"").trim(),f=(o.style.getPropertyValue("font-variation-settings")||"").trim(),h=(o.style.getPropertyValue("src")||"").trim(),p=(o.style.getPropertyValue("unicode-range")||"").trim(),m=d||"400",y=c||"normal",b=u||"100%",x=(c?`font-style:${c};`:"")+(d?`font-weight:${d};`:"")+(u?`font-stretch:${u};`:"")+(f?`font-variation-settings:${f};`:"")+(p?`unicode-range:${p};`:""),v=n.faceMatchesRequired(s,y,m,b);if(!v&&!n.requiredIndex.has(s.toLowerCase()))continue;let g=Nn(p);if(!Rn(n.usedCodepoints,g))continue;let w={family:s,weightSpec:m,styleSpec:y,stretchSpec:b,unicodeRange:p,srcRaw:h,srcUrls:ir(h,t||location.href),href:t||location.href};if(n.simpleExcluder&&n.simpleExcluder(w,g))continue;if(!v){n.provisionalFaces.push({family:s.toLowerCase(),block:`@font-face{font-family:${s};src:${h};${x}}`,srcRaw:h,baseHref:t||location.href});continue}if(n.coveredFamilies.add(s.toLowerCase()),/url\(/i.test(h)){let M=await Ot(h,t||location.href,n.useProxy);await r(`@font-face{font-family:${s};src:${M};${x}}`)}else await r(`@font-face{font-family:${s};src:${h};${x}}`)}}}async function Pn({required:e,usedCodepoints:t,exclude:r=void 0,localFonts:n=[],useProxy:i="",fontStylesheetDomains:a=[],doc:o=document}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let l=new Map;for(let g of e){let[w,M,A,S]=String(g).split("__");if(!w)continue;let $=w.toLowerCase(),k=l.get($)||[];k.push({w:parseInt(M,10),s:A,st:parseInt(S,10)}),l.set($,k)}function s(g,w,M,A){let S=String(g).toLowerCase();if(!l.has(S))return!1;let $=l.get(S),k=oa(M),N=aa(w),R=la(A),I=k.min!==k.max,E=k.min,L=T=>N.kind==="normal"&&T==="normal"||N.kind!=="normal"&&(T==="italic"||T==="oblique"),O=!1;for(let T of $){let P=I?T.w>=k.min&&T.w<=k.max:T.w===E,q=L(ot(T.s)),z=T.st>=R.min&&T.st<=R.max;if(P&&q&&z){O=!0;break}}if(O)return!0;if(!I)for(let T of $){let P=L(ot(T.s)),q=T.st>=R.min&&T.st<=R.max;if(Math.abs(E-T.w)<=300&&P&&q)return!0}if(!I&&N.kind==="normal"&&$.some(T=>ot(T.s)!=="normal"))for(let T of $){let P=Math.abs(E-T.w)<=300,q=T.st>=R.min&&T.st<=R.max;if(P&&q)return!0}return!1}let d=Ir(r),c=ya(e,r,n,i,a,o);if(C.resource?.has(c))return C.resource.get(c);let u=ua(e),f=[],h=It;for(let g of o.querySelectorAll("style")){let w=g.textContent||"";for(let M of w.matchAll(h)){let A=(M[2]||M[4]||"").trim();!A||Lr(A)||o.querySelector(`link[rel="stylesheet"][href="${A}"]`)||f.push(A)}}let p=[];f.length&&await Promise.all(f.map(g=>new Promise(w=>{if(o.querySelector(`link[rel="stylesheet"][href="${g}"]`))return w(null);let M=o.createElement("link");M.rel="stylesheet",M.href=g,M.setAttribute("data-snapdom","injected-import"),M.onload=()=>w(M),M.onerror=()=>w(null),o.head.appendChild(M),p.push(M)})));let m="",y=new Set,b=[],x=Array.from(o.querySelectorAll('link[rel="stylesheet"]')).filter(g=>!!g.href);for(let g of p)try{g.remove()}catch{}for(let g of x)try{if(Lr(g.href))continue;let w="",M=!1;try{M=new URL(g.href,location.href).origin===location.origin}catch{}if(!M){let S=Array.isArray(a)?a:[];if(!ca(g.href,u,S))continue}if(M){let S=Array.from(o.styleSheets).find($=>$.href===g.href);if(S)try{let $=S.cssRules||[];w=Array.from($).map(k=>k.cssText).join("")}catch{}}if(!w){let S=await ie(g.href,{as:"text",useProxy:i});S?.ok&&typeof S.data=="string"&&(w=S.data)}w=await da(w,g.href,i);let A="";for(let S of w.match(fa)||[]){let $=le(S,"font-family"),k=nr($);if(!k||be(k))continue;let N=le(S,"font-weight","400"),R=le(S,"font-style","normal"),I=le(S,"font-stretch","100%"),E=le(S,"unicode-range"),L=le(S,"src"),O=ir(L,g.href),T=s(k,R,N,I);if(!T&&!l.has(k.toLowerCase()))continue;let P=Nn(E);if(!Rn(t,P))continue;let q={family:k,weightSpec:N,styleSpec:R,stretchSpec:I,unicodeRange:E,srcRaw:L,srcUrls:O,href:g.href};if(r&&d(q,P))continue;if(!T){b.push({family:k.toLowerCase(),block:S,srcRaw:L,baseHref:g.href});continue}y.add(k.toLowerCase());let z=/url\(/i.test(L)?await Ot(S,g.href,i):S;A+=z}A.trim()&&(m+=A)}catch{console.warn("[snapDOM] Failed to process stylesheet:",g.href)}let v={requiredIndex:l,usedCodepoints:t,faceMatchesRequired:s,coveredFamilies:y,provisionalFaces:b,simpleExcluder:r?Ir(r):null,useProxy:i,visitedSheets:new Set,depth:0};for(let g of o.styleSheets)if(!(g.href&&x.some(w=>w.href===g.href)))try{let w=g.href||location.origin+"/";w&&v.visitedSheets.add(w),await En(g,w,async M=>{m+=M},v)}catch{}for(let g of b)y.has(g.family)||(m+=/url\(/i.test(g.srcRaw)?await Ot(g.block,g.baseHref,i):g.block);try{for(let g of o.fonts||[]){if(!g||!g.family||g.status!=="loaded"||!g._snapdomSrc)continue;let w=String(g.family).replace(/^['"]+|['"]+$/g,"");if(be(w)||!l.has(w.toLowerCase())||r?.families&&r.families.some(A=>String(A).toLowerCase()===w.toLowerCase()))continue;let M=g._snapdomSrc;if(!String(M).startsWith("data:")){if(C.resource?.has(g._snapdomSrc))M=C.resource.get(g._snapdomSrc),C.font?.add(g._snapdomSrc);else if(!C.font?.has(g._snapdomSrc))try{let A=await ie(g._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(A.ok&&typeof A.data=="string")M=A.data,C.resource?.set(g._snapdomSrc,M),C.font?.add(g._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",g._snapdomSrc);continue}}m+=`@font-face{font-family:'${w}';src:url(${M});font-style:${g.style||"normal"};font-weight:${g.weight||"normal"};}`}}catch{}for(let g of n){if(!g||typeof g!="object")continue;let w=String(g.family||"").replace(/^['"]+|['"]+$/g,"");if(!w||be(w)||!l.has(w.toLowerCase())||r?.families&&r.families.some(N=>String(N).toLowerCase()===w.toLowerCase()))continue;let M=g.weight!=null?String(g.weight):"normal",A=g.style!=null?String(g.style):"normal",S=g.stretchPct!=null?`${g.stretchPct}%`:"100%",$=String(g.src||""),k=$;if(!k.startsWith("data:")){if(C.resource?.has($))k=C.resource.get($),C.font?.add($);else if(!C.font?.has($))try{let N=await ie($,{as:"dataURL",useProxy:i,silent:!0});if(N.ok&&typeof N.data=="string")k=N.data,C.resource?.set($,k),C.font?.add($);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",$);continue}}m+=`@font-face{font-family:'${w}';src:url(${k});font-style:${A};font-weight:${M};font-stretch:${S};}`}return m&&(m=pa(m),C.resource?.set(c,m)),m}function or(e,t){let r=new Set,n=new Set;if(!e)return{required:r,usedCodepoints:n};let i=s=>{if(s)for(let d of s)n.add(d.codePointAt(0))},a=s=>{let d=na(s.fontFamily);if(d.length)for(let c of d)r.add(`${c}__${it(s.fontWeight)}__${ot(s.fontStyle)}__${ia(s.fontStretch)}`)},o=s=>{a(B(s));for(let d of["::before","::after"]){let c=B(s,d),u=c&&c.content;if(!(!u||u==="none"||u==="normal"))if(a(c),/^["']/.test(u))i(u.slice(1,-1));else{let f=u.match(/\\[0-9A-Fa-f]{1,6}/g);if(f)for(let h of f)try{n.add(parseInt(h.slice(1),16))}catch{}}}};o(e);let l=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;l.nextNode();){let s=l.currentNode;if(s.nodeType===Node.TEXT_NODE){if(t&&s.parentElement&&!t(s.parentElement))continue;i(s.nodeValue||"")}else{if(t&&!t(s))continue;o(s)}}return{required:r,usedCodepoints:n}}function ba(e,t){return or(e,t).required}async function ar(e,t=2,r=document){try{await r.fonts.ready}catch{}let n=Array.from(e||[]).filter(Boolean);if(n.length===0)return;let i=()=>{let a=r.createElement("div");a.setAttribute("data-snapdom-internal",""),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 l=r.createElement("span");l.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",l.style.fontFamily=`"${o}"`,l.style.fontWeight="700",l.style.fontStyle="italic",l.style.fontSize="32px",l.style.lineHeight="1",l.style.whiteSpace="nowrap",l.style.margin="0",l.style.padding="0",a.appendChild(l)}r.body.appendChild(a),a.offsetWidth,r.body.removeChild(a)};for(let a=0;a<Math.max(1,t);a++)i(),await Ce(),await Ce()}function wa(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function _r(e,t=!1){let r="",n=Math.max(1,e);for(;n>0;)n--,r=String.fromCharCode(97+n%26)+r,n=Math.floor(n/26);return t?r.toUpperCase():r}function Dr(e,t=!0){let r=[[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"]],n=Math.max(1,Math.min(3999,e)),i="";for(let[a,o]of r)for(;n>=a;)i+=o,n-=a;return t?i:i.toLowerCase()}function Br(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(e);case"decimal-leading-zero":{let r=Math.abs(e);return(e<0?"-":"")+(r<10?"0":"")+String(r)}case"lower-alpha":return _r(e,!1);case"upper-alpha":return _r(e,!0);case"lower-roman":return Dr(e,!1);case"upper-roman":return Dr(e,!0);default:return String(e)}}function xa(e){let t=new WeakMap,r=Ui(e)?e.documentElement:e,n=d=>d&&d.tagName==="LI",i=d=>{let c=0,u=d?.parentElement;if(!u)return 0;for(let f of u.children){if(f===d)break;f.tagName==="LI"&&c++}return c},a=d=>{let c=new Map;for(let[u,f]of d)c.set(u,f.slice());return c},o=(d,c,u)=>{let f=a(d),h;try{h=u.style?.counterReset||getComputedStyle(u).counterReset}catch{}if(h&&h!=="none")for(let y of h.split(",")){let b=y.trim().split(/\s+/),x=b[0],v=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!x)continue;let g=c.get(x);if(g&&g.length){let w=g.slice();w.push(v),f.set(x,w)}else f.set(x,[v])}let p;try{p=u.style?.counterSet||getComputedStyle(u).counterSet}catch{}if(p&&p!=="none")for(let y of p.split(",")){let b=y.trim().split(/\s+/),x=b[0],v=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!x)continue;let g=f.get(x)||[];g.length===0&&g.push(0),g[g.length-1]=v,f.set(x,g)}let m;try{m=u.style?.counterIncrement||getComputedStyle(u).counterIncrement}catch{}if(m&&m!=="none")for(let y of m.split(",")){let b=y.trim().split(/\s+/),x=b[0],v=Number.isFinite(Number(b[1]))?Number(b[1]):1;if(!x)continue;let g=f.get(x)||[];g.length===0&&g.push(0),g[g.length-1]+=v,f.set(x,g)}try{if(getComputedStyle(u).display==="list-item"&&n(u)){let y=u.parentElement,b=1;if(y&&y.tagName==="OL"){let v=y.getAttribute("start"),g=Number.isFinite(Number(v))?Number(v):1,w=i(u),M=u.getAttribute("value");b=Number.isFinite(Number(M))?Number(M):g+w}else b=1+i(u);let x=f.get("list-item")||[];x.length===0&&x.push(0),x[x.length-1]=b,f.set("list-item",x)}}catch{}return f},l=(d,c,u)=>{let f=o(u,c,d);t.set(d,f);let h=f;for(let m of d.children)h=l(m,f,h);let p=new Map;for(let[m,y]of u){let b=y.length,x=h.get(m);p.set(m,x&&x.length?x.slice(0,b):y.slice())}for(let[m,y]of h)!p.has(m)&&y.length&&!c.has(m)&&p.set(m,y.slice(0,1));return p},s=new Map;return l(r,s,s),{get(d,c){let u=t.get(d)?.get(c);return u&&u.length?u[u.length-1]:0},getStack(d,c){let u=t.get(d)?.get(c);return u?u.slice():[]}}}function va(e,t,r){if(!e||e==="none")return e;try{let n=/\b(counter|counters)\s*\(([^)]+)\)/g;return e.replace(n,(i,a,o)=>{let l=String(o).split(",").map(s=>s.trim());if(a==="counter"){let s=l[0]?.replace(/^["']|["']$/g,""),d=(l[1]||"decimal").toLowerCase(),c=r.get(t,s);return Br(c,d)}else{let s=l[0]?.replace(/^["']|["']$/g,""),d=l[1]?.replace(/^["']|["']$/g,"")??"",c=(l[2]||"decimal").toLowerCase(),u=r.getStack(t,s);return u.length?u.map(f=>Br(f,c)).join(d):""}})}catch{return"- "}}Ae();var Re=new WeakMap,Ur=1e3;function Sa(e,t){let r=Ln(e);return t?(t.__pseudoPreflightFp!==r&&(t.__pseudoPreflight=Vr(e,r),t.__pseudoPreflightFp=r),!!t.__pseudoPreflight):Vr(e,r)}function _t(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Ln(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),r=`n:${t.length}|`,n=0;for(let a=0;a<t.length;a++){let o=t[a];if(o.tagName==="STYLE"){let l=o.textContent?o.textContent.length:0;r+=`S${l}|`;let s=o.sheet,d=s?_t(s):null;d&&(n+=d.length)}else{let l=o.getAttribute("href")||"",s=o.getAttribute("media")||"all";r+=`L${l}|m:${s}|`;let d=o.sheet,c=d?_t(d):null;c&&(n+=c.length)}}let i=e.adoptedStyleSheets;return r+=`ass:${Array.isArray(i)?i.length:0}|tr:${n}`,r}function jr(e,t,r){let n=_t(e);if(!n)return!1;for(let i=0;i<n.length;i++){if(r.budget<=0)return!1;let a=n[i],o=a&&a.cssText?a.cssText:"";r.budget--;for(let l of t)if(o.includes(l))return!0;if(a&&a.cssRules&&a.cssRules.length)for(let l=0;l<a.cssRules.length&&r.budget>0;l++){let s=a.cssRules[l],d=s&&s.cssText?s.cssText:"";r.budget--;for(let c of t)if(d.includes(c))return!0}if(r.budget<=0)return!1}return!1}function Vr(e=document,t=Ln(e)){let r=Re.get(e);if(r&&r.fingerprint===t)return r.result;let n=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],i=e.querySelectorAll("style");for(let o=0;o<i.length;o++){let l=i[o].textContent||"";for(let s of n)if(l.includes(s))return Re.set(e,{fingerprint:t,result:!0}),!0}let a=e.adoptedStyleSheets;if(Array.isArray(a)&&a.length){let o={budget:Ur};try{for(let l of a)if(jr(l,n,o))return Re.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let o=e.querySelectorAll('style,link[rel~="stylesheet"]'),l={budget:Ur};for(let s=0;s<o.length&&l.budget>0;s++){let d=o[s],c=null;if(d.tagName,c=d.sheet||null,c&&jr(c,n,l))return Re.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(Re.set(e,{fingerprint:t,result:!0}),!0):(Re.set(e,{fingerprint:t,result:!1}),!1)}function qr(e){for(let t of["Top","Right","Bottom","Left"]){let r=parseFloat(e[`border${t}Width`])||0,n=e[`border${t}Style`];if(r>0&&n&&n!=="none"&&n!=="hidden")return!0}return!1}function Ca(e,t){let r=null,n=()=>{if(!r)try{r=xa(e)}catch(i){U(t,"buildCounterContext failed",i),r={get:()=>0,getStack:()=>[]}}return r};return{get(i,a){return n().get(i,a)},getStack(i,a){return n().getStack(i,a)}}}function Ma(e){let t=!1;for(let r=0;r<e.length;r++){let n=e[r];if(n==='"')t=!t;else if(n==="/"&&!t)return e.slice(0,r).trim()}return e}function Aa(e){if(!e)return"";let t=[],r=/"([^"]*)"/g,n=0,i;for(;i=r.exec(e);){let o=e.slice(n,i.index).trim();o&&t.push(o),t.push(i[1]),n=r.lastIndex}let a=e.slice(n).trim();return a&&t.push(a),t.join("")}function Dt(e,t,r){let n=e.parentElement,i=n&&r?r.get(n):null;return i?{get(a,o){let l=t.get(a,o),s=i.get(o);return typeof s=="number"?Math.max(l,s):l},getStack(a,o){let l=t.getStack(a,o);if(!l.length)return l;let s=i.get(o);if(typeof s=="number"){let d=l.slice();return d[d.length-1]=Math.max(d[d.length-1],s),d}return l}}:t}function Bt(e,t,r){let n=new Map;function i(d){let c=[];if(!d||d==="none")return c;for(let u of String(d).split(",")){let f=u.trim().split(/\s+/),h=f[0],p=Number.isFinite(Number(f[1]))?Number(f[1]):void 0;h&&c.push({name:h,num:p})}return c}let a=i(t?.counterReset),o=i(t?.counterSet),l=i(t?.counterIncrement);function s(d){if(n.has(d))return n.get(d).slice();let c=r.getStack(e,d);c=c.length?c.slice():[];let u=a.find(p=>p.name===d);if(u){let p=Number.isFinite(u.num)?u.num:0;c=c.length?[...c,p]:[p]}let f=o.find(p=>p.name===d);if(f){let p=Number.isFinite(f.num)?f.num:0;c.length===0&&(c=[0]),c[c.length-1]=p}let h=l.find(p=>p.name===d);if(h){let p=Number.isFinite(h.num)?h.num:1;c.length===0&&(c=[0]),c[c.length-1]+=p}return n.set(d,c.slice()),c}return{get(d,c){let u=s(c);return u.length?u[u.length-1]:0},getStack(d,c){return s(c)},__incs:l}}function $a(e,t,r,n){let i;try{i=B(e,t)}catch{}let a=i?.content;if(!a||a==="none"||a==="normal")return{text:"",incs:[]};a=Ma(a);let o=Dt(e,r,n),l=Bt(e,i,o),s=wa(a)?va(a,e,l):a;return{text:Aa(s),incs:l.__incs||[]}}async function Ut(e,t,r,n){if(e?.nodeType!==1||t?.nodeType!==1||e.tagName==="TEXTAREA")return;let i=e.ownerDocument||document;if(!Sa(i,r))return;r.__siblingCounters||(r.__siblingCounters=new WeakMap),r.__counterCtx||(r.__counterCtx=Ca(e.ownerDocument||document,r));let a=r.__counterCtx;for(let l of["::before","::after","::first-letter"])try{let s=B(e,l);if(!s||s.content==="none"&&s.backgroundImage==="none"&&(s.backgroundColor==="transparent"||s.backgroundColor==="rgba(0, 0, 0, 0)")&&!qr(s)&&(!s.transform||s.transform==="none")&&s.display==="inline")continue;if(s.display==="none"||l!=="::first-letter"&&(s.content==="none"||s.content==="normal")){l==="::before"&&(t.dataset.snapdomHasBefore="1"),l==="::after"&&(t.dataset.snapdomHasAfter="1");continue}if(l==="::first-letter"){let W=B(e),_=(W?.display||"").toLowerCase();if(_.includes("flex")||_.includes("grid"))continue;let D=ue=>s[ue]!==W[ue]&&(parseFloat(s[ue])||0)!==0;if(!(s.color!==W.color||s.fontSize!==W.fontSize||s.fontWeight!==W.fontWeight||s.fontFamily!==W.fontFamily||s.fontStyle!==W.fontStyle||s.textTransform!==W.textTransform||s.float!==W.float&&s.float!=="none"||D("paddingTop")||D("paddingRight")||D("paddingBottom")||D("paddingLeft")||D("marginTop")||D("marginRight")||D("marginBottom")||D("marginLeft")))continue;let j=Array.from(t.childNodes).find(ue=>ue.nodeType===Node.TEXT_NODE&&ue.textContent?.trim().length>0);if(!j)continue;let Q=j.textContent,re=Q.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],K=Q.slice(re?.length||0);if(!re||/[\uD800-\uDFFF]/.test(re))continue;let ae=document.createElement("span");ae.textContent=re,ae.dataset.snapdomPseudo="::first-letter";let ke=br(s),fe=Nt(ke,"span");r.styleMap.set(ae,fe);let Se=document.createTextNode(K);t.replaceChild(Se,j),t.insertBefore(ae,Se);continue}let d=s.content??"",c=d===""||d==="none"||d==="normal",{text:u,incs:f}=$a(e,l,a,r.__siblingCounters),h=s.backgroundImage,p=s.backgroundColor,m=s.fontFamily,y=parseInt(s.fontSize)||32,b=parseInt(s.fontWeight)||!1,x=s.fontStyle||"normal",v=s.color||"#000",g=s.transform,w=be(m),M=!c&&u!=="",A=h&&h!=="none",S=p&&p!=="transparent"&&p!=="rgba(0, 0, 0, 0)",$=qr(s),k=g&&g!=="none",N=d!=="none"&&d!=="normal",R=/^inline-/.test(s.display||""),I=N&&((parseFloat(s.width)||0)>0||(parseFloat(s.height)||0)>0||R),E=N&&s.boxShadow&&s.boxShadow!=="none",L=N&&s.outlineStyle&&s.outlineStyle!=="none"&&(parseFloat(s.outlineWidth)||0)>0;if(!(M||A||S||$||k||I||E||L)){if(f&&f.length&&e.parentElement){let W=r.__siblingCounters.get(e.parentElement)||new Map;for(let{name:_}of f){if(!_)continue;let D=Dt(e,a,r.__siblingCounters),j=Bt(e,B(e,l),D).get(e,_);W.set(_,j)}r.__siblingCounters.set(e.parentElement,W)}continue}let O=u.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(u),T=!1;if(M&&!w&&u.length>1&&!O){let W=B(e),_=parseFloat(W.fontSize)||16,D=parseFloat(W.lineHeight);Number.isFinite(D)||(D=_*1.5),e.getBoundingClientRect().height<D*1.6&&(t.style.whiteSpace="nowrap",T=!0)}let P=document.createElement("span");P.dataset.snapdomPseudo=l,P.style.pointerEvents="none",T&&(P.style.whiteSpace="nowrap");let q=br(s),z=(B(e).display||"").toLowerCase(),Y=z.includes("flex")||z.includes("grid");if(Y){let W=q["min-width"];(!W||W==="auto"||W==="0px")&&(q["min-width"]="0px")}let J=Nt(q,"span",M,Y);if(r.styleMap.set(P,J),w&&u&&u.length===1){let{dataUrl:W,width:_,height:D}=await ta(u,m,b,y,v,x),j=document.createElement("img");j.src=W,j.style=`height:${y}px;width:${_/D*y}px;object-fit:contain;`,P.appendChild(j),t.dataset.snapdomHasIcon="true"}else if(u&&O){let W=Kr(u,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Ht(u);if(W?.trim())try{let _=await ie(lt(W),{as:"dataURL",useProxy:n.useProxy});if(_?.ok&&typeof _.data=="string"){let D=document.createElement("img");D.src=_.data,D.style=`width:${y}px;height:auto;object-fit:contain;`,P.appendChild(D)}}catch(_){console.error(`[snapdom] Error in pseudo ${l} for`,e,_)}}else!w&&M&&(P.textContent=u);P.style.backgroundImage="none","maskImage"in P.style&&(P.style.maskImage="none"),"webkitMaskImage"in P.style&&(P.style.webkitMaskImage="none");try{P.style.backgroundRepeat=s.backgroundRepeat,P.style.backgroundSize=s.backgroundSize,s.backgroundPositionX&&s.backgroundPositionY?(P.style.backgroundPositionX=s.backgroundPositionX,P.style.backgroundPositionY=s.backgroundPositionY):P.style.backgroundPosition=s.backgroundPosition,P.style.backgroundOrigin=s.backgroundOrigin,P.style.backgroundClip=s.backgroundClip,P.style.backgroundAttachment=s.backgroundAttachment,P.style.backgroundBlendMode=s.backgroundBlendMode}catch{}if(A)try{let W=Rt(h),_=await Promise.all(W.map(Xt));P.style.backgroundImage=_.join(", ")}catch(W){console.warn(`[snapdom] Failed to inline background-image for ${l}`,W)}S&&(P.style.backgroundColor=p);let ce=P.childNodes.length>0||P.textContent?.trim()!==""||A||S||$||k||I||E||L;if(f&&f.length&&e.parentElement){let W=r.__siblingCounters.get(e.parentElement)||new Map,_=Dt(e,a,r.__siblingCounters),D=Bt(e,B(e,l),_);for(let{name:j}of f){if(!j)continue;let Q=D.get(e,j);W.set(j,Q)}r.__siblingCounters.set(e.parentElement,W)}if(!ce)continue;l==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(P,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(P))}catch(s){console.warn(`[snapdom] Failed to capture ${l} for`,e,s)}let o=Array.from(t.children).filter(l=>!l.dataset.snapdomPseudo);if(r.nodeMap)for(let l of o){let s=r.nodeMap.get(l);s?.nodeType===1&&await Ut(s,l,r,n)}else{let l=Array.from(e.children);for(let s=0;s<Math.min(l.length,o.length);s++)await Ut(l[s],o[s],r,n)}}function ka(e,t){if(!e||e?.nodeType!==1)return;let r=e.ownerDocument||document,n=t||r,i=Bi(e)?[e]:Array.from(e.querySelectorAll("svg"));if(i.length===0)return;let a=/url\(\s*#([^)]+)\)/g,o=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],l=g=>window.CSS&&CSS.escape?CSS.escape(g):g.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),s="http://www.w3.org/1999/xlink",d=g=>{if(!g||!g.getAttribute)return null;let w=g.getAttribute("href")||g.getAttribute("xlink:href")||(typeof g.getAttributeNS=="function"?g.getAttributeNS(s,"href"):null);if(w)return w;let M=g.attributes;if(!M)return null;for(let A=0;A<M.length;A++){let S=M[A];if(!S||!S.name)continue;if(S.name==="href")return S.value;let $=S.name.indexOf(":");if($!==-1&&S.name.slice($+1)==="href")return S.value}return null},c=new Set(Array.from(e.querySelectorAll("[id]")).map(g=>g.id)),u=new Set,f=!1,h=(g,w=null)=>{if(!g)return;a.lastIndex=0;let M;for(;M=a.exec(g);){f=!0;let A=(M[1]||"").trim();A&&(c.has(A)||(u.add(A),w&&!w.has(A)&&w.add(A)))}},p=g=>{let w=g.querySelectorAll("use");for(let S of w){let $=d(S);if(!$||!$.startsWith("#"))continue;f=!0;let k=$.slice(1).trim();k&&!c.has(k)&&u.add(k)}let M='*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]';h(g.getAttribute("style")||"");for(let S of o)h(g.getAttribute(S));let A=g.querySelectorAll(M);for(let S of A){h(S.getAttribute("style")||"");for(let $ of o)h(S.getAttribute($))}};for(let g of i)p(g);if(!f)return;let m=e.querySelector("svg.inline-defs-container");m||(m=r.createElementNS("http://www.w3.org/2000/svg","svg"),m.classList.add("inline-defs-container"),m.setAttribute("aria-hidden","true"),m.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(m,e.firstChild||null));let y=m.querySelector("defs")||null,b=g=>{if(!g||c.has(g))return null;let w=l(g),M=A=>{let S=n.querySelector(A);return S&&!e.contains(S)?S:null};return M(`svg defs > *#${w}`)||M(`svg > symbol#${w}`)||M(`*#${w}`)};if(!u.size)return;let x=new Set(u),v=new Set;for(;x.size;){let g=x.values().next().value;if(x.delete(g),!g||c.has(g)||v.has(g))continue;let w=b(g);if(!w){v.add(g);continue}y||(y=r.createElementNS("http://www.w3.org/2000/svg","defs"),m.appendChild(y));let M=w.cloneNode(!0);M.id||M.setAttribute("id",g),y.appendChild(M),v.add(g),c.add(g);let A=[M,...M.querySelectorAll("*")];for(let S of A){let $=d(S);if($&&$.startsWith("#")){let N=$.slice(1).trim();N&&!c.has(N)&&!v.has(N)&&x.add(N)}let k=S.getAttribute?.("style")||"";k&&h(k,x);for(let N of o){let R=S.getAttribute?.(N);R&&h(R,x)}}}}te();function Fa(e){let t=getComputedStyle(e),r=t.outlineStyle,n=t.outlineWidth,i=t.borderStyle,a=t.borderWidth,o=r!=="none"&&parseFloat(n)>0,l=i==="none"||parseFloat(a)===0;if(o&&l){let s=e.style.border;return e.style.border=`${n} solid transparent`,()=>{e.style.border=s}}return()=>{}}function Na(e){let t=[];try{let r=e.querySelectorAll("*");for(let n of r){if(!ut(n))continue;let i=n.style.contentVisibility||"",a=getComputedStyle(n);(a.contentVisibility||a.getPropertyValue("content-visibility")||"")==="auto"&&(t.push({el:n,original:i}),n.style.contentVisibility="visible")}if(ut(e)){let n=getComputedStyle(e);(n.contentVisibility||n.getPropertyValue("content-visibility")||"")==="auto"&&(t.push({el:e,original:e.style.contentVisibility||""}),e.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:r,original:n}of t)try{r.style.contentVisibility=n}catch{}}}de();yt();function Ra(e){return Wn(e.boxShadow)}function Ea(e){return Wn(e.textShadow)}function Wn(e){if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let t=[],r="",n=0;for(let s=0;s<e.length;s++){let d=e[s];d==="("?n++:d===")"&&(n=Math.max(0,n-1)),d===","&&n===0?(t.push(r),r=""):r+=d}r.trim()&&t.push(r);let i=0,a=0,o=0,l=0;for(let s of t){if(/\binset\b/i.test(s))continue;let d=s.match(/-?\d+(\.\d+)?px/g)?.map(y=>parseFloat(y))||[];if(d.length<2)continue;let[c,u,f=0,h=0]=d,p=Math.abs(c)+f+h,m=Math.abs(u)+f+h;a=Math.max(a,p+Math.max(c,0)),l=Math.max(l,p+Math.max(-c,0)),o=Math.max(o,m+Math.max(u,0)),i=Math.max(i,m+Math.max(-u,0))}return{top:Math.ceil(i),right:Math.ceil(a),bottom:Math.ceil(o),left:Math.ceil(l)}}function Pa(e){let t=e.filter&&e.filter!=="none"?e.filter:e.webkitFilter||"",r=/blur\(\s*([0-9.]+)px\s*\)/gi,n=0,i;for(;i=r.exec(t);)n+=parseFloat(i[1])||0;let a=Math.ceil(n);return{top:a,right:a,bottom:a,left:a}}function La(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0),r=parseFloat(e.outlineOffset||"0")||0,n=t+Math.max(0,Math.ceil(r));return{top:n,right:n,bottom:n,left:n}}function Wa(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||t==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let r=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],n=0,i=0,a=0,o=0,l=!1;for(let s of r){l=!0;let d=s.match(/-?\d+(?:\.\d+)?px/gi)?.map(m=>parseFloat(m))||[],[c=0,u=0,f=0]=d,h=Math.abs(c)+f,p=Math.abs(u)+f;i=Math.max(i,h+Math.max(c,0)),o=Math.max(o,h+Math.max(-c,0)),a=Math.max(a,p+Math.max(u,0)),n=Math.max(n,p+Math.max(-u,0))}return{bleed:{top:F(n),right:F(i),bottom:F(a),left:F(o)},has:l}}function Ta(e,t){if(!e||!t||!t.style)return null;let r=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let n=r.transform||"none";if(!n||n==="none"){let l=null;try{l=pt(e).scale}catch{}try{t.style.transform="none"}catch{}if(!l)return{a:1,b:0,c:0,d:1};let s=l.trim().split(/\s+/).map(parseFloat),d=Number.isFinite(s[0])?s[0]:1,c=Number.isFinite(s[1])?s[1]:d;return{a:d,b:0,c:0,d:c}}function i(l,s,d,c){let u=Math.sqrt(l*l+s*s)||0,f=0,h=0;if(u>0){let p=l/u,m=s/u;f=p*d+m*c;let y=d-p*f,b=c-m*f;h=Math.sqrt(y*y+b*b)||0,h>0?f=f/h:f=0}return{a:u,b:0,c:f*h,d:h}}let a=n.match(/^matrix\(\s*([^)]+)\)$/i);if(a){let l=a[1].split(",").map(s=>parseFloat(s.trim()));if(l.length===6&&l.every(Number.isFinite)){let[s,d,c,u]=l,f=i(s,d,c,u);try{t.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}let o=n.match(/^matrix3d\(\s*([^)]+)\)$/i);if(o){let l=o[1].split(",").map(s=>parseFloat(s.trim()));if(l.length===16&&l.every(Number.isFinite)){let s=l[0],d=l[1],c=l[4],u=l[5],f=i(s,d,c,u);try{t.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}try{let l=new DOMMatrix(n),s=i(l.a,l.b,l.c,l.d);try{t.style.transform=`matrix(${s.a}, ${s.b}, ${s.c}, ${s.d}, 0, 0)`}catch{}return s}catch{return null}}function at(e,t,r,n,i){let a=r.a,o=r.b,l=r.c,s=r.d,d=r.e||0,c=r.f||0;function u(b,x){let v=b-n,g=x-i,w=a*v+l*g,M=o*v+s*g;return w+=n+d,M+=i+c,[w,M]}let f=[u(0,0),u(e,0),u(0,t),u(e,t)],h=1/0,p=1/0,m=-1/0,y=-1/0;for(let[b,x]of f)b<h&&(h=b),x<p&&(p=x),b>m&&(m=b),x>y&&(y=x);return{minX:h,minY:p,maxX:m,maxY:y,width:m-h,height:y-p}}function jt(e,t,r){let n=(e.transformOrigin||"0 0").trim().split(/\s+/),[i,a]=[n[0]||"0",n[1]||"0"],o=(l,s)=>{let d=l.toLowerCase();return d==="left"||d==="top"?0:d==="center"?s/2:d==="right"||d==="bottom"?s:d.endsWith("px")?parseFloat(d)||0:d.endsWith("%")?(parseFloat(d)||0)*s/100:/^-?\d+(\.\d+)?$/.test(d)&&parseFloat(d)||0};return{ox:o(i,t),oy:o(a,r)}}function pt(e){let t={rotate:"0deg",scale:null,translate:null},r=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(r){let i=s=>{try{return typeof r.has=="function"&&!r.has(s)||typeof r.get!="function"?null:r.get(s)}catch{return null}},a=i("rotate");if(a)if(a.angle){let s=a.angle;t.rotate=s.unit==="rad"?s.value*180/Math.PI+"deg":s.value+s.unit}else a.unit?t.rotate=a.unit==="rad"?a.value*180/Math.PI+"deg":a.value+a.unit:t.rotate=String(a);else{let s=getComputedStyle(e);t.rotate=s.rotate&&s.rotate!=="none"?s.rotate:"0deg"}let o=i("scale");if(o){let s="x"in o&&o.x?.value!=null?o.x.value:Array.isArray(o)?o[0]?.value:Number(o)||1,d="y"in o&&o.y?.value!=null?o.y.value:Array.isArray(o)?o[1]?.value:s;t.scale=`${s} ${d}`}else{let s=getComputedStyle(e);t.scale=s.scale&&s.scale!=="none"?s.scale:null}let l=i("translate");if(l){let s="x"in l&&"value"in l.x?l.x.value:Array.isArray(l)?l[0]?.value:0,d="y"in l&&"value"in l.y?l.y.value:Array.isArray(l)?l[1]?.value:0,c="x"in l&&l.x?.unit?l.x.unit:"px",u="y"in l&&l.y?.unit?l.y.unit:"px";t.translate=`${s}${c} ${d}${u}`}else{let s=getComputedStyle(e);t.translate=s.translate&&s.translate!=="none"?s.translate:null}return t}let n=getComputedStyle(e);return t.rotate=n.rotate&&n.rotate!=="none"?n.rotate:"0deg",t.scale=n.scale&&n.scale!=="none"?n.scale:null,t.translate=n.translate&&n.translate!=="none"?n.translate:null,t}var $t=null;function Ia(){if($t)return $t;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),$t=e,e}function Oa(e){let t=Ia(),r=document.createElement("div");r.style.transformOrigin="0 0",e.baseTransform&&(r.style.transform=e.baseTransform),e.rotate&&(r.style.rotate=e.rotate),e.scale&&(r.style.scale=e.scale),e.translate&&(r.style.translate=e.translate),t.appendChild(r);let n=Da(r);return t.removeChild(r),n}function _a(e){let t=B(e),r=t.transform||"none";if(r!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(r))return!0;let n=t.rotate&&t.rotate!=="none"&&t.rotate!=="0deg",i=t.scale&&t.scale!=="none"&&t.scale!=="1",a=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(n||i||a)}function Da(e){let t=getComputedStyle(e).transform;if(!t||t==="none")return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}var Tn=new WeakSet;function In(e,t){if(!t)return null;let r=e.ownerDocument||document,n=r.defaultView||window,i,a,o,l;if(t==="viewport")i=0,a=0,o=r.documentElement?.clientWidth||n.innerWidth,l=r.documentElement?.clientHeight||n.innerHeight;else if(typeof t=="object")i=(Number(t.x)||0)-(n.scrollX||0),a=(Number(t.y)||0)-(n.scrollY||0),o=Number(t.width),l=Number(t.height);else return null;return o>0&&l>0?{left:i,top:a,width:o,height:l,right:i+o,bottom:a+l}:null}function Vt(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode&&e.getRootNode();return rr(t)?t.host:null}function Ba(e,t){for(let r=t;r;r=Vt(r))if(r===e)return!0;return!1}function Ua(e,t){for(let r=Vt(e);r&&r!==t&&r?.nodeType===1;r=Vt(r)){let n=B(r);if(n.position!=="static"||n.transform&&n.transform!=="none"||n.filter&&n.filter!=="none"||n.backdropFilter&&n.backdropFilter!=="none"||n.perspective&&n.perspective!=="none"||/transform|perspective|filter/.test(n.willChange||"")||/layout|paint|strict|content/.test(n.contain||""))return r}return null}function On(e,t){try{let r=new DOMMatrix;if(t&&t.rotate&&t.rotate!=="0deg"&&(r=r.multiply(new DOMMatrix(`rotate(${t.rotate})`))),t&&t.scale){let n=String(t.scale).trim().split(/\s+/).filter(Boolean);n.length&&n.every(i=>Number.isFinite(Number(i)))&&(r=r.multiply(new DOMMatrix(`scale(${n.join(",")})`)))}return e&&(r=r.multiply(new DOMMatrix(e))),r}catch{return null}}function ja(e,t,r,n,i){let a=e.getBoundingClientRect();t?.nodeType===1&&t.namespaceURI===ct&&B(e).position==="static"&&(t.style.position="relative");let o=[];for(let[l,s]of r){if(l?.nodeType!==1||l.namespaceURI!==ct||s?.nodeType!==1||s===e||!Ba(e,s))continue;let d=n.get(s)||B(s),c=d.position;if(c!=="fixed"&&c!=="sticky"&&c!=="-webkit-sticky"||l.style.position==="absolute")continue;let u=s.getBoundingClientRect();if(!(u.width>0&&u.height>0))continue;Tn.add(l);let f=d.transform&&d.transform!=="none"?d.transform:"",h=pt(s),p=!!(f||h.rotate!=="0deg"||h.scale||h.translate),m=p?On(f,h):null,y=!m||!m.is2D||m.a===1&&m.b===0&&m.c===0&&m.d===1,b=u.width,x=u.height;y||(b=s.offsetWidth||u.width,x=s.offsetHeight||u.height);let v=s.getRootNode&&rr(s.getRootNode()),g=a,w=e.clientLeft||0,M=e.clientTop||0;if(v){let N=Ua(s,e);N&&(g=N.getBoundingClientRect(),w=N.clientLeft||0,M=N.clientTop||0)}let A=u.left-g.left-w,S=u.top-g.top-M;if(p)if(l.style.translate="none",l.style.rotate="none",l.style.scale="none",y)l.style.transform="none";else{l.style.transform=`matrix(${m.a},${m.b},${m.c},${m.d},0,0)`;let{ox:N,oy:R}=jt(d,b,x),I=at(b,x,{a:m.a,b:m.b,c:m.c,d:m.d,e:0,f:0},N,R);A-=I.minX,S-=I.minY}if(c!=="fixed"){let N=l.cloneNode(!1);N.setAttribute("data-snap-ph","1"),N.style.position="static",N.style.visibility="hidden",N.style.width=`${b}px`,N.style.height=`${x}px`,N.style.boxSizing="border-box",l.parentElement?.insertBefore(N,l)}let $=b+2,k=x;i&&(Math.abs(S-i.y)<.5&&(S-=1,k+=1),Math.abs(A-i.x)<.5&&(A-=1,$+=1)),l.style.position="absolute",l.style.left=`${A}px`,l.style.top=`${S}px`,l.style.right="auto",l.style.bottom="auto",l.style.margin="0",l.style.width=`${$}px`,l.style.height=`${k}px`,l.style.boxSizing="border-box",v||o.push(l)}for(let l of o)t.appendChild(l)}function Va(e,t,r={}){if(!e||!t||!t.style)return;let n=getComputedStyle(e);try{t.style.boxShadow="none"}catch(a){U(r,"stripRootShadows boxShadow",a)}try{t.style.textShadow="none"}catch(a){U(r,"stripRootShadows textShadow",a)}try{t.style.outline="none"}catch(a){U(r,"stripRootShadows outline",a)}let i=(n.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=i.length?i:"none"}catch(a){U(r,"stripRootShadows filter",a)}}function qa(e,t){if(!e||!t||!t.style)return;let r=1;try{r=parseFloat(getComputedStyle(e).zoom)}catch{return}if(!(!t.style.getPropertyValue("zoom")&&(!Number.isFinite(r)||r===1)))try{t.style.setProperty("zoom","1","important")}catch{}}function zr(e){let t=e.display||"";if(t.includes("flex")||t.includes("grid")||t.startsWith("table")||t==="inline-block"||t==="flow-root"||e.position==="absolute"||e.position==="fixed"||e.float&&e.float!=="none")return!0;let r=e.overflowX||e.overflow||"visible",n=e.overflowY||e.overflow||"visible";return!!(r!=="visible"||n!=="visible"||e.contain&&/\b(layout|content|paint|strict)\b/.test(e.contain))}function za(e,t){let r=Array.from(e.childNodes),n=t==="top"?r:r.reverse();for(let i of n){if(i.nodeType===Node.TEXT_NODE){if(/\S/.test(i.textContent||""))return null;continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let a=getComputedStyle(i),o=String(a.display||"");if(!(o==="none"||o==="contents")&&!(a.position==="absolute"||a.position==="fixed"))return a.float&&a.float!=="none"||o.startsWith("inline")?null:i}return null}function Ha(e,t,r){if(!e||!t||!t.style)return;let n=getComputedStyle(e);if(!zr(n))for(let i of["top","bottom"]){let a=i==="top"?"Top":"Bottom";if((parseFloat(n[`border${a}Width`])||0)>0||(parseFloat(n[`padding${a}`])||0)>0)continue;let o=e,l=t;for(;o&&l;){let s=za(o,i);if(!s)break;let d=r?Array.from(l.children).find(f=>r.get(f)===s)||null:l.children[Array.from(o.children).indexOf(s)]||null,c=getComputedStyle(s),u=parseFloat(c[`margin${a}`])||0;if(d&&d.style&&u>0&&(d.style[`margin${a}`]="0px"),zr(c)||(parseFloat(c[`border${a}Width`])||0)>0||(parseFloat(c[`padding${a}`])||0)>0)break;o=s,l=d}}}function Xa(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),r=[];for(;t.nextNode();)r.push(t.currentNode);for(let n of r)n.remove()}function Ga(e,t={}){let{stripFrameworkDirectives:r=!0}=t,n=new Set(["xml","xlink"]),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let a=i.currentNode;for(let o of Array.from(a.attributes)){let l=o.name;if(l.startsWith("*")){a.removeAttribute(l);continue}if(l.includes("@")){a.removeAttribute(l);continue}if(l.includes(":")){let s=l.split(":",1)[0];if(!n.has(s)){a.removeAttribute(l);continue}}if(r&&(l.startsWith("x-")||l.startsWith("v-")||l.startsWith(":")||l.startsWith("on:")||l.startsWith("bind:")||l.startsWith("let:")||l.startsWith("class:"))){a.removeAttribute(l);continue}}}}var Hr=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function Ya(e){if(!e)return;let t=i=>{if(i.nodeType===Node.ELEMENT_NODE){if(i.attributes)for(let a of Array.from(i.attributes)){let o=a.value.replace(Hr,"");if(o!==a.value)try{i.setAttribute(a.name,o)}catch{}}}else if(i.nodeType===Node.TEXT_NODE||i.nodeType===Node.CDATA_SECTION_NODE){let a=i.data.replace(Hr,"");a!==i.data&&(i.data=a)}};t(e);let r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),n;for(;n=r.nextNode();)t(n)}function Qa(e,t={}){e&&(Ga(e,t),Xa(e),Ya(e))}function Ja(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function Ka(e){return pe(e,"img","canvas","video","iframe","object","embed")||tr(e)}function Za(e,t){if(e?.nodeType!==1||Ja(e)||Ka(e))return!1;let r=t.position;if(r==="absolute"||r==="fixed"||r==="sticky")return!1;let n=t.display||"";return!(n.includes("flex")||n.includes("grid")||n.startsWith("table")||t.transform&&t.transform!=="none")}function el(e,t,r=new Map){function n(i,a){if(i?.nodeType!==1||a?.nodeType!==1)return;let o=i.childElementCount>a.childElementCount,l=r.get(i)||getComputedStyle(i);if(r.has(i)||r.set(i,l),o&&Za(i,l)){a.style.height||(a.style.height="auto"),a.style.width||(a.style.width="auto"),a.style.removeProperty("block-size"),a.style.removeProperty("inline-size"),a.style.minHeight||(a.style.minHeight="0"),a.style.minWidth||(a.style.minWidth="0"),a.style.maxHeight||(a.style.maxHeight="none"),a.style.maxWidth||(a.style.maxWidth="none");let c=l.overflowY||l.overflowBlock||"visible",u=l.overflowX||l.overflowInline||"visible";(c!=="visible"||u!=="visible")&&(a.style.overflow="visible")}let s=Array.from(i.children),d=Array.from(a.children);for(let c=0;c<Math.min(s.length,d.length);c++)n(s[c],d[c])}n(e,t)}function tl(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function rl(e,t){if(e?.nodeType!==1)return!1;if(e.getAttribute("data-capture")==="exclude"&&t?.excludeMode==="remove")return!0;if(Array.isArray(t?.exclude))for(let r of t.exclude)try{if(e.matches(r))return t.excludeMode==="remove"}catch(n){U(t,"exclude selector match failed",n)}if(typeof t?.filter=="function"&&t.filterMode==="remove")try{if(!t.filter(e))return!0}catch(r){U(t,"filter function failed",r)}return!1}function nl(e,t){let r=getComputedStyle(e),n=e.getBoundingClientRect(),i=1/0,a=-1/0,o=!1,l=Array.from(e.children);for(let h of l){if(rl(h,t)||!tl(h))continue;let p=h.getBoundingClientRect(),m=p.top-n.top,y=p.bottom-n.top;y<=m||(m<i&&(i=m),y>a&&(a=y),o=!0)}let s=o?Math.max(0,a-i):0,d=parseFloat(r.borderTopWidth)||0,c=parseFloat(r.borderBottomWidth)||0,u=parseFloat(r.paddingTop)||0,f=parseFloat(r.paddingBottom)||0;return d+c+u+f+s}var F=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,Ee=.75;function il(e,t,r,n,i,a){let o=e.ownerDocument||document,l=e.getBoundingClientRect(),s=i>0&&l.width>0?l.width/i:1,d=a>0&&l.height>0?l.height/a:1;if(Math.abs(s-d)>.02)return 0;let c=o.createElement("div");c.setAttribute("data-snapdom-internal",""),c.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let u=c.attachShadow({mode:"open"}),f=o.createElement("style");f.textContent=r,u.appendChild(f);let h=t.cloneNode(!0);u.appendChild(h),o.body.appendChild(c);let p=0,m=(y,b,x)=>{let v=B(y),g=v.boxSizing==="border-box",w=(M,A,...S)=>{let $=parseFloat(M);if(!Number.isFinite($))return A;let k=$+(g?0:S.reduce((N,R)=>N+(parseFloat(R)||0),0));return Math.abs(k-A)<=.51?k:A};return{width:w(v.width,b,v.paddingLeft,v.paddingRight,v.borderLeftWidth,v.borderRightWidth),height:w(v.height,x,v.paddingTop,v.paddingBottom,v.borderTopWidth,v.borderBottomWidth)}};try{let y=h.getBoundingClientRect(),b=h.offsetWidth||i,x=h.offsetHeight||a,v=b>0&&y.width>0?y.width/b:1,g=x>0&&y.height>0?y.height/x:1,w=(M,A,S=!1)=>{let $=M.children,k=A.children,N=Math.min($.length,k.length);for(let R=0;R<N;R++){let I=$[R],E=k[R],L=n.get(I),O=S||Tn.has(I);if(L?.nodeType===1&&I?.namespaceURI===ct&&I.style&&L.isConnected){let T=L.getBoundingClientRect();if(T.width>0&&T.height>0){let P=E.getBoundingClientRect(),q=T.width/s,z=T.height/d,Y=P.width,J=P.height,ce=L.offsetWidth||q,W=L.offsetHeight||z,_=E.offsetWidth||Y,D=E.offsetHeight||J,j=Math.abs(q-ce)>Ee||Math.abs(z-W)>Ee||Math.abs(Y-_)>Ee||Math.abs(J-D)>Ee;if(O){let K=m(E,_,D);q=Y>0?q*v*K.width/Y:q,z=J>0?z*g*K.height/J:z,Y=K.width,J=K.height}else if(j){let K=m(L,ce,W),ae=m(E,_,D);q=K.width,z=K.height,Y=ae.width,J=ae.height}let Q=Y-q,re=J-z;(Math.abs(Q)>Ee||Math.abs(re)>Ee)&&(I.style.boxSizing="border-box",I.style.width=`${F(q)}px`,I.style.height=`${F(z)}px`,p++)}}w(I,E,O)}};w(t,h)}finally{c.remove()}return p}var ol=/::-webkit-scrollbar(-[a-z]+)?\b/i;function qt(e,t=new Set){let r="";if(!e)return r;for(let n=0;n<e.length;n++){let i=e[n];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){r+=qt(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let a=qt(i.cssRules,t);a&&(r+=`@media ${i.conditionText}{${a}}`);continue}if(i.type===CSSRule.STYLE_RULE){let a=i.selectorText||"";if(ol.test(a)){let o=i.cssText;o&&!t.has(o)&&(t.add(o),r+=o)}}}catch{}}return r}var Xr=new WeakMap;function al(e){let t="";for(let r of e.styleSheets){let n=-1;try{n=r.cssRules?r.cssRules.length:-1}catch{}t+=(r.href||"inline")+":"+n+"|"}return t}function ll(e){if(!e||!e.styleSheets)return"";let t=al(e),r=Xr.get(e);if(r&&r.fp===t)return r.css;let n=new Set,i="";for(let a of Array.from(e.styleSheets))try{let o=a.cssRules;o&&(i+=qt(o,n))}catch{}return Xr.set(e,{fp:t,css:i}),i}$e();var Ye=new Set;async function sl(e,t={}){let r=t.__session||C.session,n={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:t},i=null;if(t.clip){let u=In(e,t.clip);if(u){n.clip={rect:u,root:e};let f=e.getBoundingClientRect();i={x:u.left-f.left,y:u.top-f.top,width:u.width,height:u.height}}}let a,o="",l="";if(Ye.size){let u=(f,h)=>{for(let p=h;p;p=p.assignedSlot||p.parentElement||p.getRootNode()?.host)if(p===f)return!0;return!1};for(;;){let f=[...Ye].filter(({root:h})=>u(h,e)||u(e,h)).map(({promise:h})=>h.catch(()=>{}));if(!f.length)break;await Promise.all(f)}}if(!n.clip&&e.isConnected&&e.ownerDocument?.visibilityState!=="hidden")try{let u=e.getBoundingClientRect(),f=e.ownerDocument?.defaultView||window,h=u.right<=0||u.bottom<=0||u.left>=f.innerWidth||u.top>=f.innerHeight,p=[];if(h&&(()=>{let m=[];e.shadowRoot&&m.push(e.shadowRoot);for(let y of e.querySelectorAll("*"))y.shadowRoot&&m.push(y.shadowRoot);for(;m.length;){let y=m.pop(),b=y.host?.localName==="calcite-icon";for(let x of y.querySelectorAll("*")){if(x.shadowRoot&&m.push(x.shadowRoot),!b||x.localName!=="svg")continue;let v=x.querySelectorAll("path");if(!v.length||[...v].some(w=>w.getAttribute("d")?.trim()))continue;let g=x.getBoundingClientRect();g.width&&g.height&&p.push(x)}}})(),p.length){let m=(async()=>{let b=e.style,x=e.hasAttribute("style"),v=new Map,g=(w,M)=>{v.has(w)||v.set(w,{value:b.getPropertyValue(w),priority:b.getPropertyPriority(w)}),b.setProperty(w,M,"important");let A=v.get(w);A.forcedValue=b.getPropertyValue(w),A.forcedPriority=b.getPropertyPriority(w)};try{g("left","0"),g("top","0"),g("right","auto"),g("bottom","auto"),g("margin-top","0"),g("margin-right","0"),g("margin-bottom","0"),g("margin-left","0"),g("transform","none"),g("translate","none"),g("opacity","0"),g("pointer-events","none");let w=e.getBoundingClientRect();if(w.right<=0||w.bottom<=0||w.left>=f.innerWidth||w.top>=f.innerHeight){let S=e.parentElement?.getBoundingClientRect(),$=S&&S.right>0&&S.left<f.innerWidth?Math.max(0,S.left):0,k=S&&S.bottom>0&&S.top<f.innerHeight?Math.max(0,S.top):0;g("position","fixed"),g("left",`${$}px`),g("top",`${k}px`)}await Ce(100);let M=Date.now()+1500,A=()=>p.some(S=>{if([...S.querySelectorAll("path")].some(k=>k.getAttribute("d")?.trim()))return!1;let $=S.getBoundingClientRect();return $.width&&$.height&&$.right>0&&$.bottom>0&&$.left<f.innerWidth&&$.top<f.innerHeight});for(;Date.now()<M&&A();)await new Promise(S=>setTimeout(S,25));await Ce(100)}finally{for(let[w,M]of v)b.getPropertyValue(w)!==M.forcedValue||b.getPropertyPriority(w)!==M.forcedPriority||(M.value?b.setProperty(w,M.value,M.priority):b.removeProperty(w));!x&&!b.length&&e.removeAttribute("style"),await Ce(100)}})(),y={root:e,promise:m};Ye.add(y);try{await m}finally{Ye.delete(y)}}}catch{}let s=Fa(e),d=n.clip?()=>{}:Na(e);try{a=await nt(e,n,t)}catch(u){throw console.warn("deepClone failed:",u),u}finally{d(),s()}try{ka(a)}catch(u){console.warn("inlineExternal defs or symbol failed:",u)}try{await Ut(e,a,n,t)}catch(u){console.warn("inlinePseudoElements failed:",u)}await Io(a,n);try{let u=a.querySelectorAll("style[data-sd]");for(let f of u)l+=f.textContent||"",f.remove()}catch(u){U(n,"Failed to extract shadow CSS from style[data-sd]",u)}let c=Ci(n.styleMap);o=Array.from(c.entries()).map(([u,f])=>`.${f}{${u}}`).join(""),o=l+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+o;for(let[u,f]of n.styleMap.entries()){if(u.tagName==="STYLE")continue;if(u.getRootNode&&rr(u.getRootNode())){u.setAttribute("style",f.replace(/;/g,"; "));continue}let h=c.get(f);h&&u.classList.add(h);let p=u.style?.backgroundImage,m=u.dataset?.snapdomHasIcon;p&&p!=="none"&&(u.style.backgroundImage=p),m&&(u.style.verticalAlign="middle",u.style.display="inline")}if((n.clip||e.scrollTop||e.scrollLeft)&&a?.nodeType===1)try{let u=n.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};ja(e,a,n.nodeMap,n.styleCache,u)}catch(u){U(n,"freezeViewportPositioned failed",u)}for(let[u,f]of n.nodeMap.entries()){if(n.clip&&f===e)continue;let h=f.scrollLeft,p=f.scrollTop;if((h||p)&&u?.nodeType===1&&u.namespaceURI==="http://www.w3.org/1999/xhtml"){u.style.overflow="hidden",u.style.scrollbarWidth="none",u.style.msOverflowStyle="none";try{let y=u.querySelectorAll("*");for(let b of y){if(b.nodeType!==1||b.namespaceURI!=="http://www.w3.org/1999/xhtml")continue;let x=b.style.position;if(x==="fixed"||x==="absolute"){let v=parseFloat(b.style.top)||0,g=parseFloat(b.style.left)||0;b.style.top=`${v+p}px`,b.style.left=`${g+h}px`,x==="fixed"&&(b.style.position="absolute")}}}catch{}let m=document.createElement("div");for(m.style.all="unset",m.style.transform=`translate(${-h}px, ${-p}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";u.firstChild;)m.appendChild(u.firstChild);u.appendChild(m)}}if(e===n.nodeMap.get(a)){let u=n.styleCache.get(e)||B(e);n.styleCache.set(e,u);let f=ui(u.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=f||""}for(let[u,f]of n.nodeMap.entries())f.tagName==="PRE"&&(u.style.marginTop="0",u.style.marginBlockStart="0");return{clone:a,classCSS:o,styleCache:n.styleCache,nodeMap:n.nodeMap,reconcileRisk:n.reconcileRisk||0,clipWindow:i}}Ae();te();var _n="http://www.w3.org/1999/xlink";function cl(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(_n,"href"):null)}function ul(e){let t=parseFloat(e.dataset?.snapdomWidth||"")||0,r=parseFloat(e.dataset?.snapdomHeight||"")||0,n=parseInt(e.getAttribute("width")||"",10)||0,i=parseInt(e.getAttribute("height")||"",10)||0,a=parseFloat(e.style?.width||"")||0,o=parseFloat(e.style?.height||"")||0,l=t||a||n||e.width||e.naturalWidth||100,s=r||o||i||e.height||e.naturalHeight||100;return{width:l,height:s}}async function dl(e,t={}){let r=Array.from(e.querySelectorAll("img"));e.tagName==="IMG"&&r.unshift(e);let n=async l=>{if(!l.getAttribute("src")){let p=l.currentSrc||l.src||ft(l.getAttribute("srcset"),l)||"";p&&l.setAttribute("src",p)}l.removeAttribute("srcset"),l.removeAttribute("sizes");let s=l.src||"";if(!s)return;let d=C.image?.get(s);if(d){l.src=d,l.width||(l.width=l.naturalWidth||100),l.height||(l.height=l.naturalHeight||100);return}let c=await ie(s,{as:"dataURL",useProxy:t.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){C.image?.set(s,c.data),l.src=c.data,l.width||(l.width=l.naturalWidth||100),l.height||(l.height=l.naturalHeight||100);return}let{width:u,height:f}=ul(l),{fallbackURL:h}=t||{};if(h)try{let p=typeof h=="function"?await h({width:u,height:f,src:s,element:l}):h;if(p){let m=await ie(p,{as:"dataURL",useProxy:t.useProxy});if(m?.ok&&typeof m.data=="string"){l.src=m.data,l.width||(l.width=u),l.height||(l.height=f);return}}}catch{}if(t.placeholders!==!1){let p=document.createElement("div");p.style.cssText=[`width:${u}px`,`height:${f}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${f}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),p.textContent="img",l.replaceWith(p)}else{let p=document.createElement("div");p.style.cssText=`display:inline-block;width:${u}px;height:${f}px;visibility:hidden;`,l.replaceWith(p)}},i=6;for(let l=0;l<r.length;l+=i){let s=r.slice(l,l+i).map(n);await Promise.allSettled(s)}let a=Array.from(e.querySelectorAll("image"));e.localName==="image"&&a.unshift(e);let o=async l=>{let s=cl(l);if(!s||s.startsWith("data:")||s.startsWith("blob:"))return;let d=await ie(s,{as:"dataURL",useProxy:t.useProxy});d.ok&&typeof d.data=="string"&&d.data.startsWith("data:")&&(l.setAttribute("href",d.data),l.removeAttribute("xlink:href"),typeof l.removeAttributeNS=="function"&&l.removeAttributeNS(_n,"href"))};for(let l=0;l<a.length;l+=i){let s=a.slice(l,l+i).map(o);await Promise.allSettled(s)}}de();te();var Dn=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],fl=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],hl=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],pl=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function ml(e,t,r,n){let i=r.get(e)||B(e);r.has(e)||r.set(e,i);let a=i.getPropertyValue("border-image"),o=i.getPropertyValue("border-image-source"),l=a&&a!=="none"||o&&o!=="none",s=i.getPropertyValue("background-image"),d=i.getPropertyValue("background-color");if(s&&s!=="none"||d&&d!=="rgba(0, 0, 0, 0)"&&d!=="transparent"||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""))for(let c of hl){let u=i.getPropertyValue(c);u&&t.style.setProperty(c,u)}for(let c of Dn){let u=i.getPropertyValue(c);if(c==="background-image"&&(!u||u==="none")){let p=i.getPropertyValue("background");p&&/url\s*\(/.test(p)&&(u=Rt(p).filter(m=>/url\s*\(/.test(m)).join(", ")||u)}if(!u||u==="none")continue;let f=Rt(u),h=await Promise.all(f.map(p=>Xt(p,n)));h.some(p=>p&&p!=="none"&&!/^url\(undefined/.test(p))&&t.style.setProperty(c,h.join(", "))}for(let c of fl){let u=i.getPropertyValue(c);!u||u==="initial"||t.style.setProperty(c,u)}if(l)for(let c of pl){let u=i.getPropertyValue(c);!u||u==="initial"||t.style.setProperty(c,u)}}async function gl(e,t,r,n={},i=C.session.nodeMap){if(!t)return;let a=[];e&&Mr(e)&&a.push([e,t]);let o=[t];for(;o.length;){let s=o.pop();if(s.children)for(let d of s.children){if(d.tagName==="STYLE")continue;let c=i.get(d);c&&Mr(c)&&a.push([c,d]),o.push(d)}}let l=6;for(let s=0;s<a.length;s+=l)await Promise.allSettled(a.slice(s,s+l).map(([d,c])=>ml(d,c,r,n)))}te();de();function yl(e,t,r=C.session.nodeMap){let n=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(let l=i.currentNode;l;l=i.nextNode()){let s=r.get(l);if(s?.nodeType!==1)continue;let d=B(s),c=d.getPropertyValue("backdrop-filter")||d.getPropertyValue("-webkit-backdrop-filter");c&&c!=="none"&&l!==t&&n.push({cloneEl:l,orig:s,bf:c,path:xl(t,l)})}if(!n.length)return;let a=e.getBoundingClientRect(),o=n.map((l,s)=>{let d=t.cloneNode(!0);wl(d,t,l.orig.getBoundingClientRect(),r),vl(Gr(d,l.path));for(let c=0;c<s;c++){let u=Gr(d,n[c].path);u&&(u.style.setProperty("backdrop-filter","none","important"),u.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...l,copy:d}});for(let{cloneEl:l,orig:s,bf:d,copy:c}of o)bl(l,s,d,c,a)}function bl(e,t,r,n,i){let a=t.getBoundingClientRect();if(!a.width||!a.height)return;let o=B(t),l=t.offsetWidth?a.width/t.offsetWidth:1,s=Math.abs(l-1)>.001?1/l:1;n.style.position="absolute",n.style.left=`${(i.left-a.left)*s}px`,n.style.top=`${(i.top-a.top)*s}px`,n.style.width=`${i.width}px`,n.style.height=`${i.height}px`,n.style.margin="0",n.style.filter=r,s!==1&&(n.style.transform=`scale(${s})`,n.style.transformOrigin="top left");let d=document.createElement("div");d.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",d.appendChild(n);let c=document.createElement("div");c.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",c.style.backgroundColor=o.backgroundColor,c.style.backgroundImage=e.style.backgroundImage||o.backgroundImage;for(let u of["background-size","background-position","background-repeat","background-origin","background-clip"])c.style.setProperty(u,o.getPropertyValue(u));e.style.setProperty("background-color","transparent","important"),e.style.setProperty("background-image","none","important"),e.style.setProperty("backdrop-filter","none","important"),e.style.setProperty("-webkit-backdrop-filter","none","important"),o.position==="static"&&(e.style.position="relative"),e.style.isolation="isolate",e.prepend(c),e.prepend(d)}var Qe=128;function wl(e,t,r,n){let i=[[e,t]];for(;i.length;){let[a,o]=i.pop(),l=n.get(o);if(l?.nodeType===1){let c=l.getBoundingClientRect();(c.left>r.right+Qe||c.right<r.left-Qe||c.top>r.bottom+Qe||c.bottom<r.top-Qe)&&(a.tagName==="IMG"&&a.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),a.style&&(a.style.backgroundImage="none"))}let s=a.children,d=o.children;for(let c=0;c<s.length;c++)i.push([s[c],d[c]])}}function xl(e,t){let r=[];for(let n=t;n!==e;n=n.parentElement){if(!n?.parentElement)return null;r.push([...n.parentElement.children].indexOf(n))}return r.reverse()}function Gr(e,t){if(!t)return null;let r=e;for(let n of t)if(r=r.children[n],!r)return null;return r}function vl(e){if(e)for(let t=e;t&&t.parentNode;){let r=t.parentNode;for(;t.nextSibling;)t.nextSibling.remove();t===e&&t.remove(),t=r}}de();te();function Sl(e,t){if(!e)return()=>{};let r=[],n=200;function i(a){if(t){let d=a.getBoundingClientRect();if(d.width>0||d.height>0){let c=Math.max(d.right,d.left+(a.scrollWidth||0)),u=Math.max(d.bottom,d.top+(a.scrollHeight||0));if(c<t.left-n||d.left>t.right+n||u<t.top-n||d.top>t.bottom+n)return}}let o=getComputedStyle(a),l=Cl(a,o);l&&r.push(l);let s=Ml(a,o);s&&r.push(s);for(let d of a.children||[])i(d)}return i(e),()=>r.forEach(a=>a())}function Cl(e,t){if(!e)return()=>{};t=t||getComputedStyle(e);let r=Al(t);if(r<=0)return()=>{};if(!Un(e))return()=>{};let n=Bn(e),i=n.text,a=kl(t);n.write("X");let o=e.scrollHeight-a;n.restore();let l=o>0?o:$l(t),s=Math.round(l*r+a);if(e.scrollHeight<=s+.5)return()=>{};let d=0,c=i.length,u=-1;for(;d<=c;){let f=d+c>>1;n.write(i.slice(0,f)+"\u2026"),e.scrollHeight<=s+.5?(u=f,d=f+1):c=f-1}return n.write((u>=0?i.slice(0,u):"")+"\u2026"),()=>{n.restore()}}function Ml(e,t){if(!e)return()=>{};if(t=t||getComputedStyle(e),t.textOverflow!=="ellipsis")return()=>{};if(t.whiteSpace!=="nowrap"&&t.whiteSpace!=="pre")return()=>{};if(t.overflowX!=="hidden"&&t.overflowX!=="clip")return()=>{};if(!Un(e))return()=>{};if(e.scrollWidth<=e.clientWidth+.5)return()=>{};let r=Bn(e),n=r.text,i=0,a=n.length,o=-1;for(;i<=a;){let l=i+a>>1;r.write(n.slice(0,l)+"\u2026"),e.scrollWidth<=e.clientWidth+.5?(o=l,i=l+1):a=l-1}return r.write((o>=0?n.slice(0,o):"")+"\u2026"),()=>{r.restore()}}function Bn(e){let t=[];for(let n=e.firstChild;n;n=n.nextSibling)n.nodeType===Node.TEXT_NODE&&t.push(n);let r=t.map(n=>n.data);return{text:r.join(""),write(n){t[0].data=n;for(let i=1;i<t.length;i++)t[i].data=""},restore(){for(let n=0;n<t.length;n++)t[n].data=r[n]}}}function Al(e){let t=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");t=(t||"").trim();let r=parseInt(t,10);return Number.isFinite(r)&&r>0?r:0}function $l(e){let t=(e.lineHeight||"").trim(),r=parseFloat(e.fontSize)||16;return!t||t==="normal"?Math.round(r*1.2):t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*r):t.endsWith("%")?Math.round(parseFloat(t)/100*r):Math.round(r*1.2)}function kl(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function Un(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var Ie=[];function xt(e){if(!e)return null;if(Array.isArray(e)){let[t,r]=e;return typeof t=="function"?t(r):t}if(typeof e=="object"&&"plugin"in e){let{plugin:t,options:r}=e;return typeof t=="function"?t(r):t}return typeof e=="function"?e():e}function Fl(...e){let t=e.flat();for(let r of t){let n=xt(r);n&&(Ie.some(i=>i&&i.name&&n.name&&i.name===n.name)||Ie.push(n))}}function jn(e){return e&&Array.isArray(e.plugins)?e.plugins:Ie}async function ve(e,t,r){let n=r,i=jn(t);for(let a of i){let o=a&&typeof a[e]=="function"?a[e]:null;if(!o)continue;let l=await o(t,n);typeof l<"u"&&(n=l)}return n}async function Nl(e,t,r){let n=[],i=jn(t);for(let a of i){let o=a&&typeof a[e]=="function"?a[e]:null;if(!o)continue;let l=await o(t,r);typeof l<"u"&&n.push(l)}return n}function Rl(e){let t=[];if(Array.isArray(e))for(let r of e){let n=xt(r);if(!n||!n.name)continue;let i=t.findIndex(a=>a&&a.name===n.name);i>=0&&t.splice(i,1),t.push(n)}for(let r of Ie)r&&r.name&&!t.some(n=>n.name===r.name)&&t.push(r);return Object.freeze(t)}function El(e,t,r=!1){return!e||e.plugins&&!r||(e.plugins=Rl(t)),e}function Vn(){return Ie.slice()}te();var Pl=.92,Ll=.95;async function Wl(e){let t=new Image;if(t.decoding="sync",t.src=e,typeof t.decode=="function")try{return await t.decode(),t}catch{}return await new Promise((r,n)=>{t.onload=()=>r(),t.onerror=n}),t}function Tl(e){let t=/^data:([^;,]+)/.exec(e);return t?t[1]:""}async function lr(e,t,r){if(typeof e!="string"||!e.startsWith("data:image")||e.startsWith("data:image/svg"))return null;let n=e.length+":"+e.slice(0,64)+e.slice(-64)+":"+Math.round(t)+"x"+Math.round(r);if(C.compress.has(n))return C.compress.get(n);let i=await(async()=>{let a;try{a=await Wl(e)}catch{return null}let o=a.naturalWidth||a.width,l=a.naturalHeight||a.height;if(!o||!l)return null;let s=Math.min(1,Math.max(t/o,r/l));if(!(s>0)||s>=.95)return null;let d=s*Ll,c=Math.max(1,Math.round(o*d)),u=Math.max(1,Math.round(l*d)),f=document.createElement("canvas");f.width=c,f.height=u;let h=f.getContext("2d");if(!h)return null;h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high",h.drawImage(a,0,0,c,u);let p=Tl(e),m=p==="image/jpeg"?"image/jpeg":p==="image/webp"?"image/webp":"image/png";try{let y=f.toDataURL(m,Pl);if(typeof y=="string"&&y.startsWith("data:image")&&y.length<e.length)return y}catch{}return null})();return C.compress.set(n,i),i}async function Il(e,t){if(!t.compress)return{count:0,before:0,after:0};let r=(t.scale||1)*(t.dpr||1),n=Array.from(e.querySelectorAll("img"));e.tagName==="IMG"&&n.unshift(e);let i=0,a=0,o=0,l=async d=>{let c=d.getAttribute("src")||"";if(!c.startsWith("data:image")||c.startsWith("data:image/svg"))return;let u=parseFloat(d.dataset.snapdomWidth)||parseFloat(d.style.width)||d.width||0,f=parseFloat(d.dataset.snapdomHeight)||parseFloat(d.style.height)||d.height||0;if(!u||!f)return;let h=await lr(c,u*r,f*r);h&&(i++,a+=c.length,o+=h.length,d.setAttribute("src",h))},s=6;for(let d=0;d<n.length;d+=s)await Promise.allSettled(n.slice(d,d+s).map(l));return{count:i,before:a,after:o}}function Ol(e){let t=e.offsetWidth||e.getBoundingClientRect().width||0,r=e.offsetHeight||e.getBoundingClientRect().height||0;return{w:t,h:r}}async function _l(e,t,r=C.session.nodeMap){if(!t.compress)return{count:0};let n=(t.scale||1)*(t.dpr||1),i=[],a=[e,...e.querySelectorAll("*")];for(let d of a){let c=d.style&&d.style.backgroundImage;c&&c.includes("data:image")&&i.push(d)}let o=0,l=async d=>{let c=r.get(d);if(!c||!c.isConnected)return;let u;try{u=getComputedStyle(c)}catch{return}if((u.backgroundRepeat||"repeat").toLowerCase().split(",").some(v=>v.trim()!=="no-repeat"))return;let{w:f,h}=Ol(c);if(!f||!h)return;let p=f*n,m=h*n,y=d.style.backgroundImage,b=[...y.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],x=y;for(let v of b){let g=v[2];if(g.startsWith("data:image/svg"))continue;let w=await lr(g,p,m);w&&(x=x.split(g).join(w),o++)}x!==y&&(d.style.backgroundImage=x)},s=6;for(let d=0;d<i.length;d+=s)await Promise.allSettled(i.slice(d,d+s).map(l));return{count:o}}async function Dl(e,t){if(!t.compress)return{count:0};let r=(t.scale||1)*(t.dpr||1),n=Array.from(e.querySelectorAll("image"));e.localName==="image"&&n.unshift(e);let i=0,a=async l=>{let s=l.getAttribute("href")||(typeof l.getAttributeNS=="function"?l.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!s||!s.startsWith("data:image")||s.startsWith("data:image/svg"))return;let d=parseFloat(l.getAttribute("width"))||0,c=parseFloat(l.getAttribute("height"))||0;if(!d||!c)return;let u=await lr(s,d*r,c*r);u&&(l.setAttribute("href",u),l.hasAttribute("xlink:href")&&l.setAttribute("xlink:href",u),i++)},o=6;for(let l=0;l<n.length;l+=o)await Promise.allSettled(n.slice(l,l+o).map(a));return{count:i}}async function Bl(e,t,r){t.compress&&(await Il(e,t),await _l(e,t,r),await Dl(e,t))}function Ul(e){if(Array.isArray(e.plugins)){for(let t of e.plugins)if(xt(t)?.name==="picture-resolver")return!0}return Vn().some(t=>t?.name==="picture-resolver")}function jl(e){let t=Array.isArray(e.plugins)?e.plugins:Vn(),r=[];for(let n of t){let i=xt(n);i&&typeof i.resolveNode=="function"&&r.push(i.resolveNode.bind(i))}return r.length?r:null}var Vl=2e3,ql=3;function zl(e){let t=Date.now(),r=C.burstAdvice.get(e);if(!r||t-r.firstTs>Vl){C.burstAdvice.set(e,{count:1,firstTs:t,warned:!1});return}r.count++,r.count>=ql&&!r.warned&&(r.warned=!0,console.warn("[snapdom] Captured this element multiple times. Pass { burst: true } to increase the speed."))}async function Hl(e,t){if(!e)throw new Error("Element cannot be null or undefined");Jr(t.cache),t.__session={styleMap:C.session.styleMap,styleCache:C.session.styleCache,nodeMap:C.session.nodeMap},t.burst||zl(e),t.__resolveNodeHooks=jl(t);let r=t.fast,n=t.outerTransforms!==!1,i=!!t.outerShadows,a=t.clip?In(e,t.clip):null,o={element:e,options:t,plugins:t.plugins},l,s,d,c,u,f,h="",p="",m,y,b=null;await ve("beforeSnap",o);let x=null;t.resolvePicturePlaceholders!==!1&&!Ul(t)&&(x=await go(o.element,o.options)),await ve("beforeClone",o);let v=Sl(o.element,a);try{({clone:l,classCSS:s,styleCache:d,nodeMap:c,reconcileRisk:u,clipWindow:f}=await sl(o.element,o.options)),u>0&&!t.reconcile&&!C.warnedReconcile&&(C.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time).")),!n&&l&&(b=Ta(o.element,l)),!i&&l&&Va(o.element,l,o.options),l&&(Ha(o.element,l,c),qa(o.element,l))}finally{v()}if(o={clone:l,classCSS:s,styleCache:d,nodeMap:c,...o},await ve("afterClone",o),x&&await x(),Qa(o.clone),o.options?.excludeMode==="remove"||o.options?.filterMode==="remove")try{el(o.element,o.clone,o.styleCache)}catch(N){console.warn("[snapdom] shrink pass failed:",N)}try{await ea(o.clone,o.element,o.nodeMap)}catch{}let g=N=>new Promise((R,I)=>{Ke(()=>{Promise.resolve().then(N).then(R,I)},{fast:r})}),w=(async()=>{await Promise.all([g(()=>dl(o.clone,o.options)),g(()=>gl(o.element,o.clone,o.styleCache,o.options,o.nodeMap))]);try{yl(o.element,o.clone,o.nodeMap)}catch(N){console.warn("[snapdom] backdrop-filter emulation failed:",N)}t.compress&&await g(()=>Bl(o.clone,o.options,o.nodeMap))})(),M=Promise.resolve();t.embedFonts&&(M=g(async()=>{let N=o.element.ownerDocument||document,R=a?L=>{try{let O=L.getBoundingClientRect();return O.right>=a.left-200&&O.left<=a.right+200&&O.bottom>=a.top-200&&O.top<=a.bottom+200}catch{return!0}}:null,{required:I,usedCodepoints:E}=or(o.element,R);if(se()){let L=new Set(Array.from(I).map(O=>String(O).split("__")[0]).filter(Boolean));await ar(L,1,N)}h=await Pn({required:I,usedCodepoints:E,preCached:!1,exclude:o.options.excludeFonts,localFonts:o.options.localFonts,useProxy:o.options.useProxy,fontStylesheetDomains:o.options.fontStylesheetDomains,doc:N})})),await Promise.all([w,M]);let A=vi(o.clone).sort(),S=A.join(",");C.baseStyle.has(S)?p=C.baseStyle.get(S):await new Promise(N=>{Ke(()=>{p=Si(A),C.baseStyle.set(S,p),N()},{fast:r})});let $=ll(o.element?.ownerDocument||document);o={fontsCSS:h,baseCSS:p,scrollbarCSS:$,...o},await ve("beforeRender",o),await new Promise(N=>{Ke(()=>{let R=B(o.element),I=o.element.getBoundingClientRect(),E=Math.max(1,F(o.element.offsetWidth||parseFloat(R.width)||I.width||1)),L=Math.max(1,F(o.element.offsetHeight||parseFloat(R.height)||I.height||1)),O=o.element.ownerDocument||document;if(!f&&(o.element===O.body||o.element===O.documentElement)&&!O.documentElement.hasAttribute("data-sd-pinned")){let H=Math.max(o.element.scrollHeight||0,O.documentElement?.scrollHeight||0,O.body?.scrollHeight||0),Z=Math.max(o.element.scrollWidth||0,O.documentElement?.scrollWidth||0,O.body?.scrollWidth||0);H>0&&(L=Math.max(L,F(H))),Z>0&&(E=Math.max(E,F(Z)));try{let X=(o.scrollbarCSS||"").length+(o.baseCSS||"").length+(o.fontsCSS||"").length+(o.classCSS||"").length,ne=C.measureHints.get(o.element);if(ne&&ne.cssLen===X&&ne.w0===E)ne.csh>0&&(L=Math.max(L,F(ne.csh))),ne.csw>0&&(E=Math.max(E,F(ne.csw)));else{let G=O.createElement("div");G.setAttribute("data-snapdom-internal",""),G.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+E+"px!important;overflow:visible!important;visibility:hidden!important;";let he=G.attachShadow({mode:"open"}),ze=O.createElement("style");ze.textContent=(o.scrollbarCSS||"")+o.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,he.appendChild(ze),he.appendChild(o.clone.cloneNode(!0)),O.body.appendChild(G);let xe=G.scrollHeight,vt=G.scrollWidth;O.body.removeChild(G),C.measureHints.set(o.element,{cssLen:X,w0:E,csh:xe,csw:vt}),xe>0&&(L=Math.max(L,F(xe))),vt>0&&(E=Math.max(E,F(vt)))}}catch{}}if(o.options?.excludeMode==="remove"||o.options?.filterMode==="remove"){let H=nl(o.element,o.options);Number.isFinite(H)&&H>0&&(L=Math.max(1,Math.min(L,F(H+1))))}if(o.options?.reconcile)try{let H=(o.scrollbarCSS||"")+o.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS;il(o.element,o.clone,H,o.nodeMap,E,L)}catch(H){console.warn("[snapdom] reconcile pass failed:",H)}let T=(H,Z=NaN)=>{let X=typeof H=="string"?parseFloat(H):H;return Number.isFinite(X)?X:Z},P=T(o.options.width),q=T(o.options.height),z=f?F(f.width):E,Y=f?F(f.height):L,J=z,ce=Y,W=Number.isFinite(P),_=Number.isFinite(q),D=Y>0?z/Y:1;W&&_?(J=Math.max(1,F(P)),ce=Math.max(1,F(q))):W?(J=Math.max(1,F(P)),ce=Math.max(1,F(J/(D||1)))):_&&(ce=Math.max(1,F(q)),J=Math.max(1,F(ce*(D||1))));let j=0,Q=0,re=E,K=L;if(f){let H=0,Z=0;if(kt(o.element)){let X=null;if(!n&&b&&Number.isFinite(b.a))X={a:b.a,b:b.b||0,c:b.c||0,d:b.d||1,e:0,f:0};else{let ne=pt(o.element),G=On(R.transform&&R.transform!=="none"?R.transform:"",ne);G&&G.is2D&&(X={a:G.a,b:G.b,c:G.c,d:G.d,e:0,f:0})}if(X&&!(X.a===1&&X.b===0&&X.c===0&&X.d===1)){let{ox:ne,oy:G}=jt(R,E,L),he=at(E,L,X,ne,G);H=he.minX,Z=he.minY}}j=F(f.x+H),Q=F(f.y+Z),re=F(j+f.width),K=F(Q+f.height)}else if(!n&&b&&Number.isFinite(b.a)){let H={a:b.a,b:b.b||0,c:b.c||0,d:b.d||1,e:0,f:0},Z=at(E,L,H,0,0);j=F(Z.minX),Q=F(Z.minY),re=F(Z.maxX),K=F(Z.maxY)}else if(n&&kt(o.element)){let H=R.transform&&R.transform!=="none"?R.transform:"",Z=pt(o.element),X=Oa({baseTransform:H,rotate:Z.rotate||"0deg",scale:Z.scale,translate:Z.translate}),{ox:ne,oy:G}=jt(R,E,L),he=X.is2D?X:new DOMMatrix(X.toString()),ze={a:he.a,b:he.b,c:he.c,d:he.d,e:0,f:0},xe=at(E,L,ze,ne,G);j=F(xe.minX),Q=F(xe.minY),re=F(xe.maxX),K=F(xe.maxY)}let ae=Ra(R),ke=Ea(R),fe=Pa(R),Se=La(R),ue=Wa(R),De=f?{top:0,right:0,bottom:0,left:0}:i?{top:F(Math.max(ae.top,ke.top)+fe.top+Se.top+ue.bleed.top),right:F(Math.max(ae.right,ke.right)+fe.right+Se.right+ue.bleed.right),bottom:F(Math.max(ae.bottom,ke.bottom)+fe.bottom+Se.bottom+ue.bleed.bottom),left:F(Math.max(ae.left,ke.left)+fe.left+Se.left+ue.bleed.left)}:{top:fe.top,right:fe.right,bottom:fe.bottom,left:fe.left};j=F(j-De.left),Q=F(Q-De.top),re=F(re+De.right),K=F(K+De.bottom);let sr=Math.max(1,F(re-j)),cr=Math.max(1,F(K-Q)),zn=W||_?F(J/z):1,Hn=_||W?F(ce/Y):1,Xn=Math.max(1,F(sr*zn)),Gn=Math.max(1,F(cr*Hn)),ur="http://www.w3.org/2000/svg",Yn=kt(o.element)?2:0,Fe=F(Yn+(n?0:1)),Be=Math.ceil(sr+Fe*2),Ue=Math.ceil(cr+Fe*2),je=F(-(F(j)-Fe)),Ve=F(-(F(Q)-Fe)),dr=Math.max(0,je),fr=Math.max(0,Ve),hr=F(Be-Math.min(0,je)),pr=F(Ue-Math.min(0,Ve)),we=document.createElementNS(ur,"foreignObject");we.setAttribute("x",String(Math.min(0,je))),we.setAttribute("y",String(Math.min(0,Ve))),we.setAttribute("width",String(hr)),we.setAttribute("height",String(pr)),we.style.overflow="visible";let mr=document.createElement("style"),Qn="svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}";mr.textContent=(o.scrollbarCSS||"")+o.baseCSS+o.fontsCSS+Qn+o.classCSS,we.appendChild(mr);let qe=document.createElement("div");qe.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),qe.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${hr}px;height:${pr}px`+(dr!==0||fr!==0?`;padding:${fr}px 0 0 ${dr}px !important`:""),qe.appendChild(o.clone),we.appendChild(qe);let Jn=new XMLSerializer().serializeToString(we),gr=W||_,Kn=Object.freeze({w0:z,h0:Y,vbW:Be,vbH:Ue,targetW:J,targetH:ce,contentX:F(je+(f?j:0)),contentY:F(Ve+(f?Q:0)),clip:f?Object.freeze({x:F(j),y:F(Q),width:z,height:Y}):null});Object.defineProperty(t,"meta",{value:Kn,enumerable:!0,writable:!1,configurable:!0});let Zn=!gr||se()?Be:F(Xn+Fe*2),ei=!gr||se()?Ue:F(Gn+Fe*2),ti=parseFloat(B(O.documentElement)?.fontSize)||16;y=`<svg xmlns="${ur}" width="${Zn}" height="${ei}" viewBox="0 0 ${Be} ${Ue}" font-size="${ti}px">`+Jn+"</svg>",m=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(y)}`,o={svgString:y,dataURL:m,...o},N()},{fast:r})}),await ve("afterRender",o);let k=document.getElementById("snapdom-sandbox");return k&&k.style.position==="absolute"&&k.remove(),o.dataURL}function kt(e){return _a(e)}te();function Xl(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let r=ci(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:e.placeholders!==!1,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:r,useProxy:typeof e.useProxy=="string"?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,reconcile:e.reconcile??!1,burst:e.burst??!1,invalidate:e.invalidate??!1,clip:e.clip??null,compress:e.compress!==!1,excludeStyleProps:e.excludeStyleProps??null,resolvePicturePlaceholders:e.resolvePicturePlaceholders!==!1,pictureResolver:e.pictureResolver&&typeof e.pictureResolver=="object"?e.pictureResolver:{}}}$e();hn();var Yr=new WeakMap;function qn(e,t,r){let n=new Set;if(pe(e,"video")&&n.add(e),e.querySelectorAll)for(let i of e.querySelectorAll("video"))n.add(i);for(let i of t.trackedVideos)n.has(i)||(i.removeEventListener("timeupdate",r),i.removeEventListener("seeked",r),t.trackedVideos.delete(i));for(let i of n)t.trackedVideos.has(i)||(i.addEventListener("timeupdate",r),i.addEventListener("seeked",r),t.trackedVideos.add(i))}function Gl(e){let t={dirty:!0,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedVideos:new Set},r=a=>{t.capturing||Sn(a)&&(t.dirty=!0)},n=()=>{t.capturing||(t.dirty=!0)},i=e.ownerDocument||document;try{let a=new MutationObserver(r);a.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),t.observers.push(a)}catch{}try{if(i.head){let a=new MutationObserver(r);a.observe(i.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),t.observers.push(a)}}catch{}return t.markDirty=r,t.onMediaDirty=n,qn(e,t,n),t}function Qr(e){let{burst:t,invalidate:r,...n}=e||{};try{return JSON.stringify(n,Object.keys(n).sort())}catch{return null}}function Yl(e,t,r,n){let i=Yr.get(e);i||(i=Gl(e),i.baselineSignature=Qr(t),Yr.set(e,i));let a=Qr(t),o=a===null||a!==i.baselineSignature,l=async()=>{for(let d of i.observers)i.markDirty(d.takeRecords());if(r.invalidate&&(i.dirty=!0),!o&&!i.dirty&&i.last)return i.last;i.capturing=!0,o||(i.dirty=!1);try{let d=await n();return o||(i.last=d),d}finally{for(let d of i.observers)d.takeRecords();i.capturing=!1,qn(e,i,i.onMediaDirty)}},s=i.inflight.then(l,l);return i.inflight=s.catch(()=>{}),s}de();Ae();te();async function Ql(e=document,t={}){let{embedFonts:r=!0,useProxy:n=""}=t,i=t.cache??t.cacheOpt??"full";Jr(i);try{await document.fonts?.ready}catch{}try{wi()}catch{}C.session=C.session||{},C.session.styleCache||(C.session.styleCache=new WeakMap),C.image=C.image||new ee(100),C.background=C.background||new ee(100);let a=[],o=[];try{if(e&&e.nodeType===1){let s=e.querySelectorAll?Array.from(e.querySelectorAll("*")):[];o=[e,...s],a=[],e.tagName==="IMG"&&e.getAttribute("src")&&a.push(e),a.push(...Array.from(e.querySelectorAll?.("img[src]")||[]))}else e?.querySelectorAll&&(a=Array.from(e.querySelectorAll("img[src]")),o=Array.from(e.querySelectorAll("*")))}catch{}let l=[];for(let s of a){let d=s?.currentSrc||s?.src;if(d&&!C.image.has(d)){let c=Promise.resolve().then(async()=>{let u=await ie(d,{as:"dataURL",useProxy:n});u?.ok&&typeof u.data=="string"&&C.image.set(d,u.data)}).catch(()=>{});l.push(c)}}for(let s of o){let d=new Set;for(let c of Dn){let u="";try{u=c==="background-image"&&s?.style?.backgroundImage||B(s).getPropertyValue(c)||""}catch{}if(!u||u==="none")continue;let f=u.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let h of f){if(d.has(h))continue;d.add(h);let p=Promise.resolve().then(()=>Xt(h,{...t,useProxy:n})).catch(()=>{});l.push(p)}}}if(r)try{let{required:s,usedCodepoints:d}=or(e);if(typeof se=="function"?se():se){let c=new Set(Array.from(s).map(u=>String(u).split("__")[0]).filter(Boolean));await ar(c,3)}await Pn({required:s,usedCodepoints:d,exclude:t.excludeFonts,localFonts:t.localFonts,useProxy:t.useProxy??n,fontStylesheetDomains:t.fontStylesheetDomains})}catch{}await Promise.allSettled(l)}function Jl(...e){return Fl(...e),V}var V=Object.assign(Zl,{plugins:Jl}),zt=Symbol("snapdom.internal"),Kl=Symbol("snapdom.internal.silent");async function Zl(e,t){if(!e)throw new Error("Element cannot be null or undefined");let r=Xl(t);if(El(r,t&&t.plugins),se()){if(r.embedFonts===!0)try{let i=ba(e),a=new Set([...i].map(o=>String(o).split("__")[0]).filter(Boolean));await ar(a,1)}catch{}let n=Array.from(e.querySelectorAll("canvas"));e.tagName==="CANVAS"&&n.unshift(e);for(let i of n)try{let a=i.getContext("2d",{willReadFrequently:!0});a&&a.getImageData(0,0,1,1)}catch(a){U(t,"safari canvas poke failed",a)}}return r.iconFonts&&r.iconFonts.length>0&&Xo(r.iconFonts),r.snap||(r.snap={toPng:(n,i)=>V.toPng(n,i),toSvg:(n,i)=>V.toSvg(n,i)}),r.burst?Yl(e,t,r,()=>V.capture(e,r,zt)):V.capture(e,r,zt)}V.capture=async(e,t,r)=>{if(r!==zt)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");t.element=e;let n=await Hl(e,t),i={img:async(m,y)=>{let{toImg:b}=await Promise.resolve().then(()=>(vr(),Pt));return b(n,{...m,...y||{}})},svg:async(m,y)=>{let{toSvg:b}=await Promise.resolve().then(()=>(vr(),Pt));return b(n,{...m,...y||{}})},canvas:async(m,y)=>{let{toCanvas:b}=await Promise.resolve().then(()=>(_e(),pn));return b(n,{...m,...y||{}})},blob:async(m,y)=>{let{toBlob:b}=await Promise.resolve().then(()=>(xn(),bn));return b(n,{...m,...y||{}})},png:async(m,y)=>{let{rasterize:b}=await Promise.resolve().then(()=>(tt(),et));return b(n,{...m,...y||{},format:"png"})},jpeg:async(m,y)=>{let{rasterize:b}=await Promise.resolve().then(()=>(tt(),et));return b(n,{...m,...y||{},format:"jpeg"})},webp:async(m,y)=>{let{rasterize:b}=await Promise.resolve().then(()=>(tt(),et));return b(n,{...m,...y||{},format:"webp"})},download:async(m,y)=>{let{download:b}=await Promise.resolve().then(()=>(_i(),vn));return b(n,{...m,...y||{}})}},a={};for(let m of["img","svg","canvas","blob","png","jpeg","webp"])a[m]=async y=>i[m](t,{...y||{},[Kl]:!0});a.jpg=a.jpeg;let o={...t,export:{url:n},exports:a},l=await Nl("defineExports",o),s=Object.assign({},...l.filter(m=>m&&typeof m=="object").reverse()),d={...i,...s};d.jpeg&&!d.jpg&&(d.jpg=(m,y)=>d.jpeg(m,y));function c(m,y){let b={...t,...y||{}},x=v=>v==="jpeg"||v==="jpg"||v==="webp";return[m,b.format,b.type].map(v=>typeof v=="string"?v.toLowerCase():"").find(x)&&(b.backgroundColor==null||b.backgroundColor==="transparent")&&(b.backgroundColor="#ffffff"),b}let u=!1,f=Promise.resolve();async function h(m,y){let b=Object.freeze(y&&typeof y=="object"?{...y}:{}),x=async()=>{let g=d[m];if(!g)throw new Error(`[snapdom] Unknown export type: ${m}`);let w=c(m,b),M={...t,export:{type:m,options:w,requestedOptions:b,url:n}};await ve("beforeExport",M,{format:m,options:w});let A=await g(M,w);return await ve("afterExport",M,{format:m,options:w,result:A}),u||(u=!0,await ve("afterSnap",t)),A},v=f.then(x);return f=v.catch(()=>{}),v}let p={url:n,toRaw:()=>n,to:(m,y)=>h(m,y),toImg:m=>h("img",m),toSvg:m=>h("svg",m),toCanvas:m=>h("canvas",m),toBlob:m=>h("blob",m),toPng:m=>h("png",m),toJpg:m=>h("jpg",m),toWebp:m=>h("webp",m),download:m=>h("download",m)};Object.defineProperty(p,"meta",{value:t.meta,enumerable:!0,writable:!1,configurable:!1});for(let m of Object.keys(d)){let y="to"+m.charAt(0).toUpperCase()+m.slice(1);p[y]||(p[y]=b=>h(m,b))}return p};V.toRaw=(e,t)=>V(e,t).then(r=>r.toRaw());V.toImg=(e,t)=>V(e,t).then(r=>r.toImg());V.toSvg=(e,t)=>V(e,t).then(r=>r.toSvg());V.toCanvas=(e,t)=>V(e,t).then(r=>r.toCanvas());V.toBlob=(e,t)=>V(e,t).then(r=>r.toBlob());V.toPng=(e,t)=>V(e,{...t,format:"png"}).then(r=>r.toPng());V.toJpg=(e,t)=>V(e,{...t,format:"jpeg"}).then(r=>r.toJpg());V.toWebp=(e,t)=>V(e,{...t,format:"webp"}).then(r=>r.toWebp());V.download=(e,t)=>V(e,t).then(r=>r.download());return li(es);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loomweaver/frame-kit",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.6",
|
|
4
4
|
"description": "LoomWeaver: open-source plugin platform for Angular workbenches. The frame kit: the <lw-*> custom elements, the compiled .lw-* class contracts and Penpal, served as static assets to sandboxed iframe plugins.",
|
|
5
5
|
"types": "dist/lw-frame.d.ts",
|
|
6
6
|
"keywords": [
|