@zumer/snapdom 2.0.0-dev.0 → 2.0.0-dev.1

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.
@@ -1,8 +1,8 @@
1
- (()=>{var bn=Object.defineProperty,Sn=Object.defineProperties;var xn=Object.getOwnPropertyDescriptors;var Se=Object.getOwnPropertySymbols;var Cn=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable;var Kt=Math.pow,xe=(t,e,n)=>e in t?bn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,E=(t,e)=>{for(var n in e||(e={}))Cn.call(e,n)&&xe(t,n,e[n]);if(Se)for(var n of Se(e))kn.call(e,n)&&xe(t,n,e[n]);return t},W=(t,e)=>Sn(t,xn(e));var v=(t,e,n)=>new Promise((r,s)=>{var o=c=>{try{u(n.next(c))}catch(l){s(l)}},a=c=>{try{u(n.throw(c))}catch(l){s(l)}},u=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,a);u((n=n.apply(t,e)).next())});var S={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function Pt(t="soft"){switch(S.session.__counterEpoch=(S.session.__counterEpoch||0)+1,t){case"auto":{S.session.styleMap=new Map,S.session.nodeMap=new Map;return}case"soft":{S.session.styleMap=new Map,S.session.nodeMap=new Map,S.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{S.session.styleMap=new Map,S.session.nodeMap=new Map,S.session.styleCache=new WeakMap,S.computedStyle=new WeakMap,S.baseStyle=new Map,S.defaultStyle=new Map,S.image=new Map,S.background=new Map,S.resource=new Map,S.font=new Set;return}default:{S.session.styleMap=new Map,S.session.nodeMap=new Map,S.session.styleCache=new WeakMap;return}}}function mt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Jt(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let s=r.split(",").map(o=>o.trim());return s.length!==6?`matrix(${r})`:(s[4]="0",s[5]="0",`matrix(${s.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let s=r.split(",").map(o=>o.trim());return s.length!==16?`matrix3d(${r})`:(s[12]="0",s[13]="0",`matrix3d(${s.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function ut(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch(e){return t}}function An(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,s=0;function o(a,u,c){if(s>=n)return;let l=Date.now();(r.get(u)||0)>l||(r.set(u,l+e),s++,a==="warn"&&console&&console.warn?console.warn(`${t} ${c}`):console&&console.error&&console.error(`${t} ${c}`))}return{warnOnce(a,u){o("warn",a,u)},errorOnce(a,u){o("error",a,u)},reset(){r.clear(),s=0}}}var Ce=An("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Qt=new Map,_t=new Map;function Mn(t){return/^data:|^blob:|^about:blank$/i.test(t)}function vn(t,e){try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",r=e.includes("{url}")?e.split("{url}")[0]:e,s=new URL(r||".",n),o=new URL(t,n);if(o.origin===s.origin)return!0;let a=o.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch(n){}return!1}function $n(t,e){if(!e||Mn(t)||vn(t,e))return!1;try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location!="undefined"?r.origin!==location.origin:!0}catch(n){return!!e}}function En(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",ut(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${ut(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function ke(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function Fn(t,e){var n,r;return[e.as||"blob",(n=e.timeout)!=null?n:3e3,e.useProxy||"",(r=e.errorTTL)!=null?r:8e3,t].join("|")}function X(n){return v(this,arguments,function*(t,e={}){var y,b,x;let r=(y=e.as)!=null?y:"blob",s=(b=e.timeout)!=null?b:3e3,o=e.useProxy||"",a=(x=e.errorTTL)!=null?x:8e3,u=e.headers||{},c=!!e.silent;if(/^data:/i.test(t))try{if(r==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(r==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,M="",C=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],F=/;base64/i.test(M)?atob(C):decodeURIComponent(C),k=new Uint8Array([...F].map(R=>R.charCodeAt(0))),N=new Blob([k],{type:(M||"").split(";")[0]||""});return{ok:!0,data:N,status:200,url:t,fromCache:!1,mime:N.type||""}}catch(M){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let M=yield fetch(t);if(!M.ok)return{ok:!1,data:null,status:M.status,url:t,fromCache:!1,reason:"http_error"};let C=yield M.blob(),w=C.type||M.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:yield ke(C),status:M.status,url:t,fromCache:!1,mime:w}:r==="text"?{ok:!0,data:yield C.text(),status:M.status,url:t,fromCache:!1,mime:w}:{ok:!0,data:C,status:M.status,url:t,fromCache:!1,mime:w}}catch(M){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return r==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:r==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let l=Fn(t,{as:r,timeout:s,useProxy:o,errorTTL:a}),p=_t.get(l);if(p&&p.until>Date.now())return W(E({},p.result),{fromCache:!0});p&&_t.delete(l);let f=Qt.get(l);if(f)return f;let h=$n(t,o)?En(t,o):t,m=e.credentials;if(!m)try{let M=typeof location!="undefined"&&location.href?location.href:"http://localhost/",C=new URL(t,M);m=typeof location!="undefined"&&C.origin===location.origin?"include":"omit"}catch(M){m="omit"}let g=new AbortController,i=setTimeout(()=>g.abort("timeout"),s),d=v(null,null,function*(){var M,C;try{let w=yield fetch(h,{signal:g.signal,credentials:m,headers:u});if(!w.ok){let N={ok:!1,data:null,status:w.status,url:h,fromCache:!1,reason:"http_error"};if(a>0&&_t.set(l,{until:Date.now()+a,result:N}),!c){let R=`${w.status} ${w.statusText||""}`.trim();Ce.warnOnce(`http:${w.status}:${r}:${new URL(t,(M=location==null?void 0:location.href)!=null?M:"http://localhost/").origin}`,`HTTP error ${R} while fetching ${r} ${t}`)}return e.onError&&e.onError(N),N}if(r==="text")return{ok:!0,data:yield w.text(),status:w.status,url:h,fromCache:!1};let F=yield w.blob(),k=F.type||w.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:yield ke(F),status:w.status,url:h,fromCache:!1,mime:k}:{ok:!0,data:F,status:w.status,url:h,fromCache:!1,mime:k}}catch(w){let F=w&&typeof w=="object"&&"name"in w&&w.name==="AbortError"?String(w.message||"").includes("timeout")?"timeout":"abort":"network",k={ok:!1,data:null,status:0,url:h,fromCache:!1,reason:F};if(!/^blob:/i.test(t)&&a>0&&_t.set(l,{until:Date.now()+a,result:k}),!c){let N=`${F}:${r}:${new URL(t,(C=location==null?void 0:location.href)!=null?C:"http://localhost/").origin}`,R=F==="timeout"?`Timeout after ${s}ms. Consider increasing timeout or using a proxy for ${t}`:F==="abort"?`Request aborted while fetching ${r} ${t}`:`Network/CORS issue while fetching ${r} ${t}. A proxy may be required`;Ce.errorOnce(N,R)}return e.onError&&e.onError(k),k}finally{clearTimeout(i),Qt.delete(l)}});return Qt.set(l,d),d})}function ht(t,e){if(!e||!t.width||!t.height)return t;let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let r=n.getContext("2d");return r.fillStyle=e,r.fillRect(0,0,n.width,n.height),r.drawImage(t,0,0),n}function pt(n){return v(this,arguments,function*(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let s=mt(t);if(!s)return t;let o=ut(s);if(S.background.has(o)){let a=S.background.get(o);return a?`url("${a}")`:"none"}try{let a=yield X(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(S.background.set(o,a.data),`url("${a.data}")`):(S.background.set(o,null),"none")}catch(a){return S.background.set(o,null),"none"}})}var Tt=new Set(["meta","script","noscript","title","link","template"]),xt=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Rn=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"];function Zt(){for(let t of Rn){let e=String(t).toLowerCase();Tt.has(e)||xt.has(e)||te(e)}}function te(t){if(t=String(t).toLowerCase(),xt.has(t)){let o={};return S.defaultStyle.set(t,o),o}if(S.defaultStyle.has(t))return S.defaultStyle.get(t);let e=document.getElementById("snapdom-sandbox");e||(e=document.createElement("div"),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t);n.style.all="initial",e.appendChild(n);let r=getComputedStyle(n),s={};for(let o of r){if(Ae(o))continue;let a=r.getPropertyValue(o);s[o]=a}return e.removeChild(n),S.defaultStyle.set(t,s),s}var Ln=/(?:^|-)(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,In=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"]);function Ae(t){let e=String(t).toLowerCase();return!!(In.has(e)||Nn.test(e)||Ln.test(e))}function Ct(t,e){if(e=String(e||"").toLowerCase(),xt.has(e))return"";let n=[],r=te(e);for(let[s,o]of Object.entries(t)){if(Ae(s))continue;let a=r[s];o&&o!==a&&n.push(`${s}:${o}`)}return n.sort(),n.join(";")}function ee(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(n=>e.add(n.tagName.toLowerCase())),Array.from(e))}function ne(t){let e=new Map;for(let r of t){let s=S.defaultStyle.get(r);if(!s)continue;let o=Object.entries(s).map(([a,u])=>`${a}:${u};`).sort().join("");o&&(e.has(o)||e.set(o,[]),e.get(o).push(r))}let n="";for(let[r,s]of e.entries())n+=`${s.join(",")} { ${r} }
2
- `;return n}function re(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let s of e)n.set(s,`c${r++}`);return n}function gt(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=S.computedStyle.get(t);if(n||(n=new Map,S.computedStyle.set(t,n)),!n.has(e)){let r=window.getComputedStyle(t,e);n.set(e,r)}return n.get(e)}function Wt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function Mt(t){let e=[],n=0,r=0;for(let s=0;s<t.length;s++){let o=t[s];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,s).trim()),r=s+1)}return e.push(t.slice(r).trim()),e}function it(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function Y(){let t=typeof navigator!="undefined"&&navigator.userAgent?navigator.userAgent:"",e=/^((?!chrome|android).)*safari/i.test(t),n=/AppleWebKit/i.test(t)&&/Mobile/i.test(t)&&!/Safari/i.test(t),r=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(t);return e||n||r}var Me=new WeakMap,oe=new Map,se=0;function vt(){se++}var ve=!1;function Pn(t=document.documentElement){var e,n;if(!ve){ve=!0;try{new MutationObserver(()=>vt()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(r){}try{new MutationObserver(()=>vt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(r){}try{let r=document.fonts;r&&((e=r.addEventListener)==null||e.call(r,"loadingdone",vt),(n=r.ready)==null||n.then(()=>vt()).catch(()=>{}))}catch(r){}}}function _n(t,e={}){let n={},r=t.getPropertyValue("visibility");for(let s=0;s<t.length;s++){let o=t[s],a=t.getPropertyValue(o);(o==="background-image"||o==="content")&&a.includes("url(")&&!a.includes("data:")&&(a="none"),n[o]=a}if(e.embedFonts){let s=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let o of s)if(!n[o])try{let a=t.getPropertyValue(o);a&&(n[o]=a)}catch(a){}}return r==="hidden"&&(n.opacity="0"),n}var $e=new WeakMap;function Tn(t){let e=$e.get(t);return e||(e=Object.entries(t).sort((r,s)=>r[0]<s[0]?-1:r[0]>s[0]?1:0).map(([r,s])=>`${r}:${s}`).join(";"),$e.set(t,e),e)}function Wn(t,e=null,n={}){let r=Me.get(t);if(r&&r.epoch===se)return r.snapshot;let s=e||getComputedStyle(t),o=_n(s,n);return qn(t,s,o),Me.set(t,{epoch:se,snapshot:o}),o}function Un(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:oe,defaultStyle:S.defaultStyle,baseStyle:S.baseStyle,image:S.image,resource:S.resource,background:S.background,font:S.font},options:e||{}}:{session:S.session,persist:{snapshotKeyCache:oe,defaultStyle:S.defaultStyle,baseStyle:S.baseStyle,image:S.image,resource:S.resource,background:S.background,font:S.font},options:t||e||{}}}function yt(t,e,n,r){return v(this,null,function*(){var h,m,g;if(t.tagName==="STYLE")return;let s=Un(n,r),o=s.options&&s.options.cache||"auto";if(o!=="disabled"&&Pn(document.documentElement),o==="disabled"&&!s.session.__bumpedForDisabled&&(vt(),oe.clear(),s.session.__bumpedForDisabled=!0),xt.has((h=t.tagName)==null?void 0:h.toLowerCase())){let i=(m=t.getAttribute)==null?void 0:m.call(t,"style");i&&e.setAttribute("style",i)}let{session:a,persist:u}=s;a.styleCache.has(t)||a.styleCache.set(t,getComputedStyle(t));let c=a.styleCache.get(t),l=Wn(t,c,s.options),p=Tn(l),f=u.snapshotKeyCache.get(p);if(!f){let i=((g=t.tagName)==null?void 0:g.toLowerCase())||"div";f=Ct(l,i),u.snapshotKeyCache.set(p,f)}a.styleMap.set(e,f)})}function On(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Bn(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}function Dn(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function Hn(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,r=t.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let s=t.scrollHeight;if(s===0)return!1;let o=parseFloat(e.paddingTop)||0,a=parseFloat(e.paddingBottom)||0;return s>o+a}function qn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let r=e.display||"";if(r.includes("flex")||r.includes("grid")||On(t))return;let s=e.position;s==="absolute"||s==="fixed"||s==="sticky"||e.transform==="none"&&(Bn(e)||Dn(t)||Hn(t,e)&&(delete n.height,delete n["block-size"]))}var Fe=["fill","stroke","color","background-color","stop-color"],Ee=new Map;function jn(t,e){let n=e+"::"+t.toLowerCase(),r=Ee.get(n);if(r)return r;let s=document,o=e==="http://www.w3.org/2000/svg"?s.createElementNS(e,t):s.createElement(t),a=s.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(o),s.documentElement.appendChild(a);let u=getComputedStyle(o),c={};for(let l of Fe)c[l]=u.getPropertyValue(l)||"";return a.remove(),Ee.set(n,c),c}function Re(t,e){var o,a,u;if(!(t instanceof Element)||!(e instanceof Element))return;let n=(o=t.getAttribute)==null?void 0:o.call(t,"style"),r=!!(n&&n.includes("var("));if(!r&&((a=t.attributes)!=null&&a.length)){let c=t.attributes;for(let l=0;l<c.length;l++){let p=c[l];if(p&&typeof p.value=="string"&&p.value.includes("var(")){r=!0;break}}}let s=null;if(r)try{s=getComputedStyle(t)}catch(c){}if(r){let c=t.style;if(c&&c.length)for(let l=0;l<c.length;l++){let p=c[l],f=c.getPropertyValue(p);if(!f||!f.includes("var("))continue;let h=s&&s.getPropertyValue(p);if(h)try{e.style.setProperty(p,h.trim(),c.getPropertyPriority(p))}catch(m){}}}if(r&&((u=t.attributes)!=null&&u.length)){let c=t.attributes;for(let l=0;l<c.length;l++){let p=c[l];if(!p||typeof p.value!="string"||!p.value.includes("var("))continue;let f=p.name,h=s&&s.getPropertyValue(f);if(h)try{e.style.setProperty(f,h.trim())}catch(m){}}}if(!r){if(!s)try{s=getComputedStyle(t)}catch(p){s=null}if(!s)return;let c=t.namespaceURI||"html",l=jn(t.tagName,c);for(let p of Fe){let f=s.getPropertyValue(p)||"",h=l[p]||"";if(f&&f!==h)try{e.style.setProperty(p,f.trim())}catch(m){}}}}function ae(t,e,n){return Promise.all(t.map(r=>new Promise(s=>{function o(){it(a=>{(a&&typeof a.timeRemaining=="function"?a.timeRemaining()>0:!0)?e(r,s):o()},{fast:n})}o()})))}function zn(t){return t=t.trim(),!t||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function Vn(t,e,n=!0){return t.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let s=n?zn(r):r;return`:where(${e} ${s})`}).join(", ")}function Xn(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,s,o)=>{let a=Vn(o,e,!0);return`${r}${s}${a}{`}),t):""}function Yn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Gn(t){let e="";try{t.querySelectorAll("style").forEach(r=>{e+=(r.textContent||"")+`
1
+ (()=>{var xn=Object.defineProperty,Sn=Object.defineProperties;var Cn=Object.getOwnPropertyDescriptors;var xe=Object.getOwnPropertySymbols;var kn=Object.prototype.hasOwnProperty,An=Object.prototype.propertyIsEnumerable;var Kt=Math.pow,Se=(t,e,n)=>e in t?xn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,E=(t,e)=>{for(var n in e||(e={}))kn.call(e,n)&&Se(t,n,e[n]);if(xe)for(var n of xe(e))An.call(e,n)&&Se(t,n,e[n]);return t},W=(t,e)=>Sn(t,Cn(e));var A=(t,e,n)=>new Promise((r,s)=>{var o=l=>{try{u(n.next(l))}catch(c){s(c)}},a=l=>{try{u(n.throw(l))}catch(c){s(c)}},u=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,a);u((n=n.apply(t,e)).next())});var x={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function Pt(t="soft"){switch(x.session.__counterEpoch=(x.session.__counterEpoch||0)+1,t){case"auto":{x.session.styleMap=new Map,x.session.nodeMap=new Map;return}case"soft":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap,x.computedStyle=new WeakMap,x.baseStyle=new Map,x.defaultStyle=new Map,x.image=new Map,x.background=new Map,x.resource=new Map,x.font=new Set;return}default:{x.session.styleMap=new Map,x.session.nodeMap=new Map,x.session.styleCache=new WeakMap;return}}}function mt(t){let e=t.match(/url\((['"]?)(.*?)(\1)\)/);if(!e)return null;let n=e[2].trim();return n.startsWith("#")?null:n}function Jt(t){if(!t||t==="none")return"";let e=t.replace(/translate[XY]?\([^)]*\)/g,"");return e=e.replace(/matrix\(([^)]+)\)/g,(n,r)=>{let s=r.split(",").map(o=>o.trim());return s.length!==6?`matrix(${r})`:(s[4]="0",s[5]="0",`matrix(${s.join(", ")})`)}),e=e.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let s=r.split(",").map(o=>o.trim());return s.length!==16?`matrix3d(${r})`:(s[12]="0",s[13]="0",`matrix3d(${s.join(", ")})`)}),e.trim().replace(/\s{2,}/g," ")}function ut(t){if(/%[0-9A-Fa-f]{2}/.test(t))return t;try{return encodeURI(t)}catch(e){return t}}function Mn(t="[snapDOM]",{ttlMs:e=5*6e4,maxEntries:n=12}={}){let r=new Map,s=0;function o(a,u,l){if(s>=n)return;let c=Date.now();(r.get(u)||0)>c||(r.set(u,c+e),s++,a==="warn"&&console&&console.warn?console.warn(`${t} ${l}`):console&&console.error&&console.error(`${t} ${l}`))}return{warnOnce(a,u){o("warn",a,u)},errorOnce(a,u){o("error",a,u)},reset(){r.clear(),s=0}}}var Ce=Mn("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Qt=new Map,Tt=new Map;function vn(t){return/^data:|^blob:|^about:blank$/i.test(t)}function $n(t,e){try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",r=e.includes("{url}")?e.split("{url}")[0]:e,s=new URL(r||".",n),o=new URL(t,n);if(o.origin===s.origin)return!0;let a=o.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch(n){}return!1}function En(t,e){if(!e||vn(t)||$n(t,e))return!1;try{let n=typeof location!="undefined"&&location.href?location.href:"http://localhost/",r=new URL(t,n);return typeof location!="undefined"?r.origin!==location.origin:!0}catch(n){return!!e}}function Fn(t,e){if(!e)return t;if(e.includes("{url}"))return e.replace("{urlRaw}",ut(t)).replace("{url}",encodeURIComponent(t));if(/[?&]url=?$/.test(e))return`${e}${encodeURIComponent(t)}`;if(e.endsWith("?"))return`${e}url=${encodeURIComponent(t)}`;if(e.endsWith("/"))return`${e}${ut(t)}`;let n=e.includes("?")?"&":"?";return`${e}${n}url=${encodeURIComponent(t)}`}function ke(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(t)})}function Ln(t,e){var n,r;return[e.as||"blob",(n=e.timeout)!=null?n:3e3,e.useProxy||"",(r=e.errorTTL)!=null?r:8e3,t].join("|")}function X(n){return A(this,arguments,function*(t,e={}){var y,b,S;let r=(y=e.as)!=null?y:"blob",s=(b=e.timeout)!=null?b:3e3,o=e.useProxy||"",a=(S=e.errorTTL)!=null?S:8e3,u=e.headers||{},l=!!e.silent;if(/^data:/i.test(t))try{if(r==="text")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(r==="dataURL")return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(";")[0]||""};let[,v="",C=""]=String(t).match(/^data:([^,]*),(.*)$/)||[],F=/;base64/i.test(v)?atob(C):decodeURIComponent(C),k=new Uint8Array([...F].map(L=>L.charCodeAt(0))),I=new Blob([k],{type:(v||"").split(";")[0]||""});return{ok:!0,data:I,status:200,url:t,fromCache:!1,mime:I.type||""}}catch(v){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(t))try{let v=yield fetch(t);if(!v.ok)return{ok:!1,data:null,status:v.status,url:t,fromCache:!1,reason:"http_error"};let C=yield v.blob(),w=C.type||v.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:yield ke(C),status:v.status,url:t,fromCache:!1,mime:w}:r==="text"?{ok:!0,data:yield C.text(),status:v.status,url:t,fromCache:!1,mime:w}:{ok:!0,data:C,status:v.status,url:t,fromCache:!1,mime:w}}catch(v){return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(t))return r==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:t,fromCache:!1,mime:"image/png"}:{ok:!0,data:r==="text"?"":new Blob([]),status:200,url:t,fromCache:!1};let c=Ln(t,{as:r,timeout:s,useProxy:o,errorTTL:a}),p=Tt.get(c);if(p&&p.until>Date.now())return W(E({},p.result),{fromCache:!0});p&&Tt.delete(c);let f=Qt.get(c);if(f)return f;let m=En(t,o)?Fn(t,o):t,d=e.credentials;if(!d)try{let v=typeof location!="undefined"&&location.href?location.href:"http://localhost/",C=new URL(t,v);d=typeof location!="undefined"&&C.origin===location.origin?"include":"omit"}catch(v){d="omit"}let g=new AbortController,i=setTimeout(()=>g.abort("timeout"),s),h=A(null,null,function*(){var v,C;try{let w=yield fetch(m,{signal:g.signal,credentials:d,headers:u});if(!w.ok){let I={ok:!1,data:null,status:w.status,url:m,fromCache:!1,reason:"http_error"};if(a>0&&Tt.set(c,{until:Date.now()+a,result:I}),!l){let L=`${w.status} ${w.statusText||""}`.trim();Ce.warnOnce(`http:${w.status}:${r}:${new URL(t,(v=location==null?void 0:location.href)!=null?v:"http://localhost/").origin}`,`HTTP error ${L} while fetching ${r} ${t}`)}return e.onError&&e.onError(I),I}if(r==="text")return{ok:!0,data:yield w.text(),status:w.status,url:m,fromCache:!1};let F=yield w.blob(),k=F.type||w.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:yield ke(F),status:w.status,url:m,fromCache:!1,mime:k}:{ok:!0,data:F,status:w.status,url:m,fromCache:!1,mime:k}}catch(w){let F=w&&typeof w=="object"&&"name"in w&&w.name==="AbortError"?String(w.message||"").includes("timeout")?"timeout":"abort":"network",k={ok:!1,data:null,status:0,url:m,fromCache:!1,reason:F};if(!/^blob:/i.test(t)&&a>0&&Tt.set(c,{until:Date.now()+a,result:k}),!l){let I=`${F}:${r}:${new URL(t,(C=location==null?void 0:location.href)!=null?C:"http://localhost/").origin}`,L=F==="timeout"?`Timeout after ${s}ms. Consider increasing timeout or using a proxy for ${t}`:F==="abort"?`Request aborted while fetching ${r} ${t}`:`Network/CORS issue while fetching ${r} ${t}. A proxy may be required`;Ce.errorOnce(I,L)}return e.onError&&e.onError(k),k}finally{clearTimeout(i),Qt.delete(c)}});return Qt.set(c,h),h})}function ht(t,e){if(!e||!t.width||!t.height)return t;let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let r=n.getContext("2d");return r.fillStyle=e,r.fillRect(0,0,n.width,n.height),r.drawImage(t,0,0),n}function pt(n){return A(this,arguments,function*(t,e={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(t)||t.trim()==="none")return t;let s=mt(t);if(!s)return t;let o=ut(s);if(x.background.has(o)){let a=x.background.get(o);return a?`url("${a}")`:"none"}try{let a=yield X(o,{as:"dataURL",useProxy:e.useProxy});return a.ok?(x.background.set(o,a.data),`url("${a.data}")`):(x.background.set(o,null),"none")}catch(a){return x.background.set(o,null),"none"}})}var _t=new Set(["meta","script","noscript","title","link","template"]),St=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Rn=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"];function Zt(){for(let t of Rn){let e=String(t).toLowerCase();_t.has(e)||St.has(e)||te(e)}}function te(t){if(t=String(t).toLowerCase(),St.has(t)){let o={};return x.defaultStyle.set(t,o),o}if(x.defaultStyle.has(t))return x.defaultStyle.get(t);let e=document.getElementById("snapdom-sandbox");e||(e=document.createElement("div"),e.id="snapdom-sandbox",e.setAttribute("data-snapdom-sandbox","true"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0px",e.style.height="0px",e.style.overflow="hidden",document.body.appendChild(e));let n=document.createElement(t);n.style.all="initial",e.appendChild(n);let r=getComputedStyle(n),s={};for(let o of r){if(Ae(o))continue;let a=r.getPropertyValue(o);s[o]=a}return e.removeChild(n),x.defaultStyle.set(t,s),s}var In=/(?:^|-)(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,Pn=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"]);function Ae(t){let e=String(t).toLowerCase();return!!(Pn.has(e)||Nn.test(e)||In.test(e))}function Ct(t,e){if(e=String(e||"").toLowerCase(),St.has(e))return"";let n=[],r=te(e);for(let[s,o]of Object.entries(t)){if(Ae(s))continue;let a=r[s];o&&o!==a&&n.push(`${s}:${o}`)}return n.sort(),n.join(";")}function ee(t){let e=new Set;return t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(t.tagName&&e.add(t.tagName.toLowerCase()),typeof t.querySelectorAll=="function"&&t.querySelectorAll("*").forEach(n=>e.add(n.tagName.toLowerCase())),Array.from(e))}function ne(t){let e=new Map;for(let r of t){let s=x.defaultStyle.get(r);if(!s)continue;let o=Object.entries(s).map(([a,u])=>`${a}:${u};`).sort().join("");o&&(e.has(o)||e.set(o,[]),e.get(o).push(r))}let n="";for(let[r,s]of e.entries())n+=`${s.join(",")} { ${r} }
2
+ `;return n}function re(t){let e=Array.from(new Set(t.values())).filter(Boolean).sort(),n=new Map,r=1;for(let s of e)n.set(s,`c${r++}`);return n}function gt(t,e=null){if(!(t instanceof Element))return window.getComputedStyle(t,e);let n=x.computedStyle.get(t);if(n||(n=new Map,x.computedStyle.set(t,n)),!n.has(e)){let r=window.getComputedStyle(t,e);n.set(e,r)}return n.get(e)}function Wt(t){let e={};for(let n of t)e[n]=t.getPropertyValue(n);return e}function Mt(t){let e=[],n=0,r=0;for(let s=0;s<t.length;s++){let o=t[s];o==="("&&n++,o===")"&&n--,o===","&&n===0&&(e.push(t.slice(r,s).trim()),r=s+1)}return e.push(t.slice(r).trim()),e}function it(t,{fast:e=!1}={}){if(e)return t();"requestIdleCallback"in window?requestIdleCallback(t,{timeout:50}):setTimeout(t,1)}function Y(){let t=typeof navigator!="undefined"&&navigator.userAgent?navigator.userAgent:"",e=/^((?!chrome|android).)*safari/i.test(t),n=/AppleWebKit/i.test(t)&&/Mobile/i.test(t)&&!/Safari/i.test(t),r=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(t);return e||n||r}var Me=new WeakMap,oe=new Map,se=0;function vt(){se++}var ve=!1;function Tn(t=document.documentElement){var e,n;if(!ve){ve=!0;try{new MutationObserver(()=>vt()).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(r){}try{new MutationObserver(()=>vt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch(r){}try{let r=document.fonts;r&&((e=r.addEventListener)==null||e.call(r,"loadingdone",vt),(n=r.ready)==null||n.then(()=>vt()).catch(()=>{}))}catch(r){}}}function _n(t,e={}){let n={},r=t.getPropertyValue("visibility");for(let s=0;s<t.length;s++){let o=t[s],a=t.getPropertyValue(o);(o==="background-image"||o==="content")&&a.includes("url(")&&!a.includes("data:")&&(a="none"),n[o]=a}if(e.embedFonts){let s=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let o of s)if(!n[o])try{let a=t.getPropertyValue(o);a&&(n[o]=a)}catch(a){}}return r==="hidden"&&(n.opacity="0"),n}var $e=new WeakMap;function Wn(t){let e=$e.get(t);return e||(e=Object.entries(t).sort((r,s)=>r[0]<s[0]?-1:r[0]>s[0]?1:0).map(([r,s])=>`${r}:${s}`).join(";"),$e.set(t,e),e)}function Un(t,e=null,n={}){let r=Me.get(t);if(r&&r.epoch===se)return r.snapshot;let s=e||getComputedStyle(t),o=_n(s,n);return jn(t,s,o),Me.set(t,{epoch:se,snapshot:o}),o}function On(t,e){return t&&t.session&&t.persist?t:t&&(t.styleMap||t.styleCache||t.nodeMap)?{session:t,persist:{snapshotKeyCache:oe,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:e||{}}:{session:x.session,persist:{snapshotKeyCache:oe,defaultStyle:x.defaultStyle,baseStyle:x.baseStyle,image:x.image,resource:x.resource,background:x.background,font:x.font},options:t||e||{}}}function yt(t,e,n,r){return A(this,null,function*(){var m,d,g;if(t.tagName==="STYLE")return;let s=On(n,r),o=s.options&&s.options.cache||"auto";if(o!=="disabled"&&Tn(document.documentElement),o==="disabled"&&!s.session.__bumpedForDisabled&&(vt(),oe.clear(),s.session.__bumpedForDisabled=!0),St.has((m=t.tagName)==null?void 0:m.toLowerCase())){let i=(d=t.getAttribute)==null?void 0:d.call(t,"style");i&&e.setAttribute("style",i)}let{session:a,persist:u}=s;a.styleCache.has(t)||a.styleCache.set(t,getComputedStyle(t));let l=a.styleCache.get(t),c=Un(t,l,s.options),p=Wn(c),f=u.snapshotKeyCache.get(p);if(!f){let i=((g=t.tagName)==null?void 0:g.toLowerCase())||"div";f=Ct(c,i),u.snapshotKeyCache.set(p,f)}a.styleMap.set(e,f)})}function Bn(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof HTMLIFrameElement||t instanceof SVGElement||t instanceof HTMLObjectElement||t instanceof HTMLEmbedElement}function Dn(t){return t.backgroundImage&&t.backgroundImage!=="none"||t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"||(parseFloat(t.borderTopWidth)||0)>0||(parseFloat(t.borderBottomWidth)||0)>0||(parseFloat(t.paddingTop)||0)>0||(parseFloat(t.paddingBottom)||0)>0?!0:(t.overflowBlock||t.overflowY||"visible")!=="visible"}function Hn(t){let e=t.parentElement;if(!e)return!1;let n=getComputedStyle(e).display||"";return n.includes("flex")||n.includes("grid")}function qn(t,e){if(t.textContent&&/\S/.test(t.textContent))return!0;let n=t.firstElementChild,r=t.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let s=t.scrollHeight;if(s===0)return!1;let o=parseFloat(e.paddingTop)||0,a=parseFloat(e.paddingBottom)||0;return s>o+a}function jn(t,e,n){if(t instanceof HTMLElement&&t.style&&t.style.height)return;let r=e.display||"";if(r.includes("flex")||r.includes("grid")||Bn(t))return;let s=e.position;s==="absolute"||s==="fixed"||s==="sticky"||e.transform==="none"&&(Dn(e)||Hn(t)||qn(t,e)&&(delete n.height,delete n["block-size"]))}var Fe=["fill","stroke","color","background-color","stop-color"],Ee=new Map;function Vn(t,e){let n=e+"::"+t.toLowerCase(),r=Ee.get(n);if(r)return r;let s=document,o=e==="http://www.w3.org/2000/svg"?s.createElementNS(e,t):s.createElement(t),a=s.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(o),s.documentElement.appendChild(a);let u=getComputedStyle(o),l={};for(let c of Fe)l[c]=u.getPropertyValue(c)||"";return a.remove(),Ee.set(n,l),l}function Le(t,e){var o,a,u;if(!(t instanceof Element)||!(e instanceof Element))return;let n=(o=t.getAttribute)==null?void 0:o.call(t,"style"),r=!!(n&&n.includes("var("));if(!r&&((a=t.attributes)!=null&&a.length)){let l=t.attributes;for(let c=0;c<l.length;c++){let p=l[c];if(p&&typeof p.value=="string"&&p.value.includes("var(")){r=!0;break}}}let s=null;if(r)try{s=getComputedStyle(t)}catch(l){}if(r){let l=t.style;if(l&&l.length)for(let c=0;c<l.length;c++){let p=l[c],f=l.getPropertyValue(p);if(!f||!f.includes("var("))continue;let m=s&&s.getPropertyValue(p);if(m)try{e.style.setProperty(p,m.trim(),l.getPropertyPriority(p))}catch(d){}}}if(r&&((u=t.attributes)!=null&&u.length)){let l=t.attributes;for(let c=0;c<l.length;c++){let p=l[c];if(!p||typeof p.value!="string"||!p.value.includes("var("))continue;let f=p.name,m=s&&s.getPropertyValue(f);if(m)try{e.style.setProperty(f,m.trim())}catch(d){}}}if(!r){if(!s)try{s=getComputedStyle(t)}catch(p){s=null}if(!s)return;let l=t.namespaceURI||"html",c=Vn(t.tagName,l);for(let p of Fe){let f=s.getPropertyValue(p)||"",m=c[p]||"";if(f&&f!==m)try{e.style.setProperty(p,f.trim())}catch(d){}}}}function ae(t,e,n){return Promise.all(t.map(r=>new Promise(s=>{function o(){it(a=>{(a&&typeof a.timeRemaining=="function"?a.timeRemaining()>0:!0)?e(r,s):o()},{fast:n})}o()})))}function zn(t){return t=t.trim(),!t||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t)?t:`${t}:not([data-sd-slotted])`}function Xn(t,e,n=!0){return t.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let s=n?zn(r):r;return`:where(${e} ${s})`}).join(", ")}function Yn(t,e){return t?(t=t.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${e}:is(${r.trim()}))`),t=t.replace(/:host\b/g,`:where(${e})`),t=t.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${e})`),t=t.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${e} ${r.trim()})`),t=t.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,s,o)=>{let a=Xn(o,e,!0);return`${r}${s}${a}{`}),t):""}function Gn(t){return t.shadowScopeSeq=(t.shadowScopeSeq||0)+1,`s${t.shadowScopeSeq}`}function Kn(t){let e="";try{t.querySelectorAll("style").forEach(r=>{e+=(r.textContent||"")+`
3
3
  `});let n=t.adoptedStyleSheets||[];for(let r of n)try{if(r&&r.cssRules)for(let s of r.cssRules)e+=s.cssText+`
4
- `}catch(s){}}catch(n){}return e}function Kn(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function Jn(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch(n){}}function Qn(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function Zn(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch(n){}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch(n){}return""}function tr(t,e,n){let r=[];for(let s of e){let o=Zn(t,s);o&&r.push(`${s}: ${o};`)}return r.length?`${n}{${r.join("")}}
5
- `:""}function er(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}function nr(t,e=3){return v(this,null,function*(){let n=()=>{var o;try{return t.contentDocument||((o=t.contentWindow)==null?void 0:o.document)||null}catch(a){return null}},r=n(),s=0;for(;s<e&&(!r||!r.body&&!r.documentElement);)yield new Promise(o=>setTimeout(o,0)),r=n(),s++;return r&&(r.body||r.documentElement)?r:null})}function rr(t){let e=t.getBoundingClientRect(),n=0,r=0,s=0,o=0;try{let c=getComputedStyle(t);n=parseFloat(c.borderLeftWidth)||0,r=parseFloat(c.borderRightWidth)||0,s=parseFloat(c.borderTopWidth)||0,o=parseFloat(c.borderBottomWidth)||0}catch(c){}let a=Math.max(0,Math.round(e.width-(n+r))),u=Math.max(0,Math.round(e.height-(s+o)));return{contentWidth:a,contentHeight:u,rect:e}}function or(t,e,n){let r=t.createElement("style");return r.setAttribute("data-sd-iframe-pin",""),r.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(r),()=>{try{r.remove()}catch(s){}}}function sr(t,e,n){return v(this,null,function*(){let r=yield nr(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:s,contentHeight:o,rect:a}=rr(t),u=n==null?void 0:n.snap;if(!u||typeof u.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let c=W(E({},n),{scale:1}),l=or(r,s,o),p;try{p=yield u.toPng(r.documentElement,c)}finally{l()}p.style.display="block",p.style.width=`${s}px`,p.style.height=`${o}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),yt(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(a.width)}px`),f.style.height||(f.style.height=`${Math.round(a.height)}px`),f.appendChild(p),f})}function $t(t,e,n){return v(this,null,function*(){var l,p,f,h,m,g;if(!t)throw new Error("Invalid node");let r=new Set,s=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let i=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||Tt.has(i))return null}if(t.nodeType===Node.TEXT_NODE||t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let i=document.createElement("div"),d=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${d.width}px;height:${d.height}px;visibility:hidden;`,i}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let i of n.exclude)try{if((l=t.matches)!=null&&l.call(t,i)){if(n.excludeMode==="hide"){let d=document.createElement("div"),y=t.getBoundingClientRect();return d.style.cssText=`display:inline-block;width:${y.width}px;height:${y.height}px;visibility:hidden;`,d}else if(n.excludeMode==="remove")return null}}catch(d){console.warn(`Invalid selector in exclude option: ${i}`,d)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let i=document.createElement("div"),d=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${d.width}px;height:${d.height}px;visibility:hidden;`,i}else if(n.filterMode==="remove")return null}}catch(i){console.warn("Error in filter function:",i)}if(t.tagName==="IFRAME"){let i=!1;try{i=!!(t.contentDocument||(p=t.contentWindow)!=null&&p.document)}catch(d){i=!1}if(i)try{return yield sr(t,e,n)}catch(d){console.warn("[SnapDOM] iframe rasterization failed, fallback:",d)}if(n.placeholders){let d=document.createElement("div");return d.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,yt(t,d,e,n),d}else{let d=t.getBoundingClientRect(),y=document.createElement("div");return y.style.cssText=`display:inline-block;width:${d.width}px;height:${d.height}px;visibility:hidden;`,yt(t,y,e,n),y}}if(t.getAttribute("data-capture")==="placeholder"){let i=t.cloneNode(!1);e.nodeMap.set(i,t),yt(t,i,e,n);let d=document.createElement("div");return d.textContent=t.getAttribute("data-placeholder-text")||"",d.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",i.appendChild(d),i}if(t.tagName==="CANVAS"){let i="";try{let y=t.getContext("2d",{willReadFrequently:!0});try{y&&y.getImageData(0,0,1,1)}catch(b){}if(yield new Promise(b=>requestAnimationFrame(b)),i=t.toDataURL("image/png"),!i||i==="data:,"){try{y&&y.getImageData(0,0,1,1)}catch(b){}if(yield new Promise(b=>requestAnimationFrame(b)),i=t.toDataURL("image/png"),!i||i==="data:,"){let b=document.createElement("canvas");b.width=t.width,b.height=t.height;let x=b.getContext("2d");x&&(x.drawImage(t,0,0),i=b.toDataURL("image/png"))}}}catch(y){}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch(y){}i&&(d.src=i),d.width=t.width,d.height=t.height;try{let y=getComputedStyle(t);y.width&&(d.style.width=y.width),y.height&&(d.style.height=y.height)}catch(y){}return e.nodeMap.set(d,t),yt(t,d,e,n),d}let a;try{if(a=t.cloneNode(!1),Re(t,a),e.nodeMap.set(a,t),t.tagName==="IMG"){Jn(t,a);try{let i=t.getBoundingClientRect(),d=Math.round(i.width||0),y=Math.round(i.height||0);if(!d||!y){let b=window.getComputedStyle(t),x=parseFloat(b.width)||0,M=parseFloat(b.height)||0,C=parseInt(t.getAttribute("width")||"",10)||0,w=parseInt(t.getAttribute("height")||"",10)||0,F=t.width||t.naturalWidth||0,k=t.height||t.naturalHeight||0;d=Math.round(d||x||C||F||0),y=Math.round(y||M||w||k||0)}d&&(a.dataset.snapdomWidth=String(d)),y&&(a.dataset.snapdomHeight=String(y))}catch(i){}}}catch(i){throw console.error("[Snapdom] Failed to clone node:",t,i),i}if(t instanceof HTMLTextAreaElement){let i=t.getBoundingClientRect();a.style.width=`${i.width}px`,a.style.height=`${i.height}px`}if(t instanceof HTMLInputElement&&(a.value=t.value,a.setAttribute("value",t.value),t.checked!==void 0&&(a.checked=t.checked,t.checked&&a.setAttribute("checked",""),t.indeterminate&&(a.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(s=t.value),t instanceof HTMLTextAreaElement&&(o=t.value),yt(t,a,e,n),t.shadowRoot){let w=function(k,N){if(k.nodeType===Node.ELEMENT_NODE&&k.tagName==="STYLE")return N(null);$t(k,e,n).then(R=>{N(R||null)}).catch(()=>{N(null)})};try{let k=t.shadowRoot.querySelectorAll("slot");for(let N of k){let R=[];try{R=((f=N.assignedNodes)==null?void 0:f.call(N,{flatten:!0}))||((h=N.assignedNodes)==null?void 0:h.call(N))||[]}catch(U){R=((m=N.assignedNodes)==null?void 0:m.call(N))||[]}for(let U of R)r.add(U)}}catch(k){}let i=Yn(e),d=`[data-sd="${i}"]`;try{a.setAttribute("data-sd",i)}catch(k){}let y=Gn(t.shadowRoot),b=Xn(y,d),x=Qn(y),M=tr(t,x,d);Kn(a,M+b,i);let C=document.createDocumentFragment(),F=yield ae(Array.from(t.shadowRoot.childNodes),w,n.fast);C.append(...F.filter(k=>!!k)),a.appendChild(C)}if(t.tagName==="SLOT"){let b=function(M,C){$t(M,e,n).then(w=>{w&&er(w),C(w||null)}).catch(()=>{C(null)})},i=((g=t.assignedNodes)==null?void 0:g.call(t,{flatten:!0}))||[],d=i.length>0?i:Array.from(t.childNodes),y=document.createDocumentFragment(),x=yield ae(Array.from(d),b,n.fast);return y.append(...x.filter(M=>!!M)),y}function u(i,d){if(r.has(i))return d(null);$t(i,e,n).then(y=>{d(y||null)}).catch(()=>{d(null)})}let c=yield ae(Array.from(t.childNodes),u,n.fast);if(a.append(...c.filter(i=>!!i)),s!==null&&a instanceof HTMLSelectElement){a.value=s;for(let i of a.options)i.value===s?i.setAttribute("selected",""):i.removeAttribute("selected")}return o!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=o),a})}var ar=[/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],ie=[];function Le(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?ie.push(n):typeof n=="string"?ie.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function rt(t){let e=typeof t=="string"?t:"",n=[...ar,...ie];for(let r of n)if(r instanceof RegExp&&r.test(e))return!0;return!!(/icon/i.test(e)||/glyph/i.test(e)||/symbols/i.test(e)||/feather/i.test(e)||/fontawesome/i.test(e))}function Pe(t,e,n,r=32,s="#000"){return v(this,null,function*(){e=e.replace(/^['"]+|['"]+$/g,"");let o=window.devicePixelRatio||1;try{yield document.fonts.ready}catch(h){}let a=document.createElement("span");a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let u=a.getBoundingClientRect(),c=Math.ceil(u.width),l=Math.ceil(u.height);document.body.removeChild(a);let p=document.createElement("canvas");p.width=Math.max(1,c*o),p.height=Math.max(1,l*o);let f=p.getContext("2d");return f.scale(o,o),f.font=n?`${n} ${r}px "${e}"`:`${r}px "${e}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=s,f.fillText(t,0,0),{dataUrl:p.toDataURL(),width:c,height:l}})}var ir=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Bt(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!ir.has(n.toLowerCase()))return n}return""}function Ut(t){let e=String(t!=null?t:"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function ce(t){let e=String(t!=null?t:"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function cr(t){let e=String(t!=null?t:"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function lr(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let s=Ut(n[1]),o=Ut(n[2]);return{min:Math.min(s,o),max:Math.max(s,o)}}let r=Ut(e);return{min:r,max:r}}function ur(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function fr(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(o,a),max:Math.max(o,a)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),s=r?parseFloat(r[1]):100;return{min:s,max:s}}function dr(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let s=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(u=>s.endsWith(u)))return!0;let a=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a))return!0;for(let u of e){let c=u.toLowerCase().replace(/\s+/g,"+"),l=u.toLowerCase().replace(/\s+/g,"-");if(a.includes(c)||a.includes(l))return!0}return!1}catch(n){return!1}}function mr(t){var n;let e=new Set;for(let r of t||[]){let s=(n=String(r).split("__")[0])==null?void 0:n.trim();s&&e.add(s)}return e}function Ne(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,s)=>{let o=(s||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let a=o;try{a=new URL(o,e||location.href).href}catch(u){}return`url("${a}")`})}var le=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Ot=4;function hr(t,e,n){return v(this,null,function*(){if(!t)return t;let r=new Set;function s(u,c){try{return new URL(u,c||location.href).href}catch(l){return u}}function o(u,c,l=0){return v(this,null,function*(){if(l>Ot)return console.warn(`[snapDOM] @import depth exceeded (${Ot}) at ${c}`),u;let p="",f=0,h;for(;h=le.exec(u);){p+=u.slice(f,h.index),f=le.lastIndex;let m=(h[2]||h[4]||"").trim(),g=s(m,c);if(r.has(g)){console.warn(`[snapDOM] Skipping circular @import: ${g}`);continue}r.add(g);let i="";try{let d=yield X(g,{as:"text",useProxy:n,silent:!0});d.ok&&typeof d.data=="string"&&(i=d.data)}catch(d){}i?(i=Ne(i,g),i=yield o(i,g,l+1),p+=`
4
+ `}catch(s){}}catch(n){}return e}function Jn(t,e,n){if(!e)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=e,t.insertBefore(r,t.firstChild||null)}function Qn(t,e){try{let n=t.currentSrc||t.src||"";if(!n)return;e.setAttribute("src",n),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.loading="eager",e.decoding="sync"}catch(n){}}function Zn(t){let e=new Set;if(!t)return e;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(t);)e.add(r[1]);return e}function tr(t,e){try{let r=getComputedStyle(t).getPropertyValue(e).trim();if(r)return r}catch(n){}try{let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(r)return r}catch(n){}return""}function er(t,e,n){let r=[];for(let s of e){let o=tr(t,s);o&&r.push(`${s}: ${o};`)}return r.length?`${n}{${r.join("")}}
5
+ `:""}function nr(t){t&&(t.nodeType===Node.ELEMENT_NODE&&t.setAttribute("data-sd-slotted",""),t.querySelectorAll&&t.querySelectorAll("*").forEach(e=>e.setAttribute("data-sd-slotted","")))}function rr(t,e=3){return A(this,null,function*(){let n=()=>{var o;try{return t.contentDocument||((o=t.contentWindow)==null?void 0:o.document)||null}catch(a){return null}},r=n(),s=0;for(;s<e&&(!r||!r.body&&!r.documentElement);)yield new Promise(o=>setTimeout(o,0)),r=n(),s++;return r&&(r.body||r.documentElement)?r:null})}function or(t){let e=t.getBoundingClientRect(),n=0,r=0,s=0,o=0;try{let l=getComputedStyle(t);n=parseFloat(l.borderLeftWidth)||0,r=parseFloat(l.borderRightWidth)||0,s=parseFloat(l.borderTopWidth)||0,o=parseFloat(l.borderBottomWidth)||0}catch(l){}let a=Math.max(0,Math.round(e.width-(n+r))),u=Math.max(0,Math.round(e.height-(s+o)));return{contentWidth:a,contentHeight:u,rect:e}}function sr(t,e,n){let r=t.createElement("style");return r.setAttribute("data-sd-iframe-pin",""),r.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${e}px !important;height: ${n}px !important;min-width: ${e}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(t.head||t.documentElement).appendChild(r),()=>{try{r.remove()}catch(s){}}}function ar(t,e,n){return A(this,null,function*(){let r=yield rr(t,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:s,contentHeight:o,rect:a}=or(t),u=n==null?void 0:n.snap;if(!u||typeof u.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let l=W(E({},n),{scale:1}),c=sr(r,s,o),p;try{p=yield u.toPng(r.documentElement,l)}finally{c()}p.style.display="block",p.style.width=`${s}px`,p.style.height=`${o}px`;let f=document.createElement("div");return e.nodeMap.set(f,t),yt(t,f,e,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(a.width)}px`),f.style.height||(f.style.height=`${Math.round(a.height)}px`),f.appendChild(p),f})}function $t(t,e,n){return A(this,null,function*(){var c,p,f,m,d,g;if(!t)throw new Error("Invalid node");let r=new Set,s=null,o=null;if(t.nodeType===Node.ELEMENT_NODE){let i=(t.localName||t.tagName||"").toLowerCase();if(t.id==="snapdom-sandbox"||t.hasAttribute("data-snapdom-sandbox")||_t.has(i))return null}if(t.nodeType===Node.TEXT_NODE||t.nodeType!==Node.ELEMENT_NODE)return t.cloneNode(!0);if(t.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let i=document.createElement("div"),h=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${h.width}px;height:${h.height}px;visibility:hidden;`,i}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let i of n.exclude)try{if((c=t.matches)!=null&&c.call(t,i)){if(n.excludeMode==="hide"){let h=document.createElement("div"),y=t.getBoundingClientRect();return h.style.cssText=`display:inline-block;width:${y.width}px;height:${y.height}px;visibility:hidden;`,h}else if(n.excludeMode==="remove")return null}}catch(h){console.warn(`Invalid selector in exclude option: ${i}`,h)}if(typeof n.filter=="function")try{if(!n.filter(t)){if(n.filterMode==="hide"){let i=document.createElement("div"),h=t.getBoundingClientRect();return i.style.cssText=`display:inline-block;width:${h.width}px;height:${h.height}px;visibility:hidden;`,i}else if(n.filterMode==="remove")return null}}catch(i){console.warn("Error in filter function:",i)}if(t.tagName==="IFRAME"){let i=!1;try{i=!!(t.contentDocument||(p=t.contentWindow)!=null&&p.document)}catch(h){i=!1}if(i)try{return yield ar(t,e,n)}catch(h){console.warn("[SnapDOM] iframe rasterization failed, fallback:",h)}if(n.placeholders){let h=document.createElement("div");return h.style.cssText=`width:${t.offsetWidth}px;height:${t.offsetHeight}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,yt(t,h,e,n),h}else{let h=t.getBoundingClientRect(),y=document.createElement("div");return y.style.cssText=`display:inline-block;width:${h.width}px;height:${h.height}px;visibility:hidden;`,yt(t,y,e,n),y}}if(t.getAttribute("data-capture")==="placeholder"){let i=t.cloneNode(!1);e.nodeMap.set(i,t),yt(t,i,e,n);let h=document.createElement("div");return h.textContent=t.getAttribute("data-placeholder-text")||"",h.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",i.appendChild(h),i}if(t.tagName==="CANVAS"){let i="";try{let y=t.getContext("2d",{willReadFrequently:!0});try{y&&y.getImageData(0,0,1,1)}catch(b){}if(yield new Promise(b=>requestAnimationFrame(b)),i=t.toDataURL("image/png"),!i||i==="data:,"){try{y&&y.getImageData(0,0,1,1)}catch(b){}if(yield new Promise(b=>requestAnimationFrame(b)),i=t.toDataURL("image/png"),!i||i==="data:,"){let b=document.createElement("canvas");b.width=t.width,b.height=t.height;let S=b.getContext("2d");S&&(S.drawImage(t,0,0),i=b.toDataURL("image/png"))}}}catch(y){}let h=document.createElement("img");try{h.decoding="sync",h.loading="eager"}catch(y){}i&&(h.src=i),h.width=t.width,h.height=t.height;try{let y=getComputedStyle(t);y.width&&(h.style.width=y.width),y.height&&(h.style.height=y.height)}catch(y){}return e.nodeMap.set(h,t),yt(t,h,e,n),h}let a;try{if(a=t.cloneNode(!1),Le(t,a),e.nodeMap.set(a,t),t.tagName==="IMG"){Qn(t,a);try{let i=t.getBoundingClientRect(),h=Math.round(i.width||0),y=Math.round(i.height||0);if(!h||!y){let b=window.getComputedStyle(t),S=parseFloat(b.width)||0,v=parseFloat(b.height)||0,C=parseInt(t.getAttribute("width")||"",10)||0,w=parseInt(t.getAttribute("height")||"",10)||0,F=t.width||t.naturalWidth||0,k=t.height||t.naturalHeight||0;h=Math.round(h||S||C||F||0),y=Math.round(y||v||w||k||0)}h&&(a.dataset.snapdomWidth=String(h)),y&&(a.dataset.snapdomHeight=String(y))}catch(i){}}}catch(i){throw console.error("[Snapdom] Failed to clone node:",t,i),i}if(t instanceof HTMLTextAreaElement){let i=t.getBoundingClientRect();a.style.width=`${i.width}px`,a.style.height=`${i.height}px`}if(t instanceof HTMLInputElement&&(a.value=t.value,a.setAttribute("value",t.value),t.checked!==void 0&&(a.checked=t.checked,t.checked&&a.setAttribute("checked",""),t.indeterminate&&(a.indeterminate=t.indeterminate))),t instanceof HTMLSelectElement&&(s=t.value),t instanceof HTMLTextAreaElement&&(o=t.value),yt(t,a,e,n),t.shadowRoot){let w=function(k,I){if(k.nodeType===Node.ELEMENT_NODE&&k.tagName==="STYLE")return I(null);$t(k,e,n).then(L=>{I(L||null)}).catch(()=>{I(null)})};try{let k=t.shadowRoot.querySelectorAll("slot");for(let I of k){let L=[];try{L=((f=I.assignedNodes)==null?void 0:f.call(I,{flatten:!0}))||((m=I.assignedNodes)==null?void 0:m.call(I))||[]}catch(U){L=((d=I.assignedNodes)==null?void 0:d.call(I))||[]}for(let U of L)r.add(U)}}catch(k){}let i=Gn(e),h=`[data-sd="${i}"]`;try{a.setAttribute("data-sd",i)}catch(k){}let y=Kn(t.shadowRoot),b=Yn(y,h),S=Zn(y),v=er(t,S,h);Jn(a,v+b,i);let C=document.createDocumentFragment(),F=yield ae(Array.from(t.shadowRoot.childNodes),w,n.fast);C.append(...F.filter(k=>!!k)),a.appendChild(C)}if(t.tagName==="SLOT"){let b=function(v,C){$t(v,e,n).then(w=>{w&&nr(w),C(w||null)}).catch(()=>{C(null)})},i=((g=t.assignedNodes)==null?void 0:g.call(t,{flatten:!0}))||[],h=i.length>0?i:Array.from(t.childNodes),y=document.createDocumentFragment(),S=yield ae(Array.from(h),b,n.fast);return y.append(...S.filter(v=>!!v)),y}function u(i,h){if(r.has(i))return h(null);$t(i,e,n).then(y=>{h(y||null)}).catch(()=>{h(null)})}let l=yield ae(Array.from(t.childNodes),u,n.fast);if(a.append(...l.filter(i=>!!i)),s!==null&&a instanceof HTMLSelectElement){a.value=s;for(let i of a.options)i.value===s?i.setAttribute("selected",""):i.removeAttribute("selected")}return o!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=o),a})}var ir=[/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],ie=[];function Re(t){let e=Array.isArray(t)?t:[t];for(let n of e)n instanceof RegExp?ie.push(n):typeof n=="string"?ie.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function rt(t){let e=typeof t=="string"?t:"",n=[...ir,...ie];for(let r of n)if(r instanceof RegExp&&r.test(e))return!0;return!!(/icon/i.test(e)||/glyph/i.test(e)||/symbols/i.test(e)||/feather/i.test(e)||/fontawesome/i.test(e))}function cr(t=""){let e=String(t).toLowerCase();return/\bmaterial\s*icons\b/.test(e)||/\bmaterial\s*symbols\b/.test(e)}function lr(t="Material Icons",e=24){return A(this,null,function*(){try{yield Promise.all([document.fonts.load(`400 ${e}px "${t.replace(/["']/g,"")}"`),document.fonts.ready])}catch(n){}})}function ur(t){var s,o;let e=((s=t.getPropertyValue("-webkit-text-fill-color"))==null?void 0:s.trim())||"",n=/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e);if(e&&!n&&e.toLowerCase()!=="currentcolor")return e;let r=(o=t.color)==null?void 0:o.trim();return r&&r!=="inherit"?r:"#000"}function fr(a){return A(this,arguments,function*(t,{family:e="Material Icons",weight:n="normal",fontSize:r=32,color:s="#000",variation:o=""}={}){let u=String(e||"").replace(/^['"]+|['"]+$/g,""),l=window.devicePixelRatio||1;yield lr(u,r);let c=document.createElement("span");c.textContent=t,c.style.position="absolute",c.style.visibility="hidden",c.style.left="-99999px",c.style.whiteSpace="nowrap",c.style.fontFamily=`"${u}"`,c.style.fontWeight=String(n||"normal"),c.style.fontSize=`${r}px`,c.style.lineHeight="1",c.style.margin="0",c.style.padding="0",c.style.fontFeatureSettings="'liga' 1",c.style.fontVariantLigatures="normal",o&&(c.style.fontVariationSettings=o),c.style.color=s,document.body.appendChild(c);let p=c.getBoundingClientRect(),f=Math.max(1,Math.ceil(p.width)),m=Math.max(1,Math.ceil(p.height));document.body.removeChild(c);let d=document.createElement("canvas");d.width=f*l,d.height=m*l;let g=d.getContext("2d");g.scale(l,l),g.font=`${n?`${n} `:""}${r}px "${u}"`,g.textAlign="left",g.textBaseline="top",g.fillStyle=s;try{g.fontKerning="normal"}catch(i){}return g.fillText(t,0,0),{dataUrl:d.toDataURL(),width:f,height:m}})}function Ie(t,e){return A(this,null,function*(){if(!(t instanceof Element))return 0;let n='.material-icons, [class*="material-symbols"]',r=Array.from(t.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim());if(r.length===0)return 0;let s=e instanceof Element?Array.from(e.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],o=0;for(let a=0;a<r.length;a++){let u=r[a],l=s[a]||null;try{let c=getComputedStyle(l||u),p=c.fontFamily||"Material Icons";if(!cr(p))continue;let f=(l||u).textContent.trim();if(!f)continue;let m=parseInt(c.fontSize,10)||24,d=c.fontWeight&&c.fontWeight!=="normal"?c.fontWeight:"normal",g=ur(c),i=c.fontVariationSettings&&c.fontVariationSettings!=="normal"?c.fontVariationSettings:"",{dataUrl:h,width:y,height:b}=yield fr(f,{family:p,weight:d,fontSize:m,color:g,variation:i});u.textContent="";let S=u.ownerDocument.createElement("img");S.src=h,S.alt=f,S.style.height=`${m}px`,S.style.width=`${Math.max(1,Math.round(y/b*m))}px`,S.style.objectFit="contain",S.style.verticalAlign=getComputedStyle(u).verticalAlign||"baseline",u.appendChild(S),o++}catch(c){}}return o})}function Te(t,e,n,r=32,s="#000"){return A(this,null,function*(){e=e.replace(/^['"]+|['"]+$/g,"");let o=window.devicePixelRatio||1;try{yield document.fonts.ready}catch(m){}let a=document.createElement("span");a.textContent=t,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${e}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let u=a.getBoundingClientRect(),l=Math.ceil(u.width),c=Math.ceil(u.height);document.body.removeChild(a);let p=document.createElement("canvas");p.width=Math.max(1,l*o),p.height=Math.max(1,c*o);let f=p.getContext("2d");return f.scale(o,o),f.font=n?`${n} ${r}px "${e}"`:`${r}px "${e}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=s,f.fillText(t,0,0),{dataUrl:p.toDataURL(),width:l,height:c}})}var dr=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Bt(t){if(!t)return"";for(let e of t.split(",")){let n=e.trim().replace(/^['"]+|['"]+$/g,"");if(n&&!dr.has(n.toLowerCase()))return n}return""}function Ut(t){let e=String(t!=null?t:"400").trim().toLowerCase();if(e==="normal")return 400;if(e==="bold")return 700;let n=parseInt(e,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function ce(t){let e=String(t!=null?t:"normal").trim().toLowerCase();return e.startsWith("italic")?"italic":e.startsWith("oblique")?"oblique":"normal"}function mr(t){let e=String(t!=null?t:"100%").match(/(\d+(?:\.\d+)?)\s*%/);return e?Math.max(50,Math.min(200,parseFloat(e[1]))):100}function hr(t){let e=String(t||"400").trim(),n=e.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let s=Ut(n[1]),o=Ut(n[2]);return{min:Math.min(s,o),max:Math.max(s,o)}}let r=Ut(e);return{min:r,max:r}}function pr(t){let e=String(t||"normal").trim().toLowerCase();return e==="italic"?{kind:"italic"}:e.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function gr(t){let e=String(t||"100%").trim(),n=e.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let o=parseFloat(n[1]),a=parseFloat(n[2]);return{min:Math.min(o,a),max:Math.max(o,a)}}let r=e.match(/(\d+(?:\.\d+)?)\s*%/),s=r?parseFloat(r[1]):100;return{min:s,max:s}}function yr(t,e){if(!t)return!1;try{let n=new URL(t,location.href);if(n.origin===location.origin)return!0;let s=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(u=>s.endsWith(u)))return!0;let a=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a))return!0;for(let u of e){let l=u.toLowerCase().replace(/\s+/g,"+"),c=u.toLowerCase().replace(/\s+/g,"-");if(a.includes(l)||a.includes(c))return!0}return!1}catch(n){return!1}}function wr(t){var n;let e=new Set;for(let r of t||[]){let s=(n=String(r).split("__")[0])==null?void 0:n.trim();s&&e.add(s)}return e}function Ne(t,e){return t&&t.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,s)=>{let o=(s||"").trim();if(!o||/^data:|^blob:|^https?:|^file:|^about:/i.test(o))return n;let a=o;try{a=new URL(o,e||location.href).href}catch(u){}return`url("${a}")`})}var le=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Ot=4;function br(t,e,n){return A(this,null,function*(){if(!t)return t;let r=new Set;function s(u,l){try{return new URL(u,l||location.href).href}catch(c){return u}}function o(u,l,c=0){return A(this,null,function*(){if(c>Ot)return console.warn(`[snapDOM] @import depth exceeded (${Ot}) at ${l}`),u;let p="",f=0,m;for(;m=le.exec(u);){p+=u.slice(f,m.index),f=le.lastIndex;let d=(m[2]||m[4]||"").trim(),g=s(d,l);if(r.has(g)){console.warn(`[snapDOM] Skipping circular @import: ${g}`);continue}r.add(g);let i="";try{let h=yield X(g,{as:"text",useProxy:n,silent:!0});h.ok&&typeof h.data=="string"&&(i=h.data)}catch(h){}i?(i=Ne(i,g),i=yield o(i,g,c+1),p+=`
6
6
  /* inlined: ${g} */
7
7
  ${i}
8
- `):p+=h[0]}return p+=u.slice(f),p})}let a=Ne(t,e||location.href);return a=yield o(a,e||location.href,0),a})}var _e=/url\((["']?)([^"')]+)\1\)/g,pr=/@font-face[^{}]*\{[^}]*\}/g;function Te(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let s=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!s)continue;let o=s[1],a=s[2],u=c=>{if(!c.includes("?"))return parseInt(c,16);let l=parseInt(c.replace(/\?/g,"0"),16),p=parseInt(c.replace(/\?/g,"F"),16);return[l,p]};if(a){let c=u(o),l=u(a),p=Array.isArray(c)?c[0]:c,f=Array.isArray(l)?l[1]:l;e.push([Math.min(p,f),Math.max(p,f)])}else{let c=u(o);Array.isArray(c)?e.push([c[0],c[1]]):e.push([c,c])}}return e}function We(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,s]of e)if(n>=r&&n<=s)return!0;return!1}function ue(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(_e)){let s=(r[2]||"").trim();if(!(!s||s.startsWith("data:"))){if(!/^https?:/i.test(s))try{s=new URL(s,e||location.href).href}catch(o){}n.push(s)}}return n}function Ue(t,e,n=""){return v(this,null,function*(){var s,o,a,u,c;let r=t;for(let l of t.matchAll(_e)){let p=mt(l[0]);if(!p)continue;let f=p;if(!f.startsWith("http")&&!f.startsWith("data:"))try{f=new URL(f,e||location.href).href}catch(h){}if(!rt(f)){if((s=S.resource)!=null&&s.has(f)){(o=S.font)==null||o.add(f),r=r.replace(l[0],`url(${S.resource.get(f)})`);continue}if(!((a=S.font)!=null&&a.has(f)))try{let h=yield X(f,{as:"dataURL",useProxy:n,silent:!0});if(h.ok&&typeof h.data=="string"){let m=h.data;(u=S.resource)==null||u.set(f,m),(c=S.font)==null||c.add(f),r=r.replace(l[0],`url(${m})`)}}catch(h){console.warn("[snapDOM] Failed to fetch font resource:",f)}}}return r})}function gr(t){if(!t.length)return null;let e=(u,c)=>t.some(([l,p])=>!(p<u||l>c)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),s=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":s?"greek":r?"latin-ext":n?"latin":null}function Ie(t={}){let e=new Set((t.families||[]).map(s=>String(s).toLowerCase())),n=new Set((t.domains||[]).map(s=>String(s).toLowerCase())),r=new Set((t.subsets||[]).map(s=>String(s).toLowerCase()));return(s,o)=>{if(e.size&&e.has(s.family.toLowerCase()))return!0;if(n.size)for(let a of s.srcUrls)try{if(n.has(new URL(a).host.toLowerCase()))return!0}catch(u){}if(r.size){let a=gr(o);if(a&&r.has(a))return!0}return!1}}function yr(t){var o,a,u,c,l,p;if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let f of t.match(e)||[]){let h=((o=f.match(/font-family:\s*([^;]+);/i))==null?void 0:o[1])||"",m=Bt(h),g=(((a=f.match(/font-weight:\s*([^;]+);/i))==null?void 0:a[1])||"400").trim(),i=(((u=f.match(/font-style:\s*([^;]+);/i))==null?void 0:u[1])||"normal").trim(),d=(((c=f.match(/font-stretch:\s*([^;]+);/i))==null?void 0:c[1])||"100%").trim(),y=(((l=f.match(/unicode-range:\s*([^;]+);/i))==null?void 0:l[1])||"").trim(),b=(((p=f.match(/src\s*:\s*([^;]+);/i))==null?void 0:p[1])||"").trim(),x=ue(b,location.href),M=x.length?x.map(w=>String(w).toLowerCase()).sort().join("|"):b.toLowerCase(),C=[String(m||"").toLowerCase(),g,i,d,y.toLowerCase(),M].join("|");n.has(C)||(n.add(C),r.push(f))}if(r.length===0)return t;let s=0;return t.replace(e,()=>r[s++]||"")}function wr(t,e,n,r){let s=Array.from(t||[]).sort().join("|"),o=e?JSON.stringify({families:(e.families||[]).map(c=>String(c).toLowerCase()).sort(),domains:(e.domains||[]).map(c=>String(c).toLowerCase()).sort(),subsets:(e.subsets||[]).map(c=>String(c).toLowerCase()).sort()}):"",a=(n||[]).map(c=>`${(c.family||"").toLowerCase()}::${c.weight||"normal"}::${c.style||"normal"}::${c.src||""}`).sort().join("|");return`fonts-embed-css::req=${s}::ex=${o}::lf=${a}::px=${r||""}`}function Oe(t,e,n,r){return v(this,null,function*(){let s;try{s=t.cssRules||[]}catch(a){return}let o=(a,u)=>{try{return new URL(a,u||location.href).href}catch(c){return a}};for(let a of s){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let u=a.href?o(a.href,e):e;if(r.depth>=Ot){console.warn(`[snapDOM] CSSOM import depth exceeded (${Ot}) at ${u}`);continue}if(u&&r.visitedSheets.has(u)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${u}`);continue}u&&r.visitedSheets.add(u);let c=W(E({},r),{depth:(r.depth||0)+1});yield Oe(a.styleSheet,u,n,c);continue}if(a.type===CSSRule.FONT_FACE_RULE){let u=(a.style.getPropertyValue("font-family")||"").trim(),c=Bt(u);if(!c||rt(c))continue;let l=(a.style.getPropertyValue("font-weight")||"400").trim(),p=(a.style.getPropertyValue("font-style")||"normal").trim(),f=(a.style.getPropertyValue("font-stretch")||"100%").trim(),h=(a.style.getPropertyValue("src")||"").trim(),m=(a.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(c,p,l,f))continue;let g=Te(m);if(!We(r.usedCodepoints,g))continue;let i={family:c,weightSpec:l,styleSpec:p,stretchSpec:f,unicodeRange:m,srcRaw:h,srcUrls:ue(h,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(i,g))continue;if(/url\(/i.test(h)){let d=yield Ue(h,e||location.href,r.useProxy);yield n(`@font-face{font-family:${c};src:${d};font-style:${p};font-weight:${l};font-stretch:${f};${m?`unicode-range:${m};`:""}}`)}else yield n(`@font-face{font-family:${c};src:${h};font-style:${p};font-weight:${l};font-stretch:${f};${m?`unicode-range:${m};`:""}}`)}}})}function Dt(){return v(this,arguments,function*({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:s=""}={}){var i,d,y,b,x,M,C,w,F,k,N,R,U,V,j,Q,Z,tt;t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let o=new Map;for(let $ of t){let[A,P,O,D]=String($).split("__");if(!A)continue;let T=o.get(A)||[];T.push({w:parseInt(P,10),s:O,st:parseInt(D,10)}),o.set(A,T)}function a($,A,P,O){if(!o.has($))return!1;let D=o.get($),T=lr(P),I=ur(A),_=fr(O),q=T.min!==T.max,z=T.min,G=H=>I.kind==="normal"&&H==="normal"||I.kind!=="normal"&&(H==="italic"||H==="oblique"),K=!1;for(let H of D){let J=q?H.w>=T.min&&H.w<=T.max:H.w===z,at=G(ce(H.s)),dt=H.st>=_.min&&H.st<=_.max;if(J&&at&&dt){K=!0;break}}if(K)return!0;if(!q)for(let H of D){let J=G(ce(H.s)),at=H.st>=_.min&&H.st<=_.max;if(Math.abs(z-H.w)<=300&&J&&at)return!0}return!1}let u=Ie(n),c=wr(t,n,r,s);if((i=S.resource)!=null&&i.has(c))return S.resource.get(c);let l=mr(t),p=[],f=le;for(let $ of document.querySelectorAll("style")){let A=$.textContent||"";for(let P of A.matchAll(f)){let O=(P[2]||P[4]||"").trim();if(!O||rt(O))continue;!!document.querySelector(`link[rel="stylesheet"][href="${O}"]`)||p.push(O)}}p.length&&(yield Promise.all(p.map($=>new Promise(A=>{if(document.querySelector(`link[rel="stylesheet"][href="${$}"]`))return A(null);let P=document.createElement("link");P.rel="stylesheet",P.href=$,P.setAttribute("data-snapdom","injected-import"),P.onload=()=>A(P),P.onerror=()=>A(null),document.head.appendChild(P)}))));let h="",m=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter($=>!!$.href);for(let $ of m)try{if(rt($.href))continue;let A="",P=!1;try{P=new URL($.href,location.href).origin===location.origin}catch(D){}if(!P&&!dr($.href,l))continue;if(P){let D=Array.from(document.styleSheets).find(T=>T.href===$.href);if(D)try{let T=D.cssRules||[];A=Array.from(T).map(I=>I.cssText).join("")}catch(T){}}if(!A&&(A=(yield X($.href,{as:"text",useProxy:s})).data,rt($.href)))continue;A=yield hr(A,$.href,s);let O="";for(let D of A.match(pr)||[]){let T=(((d=D.match(/font-family:\s*([^;]+);/i))==null?void 0:d[1])||"").trim(),I=Bt(T);if(!I||rt(I))continue;let _=(((y=D.match(/font-weight:\s*([^;]+);/i))==null?void 0:y[1])||"400").trim(),q=(((b=D.match(/font-style:\s*([^;]+);/i))==null?void 0:b[1])||"normal").trim(),z=(((x=D.match(/font-stretch:\s*([^;]+);/i))==null?void 0:x[1])||"100%").trim(),G=(((M=D.match(/unicode-range:\s*([^;]+);/i))==null?void 0:M[1])||"").trim(),K=(((C=D.match(/src\s*:\s*([^;]+);/i))==null?void 0:C[1])||"").trim(),H=ue(K,$.href);if(!a(I,q,_,z))continue;let J=Te(G);if(!We(e,J))continue;let at={family:I,weightSpec:_,styleSpec:q,stretchSpec:z,unicodeRange:G,srcRaw:K,srcUrls:H,href:$.href};if(n&&u(at,J))continue;let dt=/url\(/i.test(K)?yield Ue(D,$.href,s):D;O+=dt}O.trim()&&(h+=O)}catch(A){console.warn("[snapDOM] Failed to process stylesheet:",$.href)}let g={requiredIndex:o,usedCodepoints:e,faceMatchesRequired:a,simpleExcluder:n?Ie(n):null,useProxy:s,visitedSheets:new Set,depth:0};for(let $ of document.styleSheets)if(!($.href&&m.some(A=>A.href===$.href)))try{let A=$.href||location.href;A&&g.visitedSheets.add(A),yield Oe($,A,P=>v(null,null,function*(){h+=P}),g)}catch(A){}try{for(let $ of document.fonts||[]){if(!$||!$.family||$.status!=="loaded"||!$._snapdomSrc)continue;let A=String($.family).replace(/^['"]+|['"]+$/g,"");if(rt(A)||!o.has(A)||n!=null&&n.families&&n.families.some(O=>String(O).toLowerCase()===A.toLowerCase()))continue;let P=$._snapdomSrc;if(!String(P).startsWith("data:")){if((w=S.resource)!=null&&w.has($._snapdomSrc))P=S.resource.get($._snapdomSrc),(F=S.font)==null||F.add($._snapdomSrc);else if(!((k=S.font)!=null&&k.has($._snapdomSrc)))try{let O=yield X($._snapdomSrc,{as:"dataURL",useProxy:s,silent:!0});if(O.ok&&typeof O.data=="string")P=O.data,(N=S.resource)==null||N.set($._snapdomSrc,P),(R=S.font)==null||R.add($._snapdomSrc);else continue}catch(O){console.warn("[snapDOM] Failed to fetch dynamic font src:",$._snapdomSrc);continue}}h+=`@font-face{font-family:'${A}';src:url(${P});font-style:${$.style||"normal"};font-weight:${$.weight||"normal"};}`}}catch($){}for(let $ of r){if(!$||typeof $!="object")continue;let A=String($.family||"").replace(/^['"]+|['"]+$/g,"");if(!A||rt(A)||!o.has(A)||n!=null&&n.families&&n.families.some(_=>String(_).toLowerCase()===A.toLowerCase()))continue;let P=$.weight!=null?String($.weight):"normal",O=$.style!=null?String($.style):"normal",D=$.stretchPct!=null?`${$.stretchPct}%`:"100%",T=String($.src||""),I=T;if(!I.startsWith("data:")){if((U=S.resource)!=null&&U.has(T))I=S.resource.get(T),(V=S.font)==null||V.add(T);else if(!((j=S.font)!=null&&j.has(T)))try{let _=yield X(T,{as:"dataURL",useProxy:s,silent:!0});if(_.ok&&typeof _.data=="string")I=_.data,(Q=S.resource)==null||Q.set(T,I),(Z=S.font)==null||Z.add(T);else continue}catch(_){console.warn("[snapDOM] Failed to fetch localFonts src:",T);continue}}h+=`@font-face{font-family:'${A}';src:url(${I});font-style:${O};font-weight:${P};font-stretch:${D};}`}return h&&(h=yr(h),(tt=S.resource)==null||tt.set(c,h)),h})}function Ht(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),r=a=>{let u=Bt(a.fontFamily);if(!u)return;let c=(l,p,f)=>`${u}__${Ut(l)}__${ce(p)}__${cr(f)}`;e.add(c(a.fontWeight,a.fontStyle,a.fontStretch))};r(getComputedStyle(t));let s=getComputedStyle(t,"::before");s&&s.content&&s.content!=="none"&&r(s);let o=getComputedStyle(t,"::after");for(o&&o.content&&o.content!=="none"&&r(o);n.nextNode();){let a=n.currentNode,u=getComputedStyle(a);r(u);let c=getComputedStyle(a,"::before");c&&c.content&&c.content!=="none"&&r(c);let l=getComputedStyle(a,"::after");l&&l.content&&l.content!=="none"&&r(l)}return e}function qt(t){let e=new Set,n=s=>{if(s)for(let o of s)e.add(o.codePointAt(0))},r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let s=r.currentNode;if(s.nodeType===Node.TEXT_NODE)n(s.nodeValue||"");else if(s.nodeType===Node.ELEMENT_NODE){let o=s;for(let a of["::before","::after"]){let u=getComputedStyle(o,a),c=u==null?void 0:u.getPropertyValue("content");if(!(!c||c==="none"))if(/^"/.test(c)||/^'/.test(c))n(c.slice(1,-1));else{let l=c.match(/\\[0-9A-Fa-f]{1,6}/g);if(l)for(let p of l)try{e.add(parseInt(p.slice(1),16))}catch(f){}}}}}return e}function jt(t,e=2){return v(this,null,function*(){try{yield document.fonts.ready}catch(s){}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let s=document.createElement("div");s.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let o of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${o}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",s.appendChild(a)}document.body.appendChild(s),s.offsetWidth,document.body.removeChild(s)};for(let s=0;s<Math.max(1,e);s++)r(),yield new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o)))})}function qe(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function br(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function Be(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function De(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,t)),s="";for(let[o,a]of n)for(;r>=o;)s+=a,r-=o;return e?s:s.toLowerCase()}function He(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return Be(t,!1);case"upper-alpha":return Be(t,!0);case"lower-roman":return De(t,!1);case"upper-roman":return De(t,!0);default:return String(Math.max(0,t))}}function je(t){let e=()=>{var h,m,g;return(g=(m=(h=S)==null?void 0:h.session)==null?void 0:m.__counterEpoch)!=null?g:0},n=e(),r=new WeakMap,s=t instanceof Document?t.documentElement:t,o=h=>h&&h.tagName==="LI",a=h=>{let m=0,g=h==null?void 0:h.parentElement;if(!g)return 0;for(let i of g.children){if(i===h)break;i.tagName==="LI"&&m++}return m},u=h=>{let m=new Map;for(let[g,i]of h)m.set(g,i.slice());return m},c=(h,m,g)=>{var b,x;let i=u(h),d;try{d=((b=g.style)==null?void 0:b.counterReset)||getComputedStyle(g).counterReset}catch(M){}if(d&&d!=="none")for(let M of d.split(",")){let C=M.trim().split(/\s+/),w=C[0],F=Number.isFinite(Number(C[1]))?Number(C[1]):0;if(!w)continue;let k=m.get(w);if(k&&k.length){let N=k.slice();N.push(F),i.set(w,N)}else i.set(w,[F])}let y;try{y=((x=g.style)==null?void 0:x.counterIncrement)||getComputedStyle(g).counterIncrement}catch(M){}if(y&&y!=="none")for(let M of y.split(",")){let C=M.trim().split(/\s+/),w=C[0],F=Number.isFinite(Number(C[1]))?Number(C[1]):1;if(!w)continue;let k=i.get(w)||[];k.length===0&&k.push(0),k[k.length-1]+=F,i.set(w,k)}try{if(getComputedStyle(g).display==="list-item"&&o(g)){let C=g.parentElement,w=1;if(C&&C.tagName==="OL"){let k=C.getAttribute("start"),N=Number.isFinite(Number(k))?Number(k):1,R=a(g),U=g.getAttribute("value");w=Number.isFinite(Number(U))?Number(U):N+R}else w=1+a(g);let F=i.get("list-item")||[];F.length===0&&F.push(0),F[F.length-1]=w,i.set("list-item",F)}}catch(M){}return i},l=(h,m,g)=>{let i=c(g,m,h);r.set(h,i);let d=i;for(let y of h.children)d=l(y,i,d);return i},p=new Map;l(s,p,p);function f(){let h=e();if(h!==n){n=h;let m=new Map;l(s,m,m)}}return{get(h,m){var i;f();let g=(i=r.get(h))==null?void 0:i.get(m);return g&&g.length?g[g.length-1]:0},getStack(h,m){var i;f();let g=(i=r.get(h))==null?void 0:i.get(m);return g?g.slice():[]}}}function ze(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,s=t.replace(r,(o,a,u)=>{var l,p,f,h;let c=String(u).split(",").map(m=>m.trim());if(a==="counter"){let m=(l=c[0])==null?void 0:l.replace(/^["']|["']$/g,""),g=(c[1]||"decimal").toLowerCase(),i=n.get(e,m);return He(i,g)}else{let m=(p=c[0])==null?void 0:p.replace(/^["']|["']$/g,""),g=(h=(f=c[1])==null?void 0:f.replace(/^["']|["']$/g,""))!=null?h:"",i=(c[2]||"decimal").toLowerCase(),d=n.getStack(e,m);return d.length?d.map(b=>He(b,i)).join(g):""}});return br(s)}catch(r){return"- "}}var kt=new WeakMap,Ve=-1;function Sr(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function xr(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,r;for(;r=n.exec(t);)e.push(r[1]);return e.length?e.join(""):Sr(t)}function fe(t,e){let n=t.parentElement,r=n?kt.get(n):null;return r?{get(s,o){let a=e.get(s,o),u=r.get(o);return typeof u=="number"?Math.max(a,u):a},getStack(s,o){let a=e.getStack(s,o);if(!a.length)return a;let u=r.get(o);if(typeof u=="number"){let c=a.slice();return c[c.length-1]=Math.max(c[c.length-1],u),c}return a}}:e}function de(t,e,n){let r=new Map;function s(c){let l=[];if(!c||c==="none")return l;for(let p of String(c).split(",")){let f=p.trim().split(/\s+/),h=f[0],m=Number.isFinite(Number(f[1]))?Number(f[1]):void 0;h&&l.push({name:h,num:m})}return l}let o=s(e==null?void 0:e.counterReset),a=s(e==null?void 0:e.counterIncrement);function u(c){if(r.has(c))return r.get(c).slice();let l=n.getStack(t,c);l=l.length?l.slice():[];let p=o.find(h=>h.name===c);if(p){let h=Number.isFinite(p.num)?p.num:0;l=l.length?[...l,h]:[h]}let f=a.find(h=>h.name===c);if(f){let h=Number.isFinite(f.num)?f.num:1;l.length===0&&(l=[0]),l[l.length-1]+=h}return r.set(c,l.slice()),l}return{get(c,l){let p=u(l);return p.length?p[p.length-1]:0},getStack(c,l){return u(l)},__incs:a}}function Cr(t,e,n){let r;try{r=getComputedStyle(t,e)}catch(l){}let s=r==null?void 0:r.content;if(!s||s==="none"||s==="normal")return{text:"",incs:[]};let o=fe(t,n),a=de(t,r,o),u=qe(s)?ze(s,t,a):s;return{text:xr(u),incs:a.__incs||[]}}function me(t,e,n,r){return v(this,null,function*(){var c,l,p,f;if(!(t instanceof Element)||!(e instanceof Element))return;let s=(p=(l=(c=S)==null?void 0:c.session)==null?void 0:l.__counterEpoch)!=null?p:0;if(Ve!==s&&(kt=new WeakMap,n&&(n.__counterCtx=null),Ve=s),!n.__counterCtx)try{n.__counterCtx=je(t.ownerDocument||document)}catch(h){}let o=n.__counterCtx;for(let h of["::before","::after","::first-letter"])try{let m=gt(t,h);if(!m||typeof m[Symbol.iterator]!="function"||m.content==="none"&&m.backgroundImage==="none"&&m.backgroundColor==="transparent"&&(m.borderStyle==="none"||parseFloat(m.borderWidth)===0)&&(!m.transform||m.transform==="none")&&m.display==="inline")continue;if(h==="::first-letter"){let I=getComputedStyle(t);if(!(m.color!==I.color||m.fontSize!==I.fontSize||m.fontWeight!==I.fontWeight))continue;let q=Array.from(e.childNodes).find(nt=>{var Nt;return nt.nodeType===Node.TEXT_NODE&&((Nt=nt.textContent)==null?void 0:Nt.trim().length)>0});if(!q)continue;let z=q.textContent,G=z.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u),K=G==null?void 0:G[0],H=z.slice((K==null?void 0:K.length)||0);if(!K||/[\uD800-\uDFFF]/.test(K))continue;let J=document.createElement("span");J.textContent=K,J.dataset.snapdomPseudo="::first-letter";let at=Wt(m),dt=Ct(at,"span");n.styleMap.set(J,dt);let et=document.createTextNode(H);e.replaceChild(et,q),e.insertBefore(J,et);continue}let i=m.content,{text:d,incs:y}=Cr(t,h,o),b=m.backgroundImage,x=m.backgroundColor,M=m.fontFamily,C=parseInt(m.fontSize)||32,w=parseInt(m.fontWeight)||!1,F=m.color||"#000",k=m.borderStyle,N=parseFloat(m.borderWidth),R=m.transform,U=rt(M),V=i!=="none"&&d!=="",j=b&&b!=="none",Q=x&&x!=="transparent"&&x!=="rgba(0, 0, 0, 0)",Z=k&&k!=="none"&&N>0,tt=R&&R!=="none";if(!(V||j||Q||Z||tt)){if(y&&y.length&&t.parentElement){let I=kt.get(t.parentElement)||new Map;for(let{name:_}of y){if(!_)continue;let q=fe(t,o),G=de(t,getComputedStyle(t,h),q).get(t,_);I.set(_,G)}kt.set(t.parentElement,I)}continue}let A=document.createElement("span");A.dataset.snapdomPseudo=h,A.style.display="inline",A.style.verticalAlign="baseline",A.style.pointerEvents="none";let P=Wt(m),O=Ct(P,"span");if(n.styleMap.set(A,O),U&&d&&d.length===1){let{dataUrl:I,width:_,height:q}=yield Pe(d,M,w,C,F),z=document.createElement("img");z.src=I,z.style=`height:${C}px;width:${_/q*C}px;object-fit:contain;`,A.appendChild(z),e.dataset.snapdomHasIcon="true"}else if(d&&d.startsWith("url(")){let I=mt(d);if(I!=null&&I.trim())try{let _=document.createElement("img"),q=yield X(ut(I),{as:"dataURL",useProxy:r.useProxy});_.src=q.data,_.style=`width:${C}px;height:auto;object-fit:contain;`,A.appendChild(_)}catch(_){console.error(`[snapdom] Error in pseudo ${h} for`,t,_)}}else!U&&V&&(A.textContent=d);A.style.backgroundImage="none","maskImage"in A.style&&(A.style.maskImage="none"),"webkitMaskImage"in A.style&&(A.style.webkitMaskImage="none");try{A.style.backgroundRepeat=m.backgroundRepeat,A.style.backgroundSize=m.backgroundSize,m.backgroundPositionX&&m.backgroundPositionY?(A.style.backgroundPositionX=m.backgroundPositionX,A.style.backgroundPositionY=m.backgroundPositionY):A.style.backgroundPosition=m.backgroundPosition,A.style.backgroundOrigin=m.backgroundOrigin,A.style.backgroundClip=m.backgroundClip,A.style.backgroundAttachment=m.backgroundAttachment,A.style.backgroundBlendMode=m.backgroundBlendMode}catch(I){}if(j)try{let I=Mt(b),_=yield Promise.all(I.map(pt));A.style.backgroundImage=_.join(", ")}catch(I){console.warn(`[snapdom] Failed to inline background-image for ${h}`,I)}Q&&(A.style.backgroundColor=x);let T=A.childNodes.length>0||((f=A.textContent)==null?void 0:f.trim())!==""||j||Q||Z||tt;if(y&&y.length&&t.parentElement){let I=kt.get(t.parentElement)||new Map,_=fe(t,o),q=de(t,getComputedStyle(t,h),_);for(let{name:z}of y){if(!z)continue;let G=q.get(t,z);I.set(z,G)}kt.set(t.parentElement,I)}if(!T)continue;h==="::before"?e.insertBefore(A,e.firstChild):e.appendChild(A)}catch(m){console.warn(`[snapdom] Failed to capture ${h} for`,t,m)}let a=Array.from(t.children),u=Array.from(e.children).filter(h=>!h.dataset.snapdomPseudo);for(let h=0;h<Math.min(a.length,u.length);h++)yield me(a[h],u[h],n,r)})}function Xe(t,e){var b,x,M,C;if(!t||!(t instanceof Element))return;let n=t.ownerDocument||document,r=e||n,s=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(s.length===0)return;let o=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],u=w=>window.CSS&&CSS.escape?CSS.escape(w):w.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c=new Set(Array.from(t.querySelectorAll("[id]")).map(w=>w.id)),l=new Set,p=!1,f=w=>{if(!w)return;o.lastIndex=0;let F;for(;F=o.exec(w);){p=!0;let k=(F[1]||"").trim();k&&!c.has(k)&&l.add(k)}},h=w=>{let F=w.querySelectorAll('use[href^="#"], use[xlink\\:href^="#"]');for(let R of F){let U=R.getAttribute("href")||R.getAttribute("xlink:href");if(!U||!U.startsWith("#"))continue;p=!0;let V=U.slice(1).trim();V&&!c.has(V)&&l.add(V)}let N=w.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("], *[clip-path^="url("],*[mask^="url("],*[marker^="url("], *[marker-start^="url("],*[marker-mid^="url("], *[marker-end^="url("]');for(let R of N){f(R.getAttribute("style")||"");for(let U of a)f(R.getAttribute(U))}};for(let w of s)h(w);if(!p)return;let m=t.querySelector("svg.inline-defs-container");m||(m=n.createElementNS("http://www.w3.org/2000/svg","svg"),m.classList.add("inline-defs-container"),m.setAttribute("aria-hidden","true"),m.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(m,t.firstChild||null));let g=m.querySelector("defs")||null,i=w=>{if(!w||c.has(w))return null;let F=u(w),k=N=>{let R=r.querySelector(N);return R&&!t.contains(R)?R:null};return k(`svg defs > *#${F}`)||k(`svg > symbol#${F}`)||k(`*#${F}`)};if(!l.size)return;let d=new Set(l),y=new Set;for(;d.size;){let w=d.values().next().value;if(d.delete(w),!w||c.has(w)||y.has(w))continue;let F=i(w);if(!F){y.add(w);continue}g||(g=n.createElementNS("http://www.w3.org/2000/svg","defs"),m.appendChild(g));let k=F.cloneNode(!0);k.id||k.setAttribute("id",w),g.appendChild(k),y.add(w),c.add(w);let N=[k,...k.querySelectorAll("*")];for(let R of N){let U=((b=R.getAttribute)==null?void 0:b.call(R,"href"))||((x=R.getAttribute)==null?void 0:x.call(R,"xlink:href"));if(U&&U.startsWith("#")){let j=U.slice(1).trim();j&&!c.has(j)&&!y.has(j)&&d.add(j)}let V=((M=R.getAttribute)==null?void 0:M.call(R,"style"))||"";V&&f(V);for(let j of a){let Q=(C=R.getAttribute)==null?void 0:C.call(R,j);Q&&f(Q)}}}}function Ge(t,e){var u;if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let r=t.getBoundingClientRect(),s=t.clientHeight,o="data-snap-ph",a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let c=a.currentNode,l=getComputedStyle(c),p=l.position;if(p!=="sticky"&&p!=="-webkit-sticky")continue;let f=Ye(l.top),h=Ye(l.bottom);if(f==null&&h==null)continue;let m=kr(c,t),g=Ar(e,m,o);if(!g)continue;let i=c.getBoundingClientRect(),d=i.width,y=i.height,b=i.left-r.left;if(!(d>0&&y>0)||!Number.isFinite(b))continue;let x=f!=null?f+n:n+(s-y-h);if(!Number.isFinite(x))continue;let M=Number.parseInt(l.zIndex,10),C=Number.isFinite(M),w=C?Math.max(M,1)+1:2,F=C?M-1:0,k=g.cloneNode(!1);k.setAttribute(o,"1"),k.style.position="sticky",k.style.left=`${b}px`,k.style.top=`${x}px`,k.style.width=`${d}px`,k.style.height=`${y}px`,k.style.visibility="hidden",k.style.zIndex=String(F),k.style.overflow="hidden",k.style.background="transparent",k.style.boxShadow="none",k.style.filter="none",(u=g.parentElement)==null||u.insertBefore(k,g),g.style.position="absolute",g.style.left=`${b}px`,g.style.top=`${x}px`,g.style.bottom="auto",g.style.zIndex=String(w),g.style.pointerEvents="none"}}function Ye(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function kr(t,e){let n=[];for(let r=t;r&&r!==e;){let s=r.parentElement;if(!s)break;n.push(Array.prototype.indexOf.call(s.children,r)),r=s}return n.reverse()}function Ar(t,e,n){let r=t;for(let s=0;s<e.length;s++)if(r=Mr(r,n)[e[s]],!r)return null;return r instanceof HTMLElement?r:null}function Mr(t,e){let n=[],r=t.children;for(let s=0;s<r.length;s++){let o=r[s];o.hasAttribute(e)||n.push(o)}return n}function Je(n){return v(this,arguments,function*(t,e={}){var l,p;let r={styleMap:S.session.styleMap,styleCache:S.session.styleCache,nodeMap:S.session.nodeMap},s,o="",a="";vr(t);try{Xe(t)}catch(f){console.warn("inlineExternal defs or symbol failed:",f)}try{s=yield $t(t,r,e,t)}catch(f){throw console.warn("deepClone failed:",f),f}try{yield me(t,s,r,e)}catch(f){console.warn("inlinePseudoElements failed:",f)}yield Rr(s);try{let f=s.querySelectorAll("style[data-sd]");for(let h of f)a+=h.textContent||"",h.remove()}catch(f){}let u=re(r.styleMap);o=Array.from(u.entries()).map(([f,h])=>`.${h}{${f}}`).join(""),o=a+o;for(let[f,h]of r.styleMap.entries()){if(f.tagName==="STYLE")continue;if(f.getRootNode&&f.getRootNode()instanceof ShadowRoot){f.setAttribute("style",h.replace(/;/g,"; "));continue}let m=u.get(h);m&&f.classList.add(m);let g=(l=f.style)==null?void 0:l.backgroundImage,i=(p=f.dataset)==null?void 0:p.snapdomHasIcon;g&&g!=="none"&&(f.style.backgroundImage=g),i&&(f.style.verticalAlign="middle",f.style.display="inline")}for(let[f,h]of r.nodeMap.entries()){let m=h.scrollLeft,g=h.scrollTop;if((m||g)&&f instanceof HTMLElement){f.style.overflow="hidden",f.style.scrollbarWidth="none",f.style.msOverflowStyle="none";let d=document.createElement("div");for(d.style.transform=`translate(${-m}px, ${-g}px)`,d.style.willChange="transform",d.style.display="inline-block",d.style.width="100%";f.firstChild;)d.appendChild(f.firstChild);f.appendChild(d)}}let c=s instanceof HTMLElement&&s.firstElementChild instanceof HTMLElement?s.firstElementChild:s;if(Ge(t,c),t===r.nodeMap.get(s)){let f=r.styleCache.get(t)||window.getComputedStyle(t);r.styleCache.set(t,f);let h=Jt(f.transform);s.style.margin="0",s.style.top="auto",s.style.left="auto",s.style.right="auto",s.style.bottom="auto",s.style.animation="none",s.style.transition="none",s.style.willChange="auto",s.style.float="none",s.style.clear="none",s.style.transform=h||""}for(let[f,h]of r.nodeMap.entries())h.tagName==="PRE"&&(f.style.marginTop="0",f.style.marginBlockStart="0");return{clone:s,classCSS:o,styleCache:r.styleCache}})}function vr(t){let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,s=e.borderStyle,o=e.borderWidth,a=n!=="none"&&parseFloat(r)>0,u=s==="none"||parseFloat(o)===0;a&&u&&(t.style.border=`${r} solid transparent`)}var Et=new Map;function Ft(t){return v(this,null,function*(){var n;if((n=S.resource)!=null&&n.has(t))return S.resource.get(t);if(Et.has(t))return Et.get(t);let e=v(null,null,function*(){var s;let r=yield X(t,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return(s=S.resource)==null||s.set(t,r.data),r.data});Et.set(t,e);try{let r=yield e;return Et.set(t,r),r}catch(r){throw Et.delete(t),r}})}var $r=/\bblob:[^)"'\s]+/g;function Ke(t){return v(this,null,function*(){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match($r)||[]));if(e.length===0)return t;let n=t;for(let r of e)try{let s=yield Ft(r);n=n.split(r).join(s)}catch(s){}return n})}function zt(t){return typeof t=="string"&&t.startsWith("blob:")}function Er(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function Fr(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function Rr(t){return v(this,null,function*(){var a,u;if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let c of e)try{let p=c.getAttribute("src")||c.currentSrc||"";if(zt(p)){let h=yield Ft(p);c.setAttribute("src",h)}let f=c.getAttribute("srcset");if(f&&f.includes("blob:")){let h=Er(f),m=!1;for(let g of h)if(zt(g.url))try{g.url=yield Ft(g.url),m=!0}catch(i){}m&&c.setAttribute("srcset",Fr(h))}}catch(l){}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let c of n)try{let l="http://www.w3.org/1999/xlink",p=c.getAttribute("href")||((a=c.getAttributeNS)==null?void 0:a.call(c,l,"href"));if(zt(p)){let f=yield Ft(p);c.setAttribute("href",f),(u=c.removeAttributeNS)==null||u.call(c,l,"href")}}catch(l){}let r=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let c of r)try{let l=c.getAttribute("style");if(l&&l.includes("blob:")){let p=yield Ke(l);c.setAttribute("style",p)}}catch(l){}let s=t.querySelectorAll?t.querySelectorAll("style"):[];for(let c of s)try{let l=c.textContent||"";l.includes("blob:")&&(c.textContent=yield Ke(l))}catch(l){}let o=["poster"];for(let c of o){let l=t.querySelectorAll?t.querySelectorAll(`[${c}^='blob:']`):[];for(let p of l)try{let f=p.getAttribute(c);zt(f)&&p.setAttribute(c,yield Ft(f))}catch(f){}}})}function Qe(n){return v(this,arguments,function*(t,e={}){let r=Array.from(t.querySelectorAll("img")),s=o=>v(null,null,function*(){var f,h,m,g;if(!o.getAttribute("src")){let i=o.currentSrc||o.src||"";i&&o.setAttribute("src",i)}o.removeAttribute("srcset"),o.removeAttribute("sizes");let a=o.src||"";if(!a)return;let u=yield X(a,{as:"dataURL",useProxy:e.useProxy});if(u.ok&&typeof u.data=="string"&&u.data.startsWith("data:")){o.src=u.data,o.width||(o.width=o.naturalWidth||100),o.height||(o.height=o.naturalHeight||100);return}let{fallbackURL:c}=e||{};if(c)try{let i=parseInt(((f=o.dataset)==null?void 0:f.snapdomWidth)||"",10)||0,d=parseInt(((h=o.dataset)==null?void 0:h.snapdomHeight)||"",10)||0,y=parseInt(o.getAttribute("width")||"",10)||0,b=parseInt(o.getAttribute("height")||"",10)||0,x=parseFloat(((m=o.style)==null?void 0:m.width)||"")||0,M=parseFloat(((g=o.style)==null?void 0:g.height)||"")||0,C=i||x||y||o.width||void 0,w=d||M||b||o.height||void 0,F=typeof c=="function"?yield c({width:C,height:w,src:a,element:o}):c;if(F){let k=yield X(F,{as:"dataURL",useProxy:e.useProxy});o.src=k.data,!o.width&&C&&(o.width=C),!o.height&&w&&(o.height=w),o.width||(o.width=o.naturalWidth||100),o.height||(o.height=o.naturalHeight||100);return}}catch(i){}let l=o.width||o.naturalWidth||100,p=o.height||o.naturalHeight||100;if(e.placeholders!==!1){let i=document.createElement("div");i.style.cssText=[`width:${l}px`,`height:${p}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${p}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),i.textContent="img",o.replaceWith(i)}else{let i=document.createElement("div");i.style.cssText=`display:inline-block;width:${l}px;height:${p}px;visibility:hidden;`,o.replaceWith(i)}});for(let o=0;o<r.length;o+=4){let a=r.slice(o,o+4).map(s);yield Promise.allSettled(a)}})}function Vt(s,o,a){return v(this,arguments,function*(t,e,n,r={}){let u=[[t,e]],c=["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"],l=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],p=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],f=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;u.length;){let[h,m]=u.shift(),g=n.get(h)||gt(h);n.has(h)||n.set(h,g);let i=(()=>{let b=g.getPropertyValue("border-image"),x=g.getPropertyValue("border-image-source");return b&&b!=="none"||x&&x!=="none"})();for(let b of p){let x=g.getPropertyValue(b);x&&m.style.setProperty(b,x)}for(let b of c){let x=g.getPropertyValue(b);if(!x||x==="none")continue;let M=Mt(x),C=yield Promise.all(M.map(w=>pt(w,r)));C.some(w=>w&&w!=="none"&&!/^url\(undefined/.test(w))&&m.style.setProperty(b,C.join(", "))}for(let b of l){let x=g.getPropertyValue(b);!x||x==="initial"||m.style.setProperty(b,x)}if(i)for(let b of f){let x=g.getPropertyValue(b);!x||x==="initial"||m.style.setProperty(b,x)}let d=Array.from(h.children),y=Array.from(m.children).filter(b=>!(b.dataset&&b.dataset.snapdomPseudo));for(let b=0;b<Math.min(d.length,y.length);b++)u.push([d[b],y[b]])}})}function Ze(t){var l;if(!t)return()=>{};let e=Lr(t);if(e<=0)return()=>{};if(!Pr(t))return()=>{};let n=getComputedStyle(t),r=Math.round(Nr(n)*e+Ir(n)),s=(l=t.textContent)!=null?l:"",o=s;if(t.scrollHeight<=r+.5)return()=>{};let a=0,u=s.length,c=-1;for(;a<=u;){let p=a+u>>1;t.textContent=s.slice(0,p)+"\u2026",t.scrollHeight<=r+.5?(c=p,a=p+1):u=p-1}return t.textContent=(c>=0?s.slice(0,c):"")+"\u2026",()=>{t.textContent=o}}function Lr(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function Nr(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function Ir(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function Pr(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var Rt=[];function tn(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function he(...t){let e=t.flat();for(let n of e){let r=tn(n);r&&(Rt.some(s=>s&&s.name&&r.name&&s.name===r.name)||Rt.push(r))}}function en(t){return(t&&Array.isArray(t.plugins)?t.plugins:Rt)||Rt}function ot(t,e,n){return v(this,null,function*(){let r=n,s=en(e);for(let o of s){let a=o&&typeof o[t]=="function"?o[t]:null;if(!a)continue;let u=yield a(e,r);typeof u!="undefined"&&(r=u)}return r})}function nn(t,e,n){return v(this,null,function*(){let r=[],s=en(e);for(let o of s){let a=o&&typeof o[t]=="function"?o[t]:null;if(!a)continue;let u=yield a(e,n);typeof u!="undefined"&&r.push(u)}return r})}function _r(t){let e=[];if(Array.isArray(t))for(let n of t){let r=tn(n);if(!r||!r.name)continue;let s=e.findIndex(o=>o&&o.name===r.name);s>=0&&e.splice(s,1),e.push(r)}for(let n of Rt)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function rn(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=_r(e)),t}function Tr(t,e){if(!t||!e||!e.style)return;let n=getComputedStyle(t);try{e.style.boxShadow="none"}catch(o){}try{e.style.textShadow="none"}catch(o){}try{e.style.outline="none"}catch(o){}let s=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=s.length?s:"none"}catch(o){}}function ge(t,e){return v(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");Pt(e.cache);let n=e.fast,r=!!e.straighten,s=!!e.noShadows,o={element:t,options:e,plugins:e.plugins},a,u,c,l="",p="",f,h,m=null;yield ot("beforeSnap",o),yield ot("beforeClone",o);let g=Ze(o.element);try{({clone:a,classCSS:u,styleCache:c}=yield Je(o.element,o.options)),r&&a&&(m=Ur(o.element,o.clone)),s&&a&&Tr(o.element,o.clone)}finally{g()}o=E({clone:a,classCSS:u,styleCache:c},o),yield ot("afterClone",o),yield new Promise(b=>{it(()=>v(null,null,function*(){yield Qe(o.clone,o.options),b()}),{fast:n})}),yield new Promise(b=>{it(()=>v(null,null,function*(){yield Vt(o.element,o.clone,o.styleCache,o.options),b()}),{fast:n})}),e.embedFonts&&(yield new Promise(b=>{it(()=>v(null,null,function*(){let x=Ht(o.element),M=qt(o.element);if(Y()){let C=new Set(Array.from(x).map(w=>String(w).split("__")[0]).filter(Boolean));yield jt(C,1)}l=yield Dt({required:x,usedCodepoints:M,preCached:!1,exclude:o.options.excludeFonts,useProxy:o.options.useProxy}),b()}),{fast:n})}));let i=ee(o.clone).sort(),d=i.join(",");S.baseStyle.has(d)?p=S.baseStyle.get(d):yield new Promise(b=>{it(()=>{p=ne(i),S.baseStyle.set(d,p),b()},{fast:n})}),o=E({fontsCSS:l,baseCSS:p},o),yield ot("beforeRender",o),yield new Promise(b=>{it(()=>{let x=getComputedStyle(o.element),M=o.element.getBoundingClientRect(),C=Math.max(1,L(o.element.offsetWidth||parseFloat(x.width)||M.width||1)),w=Math.max(1,L(o.element.offsetHeight||parseFloat(x.height)||M.height||1)),F=(bt,lt=NaN)=>{let St=typeof bt=="string"?parseFloat(bt):bt;return Number.isFinite(St)?St:lt},k=F(o.options.width),N=F(o.options.height),R=C,U=w,V=Number.isFinite(k),j=Number.isFinite(N),Q=w>0?C/w:1;V&&j?(R=Math.max(1,L(k)),U=Math.max(1,L(N))):V?(R=Math.max(1,L(k)),U=Math.max(1,L(R/(Q||1)))):j?(U=Math.max(1,L(N)),R=Math.max(1,L(U*(Q||1)))):(R=C,U=w);let Z=0,tt=0,$=C,A=w;if(r&&m&&Number.isFinite(m.a)){let bt={a:m.a,b:m.b||0,c:m.c||0,d:m.d||1,e:0,f:0},lt=on(C,w,bt,0,0);Z=L(lt.minX),tt=L(lt.minY),$=L(lt.maxX),A=L(lt.maxY)}else if(!r&&Hr(o.element)){let lt=x.transform&&x.transform!=="none"?x.transform:"",St=qr(o.element),Gt=Xr({baseTransform:lt,rotate:St.rotate||"0deg",scale:St.scale,translate:St.translate}),{ox:gn,oy:yn}=zr(x,C,w),wn=Gt.is2D?Gt:new DOMMatrix(Gt.toString()),It=on(C,w,wn,gn,yn);Z=L(It.minX),tt=L(It.minY),$=L(It.maxX),A=L(It.maxY)}let P=Or(x),O=Br(x),D=Dr(x),T=Wr(x),I=s?{top:0,right:0,bottom:0,left:0}:{top:L(P.top+O.top+D.top+T.bleed.top),right:L(P.right+O.right+D.right+T.bleed.right),bottom:L(P.bottom+O.bottom+D.bottom+T.bleed.bottom),left:L(P.left+O.left+D.left+T.bleed.left)};Z=L(Z-I.left),tt=L(tt-I.top),$=L($+I.right),A=L(A+I.bottom);let _=Math.max(1,L($-Z)),q=Math.max(1,L(A-tt)),z=V||j?L(R/C):1,G=j||V?L(U/w):1,K=Math.max(1,L(_*z)),H=Math.max(1,L(q*G)),J="http://www.w3.org/2000/svg",at=Y()?1:0,et=L(at+(r?1:0)),nt=document.createElementNS(J,"foreignObject"),Nt=L(Z),dn=L(tt);nt.setAttribute("x",String(L(-(Nt-et)))),nt.setAttribute("y",String(L(-(dn-et)))),nt.setAttribute("width",String(L(C+et*2))),nt.setAttribute("height",String(L(w+et*2))),nt.style.overflow="visible";let we=document.createElement("style");we.textContent=o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,nt.appendChild(we);let wt=document.createElement("div");wt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),wt.style.width=`${L(C)}px`,wt.style.height=`${L(w)}px`,wt.style.overflow="visible",o.clone.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),wt.appendChild(o.clone),nt.appendChild(wt);let mn=new XMLSerializer().serializeToString(nt),Xt=L(_+et*2),Yt=L(q+et*2),be=V||j;e.meta={w0:C,h0:w,vbW:Xt,vbH:Yt,targetW:R,targetH:U};let hn=Y()&&be?Xt:L(K+et*2),pn=Y()&&be?Yt:L(H+et*2);h=`<svg xmlns="${J}" width="${hn}" height="${pn}" viewBox="0 0 ${Xt} ${Yt}">`+mn+"</svg>",f=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h)}`,o=E({svgString:h,dataURL:f},o),b()},{fast:n})}),yield ot("afterRender",o);let y=document.getElementById("snapdom-sandbox");return y&&y.style.position==="absolute"&&y.remove(),o.dataURL})}var L=(t,e=3)=>Number.isFinite(t)?Math.round(t*Kt(10,e))/Kt(10,e):t;function Wr(t){var c;let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,s=0,o=0,a=0,u=!1;for(let l of n){u=!0;let p=((c=l.match(/-?\d+(?:\.\d+)?px/gi))==null?void 0:c.map(d=>parseFloat(d)))||[],[f=0,h=0,m=0]=p,g=Math.abs(f)+m,i=Math.abs(h)+m;s=Math.max(s,g+Math.max(f,0)),a=Math.max(a,g+Math.max(-f,0)),o=Math.max(o,i+Math.max(h,0)),r=Math.max(r,i+Math.max(-h,0))}return{bleed:{top:L(r),right:L(s),bottom:L(o),left:L(a)},has:u}}function Ur(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch(o){}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch(o){}let r=n.transform||"none";if(!r||r==="none")try{let o=sn(t);if(o.a===1&&o.b===0&&o.c===0&&o.d===1)return e.style.transform="none",{a:1,b:0,c:0,d:1}}catch(o){}let s=r.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let o=s[1].split(",").map(a=>parseFloat(a.trim()));if(o.length===6&&o.every(Number.isFinite)){let[a,u,c,l]=o,p=Math.sqrt(a*a+u*u)||0,f=0,h=0,m=0,g=0,i=0,d=0;p>0&&(f=a/p,h=u/p,m=f*c+h*l,g=c-f*m,i=l-h*m,d=Math.sqrt(g*g+i*i)||0,d>0?m=m/d:m=0);let y=p,b=0,x=m*d,M=d;try{e.style.transform=`matrix(${y}, ${b}, ${x}, ${M}, 0, 0)`}catch(C){}return{a:y,b,c:x,d:M}}}try{let o=String(r).trim();return e.style.transform=o+" translate(0px, 0px) rotate(0deg)",null}catch(o){return null}}function Or(t){var u;let e=t.boxShadow||"";if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let n=e.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(c=>c.trim()),r=0,s=0,o=0,a=0;for(let c of n){let l=((u=c.match(/-?\d+(\.\d+)?px/g))==null?void 0:u.map(d=>parseFloat(d)))||[];if(l.length<2)continue;let[p,f,h=0,m=0]=l,g=Math.abs(p)+h+m,i=Math.abs(f)+h+m;s=Math.max(s,g+Math.max(p,0)),a=Math.max(a,g+Math.max(-p,0)),o=Math.max(o,i+Math.max(f,0)),r=Math.max(r,i+Math.max(-f,0))}return{top:Math.ceil(r),right:Math.ceil(s),bottom:Math.ceil(o),left:Math.ceil(a)}}function Br(t){let e=(t.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=e?Math.ceil(parseFloat(e[1])||0):0;return{top:n,right:n,bottom:n,left:n}}function Dr(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0);return{top:e,right:e,bottom:e,left:e}}function on(t,e,n,r,s){let o=n.a,a=n.b,u=n.c,c=n.d,l=n.e||0,p=n.f||0;function f(y,b){let x=y-r,M=b-s,C=o*x+u*M,w=a*x+c*M;return C+=r+l,w+=s+p,[C,w]}let h=[f(0,0),f(t,0),f(0,e),f(t,e)],m=1/0,g=1/0,i=-1/0,d=-1/0;for(let[y,b]of h)y<m&&(m=y),b<g&&(g=b),y>i&&(i=y),b>d&&(d=b);return{minX:m,minY:g,maxX:i,maxY:d,width:i-m,height:d-g}}function Hr(t){return jr(t)}function sn(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch(n){return new WebKitCSSMatrix(e)}}function qr(t){var s,o,a,u,c,l,p,f;let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let h=d=>{try{return typeof n.has=="function"&&!n.has(d)||typeof n.get!="function"?null:n.get(d)}catch(y){return null}},m=h("rotate");if(m)if(m.angle){let d=m.angle;e.rotate=d.unit==="rad"?d.value*180/Math.PI+"deg":d.value+d.unit}else m.unit?e.rotate=m.unit==="rad"?m.value*180/Math.PI+"deg":m.value+m.unit:e.rotate=String(m);else{let d=getComputedStyle(t);e.rotate=d.rotate&&d.rotate!=="none"?d.rotate:"0deg"}let g=h("scale");if(g){let d="x"in g&&((s=g.x)==null?void 0:s.value)!=null?g.x.value:Array.isArray(g)?(o=g[0])==null?void 0:o.value:Number(g)||1,y="y"in g&&((a=g.y)==null?void 0:a.value)!=null?g.y.value:Array.isArray(g)?(u=g[1])==null?void 0:u.value:d;e.scale=`${d} ${y}`}else{let d=getComputedStyle(t);e.scale=d.scale&&d.scale!=="none"?d.scale:null}let i=h("translate");if(i){let d="x"in i&&"value"in i.x?i.x.value:Array.isArray(i)?(c=i[0])==null?void 0:c.value:0,y="y"in i&&"value"in i.y?i.y.value:Array.isArray(i)?(l=i[1])==null?void 0:l.value:0,b="x"in i&&((p=i.x)!=null&&p.unit)?i.x.unit:"px",x="y"in i&&((f=i.y)!=null&&f.unit)?i.y.unit:"px";e.translate=`${d}${b} ${y}${x}`}else{let d=getComputedStyle(t);e.translate=d.translate&&d.translate!=="none"?d.translate:null}return e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}function jr(t){let e=getComputedStyle(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let s=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",o=e.scale&&e.scale!=="none"&&e.scale!=="1",a=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(s||o||a)}function zr(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[s,o]=[r[0]||"0",r[1]||"0"],a=(u,c)=>{let l=u.toLowerCase();return l==="left"||l==="top"?0:l==="center"?c/2:l==="right"||l==="bottom"?c:l.endsWith("px")?parseFloat(l)||0:l.endsWith("%")?(parseFloat(l)||0)*c/100:/^-?\d+(\.\d+)?$/.test(l)&&parseFloat(l)||0};return{ox:a(s,e),oy:a(o,n)}}var pe=null;function Vr(){if(pe)return pe;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),pe=t,t}function Xr(t){let e=Vr(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform),t.rotate&&(n.style.rotate=t.rotate),t.scale&&(n.style.scale=t.scale),t.translate&&(n.style.translate=t.translate),e.appendChild(n);let r=sn(n);return e.removeChild(n),r}function Yr(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function an(t={}){var r,s,o,a,u,c,l,p,f,h,m,g,i,d,y,b,x,M,C,w;let e=(r=t.format)!=null?r:"png";e==="jpg"&&(e="jpeg");let n=Yr(t.cache);return{debug:(s=t.debug)!=null?s:!1,fast:(o=t.fast)!=null?o:!0,scale:(a=t.scale)!=null?a:1,exclude:(u=t.exclude)!=null?u:[],excludeMode:(c=t.excludeMode)!=null?c:"hide",filter:(l=t.filter)!=null?l:null,filterMode:(p=t.filterMode)!=null?p:"hide",placeholders:t.placeholders!==!1,embedFonts:(f=t.embedFonts)!=null?f:!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:(h=t.excludeFonts)!=null?h:void 0,fallbackURL:(m=t.fallbackURL)!=null?m:void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:(g=t.width)!=null?g:null,height:(i=t.height)!=null?i:null,format:e,type:(d=t.type)!=null?d:"svg",quality:(y=t.quality)!=null?y:.92,dpr:(b=t.dpr)!=null?b:window.devicePixelRatio||1,backgroundColor:(x=t.backgroundColor)!=null?x:["jpeg","webp"].includes(e)?"#ffffff":null,filename:(M=t.filename)!=null?M:"snapDOM",straighten:(C=t.straighten)!=null?C:!1,noShadows:(w=t.noShadows)!=null?w:!1}}function Gr(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function Kr(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function Jr(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Qr(t){let e=[],n="",r=0;for(let s=0;s<t.length;s++){let o=t[s];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(e.push(n),n=""):n+=o}return n.trim()&&e.push(n),e.map(s=>s.trim()).filter(Boolean)}function Zr(t){let e=[],n="",r=0;for(let o=0;o<t.length;o++){let a=t[o];a==="("&&r++,a===")"&&(r=Math.max(0,r-1)),a===","&&r===0?(e.push(n.trim()),n=""):n+=a}n.trim()&&e.push(n.trim());let s=[];for(let o of e){if(/\binset\b/i.test(o))continue;let a=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[u="0px",c="0px",l="0px"]=a,p=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!p&&p!==",";s.push(`drop-shadow(${u} ${c} ${l}${f?` ${p}`:""})`)}return s.join(" ")}function cn(t){let e=Qr(t),n=null,r=null,s=null,o=[];for(let u of e){let c=u.indexOf(":");if(c<0)continue;let l=u.slice(0,c).trim().toLowerCase(),p=u.slice(c+1).trim();l==="box-shadow"?s=p:l==="filter"?n=p:l==="-webkit-filter"?r=p:o.push([l,p])}if(s){let u=Zr(s);u&&(n=n?`${n} ${u}`:u,r=r?`${r} ${u}`:u)}let a=[...o];return n&&a.push(["filter",n]),r&&a.push(["-webkit-filter",r]),a.map(([u,c])=>`${u}:${c}`).join(";")}function to(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${cn(r)}}`)}function eo(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,to(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${cn(r)}${n}`),t}function no(t){if(!Y()||!Gr(t))return t;try{let e=Kr(t),n=eo(e);return Jr(n)}catch(e){return t}}function ct(t,e){return v(this,null,function*(){let{width:n,height:r,scale:s=1,dpr:o=1,meta:a={}}=e;t=no(t);let u=new Image;u.loading="eager",u.decoding="sync",u.crossOrigin="anonymous",u.src=t,yield u.decode();let c=u.naturalWidth,l=u.naturalHeight,p=Number.isFinite(a.w0)?a.w0:c,f=Number.isFinite(a.h0)?a.h0:l,h,m,g=Number.isFinite(n),i=Number.isFinite(r);if(g&&i)h=Math.max(1,n),m=Math.max(1,r);else if(g){let b=n/Math.max(1,p);h=n,m=f*b}else if(i){let b=r/Math.max(1,f);m=r,h=p*b}else h=c,m=l;h=h*s,m=m*s;let d=document.createElement("canvas");d.width=h*o,d.height=m*o,d.style.width=`${h}px`,d.style.height=`${m}px`;let y=d.getContext("2d");return o!==1&&y.scale(o,o),y.drawImage(u,0,0,h,m),d})}function st(t,e){return v(this,null,function*(){let n=yield ct(t,e),r=e.backgroundColor?ht(n,e.backgroundColor):n,s=new Image;return s.src=r.toDataURL(`image/${e.format}`,e.quality),yield s.decode(),s.style.width=`${r.width/e.dpr}px`,s.style.height=`${r.height/e.dpr}px`,s})}function At(t,e){return v(this,null,function*(){let{scale:n=1,width:r,height:s,meta:o={}}=e,a=Number.isFinite(r),u=Number.isFinite(s),c=Number.isFinite(n)&&n!==1||a||u;if(Y()&&c)return yield st(t,W(E({},e),{format:"png",quality:1,meta:o}));let l=new Image;if(l.decoding="sync",l.loading="eager",l.src=t,yield l.decode(),a&&u)l.style.width=`${r}px`,l.style.height=`${s}px`;else if(a){let p=Number.isFinite(o.w0)?o.w0:l.naturalWidth,f=Number.isFinite(o.h0)?o.h0:l.naturalHeight,h=r/Math.max(1,p);l.style.width=`${r}px`,l.style.height=`${Math.round(f*h)}px`}else if(u){let p=Number.isFinite(o.w0)?o.w0:l.naturalWidth,f=Number.isFinite(o.h0)?o.h0:l.naturalHeight,h=s/Math.max(1,f);l.style.height=`${s}px`,l.style.width=`${Math.round(p*h)}px`}else{let p=Math.round(l.naturalWidth*n),f=Math.round(l.naturalHeight*n);if(l.style.width=`${p}px`,l.style.height=`${f}px`,typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let m=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${p}"`).replace(/height="[^"]*"/,`height="${f}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,l.src=t}catch(h){}}return l})}function Lt(t,e){return v(this,null,function*(){let n=e.type;if(n==="svg"){let o=decodeURIComponent(t.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let r=yield ct(t,e),s=e.backgroundColor?ht(r,e.backgroundColor):r;return new Promise(o=>s.toBlob(a=>o(a),`image/${n}`,e.quality))})}function ln(t,e){return v(this,null,function*(){if(e.dpr=1,e.format==="svg"){let o=yield Lt(t,W(E({},e),{type:"svg"})),a=URL.createObjectURL(o),u=document.createElement("a");u.href=a,u.download=e.filename,u.click(),URL.revokeObjectURL(a);return}let n=yield ct(t,e),r=e.backgroundColor?ht(n,e.backgroundColor):n,s=document.createElement("a");s.href=r.toDataURL(`image/${e.format}`,e.quality),s.download=e.filename,s.click()})}B.plugins=(...t)=>(he(...t),B);var un=Symbol("snapdom.internal"),ft=Symbol("snapdom.internal.silent"),ye=!1;function B(t,e){return v(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");let n=an(e);if(rn(n,e&&e.plugins),Y()&&(n.embedFonts===!0||oo(t)))for(let r=0;r<3;r++)try{yield ro(t,e),console.log("safariWarmup:",r),ye=!1}catch(s){}return n.iconFonts&&n.iconFonts.length>0&&Le(n.iconFonts),n.snap||(n.snap={toPng:(r,s)=>B.toPng(r,s),toSvg:(r,s)=>B.toSvg(r,s)}),B.capture(t,n,un)})}B.plugins=(...t)=>(he(...t),B);B.capture=(t,e,n)=>v(null,null,function*(){if(n!==un)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=yield ge(t,e),s={img:(i,d)=>v(null,null,function*(){return At(r,E(E({},i),d||{}))}),svg:(i,d)=>v(null,null,function*(){return At(r,E(E({},i),d||{}))}),canvas:(i,d)=>v(null,null,function*(){return ct(r,E(E({},i),d||{}))}),blob:(i,d)=>v(null,null,function*(){return Lt(r,E(E({},i),d||{}))}),png:(i,d)=>v(null,null,function*(){return st(r,W(E(E({},i),d||{}),{format:"png"}))}),jpeg:(i,d)=>v(null,null,function*(){return st(r,W(E(E({},i),d||{}),{format:"jpeg"}))}),webp:(i,d)=>v(null,null,function*(){return st(r,W(E(E({},i),d||{}),{format:"webp"}))}),download:(i,d)=>v(null,null,function*(){return ln(r,E(E({},i),d||{}))})},o={svg:i=>At(r,W(E(E({},e),i||{}),{[ft]:!0})),canvas:i=>ct(r,W(E(E({},e),i||{}),{[ft]:!0})),png:i=>st(r,W(E(E({},e),i||{}),{format:"png",[ft]:!0})),jpeg:i=>st(r,W(E(E({},e),i||{}),{format:"jpeg",[ft]:!0})),jpg:i=>st(r,W(E(E({},e),i||{}),{format:"jpeg",[ft]:!0})),webp:i=>st(r,W(E(E({},e),i||{}),{format:"webp",[ft]:!0})),blob:i=>Lt(r,W(E(E({},e),i||{}),{[ft]:!0})),img:i=>At(r,W(E(E({},e),i||{}),{[ft]:!0}))},a=W(E({},e),{export:{url:r},exports:o}),u=yield nn("defineExports",a),c=Object.assign({},...u.filter(i=>i&&typeof i=="object")),l=E(E({},s),c);l.jpeg&&!l.jpg&&(l.jpg=(i,d)=>l.jpeg(i,d));function p(i,d){let y=E(E({},e),d||{});return(i==="jpeg"||i==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let f=!1,h=Promise.resolve();function m(i,d){return v(this,null,function*(){let y=()=>v(null,null,function*(){let b=l[i];if(!b)throw new Error(`[snapdom] Unknown export type: ${i}`);let x=p(i,d),M=W(E({},e),{export:{type:i,options:x,url:r}});yield ot("beforeExport",M);let C=yield b(M,x);return yield ot("afterExport",M,C),f||(f=!0,yield ot("afterSnap",e)),C});return h=h.then(y)})}let g={url:r,toRaw:()=>r,to:(i,d)=>m(i,d),toImg:i=>m("img",i),toSvg:i=>m("svg",i),toCanvas:i=>m("canvas",i),toBlob:i=>m("blob",i),toPng:i=>m("png",i),toJpg:i=>m("jpg",i),toWebp:i=>m("webp",i),download:i=>m("download",i)};for(let i of Object.keys(l)){let d="to"+i.charAt(0).toUpperCase()+i.slice(1);g[d]||(g[d]=y=>m(i,y))}return g});B.toRaw=(t,e)=>B(t,e).then(n=>n.toRaw());B.toImg=(t,e)=>B(t,e).then(n=>n.toImg());B.toSvg=(t,e)=>B(t,e).then(n=>n.toSvg());B.toCanvas=(t,e)=>B(t,e).then(n=>n.toCanvas());B.toBlob=(t,e)=>B(t,e).then(n=>n.toBlob());B.toPng=(t,e)=>B(t,W(E({},e),{format:"png"})).then(n=>n.toPng());B.toJpg=(t,e)=>B(t,W(E({},e),{format:"jpeg"})).then(n=>n.toJpg());B.toWebp=(t,e)=>B(t,W(E({},e),{format:"webp"})).then(n=>n.toWebp());B.download=(t,e)=>B(t,e).then(n=>n.download());function ro(t,e){return v(this,null,function*(){if(ye)return;let n=W(E({},e),{fast:!0,embedFonts:!0,scale:.2}),r;try{r=yield ge(t,n)}catch(s){}yield new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s))),r&&(yield new Promise(s=>{let o=new Image;try{o.decoding="sync",o.loading="eager"}catch(a){}o.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",o.src=r,document.body.appendChild(o),v(null,null,function*(){try{typeof o.decode=="function"&&(yield o.decode())}catch(u){}let a=performance.now();for(;!(o.complete&&o.naturalWidth>0)&&performance.now()-a<900;)yield new Promise(u=>setTimeout(u,50));yield new Promise(u=>requestAnimationFrame(u));try{o.remove()}catch(u){}s()})})),t.querySelectorAll("canvas").forEach(s=>{try{let o=s.getContext("2d",{willReadFrequently:!0});o&&o.getImageData(0,0,1,1)}catch(o){}}),ye=!0})}function oo(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,r=getComputedStyle(n),s=r.backgroundImage&&r.backgroundImage!=="none",o=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(s||o||n.tagName==="CANVAS")return!0}return!1}function fn(){return v(this,arguments,function*(t=document,e={}){var c,l,p,f,h,m;let{embedFonts:n=!0,useProxy:r=""}=e,s=(l=(c=e.cache)!=null?c:e.cacheOpt)!=null?l:"full";Pt(s);try{yield(p=document.fonts)==null?void 0:p.ready}catch(g){}try{Zt()}catch(g){}S.session=S.session||{},S.session.styleCache||(S.session.styleCache=new WeakMap),S.image=S.image||new Map,S.background=S.background||new Map;try{yield Vt(t,void 0,S.session.styleCache,{useProxy:r})}catch(g){}let o=[],a=[];try{if(t&&t.nodeType===1){let g=t.querySelectorAll?Array.from(t.querySelectorAll("*")):[];a=[t,...g],o=[],t.tagName==="IMG"&&t.getAttribute("src")&&o.push(t),o.push(...Array.from(((f=t.querySelectorAll)==null?void 0:f.call(t,"img[src]"))||[]))}else t!=null&&t.querySelectorAll&&(o=Array.from(t.querySelectorAll("img[src]")),a=Array.from(t.querySelectorAll("*")))}catch(g){}let u=[];for(let g of o){let i=(g==null?void 0:g.currentSrc)||(g==null?void 0:g.src);if(i&&!S.image.has(i)){let d=Promise.resolve().then(()=>v(null,null,function*(){let y=yield X(i,{as:"dataURL",useProxy:r});y!=null&&y.ok&&typeof y.data=="string"&&S.image.set(i,y.data)})).catch(()=>{});u.push(d)}}for(let g of a){let i="";try{i=((h=g==null?void 0:g.style)==null?void 0:h.backgroundImage)||"",(!i||i==="none")&&(i=gt(g).backgroundImage)}catch(d){}if(i&&i!=="none"){let d=i.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let y of d){let b=Promise.resolve().then(()=>pt(y,W(E({},e),{useProxy:r}))).catch(()=>{});u.push(b)}}}if(n)try{let g=Ht(t),i=qt(t);if(typeof Y=="function"?Y():!!Y){let y=new Set(Array.from(g).map(b=>String(b).split("__")[0]).filter(Boolean));yield jt(y,3)}yield Dt({required:g,usedCodepoints:i,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:(m=e.useProxy)!=null?m:r})}catch(g){}yield Promise.allSettled(u)})}typeof window!="undefined"&&(window.snapdom=B,window.preCache=fn);})();
8
+ `):p+=m[0]}return p+=u.slice(f),p})}let a=Ne(t,e||location.href);return a=yield o(a,e||location.href,0),a})}var _e=/url\((["']?)([^"')]+)\1\)/g,xr=/@font-face[^{}]*\{[^}]*\}/g;function We(t){if(!t)return[];let e=[],n=t.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let s=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!s)continue;let o=s[1],a=s[2],u=l=>{if(!l.includes("?"))return parseInt(l,16);let c=parseInt(l.replace(/\?/g,"0"),16),p=parseInt(l.replace(/\?/g,"F"),16);return[c,p]};if(a){let l=u(o),c=u(a),p=Array.isArray(l)?l[0]:l,f=Array.isArray(c)?c[1]:c;e.push([Math.min(p,f),Math.max(p,f)])}else{let l=u(o);Array.isArray(l)?e.push([l[0],l[1]]):e.push([l,l])}}return e}function Ue(t,e){if(!e.length||!t||t.size===0)return!0;for(let n of t)for(let[r,s]of e)if(n>=r&&n<=s)return!0;return!1}function ue(t,e){let n=[];if(!t)return n;for(let r of t.matchAll(_e)){let s=(r[2]||"").trim();if(!(!s||s.startsWith("data:"))){if(!/^https?:/i.test(s))try{s=new URL(s,e||location.href).href}catch(o){}n.push(s)}}return n}function Oe(t,e,n=""){return A(this,null,function*(){var s,o,a,u,l;let r=t;for(let c of t.matchAll(_e)){let p=mt(c[0]);if(!p)continue;let f=p;if(!f.startsWith("http")&&!f.startsWith("data:"))try{f=new URL(f,e||location.href).href}catch(m){}if(!rt(f)){if((s=x.resource)!=null&&s.has(f)){(o=x.font)==null||o.add(f),r=r.replace(c[0],`url(${x.resource.get(f)})`);continue}if(!((a=x.font)!=null&&a.has(f)))try{let m=yield X(f,{as:"dataURL",useProxy:n,silent:!0});if(m.ok&&typeof m.data=="string"){let d=m.data;(u=x.resource)==null||u.set(f,d),(l=x.font)==null||l.add(f),r=r.replace(c[0],`url(${d})`)}}catch(m){console.warn("[snapDOM] Failed to fetch font resource:",f)}}}return r})}function Sr(t){if(!t.length)return null;let e=(u,l)=>t.some(([c,p])=>!(p<u||c>l)),n=e(0,255)||e(305,305),r=e(256,591)||e(7680,7935),s=e(880,1023),o=e(1024,1279);return e(7840,7929)||e(258,259)||e(416,417)||e(431,432)?"vietnamese":o?"cyrillic":s?"greek":r?"latin-ext":n?"latin":null}function Pe(t={}){let e=new Set((t.families||[]).map(s=>String(s).toLowerCase())),n=new Set((t.domains||[]).map(s=>String(s).toLowerCase())),r=new Set((t.subsets||[]).map(s=>String(s).toLowerCase()));return(s,o)=>{if(e.size&&e.has(s.family.toLowerCase()))return!0;if(n.size)for(let a of s.srcUrls)try{if(n.has(new URL(a).host.toLowerCase()))return!0}catch(u){}if(r.size){let a=Sr(o);if(a&&r.has(a))return!0}return!1}}function Cr(t){var o,a,u,l,c,p;if(!t)return t;let e=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let f of t.match(e)||[]){let m=((o=f.match(/font-family:\s*([^;]+);/i))==null?void 0:o[1])||"",d=Bt(m),g=(((a=f.match(/font-weight:\s*([^;]+);/i))==null?void 0:a[1])||"400").trim(),i=(((u=f.match(/font-style:\s*([^;]+);/i))==null?void 0:u[1])||"normal").trim(),h=(((l=f.match(/font-stretch:\s*([^;]+);/i))==null?void 0:l[1])||"100%").trim(),y=(((c=f.match(/unicode-range:\s*([^;]+);/i))==null?void 0:c[1])||"").trim(),b=(((p=f.match(/src\s*:\s*([^;]+);/i))==null?void 0:p[1])||"").trim(),S=ue(b,location.href),v=S.length?S.map(w=>String(w).toLowerCase()).sort().join("|"):b.toLowerCase(),C=[String(d||"").toLowerCase(),g,i,h,y.toLowerCase(),v].join("|");n.has(C)||(n.add(C),r.push(f))}if(r.length===0)return t;let s=0;return t.replace(e,()=>r[s++]||"")}function kr(t,e,n,r){let s=Array.from(t||[]).sort().join("|"),o=e?JSON.stringify({families:(e.families||[]).map(l=>String(l).toLowerCase()).sort(),domains:(e.domains||[]).map(l=>String(l).toLowerCase()).sort(),subsets:(e.subsets||[]).map(l=>String(l).toLowerCase()).sort()}):"",a=(n||[]).map(l=>`${(l.family||"").toLowerCase()}::${l.weight||"normal"}::${l.style||"normal"}::${l.src||""}`).sort().join("|");return`fonts-embed-css::req=${s}::ex=${o}::lf=${a}::px=${r||""}`}function Be(t,e,n,r){return A(this,null,function*(){let s;try{s=t.cssRules||[]}catch(a){return}let o=(a,u)=>{try{return new URL(a,u||location.href).href}catch(l){return a}};for(let a of s){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let u=a.href?o(a.href,e):e;if(r.depth>=Ot){console.warn(`[snapDOM] CSSOM import depth exceeded (${Ot}) at ${u}`);continue}if(u&&r.visitedSheets.has(u)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${u}`);continue}u&&r.visitedSheets.add(u);let l=W(E({},r),{depth:(r.depth||0)+1});yield Be(a.styleSheet,u,n,l);continue}if(a.type===CSSRule.FONT_FACE_RULE){let u=(a.style.getPropertyValue("font-family")||"").trim(),l=Bt(u);if(!l||rt(l))continue;let c=(a.style.getPropertyValue("font-weight")||"400").trim(),p=(a.style.getPropertyValue("font-style")||"normal").trim(),f=(a.style.getPropertyValue("font-stretch")||"100%").trim(),m=(a.style.getPropertyValue("src")||"").trim(),d=(a.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(l,p,c,f))continue;let g=We(d);if(!Ue(r.usedCodepoints,g))continue;let i={family:l,weightSpec:c,styleSpec:p,stretchSpec:f,unicodeRange:d,srcRaw:m,srcUrls:ue(m,e||location.href),href:e||location.href};if(r.simpleExcluder&&r.simpleExcluder(i,g))continue;if(/url\(/i.test(m)){let h=yield Oe(m,e||location.href,r.useProxy);yield n(`@font-face{font-family:${l};src:${h};font-style:${p};font-weight:${c};font-stretch:${f};${d?`unicode-range:${d};`:""}}`)}else yield n(`@font-face{font-family:${l};src:${m};font-style:${p};font-weight:${c};font-stretch:${f};${d?`unicode-range:${d};`:""}}`)}}})}function Dt(){return A(this,arguments,function*({required:t,usedCodepoints:e,exclude:n=void 0,localFonts:r=[],useProxy:s=""}={}){var i,h,y,b,S,v,C,w,F,k,I,L,U,z,j,Q,Z,tt;t instanceof Set||(t=new Set),e instanceof Set||(e=new Set);let o=new Map;for(let $ of t){let[M,P,O,D]=String($).split("__");if(!M)continue;let _=o.get(M)||[];_.push({w:parseInt(P,10),s:O,st:parseInt(D,10)}),o.set(M,_)}function a($,M,P,O){if(!o.has($))return!1;let D=o.get($),_=hr(P),N=pr(M),T=gr(O),q=_.min!==_.max,V=_.min,G=H=>N.kind==="normal"&&H==="normal"||N.kind!=="normal"&&(H==="italic"||H==="oblique"),K=!1;for(let H of D){let J=q?H.w>=_.min&&H.w<=_.max:H.w===V,at=G(ce(H.s)),dt=H.st>=T.min&&H.st<=T.max;if(J&&at&&dt){K=!0;break}}if(K)return!0;if(!q)for(let H of D){let J=G(ce(H.s)),at=H.st>=T.min&&H.st<=T.max;if(Math.abs(V-H.w)<=300&&J&&at)return!0}return!1}let u=Pe(n),l=kr(t,n,r,s);if((i=x.resource)!=null&&i.has(l))return x.resource.get(l);let c=wr(t),p=[],f=le;for(let $ of document.querySelectorAll("style")){let M=$.textContent||"";for(let P of M.matchAll(f)){let O=(P[2]||P[4]||"").trim();if(!O||rt(O))continue;!!document.querySelector(`link[rel="stylesheet"][href="${O}"]`)||p.push(O)}}p.length&&(yield Promise.all(p.map($=>new Promise(M=>{if(document.querySelector(`link[rel="stylesheet"][href="${$}"]`))return M(null);let P=document.createElement("link");P.rel="stylesheet",P.href=$,P.setAttribute("data-snapdom","injected-import"),P.onload=()=>M(P),P.onerror=()=>M(null),document.head.appendChild(P)}))));let m="",d=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter($=>!!$.href);for(let $ of d)try{if(rt($.href))continue;let M="",P=!1;try{P=new URL($.href,location.href).origin===location.origin}catch(D){}if(!P&&!yr($.href,c))continue;if(P){let D=Array.from(document.styleSheets).find(_=>_.href===$.href);if(D)try{let _=D.cssRules||[];M=Array.from(_).map(N=>N.cssText).join("")}catch(_){}}if(!M&&(M=(yield X($.href,{as:"text",useProxy:s})).data,rt($.href)))continue;M=yield br(M,$.href,s);let O="";for(let D of M.match(xr)||[]){let _=(((h=D.match(/font-family:\s*([^;]+);/i))==null?void 0:h[1])||"").trim(),N=Bt(_);if(!N||rt(N))continue;let T=(((y=D.match(/font-weight:\s*([^;]+);/i))==null?void 0:y[1])||"400").trim(),q=(((b=D.match(/font-style:\s*([^;]+);/i))==null?void 0:b[1])||"normal").trim(),V=(((S=D.match(/font-stretch:\s*([^;]+);/i))==null?void 0:S[1])||"100%").trim(),G=(((v=D.match(/unicode-range:\s*([^;]+);/i))==null?void 0:v[1])||"").trim(),K=(((C=D.match(/src\s*:\s*([^;]+);/i))==null?void 0:C[1])||"").trim(),H=ue(K,$.href);if(!a(N,q,T,V))continue;let J=We(G);if(!Ue(e,J))continue;let at={family:N,weightSpec:T,styleSpec:q,stretchSpec:V,unicodeRange:G,srcRaw:K,srcUrls:H,href:$.href};if(n&&u(at,J))continue;let dt=/url\(/i.test(K)?yield Oe(D,$.href,s):D;O+=dt}O.trim()&&(m+=O)}catch(M){console.warn("[snapDOM] Failed to process stylesheet:",$.href)}let g={requiredIndex:o,usedCodepoints:e,faceMatchesRequired:a,simpleExcluder:n?Pe(n):null,useProxy:s,visitedSheets:new Set,depth:0};for(let $ of document.styleSheets)if(!($.href&&d.some(M=>M.href===$.href)))try{let M=$.href||location.href;M&&g.visitedSheets.add(M),yield Be($,M,P=>A(null,null,function*(){m+=P}),g)}catch(M){}try{for(let $ of document.fonts||[]){if(!$||!$.family||$.status!=="loaded"||!$._snapdomSrc)continue;let M=String($.family).replace(/^['"]+|['"]+$/g,"");if(rt(M)||!o.has(M)||n!=null&&n.families&&n.families.some(O=>String(O).toLowerCase()===M.toLowerCase()))continue;let P=$._snapdomSrc;if(!String(P).startsWith("data:")){if((w=x.resource)!=null&&w.has($._snapdomSrc))P=x.resource.get($._snapdomSrc),(F=x.font)==null||F.add($._snapdomSrc);else if(!((k=x.font)!=null&&k.has($._snapdomSrc)))try{let O=yield X($._snapdomSrc,{as:"dataURL",useProxy:s,silent:!0});if(O.ok&&typeof O.data=="string")P=O.data,(I=x.resource)==null||I.set($._snapdomSrc,P),(L=x.font)==null||L.add($._snapdomSrc);else continue}catch(O){console.warn("[snapDOM] Failed to fetch dynamic font src:",$._snapdomSrc);continue}}m+=`@font-face{font-family:'${M}';src:url(${P});font-style:${$.style||"normal"};font-weight:${$.weight||"normal"};}`}}catch($){}for(let $ of r){if(!$||typeof $!="object")continue;let M=String($.family||"").replace(/^['"]+|['"]+$/g,"");if(!M||rt(M)||!o.has(M)||n!=null&&n.families&&n.families.some(T=>String(T).toLowerCase()===M.toLowerCase()))continue;let P=$.weight!=null?String($.weight):"normal",O=$.style!=null?String($.style):"normal",D=$.stretchPct!=null?`${$.stretchPct}%`:"100%",_=String($.src||""),N=_;if(!N.startsWith("data:")){if((U=x.resource)!=null&&U.has(_))N=x.resource.get(_),(z=x.font)==null||z.add(_);else if(!((j=x.font)!=null&&j.has(_)))try{let T=yield X(_,{as:"dataURL",useProxy:s,silent:!0});if(T.ok&&typeof T.data=="string")N=T.data,(Q=x.resource)==null||Q.set(_,N),(Z=x.font)==null||Z.add(_);else continue}catch(T){console.warn("[snapDOM] Failed to fetch localFonts src:",_);continue}}m+=`@font-face{font-family:'${M}';src:url(${N});font-style:${O};font-weight:${P};font-stretch:${D};}`}return m&&(m=Cr(m),(tt=x.resource)==null||tt.set(l,m)),m})}function Ht(t){let e=new Set;if(!t)return e;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null),r=a=>{let u=Bt(a.fontFamily);if(!u)return;let l=(c,p,f)=>`${u}__${Ut(c)}__${ce(p)}__${mr(f)}`;e.add(l(a.fontWeight,a.fontStyle,a.fontStretch))};r(getComputedStyle(t));let s=getComputedStyle(t,"::before");s&&s.content&&s.content!=="none"&&r(s);let o=getComputedStyle(t,"::after");for(o&&o.content&&o.content!=="none"&&r(o);n.nextNode();){let a=n.currentNode,u=getComputedStyle(a);r(u);let l=getComputedStyle(a,"::before");l&&l.content&&l.content!=="none"&&r(l);let c=getComputedStyle(a,"::after");c&&c.content&&c.content!=="none"&&r(c)}return e}function qt(t){let e=new Set,n=s=>{if(s)for(let o of s)e.add(o.codePointAt(0))},r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let s=r.currentNode;if(s.nodeType===Node.TEXT_NODE)n(s.nodeValue||"");else if(s.nodeType===Node.ELEMENT_NODE){let o=s;for(let a of["::before","::after"]){let u=getComputedStyle(o,a),l=u==null?void 0:u.getPropertyValue("content");if(!(!l||l==="none"))if(/^"/.test(l)||/^'/.test(l))n(l.slice(1,-1));else{let c=l.match(/\\[0-9A-Fa-f]{1,6}/g);if(c)for(let p of c)try{e.add(parseInt(p.slice(1),16))}catch(f){}}}}}return e}function jt(t,e=2){return A(this,null,function*(){try{yield document.fonts.ready}catch(s){}let n=Array.from(t||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let s=document.createElement("div");s.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let o of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${o}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",s.appendChild(a)}document.body.appendChild(s),s.offsetWidth,document.body.removeChild(s)};for(let s=0;s<Math.max(1,e);s++)r(),yield new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o)))})}function je(t){return/\bcounter\s*\(|\bcounters\s*\(/.test(t||"")}function Ar(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function De(t,e=!1){let n="",r=Math.max(1,t);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return e?n.toUpperCase():n}function He(t,e=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,t)),s="";for(let[o,a]of n)for(;r>=o;)s+=a,r-=o;return e?s:s.toLowerCase()}function qe(t,e){switch((e||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,t));case"decimal-leading-zero":return(t<10?"0":"")+String(Math.max(0,t));case"lower-alpha":return De(t,!1);case"upper-alpha":return De(t,!0);case"lower-roman":return He(t,!1);case"upper-roman":return He(t,!0);default:return String(Math.max(0,t))}}function Ve(t){let e=()=>{var m,d,g;return(g=(d=(m=x)==null?void 0:m.session)==null?void 0:d.__counterEpoch)!=null?g:0},n=e(),r=new WeakMap,s=t instanceof Document?t.documentElement:t,o=m=>m&&m.tagName==="LI",a=m=>{let d=0,g=m==null?void 0:m.parentElement;if(!g)return 0;for(let i of g.children){if(i===m)break;i.tagName==="LI"&&d++}return d},u=m=>{let d=new Map;for(let[g,i]of m)d.set(g,i.slice());return d},l=(m,d,g)=>{var b,S;let i=u(m),h;try{h=((b=g.style)==null?void 0:b.counterReset)||getComputedStyle(g).counterReset}catch(v){}if(h&&h!=="none")for(let v of h.split(",")){let C=v.trim().split(/\s+/),w=C[0],F=Number.isFinite(Number(C[1]))?Number(C[1]):0;if(!w)continue;let k=d.get(w);if(k&&k.length){let I=k.slice();I.push(F),i.set(w,I)}else i.set(w,[F])}let y;try{y=((S=g.style)==null?void 0:S.counterIncrement)||getComputedStyle(g).counterIncrement}catch(v){}if(y&&y!=="none")for(let v of y.split(",")){let C=v.trim().split(/\s+/),w=C[0],F=Number.isFinite(Number(C[1]))?Number(C[1]):1;if(!w)continue;let k=i.get(w)||[];k.length===0&&k.push(0),k[k.length-1]+=F,i.set(w,k)}try{if(getComputedStyle(g).display==="list-item"&&o(g)){let C=g.parentElement,w=1;if(C&&C.tagName==="OL"){let k=C.getAttribute("start"),I=Number.isFinite(Number(k))?Number(k):1,L=a(g),U=g.getAttribute("value");w=Number.isFinite(Number(U))?Number(U):I+L}else w=1+a(g);let F=i.get("list-item")||[];F.length===0&&F.push(0),F[F.length-1]=w,i.set("list-item",F)}}catch(v){}return i},c=(m,d,g)=>{let i=l(g,d,m);r.set(m,i);let h=i;for(let y of m.children)h=c(y,i,h);return i},p=new Map;c(s,p,p);function f(){let m=e();if(m!==n){n=m;let d=new Map;c(s,d,d)}}return{get(m,d){var i;f();let g=(i=r.get(m))==null?void 0:i.get(d);return g&&g.length?g[g.length-1]:0},getStack(m,d){var i;f();let g=(i=r.get(m))==null?void 0:i.get(d);return g?g.slice():[]}}}function ze(t,e,n){if(!t||t==="none")return t;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,s=t.replace(r,(o,a,u)=>{var c,p,f,m;let l=String(u).split(",").map(d=>d.trim());if(a==="counter"){let d=(c=l[0])==null?void 0:c.replace(/^["']|["']$/g,""),g=(l[1]||"decimal").toLowerCase(),i=n.get(e,d);return qe(i,g)}else{let d=(p=l[0])==null?void 0:p.replace(/^["']|["']$/g,""),g=(m=(f=l[1])==null?void 0:f.replace(/^["']|["']$/g,""))!=null?m:"",i=(l[2]||"decimal").toLowerCase(),h=n.getStack(e,d);return h.length?h.map(b=>qe(b,i)).join(g):""}});return Ar(s)}catch(r){return"- "}}var kt=new WeakMap,Xe=-1;function Mr(t){return(t||"").replace(/"([^"]*)"/g,"$1")}function vr(t){if(!t)return"";let e=[],n=/"([^"]*)"/g,r;for(;r=n.exec(t);)e.push(r[1]);return e.length?e.join(""):Mr(t)}function fe(t,e){let n=t.parentElement,r=n?kt.get(n):null;return r?{get(s,o){let a=e.get(s,o),u=r.get(o);return typeof u=="number"?Math.max(a,u):a},getStack(s,o){let a=e.getStack(s,o);if(!a.length)return a;let u=r.get(o);if(typeof u=="number"){let l=a.slice();return l[l.length-1]=Math.max(l[l.length-1],u),l}return a}}:e}function de(t,e,n){let r=new Map;function s(l){let c=[];if(!l||l==="none")return c;for(let p of String(l).split(",")){let f=p.trim().split(/\s+/),m=f[0],d=Number.isFinite(Number(f[1]))?Number(f[1]):void 0;m&&c.push({name:m,num:d})}return c}let o=s(e==null?void 0:e.counterReset),a=s(e==null?void 0:e.counterIncrement);function u(l){if(r.has(l))return r.get(l).slice();let c=n.getStack(t,l);c=c.length?c.slice():[];let p=o.find(m=>m.name===l);if(p){let m=Number.isFinite(p.num)?p.num:0;c=c.length?[...c,m]:[m]}let f=a.find(m=>m.name===l);if(f){let m=Number.isFinite(f.num)?f.num:1;c.length===0&&(c=[0]),c[c.length-1]+=m}return r.set(l,c.slice()),c}return{get(l,c){let p=u(c);return p.length?p[p.length-1]:0},getStack(l,c){return u(c)},__incs:a}}function $r(t,e,n){let r;try{r=getComputedStyle(t,e)}catch(c){}let s=r==null?void 0:r.content;if(!s||s==="none"||s==="normal")return{text:"",incs:[]};let o=fe(t,n),a=de(t,r,o),u=je(s)?ze(s,t,a):s;return{text:vr(u),incs:a.__incs||[]}}function me(t,e,n,r){return A(this,null,function*(){var l,c,p,f;if(!(t instanceof Element)||!(e instanceof Element))return;let s=(p=(c=(l=x)==null?void 0:l.session)==null?void 0:c.__counterEpoch)!=null?p:0;if(Xe!==s&&(kt=new WeakMap,n&&(n.__counterCtx=null),Xe=s),!n.__counterCtx)try{n.__counterCtx=Ve(t.ownerDocument||document)}catch(m){}let o=n.__counterCtx;for(let m of["::before","::after","::first-letter"])try{let d=gt(t,m);if(!d||typeof d[Symbol.iterator]!="function"||d.content==="none"&&d.backgroundImage==="none"&&d.backgroundColor==="transparent"&&(d.borderStyle==="none"||parseFloat(d.borderWidth)===0)&&(!d.transform||d.transform==="none")&&d.display==="inline")continue;if(m==="::first-letter"){let N=getComputedStyle(t);if(!(d.color!==N.color||d.fontSize!==N.fontSize||d.fontWeight!==N.fontWeight))continue;let q=Array.from(e.childNodes).find(nt=>{var It;return nt.nodeType===Node.TEXT_NODE&&((It=nt.textContent)==null?void 0:It.trim().length)>0});if(!q)continue;let V=q.textContent,G=V.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u),K=G==null?void 0:G[0],H=V.slice((K==null?void 0:K.length)||0);if(!K||/[\uD800-\uDFFF]/.test(K))continue;let J=document.createElement("span");J.textContent=K,J.dataset.snapdomPseudo="::first-letter";let at=Wt(d),dt=Ct(at,"span");n.styleMap.set(J,dt);let et=document.createTextNode(H);e.replaceChild(et,q),e.insertBefore(J,et);continue}let i=d.content,{text:h,incs:y}=$r(t,m,o),b=d.backgroundImage,S=d.backgroundColor,v=d.fontFamily,C=parseInt(d.fontSize)||32,w=parseInt(d.fontWeight)||!1,F=d.color||"#000",k=d.borderStyle,I=parseFloat(d.borderWidth),L=d.transform,U=rt(v),z=i!=="none"&&h!=="",j=b&&b!=="none",Q=S&&S!=="transparent"&&S!=="rgba(0, 0, 0, 0)",Z=k&&k!=="none"&&I>0,tt=L&&L!=="none";if(!(z||j||Q||Z||tt)){if(y&&y.length&&t.parentElement){let N=kt.get(t.parentElement)||new Map;for(let{name:T}of y){if(!T)continue;let q=fe(t,o),G=de(t,getComputedStyle(t,m),q).get(t,T);N.set(T,G)}kt.set(t.parentElement,N)}continue}let M=document.createElement("span");M.dataset.snapdomPseudo=m,M.style.display="inline",M.style.verticalAlign="baseline",M.style.pointerEvents="none";let P=Wt(d),O=Ct(P,"span");if(n.styleMap.set(M,O),U&&h&&h.length===1){let{dataUrl:N,width:T,height:q}=yield Te(h,v,w,C,F),V=document.createElement("img");V.src=N,V.style=`height:${C}px;width:${T/q*C}px;object-fit:contain;`,M.appendChild(V),e.dataset.snapdomHasIcon="true"}else if(h&&h.startsWith("url(")){let N=mt(h);if(N!=null&&N.trim())try{let T=document.createElement("img"),q=yield X(ut(N),{as:"dataURL",useProxy:r.useProxy});T.src=q.data,T.style=`width:${C}px;height:auto;object-fit:contain;`,M.appendChild(T)}catch(T){console.error(`[snapdom] Error in pseudo ${m} for`,t,T)}}else!U&&z&&(M.textContent=h);M.style.backgroundImage="none","maskImage"in M.style&&(M.style.maskImage="none"),"webkitMaskImage"in M.style&&(M.style.webkitMaskImage="none");try{M.style.backgroundRepeat=d.backgroundRepeat,M.style.backgroundSize=d.backgroundSize,d.backgroundPositionX&&d.backgroundPositionY?(M.style.backgroundPositionX=d.backgroundPositionX,M.style.backgroundPositionY=d.backgroundPositionY):M.style.backgroundPosition=d.backgroundPosition,M.style.backgroundOrigin=d.backgroundOrigin,M.style.backgroundClip=d.backgroundClip,M.style.backgroundAttachment=d.backgroundAttachment,M.style.backgroundBlendMode=d.backgroundBlendMode}catch(N){}if(j)try{let N=Mt(b),T=yield Promise.all(N.map(pt));M.style.backgroundImage=T.join(", ")}catch(N){console.warn(`[snapdom] Failed to inline background-image for ${m}`,N)}Q&&(M.style.backgroundColor=S);let _=M.childNodes.length>0||((f=M.textContent)==null?void 0:f.trim())!==""||j||Q||Z||tt;if(y&&y.length&&t.parentElement){let N=kt.get(t.parentElement)||new Map,T=fe(t,o),q=de(t,getComputedStyle(t,m),T);for(let{name:V}of y){if(!V)continue;let G=q.get(t,V);N.set(V,G)}kt.set(t.parentElement,N)}if(!_)continue;m==="::before"?e.insertBefore(M,e.firstChild):e.appendChild(M)}catch(d){console.warn(`[snapdom] Failed to capture ${m} for`,t,d)}let a=Array.from(t.children),u=Array.from(e.children).filter(m=>!m.dataset.snapdomPseudo);for(let m=0;m<Math.min(a.length,u.length);m++)yield me(a[m],u[m],n,r)})}function Ye(t,e){var b,S,v,C;if(!t||!(t instanceof Element))return;let n=t.ownerDocument||document,r=e||n,s=t instanceof SVGSVGElement?[t]:Array.from(t.querySelectorAll("svg"));if(s.length===0)return;let o=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],u=w=>window.CSS&&CSS.escape?CSS.escape(w):w.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),l=new Set(Array.from(t.querySelectorAll("[id]")).map(w=>w.id)),c=new Set,p=!1,f=w=>{if(!w)return;o.lastIndex=0;let F;for(;F=o.exec(w);){p=!0;let k=(F[1]||"").trim();k&&!l.has(k)&&c.add(k)}},m=w=>{let F=w.querySelectorAll('use[href^="#"], use[xlink\\:href^="#"]');for(let L of F){let U=L.getAttribute("href")||L.getAttribute("xlink:href");if(!U||!U.startsWith("#"))continue;p=!0;let z=U.slice(1).trim();z&&!l.has(z)&&c.add(z)}let I=w.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("], *[clip-path^="url("],*[mask^="url("],*[marker^="url("], *[marker-start^="url("],*[marker-mid^="url("], *[marker-end^="url("]');for(let L of I){f(L.getAttribute("style")||"");for(let U of a)f(L.getAttribute(U))}};for(let w of s)m(w);if(!p)return;let d=t.querySelector("svg.inline-defs-container");d||(d=n.createElementNS("http://www.w3.org/2000/svg","svg"),d.classList.add("inline-defs-container"),d.setAttribute("aria-hidden","true"),d.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),t.insertBefore(d,t.firstChild||null));let g=d.querySelector("defs")||null,i=w=>{if(!w||l.has(w))return null;let F=u(w),k=I=>{let L=r.querySelector(I);return L&&!t.contains(L)?L:null};return k(`svg defs > *#${F}`)||k(`svg > symbol#${F}`)||k(`*#${F}`)};if(!c.size)return;let h=new Set(c),y=new Set;for(;h.size;){let w=h.values().next().value;if(h.delete(w),!w||l.has(w)||y.has(w))continue;let F=i(w);if(!F){y.add(w);continue}g||(g=n.createElementNS("http://www.w3.org/2000/svg","defs"),d.appendChild(g));let k=F.cloneNode(!0);k.id||k.setAttribute("id",w),g.appendChild(k),y.add(w),l.add(w);let I=[k,...k.querySelectorAll("*")];for(let L of I){let U=((b=L.getAttribute)==null?void 0:b.call(L,"href"))||((S=L.getAttribute)==null?void 0:S.call(L,"xlink:href"));if(U&&U.startsWith("#")){let j=U.slice(1).trim();j&&!l.has(j)&&!y.has(j)&&h.add(j)}let z=((v=L.getAttribute)==null?void 0:v.call(L,"style"))||"";z&&f(z);for(let j of a){let Q=(C=L.getAttribute)==null?void 0:C.call(L,j);Q&&f(Q)}}}}function Ke(t,e){var u;if(!t||!e)return;let n=t.scrollTop||0;if(!n)return;getComputedStyle(e).position==="static"&&(e.style.position="relative");let r=t.getBoundingClientRect(),s=t.clientHeight,o="data-snap-ph",a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let l=a.currentNode,c=getComputedStyle(l),p=c.position;if(p!=="sticky"&&p!=="-webkit-sticky")continue;let f=Ge(c.top),m=Ge(c.bottom);if(f==null&&m==null)continue;let d=Er(l,t),g=Fr(e,d,o);if(!g)continue;let i=l.getBoundingClientRect(),h=i.width,y=i.height,b=i.left-r.left;if(!(h>0&&y>0)||!Number.isFinite(b))continue;let S=f!=null?f+n:n+(s-y-m);if(!Number.isFinite(S))continue;let v=Number.parseInt(c.zIndex,10),C=Number.isFinite(v),w=C?Math.max(v,1)+1:2,F=C?v-1:0,k=g.cloneNode(!1);k.setAttribute(o,"1"),k.style.position="sticky",k.style.left=`${b}px`,k.style.top=`${S}px`,k.style.width=`${h}px`,k.style.height=`${y}px`,k.style.visibility="hidden",k.style.zIndex=String(F),k.style.overflow="hidden",k.style.background="transparent",k.style.boxShadow="none",k.style.filter="none",(u=g.parentElement)==null||u.insertBefore(k,g),g.style.position="absolute",g.style.left=`${b}px`,g.style.top=`${S}px`,g.style.bottom="auto",g.style.zIndex=String(w),g.style.pointerEvents="none"}}function Ge(t){if(!t||t==="auto")return null;let e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function Er(t,e){let n=[];for(let r=t;r&&r!==e;){let s=r.parentElement;if(!s)break;n.push(Array.prototype.indexOf.call(s.children,r)),r=s}return n.reverse()}function Fr(t,e,n){let r=t;for(let s=0;s<e.length;s++)if(r=Lr(r,n)[e[s]],!r)return null;return r instanceof HTMLElement?r:null}function Lr(t,e){let n=[],r=t.children;for(let s=0;s<r.length;s++){let o=r[s];o.hasAttribute(e)||n.push(o)}return n}function Qe(n){return A(this,arguments,function*(t,e={}){var c,p;let r={styleMap:x.session.styleMap,styleCache:x.session.styleCache,nodeMap:x.session.nodeMap},s,o="",a="";Rr(t);try{Ye(t)}catch(f){console.warn("inlineExternal defs or symbol failed:",f)}try{s=yield $t(t,r,e,t)}catch(f){throw console.warn("deepClone failed:",f),f}try{yield me(t,s,r,e)}catch(f){console.warn("inlinePseudoElements failed:",f)}yield Tr(s);try{let f=s.querySelectorAll("style[data-sd]");for(let m of f)a+=m.textContent||"",m.remove()}catch(f){}let u=re(r.styleMap);o=Array.from(u.entries()).map(([f,m])=>`.${m}{${f}}`).join(""),o=a+o;for(let[f,m]of r.styleMap.entries()){if(f.tagName==="STYLE")continue;if(f.getRootNode&&f.getRootNode()instanceof ShadowRoot){f.setAttribute("style",m.replace(/;/g,"; "));continue}let d=u.get(m);d&&f.classList.add(d);let g=(c=f.style)==null?void 0:c.backgroundImage,i=(p=f.dataset)==null?void 0:p.snapdomHasIcon;g&&g!=="none"&&(f.style.backgroundImage=g),i&&(f.style.verticalAlign="middle",f.style.display="inline")}for(let[f,m]of r.nodeMap.entries()){let d=m.scrollLeft,g=m.scrollTop;if((d||g)&&f instanceof HTMLElement){f.style.overflow="hidden",f.style.scrollbarWidth="none",f.style.msOverflowStyle="none";let h=document.createElement("div");for(h.style.transform=`translate(${-d}px, ${-g}px)`,h.style.willChange="transform",h.style.display="inline-block",h.style.width="100%";f.firstChild;)h.appendChild(f.firstChild);f.appendChild(h)}}let l=s instanceof HTMLElement&&s.firstElementChild instanceof HTMLElement?s.firstElementChild:s;if(Ke(t,l),t===r.nodeMap.get(s)){let f=r.styleCache.get(t)||window.getComputedStyle(t);r.styleCache.set(t,f);let m=Jt(f.transform);s.style.margin="0",s.style.top="auto",s.style.left="auto",s.style.right="auto",s.style.bottom="auto",s.style.animation="none",s.style.transition="none",s.style.willChange="auto",s.style.float="none",s.style.clear="none",s.style.transform=m||""}for(let[f,m]of r.nodeMap.entries())m.tagName==="PRE"&&(f.style.marginTop="0",f.style.marginBlockStart="0");return{clone:s,classCSS:o,styleCache:r.styleCache}})}function Rr(t){let e=getComputedStyle(t),n=e.outlineStyle,r=e.outlineWidth,s=e.borderStyle,o=e.borderWidth,a=n!=="none"&&parseFloat(r)>0,u=s==="none"||parseFloat(o)===0;a&&u&&(t.style.border=`${r} solid transparent`)}var Et=new Map;function Ft(t){return A(this,null,function*(){var n;if((n=x.resource)!=null&&n.has(t))return x.resource.get(t);if(Et.has(t))return Et.get(t);let e=A(null,null,function*(){var s;let r=yield X(t,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);return(s=x.resource)==null||s.set(t,r.data),r.data});Et.set(t,e);try{let r=yield e;return Et.set(t,r),r}catch(r){throw Et.delete(t),r}})}var Ir=/\bblob:[^)"'\s]+/g;function Je(t){return A(this,null,function*(){if(!t||t.indexOf("blob:")===-1)return t;let e=Array.from(new Set(t.match(Ir)||[]));if(e.length===0)return t;let n=t;for(let r of e)try{let s=yield Ft(r);n=n.split(r).join(s)}catch(s){}return n})}function Vt(t){return typeof t=="string"&&t.startsWith("blob:")}function Nr(t){return(t||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function Pr(t){return t.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function Tr(t){return A(this,null,function*(){var a,u;if(!t)return;let e=t.querySelectorAll?t.querySelectorAll("img"):[];for(let l of e)try{let p=l.getAttribute("src")||l.currentSrc||"";if(Vt(p)){let m=yield Ft(p);l.setAttribute("src",m)}let f=l.getAttribute("srcset");if(f&&f.includes("blob:")){let m=Nr(f),d=!1;for(let g of m)if(Vt(g.url))try{g.url=yield Ft(g.url),d=!0}catch(i){}d&&l.setAttribute("srcset",Pr(m))}}catch(c){}let n=t.querySelectorAll?t.querySelectorAll("image"):[];for(let l of n)try{let c="http://www.w3.org/1999/xlink",p=l.getAttribute("href")||((a=l.getAttributeNS)==null?void 0:a.call(l,c,"href"));if(Vt(p)){let f=yield Ft(p);l.setAttribute("href",f),(u=l.removeAttributeNS)==null||u.call(l,c,"href")}}catch(c){}let r=t.querySelectorAll?t.querySelectorAll("[style*='blob:']"):[];for(let l of r)try{let c=l.getAttribute("style");if(c&&c.includes("blob:")){let p=yield Je(c);l.setAttribute("style",p)}}catch(c){}let s=t.querySelectorAll?t.querySelectorAll("style"):[];for(let l of s)try{let c=l.textContent||"";c.includes("blob:")&&(l.textContent=yield Je(c))}catch(c){}let o=["poster"];for(let l of o){let c=t.querySelectorAll?t.querySelectorAll(`[${l}^='blob:']`):[];for(let p of c)try{let f=p.getAttribute(l);Vt(f)&&p.setAttribute(l,yield Ft(f))}catch(f){}}})}function Ze(n){return A(this,arguments,function*(t,e={}){let r=Array.from(t.querySelectorAll("img")),s=o=>A(null,null,function*(){var f,m,d,g;if(!o.getAttribute("src")){let i=o.currentSrc||o.src||"";i&&o.setAttribute("src",i)}o.removeAttribute("srcset"),o.removeAttribute("sizes");let a=o.src||"";if(!a)return;let u=yield X(a,{as:"dataURL",useProxy:e.useProxy});if(u.ok&&typeof u.data=="string"&&u.data.startsWith("data:")){o.src=u.data,o.width||(o.width=o.naturalWidth||100),o.height||(o.height=o.naturalHeight||100);return}let{fallbackURL:l}=e||{};if(l)try{let i=parseInt(((f=o.dataset)==null?void 0:f.snapdomWidth)||"",10)||0,h=parseInt(((m=o.dataset)==null?void 0:m.snapdomHeight)||"",10)||0,y=parseInt(o.getAttribute("width")||"",10)||0,b=parseInt(o.getAttribute("height")||"",10)||0,S=parseFloat(((d=o.style)==null?void 0:d.width)||"")||0,v=parseFloat(((g=o.style)==null?void 0:g.height)||"")||0,C=i||S||y||o.width||void 0,w=h||v||b||o.height||void 0,F=typeof l=="function"?yield l({width:C,height:w,src:a,element:o}):l;if(F){let k=yield X(F,{as:"dataURL",useProxy:e.useProxy});o.src=k.data,!o.width&&C&&(o.width=C),!o.height&&w&&(o.height=w),o.width||(o.width=o.naturalWidth||100),o.height||(o.height=o.naturalHeight||100);return}}catch(i){}let c=o.width||o.naturalWidth||100,p=o.height||o.naturalHeight||100;if(e.placeholders!==!1){let i=document.createElement("div");i.style.cssText=[`width:${c}px`,`height:${p}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${p}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),i.textContent="img",o.replaceWith(i)}else{let i=document.createElement("div");i.style.cssText=`display:inline-block;width:${c}px;height:${p}px;visibility:hidden;`,o.replaceWith(i)}});for(let o=0;o<r.length;o+=4){let a=r.slice(o,o+4).map(s);yield Promise.allSettled(a)}})}function zt(s,o,a){return A(this,arguments,function*(t,e,n,r={}){let u=[[t,e]],l=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],c=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],p=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],f=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;u.length;){let[m,d]=u.shift(),g=n.get(m)||gt(m);n.has(m)||n.set(m,g);let i=(()=>{let b=g.getPropertyValue("border-image"),S=g.getPropertyValue("border-image-source");return b&&b!=="none"||S&&S!=="none"})();for(let b of p){let S=g.getPropertyValue(b);S&&d.style.setProperty(b,S)}for(let b of l){let S=g.getPropertyValue(b);if(!S||S==="none")continue;let v=Mt(S),C=yield Promise.all(v.map(w=>pt(w,r)));C.some(w=>w&&w!=="none"&&!/^url\(undefined/.test(w))&&d.style.setProperty(b,C.join(", "))}for(let b of c){let S=g.getPropertyValue(b);!S||S==="initial"||d.style.setProperty(b,S)}if(i)for(let b of f){let S=g.getPropertyValue(b);!S||S==="initial"||d.style.setProperty(b,S)}let h=Array.from(m.children),y=Array.from(d.children).filter(b=>!(b.dataset&&b.dataset.snapdomPseudo));for(let b=0;b<Math.min(h.length,y.length);b++)u.push([h[b],y[b]])}})}function tn(t){var c;if(!t)return()=>{};let e=_r(t);if(e<=0)return()=>{};if(!Or(t))return()=>{};let n=getComputedStyle(t),r=Math.round(Wr(n)*e+Ur(n)),s=(c=t.textContent)!=null?c:"",o=s;if(t.scrollHeight<=r+.5)return()=>{};let a=0,u=s.length,l=-1;for(;a<=u;){let p=a+u>>1;t.textContent=s.slice(0,p)+"\u2026",t.scrollHeight<=r+.5?(l=p,a=p+1):u=p-1}return t.textContent=(l>=0?s.slice(0,l):"")+"\u2026",()=>{t.textContent=o}}function _r(t){let e=getComputedStyle(t),n=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function Wr(t){let e=(t.lineHeight||"").trim(),n=parseFloat(t.fontSize)||16;return!e||e==="normal"?Math.round(n*1.2):e.endsWith("px")?parseFloat(e):/^\d+(\.\d+)?$/.test(e)?Math.round(parseFloat(e)*n):e.endsWith("%")?Math.round(parseFloat(e)/100*n):Math.round(n*1.2)}function Ur(t){return(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)}function Or(t){return t.childElementCount>0?!1:Array.from(t.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var Lt=[];function en(t){if(!t)return null;if(Array.isArray(t)){let[e,n]=t;return typeof e=="function"?e(n):e}if(typeof t=="object"&&"plugin"in t){let{plugin:e,options:n}=t;return typeof e=="function"?e(n):e}return typeof t=="function"?t():t}function he(...t){let e=t.flat();for(let n of e){let r=en(n);r&&(Lt.some(s=>s&&s.name&&r.name&&s.name===r.name)||Lt.push(r))}}function nn(t){return(t&&Array.isArray(t.plugins)?t.plugins:Lt)||Lt}function ot(t,e,n){return A(this,null,function*(){let r=n,s=nn(e);for(let o of s){let a=o&&typeof o[t]=="function"?o[t]:null;if(!a)continue;let u=yield a(e,r);typeof u!="undefined"&&(r=u)}return r})}function rn(t,e,n){return A(this,null,function*(){let r=[],s=nn(e);for(let o of s){let a=o&&typeof o[t]=="function"?o[t]:null;if(!a)continue;let u=yield a(e,n);typeof u!="undefined"&&r.push(u)}return r})}function Br(t){let e=[];if(Array.isArray(t))for(let n of t){let r=en(n);if(!r||!r.name)continue;let s=e.findIndex(o=>o&&o.name===r.name);s>=0&&e.splice(s,1),e.push(r)}for(let n of Lt)n&&n.name&&!e.some(r=>r.name===n.name)&&e.push(n);return Object.freeze(e)}function on(t,e,n=!1){return!t||t.plugins&&!n||(t.plugins=Br(e)),t}function Dr(t,e){if(!t||!e||!e.style)return;let n=getComputedStyle(t);try{e.style.boxShadow="none"}catch(o){}try{e.style.textShadow="none"}catch(o){}try{e.style.outline="none"}catch(o){}let s=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{e.style.filter=s.length?s:"none"}catch(o){}}function ge(t,e){return A(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");Pt(e.cache);let n=e.fast,r=e.outerTransforms!==!1,s=!!e.outerShadows,o={element:t,options:e,plugins:e.plugins},a,u,l,c="",p="",f,m,d=null;yield ot("beforeSnap",o),yield ot("beforeClone",o);let g=tn(o.element);try{({clone:a,classCSS:u,styleCache:l}=yield Qe(o.element,o.options)),!r&&a&&(d=qr(o.element,a)),!s&&a&&Dr(o.element,a)}finally{g()}o=E({clone:a,classCSS:u,styleCache:l},o),yield ot("afterClone",o);try{yield Ie(o.clone,o.element)}catch(b){}yield new Promise(b=>{it(()=>A(null,null,function*(){yield Ze(o.clone,o.options),b()}),{fast:n})}),yield new Promise(b=>{it(()=>A(null,null,function*(){yield zt(o.element,o.clone,o.styleCache,o.options),b()}),{fast:n})}),e.embedFonts&&(yield new Promise(b=>{it(()=>A(null,null,function*(){let S=Ht(o.element),v=qt(o.element);if(Y()){let C=new Set(Array.from(S).map(w=>String(w).split("__")[0]).filter(Boolean));yield jt(C,1)}c=yield Dt({required:S,usedCodepoints:v,preCached:!1,exclude:o.options.excludeFonts,useProxy:o.options.useProxy}),b()}),{fast:n})}));let i=ee(o.clone).sort(),h=i.join(",");x.baseStyle.has(h)?p=x.baseStyle.get(h):yield new Promise(b=>{it(()=>{p=ne(i),x.baseStyle.set(h,p),b()},{fast:n})}),o=E({fontsCSS:c,baseCSS:p},o),yield ot("beforeRender",o),yield new Promise(b=>{it(()=>{let S=getComputedStyle(o.element),v=o.element.getBoundingClientRect(),C=Math.max(1,R(o.element.offsetWidth||parseFloat(S.width)||v.width||1)),w=Math.max(1,R(o.element.offsetHeight||parseFloat(S.height)||v.height||1)),F=(bt,lt=NaN)=>{let xt=typeof bt=="string"?parseFloat(bt):bt;return Number.isFinite(xt)?xt:lt},k=F(o.options.width),I=F(o.options.height),L=C,U=w,z=Number.isFinite(k),j=Number.isFinite(I),Q=w>0?C/w:1;z&&j?(L=Math.max(1,R(k)),U=Math.max(1,R(I))):z?(L=Math.max(1,R(k)),U=Math.max(1,R(L/(Q||1)))):j?(U=Math.max(1,R(I)),L=Math.max(1,R(U*(Q||1)))):(L=C,U=w);let Z=0,tt=0,$=C,M=w;if(!r&&d&&Number.isFinite(d.a)){let bt={a:d.a,b:d.b||0,c:d.c||0,d:d.d||1,e:0,f:0},lt=sn(C,w,bt,0,0);Z=R(lt.minX),tt=R(lt.minY),$=R(lt.maxX),M=R(lt.maxY)}else if(r&&Xr(o.element)){let lt=S.transform&&S.transform!=="none"?S.transform:"",xt=Yr(o.element),Gt=Qr({baseTransform:lt,rotate:xt.rotate||"0deg",scale:xt.scale,translate:xt.translate}),{ox:yn,oy:wn}=Kr(S,C,w),bn=Gt.is2D?Gt:new DOMMatrix(Gt.toString()),Nt=sn(C,w,bn,yn,wn);Z=R(Nt.minX),tt=R(Nt.minY),$=R(Nt.maxX),M=R(Nt.maxY)}let P=jr(S),O=Vr(S),D=zr(S),_=Hr(S),N=s?{top:R(P.top+O.top+D.top+_.bleed.top),right:R(P.right+O.right+D.right+_.bleed.right),bottom:R(P.bottom+O.bottom+D.bottom+_.bleed.bottom),left:R(P.left+O.left+D.left+_.bleed.left)}:{top:0,right:0,bottom:0,left:0};Z=R(Z-N.left),tt=R(tt-N.top),$=R($+N.right),M=R(M+N.bottom);let T=Math.max(1,R($-Z)),q=Math.max(1,R(M-tt)),V=z||j?R(L/C):1,G=j||z?R(U/w):1,K=Math.max(1,R(T*V)),H=Math.max(1,R(q*G)),J="http://www.w3.org/2000/svg",at=Y()?1:0,et=R(at+(r?0:1)),nt=document.createElementNS(J,"foreignObject"),It=R(Z),mn=R(tt);nt.setAttribute("x",String(R(-(It-et)))),nt.setAttribute("y",String(R(-(mn-et)))),nt.setAttribute("width",String(R(C+et*2))),nt.setAttribute("height",String(R(w+et*2))),nt.style.overflow="visible";let we=document.createElement("style");we.textContent=o.baseCSS+o.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+o.classCSS,nt.appendChild(we);let wt=document.createElement("div");wt.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),wt.style.width=`${R(C)}px`,wt.style.height=`${R(w)}px`,wt.style.overflow="visible",o.clone.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),wt.appendChild(o.clone),nt.appendChild(wt);let hn=new XMLSerializer().serializeToString(nt),Xt=R(T+et*2),Yt=R(q+et*2),be=z||j;e.meta={w0:C,h0:w,vbW:Xt,vbH:Yt,targetW:L,targetH:U};let pn=Y()&&be?Xt:R(K+et*2),gn=Y()&&be?Yt:R(H+et*2);m=`<svg xmlns="${J}" width="${pn}" height="${gn}" viewBox="0 0 ${Xt} ${Yt}">`+hn+"</svg>",f=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,o=E({svgString:m,dataURL:f},o),b()},{fast:n})}),yield ot("afterRender",o);let y=document.getElementById("snapdom-sandbox");return y&&y.style.position==="absolute"&&y.remove(),o.dataURL})}var R=(t,e=3)=>Number.isFinite(t)?Math.round(t*Kt(10,e))/Kt(10,e):t;function Hr(t){var l;let e=`${t.filter||""} ${t.webkitFilter||""}`.trim();if(!e||e==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=e.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,s=0,o=0,a=0,u=!1;for(let c of n){u=!0;let p=((l=c.match(/-?\d+(?:\.\d+)?px/gi))==null?void 0:l.map(h=>parseFloat(h)))||[],[f=0,m=0,d=0]=p,g=Math.abs(f)+d,i=Math.abs(m)+d;s=Math.max(s,g+Math.max(f,0)),a=Math.max(a,g+Math.max(-f,0)),o=Math.max(o,i+Math.max(m,0)),r=Math.max(r,i+Math.max(-m,0))}return{bleed:{top:R(r),right:R(s),bottom:R(o),left:R(a)},has:u}}function qr(t,e){if(!t||!e||!e.style)return null;let n=getComputedStyle(t);try{e.style.transformOrigin="0 0"}catch(o){}try{"translate"in e.style&&(e.style.translate="none"),"rotate"in e.style&&(e.style.rotate="none")}catch(o){}let r=n.transform||"none";if(!r||r==="none")try{let o=an(t);if(o.a===1&&o.b===0&&o.c===0&&o.d===1)return e.style.transform="none",{a:1,b:0,c:0,d:1}}catch(o){}let s=r.match(/^matrix\(\s*([^)]+)\)$/i);if(s){let o=s[1].split(",").map(a=>parseFloat(a.trim()));if(o.length===6&&o.every(Number.isFinite)){let[a,u,l,c]=o,p=Math.sqrt(a*a+u*u)||0,f=0,m=0,d=0,g=0,i=0,h=0;p>0&&(f=a/p,m=u/p,d=f*l+m*c,g=l-f*d,i=c-m*d,h=Math.sqrt(g*g+i*i)||0,h>0?d=d/h:d=0);let y=p,b=0,S=d*h,v=h;try{e.style.transform=`matrix(${y}, ${b}, ${S}, ${v}, 0, 0)`}catch(C){}return{a:y,b,c:S,d:v}}}try{let o=String(r).trim();return e.style.transform=o+" translate(0px, 0px) rotate(0deg)",null}catch(o){return null}}function jr(t){var u;let e=t.boxShadow||"";if(!e||e==="none")return{top:0,right:0,bottom:0,left:0};let n=e.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(l=>l.trim()),r=0,s=0,o=0,a=0;for(let l of n){let c=((u=l.match(/-?\d+(\.\d+)?px/g))==null?void 0:u.map(h=>parseFloat(h)))||[];if(c.length<2)continue;let[p,f,m=0,d=0]=c,g=Math.abs(p)+m+d,i=Math.abs(f)+m+d;s=Math.max(s,g+Math.max(p,0)),a=Math.max(a,g+Math.max(-p,0)),o=Math.max(o,i+Math.max(f,0)),r=Math.max(r,i+Math.max(-f,0))}return{top:Math.ceil(r),right:Math.ceil(s),bottom:Math.ceil(o),left:Math.ceil(a)}}function Vr(t){let e=(t.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=e?Math.ceil(parseFloat(e[1])||0):0;return{top:n,right:n,bottom:n,left:n}}function zr(t){if((t.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let e=Math.ceil(parseFloat(t.outlineWidth||"0")||0);return{top:e,right:e,bottom:e,left:e}}function sn(t,e,n,r,s){let o=n.a,a=n.b,u=n.c,l=n.d,c=n.e||0,p=n.f||0;function f(y,b){let S=y-r,v=b-s,C=o*S+u*v,w=a*S+l*v;return C+=r+c,w+=s+p,[C,w]}let m=[f(0,0),f(t,0),f(0,e),f(t,e)],d=1/0,g=1/0,i=-1/0,h=-1/0;for(let[y,b]of m)y<d&&(d=y),b<g&&(g=b),y>i&&(i=y),b>h&&(h=b);return{minX:d,minY:g,maxX:i,maxY:h,width:i-d,height:h-g}}function Xr(t){return Gr(t)}function an(t){let e=getComputedStyle(t).transform;if(!e||e==="none")return new DOMMatrix;try{return new DOMMatrix(e)}catch(n){return new WebKitCSSMatrix(e)}}function Yr(t){var s,o,a,u,l,c,p,f;let e={rotate:"0deg",scale:null,translate:null},n=typeof t.computedStyleMap=="function"?t.computedStyleMap():null;if(n){let m=h=>{try{return typeof n.has=="function"&&!n.has(h)||typeof n.get!="function"?null:n.get(h)}catch(y){return null}},d=m("rotate");if(d)if(d.angle){let h=d.angle;e.rotate=h.unit==="rad"?h.value*180/Math.PI+"deg":h.value+h.unit}else d.unit?e.rotate=d.unit==="rad"?d.value*180/Math.PI+"deg":d.value+d.unit:e.rotate=String(d);else{let h=getComputedStyle(t);e.rotate=h.rotate&&h.rotate!=="none"?h.rotate:"0deg"}let g=m("scale");if(g){let h="x"in g&&((s=g.x)==null?void 0:s.value)!=null?g.x.value:Array.isArray(g)?(o=g[0])==null?void 0:o.value:Number(g)||1,y="y"in g&&((a=g.y)==null?void 0:a.value)!=null?g.y.value:Array.isArray(g)?(u=g[1])==null?void 0:u.value:h;e.scale=`${h} ${y}`}else{let h=getComputedStyle(t);e.scale=h.scale&&h.scale!=="none"?h.scale:null}let i=m("translate");if(i){let h="x"in i&&"value"in i.x?i.x.value:Array.isArray(i)?(l=i[0])==null?void 0:l.value:0,y="y"in i&&"value"in i.y?i.y.value:Array.isArray(i)?(c=i[1])==null?void 0:c.value:0,b="x"in i&&((p=i.x)!=null&&p.unit)?i.x.unit:"px",S="y"in i&&((f=i.y)!=null&&f.unit)?i.y.unit:"px";e.translate=`${h}${b} ${y}${S}`}else{let h=getComputedStyle(t);e.translate=h.translate&&h.translate!=="none"?h.translate:null}return e}let r=getComputedStyle(t);return e.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",e.scale=r.scale&&r.scale!=="none"?r.scale:null,e.translate=r.translate&&r.translate!=="none"?r.translate:null,e}function Gr(t){let e=getComputedStyle(t),n=e.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let s=e.rotate&&e.rotate!=="none"&&e.rotate!=="0deg",o=e.scale&&e.scale!=="none"&&e.scale!=="1",a=e.translate&&e.translate!=="none"&&e.translate!=="0px 0px";return!!(s||o||a)}function Kr(t,e,n){let r=(t.transformOrigin||"0 0").trim().split(/\s+/),[s,o]=[r[0]||"0",r[1]||"0"],a=(u,l)=>{let c=u.toLowerCase();return c==="left"||c==="top"?0:c==="center"?l/2:c==="right"||c==="bottom"?l:c.endsWith("px")?parseFloat(c)||0:c.endsWith("%")?(parseFloat(c)||0)*l/100:/^-?\d+(\.\d+)?$/.test(c)&&parseFloat(c)||0};return{ox:a(s,e),oy:a(o,n)}}var pe=null;function Jr(){if(pe)return pe;let t=document.createElement("div");return t.id="snapdom-measure-slot",t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(t),pe=t,t}function Qr(t){let e=Jr(),n=document.createElement("div");n.style.transformOrigin="0 0",t.baseTransform&&(n.style.transform=t.baseTransform),t.rotate&&(n.style.rotate=t.rotate),t.scale&&(n.style.scale=t.scale),t.translate&&(n.style.translate=t.translate),e.appendChild(n);let r=an(n);return e.removeChild(n),r}function Zr(t){if(typeof t=="string"){let e=t.toLowerCase().trim();if(e==="disabled"||e==="full"||e==="auto"||e==="soft")return e}return"soft"}function cn(t={}){var r,s,o,a,u,l,c,p,f,m,d,g,i,h,y,b,S,v,C,w;let e=(r=t.format)!=null?r:"png";e==="jpg"&&(e="jpeg");let n=Zr(t.cache);return{debug:(s=t.debug)!=null?s:!1,fast:(o=t.fast)!=null?o:!0,scale:(a=t.scale)!=null?a:1,exclude:(u=t.exclude)!=null?u:[],excludeMode:(l=t.excludeMode)!=null?l:"hide",filter:(c=t.filter)!=null?c:null,filterMode:(p=t.filterMode)!=null?p:"hide",placeholders:t.placeholders!==!1,embedFonts:(f=t.embedFonts)!=null?f:!1,iconFonts:Array.isArray(t.iconFonts)?t.iconFonts:t.iconFonts?[t.iconFonts]:[],localFonts:Array.isArray(t.localFonts)?t.localFonts:[],excludeFonts:(m=t.excludeFonts)!=null?m:void 0,fallbackURL:(d=t.fallbackURL)!=null?d:void 0,cache:n,useProxy:typeof t.useProxy=="string"?t.useProxy:"",width:(g=t.width)!=null?g:null,height:(i=t.height)!=null?i:null,format:e,type:(h=t.type)!=null?h:"svg",quality:(y=t.quality)!=null?y:.92,dpr:(b=t.dpr)!=null?b:window.devicePixelRatio||1,backgroundColor:(S=t.backgroundColor)!=null?S:["jpeg","webp"].includes(e)?"#ffffff":null,filename:(v=t.filename)!=null?v:"snapDOM",outerTransforms:(C=t.outerTransforms)!=null?C:!0,outerShadows:(w=t.outerShadows)!=null?w:!1}}function to(t){return typeof t=="string"&&/^data:image\/svg\+xml/i.test(t)}function eo(t){let e=t.indexOf(",");return e>=0?decodeURIComponent(t.slice(e+1)):""}function no(t){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function ro(t){let e=[],n="",r=0;for(let s=0;s<t.length;s++){let o=t[s];o==="("&&r++,o===")"&&(r=Math.max(0,r-1)),o===";"&&r===0?(e.push(n),n=""):n+=o}return n.trim()&&e.push(n),e.map(s=>s.trim()).filter(Boolean)}function oo(t){let e=[],n="",r=0;for(let o=0;o<t.length;o++){let a=t[o];a==="("&&r++,a===")"&&(r=Math.max(0,r-1)),a===","&&r===0?(e.push(n.trim()),n=""):n+=a}n.trim()&&e.push(n.trim());let s=[];for(let o of e){if(/\binset\b/i.test(o))continue;let a=o.match(/-?\d+(?:\.\d+)?px/gi)||[],[u="0px",l="0px",c="0px"]=a,p=o.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),f=!!p&&p!==",";s.push(`drop-shadow(${u} ${l} ${c}${f?` ${p}`:""})`)}return s.join(" ")}function ln(t){let e=ro(t),n=null,r=null,s=null,o=[];for(let u of e){let l=u.indexOf(":");if(l<0)continue;let c=u.slice(0,l).trim().toLowerCase(),p=u.slice(l+1).trim();c==="box-shadow"?s=p:c==="filter"?n=p:c==="-webkit-filter"?r=p:o.push([c,p])}if(s){let u=oo(s);u&&(n=n?`${n} ${u}`:u,r=r?`${r} ${u}`:u)}let a=[...o];return n&&a.push(["filter",n]),r&&a.push(["-webkit-filter",r]),a.map(([u,l])=>`${u}:${l}`).join(";")}function so(t){return t.replace(/([^{}]+)\{([^}]*)\}/g,(e,n,r)=>`${n}{${ln(r)}}`)}function ao(t){return t=t.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,n)=>e.replace(n,so(n))),t=t.replace(/style=(['"])([\s\S]*?)\1/gi,(e,n,r)=>`style=${n}${ln(r)}${n}`),t}function io(t){if(!Y()||!to(t))return t;try{let e=eo(t),n=ao(e);return no(n)}catch(e){return t}}function ct(t,e){return A(this,null,function*(){let{width:n,height:r,scale:s=1,dpr:o=1,meta:a={}}=e;t=io(t);let u=new Image;u.loading="eager",u.decoding="sync",u.crossOrigin="anonymous",u.src=t,yield u.decode();let l=u.naturalWidth,c=u.naturalHeight,p=Number.isFinite(a.w0)?a.w0:l,f=Number.isFinite(a.h0)?a.h0:c,m,d,g=Number.isFinite(n),i=Number.isFinite(r);if(g&&i)m=Math.max(1,n),d=Math.max(1,r);else if(g){let b=n/Math.max(1,p);m=n,d=f*b}else if(i){let b=r/Math.max(1,f);d=r,m=p*b}else m=l,d=c;m=m*s,d=d*s;let h=document.createElement("canvas");h.width=m*o,h.height=d*o,h.style.width=`${m}px`,h.style.height=`${d}px`;let y=h.getContext("2d");return o!==1&&y.scale(o,o),y.drawImage(u,0,0,m,d),h})}function st(t,e){return A(this,null,function*(){let n=yield ct(t,e),r=e.backgroundColor?ht(n,e.backgroundColor):n,s=new Image;return s.src=r.toDataURL(`image/${e.format}`,e.quality),yield s.decode(),s.style.width=`${r.width/e.dpr}px`,s.style.height=`${r.height/e.dpr}px`,s})}function At(t,e){return A(this,null,function*(){let{scale:n=1,width:r,height:s,meta:o={}}=e,a=Number.isFinite(r),u=Number.isFinite(s),l=Number.isFinite(n)&&n!==1||a||u;if(Y()&&l)return yield st(t,W(E({},e),{format:"png",quality:1,meta:o}));let c=new Image;if(c.decoding="sync",c.loading="eager",c.src=t,yield c.decode(),a&&u)c.style.width=`${r}px`,c.style.height=`${s}px`;else if(a){let p=Number.isFinite(o.w0)?o.w0:c.naturalWidth,f=Number.isFinite(o.h0)?o.h0:c.naturalHeight,m=r/Math.max(1,p);c.style.width=`${r}px`,c.style.height=`${Math.round(f*m)}px`}else if(u){let p=Number.isFinite(o.w0)?o.w0:c.naturalWidth,f=Number.isFinite(o.h0)?o.h0:c.naturalHeight,m=s/Math.max(1,f);c.style.height=`${s}px`,c.style.width=`${Math.round(p*m)}px`}else{let p=Math.round(c.naturalWidth*n),f=Math.round(c.naturalHeight*n);if(c.style.width=`${p}px`,c.style.height=`${f}px`,typeof t=="string"&&t.startsWith("data:image/svg+xml"))try{let d=decodeURIComponent(t.split(",")[1]).replace(/width="[^"]*"/,`width="${p}"`).replace(/height="[^"]*"/,`height="${f}"`);t=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,c.src=t}catch(m){}}return c})}function Rt(t,e){return A(this,null,function*(){let n=e.type;if(n==="svg"){let o=decodeURIComponent(t.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let r=yield ct(t,e),s=e.backgroundColor?ht(r,e.backgroundColor):r;return new Promise(o=>s.toBlob(a=>o(a),`image/${n}`,e.quality))})}function un(t,e){return A(this,null,function*(){if(e.dpr=1,e.format==="svg"){let o=yield Rt(t,W(E({},e),{type:"svg"})),a=URL.createObjectURL(o),u=document.createElement("a");u.href=a,u.download=e.filename,u.click(),URL.revokeObjectURL(a);return}let n=yield ct(t,e),r=e.backgroundColor?ht(n,e.backgroundColor):n,s=document.createElement("a");s.href=r.toDataURL(`image/${e.format}`,e.quality),s.download=e.filename,s.click()})}B.plugins=(...t)=>(he(...t),B);var fn=Symbol("snapdom.internal"),ft=Symbol("snapdom.internal.silent"),ye=!1;function B(t,e){return A(this,null,function*(){if(!t)throw new Error("Element cannot be null or undefined");let n=cn(e);if(on(n,e&&e.plugins),Y()&&(n.embedFonts===!0||lo(t)))for(let r=0;r<3;r++)try{yield co(t,e),console.log("safariWarmup:",r),ye=!1}catch(s){}return n.iconFonts&&n.iconFonts.length>0&&Re(n.iconFonts),n.snap||(n.snap={toPng:(r,s)=>B.toPng(r,s),toSvg:(r,s)=>B.toSvg(r,s)}),B.capture(t,n,fn)})}B.plugins=(...t)=>(he(...t),B);B.capture=(t,e,n)=>A(null,null,function*(){if(n!==fn)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=yield ge(t,e),s={img:(i,h)=>A(null,null,function*(){return At(r,E(E({},i),h||{}))}),svg:(i,h)=>A(null,null,function*(){return At(r,E(E({},i),h||{}))}),canvas:(i,h)=>A(null,null,function*(){return ct(r,E(E({},i),h||{}))}),blob:(i,h)=>A(null,null,function*(){return Rt(r,E(E({},i),h||{}))}),png:(i,h)=>A(null,null,function*(){return st(r,W(E(E({},i),h||{}),{format:"png"}))}),jpeg:(i,h)=>A(null,null,function*(){return st(r,W(E(E({},i),h||{}),{format:"jpeg"}))}),webp:(i,h)=>A(null,null,function*(){return st(r,W(E(E({},i),h||{}),{format:"webp"}))}),download:(i,h)=>A(null,null,function*(){return un(r,E(E({},i),h||{}))})},o={svg:i=>At(r,W(E(E({},e),i||{}),{[ft]:!0})),canvas:i=>ct(r,W(E(E({},e),i||{}),{[ft]:!0})),png:i=>st(r,W(E(E({},e),i||{}),{format:"png",[ft]:!0})),jpeg:i=>st(r,W(E(E({},e),i||{}),{format:"jpeg",[ft]:!0})),jpg:i=>st(r,W(E(E({},e),i||{}),{format:"jpeg",[ft]:!0})),webp:i=>st(r,W(E(E({},e),i||{}),{format:"webp",[ft]:!0})),blob:i=>Rt(r,W(E(E({},e),i||{}),{[ft]:!0})),img:i=>At(r,W(E(E({},e),i||{}),{[ft]:!0}))},a=W(E({},e),{export:{url:r},exports:o}),u=yield rn("defineExports",a),l=Object.assign({},...u.filter(i=>i&&typeof i=="object")),c=E(E({},s),l);c.jpeg&&!c.jpg&&(c.jpg=(i,h)=>c.jpeg(i,h));function p(i,h){let y=E(E({},e),h||{});return(i==="jpeg"||i==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let f=!1,m=Promise.resolve();function d(i,h){return A(this,null,function*(){let y=()=>A(null,null,function*(){let b=c[i];if(!b)throw new Error(`[snapdom] Unknown export type: ${i}`);let S=p(i,h),v=W(E({},e),{export:{type:i,options:S,url:r}});yield ot("beforeExport",v);let C=yield b(v,S);return yield ot("afterExport",v,C),f||(f=!0,yield ot("afterSnap",e)),C});return m=m.then(y)})}let g={url:r,toRaw:()=>r,to:(i,h)=>d(i,h),toImg:i=>d("img",i),toSvg:i=>d("svg",i),toCanvas:i=>d("canvas",i),toBlob:i=>d("blob",i),toPng:i=>d("png",i),toJpg:i=>d("jpg",i),toWebp:i=>d("webp",i),download:i=>d("download",i)};for(let i of Object.keys(c)){let h="to"+i.charAt(0).toUpperCase()+i.slice(1);g[h]||(g[h]=y=>d(i,y))}return g});B.toRaw=(t,e)=>B(t,e).then(n=>n.toRaw());B.toImg=(t,e)=>B(t,e).then(n=>n.toImg());B.toSvg=(t,e)=>B(t,e).then(n=>n.toSvg());B.toCanvas=(t,e)=>B(t,e).then(n=>n.toCanvas());B.toBlob=(t,e)=>B(t,e).then(n=>n.toBlob());B.toPng=(t,e)=>B(t,W(E({},e),{format:"png"})).then(n=>n.toPng());B.toJpg=(t,e)=>B(t,W(E({},e),{format:"jpeg"})).then(n=>n.toJpg());B.toWebp=(t,e)=>B(t,W(E({},e),{format:"webp"})).then(n=>n.toWebp());B.download=(t,e)=>B(t,e).then(n=>n.download());function co(t,e){return A(this,null,function*(){if(ye)return;let n=W(E({},e),{fast:!0,embedFonts:!0,scale:.2}),r;try{r=yield ge(t,n)}catch(s){}yield new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s))),r&&(yield new Promise(s=>{let o=new Image;try{o.decoding="sync",o.loading="eager"}catch(a){}o.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",o.src=r,document.body.appendChild(o),A(null,null,function*(){try{typeof o.decode=="function"&&(yield o.decode())}catch(u){}let a=performance.now();for(;!(o.complete&&o.naturalWidth>0)&&performance.now()-a<900;)yield new Promise(u=>setTimeout(u,50));yield new Promise(u=>requestAnimationFrame(u));try{o.remove()}catch(u){}s()})})),t.querySelectorAll("canvas").forEach(s=>{try{let o=s.getContext("2d",{willReadFrequently:!0});o&&o.getImageData(0,0,1,1)}catch(o){}}),ye=!0})}function lo(t){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode();){let n=e.currentNode,r=getComputedStyle(n),s=r.backgroundImage&&r.backgroundImage!=="none",o=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(s||o||n.tagName==="CANVAS")return!0}return!1}function dn(){return A(this,arguments,function*(t=document,e={}){var l,c,p,f,m,d;let{embedFonts:n=!0,useProxy:r=""}=e,s=(c=(l=e.cache)!=null?l:e.cacheOpt)!=null?c:"full";Pt(s);try{yield(p=document.fonts)==null?void 0:p.ready}catch(g){}try{Zt()}catch(g){}x.session=x.session||{},x.session.styleCache||(x.session.styleCache=new WeakMap),x.image=x.image||new Map,x.background=x.background||new Map;try{yield zt(t,void 0,x.session.styleCache,{useProxy:r})}catch(g){}let o=[],a=[];try{if(t&&t.nodeType===1){let g=t.querySelectorAll?Array.from(t.querySelectorAll("*")):[];a=[t,...g],o=[],t.tagName==="IMG"&&t.getAttribute("src")&&o.push(t),o.push(...Array.from(((f=t.querySelectorAll)==null?void 0:f.call(t,"img[src]"))||[]))}else t!=null&&t.querySelectorAll&&(o=Array.from(t.querySelectorAll("img[src]")),a=Array.from(t.querySelectorAll("*")))}catch(g){}let u=[];for(let g of o){let i=(g==null?void 0:g.currentSrc)||(g==null?void 0:g.src);if(i&&!x.image.has(i)){let h=Promise.resolve().then(()=>A(null,null,function*(){let y=yield X(i,{as:"dataURL",useProxy:r});y!=null&&y.ok&&typeof y.data=="string"&&x.image.set(i,y.data)})).catch(()=>{});u.push(h)}}for(let g of a){let i="";try{i=((m=g==null?void 0:g.style)==null?void 0:m.backgroundImage)||"",(!i||i==="none")&&(i=gt(g).backgroundImage)}catch(h){}if(i&&i!=="none"){let h=i.match(/url\((?:[^()"']+|"(?:[^"]*)"|'(?:[^']*)')\)/gi)||[];for(let y of h){let b=Promise.resolve().then(()=>pt(y,W(E({},e),{useProxy:r}))).catch(()=>{});u.push(b)}}}if(n)try{let g=Ht(t),i=qt(t);if(typeof Y=="function"?Y():!!Y){let y=new Set(Array.from(g).map(b=>String(b).split("__")[0]).filter(Boolean));yield jt(y,3)}yield Dt({required:g,usedCodepoints:i,exclude:e.excludeFonts,localFonts:e.localFonts,useProxy:(d=e.useProxy)!=null?d:r})}catch(g){}yield Promise.allSettled(u)})}typeof window!="undefined"&&(window.snapdom=B,window.preCache=dn);})();